/* Reacal, "paper and ink". White page, near-black type, color only for entry types and status.
   Every size is in rem (design px / 16) so the whole app scales with the phone's text size and the in-app Text size control.
   The only px values are 1px hairlines and stroke widths. */
:root {
  --bg: #FFFFFF; --surface: #FFFFFF; --surface-sunken: #F5F6F8;
  --line: #ECEEF1; --line-strong: #D5D9DF;
  --ink: #141A22; --ink-2: #4A5361; --ink-3: #6B7380; --on-ink: #FFFFFF;
  --danger: #B42318; --success: #2E7D4F; --warning: #8A6100;
  --show-bg: #E7F2EA; --show-fg: #2F6B47;
  --insp-bg: #F2EAE2; --insp-fg: #7A5536;
  --task-bg: #FAF1D3; --task-fg: #7A5D12;
  --due-bg:  #FBE8E6; --due-fg:  #A3352B;
  --list-bg: #E7EEFA; --list-fg: #2F5597;
  --meet-bg: #EFE9F7; --meet-fg: #5F4592;
  --pers-bg: #F1F2F4; --pers-fg: #59616D;
  --other-bg: transparent; --other-fg: #4A5361;
  --scrim: rgba(14,17,22,.40);
  --shadow: 0 0.5rem 2rem rgba(20,26,34,.12);
  --r-sm: 0.375rem; --r-md: 0.625rem; --r-lg: 1.25rem;
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1116; --surface: #161A21; --surface-sunken: #1B2028;
    --line: #232933; --line-strong: #323A46;
    --ink: #ECEFF3; --ink-2: #B2B9C4; --ink-3: #8A93A0; --on-ink: #0E1116;
    --danger: #FF8A7A; --success: #7BD49C; --warning: #E3C866;
    --show-bg: #15291D; --show-fg: #8FD1A6;
    --insp-bg: #2C2219; --insp-fg: #D9B48E;
    --task-bg: #2C2613; --task-fg: #E3C866;
    --due-bg:  #331B19; --due-fg:  #F29B91;
    --list-bg: #172540; --list-fg: #9DBCF0;
    --meet-bg: #251E3A; --meet-fg: #C3ADF0;
    --pers-bg: #1E2229; --pers-fg: #A7AFBA;
    --other-fg: #B2B9C4;
    --scrim: rgba(0,0,0,.55); --shadow: 0 0.5rem 2rem rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

/* Follow the phone's text size (iOS Dynamic Type), then the system font. */
html { font: -apple-system-body; font-family: var(--font-ui); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font-ui);
  font-size: 0.9375rem; line-height: 1.375rem; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top, 0px) 1rem calc(7rem + env(safe-area-inset-bottom, 0px));
}
.app { max-width: 28.75rem; margin: 0 auto; display: flex; flex-direction: column; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; margin: 0; text-align: inherit; }
button:disabled { cursor: default; }
a { color: inherit; }
svg { display: block; flex: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Type ---------- */
.title { margin: 0; font-size: 1.5rem; line-height: 1.875rem; font-weight: 600; letter-spacing: -.01em; }
.heading { margin: 0; font-size: 1.0625rem; line-height: 1.5rem; font-weight: 500; }
.small { font-size: 0.8125rem; line-height: 1.125rem; }
.caption { font-size: 0.75rem; line-height: 1rem; font-weight: 500; color: var(--ink-3); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.ok-text { color: var(--success); }
.bad-text { color: var(--danger); }
.warn-text { color: var(--warning); }

/* ---------- Buttons ---------- */
.btn {
  min-height: 2.75rem; padding: 0 1rem; border-radius: var(--r-md); border: 1px solid var(--line-strong);
  color: var(--ink); font-size: 0.9375rem; line-height: 1.25rem; font-weight: 500; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; text-align: center;
}
.btn svg { width: 1.125rem; height: 1.125rem; }
.btn:active { background: var(--surface-sunken); }
.btn.primary { width: 100%; min-height: 3.25rem; border: 0; background: var(--ink); color: var(--on-ink); font-size: 1rem; padding: 0.5rem 1rem; }
.btn.primary svg { width: 1.25rem; height: 1.25rem; }
.btn.primary:disabled { opacity: .6; }
.btn.recording { border-color: var(--danger); color: var(--danger); }
.tert {
  min-height: 2.75rem; padding: 0 0.5rem; color: var(--ink-2); font-weight: 500; font-size: 0.9375rem; line-height: 1.25rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem; text-decoration: none; border-radius: var(--r-md);
}
.tert:active { background: var(--surface-sunken); }
.tert svg { width: 1rem; height: 1rem; }
.tert.danger { color: var(--danger); }
.tert.ink { color: var(--ink); }
.icon-btn { width: 2.75rem; height: 2.75rem; border-radius: 999px; display: grid; place-items: center; color: var(--ink-2); flex: none; text-decoration: none; }
.icon-btn svg { width: 1.375rem; height: 1.375rem; }
.icon-btn:active { background: var(--surface-sunken); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.btn-row > .btn { flex: 1 1 6.5rem; }

/* ---------- Header ---------- */
header.top { position: sticky; top: 0; z-index: 5; background: var(--bg); min-height: 4rem; display: flex; align-items: center; gap: 0.25rem; margin: 0 -0.75rem 0 -0.75rem; padding: 0.25rem 0; }
.datenav { flex: 1; min-width: 0; display: flex; align-items: center; }
.date { min-width: 0; padding: 0 0.125rem; }
.date .eyebrow { display: block; font-size: 0.75rem; line-height: 1rem; font-weight: 500; color: var(--ink-3); }
.date .eyebrow button { color: var(--ink); text-decoration: underline; text-underline-offset: 0.1875rem; text-decoration-color: var(--line-strong); min-height: 1rem; }
.date h1 { margin: 0; font-size: 1.375rem; line-height: 1.75rem; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }

/* Offline / error line under the date. Silent while everything is fine. */
.status-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.5rem; min-height: 2rem; margin: -0.25rem 0 0.5rem; font-size: 0.8125rem; line-height: 1.125rem; font-weight: 500; }
.status-bar.warn { color: var(--warning); }
.status-bar.bad { color: var(--danger); }
.status-bar .tert { min-height: 2rem; padding: 0; color: inherit; text-decoration: underline; text-underline-offset: 0.1875rem; }

/* ---------- Getting started (one row) ---------- */
.setup-row { display: flex; align-items: center; gap: 0.5rem; min-height: 3rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.setup-row .tert { flex: 1; min-width: 0; justify-content: flex-start; padding: 0.5rem 0; color: var(--ink); text-align: left; }
.setup-row .tert b { font-weight: 500; color: var(--ink-3); margin-right: 0.25rem; }
.setup-row .icon-btn { margin-right: -0.625rem; }

/* ---------- Entry colors ---------- */
.c-show { --b: var(--show-bg); --f: var(--show-fg); }
.c-insp { --b: var(--insp-bg); --f: var(--insp-fg); }
.c-task { --b: var(--task-bg); --f: var(--task-fg); }
.c-due  { --b: var(--due-bg);  --f: var(--due-fg); }
.c-list { --b: var(--list-bg); --f: var(--list-fg); }
.c-meet { --b: var(--meet-bg); --f: var(--meet-fg); }
.c-pers { --b: var(--pers-bg); --f: var(--pers-fg); }
.c-other { --b: var(--other-bg); --f: var(--other-fg); }

/* ---------- Day ---------- */
.day, .dls, .stops { display: flex; flex-direction: column; gap: 0.25rem; }
.dls:not(:empty) { margin-bottom: 1.5rem; }
.sect { margin: 0 0 0.25rem 3.5rem; font-size: 0.75rem; line-height: 1rem; font-weight: 500; color: var(--ink-3); }
.item { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); column-gap: 0.75rem; align-items: start; }
.time { font-size: 0.75rem; line-height: 1rem; font-weight: 500; color: var(--ink-3); text-align: right; padding-top: 1rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.box { background: var(--b); color: var(--f); border-radius: var(--r-md); min-height: 3rem; display: flex; align-items: center; padding: 0 0.125rem 0 0.75rem; min-width: 0; }
.box.c-other { box-shadow: inset 0 0 0 1px var(--line-strong); }
.box .main { flex: 1; min-width: 0; text-align: left; padding: 0.4375rem 0.5rem 0.4375rem 0; display: flex; flex-direction: column; color: inherit; align-self: stretch; justify-content: center; }
.box .t { color: var(--ink); font-size: 0.9375rem; line-height: 1.25rem; font-weight: 500; overflow-wrap: anywhere; }
.box .s { color: var(--f); font-size: 0.8125rem; line-height: 1.125rem; overflow-wrap: anywhere; }
.box.late .s { color: var(--danger); }
.box.done .t { text-decoration: line-through; color: var(--ink-3); }
.box.cancelled { background: var(--surface-sunken); }
.box.cancelled .t { text-decoration: line-through; color: var(--ink-3); }
.box.cancelled .s { color: var(--danger); }
.icon { flex: none; width: 2.75rem; height: 2.75rem; border-radius: var(--r-md); display: grid; place-items: center; color: var(--f); text-decoration: none; }
.icon + .icon { margin-left: 0.25rem; }
.icon:active { background: rgba(127,127,127,.14); }
.icon svg { width: 1.25rem; height: 1.25rem; }
.check { width: 1.25rem; height: 1.25rem; border-radius: var(--r-sm); border: 1.5px solid var(--f); display: grid; place-items: center; color: var(--b); }
.check svg { width: 0.875rem; height: 0.875rem; }
.done .check, .check.on { background: var(--f); }
@media (prefers-reduced-motion: no-preference) { .check { transition: background-color .12s ease-out; } }

.earlier { margin: 0 0 0.25rem 3.5rem; min-height: 2.75rem; display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; font-weight: 500; color: var(--ink-3); align-self: flex-start; }
.earlier svg { width: 1rem; height: 1rem; }

/* The "now" line */
.now { position: relative; height: 0; margin: 0.5rem 0; }
.now::before { content: ""; position: absolute; left: 3.125rem; right: 0; top: 0; border-top: 1px solid var(--danger); }
.now::after { content: ""; position: absolute; left: 2.875rem; top: -0.25rem; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--danger); }
.now span { position: absolute; left: 0; top: -0.5rem; width: 2.5rem; text-align: right; font-size: 0.6875rem; line-height: 1rem; font-weight: 600; color: var(--danger); }

/* Tours */
.tour { display: flex; flex-direction: column; margin: 1.25rem 0; }
.tour-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.25rem; margin: 0 0 0.25rem 3.5rem; min-height: 2.75rem; }
.tour-head .name { flex: 1 1 6rem; min-width: 0; font-size: 1.0625rem; line-height: 1.5rem; font-weight: 500; overflow-wrap: anywhere; }
.tour-head .name span { display: block; color: var(--ink-3); font-size: 0.8125rem; line-height: 1.125rem; font-weight: 400; }
.tour-head .acts { display: flex; align-items: center; gap: 0.25rem; margin-left: auto; }
.tour-head .btn { min-height: 2.5rem; padding: 0 0.875rem; border-radius: 999px; font-size: 0.875rem; }
.tour-head .btn svg { width: 1rem; height: 1rem; }
.tour-head .icon-btn svg { width: 1.25rem; height: 1.25rem; }
.tour-head .btn.solid { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.stops { position: relative; }
.stops::before { content: ""; position: absolute; left: 3.1875rem; top: 0.5rem; bottom: 0.5rem; width: 2px; border-radius: 2px; background: var(--show-fg); opacity: .35; }
.drive { margin: 0 0 0 3.5rem; font-size: 0.75rem; line-height: 1rem; color: var(--ink-3); padding: 0.125rem 0; }
.grip { flex: none; color: var(--f); width: 2rem; height: 2.75rem; display: grid; place-items: center; touch-action: none; cursor: grab; margin-left: -0.5rem; }
.grip svg { width: 1rem; height: 1rem; }
.arrows { display: flex; gap: 0.25rem; }
.arrows button { width: 2.75rem; height: 2.75rem; border-radius: var(--r-md); display: grid; place-items: center; color: var(--f); }
.arrows button svg { width: 1.25rem; height: 1.25rem; }
.arrows button:active { background: rgba(127,127,127,.16); }
.arrows button:disabled { opacity: .3; }
.dragging { box-shadow: var(--shadow); position: relative; z-index: 3; border-radius: var(--r-md); }
@media (prefers-reduced-motion: no-preference) { .stop { transition: transform .18s ease-out; } .stop.dragging { transition: none; } }

/* Loading skeleton, empty state, sign-in */
.skel { display: grid; grid-template-columns: 2.75rem 1fr; column-gap: 0.75rem; align-items: start; }
.skel i { display: block; height: 0.75rem; width: 2rem; margin: 1.125rem 0 0 auto; border-radius: var(--r-sm); background: var(--surface-sunken); }
.skel b { display: block; height: 3rem; border-radius: var(--r-md); background: var(--surface-sunken); }
@media (prefers-reduced-motion: no-preference) { .skel { animation: pulse 1.6s ease-in-out infinite; } }
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; padding: 2rem 0 0 3.5rem; }
.empty p { margin: 0; color: var(--ink-2); }
.foot { margin: 1.5rem 0 0 3.5rem; font-size: 0.75rem; line-height: 1rem; color: var(--ink-3); }
.signin { display: flex; flex-direction: column; gap: 1rem; padding: 2rem 0; }
.signin p { margin: 0; color: var(--ink-2); }

/* Floating + */
.fab {
  position: fixed; z-index: 10; width: 3.5rem; height: 3.5rem; border-radius: 999px; background: var(--ink); color: var(--on-ink);
  display: grid; place-items: center; box-shadow: var(--shadow);
  right: max(1rem, calc(50vw - 14.375rem)); bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}
.fab svg { width: 1.625rem; height: 1.625rem; }

/* ---------- Sheets ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 30rem; max-height: 92vh; max-height: 92dvh; background: var(--surface); color: var(--ink);
  border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden;
}
.grab { flex: none; padding: 0.5rem 0 0.25rem; display: grid; place-items: center; touch-action: none; cursor: grab; }
.grab::before { content: ""; width: 2.25rem; height: 0.25rem; border-radius: 0.125rem; background: var(--line-strong); }
.sheet-head { flex: none; display: flex; align-items: flex-start; gap: 0.5rem; padding: 0 0.625rem 0 1.25rem; position: relative; touch-action: none; }
.sheet-head .htext { flex: 1; min-width: 0; padding-top: 0.5rem; }
.sheet-head h2 { margin: 0; font-size: 1.375rem; line-height: 1.75rem; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.sheet-head .meta { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.25rem; color: var(--ink-2); font-size: 0.875rem; line-height: 1.25rem; }
.sheet-head .meta i { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--f); flex: none; }
.sheet-head .icons { display: flex; flex: none; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0.5rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.sheet-body > *, .ob > * { flex-shrink: 0; }
.sheet-foot { flex: none; padding: 0.75rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.5rem; background: var(--surface); }
.sheet-foot .tert { align-self: center; }
@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: up .22s ease-out; }
  @keyframes up { from { transform: translateY(100%); } to { transform: none; } }
}
.menu { position: absolute; right: 0.75rem; top: 3rem; z-index: 2; min-width: 12rem; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow), 0 0 0 1px var(--line); padding: 0.25rem; display: flex; flex-direction: column; }
.menu button { min-height: 2.75rem; padding: 0 0.75rem; text-align: left; font-weight: 500; border-radius: var(--r-sm); display: flex; align-items: center; gap: 0.5rem; }
.menu button:active { background: var(--surface-sunken); }
.menu .danger { color: var(--danger); }

/* Detail sheet */
.mark { display: flex; align-items: center; gap: 0.75rem; min-height: 2.75rem; font-weight: 500; color: var(--ink); align-self: flex-start; }
.mark .check { width: 1.375rem; height: 1.375rem; }
.kv { margin: 0; border-top: 1px solid var(--line); }
.kv > div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); align-items: center; min-height: 3rem; border-bottom: 1px solid var(--line); gap: 0.75rem; padding: 0.5rem 0; }
.kv dt { color: var(--ink-3); font-size: 0.875rem; line-height: 1.25rem; }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.kv dd.bad { color: var(--danger); }
.kv dd.warn { color: var(--warning); }
.kv dd .tert { min-height: 2.25rem; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 0.1875rem; text-decoration-color: var(--line-strong); }
.code { font-size: 1.25rem; line-height: 1.75rem; font-weight: 500; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.code-row { display: flex; align-items: center; gap: 0.25rem; }
.code-row .icon-btn { width: 2.5rem; height: 2.5rem; }
.code-row .icon-btn svg { width: 1.125rem; height: 1.125rem; }
.instr { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1rem 0; }
.kv + .instr { border-top: 0; margin-top: -1rem; }
.instr p { margin: 0.25rem 0 0; white-space: pre-wrap; }
.media { display: flex; flex-direction: column; gap: 1rem; }
.media:empty { display: none; }
.notes { display: flex; flex-direction: column; }
.notes > div { padding: 0.75rem 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.25rem; }
.notes > div:first-child { padding-top: 0; }
.notetext { margin: 0; white-space: pre-wrap; }
.noteacts { display: flex; gap: 0.5rem; align-items: center; margin-left: -0.5rem; flex-wrap: wrap; }
.noteacts .tert { min-height: 2.25rem; font-size: 0.875rem; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.25rem; }
.thumb { position: relative; }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-md); display: block; background: var(--surface-sunken); }
.thumbdel { position: absolute; top: 0.25rem; right: 0.25rem; min-width: 1.75rem; height: 1.75rem; padding: 0 0.5rem; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: 0.8125rem; line-height: 1; display: grid; place-items: center; }
.trio { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.trio > .btn { flex: 1 1 6rem; white-space: nowrap; padding: 0 0.375rem; font-size: 0.875rem; gap: 0.375rem; }
.trio label.btn { cursor: pointer; }
.after { display: flex; flex-wrap: wrap; gap: 0 0.5rem; align-items: center; margin-left: -0.5rem; }

/* Rows used in Settings, Onboarding and Help */
.addr-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.25rem 0 1rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.addr-row b { flex: 1 1 10rem; min-width: 0; font-size: 1.0625rem; line-height: 1.5rem; font-weight: 500; overflow-wrap: anywhere; user-select: all; }
.status-line { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; line-height: 1.125rem; color: var(--ink-3); min-height: 1.5rem; flex-wrap: wrap; }
.status-line.ok { color: var(--success); font-weight: 500; }
.status-line svg { width: 1rem; height: 1rem; }
.pulse { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--ink-3); flex: none; }
@media (prefers-reduced-motion: no-preference) { .pulse { animation: pulse 1.6s ease-in-out infinite; } }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.sec { padding: 1rem 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.5rem; }
.sec:first-child { padding-top: 0.25rem; }
.sec:last-child { border-bottom: 0; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.sec .tert { align-self: flex-start; margin-left: -0.5rem; }
.status { font-size: 0.8125rem; line-height: 1.125rem; font-weight: 500; display: inline-flex; align-items: center; gap: 0.375rem; color: var(--success); }
.status .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; flex: none; }
.status.off { color: var(--ink-3); }
.status.bad { color: var(--danger); }
.recent { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.recent li { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; padding: 0.375rem 0; font-size: 0.875rem; line-height: 1.25rem; }
.recent li span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent li span:last-child { color: var(--ink-3); flex: none; font-size: 0.8125rem; }
.recent .r-failed, .recent .r-ignored { color: var(--ink-3); }
.gcode { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.radios { display: flex; flex-direction: column; }
.radio { display: flex; align-items: center; gap: 0.75rem; min-height: 3rem; border-bottom: 1px solid var(--line); text-align: left; width: 100%; }
.radio:last-child { border-bottom: 0; }
.radio .rb { width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 1.5px solid var(--ink-3); display: grid; place-items: center; flex: none; }
.radio[aria-checked="true"] .rb { border-color: var(--ink); }
.radio[aria-checked="true"] .rb::after { content: ""; width: 0.625rem; height: 0.625rem; border-radius: 50%; background: var(--ink); }
.radio span:last-child { flex: 1; min-width: 0; }
.sizes { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sizes button { flex: 1 1 4.5rem; min-height: 2.75rem; border: 1px solid var(--line-strong); border-radius: var(--r-md); font-weight: 500; display: grid; place-items: center; padding: 0.25rem 0.5rem; }
.sizes button[aria-checked="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.sizes button .aa { font-size: 0.8125rem; line-height: 1rem; }
.preview { pointer-events: none; padding-top: 0.25rem; }
.row-btn { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 2.75rem; width: 100%; text-align: left; font-weight: 500; }
.row-btn svg { width: 1.25rem; height: 1.25rem; color: var(--ink-3); }
.row-btn .sw { display: flex; gap: 0.25rem; }
.row-btn .sw i { width: 0.625rem; height: 0.625rem; border-radius: 0.1875rem; background: var(--b); box-shadow: inset 0 0 0 1px var(--f); }
.keylist { list-style: none; margin: 0; padding: 0; }
.keylist li { display: flex; align-items: center; gap: 0.75rem; min-height: 3rem; border-bottom: 1px solid var(--line); }
.keylist li:last-child { border-bottom: 0; }
.keylist i { width: 2.5rem; height: 1.5rem; border-radius: var(--r-sm); background: var(--b); box-shadow: inset 0 0 0 1.5px var(--f); flex: none; }
.keychips { display: flex; flex-wrap: wrap; gap: 0.375rem 0.5rem; }
.keychips span { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.625rem; border-radius: 999px; background: var(--b); color: var(--ink); font-size: 0.8125rem; line-height: 1.125rem; font-weight: 500; }
.keychips span::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--f); }

/* Numbered steps (help sheet) */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.5rem; }
.steps li { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); gap: 0.75rem; }
.num { width: 1.5rem; height: 1.5rem; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-3); font-size: 0.75rem; font-weight: 500; display: grid; place-items: center; }
.steps p { margin: 0; color: var(--ink-2); font-size: 0.875rem; line-height: 1.25rem; }
.steps p strong { display: block; color: var(--ink); font-weight: 500; font-size: 0.9375rem; line-height: 1.375rem; margin-bottom: 0.125rem; }
.kbd { font-weight: 500; color: var(--ink); }
.help-sec { display: flex; flex-direction: column; gap: 0.5rem; }
.help-sec p { margin: 0; color: var(--ink-2); }

