:root {
  --paper: #f6f3e9;
  --paper-deep: #ece8d8;
  --water: #cce9e5;
  --water-deep: #93ccc9;
  --land: #d9e3c4;
  --land-high: #c4bd9e;
  --ink: #142b2a;
  --ink-soft: #355452;
  --muted: #617773;
  --line: rgba(20, 72, 67, .2);
  --line-strong: rgba(20, 72, 67, .48);
  --accent: #08756c;
  --accent-quiet: #d9efea;
  --sun: #d58a3f;
  --warning: #9b4d1b;
  --warning-quiet: #f7e6d4;
  --shadow: 0 14px 36px rgba(37, 77, 70, .13);
  --tap: 44px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --font-display: "Archivo", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --font-mono: "Chivo Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/archivo-latin-200-800.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Chivo Mono";
  src: url("assets/fonts/chivo-mono-latin-400-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); -webkit-text-size-adjust: 100%; }
body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  word-break: keep-all;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
}
a { color: var(--accent); }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 9px 14px;
  background: #fff;
  border: 2px solid var(--accent);
  color: var(--ink);
  text-decoration: none;
}
.skip-link:focus { top: calc(var(--safe-top) + 10px); }

.console-shell { position: relative; min-height: 100dvh; isolation: isolate; }
.console-main { position: relative; min-height: 100dvh; }
.console-header {
  position: absolute;
  top: calc(var(--safe-top) + 18px);
  left: 50%;
  z-index: 24;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  width: min(1040px, calc(100% - 48px));
  transform: translateX(-50%);
  pointer-events: none;
}
.console-header > * { pointer-events: auto; }
.header-copy { max-width: 420px; padding: 12px 16px 13px; background: rgba(251, 250, 242, .88); border-left: 4px solid var(--accent); box-shadow: 0 7px 18px rgba(37, 77, 70, .08); }
.eyebrow, .rail-kicker, .time-kicker, .context-kicker, .panel-kicker, .print-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
  line-height: 1.2;
  text-transform: uppercase;
}
.header-copy h1 { margin: 5px 0 0; font-family: var(--font-display); font-size: clamp(28px, 4vw, 46px); font-weight: 800; letter-spacing: -.06em; line-height: 1.02; }
.phase-why { max-width: 400px; margin: 9px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.45; }
.phase-controls-wrap { position: absolute; top: 0; left: 50%; display: flex; align-items: center; gap: 9px; transform: translateX(-50%); }
.phase-controls { display: flex; gap: 2px; padding: 4px; background: rgba(248, 248, 239, .9); border: 1px solid var(--line); }
.phase-control {
  min-height: 42px;
  border: 1px solid transparent;
  padding: 6px 13px;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}
