/* Layout: one phone-width column. A postcard header per day, a timeline of bookings, then the Trello list as cards. Tab bar at the bottom. */
:root {
  --paper: #EDF0F4;
  --card: #FFFFFF;
  --ink: #16202C;
  --muted: #566273;
  --faint: #8792A1;
  --line: #D6DCE4;
  --accent: #1F4FA3;
  --warn: #9A5B00;
  --warn-bg: #FFF4DE;
  --mail-red: #CF3445;
  --mail-blue: #1F4FA3;
  --hatch: rgba(22, 32, 44, 0.07);
  --shadow: 0 1px 0 rgba(22, 32, 44, 0.05), 0 3px 10px rgba(22, 32, 44, 0.07);
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --tab-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0D131A; --card: #16202B; --ink: #E5EAF0; --muted: #A2ADBB; --faint: #6F7B8B;
    --line: #283444; --accent: #8EAEFF; --warn: #F2B65A; --warn-bg: #2B2212; --mail-red: #FF7383; --mail-blue: #8EAEFF;
    --hatch: rgba(229, 234, 240, 0.07); --shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0D131A; --card: #16202B; --ink: #E5EAF0; --muted: #A2ADBB; --faint: #6F7B8B;
  --line: #283444; --accent: #8EAEFF; --warn: #F2B65A; --warn-bg: #2B2212; --mail-red: #FF7383; --mail-blue: #8EAEFF;
  --hatch: rgba(229, 234, 240, 0.07); --shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--paper); color: var(--ink); font: 16px/1.5 var(--font-body); }
button { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg.i { width: 18px; height: 18px; flex: none; }

.app { max-width: 560px; margin: 0 auto; padding-inline: 16px; padding-block: 10px calc(var(--tab-h) + 28px + env(safe-area-inset-bottom, 0px)); }
.proto { font: 500 11px/1.4 var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-block: 4px 10px; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; }
h2.section { font-size: 13px; font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 28px 0 10px; }
.sub { color: var(--muted); font-size: 14px; }

/* Day header: a postcard. The airmail edge is the one flourish. */
.daynav { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; margin-bottom: 10px; }
.daynav h1 { font-size: 20px; font-weight: 700; text-align: center; }
.daynav .sub { text-align: center; font-size: 13px; }
.iconbtn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; font-size: 22px; line-height: 1; }
.iconbtn:disabled { opacity: 0.35; cursor: default; }
.postcard { position: relative; border-radius: 14px; overflow: hidden; color: #fff; padding: 22px 18px 16px; min-height: 150px; display: flex; flex-direction: column; justify-content: flex-end; box-shadow: var(--shadow); background: var(--c); }
.postcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 7px; z-index: 2; background: repeating-linear-gradient(-45deg, var(--mail-red) 0 12px, #fff 12px 18px, var(--mail-blue) 18px 30px, #fff 30px 36px); }
.postcard::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255,255,255,0.06) 0 2px, transparent 2px 14px); pointer-events: none; }
.postcard .wash { position: absolute; inset: 0; background: var(--to); clip-path: polygon(58% 0, 100% 0, 100% 100%, 38% 100%); }
.postcard.transit { background: repeating-linear-gradient(-45deg, #2A3A52 0 18px, #31435E 18px 36px); }
.postcard .place { font: 800 clamp(28px, 8.5vw, 40px)/1.02 var(--font-display); letter-spacing: -0.01em; position: relative; z-index: 1; }
.postcard .route { font-size: 15px; opacity: 0.92; position: relative; z-index: 1; margin-top: 6px; }
.postcard .photo-note { position: absolute; top: 18px; right: 14px; z-index: 1; font: 500 10px/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.75; text-align: right; max-width: 46%; }

/* Today's timeline */
.timeline { display: grid; gap: 10px; }
.event { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 10px; align-items: start; }
.event .when { font: 500 13px/1.25 var(--font-mono); color: var(--muted); padding-top: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.event .when small { display: block; font-size: 10px; color: var(--faint); }
.slot { background: var(--card); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); border-left: 5px solid var(--c, var(--line)); min-width: 0; }
.slot .kind { display: flex; align-items: center; gap: 6px; font: 500 11px/1.3 var(--font-mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.slot .kind svg { width: 15px; height: 15px; }
.slot .title { font: 700 17px/1.3 var(--font-display); margin-top: 3px; }
.slot .meta { font-size: 14px; color: var(--muted); margin-top: 2px; }
.slot .row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.slot.quiet { background: transparent; box-shadow: none; border-left-width: 3px; padding-block: 6px; }
.slot.quiet .title { font-size: 15px; }
.slot.missing { background: transparent; box-shadow: none; border: 2px dashed var(--line); background-image: repeating-linear-gradient(-45deg, var(--hatch) 0 6px, transparent 6px 12px); }
.flag { display: flex; gap: 6px; align-items: flex-start; margin-top: 8px; font-size: 13px; color: var(--warn); background: var(--warn-bg); border-radius: 6px; padding: 6px 8px; }
/* Boarding pass for flights and trains */
.pass { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 8px; margin-top: 6px; }
.pass .code { font: 800 30px/1 var(--font-display); letter-spacing: 0.01em; }
.pass .stn { font: 700 16px/1.2 var(--font-display); }
.pass .t { font: 500 13px/1.3 var(--font-mono); color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.pass .end { text-align: right; }
.pass .mid { color: var(--faint); font: 500 11px/1.2 var(--font-mono); text-align: center; padding-bottom: 18px; white-space: nowrap; }
.pass .mid::before { content: ""; display: block; border-top: 2px dotted var(--line); margin-bottom: 4px; min-width: 48px; }
.perf { border-top: 2px dashed var(--line); margin: 10px -14px 0; padding: 8px 14px 0; }
/* What Trello adds to a booking */
.fromtrello { margin-top: 10px; border-radius: 8px; background: var(--paper); padding: 8px 10px; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.fromtrello .bars { margin: 0; }
.fromtrello .note { color: var(--ink); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; padding: 5px 9px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); background: var(--card); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.doc { border-style: solid; border-color: var(--accent); color: var(--accent); }
.chip.conf { font-family: var(--font-mono); font-size: 12px; }

/* Trello-style cards */
.group { display: grid; gap: 10px; }
.group-head { display: flex; align-items: center; gap: 8px; margin: 22px 0 8px; }
.group-head .dot { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.group-head h3 { font-size: 16px; font-weight: 700; }
.group-head .count { font: 500 12px var(--font-mono); color: var(--faint); }
.tcard { background: var(--card); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; text-align: left; width: 100%; border: 0; padding: 0; cursor: pointer; display: block; }
.tcard .cover { height: 92px; display: grid; place-items: center; font: 500 11px/1.3 var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; color: #fff; background: var(--c); position: relative; }
.tcard .cover::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255,255,255,0.08) 0 2px, transparent 2px 12px); }
.tcard .cover span { position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; }
.tcard .body { padding: 10px 12px 12px; }
.bars { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.bar { height: 8px; width: 40px; border-radius: 4px; }
.tcard .name { font: 700 16px/1.3 var(--font-display); }
.tcard .snippet { font-size: 14px; color: var(--muted); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.tcard.open .snippet { -webkit-line-clamp: unset; display: block; }
.tcard .extra { display: none; margin-top: 10px; gap: 8px; flex-wrap: wrap; }
.tcard.open .extra { display: flex; }
.pill { font: 700 12px/1 var(--font-body); padding: 5px 8px; border-radius: 6px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font: 500 11px/1 var(--font-mono); padding: 5px 7px; border-radius: 4px; background: var(--paper); color: var(--muted); margin-top: 8px; }
.badge.booked { background: #1F845A; color: #fff; }

/* Trip view */
.trip-head h1 { font: 800 34px/1.05 var(--font-display); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.stat { background: var(--card); border-radius: 10px; padding: 10px; box-shadow: var(--shadow); }
.stat b { display: block; font: 800 24px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.month { margin-top: 18px; }
.month h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .dow { font: 500 10px var(--font-mono); color: var(--faint); text-align: center; text-transform: uppercase; }
.cell { aspect-ratio: 1 / 1; max-width: 100%; border-radius: 7px; border: 0; padding: 4px; font: 700 13px/1 var(--font-body); font-variant-numeric: tabular-nums; color: #fff; background: var(--c, transparent); text-align: left; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; }
.cell.transit { background: repeating-linear-gradient(-45deg, #2A3A52 0 5px, #3A4D6B 5px 10px); }
.cell.gap { color: var(--muted); border: 1.5px dashed var(--line); background-image: repeating-linear-gradient(-45deg, var(--hatch) 0 4px, transparent 4px 8px); }
.cell.out { background: transparent; color: var(--faint); cursor: default; opacity: 0.5; }
.cell.today { outline: 3px solid var(--ink); outline-offset: 1px; }
.cell .dots { display: flex; gap: 2px; align-self: flex-end; }
.cell .dots i { width: 5px; height: 5px; border-radius: 50%; background: #fff; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.route { display: grid; gap: 6px; }
.leg { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 12px; background: var(--card); border-radius: 10px; padding: 12px 14px 12px 0; box-shadow: var(--shadow); text-align: left; border: 0; width: 100%; cursor: pointer; overflow: hidden; }
.leg .band { background: var(--c); border-radius: 0 4px 4px 0; }
.leg .title { font: 700 16px/1.3 var(--font-display); }
.leg .meta { font-size: 14px; color: var(--muted); }
.hop { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 2px 4px 2px 20px; font-size: 13px; color: var(--muted); }
.hop span { display: inline-flex; align-items: center; gap: 5px; }
.hop svg { width: 14px; height: 14px; }
.hop.gap { color: var(--warn); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chipbtn { cursor: pointer; }
.chipbtn i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.findings { background: var(--card); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.findings ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 15px; }

/* Places */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { border: 0; padding: 0; border-radius: 12px; overflow: hidden; background: var(--card); box-shadow: var(--shadow); text-align: left; cursor: pointer; display: flex; flex-direction: column; }
.tile .top { background: var(--c); color: #fff; padding: 12px; min-height: 76px; display: flex; align-items: flex-end; font: 800 19px/1.1 var(--font-display); position: relative; }
.tile .top::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255,255,255,0.07) 0 2px, transparent 2px 12px); }
.tile .top span { position: relative; z-index: 1; }
.tile .info { padding: 10px 12px 12px; font-size: 13px; color: var(--muted); display: grid; gap: 2px; }
.tile .info b { color: var(--ink); font-weight: 700; }
.back { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--accent); cursor: pointer; padding: 8px 0; font-weight: 700; }

/* Tab bar */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); z-index: 10; }
.tabs nav { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: var(--tab-h); }
.tabs button { border: 0; background: none; display: grid; place-items: center; align-content: center; gap: 2px; font-size: 12px; color: var(--muted); cursor: pointer; }
.tabs button[aria-current="page"] { color: var(--accent); font-weight: 700; }
.tabs svg { width: 22px; height: 22px; }
.empty { color: var(--muted); font-size: 15px; }
@media (prefers-reduced-motion: no-preference) { .tcard, .leg, .tile, .cell { transition: transform 120ms ease; } .tcard:active, .leg:active, .tile:active, .cell:active { transform: scale(0.985); } }
@media (max-width: 380px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pass .code { font-size: 24px; } }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ===== Live app additions ===== */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; overscroll-behavior-y: contain; }
[hidden] { display: none !important; }
button { -webkit-tap-highlight-color: transparent; }
.topbar { position: sticky; top: 0; z-index: 9; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding-top: env(safe-area-inset-top, 0px); }
.topbar .inner { max-width: 560px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; }
.tripname { border: 0; background: none; padding: 6px 0; font: 700 15px/1.2 var(--font-display); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.syncpill { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 10px; min-height: 32px; display: inline-flex; align-items: center; gap: 6px; font: 500 11px/1 var(--font-mono); letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted); cursor: pointer; white-space: nowrap; flex: none; }
.syncpill:empty { display: none; }
.syncpill svg { width: 14px; height: 14px; }
.syncpill.ok { color: #1F845A; border-color: color-mix(in srgb, #1F845A 45%, var(--line)); }
.syncpill.off { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.syncpill.busy svg { animation: bob 1s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(2px); } }
main:focus { outline: none; }

.daytitle { border: 0; background: none; cursor: pointer; padding: 2px; }
.iconbtn svg { width: 20px; height: 20px; }
.postcard { background-size: cover; background-position: center; cursor: pointer; }
.postcard.has-photo { min-height: 190px; }
.postcard.has-photo::after { display: none; }
.postcard.transit { cursor: default; }
.postcard .route { line-height: 1.35; }
.slot[data-card] { cursor: pointer; }
.slot.pencil, .crow.pencil { border: 2px dashed color-mix(in srgb, var(--c) 60%, var(--line)); border-left-width: 5px; box-shadow: none; }
.slot.flight .pass { margin-top: 10px; }
.slot .title .status, .slot .title .who { vertical-align: 2px; margin-left: 4px; }
.pass sup { font-size: 10px; color: var(--warn); margin-left: 2px; }
.lay { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.lay svg { width: 14px; height: 14px; }
.perf { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.perf .row { margin-top: 0; }
.itin { display: block; width: 100%; border-radius: 8px; margin-top: 10px; border: 1px solid var(--line); cursor: zoom-in; background: #fff; }
img.missing { display: none; }
.stayband { margin-top: 10px; width: 100%; display: flex; align-items: center; gap: 10px; border: 0; border-left: 5px solid var(--c); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); padding: 12px 12px 12px 14px; text-align: left; cursor: pointer; font-size: 15px; }
.stayband span { flex: 1; min-width: 0; }
.stayband svg:last-child { color: var(--faint); }
.flag { margin-top: 10px; }
.flag svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }

.status { display: inline-flex; align-items: center; gap: 3px; font: 700 11px/1 var(--font-body); padding: 4px 7px; border-radius: 999px; white-space: nowrap; }
.status svg { width: 12px; height: 12px; stroke-width: 2.6; }
.status.confirmed { background: #1F845A; color: #fff; }
.status.decided { background: color-mix(in srgb, #1F845A 16%, var(--card)); color: color-mix(in srgb, #1F845A 80%, var(--ink)); border: 1px dashed #1F845A; }
.status.maybe { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.who { display: inline-flex; align-items: center; gap: 3px; font: 700 11px/1 var(--font-body); padding: 4px 7px; border-radius: 999px; background: var(--paper); color: var(--muted); }
.who svg { width: 12px; height: 12px; }
.lbl { font: 700 11px/1 var(--font-body); padding: 4px 7px; border-radius: 4px; background: color-mix(in srgb, var(--c) 28%, var(--card)); color: var(--ink); border-left: 4px solid var(--c); }
.chip { cursor: pointer; min-height: 32px; }
.chip svg { width: 14px; height: 14px; flex: none; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.primary { background: var(--accent); border-color: var(--accent); color: var(--paper); font-weight: 700; }
.chip:disabled { opacity: 0.45; cursor: default; }
.chip.conf b { letter-spacing: 0.06em; }
.chipbtn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chips.filter { margin: 10px 0 4px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.chips.filter::-webkit-scrollbar { display: none; }
.chips.filter .chip { flex: none; max-width: none; }

.fold { margin-top: 8px; }
.fold summary { list-style: none; display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: 10px 2px; font: 700 15px var(--font-display); }
.fold summary::-webkit-details-marker { display: none; }
.fold summary .count, .group-head .count { font: 500 12px var(--font-mono); color: var(--faint); }
.fold summary span:first-child::before { content: "▸"; display: inline-block; width: 16px; color: var(--faint); transition: transform 120ms; }
.fold[open] summary span:first-child::before { transform: rotate(90deg); }
.crow { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; width: 100%; text-align: left; border: 0; border-left: 5px solid var(--c); background: var(--card); border-radius: 10px; box-shadow: var(--shadow); padding: 8px 12px 8px 8px; cursor: pointer; }
.crow .thumb { width: 64px; height: 64px; border-radius: 7px; object-fit: cover; background: var(--paper); display: block; }
.crow .thumb.ph { display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--card)); }
.crow .thumb.ph svg { width: 24px; height: 24px; }
.crow .body { display: grid; gap: 3px; min-width: 0; }
.crow .name { font: 700 15px/1.25 var(--font-display); }
.crow .sub2 { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.crow .tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crow .tags:empty { display: none; }
.tag { display: inline-flex; align-items: center; gap: 2px; font: 500 11px var(--font-mono); color: var(--faint); }
.tag svg { width: 13px; height: 13px; }

.notice { margin-top: 14px; width: 100%; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 12px; text-align: left; cursor: pointer; font-size: 15px; }
.notice span { flex: 1; }
.notice.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); font-weight: 700; }
.cell { cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; text-shadow: 0 1px 1px rgba(0,0,0,.25); }
.cell.transit, .cell.out { text-shadow: none; }
.cell.nobed { box-shadow: inset 0 0 0 2px var(--card), inset 0 0 0 3.5px var(--warn); }
.cell .dots i.j { background: #FFD479; border-radius: 1px; transform: rotate(45deg); }
.legend i.j { width: 9px; height: 9px; background: #C99A2E; transform: rotate(45deg); border-radius: 1px; }
.legend i.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.leg > span:last-child { display: grid; gap: 2px; min-width: 0; }
.leg .title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
button.hop { border: 0; background: none; text-align: left; cursor: pointer; width: 100%; align-items: center; padding-block: 6px; }
.tile .top { background-size: cover; background-position: center; min-height: 96px; }
.tile .top.has-photo::after { display: none; }
.group-head { justify-content: space-between; }

.docgroup { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); margin-top: 12px; overflow: hidden; }
.dochead { width: 100%; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border: 0; background: none; padding: 12px 14px 6px; text-align: left; cursor: pointer; font-size: 15px; }
.dochead .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.dochead .sub { margin-left: auto; font-size: 13px; }
.docrow { width: 100%; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; border: 0; border-top: 1px solid var(--line); background: none; padding: 12px 14px; min-height: 48px; text-align: left; cursor: pointer; color: var(--accent); }
.docrow .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.docrow .size { font: 500 11px var(--font-mono); color: var(--faint); }
.docrow .saved { color: var(--faint); display: grid; }
.docrow .saved.yes { color: #1F845A; }
.docrow .saved svg { width: 16px; height: 16px; }
.doclist { background: var(--paper); border-radius: 10px; overflow: hidden; }
.doclist .docrow:first-child { border-top: 0; }
.doclist .docrow { grid-template-columns: 20px minmax(0, 1fr) auto; }

.issues { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.issues li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; background: var(--card); border-radius: 10px; padding: 12px; box-shadow: var(--shadow); font-size: 15px; }
.issues li.warn > svg { color: var(--warn); }
.issues li.info > svg { color: var(--faint); }
.linkbtn { border: 0; background: none; color: var(--accent); padding: 6px 0 0; cursor: pointer; font-weight: 700; font-size: 14px; }

.panel { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 14px 16px; margin-top: 12px; }
.panel h3 { font-size: 17px; }
.panel .sub { margin: 4px 0 0; }
.panel .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.meter { height: 8px; border-radius: 4px; background: var(--paper); margin-top: 10px; overflow: hidden; }
.meter i { display: block; height: 100%; background: #1F845A; border-radius: 4px; transition: width 200ms; }
.foot { text-align: center; margin-top: 20px; }
.welcome { display: grid; gap: 14px; padding-top: 10px; }
.bigbtn { border: 0; border-radius: 12px; background: var(--accent); color: var(--paper); font: 700 17px var(--font-display); padding: 14px 18px; min-height: 52px; cursor: pointer; width: 100%; }
.loading { display: grid; place-items: center; gap: 12px; padding: 80px 0; color: var(--muted); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 10px; font-size: 14px; z-index: 50; max-width: min(92vw, 480px); text-align: center; box-shadow: 0 6px 24px rgba(0,0,0,.25); }

/* Card sheet and viewer */
dialog { color: var(--ink); }
.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92dvh; border-radius: 18px 18px 0 0; background: var(--card); overflow-y: auto; overscroll-behavior: contain; }
.sheet::backdrop, .viewer::backdrop { background: rgba(10, 16, 24, 0.55); }
.sheet-close { position: sticky; top: 10px; float: right; margin: 10px 10px -54px 0; z-index: 3; box-shadow: var(--shadow); }
.sheet-cover { display: block; width: 100%; height: 210px; object-fit: cover; cursor: zoom-in; background: var(--paper); }
.sheet-body { padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px)); }
.sheet-body .kind { display: flex; align-items: center; gap: 6px; font: 500 11px/1.3 var(--font-mono); letter-spacing: 0.05em; text-transform: uppercase; padding-right: 50px; }
.sheet-body .kind svg { width: 15px; height: 15px; }
.sheet-body h2 { font-size: 24px; line-height: 1.15; margin: 6px 0 10px; padding-right: 40px; }
.sheet-body .row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sheet-body .actions { margin-top: 12px; gap: 8px; }
.whenline { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; margin: 10px 0 0; font-size: 15px; }
.whenline svg { width: 18px; height: 18px; color: var(--muted); margin-top: 2px; }
.sheet-h { font: 500 12px var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 22px 0 8px; }
.sheet-legs { display: grid; gap: 8px; margin-top: 14px; }
.sheet-legs .slot { background: var(--paper); box-shadow: none; }
.md { font-size: 16px; overflow-wrap: anywhere; }
.md p { margin: 0 0 10px; }
.md h4 { font: 700 16px var(--font-display); margin: 14px 0 6px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 20px; }
.md blockquote { margin: 0 0 10px; padding-left: 10px; border-left: 3px solid var(--line); color: var(--muted); }
.md-img { display: block; max-width: 100%; border-radius: 8px; margin: 8px 0; }
.photos { display: grid; grid-auto-flow: column; grid-auto-columns: 72%; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.photos img { width: 100%; height: 190px; object-fit: cover; border-radius: 10px; scroll-snap-align: start; cursor: zoom-in; background: var(--paper); }
.sheet-foot { margin: 22px 0 0; font-size: 14px; }
.viewer { border: 0; padding: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: #0B0F14; color: #fff; }
.viewer .sheet-close { position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); right: 10px; margin: 0; float: none; }
#viewer-content { height: 100%; display: flex; flex-direction: column; }
.viewer-bar { padding: calc(12px + env(safe-area-inset-top, 0px)) 64px 12px 14px; display: grid; gap: 8px; }
.viewer-bar b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-bar .row { display: flex; gap: 8px; flex-wrap: wrap; }
.viewer-frame { flex: 1; width: 100%; border: 0; background: #fff; }
.viewer-img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }

/* Map */
.map { height: calc(100dvh - 48px - var(--tab-h) - 132px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); min-height: 320px; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); z-index: 0; background: var(--line); }
.mapnote { margin: 8px 2px 0; font-size: 12px; }
.pin { display: block; width: 22px; height: 22px; border-radius: 50% 50% 50% 2px; transform: rotate(-45deg); background: var(--c); border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); }
.pin.big { width: 30px; height: 30px; border-width: 3px; }
.pin.maybe { opacity: 0.75; border-style: dashed; }
.leaflet-container { font: inherit; }
.pop { display: grid; gap: 4px; font-size: 14px; color: #16202C; }
.pop span { color: #566273; font-size: 13px; }
.pop .row { display: flex; gap: 6px; margin-top: 6px; }
.pop .chip { color: #16202C; background: #fff; border-color: #D6DCE4; text-decoration: none; }
.pop .chip.primary { background: #1F4FA3; border-color: #1F4FA3; color: #fff; }

/* Tablet and laptop: wider column, two-up lists. */
@media (min-width: 900px) {
  .app, .topbar .inner, .tabs nav { max-width: 920px; }
  .group, .route { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .route .hop { grid-column: 1 / -1; }
  .timeline { max-width: 620px; }
  .sheet { margin: auto; border-radius: 18px; max-width: 640px; max-height: 88dvh; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .month { max-width: 460px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.pass .t { white-space: nowrap; font-size: 12px; }
.when small { white-space: normal; }
.viewer .sheet-close { color: #16202C; background: #fff; }
.viewer-open { flex: 1; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; }
.viewer-open svg { width: 56px; height: 56px; opacity: 0.7; }
.viewer-open .bigbtn { text-decoration: none; display: inline-block; width: auto; min-width: 220px; background: #fff; color: #16202C; }
.viewer-bar .chip { color: #16202C; background: #fff; text-decoration: none; }
.viewer-bar .chip.primary { background: #8EAEFF; border-color: #8EAEFF; color: #0B0F14; }
.tl.past { opacity: 0.55; }
.tl.next .slot { outline: 2px solid var(--accent); outline-offset: 1px; }
.nextlabel { font: 500 11px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 4px 0 4px 72px; }
