/* The shell of kyianyn-routine.isakov.fyi (header, tabs, footer, help dialog, toast, privacy page) and tab 1
   "Відповідь": the answer first, big, in the colour of its tier. Colors, fonts, radii, shadows and easing only
   from tokens.css: pink is the brand (logo, tabs, links, focus); green, amber and red carry the meaning. */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--body);
  font: 400 16px/1.55 var(--font);
}

main { flex: 1 0 auto; }
h1, h2, h3, p, dl, dd { margin: 0; }
button { font: inherit; color: inherit; }
a { color: var(--ink); text-decoration-color: var(--pink); text-underline-offset: 3px; }
a:hover { color: var(--pink); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }
a:focus-visible { border-radius: var(--r-small); }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }

.ico { display: inline-flex; flex: none; width: 20px; height: 20px; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Header: the bridge mark and the short name, the two tabs, the live dot, the keys button */

.top { position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: 1px solid var(--line); }

.top-in {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "logo tabs live help";
  align-items: center;
  gap: 10px 20px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.top-simple { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; }

.logo {
  grid-area: logo;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font: 800 17px/1.2 var(--font-display);
  text-decoration: none;
  white-space: nowrap;
}
.logo-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.logo:hover { color: var(--ink); }
.logo svg { flex: none; width: 30px; height: 30px; fill: none; stroke: var(--pink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform 300ms var(--ease); }
.logo:hover svg { transform: translateY(-2px); }

.tabs { grid-area: tabs; display: flex; gap: 6px; }

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); border-color: var(--pink); }
.tab:focus-visible { border-radius: var(--r-pill); }
.tab[aria-current="page"] { background: var(--pink); border-color: var(--pink); color: var(--card); }

.live {
  grid-area: live;
  justify-self: end;
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--body);
  font-size: 14px;
  cursor: pointer;
}
.live:hover { border-color: var(--pink); }
.live-dot { flex: none; width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--go); }
.live.is-empty .live-dot { background: var(--soft); }
.live-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live .ico { display: none; width: 18px; height: 18px; }
.live.is-stale { border-color: var(--risk-fill); background: var(--risk-soft); color: var(--risk); font-weight: 600; }
.live.is-stale .live-dot { display: none; }
.live.is-stale .ico { display: inline-flex; }

.help-btn {
  grid-area: help;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--ink);
  font: 800 16px/1 var(--font-display);
  cursor: pointer;
}
.help-btn:hover { border-color: var(--pink); color: var(--pink); }

/* Blocks (tab 1, the charts, some scenes of the deck) */

.tab-main { display: grid; gap: 16px; padding-top: 16px; }
.tab-how { padding-top: 28px; }

.block {
  position: relative;
  min-width: 0;
  padding: 28px 32px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  scroll-margin-top: 92px;
}
.block:focus { outline: none; }
.block > h2 { margin-bottom: 14px; font: 700 clamp(20px, 2.2vw, 26px)/1.2 var(--font-display); color: var(--ink); }

.lead { max-width: 72ch; margin-bottom: 18px; font-size: 17px; }
.sub { margin: 22px 0 10px; font: 700 17px/1.3 var(--font); color: var(--ink); }
.src { font-size: 14px; color: var(--soft); }
p.src { margin-top: 12px; }
.calm { padding: 16px 18px; border: 1px dashed var(--line); border-radius: var(--r-card); background: var(--paper); color: var(--soft); font-size: 15px; }
.note { margin-top: 16px; padding: 12px 16px; border-left: 4px solid var(--pink); border-radius: var(--r-small); background: var(--paper); font-size: 15px; }
.note b { color: var(--ink); }
.tip { position: absolute; left: 12px; right: 12px; z-index: 2; padding: 10px 12px; border-radius: var(--r-small); background: var(--ink); color: var(--card); font-size: 14px; line-height: 1.4; box-shadow: var(--shadow-pink); pointer-events: none; animation: fade 200ms var(--ease) both; }

