/* Every Country — a school-atlas map that colours in as you learn.
   One typeface, Overpass, descended from the lettering on North American highway signs. */

/* Overpass is served from this site (fonts/, SIL Open Font License in fonts/OFL.txt),
   not Google Fonts, so a visit sends nothing to Google. Latin, plus Latin Extended for
   names like Chișinău and São Tomé. */
@font-face { font-family: "Overpass"; font-weight: 400; font-display: swap; src: url("fonts/overpass-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Overpass"; font-weight: 400; font-display: swap; src: url("fonts/overpass-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Overpass"; font-weight: 600; font-display: swap; src: url("fonts/overpass-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Overpass"; font-weight: 600; font-display: swap; src: url("fonts/overpass-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Overpass"; font-weight: 800; font-display: swap; src: url("fonts/overpass-latin-800-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Overpass"; font-weight: 800; font-display: swap; src: url("fonts/overpass-latin-ext-800-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --ocean: #cfe2ea;
  --land: #f4f5f2;
  --border: #8d9ca4;
  --context: #e2e5e1;
  --ink: #14232b;
  --muted: #56666e;
  --panel: #fbfcfb;
  --rule: #d6dee2;
  --right: #1d8a4f;
  --wrong: #c63a3a;
  --target: #14232b;
  /* atlas colours: neighbours never share one */
  --on-accent: #14232b; /* icons on a game's colour tile, in both themes */
  --atlas-0: #f0a7b6;
  --atlas-1: #f3d36b;
  --atlas-2: #a6d48c;
  --atlas-3: #bfa9e4;
  --atlas-4: #f4b47c;
  --atlas-5: #dcc39c;
  --font: "Overpass", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ocean: #0f2531;
    --land: #23353f;
    --border: #5b7380;
    --context: #1b2b33;
    --ink: #e9eff2;
    --muted: #9fb1ba;
    --panel: #12232c;
    --rule: #2c414c;
    --right: #4cc283;
    --wrong: #ef7067;
    --target: #f3f7f9;
    --atlas-0: #c97a8c;
    --atlas-1: #c9a944;
    --atlas-2: #7fae67;
    --atlas-3: #9682c0;
    --atlas-4: #c98a54;
    --atlas-5: #ad9773;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ocean: #0f2531; --land: #23353f; --border: #5b7380; --context: #1b2b33; --ink: #e9eff2;
  --muted: #9fb1ba; --panel: #12232c; --rule: #2c414c; --right: #4cc283; --wrong: #ef7067; --target: #f3f7f9;
  --atlas-0: #c97a8c; --atlas-1: #c9a944; --atlas-2: #7fae67; --atlas-3: #9682c0; --atlas-4: #c98a54; --atlas-5: #ad9773;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
/* feel like an app on a phone: no rubber-band page, no zoom on a double tap, no grey
   flash or text-selection popup when a button or the map is pressed */
html { -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
button, .map { touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body {
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.app {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* the header can't push the page wider than the screen */
  grid-template-rows: auto minmax(44svh, 1fr) auto;
}

/* typing on a phone: the map takes only what the keyboard leaves above the question and
   the answer box (--map-h, set by fitAboveKeyboard in ui.js) */
@media (max-width: 899px) { .app.typing { min-height: 0; grid-template-rows: auto var(--map-h, 30svh) auto; } }

/* an iPhone in Safari, with its bars showing: a little less map keeps a question's four
   answers on screen even when a long name ("Bosnia and Herzegovina") takes two lines */
@media (max-width: 899px) and (max-height: 700px) { .app { grid-template-rows: auto minmax(38svh, 1fr) auto; } }
/* short screens (an iPhone SE in Safari): a smaller map and flag still */
@media (max-width: 899px) and (max-height: 640px) {
  .app { grid-template-rows: auto minmax(30svh, 1fr) auto; }
  .flag.big-flag { height: 68px; margin: 6px 0 10px; }
  .opt { min-height: 50px; }
}

/* on phones, the world map gets a box its own shape instead of a tall one full of ocean */
@media (max-width: 899px) { .app.world { grid-template-rows: auto calc(100vw * 0.56) auto; } }

/* ---------- top bar ---------- */
.bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  background: var(--ocean);
}
.title { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.01em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tally { margin: 0; font-size: 14px; color: var(--muted); white-space: nowrap; }
.bar-btn {
  border: 1.5px solid var(--ink);
  background: transparent;
  border-radius: 999px;
  padding: 4px 14px 2px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}
.bar-btn.round { width: 34px; height: 34px; padding: 2px 0 0; }

/* ---------- map ---------- */
.map-wrap { position: relative; background: var(--ocean); min-height: 0; }
.map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: manipulation; }
.ocean { fill: var(--ocean); }
.context path { fill: var(--context); stroke: var(--border); stroke-width: 0.5px; vector-effect: non-scaling-stroke; }
.hatch-ground { fill: var(--land); }

.c {
  fill: var(--land);
  stroke: var(--border);
  stroke-width: 0.6px;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill 300ms ease;
}
.c.s2 { fill: color-mix(in srgb, var(--fill) 50%, var(--land)); }
.c.s3 { fill: var(--fill); }
.c.target { stroke: var(--target); stroke-width: 2.5px; animation: pulse 1.6s ease-in-out infinite; }
.c.right { fill: var(--right) !important; stroke: var(--target); stroke-width: 1.5px; animation: none; }
.c.wrong { fill: var(--wrong) !important; stroke: var(--target); stroke-width: 1.5px; }
@keyframes pulse { 50% { stroke-width: 1px; } }

/* the end-of-session moment: countries that moved up fill in one after another */
.c.fresh {
  transform-box: fill-box;
  transform-origin: center;
  animation: fill-in 800ms cubic-bezier(.2, .9, .3, 1.2) both;
  animation-delay: calc(var(--i) * 140ms + 450ms);
}
@keyframes fill-in { from { opacity: 0.15; transform: scale(1.25); } to { opacity: 1; transform: none; } }

/* while you look for a country, the map shows no progress colours */
.map.plain .c:not(.right):not(.wrong),
.map.plain .dot:not(.right):not(.wrong) { fill: var(--land) !important; }

.dot { fill: var(--land); stroke: var(--ink); stroke-width: 1.2px; vector-effect: non-scaling-stroke; cursor: pointer; }
.dot.s1 { fill: color-mix(in srgb, var(--fill) 45%, var(--land)); }
.dot.s2 { fill: color-mix(in srgb, var(--fill) 65%, var(--land)); }
.dot.s3 { fill: var(--fill); }
.dot.target { stroke: var(--target); stroke-width: 3px; animation: dot-pulse 1.6s ease-in-out infinite; }
@keyframes dot-pulse { 50% { stroke-width: 1.5px; } }
.dot.right { fill: var(--right); }
.dot.wrong { fill: var(--wrong); }

.label {
  font-family: var(--font);
  font-weight: 800;
  font-size: calc(var(--u) * 14px);
  text-anchor: middle;
  dominant-baseline: middle;
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--panel);
  stroke-width: calc(var(--u) * 4px);
  stroke-linejoin: round;
  pointer-events: none;
}
.label.right { fill: var(--right); }
.label.wrong { fill: var(--wrong); }

.map-caption {
  position: absolute;
  left: 16px;
  bottom: 8px;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  pointer-events: none;
}

/* ---------- panel ---------- */
.panel {
  padding: 16px 16px max(24px, env(safe-area-inset-bottom));
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}
.progress { height: 4px; background: var(--rule); border-radius: 2px; margin-bottom: 14px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ink); transition: width 300ms ease; }
.lede { margin: 0 0 14px; font-size: 18px; color: var(--muted); }
.ask { margin: 0; font-size: 16px; color: var(--muted); }
.big { margin: 0 0 12px; font-size: clamp(30px, 8vw, 40px); line-height: 1.08; font-weight: 800; letter-spacing: -0.02em; }
.facts { margin: 0 0 14px; }
.verdict { margin: 12px 0 8px; font-weight: 800; font-size: 18px; }
.verdict.good { color: var(--right); }
.verdict.bad { color: var(--wrong); }

.flag { display: block; height: 72px; width: auto; aspect-ratio: 4 / 3; border-radius: 4px; box-shadow: 0 0 0 1px var(--rule); margin: 4px 0 12px; }
.flag.big-flag { height: 104px; margin: 8px 0 14px; }
.flag.small { height: 44px; margin: 2px 0 0; flex: none; }
.hook { display: flex; gap: 12px; align-items: flex-start; }

.continents { list-style: none; margin: 0 0 16px; padding: 0; }
.continent {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: none;
  text-align: left;
  cursor: pointer;
}
.c-name { font-weight: 800; font-size: 19px; }
.c-status { font-size: 15px; color: var(--muted); align-self: center; }
.has-due .c-status { color: var(--ink); font-weight: 600; }
.meter { grid-column: 1 / -1; display: flex; height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; margin-top: 4px; }
.meter i { display: block; height: 100%; transition: width 900ms cubic-bezier(.2, .8, .2, 1) 400ms; }
.c-pct { margin-left: 4px; font-size: 15px; font-weight: 600; color: var(--muted); }
.world-row, .gain { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
.world-row { padding: 0 0 14px; margin-bottom: 4px; border-bottom: 1px solid var(--rule); }
.world-row .meter { height: 8px; }

/* after a game: the continent's or the world's bar growing, with the change */
.gain { margin: 4px 0 18px; }
.gain .meter { height: 10px; border-radius: 5px; }
.gain-pct { font-weight: 800; font-size: 19px; }
.gain-pct .up { color: var(--right); }
.gain-pct .down { color: var(--wrong); }
.gain-note { grid-column: 1 / -1; margin: 8px 0 0; font-size: 15px; color: var(--muted); }

/* practice: the game, skill and area pickers, typed answers, the race */
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.seg-btn { flex: 1 1 auto; padding: 9px 14px 7px; border-radius: 999px; border: 1.5px solid var(--rule); background: transparent; font-weight: 700; font-size: 15px; cursor: pointer; }
.seg-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.hint { margin-top: 10px; }
.typed { display: flex; gap: 8px; margin-top: 10px; }
.typed .btn { flex: none; }
.typed-input { flex: 1; min-width: 0; font: inherit; font-size: 18px; padding: 12px 14px 10px; border-radius: 12px; border: 1.5px solid var(--rule); background: var(--panel); color: var(--ink); }
.typed-input:focus { outline: none; border-color: var(--ink); }
.typed-input:disabled { opacity: 0.6; }
.typed-input.wide { width: 100%; margin-top: 10px; }
/* the on-screen keyboard (phones): the box only shows what's typed */
.typed-input.keyed { pointer-events: none; caret-color: transparent; }
.kb { display: grid; gap: 8px; margin-top: 12px; -webkit-user-select: none; user-select: none; }
.kb-row { display: flex; gap: 5px; justify-content: center; }
.key { flex: 1 1 0; max-width: 42px; height: 46px; padding: 0; border: 0; border-radius: 8px; background: var(--rule); color: var(--ink); font-weight: 700; font-size: 18px; cursor: pointer; }
.key.wide { max-width: none; flex: 1.6 1 0; font-size: 15px; }
.key.space { max-width: none; flex: 3 1 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.key.go { max-width: none; flex: 1.6 1 0; background: var(--ink); color: var(--panel); font-size: 16px; }
.key:active { background: color-mix(in srgb, var(--ink) 30%, var(--rule)); }
.key.go:active { background: color-mix(in srgb, var(--ink) 75%, var(--rule)); }
/* with the keyboard on screen, the page fits the screen: the map takes what's left */
@media (max-width: 899px) {
  .app:has(.kb) { height: 100svh; min-height: 0; grid-template-rows: auto minmax(110px, 1fr) auto; }
  .app:has(.kb) .flag.big-flag { height: 64px; margin: 4px 0 8px; }
  .app:has(.kb) .panel { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}
.race-score { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; }
.race-score .big { margin: 0; }
.race-clock { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--muted); }
.race-last { min-height: 1.4em; margin: 8px 0 0; color: var(--muted); }
.race-got { margin-top: 16px; }
.race-got-label { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.race-got-list { list-style: none; margin: 0; padding: 0; columns: 9em; column-gap: 16px; font-size: 14px; line-height: 1.6; }
.race-got-list li { break-inside: avoid; }
.race-got-list .new { color: var(--right); font-weight: 700; }
.game-cards { display: grid; gap: 10px; margin: 4px 0 6px; }
/* each game in its own colour (--accent, set per button): a solid icon tile and a tint */
.game-card { display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left; padding: 14px 16px 13px; border: 1.5px solid color-mix(in srgb, var(--accent) 50%, var(--rule)); border-radius: 14px; background: color-mix(in srgb, var(--accent) 12%, var(--panel)); cursor: pointer; }
.g-text { display: grid; gap: 3px; }
.g-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: var(--on-accent); }
.g-icon svg { width: 24px; height: 24px; }
.big.with-icon { display: flex; align-items: center; gap: 12px; }
.game-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.game-tile { display: grid; justify-items: center; align-content: start; gap: 6px; padding: 14px 6px 12px; border: 1.5px solid color-mix(in srgb, var(--accent) 50%, var(--rule)); border-radius: 14px; background: color-mix(in srgb, var(--accent) 12%, var(--panel)); text-align: center; cursor: pointer; }
.t-name { font-weight: 800; font-size: 16px; }
.t-sub { font-size: 13px; line-height: 1.25; color: var(--muted); }
/* the daily, first on the home screen: full width, icon beside its name */
.game-tile.featured { grid-column: 1 / -1; grid-template-columns: auto 1fr; justify-items: start; align-items: center; gap: 1px 14px; padding: 14px 16px 12px; text-align: left; }
.game-tile.featured .g-icon { grid-row: span 2; }
.game-tile.featured .t-name { font-size: 20px; align-self: end; }
.game-tile.featured .t-sub { font-size: 15px; align-self: start; }
.g-name { font-weight: 800; font-size: 19px; }
.g-hint { color: var(--muted); font-size: 15px; }
.g-meta { margin-top: 5px; font-size: 14px; font-weight: 600; }
.back-link { display: block; padding: 2px 0; margin: 0 0 8px; border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 15px; cursor: pointer; }

/* the map key: what striped, pale and full colour mean */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 15px; font-weight: 600; }
.legend .key { display: inline-block; width: 16px; height: 12px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--atlas-2) 60%, transparent); }
.key.m1 { background: repeating-linear-gradient(45deg, var(--atlas-2) 0 2px, transparent 2px 5px); }
.key.m2 { background: color-mix(in srgb, var(--atlas-2) 50%, var(--rule)); }
.key.m3 { background: var(--atlas-2); }
.legend-note { margin: 6px 0 16px; font-size: 14px; color: var(--muted); }
.meter .m3 { background: var(--atlas-2); }
.meter .m2 { background: color-mix(in srgb, var(--atlas-2) 50%, var(--rule)); }
.meter .m1 { background: repeating-linear-gradient(45deg, var(--atlas-2) 0 2px, transparent 2px 5px); }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.opt {
  min-height: 56px;
  padding: 10px 12px 8px;
  border: 1.5px solid var(--rule);
  border-radius: 12px;
  background: var(--panel);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Only devices with a real mouse get hover borders. On a phone a tapped button stays
   "hovered", and the next question's button in the same spot would look picked. */
@media (hover: hover) {
  .opt:hover:not(:disabled), .seg-btn:hover { border-color: var(--ink); }
  .game-card:hover, .game-tile:hover { border-color: var(--accent); }
}
.opt .key { display: none; font-size: 12px; color: var(--muted); border: 1px solid var(--rule); border-radius: 4px; padding: 1px 5px 0; }
@media (pointer: fine) { .opt .key { display: inline-block; } }
.opt.right { border-color: var(--right); background: color-mix(in srgb, var(--right) 14%, var(--panel)); }
.opt.wrong { border-color: var(--wrong); background: color-mix(in srgb, var(--wrong) 14%, var(--panel)); }
.opt:disabled { cursor: default; }
.opt:disabled:not(.right):not(.wrong) { opacity: 0.55; }

.btn {
  padding: 13px 18px 11px;
  border-radius: 12px;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--panel);
  font-weight: 800;
  font-size: 17px;
  cursor: pointer;
}
.btn.quiet { background: transparent; color: var(--ink); }
.btn.wide { width: 100%; margin-top: 8px; }
.extras { display: flex; gap: 10px; flex-wrap: wrap; }
.extras .btn { flex: 1 1 160px; }

.squares { font-size: 24px; letter-spacing: 2px; margin: 0 0 12px; }
/* the daily streak: a card in the daily's colour, with the last seven days */
.streak { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 12px; margin: 2px 0 16px; padding: 12px 16px 12px 14px; border-radius: 14px; border: 1.5px solid color-mix(in srgb, var(--accent) 55%, var(--rule)); background: color-mix(in srgb, var(--accent) 14%, var(--panel)); }
.streak-flame { grid-row: span 2; font-size: 34px; line-height: 1; }
.streak-days { font-weight: 800; font-size: 20px; line-height: 1.2; }
.streak-note { font-size: 14px; color: var(--muted); }
.streak-week { grid-column: 1 / -1; display: flex; justify-content: space-between; margin-top: 12px; }
.streak-week span { display: grid; justify-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.streak-week i { display: block; width: 24px; height: 24px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--accent) 60%, var(--rule)); }
.streak-week .on i { background: var(--accent); border-color: var(--accent); }
.streak-week .today { color: var(--ink); }
.streak-week .today i { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--ink); }
.next-daily { color: var(--muted); text-align: center; margin: 12px 0 4px; font-variant-numeric: tabular-nums; }
.share-text { white-space: pre-wrap; background: var(--rule); padding: 10px; border-radius: 8px; font-family: var(--font); user-select: all; }

.help {
  max-width: 440px;
  border: 0;
  border-radius: 16px;
  padding: 20px 20px 16px;
  background: var(--panel);
  color: var(--ink);
}
.help::backdrop { background: rgb(10 20 26 / 0.45); }
.help h2 { margin: 0 0 8px; font-size: 24px; font-weight: 800; }
.help p { margin: 0 0 10px; }
.help-list { margin: 0 0 12px; padding-left: 20px; }
.help-list li { margin-bottom: 6px; }
.help .feedback { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.help .feedback a { color: var(--ink); font-weight: 600; }
.help .privacy { margin: 0 0 4px; font-size: 14px; color: var(--muted); }
.help .privacy summary { cursor: pointer; font-weight: 600; }
.help .privacy p { margin: 6px 0 0; }

/* ---------- desktop: map beside the panel ---------- */
@media (min-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr) 420px; grid-template-rows: auto 1fr; height: 100svh; }
  .bar { grid-column: 1 / -1; }
  .map-wrap { grid-row: 2; }
  .panel { grid-row: 2; grid-column: 2; overflow-y: auto; max-width: none; padding: 24px; border-left: 1px solid var(--rule); }
}

@media (prefers-reduced-motion: reduce) {
  .c, .progress i, .meter i { transition: none; }
  .c.target, .c.fresh, .dot.target { animation: none; }
}
