/* PackWise console: "the luggage tag". Kraft paper ground, perforation hairlines, rubber-stamp statuses,
   airmail stripes on the ONE object that matters, monospace codes. No sidebar, no card grid, no shadow stacks.
   docs/BRAND.md is the source of every colour; docs/UI.md lists the components and the rules for using them.
   Colour is data: --ok PACKED, --warn PARTIAL/EXTRA/CHECK, --bad MISSING (real gaps only), --brand the one action,
   --stripe the airmail border only. */
:root {
  color-scheme: light;
  --bg: #F3ECDD; --bg-2: #EBE2CD; --bg-3: #E0D4B9;
  --surface: #FBF8F0; --surface-2: #F7F2E4;
  --ink: #16202B; --ink-2: #33404D; --muted: #6A685F; --faint: #8F8B7E;
  --line: #D8CCB2; --line-2: #C2B493;
  --brand: #1E4FD0; --brand-ink: #173FA8; --brand-soft: #E3E9F8; --brand-strong: #173FA8; --on-brand: #FFFFFF;
  --stripe: #D6322E;
  --ok: #237A4B; --ok-ink: #1B6339; --ok-soft: rgba(35, 122, 75, .12);
  --warn: #B76A00; --warn-ink: #8A4F00; --warn-soft: rgba(183, 106, 0, .13);
  --bad: #B3261E; --bad-ink: #9A1F18; --bad-soft: rgba(179, 38, 30, .10);
  --info: #1E4FD0; --info-ink: #173FA8; --info-soft: rgba(30, 79, 208, .10);
  --navy: #1E4FD0; --on-solid: #FFFFFF; --focus: #16202B;
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--focus);
  --scrim: rgba(22, 32, 43, .5);
  --shadow-lg: 0 18px 40px -18px rgba(22, 32, 43, .4);
  --radius: 4px; --radius-sm: 3px; --radius-xs: 2px;
  --font: ui-sans-serif, system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sign: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", system-ui, sans-serif;
  --serif: "Iowan Old Style", Palatino, Georgia, serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --page-w: 1180px; --gutter: 28px; --bar-h: 56px; --tabbar-h: 62px;
  --paper-dot: rgba(22, 32, 43, .055);
}
:root[data-theme="dark"] { color-scheme: dark;
  --bg: #0F1620; --bg-2: #131C29; --bg-3: #1B2738; --surface: #172131; --surface-2: #1B273A;
  --ink: #ECE7DA; --ink-2: #D2CDBF; --muted: #9AA3AE; --faint: #77818D; --line: #2B3A4F; --line-2: #3A4C66;
  --brand: #7EA2FF; --brand-ink: #A9C0FF; --brand-soft: rgba(126, 162, 255, .13); --brand-strong: #A9C0FF; --on-brand: #0F1620;
  --stripe: #F26A66; --ok: #4CC38A; --ok-ink: #6FD6A3; --ok-soft: rgba(76, 195, 138, .14);
  --warn: #F0A93B; --warn-ink: #F5BE66; --warn-soft: rgba(240, 169, 59, .14);
  --bad: #FF7A70; --bad-ink: #FF9C94; --bad-soft: rgba(255, 122, 112, .13);
  --info: #7EA2FF; --info-ink: #A9C0FF; --info-soft: rgba(126, 162, 255, .13);
  --navy: #7EA2FF; --on-solid: #0F1620; --focus: #ECE7DA; --scrim: rgba(3, 7, 12, .66); --paper-dot: rgba(236, 231, 218, .045); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark;
  --bg: #0F1620; --bg-2: #131C29; --bg-3: #1B2738; --surface: #172131; --surface-2: #1B273A;
  --ink: #ECE7DA; --ink-2: #D2CDBF; --muted: #9AA3AE; --faint: #77818D; --line: #2B3A4F; --line-2: #3A4C66;
  --brand: #7EA2FF; --brand-ink: #A9C0FF; --brand-soft: rgba(126, 162, 255, .13); --brand-strong: #A9C0FF; --on-brand: #0F1620;
  --stripe: #F26A66; --ok: #4CC38A; --ok-ink: #6FD6A3; --ok-soft: rgba(76, 195, 138, .14);
  --warn: #F0A93B; --warn-ink: #F5BE66; --warn-soft: rgba(240, 169, 59, .14);
  --bad: #FF7A70; --bad-ink: #FF9C94; --bad-soft: rgba(255, 122, 112, .13);
  --info: #7EA2FF; --info-ink: #A9C0FF; --info-soft: rgba(126, 162, 255, .13);
  --navy: #7EA2FF; --on-solid: #0F1620; --focus: #ECE7DA; --scrim: rgba(3, 7, 12, .66); --paper-dot: rgba(236, 231, 218, .045); } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--font);
  background-image: radial-gradient(var(--paper-dot) 1px, transparent 1px); background-size: 14px 14px; }
