/* EasyRoute web app: "the manifest". Paper and ink, plus four status colours that only ever signal state
   (SPEC 3 and 12). Every colour value in the app lives in the token block below; nothing else in this file or
   in the scripts may contain one (checked by backend/webtests/static.test.mjs). The token names for paper,
   ink and the opacity steps are the same as backend/app/static/manifest.css. */

/* ===== Tokens ===================================================================================== */
:root {
  color-scheme: light dark;
  --paper: #fff;
  --ink: #000;
  --paper-solid: #fff;
  --ink-solid: #000;
  --ink-rgb: 0 0 0;
  --ink2: rgb(var(--ink-rgb) / 0.62);
  --ink3: rgb(var(--ink-rgb) / 0.36);
  --rule: rgb(var(--ink-rgb) / 0.14);
  --fill: rgb(var(--ink-rgb) / 0.07);
  /* Status colours (SPEC 12.1), light appearance. Text in these colours needs 4.5:1; yellow stays ink. */
  --status-success: #0b7a3b;
  --status-warning: #b88700;
  --status-warning-fill: #ffcc00;
  --status-error: #c62828;
  --status-info: #0a5fd8;
  /* The map canvas is drawn for the light appearance; the CSS filter inverts it in dark. */
  --map-ink: #000;
  --map-paper: #fff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #000;
    --ink: #fff;
    --ink-rgb: 255 255 255;
    --status-success: #30d158;
    --status-warning: #ffd60a;
    --status-warning-fill: #ffd60a;
    --status-error: #ff453a;
    --status-info: #0a84ff;
    --paper-solid: #000;
    --ink-solid: #fff;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #000;
  --ink: #fff;
  --ink-rgb: 255 255 255;
  --status-success: #30d158;
  --status-warning: #ffd60a;
  --status-warning-fill: #ffd60a;
  --status-error: #ff453a;
  --status-info: #0a84ff;
  --paper-solid: #000;
  --ink-solid: #fff;
}
:root[data-theme="light"] { color-scheme: light; }

