/* Lingle — "aerogramme" identity: pale airmail paper, red/blue airmail stripe, postmark result. */
:root {
  --paper: #e7edf5;
  --sheet: #f7f9fc;
  --sheet-2: #eef3f9;
  --ink: #13223a;
  --ink-2: #33465f;
  --muted: #5d6e85;
  --line: #c6d2e0;
  --line-2: #dbe3ed;
  --air-red: #c4392f;
  --air-blue: #214f8e;
  --accent: #214f8e;
  --accent-ink: #ffffff;
  --ok: #2c8454;
  --bad: #b3322a;
  --p1: #8ea7c2;
  --p2: #cbb97f;
  --p3: #e29f3a;
  --p4: #dc6c2c;
  --p5: #c1352a;
  --land: #d2dce8;
  --land-edge: #f7f9fc;
  --wave-off: #c3cfdd;
  --focus: #2f6fd0;
  --shadow: 0 1px 0 rgba(19, 34, 58, 0.05), 0 10px 28px -16px rgba(19, 34, 58, 0.35);
  --radius: 10px;
  --font-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-flag: "Twemoji Country Flags", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0c1522;
    --sheet: #142033;
    --sheet-2: #1a2940;
    --ink: #e3ebf5;
    --ink-2: #b8c6d8;
    --muted: #8d9cb1;
    --line: #2a3b53;
    --line-2: #213046;
    --air-red: #ea6a5e;
    --air-blue: #7ea5e8;
    --accent: #7ea5e8;
    --accent-ink: #0c1522;
    --ok: #4dbd84;
    --bad: #ee6b5f;
    --p1: #5b7593;
    --p2: #a69861;
    --p3: #d8942f;
    --p4: #e27a3a;
    --p5: #e8574b;
    --land: #22324a;
    --land-edge: #142033;
    --wave-off: #2e405a;
    --focus: #9cc0ff;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 12px 30px -16px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0c1522;
  --sheet: #142033;
  --sheet-2: #1a2940;
  --ink: #e3ebf5;
  --ink-2: #b8c6d8;
  --muted: #8d9cb1;
  --line: #2a3b53;
  --line-2: #213046;
  --air-red: #ea6a5e;
  --air-blue: #7ea5e8;
  --accent: #7ea5e8;
  --accent-ink: #0c1522;
  --ok: #4dbd84;
  --bad: #ee6b5f;
  --p1: #5b7593;
  --p2: #a69861;
  --p3: #d8942f;
  --p4: #e27a3a;
  --p5: #e8574b;
  --land: #22324a;
  --land-edge: #142033;
  --wave-off: #2e405a;
  --focus: #9cc0ff;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 12px 30px -16px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
[hidden] { display: none !important; }

.app {
  max-width: 580px;
  margin: 0 auto;
  padding-inline: 16px;
  padding-block: 0 40px;
}
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ------------------------------------------------------------------ masthead */
.masthead { margin-bottom: 18px; }
body::before {
  content: "";
  display: block;
  height: 9px;
  background: repeating-linear-gradient(-45deg,
    var(--air-red) 0 13px, var(--paper) 13px 20px,
    var(--air-blue) 20px 33px, var(--paper) 33px 40px);
}
.masthead-row {
  display: grid;
  grid-template-columns: 88px 1fr 88px;
  align-items: center;
  padding-top: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.masthead-actions { display: flex; justify-content: flex-end; gap: 4px; }
.brand { text-align: center; min-width: 0; }
.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 850;
  font-stretch: 125%;
  font-variation-settings: "wdth" 125;
  font-size: clamp(1.85rem, 7.2vw, 2.45rem);
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
}
.edition {
  margin: 6px 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-2);
}
.icon-btn:hover { background: var(--sheet-2); color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.close { font-size: 1.6rem; line-height: 1; }

/* ------------------------------------------------------------------ player */
.player {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 16px 12px;
}
.player-row { display: flex; align-items: center; gap: 14px; }
.play {
  flex: 0 0 auto;
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid; place-items: center;
  transition: transform 120ms ease;
}
.play:hover { transform: scale(1.04); }
.play:active { transform: scale(0.97); }
.play svg { width: 28px; height: 28px; grid-area: 1 / 1; }
.play .icon-stop, .play .icon-load { display: none; }
.play.is-playing .icon-play { display: none; }
.play.is-playing .icon-stop { display: block; }
.play.is-loading .icon-play { display: none; }
.play.is-loading .icon-load { display: block; animation: spin 900ms linear infinite; }
.play.nudge { animation: nudge 900ms ease 2; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes nudge { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 25%, transparent); } }

