/* Version F: a timetable on paper. Ink and hairlines carry everything; one vermilion playhead is "now";
   one yellow fill is the call. Past 4.5 hours the color only shifts from green to blue: nothing turns red. */
@font-face { font-family: "BVP"; font-weight: 500; font-display: swap; src: url(fonts/bvp-latin-500.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "BVP"; font-weight: 800; font-display: swap; src: url(fonts/bvp-latin-800.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "BVP"; font-weight: 500; font-display: swap; src: url(fonts/bvp-vietnamese-500.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "BVP"; font-weight: 800; font-display: swap; src: url(fonts/bvp-vietnamese-800.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }

:root {
  --paper: #FAF7F0; --card: #FFFFFF; --ink: #14212F; --ink-2: #47535F; --line: #DAD4C6; --line-2: #EBE6D9;
  --a: #CFE8DD; --a-ink: #0F5A46; --b: #D6E4F2; --b-ink: #1D4C7C; --c: #ECE9E0;
  --now: #C2360A; --yellow: #FFD600; --dark: #0F172A;
  --inset: 24px; --dock: 76px;
  font-family: "BVP", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 18px; line-height: 1.45; color: var(--ink); background: var(--paper);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 64px; }
body { margin: 0; background: var(--paper); font-weight: 500; overflow-x: hidden; }
h1, h2, h3, p, ul, ol, blockquote, dl, fieldset, legend { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3, b, strong { font-weight: 800; }
a { color: inherit; }
input, select, button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--yellow); color: var(--ink); }
input, textarea { caret-color: var(--now); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 12px 16px; z-index: 40; border-radius: 8px; }
.skip:focus { left: 8px; }
.noscript { padding: 16px; font-weight: 800; background: var(--yellow); }

/* Top bar */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 14px; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; text-decoration: none; margin-right: auto; white-space: nowrap; }
@media (max-width: 380px) { .top { gap: 6px; padding: 0 10px; } }
.brand-tick { width: 4px; height: 20px; background: var(--now); border-radius: 2px; }
.top-link { font-size: 15px; font-weight: 800; padding: 12px 6px; min-height: 48px; display: inline-flex; align-items: center; white-space: nowrap; text-underline-offset: 3px; }
.top-115 { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 14px; background: var(--ink); color: #fff; border-radius: 12px; font-weight: 800; text-decoration: none; white-space: nowrap; font-size: 16px; }

/* Layout */
.em-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; max-width: 1560px; margin: 0 auto; padding: 12px 14px calc(var(--dock) + 28px); }
.em-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.em-map { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
@media (min-width: 1000px) {
  :root { --inset: 24px; }
  .em-grid { grid-template-columns: minmax(0, 640px) minmax(0, 1fr); gap: 20px; padding: 16px 24px 40px; }
  .em-map { position: sticky; top: 76px; align-self: start; height: calc(100vh - 92px); }
  .map { flex: 1 1 auto; height: auto !important; min-height: 320px; }
  .dock { display: none !important; }
  .call-focus { background: var(--yellow) !important; color: var(--ink) !important; border: 2px solid var(--ink) !important; }
}

/* Buttons */
.btn { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 56px; padding: 10px 16px; border-radius: 14px; border: 2px solid var(--ink); background: var(--card); font-weight: 800; text-decoration: none; }
.btn-call { background: var(--ink); color: #fff; font-size: 18px; min-height: 64px; width: 100%; }
.btn-go { background: var(--a-ink); border-color: var(--a-ink); color: #fff; flex: 1 1 auto; }
.btn-out { background: var(--card); flex: 1 1 auto; }
.btn-loc { width: 100%; background: var(--ink); color: #fff; }
.link { background: none; border: 0; padding: 8px 2px; min-height: 48px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; display: inline-block; }
.act { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px 14px; border: 1px solid var(--ink); background: var(--card); border-radius: 12px; font-weight: 800; font-size: 16px; text-decoration: none; }
.field { display: block; font-size: 15px; font-weight: 800; margin: 12px 0 4px; }
select, input[type=search], input[type=text], input[type=time], textarea { width: 100%; min-height: 52px; padding: 10px 12px; border: 1px solid var(--ink); background: var(--card); border-radius: 12px; font-size: 18px; }

/* Where */
.here { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; }
#hereAsk { flex: 1 1 100%; }
.here-status { font-size: 15px; color: var(--ink-2); flex: 1 1 200px; }
.here-status:empty { display: none; }
.place-row { display: flex; gap: 8px; }
.place-row input { flex: 1 1 auto; min-width: 0; font-size: 16px; }
.place-go { flex: none; min-height: 52px; min-width: 64px; padding: 0 14px; border: 2px solid var(--ink); border-radius: 12px; background: var(--card); font-weight: 800; }
.place-go:disabled { color: var(--ink-2); border-color: var(--line); }
.place-go:not(:disabled):hover { background: var(--line-2); }
.place-msg { font-size: 15px; color: var(--ink-2); margin-top: 6px; }
.place-msg:empty { display: none; }
.place-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.place-list:empty { display: none; }
.place-opt { display: flex; flex-direction: column; width: 100%; min-height: 56px; padding: 10px 12px; gap: 1px; text-align: left; border: 1px solid var(--ink); border-radius: 12px; background: var(--card); }
.place-opt:hover { background: var(--line-2); }
.place-opt span { font-size: 15px; color: var(--ink-2); }
.place-opt .place-warn { color: var(--now); font-weight: 800; }

/* Two ways in when the address is unknown: pick on the map, or ask the person next to the patient. */
.place-more { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.place-more .btn { flex: 1 1 200px; min-height: 52px; font-size: 16px; }
.here-acts { display: flex; flex-wrap: wrap; gap: 0 18px; }
.saved { margin-top: 4px; }
.saved-row { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.saved-btn { min-height: 52px; padding: 8px 16px 8px 34px; border: 2px solid var(--ink); border-radius: 12px; background: var(--card); font-weight: 800; font-size: 16px; text-align: left; position: relative; }
.saved-btn::before { content: ""; position: absolute; left: 13px; top: 50%; width: 12px; height: 12px; margin-top: -8px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--now); }
.saved-btn:hover { background: var(--line-2); }
.ask { background: var(--card); border: 2px solid var(--ink); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ask h2 { font-size: 22px; line-height: 1.2; }
.ask p { font-size: 16px; }
#here, #mapBox { scroll-margin-top: 72px; }
.sos-pin { display: inline-flex; align-items: center; justify-content: center; padding: 2px 7px; border-radius: 8px; border: 2px solid #fff; background: var(--now); color: #fff; font: 800 15px/1.1 "BVP", system-ui, sans-serif; letter-spacing: .04em; box-shadow: 0 1px 4px rgba(11, 14, 20, .45); pointer-events: none; }
.sos-key { padding: 0 5px; font-size: 12px; border-width: 1px; box-shadow: none; font-style: normal; }
.skip-note { background: var(--b); color: var(--b-ink); padding: 10px 12px; border-radius: 12px; font-size: 16px; }
#note:empty, #tools:empty { display: none; }
#lead:empty { display: none; }
#lead { display: flex; flex-direction: column; gap: 10px; }

/* Recommendation */
.rec, .jour { background: var(--card); border: 2px solid var(--ink); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.rec.swap, .jour.swap { animation: swap 220ms cubic-bezier(.22,1,.36,1); }
@keyframes swap { from { transform: translateY(8px); opacity: .4; } to { transform: none; opacity: 1; } }
.rec-tag { font-size: 14px; font-weight: 800; color: var(--a-ink); letter-spacing: .02em; }
.rec-why { font-size: 17px; }
.rec-name { font-size: 26px; line-height: 1.2; }
.cap { display: flex; flex-direction: column; gap: 1px; font-size: 15px; color: var(--ink-2); }
.cap b { color: var(--ink); font-size: 16px; }
.eta { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.eta-clock { font-size: 52px; font-weight: 800; line-height: 1; }
.eta-sub { display: flex; flex-direction: column; font-size: 15px; color: var(--ink-2); min-width: 0; }
.eta-sub b { color: var(--ink); font-size: 16px; }
.rec-addr { font-size: 15px; color: var(--ink-2); }
.rec-call { display: flex; flex-direction: column; gap: 6px; }
.ph-note { font-size: 15px; color: var(--ink-2); }
.rec-row { display: flex; gap: 8px; flex-wrap: wrap; }
.rec-row > * { flex: 1 1 130px; }
.rec-more summary, .row-more summary { cursor: pointer; font-weight: 800; font-size: 16px; min-height: 48px; display: flex; align-items: center; }
.alt { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.alt-tag { font-size: 14px; font-weight: 800; color: var(--ink-2); }
.alt-name { font-size: 20px; line-height: 1.25; }
.cap-sm { font-size: 14px; }
.alt-eta { font-size: 16px; color: var(--ink-2); }
.alt-eta b { color: var(--ink); }
.detail { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 8px; }
.d-line, .d-gloss { font-size: 16px; }
.d-gloss { color: var(--ink-2); font-size: 15px; }
.d-nums { display: flex; flex-direction: column; gap: 2px; font-size: 18px; }
.d-nums a { display: inline-block; padding: 10px 0; font-weight: 800; }
.d-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Journey */
.jour { border-color: var(--a-ink); }
.jour-time { display: flex; align-items: center; gap: 14px; }
.jour-words { min-width: 0; }
.jw-l { font-size: 15px; font-weight: 800; }
.jw-s { font-size: 18px; font-weight: 800; }
.jw-m { font-size: 15px; color: var(--ink-2); }
.jw-go { color: var(--b-ink); font-weight: 800; }
.dial { flex: none; }
.d-face { fill: var(--paper); stroke: var(--ink); stroke-width: 2; }
.d-tick { stroke: var(--ink); stroke-width: 1.4; }
.d-n { font: 800 13px "BVP", system-ui, sans-serif; fill: var(--ink-2); }
.d-a { fill: none; stroke: #5FB89A; stroke-width: 11; stroke-linecap: butt; }
.d-b { fill: none; stroke: #7FA6CF; stroke-width: 11; stroke-linecap: butt; }
.d-onset { fill: var(--ink); }
.d-arrive { fill: var(--ink); stroke: #fff; stroke-width: 2; }
.d-hand { stroke: var(--now); stroke-width: 3.5; stroke-linecap: round; }
.d-pin { fill: var(--now); }
.dial-key { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--ink-2); }
.dial-key li { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; flex: none; }
.sw-a { background: #5FB89A; }
.sw-b { background: #7FA6CF; }
.sw-dot { background: var(--ink); border-radius: 50%; }
.sw-hand { background: var(--now); height: 4px; }
.jour-hint { background: var(--b); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; font-size: 16px; }
.jour-step { font-size: 18px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.script { font-size: 20px; line-height: 1.4; padding: 12px 14px; background: var(--paper); border: 1px solid var(--ink); border-radius: 12px; }

/* Tools */
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool { min-height: 52px; padding: 8px 10px; border: 1px solid var(--ink); border-radius: 12px; background: var(--card); font-weight: 800; font-size: 16px; }
.tool[aria-expanded=true] { background: var(--ink); color: #fff; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.panel h3 { font-size: 18px; }
.panel-pre { white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 15px; margin: 0; background: var(--paper); padding: 10px; border-radius: 10px; }

/* Rail */
.rail { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 0 14px; display: flex; flex-direction: column; gap: 10px; }
.rail > *:not(.plot) { margin-inline: 14px; }
.rail-head h2 { font-size: 18px; }
.since { display: flex; flex-direction: column; font-size: 15px; color: var(--ink-2); }
.since b { font-size: 34px; line-height: 1.1; color: var(--ink); }
.plot { position: relative; --nx: 0%; padding-top: 26px; }
.now-flag { position: absolute; top: 0; left: calc(var(--inset) + (100% - 2 * var(--inset)) * var(--nowf, 0)); z-index: 3; font-size: 13px; font-weight: 800; color: var(--now); white-space: nowrap; transform: translateX(var(--fx, 0)); }
.bands { position: absolute; left: var(--inset); right: var(--inset); top: 26px; bottom: 0; pointer-events: none; }
.band { position: absolute; top: 0; bottom: 0; }
.band-a { left: 0; width: 62%; background: var(--a); }
.band-b { left: 62%; width: 16%; background: var(--b); }
.band-c { left: 78%; width: 22%; background: repeating-linear-gradient(135deg, var(--b) 0 3px, var(--c) 3px 7px); }
.mark { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); }
.mark-45 { left: 62%; }
.mark-6 { left: 78%; opacity: .5; }
.playhead { position: absolute; top: 0; bottom: 0; left: var(--nx); width: 3px; margin-left: -1.5px; background: var(--now); }
.plot[data-mode=unknown] .band, .plot[data-mode=unknown] .mark, .plot[data-mode=unknown] .now-flag, .plot[data-mode=unknown] .slider { display: none; }
.plot[data-mode=unknown] .bands { background: var(--line-2); }
.plot[data-mode=unknown] { padding-top: 26px; }
.plot[data-range=true] .slider { visibility: hidden; }
.gap { position: absolute; left: var(--inset); top: 26px; height: 48px; width: calc((100% - 2 * var(--inset)) * var(--gapf, 0)); z-index: 2; pointer-events: none; }
.gap::before { content: ""; position: absolute; left: 0; right: 0; top: 30px; height: 2px; background: var(--ink); }
.gap::after { content: ""; position: absolute; left: 0; right: 0; top: 23px; height: 16px; border-inline: 2px solid var(--ink); }
.gap span { position: absolute; left: 6px; top: 2px; padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,.88); font-size: 13.5px; font-weight: 800; white-space: nowrap; }
.slider { position: relative; z-index: 4; -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 48px; margin: 0; background: transparent; touch-action: pan-y; }
.slider::-webkit-slider-runnable-track { height: 48px; background: transparent; }
.slider::-moz-range-track { height: 48px; background: transparent; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 48px; height: 48px; border-radius: 50%; border: 3px solid #fff; background: var(--now) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 7l-5 5 5 5M15 7l5 5-5 5'/%3E%3C/svg%3E") center/24px no-repeat; box-shadow: 0 1px 4px rgba(15,23,42,.45); cursor: grab; }
.slider::-moz-range-thumb { width: 42px; height: 42px; border-radius: 50%; border: 3px solid #fff; background: var(--now) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 7l-5 5 5 5M15 7l5 5-5 5'/%3E%3C/svg%3E") center/24px no-repeat; }
.slider:focus-visible { outline: none; }
.slider:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--ink); outline-offset: 1px; }
.slider:focus-visible::-moz-range-thumb { outline: 3px solid var(--ink); outline-offset: 1px; }

.ticks { position: relative; height: 40px; margin: 2px var(--inset) 0; font-size: 12.5px; z-index: 3; }
.ticks span { position: absolute; top: 2px; transform: translateX(-50%); white-space: nowrap; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.ticks b { font-size: 13px; }
.ticks .tk-l { transform: none; align-items: flex-start; }
.ticks .tk-r { transform: translateX(-100%); align-items: flex-end; }

.lanes { position: relative; z-index: 3; display: flex; flex-direction: column; gap: 10px; padding: 8px var(--inset) 10px; }
.lane { display: flex; flex-direction: column; gap: 4px; }
.lane-head { display: flex; align-items: center; gap: 6px; }
.lane-head > .lane-name, .lane-head > .lane-eta { background: rgba(255,255,255,.86); border-radius: 8px; padding: 2px 5px; }
.lane-head > .lane-name { align-self: flex-start; margin-right: auto; flex: 0 1 auto; }
.lane-name { display: flex; flex-direction: column; min-width: 0; }
.lane-title { font-weight: 800; font-size: 15.5px; line-height: 1.2; overflow-wrap: anywhere; }
.lane-sub { font-size: 13px; color: var(--ink-2); line-height: 1.2; }
.lane-eta { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.lane-eta b { font-size: 22px; line-height: 1; }
.lane-min { font-size: 12.5px; color: var(--ink-2); }
.lane-call { flex: none; min-width: 48px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--card); border: 1px solid var(--ink); font-weight: 800; font-size: 15px; text-decoration: none; }
.lane-track { position: relative; height: 16px; }
.lane-bar { position: absolute; top: 5px; height: 6px; background: var(--ink); opacity: .55; border-radius: 3px; }
.is-target .lane-bar { opacity: 1; height: 8px; top: 4px; }
.lane-dot { position: absolute; top: 0; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--card); border: 3px solid var(--ink); z-index: 2; }
.is-full .lane-dot { background: var(--ink); }
.is-target .lane-dot { box-shadow: 0 0 0 3px var(--yellow); }

.narr { font-size: 16px; }
.narr:empty { display: none; }
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.chips-2 { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.chip { min-height: 48px; padding: 6px 4px; border: 1px solid var(--ink); background: var(--card); border-radius: 12px; font-weight: 800; font-size: 15px; white-space: nowrap; }
.chip[aria-pressed=true] { background: var(--ink); color: #fff; }
.chip-soft { border-color: var(--line); background: var(--paper); }
.chip-solid { background: var(--ink); color: #fff; }
.chip-wide { grid-column: 1 / -1; }
.chips-3 { grid-template-columns: repeat(3, 1fr); }
.fix { display: flex; flex-direction: column; gap: 8px; background: var(--paper); padding: 12px; border-radius: 12px; }
.fix-row { display: flex; gap: 8px; }
.fix-row > * { flex: 1 1 0; }
.fix-tip { font-size: 15px; color: var(--ink-2); }
.msg { font-size: 15px; color: var(--ink-2); }
.msg:empty { display: none; }
.range-h { font-size: 18px; line-height: 1.25; }
.range .field { margin-top: 0; }
.range-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
.range-fields input { padding-inline: 10px; }
.range-sub { margin-top: 8px !important; }
.range-go { min-height: 56px; font-size: 18px; }
.range-err { color: var(--now); font-weight: 800; }
.photo-pick { width: 100%; cursor: pointer; }
.photo-pick:focus-within { outline: 3px solid var(--ink); outline-offset: 2px; }
.photo-out { display: flex; align-items: center; gap: 12px; }
.photo-out:not(:has(img)):has(.msg:empty) { display: none; }
.photo-out img { width: 72px; height: 72px; flex: none; object-fit: cover; border-radius: 10px; }
.delay-l { font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.key { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--ink-2); }
.key li { display: flex; align-items: flex-start; gap: 6px; }
.key .sw { margin-top: 3px; }
.key-note { padding-top: 2px; }

/* Wait */
.aid-link { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; row-gap: 2px; min-height: 52px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); text-decoration: none; }
.aid-link:hover { background: var(--line-2); }
.aid-t { font-weight: 800; font-size: 17px; }
.aid-link::after { content: ""; grid-column: 2; grid-row: 1 / 3; width: 18px; height: 18px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314212F' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 9l7 7 7-7'/%3E%3C/svg%3E") center/contain no-repeat; }
.aid-n { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--ink-2); font-weight: 700; }
.aid-n i { width: 7px; height: 7px; border-radius: 50%; background: var(--a-ink); }
.aid-n i.aid-no { border-radius: 1px; background: var(--now); margin-left: 6px; }
#wait { scroll-margin-top: 72px; }
.wait { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px; }
.wait summary { min-height: 52px; display: flex; align-items: center; font-weight: 800; cursor: pointer; }
.wait-body { padding: 4px 0 12px; display: flex; flex-direction: column; gap: 8px; font-size: 16px; }
.wait-body li { padding-left: 14px; position: relative; margin-bottom: 4px; }
.wait-body li::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; background: var(--ink); border-radius: 50%; }
.dont li::before { background: var(--now); border-radius: 1px; }
.src { font-size: 14px; color: var(--ink-2); }

.wait summary, .say-q summary, .say-more summary { list-style: none; gap: 10px; justify-content: space-between; }
.wait summary::-webkit-details-marker, .say-q summary::-webkit-details-marker, .say-more summary::-webkit-details-marker { display: none; }
.wait summary::after, .say-q summary::after, .say-more summary::after { content: ""; flex: none; width: 18px; height: 18px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314212F' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 9l7 7 7-7'/%3E%3C/svg%3E") center/contain no-repeat; transition: transform 180ms cubic-bezier(.22,1,.36,1); }
details[open] > summary::after { transform: rotate(180deg); }

/* Replies to the sentences that delay leaving */
.say-body { padding: 0 0 8px; }
.say-clock { font-size: 16px; font-weight: 800; color: var(--now); padding: 2px 0 10px; }
.say-q { border-top: 1px solid var(--line-2); }
.say-q summary { min-height: 56px; display: flex; align-items: center; padding: 8px 0; font-size: 18px; font-weight: 800; line-height: 1.25; cursor: pointer; }
.say-a { display: flex; flex-direction: column; gap: 8px; padding: 2px 0 16px; }
.say-q[open] .say-a { animation: swap 220ms cubic-bezier(.22,1,.36,1); }
.say-no { font-size: 28px; line-height: 1.15; font-weight: 800; }
.say-b { font-size: 17px; max-width: 62ch; }
.say-more { border-top: 1px solid var(--line-2); }
.say-more > summary { min-height: 52px; display: flex; align-items: center; font-size: 16px; font-weight: 800; color: var(--ink-2); cursor: pointer; }

/* Explorer */
.explorer { display: flex; flex-direction: column; gap: 10px; }
.explorer > h2 { font-size: 20px; }
.warn { font-size: 15px; padding: 12px 14px; border: 1px solid var(--ink); background: var(--card); border-radius: 12px; }
.f-both { display: flex; align-items: center; gap: 10px; min-height: 48px; font-weight: 800; }
.f-both input { width: 24px; height: 24px; accent-color: var(--ink); }
.f-grid { display: grid; gap: 4px; }
@media (min-width: 720px) { .f-grid { grid-template-columns: 1fr 1fr; gap: 12px; } }
.count { font-size: 15px; color: var(--ink-2); }
.list { display: flex; flex-direction: column; }
.row { padding: 10px 2px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.row-head { display: grid; grid-template-columns: 74px minmax(0, 1fr) 52px; gap: 8px; align-items: center; }
.row-eta { display: flex; flex-direction: column; }
.row-eta b { font-size: 24px; line-height: 1.05; }
.row-eta span { font-size: 12.5px; color: var(--ink-2); line-height: 1.1; }
.row-name { font-weight: 800; font-size: 16.5px; line-height: 1.25; }
.row-cap { font-size: 14px; color: var(--ink-2); }
.row-cap.is-full { color: var(--a-ink); font-weight: 800; }
.row-call { min-height: 48px; min-width: 48px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--ink); border-radius: 12px; font-weight: 800; text-decoration: none; font-size: 15px; }
.mini { position: relative; height: 10px; margin-left: 82px; background: linear-gradient(90deg, var(--a) 62%, var(--b) 62% 78%, var(--c) 78%); border-radius: 3px; }
.mini-mark { position: absolute; left: 62%; top: -2px; bottom: -2px; width: 2px; background: var(--ink); }
.mini-dot { position: absolute; top: 0; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--card); border: 2px solid var(--ink); }
.mini-dot.is-full { background: var(--ink); }
.row-more summary { font-size: 15px; color: var(--ink-2); }
.empty { padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; gap: 10px; }
.btn-more { width: 100%; margin-top: 8px; }

/* Map */
.map-wrap { position: relative; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.pick-cross { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); pointer-events: none; display: flex; flex-direction: column; align-items: center; z-index: 2; }
.pick-cross::after { content: ""; width: 3px; height: 14px; background: var(--ink); border-radius: 0 0 2px 2px; }
.pick-cross[hidden] { display: none; }
.pick-bar { background: var(--card); border: 2px solid var(--ink); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.pick-bar p { font-size: 16px; font-weight: 700; }
.pick-row { display: flex; gap: 8px; }
.pick-row .btn { flex: 1 1 auto; width: auto; }
body[data-pick] .map { height: 52vh; }
body[data-pick] .map-pick, body[data-pick] .legend { display: none; }
.map { height: 300px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--line-2); }
.map-msg { font-size: 15px; background: var(--card); padding: 12px 14px; border-radius: 12px; border: 1px solid var(--ink); }
.map-time { background: var(--card); border: 1px solid var(--ink); border-radius: 8px; padding: 2px 6px; font-weight: 800; font-size: 14px; pointer-events: none; }
.map-time.is-main { background: var(--ink); color: #fff; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.pin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #0B0E14; }
.pin-full { background: #1E7FE0; border-color: #1E7FE0; }
.pin-empty { background: #fff; border-color: #1E7FE0; }
.pin-sel { background: #FFD600; }
.pin-me { background: #2563EB; border-color: #fff; box-shadow: 0 0 0 1px #2563EB; }
.pin-time { font-style: normal; font-weight: 800; background: var(--ink); color: #fff; border-radius: 6px; padding: 0 5px; font-size: 13px; }
.map-pick { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; max-height: 40vh; overflow: auto; }
.pick { display: flex; flex-direction: column; gap: 8px; }
.pick h3 { font-size: 19px; }

/* Dock */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); min-height: var(--dock); }
.dock-115 { flex: 1 1 100%; display: inline-flex; align-items: center; justify-content: center; min-height: 60px; background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); border-radius: 14px; font-weight: 800; font-size: 20px; text-decoration: none; }
.dock.has-h .dock-115 { flex: 0 0 96px; background: var(--ink); color: #fff; font-size: 18px; }
.dock-h { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; min-height: 60px; padding: 4px 12px; background: var(--yellow); border: 2px solid var(--ink); border-radius: 14px; text-decoration: none; }
.dock-l { font-size: 14px; font-weight: 800; line-height: 1.2; }
.dock-n { font-size: 17px; font-weight: 800; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.toast { position: fixed; left: 50%; transform: translate(-50%, 16px); bottom: calc(var(--dock) + 16px); background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 16px; opacity: 0; transition: opacity 180ms, transform 180ms; pointer-events: none; max-width: min(92vw, 520px); text-align: center; z-index: 45; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Handoff */
.handoff { width: 100%; max-width: 760px; height: 100%; max-height: 100%; margin: 0 auto; border: 0; padding: 0; background: var(--card); }
.handoff::backdrop { background: rgba(15, 23, 42, .7); }
.ho { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.ho-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ho-top h2 { font-size: 22px; }
.ho-x { min-height: 48px; padding: 0 16px; border: 2px solid var(--ink); border-radius: 12px; background: var(--card); font-weight: 800; }
.ho-label { font-size: 16px; font-weight: 800; color: var(--ink-2); }
.ho-onset { font-size: 96px; line-height: 1; font-weight: 800; }
.ho-ago { font-size: 22px; font-weight: 800; }
.ho-where { font-size: 18px; }
.ho-fields { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.ho-f span, .ho-sym legend { display: block; font-weight: 800; font-size: 18px; margin-bottom: 4px; }
.ho-f textarea, .ho-f input { font-size: 20px; }
.ho-sym { border: 0; }
.ho-sym label { display: flex; align-items: center; gap: 10px; min-height: 48px; font-size: 18px; }
.ho-sym input { width: 24px; height: 24px; accent-color: var(--ink); }
.ho-fine { font-size: 15px; color: var(--ink-2); }
.ho-wake { font-size: 15px; color: var(--ink-2); }
.ho-wake:empty { display: none; }

/* Learn */
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.wrap-narrow { max-width: 620px; }
.learn section { padding-block: 40px; }
.intro { padding-top: 28px !important; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pills li { font-size: 13px; font-weight: 800; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--ink); }
.pills .pill-main { background: var(--ink); color: #fff; }
.pills-paper li { background: var(--card); }
.pills-paper .pill-main { background: var(--a-ink); border-color: var(--a-ink); }
.hook { font-size: clamp(30px, 6.4vw, 54px); line-height: 1.16; letter-spacing: -.01em; }
.hook em { font-style: normal; color: var(--now); }
.formula { margin: 18px 0; padding: 12px 14px; border: 1px solid var(--now); background: var(--card); font-weight: 800; border-radius: 12px; font-size: 19px; }
.formula-paper { border-color: var(--a-ink); }
.bento { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-top: 20px; }
.bento a { background: var(--card); padding: 14px; text-decoration: none; display: flex; flex-direction: column; gap: 2px; min-height: 130px; }
.b-tag { font-size: 13px; font-weight: 800; color: var(--ink-2); }
.b-num { font-size: 30px; font-weight: 800; line-height: 1.1; }
.b-sub { font-size: 14px; color: var(--ink-2); flex: 1; }
.b-go { font-size: 14px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 720px) { .bento { grid-template-columns: repeat(4, 1fr); } }

.story { padding-block: 0 !important; }
.story-grid { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 1120px; margin: 0 auto; padding: 0 16px; gap: 0 48px; }
.stage { position: sticky; top: 60px; z-index: 5; background: var(--paper); padding: 12px 0; height: 196px; }
.layer { position: absolute; inset: 12px 0; transition: opacity 240ms; }
.layer-dots { opacity: 0; }
.stage[data-beat="3"] .layer-rail { opacity: 0; }
.stage[data-beat="3"] .layer-dots { opacity: 1; }
.st-now { font-size: 50px; font-weight: 800; line-height: 1; }
.st-sub { font-size: 16px; color: var(--ink-2); min-height: 1.45em; }
.st-rail, .sb-rail { position: relative; height: 34px; margin-top: 18px; }
.st-a, .st-b { position: absolute; top: 8px; height: 20px; }
.st-a { left: 0; width: 62%; background: var(--a); }
.st-b { left: 62%; width: 16%; background: var(--b); }
.st-mark { position: absolute; top: 0; height: 34px; width: 2px; background: var(--ink); }
.st-mark span { position: absolute; top: -18px; left: -22px; font-size: 13px; font-style: normal; font-weight: 800; }
.st-head { position: absolute; top: 0; height: 34px; width: 4px; margin-left: -2px; background: var(--now); transition: left 400ms cubic-bezier(.22,1,.36,1); }
.st-scale { position: relative; height: 18px; font-size: 13px; color: var(--ink-2); }
.st-scale span { position: absolute; }
.dots { display: grid; grid-template-columns: repeat(41, 1fr); gap: 2px; margin-top: 6px; }
.dots i { aspect-ratio: 1; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--ink); }
.st-key { font-size: 14px; margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.st-key i { width: 12px; height: 12px; background: var(--ink); border-radius: 50%; }
.beats { position: relative; z-index: 1; }
.beat { min-height: 62vh; padding-top: 28px; display: flex; flex-direction: column; gap: 10px; }
.beat-kicker { font-size: 14px; font-weight: 800; color: var(--a-ink); }
.beat h2 { font-size: 26px; line-height: 1.22; }
@media (min-width: 900px) {
  .story-grid { grid-template-columns: 38fr 62fr; align-items: start; }
  .stage { order: 2; top: 120px; height: 300px; }
  .st-now { font-size: 96px; }
  .beat { min-height: 75vh; justify-content: center; padding-top: 0; }
  .beat h2 { font-size: 30px; }
}

.fermata { background: var(--dark); color: #E2E8F0; padding-block: 80px !important; }
.fermata-inner { max-width: 720px; margin: 0 auto; padding: 0 16px; display: flex; flex-direction: column; gap: 12px; }
.f-num { font-size: clamp(64px, 20vw, 150px); font-weight: 800; line-height: 1; color: var(--yellow); }
.f-unit { font-size: 22px; font-weight: 800; }
.f-quote { font-size: 20px; }
.f-note { font-size: 16px; color: #A9B4C2; }
.fermata .src { color: #A9B4C2; }

.sandbox { background: var(--card); }
.sec-h { font-size: clamp(26px, 4.6vw, 36px); line-height: 1.2; }
.sb-out { display: flex; align-items: baseline; gap: 10px; margin-top: 12px; }
.sb-out .num { font-size: 56px; font-weight: 800; line-height: 1; }
.sb-rail { margin-top: 22px; margin-bottom: 4px; }
.sb-wait { position: absolute; left: 0; top: 13px; height: 10px; background: var(--now); }
.sb-drive { position: absolute; top: 13px; height: 10px; background: var(--ink); }
.sb-slider { width: 100%; height: 48px; accent-color: var(--ink); }
.sb-eq { font-weight: 800; }
.sb-note { color: var(--ink-2); }

.band2.tint { background: #F2EEE3; }
.band2 { display: block; }
.sec-h + * { margin-top: 12px; }
.tx-grid { display: grid; gap: 12px; margin-top: 14px; }
@media (min-width: 720px) { .tx-grid { grid-template-columns: 1fr 1fr; } }
.tx { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.tx h3 { font-size: 20px; line-height: 1.25; }
.wbar { position: relative; height: 12px; background: var(--line-2); border-radius: 6px; overflow: hidden; margin-top: 6px; }
.wbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--a-ink); }
.wbar-b i { background: var(--b-ink); }
.wbar u { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, var(--b-ink) 0 3px, transparent 3px 7px); }
.wbar-l { font-size: 14px; font-weight: 800; }
.tx-foot { margin-top: 12px; color: var(--ink-2); font-size: 16px; }
.farther { margin-top: 16px; padding: 14px; background: var(--card); border-radius: 16px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.befast { display: grid; gap: 8px; margin-top: 14px; }
@media (min-width: 720px) { .befast { grid-template-columns: 1fr 1fr; } }
.befast li { display: flex; gap: 12px; background: var(--card); padding: 12px; border-radius: 14px; border: 1px solid var(--line); }
.befast b { font-size: 34px; line-height: 1; width: 34px; flex: none; }
.befast strong { display: block; }
.befast .t { background: var(--ink); color: #fff; border-color: var(--ink); }
.dd { display: grid; gap: 12px; margin-top: 14px; }
@media (min-width: 720px) { .dd { grid-template-columns: 1fr 1fr; } }
.dd > div { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.dd h3 { margin-bottom: 8px; font-size: 20px; }
.dd li { padding-left: 16px; position: relative; margin-bottom: 8px; font-size: 16px; }
.dd li::before { content: ""; position: absolute; left: 0; top: .6em; width: 7px; height: 7px; border-radius: 50%; background: var(--a-ink); }
.dd-no li::before { background: var(--now); border-radius: 1px; }
.risk { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.rb { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) 56px; align-items: center; gap: 8px; font-size: 15px; }
.rb-t { height: 14px; background: var(--line-2); border-radius: 7px; overflow: hidden; }
.rb-t i { display: block; height: 100%; background: #64748B; }
.rb-focus .rb-t i { background: var(--ink); }
.rb-focus { font-weight: 800; }
.src-paper { margin-top: 8px; }
.pv-g { margin-top: 20px; }
.pv-g h3 { font-size: 20px; margin-bottom: 8px; }
.pv-grid { list-style: none; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.pv-grid li { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
@media (min-width: 560px) { .pv-four { grid-template-columns: 1fr 1fr; } }
.nb { white-space: nowrap; }
.pv-t { font-size: 15px; font-weight: 800; color: var(--ink-2); }
.pv-n { font-size: 23px; font-weight: 800; line-height: 1.2; }
.pv-d { font-size: 16px; color: var(--ink-2); }
.clip { margin-top: 10px; color: var(--ink-2); }
.save-tool { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.status-paper { font-size: 15px; color: var(--ink-2); }
.status-paper:empty { display: none; }
.save-out { display: flex; flex-direction: column; gap: 10px; }
.parent-link { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.parent-link h3 { font-size: 18px; }
.saved-mgr { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.saved-mgr h3 { font-size: 18px; }
.saved-list { list-style: none; }
.saved-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line-2); font-weight: 700; }
.saved-list li span { overflow-wrap: anywhere; }
.end { background: var(--a-ink); color: #fff; text-align: left; }
.end .wrap { display: flex; flex-direction: column; gap: 12px; }
.end-h { font-size: clamp(30px, 6vw, 44px); line-height: 1.15; }
.end-list { display: flex; flex-direction: column; gap: 6px; }
.end-list b { color: #fff; }
.end-we { font-size: 18px; }
.btn-share { background: var(--yellow); color: var(--ink); border-color: var(--ink); min-height: 60px; }
.share-msg { font-size: 16px; min-height: 1.45em; }

.foot { padding: 24px 0 calc(var(--dock) + 24px); border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
body[data-view=learn] .foot { padding-bottom: 24px; }
@media (min-width: 1000px) { .foot { padding-bottom: 24px; } }
.foot-ind { margin-bottom: 8px; color: var(--ink); }
.foot-credit { display: flex; flex-direction: column; gap: 6px; }

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