:root {
  --bg: #04060a;
  --ink: #eef1f5;
  --ink-2: rgba(238, 241, 245, .66);
  --ink-3: rgba(238, 241, 245, .40);
  --ink-4: rgba(238, 241, 245, .22);
  --line: rgba(255, 255, 255, .085);
  --accent: #eef1f5;
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --pad: clamp(20px, 2.6vw, 40px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); }
body { font: 400 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; font-feature-settings: 'tnum' 1, 'cv11' 1; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
::selection { background: rgba(255, 255, 255, .2); }

#globe { position: fixed; inset: 0; cursor: grab; }
#globe:active { cursor: grabbing; }
#globe canvas { display: block; }

/* legibility without boxes: soft gradients behind text columns */
.scrim { position: fixed; pointer-events: none; z-index: 1; transition: opacity .6s var(--ease); }
.scrim-l { left: 0; top: 0; bottom: 0; width: min(520px, 42vw); background: linear-gradient(90deg, rgba(4, 6, 10, .82), rgba(4, 6, 10, .45) 55%, transparent); }
.scrim-r { right: 0; top: 0; bottom: 0; width: min(560px, 44vw); background: linear-gradient(270deg, rgba(4, 6, 10, .82), rgba(4, 6, 10, .45) 55%, transparent); }
.scrim-b { left: 0; right: 0; bottom: 0; height: 190px; background: linear-gradient(0deg, rgba(4, 6, 10, .75), transparent); }

/* ---- brand ------------------------------------------------------------------ */
.brand { position: fixed; z-index: 5; left: var(--pad); top: calc(var(--pad) - 6px); }
.wordmark { font: 400 30px/1 var(--serif); letter-spacing: -.01em; text-decoration: none; color: var(--ink); }
.wordmark i { color: var(--ink-3); }
.wordmark { display: inline-flex; align-items: center; }
.wordmark .mark { width: 1em; height: 1em; margin-right: .3em; transform: translateY(.04em); filter: drop-shadow(0 0 8px rgba(238, 241, 245, .1)); }
.status { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--ink-3); }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: #6ee7b7; box-shadow: 0 0 0 0 rgba(110, 231, 183, .5); animation: pulse 2.4s infinite; }
.pulse.stale { background: #fbbf24; animation: none; }
.sat-note { margin-top: 6px; font-size: 11.5px; color: var(--ink-3); opacity: 0; transform: translateY(-3px); transition: all .6s var(--ease); }
.sat-note.on { opacity: 1; transform: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(110, 231, 183, .45); } 70%, 100% { box-shadow: 0 0 0 8px rgba(110, 231, 183, 0); } }

.tools { position: fixed; z-index: 5; right: var(--pad); top: var(--pad); display: flex; gap: 22px; }
.tool { font-size: 13px; color: var(--ink-2); position: relative; padding: 4px 0; transition: color .25s; }
.tool::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.tool:hover { color: var(--ink); }
.tool:hover::after { transform: scaleX(1); }
.only-mobile { display: none; }