:root {
  --tint-success: color-mix(in srgb, var(--status-success) 14%, transparent);
  --tint-warning: color-mix(in srgb, var(--status-warning-fill) 14%, transparent);
  --tint-error: color-mix(in srgb, var(--status-error) 14%, transparent);
  --tint-info: color-mix(in srgb, var(--status-info) 14%, transparent);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  --radius: 16px;
  --radius-badge: 8px;
  --gutter: 16px;
  --topbar-h: 56px;
  --tap: 44px;
  /* Motion tokens are published by js/motion.js; these are the same values for the first paint. */
  --m-enter: 240ms;
  --m-entrance: 320ms;
  --m-departure: 192ms;
  --m-fade: 120ms;
  --m-press: 0.97;
  --m-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --m-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --m-settle: cubic-bezier(0.32, 0.72, 0, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

/* ===== Base ======================================================================================= */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; height: 100%; background: var(--paper); color: var(--ink);
  font: 400 1rem/1.45 var(--sans); -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
a { color: var(--ink); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 12px; z-index: 100; }
.skip:focus { top: 8px; }
.figure, .figures dd { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink2); }
.display { font-weight: 900; font-stretch: 125%; text-transform: uppercase; letter-spacing: -0.02em; line-height: 1; font-size: clamp(1.75rem, 8vw, 3rem); margin: 0.5rem 0; overflow-wrap: anywhere; }
.lede { font-size: 1.125rem; line-height: 1.35; margin: 0 0 1.25rem; }
.lede2 { margin: 0 0 1rem; }
.hint { font-size: 0.8125rem; color: var(--ink2); margin: 0.5rem 0; }
.inf { font-family: var(--mono); font-size: 1.15em; line-height: 1; }
.boot, .boot-error { padding: 2rem var(--gutter); font-weight: 900; font-stretch: 125%; text-transform: uppercase; }
.boot-error { font-weight: 400; text-transform: none; }

.app { height: 100%; display: flex; flex-direction: column; padding-left: var(--sal); padding-right: var(--sar); }

/* ===== Top bar ==================================================================================== */
.topbar {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: calc(var(--topbar-h) + var(--sat)); padding: var(--sat) 8px 0 var(--gutter);
  border-bottom: 1px solid var(--rule); background: var(--paper);
}
.wordmark { font-weight: 900; font-stretch: 125%; text-transform: uppercase; letter-spacing: -0.02em; font-size: 1.125rem; text-decoration: none; padding: 10px 0; }
.topnav { display: flex; align-items: center; }

@media (max-width: 400px) {
  .topbar { padding-left: 12px; padding-right: 2px; }
  .wordmark { font-size: 1rem; }
  .acct-btn { display: none; }
  .wordmark { font-size: 0.9375rem; }
  .bar-row .btn { padding: 0 10px; font-size: 0.8125rem; }
}

/* ===== Buttons ==================================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 18px;
  border-radius: var(--radius); border: 1px solid transparent; background: transparent; color: var(--ink);
  font-size: 0.9375rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; text-decoration: none; text-align: center;
  transition: transform var(--m-enter) var(--m-ease-out), background-color var(--m-fade), color var(--m-fade);
  position: relative; overflow: hidden;
}
.btn { white-space: nowrap; }
.btn:active { transform: scale(var(--m-press)); transition: none; }
.btn:disabled { color: var(--ink3); cursor: default; }
.btn-primary { background: var(--ink); color: var(--paper); min-height: 56px; width: 100%; }
.btn-primary:active { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.btn-primary:disabled { background: var(--fill); color: var(--ink3); }
.btn-secondary { border-color: var(--ink); }
.btn-secondary:active { background: var(--ink); color: var(--paper); }
.btn-secondary:disabled { border-color: var(--ink3); }
.btn-tertiary { padding: 0 10px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.btn-tertiary:active { text-decoration: underline; }
.btn-big { min-height: 64px; font-size: 1.0625rem; width: 100%; }
.iconbtn {
  display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); border: 0; background: transparent; border-radius: 12px;
  transition: transform var(--m-enter) var(--m-ease-out), background-color var(--m-fade);
}
.iconbtn:active { transform: scale(var(--m-press)); transition: none; background: var(--fill); }
.iconbtn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.icon { flex: none; }
.btn-start .bar-fill { position: absolute; inset: 0; background: var(--paper); opacity: 0; transform: translateX(-100%); }
.btn-start.progressing .bar-fill { opacity: 0.22; animation: sweep 1.3s var(--m-ease-in-out) infinite; }
.btn-start .btn-label { position: relative; }
@keyframes sweep { to { transform: translateX(100%); } }

/* ===== Forms ====================================================================================== */
.input {
  width: 100%; min-height: var(--tap); padding: 10px 12px; background: var(--paper); border: 1px solid var(--rule);
  border-radius: 12px; outline-offset: 0;
}
.input:focus { border-color: var(--ink); outline: 2px solid var(--ink); outline-offset: 0; }
textarea.input { resize: vertical; line-height: 1.4; }
.field { margin: 0 0 14px; display: block; }
.field > label { display: block; margin-bottom: 6px; }
.field .input { display: block; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.segmented { display: inline-flex; border: 1px solid var(--ink); border-radius: 12px; overflow: hidden; margin-top: 6px; }
.segmented.wrap { display: flex; flex-wrap: wrap; border: 0; gap: 6px; }
.seg { min-height: var(--tap); padding: 0 14px; background: transparent; border: 0; font-size: 0.875rem; font-weight: 500; transition: background-color var(--m-fade), color var(--m-fade); }
.wrap .seg { border: 1px solid var(--rule); border-radius: 12px; }
.seg[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.seg:disabled { color: var(--ink3); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 4px; }
.row-actions .btn-primary { width: auto; flex: 1 1 100%; }
.tag { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; border: 1px solid var(--ink3); border-radius: 6px; padding: 1px 6px; color: var(--ink2); }
.linkrow { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0; }
.linkrow a { font-size: 0.875rem; }

/* ===== Layout: list and map ======================================================================= */
.viewhost { flex: 1; min-height: 0; display: flex; }
.planview { flex: 1; display: flex; min-width: 0; min-height: 0; }
.layout { flex: 1; display: grid; grid-template-columns: 1fr; min-height: 0; min-width: 0; }
.pane-list { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pane-map { display: none; position: relative; min-height: 0; border-inline-start: 1px solid var(--rule); background: var(--fill); }
.layout.show-map .pane-list { display: none; }
.layout.show-map .pane-map { display: block; border: 0; }
.layout.no-map .pane-map { display: none; }
.map-toggle { display: inline-grid; }
@media (min-width: 900px) {
  .layout { grid-template-columns: minmax(360px, 42%) 1fr; }
  .pane-map, .layout.show-map .pane-map { display: block; border-inline-start: 1px solid var(--rule); }
  .layout.show-map .pane-list { display: flex; }
  .map-toggle { display: none; }
  .layout.no-map { grid-template-columns: minmax(360px, 640px); justify-content: center; }
}
.pane-scroll { flex: 1; overflow-y: auto; padding: 16px var(--gutter) 24px; -webkit-overflow-scrolling: touch; }
.bar-bottom {
  flex: none; padding: 12px var(--gutter) calc(12px + var(--sab)); border-top: 1px solid var(--rule); background: var(--paper);
  display: flex; flex-direction: column; gap: 8px;
}
.bar-row { display: flex; gap: 8px; align-items: center; }
.bar-row .btn-secondary, .bar-row .btn-primary { flex: 1; }
.bar-row .btn-tertiary { flex: none; }

/* ===== Plan: title, start/end ====================================================================== */
.titleblock { margin-bottom: 14px; }
.title-input {
  width: 100%; border: 0; border-bottom: 1px solid transparent; background: transparent; padding: 4px 0; border-radius: 0;
  font-weight: 900; font-stretch: 125%; text-transform: uppercase; letter-spacing: -0.02em; font-size: clamp(1.5rem, 6vw, 2.25rem); line-height: 1.1;
}
.title-input:hover { border-bottom-color: var(--rule); }
.title-input:focus { border-bottom-color: var(--ink); outline: none; }
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: var(--tap); }
.summary { margin: 0; font-size: 0.9375rem; color: var(--ink2); }
.startend { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 8px 0; margin-bottom: 8px; }
.se-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 4px 0; }
.se-main { min-width: 0; flex: 1 1 8rem; }
.se-value { margin: 2px 0 0; overflow-wrap: anywhere; }
.se-actions { display: flex; flex-wrap: wrap; }
.startend .hint { margin: 4px 0 6px; }

/* ===== Manifest rows ============================================================================== */
.manifest { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.line {
  display: flex; align-items: center; gap: 8px; padding: 8px 0 8px 12px; border-bottom: 1px solid var(--rule);
  border-inline-start: 2px solid transparent; margin-inline-start: -12px; background: var(--paper);
  content-visibility: auto; contain-intrinsic-size: auto 64px; position: relative;
}
.line.next { border-inline-start-color: var(--ink); }
.line.shifted { transform: translateY(var(--shift-y, 0)); transition: transform var(--m-enter) var(--m-ease-in-out); }
.line.dragging { transform: translateY(var(--drag-y, 0)); z-index: 5; outline: 2px solid var(--ink); content-visibility: visible; }
.badge {
  flex: none; width: 40px; height: 40px; min-width: 40px; border-radius: var(--radius-badge); border: 1px solid var(--ink); background: transparent;
  display: grid; place-items: center; font-family: var(--mono); font-weight: 500; font-size: 0.9375rem; padding: 0;
  transition: background-color var(--m-fade), color var(--m-fade), transform var(--m-enter) var(--m-ease-out);
}
button.badge { cursor: pointer; position: relative; }
/* The hit area grows to 44 x 44 around the 40 px badge (1 px border, so inset -3 px), and only there: the badge is its own positioning context. */
button.badge::after { content: ""; position: absolute; inset: -3px; }
button.badge:active { transform: scale(var(--m-press)); transition: none; }
.badge.static { cursor: default; }
.badge-xl { width: 72px; height: 72px; font-size: 1.75rem; border-radius: 14px; border-width: 2px; }
.done .badge, .badge-xl:has(.icon) { background: var(--ink); color: var(--paper); }
.skipped .badge { border-style: dashed; color: var(--ink2); border-color: var(--ink2); }
.line-body { flex: 1; min-width: 0; text-align: start; background: transparent; border: 0; padding: 4px 0; min-height: var(--tap); display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.name { min-width: 0; overflow-wrap: anywhere; }
.done .name { text-decoration: line-through; color: var(--ink2); }
.skipped .name { text-decoration: line-through; color: var(--ink3); }
.addr { font-size: 0.8125rem; color: var(--ink2); overflow-wrap: anywhere; display: block; }
.eta { flex: none; text-align: end; font-size: 0.9375rem; min-width: 3.2rem; }
.eta small { display: block; font-family: var(--sans); font-size: 0.6875rem; font-weight: 500; color: var(--ink2); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 0; padding: 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 0.6875rem; font-weight: 600; border: 1px solid var(--rule); border-radius: 6px; padding: 1px 6px; color: var(--ink2); }
.chip-late { border-color: var(--ink); color: var(--ink); }
.handle { touch-action: none; cursor: grab; color: var(--ink2); }
.handle:active { cursor: grabbing; }
.how .eta { flex: 0 1 11rem; text-align: start; }
.how .eta small { font-size: 0.8125rem; font-weight: 400; }
.how .name { flex: none; }
.empty-title { font-size: clamp(1.5rem, 7vw, 2.25rem); }
.undo-host { position: sticky; bottom: 0; }
.undo { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--ink); color: var(--paper); border-radius: 12px; padding: 4px 8px 4px 14px; font-size: 0.875rem; }
.undo .btn { color: var(--paper); }
@media (max-width: 420px) { .eta { min-width: 2.6rem; font-size: 0.8125rem; } .line { gap: 4px; } }

/* ===== Status components (SPEC 12.1) ============================================================== */
.st-success { --st: var(--status-success); --st-tint: var(--tint-success); }
.st-warning { --st: var(--status-warning); --st-tint: var(--tint-warning); }
.st-error { --st: var(--status-error); --st-tint: var(--tint-error); }
.st-info { --st: var(--status-info); --st-tint: var(--tint-info); }
.statusline { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; font-size: 0.8125rem; color: var(--ink); }
.statusline .icon { color: var(--st); }
.notice { display: flex; gap: 12px; padding: 12px 14px; margin: 10px 0; border-radius: var(--radius); background: var(--st-tint); border-inline-start: 4px solid var(--st); }
.notice-icon { color: var(--st); margin-top: 1px; }
.notice-title { margin: 0 0 2px; font-weight: 600; }
.notice-text { margin: 0; font-size: 0.9375rem; }
.notice-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.banner-host { position: fixed; top: calc(var(--topbar-h) + var(--sat) + 8px); left: 0; right: 0; z-index: 60; display: flex; justify-content: center; pointer-events: none; padding: 0 var(--gutter); }
.banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--rule); border-inline-start: 4px solid var(--st); box-shadow: none; max-width: 36rem; font-size: 0.9375rem; }
.banner::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--st-tint); pointer-events: none; }
.banner { position: relative; }
.banner .icon { color: var(--st); position: relative; }
.banner span { position: relative; }
.statusdialog, .sheet {
  color: var(--ink); background: var(--paper); border: 1px solid var(--ink); border-radius: var(--radius); padding: 0; max-width: calc(100vw - 32px);
}
.statusdialog { width: 26rem; padding: 20px; border-inline-start: 6px solid var(--st); }
.statusdialog::backdrop, .sheet::backdrop { background: rgb(var(--ink-rgb) / 0.45); }
.sd-head { display: flex; align-items: flex-start; gap: 12px; }
.sd-icon { color: var(--st); flex: none; margin-top: 2px; }
.sd-title { margin: 0; font-size: 1.25rem; font-weight: 800; line-height: 1.2; }
.sd-message { margin: 12px 0 16px; }
.sd-actions { display: flex; flex-direction: column; gap: 8px; }
.sd-actions .btn-primary { min-height: 52px; }

