/* Holidays planner. Calm and plain, big text for older eyes, one obvious next action per screen.
   Sizes are in rem so the planner follows the phone's text size (Dynamic Type on iPhone). Fonts are served from here. */
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url(/static/fonts/figtree-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url(/static/fonts/figtree-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/static/fonts/geist-mono-latin.woff2) format("woff2"); }

:root {
  --bg: #F3F5F6;
  --surface: #FFFFFF;
  --surface-2: #EDF1F2;
  --line: #E2E7E9;
  --line-2: #C9D3D6;
  --text: #0E191D;
  --text-2: #4C5D64;
  --text-3: #5D6E74;
  --accent: #0A6B70;
  --accent-press: #08565A;
  --accent-soft: #E0F0F0;
  --on-accent: #FFFFFF;
  --tn: #0A6B70;   --tn-soft: #E0F0F0;
  --pa: #A8385F;   --pa-soft: #FBE6ED;
  --ok: #18794A;   --ok-soft: #E1F3E8;
  --warn: #9A4F00; --warn-soft: #FFF0D6;
  --bad: #B42318;  --bad-soft: #FDE7E4;
  --t-meal: #A15C07;
  --t-ready: #6A55CF; --t-ready-soft: #EEEAFC;
  --t-show: #3657C9;
  --t-ship: #0E6F8A;  --t-ship-soft: #DDF0F6;
  --t-travel: #4C5B66;
  --sun: #D98A0B;
  --shadow-1: 0 1px 2px rgba(14, 25, 29, .05);
  --shadow-2: 0 10px 30px rgba(14, 25, 29, .16);
  --scrim: rgba(8, 16, 19, .44);

  --font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r-lg: 18px; --r-md: 12px; --r-sm: 8px;
  --tap: 48px;
  --tabbar: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A1114;
    --surface: #121B1F;
    --surface-2: #19252A;
    --line: #223137;
    --line-2: #34474F;
    --text: #E8EFF1;
    --text-2: #B0BFC5;
    --text-3: #8FA0A7;
    --accent: #4CC2C2;
    --accent-press: #3AA9A9;
    --accent-soft: #123134;
    --on-accent: #06201F;
    --tn: #4CC2C2;   --tn-soft: #123134;
    --pa: #F07AA0;   --pa-soft: #3A1B27;
    --ok: #5FD08F;   --ok-soft: #13301F;
    --warn: #F2B24D; --warn-soft: #35270F;
    --bad: #F4776B;  --bad-soft: #3A1714;
    --t-meal: #F0B25C;
    --t-ready: #A897F5; --t-ready-soft: #241D40;
    --t-show: #8FA7F7;
    --t-ship: #5CC6E0;  --t-ship-soft: #0F2C35;
    --t-travel: #A6B5BE;
    --sun: #F2B24D;
    --shadow-1: none;
    --shadow-2: 0 10px 30px rgba(0, 0, 0, .5);
    --scrim: rgba(0, 0, 0, .6);
  }
}

/* 17px body text by default; on iPhone it follows the Text Size setting. */
html { font-size: 93.75%; -webkit-text-size-adjust: 100%; }


* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 1rem; line-height: 1.45; font-weight: 400; font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.center { text-align: center; justify-self: center; }
.nw { white-space: nowrap; }
svg.i { width: 1.3rem; height: 1.3rem; flex: none; }
.noscript { padding: 2rem; font-family: sans-serif; }
body.no-scroll { overflow: hidden; }

#app { max-width: 640px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; }