h1, h2, h3, h4, p, ul, ol, figure, dl { margin: 0; }
h1, h2, h3 { font-family: var(--font); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(28px, 4vw, 40px); } h2 { font-size: 20px; } h3 { font-size: 16px; }
h1 em, h2 em, .accent { font-family: var(--serif); font-style: italic; font-weight: 500; letter-spacing: -.01em; }
a { color: var(--brand-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 2px; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 200; padding: 10px 14px; background: var(--ink); color: var(--bg); } .skip-link:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .row.between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 16px; } .stack.sm { gap: 8px; } .stack.lg { gap: 28px; }
.mono, .code { font-family: var(--mono); font-feature-settings: "tnum"; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- signage type ---------- */
.eyebrow, .label-caps { font: 700 12px/1.2 var(--sign); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.code { display: inline-block; padding: 1px 7px; border: 1px solid var(--line-2); border-radius: 2px; background: var(--bg-2); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.code.big { font-size: 15px; padding: 3px 10px; letter-spacing: .12em; }
.perf { border: 0; border-top: 1.5px dashed var(--line-2); margin: 0; height: 0; }
.perf-v { border-left: 1.5px dashed var(--line-2); align-self: stretch; }

/* ---------- shell ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1.5px dashed var(--line-2); }
.topbar-in { max-width: var(--page-w); margin: 0 auto; height: var(--bar-h); padding: 0 var(--gutter); display: flex; align-items: center; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font: 800 19px/1 var(--font); letter-spacing: -.03em; flex: none; }
.brand img { width: 28px; height: 28px; display: block; } .brand em { font: italic 500 20px/1 var(--serif); letter-spacing: -.01em; color: var(--brand-ink); }
.ticker { display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding: 3px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg); font: 600 12px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); flex: none; }
.ticker.idle::before { background: var(--line-2); } .ticker:hover { border-color: var(--ink); }
.ticker .digit { display: inline-block; }
.topnav { display: flex; gap: 2px; margin-left: auto; }
.topnav a { padding: 6px 10px; text-decoration: none; color: var(--muted); font: 700 13px/1 var(--sign); letter-spacing: .12em; text-transform: uppercase; border-bottom: 2px solid transparent; }
.topnav a:hover { color: var(--ink); } .topnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--stripe); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar .btn.primary { white-space: nowrap; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; background: transparent; border-radius: 50%; color: var(--ink-2); } .icon-btn:hover { background: var(--bg-2); }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--bg); font: 700 13px/1 var(--sign); letter-spacing: .06em; }
.user-menu { position: relative; }
.pop { position: absolute; right: 0; top: calc(100% + 8px); width: 248px; padding: 6px; background: var(--surface); border: 1px solid var(--ink); box-shadow: var(--shadow-lg); z-index: 60; }
.pop .who { padding: 8px 10px 10px; display: grid; gap: 1px; border-bottom: 1.5px dashed var(--line-2); margin-bottom: 4px; } .pop .who span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.pop a, .pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; text-align: left; text-decoration: none; color: var(--ink); font-size: 14px; border-radius: 2px; } .pop a:hover, .pop button:hover { background: var(--bg-2); }
.pop hr { border: 0; border-top: 1.5px dashed var(--line-2); margin: 4px 0; }
.main { flex: 1; width: 100%; max-width: var(--page-w); margin: 0 auto; padding: 28px var(--gutter) 56px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; } .page-head .sub { color: var(--muted); margin-top: 6px; max-width: 60ch; }
.foot { max-width: var(--page-w); width: 100%; margin: 0 auto; padding: 18px var(--gutter) 24px; border-top: 1.5px dashed var(--line-2); display: flex; gap: 8px 20px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.foot a { color: var(--muted); } .foot .sp { margin-left: auto; }
#app > * { animation: rise .35s ease-out both; } #app.settled > * { animation: none; }
#app > *:nth-child(2) { animation-delay: .05s; } #app > *:nth-child(3) { animation-delay: .1s; } #app > *:nth-child(n+4) { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1.5px dashed var(--line-2); grid-template-columns: repeat(5, 1fr); }
.tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--muted); text-decoration: none; font: 700 10.5px/1 var(--sign); letter-spacing: .12em; text-transform: uppercase; min-height: 44px; }
.tabbar .i { width: 22px; height: 22px; } .tabbar [aria-current="page"], .tabbar .current { color: var(--ink); }
.tabbar [aria-current="page"] .i { color: var(--brand-ink); }
.tabbar .tab-new span.plus { display: grid; place-items: center; width: 46px; height: 46px; margin-top: -22px; border-radius: 50%; background: var(--brand); color: var(--on-brand); border: 3px solid var(--surface); }
.tabbar .tab-new { color: var(--ink); }
.more-sheet { position: fixed; inset: 0; z-index: 70; background: var(--scrim); display: flex; align-items: flex-end; }
.more-sheet .sheet { width: 100%; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 2px solid var(--ink); display: grid; gap: 2px; animation: sheet .2s ease-out; }
.more-sheet .sheet a, .more-sheet .sheet button { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 6px; border: 0; background: none; text-align: left; text-decoration: none; color: var(--ink); font-size: 16px; border-bottom: 1px dashed var(--line); }
@keyframes sheet { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 860px) {
  :root { --gutter: 16px; }
  .topnav, .topbar .top-cta { display: none; } .tabbar { display: grid; }
  .topbar-actions { margin-left: auto; } .ticker { max-width: 46vw; }
  .main { padding-top: 20px; padding-bottom: calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom)); }
  .foot { padding-bottom: calc(var(--tabbar-h) + 20px + env(safe-area-inset-bottom)); }
}
@media (max-width: 400px) { .brand .wm { display: none; } }
@media (max-width: 600px) { .ticker { max-width: 62vw; font-size: 11px; letter-spacing: .05em; padding: 3px 10px; } }
@media (min-width: 861px) and (max-width: 1060px) { .topnav a { padding: 6px 6px; letter-spacing: .08em; } .topbar-in { gap: 12px; } .ticker { font-size: 11px; letter-spacing: .05em; } }

/* ---------- banners ---------- */
#banners:empty { display: none; } #banners { display: grid; gap: 10px; margin-bottom: 18px; }
.banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--warn); border-left: 5px solid var(--warn); background: var(--warn-soft); font-size: 14.5px; }
.banner.bad { border-color: var(--bad); background: var(--bad-soft); } .banner.info { border-color: var(--info); background: var(--info-soft); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1.5px solid var(--ink); border-radius: var(--radius); background: transparent; color: var(--ink); font: 700 14px/1 var(--sign); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: background .15s, transform .08s; }
.btn:hover { background: var(--bg-2); } .btn:active { transform: translateY(1px); }
.btn.primary, .btn.cta { background: var(--brand); border-color: var(--brand); color: var(--on-brand); } .btn.primary:hover, .btn.cta:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn.quiet { border-color: transparent; padding: 0 10px; color: var(--brand-ink); } .btn.quiet:hover { background: var(--brand-soft); }
.btn.danger { border-color: var(--bad); color: var(--bad-ink); } .btn.danger:hover { background: var(--bad-soft); }
.btn.danger.solid { background: var(--bad); color: #fff; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 12.5px; } .btn.lg { min-height: 52px; padding: 0 28px; font-size: 15px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn[aria-busy="true"] { position: relative; color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"]::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid var(--on-brand); border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn:not(.primary)[aria-busy="true"]::after { border-color: var(--ink); border-top-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--brand-ink); text-decoration: none; border-bottom: 1.5px solid currentColor; padding-bottom: 1px; } .link-arrow:hover { gap: 10px; }
.link-arrow { transition: gap .15s; }

/* ---------- the rubber stamp ---------- */
.stamp { display: inline-block; padding: 3px 9px 2px; border: 2px solid currentColor; border-radius: 3px; box-shadow: inset 0 0 0 1px var(--surface), inset 0 0 0 2px color-mix(in srgb, currentColor 45%, transparent);
  font: 800 12px/1.15 var(--sign); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); background: transparent; transform: rotate(-2.5deg); white-space: nowrap; mix-blend-mode: normal; opacity: .96; }
.stamp.packed { color: var(--ok-ink); } .stamp.missing { color: var(--bad-ink); } .stamp.partial, .stamp.extra, .stamp.check { color: var(--warn-ink); }
.stamp.optional, .stamp.unknown, .stamp.none { color: var(--muted); border-style: dashed; }
.stamp.partial { transform: rotate(1.8deg); } .stamp.extra { transform: rotate(-4deg); } .stamp.missing { transform: rotate(-3.5deg); }
.stamp.lg { font-size: 16px; padding: 5px 13px 4px; letter-spacing: .2em; } .stamp.sm { font-size: 10.5px; padding: 2px 6px 1px; letter-spacing: .12em; border-width: 1.5px; }
.stamp.flat { transform: none; }
.stamp.land { animation: thunk .42s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes thunk { 0% { transform: scale(1.9) rotate(-9deg); opacity: 0; } 55% { transform: scale(.94) rotate(-2.5deg); opacity: 1; } 100% { transform: scale(1) rotate(-2.5deg); } }
/* evidence stamps: smaller, never rotated, a different shape (pill) so they cannot be mistaken for a status */
.stamp.ev { transform: none; border-radius: 999px; padding: 1px 8px; font-size: 10.5px; letter-spacing: .1em; border-width: 1.5px; box-shadow: none; }
.stamp.ev.observed { color: var(--brand-ink); } .stamp.ev.confirmed { color: var(--ok-ink); } .stamp.ev.possible { color: var(--warn-ink); border-style: dashed; } .stamp.ev.not_verifiable { color: var(--muted); border-style: dotted; }

/* ---------- paper tag, airmail border, punched hole ---------- */
.tag { position: relative; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 20px 22px; }
.tag.punched { padding-left: 54px; }
.tag.punched::before { content: ""; position: absolute; left: 16px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--line-2); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18); }
.airmail { border: 7px solid transparent; border-image: repeating-linear-gradient(-45deg, var(--stripe) 0 11px, var(--surface) 11px 22px, var(--brand) 22px 33px, var(--surface) 33px 44px) 7; background: var(--surface); position: relative; }
.airmail-thin { border-width: 4px; border-image-width: 4px; }
.band-airmail { height: 7px; background: repeating-linear-gradient(-45deg, var(--stripe) 0 11px, var(--surface) 11px 22px, var(--brand) 22px 33px, var(--surface) 33px 44px); }
.tag-string { position: absolute; left: 24px; top: -26px; width: 2px; height: 34px; background: var(--ink-2); transform: rotate(14deg); transform-origin: bottom; opacity: .55; }

