/* UPSC syllabus map (#syllabus, syllabus.js), shared by every lab; also the small "Syllabus" link in each lab's header.
   Drawn as a tree: paper (root) → UPSC's printed lines (branches) → our topics (leaves), with CSS connector lines; left to right on wide
   screens, a vertical indented tree on phones. Same green palette as the Timeline and Ripples pages. Coverage is told
   by pattern as well as colour: solid (covered), hatched (partly), hollow and dashed (not yet). */

/* Header link, after "Timeline" (labs.js) */
.syllabus-link{margin-left:8px;padding:6px 12px;border:1px solid #cfd8c6;border-radius:999px;background:#fffdf8;color:#315c49;font-size:12.5px;font-weight:600;line-height:1;text-decoration:none;white-space:nowrap}
.syllabus-link:hover{border-color:#315c49}
.syllabus-link+.tour-replay{margin-left:8px}
@media (max-width:650px){.syllabus-link{margin-left:6px;padding:6px 10px}.syllabus-link+.tour-replay{margin-left:6px}}
/* Three pills and the brand do not fit one row on a phone: the brand takes the first row, the pills the second. */
@media (max-width:560px){header:has(.syllabus-link){height:auto;min-height:70px;flex-wrap:wrap;row-gap:8px;padding-top:10px;padding-bottom:10px}header:has(.syllabus-link) .brand{flex:1 0 100%}}


.sy-head{max-width:860px;margin:0 0 18px}.sy-head h1{margin:12px 0 12px}
.sy-lead{font-size:16px;line-height:1.7;color:#4d5e54;max-width:720px;margin:0}
.sy-section-title{font:700 12px/1.3 ui-sans-serif,system-ui,sans-serif;letter-spacing:2px;color:#315c49;margin:16px 0 8px}
.sy-vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.sy-tag{display:inline-block;margin-right:4px;padding:1px 6px;border-radius:5px;background:#eef3e7;color:#315c49;font-size:10px;font-weight:700;letter-spacing:1px;vertical-align:1px;text-transform:uppercase;font-style:normal}

/* Coverage marks and bars */
.sy-dot{display:inline-block;flex:none;width:11px;height:11px;margin:0 5px 0 0;border-radius:50%;border:2px solid #315c49;box-sizing:border-box;vertical-align:-1px;font-style:normal}
.sy-dot.sy-cov-c{background:#315c49}
.sy-dot.sy-cov-p{border-color:#b07d1f;background:linear-gradient(90deg,#b07d1f 50%,#fff 50%)}
.sy-dot.sy-cov-n{border-color:#8a9585;background:#fff}
.sy-bar{position:relative;display:flex;width:100%;height:8px;border-radius:4px;background:#fff;border:1px solid #c8d3bd;overflow:hidden;box-sizing:border-box}
.sy-seg{display:block;height:100%}
.sy-seg.sy-cov-c{background:#315c49}
.sy-seg.sy-cov-p{background:repeating-linear-gradient(135deg,#c99a3a 0 3px,#f2e3bf 3px 6px)}

/* Paper tabs (they replace the old summary cards) */
.sy-tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;max-width:1166px;margin:0 0 14px}
.sy-tab{position:relative;display:grid;gap:4px;align-content:start;text-align:left;padding:10px 12px 11px;border:1px solid #dce4d5;border-radius:12px;background:#fffdf8;color:#263f36;font-family:inherit;cursor:pointer;min-width:0}
.sy-tab:hover{border-color:#8fae86}
.sy-tab.is-on{border-color:#315c49;box-shadow:0 0 0 2px #315c49 inset;background:#f4f8ef}
.sy-tab-exam{font-size:10px;letter-spacing:1.4px;font-weight:700;color:#75856b}
.sy-tab-name{font-size:18px;line-height:1.15}
.sy-tab-pct{font-size:12.5px;color:#4d5e54}.sy-tab-pct b{font-size:15px;color:#263f36}
.sy-tab-hits{position:absolute;top:8px;right:8px;min-width:22px;height:22px;padding:0 6px;border-radius:11px;background:#b5641a;color:#fff;font-size:12px;font-weight:700;line-height:22px;text-align:center;box-sizing:border-box}
.sy-tab-hits.is-zero{background:#e6e8e0;color:#75856b}

/* Controls */
.sy-controls{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;margin:0 0 6px;max-width:1166px}
.sy-find{flex:1 1 280px;max-width:380px;display:flex}
.sy-find input{flex:1;min-width:0;min-height:40px;padding:6px 12px;border:1px solid #c8d3bd;border-radius:10px;font-family:inherit;font-size:15px;background:#fffdf8;color:#263f36}
.sy-seg{display:flex;flex-wrap:wrap;gap:6px}
.sy-fold{display:flex;gap:6px;margin-left:auto}
.sy-chip{min-height:36px;padding:4px 12px;border-radius:18px;border:1px solid #c8d3bd;background:#fff;color:#2f513f;font-family:inherit;font-weight:600;font-size:13px;line-height:1.2;cursor:pointer}
.sy-chip[aria-pressed="true"]{background:#315c49;border-color:#315c49;color:#fffdf5}
.sy-quiet{min-height:34px;padding:4px 12px;border-radius:17px;background:#fff;border:1px solid #c8d3bd;color:#2f513f;font-family:inherit;font-weight:600;font-size:12.5px;cursor:pointer}
.sy-quiet:hover{border-color:#315c49}
.sy-count{min-height:1.4em;font-size:13.5px;color:#5d6e5f;margin:4px 0 10px}
.sy-chip:focus-visible,.sy-tab:focus-visible,.sy-quiet:focus-visible,.syt-bnode:focus-visible,.syt-leaf:focus-visible,.syp a:focus-visible,.syp button:focus-visible,.sy-more summary:focus-visible{outline:3px solid #b5641a;outline-offset:2px}

/* ---------------- The tree ----------------
   Every level is a list with a trunk on its left: each item draws its piece of the trunk (::before) and an elbow
   (::after) at --y, the height of its node's first line. The first item's trunk starts at its elbow, the last one's
   ends there. Wide screens put the root left of the subjects and the leaves right of each subject. */
#sy-tree{max-width:1166px;--line:#b6c6ac;--y:20px}
.syt{display:grid;grid-template-columns:186px minmax(0,1fr);align-items:start}
.syt-root{position:relative;display:grid;gap:5px;margin-right:26px;padding:12px 14px;border-radius:14px;background:#315c49;color:#fffdf5;box-shadow:0 4px 14px #315c4922}
.syt-root::after{content:'';position:absolute;left:100%;top:var(--y);width:26px;border-top:2px solid var(--line)}
.syt-root .sy-tab-exam{color:#cfe0c6}
.syt-root-name{font:700 26px/1.1 Georgia,serif;letter-spacing:-.5px}
.syt-root-full{font-size:12px;line-height:1.35;color:#dbe7d3}
.syt-root-heading{display:block;margin-top:2px;padding-left:8px;border-left:2px solid #6d907c;font:italic 12.5px/1.4 Georgia,serif;color:#f1f6ec;quotes:'“' '”'}
.syt-root-pct{font-size:12.5px;color:#dbe7d3;margin-top:4px}.syt-root-pct b{font-size:20px;color:#fff}
.syt-root .sy-bar{border-color:#6d907c;background:#244638}
.syt-root .sy-seg.sy-cov-c{background:#fffdf5}
.syt-root-counts{display:flex;gap:10px;font-size:12.5px;font-variant-numeric:tabular-nums}
.syt-root .sy-dot{border-color:#fffdf5}.syt-root .sy-dot.sy-cov-c{background:#fffdf5}
.syt-root .sy-dot.sy-cov-p{border-color:#e9c77d;background:linear-gradient(90deg,#e9c77d 50%,transparent 50%)}
.syt-root .sy-dot.sy-cov-n{border-color:#a9c0a7;background:transparent}
.syt-root-ticks{font-size:12px;color:#dbe7d3}.syt-root-ticks b{color:#ffd59a}

.syt-branches,.syt-twigs,.syt-pills{list-style:none;margin:0;padding:0}
.syt-branch,.syt-twig{position:relative;padding-left:24px}
/* The branch column takes a share of the width (not a fixed 340 px) so a long UPSC line wraps over fewer rows; rows
   with one or two leaves are then only as tall as the line's text. */
.syt-branch{padding-bottom:8px;display:grid;grid-template-columns:minmax(320px,.85fr) minmax(0,1fr);align-items:start}
.syt.is-bushy .syt-branch{grid-template-columns:320px minmax(0,1fr)}
.syt-branch::before,.syt-twig::before{content:'';position:absolute;left:0;top:0;bottom:0;border-left:2px solid var(--line)}
.syt-branch::after,.syt-twig::after{content:'';position:absolute;left:0;top:var(--y);width:24px;border-top:2px solid var(--line)}
.syt-branch:first-child::before,.syt-twig:first-child::before{top:var(--y)}
.syt-branch:last-child::before,.syt-twig:last-child::before{bottom:auto;height:var(--y)}
.syt-branch:first-child:last-child::before,.syt-twig:first-child:last-child::before{display:none}
.syt-branch:last-child{padding-bottom:0}

.syt-bnode{position:relative;display:grid;grid-template-columns:24px minmax(0,1fr);gap:4px 10px;align-items:start;width:100%;text-align:left;padding:8px 12px 8px;border:1px solid #d3ddc9;border-radius:12px;background:#fffdf8;color:#263f36;font-family:inherit;cursor:pointer;box-shadow:0 1px 0 #e6eadf}
.syt-bnode:hover{border-color:#8fae86}
.syt-branch.is-open>.syt-bnode{border-color:#a9bf9e}
.syt-branch.is-open>.syt-bnode::after{content:'';position:absolute;left:100%;top:var(--y);width:25px;border-top:2px solid var(--line)}
.syt-line-no{width:24px;height:24px;border-radius:50%;border:1.5px solid #315c49;box-sizing:border-box;display:grid;place-items:center;font-size:12px;font-weight:700;color:#315c49;font-variant-numeric:tabular-nums}
.syt-branch.is-open .syt-line-no{background:#315c49;color:#fffdf5}
/* UPSC's own words: a serif face, so the official line reads differently from our leaves and groupings. */
.syt-line-text{font:14px/1.42 Georgia,serif;color:#263f36;overflow-wrap:anywhere;padding-top:2px}
.syt-bnode-foot{grid-column:2;display:flex;align-items:center;gap:8px}
.syt-bnode-foot .syt-dots{flex:1}
.syt-bnode-pct{font-size:13px;font-weight:700;color:#315c49;font-variant-numeric:tabular-nums}
.syt-chev{align-self:center;width:7px;height:7px;border-right:2px solid #75856b;border-bottom:2px solid #75856b;transform:rotate(-45deg);margin:0 2px 0 2px}
.syt-branch.is-open .syt-chev{transform:rotate(45deg);margin-top:-3px}
@media (prefers-reduced-motion:no-preference){.syt-chev{transition:transform .18s ease}}
.syt-dots{display:flex;flex-wrap:wrap;gap:3px}
.syt-dot{display:block;width:9px;height:9px;border-radius:50%;box-sizing:border-box;border:1.5px solid #315c49;background:#315c49}
.syt-dot.is-p{border-color:#b07d1f;background:linear-gradient(90deg,#b07d1f 50%,#fff 50%)}
.syt-dot.is-n{border-color:#9aa594;background:#fff}
.syt-dot.is-done{box-shadow:0 0 0 1.5px #fffdf8,0 0 0 3px #b5641a}
.syt-dot.is-dim{opacity:.25}
.syt-bnode-meta{grid-column:2;font-size:11.5px;color:#75856b}.syt-bnode-meta b{color:#b5641a}
.syt-branch.is-dim>.syt-bnode{opacity:.55}

.syt-leaves{padding-left:25px;min-width:0}
.syt-twig{padding-bottom:6px}
.syt-twig:last-child{padding-bottom:0}
/* Our own groupings under a line: plain italic, never the serif of UPSC's words. */
.syt-twig-name{display:block;margin-top:12px;font-size:12px;line-height:16px;font-style:italic;font-weight:600;color:#6b7b67}
.syt-twig-name small{font-size:11px;font-weight:500;color:#9a8763}
.syt-twig.is-bare .syt-pills{padding-top:0}
.syt-pills{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
.syt-twig-name+.syt-pills{margin-top:5px}
.syt-pills li{min-width:0;max-width:100%}
.syt-none{margin:12px 0 0;font-size:13px;color:#75856b;font-style:italic}
@media (prefers-reduced-motion:no-preference){.syt-leaves{animation:syt-in .2s ease-out}@keyframes syt-in{from{opacity:0;transform:translateX(-6px)}to{opacity:1;transform:none}}}

/* A leaf: solid = covered, hatched = partly, hollow with a dashed edge = not yet. */
.syt-leaf{display:inline-flex;align-items:center;gap:6px;max-width:100%;min-height:32px;padding:5px 12px;border-radius:16px;border:1.5px solid #315c49;background:#315c49;color:#fffdf5;font-family:inherit;font-size:13px;font-weight:600;line-height:1.3;text-align:left;cursor:pointer;box-sizing:border-box}
.syt-leaf.is-p{border-color:#b07d1f;color:#4f3608;background:repeating-linear-gradient(135deg,#f1dcae 0 4px,#fbf1da 4px 8px)}
.syt-leaf.is-n{border:1.5px dashed #a3ad9c;background:#fff;color:#56665a;font-weight:500}
.syt-leaf:hover{box-shadow:0 2px 8px #315c4930}
.syt-leaf.is-c:hover{background:#264a3a}
.syt-leaf.is-p:hover{border-color:#8a5f12}
.syt-leaf.is-n:hover{border-color:#5f6e60;color:#263f36}
.syt-leaf-text{min-width:0;overflow-wrap:anywhere}
.syt-leaf.is-dim{opacity:.22}
.syt-leaf.is-hit{box-shadow:0 0 0 3px #fffdf8,0 0 0 5px #b5641a}
.syt-leaf.is-current{box-shadow:0 0 0 3px #fffdf8,0 0 0 5px #315c49}
.syt-tick{flex:none;position:relative;width:16px;height:16px;border-radius:50%;background:#b5641a;display:inline-block}
.syt-tick::after{content:'';position:absolute;left:5px;top:2.5px;width:4px;height:8px;border-right:2px solid #fff;border-bottom:2px solid #fff;transform:rotate(45deg)}
.syt-leaf.is-c .syt-tick{background:#fffdf5}.syt-leaf.is-c .syt-tick::after{border-color:#315c49}
.syt-sample{cursor:default;min-height:24px;padding:2px 10px;font-size:12px}
.syt-sample:hover{box-shadow:none}
.syt-leaf.is-c.syt-sample:hover{background:#315c49}

/* Legend and footnotes */
.sy-key{display:flex;flex-wrap:wrap;gap:8px 16px;align-items:center;font-size:12.5px;color:#5d6e5f;margin:22px 0 0;line-height:1.5;max-width:1166px;padding-top:12px;border-top:1px solid #e3e7dc}
.sy-keyitem{display:inline-flex;align-items:center;gap:6px}
.sy-keynote{flex-basis:100%;font-size:12.5px;color:#75856b}
.sy-ticknote{max-width:860px;font-size:13px;line-height:1.6;color:#5d6e5f;margin:12px 0}
.sy-more{max-width:1000px;margin:6px 0 10px;border:1px solid #e3e7dc;border-radius:12px;background:#fffdf8;padding:0 14px}
.sy-more>summary{cursor:pointer;padding:12px 0;font-size:14px;font-weight:600;color:#315c49}
.sy-more[open]>summary{border-bottom:1px solid #eef0e8}
.sy-outside{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.sy-outside li{padding:10px 14px;border:1px dashed #c8d3bd;border-radius:12px;background:#fafbf6}
.sy-outside li>b{font-size:14px}.sy-outside li>span{display:block;font-size:13px;color:#5d6e5f;margin:2px 0 6px}
.sy-official{margin:0;font-size:13px;line-height:1.55;color:#3d4a42}
.sy-foot{font-size:13px;line-height:1.6;color:#5d6e5f;padding-bottom:10px}
.sy-foot p{margin:0 0 8px}.sy-foot a{color:#315c49}
.sy-headings{margin:0 0 10px;padding-left:0;list-style:none;display:grid;gap:4px}

/* ---------------- Topic panel: a side panel; a bottom sheet on phones ---------------- */
.syp-scrim{position:fixed;inset:0;z-index:60;background:#233e3033}
.syp{position:fixed;z-index:61;top:0;right:0;bottom:0;width:min(440px,100%);overflow:auto;overscroll-behavior:contain;box-sizing:border-box;padding:16px 22px 22px;background:#fffdf8;border-left:1px solid #d3ddc9;box-shadow:-10px 0 30px #233e3022;color:#263f36}
@media (prefers-reduced-motion:no-preference){.syp{animation:syp-in .2s ease-out}.syp-scrim{animation:syp-fade .2s ease-out}@keyframes syp-in{from{transform:translateX(24px);opacity:0}to{transform:none;opacity:1}}@keyframes syp-fade{from{opacity:0}}}
.syp-head{display:flex;align-items:flex-start;gap:10px}
.syp-trail{flex:1;margin:6px 0 0;font-size:11.5px;letter-spacing:.3px;color:#75856b;line-height:1.4}
.syp-close{flex:none;width:40px;height:40px;border-radius:20px;border:1px solid #d3ddc9;background:#fff;color:#315c49;font-size:24px;line-height:1;cursor:pointer;font-family:inherit}
.syp-close:hover{border-color:#315c49}
.syp h2{font:600 24px/1.2 Georgia,serif;letter-spacing:-.3px;margin:8px 0 10px;outline:none}
.syp-status{display:flex;align-items:flex-start;gap:8px;margin:0 0 6px;padding:9px 10px;border-radius:10px;background:#f1f6ec;font-size:13.5px;line-height:1.5;color:#33433a}
.syp-status.is-p{background:#fbf4e4}.syp-status.is-n{background:#f3f3ee}
.syp-status .syt-sample{flex:none}
.syp-twin{margin:4px 0 0;font-size:12.5px;color:#5d6e5f;font-style:italic}
.syp-part{margin-top:16px}
.syp-part h3{margin:0 0 7px;font-size:10.5px;letter-spacing:1.5px;font-weight:700;color:#75856b;text-transform:uppercase}
.syp-part h3 small{text-transform:none;letter-spacing:0;font-weight:600}
.syp-lessons{list-style:none;margin:0;padding:0;display:grid;gap:7px}
.syp-lesson{display:flex;align-items:center;gap:10px;padding:10px 12px;min-height:48px;box-sizing:border-box;border:1px solid #cddbc4;border-radius:12px;background:#f4f8ef;color:#263f36;text-decoration:none}
.syp-lesson:hover{border-color:#315c49;background:#eaf2e3}
.syp-lesson .rp-mark,.syp-lesson .sy-ripple-mark{flex:none;font-size:16px}
.syp-lesson-text{flex:1;min-width:0;display:grid;gap:1px}
.syp-lesson-kind{font-size:11px;color:#5d6e5f;letter-spacing:.2px}
.syp-lesson b{font-size:14.5px;font-weight:650;line-height:1.3;color:#244a39}
.syp-go{flex:none;color:#315c49;font-weight:700}
.sy-ripple-mark{display:inline-grid;place-items:center;width:1.5em;height:1.5em;border-radius:50%;border:1px dashed #b5641a;color:#b5641a;font-size:.85em;line-height:1}
.syp-empty{margin:0;font-size:13.5px;color:#75856b;font-style:italic}
.syp-study{margin:0;padding:0;list-style:none;display:grid;gap:6px;font-size:13.5px;line-height:1.5;color:#33433a}
.syp-study small{color:#8a6a1d}
.sy-src{display:inline-block;margin-right:4px;padding:1px 6px;border-radius:5px;background:#e6efe0;color:#315c49;font-size:9.5px;font-weight:700;letter-spacing:.8px;vertical-align:1px}
.sy-src.is-official{background:#e7eef5;color:#2e4f6e}.sy-src.is-book{background:#f3ead8;color:#7a4a14}
.syp-pts{margin:0;font-size:13.5px;line-height:1.55;color:#3d4a42}
.syp-done{display:flex;align-items:center;justify-content:center;gap:9px;width:100%;margin:18px 0 0;min-height:44px;border-radius:12px;border:1.5px solid #315c49;background:#fff;color:#315c49;font-family:inherit;font-size:14.5px;font-weight:700;cursor:pointer}
.syp-done[aria-pressed="true"]{background:#315c49;color:#fffdf5}
.syp-box{position:relative;width:18px;height:18px;border-radius:5px;border:2px solid currentColor;box-sizing:border-box}
.syp-done[aria-pressed="true"] .syp-box::after{content:'';position:absolute;left:4px;top:0;width:4px;height:9px;border-right:2px solid #fffdf5;border-bottom:2px solid #fffdf5;transform:rotate(45deg)}
.syp-upsc{margin:18px 0 0;padding-top:12px;border-top:1px solid #e9ece3;font-size:12px;line-height:1.55;color:#5d6e5f}
.syp-upsc-src{display:block;margin-top:3px;font-size:11px;color:#8a9585}

/* ---------------- Narrow screens ---------------- */
@media (max-width:1100px){.syt{grid-template-columns:170px minmax(0,1fr)}.syt-branch{grid-template-columns:minmax(280px,.85fr) minmax(0,1fr)}.syt.is-bushy .syt-branch{grid-template-columns:280px minmax(0,1fr)}}
/* Below 860 px the tree turns vertical: the root on top, subjects below it on one trunk, each subject's leaves
   indented under it. */
@media (max-width:860px){
  .syt{display:block}
  .syt-root{margin:0 0 0;grid-template-columns:minmax(0,1fr) auto;align-items:baseline;column-gap:12px}
  .syt-root::after{left:16px;top:100%;width:0;height:14px;border-top:0;border-left:2px solid var(--line)}
  .syt-root>.sy-tab-exam,.syt-root-full,.syt-root-heading,.syt-root .sy-bar,.syt-root-counts,.syt-root-ticks{grid-column:1 / -1}
  .syt-root-name{grid-row:2}.syt-root-pct{grid-row:2;margin:0;text-align:right}
  .syt-branches{margin-left:16px;padding-top:14px}
  .syt-branch{display:block;padding-left:18px;padding-bottom:10px}
  .syt-branch::after{width:18px}
  .syt-branch:first-child::before{top:-14px}
  .syt-branch:first-child:last-child::before{display:block;bottom:auto;height:calc(var(--y) + 14px)}
  .syt-branch.is-open>.syt-bnode::after{left:16px;top:100%;width:0;height:8px;border-top:0;border-left:2px solid var(--line)}
  .syt-leaves{padding-left:0;margin-left:16px;padding-top:8px}
  .syt-twig{padding-left:16px}
  .syt-twig::after{width:16px}
  .syt-twig:first-child::before{top:0}
  .syt-twig:first-child:last-child::before{display:block;bottom:auto;height:var(--y)}
}
@media (max-width:640px){
  .sy-tabs{gap:5px}
  .sy-tab{padding:8px 7px 9px;gap:3px;border-radius:10px}
  .sy-tab-exam{font-size:8.5px;letter-spacing:.8px}
  .sy-tab-name{font-size:15px}
  .sy-tab-word{display:none}
  .sy-tab-pct b{font-size:14px}
  .sy-tab-hits{top:-7px;right:-4px;min-width:20px;height:20px;line-height:20px;font-size:11px}
  .sy-fold{margin-left:0}
  .sy-find{max-width:none;flex-basis:100%}
  /* The panel becomes a bottom sheet. */
  .syp{top:auto;left:0;right:0;width:auto;max-height:86vh;border-left:0;border-top:1px solid #d3ddc9;border-radius:18px 18px 0 0;padding:10px 18px 22px;box-shadow:0 -10px 30px #233e3026}
  .syp::before{content:'';display:block;width:40px;height:4px;border-radius:2px;background:#cfd8c6;margin:0 auto 6px}
  .syp h2{font-size:21px}
}
@media (max-width:640px) and (prefers-reduced-motion:no-preference){.syp{animation-name:syp-up}@keyframes syp-up{from{transform:translateY(30px);opacity:0}to{transform:none;opacity:1}}}
@media (max-width:420px){.sy-tab-exam{font-size:7.5px;letter-spacing:.4px}}
/* While the bottom sheet is open the page behind it does not scroll. */
@media (max-width:640px){html.syp-open{overflow:hidden}}
