/* Christmas Market Atlas styles.
   Colours and fonts are tokens on :root (light) and in the two dark blocks below it.
   Change a token once and every component follows. */

[hidden] { display: none !important; }
:root {
  color-scheme: light;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

:root {
  --bg: #EEF2F3;          /* snow under a grey sky */
  --surface: #FFFFFF;
  --ink: #1A292E;         /* spruce ink */
  --muted: #566970;
  --line: #D0D9DC;
  --track: #DFE6E8;
  --accent: #A3132F;      /* Glühwein */
  --accent-ink: #FFFFFF;
  --accent-soft: #F4E0E4;
  --glow: #C8243F;
  --halo-op: 0.07;
  --water: #CCDAE1;
  --land: #E7ECEE;
  --land-strong: #FBFCFC;
  --border: #8FA2A9;
  --river: #ADC3CD;
  --grat: #BCCBD1;
  --ghost: #98A6AB;
  --ok: #276447;
  --ok-soft: #DCEDE4;
  --warn: #855400;
  --warn-soft: #F5E8CC;
  --shade: rgba(16, 32, 38, 0.14);

  --f-display: "Grenze Gotisch", "UnifrakturMaguntia", Georgia, "Times New Roman", serif;
  --f-body: "Alegreya Sans", "Gill Sans", "Gill Sans MT", "Segoe UI", system-ui, sans-serif;
  --f-sc: "Alegreya Sans SC", "Alegreya Sans", "Gill Sans", "Segoe UI", system-ui, sans-serif;
  --r: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D161A; --surface: #142229; --ink: #E5ECEE; --muted: #93A5AB; --line: #233740; --track: #1E3038;
    --accent: #EE6372; --accent-ink: #1B0C10; --accent-soft: #3A1B22; --glow: #FFB25C; --halo-op: 0.5;
    --water: #081013; --land: #101B20; --land-strong: #17272E; --border: #3A525A; --river: #1C3440; --grat: #1A2C34;
    --ghost: #4E6168; --ok: #74C99E; --ok-soft: #163126; --warn: #E8B65C; --warn-soft: #382A11; --shade: rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D161A; --surface: #142229; --ink: #E5ECEE; --muted: #93A5AB; --line: #233740; --track: #1E3038;
  --accent: #EE6372; --accent-ink: #1B0C10; --accent-soft: #3A1B22; --glow: #FFB25C; --halo-op: 0.5;
  --water: #081013; --land: #101B20; --land-strong: #17272E; --border: #3A525A; --river: #1C3440; --grat: #1A2C34;
  --ghost: #4E6168; --ok: #74C99E; --ok-soft: #163126; --warn: #E8B65C; --warn-soft: #382A11; --shade: rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

html { height: 100%; box-sizing: border-box; }
*, *::before, *::after { box-sizing: border-box; }
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.45;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 16px;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(330px, 410px) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "head map" "index map";
  column-gap: 22px;
}

/* ---------- masthead ---------- */
.masthead { grid-area: head; display: grid; gap: 6px; padding: 2px 6px 16px 2px; }
.eyebrow {
  margin: 0; font-family: var(--f-sc); font-weight: 500; font-size: 13px; letter-spacing: 0.06em;
  color: var(--muted); font-variant-numeric: lining-nums;
}
h1 {
  margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 42px; line-height: 0.95;
  letter-spacing: 0.005em; text-wrap: balance;
}
.lede { margin: 2px 0 0; font-size: 15.5px; color: var(--muted); max-width: 40ch; }
.lede strong { color: var(--ink); font-weight: 700; }

/* ---------- index panel ---------- */
.index { grid-area: index; min-height: 0; overflow-y: auto; padding: 0 6px 12px 2px; scrollbar-gutter: stable; }
.list-view { display: grid; gap: 18px; }

.filters { display: grid; gap: 14px; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 2; pointer-events: none; }
.search input {
  width: 100%; height: 42px; padding: 0 12px 0 36px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); font-size: 16px;
}
.search input::placeholder { color: var(--muted); opacity: 0.85; }
.search input:focus-visible { outline-offset: 0; border-color: var(--accent); }