/* Add / edit sheet */
.describe { position: relative; display: flex; align-items: center; }
.describe svg.spark { position: absolute; left: 0.75rem; width: 1.25rem; height: 1.25rem; color: var(--ink-3); pointer-events: none; }
.describe input { padding-left: 2.5rem !important; padding-right: 5rem !important; }
.describe .tert { position: absolute; right: 0.25rem; color: var(--ink); }
.or { display: flex; align-items: center; gap: 0.75rem; color: var(--ink-3); font-size: 0.75rem; line-height: 1rem; font-weight: 500; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.types { display: flex; gap: 0.5rem; overflow-x: auto; scrollbar-width: none; margin: 0 -1.25rem; padding: 0 1.25rem; scroll-padding: 0 1.25rem; }
.types::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 2.75rem; display: flex; align-items: center; }
.chip > span { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2.25rem; padding: 0 0.875rem; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 0.875rem; font-weight: 500; color: var(--ink); white-space: nowrap; }
.chip > span::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--f); }
.chip[aria-pressed="true"] > span { background: var(--b); border: 1.5px solid var(--f); }
.chip[aria-pressed="true"] > span::before { display: none; }
.chip svg { width: 0.875rem; height: 0.875rem; color: var(--f); }
.lock { display: flex; align-items: center; gap: 0.5rem; color: var(--ink-3); font-size: 0.8125rem; line-height: 1.125rem; font-weight: 500; }
.lock svg { width: 1rem; height: 1rem; }
.form { display: flex; flex-direction: column; gap: 1rem; }
.f { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.wrap > .f { flex: 1 1 8rem; }
.f > span { font-size: 0.75rem; line-height: 1rem; font-weight: 500; color: var(--ink-2); }
.f > span i { font-style: normal; color: var(--ink-3); font-weight: 400; }
.wrap { display: flex; flex-wrap: wrap; gap: 1rem 0.75rem; }
input[type="text"], input[type="tel"], input[type="date"], input[type="time"], textarea {
  width: 100%; min-height: 3rem; font: inherit; font-size: 1rem; line-height: 1.5rem; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 0.6875rem 0.75rem; -webkit-appearance: none; appearance: none; margin: 0;
}
input[type="date"], input[type="time"] { min-width: 0; }
textarea { resize: vertical; display: block; }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }
input:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
input:disabled { color: var(--ink-3); background: var(--surface-sunken); border-color: var(--line); }
.f.err input, .f.err textarea { border-color: var(--danger); }
.toggle { display: flex; align-items: center; gap: 0.75rem; min-height: 2.75rem; font-weight: 500; cursor: pointer; }
.toggle input { width: 1.25rem; height: 1.25rem; accent-color: var(--ink); margin: 0; }
.msg { margin: 0; font-size: 0.8125rem; line-height: 1.125rem; color: var(--ink-2); }
.msg:empty { display: none; }
.msg.bad { color: var(--danger); }
.paste textarea { min-height: 12rem; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 0.625rem 1rem; border-radius: var(--r-md); font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; z-index: 60; max-width: calc(100% - 2rem); box-shadow: var(--shadow); }

