/* Stark Travel Desk — trip cards on a cool, airy console. Left: trip identity, middle: itinerary timeline, right: actions. */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --rail: #fafbfd;
  --sunk: #f1f4f9;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --faint: #9aa3b2;
  --line: #e6eaf1;
  --line-2: #d8dee8;
  --blue: #2b59c3;
  --blue-soft: #eef3ff;
  --blue-line: #cfdcfb;
  --violet: #6d28d9;
  --green: #0f7a43;
  --green-soft: #ecfbf2;
  --green-line: #b9ebcf;
  --amber: #b45309;
  --amber-soft: #fff7e6;
  --amber-line: #f6d69a;
  --red: #b42318;
  --red-soft: #fef1f0;
  --red-line: #f7c6c1;
  --sky: #0369a1;
  --sky-soft: #e8f5fd;
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 4px 18px rgba(17, 24, 39, .05);
  --shadow-lg: 0 20px 60px rgba(17, 24, 39, .22);
  --f: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d121a; --surface: #141b26; --rail: #121925; --sunk: #1a2331; --ink: #e8edf5; --ink-2: #c9d2df; --muted: #94a0b2;
    --faint: #6f7b8e; --line: #232e3e; --line-2: #2d3a4d; --blue: #8fb0ff; --blue-soft: #1a2640; --blue-line: #2f4675;
    --violet: #b79cff; --green: #5fd598; --green-soft: #12291e; --green-line: #1f5a3c; --amber: #f3b65b; --amber-soft: #2c2312;
    --amber-line: #5c4419; --red: #ff958b; --red-soft: #2f1716; --red-line: #6a2a25; --sky: #7cc8f2; --sky-soft: #11283a;
    --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 20px 60px rgba(0,0,0,.6); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--f); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.boot { padding: 40vh 16px; text-align: center; color: var(--muted); }