/* a) the first screen: alert chip, answer, line, question, crossing picture, probability, chips. The hero takes the
   soft colour of the tier and the answer, the number and the chip icons its strong colour. */

.block.hero {
  --tone: var(--soft);
  --tone-soft: var(--card);
  --answer-h: clamp(84px, 25vw, 124px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 32px 28px;
  border-color: transparent;
  background: var(--tone-soft);
  text-align: center;
}
.hero[data-tier="none"] { border-color: var(--line); }
.hero[data-tier="low"] { --tone: var(--go); --tone-soft: var(--go-soft); }
.hero[data-tier="medium"] { --tone: var(--risk); --tone-soft: var(--risk-soft); }
.hero[data-tier="high"] { --tone: var(--stop); --tone-soft: var(--stop-soft); }

.hero-alert { margin-bottom: 4px; }
.hero-alert:empty, .hero-window:empty, .hero-p:empty, .hero-chips:empty { display: none; }
.alert-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 14px 0 10px; border-radius: var(--r-pill); font-size: 15px; font-weight: 700; animation: rise 300ms var(--ease) both; }
.alert-chip .ico { width: 18px; height: 18px; }
.alert-red { background: var(--stop); color: var(--card); }
.alert-yellow { background: var(--risk-fill); color: var(--ink); }

.hero-answer { display: flex; align-items: center; justify-content: center; width: 100%; height: var(--answer-h); }
.hero .answer { margin: 0; font: 800 var(--answer-h)/1 var(--font-display); letter-spacing: -.02em; color: var(--tone); white-space: nowrap; animation: rise 360ms var(--ease) both; }
.hero .answer-medium { font-size: clamp(30px, 9vw, 88px); }
.hero .answer-wait { font-size: clamp(24px, 6vw, 40px); letter-spacing: 0; color: var(--soft); white-space: normal; }
.hero-line { font: 700 clamp(17px, 1.7vw, 21px)/1.3 var(--font); color: var(--ink); }
.hero[data-tier="none"] .hero-line { font-weight: 500; color: var(--soft); }
.hero-q { max-width: 60ch; margin-top: 14px; font: 600 15px/1.4 var(--font); color: var(--body); text-wrap: balance; }
.hero-window { margin-top: 2px; font-size: 14px; color: var(--soft); }

/* The crossing picture: a fixed 2:1 box. hero.js draws in it when present; until then the train on the bridge. */
.hero-map { position: relative; width: 100%; max-width: 600px; aspect-ratio: 2 / 1; margin-top: 18px; overflow: hidden; border-radius: var(--r-card); background: var(--card); }
.hero-map:has(.train:focus-visible) { box-shadow: var(--focus-ring); }
.hero-map .train { width: 100%; height: 100%; max-width: none; padding: 0; border: 0; border-radius: 0; background: none; }
.hero-map .train:focus-visible { box-shadow: none; }
.hero-map .train-svg { height: 100%; }
.hero-map .train-svg .river { fill: var(--m2); opacity: .14; }
.hero-map .train-svg .wave { stroke: var(--m2); opacity: .45; }
.hero-map .train-svg .arch { stroke: var(--go); stroke-width: 3.5; }
.hero-map .train[data-m1="limited"] .arch { stroke: var(--risk-fill); }
.hero-map .train[data-m1="closed"] .arch { stroke: var(--stop); }
.hero-map .train[data-m1="unknown"] .arch { stroke: var(--soft); }
.hero-map .train-svg .train-car rect { fill: var(--m1); }
.hero-map .train-svg text { fill: var(--soft); }
.hero-map .train-svg .river-name { fill: var(--m2); }