/* ---------- the tag strip (a list row) ---------- */
.strips { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.strip { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 4px 12px; padding: 9px 12px 9px 14px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--line-2); border-radius: var(--radius-sm); min-height: 52px; }
.strip[data-status="packed"] { border-left-color: var(--ok); } .strip[data-status="missing"] { border-left-color: var(--bad); }
.strip[data-status="partial"], .strip[data-status="extra"] { border-left-color: var(--warn); }
.strip.link { text-decoration: none; color: inherit; } a.strip:hover, .strip.hover:hover { border-color: var(--ink); }
.strip-main { min-width: 0; } .strip-label { font-weight: 600; overflow-wrap: anywhere; }
.strip-sub { font-size: 13px; color: var(--muted); display: flex; gap: 4px 10px; flex-wrap: wrap; align-items: center; }
.strip-qty { font: 600 13px/1 var(--mono); color: var(--ink-2); white-space: nowrap; }
.strip.done .strip-label { text-decoration: line-through; color: var(--muted); }
.strip-reasons { grid-column: 2 / -1; font-size: 13px; color: var(--muted); }
.strip-reasons summary { cursor: pointer; list-style: none; font: 700 11.5px/1 var(--sign); letter-spacing: .12em; text-transform: uppercase; color: var(--brand-ink); padding: 4px 0; }
.strip-reasons summary::-webkit-details-marker { display: none; } .strip-reasons[open] summary::after { content: " ×"; }
.strip-reasons ul { margin: 4px 0 2px 16px; padding: 0; }
.strip-tick { width: 28px; height: 28px; margin: 0; accent-color: var(--ok); cursor: pointer; }
.strip-menu { grid-column: -2; }
@media (max-width: 520px) { .strip { grid-template-columns: auto minmax(0, 1fr) auto; } .strip .strip-qty { display: none; } }