/* ---------- First-run setup ---------- */
#onboard { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: flex; flex-direction: column; }
.ob-body { flex: 1; min-height: 0; overflow-y: auto; padding: calc(1rem + env(safe-area-inset-top, 0px)) 1.25rem 1.5rem; }
.ob { max-width: 28.75rem; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.ob h2 { outline: none; }
.ob-dots { display: flex; gap: 0.375rem; margin: 0.25rem 0 0.25rem; }
.ob-dots i { width: 1.75rem; height: 0.25rem; border-radius: 0.125rem; background: var(--line); }
.ob-dots i.on { background: var(--ink); }
.ob-foot { flex: none; border-top: 1px solid var(--line); padding: 0.75rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px)); }
.ob-foot > div { max-width: 28.75rem; margin: 0 auto; display: flex; flex-direction: column; gap: 0.25rem; align-items: stretch; }
.ob-foot .tert { align-self: center; }
.provs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.provs li { display: flex; align-items: center; gap: 0.75rem; min-height: 3.75rem; border-bottom: 1px solid var(--line); padding: 0.5rem 0; flex-wrap: wrap; }
.provs .pv { flex: 1 1 10rem; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.provs .pv b { font-weight: 500; }
.provs .pv span { font-size: 0.8125rem; line-height: 1.125rem; color: var(--ink-2); }
.provs .soon { font-size: 0.8125rem; color: var(--ink-3); white-space: nowrap; }
.tip { display: flex; gap: 0.625rem; align-items: flex-start; color: var(--ink-2); font-size: 0.8125rem; line-height: 1.125rem; }
.tip svg { width: 1.125rem; height: 1.125rem; color: var(--ink-3); }
.tip strong { color: var(--ink); font-weight: 500; }
.ob-checks { display: flex; flex-direction: column; gap: 0.5rem; }
.ob-sec { display: flex; flex-direction: column; gap: 0.5rem; }
.ob-sec .tert { align-self: flex-start; margin-left: -0.5rem; }
.ob-sec p { margin: 0; color: var(--ink-2); }

/* ---------- Largest text sizes: give the entry the full width and put the time above it ---------- */
html.ts-large .item { grid-template-columns: minmax(0, 1fr); row-gap: 0.125rem; }
html.ts-large .time { text-align: left; padding: 0.375rem 0 0 0.75rem; }
html.ts-large .time:empty { display: none; }
html.ts-large .sect, html.ts-large .earlier, html.ts-large .tour-head, html.ts-large .drive, html.ts-large .empty, html.ts-large .foot { margin-left: 0; padding-left: 0; }
html.ts-large .stops { padding-left: 0.75rem; }
html.ts-large .stops::before { left: 0; }
html.ts-large .now::before { left: 3rem; }
html.ts-large .now::after { left: 2.5rem; }
html.ts-large .now span { width: 2.25rem; text-align: left; }
html.ts-large .skel { grid-template-columns: 1fr; }
html.ts-large .skel i { margin: 0.5rem 0 0.25rem; }
html.ts-large .kv > div { grid-template-columns: minmax(0, 1fr); gap: 0.125rem; }
html.ts-large header.top { align-items: flex-start; }
.row-end { display: flex; align-items: center; gap: 0.5rem; }
.hr { border-top: 1px solid var(--line); }
html.ts-large .date h1 { font-size: 1.125rem; line-height: 1.5rem; white-space: nowrap; }
html.ts-large .icon { width: 2.25rem; }
html.ts-large .recent li { flex-wrap: wrap; }
html.ts-large .recent li span:first-child { white-space: normal; }