.hero-p { width: 100%; max-width: 520px; margin-top: 18px; }
.p-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
.p-num { font: 800 clamp(28px, 6.6vw, 56px)/1 var(--font-display); color: var(--tone); }
.p-label { max-width: 22ch; font-size: 15px; line-height: 1.3; text-align: left; color: var(--body); }
.meter { margin-top: 14px; }
.meter-bar { position: relative; display: flex; height: 10px; }
.zone-go { background: var(--go); border-radius: var(--r-pill) 0 0 var(--r-pill); }
.zone-risk { background: var(--risk-fill); }
.zone-stop { flex: 1; background: var(--stop); border-radius: 0 var(--r-pill) var(--r-pill) 0; }
.meter-mark { position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 4px solid var(--card); border-radius: var(--r-pill); background: var(--ink); box-shadow: var(--shadow-pink); animation: pop 320ms var(--ease) 120ms both; }
.meter-ticks { position: relative; height: 18px; margin-top: 8px; font-size: 13px; line-height: 18px; color: var(--soft); }
.meter-ticks span { position: absolute; top: 0; white-space: nowrap; }
.meter-ticks .to-left { transform: translateX(calc(-100% - 3px)); }
.meter-ticks .to-right { transform: translateX(3px); }

.hero-chips { width: 100%; }
.chips { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 36px; padding: 6px 14px 6px 10px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--card); color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.25; text-align: left; cursor: help; }
.chip:hover { border-color: var(--pink); }
.chip .ico { width: 18px; height: 18px; color: var(--tone); }
.chips .tip, .pills-box .tip, .reasons-box .tip { left: 0; right: 0; text-align: left; }

/* b) what crosses the Dnipro now */

.block.strip { padding: 20px 28px; }
.block.strip > h2 { margin-bottom: 12px; font-size: clamp(18px, 1.8vw, 22px); }
.pills-box { position: relative; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px 0 8px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--card); color: var(--ink); font-size: 14px; font-weight: 600; cursor: help; }
.pill:hover { box-shadow: var(--shadow-pink); }
.pill .ico { width: 18px; height: 18px; }
.pill-open { border-color: var(--go); background: var(--go-soft); }
.pill-open .ico { color: var(--go); }
.pill-limited { border-color: var(--risk-fill); background: var(--risk-soft); }
.pill-limited .ico { color: var(--risk); }
.pill-closed { border-color: var(--stop); background: var(--stop-soft); }
.pill-closed .ico { color: var(--stop); }
.pill-unknown { border-style: dashed; border-color: var(--soft); background: var(--paper); }
.pill-unknown .ico { color: var(--soft); }
.metro { flex: none; width: 10px; height: 10px; border-radius: var(--r-pill); }
.metro-m1 { background: var(--m1); }
.metro-m3 { background: var(--m3); }
.cross-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 12px; font-size: 14px; color: var(--soft); }
.cross-line > .ico { width: 18px; height: 18px; color: var(--pink); }
.cross-line > span:not(.ico) { flex: 1 1 220px; min-width: 0; }
.srcs summary { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-pill); color: var(--ink); font-weight: 600; cursor: pointer; list-style: none; }
.srcs summary::-webkit-details-marker { display: none; }
.srcs summary:hover { border-color: var(--pink); }
.srcs summary:focus-visible { border-radius: var(--r-pill); }
.srcs[open] { flex-basis: 100%; }
.srcs ul { display: grid; gap: 4px; margin: 10px 0 0; padding-left: 20px; }

/* Folded blocks: why, glossary, live sources */

.block.fold-block { padding: 0; }
.fold > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; padding: 12px 28px; border-radius: var(--r-card); cursor: pointer; list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary h2 { font: 700 clamp(18px, 1.8vw, 22px)/1.25 var(--font-display); color: var(--ink); }
.fold > summary:hover h2 { color: var(--pink); }
.fold > summary .ico { color: var(--pink); transition: transform 240ms var(--ease); }
.fold[open] > summary .ico { transform: rotate(180deg); }
.fold-body { padding: 0 28px 22px; }

/* c) reasons */