/* ===== Sheets and menus =========================================================================== */
.sheet { width: 100%; max-width: 100%; margin: auto 0 0; max-height: calc(100dvh - 24px - var(--sat)); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.sheet[open] { display: flex; flex-direction: column; }
.sheet-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px var(--gutter); border-bottom: 1px solid var(--rule); }
.sheet-title { margin: 0; font-weight: 900; font-stretch: 125%; text-transform: uppercase; letter-spacing: -0.02em; font-size: 1.125rem; }
.sheet-body { flex: 1; overflow-y: auto; padding: 16px var(--gutter) calc(20px + var(--sab)); }
@media (min-width: 700px) {
  .sheet { width: 34rem; margin: auto; border: 1px solid var(--ink); border-radius: var(--radius); max-height: min(44rem, calc(100dvh - 48px)); }
  .sheet-wide { width: 46rem; }
}
.menu { position: fixed; left: var(--menu-left, 0); top: var(--menu-top, 0); z-index: 80; min-width: 12rem; background: var(--paper); border: 1px solid var(--ink); border-radius: 12px; padding: 4px; display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 0 12px; background: transparent; border: 0; border-radius: 8px; text-align: start; }
.menu-item:hover, .menu-item:focus-visible { background: var(--ink); color: var(--paper); outline: none; }
.menu-item:disabled { color: var(--ink3); background: transparent; }
.sheet-note { margin: 6px 0; }
.plist { list-style: none; margin: 8px 0; padding: 0; border-top: 1px solid var(--rule); }
.plist[hidden] { display: none; }
.prow, .rrow-main { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 4px; background: transparent; border: 0; border-bottom: 1px solid var(--rule); text-align: start; }
.plist li { border-bottom: 1px solid var(--rule); }
.plist .prow { border-bottom: 0; }
.prow:active, .rrow-main:active { background: var(--fill); }
.prow-text, .rrow-main { min-width: 0; }
.rlist { list-style: none; margin: 8px 0; padding: 0; border-top: 1px solid var(--rule); }
.rrow { display: flex; align-items: center; border-bottom: 1px solid var(--rule); }
.rrow-main { flex: 1; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; border-bottom: 0; }
.rrow.current { border-inline-start: 2px solid var(--ink); padding-inline-start: 8px; }
.count { min-height: 1.2em; }