/* ---------- three-column tag board ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 22px; align-items: start; }
.board-col { display: grid; gap: 8px; align-content: start; min-width: 0; }
.board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 2px solid var(--ink); font: 800 14px/1 var(--sign); letter-spacing: .16em; text-transform: uppercase; }
.board-head .code { letter-spacing: .04em; }
@media (max-width: 960px) { .board { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; } .field > label, .field > .lab, legend.lab { font: 700 12px/1.2 var(--sign); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.field .hint { font-size: 13px; color: var(--muted); } .field .err, .err { font-size: 13.5px; color: var(--bad-ink); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
input[type="text"], input[type="search"], input[type="email"], input[type="number"], input[type="date"], input[type="password"], select, textarea { width: 100%; min-height: 46px; padding: 9px 12px; border: 1.5px solid var(--line-2); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
textarea { min-height: 96px; resize: vertical; } input:hover, select:hover, textarea:hover { border-color: var(--ink-2); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--ink); } [aria-invalid="true"] { border-color: var(--bad) !important; }
input::placeholder, textarea::placeholder { color: var(--faint); }
.seg { display: inline-flex; flex-wrap: wrap; border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden; background: var(--surface); max-width: 100%; }
.seg label { position: relative; cursor: pointer; } .seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; font: 700 13px/1 var(--sign); letter-spacing: .1em; text-transform: uppercase; border-right: 1px dashed var(--line-2); }
.seg label:last-child span { border-right: 0; } .seg input:checked + span { background: var(--ink); color: var(--bg); } .seg input:focus-visible + span { box-shadow: inset 0 0 0 3px var(--brand); }
.seg.block { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; } .seg.block span { justify-content: center; text-align: center; border-right: 1px dashed var(--line-2); }
.choice-notes { display: grid; gap: 6px; }
.opt { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: start; padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.opt:hover { border-color: var(--ink-2); } .opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.opt input { margin: 4px 0 0; accent-color: var(--brand); width: 18px; height: 18px; } .opt b { font-weight: 700; } .opt small { grid-column: 2; color: var(--muted); font-size: 13.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; } .chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1.5px dashed var(--line-2); border-radius: 999px; background: var(--surface); font-size: 14.5px; font-weight: 600; }
.chip:hover span { border-color: var(--ink-2); } .chip input:checked + span { border-style: solid; border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.chip input:checked + span::before { content: "✓"; font-weight: 800; } .chip input:focus-visible + span { box-shadow: var(--ring); }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--surface); }
.stepper button { width: 44px; height: 44px; border: 0; background: none; font-size: 20px; font-weight: 700; } .stepper button:hover { background: var(--bg-2); } .stepper button[disabled] { opacity: .35; }
.stepper output { min-width: 44px; text-align: center; font: 700 17px/1 var(--mono); }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; } .switch input { position: absolute; opacity: 0; }
.switch .track { width: 44px; height: 26px; flex: none; border: 1.5px solid var(--ink-2); border-radius: 999px; background: var(--bg-2); position: relative; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: var(--ink-2); transition: transform .15s, background .15s; }
.switch input:checked + .track { background: var(--brand); border-color: var(--brand); } .switch input:checked + .track::after { transform: translateX(18px); background: var(--on-brand); }
.switch input:focus-visible + .track { box-shadow: var(--ring); } .switch .sw-t { display: grid; } .switch .sw-t small { color: var(--muted); font-size: 13px; }
.combo { position: relative; } .combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; list-style: none; margin: 0; padding: 4px; background: var(--surface); border: 1.5px solid var(--ink); box-shadow: var(--shadow-lg); max-height: 280px; overflow: auto; }
.combo-list li { padding: 10px 12px; cursor: pointer; border-radius: 2px; display: grid; } .combo-list li small { color: var(--muted); } .combo-list li[aria-selected="true"], .combo-list li:hover { background: var(--brand-soft); } .combo-list li.msg { cursor: default; color: var(--muted); }
.picked { display: inline-flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border: 1.5px solid var(--brand); background: var(--brand-soft); border-radius: var(--radius); font-weight: 600; max-width: 100%; }
.progress-steps { display: flex; gap: 0; list-style: none; margin: 0 0 24px; padding: 0; counter-reset: s; }
.progress-steps li { flex: 1; counter-increment: s; position: relative; padding-top: 14px; border-top: 3px solid var(--line-2); font: 700 12px/1.2 var(--sign); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-right: 6px; }
.progress-steps li::before { content: "0" counter(s) " · "; font-family: var(--mono); } .progress-steps li.on { border-color: var(--ink); color: var(--ink); } .progress-steps li.done { border-color: var(--brand); color: var(--brand-ink); }
@media (max-width: 560px) { .progress-steps li { font-size: 0; } .progress-steps li::before { font-size: 12px; } .progress-steps li.on::after { content: attr(data-name); font-size: 12px; } }

/* ---------- tables, ledger ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 15px; }
table.t th { text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--ink); font: 700 12px/1.2 var(--sign); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
table.t th.sortable { cursor: pointer; } table.t th[aria-sort="ascending"]::after { content: " ↑"; } table.t th[aria-sort="descending"]::after { content: " ↓"; }
table.t td { padding: 11px 10px; border-bottom: 1px dashed var(--line-2); vertical-align: middle; } table.t th:first-child, table.t td:first-child { padding-left: 0; }
table.t tr.clickable { cursor: pointer; } table.t tbody tr:hover { background: var(--bg-2); } table.t .num { text-align: right; font-variant-numeric: tabular-nums; }
.pagebar { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.ledger { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.ledger li > a, .ledger li > div { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto auto; gap: 4px 14px; align-items: center; padding: 11px 2px; border-bottom: 1px dashed var(--line-2); text-decoration: none; color: inherit; }
.ledger li > a:hover { background: var(--bg-2); } .ledger .when { font: 600 12.5px/1 var(--mono); color: var(--muted); letter-spacing: .04em; text-transform: uppercase; } .ledger .what { font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 560px) { .ledger li > a, .ledger li > div { grid-template-columns: minmax(0, 1fr) auto; } .ledger .when { grid-column: 1 / -1; } }

/* ---------- dialog, toast, skeleton, empty ---------- */
.scrim { position: fixed; inset: 0; z-index: 80; background: var(--scrim); display: grid; place-items: center; padding: 16px; animation: fade .15s; } @keyframes fade { from { opacity: 0; } }
.dialog { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 22px 24px; animation: pop .18s ease-out; }
.dialog.wide { width: min(740px, 100%); } .dialog .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; border-top: 1.5px dashed var(--line-2); padding-top: 16px; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.secret { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--bg-2); border: 1px dashed var(--ink-2); font: 600 14px/1.4 var(--mono); overflow-wrap: anywhere; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--ink); color: var(--bg); border-left: 5px solid var(--info); font-size: 14.5px; animation: pop .2s ease-out; }
.toast.ok { border-left-color: var(--ok); } .toast.bad { border-left-color: var(--bad); } .toast.warn { border-left-color: var(--warn); }
.toast a { color: inherit; } .toast .body { flex: 1; min-width: 0; overflow-wrap: anywhere; } .toast .x { border: 0; background: none; color: inherit; opacity: .7; padding: 2px; }
@media (max-width: 860px) { .toasts { left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom)); max-width: none; } }
.skel { position: relative; overflow: hidden; background: var(--bg-2); border-radius: 2px; min-height: 14px; }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent); animation: shimmer 1.4s infinite; } @keyframes shimmer { to { transform: translateX(100%); } }
.skel.line { height: 14px; margin: 8px 0; } .skel.tag { height: 240px; border: 1px solid var(--line); } .skel.strip { height: 54px; } .skel.chart { height: 200px; } .skel.title { height: 44px; width: min(380px, 70%); }
.empty { padding: 36px 0; color: var(--muted); max-width: 52ch; } .empty .big { width: 52px; height: 52px; margin-bottom: 14px; display: grid; place-items: center; border: 2px dashed var(--line-2); border-radius: 50%; color: var(--ink-2); } .empty .big svg { width: 26px; height: 26px; }
.empty h3 { color: var(--ink); font-size: 22px; margin-bottom: 6px; } .empty p { margin-bottom: 14px; }
.badge { display: inline-block; padding: 1px 8px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg-2); }

