/* India Hex: editorial UI. Hierarchy through type, whitespace and quiet background shifts;
   hairlines instead of boxes; one ochre accent. Tokens below; dark theme via [data-theme=dark]. */
:root {
  --display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --paper: #f5f3ee;
  --paper-2: #ece8df;
  --paper-3: #e2dccf;
  --ink: #1b1a17;
  --ink-2: #4b473e;
  --ink-3: #857f73;
  --hair: rgba(27, 26, 23, 0.11);
  --hair-2: rgba(27, 26, 23, 0.2);
  --accent: #b7791f;
  --accent-ink: #8a5a12;
  --accent-wash: rgba(183, 121, 31, 0.12);
  --float: rgba(250, 249, 246, 0.93);
  --float-shadow: 0 10px 30px rgba(20, 18, 14, 0.12), 0 1px 2px rgba(20, 18, 14, 0.06);
  --up: #2f7a55;
  --down: #b4442f;
  --side-w: 392px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}
[data-theme="dark"] {
  --paper: #131417;
  --paper-2: #1b1d21;
  --paper-3: #25282d;
  --ink: #ece9e2;
  --ink-2: #bdb7ab;
  --ink-3: #8b867b;
  --hair: rgba(236, 233, 226, 0.1);
  --hair-2: rgba(236, 233, 226, 0.2);
  --accent: #e2aa4f;
  --accent-ink: #f0c47c;
  --accent-wash: rgba(226, 170, 79, 0.14);
  --float: rgba(22, 23, 27, 0.9);
  --float-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --up: #6cc59a;
  --down: #ef8a73;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--body); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1, "cv11" 1; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
svg { display: block; }

.app { display: grid; grid-template-columns: var(--side-w) 1fr; height: 100vh; height: 100dvh; overflow: hidden; }

/* ------------------------------------------------------------------ side */
.side { display: flex; flex-direction: column; min-height: 0; background: var(--paper); border-right: 1px solid var(--hair); position: relative; z-index: 5; }
.sheet-handle { display: none; }
.mast { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 6px; }
.wordmark { font-family: var(--display); font-size: 29px; line-height: 1; text-decoration: none; letter-spacing: -0.01em; }
.wordmark em { color: var(--accent); font-style: italic; }
.mast-actions { position: relative; }
.icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }
.icon:hover { background: var(--paper-2); color: var(--ink); }
.icon svg { width: 18px; height: 18px; fill: currentColor; }
.menu { position: absolute; right: 0; top: 40px; min-width: 220px; background: var(--paper); border: 1px solid var(--hair-2); border-radius: 12px; box-shadow: var(--float-shadow); padding: 6px; z-index: 30; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; text-align: left; text-decoration: none; font-size: 13.5px; }
.menu button:hover, .menu a:hover { background: var(--paper-2); }
.menu hr { border: 0; border-top: 1px solid var(--hair); margin: 6px 4px; }