/* ===== Paste ====================================================================================== */
.paste-area { font-family: var(--mono); font-size: 0.875rem; min-height: 9rem; }
.draftlist { list-style: none; margin: 8px 0; padding: 0; border-top: 1px solid var(--rule); }
.draft { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.draft-head { display: flex; gap: 10px; align-items: flex-start; }
.draft-fields { flex: 1; display: grid; gap: 6px; min-width: 0; }
.flag { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 0.8125rem; font-weight: 600; }
.draft-result { margin: 4px 0 0; }
.preview-head { margin: 14px 0 4px; }

/* ===== Drive ====================================================================================== */
.drivehost, .drive { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; width: 100%; }
.drive-top { flex: none; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 12px; padding: calc(8px + var(--sat)) var(--gutter) 0 8px; }
.drive-top .meter { grid-column: 1 / -1; margin: 0 0 8px 8px; }
.progress { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; }
.progress .eyebrow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress .figure { font-size: 1.5rem; }
.meter { display: block; width: 100%; height: 2px; border: 0; appearance: none; -webkit-appearance: none; background: var(--rule); color: var(--ink); }
.meter::-webkit-progress-bar { background: var(--rule); }
.meter::-webkit-progress-value { background: var(--ink); transition: width var(--m-entrance) var(--m-ease-in-out); }
.meter::-moz-progress-bar { background: var(--ink); }
.drive-main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 16px var(--gutter) calc(20px + var(--sab)); max-width: 44rem; width: 100%; margin: 0 auto; }
.drive-stop { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: min-content; }
.drive-stop > :first-child { margin-top: auto; }
.drive-stop > :last-child { margin-bottom: auto; }
.drive-title { margin: 4px 0 0; font-size: clamp(2rem, 9vw, 3.75rem); line-height: 1.02; font-weight: 900; font-stretch: 125%; text-transform: uppercase; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.drive-title:focus { outline: none; }
.drive-addr { margin: 0; font-size: clamp(1.0625rem, 4vw, 1.375rem); color: var(--ink2); overflow-wrap: anywhere; }
.drive-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: clamp(1.25rem, 5vw, 1.75rem); }
.drive-note { margin: 0; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 12px; width: 100%; }
.drive-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; flex: none; }
.drive-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reopt { width: 100%; justify-content: flex-start; text-align: start; gap: 14px; padding: 10px 16px; min-height: 64px; white-space: normal; text-transform: none; letter-spacing: 0; }
.reopt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.reopt-label { font-size: 0.9375rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.reopt-caption { font-size: 0.8125rem; font-weight: 400; color: var(--ink2); }
.reopt:active .reopt-caption { color: inherit; }
.drive-layout { grid-template-columns: 1fr; }
.drive-layout .drivehost { min-height: 0; overflow: hidden; }
.drive-layout .drive-main { margin: 0; max-width: none; }
.map-loading { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; z-index: 1; font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink2); background: var(--fill); pointer-events: none; }
.drive-notice .notice { margin: 0; }
.savings { border-top: 1px solid var(--rule); padding-top: 14px; }
.figures { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; margin: 8px 0; }
.fig { border-top: 1px solid var(--rule); padding-top: 6px; }
.fig dt { margin: 0; }
.fig dd { margin: 0; font-size: 1.5rem; }
.pct { margin: 6px 0; font-size: 1.0625rem; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 90; }
@media (min-width: 900px) { .drive-layout { grid-template-columns: minmax(380px, 42%) 1fr; } }