.fgroup { display: grid; gap: 7px; margin: 0; padding: 0; border: 0; min-width: 0; }
.flabel {
  font-family: var(--f-sc); font-weight: 700; font-size: 12.5px; letter-spacing: 0.08em; color: var(--muted); padding: 0;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 15px; font-weight: 500; line-height: 1;
  transition: background-color .12s, border-color .12s;
}
.chip:hover { border-color: var(--muted); }
.chip .n { font-size: 13px; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[aria-pressed="true"] .n { color: var(--bg); opacity: 0.75; }
.chip[aria-pressed="true"] .gd { fill: var(--bg); }
.chip[aria-pressed="true"] .gr { stroke: var(--bg); }
.chip.is-empty { opacity: 0.5; }

/* tier glyphs (same drawing as the map markers) */
.g { flex: none; display: block; overflow: visible; }
.gd { fill: var(--accent); }
.gr { fill: none; stroke: var(--accent); stroke-width: 1.5; }

/* season strip */
.strip-head { display: flex; align-items: baseline; gap: 10px; min-height: 22px; }
.strip-val { font-weight: 700; font-size: 15px; font-variant-numeric: lining-nums tabular-nums; }
.strip-val.is-preview { color: var(--muted); }
.linkbtn {
  margin-left: auto; border: 0; background: none; padding: 2px 0; font-size: 14.5px; font-weight: 700; color: var(--accent);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.strip-wrap { display: grid; gap: 4px; }
.strip-events, .strip-axis { position: relative; height: 15px; font-size: 12px; color: var(--muted); font-variant-numeric: lining-nums; }
.strip-events span, .strip-axis span { position: absolute; top: 0; white-space: nowrap; line-height: 15px; }
.strip-events span { transform: translateX(-50%); font-style: italic; }
.strip-axis span { font-family: var(--f-sc); font-weight: 700; letter-spacing: 0.06em; padding-left: 3px; }
.strip {
  position: relative; height: 54px; cursor: crosshair; touch-action: pan-y;
  border-bottom: 1px solid var(--muted); user-select: none; -webkit-user-select: none;
}
.strip svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.strip .bar { fill: var(--accent); opacity: 0.82; }
.strip .bar.sat { opacity: 0.26; }
.strip .bar.on { fill: var(--ink); opacity: 1; }
.strip .ev { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 2; vector-effect: non-scaling-stroke; }
.strip .mon { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.strip input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none;
}
.strip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 3px; }
.cursor, .hcursor { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; pointer-events: none; }
.cursor { background: var(--ink); }
.cursor::after { content: ""; position: absolute; top: -5px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.hcursor { background: var(--muted); opacity: 0.55; }

.results {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0 2px; border-top: 1px solid var(--line);
}
.count { font-weight: 700; font-size: 15.5px; font-variant-numeric: lining-nums; }
.sort { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; color: var(--muted); }
.sort select {
  height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); padding: 0 8px; font-size: 14.5px; color: var(--ink);
}

.list { display: grid; gap: 2px; }
.tier-head {
  display: flex; align-items: baseline; gap: 8px; margin: 14px 0 4px; padding: 0 10px; font-family: var(--f-sc);
  font-weight: 700; font-size: 13px; letter-spacing: 0.07em; color: var(--muted);
}
.tier-head:first-child { margin-top: 2px; }
.tier-head .n { margin-left: auto; font-variant-numeric: lining-nums tabular-nums; }
.item {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; grid-template-areas: "g main meta" ". bar bar";
  column-gap: 10px; row-gap: 8px; align-items: center; width: 100%; text-align: left; padding: 10px 10px 12px;
  border: 0; border-radius: 10px; background: transparent;
}
.item:hover, .item.is-hov { background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.item.is-sel { background: var(--accent-soft); box-shadow: none; }
.item > .g { grid-area: g; }
.item-main { grid-area: main; min-width: 0; display: grid; gap: 1px; }
.item-name { font-weight: 800; font-size: 17.5px; line-height: 1.15; }
.item-sub { font-size: 14.5px; color: var(--muted); line-height: 1.25; }
.item-meta { grid-area: meta; display: grid; justify-items: end; gap: 1px; align-self: start; padding-top: 2px; }
.cc { font-family: var(--f-sc); font-weight: 700; font-size: 12px; letter-spacing: 0.08em; color: var(--muted); }
.item-dates { font-size: 14.5px; font-weight: 500; white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.item > .sbar { grid-area: bar; }

.sbar { position: relative; display: block; height: 6px; border-radius: 3px; background: var(--track); }
.sbar .run { position: absolute; top: 0; bottom: 0; border-radius: 2px; background: var(--accent); }
.sbar .run.ext { opacity: 0.3; }
.sbar .gap { position: absolute; top: -1px; bottom: -1px; background: var(--track); }
.sbar .tick { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--muted); opacity: 0.35; }
.sbar .cur { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); }
.sbar .today { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ok); }