.reasons-box { position: relative; }
.reason-axis { display: flex; justify-content: space-between; margin: 0 76px 6px 12px; font-size: 13px; color: var(--soft); }
.reasons { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.reason { padding: 10px 12px; border-radius: var(--r-small); cursor: help; }
.reason:hover, .reason:focus-visible { background: var(--paper); }
.reason-text { display: flex; justify-content: space-between; gap: 12px; color: var(--ink); }
.reason-val { white-space: nowrap; }
.reason-bar { display: grid; grid-template-columns: minmax(0, 1fr) 56px; align-items: center; gap: 8px; margin-top: 6px; }
.reason-track { position: relative; display: block; height: 12px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--card); }
.reason-track::after { content: ""; position: absolute; top: -5px; bottom: -5px; left: 50%; width: 2px; margin-left: -1px; background: var(--soft); }
.reason-fill { position: absolute; top: 0; bottom: 0; border-radius: var(--r-pill); animation: grow 380ms var(--ease) both; }
.reason-fill.up { background: var(--stop); transform-origin: left center; }
.reason-fill.down { background: var(--go); transform-origin: right center; }
.reason-w { font: 700 15px/1 var(--font-display); color: var(--ink); text-align: right; }

/* d) glossary */

.gloss { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 8px; }
.gloss div { padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-card); }
.gloss dt { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); }
.gloss dd { font-size: 14px; }

.sw { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: var(--r-pill); }
.sw-go { background: var(--go); }
.sw-risk { background: var(--risk-fill); }
.sw-stop { background: var(--stop); }
.sw-low { background: var(--line); }
.sw-mid { border: 1px solid var(--pink); background: var(--pink-soft); }
.sw-high, .sw-m { background: var(--pink); }
.sw-d { border: 2px solid var(--ink); background: var(--card); }

/* e) the charts slot (charts.js draws inside) */

#charts [data-chart] + [data-chart] { margin-top: 16px; }

/* f) live sources */

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 12px; margin-top: 18px; }
.facts div { padding: 12px 16px; border-radius: var(--r-card); background: var(--paper); }
.facts dt { font-size: 14px; color: var(--soft); }
.facts dd { margin-top: 2px; color: var(--ink); font-weight: 600; }
#sources .facts { gap: 8px; margin-top: 0; }
.chans { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.chan { display: grid; gap: 2px; min-width: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-card); }
.chan-name { overflow: hidden; color: var(--ink); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.chan-ago, .chan-n { font-size: 14px; color: var(--soft); }
.chan.is-old { background: var(--paper); }
#sources .chans { grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 6px; margin-top: 12px; }
#sources .chan { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; font-size: 14px; }
#sources .chan-ago { flex: none; }
.safety { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 16px; border-radius: var(--r-card); background: var(--ink); color: var(--card); font-weight: 600; }
.safety .ico { color: var(--pink); }

/* Older pieces some scenes of the deck may reuse */

.answer { margin: 18px 0 12px; font: 800 clamp(34px, 4.4vw, 56px)/1.05 var(--font-display); color: var(--ink); animation: rise 360ms var(--ease) both; }
.tier { display: inline-flex; align-items: center; min-height: 32px; padding: 0 14px; border-radius: var(--r-pill); font-size: 15px; font-weight: 600; }
.tier-low { border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.tier-medium { background: var(--pink-soft); color: var(--ink); }
.tier-high { background: var(--pink); color: var(--card); }
.honest { max-width: 62ch; margin-top: 10px; font-size: 16px; }
.scale { max-width: 560px; margin-top: 22px; }
.scale-row { position: relative; height: 24px; }
.scale-bottom { margin-top: 8px; font-size: 13px; color: var(--soft); }
.scale-bar { position: relative; display: flex; height: 14px; }
.zone { height: 100%; }
.zone-low { background: var(--line); border-radius: var(--r-pill) 0 0 var(--r-pill); }
.zone-mid { background: var(--pink-soft); }
.zone-high { flex: 1; background: var(--pink); border-radius: 0 var(--r-pill) var(--r-pill) 0; }
.scale-tick { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; border-radius: var(--r-pill); background: var(--ink); }
.scale-dot { position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 3px solid var(--card); border-radius: var(--r-pill); background: var(--ink); box-shadow: var(--shadow-pink); animation: pop 320ms var(--ease) 120ms both; }
.scale-p { position: absolute; bottom: 2px; font: 800 15px/1 var(--font-display); color: var(--ink); white-space: nowrap; }
.scale-p.align-mid { transform: translateX(-50%); }
.scale-p.align-end { transform: translateX(-100%); }
.scale-num, .scale-end { position: absolute; top: 0; white-space: nowrap; }
.scale-num.to-left { transform: translateX(calc(-100% - 4px)); }
.scale-num.to-right { transform: translateX(4px); }
.scale-end { left: 0; }
.scale-end.end-right { left: auto; right: 0; }
.scale-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 14px; }
.scale-legend li { display: inline-flex; align-items: center; gap: 6px; }
.crosses { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.cross { display: grid; align-content: start; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); }
.cell { aspect-ratio: 1; border-radius: var(--r-small); animation: pop 300ms var(--ease) both; }
.cell-m { background: var(--pink); }
.cell-d { border: 2px solid var(--ink); background: var(--card); }
.sources { margin-top: 14px; }
.sources summary { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r-pill); color: var(--ink); font-size: 15px; font-weight: 600; cursor: pointer; list-style: none; }
.sources summary::-webkit-details-marker { display: none; }
.sources summary:hover { border-color: var(--pink); }
.sources ul { display: grid; gap: 6px; margin: 12px 0 0; padding-left: 20px; font-size: 15px; }