/* ===== Map ======================================================================================== */
.map-host, .map-canvas { position: absolute; inset: 0; }
.received-map { position: relative; height: 16rem; margin: 16px 0; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.map-host > .notice { margin: 16px; position: relative; }
.map-canvas canvas { filter: grayscale(1) contrast(1.06); }
:root[data-theme="dark"] .map-canvas canvas { filter: grayscale(1) invert(1) contrast(1.06); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .map-canvas canvas { filter: grayscale(1) invert(1) contrast(1.06); } }
.maplibregl-ctrl-attrib { background: var(--paper) !important; color: var(--ink2) !important; font-size: 10px; }
.maplibregl-ctrl-attrib a { color: var(--ink2) !important; }
.mapcapsule { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--ink); border-radius: 22px; overflow: visible; z-index: 3; }
.capbtn { position: relative; display: grid; place-items: center; width: var(--tap); height: var(--tap); background: transparent; border: 0; border-radius: 22px; }
.capbtn + .capbtn { border-top: 1px solid var(--rule); border-radius: 0 0 22px 22px; }
.capbtn:active { background: var(--ink); color: var(--paper); transform: scale(var(--m-press)); }
.cap { position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%); white-space: nowrap; background: var(--ink); color: var(--paper); font-size: 0.75rem; font-weight: 600; padding: 4px 10px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity var(--m-fade); }
.capbtn.show-cap .cap { opacity: 1; }
.stopcard { position: absolute; left: 12px; right: 12px; bottom: calc(12px + var(--sab)); max-width: 28rem; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; background: var(--paper); border: 1px solid var(--ink); border-radius: var(--radius); z-index: 4; }
.stopcard-text { flex: 1; min-width: 0; }
.stopcard-text p { margin: 0; }
.stopcard-actions { display: flex; align-items: center; gap: 2px; }
.dropbar { position: absolute; left: 12px; right: 64px; top: 12px; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; background: var(--paper); border: 1px solid var(--ink); border-inline-start: 4px solid var(--st); border-radius: var(--radius); z-index: 4; font-size: 0.875rem; }
.dropbar .icon { color: var(--st); }
.dropbar .drop-count { margin-inline-start: auto; font-size: 0.8125rem; }