.tape { flex: 1 1 auto; min-width: 0; }
.wave { display: block; width: 100%; height: 56px; }
.wave .bar { fill: var(--wave-off); }
.wave .bar.on { fill: var(--ink); }
.wave .bar.heard { fill: var(--accent); }
.wave .lock { fill: url(#hatch); }
.wave .playhead { stroke: var(--air-red); stroke-width: 3; vector-effect: non-scaling-stroke; }
.wave .edge { stroke: var(--air-red); stroke-width: 2; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.ticks { position: relative; height: 18px; margin-top: 4px; font-family: var(--font-mono); font-size: 0.68rem; color: var(--muted); }
.ticks span { position: absolute; top: 0; transform: translateX(-100%); padding-right: 2px; white-space: nowrap; }
.ticks span::before {
  content: ""; position: absolute; right: 0; top: -4px; width: 1px; height: 4px; background: var(--line);
}
.ticks span.on { color: var(--ink); font-weight: 600; }
.player-meta {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-top: 6px; flex-wrap: wrap;
}
.note { margin: 0; color: var(--ink-2); font-size: 0.9rem; }
.text-btn {
  border: 0; background: none; padding: 4px 2px;
  color: var(--accent); font-weight: 600; font-size: 0.9rem;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.text-btn:hover { text-decoration-thickness: 2px; }
.text-btn:disabled { color: var(--muted); cursor: default; text-decoration: none; }

/* ------------------------------------------------------------------ hint */
.hint { display: flex; flex-direction: column; gap: 10px; }
.hint-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hint-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border: 1px dashed var(--muted);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-weight: 600; font-size: 0.9rem;
}
.hint-btn svg { width: 18px; height: 18px; }
.hint-btn:hover { border-style: solid; color: var(--ink); }
.hint-cost { font-size: 0.8rem; color: var(--muted); }
.hint-confirm {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--sheet); padding: 12px 14px;
}
.hint-confirm p { margin: 0 0 10px; font-size: 0.92rem; color: var(--ink-2); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.transcript-wrap { margin: 0; }
.label {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.transcript {
  margin: 0;
  padding: 14px 16px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-left: 4px solid var(--air-red);
  border-radius: 4px var(--radius) var(--radius) 4px;
  font-size: 1.12rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.transcript[dir="rtl"], .transcript:dir(rtl) { border-left: 1px solid var(--line); border-right: 4px solid var(--air-red); }

/* ------------------------------------------------------------------ guess form */
.guess-form { display: flex; gap: 8px; }
.combo { position: relative; flex: 1 1 auto; min-width: 0; }
#guess-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--sheet);
  font-size: 1rem;
}
#guess-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
#guess-input::placeholder { color: var(--muted); }
.suggestions {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px);
  margin: 0; padding: 4px; list-style: none;
  background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 290px; overflow-y: auto;
}
.suggestions li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 6px; cursor: pointer;
}
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--sheet-2); }
.suggestions .alias { color: var(--muted); font-size: 0.82rem; margin-left: auto; text-align: right; }
.flag { font-family: var(--font-flag); font-size: 1.15em; line-height: 1; width: 1.4em; text-align: center; flex: 0 0 auto; }
.primary, .ghost {
  height: 48px; padding: 0 20px;
  border-radius: var(--radius);
  font-weight: 700; letter-spacing: 0.01em;
}
.primary { border: 0; background: var(--accent); color: var(--accent-ink); }
.primary:hover { filter: brightness(1.08); }
.ghost { border: 1.5px solid var(--line); background: transparent; color: var(--ink); }
.ghost:hover { border-color: var(--muted); }
.small { height: 38px; padding: 0 14px; font-size: 0.9rem; }
.form-error { margin: -6px 0 0; color: var(--bad); font-size: 0.88rem; }

