/* Design tokens and patterns follow s-bz/db-transports (dark first, light follows the system). */
:root {
  color-scheme: dark light;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", "PingFang HK", sans-serif;
  --bg: #0e1116; --card: #171c24; --card-hover: #1d2430; --chip: #262d38; --line: #262d38;
  --fg: #e7ebf0; --muted: #9aa5b3;
  --open: #3fb950; --open-bg: rgba(63,185,80,.15);
  --partial: #ff9f43; --partial-bg: rgba(255,159,67,.15);
  --closed: #ff6b6b; --closed-bg: rgba(255,107,107,.14);
  --group: #b9a4ff; --group-bg: rgba(167,139,250,.16);
  --live: #3fb950; --ph: #ff6b6b; --star: #f1c40f;
  --band: #121c2b; --raised: #1b222e; --raised-hover: #222a36; --raised-chip: #2a3240;
  --brand: #4aa8ff; --on-brand: #0b1220;
  --shadow: none; --shadow-hover: 0 8px 20px rgba(0,0,0,.35);
}
/* Dark mode stated explicitly too: dark-mode extensions (e.g. Noir in Safari) look for a prefers-color-scheme: dark
   rule to tell a site that has its own dark mode; without one they recolour the page (the nav's highlight vanished). */
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1116; --card: #171c24; --fg: #e7ebf0; --muted: #9aa5b3; --brand: #4aa8ff; }
  .glass-nav { --gn-fill: rgba(30,36,46,.5); --gn-edge: rgba(255,255,255,.28); --gn-edge-low: rgba(255,255,255,.06); --gn-shadow: rgba(0,0,0,.45); --gn-lens: rgba(255,255,255,.12); }
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f6fa; --card: #fff; --card-hover: #fff; --chip: #eef1f6; --line: #e3e8ef;
    --fg: #111; --muted: #5e5e5e;
    --open: #1a7f37; --open-bg: rgba(26,127,55,.11);
    --partial: #b45309; --partial-bg: rgba(180,83,9,.12);
    --closed: #c62828; --closed-bg: rgba(211,47,47,.10);
    --group: #6d4fd6; --group-bg: rgba(109,79,214,.12);
    --live: #1a7f37; --ph: #d32f2f; --star: #c98e00;
    --band: #e6f0fc; --raised: #fff; --raised-hover: #fff; --raised-chip: #eef1f6;
    --brand: #1a6fd8; --on-brand: #fff;
    --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06); --shadow-hover: 0 8px 20px rgba(16,24,40,.10);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
a, button, summary, label { touch-action: manipulation; }
html, body { margin: 0; padding: 0; color: var(--fg); font: 15px/1.5 var(--font); }
/* A faint colour wash behind everything (as db-transports), so the glass nav has something to pick up. It sits on a
   fixed layer, solid at each edge, with thin fixed strips in the same colours: that's what iOS Safari samples to tint
   its bars (the theme-color metas carry the same two colours). Cards stay opaque. */
:root { --edge-top: color-mix(in srgb, var(--bg) 86%, rgb(58, 160, 255)); --edge-bottom: color-mix(in srgb, var(--bg) 89%, rgb(45, 212, 191)); }
@media (prefers-color-scheme: light) { :root { --edge-top: color-mix(in srgb, var(--bg) 84%, rgb(58, 160, 255)); --edge-bottom: color-mix(in srgb, var(--bg) 87%, rgb(45, 212, 191)); } }
html { background-color: var(--edge-top); } /* iOS overscroll shows this: match the wash's top edge */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, var(--edge-top), transparent 36%, transparent 62%, var(--edge-bottom)),
              radial-gradient(60% 30% at 100% 45%, color-mix(in srgb, rgb(255, 159, 67) 9%, transparent), transparent), var(--bg); }