/* ---------- the next-departure tag (dashboard) ---------- */
.depart { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 0; }
.depart-main { padding: 26px 30px 26px 54px; position: relative; } .depart-side { padding: 26px 28px; border-left: 1.5px dashed var(--line-2); display: grid; gap: 14px; align-content: center; }
.depart-main::before { content: ""; position: absolute; left: 18px; top: 28px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--line-2); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .2); }
.depart h2.dest { font-size: clamp(38px, 6.2vw, 68px); line-height: .98; letter-spacing: -.035em; margin: 10px 0 8px; overflow-wrap: anywhere; }
.depart .route { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.depart .count { font: 800 clamp(40px, 5vw, 56px)/1 var(--sign); letter-spacing: -.01em; } .depart .count small { font: 700 13px/1 var(--sign); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); display: block; margin-top: 6px; }
.depart .stats { display: flex; gap: 22px; flex-wrap: wrap; } .depart .stats b { display: block; font: 800 26px/1 var(--sign); } .depart .stats span { font: 700 11.5px/1.2 var(--sign); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 760px) { .depart { grid-template-columns: 1fr; } .depart-side { border-left: 0; border-top: 1.5px dashed var(--line-2); padding: 20px 16px; } .depart-main { padding: 18px 10px 18px 36px; } .depart-main::before { left: 8px; top: 22px; width: 14px; height: 14px; } }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px 40px; align-items: start; } @media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 10px; } .section-h h2 { font: 800 13px/1 var(--sign); letter-spacing: .18em; text-transform: uppercase; }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; list-style: none; margin: 18px 0 0; padding: 0; }
.steps3 li { padding: 0 18px 0 0; margin-right: 18px; border-right: 1.5px dashed var(--line-2); } .steps3 li:last-child { border: 0; margin: 0; padding: 0; }
.steps3 .n { font: 800 34px/1 var(--mono); color: var(--stripe); } .steps3 b { display: block; margin: 6px 0 2px; font-size: 17px; } .steps3 span { color: var(--muted); font-size: 14.5px; }
@media (max-width: 640px) { .steps3 { grid-template-columns: 1fr; gap: 14px; } .steps3 li { border: 0; border-bottom: 1.5px dashed var(--line-2); padding: 0 0 14px; margin: 0; } }
.spark { display: block; width: 100%; height: auto; max-height: 90px; overflow: visible; } .spark path { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--surface); stroke: var(--brand); stroke-width: 2; }
.tripstrip { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line-2); border-left: 5px solid var(--brand); border-radius: var(--radius-sm); position: relative; text-decoration: none; color: inherit; }
.tripstrip:hover { border-color: var(--ink); border-left-color: var(--brand); } .tripstrip .nm { font-weight: 700; font-size: 17px; overflow-wrap: anywhere; } .tripstrip .when { font-size: 13.5px; color: var(--muted); }
.tripstrip.past { border-left-color: var(--line-2); opacity: .92; } .tripstrip.underway { border-left-color: var(--stripe); }
.tripstrip .acts { display: flex; align-items: center; gap: 8px; }
.grouphead { display: flex; align-items: center; gap: 12px; margin: 26px 0 10px; } .grouphead h2 { font: 800 13px/1 var(--sign); letter-spacing: .18em; text-transform: uppercase; } .grouphead::after { content: ""; flex: 1; border-top: 1.5px dashed var(--line-2); }
.grouphead .code { order: 2; } .grouphead::after { order: 3; }
.attrib { font-size: 12.5px; color: var(--muted); }
.callout { padding: 12px 14px; border: 1px dashed var(--line-2); background: var(--surface-2); font-size: 14.5px; }
.callout.warn { border-color: var(--warn); background: var(--warn-soft); }
.cardlist { display: grid; gap: 8px; }
.sumgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 24px; } .sumgrid dt { font: 700 11.5px/1 var(--sign); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; } .sumgrid dd { margin: 0; font-weight: 700; font-size: 18px; }

