/* NEET PG Cutoff Explorer. Warm paper + ink in light mode, warm charcoal in dark mode.
   Theme: <html data-theme="light|dark"> set by assets/theme.js; without JS the OS preference applies. */
:root {
  --bg: #f5f1e8; --surface: #fffdf8; --surface-2: #eee8da; --fg: #1d1b17; --muted: #6b655a; --border: #e0d8c8; --rule: #cfc4ae;
  --accent: #0f6b61; --accent-soft: color-mix(in srgb, var(--accent) 11%, transparent); --on-accent: #fff;
  --safe: #2e7d32; --likely: #2c5f8d; --reach: #b86a0c; --you: #c23b22;
  --success: var(--safe); --warning: var(--reach); --error: var(--you);
  --c1: #0f6b61; --c2: #c27012; --c3: #6a4c93; --c4: #2c5f8d; --c5: #c23b22; --c6: #7a8b2e;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Charter, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --radius: 8px; --shadow: 0 1px 0 rgb(60 45 20 / .04), 0 8px 24px -12px rgb(60 45 20 / .18);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #161513; --surface: #1f1d1a; --surface-2: #29261f; --fg: #ece6da; --muted: #a39b8c; --border: #353128; --rule: #4a4438;
  --accent: #52b5a6; --on-accent: #0f1312;
  --safe: #6cbf6f; --likely: #7eaad6; --reach: #e09a45; --you: #f0705a;
  --c1: #52b5a6; --c2: #e09a45; --c3: #b49ad6; --c4: #7eaad6; --c5: #f0705a; --c6: #b5c46a;
  --shadow: 0 10px 30px -12px rgb(0 0 0 / .6);
  color-scheme: dark;
}
/* No-JS fallback: same dark palette when the OS asks for it and no theme was chosen. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #161513; --surface: #1f1d1a; --surface-2: #29261f; --fg: #ece6da; --muted: #a39b8c; --border: #353128; --rule: #4a4438;
    --accent: #52b5a6; --on-accent: #0f1312;
    --safe: #6cbf6f; --likely: #7eaad6; --reach: #e09a45; --you: #f0705a;
    --c1: #52b5a6; --c2: #e09a45; --c3: #b49ad6; --c4: #7eaad6; --c5: #f0705a; --c6: #b5c46a;
    --shadow: 0 10px 30px -12px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--sans); background: var(--bg); color: var(--fg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.005em; }
h3 { margin: 32px 0 10px; font-size: 19px; }
.muted, .muted-t { color: var(--muted); fill: var(--muted); }
.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
button { font: inherit; color: inherit; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 8px 14px; background: var(--fg); color: var(--bg); border-radius: 6px; }
.skip:focus { left: 8px; }

/* ---------------------------------------------------------------- header */
.top { display: flex; flex-wrap: wrap; gap: 14px 12px; align-items: center; padding: 18px 28px; max-width: 1320px; margin: 0 auto; }
.brand { display: flex; gap: 12px; align-items: center; min-width: 0; margin-right: auto; }
.logo { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--fg); flex: none; }
.logo i { width: 24px; height: 28px; background: var(--fg); -webkit-mask: url(caduceus.svg) center / contain no-repeat; mask: url(caduceus.svg) center / contain no-repeat; }
.brand h1, .brand-name { font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.brand h1 em, .brand-name em { font-style: italic; font-weight: 500; color: var(--accent); }
.sub { margin: 1px 0 0; color: var(--muted); font-size: 13px; }
.byline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.byline b { color: var(--fg); font-weight: 600; }
.byline a { font-weight: 500; }

.profile { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 14px 10px 8px; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); position: relative; }
.profile::before { content: "Your profile"; position: absolute; top: -9px; left: 10px; padding: 0 6px; background: var(--bg); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.profile.needs-cat [data-tour="category"] select { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.profile .ctl select, .profile .ctl input { background: var(--bg); }

/* Labelled pill so it reads as a control; shows the theme you'd switch to. */
.theme-toggle { display: inline-flex; align-items: center; height: 38px; padding: 0 14px 0 11px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); color: var(--fg); font-size: 13.5px; font-weight: 600; cursor: pointer; flex: none; box-shadow: 0 1px 2px rgb(0 0 0 / .08); transition: border-color .15s, background .15s; }
.theme-toggle:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.theme-toggle:active { transform: translateY(1px); }
.theme-toggle > span { display: inline-flex; align-items: center; white-space: nowrap; }
.theme-toggle svg { width: 17px; height: 17px; margin-right: 7px; }
.theme-toggle .m { white-space: pre; } /* keep the leading space: flex items drop it otherwise */
.theme-toggle .to-light, :root[data-theme="dark"] .theme-toggle .to-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .to-light { display: inline-flex; }
:root:not([data-theme]) .theme-toggle { display: none; } /* needs theme.js */

/* ---------------------------------------------------------------- tabs */
.tabs-bar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.2) blur(8px); -webkit-backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--rule); }
.tabs-inner { display: flex; align-items: center; gap: 12px; max-width: 1320px; margin: 0 auto; padding: 0 28px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { position: relative; padding: 13px 12px 12px; color: var(--muted); text-decoration: none; white-space: nowrap; font-weight: 500; font-size: 14.5px; }
.tabs a:hover { color: var(--fg); }
.tabs a.active { color: var(--fg); }
.tabs a.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
.ctx { display: none; align-items: center; gap: 6px; white-space: nowrap; padding: 4px 10px; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); font-size: 13px; color: var(--fg); cursor: pointer; }
.ctx.show { display: inline-flex; }
.ctx b { font-variant-numeric: tabular-nums; }
.ctx .muted { font-size: 12px; }