/* ---------- shell ---------- */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1440px; margin: 0 auto; padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: 8px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--blue); display: grid; place-items: center; color: #fff; }
.brand-mark svg { width: 18px; height: 18px; }
.brand b { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; line-height: 1.1; }
nav.tabs { display: flex; gap: 2px; }
nav.tabs button { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; font-weight: 600; color: var(--muted); }
nav.tabs button[aria-current="page"] { background: var(--blue-soft); color: var(--blue); }
nav.tabs button:hover { color: var(--ink); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sync-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.sync-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.sync-chip.ok i { background: #22c55e; }
.sync-chip.bad i { background: #ef4444; }
main { max-width: 1440px; margin: 0 auto; padding: 20px max(16px, env(safe-area-inset-right)) 60px max(16px, env(safe-area-inset-left)); display: grid; gap: 18px; }
h1.page { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head p { margin: 2px 0 0; color: var(--muted); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); padding: 8px 14px; border-radius: 10px; font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--blue-line); color: var(--ink); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); color: #fff; }
.btn.soft { background: var(--blue-soft); border-color: var(--blue-line); color: var(--blue); }
.btn.wa { background: var(--surface); border-color: var(--green-line); color: var(--green); }
.btn.wa:hover { background: var(--green-soft); }
.btn.wa-solid { background: #128c4b; border-color: #128c4b; color: #fff; }
.btn.danger { color: var(--red); border-color: var(--red-line); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn { border: 0; background: transparent; color: var(--faint); padding: 6px; border-radius: 8px; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--sunk); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- setup banner & stats ---------- */
.setup { background: var(--surface); border: 1px solid var(--blue-line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 10px; }
.setup h2 { margin: 0; font-size: 14px; }
.setup ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.setup li { display: flex; gap: 10px; align-items: start; padding: 10px 12px; border-radius: 10px; background: var(--sunk); }
.setup li .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center; margin-top: 1px; }
.setup li.done .dot { background: #22c55e; border-color: #22c55e; color: #fff; }
.setup li.done .dot svg { width: 12px; height: 12px; }
.setup li b { display: block; font-size: 13px; }
.setup li span { font-size: 12.5px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 2px; box-shadow: var(--shadow); }
.stat .k { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.stat .v { font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat .s { font-size: 12.5px; color: var(--muted); }
.stat.warn .v { color: var(--amber); }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- filters ---------- */
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search { position: relative; flex: 1 1 280px; min-width: 0; }
.search input { width: 100%; padding: 9px 12px 9px 36px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); }
.seg-ctl { display: inline-flex; background: var(--sunk); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg-ctl button { border: 0; background: transparent; padding: 6px 11px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.seg-ctl button .n { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.seg-ctl button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
select.sel { padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }

/* ---------- trip card (matches reference) ---------- */
.trips { display: grid; gap: 16px; }
.trip { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) minmax(220px, 280px); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.trip.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 3px var(--blue-line); } }
.t-left { padding: 18px 18px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.t-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mode-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 9px; border-radius: 999px; background: var(--sky-soft); border: 1px solid color-mix(in srgb, var(--sky) 25%, transparent); font-weight: 600; font-size: 13.5px; }
.mode-pill svg { width: 17px; height: 17px; }
.mode-icons { display: inline-flex; gap: 4px; align-items: center; }
.mode-icons .mi { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; }
.mode-icons .mi svg { width: 16px; height: 16px; }
.mode-icons + small { font-size: 12px; font-weight: 600; color: var(--muted); }
.phase { display: inline-flex; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid; }
.ph-upcoming { color: var(--blue); border-color: var(--blue-line); background: var(--blue-soft); }
.ph-ongoing { color: var(--violet); border-color: color-mix(in srgb, var(--violet) 35%, transparent); background: color-mix(in srgb, var(--violet) 8%, var(--surface)); }
.ph-completed { color: var(--green); border-color: var(--green); background: var(--green-soft); }
.ph-cancelled { color: var(--red); border-color: var(--red-line); background: var(--red-soft); }
.t-title { display: flex; gap: 8px; align-items: start; }
.t-title h3 { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.35; letter-spacing: -.01em; overflow-wrap: anywhere; flex: 1; }
.t-sec { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }
.t-sec .lbl { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.people { display: grid; gap: 8px; }
.person { display: flex; gap: 10px; align-items: center; min-width: 0; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-weight: 700; font-size: 12px; display: grid; place-items: center; flex: none; }
.person b { display: block; font-size: 14px; overflow-wrap: anywhere; }
.person small { display: block; font-size: 12px; color: var(--muted); }
.person small.miss { color: var(--amber); font-weight: 600; }
.person small.miss button { border: 0; background: none; padding: 0; color: var(--blue); font-weight: 600; text-decoration: underline; font-size: inherit; }
.t-log { margin-top: auto; }
.t-log .row { display: flex; justify-content: space-between; align-items: center; }
.t-log .count { font-size: 11.5px; font-weight: 600; background: var(--sunk); color: var(--muted); border-radius: 6px; padding: 1px 8px; }
.t-log .lbl { color: var(--blue); }
.loglink { border: 0; background: none; padding: 0; color: var(--violet); font-weight: 600; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.loglist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 260px; overflow-y: auto; }
.loglist li { font-size: 12.5px; color: var(--ink-2); border-left: 2px solid var(--line-2); padding-left: 10px; }
.loglist li.wa { border-color: var(--green-line); }
.loglist li.st { border-color: var(--amber-line); }
.loglist li small { display: block; color: var(--faint); font-size: 11.5px; }

.t-mid { padding: 22px 26px; min-width: 0; display: grid; align-content: center; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 16px; bottom: 16px; border-left: 1px dashed var(--line-2); }
.seg { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; position: relative; }
.seg-ic { width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; z-index: 1; box-shadow: 0 0 0 4px var(--surface); }
.seg-ic svg { width: 17px; height: 17px; }
.seg-body { display: grid; gap: 4px; min-width: 0; }
.seg-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg-kind { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.chip { font-family: var(--mono); font-size: 11.5px; padding: 1px 7px; border-radius: 5px; border: 1px solid; }
.st-reserved, .st-waitlisted { color: var(--amber); background: var(--amber-soft); border-color: var(--amber-line); }
.st-confirmed { color: var(--amber); background: var(--amber-soft); border-color: var(--amber-line); }
.st-completed { color: var(--amber); background: var(--amber-soft); border-color: var(--amber-line); }
.st-delayed { color: var(--red); background: var(--red-soft); border-color: var(--red-line); }
.st-cancelled { color: var(--red); background: var(--red-soft); border-color: var(--red-line); text-decoration: line-through; }
.seg-route { font-size: 16px; font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.seg-route .arr { color: var(--faint); font-weight: 500; }
.seg-when { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.seg-when svg { width: 14px; height: 14px; }
.seg-when b { color: var(--ink-2); }
.timechip { display: inline-flex; align-items: center; gap: 6px; background: var(--blue-soft); color: var(--blue); border-radius: 7px; padding: 2px 9px; font-size: 12.5px; font-weight: 700; width: fit-content; }
.timechip svg { width: 13px; height: 13px; }
.note { margin-top: 6px; background: var(--rail); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 13px; font-style: italic; color: var(--muted); overflow-wrap: anywhere; }
.seg.cancelled .seg-route { color: var(--faint); text-decoration: line-through; }
.empty-seg { color: var(--muted); font-style: italic; }

.t-right { background: var(--rail); border-left: 1px solid var(--line); padding: 18px; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.t-right .btn { width: 100%; padding: 12px 14px; border-radius: 12px; font-size: 14.5px; }
.t-right .wa-meta { font-size: 12px; color: var(--muted); text-align: center; }
.t-right .wa-meta.bad { color: var(--red); }
@media (max-width: 1100px) {
  .trip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
  .t-right { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; border-left: 0; border-top: 1px solid var(--line); }
  .t-right .btn { width: auto; flex: 1 1 180px; }
  .t-right .wa-meta { width: 100%; }
}
@media (max-width: 720px) {
  .trip { grid-template-columns: minmax(0, 1fr); }
  .t-left { border-right: 0; border-bottom: 1px solid var(--line); }
  .t-mid { padding: 18px; }
}
.empty { background: var(--surface); border: 1px dashed var(--line-2); border-radius: 18px; padding: 48px 20px; text-align: center; display: grid; gap: 10px; justify-items: center; color: var(--muted); }
.empty h3 { margin: 0; color: var(--ink); font-size: 18px; }
.empty p { margin: 0; max-width: 52ch; }

/* ---------- tables (travellers, activity) ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.panel-h { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-h h2 { margin: 0; font-size: 15px; }
.panel-h p { margin: 0; color: var(--muted); font-size: 12.5px; }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 720px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 14px; background: var(--rail); border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td .sub { color: var(--muted); font-size: 12.5px; }
.state { display: inline-flex; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.s-sent, .s-parsed { color: var(--green); background: var(--green-soft); }
.s-failed, .s-error { color: var(--red); background: var(--red-soft); }
.s-skipped, .s-ignored { color: var(--muted); background: var(--sunk); }
.missing-names { padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--amber-soft); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.missing-names .btn { border-color: var(--amber-line); }

/* ---------- settings ---------- */
.settings { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); align-items: start; }
.card-s { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: grid; gap: 14px; box-shadow: var(--shadow); }
.card-s h2 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card-s > p { margin: -6px 0 0; color: var(--muted); font-size: 13px; }
.ok-tag { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 6px; color: var(--green); background: var(--green-soft); }
.no-tag { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 6px; color: var(--amber); background: var(--amber-soft); }
.field { display: grid; gap: 5px; min-width: 0; }
.field label, .field .lab { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.field textarea { resize: vertical; min-height: 70px; }
.copyrow { display: flex; gap: 6px; }
.copyrow input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px; background: var(--sunk); }
.check { display: flex; gap: 10px; align-items: start; }
.check input { margin-top: 3px; width: 16px; height: 16px; }
.check b { display: block; font-size: 13.5px; }
.check span { font-size: 12.5px; color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
details.howto { background: var(--sunk); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
details.howto summary { cursor: pointer; font-weight: 600; }
details.howto ol { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; color: var(--ink-2); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(15, 23, 42, .45); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.dialog { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); width: min(860px, 100%); max-height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.dialog.narrow { width: min(560px, 100%); }
.dlg-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dlg-h h2 { margin: 0; font-size: 17px; font-weight: 800; }
.dlg-b { padding: 18px 20px; overflow-y: auto; display: grid; gap: 16px; }
.dlg-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; align-items: center; }
.dlg-f .r { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.err { color: var(--red); font-size: 13px; font-weight: 600; }
.seg-edit { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 10px; background: var(--rail); }
.seg-edit .hd { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.seg-edit .hd b { font-size: 13px; }
.grid6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.c2 { grid-column: span 2; } .c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c6 { grid-column: span 6; }
@media (max-width: 640px) { .grid6 .c2, .grid6 .c3, .grid6 .c4 { grid-column: span 6; } }
.tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.tags span { display: inline-flex; gap: 4px; align-items: center; background: var(--blue-soft); color: var(--blue); border-radius: 6px; padding: 2px 4px 2px 8px; font-weight: 600; font-size: 13px; }
.tags span button { border: 0; background: none; color: inherit; padding: 0 4px; font-size: 15px; line-height: 1; }
.tags input { border: 0; outline: 0; flex: 1; min-width: 140px; padding: 4px; background: transparent; }
.recips { display: grid; gap: 8px; }
.recip { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.recip.off { opacity: .7; }
.recip .grow { flex: 1; min-width: 0; }
.recip small { display: block; color: var(--muted); }
.recip small.miss { color: var(--amber); font-weight: 600; }
.wa-preview { background: #e7f8ee; color: #0b3d22; border-radius: 12px; padding: 4px; }
.wa-preview textarea { width: 100%; min-height: 200px; border: 0; background: #ffffff; border-radius: 9px; padding: 12px; color: #111; line-height: 1.5; resize: vertical; }
.track-list { display: grid; gap: 8px; }
.track { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.track .grow { flex: 1; min-width: 0; }
.track small { display: block; color: var(--muted); }

#toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; }
#toast div { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); }
#toast div.bad { background: var(--red); color: #fff; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login form { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; display: grid; gap: 14px; box-shadow: var(--shadow); }
.login h1 { margin: 0; font-size: 22px; font-weight: 800; }
.login p { margin: -6px 0 4px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.field input[type="checkbox"], .check input[type="checkbox"] { width: 16px; height: 16px; flex: none; padding: 0; }
.recip .grow b { display: block; }
.upd-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 55; display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--blue-line); box-shadow: var(--shadow-lg); border-radius: 12px; padding: 10px 12px 10px 16px; font-weight: 600; max-width: calc(100vw - 32px); flex-wrap: wrap; }
.s-opened { color: var(--green); background: var(--green-soft); }
.s-pending { color: var(--amber); background: var(--amber-soft); }
.s-dismissed { color: var(--muted); background: var(--sunk); }
.panel.pending { border-color: var(--green-line); }
.panel.pending .panel-h { background: var(--green-soft); }
.panel.pending h2 { display: flex; align-items: center; gap: 8px; }
.count-pill { font-family: var(--mono); font-size: 12px; background: var(--green); color: #fff; border-radius: 999px; padding: 1px 8px; }
.pend-list { list-style: none; margin: 0; padding: 0; }
.pend { display: flex; gap: 12px; align-items: start; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pend:first-child { border-top: 0; }
.pend .grow { flex: 1 1 260px; min-width: 0; }
.pend .sub { color: var(--muted); font-size: 12.5px; }
.pend details { margin-top: 4px; font-size: 12.5px; }
.pend summary { cursor: pointer; color: var(--blue); }
.msg-pre { white-space: pre-wrap; font: 13px/1.5 var(--f); background: var(--sunk); border-radius: 8px; padding: 8px 10px; margin: 6px 0 0; overflow-wrap: anywhere; }
.wa-meta.due { color: var(--amber); font-weight: 600; }