/* ---------- in-app camera: a dark viewfinder in both themes ---------- */
body.cam-open { overflow: hidden; }
.cam { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: black; color: white; }
.cam-panel { position: relative; width: 100%; height: 100%; background: black; overflow: hidden; }
.cam-stage { position: absolute; inset: 0; } .cam-video { width: 100%; height: 100%; object-fit: cover; display: block; background: black; } .cam-video.mirror { transform: scaleX(-1); }
.cam-guide { position: absolute; inset: 12% 10% 22%; border: 1.5px dashed rgba(255, 255, 255, .75); display: grid; align-items: start; justify-items: center; pointer-events: none; }
.cam-guide span { margin-top: 8px; padding: 6px 10px; background: rgba(0, 0, 0, .55); font: 700 13px/1.3 var(--sign); letter-spacing: .08em; text-transform: uppercase; text-align: center; }
.cam-count { position: absolute; inset: 0; display: none; place-items: center; font: 800 min(40vw, 240px)/1 var(--sign); text-shadow: 0 2px 24px rgba(0, 0, 0, .6); pointer-events: none; } .cam-count.on { display: grid; }
.cam-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: max(14px, env(safe-area-inset-top)) 14px 24px; background: linear-gradient(rgba(0, 0, 0, .55), transparent); }
.cam-hint { padding: 8px 12px; background: rgba(0, 0, 0, .55); font: 600 14px/1.3 var(--font); } .cam-hint:empty { display: none; }
.cam-hint[data-state="good"]::before, .cam-hint[data-state="dark"]::before, .cam-hint[data-state="bright"]::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; background: rgb(79, 217, 160); }
.cam-hint[data-state="dark"]::before, .cam-hint[data-state="bright"]::before { background: rgb(255, 194, 77); }
.cam-tools { display: flex; gap: 10px; }
.cam-btn { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .5); background: rgba(0, 0, 0, .5); color: white; } .cam-btn .i { width: 22px; height: 22px; } .cam-btn[aria-pressed="true"] { background: white; color: black; }
.cam-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 24px 14px max(22px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0, 0, 0, .6)); }
.cam-timer { display: flex; gap: 6px; } .cam-chip { min-height: 40px; min-width: 44px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .5); background: rgba(0, 0, 0, .5); color: white; font: 700 13px/1 var(--sign); } .cam-chip[aria-pressed="true"] { background: white; color: black; }
.cam-shutter { width: 76px; height: 76px; border-radius: 50%; border: 3px solid white; background: transparent; padding: 4px; display: grid; place-items: center; } .cam-shutter span { width: 100%; height: 100%; border-radius: 50%; background: var(--brand); transition: transform .1s; }
.cam-shutter:active span { transform: scale(.88); } .cam-shutter.busy span { border-radius: 8px; transform: scale(.55); }
.cam-btn:focus-visible, .cam-chip:focus-visible, .cam-shutter:focus-visible { outline: 3px solid white; outline-offset: 3px; box-shadow: 0 0 0 6px black; }
@media (min-width: 900px) { .cam { background: rgba(0, 0, 0, .78); } .cam-panel { width: min(960px, 92vw); height: min(720px, 90vh); border-radius: 4px; } .cam-guide { inset: 8% 24% 16%; } }
@media (max-width: 640px) { .cam-timer { grid-column: 1 / -1; grid-row: 1; justify-content: center; } .cam-bottom { grid-template-columns: 1fr; justify-items: center; } .cam-spacer { display: none; } }