/* ---- now list (left) ---------------------------------------------------------- */
.now { position: fixed; z-index: 4; left: var(--pad); top: 128px; width: 300px; max-height: calc(100vh - 128px - 120px); display: flex; flex-direction: column; }
.now-head { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.now h2 { margin: 0; font: 400 13px/1 var(--sans); color: var(--ink-3); letter-spacing: .01em; }
.scope { display: flex; align-items: baseline; gap: 14px; font-size: 12px; white-space: nowrap; }
.scope-group { display: inline-flex; align-items: baseline; gap: 10px; padding-left: 14px; border-left: 1px solid var(--line); }
.scope-lab { color: var(--ink-4); }
.scope-lab::after { content: ':'; }
.scope button { color: var(--ink-3); transition: color .25s; position: relative; }
.scope button[aria-pressed="true"] { color: var(--ink); }
.scope button[aria-pressed="true"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: var(--ink-2); }
#nowList { list-style: none; margin: 0; padding: 0; overflow-y: auto; scrollbar-width: none; }
#nowList::-webkit-scrollbar { display: none; }

.row { position: relative; width: 100%; text-align: left; display: grid; grid-template-columns: 1fr auto; column-gap: 16px; align-items: end;
  padding: 15px 0 14px; border-top: 1px solid var(--line); transition: padding .4s var(--ease); }
.row::before { content: ''; position: absolute; left: -14px; top: 16px; bottom: 15px; width: 2px; border-radius: 2px; background: var(--c, var(--ink));
  transform: scaleY(0); transform-origin: top; transition: transform .45s var(--ease); }
.row:hover { padding-left: 4px; }
.row[aria-current="true"]::before { transform: scaleY(1); }
.row-label { font-size: 12px; color: var(--ink-3); transition: color .3s; }
.row[aria-current="true"] .row-label { color: var(--c); }
.row-place { grid-column: 1; font-size: 14px; color: var(--ink-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-value { grid-column: 2; grid-row: 1 / span 2; font: 400 34px/0.9 var(--serif); letter-spacing: -.01em; white-space: nowrap; }
.row-value small { font: 400 13px var(--sans); color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }

/* ---- detail (right) ----------------------------------------------------------- */
.detail { position: fixed; z-index: 4; right: var(--pad); top: 128px; bottom: 150px; width: 360px; overflow-y: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 40px), transparent); padding-bottom: 40px; }
.detail::-webkit-scrollbar { display: none; }
.sheet-handle { display: none; }
.d-kicker { font-size: 12px; color: var(--c, var(--ink-3)); }
.d-title { margin: 6px 0 0; font: 400 36px/1.05 var(--serif); letter-spacing: -.01em; text-wrap: balance; }
.d-sub { margin-top: 6px; color: var(--ink-2); font-size: 14px; }
.d-value { margin: 18px 0 4px; font: 400 96px/0.85 var(--serif); letter-spacing: -.03em; white-space: nowrap; }
.d-value small { font: 400 22px var(--sans); letter-spacing: 0; color: var(--ink-3); margin-left: 8px; vertical-align: 0.9em; }
.d-story { display: none; }
.d-compare { margin: 20px 0 0; font-size: 15px; line-height: 1.55; color: var(--ink-2); max-width: 34ch; }
.d-compare b { color: var(--ink); font-weight: 500; }
.d-facts { display: grid; grid-template-columns: 1fr 1fr; margin: 22px 0 0; border-top: 1px solid var(--line); }
.d-facts div { padding: 11px 0; border-bottom: 1px solid var(--line); }
.d-facts dt { font-size: 11.5px; color: var(--ink-3); }
.d-facts dd { margin: 2px 0 0; font-size: 14px; }
.d-section { margin-top: 30px; font-size: 12px; color: var(--ink-3); }
.d-list { list-style: none; margin: 8px 0 0; padding: 0; }
.d-list button { width: 100%; display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: baseline; padding: 8px 0; text-align: left;
  border-top: 1px solid var(--line); color: var(--ink-2); transition: color .2s, padding .35s var(--ease); }
.d-list button:hover { color: var(--ink); padding-left: 3px; }
.d-list button[aria-current="true"] { color: var(--ink); }
.d-list button[aria-current="true"] .n { color: var(--c); }
.d-list .n { font-size: 11px; color: var(--ink-4); }
.d-list .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.d-list .t em { font-style: normal; color: var(--ink-3); }
.d-list .v { font: 400 19px/1 var(--serif); }
.d-source { margin-top: 26px; font-size: 11.5px; color: var(--ink-4); line-height: 1.6; }
.d-credits { display: none; margin-top: 10px; font-size: 10.5px; color: var(--ink-4); }
.d-source a { color: var(--ink-3); text-underline-offset: 2px; }
.d-source a:hover { color: var(--ink); }

/* staggered entrance for whatever the detail panel renders */
.enter > * { animation: rise .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }

/* ---- bottom: home, layers, legend --------------------------------------------- */
.bottom { position: fixed; z-index: 4; left: var(--pad); right: var(--pad); bottom: 34px; display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 14px 28px; pointer-events: none; }
.bottom > * { pointer-events: auto; }
.home { font-size: 13px; color: var(--ink-3); justify-self: start; }
.home button { color: var(--ink-2); transition: color .2s; text-align: left; }
.home button:hover { color: var(--ink); }
.home b { font: 400 22px/1 var(--serif); color: var(--ink); margin-left: 6px; }
.layers { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 6px 18px; flex-wrap: wrap; justify-content: center; }
.layer { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); transition: color .3s; white-space: nowrap; padding: 4px 0; }
.layer .dot { width: 7px; height: 7px; border-radius: 50%; border: 1px solid currentColor; transition: background .3s, border-color .3s, box-shadow .3s; }
.layer[aria-pressed="true"] { color: var(--ink); }
.layer[aria-pressed="true"] .dot { background: var(--c); border-color: var(--c); box-shadow: 0 0 10px var(--c); }
.layer:hover { color: var(--ink-2); }
.layer[aria-pressed="true"]:hover { color: var(--ink); }
.legend { justify-self: center; display: flex; gap: 0 28px; align-items: flex-end; font-size: 11px; color: var(--ink-3); transition: opacity .5s var(--ease); }
.legend .lg { width: 165px; transition: opacity .5s var(--ease), width .5s var(--ease); overflow: hidden; white-space: nowrap; }
.legend .lg.off { opacity: 0; width: 0; margin-left: -28px; }
.legend .bar { height: 4px; border-radius: 4px; margin: 6px 0 5px; }
.legend .ticks { display: flex; justify-content: space-between; }
/* °C / °F */
.unit-btn { display: inline-flex; gap: 7px; }
.unit-btn span { color: var(--ink-4); transition: color .3s var(--ease); }
.unit-btn span.on { color: var(--ink); }
.unit-btn:hover span:not(.on) { color: var(--ink-2); }
/* language picker */
.lang-pick { position: relative; }
.lang-btn { display: inline-flex; align-items: center; gap: 6px; letter-spacing: .06em; }
.lang-btn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.1; opacity: .8; transition: transform .6s var(--ease); }
.lang-pick.open .lang-btn { color: var(--ink); }
.lang-pick.open .lang-btn svg, .lang-btn:hover svg { transform: rotate(-24deg); }
.lang-menu { position: absolute; right: -12px; top: calc(100% + 12px); min-width: 196px; padding: 6px;
  background: rgba(9, 12, 18, .82); -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right; pointer-events: none; visibility: hidden;
  transition: opacity .28s var(--ease), transform .38s var(--ease), visibility 0s .38s; }
