/* ============================================================
   The Panorama: board styles (final, seven routes).
   A printed alpine panorama in a short ink set. The sheet is the
   world; the legend, composer, reader and film player are the map's
   furniture. Tokens and rules are recorded in DESIGN.md.
   ============================================================ */

:root {
  --paper: #f4f6f8;
  --ink: #14213d;
  --ink-2: #3a4763;          /* secondary text on paper, 8.6:1 */
  --rule: #c5cddb;
  --sky: #1e4eac;
  --sky-deep: #153585;
  --peri: #96a9e1;
  --spruce: #1f5a45;
  --sun: #f2a900;
  --alert: #a3200c;          /* error text on paper, 7.4:1 */
  --wash: #e3e8f0;           /* hover on paper */
  --mute: #5a6680;           /* placeholder and disabled text on paper, 5.4:1 */
  --table: #0e1830;          /* what the sheet lies on */
  --font: "Jost", "Futura", "Century Gothic", "Avenir Next", system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --dock: 0px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }
html { background: var(--table); }
body {
  margin: 0; overflow: clip;
  font-family: var(--font); font-size: 1rem; line-height: 1.45;
  color: var(--ink); background: var(--table);
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--ink) transparent;
}
::selection { background: var(--sun); color: var(--ink); }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, ol, ul, fieldset { margin: 0; padding: 0; border: 0; }
ol, ul { list-style: none; }
svg { display: block; }

/* One focus treatment everywhere: ink ring with a paper gap, visible on sky, snow and forest alike. */
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 3px var(--paper); }
:focus:not(:focus-visible) { outline: none; }

.skip {
  position: fixed; left: 12px; top: -80px; z-index: 60;
  background: var(--paper); color: var(--ink); padding: 10px 14px; font-weight: 600; text-underline-offset: 3px;
}
.skip:focus { top: 12px; }

/* icons: one stroke everywhere */
button svg, label svg, a svg, .roundel svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- the map ---------- */
.map { position: fixed; inset: 0; overflow: clip; cursor: grab; background: var(--table); }
.map[data-panning] { cursor: grabbing; }
.map:focus-visible { outline-offset: -6px; box-shadow: inset 0 0 0 9px var(--paper); }
.world { position: absolute; left: 0; top: 0; user-select: none; -webkit-user-select: none; }
.art { position: absolute; left: 0; top: 0; overflow: visible; }

/* printed title block, part of the sheet */
.titleblock { position: absolute; left: 270px; top: 215px; color: var(--paper); width: 2300px; }
.tb-title {
  font-weight: 800; font-size: 318px; line-height: .9; letter-spacing: -.012em; text-transform: uppercase;
}
/* the sub-line holds a readable size on screen however far out the camera is */
.tb-sub { margin-top: 68px; font-weight: 500; font-size: max(68px, calc(13px / var(--k, .2))); line-height: 1.25; max-width: 21em; text-wrap: balance; }

/* ---------- routes on the sheet ---------- */
.pa-route-core, .pa-route-key, .pa-route-halo { transition: stroke-opacity .25s linear; }
.pa-roundel-in { transform: scale(min(2.2, max(1, calc(.36 / var(--k, 1))))); }
:root[data-isolate] .pa-route[data-ghost] .pa-route-core { stroke: var(--paper); stroke-dasharray: 16 15; }
:root[data-isolate] .pa-route[data-ghost] .pa-route-key { stroke-opacity: .5; }
:root[data-isolate] .pa-route[data-ghost] .pa-roundel circle:last-of-type { fill: var(--paper); }
:root[data-isolate] .pa-route[data-ghost] .pa-roundel text { fill: var(--ink); }