.search { position: relative; margin: 10px 24px 6px; }
.search input { width: 100%; border: 0; border-bottom: 1px solid var(--hair-2); background: transparent; padding: 10px 28px 10px 26px; outline: none; font-size: 14.5px; }
.search input:focus { border-bottom-color: var(--accent); }
.search input::-webkit-search-cancel-button { display: none; }
.search-icon { position: absolute; left: 0; top: 11px; width: 17px; height: 17px; color: var(--ink-3); }
.search kbd { position: absolute; right: 0; top: 9px; font: 11px var(--body); color: var(--ink-3); border: 1px solid var(--hair-2); border-radius: 4px; padding: 0 5px; }
.search-results { position: absolute; left: -10px; right: -10px; top: calc(100% + 6px); background: var(--paper); border: 1px solid var(--hair-2); border-radius: 12px; box-shadow: var(--float-shadow); max-height: 420px; overflow-y: auto; padding: 6px; z-index: 40; }
.sr { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; }
.sr:hover, .sr.on { background: var(--paper-2); }
.sr .t { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.sr .n { font-weight: 500; }
.sr .m { font-size: 12px; color: var(--ink-3); }
.sr mark { background: var(--accent-wash); color: inherit; border-radius: 2px; }
.sr-head { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 10px 10px 4px; }
.sr-empty { padding: 18px; color: var(--ink-3); text-align: center; }

.crumbs { padding: 6px 24px 2px; font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 2px 6px; min-height: 26px; align-items: center; }
.crumbs button { letter-spacing: inherit; text-transform: inherit; color: var(--ink-2); }
.crumbs button:hover { color: var(--accent-ink); }
.crumbs .sep { opacity: .5; }

.panel { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 24px 40px; scroll-behavior: smooth; }
.panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-thumb { background: var(--hair-2); border-radius: 4px; }

/* hero */
.kicker { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 14px 0 6px; }
.kicker b { color: var(--accent-ink); font-weight: 600; }
.title { font-family: var(--display); font-weight: 400; font-size: 46px; line-height: .98; letter-spacing: -0.015em; margin: 0; }
.title.small { font-size: 34px; }
.title.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 22px; letter-spacing: 0; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.meta button { color: var(--ink); border-bottom: 1px solid var(--hair-2); }
.meta button:hover { border-color: var(--accent); color: var(--accent-ink); }
.meta span { color: var(--ink-3); }
.acts { display: flex; gap: 2px; margin: 14px 0 0 -8px; }
.acts .icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.acts .icon.on { color: var(--accent); }

/* lens block (value of the current variable for this place) */
.lensblock { margin-top: 22px; padding: 16px 0 6px; border-top: 1px solid var(--hair); }
.lensblock .lbl { font-size: 12.5px; color: var(--ink-2); }
.lensblock .big { font-family: var(--display); font-size: 48px; line-height: 1.05; letter-spacing: -0.01em; }
.lensblock .big small { font-family: var(--body); font-size: 13px; color: var(--ink-3); margin-left: 6px; letter-spacing: 0; }
.lensblock .rank { font-size: 12.5px; color: var(--ink-2); }
.hist { margin-top: 10px; }
.hist rect.on { fill: var(--accent); }

/* key figures */
.h2 { font-family: var(--display); font-size: 23px; font-weight: 400; margin: 28px 0 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.h2 small { font-family: var(--body); font-size: 11.5px; color: var(--ink-3); }
.figs { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
.fig { text-align: left; padding: 10px 0 12px; border-top: 1px solid var(--hair); position: relative; }
.fig:hover .fv { color: var(--accent-ink); }
.fig.on .fl { color: var(--accent-ink); }
.fig.on::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--accent); }
.fl { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); line-height: 1.3; }
.fv { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.fv small { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 3px; }
.fd { font-size: 11.5px; margin-top: 1px; color: var(--ink-3); }
.up { color: var(--up); }
.down { color: var(--down); }
.lc { margin-top: 6px; }
.lc-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--paper-3); }
.lc-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--ink-2); margin-top: 8px; }
.lc-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }

/* hex band: a quiet background shift, full bleed */
.band { margin: 10px -24px 4px; padding: 6px 24px 18px; background: var(--paper-2); }
.band .close { float: right; margin-top: 10px; }