/* The train on the bridge (the fallback crossing picture of tab 1) */

.train-tip { position: absolute; top: 10px; left: 50%; z-index: 3; width: max-content; max-width: calc(100% - 24px); padding: 8px 12px; border-radius: var(--r-small); background: var(--ink); color: var(--card); font-size: 14px; line-height: 1.35; text-align: center; transform: translateX(-50%); box-shadow: var(--shadow-pink); pointer-events: none; animation: fade 200ms var(--ease) both; }
.train { display: block; width: 100%; max-width: 440px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); cursor: pointer; transition: transform 240ms var(--ease); }
.train:hover { border-color: var(--pink); }
.train:active { transform: scale(.98); }
.train:focus-visible { border-radius: var(--r-card); }
.train-svg { display: block; width: 100%; height: auto; }
.train-svg .bank { fill: var(--line); }
.train-svg .river { fill: var(--pink-soft); }
.train-svg .wave { fill: none; stroke: var(--pink); stroke-width: 2; stroke-linecap: round; opacity: .55; }
.train-svg .arch { fill: none; stroke: var(--pink); stroke-width: 3; stroke-linecap: round; }
.train-svg .pier, .train-svg .deck { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.train-svg .train-car rect { fill: var(--pink); }
.train-svg .win { fill: none; stroke: var(--card); stroke-width: 2.4; stroke-linecap: round; }
.train-svg text { font: 600 13px var(--font); fill: var(--body); text-anchor: middle; }

/* Loading. Until the first data (and the web fonts) the hero shows only a skeleton in the place and about the size
   of the answer, the picture and the number; the other blocks and the live pill wait with display none, so they
   count as new when they show, not as moved. */
.app { min-height: 100vh; }
.is-loading .tab-main > section:not(#hero), .is-loading .hero > :not(.hero-sk), .is-loading .live { display: none; }
.hero-sk { display: none; width: 100%; }
.is-loading .hero-sk { display: flex; flex-direction: column; align-items: center; }
.sk { display: block; border-radius: var(--r-small); background: var(--line); opacity: .6; }
.sk-answer { width: min(50%, 300px); height: calc(var(--answer-h) * .76); margin: calc(var(--answer-h) * .12) 0; border-radius: var(--r-card); }
.sk-line { width: min(70%, 320px); height: 22px; }
.sk-q { width: min(90%, 440px); height: 18px; margin-top: 16px; }
.sk-map { width: 100%; max-width: 600px; aspect-ratio: 2 / 1; margin-top: 20px; border-radius: var(--r-card); }
.sk-p { width: min(80%, 400px); height: 56px; margin-top: 18px; border-radius: var(--r-card); }

/* Footer */

.foot { margin-top: 36px; border-top: 1px solid var(--line); }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-top: 22px; padding-bottom: 32px; font-size: 14px; color: var(--soft); }
.foot-links { display: flex; align-items: center; gap: 18px; }
.credit { color: var(--pink); font: 800 15px/1 var(--font-display); text-decoration: none; }
.credit:hover { color: var(--ink); }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }

/* Help dialog and toast */

.help { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: var(--r-card); background: var(--card); color: var(--body); box-shadow: var(--shadow-pink); }
.help[open] { animation: rise 260ms var(--ease) both; }
.help::backdrop { background: var(--ink); opacity: .45; }
.help-in { padding: 24px; }
.help h2 { margin-bottom: 14px; font: 700 22px/1.2 var(--font-display); color: var(--ink); }
.keys { display: grid; gap: 8px; margin-bottom: 20px; }
.keys div { display: grid; grid-template-columns: 128px minmax(0, 1fr); align-items: center; gap: 12px; }
.keys dt { display: flex; flex-wrap: wrap; gap: 4px; }
.keys dd { font-size: 15px; }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: var(--r-small); background: var(--paper); color: var(--ink); font: 600 14px/1 var(--font); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 22px; border: 1px solid var(--pink); border-radius: var(--r-pill); background: var(--pink); color: var(--card); font-weight: 600; cursor: pointer; }
.btn:hover { box-shadow: var(--shadow-pink); }
.btn:focus-visible { box-shadow: var(--focus-ring); }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; max-width: calc(100vw - 32px); padding: 10px 18px; border-radius: var(--r-pill); background: var(--ink); color: var(--card); font-size: 15px; opacity: 0; transform: translate(-50%, 8px); transition: opacity 260ms var(--ease), transform 260ms var(--ease); pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Privacy page */

.doc { max-width: 760px; margin: 28px auto 0; }
.doc h1 { margin-bottom: 12px; font: 700 clamp(26px, 3vw, 34px)/1.2 var(--font-display); color: var(--ink); }
.doc h2 { margin: 24px 0 8px; font: 700 19px/1.3 var(--font-display); color: var(--ink); }
.doc ul { display: grid; gap: 6px; margin: 0; padding-left: 22px; }
.doc p + p { margin-top: 10px; }

/* Narrower screens: the tabs go under the name; phone: name and keys, then tabs and the live pill */

@media (min-width: 1001px) {
  .tab { min-width: 132px; } /* one width when the web fonts swap in, so the header never shifts */
}

@media (max-width: 1000px) {
  .top-in { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "logo live help" "tabs tabs tabs"; }
}

@media (max-width: 760px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .top-in { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "logo logo help" "tabs live live"; gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .logo { gap: 8px; font-size: 15px; }
  .logo svg { width: 26px; height: 26px; }
  .tab { min-height: 36px; padding: 0 12px; font-size: 14px; }
  .live { min-height: 34px; padding: 0 10px; font-size: 13px; }
  .live-word, .live-more, .live-date { display: none; }
  .help-btn { width: 36px; height: 36px; }
  .tab-main { gap: 12px; padding-top: 12px; }
  .block { padding: 22px 16px; scroll-margin-top: 112px; }
  .block.hero { padding: 16px 16px 20px; }
  .hero-q { font-size: 14px; }
  .chip { font-size: 13px; }
  .block.strip { padding: 18px 16px; }
  .fold > summary { padding: 12px 16px; }
  .fold-body { padding: 0 16px 18px; }
  .keys div { grid-template-columns: 104px minmax(0, 1fr); }
}

@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