/* ---------------------------------------------------------------- page */
main { max-width: 1320px; margin: 0 auto; padding: 28px 28px 48px; }
.head { margin-bottom: 18px; }
.head h2 { font-size: 30px; }
.lede { color: var(--muted); margin: 6px 0 0; max-width: 70ch; }
.loading { color: var(--muted); display: flex; align-items: center; gap: 10px; }
.loading::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--rule); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.ctl { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.ctl select, .ctl input { font: inherit; font-size: 14px; letter-spacing: 0; text-transform: none; font-weight: 400; color: var(--fg); background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 7px 10px; min-width: 120px; height: 36px; }
.ctl select { appearance: none; -webkit-appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
.ctl select:hover, .ctl input:hover { border-color: var(--muted); }
.ctl select:focus-visible, .ctl input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ctl input[type=number] { width: 110px; min-width: 0; font-variant-numeric: tabular-nums; }
.ctl.on select { border-color: var(--accent); color: var(--accent); font-weight: 600; }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 12px 0 14px; margin-bottom: 20px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.filters .ctl.search { flex: 1 1 220px; }
.filters .ctl.search input { width: 100%; }
.filters .reset-slot { align-self: flex-end; display: flex; align-items: center; height: 36px; }
.filters .reset-slot:empty { display: none; }
.filters .reset { white-space: nowrap; font-size: 14px; }

/* Buttons */
button.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); }
button.more { margin: 14px auto 0; display: block; padding: 8px 18px; border-radius: 6px; border: 1px solid var(--rule); background: var(--surface); color: var(--fg); cursor: pointer; }
button.more:hover { border-color: var(--fg); }

/* ---------------------------------------------------------------- summary (predictor, trends) */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 14px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.stat { padding: 14px 18px 14px 0; border-right: 1px solid var(--border); margin-right: 18px; text-align: left; background: none; border-top: 0; border-bottom: 0; border-left: 0; color: inherit; }
.stat:last-child { border-right: 0; margin-right: 0; }
.stat-title { display: flex; align-items: center; gap: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.stat strong { display: block; font-family: var(--serif); font-size: 34px; font-weight: 600; line-height: 1.1; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.stat small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
button.stat { display: flex; flex-direction: column; justify-content: flex-start; cursor: pointer; border-radius: 0; font: inherit; }
button.stat:hover strong { color: var(--accent); }
button.stat.on { box-shadow: inset 0 -3px 0 var(--accent); }
.stat.safe strong { color: var(--safe); } .stat.likely strong { color: var(--likely); } .stat.reach strong { color: var(--reach); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.safe > .stat-title .dot, .dot.safe { color: var(--safe); }
.likely > .stat-title .dot, .dot.likely { color: var(--likely); }
.reach > .stat-title .dot, .dot.reach { color: var(--reach); }
.chance-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface-2); margin: 0 0 18px; }
.chance-bar i { display: block; height: 100%; }
.chance-bar .safe { background: var(--safe); } .chance-bar .likely { background: var(--likely); } .chance-bar .reach { background: var(--reach); }
.filter-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 14px; font-size: 13.5px; }