/* lists */
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--hair); margin-bottom: 4px; }
.tabs button { padding: 8px 0; font-size: 13px; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs small { color: var(--ink-3); margin-left: 3px; }
.filter { width: 100%; border: 0; border-bottom: 1px solid var(--hair); background: transparent; padding: 9px 0; outline: none; font-size: 13px; margin-bottom: 4px; }
.filter:focus { border-bottom-color: var(--accent); }
.rows { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 28px 1fr auto; align-items: baseline; gap: 2px 8px; padding: 8px 6px; margin: 0 -6px; text-align: left; border-radius: 6px; position: relative; }
.row:hover { background: var(--paper-2); }
.row .rk { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .nm small { color: var(--ink-3); margin-left: 5px; font-size: 11.5px; }
.row .vl { font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.row .br { grid-column: 2 / -1; height: 3px; border-radius: 2px; background: var(--paper-3); overflow: hidden; }
.row .br i { display: block; height: 100%; border-radius: 2px; }
.more { margin: 8px 0; color: var(--accent-ink); font-size: 13px; }
.jump { width: 100%; appearance: none; -webkit-appearance: none; border: 0; border-bottom: 1px solid var(--hair-2); border-radius: 0; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23857f73' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 2px center / 14px; padding: 10px 22px 10px 0; font-size: 14px; color: var(--ink); cursor: pointer; outline: none; }
.jump:focus { border-bottom-color: var(--accent); }
.jump option { color: #1b1a17; }
.fold { margin-top: 10px; }
.fold summary { cursor: pointer; font-size: 12.5px; color: var(--accent-ink); list-style: none; padding: 6px 0; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: " ▾"; }
.fold[open] summary::after { content: " ▴"; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.split h3 { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin: 6px 0 2px; }
.note { font-size: 12px; color: var(--ink-3); line-height: 1.5; margin: 14px 0 0; }
.lede { font-family: var(--display); font-size: 21px; line-height: 1.3; color: var(--ink-2); margin: 12px 0 0; }
.steps { margin: 18px 0 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; padding: 9px 0 9px 30px; border-top: 1px solid var(--hair); position: relative; font-size: 13.5px; color: var(--ink-2); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 7px; font-family: var(--display); font-size: 20px; color: var(--accent); }

/* comparison table */
.ctable { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 8px; }
.ctable th, .ctable td { padding: 7px 6px; text-align: right; border-bottom: 1px solid var(--hair); font-variant-numeric: tabular-nums; }
.ctable th:first-child, .ctable td:first-child { text-align: left; }
.ctable thead th { font-weight: 500; color: var(--ink-2); vertical-align: bottom; }
.ctable td.best { color: var(--accent-ink); font-weight: 600; }

.pins { border-top: 1px solid var(--hair); padding: 10px 24px 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--paper); }
.pin { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; border: 1px solid var(--hair-2); border-radius: 999px; padding: 4px 6px 4px 10px; }
.pin button { width: 18px; height: 18px; border-radius: 50%; color: var(--ink-3); }
.pin button:hover { background: var(--paper-2); }
.pins .go { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--accent-ink); }

.textbtn { color: var(--accent-ink); font-size: 13px; border-bottom: 1px solid currentColor; }

/* ------------------------------------------------------------------ stage */
.stage { position: relative; min-width: 0; }
.map { position: absolute; inset: 0; background: #0d1117; }
.map-b { pointer-events: none; z-index: 1; }
.swipe { position: absolute; top: 0; bottom: 0; width: 0; z-index: 4; }
.swipe::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }
.swipe-grip { position: absolute; top: 50%; left: -16px; width: 32px; height: 32px; margin-top: -16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); cursor: ew-resize; touch-action: none; }
.swipe-grip::before, .swipe-grip::after { content: ""; position: absolute; top: 11px; border: 5px solid transparent; }
.swipe-grip::before { left: 3px; border-right-color: #333; }
.swipe-grip::after { right: 3px; border-left-color: #333; }

.float { background: var(--float); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--hair); border-radius: 14px; box-shadow: var(--float-shadow); }

.lens { position: absolute; left: 14px; top: 14px; width: 318px; max-height: calc(100% - 150px); display: flex; flex-direction: column; z-index: 5; background: var(--float); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--hair); border-radius: 14px; box-shadow: var(--float-shadow); }
.lens-head { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.lens-head svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .2s var(--ease); }
.lens.closed .lens-head svg { transform: rotate(-90deg); }
.lens.closed .lens-body { display: none; }
.lens-body { padding: 0 14px 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 13px; }
.lab { font-size: 10px; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 5px; display: flex; justify-content: space-between; gap: 8px; }
.lab span { letter-spacing: 0; text-transform: none; font-size: 11px; }
.seg { display: flex; gap: 2px; background: var(--paper-2); border-radius: 9px; padding: 2px; }
.seg button { flex: 1; padding: 6px 2px; border-radius: 7px; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); font-weight: 600; }
[data-theme="dark"] .seg button.on { background: var(--paper-3); }
.seg button:disabled { opacity: .35; cursor: default; }
.seg button { position: relative; }
.seg button.shown::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.seg.sm button { font-size: 11px; padding: 4px 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { font-size: 11.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--hair-2); color: var(--ink-2); }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip:disabled { opacity: .35; cursor: default; }

/* lens bar: what the map is coloured by (top centre) */
.lensbar { position: absolute; top: 14px; left: calc(346px + (100% - 346px - 64px) / 2); transform: translateX(-50%); width: min(470px, calc(100% - 430px)); z-index: 6; background: var(--float); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--hair); border-radius: 14px; box-shadow: var(--float-shadow); }
.lb-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 6px; flex-wrap: wrap; }
.var-btn { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; border-radius: 10px; flex: 1 1 auto; min-width: 0; text-align: left; }
.var-btn:hover { background: var(--paper-2); }
.var-btn .vk { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.var-btn .vv { font-family: var(--display); font-size: 21px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.var-btn svg { width: 14px; height: 14px; fill: none; stroke: var(--ink-3); stroke-width: 2; flex-shrink: 0; align-self: center; }
.lensbar.empty .vv { color: var(--accent-ink); }
.lensbar.empty { width: auto; }
.lensbar.empty .var-btn { flex: 0 0 auto; }
.lb-row .chips { flex-wrap: nowrap; }
.picker { position: absolute; left: 0; right: 0; top: calc(100% + 6px); border: 1px solid var(--hair-2); border-radius: 12px; background: var(--paper); max-height: min(420px, 60vh); overflow-y: auto; box-shadow: var(--float-shadow); z-index: 30; }
.picker input { position: sticky; top: 0; width: 100%; border: 0; border-bottom: 1px solid var(--hair); background: var(--paper); padding: 11px 14px; outline: none; font-size: 14px; }
.picker .g { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 10px 14px 3px; }
.picker button { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; padding: 7px 14px; font-size: 13.5px; }
.picker button:hover, .picker button.on { background: var(--paper-2); }
.picker button small { color: var(--ink-3); font-size: 11px; white-space: nowrap; }

.legend { padding: 2px 14px 8px; }
.legend .ramp { display: flex; height: 8px; border-radius: 3px; overflow: hidden; }
.legend .ramp i { flex: 1; }
.legend .ticks { display: flex; font-size: 10px; color: var(--ink-3); margin-top: 3px; font-variant-numeric: tabular-nums; }
.legend .ticks span { flex: 1; text-align: center; white-space: nowrap; overflow: hidden; }
.legend .ticks span:first-child, .legend .ticks span:last-child { flex: .5; }
.legend .lnote { font-size: 11px; color: var(--ink-3); margin-top: 3px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: help; }
.legend .lnote.nodata { margin-top: 2px; padding: 7px 10px; border-radius: 8px; background: var(--paper-2); color: var(--ink-2); white-space: normal; cursor: default; }
.row2 { display: flex; align-items: center; gap: 10px; }
.row2 > :first-child { flex: 1; }
input[type=range] { accent-color: var(--accent); width: 100%; }
.slider { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--ink-3); }
.slider input { flex: 1; }

.drawer { border-top: 1px solid var(--hair); padding-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.drawer summary { cursor: pointer; font-size: 10px; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-3); list-style: none; display: flex; justify-content: space-between; }
.drawer summary::-webkit-details-marker { display: none; }
.drawer[open] summary { margin-bottom: 6px; }
.tog { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); cursor: pointer; padding: 3px 0; }
.tog input { display: none; }
.tog i { width: 28px; height: 16px; border-radius: 8px; background: var(--hair-2); position: relative; transition: background .15s; flex-shrink: 0; }
.tog i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .18s var(--ease); }
.tog input:checked + i { background: var(--accent); }
.tog input:checked + i::after { transform: translateX(12px); }

