@font-face { font-family: "Grotesk"; src: url("/fonts/TimelessSans-GroteskLight.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Grotesk"; src: url("/fonts/TimelessSans-GroteskRegular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Grotesk"; src: url("/fonts/TimelessSans-GroteskMedium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Grotesk"; src: url("/fonts/TimelessSans-GroteskSemibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Serif"; src: url("/fonts/TimelessSerif-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Serif"; src: url("/fonts/TimelessSerif-LightItalic.woff2") format("woff2"); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: "Serif"; src: url("/fonts/TimelessSerif-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Serif"; src: url("/fonts/TimelessSerif-RegularItalic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Serif"; src: url("/fonts/TimelessSerif-Book.woff2") format("woff2"); font-weight: 450; font-display: swap; }

:root {
  --bg: #000;
  --panel: #0a0a0a;
  --surface: #141414;
  --surface-2: #1c1c1c;
  --surface-3: #262626;
  --glass: rgba(14, 14, 14, 0.72);
  --ink: #f3efe7;
  --ink-2: rgba(243, 239, 231, 0.64);
  --ink-3: rgba(243, 239, 231, 0.4);
  --ink-4: rgba(243, 239, 231, 0.16);
  --line: rgba(243, 239, 231, 0.08);
  --line-2: rgba(243, 239, 231, 0.14);
  --ember: #e8783e;
  --ember-ink: #ffb48a;
  --ember-soft: rgba(232, 120, 62, 0.14);
  --good: #7fc79a;
  --danger: #ff7a6b;
  --sans: "Grotesk", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --serif: "Serif", "Iowan Old Style", Georgia, serif;
  --r-card: 26px;
  --r-tile: 18px;
  --gutter: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body, button, input, textarea, select, canvas, .mapboxgl-map, .maplibregl-map {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
::selection { background: var(--ember); color: #000; }
[hidden] { display: none !important; }

/* ---------- canvas ---------- */
#map { position: fixed; inset: 0; background: #050505; }
#map .mapboxgl-ctrl-logo, #map .maplibregl-ctrl-logo { opacity: 0.35; }
#map .mapboxgl-ctrl-attrib, #map .maplibregl-ctrl-attrib { background: transparent !important; font-size: 9px; opacity: 0.35; }
#map .mapboxgl-ctrl-attrib a, #map .maplibregl-ctrl-attrib a { color: var(--ink-3) !important; }
#map .maplibregl-ctrl-attrib-button, #map .mapboxgl-ctrl-attrib-button { filter: invert(1); opacity: 0.3; }
#scrim { position: fixed; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, transparent 22%, transparent 55%, rgba(0,0,0,0.75) 100%); transition: opacity 0.4s; }
#screen { position: fixed; inset: 0; pointer-events: none; }
#screen > * { pointer-events: none; }
#screen .live { pointer-events: auto; }

/* ---------- type ---------- */
.serif { font-family: var(--serif); font-weight: 300; letter-spacing: -0.01em; }
.eyebrow { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }

/* ---------- controls ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 56px; padding: 0 26px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink); font-size: 17px; font-weight: 400;
  transition: transform 0.2s var(--ease), background 0.2s, opacity 0.2s;
  user-select: none; -webkit-user-select: none; white-space: nowrap;
}
.pill:active { transform: scale(0.97); }
.pill.light { background: var(--ink); color: #0a0a0a; font-weight: 500; }
.pill.ember { background: var(--ember); color: #160800; font-weight: 500; }
.pill.ghost { background: transparent; border: 1px solid var(--line-2); }
.pill.small { height: 40px; padding: 0 16px; font-size: 14px; }
.pill.block { width: 100%; }
.pill[disabled] { opacity: 0.4; pointer-events: none; }
.pill svg { width: 18px; height: 18px; flex: none; }

.round {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--glass); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--line); transition: transform 0.2s var(--ease); flex: none;
}
.round:active { transform: scale(0.94); }
.round svg { width: 20px; height: 20px; }
.round.solid { background: var(--surface-2); backdrop-filter: none; }

.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 14px;
  transition: all 0.2s var(--ease); white-space: nowrap;
}
.chip:active { transform: scale(0.96); }
.chip.on { background: var(--ink); color: #0a0a0a; border-color: var(--ink); }
.chip svg { width: 15px; height: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.chips.scroll::-webkit-scrollbar { display: none; }

.field { display: grid; gap: 10px; }
.field > label { font-size: 13px; color: var(--ink-3); letter-spacing: 0.02em; }
.input, .textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 15px 16px; font-size: 16px; outline: none; transition: border 0.2s;
}
.input:focus, .textarea:focus { border-color: var(--line-2); background: var(--surface-2); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.textarea { min-height: 112px; resize: none; line-height: 1.5; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface); border-radius: 999px; padding: 4px; border: 1px solid var(--line); }
.seg button { height: 40px; border-radius: 999px; font-size: 14px; color: var(--ink-2); transition: all 0.25s var(--ease); }
.seg button.on { background: var(--surface-3); color: var(--ink); }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 36px; background: transparent; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--ink) var(--fill, 50%), var(--surface-3) var(--fill, 50%)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--surface-3); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--ink); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); margin-top: -11px; box-shadow: 0 2px 12px rgba(0,0,0,0.5); }
input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); border: 0; }

/* ---------- dock ---------- */
#dock {
  position: fixed; left: 50%; bottom: calc(14px + var(--safe-bottom)); transform: translateX(-50%);
  display: flex; gap: 10px; z-index: 20; transition: transform 0.45s var(--ease), opacity 0.3s;
}
#dock.away { transform: translate(-50%, 140%); opacity: 0; pointer-events: none; }
#dock button {
  width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: rgba(30, 30, 30, 0.82); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid var(--line); transition: transform 0.25s var(--spring), background 0.25s, color 0.25s;
}
#dock button svg { width: 24px; height: 24px; }
#dock button.on { background: var(--ink); color: #0a0a0a; }
#dock button:active { transform: scale(0.92); }
#dock button .live-dot { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 3px rgba(0,0,0,0.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; top: calc(14px + var(--safe-top)); transform: translate(-50%, -160%);
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 11px 18px; font-size: 14px;
  z-index: 50; transition: transform 0.45s var(--ease); max-width: calc(100% - 32px); text-align: center; pointer-events: none;
}
#toast.show { transform: translate(-50%, 0); }

/* ---------- lock ---------- */
.lock { position: fixed; inset: 0; display: grid; place-items: center; padding: 32px; background: radial-gradient(120% 70% at 50% 110%, rgba(232,120,62,0.18), transparent 60%), #000; }
.lock-inner { width: min(360px, 100%); display: grid; gap: 28px; text-align: center; }
.lock .mark { width: 72px; height: 72px; margin: 0 auto; }
.lock h1 { font-family: var(--serif); font-weight: 300; font-size: 44px; line-height: 1; letter-spacing: -0.02em; }
.lock p { color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.lock form { display: grid; gap: 12px; }
.lock .input { text-align: center; height: 56px; border-radius: 999px; font-size: 17px; }
.lock .err { color: var(--danger); font-size: 14px; min-height: 20px; }

/* ---------- top bar (over the map) ---------- */
.topbar { position: fixed; left: 0; right: 0; top: 0; padding: calc(12px + var(--safe-top)) 16px 0; display: flex; gap: 10px; align-items: center; }
.wordmark { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 22px; letter-spacing: -0.01em; padding-left: 4px; }
.wordmark svg { width: 26px; height: 26px; }
.searchbox { flex: 1; position: relative; }
.searchbox .input { height: 46px; border-radius: 999px; padding-left: 44px; background: var(--glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.searchbox > svg { position: absolute; left: 15px; top: 13px; width: 20px; height: 20px; color: var(--ink-3); }
.results { position: absolute; left: 0; right: 0; top: 54px; background: rgba(16,16,16,0.96); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.results button { display: block; width: 100%; text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.results button:last-child { border-bottom: 0; }
.results b { display: block; font-weight: 400; font-size: 15px; }
.results span { display: block; font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- sheets & pages ---------- */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; max-height: 58vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(10,10,10,0.9), #070707 30%); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  border-top-left-radius: 30px; border-top-right-radius: 30px; border-top: 1px solid var(--line);
  padding: 10px 0 calc(96px + var(--safe-bottom)); animation: rise 0.55s var(--ease) both;
}
.sheet .grip { width: 38px; height: 4px; border-radius: 4px; background: var(--ink-4); margin: 0 auto 14px; flex: none; }
.sheet .scroll { overflow-y: auto; padding: 0 var(--gutter); overscroll-behavior: contain; scrollbar-width: none; }
.sheet .scroll::-webkit-scrollbar { display: none; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.page {
  position: fixed; inset: 0; background: var(--bg); overflow-y: auto; overscroll-behavior: contain;
  padding: calc(14px + var(--safe-top)) var(--gutter) calc(120px + var(--safe-bottom)); animation: fade 0.35s var(--ease) both;
  scrollbar-width: none;
}
.page::-webkit-scrollbar { display: none; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; min-height: 44px; }
.page-head .title { font-size: 15px; color: var(--ink-2); }
.page h1.big { font-family: var(--serif); font-weight: 300; font-size: 40px; line-height: 1.02; letter-spacing: -0.02em; }
.section { margin-top: 34px; display: grid; gap: 14px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.section-head h3 { font-size: 15px; font-weight: 500; }
.section-head button { font-size: 14px; color: var(--ink-3); }
.stack { display: grid; gap: 12px; }

/* ---------- show cards ---------- */
.cards { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(196px, 48%); gap: 12px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 4px; scroll-snap-type: x mandatory; }
.cards::-webkit-scrollbar { display: none; }
.card {
  position: relative; aspect-ratio: 0.78; border-radius: var(--r-card); overflow: hidden; text-align: left;
  display: flex; flex-direction: column; justify-content: space-between; padding: 16px; scroll-snap-align: start;
  border: 1px solid rgba(255,255,255,0.08); isolation: isolate; transition: transform 0.3s var(--ease);
}
.card:active { transform: scale(0.98); }
.card .cover { position: absolute; inset: 0; z-index: -1; }
.card .top { display: flex; justify-content: space-between; align-items: flex-start; }
.card .glyph { width: 30px; height: 30px; }
.card h4 { font-family: var(--serif); font-weight: 400; font-size: 23px; line-height: 1.05; letter-spacing: -0.01em; margin: 0 0 10px; }
.card .meta { font-size: 13px; color: rgba(255,255,255,0.7); }
.card .tag { font-size: 11px; padding: 5px 9px; border-radius: 999px; background: rgba(0,0,0,0.35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: rgba(255,255,255,0.85); }
.card.new { background: var(--surface); border-style: dashed; border-color: var(--line-2); align-items: flex-start; justify-content: flex-end; }
.card.new .plus { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; margin-bottom: auto; }

.area-row { display: grid; gap: 14px; padding: 18px 0 20px; border-bottom: 1px solid var(--line); }
.area-row:last-child { border-bottom: 0; }
.area-row .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.area-row h3 { font-family: var(--serif); font-weight: 300; font-size: 26px; letter-spacing: -0.01em; line-height: 1.1; }
.area-row .sub { font-size: 13px; color: var(--ink-3); margin-top: 4px; }

.empty { padding: 26px 4px 8px; display: grid; gap: 16px; }
.empty h2 { font-family: var(--serif); font-weight: 300; font-size: 30px; line-height: 1.08; letter-spacing: -0.015em; }
.empty p { color: var(--ink-2); font-size: 15px; max-width: 34ch; }

/* ---------- area drawing ---------- */
.reticle { position: fixed; left: 50%; top: 42%; width: 20px; height: 20px; transform: translate(-50%, -50%); pointer-events: none; }
.reticle::before, .reticle::after { content: ""; position: absolute; background: var(--ink); left: 50%; top: 50%; transform: translate(-50%, -50%); }
.reticle::before { width: 2px; height: 20px; }
.reticle::after { width: 20px; height: 2px; }
.drawpanel { position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-bottom)); background: rgba(10,10,10,0.92); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid var(--line); border-radius: 30px; padding: 20px; display: grid; gap: 16px; animation: rise 0.5s var(--ease) both; }
.drawpanel .row { display: flex; justify-content: space-between; align-items: baseline; }
.drawpanel .radius { font-family: var(--serif); font-size: 34px; font-weight: 300; }
.drawpanel .hint { font-size: 13px; color: var(--ink-3); }

/* ---------- show page ---------- */
.hero { position: relative; border-radius: 30px; overflow: hidden; min-height: 330px; padding: 22px; display: flex; flex-direction: column; justify-content: flex-end; isolation: isolate; border: 1px solid rgba(255,255,255,0.08); }
.hero .cover { position: absolute; inset: 0; z-index: -1; }
.hero .glyph { position: absolute; top: 22px; left: 22px; width: 40px; height: 40px; }
.hero h1 { font-family: var(--serif); font-weight: 300; font-size: 42px; line-height: 1; letter-spacing: -0.02em; }
.hero p { margin-top: 10px; color: rgba(255,255,255,0.78); font-size: 15px; max-width: 36ch; }
.hero .where { position: absolute; top: 24px; right: 22px; font-size: 13px; color: rgba(255,255,255,0.75); text-align: right; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface); border-radius: var(--r-tile); padding: 14px; display: grid; gap: 2px; }
.stat b { font-family: var(--serif); font-weight: 300; font-size: 30px; line-height: 1.05; letter-spacing: -0.02em; }
.stat b small { font-family: var(--sans); font-size: 13px; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.stat span { font-size: 12px; color: var(--ink-3); }

.researching { background: var(--surface); border-radius: var(--r-card); padding: 20px; display: grid; gap: 14px; }
.researching .line { display: flex; gap: 12px; align-items: center; color: var(--ink-2); font-size: 15px; }

/* the curriculum grid — one square per thread */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18px, 1fr)); gap: 5px; }
.grid i { aspect-ratio: 1; border-radius: 4px; background: var(--surface-3); }
.grid i.told { background: var(--ink); }
.grid i.next { background: var(--ember); }
.grid i.exhausted { background: var(--ink-2); }
.grid i.dropped { background: transparent; border: 1px solid var(--surface-3); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

.thread { background: var(--surface); border-radius: var(--r-tile); padding: 15px 16px; display: grid; gap: 8px; text-align: left; width: 100%; transition: background 0.2s; }
.thread .row { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.thread h4 { margin: 0; font-weight: 400; font-size: 16px; line-height: 1.3; }
.thread .lens { font-size: 12px; color: var(--ink-3); }
.thread .state { flex: none; font-size: 11px; padding: 4px 9px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); }
.thread .state.told { background: rgba(243,239,231,0.12); color: var(--ink); }
.thread .state.next { background: var(--ember-soft); color: var(--ember-ink); }
.thread .state.dropped { background: transparent; border: 1px solid var(--line-2); color: var(--ink-3); }
.thread.dropped h4 { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-4); }
.thread .more { display: none; gap: 12px; padding-top: 6px; }
.thread.open .more { display: grid; }
.thread .more p { color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.thread .more ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; display: grid; gap: 4px; }
.thread .more .src { font-size: 12px; color: var(--ink-3); word-break: break-all; }
.thread .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.episode { background: var(--surface); border-radius: var(--r-card); padding: 16px; display: grid; grid-template-columns: 76px 1fr; gap: 14px; text-align: left; width: 100%; align-items: center; }
.episode .route { width: 76px; height: 76px; border-radius: 16px; background: #0c0c0c; }
.episode h4 { margin: 0 0 4px; font-family: var(--serif); font-weight: 400; font-size: 20px; line-height: 1.1; }
.episode .meta { font-size: 13px; color: var(--ink-3); }
.episode p { font-size: 13px; color: var(--ink-2); margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- voices ---------- */
.voices { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; max-height: 340px; overflow-y: auto; padding-right: 2px; scrollbar-width: thin; }
.voice { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid transparent; border-radius: 16px; padding: 10px 12px 10px 14px; text-align: left; width: 100%; }
.voice.on { border-color: var(--ink); background: var(--surface-2); }
.voice .who { flex: 1; min-width: 0; }
.voice b { display: block; font-weight: 400; font-size: 15px; }
.voice span { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice .play { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; flex: none; }
.voice .play svg { width: 15px; height: 15px; }
.voice .play.busy { animation: pulse 1s infinite; }

/* ---------- walk ---------- */
.walk-top { position: fixed; left: 0; right: 0; top: 0; padding: calc(12px + var(--safe-top)) 16px 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.walk-top .badge { background: var(--glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; height: 44px; display: flex; align-items: center; gap: 9px; font-size: 14px; min-width: 0; }
.walk-top .badge span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gps { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.gps.ok { background: var(--good); box-shadow: 0 0 10px var(--good); }
.gps.weak { background: #e7c35a; }

.walk-panel {
  position: fixed; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 0, #000 64px);
  padding: 64px var(--gutter) calc(18px + var(--safe-bottom)); display: grid; gap: 18px; animation: rise 0.6s var(--ease) both;
}
.now { display: grid; gap: 8px; min-height: 92px; align-content: end; }
.now .kicker { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.now .kicker .lensdot { width: 6px; height: 6px; border-radius: 50%; background: var(--ember); }
.now h2 { font-family: var(--serif); font-weight: 300; font-size: 30px; line-height: 1.06; letter-spacing: -0.015em; }
.caption { font-size: 15px; line-height: 1.5; color: var(--ink-2); min-height: 45px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; transition: opacity 0.3s; }

.wave-wrap { position: relative; display: grid; gap: 8px; }
.wave { width: 100%; height: 76px; display: block; touch-action: none; cursor: pointer; }
.wave-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-3); }
.wave-meta .up { display: inline-flex; align-items: center; gap: 7px; }
.wave-meta .up i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.wave-meta .up.writing i { background: var(--ember); animation: pulse 1s infinite; }
.wave-meta .up.ready i { background: var(--good); }

.walk-stats { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.walk-stats .big { font-family: var(--serif); font-weight: 300; font-size: 54px; line-height: 0.9; letter-spacing: -0.03em; }
.walk-stats .big small { font-family: var(--sans); font-size: 14px; color: var(--ink-3); letter-spacing: 0; margin-left: 4px; }
.walk-stats .side { text-align: right; font-size: 14px; color: var(--ink-2); display: grid; gap: 2px; }

.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hold { position: relative; overflow: hidden; color: var(--ember-ink); }
.hold .fill { position: absolute; inset: 0; background: var(--ember); transform-origin: left; transform: scaleX(0); z-index: 0; }
.hold.holding .fill { transition: transform 1.1s linear; transform: scaleX(1); }
.hold.holding { color: #160800; }
.hold > *:not(.fill) { position: relative; z-index: 1; }
.hold .sq { display: inline-block; width: 16px; height: 16px; border-radius: 4px; background: var(--ember); }
.hold.holding .sq { background: #160800; }
.steer { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.steer::-webkit-scrollbar { display: none; }

.start { display: grid; gap: 22px; }
.start h2 { font-family: var(--serif); font-weight: 300; font-size: 38px; line-height: 1.02; letter-spacing: -0.02em; }
.start .tuning { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 14px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: flex-end; z-index: 40; animation: fade 0.25s both; }
.modal .box { width: 100%; background: #0d0d0d; border-top-left-radius: 30px; border-top-right-radius: 30px; border-top: 1px solid var(--line); padding: 22px var(--gutter) calc(22px + var(--safe-bottom)); display: grid; gap: 16px; animation: rise 0.45s var(--ease) both; }
.modal h3 { font-family: var(--serif); font-weight: 300; font-size: 28px; }

/* ---------- episode ---------- */
.notes { background: var(--surface); border-radius: var(--r-card); padding: 20px; display: grid; gap: 14px; }
.notes ol { margin: 0; padding-left: 20px; display: grid; gap: 10px; color: var(--ink); font-family: var(--serif); font-size: 19px; line-height: 1.3; font-weight: 300; }
.seg-row { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.seg-row:last-child { border-bottom: 0; }
.seg-row .play { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; }
.seg-row .play svg { width: 16px; height: 16px; }
.seg-row h4 { margin: 0; font-weight: 400; font-size: 16px; }
.seg-row .meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.seg-row details { margin-top: 8px; }
.seg-row summary { font-size: 13px; color: var(--ink-3); cursor: pointer; list-style: none; }
.seg-row summary::-webkit-details-marker { display: none; }
.seg-row details p { margin-top: 8px; font-size: 14px; color: var(--ink-2); line-height: 1.6; }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink-4); border-top-color: var(--ink); animation: spin 0.9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* map markers */
.me { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); border: 4px solid #000; box-shadow: 0 0 0 2px var(--ember), 0 0 24px rgba(232,120,62,0.7); }
.pin { padding: 6px 10px; border-radius: 999px; background: rgba(10,10,10,0.85); border: 1px solid var(--line-2); font-size: 12px; color: var(--ink); white-space: nowrap; transform: translateY(-14px); backdrop-filter: blur(8px); }
.pin.hot { background: var(--ember); color: #160800; border-color: var(--ember); }
.area-label { font-family: var(--serif); font-size: 17px; color: var(--ink); text-shadow: 0 1px 12px #000; white-space: nowrap; pointer-events: auto; cursor: pointer; }

/* ---------- desktop: panels dock to the left, the map breathes ---------- */
@media (min-width: 900px) {
  .sheet, .page, .walk-panel {
    left: 16px; right: auto; top: 16px; bottom: 16px; width: 440px; max-height: none;
    border-radius: 30px; border: 1px solid var(--line); background: #070707;
  }
  .sheet { padding-bottom: 104px; }
  .sheet .grip { display: none; }
  .page { padding: 22px 26px 120px; }
  .walk-panel { top: auto; background: #050505; padding: 26px; }
  .topbar, .walk-top { left: 472px; }
  #dock { left: 236px; }
  .drawpanel { left: auto; right: 24px; width: 380px; bottom: 24px; }
  .modal { align-items: center; justify-content: center; }
  .modal .box { width: 440px; border-radius: 30px; border: 1px solid var(--line); }
  #scrim { background: linear-gradient(90deg, rgba(0,0,0,0.6) 0, transparent 40%); }
  #toast { left: 236px; }
}

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