/* ------------------------------------------------------------------ ledger */
.ledger { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.row {
  position: relative;
  display: grid;
  grid-template-columns: 2.4rem 1.6rem minmax(0, 1fr) auto 1.6rem 2.9rem;
  align-items: center;
  column-gap: 8px;
  min-height: 46px;
  padding: 0 12px 0 10px;
  border-radius: 8px;
  background: var(--sheet);
  border: 1px solid var(--line);
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.row.empty { background: transparent; border-style: dashed; color: var(--muted); }
.row .sec { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.row.current { border-style: solid; border-color: var(--ink-2); }
.row.current .sec { color: var(--ink); font-weight: 600; }
.row .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .dist, .row .prox { font-family: var(--font-mono); font-size: 0.86rem; text-align: right; white-space: nowrap; }
.row .prox { font-weight: 600; }
.row .dir { display: grid; place-items: center; }
.row .dir svg { width: 20px; height: 20px; }
.row .meter { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--heat, var(--p1)); }
.row.skip .name { color: var(--muted); font-weight: 500; font-style: italic; }
.row.correct { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--sheet)); }
.row.correct .prox { color: var(--ok); }
.row.enter { animation: rowin 380ms cubic-bezier(.2,.8,.2,1); }
@keyframes rowin { from { transform: translateY(-6px); opacity: 0.2; } to { transform: none; opacity: 1; } }
.h1 { --heat: var(--p1); } .h2 { --heat: var(--p2); } .h3 { --heat: var(--p3); } .h4 { --heat: var(--p4); } .h5 { --heat: var(--p5); } .hok { --heat: var(--ok); }