.tools { position: absolute; right: 14px; top: 14px; display: flex; flex-direction: column; gap: 8px; z-index: 5; }
.tgroup [data-tool="layers"] { display: none; }
.tgroup [data-tool="north"] svg { transition: transform .15s; }
.tgroup { display: flex; flex-direction: column; background: var(--float); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--hair); border-radius: 12px; box-shadow: var(--float-shadow); overflow: hidden; }
.tgroup button { width: 38px; height: 38px; display: grid; place-items: center; color: var(--ink-2); }
.tgroup button + button { border-top: 1px solid var(--hair); }
.tgroup button:hover { background: var(--paper-2); color: var(--ink); }
.tgroup button.on { color: var(--accent); }
.tgroup svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tgroup .txt { font-size: 11px; font-weight: 700; letter-spacing: .02em; }

.bases { position: absolute; left: 14px; bottom: 28px; z-index: 5; display: flex; gap: 6px; align-items: center; }
.tabs-bm { display: flex; padding: 3px; gap: 2px; background: var(--float); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--hair); border-radius: 11px; box-shadow: var(--float-shadow); }
.tabs-bm button { padding: 7px 12px; border-radius: 8px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.tabs-bm button:hover { color: var(--ink); }
.tabs-bm button.on { background: var(--ink); color: var(--paper); }
.ov-wrap { position: relative; }
.ov-btn { padding: 9px 12px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); background: var(--float); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--hair); border-radius: 11px; box-shadow: var(--float-shadow); }
.ov-btn:hover { color: var(--ink); }
.ov-pop { position: absolute; bottom: calc(100% + 6px); left: 0; min-width: 190px; padding: 8px 12px; background: var(--paper); border: 1px solid var(--hair-2); border-radius: 12px; box-shadow: var(--float-shadow); }
.ov-pop .tog.dis { opacity: .4; cursor: default; }

.timeline { display: flex; align-items: center; gap: 8px; padding: 6px 10px 8px; border-top: 1px solid var(--hair); }
.timeline .play { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; flex-shrink: 0; }
.timeline .play svg { width: 13px; height: 13px; fill: currentColor; }
.years { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.years::-webkit-scrollbar { display: none; }
.years button { font-size: 12px; padding: 5px 7px; border-radius: 6px; color: var(--ink-3); font-variant-numeric: tabular-nums; position: relative; }
.years button:hover { color: var(--ink); }
.years button.on { color: var(--ink); font-weight: 700; }
.years button.on::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 1px; height: 2px; background: var(--accent); border-radius: 1px; }
.years button.from { color: var(--ink-2); font-weight: 600; }
.years button.from::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 1px; height: 2px; background: var(--ink-3); border-radius: 1px; }
.years button.span { color: var(--ink-2); }