.phase-control small { display: block; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.phase-control.is-active { background: var(--accent); color: #fff; }
.phase-control.is-active small { color: #dcf4ee; }
.deadline-badge {
  display: flex;
  flex-direction: column;
  min-width: 138px;
  padding: 9px 12px;
  background: var(--warning-quiet);
  border: 1px solid rgba(155, 77, 27, .45);
  color: var(--warning);
  box-shadow: 0 7px 18px rgba(92, 57, 34, .08);
}
.deadline-label { font-size: 11px; font-weight: 750; line-height: 1.25; }
.deadline-date { margin-top: 2px; font-family: var(--font-mono); font-size: 15px; font-weight: 700; line-height: 1.15; }
.deadline-badge[data-deadline-state="past-due"] { background: var(--paper-deep); border-color: var(--line-strong); color: var(--ink-soft); }

.terrain-stage {
  position: absolute;
  inset: 0;
  z-index: auto;
  min-height: 70vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--water);
}
.terrain-atmosphere {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 28% 28%, rgba(255, 255, 255, .75), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, .34), transparent 46%),
    linear-gradient(180deg, #bfe4df 0%, #d9ece0 56%, #dae7cf 100%);
  opacity: .94;
}
.terrain-stage canvas { position: absolute; inset: 0; z-index: 2; display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.terrain-stage canvas:active { cursor: grabbing; }
.label-host { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.fallback-host { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; padding: 8vh 13vw 12vh; opacity: 1; pointer-events: auto; visibility: visible; }
.console-shell[data-scene-mode="webgl"] .fallback-host, .console-shell.webgl-ready .fallback-host { opacity: 0; pointer-events: none; visibility: hidden; }
.console-shell[data-scene-mode="fallback"] .fallback-host, .console-shell.fallback-active .fallback-host { opacity: 1; pointer-events: auto; visibility: visible; z-index: 5; }
.console-shell[data-scene-mode="fallback"] .terrain-stage canvas, .console-shell.fallback-active .terrain-stage canvas { opacity: 0; pointer-events: none; }
.fallback-map { display: block; width: min(900px, 100%); height: auto; aspect-ratio: 107.55933135 / 70; overflow: visible; }
.fallback-relief { display: block; pointer-events: none; }
.fallback-land { fill: none; stroke: #6e9f89; stroke-width: 1.5px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.fallback-contour { fill: none; stroke: rgba(108, 147, 116, .36); stroke-width: 3; stroke-dasharray: 8 10; }
.fallback-ridge { fill: rgba(190, 185, 144, .66); stroke: rgba(102, 126, 100, .55); stroke-width: 3; }
.fallback-route { fill: none; stroke: #d37e3b; stroke-width: 1.8px; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 3 7; vector-effect: non-scaling-stroke; }
.fallback-marker { fill: none; stroke: rgba(255, 255, 255, .92); stroke-width: 0.7px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.fallback-marker.hallasan { fill: #e7f3d7; }
.fallback-marker.seongsan { fill: #f9d9ad; stroke: var(--warning); }
.fallback-selection { fill: none; stroke: rgba(21, 47, 56, .84); stroke-width: 0.8px; vector-effect: non-scaling-stroke; }
.fallback-label { fill: var(--ink); font-family: var(--font-display); font-size: 24px; font-weight: 800; paint-order: stroke; stroke: rgba(255,255,255,.85); stroke-width: 8px; }
.fallback-label.minor { fill: var(--ink-soft); font-size: 18px; font-weight: 650; }
.label-host .spatial-label { fill: var(--ink); font-family: var(--font-display); font-size: 12px; font-weight: 700; paint-order: stroke; stroke: rgba(255,255,255,.9); stroke-width: 3px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.fallback-map .spatial-label { fill: var(--ink); font-family: var(--font-display); font-size: 1.75px; font-weight: 700; paint-order: stroke; stroke: rgba(255,255,255,.9); stroke-width: 1.5px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.terrain-caption { position: absolute; left: 28px; bottom: 22px; z-index: 8; display: flex; gap: 11px; align-items: center; padding: 7px 10px; background: rgba(251, 250, 242, .82); border-left: 3px solid var(--accent); color: var(--ink-soft); font-size: 11px; }
.terrain-caption span:first-child { color: var(--accent); font-weight: 800; }
.scene-controls { position: absolute; right: calc(min(370px, 31vw) + 28px); bottom: 90px; z-index: 32; display: flex; gap: 5px; align-items: center; }
.scene-controls button { min-width: var(--tap); min-height: var(--tap); border: 1px solid var(--line-strong); background: rgba(251, 250, 242, .9); color: var(--ink); font-size: 17px; font-weight: 800; }
.scene-controls .scene-enable { min-width: 116px; padding: 0 12px; color: var(--accent); font-size: 12px; letter-spacing: .02em; }
.scene-controls .scene-enable[aria-busy="true"] { cursor: progress; opacity: .68; }
.scene-status { max-width: 164px; padding: 5px 7px; color: var(--ink-soft); font: 650 10px/1.25 "Chivo Mono", monospace; text-align: right; }
.console-shell:not([data-scene-mode="webgl"]) .scene-controls button[data-scene-action="zoom-in"],
.console-shell:not([data-scene-mode="webgl"]) .scene-controls button[data-scene-action="zoom-out"],
.console-shell:not([data-scene-mode="webgl"]) .scene-controls button[data-scene-action="fit"] { display: none; }
.scene-controls button[data-scene-action="fit"] { min-width: 58px; font-size: 12px; }

.layer-rail {
  position: absolute;
  top: 50%;
  left: 24px;
  z-index: 20;
  width: 144px;
  transform: translateY(-50%);
  padding: 13px 10px 10px;
  background: rgba(251, 250, 242, .83);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.rail-kicker { margin: 0 6px 9px; color: var(--muted); }
.layer-rail-controls { display: flex; flex-direction: column; gap: 4px; }
.lens-control {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  padding: 5px 7px;
  background: transparent;
  color: var(--ink-soft);
  text-align: left;
}
.lens-control.is-active { border-color: var(--accent); background: var(--accent-quiet); color: var(--accent); }
.lens-control.is-dimmed { opacity: .55; }
.lens-control:hover, .lens-control:focus-visible { opacity: 1; border-color: var(--line-strong); }
.lens-glyph { display: grid; place-items: center; width: 22px; color: var(--sun); font-size: 15px; font-weight: 900; }
.lens-control.is-active .lens-glyph { color: var(--accent); }
.lens-copy { display: flex; min-width: 0; flex-direction: column; }
.lens-label { font-size: 13px; line-height: 1.2; }
.lens-count { color: var(--muted); font-size: 10px; line-height: 1.2; }

.context-surface {
  position: absolute;
  top: calc(var(--safe-top) + 114px);
  right: 24px;
  bottom: 106px;
  z-index: 22;
  display: flex;
  width: min(370px, 31vw);
  flex-direction: column;
  overflow: hidden;
  background: rgba(251, 250, 242, .96);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}
.sheet-handle { display: none; }
.context-topline { flex: none; padding: 16px 19px 13px; border-bottom: 1px solid var(--line); }
.context-topline h2 { margin: 5px 0 0; font-size: 20px; letter-spacing: -.04em; line-height: 1.15; }
.context-hint { margin: 7px 0 0; color: var(--muted); font-family: var(--font-display); font-size: 12px; font-weight: 200; }
.sheet-controls { display: flex; gap: 3px; margin-top: 9px; }
.sheet-controls button { min-height: 30px; border: 1px solid var(--line); padding: 3px 8px; background: #fffef8; color: var(--ink-soft); font-size: 11px; }
.sheet-controls button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-quiet); color: var(--accent); font-weight: 800; }
.context-panel { min-height: 0; overflow-y: auto; padding: 0 19px 18px; overscroll-behavior: contain; }
.panel-heading { padding: 15px 0 10px; border-bottom: 1px solid var(--line); }
.context-topline h2, .panel-title, .panel-heading h3, .print-title { font-family: var(--font-display); font-weight: 800; }
.panel-title { margin: 5px 0 0; font-size: 20px; letter-spacing: -.04em; line-height: 1.2; }
.panel-lede { margin: 7px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.48; }
.panel-meta { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.panel-empty { margin: 22px 0; color: var(--muted); font-size: 13px; }
.itinerary-days, .during-days { display: flex; gap: 4px; padding: 10px 0 8px; overflow-x: auto; }
.itinerary-day, .during-day { flex: 0 0 auto; min-height: 43px; border: 1px solid var(--line); padding: 5px 9px; background: #fffef8; color: var(--ink-soft); text-align: left; }
.itinerary-day.is-active, .during-day.is-active { border-color: var(--accent); background: var(--accent-quiet); color: var(--accent); }
.day-number { display: block; font-size: 10px; letter-spacing: .08em; }
.day-date { display: block; font-size: 11px; }
.active-day-heading { padding: 7px 0 4px; }
.active-day-heading h3 { margin: 0; font-size: 15px; }
.day-note { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.itinerary-stops { margin: 0; padding: 0; list-style: none; }
.itinerary-stop { border-top: 1px solid var(--line); }
.stop-button { display: grid; grid-template-columns: 44px 19px minmax(0, 1fr); gap: 5px; align-items: center; width: 100%; min-height: 49px; border: 0; padding: 6px 0; background: transparent; color: var(--ink); text-align: left; }
.itinerary-stop.is-selected .stop-button { color: var(--accent); }
.stop-time { color: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.stop-marker { font-size: 13px; text-align: center; }
.stop-marker.fixed { color: var(--warning); }
.stop-marker.plan { color: var(--accent); }
.stop-copy { display: flex; min-width: 0; flex-direction: column; }
.stop-name { overflow: hidden; font-size: 14px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.stop-ref { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.food-summary { display: -webkit-box; overflow: hidden; color: var(--ink-soft); font-size: 10px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.itinerary-ledgers { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.deadline-ledger-list, .decision-ledger-list { margin: 0; padding: 0; list-style: none; }
.deadline-row, .decision-row { margin-top: 6px; padding: 9px; background: rgba(255, 255, 255, .52); border: 1px solid var(--line); }
.deadline-row.is-expired { background: var(--paper-deep); color: var(--ink-soft); }
.deadline-row.is-dday { border-color: var(--warning); background: var(--warning-quiet); }
.deadline-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.deadline-countdown { color: var(--accent); font-family: var(--font-mono); font-size: 11px; }
.deadline-row.is-expired .deadline-countdown { color: var(--muted); }
.deadline-row.is-dday .deadline-countdown { color: var(--warning); }
.deadline-row .deadline-date { margin: 0; color: var(--muted); font-size: 10px; }
.deadline-row .deadline-label, .decision-title { display: block; margin-top: 4px; font-size: 12px; }
.deadline-what, .decision-facts { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.deadline-detail, .decision-why, .decision-hint { margin: 5px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.4; }
.decision-hint { padding-left: 7px; border-left: 2px solid var(--accent); }
.detail-figure { margin: 13px 0 0; }
.detail-figure img { display: block; width: 100%; max-height: 145px; object-fit: cover; }
.detail-figure figcaption { margin-top: 4px; color: var(--muted); font-size: 11px; }
.detail-body { padding: 12px 0 0; }
.section-label, .result-label { margin: 13px 0 7px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.gate-list { display: flex; flex-direction: column; gap: 5px; }
.gate-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.gate-mark { min-width: 43px; padding: 2px 4px; font-size: 10px; font-weight: 800; text-align: center; }
.gate-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.gate-copy strong { font-size: 12px; }
.gate-copy small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.gate-row.pass .gate-mark { background: var(--accent-quiet); color: var(--accent); }
.gate-row.fail .gate-mark { background: var(--warning-quiet); color: var(--warning); }
.gate-row.unknown .gate-mark { background: var(--paper-deep); color: var(--muted); }
.price-list { display: flex; flex-direction: column; gap: 4px; }
.price-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 7px; padding: 7px 8px; border-left: 3px solid var(--line); background: rgba(255, 255, 255, .56); }
.price-row.is-best { border-left-color: var(--accent); background: var(--accent-quiet); }
.price-channel { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.price-value { font-family: var(--font-mono); font-size: 13px; font-weight: 700; white-space: nowrap; }
.price-badge, .price-note { grid-column: 1 / -1; color: var(--muted); font-size: 10px; line-height: 1.35; }
.price-badge { color: var(--accent); font-weight: 800; }
.detail-definitions { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 5px 8px; margin: 13px 0 0; }
.detail-definitions dt { color: var(--muted); font-size: 11px; }
.detail-definitions dd { margin: 0; font-size: 12px; line-height: 1.42; }
.detail-list { margin: 0; padding-left: 17px; color: var(--ink-soft); font-size: 12px; }
.detail-links { display: flex; flex-wrap: wrap; gap: 5px 12px; margin: 0; padding-left: 17px; font-size: 12px; }
.detail-links a { overflow-wrap: anywhere; }
.phone-link { display: inline-flex; min-height: 28px; align-items: center; color: var(--accent); font-weight: 750; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.detail-reasoning { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.rainy-list li, .rainy-alternatives li { display: flex; flex-direction: column; gap: 3px; margin-bottom: 7px; }
.detail-caution { margin: 12px 0; padding: 8px; background: var(--warning-quiet); color: var(--warning); font-size: 12px; }
.panel-action { min-height: var(--tap); border: 1px solid var(--accent); padding: 7px 12px; background: var(--accent); color: #fff; font-weight: 750; }
.panel-action.secondary { border-color: var(--line-strong); background: transparent; color: var(--ink-soft); }
.panel-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.planner-fields { display: flex; flex-direction: column; gap: 8px; padding-top: 13px; }
.planner-gates, .planner-climate, .planner-options { margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); }
.planner-section-title { margin: 0; font-size: 13px; }
.planner-section-note, .planner-climate-period, .planner-climate-fact, .planner-climate-rationale, .planner-climate-unverified { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.planner-climate-rationale { padding: 6px 7px; background: var(--accent-quiet); color: var(--ink-soft); }
.planner-gate-controls { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.planner-gate-filter { min-height: 36px; border: 1px solid var(--line-strong); padding: 5px 8px; background: #fffef8; color: var(--ink-soft); font-size: 11px; }
.planner-gate-filter[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-quiet); color: var(--accent); font-weight: 800; }
.planner-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.planner-option-name { font-size: 12px; }
.planner-option-rate { color: var(--muted); font-family: var(--font-mono); font-size: 10px; }
.planner-gate-evidence { display: flex; grid-column: 1 / -1; flex-wrap: wrap; gap: 3px; }
.planner-gate-status { padding: 2px 5px; background: var(--paper-deep); color: var(--muted); font-size: 9px; }
.planner-gate-status.pass { background: var(--accent-quiet); color: var(--accent); }
.planner-gate-status.fail { background: var(--warning-quiet); color: var(--warning); }
.planner-field { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px; align-items: center; }
.planner-night { font-size: 12px; font-weight: 750; }
.planner-note { grid-column: 1 / -1; margin-top: -6px; color: var(--muted); font-size: 10px; }
.planner-field select { width: 100%; min-height: var(--tap); border: 1px solid var(--line-strong); padding: 5px 8px; background: #fffef8; color: var(--ink); }
.planner-result { margin-top: 15px; padding: 12px; background: rgba(217, 239, 234, .65); border-left: 4px solid var(--accent); }
.result-label { margin-top: 0; }
.result-total { display: block; font-family: var(--font-mono); font-size: 26px; font-weight: 700; letter-spacing: -.05em; }
.result-saving, .result-warning, .result-line, .result-fixed { margin: 5px 0 0; font-size: 11px; line-height: 1.4; }
.result-saving { color: var(--accent); font-weight: 750; }
.result-warning { color: var(--warning); }
.result-line { color: var(--ink-soft); }
.result-fixed { color: var(--muted); }
.next-stop { padding: 9px 0 0; }
.next-stop-button { display: grid; grid-template-columns: 53px minmax(0, 1fr) auto; gap: 8px; align-items: center; width: 100%; min-height: 62px; border: 1px solid var(--accent); padding: 9px; background: var(--accent-quiet); color: var(--ink); text-align: left; }
.next-time { color: var(--accent); font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.next-name { font-size: 16px; }
.next-kind { color: var(--muted); font-size: 10px; }
.sun-strip { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 13px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12px; }
.sun-strip small { width: 100%; color: var(--muted); font-size: 10px; }
.sun-strip .sun-note { width: 100%; margin: 1px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.4; }
.field-refs { padding-top: 4px; }
.field-ref { display: grid; grid-template-columns: auto auto; gap: 3px 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.field-ref strong { font-size: 12px; }
.field-ref small { grid-column: 1 / -1; color: var(--muted); font-size: 10px; line-height: 1.35; }
.field-ref .phone-link { grid-column: 1 / -1; justify-self: start; font-size: 11px; }
.ref-code { color: var(--accent); font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.open-places p { margin: 4px 0; color: var(--ink-soft); font-size: 12px; }
.rainy-alternatives { margin-top: 12px; padding-top: 2px; border-top: 1px solid var(--line); }

.time-rail {
  position: absolute;
  right: 24px;
  bottom: 18px;
  left: 204px;
  z-index: 21;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 10px 15px;
  background: rgba(251, 250, 242, .88);
  border-top: 1px solid var(--line-strong);
  box-shadow: 0 7px 18px rgba(37, 77, 70, .08);
}
.time-kicker { flex: 0 0 auto; color: var(--muted); }
.time-rail-controls { display: flex; min-width: 0; flex: 1; align-items: center; gap: 17px; }
.time-days { display: flex; min-width: 0; flex: 1; gap: 3px; }
.time-day { flex: 1; min-height: 40px; border: 1px solid transparent; padding: 5px 7px; background: transparent; color: var(--ink-soft); font-size: 11px; text-align: left; }
.time-day strong { display: inline; margin-right: 5px; font-size: 10px; }
.time-day.is-active { border-color: var(--accent); background: var(--accent-quiet); color: var(--accent); font-weight: 800; }
.time-scrubber { display: flex; min-width: 190px; align-items: center; gap: 9px; }
.time-label { color: var(--ink-soft); font-family: var(--font-mono); font-size: 11px; white-space: nowrap; }
.time-scrubber input { width: 100%; accent-color: var(--accent); }

.print-record { display: none; max-width: 980px; padding: 36px 28px 52px; background: #fffef8; color: var(--ink); }
.print-title { margin: 6px 0 7px; font-size: 28px; letter-spacing: -.05em; }
.print-lede, .print-source { max-width: 78ch; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.print-section { margin-top: 22px; break-inside: avoid; }
.print-section h3 { margin: 0; padding-bottom: 7px; border-bottom: 2px solid var(--ink); font-size: 16px; }
.print-list { margin: 8px 0 0; padding-left: 21px; }
.print-list li { margin: 4px 0; font-size: 12px; line-height: 1.55; }
.print-total { margin: 8px 0 0; color: var(--accent); font-size: 13px; font-weight: 800; }
.print-source { margin: 26px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.console-footer { max-width: 980px; margin: 0 auto; padding: 0 28px 42px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.console-footer p { margin: 5px 0; }
.footer-meta { font-family: var(--font-mono); font-size: 10px; font-weight: 400; }

@media (max-width: 900px) {
  .console-header { width: calc(100% - 32px); gap: 12px; }
  .header-copy { max-width: 330px; }
  .phase-controls-wrap { position: static; transform: none; }
  .phase-controls-wrap { flex-direction: column; align-items: stretch; gap: 5px; }
  .phase-controls { justify-content: center; }
  .deadline-badge { min-width: 126px; }
  .context-surface { width: min(370px, 42vw); }
  .time-rail { left: 183px; }
  .scene-controls { right: calc(min(370px, 42vw) + 28px); bottom: 90px; }
}

@media (max-width: 700px) {
  body { font-size: 14px; }
  .console-shell { min-height: 100dvh; }
  .console-header { top: calc(var(--safe-top) + 9px); width: calc(100% - 20px); flex-direction: column; gap: 6px; }
  .header-copy { width: min(100%, 340px); padding: 9px 11px 10px; }
  .header-copy h1 { font-size: 23px; }
  .phase-why { margin-top: 6px; font-size: 11px; }
  .phase-controls-wrap { width: 100%; flex-direction: row; align-items: stretch; justify-content: space-between; }
  .phase-controls-wrap { position: static; transform: none; }
  .phase-controls { flex: 1; }
  .phase-control { min-height: 38px; flex: 1; padding: 4px 5px; font-size: 11px; }
  .phase-control small { font-size: 8px; }
  .deadline-badge { min-width: 112px; padding: 7px 8px; }
  .deadline-label { font-size: 9px; }
  .deadline-date { font-size: 12px; }
  .terrain-stage { min-height: 100dvh; height: 100dvh; }
  .fallback-host { padding: 20vh 2vw 27vh; }
  .fallback-map { width: 116%; max-width: none; height: auto; }
  .fallback-label { font-size: 20px; }
  .fallback-label.minor { font-size: 15px; }
  .fallback-map .spatial-label { font-size: 2.5px; stroke-width: 1.25px; }
  .layer-rail { top: calc(var(--safe-top) + 165px); left: 10px; width: 172px; padding: 8px; transform: none; }
  .rail-kicker { margin: 0 4px 4px; font-size: 9px; }
  .layer-rail-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
  .lens-control { min-height: 34px; justify-content: center; gap: 3px; padding: 2px 3px; }
  .lens-glyph { width: 16px; font-size: 12px; }
  .lens-label { font-size: 10px; }
  .lens-count { display: none; }
  .context-surface {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--sheet-height, 96px);
    padding-bottom: var(--safe-bottom);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
    transition: height .7s cubic-bezier(.2,.75,.25,1);
  }
  .console-shell[data-sheet-position="peek"] { --sheet-height: 96px; }
  .console-shell[data-sheet-position="half"] { --sheet-height: 52dvh; }
  .console-shell[data-sheet-position="full"] { --sheet-height: calc(100dvh - var(--safe-top)); }
  .context-surface[data-sheet-position="peek"] { --sheet-height: 96px; }
  .context-surface[data-sheet-position="half"] { --sheet-height: 52dvh; }
  .context-surface[data-sheet-position="full"] { --sheet-height: calc(100dvh - var(--safe-top)); }
  .sheet-handle { display: block; flex: none; height: 24px; padding-top: 9px; }
  .sheet-handle span { display: block; width: 42px; height: 4px; margin: 0 auto; background: var(--line-strong); border-radius: 4px; }
  .context-topline { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 9px; align-items: baseline; padding: 0 16px 9px; }
  .context-kicker { grid-column: 1 / -1; font-size: 9px; }
  .context-topline h2 { margin: 0; font-size: 17px; }
  .context-hint { margin: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .sheet-controls { grid-column: 1 / -1; margin-top: 5px; }
  .sheet-controls button { min-height: 28px; flex: 1; padding: 2px 5px; font-size: 10px; }
  .context-panel { padding: 0 16px 17px; }
  .time-rail { position: fixed; right: 10px; bottom: calc(var(--sheet-height, 96px) + 8px); left: 10px; display: block; min-height: 0; padding: 6px 9px; z-index: 24; }
  .context-surface[data-sheet-position="peek"] ~ .time-rail { bottom: calc(96px + 8px); }
  .context-surface[data-sheet-position="half"] ~ .time-rail { bottom: calc(52dvh + 8px); }
  .context-surface[data-sheet-position="full"] ~ .time-rail { top: calc(var(--safe-top) + 31px); right: 10px; bottom: auto; left: 10px; z-index: 30; }
  .console-shell[data-sheet-position="full"] .time-rail { top: calc(var(--safe-top) + 31px); right: 10px; bottom: auto; left: 10px; z-index: 30; }
  .time-kicker { display: none; }
  .time-rail-controls { display: block; }
  .time-days { gap: 2px; }
  .time-day { min-height: 31px; padding: 3px 4px; font-size: 9px; text-align: center; }
  .time-day strong { display: block; margin: 0; font-size: 9px; }
  .time-scrubber { min-width: 0; gap: 7px; margin-top: 3px; }
  .time-label { font-size: 9px; }
  .terrain-caption { right: 10px; bottom: 10px; left: 10px; justify-content: space-between; padding: 5px 7px; font-size: 9px; }
  .scene-controls { right: 10px; bottom: calc(var(--sheet-height, 96px) + 80px); z-index: 32; }
  .scene-controls button { min-width: 36px; min-height: 36px; }
  .print-record { padding: 24px 16px 38px; }
  .console-footer { padding: 0 16px 28px; }
}

@media (max-width: 420px) {
  .console-header { width: calc(100% - 16px); }
  .phase-controls-wrap { gap: 4px; }
  .deadline-badge { min-width: 101px; }
  .deadline-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .layer-rail { width: 165px; }
  .console-shell[data-sheet-position="peek"] { --sheet-height: 96px; }
  .console-shell[data-sheet-position="half"] { --sheet-height: 51dvh; }
  .console-shell[data-sheet-position="full"] { --sheet-height: calc(100dvh - var(--safe-top)); }
  .context-surface[data-sheet-position="peek"] { --sheet-height: 96px; }
  .context-surface[data-sheet-position="half"] { --sheet-height: 51dvh; }
  .context-surface[data-sheet-position="full"] { --sheet-height: calc(100dvh - var(--safe-top)); }
  .time-rail { bottom: calc(var(--sheet-height, 96px) + 8px); }
  .context-surface[data-sheet-position="half"] ~ .time-rail { bottom: calc(51dvh + 8px); }
  .time-day { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .context-surface { transition: none; }
}

@media (prefers-contrast: more) {
  :root { --ink: #071918; --ink-soft: #183936; --muted: #3b5955; --line: #47716b; --line-strong: #183e39; }
  .fallback-label { stroke-width: 10px; }
}

@media print {
  @page { margin: 14mm; }
  html, body { min-width: 0; background: #fff; color: #000; }
  .skip-link, .console-shell, .console-footer { display: none !important; }
  .print-record { display: block !important; max-width: none; margin: 0; padding: 0; background: #fff; color: #000; }
  .print-kicker { color: #000; }
  .print-title { margin-top: 4px; font-size: 23px; }
  .print-lede, .print-source { color: #222; }
  .print-section h3 { border-color: #000; }
  .print-list li { color: #000; }
  .print-total { color: #000; }
}