.lang-pick.open .lang-menu { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .28s var(--ease), transform .38s var(--ease); }
.lang-menu a { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 9px 12px 9px 26px; border-radius: 9px;
  color: var(--ink-2); text-decoration: none; position: relative; transition: background .2s, color .2s; outline: none; }
.lang-menu a:hover, .lang-menu a:focus-visible { background: rgba(255, 255, 255, .055); color: var(--ink); }
.lang-menu .ln { font: 400 19px/1.1 var(--serif); letter-spacing: -.005em; }
.lang-menu .lc { font-size: 10.5px; letter-spacing: .1em; color: var(--ink-4); }
.lang-menu a[aria-checked="true"] { color: var(--ink); }
.lang-menu a[aria-checked="true"]::before { content: ''; position: absolute; left: 11px; top: 50%; width: 5px; height: 5px; margin-top: -2px;
  border-radius: 50%; background: var(--accent, #7dd3fc); box-shadow: 0 0 10px var(--accent, #7dd3fc); }
.lang-pick .lang-menu a { opacity: 0; transform: translateY(-3px); transition: opacity .3s var(--ease), transform .4s var(--ease), background .2s, color .2s; }
.lang-pick.open .lang-menu a { opacity: 1; transform: none; }
.lang-pick.open .lang-menu a:nth-child(2) { transition-delay: .03s, .03s, 0s, 0s; }
.lang-pick.open .lang-menu a:nth-child(3) { transition-delay: .06s, .06s, 0s, 0s; }
.lang-pick.open .lang-menu a:nth-child(4) { transition-delay: .09s, .09s, 0s, 0s; }
@media (prefers-reduced-motion: reduce) { .lang-menu, .lang-menu a, .lang-btn svg { transition: none !important; } }
.tool.lang option { background: #0b0f16; color: #eef1f5; }
.prerender { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* time slider: look back up to 24 h */
.timebar { display: flex; align-items: center; gap: 12px; font-size: 11.5px; color: var(--ink-3); margin-bottom: 12px; }
.timebar input[type=range] { -webkit-appearance: none; appearance: none; width: 220px; height: 18px; background: transparent; cursor: pointer; }
.timebar input[type=range]::-webkit-slider-runnable-track { height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--ink-4) 0 var(--p, 100%), rgba(238,241,245,.7) var(--p, 100%)); }
.timebar input[type=range]::-moz-range-track { height: 2px; background: var(--ink-4); }
.timebar input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -5px; border-radius: 50%;
  background: var(--ink); box-shadow: 0 0 0 4px rgba(238,241,245,.08), 0 0 12px rgba(125,211,252,.5); transition: transform .2s var(--ease); }
.timebar input[type=range]:active::-webkit-slider-thumb { transform: scale(1.25); }
.timebar input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--ink); }
.tb-now { color: var(--ink-3); transition: color .25s; }
.timebar.past .tb-now { color: #7dd3fc; }
.tb-out { color: var(--ink-2); min-width: 9em; }
.timebar[hidden] { display: none; }
.credits { position: fixed; z-index: 4; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 10.5px; color: var(--ink-4); letter-spacing: .02em; pointer-events: none; }

/* ---- labels on the globe --------------------------------------------------------- */
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
.label { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 12px; color: var(--ink); transition: opacity .35s; will-change: transform; text-shadow: 0 1px 8px rgba(0, 0, 0, .9); }
.label.sel { font: 400 18px/1 var(--serif); }
.label.sel span { display: block; font: 400 11.5px var(--sans); color: var(--ink-2); margin-top: 3px; }
.label.home { color: #7dd3fc; font-size: 11.5px; }

/* ---- tooltip, toast ---------------------------------------------------------------- */
#tooltip { position: fixed; z-index: 8; left: 0; top: 0; pointer-events: none; padding: 7px 10px; border-radius: 8px; background: rgba(8, 11, 17, .82);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink); opacity: 0; transition: opacity .15s; white-space: nowrap; }
#tooltip.on { opacity: 1; }
#tooltip span { color: var(--ink-3); }
#toast { position: fixed; z-index: 9; left: 50%; bottom: 96px; transform: translate(-50%, 8px); opacity: 0; transition: all .35s var(--ease); font-size: 13px;
  padding: 9px 14px; border-radius: 99px; background: rgba(238, 241, 245, .95); color: #05070b; pointer-events: none; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---- intro ------------------------------------------------------------------------- */
.brand, .tools, .now, .detail, .bottom, .credits { transition: opacity .9s var(--ease), transform .9s var(--ease); }
body.loading .now, body.loading .detail, body.loading .bottom { opacity: 0; transform: translateY(8px); }
body.loading .tools, body.loading .credits { opacity: 0; }
.now li { animation: rise .8s var(--ease) both; animation-delay: calc(200ms + var(--i, 0) * 70ms); }
body.loading .now li { animation: none; opacity: 0; }

/* ---- story 9:16 mode --------------------------------------------------------------- */
.story-ui { position: fixed; inset: 0; z-index: 6; display: none; align-items: center; justify-content: center; pointer-events: none; }
.story-frame { position: relative; height: min(92vh, 1600px); aspect-ratio: 9 / 16; max-width: 92vw; display: flex; flex-direction: column; justify-content: space-between;
  padding: 26px 24px; box-shadow: 0 0 0 200vmax rgba(2, 3, 6, .86); border-radius: 18px; outline: 1px solid var(--line); }
.story-top { display: flex; align-items: center; justify-content: space-between; pointer-events: auto; }
.story-top .wordmark { font-size: 24px; }
.story-actions { display: flex; gap: 18px; }
.story-photo { position: absolute; inset: 0; border-radius: 18px; overflow: hidden; opacity: 0; transition: opacity 1.4s var(--ease); pointer-events: none; z-index: -1; }
.story-photo img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); }
.story-photo.on { opacity: 1; }
.story-photo.on img { animation: kenburns 14s ease-out forwards; }
@keyframes kenburns { from { transform: scale(1.12) translateY(1.5%); } to { transform: scale(1.0) translateY(0); } }
.story-credit { position: absolute; left: 24px; right: 24px; top: 62px; font-size: 10.5px; color: rgba(238, 241, 245, .7); text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
  opacity: 0; transition: opacity 1.2s var(--ease); pointer-events: auto; }
