/* Trip app. Warm "Sicily" look: cream paper, serif titles, mono labels, one accent color per trip. */
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 500 600; font-display: swap; src: url(fonts/cormorant-garamond-latin.woff2) format('woff2'); }
:root {
  --bg: #f6f0e4; --card: #fbf8f0; --card2: #efe6d3; --text: #2b2520; --muted: #6c6154; --line: #e1d6c0;
  --accent: #c4624a; --accent-rgb: 196,98,74; --ink-l: #a14a34; --ink-d: #e08a72; --fill: #b5563f; --fill-rgb: 181,86,63;
  --accent-ink: var(--ink-l);
  --ok-bg: #dfe9d3; --ok-fg: #36592a;
  --warn-bg: #f6e6bd; --warn-fg: #6e4d05;
  --bad-bg: #f5d9d0; --bad-fg: #8e2f1d;
  --off-bg: #e8dfcd; --off-fg: #5c5246;
  --shadow: 0 1px 2px rgba(60,40,20,.05);
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --navh: 62px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1a16; --card: #2a241f; --card2: #342d26; --text: #f1e9dc; --muted: #b5a898; --line: #413930;
    --accent-ink: var(--ink-d);
    --ok-bg: #2b3a24; --ok-fg: #b5d9a0;
    --warn-bg: #43361a; --warn-fg: #ecce84;
    --bad-bg: #4a2a22; --bad-fg: #f2aa98;
    --off-bg: #3a332b; --off-fg: #c2b6a5;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  padding-left: var(--sal); padding-right: var(--sar);
  padding-bottom: calc(var(--sab) + 96px); /* room for the host badge at the bottom right */
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); }
.serif { font-family: var(--serif); font-weight: 500; letter-spacing: -.005em; }
.mono, .label { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.label.warn { color: var(--bad-fg); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

/* Header block (scrolls away) */
#hero { max-width: 720px; margin: 0 auto; padding: calc(var(--sat) + 12px) 20px 10px; }
.hero-card {
  border-radius: 22px; padding: 12px 16px 16px; border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 17%, var(--card)), color-mix(in srgb, var(--accent) 7%, var(--card)));
  box-shadow: var(--shadow);
}
.hero-card { position: relative; }
.hero-card .label { color: var(--text); font-weight: 600; }
/* App version: small and muted, bottom right of the title card (Mark, 2026-11-25). */
.hero-foot { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin: 6px -4px -10px 0; }
.app-version { font-size: 11px; line-height: 1; color: var(--muted); opacity: .75; font-variant-numeric: tabular-nums; }
/* Status chips next to the version: a filled dot = done, a hollow dot = a step to do (tap to do it). Mark, 2026-11-29. */
.app-status { display: inline-flex; gap: 8px; }
.app-status:empty { display: none; }
.stat-chip { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; font-size: 11px; line-height: 1; color: var(--muted); }
.stat-chip .sd { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; box-sizing: border-box; }
.stat-chip.ok .sd { background: var(--ok-fg, #3a8a4a); border-color: var(--ok-fg, #3a8a4a); }
button.stat-chip.todo { color: var(--accent-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
#tripDates { font-size: 24px; line-height: 1.1; margin: 0 0 8px; color: var(--text); opacity: .86; }
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
#tripName { font-size: 42px; line-height: 1; margin: 6px 0 4px; font-weight: 500; overflow-wrap: anywhere; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--muted); font-size: 14px; }
.hero-meta:not(:has(*:not([hidden]):not(:empty))) { display: none; }
.badge { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; background: var(--card2); color: var(--off-fg); }
.switch {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 99px;
  background: var(--card); border: 1px solid var(--line); font-size: 14px; font-weight: 600; flex: none;
}
.switch .dot, .trip-row .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }
.switch .caret { font-size: 11px; color: var(--muted); }

/* Tabs: at the TOP, sticky (the bottom right is covered by the host badge) */
#navwrap { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
#tabbar { display: flex; max-width: 720px; margin: 0 auto; padding: 0 8px; }
#tabbar button {
  flex: 1; min-height: 56px; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12.5px; font-weight: 500; padding: 4px 0 2px;
}
#tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#tabbar button[aria-selected="true"] { color: var(--accent-ink); border-bottom-color: var(--accent); font-weight: 700; }
#editStrip { background: var(--warn-bg); color: var(--warn-fg); text-align: center; font-size: 13px; font-weight: 600; padding: 4px 10px; }

main { padding: 16px 20px 0; max-width: 720px; margin: 0 auto; }
main > * + * { margin-top: 18px; }
main.mapmode { padding-left: 0; padding-right: 0; }
.panel { background: var(--card); border-radius: 16px; padding: 12px 14px; margin: 12px 20px 0; box-shadow: var(--shadow); border: 1px solid var(--line); border-left: 4px solid var(--accent); max-width: 680px; }
@media (min-width: 760px) { .panel { margin-left: auto; margin-right: auto; } }
.panel.issues { border-left-color: var(--warn-fg); }
.panel.issues.has-errors { border-left-color: var(--bad-fg); }
.panel h3 { margin: 0 0 4px; font-size: 14px; }
.panel ul { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
.panel li.err { color: var(--bad-fg); }
.panel .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.panel .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.x { background: none; border: 0; font-size: 22px; min-width: 44px; min-height: 44px; color: var(--muted); margin: -8px -10px -8px 0; }

.btn {
  min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 600;
}
.btn.primary { background: var(--fill); color: #fff; border-color: var(--fill); }
.btn.danger { color: var(--bad-fg); }
.btn.small { min-height: 44px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: .5; }
.link-btn { background: none; border: 0; color: var(--accent-ink); font-weight: 600; min-height: 44px; padding: 0 2px; }
.page-head h2 { font-size: 40px; line-height: 1; margin: 4px 0 6px; }
.page-head p { margin: 0; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card.empty { text-align: center; padding: 32px 18px; }
.card .serif.big { font-size: 34px; line-height: 1.05; margin: 4px 0 8px; }
.card-head, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section-head { margin-bottom: 2px; }
.count { font-family: var(--mono); font-size: 12px; background: var(--bad-bg); color: var(--bad-fg); border-radius: 99px; min-width: 24px; text-align: center; padding: 1px 8px; }
.tonight { margin-top: 12px; }
.warn-text { color: var(--bad-fg); font-weight: 600; margin: 12px 0 0; }
.status .rows, .attention .rows { margin-top: 8px; }
.status p.muted { margin: 0 0 8px; }

/* Rows: events, plan, menu */
.rows { display: flex; flex-direction: column; gap: 8px; }
.row, .thing-hit {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; min-height: 60px; padding: 10px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
}
.status .row, .attention .row { background: var(--bg); box-shadow: none; }
.icon-circle {
  width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--card2); display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-title { font-weight: 700; overflow-wrap: anywhere; line-height: 1.25; }
.row-sub { color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }
.row-note { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.chev { color: var(--muted); font-size: 24px; line-height: 1; flex: none; }
.row.s-cancelled .row-title { text-decoration: line-through; color: var(--muted); }
.row.plan.over { opacity: .55; }
.row.plan.over .row-title, .row.plan.over .row-sub, .row.plan.over .row-note, .row.plan.over .row-conf { text-decoration: line-through; }
.row.endline { border-style: dashed; background: transparent; box-shadow: none; min-height: 52px; }
.row.menu:disabled { opacity: .5; }
.row.menu.danger .row-title { color: var(--bad-fg); }
.row.plan { align-items: flex-start; }
.check { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid var(--line); margin-top: 6px; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; }
.check.on { background: var(--ok-fg); border-color: var(--ok-fg); color: var(--card); }
.row.plan .chip { margin-top: 4px; }
/* Route | Bookings switch, town tag, town badge, Bookings filter chips */
.routeswitch { display: flex; gap: 2px; padding: 3px; margin: 0 0 14px; border-radius: 99px; background: var(--card2); border: 1px solid var(--line); max-width: 360px; }
.routeswitch .seg { flex: 1; min-height: 40px; border: 0; border-radius: 99px; background: transparent; color: var(--muted); font: inherit; font-weight: 600; }
.routeswitch .seg.on { background: var(--card); color: var(--accent-ink); box-shadow: var(--shadow); font-weight: 700; }
.town-tag { align-self: flex-start; margin-left: -4px; display: inline-block; margin-top: 4px; padding: 7px 4px; min-height: 32px; box-sizing: border-box; color: var(--accent-ink); font-weight: 700; font-size: 13.5px; cursor: pointer; }
.book-badge { position: absolute; top: 12px; right: 12px; z-index: 1; padding: 8px 12px; min-height: 32px; box-sizing: border-box; border-radius: 99px; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; font-weight: 700; cursor: pointer; border: 1px solid transparent; }
.book-badge.todo { background: var(--warn-bg); color: var(--warn-fg); }
.book-badge.done { background: var(--ok-bg); color: var(--ok-fg); }
.basecard { position: relative; }
.chip-btn { min-height: 40px; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; }
.chip-btn.on { background: var(--accent-ink); color: var(--bg); border-color: var(--accent-ink); }
.filter-chips { margin: 10px 0 0; }
.row.focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent); transition: box-shadow .3s; }
.day.focus { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 12px; }
.plan-sec { margin-top: 18px; }
.plan-sec > .label { margin-bottom: 8px; }
.chip { flex: none; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; padding: 4px 9px; border-radius: 99px; white-space: nowrap; }
.chip.confirmed { background: var(--ok-bg); color: var(--ok-fg); }
.chip.pending { background: var(--warn-bg); color: var(--warn-fg); }
.chip.not_booked { background: var(--bad-bg); color: var(--bad-fg); }
.chip.cancelled, .chip.other { background: var(--off-bg); color: var(--off-fg); }

/* Journey cards, tiles */
.hscroll { display: flex; gap: 12px; overflow-x: auto; margin: 8px -20px 0; padding: 4px 20px 8px; scroll-snap-type: x proximity; scroll-padding: 0 20px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.jcard {
  flex: none; width: 150px; min-height: 148px; scroll-snap-align: start; text-align: left; display: flex; flex-direction: column; gap: 6px;
  padding: 16px 14px 14px; border-radius: 22px; background: var(--card); border: 1px solid var(--line);
}
.jcard .mono { font-size: 10.5px; }
.jname { font-size: 26px; line-height: 1.02; overflow-wrap: anywhere; flex: 1; }
.jcard .bar { width: 28px; height: 3px; border-radius: 2px; background: var(--line); margin-top: 4px; }
.jcard.now { border-color: var(--accent); }
/* Town photo cards: photo plus the accent overlay of the town page header; white text sits on the solid part */
.jcard.has-photo, .basecard.has-photo { background-size: cover; background-position: center; border-color: rgba(var(--fill-rgb), .6); }
.jcard.has-photo { justify-content: flex-end; background-image: linear-gradient(to top, rgba(var(--fill-rgb), .9) 0, rgba(var(--fill-rgb), .88) 64%, rgba(var(--fill-rgb), .12) 100%), var(--photo); }
.basecard.has-photo { background-image: linear-gradient(to right, rgba(var(--fill-rgb), .92) 0, rgba(var(--fill-rgb), .88) 58%, rgba(var(--fill-rgb), .1) 100%), var(--photo); padding-right: 30%; min-height: 104px; }
.basecard.has-photo .mono { font-size: 10.5px; letter-spacing: .06em; }
.has-photo .mono, .has-photo .muted, .has-photo .jname, .has-photo .bname { color: #fff; }
.jcard.has-photo .bar { background: rgba(255,255,255,.7); }
.jcard.now.has-photo { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.jcard.now .bar { background: var(--accent); width: 44px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.tile { text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 16px; min-height: 112px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); }
.tile-icon { font-size: 26px; line-height: 1.1; margin-bottom: 8px; }
.tile-title { font-weight: 700; font-size: 17px; }

/* Route */
.routemap { height: 210px; background: var(--card2); }
.basemap { height: 260px; border-radius: 14px; overflow: hidden; margin-top: 10px; }
.nomap { display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; color: var(--muted); font-size: 14px; }
.linkcard { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 12px; text-decoration: none; color: var(--text); border-radius: 18px; }
.timeline { position: relative; margin-top: 18px; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 24px; bottom: 24px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-left: 38px; }
.tl-dot { position: absolute; left: 0; top: 24px; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); border: 4px solid var(--muted); }
.tl-dot.now { border-color: var(--accent); background: var(--accent); }
.basecard { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 16px 18px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); min-height: 88px; }
.bname { font-size: 30px; line-height: 1.05; }
.tl-leg { padding: 6px 0 6px 38px; min-height: 40px; }
.leg { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); min-height: 44px; flex-wrap: wrap; }
.leg-text { flex: 1; min-width: 150px; }
.dir { font-weight: 700; text-decoration: none; padding: 10px 0; white-space: nowrap; }
button.dir { background: none; border: 0; font: inherit; font-weight: 700; color: var(--accent-ink); cursor: pointer; padding: 10px 0; }
.dirs { display: inline-flex; gap: 14px; flex-wrap: wrap; }

/* Base page */
.back { background: none; border: 0; color: var(--accent-ink); font-weight: 600; min-height: 44px; padding: 0 4px; font-size: 17px; margin-left: -4px; }
.base-hero {
  position: relative; min-height: 210px; border-radius: 22px; overflow: hidden; display: flex; align-items: stretch; background-size: cover; background-position: center;
  background-image: linear-gradient(135deg, rgba(var(--fill-rgb), 1), rgba(var(--accent-rgb), .75) 70%, rgba(var(--fill-rgb), .9));
}
.base-hero .panel { margin: 0; border: 0; border-radius: 0; box-shadow: none; max-width: none; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 20px 18px; background: transparent; color: #fff; }
.base-hero.has-photo .panel { width: 56%; background: rgba(var(--fill-rgb), .85); }
@media (min-width: 560px) { .base-hero.has-photo .panel { width: 40%; } }
.base-hero .mono, .base-hero .cnt { color: #fff; }
.base-hero .cnt { font-size: 14px; }
.base-hero h2 { font-size: 38px; line-height: 1; margin: 2px 0 6px; color: #fff; overflow-wrap: anywhere; }
.credit { font-size: 12px; color: var(--muted); margin-top: 6px !important; }
.editbar { display: flex; gap: 8px; flex-wrap: wrap; }
.disclose { padding: 0 16px; }
.disclose summary { min-height: 52px; display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; list-style: none; }
.disclose summary::-webkit-details-marker { display: none; }
.disclose summary::after { content: "\2304"; margin-left: auto; color: var(--muted); font-size: 18px; }
.disclose[open] summary::after { content: "\2303"; }
.disclose .mapwrap { padding-bottom: 14px; }
.day { margin-top: 22px; }
.day-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-height: 28px; }
.day-head .btn { margin-left: auto; }
.day-head .gphotos { margin-left: auto; font-size: 12px; color: var(--muted); }
.day-head .gphotos + .btn { margin-left: 0; }
.credit .gphotos { color: inherit; }
.today-chip { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; background: var(--fill); color: #fff; border-radius: 99px; padding: 3px 9px; font-weight: 600; }

/* Search */
.searchbox input {
  width: 100%; min-height: 52px; padding: 0 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); font-size: 16px;
}
#searchResults { margin-top: 14px; }

/* Map */
#mapNote, .mapnote { font-size: 13px; color: var(--muted); padding: 4px 20px 6px; min-height: 28px; }
main.mapmode .back { margin-left: 16px; }
#map { height: calc(100dvh - var(--navh) - 120px); min-height: 320px; background: var(--card2); }
.pin { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; background: #fff; border: 2px solid #2563eb; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.pin.num { background: var(--fill); border-color: #fff; color: #fff; font: 700 14px/1 -apple-system, system-ui, sans-serif; }
.pin.t-lodging { border-color: #7c3aed; } .pin.t-car { border-color: #0d9488; }
.pin.t-activity { border-color: #ea580c; } .pin.t-transit { border-color: #64748b; }
.pin.s-cancelled { opacity: .5; }
.leaflet-container { font: inherit; }
.pop h4 { margin: 0 0 2px; font-size: 15px; }
.pop p { margin: 0 0 4px; font-size: 13px; color: #555; }
.pop a { display: inline-block; margin: 4px 10px 2px 0; padding: 6px 0; font-size: 14px; }

/* Dialogs and sheets */
dialog {
  border: 0; border-radius: 22px; padding: 0; background: var(--card); color: var(--text);
  width: min(94vw, 520px); max-height: 92dvh; box-shadow: 0 10px 40px rgba(0,0,0,.4);
}
dialog::backdrop { background: rgba(20,12,6,.5); }
dialog.sheet { margin: auto auto 0; width: 100%; max-width: 560px; border-radius: 26px 26px 0 0; max-height: 90dvh; overflow: hidden; }
.sheet-body { padding: 8px 20px calc(var(--sab) + 24px); overflow-y: auto; max-height: 90dvh; }
.grab { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.sheet-title { flex: 1; min-width: 0; }
.sheet-title h2 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 28px; line-height: 1.08; overflow-wrap: anywhere; }
.sheet-title h2.s-cancelled { text-decoration: line-through; color: var(--muted); }
.sheet-x { width: 44px; height: 44px; border-radius: 50%; background: var(--card2); border: 0; font-size: 24px; line-height: 1; color: var(--muted); flex: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
.sub { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.when { font-weight: 600; margin: 4px 0 0; }
.fields { margin: 12px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14.5px; }
.fields dt { color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding-top: 3px; }
.fields dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.wx { margin: 12px 0 0; font-size: 13.5px; color: var(--muted); }
.wx:empty { display: none; }
.wx-cap { margin-bottom: 4px; }
.wx-days { display: flex; flex-direction: column; gap: 2px; }
.wx-day { display: grid; grid-template-columns: minmax(78px, auto) 22px 1fr auto; align-items: center; gap: 4px 8px; min-height: 28px; color: var(--text); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.wx-d { color: var(--muted); }
.wx-i { text-align: center; font-size: 16px; line-height: 1; }
.wx-r { color: var(--muted); text-align: right; white-space: nowrap; }
.wx-more { margin: 6px 0 0; font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.wx-more a { color: var(--accent-ink); min-height: 32px; display: inline-flex; align-items: center; }
.wx-more .needs-net { display: none; }
html.is-offline .wx-more .needs-net { display: inline; }
.base-wx + .wx-more { margin: 2px 2px 0; }
.wx.wx-tap { color: var(--accent-ink); text-decoration: underline; cursor: pointer; }
.links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.links a, .links button {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 99px;
  background: var(--card2); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; border: 1px solid var(--line);
}
.links button.edit { background: var(--warn-bg); color: var(--warn-fg); border-color: transparent; }
.missing-note { margin-top: 10px; font-size: 12px; color: var(--warn-fg); background: var(--warn-bg); display: inline-block; padding: 3px 9px; border-radius: 6px; }
.sheet-actions { margin-top: 18px; display: flex; gap: 8px; }
.sheet-actions .btn { flex: 1; }
.sheet .label { margin: 16px 0 8px; }
.trip-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.trip-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; min-height: 62px; padding: 10px 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.trip-row.current .trip-pick { border-color: var(--accent); }
.trip-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.trip-name { font-weight: 700; }
.trip-dates { font-size: 13px; color: var(--muted); }
.tick { color: var(--accent-ink); font-weight: 700; }
.trip-del { min-height: 44px; padding: 0 8px; background: none; border: 0; color: var(--bad-fg); font-size: 13px; }
.tk-item { margin-top: 12px; }
.tk-title { font-weight: 700; }
.sheet h3 { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 18px 0 6px; font-weight: 500; }
.sheet ul { margin: 0; padding-left: 20px; }
.sheet li { margin: 3px 0; line-height: 1.4; }
.credits { list-style: none; padding: 0 !important; }

.dlg-body { padding: 16px 18px; overflow-y: auto; max-height: calc(92dvh - 20px); }
.dlg-body h2 { margin: 0 0 10px; font-family: var(--serif); font-weight: 600; font-size: 28px; }
form.form { display: block; }
.fld { display: block; margin: 0 0 10px; }
.fld > span.lbl { display: block; font-size: 13px; color: var(--muted); margin-bottom: 3px; }
.fld input, .fld select, .fld textarea {
  width: 100%; min-height: 44px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); font-size: 16px;
}
.fld input[type=color] { width: 56px; padding: 2px; }
.fld textarea { min-height: 80px; }
.fld.missing input, .fld.missing select, .fld.missing textarea { border-color: var(--warn-fg); background: color-mix(in srgb, var(--warn-bg) 50%, var(--bg)); }
.fld.missing > span.lbl::after { content: " (missing)"; color: var(--warn-fg); }
.fld.invalid input, .fld.invalid select, .fld.invalid textarea { border-color: var(--bad-fg); }
.fld .msg { font-size: 12px; color: var(--bad-fg); margin-top: 2px; }
.fld .msg.warn { color: var(--warn-fg); }
.fld .hint, .check-row .hint { font-size: 12px; color: var(--muted); margin-top: 2px; display: block; }
.accent-ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.check-row { display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 12px; min-height: 44px; }
.check-row input { width: 24px; height: 24px; margin-top: 2px; flex: none; accent-color: var(--fill); }
.check-text { display: block; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions {
  position: sticky; bottom: -16px; display: flex; gap: 8px; padding: 10px 0 16px; background: var(--card);
  border-top: 1px solid var(--line); margin-top: 6px; flex-wrap: wrap;
}
.actions .spacer { flex: 1; }
.found { font-size: 13px; color: var(--muted); margin: -4px 0 10px; }
#toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--sab) + 90px);
  background: #2b2520; color: #fff; padding: 10px 16px; border-radius: 14px; z-index: 100; max-width: 90vw; font-size: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* tickets */
.ticket-row { margin: 12px 0 0; }
.tickets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.ticket { min-height: 44px; padding: 8px 16px; border-radius: 99px; border: 1px solid var(--accent-ink); background: transparent; color: var(--accent-ink); font: inherit; font-weight: 700; }
.ticket.add { border-style: dashed; }
.ticket.missing { border-color: var(--muted); color: var(--muted); font-weight: 400; opacity: .85; }
.ticket-local { display: inline-flex; gap: 6px; align-items: center; }
.ticket-x { min-height: 44px; padding: 8px 10px; border: 0; background: transparent; color: var(--bad-fg); font: inherit; }
.grid2 > *, .fld input[type=date] { min-width: 0; }

/* Confirmation code, booking button, weather lines */
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; text-align: center; }
.conf { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.conf-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; letter-spacing: .04em; font-weight: 600; user-select: all; }
.conf .btn.small { min-height: 36px; padding: 0 12px; }
.booking { margin-top: 14px; }
.booking .btn { width: 100%; }
.row-conf { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; letter-spacing: .04em; color: var(--muted); overflow-wrap: anywhere; }
.base-wx { margin: 10px 2px 0; }
.tonight .wx { margin: 6px 4px 0; }

/* Swipe hints at the bottom of a town page */
.pager { display: flex; justify-content: space-between; gap: 8px; margin-top: 26px; }
.pager-btn { background: none; border: 0; color: var(--accent-ink); font-weight: 600; font-size: 15px; min-height: 44px; padding: 0 6px; max-width: 48%; overflow-wrap: anywhere; }

/* Arrival & parking (stay_info): collapsed section on the town page and in the stop sheet */
.stay-info { margin-top: 18px; padding: 0 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.stay-info > summary.label { display: flex; align-items: center; gap: 8px; min-height: 48px; margin: 0; cursor: pointer; list-style: none; }
.stay-info > summary.label::-webkit-details-marker { display: none; }
.stay-info > summary.label::after { content: "\2304"; margin-left: auto; font-size: 18px; color: var(--muted); }
.stay-info[open] > summary.label::after { content: "\2303"; }
.stay-sub { margin-left: 4px; text-transform: none; letter-spacing: 0; font-family: inherit; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.stay-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.45; padding: 0 0 14px; }
.stay-text a { color: var(--accent-ink); }
.sheet .stay-info { margin-top: 12px; }

/* Things to do */
.thing-hit { color: inherit; }
.things { margin-top: 22px; }
.things { scroll-margin-top: calc(var(--navh) + 16px); }
.things > summary.label { display: flex; align-items: center; min-height: 44px; margin-bottom: 0; cursor: pointer; list-style: none; }
.things > summary.label::-webkit-details-marker { display: none; }
.things > summary.label::after { content: "\2304"; margin-left: auto; font-size: 18px; color: var(--muted); }
.things[open] > summary.label { margin-bottom: 8px; }
.things[open] > summary.label::after { content: "\2303"; }
.thing-list { display: flex; flex-direction: column; gap: 10px; }
.thing { padding: 14px 16px; scroll-margin-top: calc(var(--navh) + 16px); }
.thing.focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.thing.wanted { border-color: var(--accent); }
.thing-head { display: flex; align-items: flex-start; gap: 8px; }
.thing-name { flex: 1; min-width: 0; margin: 2px 0 0; font-size: 17px; line-height: 1.25; font-weight: 700; overflow-wrap: anywhere; }
.thing-head .chip { margin-top: 5px; }
.want-star { flex: none; width: 44px; height: 44px; margin: -8px -10px -8px 0; background: none; border: 0; font-size: 26px; line-height: 1; color: var(--muted); }
.want-star[aria-pressed="true"] { color: var(--accent-ink); }
.thing-text { margin: 6px 0 0; font-size: 14.5px; line-height: 1.4; }
.thing-dist { margin-top: 6px; font-size: 13px; color: var(--muted); font-family: var(--mono); }
.thing .links { margin-top: 10px; gap: 6px; }
.thing .links a { min-height: 40px; padding: 0 12px; font-size: 13.5px; }
.things-credit { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.things-credit a { color: var(--muted); }
.things-live { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.livelink { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; padding: 10px 18px; border-radius: 18px; text-decoration: none; color: var(--text); }
.live-main { display: flex; flex-direction: column; gap: 1px; }
.needs-net { display: none; font-size: 12px; color: var(--warn-fg); }
html.is-offline .needs-net { display: block; }
.things-card .row { background: var(--bg); box-shadow: none; }
.things-card .rows { margin-top: 8px; }

/* ---------- Wide windows (Mac app, iPad, desktop browser): sidebar, center pane, docked details ---------- */
/* Below 900 px the wrapper elements disappear and the phone layout above is unchanged. */
#sidebar, #center, .cols, .col { display: contents; }
#dragstrip { display: none; }
main[data-view=today] .col > * { margin-top: 18px; }
main[data-view=today] .col-a > :first-child { margin-top: 0; }
.leaflet-container.map-notiles { background: color-mix(in srgb, var(--accent) 9%, var(--card2)); }
dialog.askdlg { width: min(92vw, 400px); }
.ask-msg { margin: 0 0 16px; font-size: 16px; line-height: 1.4; }
.ask-actions { display: flex; gap: 8px; justify-content: flex-end; }
.ask-actions .btn { min-width: 96px; }

@media (min-width: 900px) {
  html, body { height: 100%; }
  body { display: grid; grid-template-columns: 260px minmax(0, 1fr) auto; grid-template-rows: 100dvh; height: 100dvh; overflow: hidden; padding: 0; }
  #sidebar {
    display: flex; flex-direction: column; grid-column: 1; grid-row: 1; min-height: 0; overflow-y: auto;
    border-right: 1px solid var(--line); background: color-mix(in srgb, var(--card2) 45%, var(--bg));
  }
  #center { display: block; grid-column: 2; grid-row: 1; min-width: 0; min-height: 0; overflow-y: auto; container-type: inline-size; container-name: center; }
  #sheet.docked { grid-column: 3; grid-row: 1; }

  /* Sidebar: trip card + vertical tabs */
  #hero, #hero[hidden] { display: block !important; max-width: none; margin: 0; padding: 16px 14px 6px; }
  .hero-card { padding: 10px 14px 14px; border-radius: 18px; }
  .hero-row { min-height: 0; flex-wrap: wrap; gap: 8px; }
  .hero-row .label { font-size: 10.5px; letter-spacing: .1em; }
  .switch { min-height: 34px; padding: 0 12px; font-size: 13px; }
  #tripName { font-size: 34px; margin: 8px 0 2px; }
  #tripDates { font-size: 21px; margin-bottom: 6px; }
  #navwrap { position: static; background: none; border: 0; flex: 1 0 auto; padding: 6px 0 20px; }
  #tabbar { flex-direction: column; max-width: none; padding: 0 10px; gap: 2px; }
  #tabbar button {
    flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 42px; padding: 0 12px; border: 0; border-radius: 12px;
    font-size: 15px; text-align: left; position: relative;
  }
  #tabbar svg { width: 22px; height: 22px; flex: none; }
  #tabbar button[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 14%, var(--card)); }
  #tabbar button[aria-selected="true"]::before { content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 3px 3px 0; background: var(--accent); }
  #editStrip { margin: 8px 10px 0; border-radius: 10px; text-align: left; padding: 6px 10px; }

  /* Center pane */
  main { max-width: 884px; padding: 28px 32px 56px; }
  main.mapmode { max-width: none; padding: 16px 0 0; }
  #notice, #issues { width: min(820px, calc(100% - 64px)); max-width: none; margin: 20px auto 0; }
  .page-head h2 { font-size: 46px; }
  #map { height: calc(100dvh - 130px); min-height: 360px; }
  main.mapmode .back { margin-left: 24px; }
  #mapNote, .mapnote { padding-left: 24px; }

  /* Today: two columns when the center pane is wide enough */
  .hscroll { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); overflow: visible; margin: 8px 0 0; padding: 4px 0; }
  .jcard { width: auto; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { min-height: 96px; }

  /* Rows, dense for the mouse */
  .row, .thing-hit { min-height: 54px; padding: 8px 12px; border-radius: 14px; }
  .btn, .btn.small, .link-btn { min-height: 38px; }
  .btn.small { min-height: 34px; }
  .searchbox input { min-height: 48px; font-size: 17px; }
  .thing-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .things-card .row, .status .row, .attention .row { min-height: 52px; }

  /* Hover and focus for mouse use */
  button, .row, .tile, .jcard, .basecard, .thing-hit, a.btn, .links a, .linkcard, .livelink { cursor: pointer; transition: background-color .12s, border-color .12s, box-shadow .12s; }
  :focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
  #tabbar button:hover:not([aria-selected="true"]) { background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--text); }
  .row:hover, .thing-hit:hover, .tile:hover, .basecard:hover, .linkcard:hover, .livelink:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
  .status .row:hover, .attention .row:hover, .things-card .row:hover { background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
  .jcard:hover { border-color: var(--accent); }
  .jcard.has-photo:hover, .basecard.has-photo:hover { filter: brightness(1.06); }
  .btn:hover:not(:disabled), .switch:hover, .links a:hover, .links button:hover { border-color: var(--accent); }
  .btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
  .link-btn:hover, .back:hover, .pager-btn:hover { text-decoration: underline; }
  .sheet-x:hover, .x:hover { color: var(--text); }
  .trip-pick:hover { border-color: var(--accent); }
  .ticket:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }

  /* Details: centered modal between 900 and 1199 px, not a bottom sheet */
  dialog.sheet { margin: auto; width: min(560px, calc(100vw - 64px)); max-width: 560px; border-radius: 22px; max-height: 86dvh; }
  .sheet-body { max-height: 86dvh; padding-top: 18px; padding-bottom: 24px; }
  .grab { display: none; }
  dialog { width: min(560px, calc(100vw - 64px)); }
  dialog.askdlg { width: min(92vw, 400px); }
  .dlg-body { max-height: calc(86dvh - 20px); }

  /* Mac title bar: hidden inset bar, traffic lights at the top left */
  html.desktop-app #dragstrip { display: block; position: fixed; top: 0; left: 0; right: 0; height: 36px; z-index: 40; -webkit-app-region: drag; app-region: drag; }
  html.desktop-app #dragstrip button, html.desktop-app #dragstrip input, html.desktop-app #dragstrip a { -webkit-app-region: no-drag; app-region: no-drag; }
  html.desktop-app #sidebar { padding-top: 40px; }
  html.desktop-app #center { padding-top: 36px; }
  html.desktop-app #sheet.docked { padding-top: 36px; }
}

/* Docked details at 1200 px and up */
@media (min-width: 1200px) {
  dialog.sheet.docked {
    position: static; inset: auto; margin: 0; width: 400px; max-width: none; height: 100dvh; max-height: none; border-radius: 0;
    border-left: 1px solid var(--line); box-shadow: none; background: var(--card); overflow: hidden; color: var(--text);
  }
  dialog.sheet.docked .sheet-body { height: 100%; max-height: none; overflow-y: auto; padding: 20px 22px 32px; }
  dialog.sheet.docked .sheet-title h2 { font-size: 30px; }
}

/* Center pane layouts follow the pane width (the docked details narrow it) */
@container center (min-width: 760px) {
  main[data-view=today] { max-width: 1000px; }
  main[data-view=today] .cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  main[data-view=today] .col { display: block; }
  main[data-view=today] .col > * { margin-top: 18px; }
  main[data-view=today] .col > :first-child { margin-top: 0; }
  main[data-view=plan], main[data-view=search] { max-width: 1000px; }
  main[data-view=plan] .rows, main[data-view=search] .rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 8px; }
}
/* Route: map beside the town list */
@container center (min-width: 900px) {
  main[data-view=route] { max-width: 1240px; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: 28px; align-items: start; }
  main[data-view=route] > * { margin-top: 0; }
  main[data-view=route] > .page-head { grid-column: 1 / -1; margin-bottom: 14px; }
  main[data-view=route] > .routemaps { grid-column: 2; grid-row: 2 / span 2; position: sticky; top: 0; }
  main[data-view=route] > .linkcard { grid-column: 1; grid-row: 2; margin-bottom: 4px; }
  main[data-view=route] > .timeline { grid-column: 1; grid-row: 3; margin-top: 14px; }
  main[data-view=route] .routemap { height: clamp(380px, calc(100dvh - 150px), 600px); }
  main[data-view=route] .routemaps.multi .routemap { height: clamp(260px, calc(50dvh - 110px), 420px); }
}
@container center (max-width: 899px) {
  main[data-view=route] .routemap { height: 400px; }
}

/* Mac app: one-click bar to turn full access on again after an update (ui/desktop.js). */
.access-bar { position: fixed; right: 16px; bottom: 16px; z-index: 50; max-width: 420px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  padding: 10px 12px; border-radius: 14px; background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 14px; }
.access-bar span { flex: 1 1 220px; }
.mapcard-title { padding: 10px 14px 8px; font-size: 14px; color: var(--muted); }
.maptotal { padding: 10px 14px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); }
.maptotal strong { color: var(--text); font-weight: 600; }
.routemaps > .mapcard + .mapcard { margin-top: 12px; }