/* ------------------------------------------------------------------ result (postmark) */
.result {
  position: relative;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
  overflow: hidden;
}
.result::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 6px;
  background: repeating-linear-gradient(-45deg, var(--air-red) 0 10px, var(--sheet) 10px 15px, var(--air-blue) 15px 25px, var(--sheet) 25px 30px);
}
.result-top { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: center; margin-top: 6px; }
.postmark { width: 112px; height: 112px; color: var(--ok); transform: rotate(-8deg); }
.postmark.lost { color: var(--bad); }
.postmark text { font-family: var(--font-mono); font-weight: 600; fill: currentColor; }
.postmark .big { font-family: var(--font-display); font-weight: 850; font-size: 30px; }
.stamp-in { animation: stamp 520ms cubic-bezier(.3,1.6,.5,1) both; }
@keyframes stamp { from { transform: rotate(-8deg) scale(1.6); opacity: 0; } to { transform: rotate(-8deg) scale(1); opacity: 1; } }
.verdict { margin: 0; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.lang-name {
  margin: 2px 0 0;
  font-family: var(--font-display); font-weight: 800; font-stretch: 112%; font-variation-settings: "wdth" 112;
  font-size: clamp(1.6rem, 6vw, 2.1rem); line-height: 1.05; text-wrap: balance;
}
.endonym { margin: 4px 0 0; font-size: 1.15rem; color: var(--ink-2); }
.facts { margin: 14px 0 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; font-size: 0.92rem; }
.facts dt { color: var(--muted); font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; padding-top: 3px; }
.facts dd { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 5px; border-radius: 999px; background: var(--sheet-2); font-size: 0.85rem; white-space: nowrap; }
.said { margin: 14px 0 0; }
.said .transcript { font-size: 1rem; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.next { margin-left: auto; text-align: right; font-size: 0.8rem; color: var(--muted); }
.next strong { display: block; font-family: var(--font-mono); font-size: 1.05rem; color: var(--ink); font-weight: 600; }
.credit { margin: 12px 0 0; font-size: 0.78rem; color: var(--muted); }
.credit a { color: inherit; }

/* ------------------------------------------------------------------ world stats */
.world {
  background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
}
.world h2, .sheet h3 { margin: 0 0 12px; font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; font-stretch: 112%; font-variation-settings: "wdth" 112; letter-spacing: 0.01em; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 10px; margin-bottom: 14px; }
.kpi .v { font-family: var(--font-mono); font-size: 1.45rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .k { font-size: 0.76rem; color: var(--muted); line-height: 1.3; }
.dist { display: flex; flex-direction: column; gap: 5px; }
.dist-row { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr); align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.8rem; }
.dist-bar {
  height: 22px; min-width: 2.2rem; width: var(--w, 0%);
  display: flex; align-items: center; justify-content: flex-end;
  padding: 0 7px; border-radius: 4px;
  background: var(--wave-off); color: var(--ink); font-weight: 600;
  transition: width 500ms ease;
}
.dist-row.me .dist-bar { background: var(--accent); color: var(--accent-ink); }
.dist-row.fail .dist-bar { background: color-mix(in srgb, var(--bad) 30%, var(--wave-off)); }
.dist-row.fail.me .dist-bar { background: var(--bad); color: #fff; }
.callout { margin: 14px 0 0; font-size: 0.95rem; }
.callout strong { font-family: var(--font-mono); }
.first-guesses { margin-top: 14px; }
.muted { color: var(--muted); }
.world .retry { margin-top: 8px; }

/* ------------------------------------------------------------------ map */
.map-wrap { margin: 4px 0 0; }
.map {
  display: block; width: 100%; aspect-ratio: 1000 / 444; max-width: 100%;
  background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius);
}
.map .c { fill: var(--land); stroke: var(--land-edge); stroke-width: 0.6; vector-effect: non-scaling-stroke; transition: fill 300ms ease; }
.map .other { fill: var(--land); opacity: 0.6; }
.map .c.g1 { fill: var(--p1); } .map .c.g2 { fill: var(--p2); } .map .c.g3 { fill: var(--p3); }
.map .c.g4 { fill: var(--p4); } .map .c.g5 { fill: var(--p5); }
.map .c.ans { fill: var(--ok); }
.map .mk { stroke: var(--sheet); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.map .mk.g1 { fill: var(--p1); } .map .mk.g2 { fill: var(--p2); } .map .mk.g3 { fill: var(--p3); }
.map .mk.g4 { fill: var(--p4); } .map .mk.g5 { fill: var(--p5); } .map .mk.ans { fill: var(--ok); }
.map-caption { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 6px; font-size: 0.8rem; color: var(--muted); }
.map-caption .text-btn { white-space: nowrap; flex: 0 0 auto; font-size: 0.8rem; }

/* ------------------------------------------------------------------ dialogs */
.sheet {
  width: min(560px, calc(100vw - 24px));
  max-height: min(86vh, 860px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--sheet);
  color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.45);
}
.sheet::backdrop { background: rgba(9, 16, 28, 0.55); }
.sheet[open] { animation: rise 220ms ease; }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 12px 12px 20px; background: var(--sheet); border-bottom: 1px solid var(--line-2);
}
.sheet-head h2 { margin: 0; font-family: var(--font-display); font-weight: 850; font-size: 1.2rem; font-stretch: 118%; font-variation-settings: "wdth" 118; text-transform: uppercase; letter-spacing: 0.02em; }
.sheet-body { padding: 16px 20px 22px; }
.sheet section + section { margin-top: 22px; }
.prose p, .prose li { max-width: 62ch; }
.prose p { margin: 0 0 12px; }
.prose ol, .prose ul { padding-left: 1.2rem; margin: 0 0 12px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--accent); }
.prose .example { margin: 8px 0 16px; padding-left: 0; }
.prose small { color: var(--muted); }
.stages { font-family: var(--font-mono); font-size: 0.85rem; }
.days { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; }
.day {
  aspect-ratio: 1; border-radius: 4px; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
  background: transparent; border: 1px dashed var(--line); color: var(--muted);
}
.day.won { background: var(--ok); border: 0; color: #fff; }
.day.lost { background: var(--bad); border: 0; color: #fff; }
.day.today { outline: 2px solid var(--ink); outline-offset: 1px; }
.days-legend { display: flex; justify-content: space-between; margin-top: 6px; font-size: 0.72rem; color: var(--muted); font-family: var(--font-mono); }
.passport { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.visa {
  border: 1.5px solid currentColor; border-radius: 6px; padding: 6px 8px; color: var(--air-blue);
  transform: rotate(var(--r, 0deg));
}
.visa .v1 { display: block; font-family: var(--font-display); font-weight: 800; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; line-height: 1.2; }
.visa .v2 { display: block; font-size: 0.85rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visa .v3 { display: block; font-family: var(--font-mono); font-size: 0.64rem; color: var(--muted); }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.setting:last-child { border-bottom: 0; }
.setting .desc { font-size: 0.8rem; color: var(--muted); }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; padding: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.share-text { width: 100%; font-family: var(--font-mono); font-size: 0.9rem; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--sheet-2); }

/* ------------------------------------------------------------------ misc */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 50; padding: 10px 16px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-weight: 600; font-size: 0.9rem;
  box-shadow: var(--shadow);
}
.colophon {
  margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 0.78rem; color: var(--muted); line-height: 1.55;
}
.colophon a { color: inherit; }
.colophon p { margin: 0 0 6px; }

@media (max-width: 420px) {
  .masthead-row { grid-template-columns: 44px 1fr 88px; }
  .row { grid-template-columns: 2rem 1.5rem minmax(0, 1fr) auto 1.3rem 2.6rem; column-gap: 6px; padding: 0 8px; }
  .row .dist, .row .prox { font-size: 0.78rem; }
  .result-top { grid-template-columns: 88px minmax(0, 1fr); gap: 12px; }
  .postmark { width: 88px; height: 88px; }
  .guess-form .primary { padding: 0 14px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