.story-credit.on { opacity: 1; }
.story-credit a { color: inherit; }
.story-frame { isolation: isolate; }
body.story #labels, body.story #tooltip { opacity: 0 !important; }
.story-caption { background: linear-gradient(0deg, rgba(4, 6, 10, .94) 55%, transparent); margin: 0 -24px -26px; padding: 90px 24px 26px; border-radius: 0 0 18px 18px; }
.story-caption .k { font-size: 13px; color: var(--c, var(--ink-2)); }
.story-caption .t { font: 400 34px/1.05 var(--serif); margin-top: 4px; }
.story-caption .v { font: 400 76px/0.9 var(--serif); margin-top: 12px; letter-spacing: -.02em; }
.story-caption .v small { font: 400 20px var(--sans); color: var(--ink-3); margin-left: 6px; vertical-align: .9em; }
.story-caption .s { font-size: 13.5px; color: var(--ink-2); margin-top: 6px; }
.story-caption .c { font-size: 13px; line-height: 1.5; color: var(--ink-2); margin: 12px 0 0; }
.story-caption .c b { color: var(--ink); font-weight: 500; }
.story-caption .f { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; margin: 14px 0 0; }
.story-caption .f div { border-top: 1px solid var(--line); padding: 7px 0; }
.story-caption .f dt { font-size: 10.5px; color: var(--ink-3); }
.story-caption .f dd { margin: 1px 0 0; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* share sheet */
.share-sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: rgba(2, 3, 6, .55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
.share-sheet.open { opacity: 1; pointer-events: auto; }
.share-card { width: min(440px, calc(100vw - 32px)); padding: 22px 22px 18px; border-radius: 16px; background: rgba(10, 13, 19, .96); border: 1px solid var(--line);
  transform: translateY(10px); transition: transform .4s var(--ease); }
.share-sheet.open .share-card { transform: none; }
.share-head { display: flex; justify-content: space-between; align-items: baseline; font: 400 26px var(--serif); }
.share-preview { margin: 8px 0 16px; font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.share-btn { text-align: left; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); transition: color .2s, padding .3s var(--ease); }
.share-btn:hover { color: var(--ink); padding-left: 3px; }
.share-btn small { display: block; font-size: 11px; color: var(--ink-4); }
@media (max-width: 820px) { .share-sheet { align-items: flex-end; } .share-card { width: 100%; border-radius: 16px 16px 0 0; } }
body.story .story-ui { display: flex; }
body.story .brand, body.story .tools, body.story .now, body.story .detail, body.story .bottom, body.story .credits, body.story .scrim { opacity: 0; pointer-events: none; }

/* ---- mobile ------------------------------------------------------------------------ */
@media (max-width: 820px) {
  :root { --pad: 18px; }
  .wordmark { font-size: 25px; }
  .scrim-l, .scrim-r { display: none; }
  .scrim-b { height: 62vh; background: linear-gradient(0deg, rgba(4, 6, 10, .96) 30%, rgba(4, 6, 10, .6) 60%, transparent); }
  .only-mobile { display: inline; }
  #btnStory { display: none; }
  .tools { top: 22px; gap: 18px; }

  .now { top: 86px; left: 0; width: 100%; max-height: none; }
  .now-head { padding: 0 var(--pad); margin-bottom: 6px; }
  #nowList { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-left: var(--pad); padding: 0 var(--pad); gap: 22px; }
  #nowList li { scroll-snap-align: start; flex: none; }
  .row { border-top: 0; padding: 6px 0; display: block; }
  .row:hover { padding-left: 0; }
  .row::before { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 1px; transform: scaleX(0); transform-origin: left; }
  .row[aria-current="true"]::before { transform: scaleX(1); }
  .row-label, .row-place { display: block; }
  .row-value { display: block; font-size: 26px; margin-top: 4px; }
  .row-place { font-size: 12.5px; max-width: 150px; }

  .detail { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 34vh; padding: 0 var(--pad) 72px; transition: max-height .5s var(--ease), opacity .9s var(--ease);
    -webkit-mask-image: none; mask-image: none; overflow-y: hidden; }
  .detail.open { max-height: 76vh; overflow-y: auto; }
  .sheet-handle { display: block; width: 100%; height: 22px; position: sticky; top: 0; z-index: 2; }
  .sheet-handle::before { content: ''; display: block; width: 36px; height: 3px; border-radius: 3px; background: var(--ink-4); margin: 8px auto 0; }
  .d-title { font-size: 28px; }
  .d-value { font-size: 64px; margin-top: 10px; }
  .d-compare { font-size: 14px; margin-top: 12px; }

  .bottom { bottom: 26px; grid-template-columns: 1fr; z-index: 5; pointer-events: none; }
  .home { display: none; }
  .legend { display: none; }
  .layers { position: fixed; right: var(--pad); top: 56px; flex-direction: column; align-items: flex-end; gap: 10px; padding: 14px 16px; border-radius: 12px;
    background: rgba(8, 11, 17, .92); border: 1px solid var(--line); opacity: 0; transform: translateY(-6px); pointer-events: none; transition: all .3s var(--ease); }
  .layers.open { opacity: 1; transform: none; pointer-events: auto; }
  .credits { display: none; }
  .d-credits { display: block; }
  .story-frame { height: 100vh; max-width: 100vw; border-radius: 0; }
  /* story: on phones the button lives in the detail sheet, next to what you picked */
  .d-story { display: inline-flex; align-items: center; gap: 7px; position: absolute; right: var(--pad); top: 30px; z-index: 3;
    padding: 7px 13px 7px 11px; border-radius: 999px; font-size: 12.5px; color: var(--ink);
    background: rgba(255, 255, 255, .06); border: 1px solid color-mix(in srgb, var(--c, #fff) 45%, transparent);
    box-shadow: 0 0 18px color-mix(in srgb, var(--c, #fff) 18%, transparent); }
  .d-story svg { width: 10px; height: 10px; fill: var(--c, var(--ink)); }
  .d-story:active { transform: scale(.96); }
  /* time slider: a slim strip just above the collapsed detail sheet; hidden while the sheet is open */
  .timebar { position: fixed; left: var(--pad); right: var(--pad); bottom: calc(34vh + 6px); margin: 0; gap: 10px; pointer-events: auto;
    padding: 6px 12px; border-radius: 999px; background: rgba(8, 11, 17, .72); border: 1px solid var(--line);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: opacity .3s var(--ease); }
  .timebar input[type=range] { flex: 1; width: auto; min-width: 0; height: 28px; }
  .timebar input[type=range]::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -8px; }
  .tb-edge { font-size: 11px; }
  .tb-out { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); min-width: 0; white-space: nowrap;
    padding: 3px 10px; border-radius: 999px; background: rgba(8, 11, 17, .8); font-size: 11.5px; }
  .tb-out:empty { display: none; }
  .detail.open ~ .bottom .timebar { opacity: 0; pointer-events: none; }
  .detail .d-kicker, .detail .d-title { padding-right: 104px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* short screens: keep the story picture visible */
@media (max-height: 760px) {
  .story-caption .c { display: none; }
  .story-caption .f div:nth-child(n+5) { display: none; }
  .story-caption .v { font-size: 56px; }
  .story-caption .t { font-size: 28px; }
}
.legend .sw { display: flex; align-items: center; gap: 5px; margin-top: 6px; }
.legend .sw i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-left: 6px; }
.legend .sw i:first-child { margin-left: 0; }

/* city labels (appear as you zoom in) */
.city { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 11px; color: rgba(238, 241, 245, .82);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .95), 0 0 2px rgba(0, 0, 0, .9); opacity: 0; transition: opacity .4s var(--ease); margin-top: -8px; }
.city.on { opacity: 1; }
.city i { width: 4px; height: 4px; border-radius: 50%; background: rgba(238, 241, 245, .9); box-shadow: 0 0 4px rgba(0, 0, 0, .8); flex: none; }
.city b { font-weight: 500; color: rgba(238, 241, 245, .55); }
.city b.m { color: rgba(238, 241, 245, .95); }          /* measured at a nearby station */
.city.cap { font-size: 11.5px; color: var(--ink); }
.city.cap i { width: 5px; height: 5px; background: var(--ink); }

/* ---- mobile tidy-up ------------------------------------------------------------------ */
@media (max-width: 820px) {
  .sat-note { display: none; }
  .status { font-size: 11px; margin-top: 6px; }
  .now { top: 76px; }
  .now-head { margin-bottom: 4px; }
  .now h2 { font-size: 11.5px; }
  .scope { gap: 12px; font-size: 11.5px; }
  #nowList { gap: 16px; padding-bottom: 6px; }
  #nowList li { width: 108px; }
  .row-label { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .row-place { font-size: 11.5px; max-width: 108px; }
  .row-value { font-size: 23px; margin-top: 3px; }
  .row-value small { font-size: 10.5px; }

  /* bottom sheet: collapsed = just what it is, where, how much; tap to open the rest */
  .detail { max-height: 27vh; cursor: pointer; }
  .detail.open { max-height: 78vh; cursor: auto; }
  .detail:not(.open) .d-compare, .detail:not(.open) .d-facts, .detail:not(.open) .d-section,
  .detail:not(.open) .d-list, .detail:not(.open) .d-source, .detail:not(.open) .d-credits { display: none; }
  .detail:not(.open) .d-value { margin-bottom: 0; }
  .detail:not(.open)::after { content: 'Ťukni pre viac'; display: block; margin-top: 8px; font-size: 11px; color: var(--ink-4); }
  .d-kicker { font-size: 11px; }
  .d-title { font-size: 25px; }
  .d-sub { font-size: 13px; }
  .d-value { font-size: 52px; margin-top: 8px; }
  .d-value small { font-size: 17px; }
  .d-facts { margin-top: 16px; }
  .d-facts dd { font-size: 13px; }
  .scrim-b { height: 46vh; }

  .layers { max-height: 70vh; overflow-y: auto; }
  .city { font-size: 10px; }
  .city.cap { font-size: 10.5px; }
}
@media (max-width: 820px) {
  .detail { transition: max-height .5s var(--ease), background .4s var(--ease), padding .4s var(--ease); }
  .detail.open { background: linear-gradient(180deg, rgba(4, 6, 10, .72), rgba(4, 6, 10, .96) 90px); border-radius: 16px 16px 0 0; padding-top: 4px;
    box-shadow: 0 -20px 40px rgba(4, 6, 10, .6); }
}

/* donate: a quiet accent, not a banner */
.tool.donate { color: #f7c873; }
.tool.donate:hover { color: #ffe0a3; }
a.share-btn { text-decoration: none; display: block; }
.donate-widget { margin: 0 0 14px; border-radius: 12px; overflow: hidden; background: #fff; }
.donate-widget iframe { display: block; width: 100%; height: min(470px, 62vh); border: 0; }
.donate-widget + .share-grid { grid-template-columns: 1fr; }

/* after-share nudge */
.nudge { position: fixed; z-index: 21; left: 50%; bottom: 96px; width: min(380px, calc(100vw - 32px)); transform: translate(-50%, 16px); opacity: 0;
  transition: all .5s var(--ease); padding: 14px 16px; border-radius: 14px; background: rgba(10, 13, 19, .96); border: 1px solid var(--line);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5); font-size: 13px; color: var(--ink-2); }
.nudge.on { opacity: 1; transform: translate(-50%, 0); }
.nudge p { margin: 0 0 10px; line-height: 1.5; }
.nudge b { color: var(--ink); font-weight: 500; }
.nudge div { display: flex; gap: 16px; }
.nudge button { font-size: 13px; padding: 4px 0; }
.nudge .nudge-yes { color: #f7c873; }
.nudge .nudge-no { color: var(--ink-3); }
@media (max-width: 820px) { .nudge { bottom: 30vh; } }