.compare-bar { position: absolute; top: auto; bottom: 80px; z-index: 6; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; background: var(--float); backdrop-filter: blur(12px); border: 1px solid var(--hair); border-radius: 999px; box-shadow: var(--float-shadow); font-size: 12px; }
.compare-bar select { border: 1px solid var(--hair-2); border-radius: 999px; background: var(--paper); padding: 3px 8px; font-size: 12px; max-width: 190px; }
.compare-bar .x { width: 22px; height: 22px; border-radius: 50%; color: var(--ink-3); }
.compare-bar .x:hover { background: var(--paper-2); }
.side-tag { position: absolute; top: 60px; z-index: 4; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; background: var(--float); padding: 4px 9px; border-radius: 999px; border: 1px solid var(--hair); color: var(--ink-2); pointer-events: none; }

.toast { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 8; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 999px; font-size: 12.5px; display: flex; gap: 8px; align-items: center; max-width: 60%; box-shadow: var(--float-shadow); }
.toast .spin { width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; opacity: .7; }
@keyframes spin { to { transform: rotate(360deg); } }
.tip { position: absolute; z-index: 9; pointer-events: none; background: var(--ink); color: var(--paper); padding: 7px 10px; border-radius: 8px; font-size: 12px; max-width: 260px; line-height: 1.4; box-shadow: var(--float-shadow); }
.tip .t1 { font-weight: 600; }
.tip .t2 { opacity: .7; font-size: 11px; }
.tip .t3 { margin-top: 3px; font-variant-numeric: tabular-nums; }
.tip .t3 b { color: var(--accent); }
[data-theme="dark"] .tip .t3 b { color: #9a6413; }

.maplibregl-ctrl-attrib { font-size: 10px; }
.maplibregl-ctrl-bottom-right { right: 8px; }
.maplibregl-ctrl-scale { background: transparent; border-color: rgba(0, 0, 0, .45); font-size: 10px; }

/* ------------------------------------------------------------------ mobile: bottom sheet */
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .stage { grid-row: 1; grid-column: 1; }
  .side { grid-row: 1; grid-column: 1; position: fixed; left: 0; right: 0; bottom: 0; height: 48vh; height: 48dvh; border-right: 0; border-top: 1px solid var(--hair); border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .18); transition: height .28s var(--ease); z-index: 20; }
  .side.peek { height: 132px; }
  .side.full { height: 90vh; height: 90dvh; }
  .sheet-handle { display: flex; justify-content: center; padding: 8px 0 0; cursor: grab; touch-action: none; }
  .sheet-handle span { width: 40px; height: 4px; border-radius: 2px; background: var(--hair-2); }
  .mast { padding: 6px 18px 0; }
  .wordmark { font-size: 24px; }
  .search, .crumbs { margin-left: 18px; margin-right: 18px; padding-left: 0; padding-right: 0; }
  .panel { padding: 4px 18px 120px; }
  .title { font-size: 38px; }
  .band { margin: 10px -18px 4px; padding: 6px 18px 18px; }
  .lensbar { left: 10px; right: 58px; top: 10px; transform: none; width: auto; }
  .var-btn .vv { font-size: 18px; }
  .lb-row { padding: 4px 6px; }
  .lens { left: 10px; top: auto; bottom: calc(48dvh + 58px); width: calc(100% - 68px); max-width: 360px; max-height: 50%; }
  .app:has(.side.peek) .lens { bottom: 190px; }
  .lens.closed { display: none; }
  .lens-head { display: none; }
  .lens .lens-body { padding-top: 12px; }
  .tools { right: 10px; top: 10px; gap: 6px; }
  .tgroup [data-tool="layers"] { display: grid; }
  .tgroup [data-tool="zin"], .tgroup [data-tool="zout"], .tgroup [data-tool="full"], .tgroup [data-tool="png"] { display: none; }
  .tgroup button { width: 36px; height: 36px; }
  .bases { left: 10px; right: 58px; bottom: calc(48dvh + 10px); }
  .app:has(.side.peek) .bases { bottom: 142px; }
  .tabs-bm button { padding: 7px 9px; font-size: 10.5px; }
  .toast { bottom: calc(48dvh + 64px); max-width: 86%; }
  .app:has(.side.peek) .toast { bottom: 196px; }
  .compare-bar { top: auto; bottom: calc(48dvh + 64px); }
}