/* ---------- app bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 30;
  padding: calc(var(--safe-t) + 8px) 16px 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
}
.appbar.is-scrolled { box-shadow: 0 1px 0 var(--line); }
.appbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: var(--tap); }
.appbar-titles + .who-seg { margin-left: auto; }
.appbar-titles { flex: 1 1 6rem; min-width: 0; }
.appbar-title { font-size: 1.45rem; font-weight: 700; letter-spacing: -.015em; line-height: 1.15; overflow-wrap: anywhere; }
.appbar-sub { font-size: .94rem; color: var(--text-2); font-weight: 500; }
.back-btn, .back-link { display: inline-flex; align-items: center; gap: 2px; min-height: var(--tap); margin-left: -8px; padding-right: 8px;
  font-size: 1rem; font-weight: 600; color: var(--accent); }
.back-btn svg { width: 1.4rem; height: 1.4rem; transform: rotate(180deg); }
.avatar-btn { width: var(--tap); height: var(--tap); display: grid; place-items: center; flex: none; margin-right: -4px; border-radius: 50%; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: .94rem; font-weight: 700; color: #fff; background: var(--text-3);
}
.av-TN { background: var(--tn); color: var(--surface); }
.av-PA { background: var(--pa); color: var(--surface); }
.avatar.av-sm { width: 30px; height: 30px; font-size: .82rem; }
.avatar.av-lg { width: 64px; height: 64px; font-size: 1.5rem; }

/* ---------- date strip ---------- */
.datestrip { display: flex; gap: 5px; overflow-x: auto; padding: 6px 16px 10px; margin: 0 -16px; scrollbar-width: none; scroll-snap-type: x proximity; }
.datestrip::-webkit-scrollbar { display: none; }
.date {
  flex: 0 0 auto; min-width: 3.15rem; scroll-snap-align: center; border-radius: 12px; padding: 5px 4px 6px;
  display: grid; justify-items: center; gap: 0; background: var(--surface); border: 1px solid var(--line); color: var(--text);
}
.date-wd { font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.date-num { font-size: 1.15rem; font-weight: 700; line-height: 1.15; }
.date-lbl { font-size: .7rem; font-weight: 600; color: var(--text-2); max-width: 4.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.date.is-today .date-num { color: var(--accent); }
.date.is-sel { background: var(--text); border-color: var(--text); }
.date.is-sel .date-wd, .date.is-sel .date-lbl { color: color-mix(in srgb, var(--surface) 80%, transparent); }
.date.is-sel .date-num { color: var(--surface); }

/* ---------- layout ---------- */
.page { padding: 6px 16px calc(var(--tabbar) + var(--safe-b) + 32px); display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
.page > *, .stack > * { min-width: 0; }
.stack { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.pad { padding: 18px; }
.group-label { font-size: .94rem; font-weight: 600; color: var(--text-2); padding: 0 4px 8px; }
.overline { font-size: .82rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.caption { font-size: .88rem; color: var(--text-2); line-height: 1.45; padding: 8px 4px 0; display: block; }
.caption.center { padding: 4px 12px 0; }
.progress { font-size: 1rem; font-weight: 600; color: var(--text-2); padding: 0 4px; }

/* ---------- chips ---------- */
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; min-height: 1.5rem; padding: 0 8px; border-radius: 7px;
  font-size: .8rem; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--text-2); flex: none;
}
.c-tn { background: var(--tn-soft); color: var(--tn); }
.c-pa { background: var(--pa-soft); color: var(--pa); }
.c-ok { background: var(--ok-soft); color: var(--ok); }
.c-warn { background: var(--warn-soft); color: var(--warn); }
.c-bad { background: var(--bad-soft); color: var(--bad); }
.c-dressy { background: var(--t-ready-soft); color: var(--t-ready); }
.c-beach { background: var(--t-ship-soft); color: var(--t-ship); }
.c-party { background: var(--pa-soft); color: var(--pa); }
.chip.chip-gap { margin-top: 6px; justify-self: start; }

/* ---------- buttons, fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 8px 18px;
  border-radius: var(--r-md); font-size: 1rem; font-weight: 600; background: var(--surface-2); color: var(--text); text-align: center;
}
.btn:active { transform: scale(.985); }
.btn svg { width: 1.2rem; height: 1.2rem; flex: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:active { background: var(--accent-press); }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: .94rem; }
.btn-danger { color: var(--bad); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.section-link { justify-self: start; display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 4px; font-size: 1rem; font-weight: 600; color: var(--accent); }
.section-link.center { justify-self: center; }
.link-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }

.field { display: grid; gap: 6px; }
.field > label, .field-label { font-size: .94rem; font-weight: 600; color: var(--text-2); }
.input, .select {
  width: 100%; min-height: 52px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface);
  padding: 0 14px; font-size: 1rem; outline: none; color: var(--text);
}
.input:focus, .select:focus, .textarea:focus, .pack-add-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { width: 100%; min-height: 110px; resize: vertical; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface); padding: 12px 14px; font-size: 1rem; line-height: 1.45; outline: none; }
.error { color: var(--bad); font-size: .94rem; font-weight: 600; }
.error:empty { display: none; }
.readonly-note { padding: 12px 14px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--text); font-weight: 600; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); font-size: 1rem; line-height: 1.4; }
.alert svg { width: 1.2rem; height: 1.2rem; flex: none; margin-top: 2px; }
.alert-warn { background: var(--warn-soft); }
.alert-warn svg { color: var(--warn); }
.alert-bad { background: var(--bad-soft); }
.alert-bad svg { color: var(--bad); }
.alert-info { background: var(--surface-2); }
.alert-info svg { color: var(--text-2); }
.banner { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); font-size: .94rem; color: var(--text-2); }
.banner svg { width: 1.2rem; height: 1.2rem; flex: none; }

.kv { display: grid; grid-template-columns: minmax(5.5rem, auto) 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--text-2); font-size: .94rem; padding-top: 1px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Today ---------- */
.next { padding: 16px; display: grid; gap: 6px; text-align: left; width: 100%; }
.next-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.next-label { font-size: .88rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.next-label.is-now { color: var(--ok); }
.next-in { font-size: .94rem; font-weight: 700; color: var(--text-2); }
.next-title { font-size: 1.4rem; font-weight: 700; letter-spacing: -.015em; line-height: 1.15; text-wrap: balance; overflow-wrap: anywhere; }
.next-when { font-size: 1rem; font-weight: 600; }
.next-where { font-size: 1rem; color: var(--text-2); }
.next[data-type="deadline"] .next-title, .next[data-type="deadline"] .next-when { color: var(--warn); }
.then-row { display: grid; grid-template-columns: minmax(5rem, auto) 1fr; gap: 12px; padding: 10px 14px; width: 100%; align-items: baseline; min-height: 44px; }
.then-row + .then-row { border-top: 1px solid var(--line); }
.then-row:active { background: var(--surface-2); }
.then-time { font-size: 1rem; font-weight: 700; color: var(--text-2); }
.then-title { font-size: 1rem; font-weight: 600; min-width: 0; }
.then-row[data-type="deadline"] .then-time, .then-row[data-type="deadline"] .then-title { color: var(--warn); }
.big-btn { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 18px; border-radius: var(--r-lg);
  background: var(--accent); color: var(--on-accent); min-height: 76px; }
.big-btn svg { width: 1.9rem; height: 1.9rem; flex: none; }
.big-btn .big-t { font-size: 1.12rem; font-weight: 700; display: block; }
.big-btn .big-s { font-size: .94rem; display: block; }
.big-btn .chev { color: inherit; margin-left: auto; width: 1.2rem; height: 1.2rem; }
.all-done { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ok); padding: 4px; }
.all-done svg { width: 1.3rem; height: 1.3rem; }

/* ---------- lists ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.list > * + * { border-top: 1px solid var(--line); }
.li { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 9px 14px; min-height: 48px; color: var(--text); }
.li:active { background: var(--surface-2); }
.li-static { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; }
.li-lead { width: 2.2rem; height: 2.2rem; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text-2); }
.li-lead svg { width: 1.2rem; height: 1.2rem; }
.li-lead.li-lead-plain { background: none; }
.li-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.li-title { font-size: 1rem; font-weight: 600; line-height: 1.3; display: block; }
.li-sub { font-size: .94rem; color: var(--text-2); display: block; }
.li-link { font-weight: 600; justify-self: start; min-height: 2.75rem; display: inline-flex; align-items: center; }
.li-static .chips { margin-top: 4px; }
.chev { width: 1.1rem; height: 1.1rem; color: var(--text-3); flex: none; }

/* one-line rows with a big tick (to-dos, packing) */
.row { display: flex; align-items: stretch; min-height: 48px; }
.tick-btn { width: 48px; flex: none; display: grid; place-items: center; }
.row-body { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 12px 16px 12px 0; text-align: left; }
.row-body.row-solo { padding-left: 0; gap: 0; }
.row-body.row-solo .tick-btn { align-self: stretch; }
.row-body:active { background: var(--surface-2); }
.row > .row-body:first-child:not(.row-solo) { padding-left: 16px; }
.row-title { flex: 1; min-width: 0; font-size: 1rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.row-wrap { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.row-wrap .row-title { flex: 1 1 9rem; }
.row-title.is-done { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.tick { width: 1.55rem; height: 1.55rem; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line-2); }
.tick svg { width: 1.1rem; height: 1.1rem; color: #fff; opacity: 0; stroke-width: 2.4; }
.tick.tick-sq { border-radius: 9px; }
.tick.tick-no { background: var(--bad-soft); box-shadow: none; width: 1.8rem; height: 1.8rem; }
.tick.tick-no svg { opacity: 1; color: var(--bad); }
[aria-pressed="true"] > .tick, [aria-pressed="true"] .tick-btn > .tick { background: var(--ok); box-shadow: none; }
[aria-pressed="true"] > .tick svg, [aria-pressed="true"] .tick-btn > .tick svg { opacity: 1; }
@media (prefers-color-scheme: dark) { .tick svg { color: #06201F; } }
.tick-count { width: 48px; flex: none; display: grid; place-items: center; font-size: .88rem; font-weight: 700; color: var(--text-3); }
.info-i { width: 1.25rem; height: 1.25rem; color: var(--text-3); flex: none; }
.row-remove { width: var(--tap); flex: none; display: grid; place-items: center; color: var(--text-3); }
.row-remove:active { color: var(--bad); }
.row-remove svg { width: 1.1rem; height: 1.1rem; }
.pack-add { display: flex; gap: 8px; padding: 10px 12px; }
.pack-add-input { flex: 1; min-width: 0; min-height: 48px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); padding: 0 12px; font-size: 1rem; outline: none; }
.pack-add-btn { min-height: 48px; padding: 0 18px; }

.outfit-row { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; padding: 9px 14px; min-height: 52px; }
.outfit-row:active { background: var(--surface-2); }
.outfit-date { display: grid; justify-items: center; line-height: 1.1; min-width: 2.6rem; }
.outfit-date span { font-size: .76rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.outfit-date b { font-size: 1.3rem; font-weight: 700; }
.row-main { flex: 1; min-width: 0; display: grid; gap: 4px; justify-items: start; }
.row-main .row-title { justify-self: stretch; }
.agreed { font-size: .94rem; font-weight: 600; color: var(--accent); }

/* ---------- segmented ---------- */
.seg { display: flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 12px; }
.seg button {
  flex: 1; min-height: 36px; border-radius: 9px; font-size: .94rem; font-weight: 600; color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 4px 8px; text-align: center;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(14,25,29,.14); }

/* ---------- Plan ---------- */
.dayhead { display: grid; gap: 4px; padding: 0 4px; margin-top: -12px; }
.dayhead-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 2.75rem; }
.dayhead-date { font-size: .94rem; font-weight: 700; letter-spacing: .02em; color: var(--text-2); }
.wx-inline { display: inline-flex; align-items: center; gap: 6px; min-height: 2.75rem; padding: 0 4px 0 12px; margin-right: -4px; font-size: 1rem; font-weight: 600; color: var(--text-2); }
.wx-inline-ico { width: 1.5rem; height: 1.5rem; color: var(--sun); }
.wx-inline-ico .wx-fill { fill: currentColor; stroke: none; }
.wx-inline-ico .wx-cloud { fill: var(--bg); stroke: var(--text-3); }
.dayhead-title { font-size: 1.4rem; font-weight: 700; letter-spacing: -.015em; line-height: 1.15; text-wrap: balance; overflow-wrap: anywhere; }
.dayhead-note { font-size: 1rem; font-weight: 600; color: var(--text-2); margin-top: 2px; }
.dayhead-note.warn { color: var(--warn); }
.kv dd.warn { color: var(--warn); font-weight: 700; }
.wx-ico { width: 2rem; height: 2rem; color: var(--sun); flex: none; }
.wx-ico .wx-fill { fill: currentColor; stroke: none; }
.wx-ico .wx-cloud { fill: var(--surface); stroke: var(--text-3); }
.wx-rain { stroke: #3D8FD1; }
.who-seg { flex: none; }
.seg.seg-sm { border-radius: 10px; padding: 2px; }
.seg.seg-sm button { min-height: 2.25rem; font-size: .88rem; padding: 2px 10px; border-radius: 8px; }

.tl { list-style: none; margin: -8px 0 0; padding: 0; }
.ev { position: relative; }
.ev-btn { display: grid; grid-template-columns: minmax(4.6rem, auto) 24px minmax(0, 1fr); align-items: start; width: 100%; text-align: left; padding: 8px 4px; min-height: 44px; border-radius: var(--r-md); }
.ev-btn:active { background: var(--surface-2); }
.ev-time { font-size: .94rem; font-weight: 700; line-height: 1.5; color: var(--text-2); }
.ev-label { font-size: .88rem; font-weight: 600; color: var(--text-3); line-height: 1.7; display: block; }
.ev-rail { position: relative; align-self: stretch; }
.ev-rail::before { content: ""; position: absolute; left: 11px; top: -8px; bottom: -8px; width: 2px; background: var(--line-2); }
.ev:first-child .ev-rail::before { top: 12px; }
.ev:last-child .ev-rail::before { bottom: calc(100% - 14px); }
.ev-dot { position: absolute; left: 5px; top: .4rem; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); box-shadow: 0 0 0 2.5px var(--dot, var(--text-3)) inset; }
.ev-body { min-width: 0; padding-left: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ev-title { font-size: 1rem; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.ev[data-type="meal"], .ev[data-type="dinner"] { --dot: var(--t-meal); }
.ev[data-type="ready"]  { --dot: var(--t-ready); }
.ev[data-type="show"]   { --dot: var(--t-show); }
.ev[data-type="quiz"], .ev[data-type="ship"] { --dot: var(--t-ship); }
.ev[data-type="travel"], .ev[data-type="task"], .ev[data-type="free"] { --dot: var(--t-travel); }
.ev[data-type="booked"] { --dot: var(--accent); }
.ev[data-type="trip"], .ev[data-type="idea"] { --dot: var(--ok); }
.ev[data-type="deadline"] { --dot: var(--warn); }
.ev[data-type="dinner"] .ev-dot, .ev[data-type="booked"] .ev-dot, .ev[data-type="deadline"] .ev-dot, .ev[data-type="trip"] .ev-dot { background: var(--dot); }
.ev[data-type="deadline"] .ev-title, .ev[data-type="deadline"] .ev-time { color: var(--warn); }
.ev[data-type="free"] .ev-title { font-weight: 500; color: var(--text-2); }
.ev.is-clash .ev-btn { background: color-mix(in srgb, var(--bad-soft) 60%, transparent); }

.walk { display: inline-flex; align-items: center; gap: 6px; font-size: .94rem; font-weight: 600; color: var(--text-2); }
.walk i { display: inline-flex; gap: 2px; }
.walk i b { width: 4px; height: 12px; border-radius: 2px; background: var(--line-2); }
.walk-1 i b:nth-child(1) { background: var(--ok); }
.walk-2 i b:nth-child(-n+2) { background: var(--warn); }
.walk-3 i b { background: var(--pa); }
.tips { margin: 0; padding-left: 1.2rem; display: grid; gap: 8px; }

/* ---------- Passes ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr)); gap: 12px; }
.tile-wrap { position: relative; min-width: 0; }
.tile { display: grid; align-content: start; gap: 6px; width: 100%; height: 100%; min-height: 9rem; padding: 16px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.tile:active { background: var(--surface-2); }
.tile-ico { width: 2.75rem; height: 2.75rem; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.tile-ico svg { width: 1.5rem; height: 1.5rem; }
.tile-title { font-size: 1.06rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.tile-sub { font-size: .88rem; color: var(--text-2); font-weight: 500; }
.tile-day { font-weight: 700; color: var(--text); white-space: nowrap; }
.tile-more { position: absolute; top: 4px; right: 4px; width: var(--tap); height: var(--tap); border-radius: 50%; display: grid; place-items: center; color: var(--text-3); }
.tile-more svg { width: 1.3rem; height: 1.3rem; }
.doc-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 9px 14px; min-height: 48px; }
.doc-row:active { background: var(--surface-2); }
.doc-row .li-lead { background: var(--accent-soft); color: var(--accent); }
.kind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 7rem), 1fr)); gap: 6px; }
.kind-grid button { min-height: var(--tap); border-radius: 10px; background: var(--surface-2); font-size: .94rem; font-weight: 600; color: var(--text-2); padding: 4px 6px; text-align: center; }
.kind-grid button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.file-pick { position: relative; display: grid; place-items: center; gap: 6px; min-height: 120px; border-radius: var(--r-lg); border: 2px dashed var(--line-2);
  background: var(--surface-2); color: var(--text-2); font-weight: 600; text-align: center; padding: 16px; cursor: pointer; }
.file-pick svg { width: 2rem; height: 2rem; color: var(--accent); }
.file-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-pick.has-file { border-style: solid; border-color: var(--accent); color: var(--text); }

/* bookings */
.leg { display: grid; gap: 4px; }
.leg + .leg { padding-top: 14px; border-top: 1px dashed var(--line-2); }
.leg-codes { display: flex; align-items: center; gap: 10px; }
.code-big { font-size: 2rem; font-weight: 700; letter-spacing: .02em; line-height: 1; }
.leg-arrow { flex: 1; height: 1px; background: var(--line-2); position: relative; }
.leg-arrow svg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 18px; height: 18px; color: var(--text-3); background: var(--surface); padding: 0 2px; box-sizing: content-box; }
.leg-cities { display: flex; justify-content: space-between; gap: 12px; font-size: .94rem; color: var(--text-2); }
.leg-meta { font-weight: 600; }
.refs { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 8px; }
.ref { border-radius: var(--r-md); padding: 10px 12px; display: grid; gap: 2px; text-align: left; background: var(--surface-2); min-width: 0; }
.ref-lbl { font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ref.c-tn .ref-lbl { color: var(--tn); }
.ref.c-pa .ref-lbl { color: var(--pa); }
.ref-code { font: 600 1.15rem/1.25 var(--mono); letter-spacing: .06em; color: var(--text); overflow-wrap: anywhere; }
.ref-sub { font-size: .88rem; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.ref-sub svg { width: 14px; height: 14px; }
.applinks { font-size: .94rem; color: var(--text-2); text-align: center; }
.applinks a { font-weight: 600; display: inline-block; padding: 8px 4px; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 640px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 4px 8px calc(var(--safe-b) + 4px);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px);
  border-top: 1px solid var(--line);
}
.tab { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 56px; font-size: .76rem; font-weight: 600; color: var(--text-3); }
.tab svg { width: 1.65rem; height: 1.65rem; }
.tab-label { line-height: 1.1; }
.tab[aria-current="page"] { color: var(--accent); }
@media (prefers-color-scheme: dark) { .tab-badge { color: #2A0F18; } }
.tab-badge { position: absolute; top: 4px; left: calc(50% + 8px); min-width: 1.2rem; height: 1.2rem; padding: 0 5px; border-radius: .6rem; background: var(--pa); color: #fff; font-size: .72rem; font-weight: 700; display: grid; place-items: center; }

/* ---------- sheets ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: var(--scrim); animation: fade .18s ease-out; }
.sheet {
  position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 640px;
  max-height: 90vh; max-height: 90dvh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: var(--shadow-2);
  animation: up .24s cubic-bezier(.2, .8, .2, 1);
}
.sheet-grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 8px auto 2px; flex: none; }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; padding: 8px 12px 10px 18px; flex: none; }
.sheet-title { flex: 1; min-width: 0; font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; padding-top: 8px; overflow-wrap: anywhere; }
.sheet-close { width: var(--tap); height: var(--tap); border-radius: 50%; display: grid; place-items: center; color: var(--text-2); flex: none; position: relative; }
.sheet-close::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--surface-2); }
.sheet-close svg { width: 1.1rem; height: 1.1rem; position: relative; }
.sheet-body { overflow-y: auto; padding: 0 18px 20px; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); -webkit-overflow-scrolling: touch; }
.sheet-body > * { min-width: 0; }
.sheet-foot { padding: 12px 16px calc(var(--safe-b) + 12px); border-top: 1px solid var(--line); display: grid; gap: 8px; flex: none; }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.me-head { display: flex; align-items: center; gap: 14px; }

.todo-people { display: flex; flex-wrap: wrap; gap: 8px; }
.pchip { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 14px 0 6px; border-radius: 24px; background: var(--surface-2); font-size: 1rem; font-weight: 600; color: var(--text-2); }
.pchip[aria-pressed="true"] { background: var(--ok-soft); color: var(--ok); }

.option-list { display: grid; gap: 10px; }
.option { display: grid; grid-template-columns: 22px 1fr; gap: 12px; text-align: left; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface); width: 100%; }
.option .radio { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line-2); margin-top: 1px; }
.option[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.option[aria-pressed="true"] .radio { box-shadow: inset 0 0 0 6px var(--accent); }
.option[disabled] { cursor: default; color: inherit; opacity: 1; }
.option-body { display: grid; gap: 3px; min-width: 0; }
.option-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 4px; }
.option-sched { display: grid; gap: 3px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line-2); font-size: .94rem; color: var(--text-2); }
.option-sched b { font-weight: 600; color: var(--text); display: inline-block; min-width: 4.4rem; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 2rem 1fr; gap: 12px; align-items: center; counter-increment: s; }
.steps li::before { content: counter(s); width: 2rem; height: 2rem; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: .88rem; font-weight: 700; }
.key { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 7px; background: var(--surface-2); font-weight: 600; }
.key svg { width: 1rem; height: 1rem; color: #0A84FF; }

/* ---------- lock screen, gate ---------- */
.lock { min-height: 100vh; min-height: 100dvh; display: grid; align-content: center; gap: 24px; padding: calc(var(--safe-t) + 32px) 20px calc(var(--safe-b) + 32px); max-width: 440px; margin: 0 auto; }
.lock-brand { display: grid; justify-items: center; gap: 12px; text-align: center; }
.lock-icon { width: 76px; height: 76px; border-radius: 19px; box-shadow: var(--shadow-2); }
.lock-title { font-size: 1.65rem; font-weight: 700; letter-spacing: -.015em; }
.lock-sub { color: var(--text-2); }
.code-input { text-align: center; font: 600 1.4rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; padding: 0 12px; min-height: 60px; }
.gate-title { font-size: 1.35rem; font-weight: 700; line-height: 1.25; }

.toast {
  position: fixed; z-index: 80; left: 50%; bottom: calc(var(--tabbar) + var(--safe-b) + 16px); transform: translateX(-50%);
  background: var(--text); color: var(--surface); padding: 12px 18px; border-radius: 12px; font-size: 1rem; font-weight: 600;
  box-shadow: var(--shadow-2); max-width: calc(100vw - 32px); animation: fade .16s ease-out;
}

/* ---------- alerts guide: drawn phone screens ---------- */
.guide-step { display: grid; gap: 12px; padding: 16px; }
.guide-num { width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 700; flex: none; }
.guide-head { display: flex; align-items: center; gap: 12px; font-size: 1.06rem; font-weight: 700; }
.mock { border-radius: 22px; border: 6px solid #1c1c1e; background: #f2f2f7; color: #000; padding: 14px 12px; display: grid; gap: 8px;
  max-width: 300px; justify-self: center; width: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 15px; }
.mock-alert { background: #fff; border-radius: 14px; overflow: hidden; text-align: center; }
.mock-alert p { padding: 14px 12px 12px; font-size: 14px; }
.mock-alert b { display: block; font-size: 16px; margin-bottom: 4px; }
.mock-alert .mock-btns { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid #d1d1d6; }
.mock-alert .mock-btns span { padding: 11px 0; color: #0a84ff; font-size: 16px; }
.mock-alert .mock-btns span + span { border-left: 1px solid #d1d1d6; font-weight: 600; }
.mock-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fff; border-radius: 10px; padding: 11px 12px; }
.mock-row.is-dim { color: #8e8e93; }
.mock-toggle { width: 46px; height: 28px; border-radius: 14px; background: #e9e9eb; position: relative; flex: none; }
.mock-toggle::after { content: ""; position: absolute; left: 2px; top: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.mock-toggle.is-on { background: #34c759; }
.mock-toggle.is-on::after { left: 20px; }
.mock-ring { box-shadow: 0 0 0 3px #ff9f0a; }

/* ship guide */
.ship-line { display: grid; gap: 2px; padding: 14px 16px; }

/* ---------- People (admin) ---------- */
.person-row > summary { list-style: none; cursor: pointer; }
.person-row > summary::-webkit-details-marker { display: none; }
.person-row[open] > summary .chev { transform: rotate(90deg); }
.person-more { padding: 4px 16px 16px; }
.device-row { align-items: center; }
.code-card { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.code-show { font: 700 2rem/1.2 var(--mono); letter-spacing: .08em; text-align: center; padding: 8px 0; word-break: break-all; }

/* ---------- full-screen viewer: passes, photos, PDFs (always white and bright for scanning) ---------- */
.viewer { position: fixed; inset: 0; z-index: 90; background: #fff; color: #111; display: flex; flex-direction: column; animation: fade .16s ease-out; }
.viewer-bar { display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-t) + 8px) 12px 8px; flex: none; }
.viewer-title { flex: 1; min-width: 0; font-size: 1.06rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-count { font-size: .88rem; font-weight: 600; color: #555; }
.viewer-close { width: var(--tap); height: var(--tap); border-radius: 50%; background: #f0f0f2; color: #111; display: grid; place-items: center; flex: none; }
.viewer-close svg { width: 20px; height: 20px; }
.viewer-track { flex: 1; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.viewer-track::-webkit-scrollbar { display: none; }
.viewer-track.is-zoomed { overflow-x: hidden; }
.viewer-page { flex: 0 0 100%; scroll-snap-align: center; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; align-items: center; padding: 8px 16px calc(var(--safe-b) + 16px); }
.zoom { width: 100%; flex: 1; display: grid; align-content: center; justify-items: center; gap: 12px; touch-action: pan-x pan-y; transform-origin: 0 0; }
.zoom.is-zoomed { touch-action: none; }
.zoom img { max-width: 100%; height: auto; display: block; user-select: none; -webkit-user-drag: none; }
.viewer-dots { display: flex; justify-content: center; gap: 6px; padding: 6px 0 calc(var(--safe-b) + 10px); flex: none; }
.viewer-dots i { width: 7px; height: 7px; border-radius: 50%; background: #d0d0d5; }
.viewer-dots i.is-on { background: #111; }
.viewer-tip { font-size: .88rem; color: #555; text-align: center; padding: 4px 16px 0; }
.viewer-msg { margin: auto; text-align: center; color: #444; padding: 24px; }
.bp { width: 100%; max-width: 440px; border-radius: 18px; border: 1px solid #e3e3e8; overflow: hidden; background: #fff; }
.bp-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid #ececf0; }
.bp-head img { max-height: 36px; max-width: 140px; }
.bp-org { font-size: 17px; font-weight: 700; flex: 1; min-width: 0; }
.bp-hfields { display: flex; gap: 14px; text-align: right; }
.bp-primary { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding: 16px 16px 8px; }
.bp-primary .pf:last-child { text-align: right; }
.bp-primary .pf-v { font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: .01em; }
.bp-primary.single .pf-v { font-size: 26px; }
.bp-arrow { font-size: 26px; color: #777; padding-bottom: 4px; }
.pf { display: grid; gap: 2px; min-width: 0; }
.pf-l { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #666; }
.pf-v { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.bp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 12px 14px; padding: 8px 16px 14px; }
.bp-code { padding: 16px; border-top: 1px dashed #d8d8de; display: grid; justify-items: center; gap: 6px; background: #fff; }
.bp-code img { width: 100%; max-width: 320px; image-rendering: pixelated; }
.bp-code.wide img { max-width: 420px; }
.bp-code small { font-size: 13px; color: #444; font-family: var(--mono); }
.bp-back { padding: 0 16px 16px; display: grid; gap: 10px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } .btn:active { transform: none; } }
@media (min-width: 700px) {
  .page { padding-left: 20px; padding-right: 20px; }
  .tabbar { border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 16px 16px 0 0; }
}

.coach-seg { margin-bottom: 14px; }
.leg-route { font-size: 1rem; font-weight: 600; margin: 2px 0 10px; }
.coach-tix { display: flex; flex-wrap: wrap; gap: 8px; }
.coach-tick { padding: 0 16px 0 12px; color: var(--text); }
.coach-tick svg { width: 18px; height: 18px; }

.bp-primary.long { align-items: center; }
.bp-primary.long .pf { flex: 1 1 0; }
.bp-primary.long .pf-v { font-size: 22px; line-height: 1.2; overflow-wrap: normal; word-break: normal; hyphens: none; }
.bp-primary.long .bp-arrow { flex: none; font-size: 22px; padding-bottom: 0; }
/* The whole pass fits the screen: the code shrinks on short screens, and a tall pass scrolls from the top, never clipped. */
.bp-code img { max-width: min(320px, 42vh); }
.zoom { align-content: safe center; }
@supports not (align-content: safe center) { .zoom { align-content: start; } }
.bp-grid { gap: 8px 12px; padding: 6px 16px 12px; }
.bp-grid .pf-v { font-size: 15px; }
/* The whole ticket fits on screen: the code takes whatever height is left (never more than 320px, never cut off). */
.viewer-page[data-pass] { justify-content: center; }
.viewer-page[data-pass] .bp { display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0; max-height: 100%; }
.viewer-page[data-pass] .bp > * { flex: none; }
.viewer-page[data-pass] .bp > .bp-code { flex: 0 1 auto; min-height: 150px; display: flex; flex-direction: column; align-items: center; }
.viewer-page[data-pass] .bp-code img { flex: 0 1 auto; min-height: 0; width: 100%; max-width: 320px; height: auto; max-height: 320px; object-fit: contain; }
.viewer-page[data-pass] .bp-code.wide img { max-width: 420px; }
.viewer-page[data-pass] .bp-code small { flex: none; }
.viewer-page[data-pass] .bp-head { padding: 10px 16px; }
.viewer-page[data-pass] .bp-primary { padding: 12px 16px 4px; }
.viewer-page[data-pass] .bp-grid { grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); }
.viewer-page[data-pass] .bp-code { padding: 12px; }