/* ---------- charts (shared helpers) ---------- */
.chart { position: relative; width: 100%; min-height: 120px; } .chart svg { display: block; overflow: visible; max-width: 100%; } .chart text { fill: var(--muted); font-size: 11px; font-family: var(--mono); }
.chart .grid-line { stroke: var(--line-2); stroke-dasharray: 3 4; shape-rendering: crispEdges; } .chart .axis-line { stroke: var(--ink); shape-rendering: crispEdges; } .chart .bar { transition: opacity .15s; fill: var(--brand); } .chart .bar.dim { opacity: .45; }
.chart-tip { position: absolute; pointer-events: none; z-index: 5; min-width: 130px; max-width: 260px; padding: 8px 10px; font-size: 13px; background: var(--ink); color: var(--bg); opacity: 0; transition: opacity .1s; } .chart-tip.on { opacity: 1; } .chart-tip .tr { display: flex; justify-content: space-between; gap: 14px; }
.chart-msg { display: grid; place-items: center; text-align: center; color: var(--muted); min-height: 140px; padding: 20px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }
@media print { .topbar, .tabbar, .foot, .toasts { display: none; } body { background: #fff; } }

.cam.flash .cam-stage { opacity: .35; }
body[data-page="newtrip"] .top-cta, body[data-page="newtrip"] .tab-new { display: none; }
@media (max-width: 860px) { body[data-page="newtrip"] .tabbar { grid-template-columns: repeat(4, 1fr); } }
.wizard { display: grid; grid-template-columns: minmax(0, 680px) minmax(240px, 320px); gap: 56px; align-items: start; justify-content: start; }
.wizard .live { position: sticky; top: calc(var(--bar-h) + 24px); transform: rotate(1.2deg); padding: 22px 22px 22px 54px; }
.live-code { font: 800 56px/1 var(--sign); letter-spacing: .04em; margin: 6px 0 2px; } .live-dest { font: 800 22px/1.15 var(--font); overflow-wrap: anywhere; }
@media (max-width: 960px) { .wizard { grid-template-columns: 1fr; } .wizard .live { display: none; } }