.edge-top::after, .edge-bottom::after { content: ""; position: fixed; left: 0; right: 0; height: 12px; z-index: 30; pointer-events: none; }
.edge-top::after { top: -7px; background: var(--edge-top); }
.edge-bottom::after { bottom: -7px; background: var(--edge-bottom); }
[data-on][hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: 900px; margin: 0 auto;
  padding: calc(24px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(112px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }

/* Brand row on every tab (as db-transports): icon and name, the tab's title right-aligned in brand blue, then the
   actions. One line always: sizes scale with the screen width (so the first paint is close) and app.js shrinks --bb to fit. */
.brand-bar { display: flex; align-items: baseline; flex-wrap: nowrap; white-space: nowrap; gap: 10px; margin: -2px 0 14px; line-height: 1.2; }
.brand-bar + .sr-only + .sub { margin-top: -8px; } /* All pools: the subtitle tucks under the row */
.brand-bar img { flex: none; border-radius: 8px; width: calc(32px * var(--bb, 1)); height: calc(32px * var(--bb, 1)); }
.brand-name { margin: 0; font-size: calc(min(26px, 6.6vw) * var(--bb, 1)); font-weight: 700; letter-spacing: -.01em; }
.brand-tab { margin-left: auto; font-size: calc(min(20px, 5.1vw) * var(--bb, 1)); font-weight: 700; color: var(--brand); }
/* The two texts share a baseline (centring their boxes left the smaller tab title sitting higher); icon and buttons stay centred. */
.brand-bar img, .brand-bar .icon-btn, .brand-bar .spinner { align-self: center; }
.brand-bar .icon-btn, .brand-bar .spinner { flex: none; margin: -6px 0 -6px 2px; }
.brand-bar .spinner { margin: 0 4px 0 2px; }
/* Pull to refresh (installed app), like Safari's: iOS's spoked spinner in the gap the page leaves as it follows the finger.
   Its 8 spokes appear one by one as the pull grows (--spokes, 0..8); while reloading they turn as iOS's do. */
.standalone, .standalone body { overscroll-behavior-y: none; }
.ptr { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 10px); z-index: 25; width: 22px; height: 22px; margin-left: -11px; opacity: 0; pointer-events: none; }
.ptr.on { opacity: 1; }
.ptr i { position: absolute; left: 9.5px; top: .5px; width: 3px; height: 6.5px; border-radius: 1.5px; background: var(--muted);
  transform-origin: 1.5px 10.5px; transform: rotate(calc(var(--k) * 45deg));
  opacity: calc(clamp(0, var(--spokes, 0) - var(--k), 1)); }
.ptr.spinning i { opacity: .25; animation: ptr-spoke 1s linear infinite; animation-delay: calc(var(--k) * 1s / 8 - 1s); }
@keyframes ptr-spoke { 0% { opacity: 1; } 100% { opacity: .25; } }
h1 { font-size: 26px; line-height: 1.2; font-weight: 700; margin: 0; }
h2 { font-size: 20px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; margin: 28px 0 10px; }
.sub { color: var(--muted); font-size: 14px; margin: 6px 0 14px; font-variant-numeric: tabular-nums; }
/* Round action button (refresh), tinted like a native action, as db-transports' share button */
.icon-btn { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--card); color: var(--brand); box-shadow: var(--shadow); transition: transform .15s; }
.icon-btn[hidden] { display: none; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:active { transform: scale(.94); }
.icon-btn span { font-size: 18px; font-weight: 700; }
.icon-btn + .icon-btn { margin-left: -2px; }
.search { width: 100%; margin: 0 0 12px; padding: 13px 20px; background: var(--card); color: var(--fg); border: 0; border-radius: 999px;
  font: inherit; font-size: 16px; box-shadow: var(--shadow); transition: box-shadow .2s; }
.search::placeholder { color: var(--muted); }
.search:focus { outline: none; box-shadow: 0 0 0 2px var(--brand); }

/* Weather: solid red bar, as for HKO warnings in db-transports */
.alert { margin: 0 0 16px; padding: 12px 16px; border-radius: 16px; font-size: 14px; background: var(--ph); color: #fff; }

/* Neutral notice card (offline) and the install offer, as in db-transports */
.notice { margin: 0 0 16px; padding: 12px 16px; border-radius: 16px; font-size: 14px; background: var(--card); box-shadow: var(--shadow); }
.install-hint { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 12px 8px 12px 16px; background: var(--card); border-radius: 16px; font-size: 14px; box-shadow: var(--shadow); }
.install-hint[hidden], .notice[hidden] { display: none; }
.install-hint > div { flex: 1 1 auto; min-width: 0; }
.install-hint p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.install-btn { flex: 0 0 auto; border: 0; border-radius: 999px; padding: 11px 18px; min-height: 44px; background: var(--brand); color: var(--on-brand); font: inherit; font-weight: 600; cursor: pointer; transition: transform .15s; }
.install-btn:active { transform: scale(.96); }
.install-x { transition: transform .15s; } .install-x:active { transform: scale(.85); }
.install-x { flex: 0 0 auto; border: 0; background: none; color: var(--muted); font-size: 16px; min-width: 44px; min-height: 44px; cursor: pointer; }
section[id^="sec-"] { scroll-margin-top: calc(72px + env(safe-area-inset-top)); }

/* Day pills: sticky, public holidays red, selected in brand colour */
.cal { position: sticky; top: env(safe-area-inset-top); z-index: 10; display: flex; gap: 8px; overflow-x: auto;
  margin: 0 -16px; padding: 8px 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cal::-webkit-scrollbar { display: none; }
/* Frosted while stuck over the cards (sticky elements can't tell when they're stuck, so always frosted). */
.cal, .search-bar { background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6); }
.cal .pill { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 52px; padding: 7px 8px;
  border: 0; border-radius: 999px; background: var(--card); color: var(--fg); font: inherit; cursor: pointer; box-shadow: var(--shadow);
  transition: background .15s, transform .15s; }
.cal .pill:active { transform: scale(.94); }
.cal .pill .dow { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cal .pill .dnum { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal .pill.ph .dnum, .cal .pill.ph .dow { color: var(--ph); }
.cal .pill.sel { background: var(--brand); }
.cal .pill.sel .dow, .cal .pill.sel .dnum { color: var(--on-brand); }
.daylabel { color: var(--muted); font-size: 13px; margin: 4px 0 4px; }
.day-extra { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 2px; }
.hol-chip { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--closed-bg); color: var(--ph); cursor: help; }
.daylabel b { color: var(--fg); font-weight: 600; }
.daylabel .fees { text-decoration: underline dotted; text-underline-offset: 3px; }

/* Filters: one row of chips, scrolling sideways on narrow screens (like db-transports' jump pills) */
.filters { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 4px; padding: 2px 16px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.filters::-webkit-scrollbar { display: none; }
.filters > * { flex: 0 0 auto; }
.pill-select { appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; min-height: 40px; padding: 0 34px 0 16px;
  background-color: var(--card); color: var(--fg); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; box-shadow: var(--shadow);
  background-repeat: no-repeat; background-size: 5px 5px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 21px) 55%, calc(100% - 16px) 55%; }
.toggle { position: relative; display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--card); color: var(--muted); font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; box-shadow: var(--shadow);
  transition: background .15s, color .15s, transform .15s; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle:active { transform: scale(.95); }
.toggle:has(input:checked), .toggle[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
.toggle:has(input:disabled) { opacity: .45; cursor: default; }
.toggle:has(input:focus-visible), .pill-select:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Sections: favourites in a tonal band, cards raised one step inside it */
.band { background: var(--band); border-radius: 20px; padding: 2px 12px 12px; margin: 20px -12px 8px;
  --card: var(--raised); --card-hover: var(--raised-hover); --chip: var(--raised-chip); }
.band h2 { margin-top: 16px; }
@media (max-width: 640px) { .band { border-radius: 0;
  margin-inline: calc(-1 * max(16px, env(safe-area-inset-left))) calc(-1 * max(16px, env(safe-area-inset-right)));
  padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); } }
.fav-hint { margin: 2px 0 10px; color: var(--muted); font-size: 14px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.grid + .grid { margin-top: 14px; }
@media (max-width: 720px) { .grid { grid-template-columns: 1fr; } }

/* Cards */
/* Cards rise in on the first draw only (staggered), lift on hover; mini cards give a little on press. */
.card-wrap { position: relative; min-width: 0; transition: transform .2s cubic-bezier(.2,.7,.3,1); }
.intro .card-wrap { animation: rise .35s cubic-bezier(.2,.7,.3,1) backwards; }
.intro .grid > :nth-child(2) { animation-delay: 40ms; } .intro .grid > :nth-child(3) { animation-delay: 80ms; }
.intro .grid > :nth-child(4) { animation-delay: 120ms; } .intro .grid > :nth-child(n+5) { animation-delay: 160ms; }
@media (hover: hover) { .card-wrap:hover { transform: translateY(-2px); } }
.card-wrap.mini:has(> .card > summary:active) { transform: scale(.985); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.card { display: block; background: var(--card); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow); transition: background .15s, box-shadow .2s; }
@media (hover: hover) { .card-wrap:hover > .card { box-shadow: var(--shadow-hover); } }
.card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; padding-right: 34px; }
.card-title { font-size: 16px; font-weight: 600; line-height: 1.3; margin: 0; }
.badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.st-open { background: var(--open-bg); color: var(--open); }
.st-partial { background: var(--partial-bg); color: var(--partial); }
.st-closed { background: var(--closed-bg); color: var(--closed); }
.st-group, .st-unknown { background: var(--group-bg); color: var(--group); }
.addr { display: inline-flex; gap: 5px; margin-top: 6px; font-size: 14px; }
.addr::before { content: ""; flex: 0 0 auto; width: 10px; height: 13px; margin-top: 4px; background: var(--brand);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 13'%3E%3Cpath d='M5 0a5 5 0 0 0-5 5c0 3.6 5 8 5 8s5-4.4 5-8a5 5 0 0 0-5-5zm0 7a2 2 0 1 1 0-4 2 2 0 0 1 0 4z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 13'%3E%3Cpath d='M5 0a5 5 0 0 0-5 5c0 3.6 5 8 5 8s5-4.4 5-8a5 5 0 0 0-5-5zm0 7a2 2 0 1 1 0-4 2 2 0 0 1 0 4z'/%3E%3C/svg%3E") center / contain no-repeat; }
.addr:hover { text-decoration: underline; text-underline-offset: 2px; }
.meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.meta a { text-decoration: underline; text-underline-offset: 2px; }

/* Now line: our status + LCSD live with a pulsing dot */
.now { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 10px; font-size: 14px; }
.live-dot { flex: 0 0 auto; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--live);
  animation: live-pulse 2.4s ease-out infinite; vertical-align: 1px; }
.live-dot.off { background: var(--closed); animation: none; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
.now .muted { color: var(--muted); }
.meter { flex: 0 0 70px; height: 6px; border-radius: 3px; background: var(--chip); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.queue { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 8px; background: var(--chip); }
.queue.q-low { color: var(--open); background: var(--open-bg); }
.queue.q-moderate { color: var(--partial); background: var(--partial-bg); }
.queue.q-high { color: var(--closed); background: var(--closed-bg); }

/* In-card notices: a tinted panel (red when it needs attention) */
.note { margin: 10px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--chip); font-size: 14px; }
.note.warn { background: var(--closed-bg); color: var(--closed); }

/* Sessions: sub-pools × sessions, each cell tinted by state */
.sess { width: calc(100% + 8px); margin: 12px -4px 0; border-collapse: separate; border-spacing: 4px; font-size: 13px; }
.sess th { font-weight: 600; font-size: 11px; color: var(--muted); text-align: center; letter-spacing: .02em; font-variant-numeric: tabular-nums; padding: 0 2px; }
.sess th:first-child { text-align: left; }
.sess td.fac { padding: 2px 4px 2px 0; }
.sess td.cell { text-align: center; border-radius: 8px; padding: 6px 4px; font-weight: 600; font-size: 12px; }
.fac-name { font-size: 14px; }
.fac-name small { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; }
.c-open { background: var(--open-bg); color: var(--open); }
.c-partial { background: var(--partial-bg); color: var(--partial); }
.c-closed { background: var(--closed-bg); color: var(--closed); }
.c-na { background: var(--chip); color: var(--muted); }

/* Collapsed sections */
details.more { margin-top: 10px; font-size: 14px; }
details.more > summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 4px 0; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "›"; display: inline-block; width: 12px; transition: transform .15s; }
details.more[open] > summary::before { transform: rotate(90deg); }
details.more ul { margin: 6px 0 0; padding-left: 18px; }
details.more li { margin: 4px 0; }
details.more li pre { white-space: pre-wrap; font: inherit; margin: 4px 0 0; color: var(--muted); }

/* Star, top-right of the card */
.fav-star { position: absolute; top: 4px; right: 4px; background: none; border: 0; cursor: pointer; font-size: 22px; line-height: 1;
  color: var(--muted); padding: 11px; transition: color .15s, transform .15s; }
.fav-star:hover { color: var(--fg); }
.fav-star:active { transform: scale(.85); }
.fav-star[aria-pressed="true"] { color: var(--star); }

/* Pools closed all day: compact, dimmed; tap to expand */
.card-wrap.mini > .card { padding: 0; opacity: .6; transition: opacity .15s; }
.card-wrap.mini > .card[open] { opacity: 1; }
@media (hover: hover) { .card-wrap.mini:hover > .card { opacity: .9; } }
.mini > .card > summary { display: flex; align-items: center; gap: 10px; padding: 12px 52px 12px 16px; cursor: pointer; list-style: none; }
.mini > .card > summary::-webkit-details-marker { display: none; }
.mini-title { font-size: 14px; font-weight: 600; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-why { flex: 0 1 auto; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.mini > .card[open] > summary .mini-why { display: none; }
.mini-body { padding: 0 18px 16px; }
.card-wrap.mini > .fav-star { top: 2px; font-size: 18px; }

.empty { color: var(--muted); padding: 30px 0; text-align: center; }

/* Screens other than All pools: a plain large title */

/* Floating "glass" bottom nav, from db-transports: blur + saturation + edge highlights (works in iOS Safari too). */
.glass-nav { --gn-fill: rgba(30,36,46,.5); --gn-edge: rgba(255,255,255,.28); --gn-edge-low: rgba(255,255,255,.06); --gn-shadow: rgba(0,0,0,.45); --gn-lens: rgba(255,255,255,.12);
  position: fixed; left: 0; right: 0; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 20; display: flex; justify-content: center; gap: 10px;
  padding: 0 max(16px, env(safe-area-inset-left)); pointer-events: none; }
@media (prefers-color-scheme: light) { .glass-nav { --gn-fill: rgba(255,255,255,.55); --gn-edge: rgba(255,255,255,.75); --gn-edge-low: rgba(255,255,255,.25); --gn-shadow: rgba(16,24,40,.16); --gn-lens: rgba(16,24,40,.07); } }
.gn-pill, .gn-orb { pointer-events: auto; position: relative; background: var(--gn-fill);
  -webkit-backdrop-filter: blur(22px) saturate(1.9) brightness(1.04); backdrop-filter: blur(22px) saturate(1.9) brightness(1.04);
  box-shadow: inset 0 1px 0 var(--gn-edge), inset 0 -1px 0 var(--gn-edge-low), inset 0 0 0 .5px var(--gn-edge-low), 0 6px 18px -4px var(--gn-shadow); }
.gn-pill { --n: 4; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); padding: 5px; border-radius: 999px; width: min(calc(100% - 74px), calc(var(--n) * 78px + 10px)); }
/* The lens under the active tab slides with a small overshoot; no lens on Search. (As db-transports.) */
.gn-lens { position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc((100% - 10px) / var(--n)); border-radius: 999px; background: var(--gn-lens);
  box-shadow: inset 0 1px 0 var(--gn-edge), inset 0 0 0 .5px var(--gn-edge-low), 0 1px 5px rgba(16,24,40,.1);
  transform: translateX(calc(var(--i, 1) * 100%)); transition: transform .5s cubic-bezier(.3,1.35,.5,1), opacity .2s; }
.gn-pill[data-none] .gn-lens { opacity: 0; }
.gn-tab { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; min-height: 54px; padding: 6px 2px 5px;
  border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .01em; color: var(--muted); transition: color .2s, transform .15s; }
.gn-tab span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gn-tab svg, .gn-orb svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gn-tab svg .hole { fill: none; }
.gn-tab[aria-current="page"] { color: var(--brand); }
.gn-tab[aria-current="page"] svg .fill { fill: currentColor; }
.gn-tab[aria-current="page"] svg .hole { fill: var(--bg); stroke: none; }
.gn-tab:active { transform: scale(.94); }
.gn-orb { flex: 0 0 auto; width: 64px; height: 64px; border-radius: 50%; border: 0; display: grid; place-items: center; color: var(--fg); cursor: pointer; font: inherit; transition: transform .15s; }
.gn-orb:active { transform: scale(.92); }
.gn-orb[aria-current="page"] { color: var(--brand); box-shadow: inset 0 1px 0 var(--gn-edge), inset 0 0 0 1.5px var(--brand), 0 6px 18px -4px var(--gn-shadow); }
@media (max-width: 340px) {
  .gn-tab { font-size: 10px; letter-spacing: 0; padding-inline: 0; }
  .gn-tab svg { width: 22px; height: 22px; }
  .gn-orb { width: 56px; height: 56px; }
  .gn-pill { width: min(calc(100% - 66px), calc(var(--n) * 78px + 10px)); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .gn-pill, .gn-orb { background: var(--card); } }

/* Search screen */
.search-bar { position: sticky; top: env(safe-area-inset-top); z-index: 11; display: flex; align-items: center; margin: 0 -16px 8px; padding: 8px 16px; }
/* On Search the day pills stick just below the (also sticky) search bar. */
.search-bar:not([hidden]) ~ .cal { top: calc(env(safe-area-inset-top) + 70px); }
#list > section > .grid:first-child { margin-top: 14px; }
.search-bar input { width: 100%; padding: 14px 48px 14px 46px; border: 0; border-radius: 999px; font: inherit; font-size: 17px; background: var(--card); color: var(--fg); box-shadow: var(--shadow); -webkit-appearance: none; appearance: none; }
.search-bar input:focus { outline: none; box-shadow: 0 0 0 2px var(--brand); }
.search-bar input::-webkit-search-cancel-button { display: none; }
.search-bar input::placeholder { color: var(--muted); }
.search-icon { position: absolute; left: 32px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; color: var(--muted); pointer-events: none; }
.search-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.search-clear { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--chip); color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.search-clear[hidden] { display: none; }
.search-head { display: flex; justify-content: space-between; align-items: baseline; }
.search-head button { border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; padding: 8px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--card); color: var(--fg); font: inherit; font-size: 15px; box-shadow: var(--shadow); cursor: pointer; transition: transform .15s; }
.chip:active { transform: scale(.96); }

/* Empty states (Favourites with nothing starred, Nearby without a location) */
.empty-state { text-align: center; padding: 20px 12px 4px; }
.empty-state h2 { margin: 18px 0 6px; font-size: 22px; }
.empty-state p { margin: 0 auto; max-width: 34ch; color: var(--muted); }
.empty-art { width: 84px; height: 84px; margin: 0 auto; border-radius: 28px; display: grid; place-items: center;
  background: linear-gradient(135deg, #5db4ff, #1769c2); box-shadow: 0 10px 28px rgba(23,105,194,.35), inset 0 1px 0 rgba(255,255,255,.45); }
.empty-art svg { width: 44px; height: 44px; fill: #fff; filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); }
.empty-state .install-btn { margin-top: 18px; }
.browse { margin: 18px 0 0; text-align: center; }
.browse a { color: var(--brand); font-weight: 600; }
/* The hand-drawn "tap the star" arrow: draws itself, then nudges toward the star. Its tip stops short of the star. */
.fav-first { position: relative; margin-top: 64px; }
.fav-hand { position: absolute; z-index: 2; right: 30px; top: -86px; display: flex; flex-direction: column; align-items: flex-end; pointer-events: none; color: var(--brand); animation: hand-nudge 2.2s 2.2s ease-in-out infinite; }
.hand-text { font-family: "Caveat", "Comic Sans MS", "Segoe Print", cursive; font-weight: 700; font-size: 24px; line-height: 1; transform: rotate(-4deg); margin-right: 34px; opacity: 0; animation: hand-fade .4s .3s forwards; }
.fav-hand svg { margin-top: -2px; overflow: visible; }
.hand-path, .hand-head { stroke-dasharray: 1; stroke-dashoffset: 1; }
.hand-path { animation: hand-draw .9s .7s ease-out forwards; }
.hand-head { animation: hand-draw .3s 1.55s ease-out forwards; }
@keyframes hand-draw { to { stroke-dashoffset: 0; } }
@keyframes hand-fade { to { opacity: 1; } }
@keyframes hand-nudge { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(3px, 5px); } }

/* More: grouped rows, as iOS settings */
.group { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); margin: 0 0 18px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 12px 16px; font-size: 16px; }
.row + .row { border-top: 1px solid var(--line); }
a.row::after { content: "›"; color: var(--muted); font-size: 22px; line-height: 1; }
button.row { width: 100%; border: 0; background: none; color: inherit; font: inherit; font-size: 16px; text-align: left; cursor: pointer; }
a.row:active, button.row:active { background: var(--card-hover); }
.group > .row:first-child { border-radius: 16px 16px 0 0; } .group > .row:last-child { border-radius: 0 0 16px 16px; } .group > .row:only-child { border-radius: 16px; }
.row .val { color: var(--muted); text-align: right; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-stack { display: block; }
/* Language picker: the native select, styled as the row's value with a chevron. */
.lang-pick { appearance: none; -webkit-appearance: none; border: 0; background: none; color: var(--muted); font: inherit; font-size: 15px; text-align: right; cursor: pointer;
  padding: 4px 18px 4px 4px; max-width: 60%; background-repeat: no-repeat; background-size: 5px 5px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 10px) 55%, calc(100% - 5px) 55%; }
.lang-pick:focus-visible { outline: 2px solid var(--brand); border-radius: 8px; }
.row-stack small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.group-head { margin: 0 0 6px 16px; color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.fine { color: var(--muted); font-size: 13px; margin: 0 16px 18px; }

/* Loading (as db-transports): placeholders in the shapes of the real cards with a soft shimmer, and a spinner
   beside the header until the data is in. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skel { display: block; border-radius: 10px; background: linear-gradient(100deg, var(--chip) 30%, color-mix(in srgb, var(--chip) 55%, var(--card)) 50%, var(--chip) 70%);
  background-size: 220% 100%; animation: skel-shimmer 1.4s ease-in-out infinite; }
@keyframes skel-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.cal .skel-day { flex: 0 0 auto; width: 52px; height: 58px; border-radius: 999px; }
.skel-line { width: 70%; height: 16px; margin: 6px 0 4px; }
.skel-h2 { width: 120px; height: 22px; margin: 28px 0 12px; }
.skel-head { display: flex; align-items: center; gap: 8px; }
.skel-badge { width: 64px; height: 20px; border-radius: 999px; flex: none; }
.skel-title { height: 18px; flex: 1; max-width: 45%; }
.skel-addr { height: 15px; width: 72%; margin-top: 12px; }
.skel-meta { height: 13px; width: 50%; margin-top: 8px; }
.skel-row { display: grid; grid-template-columns: 1fr 22% 22% 22%; gap: 4px; margin-top: 8px; }
.skel-row:first-of-type { margin-top: 16px; }
.skel-fac { height: 16px; width: 70%; align-self: center; }
.skel-cell { height: 30px; border-radius: 8px; }
.spinner { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--fg) 14%, transparent);
  border-top-color: var(--brand); animation: spinner-turn .8s linear infinite; }
.spinner[hidden], body:not(.loading) #loadSpin { display: none; }
@keyframes spinner-turn { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }
/* Without motion, the arrow is simply there. */
@media (prefers-reduced-motion: reduce) { .hand-text { opacity: 1; } .hand-path, .hand-head { stroke-dashoffset: 0; } }
/* After the global no-motion rule: the spinner still turns (slowly), or loading would look frozen. */
@media (prefers-reduced-motion: reduce) { .spinner { animation: spinner-turn 2.4s linear infinite !important; } .ptr.spinning i { animation: ptr-spoke 2s linear infinite !important; animation-delay: calc(var(--k) * 2s / 8 - 2s) !important; } }