/* Kept for the year-on-year view */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; margin-bottom: 16px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.card { padding: 14px 18px 14px 0; margin-right: 18px; border-right: 1px solid var(--border); }
.card:last-child { border-right: 0; }
.card-title { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.card strong { display: block; font-family: var(--serif); font-size: 30px; font-weight: 600; margin: 2px 0; font-variant-numeric: tabular-nums; }
.card.likely strong { color: var(--likely); } .card.reach strong { color: var(--reach); } .card.safe strong { color: var(--safe); }
.card small { color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 18px; font-size: 13px; }
.chip { display: inline-flex; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--fg); cursor: pointer; font: inherit; font-size: 13px; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip.on b { color: inherit; }
.chip b { color: var(--accent); font-variant-numeric: tabular-nums; }
.chips-label { color: var(--muted); margin-right: 4px; }

/* ---------------------------------------------------------------- tables */
.table-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.table-meta strong { color: var(--fg); font-weight: 600; }
.scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table.seats { width: 100%; border-collapse: collapse; font-size: 14px; }
.seats th, .seats td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.seats tbody tr:last-child td { border-bottom: 0; }
.seats th { position: sticky; top: 0; background: var(--surface-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; white-space: nowrap; }
.seats tfoot th { position: static; }
.seats tbody tr:hover { background: var(--accent-soft); }
.seats tr.me { background: color-mix(in srgb, var(--you) 12%, transparent); font-weight: 600; }
.seats .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.seats .num small { color: var(--muted); font-size: 11.5px; }
.seats .inst { max-width: 340px; }
.seats.compact td, .seats.compact th { padding: 7px 12px; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--fg); }
th.sorted { color: var(--accent); }
th.sorted.asc::after { content: " ↑"; } th.sorted.desc::after { content: " ↓"; }
td.gauge svg { display: block; }
.up { color: var(--safe); font-weight: 600; }
.seats td.course { min-width: 190px; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.safe { color: var(--safe); } .badge.likely { color: var(--likely); } .badge.reach { color: var(--reach); }
.deg { display: inline-block; padding: 0 5px; border-radius: 3px; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; border: 1px solid currentColor; line-height: 1.5; vertical-align: 1px; }
.deg-MD { color: var(--c1); } .deg-MS { color: var(--c3); } .deg-MDMS { color: var(--c6); }
.deg-DNB { color: var(--c2); } .deg-DNBDiploma { color: var(--c4); } .deg-Diploma { color: var(--c5); }
.deg-MCh, .deg-MPH { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag { font-size: 11px; padding: 0 6px; border-radius: 3px; background: var(--surface-2); color: var(--muted); }
.tag.cat-OBC { background: color-mix(in srgb, var(--c2) 18%, transparent); color: var(--fg); }
.tag.cat-EWS { background: color-mix(in srgb, var(--c6) 20%, transparent); color: var(--fg); }
.tag.cat-SC { background: color-mix(in srgb, var(--c4) 18%, transparent); color: var(--fg); }
.tag.cat-ST { background: color-mix(in srgb, var(--c3) 18%, transparent); color: var(--fg); }

.empty { padding: 36px 24px; text-align: center; background: var(--surface); border: 1px dashed var(--rule); border-radius: var(--radius); }
.empty strong { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.empty p { margin: 6px auto 0; max-width: 56ch; }
.start { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 10px; margin: 18px 0 8px; text-align: left; }
.start .ctl select { min-width: 200px; }
.start .ctl input { width: 130px; min-width: 0; }

/* ---------------------------------------------------------------- charts */
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg i { display: inline-block; width: 12px; height: 12px; }
.lg-dot { border-radius: 50%; background: var(--accent); opacity: .6; width: 7px !important; height: 7px !important; }
.lg-iqr { background: color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 3px; }
.lg-median { width: 2px !important; background: var(--fg); }
.lg-you { width: 2px !important; background: var(--you); }

.chart-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; overflow-x: auto; }
svg.chart { width: 100%; min-width: 720px; height: auto; font-size: 12px; display: block; font-family: var(--sans); }
svg.india { min-width: 0; max-width: 600px; margin: 0 auto; }
.chart .grid { stroke: var(--border); }
.chart .tick { fill: var(--muted); font-size: 11px; }
.chart .label { fill: var(--fg); font-size: 12.5px; }
.chart .deg-t { fill: var(--muted); font-size: 10.5px; }
.chart .hit { fill: transparent; }
.chart .row:hover .hit { fill: var(--accent-soft); }
.chart .iqr { fill: color-mix(in srgb, var(--accent) 20%, transparent); }
.chart .dot { fill: var(--accent); fill-opacity: .45; }
.chart .median { stroke: var(--fg); stroke-width: 2; }
.chart .close { fill: var(--muted); font-size: 11px; }
.chart .you { stroke: var(--you); stroke-width: 2; stroke-dasharray: 4 3; }
.chart .you-t { fill: var(--you); font-size: 11px; font-weight: 600; }
.india .state { stroke: var(--surface); stroke-width: .8; stroke-linejoin: round; cursor: pointer; }
.india .state:hover { stroke: var(--fg); stroke-width: 1.5; }
.india .empty-state { fill: var(--surface-2); cursor: default; }
.india .empty-state:hover { stroke: var(--surface); stroke-width: .8; }
.india .selected { stroke: var(--you); stroke-width: 2.5; }
.india .marker { stroke: var(--fg); stroke-width: 1; }
.india .marker-bg { fill: var(--surface); }
.india .map-v { font-size: 12px; font-weight: 600; fill: var(--fg); pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.india .map-v.on { fill: var(--on-accent); stroke: none; }
.scale { display: flex; align-items: center; gap: 8px; max-width: 320px; margin: 8px auto 0; font-size: 12px; color: var(--muted); }
.scale i { flex: 1; height: 8px; border-radius: 4px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 12%, transparent), var(--accent)); }
tr.click { cursor: pointer; }
.map-layout { display: grid; grid-template-columns: minmax(0, 640px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .map-layout { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- rank lookup */
.timeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; opacity: .7; }
.step.got { opacity: 1; box-shadow: var(--shadow); border-color: var(--rule); }
.step strong { font-family: var(--serif); font-size: 17px; }
.step-n { align-self: flex-start; color: #fff; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.pill { align-self: flex-start; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); }
.seat b { font-size: 15px; }

/* ---------------------------------------------------------------- footer, prose, tooltip */
.prose { max-width: 820px; } .prose li { margin-bottom: 6px; }
.foot { max-width: 1320px; margin: 0 auto; padding: 0 28px 30px; color: var(--muted); font-size: 13px; }
.foot p { margin: 4px 0; }
.foot .credit { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 18px 0 4px; margin-top: 14px; border-top: 1px solid var(--rule); font-size: 15px; color: var(--muted); }
.foot .credit b { color: var(--fg); font-family: var(--serif); font-size: 18px; font-weight: 600; }
.credit-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.credit-links { display: inline-flex; flex-wrap: wrap; gap: 4px 16px; margin-left: 6px; }
.credit-links button.link { font-size: 15px; }
.credit-issue { padding: 7px 16px; border: 1px solid var(--accent); border-radius: 6px; text-decoration: none; font-weight: 600; white-space: nowrap; }
.credit-issue:hover { background: var(--accent); color: var(--on-accent); }
.tooltip { position: fixed; left: 0; top: 0; z-index: 50; max-width: 360px; pointer-events: none; background: var(--fg); color: var(--bg); padding: 7px 10px; border-radius: 6px; font-size: 12.5px; line-height: 1.45; box-shadow: var(--shadow); }

td.past { white-space: nowrap; }
.yr { display: inline-block; margin-right: 4px; padding: 0 6px; border-radius: 4px; font-size: 12px; border: 1px solid var(--border); color: var(--muted); font-variant-numeric: tabular-nums; }
.yr b { color: var(--fg); font-weight: 600; }
.yr.safe { border-color: var(--safe); } .yr.likely { border-color: var(--likely); } .yr.reach { border-color: var(--reach); }
.yr.miss { border-color: var(--you); } .yr.miss b { color: var(--you); }
.yr.none { opacity: .6; }
.down { color: var(--you); font-weight: 600; }
.hit { color: var(--safe); font-weight: 600; }
svg.spark { display: block; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 1.8; }
.spark-dot { fill: var(--accent); }
.spark-you { stroke: var(--you); stroke-dasharray: 3 2; }

/* First-visit tour: dim everything except the spotlight; the page stays clickable. */
.tour-spot { position: fixed; z-index: 60; border-radius: 10px; pointer-events: none; box-shadow: 0 0 0 3px var(--accent), 0 0 0 9999px rgb(20 16 10 / .55); transition: all .25s ease; }
.tour-card { position: fixed; z-index: 61; width: min(340px, calc(100vw - 16px)); background: var(--surface); color: var(--fg); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px; box-shadow: 0 10px 30px rgb(0 0 0 / .3); transition: top .25s ease, left .25s ease; }
.tour-card strong { font-family: var(--serif); font-size: 17px; }
.tour-card p { margin: 6px 0 12px; color: var(--muted); font-size: 14px; }
.tour-nav { display: flex; align-items: center; gap: 10px; }
.tour-dots { display: flex; gap: 5px; margin-right: auto; }
.tour-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.tour-dots i.on { background: var(--accent); }
.tour-btn { font: inherit; font-size: 14px; padding: 6px 14px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); cursor: pointer; }
.tour-btn.ghost { background: none; color: var(--accent); }

/* Static SEO pages (scripts/build_pages.py) and the crawlable link block under the explorer. */
a.plain, a.brand.plain { color: inherit; text-decoration: none; }
.brand-name { display: block; line-height: 1.2; }
a.brand-name:hover { color: var(--accent); }
.top .cta, main.static .cta { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 6px; background: var(--accent); color: var(--on-accent); text-decoration: none; font-weight: 600; }
.top .cta:hover, main.static .cta:hover { filter: brightness(1.08); }
main.static { max-width: 1080px; }
main.static h1 { font-family: var(--serif); font-size: 32px; font-weight: 600; margin: 6px 0 8px; letter-spacing: -.01em; }
main.static h2 { font-size: 22px; margin: 30px 0 10px; }
main.static h3 { font-size: 16px; margin: 16px 0 6px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.links { line-height: 1.9; }
.seo-links, .seo-about { max-width: 1320px; margin: 0 auto; padding: 0 28px 12px; font-size: 13px; color: var(--muted); line-height: 1.8; }
.seo-links p { margin: 4px 0; }
.seo-links a, .seo-about a { color: var(--muted); }

@media (max-width: 760px) {
  /* Flatten the brand so logo, title, toggle share one row and the byline gets the full width below. */
  .top { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "logo title toggle" "byline byline byline" "profile profile profile"; align-items: center; gap: 0 12px; padding: 14px 16px 12px; }
  .brand, .brand > div { display: contents; }
  .brand > .logo, .brand > a.plain:first-child { grid-area: logo; }
  .logo { width: 38px; height: 38px; }
  .logo i { width: 22px; height: 26px; }
  .brand h1, .brand-name { grid-area: title; font-size: clamp(16px, 4.6vw, 18px); line-height: 1.15; }
  .brand h1 em, .brand-name em { display: block; }
  .brand .sub { display: none; }
  .byline { grid-area: byline; margin: 10px 0 0; padding-top: 9px; border-top: 1px solid var(--border); font-size: 12.5px; gap: 2px 14px; }
  .byline > span { margin-right: auto; }
  .theme-toggle { grid-area: toggle; height: 36px; padding: 0 12px 0 10px; }
  .theme-toggle .m { display: none; }
  .profile { grid-area: profile; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 18px; padding-top: 12px; }
  .profile .ctl select { padding-right: 24px; background-position: calc(100% - 13px) 15px, calc(100% - 8px) 15px; }
  .profile .ctl select, .profile .ctl input { min-width: 0; width: 100%; }
  .top .cta { grid-area: profile; justify-self: stretch; justify-content: center; margin-top: 14px; }
  main { padding: 20px 16px 40px; }
  .tabs-inner { padding: 0 10px; }
  .ctx { display: none !important; }
  .head h2 { font-size: 25px; }
  .foot, .seo-links, .seo-about { padding-left: 16px; padding-right: 16px; }
  .ctl select, .ctl input { min-width: 0; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .filters .ctl select, .filters .ctl input { width: 100%; }
  .filters .ctl.search, .filters .ctl.quota { grid-column: 1 / -1; }
  .stat { padding-right: 12px; margin-right: 12px; }
  .stat strong { font-size: 28px; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .summary .stat:nth-child(2n) { border-right: 0; margin-right: 0; }
  .summary .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
  .seats th, .seats td { padding: 8px 9px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