.empty { display: grid; justify-items: start; gap: 10px; padding: 18px 10px; color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 15px; text-decoration: none; color: var(--ink);
}
.btn:hover { border-color: var(--muted); }
.fine { margin: 0; font-size: 13.5px; color: var(--muted); max-width: 46ch; }
.list-foot { padding: 6px 10px 4px; }

/* ---------- detail ---------- */
.detail { display: grid; gap: 22px; padding-bottom: 12px; }
.d-nav {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 4px 0 10px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.back { border: 0; background: none; padding: 6px 2px; font-weight: 700; font-size: 15.5px; color: var(--accent); }
.back .mob { display: none; }
.pn { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.pn button {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 19px; line-height: 1;
}
.pn button:hover { border-color: var(--muted); }
.pos { min-width: 52px; text-align: center; font-size: 14px; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }

.d-head { display: grid; gap: 8px; }
.d-head h2 {
  margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 50px; line-height: 0.92; letter-spacing: 0.005em; text-wrap: balance;
}
.d-market { margin: 0; font-size: 16px; color: var(--muted); line-height: 1.35; }
.d-market strong { color: var(--ink); font-weight: 800; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 27px; padding: 0 11px; border-radius: 999px;
  font-size: 14px; font-weight: 700; background: var(--track); color: var(--muted); font-variant-numeric: lining-nums;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.open { background: var(--ok-soft); color: var(--ok); }
.pill.soon { background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }

.d-season { display: grid; gap: 6px; padding: 14px 16px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.d-dates { margin: 0; font-size: 21px; font-weight: 800; line-height: 1.2; font-variant-numeric: lining-nums; text-wrap: balance; }
.d-hours { margin: 0 0 8px; font-size: 15px; color: var(--muted); font-variant-numeric: lining-nums; }
.sbar.big { height: 12px; border-radius: 4px; }
.sbar.big .run { border-radius: 3px; }
.axis { position: relative; height: 16px; font-family: var(--f-sc); font-weight: 700; font-size: 12px; letter-spacing: 0.06em; color: var(--muted); }
.axis span { position: absolute; top: 0; padding-left: 3px; }
.d-ext, .d-note { margin: 4px 0 0; font-size: 14.5px; color: var(--muted); line-height: 1.4; }
.d-ext { display: flex; gap: 8px; align-items: baseline; }
.sw { flex: none; width: 18px; height: 8px; border-radius: 2px; background: var(--accent); opacity: 0.3; transform: translateY(-1px); }

.facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 14px; }
.facts div { display: grid; gap: 1px; padding-top: 8px; border-top: 2px solid var(--ink); min-width: 0; }
.facts dt { font-family: var(--f-sc); font-weight: 700; font-size: 12.5px; letter-spacing: 0.06em; color: var(--muted); }
.facts dd { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.15; font-variant-numeric: lining-nums; overflow-wrap: anywhere; }

.d-sec { display: grid; gap: 8px; }
.d-sec h3 { margin: 0; font-family: var(--f-sc); font-weight: 700; font-size: 13px; letter-spacing: 0.08em; color: var(--muted); }
.d-sec p { margin: 0; max-width: 62ch; }
.d-sec ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; max-width: 62ch; }
.d-sec li { position: relative; padding-left: 18px; }
.d-sec li::before { content: ""; position: absolute; left: 3px; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 4px 11px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); font-size: 15px; }
.near { display: flex; flex-wrap: wrap; gap: 6px; }
.near-b {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px 0 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 15px; font-weight: 700;
}
.near-b:hover { border-color: var(--muted); }
.near-b .km { font-weight: 500; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
.maplink { justify-self: start; }

/* ---------- map ---------- */
.map-wrap {
  grid-area: map; position: relative; min-height: 0; overflow: hidden; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--water);
}
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#map:active { cursor: grabbing; }
.country { fill: var(--land); }
.country.feat { fill: var(--land-strong); }
.grat { fill: none; stroke: var(--grat); stroke-width: 0.7; stroke-dasharray: 1 4; vector-effect: non-scaling-stroke; }
.river { fill: none; stroke: var(--river); stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.river.r1 { stroke-width: 1.5; }
.river.r2 { stroke-width: 1.05; }
.river.r3 { stroke-width: 0.75; }
.lake { fill: var(--water); stroke: var(--river); stroke-width: 0.6; vector-effect: non-scaling-stroke; }
.border { fill: none; stroke: var(--border); stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.border.feat { stroke-width: 1.25; }
.border.other { stroke-width: 0.8; stroke-dasharray: 4 2.5; opacity: 0.8; }

.clab { font-family: var(--f-sc); font-weight: 500; fill: var(--muted); text-anchor: middle; pointer-events: none; }
.clab.big { font-size: 14px; letter-spacing: 0.3em; }
.clab.nb { font-size: 12px; letter-spacing: 0.24em; }
.clab.range { font-size: 13px; letter-spacing: 0.75em; }
.clab.sea, .clab.lake-l { font-family: var(--f-body); font-style: italic; font-size: 13px; letter-spacing: 0.08em; fill: var(--muted); }

.mk { cursor: pointer; }
.mk .halo { fill: var(--glow); opacity: var(--halo-op); pointer-events: none; }
.mk .dot {
  fill: var(--accent); stroke: var(--land-strong); stroke-width: 1.6;
  transform-box: fill-box; transform-origin: center; transition: transform .14s ease-out;
}
.mk .ring { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.mk .pulse { fill: none; stroke: var(--accent); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: pulse 1.9s ease-out infinite; pointer-events: none; }
.mk .cnt { fill: var(--accent-ink); font-family: var(--f-body); font-weight: 800; font-size: 12.5px; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.mk .lbl {
  font-family: var(--f-body); fill: var(--ink); paint-order: stroke; stroke: var(--land-strong); stroke-width: 4px;
  stroke-linejoin: round; font-variant-numeric: lining-nums;
}
.mk .hit { fill: transparent; }
.mk.is-hov .dot, .mk.is-sel .dot { transform: scale(1.22); }
.mk.is-hov .lbl, .mk.is-sel .lbl { fill: var(--accent); }
.mk.cl .dot { stroke-width: 2; }
.gh { cursor: pointer; }
.gh .gdot { fill: var(--ghost); opacity: 0.6; }
.gh .hit { fill: transparent; }
.gh.is-sel .gdot { fill: var(--accent); opacity: 0.7; }
.gh .gring { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 2 2; }
@keyframes pulse { 0% { transform: scale(0.9); opacity: 0.85; } 100% { transform: scale(1.9); opacity: 0; } }

.map-ctrl {
  position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 10px var(--shade); overflow: hidden;
}
.map-ctrl button { width: 38px; height: 38px; border: 0; background: transparent; display: grid; place-items: center; }
.map-ctrl button + button { border-top: 1px solid var(--line); }
.map-ctrl button:hover { background: var(--track); }
.map-ctrl svg { width: 16px; height: 16px; stroke: var(--ink); fill: none; stroke-width: 2; stroke-linecap: round; }
.map-ctrl button:disabled svg { opacity: 0.35; }

.legend {
  position: absolute; top: 12px; left: 12px; max-width: calc(100% - 80px); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 10px var(--shade); font-size: 14px;
}
.legend summary {
  list-style: none; cursor: pointer; padding: 7px 12px; font-family: var(--f-sc); font-weight: 700; font-size: 12.5px;
  letter-spacing: 0.08em; color: var(--muted); display: flex; align-items: center; gap: 8px;
}
.legend summary::-webkit-details-marker { display: none; }
.legend summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: auto; }
.legend[open] summary::after { transform: rotate(-135deg) translateX(-2px); }
.legend ul { margin: 0; padding: 0 12px 10px; list-style: none; display: grid; gap: 5px; }
.legend li { display: flex; align-items: center; gap: 9px; line-height: 1.2; }
.legend .lg-ghost { fill: var(--ghost); opacity: 0.6; }
.legend .lg-cl { fill: var(--accent); }
.legend .lg-cnt { fill: var(--accent-ink); font: 800 10px var(--f-body); text-anchor: middle; dominant-baseline: central; }

.credit {
  position: absolute; right: 10px; bottom: 8px; font-size: 11.5px; color: var(--muted); opacity: 0.8; pointer-events: none;
  text-shadow: 0 0 3px var(--water), 0 0 3px var(--water);
}

.tooltip {
  position: absolute; z-index: 5; pointer-events: none; width: max-content; max-width: 270px; display: grid; gap: 2px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px 11px;
  box-shadow: 0 6px 24px var(--shade); font-size: 14.5px; line-height: 1.3;
}
.tooltip p { margin: 0; }
.tt-eye { font-family: var(--f-sc); font-weight: 700; font-size: 12px; letter-spacing: 0.06em; color: var(--muted); }
.tt-name { font-family: var(--f-display); font-weight: 700; font-size: 25px; line-height: 1; padding: 1px 0 2px; }
.tt-sub { color: var(--muted); }
.tt-dates { font-weight: 700; padding-top: 4px; font-variant-numeric: lining-nums; }
.tt-exp { font-weight: 500; font-style: italic; color: var(--muted); }
.tt-st { font-weight: 700; font-size: 14px; color: var(--muted); font-variant-numeric: lining-nums; }
.tt-st.open { color: var(--ok); }
.tt-st.soon { color: var(--accent); }
.tt-hint { padding-top: 4px; font-size: 13px; color: var(--muted); font-style: italic; }
.tt-list { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.tt-list li { display: flex; align-items: center; gap: 8px; }
.tt-list .tt-d { margin-left: auto; padding-left: 12px; color: var(--muted); font-variant-numeric: lining-nums; }

/* ---------- desktop: detail replaces the list ---------- */
@media (min-width: 861px) {
  .app[data-mode="detail"] .list-view { display: none; }
}

/* ---------- phones and narrow tablets ---------- */
@media (max-width: 860px) {
  html, body { height: auto; }
  .app {
    height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto;
    grid-template-areas: "head" "map" "index"; row-gap: 16px;
  }
  .masthead { padding: 0; }
  h1 { font-size: 36px; }
  .map-wrap { height: min(62svh, 560px); min-height: 340px; }
  .index { overflow: visible; padding: 0; scrollbar-gutter: auto; }
  .detail {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; max-height: 74svh; overflow-y: auto;
    overscroll-behavior: contain; background: var(--surface); border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0; box-shadow: 0 -14px 40px var(--shade);
    padding-top: 0;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    padding-bottom: max(22px, env(safe-area-inset-bottom, 0px));
    animation: sheet .22s ease-out;
  }
  .detail .d-nav { background: var(--surface); padding-top: 12px; }
  .detail .d-season, .detail .tag, .detail .near-b { background: var(--bg); }
  .back .desk { display: none; }
  .back .mob { display: inline; }
  .d-head h2 { font-size: 44px; }
}
@media (max-width: 420px) {
  .item-meta .cc { display: none; }
}
@keyframes sheet { from { transform: translateY(28px); opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) {
  .mk .pulse { animation: none; transform: scale(1.35); opacity: 0.6; }
  .detail { animation: none; }
  .mk .dot { transition: none; }
}