/* ===== Pro, account, settings ===================================================================== */
.benefits { list-style: none; margin: 0 0 12px; padding: 0; border-top: 1px solid var(--rule); }
.benefit { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.benefit p { margin: 0; }
.benefit-sign { width: 24px; text-align: center; font-size: 1.25rem; }
.benefit-title { font-weight: 600; }
.prices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.price { border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px; }
.price-v { margin: 2px 0; font-size: 1.125rem; }
.statement { padding: 12px 14px; border: 1px solid var(--ink); border-radius: var(--radius); margin: 12px 0; }
.identity .se-value { font-size: 1.25rem; }
.providers { display: flex; flex-direction: column; gap: 8px; }
.providers .btn { width: 100%; }
.keys, .keys-intro { margin-top: 24px; border-top: 1px solid var(--rule); padding-top: 12px; }
.keys .eyebrow, .keys-intro .eyebrow { margin: 0; }
.keylist { list-style: none; margin: 8px 0; padding: 0; border-top: 1px solid var(--rule); }
.keyrow { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.keyrow > .notice { margin: 0; flex: 1; }
.keyinfo { min-width: 0; }
.keyinfo p { margin: 0; }
.keymask { font-size: 0.875rem; overflow-wrap: anywhere; }
.keyreveal .linkbox { margin: 8px 0 0; }
.keyform { margin-top: 12px; }
.danger-zone { margin-top: 24px; border-top: 1px solid var(--rule); padding-top: 8px; }
.linkbox { margin: 8px 0; padding: 14px; border: 1px solid var(--ink); border-radius: var(--radius); overflow-wrap: anywhere; word-break: break-all; font-size: 0.9375rem; user-select: all; }

/* ===== Received-route page (/r/{id}) ============================================================== */
.received { padding: 8px 0 24px; }
.received .display { margin: 0.25rem 0 0.75rem; }
.received .progress { margin-top: 12px; }
.received .meter { margin: 8px 0 16px; }
.received .manifest { margin-top: 20px; }
.received-stop { margin-top: 8px; }
.received-actions { margin-top: 20px; }
.appfoot { margin-top: 32px; padding-top: 12px; border-top: 1px solid var(--rule); font-size: 0.75rem; color: var(--ink2); }
.appfoot p { margin: 0 0 4px; }

/* ===== Reduced motion ============================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .btn-start.progressing .bar-fill { animation: none; opacity: 0.22; transform: none; }
  .btn:active, .iconbtn:active { transform: none; }
}

/* ===== API keys page (/app/keys, SPEC 13.10) ====================================================== */
.keys-body { height: auto; min-height: 100%; overscroll-behavior: auto; }
.keys-nav { gap: 4px 16px; flex-wrap: wrap; padding-right: 8px; }
.keys-nav a { font-size: 0.875rem; padding: 10px 0; }
.keys-main { max-width: 40rem; margin: 0 auto; padding: 16px var(--gutter) calc(32px + var(--sab)); }
.providers { display: flex; flex-direction: column; gap: 8px; max-width: 22rem; }