/* trailhead signs: route number, team name, count. They stop shrinking below half scale. */
.trail-head {
  position: absolute; z-index: 3;
  --grow: min(3.3, max(1, calc(.5 / var(--k, 1))));
  --anchor: 50%;           /* where along the sign its trailhead is: signs on the flanks grow inward, never off the sheet */
  transform: translate(calc(-1 * var(--anchor)), -50%) scale(var(--grow)); transform-origin: var(--anchor) 50%;
  display: flex; align-items: center; gap: 12px; white-space: nowrap;
  background: var(--paper); border: 3px solid var(--ink); padding: 6px 14px 6px 7px;
}
.trail-title { font-size: 26px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1; }
.trail-count { font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.trail-count::before { content: "· "; }
.trail-add { display: none; }
.roundel {
  display: inline-grid; place-items: center; flex: none;
  width: 1.75em; height: 1.75em; border-radius: 50%;
  background: var(--route, var(--ink)); color: var(--on, #fff);
  border: 2px solid var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1;
}
.trail-head[data-side="left"] { --anchor: 16%; }
.trail-head[data-side="right"] { --anchor: 84%; }
.trail-head .roundel { font-size: 24px; }
.roundel--geco { border-radius: 2px; background: var(--ink); color: var(--paper); }
.roundel--geco svg { width: 1.05em; height: 1.05em; stroke-width: 2.2; }
:root[data-isolate] .trail[data-ghost] .trail-head { background: transparent; border-style: dashed; box-shadow: none; }
:root[data-isolate] .trail[data-ghost] .trail-head > * { opacity: .55; }

/* ---------- slips: the notes ---------- */
.note {
  position: absolute; width: 190px; z-index: 2;
  padding: 14px 12px 7px; font-size: 14px; line-height: 1.38;
  background: var(--slip, #fff); color: var(--ink); border-radius: 2px;
  transform: translate(-50%, -50%) rotate(calc(var(--tilt, 0) * 1.7deg));
  box-shadow: 0 1px 0 rgba(20, 33, 61, .16), 0 9px 16px -6px rgba(0, 0, 0, .5);
}
.note::before {            /* the pin, in the route's ink */
  content: ""; position: absolute; left: 50%; top: -10px; width: 20px; height: 20px; margin-left: -10px;
  border-radius: 50%; background: var(--route, var(--ink)); border: 3px solid var(--ink);
  box-shadow: 0 0 0 3px var(--paper), 0 4px 5px rgba(0, 0, 0, .35);
}
.note-prompt {
  margin: 0 0 3px; font-size: 13px; font-weight: 600; line-height: 1.25; color: var(--deep, var(--ink-2));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.note-prompt em { font-style: normal; font-weight: 800; }
.note-body {
  margin: 0; overflow: hidden; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--lines, 4); text-wrap: pretty;
}
.note:has(.note-prompt) .note-body { -webkit-line-clamp: var(--lines-p, 3); }
.note-author { margin: 2px 0 0; text-align: right; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px 2px; }
.note-photo {              /* a print clipped to the corner of the slip */
  position: absolute; right: -14px; top: -20px; width: 52px; height: 52px; object-fit: cover;
  border: 3px solid #fff; transform: rotate(6deg); box-shadow: 0 5px 9px -2px rgba(0, 0, 0, .5);
}
.note-open { border-radius: 2px; z-index: 1; }
.note-open:focus-visible { outline-offset: 4px; }
.note:hover { z-index: 4; }
.note:hover, .note:focus-within { box-shadow: 0 1px 0 rgba(20, 33, 61, .16), 0 0 0 3px var(--ink), 0 14px 22px -8px rgba(0, 0, 0, .6); }
.note--reading { z-index: 5; box-shadow: 0 0 0 4px var(--ink), 0 0 0 9px var(--paper), 0 18px 28px -8px rgba(0, 0, 0, .6); }
.note-tab {                /* "Yours" and "New" */
  position: absolute; left: 8px; top: -11px; z-index: 2;
  background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 2px 6px 1px; line-height: 1.4;
}

/* arrival: one press of ink that settles into register */
.note--enter { animation: press .44s var(--ease) both; }
@keyframes press {
  0% { opacity: 0; translate: 3px -2px; filter: saturate(2.2) contrast(1.2); }
  55% { opacity: 1; translate: 2px -1px; }
  100% { opacity: 1; translate: 0 0; filter: none; }
}

/* level of detail by scale */
/* far: the text would be three pixels tall. Cover it with the route's ink rather than hide it,
   so every note stays readable to assistive technology at any zoom. Taller chips are longer notes. */
.map[data-lod="far"] .note { min-height: 80px; background: var(--chip, var(--slip)); }
.map[data-lod="far"] .note::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--chip, var(--slip)); }
.map[data-lod="far"] .note-tab { z-index: 3; font-size: 26px; top: -30px; left: 0; padding: 2px 9px; }
.map[data-lod="far"] .note::before { z-index: 2; width: 26px; height: 26px; margin-left: -13px; top: -13px; }
/* mid: text holds a constant on-screen size (12px) while the slip scales, so it stays legible */
.map[data-lod="mid"] .note { font-size: calc(12px / var(--k, .5)); line-height: 1.18; padding: 16px 11px 6px; }
.map[data-lod="mid"] .note-prompt, .map[data-lod="mid"] .note-photo {      /* out of sight, still announced */
  position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.map[data-lod="mid"] .note-body, .map[data-lod="mid"] .note:has(.note-prompt) .note-body { -webkit-line-clamp: var(--mid-lines, 2); }
.map[data-lod="mid"] .note-author { font-size: .92em; margin-top: 4px; }
.map[data-lod="mid"] .note-author[data-hand="2"] { font-size: 1.12em; }
.map[data-lod="mid"] .note-author[data-hand="3"] { font-size: .8em; }
.map[data-lod="mid"] .note-tab { font-size: .62em; top: -.6em; }

/* pull one colour pass: the other five become unprinted outlines */
:root[data-isolate] .trail[data-ghost] .note {
  background: rgba(244, 246, 248, .16); box-shadow: none; outline: 2.5px dashed rgba(244, 246, 248, .85); outline-offset: -2px;
}
:root[data-isolate] .trail[data-ghost] .note { color: transparent; }
:root[data-isolate] .trail[data-ghost] .note > *, :root[data-isolate] .trail[data-ghost] .note .note-prompt { color: transparent; }
:root[data-isolate] .trail[data-ghost] .note::before, :root[data-isolate] .trail[data-ghost] .note::after { content: none; }
:root[data-isolate] .trail[data-ghost] .note-photo, :root[data-isolate] .trail[data-ghost] .note-tab { opacity: 0; }
:root[data-isolate] #slots-next .slot-next[data-ghost] { display: none; }

/* the next free place on each route */
.slot-next {
  position: absolute; z-index: 1; width: 190px; height: 104px; transform: translate(-50%, -50%);
  display: grid; place-content: center; justify-items: center; gap: 4px; text-align: center; padding: 6px;
  background: var(--slip, var(--paper)); color: var(--ink); border: 4px dashed var(--route, var(--ink)); border-radius: 2px;
  font-size: 15px; font-weight: 600; line-height: 1.2;
}
.slot-next svg { width: 26px; height: 26px; }
.slot-next:hover { background: var(--paper); border-style: solid; }
.slot-next[data-second] { background: rgba(244, 246, 248, .42); border-width: 3px; }
.slot-next[data-second] span, .slot-next[data-second] svg { display: none; }
.map[data-lod="far"] .slot-next span { display: none; }
.map[data-lod="far"] .slot-next svg { width: 46px; height: 46px; stroke-width: 2.6; }
.map[data-lod="mid"] .slot-next { font-size: calc(11.5px / var(--k, .5)); }

/* ---------- top bar: the real heading (phones show it, wide screens read the title block) ---------- */
.topbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- legend ---------- */
.legend {
  position: fixed; z-index: 20; top: 16px; right: 16px; width: 272px; max-height: calc(100dvh - 32px); overflow-y: auto; scrollbar-width: thin;
  background: var(--paper); border: 2px solid var(--ink); padding: 14px 14px 12px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .3), 0 18px 34px -12px rgba(0, 0, 0, .65);
  display: grid; gap: 10px;
}
.legend-scroll { display: grid; gap: 6px; }
.legend-also { border-top: 1px solid var(--rule); padding-top: 6px; }
a.legend-item { text-decoration: none; }
/* the baked snapshot is for reading: nothing on it offers to pin a note */
:root[data-readonly] [data-compose], :root[data-readonly] #slots-next, :root[data-readonly] .legend-fine { display: none; }
.legend-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.legend-head h2 { font-size: 1.125rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.legend-head p { font-size: .9375rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.legend-list { display: grid; gap: 2px; }
.legend-item {
  position: relative; width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  background: none; border: 0; padding: 4px 8px 4px 5px; min-height: 38px; text-align: left; border-radius: 2px;
  font-size: 1rem; font-weight: 500; line-height: 1.15;
}
.legend-item .roundel { font-size: 15px; }
.legend-item .n { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: .9375rem; }
.legend-item:hover { background: var(--wash); }
.legend-item[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.legend-item[aria-pressed="true"] .n { color: var(--paper); }
.legend-item[aria-pressed="true"] .roundel { border-color: var(--paper); }
.legend-whole {
  display: flex; align-items: center; gap: 10px; background: none; border: 0; border-top: 1px solid var(--rule);
  padding: 7px 8px 3px 8px; min-height: 38px; font-weight: 500; text-align: left;
}
.legend-whole:hover { text-decoration: underline; text-underline-offset: 4px; }
.legend-fine { font-size: .8125rem; line-height: 1.4; color: var(--ink-2); }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px; padding: 10px 18px; border: 2px solid var(--ink); border-radius: 2px;
  background: var(--ink); color: var(--paper); font-weight: 700; font-size: 1.0625rem; letter-spacing: .01em;
  transition: background-color .15s linear, transform .15s var(--ease);
}
.btn-primary:hover { background: var(--sky); border-color: var(--sky); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { background: var(--ink-2); border-color: var(--ink-2); cursor: progress; }
.btn-primary[data-state="done"] { background: var(--spruce); border-color: var(--spruce); }

/* ---------- zoom controls + hint ---------- */
.mapctl {
  position: fixed; z-index: 20; right: 16px; bottom: 16px; display: grid;
  background: var(--paper); border: 2px solid var(--ink); box-shadow: 0 12px 24px -10px rgba(0, 0, 0, .6);
}
.mapctl button { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; }
.mapctl button + button { border-top: 1px solid var(--rule); }
.mapctl button:hover { background: var(--wash); }
.mapctl button:disabled { color: #8c96aa; cursor: default; background: none; }
.hint {
  position: fixed; z-index: 15; left: 50%; bottom: 18px; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); font-size: .8125rem; font-weight: 500; padding: 6px 12px; border-radius: 2px;
  white-space: nowrap; pointer-events: none; transition: opacity .25s linear, visibility 0s;
}
/* at rest the hint's sentence lives in the legend; the floating line appears while a route is walked, and for errors */
.hint[data-quiet] { opacity: 0; visibility: hidden; transition: opacity .25s linear, visibility 0s .25s; }

/* ---------- arrival tags ---------- */
.arrivals { position: fixed; z-index: 25; top: 16px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.arrival {
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  background: var(--paper); border: 2px solid var(--ink); padding: 6px 6px 6px 8px; font-size: .9375rem;
  box-shadow: 0 14px 26px -10px rgba(0, 0, 0, .7);
  animation: tag-in .32s var(--ease) both;
}
.arrival .roundel { font-size: 13px; }
.arrival b { font-weight: 700; }
.arrival button { position: relative; background: var(--ink); color: var(--paper); border: 0; padding: 6px 12px; min-height: 36px; font-weight: 600; border-radius: 2px; }
.arrival button:hover { background: var(--sky); }
@keyframes tag-in { from { opacity: 0; translate: 0 -10px; } }

/* ---------- composer: a blank slip ---------- */
.composer {
  position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: min(420px, 100vw);
  background: var(--paper); border-left: 2px solid var(--ink);
  box-shadow: -22px 0 44px -18px rgba(0, 0, 0, .75);
  display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 20px 0; scrollbar-width: thin;
  animation: drawer-in .3s var(--ease) both;
}
.composer[hidden] { display: none; }
@keyframes drawer-in { from { translate: 36px 0; opacity: 0; } }
.composer-head { display: flex; align-items: center; justify-content: space-between; }
.composer-head h2 { font-size: 1.625rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; line-height: 1.1; }
.composer-lede { color: var(--ink-2); margin: 4px 0 16px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; border-radius: 2px; margin-right: -10px; }
.icon-btn:hover { background: var(--wash); }
.note-form { display: flex; flex-direction: column; gap: 16px; flex: 1; }
.f-group legend, .f-label { font-size: .875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; padding: 0; }

.team-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; counter-reset: chip; }
.team-chip {
  counter-increment: chip; display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 5px 9px 5px 6px; text-align: left;
  background: #fff; border: 2px solid var(--rule); border-radius: 2px; font-weight: 500; font-size: .9375rem; line-height: 1.15;
}
.team-chip::before {
  content: counter(chip); display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--team-color); color: var(--on, #fff); border: 2px solid var(--ink); font-weight: 800; font-size: 14px;
}
.team-chip:hover { border-color: var(--ink-2); }
/* GECO Staff is offered beside the routes but is not one: no number, its own line, the hut mark. */
.team-chip--geco { grid-column: 1 / -1; display: grid; grid-template-columns: 28px 1fr; column-gap: 8px; row-gap: 0; margin-top: 6px; }
.team-chip--geco::before { content: none; }
.team-chip--geco svg { grid-row: span 2; width: 28px; height: 28px; padding: 4px; background: var(--ink); color: var(--paper); border: 2px solid var(--ink); border-radius: 2px; }
.team-chip--geco .team-chip-sub { font-size: .8125rem; font-weight: 400; color: var(--ink-2); }
.team-chip--geco[aria-checked="true"] svg { border-color: var(--paper); }
.team-chip--geco[aria-checked="true"] .team-chip-sub { color: var(--paper); }
.team-chip[aria-checked="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.team-chip[aria-checked="true"]::before { border-color: var(--paper); }
.team-chips[data-invalid] .team-chip { border-color: var(--alert); }

.prompt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.prompt-chip {
  background: #fff; border: 1.5px solid var(--rule); border-radius: 2px; padding: 6px 9px; min-height: 34px;
  font-size: .8125rem; line-height: 1.2; text-align: left;
}
.prompt-chip em { font-style: normal; font-weight: 700; }
.prompt-chip:hover { border-color: var(--ink-2); }
.prompt-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.slip-compose {
  position: relative; margin-top: 10px; padding: 20px 16px 10px;
  background: var(--slip, #fff); border-radius: 2px;
  box-shadow: 0 1px 0 rgba(20, 33, 61, .2), 0 14px 22px -12px rgba(0, 0, 0, .55);
  transform: rotate(-.6deg);
}
.slip-pin {
  position: absolute; left: 50%; top: -11px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%;
  background: var(--route, #8c96aa); border: 3px solid var(--ink); box-shadow: 0 0 0 3px var(--paper);
}
.slip-prompt { font-size: .9375rem; font-weight: 600; color: var(--deep, var(--ink-2)); margin-bottom: 4px; }
.slip-prompt em { font-style: normal; font-weight: 800; }
.slip-compose textarea {
  display: block; width: 100%; min-height: 118px; resize: none; border: 0; background: transparent; padding: 0;
  font-size: 1.0625rem; line-height: 1.45; caret-color: var(--route, var(--ink)); outline: none;
}
.slip-compose textarea::placeholder, .slip-sign input::placeholder { color: var(--mute); opacity: 1; }
.slip-compose[data-geco="true"] { box-shadow: 0 0 0 2px var(--ink), 0 14px 22px -12px rgba(0, 0, 0, .55); }
.slip-compose[data-geco="true"] .slip-pin { border-radius: 2px; }
.slip-compose:focus-within { box-shadow: 0 0 0 3px var(--ink), 0 14px 22px -12px rgba(0, 0, 0, .55); }
.slip-compose textarea:focus-visible { box-shadow: none; }
.slip-sign input:focus-visible { box-shadow: 0 3px 0 var(--ink); }
.slip-compose textarea[aria-invalid], .slip-sign input[aria-invalid] { background: rgba(163, 32, 12, .08); box-shadow: 0 2px 0 var(--alert); }
.slip-sign { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; border-top: 1.5px dashed rgba(20, 33, 61, .32); padding-top: 8px; }
.slip-sign label { font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.slip-sign input {
  flex: 1; min-width: 0; border: 0; background: transparent; padding: 2px 0; outline: none; text-align: right;
  font-family: "Hand One", var(--font); font-size: 1.6rem; line-height: 1.1; caret-color: var(--route, var(--ink));
}
.slip-sign input::placeholder { font-family: var(--font); font-size: 1rem; }
.slip-count { font-size: .8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; margin-top: 4px; }
.slip-count[data-near="true"] { color: var(--alert); font-weight: 700; }

.btn-quiet {
  display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 8px 14px;
  background: #fff; border: 2px solid var(--rule); border-radius: 2px; font-weight: 500; cursor: pointer;
}
.btn-quiet:hover { border-color: var(--ink-2); }
.f-photo input:focus-visible + .btn-quiet { outline: 3px solid var(--ink); outline-offset: 3px; }
.photo-preview { margin-top: 10px; display: flex; align-items: flex-end; gap: 12px; }
.photo-preview[hidden] { display: none; }
.photo-preview img { max-width: 150px; max-height: 150px; border: 5px solid #fff; box-shadow: 0 8px 14px -6px rgba(0, 0, 0, .55); transform: rotate(-2deg); }
.photo-remove { background: none; border: 0; padding: 8px 4px; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }
.note-form[data-has-photo="true"] .f-photo .btn-quiet { display: none; }

.f-status { min-height: 1.45em; font-size: .9375rem; font-weight: 500; }
.f-status[data-kind="error"] { color: var(--alert); font-weight: 600; }
.f-status[data-kind="ok"] { color: #17513c; font-weight: 600; }
.composer-foot { position: sticky; bottom: 0; margin: auto -20px 0; padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 2px solid var(--ink); }
.composer-foot .btn-primary { width: 100%; }

/* ---------- reader ---------- */
.reader { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; }
.reader[hidden] { display: none; }
.reader-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .58); animation: fade .2s linear both; }
@keyframes fade { from { opacity: 0; } }
.reader-card {
  position: relative; width: min(34rem, 100%); max-height: min(86vh, 100%); overflow-y: auto; overscroll-behavior: contain;
  background: var(--slip, #fff); color: var(--ink); border-radius: 2px; padding: 22px 26px 0;
  box-shadow: 0 0 0 2px var(--ink), 0 34px 60px -20px rgba(0, 0, 0, .85);
  animation: lift .3s var(--ease) both; scrollbar-width: thin;
}
@keyframes lift { from { opacity: 0; translate: 0 14px; scale: .97; } }
.reader-card:focus { outline: none; }
.reader-head { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; border-bottom: 2px solid var(--ink); padding-bottom: 12px; }
.reader-head .roundel { font-size: 17px; }
.reader-head h2 { font-size: 1.0625rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1.15; }
.reader-pos { font-size: .9375rem; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.reader-body { padding: 20px 0 22px; user-select: text; -webkit-user-select: text; }
.reader-body .note-photo, .reader-body .note-photo--slot {
  position: static; display: block; width: 100%; height: auto; max-height: 46vh; object-fit: contain; transform: none;
  border: 8px solid #fff; box-shadow: 0 10px 18px -8px rgba(0, 0, 0, .5); margin-bottom: 18px; background: #fff;
}
.reader-body .note-prompt { font-size: 1rem; font-weight: 600; white-space: normal; color: var(--deep, var(--ink-2)); margin-bottom: 6px; }
.reader-body .note-body { display: block; font-size: 1.125rem; line-height: 1.55; max-width: 65ch; white-space: pre-wrap; overflow: visible; text-wrap: pretty; }
.reader-body .note-author { margin-top: 16px; font-size: 1.25rem; white-space: normal; padding: 0 4px 4px; }
.reader-foot {
  position: sticky; bottom: 0; display: flex; justify-content: space-between; gap: 12px; margin: 0 -26px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: var(--slip, #fff); border-top: 1.5px dashed rgba(20, 33, 61, .32);
}
.btn-step { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 12px; background: none; border: 0; border-radius: 2px; font-weight: 600; }
.btn-step:hover:not(:disabled) { background: rgba(20, 33, 61, .1); }
.btn-step:disabled { color: #6c7790; cursor: default; }

/* ---------- the foot panel: GECO's dedication and the film ----------
   Not a route. It sits on the sheet's bare paper, below the picture, and is set in the key
   colour only: no route ink, no numbered roundel, no round pin. */
.geco, .filmslot { position: absolute; left: 0; top: 0; }
.foot-head { position: absolute; width: 3300px; color: var(--ink); background: var(--paper); }
.filmslot .foot-head { width: 1568px; }
.foot-head h2 { font-weight: 800; font-size: 104px; line-height: 1; letter-spacing: .01em; text-transform: uppercase; }
.foot-head p { margin-top: 14px; font-size: 44px; font-weight: 500; line-height: 1.2; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foot-head p b { font-weight: 700; color: var(--ink); }
.map[data-plate="far"] .foot-head p { visibility: hidden; }
.map[data-plate="far"] .foot-head h2 { font-size: min(150px, calc(16px / var(--k, .2))); margin-top: 26px; }

/* leadership plates: the first is the sheet's dedication, reversed out of the key colour */
.plate {
  position: absolute; z-index: 2; display: flex; flex-direction: column; overflow: hidden;
  padding: 64px 84px 46px; border-radius: 2px;
}
.plate--first { background: var(--ink); color: var(--paper); box-shadow: inset 0 0 0 5px var(--ink), inset 0 0 0 22px var(--ink), inset 0 0 0 25px rgba(244, 246, 248, .5); }
.plate--second { background: #fff; color: var(--ink); border: 5px solid var(--ink); padding: 52px 60px 40px; }
.plate-head { flex: none; padding-bottom: 28px; margin-bottom: 30px; border-bottom: 4px solid var(--paper); }
.plate--second .plate-head { border-bottom-color: var(--ink); padding-bottom: 22px; margin-bottom: 24px; }
.plate-name { font-weight: 800; font-size: 96px; line-height: 1; letter-spacing: .01em; text-transform: uppercase; text-wrap: balance; }
.plate-title { margin-top: 12px; font-size: 40px; font-weight: 500; line-height: 1.2; color: var(--peri); }
.plate--second .plate-name { font-size: 64px; }
.plate--second .plate-title { font-size: 32px; color: var(--ink-2); margin-top: 8px; }
/* a long letter stops on a whole line here and runs on in the reader */
.plate-body {
  flex: none; overflow: hidden; font-size: 50px; line-height: 1.42; font-weight: 400; text-wrap: pretty;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 8;
}
.plate--second .plate-body { font-size: 37px; line-height: 1.45; -webkit-line-clamp: 11; }
.plate-body .plate-prompt { font-weight: 600; }
.plate-body .plate-prompt em { font-style: normal; font-weight: 800; }
.plate-more { flex: none; align-self: flex-end; margin-top: auto; font-size: 34px; font-weight: 600; text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 3px; }
.plate--second .plate-more { font-size: 28px; }
.plate[data-state="pending"] .plate-body { color: #c3cbe0; }
.plate--second[data-state="pending"] .plate-body { color: var(--ink-2); }
.plate[data-state="pending"] .plate-more { display: none; }
.plate-open { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: none; border-radius: inherit; -webkit-tap-highlight-color: transparent; }
.plate-open[hidden] { display: none; }
.plate-open:focus-visible { outline: 8px solid var(--ink); outline-offset: 10px; box-shadow: 0 0 0 10px var(--paper); }
.plate:has(.plate-open:hover) .plate-more { text-decoration-thickness: 6px; }
.plate--reading { outline: 8px solid var(--ink); outline-offset: 10px; }
/* far away the letter would be a grey block: cover it and let the name hold its size on screen */
.map[data-plate="far"] .plate-body { display: none; }
.map[data-plate="far"] .plate-more { align-self: flex-start; margin-top: .9em; font-size: min(86px, calc(12px / var(--k, .2))); text-decoration-thickness: .08em; }
.map[data-plate="far"] .plate--second .plate-more { font-size: min(70px, calc(11px / var(--k, .2))); }
.map[data-plate="far"] .plate-head { border-bottom: 0; margin: 0; padding: 0; }
.map[data-plate="far"] .plate-name { font-size: min(150px, calc(19px / var(--k, .2))); }
.map[data-plate="far"] .plate-title { font-size: min(92px, calc(12px / var(--k, .2))); margin-top: .5em; }
.map[data-plate="far"] .plate--second .plate-name { font-size: min(120px, calc(15px / var(--k, .2))); }

/* GECO staff notes: white cards ruled in the key colour, in a plain grid */
.trail--geco .trail-head {
  transform: translate(0, -100%) scale(min(2.4, max(1, calc(.42 / var(--k, 1))))); transform-origin: 0 100%;
  box-shadow: none; padding-left: 7px;
}
.trail--geco .trail-head .roundel { font-size: 24px; }
.trail--geco .note {
  width: 240px; font-size: 16.5px; padding: 16px 15px 8px;
  box-shadow: 0 0 0 2px var(--ink), 0 9px 14px -8px rgba(0, 0, 0, .4); transform: translate(-50%, -50%) rotate(calc(var(--tilt, 0) * .8deg));
}
.trail--geco .note-prompt { font-size: 15px; }
/* at a distance a white card on paper would vanish: its rule and pin keep their weight on screen */
.map[data-lod="far"] .trail--geco .note { min-height: 104px; box-shadow: 0 0 0 calc(1.5px / var(--k, .2)) var(--ink); }
.map[data-lod="far"] .trail--geco .note::before {
  --pin: calc(7px / var(--k, .2)); width: var(--pin); height: var(--pin); margin-left: calc(var(--pin) / -2); top: calc(var(--pin) / -2);
  border: 0; box-shadow: 0 0 0 calc(1.5px / var(--k, .2)) var(--paper);
}
.trail--geco .note::before { border-radius: 2px; width: 18px; height: 18px; margin-left: -9px; top: -9px; box-shadow: 0 0 0 3px var(--paper); }
.trail--geco .note:hover, .trail--geco .note:focus-within { box-shadow: 0 0 0 4px var(--ink), 0 14px 22px -8px rgba(0, 0, 0, .45); }
/* resting on the two plates, the staff notes are wholly behind the legend: put away until the view moves */
:root[data-geco-stop="lead"] .trail--geco .trail-notes, :root[data-geco-stop="lead"] .trail--geco .trail-head, :root[data-geco-stop="lead"] .slot-next--geco { visibility: hidden; }
.slot-next--geco { width: 240px; height: 116px; background: #fff; border-color: var(--ink); border-width: 3px; }
.map[data-lod="far"] .slot-next--geco { border-width: calc(1.5px / var(--k, .2)); }

/* the film: a still in a ruled frame, with one action on it */
.film-frame { position: absolute; z-index: 2; overflow: hidden; background: var(--sky); border: 5px solid var(--ink); border-radius: 2px; display: grid; place-items: center; }
.film-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.film-play {
  position: relative; display: inline-flex; align-items: center; gap: 22px; padding: 18px 44px 18px 20px; margin: 0;
  background: var(--paper); color: var(--ink); border: 5px solid var(--ink); border-radius: 2px;
  font-size: 50px; font-weight: 700; line-height: 1; text-decoration: none; white-space: nowrap;
  transform: scale(min(2.6, max(1, calc(.36 / var(--k, 1)))));
  box-shadow: 0 26px 40px -22px rgba(0, 0, 0, .7);
}
.film-play-mark { display: grid; place-items: center; width: 86px; height: 86px; border-radius: 50%; background: var(--ink); color: var(--paper); flex: none; }
.film-play-mark svg { width: 46px; height: 46px; fill: currentColor; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.film-frame[data-state="link"] .film-play-mark svg, .film-play--pending .film-play-mark svg { fill: none; stroke-width: 2.2; }
button.film-play:hover, a.film-play:hover { background: var(--sun); }
.film-play:focus-visible { outline-width: 8px; outline-offset: 8px; box-shadow: 0 0 0 8px var(--paper); }
.film-play--pending { background: var(--ink); color: var(--paper); border-color: var(--paper); font-weight: 600; }
.film-play--pending .film-play-mark { background: var(--paper); color: var(--ink); }

.film { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; padding: 24px; }
.film[hidden] { display: none; }
.film-scrim { position: absolute; inset: 0; background: rgba(4, 9, 22, .82); animation: fade .2s linear both; }
.film-dialog {
  position: relative; width: min(72rem, 100%, calc((100dvh - 150px) * 16 / 9)); background: var(--ink); color: var(--paper);
  border: 2px solid var(--paper); border-radius: 2px; box-shadow: 0 34px 60px -20px rgba(0, 0, 0, .9);
  animation: lift .3s var(--ease) both;
}
.film-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px 6px 16px; }
.film-dialog-head h2 { font-size: 1.0625rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1.15; }
.film-dialog .icon-btn { margin-right: 0; }
.film-dialog .icon-btn:hover { background: #2a3a63; }
.film-dialog :focus-visible { outline-color: var(--sun); box-shadow: none; }
.film-dialog video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.film-note { padding: 12px 16px; font-weight: 500; }
.film-note[hidden] { display: none; }

/* reader: GECO's messages keep their own dress at reading size */
.reader-card[data-kind="first"] { background: var(--ink); color: var(--paper); box-shadow: 0 0 0 2px var(--paper), 0 34px 60px -20px rgba(0, 0, 0, .85); }
.reader-card[data-kind="first"] .reader-head { border-bottom-color: var(--paper); }
.reader-card[data-kind="first"] .reader-foot { background: var(--ink); border-top-color: rgba(244, 246, 248, .4); }
.reader-card[data-kind="first"] .roundel--geco { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.reader-card[data-kind="first"] .icon-btn:hover, .reader-card[data-kind="first"] .btn-step:hover:not(:disabled) { background: #2a3a63; }
.reader-card[data-kind="first"] .btn-step:disabled { color: #8794b4; }
.reader-card[data-kind="first"] :focus-visible { outline-color: var(--paper); box-shadow: none; }
.reader-card[data-kind="second"], .reader-card[data-kind="staff"] { background: #fff; }
.reader-card[data-kind="second"] .reader-foot, .reader-card[data-kind="staff"] .reader-foot { background: #fff; }
.tribute-name { font-size: clamp(1.75rem, 4.4vw, 2.5rem); font-weight: 800; line-height: 1; letter-spacing: .01em; text-transform: uppercase; text-wrap: balance; }
.tribute-title { margin-top: 8px; font-size: 1.0625rem; font-weight: 500; color: var(--ink-2); }
.reader-card[data-kind="first"] .tribute-title { color: var(--peri); }
.tribute-body { margin-top: 22px; font-size: 1.1875rem; line-height: 1.6; max-width: 62ch; text-wrap: pretty; }
.tribute-body p + p { margin-top: .9em; }
.reader-card[data-kind="first"] .tribute-body .note-prompt { color: var(--paper); }

/* hover label for far-away slips */
.peek {
  position: fixed; z-index: 26; max-width: 320px; pointer-events: none;
  display: flex; align-items: flex-start; gap: 9px; padding: 8px 11px 8px 8px;
  background: var(--slip, var(--paper)); color: var(--ink); border: 2px solid var(--ink);
  box-shadow: 0 12px 22px -10px rgba(0, 0, 0, .7); font-size: .9375rem; line-height: 1.35;
}
.peek[hidden] { display: none; }
.peek .roundel { font-size: 13px; margin-top: 1px; }
.peek b { font-weight: 700; }

/* the prototype control sits clear of the map furniture */
.proto-bar { z-index: 30 !important; }

/* ---------- phones ---------- */
@media (max-width: 900px) {
  :root { --dock: 124px; }
  .topbar {
    position: fixed; z-index: 20; top: 0; left: 0; right: 0; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal;
    background: var(--paper); border-bottom: 2px solid var(--ink); padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
  }
  .topbar-title { font-size: 1.25rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; line-height: 1.1; }
  .topbar-meta { font-size: .8125rem; color: var(--ink-2); margin-top: 1px; }

  .legend {
    top: auto; right: 0; left: 0; bottom: 0; width: auto; border-width: 2px 0 0; box-shadow: 0 -14px 26px -14px rgba(0, 0, 0, .7);
    padding: 10px 0 calc(8px + env(safe-area-inset-bottom)); gap: 8px;
    grid-template-columns: 100%;
  }
  .legend-head, .legend-fine { display: none; }
  .legend-pin { order: -1; margin: 0 12px; }
  .legend { max-height: none; overflow: visible; }
  .legend-scroll { display: flex; gap: 6px; overflow-x: auto; padding: 2px 12px 4px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .legend-scroll::-webkit-scrollbar { display: none; }
  .legend-list { display: flex; gap: 6px; flex: none; }
  .legend-also { border-top: 0; padding-top: 0; border-left: 2px solid var(--ink); padding-left: 8px; margin-left: 2px; }
  .legend-list li { flex: none; scroll-snap-align: start; }
  .legend-item { grid-template-columns: auto auto auto; border: 1.5px solid var(--rule); min-height: 44px; padding: 5px 10px 5px 6px; white-space: nowrap; font-size: .9375rem; background: #fff; }
  .legend-item[aria-pressed="true"] { border-color: var(--ink); }
  .legend-whole { display: none; }
  .legend-list .whole-chip { display: block; }

  .mapctl { display: none; }
  .hint { display: none; }
  .arrivals { top: calc(64px + env(safe-area-inset-top)); width: calc(100vw - 20px); }
  .arrival { font-size: .875rem; }

  .composer { width: 100vw; border-left: 0; padding-top: calc(12px + env(safe-area-inset-top)); animation-name: sheet-in; }
  .prompt-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px; padding: 2px 20px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .prompt-chips::-webkit-scrollbar { display: none; }
  .prompt-chip { flex: none; white-space: nowrap; min-height: 44px; font-size: .9375rem; padding: 8px 12px; scroll-snap-align: start; }
  @keyframes sheet-in { from { translate: 0 28px; opacity: 0; } }

  .film { padding: 0; }
  .film-dialog { width: 100%; border-width: 2px 0; }

  .reader { padding: 0; place-items: end center; }
  .reader-card { width: 100%; max-height: 84dvh; padding: 16px 18px 0; box-shadow: 0 -2px 0 var(--ink), 0 -24px 44px -14px rgba(0, 0, 0, .8); animation-name: sheet-in; }
  .reader-foot { margin: 0 -18px; padding-left: 12px; padding-right: 12px; }
  .reader-body .note-body { font-size: 1.0625rem; }

  .proto-bar { bottom: calc(var(--dock) + 12px + env(safe-area-inset-bottom)) !important; }
}
@media (min-width: 901px) { .legend-list .whole-chip { display: none; } }
@media (min-width: 561px) and (max-width: 900px) {
  .reader-card { width: min(40rem, 100%); }
  .composer { width: min(30rem, 100vw); border-left: 2px solid var(--ink); }
  .prompt-chips { margin: 0; padding: 2px 0 6px; }
}

/* ---------- reduced motion: the still equivalents ---------- */
@media (prefers-reduced-motion: reduce) {
  .note--enter, .arrival, .composer, .reader-card, .reader-scrim, .film-scrim, .film-dialog { animation: none; }
  .btn-primary, .pa-route-core, .pa-route-key, .pa-route-halo, .hint { transition: none; }
}
