/* Stylesheet entry — imported by src/main.js. Split by screen/section;
   import order preserves the original cascade. */
/* ════════════════════════════════════════════════════════════════
   Kids Activities — app-shell UI (v2) · kid-themed light redesign

   Architecture notes (kept deliberately iOS-translatable):
   - Screens (Explore / Saved / My Kids / Detail / Venue / Compare)
     map 1:1 to view controllers; the bottom tab bar is a
     UITabBarController, pushed screens are a UINavigationController
     stack, and the filters sheet is a presented sheet.
   - Navigation is hash-routed; the browser history *is* the nav
     stack, so back/forward work and every screen is a shareable URL.
   - All filter state serializes into the #/explore query string.

   Theming: each kid profile carries a theme key ("" Skyline · meadow ·
   comet · unicorn · tide). Selecting a kid sets data-theme on <body>;
   each theme below overrides ONLY the accent family of custom
   properties — ink, surfaces, lines, and layout never change. Two kids
   selected = "duo": kid A drives --accent, kid B's colors ride along
   as --duo-b* inline vars and filled elements become a gradient.
   ════════════════════════════════════════════════════════════════ */
/* ── Design tokens (light, warm) ───────────────────────────── */
:root {
  --bg:         #f6f4ef;
  --surface:    #ffffff;
  --surface-2:  #f1efe9;
  --ink:        #2b2620;
  --ink-2:      #6e675d;
  --muted:      #a39b8e;
  --line:       #e7e3da;
  --green:      #2f9e63;
  --green-dim:  #e3f4ea;
  --amber:      #a86f0a;
  --amber-dim:  #f9efda;
  --danger:     #e5483d;
  --danger-dim: #fdecea;

  /* Accent family — the only tokens the kid themes override (Skyline) */
  --accent:       oklch(0.56 0.14 250);
  --accent-deep:  oklch(0.44 0.13 250);
  --accent-dim:   oklch(0.94 0.025 250);
  --accent-2:     oklch(0.78 0.13 75);
  --accent-2-dim: oklch(0.95 0.04 75);

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-card: 0 1px 3px rgba(43,38,32,.05), 0 2px 8px rgba(43,38,32,.04);
  --shadow-float: 0 6px 24px rgba(43,38,32,.18);
  --font-display: "Baloo 2", -apple-system, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --tabbar-h: 58px;
  --frame-w: 600px;
}
/* ── Kid themes ─────────────────────────────────────────────────
   Each theme overrides ONLY the accent family. Selectors match any
   element carrying data-theme so nested scopes (a selected kid's
   chip, a Saved group) retint their own subtree via inheritance. */
/* Skyline — explicit reset for nested scopes inside a themed page */
[data-theme=""] {
  --accent:       oklch(0.56 0.14 250);
  --accent-deep:  oklch(0.44 0.13 250);
  --accent-dim:   oklch(0.94 0.025 250);
  --accent-2:     oklch(0.78 0.13 75);
  --accent-2-dim: oklch(0.95 0.04 75);
}
/* Meadow — toddlers & preschool (0–4). Dinos, leaf green. */
[data-theme="meadow"] {
  --accent:       oklch(0.55 0.13 152);
  --accent-deep:  oklch(0.42 0.12 152);
  --accent-dim:   oklch(0.94 0.035 152);
  --accent-2:     oklch(0.78 0.13 85);
  --accent-2-dim: oklch(0.95 0.045 85);
}
/* Comet — kids (5–8). Rockets, warm coral. */
[data-theme="comet"] {
  --accent:       oklch(0.60 0.14 38);
  --accent-deep:  oklch(0.47 0.13 38);
  --accent-dim:   oklch(0.94 0.03 38);
  --accent-2:     oklch(0.65 0.10 230);
  --accent-2-dim: oklch(0.94 0.03 230);
}
/* Unicorn — sparkle & rainbows. Magenta-pink + lavender. */
[data-theme="unicorn"] {
  --accent:       oklch(0.60 0.15 345);
  --accent-deep:  oklch(0.46 0.14 345);
  --accent-dim:   oklch(0.95 0.03 345);
  --accent-2:     oklch(0.70 0.11 300);
  --accent-2-dim: oklch(0.95 0.035 300);
}
/* Tide — tweens & teens (9+). Cooler, calmer violet. */
[data-theme="tide"] {
  --accent:       oklch(0.52 0.13 295);
  --accent-deep:  oklch(0.40 0.12 295);
  --accent-dim:   oklch(0.94 0.03 295);
  --accent-2:     oklch(0.70 0.11 180);
  --accent-2-dim: oklch(0.94 0.035 180);
}
/* Duo — two kids selected. Kid A drives --accent (data-theme); kid B's
   colors arrive as --duo-b* inline vars set by kaApplyTheme(). */
body.duo .head-buddy {
  width: 76px; gap: 2px;
  background: linear-gradient(115deg, var(--accent-dim) 30%, var(--duo-b-dim) 70%);
}
body.duo .qchip.on,
body.duo .qbadge,
body.duo .empty-cta {
  background: linear-gradient(115deg, var(--accent), var(--duo-b));
  border-color: transparent;
}
body.duo .pill-age { background: var(--duo-b-dim); }
body.duo .results-header .label {
  background: linear-gradient(115deg, var(--accent-deep), var(--duo-b-deep));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
/* Theme cross-fade — tapping a kid chip retints the whole screen */
body, body * { transition: background-color .25s ease, border-color .25s ease, color .25s ease; }
/* ── Reset & base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; color: inherit; }
.svg-ico { display: inline-block; vertical-align: -3px; }
/* ── App frame ─────────────────────────────────────────────── */
#app-frame {
  max-width: var(--frame-w);
  margin: 0 auto;
  min-height: 100vh;
}
.screen {
  padding: 0 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom));
}
body.no-tabs .screen { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
/* ── Large-title header (tab roots) ────────────────────────── */
.lg-head {
  padding: 18px 0 4px;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px;
}
.lg-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.15;
}
.lg-head .sub {
  margin: 1px 0 0;
  font-size: .85rem;
  color: var(--ink-2);
}
.head-buddy {
  flex-shrink: 0;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 18px;
  background: var(--accent-dim);
  position: relative;
}
.head-buddy.anim { animation: ka-buddy-in .45s cubic-bezier(.34,1.56,.64,1); }
/* tiny confetti riding along with the buddy bubble */
.head-buddy::before,
.head-buddy::after { content: ""; position: absolute; border-radius: 50%; }
.head-buddy::before { width: 7px; height: 7px; background: var(--accent-2); top: -4px; right: -6px; }
.head-buddy::after  { width: 5px; height: 5px; background: var(--accent); bottom: -3px; left: -7px; opacity: .65; }
.head-buddy .buddy-star { display: inline-flex; color: var(--accent); }
@keyframes ka-buddy-in {
  from { transform: scale(.4) rotate(-12deg); opacity: 0; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}
/* ── Nav bar (pushed screens) ──────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  margin: 0 -16px; padding: 10px 12px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}
.nav-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-deep);
  flex-shrink: 0;
  position: relative;
}
.nav-btn:active { transform: scale(.94); }
.nav-btn.saved   { color: var(--accent); }
.nav-btn.in-compare { color: #fff; background: var(--accent); box-shadow: 0 3px 10px -2px var(--accent); }
/* Admin-only reliability training controls, grouped + set off from the public
   actions by a trailing divider. Active = this listing's current label. */
.nav-train { display: flex; gap: 6px; padding-right: 8px; margin-right: 2px; border-right: 1px solid var(--line); }
.nav-train .nav-btn { width: 32px; height: 32px; }
.nav-train-rel.is-active   { color: #fff; background: var(--green);  box-shadow: 0 3px 10px -2px var(--green); }
.nav-train-inacc.is-active { color: #fff; background: var(--danger); box-shadow: 0 3px 10px -2px var(--danger); }
.navbar h2 {
  margin: 0; flex: 1;
  font-family: var(--font-display);
  font-size: 1.02rem; font-weight: 700; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.nav-actions { display: flex; gap: 8px; }
/* ── Search field ──────────────────────────────────────────── */
.search-wrap {
  position: relative;
  margin: 12px 0 4px;
}
.search-wrap .svg-ico {
  position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.search-wrap input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-size: .95rem;
  outline: none;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-card);
  -webkit-appearance: none;
}
.search-wrap input::placeholder { color: var(--muted); }
.search-wrap input:focus { border-color: var(--accent); }
/* ── Kid chips ─────────────────────────────────────────────── */
.kid-row {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 10px 16px 6px; margin: 0 -16px;
}
.kid-row::-webkit-scrollbar { display: none; }
.kid-chip {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 8px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
  font-size: .88rem;
  user-select: none;
}
.kid-chip:active { transform: scale(.97); }
.kid-chip.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 3px 10px -2px var(--accent);
}
.kid-chip .avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.kid-chip.selected .avatar { background: rgba(255,255,255,.92); }
.kid-chip .age-tag { font-weight: 500; font-size: .78rem; opacity: .6; }
.kid-chip.selected .age-tag { opacity: .85; }
.add-kid {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 5px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px dashed var(--line);
  background: transparent;
  cursor: pointer;
  font-size: .84rem;
  color: var(--muted);
  white-space: nowrap;
}
.add-kid:hover { border-color: var(--accent); color: var(--accent-deep); }
/* ── Category picker ───────────────────────────────────────────
   Two labelled groups ("Activities" / "Things to do") of small icon
   chips that wrap onto multiple lines — easier to scan than one long
   horizontal scroll. */
.cat-strip { padding: 10px 0 4px; }
.cat-group + .cat-group { margin-top: 12px; }
.cat-group-title {
  margin: 0 2px 8px;
  font-size: .68rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); font-weight: 800;
}
.cat-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 9px 8px; }
.cat-strip .cat {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 46px; border: none; background: none; cursor: pointer; padding: 0;
}
.cat-strip .cat .bub {
  width: 42px; height: 42px;
  border-radius: 14px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
}
.cat-strip .cat:active .bub { transform: scale(.95); }
.cat-strip .cat span:last-child {
  font-size: .63rem; font-weight: 600; color: var(--ink-2);
  line-height: 1.15; text-align: center;
}
.cat-strip .cat.sel .bub {
  background: var(--accent-dim);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.cat-strip .cat.sel span:last-child { color: var(--accent-deep); font-weight: 700; }
/* ── Sticky quick-filter bar ───────────────────────────────── */
.qbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; gap: 8px; overflow-x: auto;
  margin: 8px -16px 0; padding: 10px 16px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}
.qbar::-webkit-scrollbar { display: none; }
.qchip {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface);
  font-size: .82rem; font-weight: 600; color: var(--ink-2);
  cursor: pointer; white-space: nowrap; user-select: none;
}
.qchip:active { transform: scale(.97); }
.qchip .caret { font-size: .6rem; opacity: .6; }
.qchip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.qchip-filters { border-color: transparent; color: var(--accent-deep); background: var(--accent-dim); }
.qchip .qbadge {
  background: var(--accent); color: #fff; border-radius: 999px;
  font-size: .66rem; font-weight: 700; min-width: 16px; height: 16px;
  padding: 0 4px; display: inline-flex; align-items: center; justify-content: center;
  margin-left: 2px;
}
/* ── Active-filter summary chips ───────────────────────────── */
.active-row {
  display: flex; gap: 7px; overflow-x: auto;
  padding: 12px 16px 2px; margin: 0 -16px; align-items: center;
}
.active-row::-webkit-scrollbar { display: none; }
.afilter {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 999px;
  background: var(--accent-dim); color: var(--accent-deep);
  font-size: .78rem; font-weight: 600;
  border: none; cursor: pointer;
}
.afilter .x { opacity: .55; font-weight: 700; }
.afilter:active { transform: scale(.97); }
.clear-all {
  flex-shrink: 0; border: none; background: none;
  color: var(--muted); font-size: .78rem; font-weight: 600;
  cursor: pointer; padding: 6px 4px; text-decoration: underline;
}
/* ── Results header & cards ────────────────────────────────── */
.results-header {
  display: flex; align-items: baseline; gap: 8px;
  margin: 14px 0 10px;
}
.results-header .label { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.results-header .count { font-size: .8rem; color: var(--muted); font-weight: 600; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 15px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  position: relative;
  transition: background-color .25s ease, border-color .25s ease, color .25s ease,
              box-shadow .15s, transform .1s;
  display: flex; flex-direction: column; gap: 8px;
}
.card:active { transform: scale(.99); }
.card-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px;
}
.card h3 { margin: 0; font-size: .98rem; font-weight: 700; line-height: 1.3; }
.card-actions { display: flex; gap: 2px; align-items: flex-start; flex-shrink: 0; }
.icon-tap {
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 2px 5px; line-height: 1;
  position: relative;
}
.icon-tap:active { transform: scale(.9); }
.icon-tap.saved  { color: var(--accent); }
.icon-tap.in-compare { color: var(--accent); }
.card-meta {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-size: .8rem; color: var(--ink-2);
}
.pill {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: .01em;
}
.pill-cat      { background: var(--accent-dim);   color: var(--accent-deep); }
.pill-free     { background: var(--green-dim);    color: var(--green); }
.pill-age      { background: var(--accent-2-dim); color: var(--ink-2); }
/* Estimated (LLM-inferred) age: amber tint + dashed edge reads "approximate". */
.pill-age-est  { background: var(--amber-dim); color: var(--amber); border: 1px dashed var(--amber); }
.pill-freq     { background: var(--amber-dim);    color: var(--amber); }
.pill-one-time { background: var(--surface-2);    color: var(--ink-2); }
/* "Fits <kids>" ribbon — detail-screen variant, shown with kid faces */
.fit-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 700;
  color: var(--accent-deep);
}
.fit-tag .face  { display: inline-flex; line-height: 0; }
.card-bot {
  display: flex; align-items: center; gap: 6px;
  font-size: .8rem; color: var(--ink-2);
}
.card-bot .svg-ico { color: var(--muted); flex-shrink: 0; }
.dist-tag { font-weight: 600; color: var(--accent-deep); }
.group-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .75rem; color: var(--accent-deep); font-weight: 600;
  background: var(--accent-dim); border-radius: 999px;
  padding: 3px 10px;
}
.slot-list {
  border-top: 1px solid var(--line);
  margin-top: 6px; padding-top: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.slot-row {
  display: flex; align-items: center;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  cursor: pointer;
  font-size: .82rem; color: var(--ink-2);
}
.slot-row:hover { background: var(--accent-dim); color: var(--accent-deep); }
.slot-row:active { transform: scale(.99); }
/* ── Organizer (venue) card — a "stacked folder" of programs ────
   A rollup card you drill into, set apart from a single listing by a
   building tile, a program-count eyebrow, a peek at the programs
   inside, a chevron, and the sheets stacked behind it. */
.place-head { display: flex; align-items: center; gap: 11px; }
.place-tile {
  width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-dim); color: var(--accent-deep);
}
.place-head-text { min-width: 0; flex: 1; }
.place-eyebrow {
  font-size: .66rem; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; color: var(--accent-deep); margin-bottom: 1px;
}
.place-head-text h3 { font-size: 1rem; }
.place-sub {
  font-size: .78rem; color: var(--ink-2); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.place-chevron { display: flex; margin-left: auto; flex-shrink: 0; color: var(--accent); }
.place-peek {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  font-size: .8rem; color: var(--ink-2);
}
.place-peek .peek-names {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.place-peek .more {
  flex-shrink: 0; background: var(--surface-2); color: var(--ink-2);
  font-weight: 700; font-size: .7rem; padding: 1px 7px; border-radius: 999px;
}
/* Two sheets peeking out behind the card — the silhouette says "many inside".
   The extra bottom margin clears them in the single-column flow; the desktop
   grid zeroes card margins and its gap already leaves room. */
.card.stack { margin-bottom: 12px; }
.card.stack::before,
.card.stack::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}
.card.stack::before { transform: translate(4px, 5px); }
.card.stack::after  { transform: translate(8px, 10px); }
/* ── Empty / loading states ────────────────────────────────── */
.empty { text-align: center; padding: 36px 24px 30px; color: var(--ink-2); }
.empty .emoji { font-size: 2.5rem; margin-bottom: 10px; }
.empty .stage { display: flex; justify-content: center; margin-bottom: 14px; }
.empty .stage svg { animation: ka-bob 2.6s ease-in-out infinite; }
.empty .bubble {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 6px;
}
.empty p { margin: 0 0 16px; font-size: .88rem; }
.empty .empty-cta {
  border: none; cursor: pointer;
  background: var(--accent); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: .9rem;
  padding: 10px 22px; border-radius: 999px;
  box-shadow: 0 3px 10px -2px var(--accent);
}
.empty .empty-cta:active { transform: scale(.97); }
@keyframes ka-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
/* Infinite-scroll trigger for the windowed feed; sized so it's reliably
   observable, invisible to the reader (the rootMargin loads ahead of it). */
#feed-sentinel { height: 1px; }
.loading { text-align: center; padding: 40px 24px; color: var(--ink-2); }
.loading .shapes { display: flex; gap: 10px; justify-content: center; margin-bottom: 16px; }
.loading .sh { width: 16px; height: 16px; animation: ka-hop 1s ease-in-out infinite; }
.loading .sh:nth-child(2) { animation-delay: .12s; }
.loading .sh:nth-child(3) { animation-delay: .24s; }
.loading .sh-circle { border-radius: 50%; background: var(--accent); }
.loading .sh-square { border-radius: 4px; background: var(--accent-2); transform: rotate(8deg); }
.loading .sh-pill   { border-radius: 999px; background: var(--accent-dim); border: 2px solid var(--accent); }
@keyframes ka-hop {
  0%, 100% { transform: translateY(0) scale(1); }
  35%      { transform: translateY(-10px) scale(1.05); }
  65%      { transform: translateY(0) scale(.95); }
}
.loading p { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: .95rem; color: var(--ink-2); }
.loading .load-hint {
  margin-top: 8px; font-family: var(--font-body);
  font-weight: 400; font-size: .78rem; color: var(--muted);
}
/* ── Save micro-interaction ────────────────────────────────── */
.star-pop svg { animation: ka-star-pop .4s cubic-bezier(.34,1.56,.64,1); }
@keyframes ka-star-pop {
  0%   { transform: scale(.4); }
  60%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}
.burst {
  position: absolute; border-radius: 50%;
  background: var(--accent-2);
  pointer-events: none;
}
/* ── Detail / venue screens ────────────────────────────────── */
.detail-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px 0 2px;
}
.dgroup {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 15px 16px;
  margin-top: 12px;
  box-shadow: var(--shadow-card);
}
.dgroup h4 {
  margin: 0 0 10px;
  font-size: .7rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); font-weight: 800;
}
.detail-row {
  display: flex; gap: 8px; margin-bottom: 6px;
  font-size: .9rem; color: var(--ink-2);
}
.detail-row:last-child { margin-bottom: 0; }
.detail-row .ico { flex-shrink: 0; width: 18px; text-align: center; color: var(--muted); }
.detail-desc { font-size: .92rem; color: var(--ink-2); line-height: 1.5; margin: 0; }
/* "Age estimated — confirm before attending" caveat under the detail tags. */
.age-est-note {
  margin: 8px 0 0; padding: 8px 11px;
  background: var(--amber-dim); color: var(--amber);
  border-radius: var(--radius-sm); font-size: .8rem; line-height: 1.4; font-weight: 600;
}
/* Sized box that Leaflet mounts into. z-index:0 keeps Leaflet's internal
   panes/controls from ever painting over the app chrome. The light fill
   shows while tiles load (or if the map script is blocked). */
.map-wrap { position: relative; }
.mini-map {
  height: 170px; margin: 12px 0 2px;
  border-radius: 14px; border: 1px solid var(--line);
  overflow: hidden; background: var(--accent-dim); position: relative; z-index: 0;
}
.mini-map .leaflet-control-attribution { font-size: 9px; }
/* theme character visiting the map's corner */
.map-buddy {
  position: absolute; bottom: 6px; right: 12px;
  transform: rotate(-4deg);
  pointer-events: none;
  z-index: 1; line-height: 0;
}
.maps-link {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 10px;
  color: var(--accent-deep); font-weight: 600; font-size: .85rem;
  text-decoration: none;
}
/* Organizer link inside the detail "Organizer" group — taps through to every
   program at the venue (the venue screen). Sits below the group's h4. */
.organizer-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 0; margin: 0;
  border: none; background: none;
  text-align: left; cursor: pointer;
  color: var(--ink); font-size: .92rem;
}
.organizer-row:active { opacity: .6; }
.organizer-row .ico,
.organizer-row .chev { flex-shrink: 0; color: var(--muted); display: flex; }
.organizer-row .grow { flex: 1; min-width: 0; }
.organizer-row .row-sub { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.venue-meta {
  padding: 12px 0 0;
  font-size: .88rem; color: var(--ink-2);
  display: flex; flex-direction: column; gap: 5px;
}
.venue-meta a { color: var(--accent-deep); text-decoration: none; font-weight: 600; }
.venue-filter-toggle {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: var(--accent-deep); font-weight: 600;
}
.venue-filter-toggle:hover { text-decoration: underline; }
.venue-list { padding-top: 14px; }
/* ── Bottom CTA bar (detail) ───────────────────────────────── */
.cta-bar {
  position: fixed; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: var(--frame-w);
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 72%, transparent);
  z-index: 60;
}
.cta-inner { display: flex; gap: 8px; position: relative; }
.cta-primary {
  flex: 1;
  display: block; min-width: 0;
  text-align: center; padding: 14px;
  border-radius: 999px;
  background: var(--accent); color: #fff;
  font-family: var(--font-display);
  font-weight: 700; font-size: .95rem;
  text-decoration: none;
  border: none; cursor: pointer;
  box-shadow: 0 4px 14px -4px var(--accent);
}
.cta-secondary {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 6px;
  padding: 14px 16px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 600; font-size: .88rem;
  cursor: pointer;
  text-decoration: none;
}
.cta-secondary.grow { flex: 1; justify-content: center; }
@media (max-width: 430px) {
  .cta-secondary span { display: none; }
  .cta-secondary { padding: 14px 12px; }
}
.cal-menu {
  position: absolute;
  right: 0; bottom: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  min-width: 210px;
  padding: 6px;
  display: none;
  z-index: 70;
}
.cal-menu.open { display: block; }
.cal-menu button, .cal-menu a {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  border: none; background: none;
  font-size: .9rem; color: var(--ink);
  text-align: left; cursor: pointer;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.cal-menu button:hover, .cal-menu a:hover { background: var(--accent-dim); }
.cal-menu .cal-ico { font-size: 1.1rem; width: 20px; text-align: center; }
/* Report-a-problem affordance, below the detail content (above the fixed CTA). */
.report-row { padding: 4px 0 90px; text-align: center; }
.report-link {
  border: none; background: none; cursor: pointer;
  color: var(--muted); font-size: .82rem; padding: 8px 12px;
  text-decoration: underline; text-underline-offset: 2px;
}
.report-link:hover { color: var(--ink); }
/* ── Compare ───────────────────────────────────────────────── */
.compare-pill {
  position: fixed;
  bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 9px 9px 9px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-float);
  display: none;
  align-items: center; gap: 10px;
  z-index: 55;
  font-size: .88rem; font-weight: 600;
  user-select: none; cursor: pointer;
  border: none;
}
.compare-pill.show { display: flex; }
.compare-pill .cb-count {
  background: var(--accent); color: #fff;
  border-radius: 999px;
  min-width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; padding: 0 6px;
}
.compare-pill .cb-clear {
  background: rgba(128,128,140,.3);
  border: none; color: inherit;
  cursor: pointer; border-radius: 50%;
  width: 26px; height: 26px;
  font-size: .95rem;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1;
}
.compare-grid {
  overflow-x: auto;
  padding: 14px 0 24px;
  display: flex; gap: 12px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  align-items: flex-start;
}
.compare-col {
  flex: 0 0 260px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 15px 16px 16px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow-card);
  scroll-snap-align: start;
  position: relative;
}
.compare-col h3 { margin: 0; font-size: 1rem; line-height: 1.3; padding-right: 28px; }
.compare-remove {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px;
  border-radius: 50%; border: none;
  background: var(--surface-2); color: var(--ink-2);
  cursor: pointer; font-size: 1rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.compare-remove:hover { background: var(--danger-dim); color: var(--danger); }
.compare-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.compare-field { display: flex; flex-direction: column; gap: 2px; }
.compare-field .label {
  font-size: .65rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); font-weight: 700;
}
.compare-field .val { font-size: .88rem; color: var(--ink); line-height: 1.4; word-wrap: break-word; }
.compare-field .val.muted { color: var(--muted); }
.compare-field .val.desc { color: var(--ink-2); font-size: .82rem; }
.compare-col .details-link {
  margin-top: auto; padding: 8px 0 0;
  font-size: .85rem; color: var(--accent-deep); font-weight: 600;
  cursor: pointer; border: none; background: none;
  text-align: left; padding-left: 0;
}
/* ── Account card (My Kids screen) ─────────────────────────── */
.account-card {
  display: flex; align-items: center; gap: 12px;
  margin-top: 12px; padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.account-card .grow { flex: 1; min-width: 0; }
.account-card .row-sub { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.acct-btn {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: var(--radius-md);
  border: 1px solid var(--line); background: var(--surface-2);
  font-weight: 700; font-size: .85rem; color: var(--ink); cursor: pointer;
}
.acct-btn:active { opacity: .8; }
.acct-btn.apple { background: #000; color: #fff; border-color: #000; }
.acct-btn.apple svg { display: block; }
.link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--danger); font: inherit; text-decoration: underline;
}
/* ── My Kids screen ────────────────────────────────────────── */
.inset-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-top: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.inset-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: none; background: none;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-size: .92rem;
  text-align: left;
  color: var(--ink);
}
.inset-row:last-child { border-bottom: none; }
.inset-row:active { background: var(--surface-2); }
.face-coin {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.face-coin .inner {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.inset-row .grow { flex: 1; min-width: 0; }
.inset-row .row-sub { font-size: .78rem; color: var(--muted); }
.inset-row .chev { color: var(--muted); flex-shrink: 0; }
.inset-row.action { color: var(--accent-deep); font-weight: 700; }
.list-caption { margin: 10px 4px 0; font-size: .78rem; color: var(--muted); }
.list-caption .contact-link { color: var(--accent-deep); font-weight: 600; }
.section-title {
  margin: 22px 4px 0;
  font-size: .7rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); font-weight: 800;
}
/* the kids' buddies standing together above the tab bar */
.crew-row {
  display: flex; justify-content: center; align-items: flex-end; gap: 4px;
  padding-top: 26px;
}
.crew-row .crew-buddy { display: inline-flex; }
.crew-row .crew-buddy:nth-child(odd)  { transform: rotate(-4deg); }
.crew-row .crew-buddy:nth-child(even) { transform: rotate(4deg) translateY(-2px); }
/* ── Saved screen · per-kid groups ─────────────────────────── */
.saved-group { display: flex; align-items: center; gap: 9px; margin: 20px 0 10px; }
.saved-group .face-coin { width: 30px; height: 30px; }
.saved-group .face-coin .inner { width: 25px; height: 25px; }
.saved-group h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.02rem;
  color: var(--accent-deep);
}
.saved-group .count { font-size: .78rem; color: var(--muted); font-weight: 600; }
/* ── Tab bar ───────────────────────────────────────────────── */
#tabbar {
  position: fixed; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: var(--frame-w);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  z-index: 50;
}
body.no-tabs #tabbar { display: none; }
/* Sidebar brand — desktop.css reveals it atop the left rail; hidden on the
   mobile bottom bar, where the tab buttons are the only children. */
.tabbar-brand { display: none; }
#tabbar button {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  border: none; background: none; cursor: pointer;
  color: var(--muted);
  font-size: .66rem; font-weight: 600;
  padding: 6px 0 4px;
}
#tabbar button.active { color: var(--accent); }
/* ── Admin report queue (docs/listing-review.md) ── */
.admin-reports { padding: 8px 0 24px; display: flex; flex-direction: column; gap: 10px; }
.ar-loading { color: var(--muted); padding: 24px; text-align: center; }
.admin-report {
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); padding: 12px 14px;
}
.ar-head { display: flex; align-items: center; gap: 8px; }
.ar-reason { font-family: var(--font-display); font-weight: 700; flex: 1; }
.ar-status {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; background: var(--accent-dim); color: var(--accent-deep);
}
.ar-status.ar-resolved { background: var(--green-dim); color: var(--green); }
.ar-status.ar-dismissed { background: var(--line); color: var(--muted); }
.ar-status.ar-quarantined { background: var(--danger-dim); color: var(--danger); }
.ar-comment { margin: 8px 0 4px; font-size: .9rem; }
.ar-meta { color: var(--muted); font-size: .78rem; margin: 4px 0; }
.ar-src { display: block; font-size: .78rem; word-break: break-all; margin: 2px 0 8px; }
/* Shared "reported listing" detail block (render/listing-info.js), used by the
   mobile cards here and the desktop bulk table's expandable detail row. */
.li-info {
  margin: 8px 0; padding: 8px 10px; border-radius: var(--radius-md);
  background: var(--bg); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
}
.li-info--empty { color: var(--muted); font-size: .8rem; font-style: italic; }
.li-field { display: flex; gap: 8px; font-size: .82rem; line-height: 1.35; }
.li-k {
  flex: 0 0 84px; color: var(--muted); font-weight: 700;
  text-transform: uppercase; font-size: .68rem; letter-spacing: .03em; padding-top: 1px;
}
.li-v { flex: 1; color: var(--ink); word-break: break-word; }
.li-links { display: flex; gap: 12px; margin-top: 2px; }
.li-links a { font-size: .78rem; font-weight: 700; color: var(--accent-deep); }
.ar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ar-approve, .ar-dismiss, .ar-quarantine, .ar-unquarantine {
  border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: .85rem;
  cursor: pointer; font-family: var(--font-display);
}
.ar-approve { border: none; background: var(--accent); color: #fff; }
.ar-dismiss { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.ar-quarantine { border: none; background: var(--danger); color: #fff; }
.ar-unquarantine { border: 1px solid var(--danger); background: var(--danger-dim); color: var(--danger); }
/* Per-report training-set label row (render/admin.js). */
.ar-train {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line);
}
.ar-train-label { color: var(--muted); font-size: .78rem; font-weight: 700; }
/* Reliability training-set panel (render/admin-training.js). */
.at { padding: 4px 0 24px; }
.at-intro { color: var(--muted); font-size: .85rem; margin: 8px 0; max-width: 760px; }
.at-counts { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.at-pill {
  font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: var(--accent-dim); color: var(--accent-deep);
}
.at-pill.at-rel { background: var(--green-dim); color: var(--green); }
.at-pill.at-inacc { background: var(--danger-dim); color: var(--danger); }
.at-search { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0; }
.at-q {
  width: 100%; box-sizing: border-box; font-family: var(--font-body); font-size: .9rem;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); color: var(--ink);
}
.at-results:not(:empty) { margin: 4px 0 12px; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.at-h { margin: 16px 0 8px; }
.at-list { display: flex; flex-direction: column; gap: 8px; }
.at-row {
  display: flex; align-items: flex-start; gap: 10px; justify-content: space-between;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface);
}
.at-results .at-row { border: none; border-bottom: 1px solid var(--line); border-radius: 0; }
.at-results .at-row:last-child { border-bottom: none; }
.at-row-main { flex: 1; min-width: 0; }
.at-name { font-family: var(--font-display); font-weight: 700; }
.at-sub { color: var(--muted); font-size: .78rem; margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.at-note { font-size: .82rem; font-style: italic; color: var(--muted); margin-top: 4px; }
.at-row-acts { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.at-empty { color: var(--muted); padding: 16px; text-align: center; font-size: .85rem; }
/* Link from the mobile queue to the desktop bulk view. */
.admin-switch { padding: 8px 0 0; }
.admin-switch-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--accent-deep);
  border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: .82rem;
  cursor: pointer; font-family: var(--font-display);
}
/* ── Town landing page (#/town/<slug>) ───────────────────────── */
.town-hero {
  margin: 16px 0 8px;
  padding: 20px;
  border-radius: var(--radius-lg, 20px);
  background: var(--accent-dim);
}
.town-hero .town-eyebrow {
  font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-deep, var(--accent));
}
.town-hero h1 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 1.9rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.15;
}
.town-hero .sub { margin: 6px 0 0; font-size: .9rem; color: var(--ink-2); max-width: 42ch; }
.town-section-head {
  display: flex; align-items: baseline; gap: 8px;
  margin: 22px 0 10px;
}
.town-section-head h2 {
  margin: 0; font-family: var(--font-display); font-size: 1.1rem; font-weight: 800;
}
.town-section-head .count {
  font-size: .78rem; font-weight: 700; color: var(--muted);
}
/* ── Filters sheet ─────────────────────────────────────────── */
.sheet-dim {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(43,38,32,.32);
  display: flex;
  align-items: flex-end; justify-content: center;
}
.sheet {
  background: var(--surface);
  width: 100%; max-width: var(--frame-w);
  border-radius: 22px 22px 0 0;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 -8px 30px rgba(43,38,32,.16);
  animation: slideUp .22s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-grip { width: 40px; height: 4px; border-radius: 999px; background: var(--line); margin: 10px auto 2px; flex-shrink: 0; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 18px 12px; border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.sheet-head h3 { margin: 0; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.sheet-reset { border: none; background: none; color: var(--accent-deep); font-weight: 700; font-size: .84rem; cursor: pointer; }
.sheet-body { overflow-y: auto; padding: 4px 18px 12px; flex: 1; }
.fgroup { padding: 15px 0; border-bottom: 1px solid var(--line); }
.fgroup:last-child { border-bottom: none; }
.fgroup > h4 {
  margin: 0 0 11px; font-size: .7rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); font-weight: 800;
}
.sheet-foot {
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.apply-btn {
  width: 100%; padding: 14px; border: none; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-family: var(--font-display);
  font-size: .95rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 14px -4px var(--accent);
}
.apply-btn:active { transform: scale(.99); }
/* ── Report-a-problem modal (docs/listing-review.md) — reuses .sheet/.sheet-dim ── */
.report-intro { color: var(--muted); font-size: .9rem; margin: 0 0 6px; }
.report-opt { color: var(--muted); font-weight: 400; }
.report-select,
.report-textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-md); background: var(--surface); color: var(--ink);
  font-family: var(--font-body); font-size: .95rem; box-sizing: border-box;
}
.report-textarea { resize: vertical; min-height: 64px; }
.report-foot { display: flex; gap: 10px; }
.report-cancel {
  flex: 0 0 auto; padding: 14px 18px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); color: var(--ink);
  font-family: var(--font-display); font-weight: 700; font-size: .95rem; cursor: pointer;
}
.report-foot .apply-btn { flex: 1; }
/* Filter controls inside the sheet */
.seg-row { display: flex; gap: 6px; }
.seg-btn {
  flex: 1; padding: 9px 6px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font-size: .78rem; font-weight: 600;
  color: var(--ink-2); text-align: center;
  user-select: none;
}
.seg-btn:active { transform: scale(.97); }
.seg-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip-row { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-row.wrap { flex-wrap: wrap; overflow: visible; }
.f-chip {
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font-size: .78rem; font-weight: 600;
  color: var(--ink-2);
  user-select: none;
  white-space: nowrap;
}
.f-chip:active { transform: scale(.97); }
.f-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.f-chip:disabled { cursor: default; }
.loc-row { display: flex; gap: 6px; align-items: center; }
.loc-btn {
  flex-shrink: 0;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font-size: .78rem; font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}
.loc-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.loc-input {
  flex: 1; min-width: 0;
  padding: 9px 12px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: .82rem; outline: none;
  background: var(--surface-2);
  color: var(--ink);
}
.loc-input:focus { border-color: var(--accent); }
.loc-status { font-size: .72rem; color: var(--ink-2); padding: 6px 2px 0; min-height: 1em; }
.loc-status.error { color: var(--danger); }
.show-list { display: flex; flex-direction: column; gap: 2px; }
.show-list .tg {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0; cursor: pointer; user-select: none;
}
.show-list .tg span:first-child { font-size: .9rem; font-weight: 600; color: var(--ink); }
.show-list .tg .sw {
  width: 44px; height: 26px; border-radius: 999px;
  background: var(--line); position: relative; transition: background .15s; flex-shrink: 0;
}
.show-list .tg .sw::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.show-list .tg.on .sw { background: var(--green); }
.show-list .tg.on .sw::after { left: 21px; }
/* ── Kid modal & theme picker ──────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(43,38,32,.32);
  z-index: 90;
  align-items: flex-end; justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal-sheet {
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  width: 100%; max-width: var(--frame-w);
  padding: 22px 20px calc(28px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-float);
  animation: slideUp .22s ease;
}
.modal-sheet h3 { margin: 0 0 16px; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.modal-sheet label {
  display: block; font-size: .78rem; color: var(--ink-2);
  font-weight: 600; margin-bottom: 4px;
}
.modal-sheet input {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .95rem; margin-bottom: 14px;
  outline: none;
  background: var(--surface-2);
  color: var(--ink);
}
.modal-sheet input:focus { border-color: var(--accent); }
.modal-sheet input.invalid { border-color: var(--danger); }
.kid-error {
  display: none;
  color: var(--danger);
  font-size: .8rem; font-weight: 600;
  margin: -4px 0 12px;
}
.kid-error.show { display: block; }
.theme-pick { display: flex; gap: 9px; padding: 2px 0 4px; overflow-x: auto; }
.theme-pick::-webkit-scrollbar { display: none; }
.theme-opt {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  border: none; background: none; cursor: pointer; padding: 0;
  width: 58px; flex-shrink: 0;
}
.theme-opt .bub {
  width: 52px; height: 52px;
  border-radius: 19px;
  background: var(--accent-dim);
  border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.theme-opt span:last-child { font-size: .66rem; font-weight: 600; color: var(--ink-2); }
.theme-opt.sel .bub {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1.5px var(--accent), 0 3px 10px -3px var(--accent);
}
.theme-opt.sel span:last-child { color: var(--accent-deep); font-weight: 700; }
.pick-hint { font-size: .75rem; color: var(--muted); margin: 6px 0 14px; }
.modal-actions { display: flex; gap: 8px; margin-top: 6px; }
.modal-actions button {
  flex: 1; padding: 12px;
  border-radius: 999px;
  font-weight: 700; font-size: .9rem; cursor: pointer;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.modal-actions button.primary { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 3px 10px -2px var(--accent); }
.modal-actions button.danger  { background: var(--danger); color: #fff; border-color: var(--danger); }
/* ── Toast ─────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  box-shadow: var(--shadow-float);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 9999;
  max-width: calc(100% - 32px);
  text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 600px) {
  .screen { padding-left: 24px; padding-right: 24px; }
  .navbar, .kid-row, .cat-strip, .qbar, .active-row { margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px; }
}
/* ════════════════════════════════════════════════════════════════
   Map view — find activities by place. Full-bleed Leaflet tiles with
   custom markers (the "pin language": activity pin, venue pin, cluster,
   you-are-here). Colours come from the same theme tokens, so the whole
   map retints with the selected kid. Companion to the redesign handoff
   `map.css`; the `.ka` scope there maps to <body> here (already themed).
   ════════════════════════════════════════════════════════════════ */
/* The map is a fixed full-bleed layer; suppress page scroll behind it and
   the floating compare pill (it would collide with the list toggle). */
body.map-mode { overflow: hidden; }
body.map-mode .screen { padding: 0; }
body.map-mode .compare-pill { display: none !important; }
.mp-screen {
  position: fixed; top: 0; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: var(--frame-w);
  overflow: hidden; background: var(--bg); z-index: 1;
}
.mp-canvas { position: absolute; inset: 0; z-index: 0; }
.mp-leaflet { position: absolute; inset: 0; background: var(--accent-dim); }
.mp-noscript {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; padding: 24px; text-align: center;
  color: var(--ink-2); font-size: .9rem;
}
/* Leaflet positions each marker's wrapper by transform; neutralise the
   markers' own absolute/transform offsets (used by the static mock) and
   strip Leaflet's default white div-icon box. */
.leaflet-marker-icon.mp-mk { background: transparent; border: 0; }
.mp-mk .mp-pin     { position: relative; transform: none; }
.mp-mk .mp-cluster { position: relative; transform: none; }
.mp-mk .mp-cluster:hover { transform: scale(1.07); }
.mp-mk .mp-cluster.dim { opacity: .5; filter: grayscale(.7); }
.mp-mk .mp-you     { position: static;  transform: none; }
.mp-mk .mp-pin .lbl { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 2px; }
/* ── Floating top overlay (search + kid chips + count) ─────── */
.mp-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  padding: 12px 14px 30px;
  padding-top: calc(12px + env(safe-area-inset-top));
  pointer-events: none;
  background: linear-gradient(to bottom,
    var(--bg) 8%,
    color-mix(in srgb, var(--bg) 62%, transparent) 64%,
    transparent);
}
.mp-top > * { pointer-events: auto; }
.mp-top .search-wrap { margin: 0; }
.mp-top .search-wrap input { box-shadow: 0 4px 16px rgba(43,38,32,.10); }
.mp-top .kid-row { margin: 0; padding: 10px 0 0; }
.mp-top .kid-chip { box-shadow: var(--shadow-card); }
.mp-top .mp-filtbar { margin: 10px 0 0; }
.mp-filtbtn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
  font-family: var(--font-display); font-weight: 700; font-size: .82rem;
  cursor: pointer; box-shadow: var(--shadow-card);
}
.mp-filtbtn:active { background: var(--surface-2); }
.mp-filtbtn .qbadge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 5px; box-sizing: border-box;
  border-radius: 999px; background: var(--accent-deep); color: #fff;
  font-size: .64rem; line-height: 1;
}
.mp-count {
  width: max-content; margin: 10px auto 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 13px;
  font-size: .76rem; font-weight: 600; color: var(--ink-2);
  box-shadow: var(--shadow-card);
}
.mp-count:empty { display: none; }
.mp-count b { color: var(--accent-deep); font-weight: 700; }
/* ── Activity pin (one activity, one place) ────────────────── */
.mp-pin {
  position: absolute; transform: translate(-50%, -100%);
  display: flex; flex-direction: column; align-items: center;
  background: none; border: none; padding: 0; cursor: pointer;
  z-index: 2; font-family: var(--font-body);
}
.mp-pin .bub {
  position: relative;
  width: 37px; height: 37px; border-radius: 50%;
  background: var(--surface); border: 2.5px solid var(--accent);
  box-shadow: 0 2px 7px rgba(43,38,32,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; line-height: 1;
  transition: transform .15s ease, background-color .25s ease, border-color .25s ease;
}
.mp-pin .tail {
  width: 0; height: 0;
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-top: 8px solid var(--accent);
  margin-top: -1px;
}
.mp-pin .lbl {
  margin-top: 3px;
  font-size: .64rem; font-weight: 700; color: var(--ink-2);
  text-shadow: 0 1px 0 rgba(255,255,255,.85), 0 0 4px rgba(255,255,255,.9);
  white-space: nowrap;
}
.mp-pin .save-dot {
  position: absolute; top: -6px; right: -7px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent-2); color: #fff;
  border: 2px solid var(--surface);
  display: flex; align-items: center; justify-content: center;
}
.mp-pin.sel { z-index: 4; }
.mp-pin.sel .bub {
  background: var(--accent-dim); border-color: var(--accent-deep);
  transform: scale(1.18);
  box-shadow: 0 5px 14px rgba(43,38,32,.28);
}
.mp-pin.sel .tail { border-top-color: var(--accent-deep); }
.mp-pin.sel .lbl { color: var(--accent-deep); }
.mp-pin.dim { opacity: .48; filter: grayscale(.75); z-index: 1; }
/* venue pin: outlined + a category icon = many programs at ONE address,
   summarised by their dominant category with a count badge in the corner. */
.mp-pin.venue .bub { font-size: 16px; }
/* ── Cluster pin (filled = a group of nearby places) ─────────
   Fills the Leaflet icon box (sized in JS so a multi-icon pin can widen into a
   pill); shows the category icon(s) with the place count as a corner badge. */
.mp-cluster {
  width: 100%; height: 100%; box-sizing: border-box;
  border-radius: 999px;
  background: var(--accent); color: #fff;
  font-family: var(--font-display); font-weight: 700;
  border: none; padding: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 2;
  box-shadow:
    0 0 0 3px var(--surface),
    0 0 0 9px color-mix(in srgb, var(--accent) 16%, transparent),
    0 4px 12px rgba(43,38,32,.28);
  transition: transform .15s ease, background-color .25s ease;
}
.mp-cluster.s { font-size: .9rem; }
.mp-cluster.m { font-size: 1.02rem; }
.mp-cluster.l { font-size: 1.2rem; }
.mp-cluster .ico { display: flex; align-items: center; justify-content: center; gap: 2px; line-height: 1; }
.mp-cluster .ce  { display: inline-flex; align-items: center; justify-content: center; }
/* Count badge — shared with the venue pin (programs at one address). */
.mp-cluster .cnt, .mp-pin .cnt {
  position: absolute; top: -5px; right: -7px;
  min-width: 17px; height: 17px; padding: 0 4px; box-sizing: border-box;
  border-radius: 999px; background: var(--ink); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: .6rem;
  line-height: 17px; text-align: center;
  border: 2px solid var(--surface);
}
/* ── "You are here" — wears the selected kid's face ────────── */
.mp-you { position: absolute; transform: translate(-50%, -50%); z-index: 3; pointer-events: none; display: block; }
.mp-you .ring {
  position: absolute; left: 50%; top: 50%;
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  animation: mp-pulse 2.6s ease-out infinite;
}
.mp-you .coin {
  position: relative;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface); border: 2.5px solid var(--accent);
  box-shadow: 0 2px 8px rgba(43,38,32,.22);
  display: flex; align-items: center; justify-content: center;
}
@keyframes mp-pulse {
  0%   { transform: scale(1);   opacity: .7; }
  70%  { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}
/* ── Map controls ──────────────────────────────────────────── */
.mp-ctl { position: absolute; right: 12px; top: 236px; z-index: 5; display: flex; flex-direction: column; gap: 8px; }
.mp-ctl .grp {
  display: flex; flex-direction: column;
  border-radius: 13px; overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 3px 10px rgba(43,38,32,.10);
}
.mp-ctl button {
  width: 40px; height: 40px; border: none;
  background: var(--surface); color: var(--ink-2);
  font-size: 19px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-body);
}
.mp-ctl .grp button + button { border-top: 1px solid var(--line); }
.mp-ctl button:active { background: var(--surface-2); }
/* ── List toggle pill ──────────────────────────────────────── */
.mp-listpill {
  position: absolute; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 20px; border-radius: 999px; border: none;
  background: var(--ink); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: .92rem;
  cursor: pointer; z-index: 5;
  box-shadow: 0 8px 22px rgba(43,38,32,.32);
}
/* ── Peek card (selected pin) ──────────────────────────────── */
.mp-peek {
  position: absolute; left: 12px; right: 12px; bottom: calc(146px + env(safe-area-inset-bottom)); z-index: 5;
  animation: mp-peek-in .32s cubic-bezier(.34,1.56,.64,1) both;
}
.mp-peek .card {
  margin: 0;
  box-shadow: 0 14px 36px rgba(43,38,32,.22);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
@keyframes mp-peek-in { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
/* ── Odds & ends ───────────────────────────────────────────── */
.mp-attr {
  position: absolute; left: 10px; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 4;
  font-size: .6rem; color: var(--muted);
  background: rgba(255,255,255,.72);
  padding: 2px 7px; border-radius: 6px;
  pointer-events: none;
}
/* a theme buddy stands on the map when zoomed out */
.mp-screen .map-buddy { right: 18px; bottom: calc(150px + env(safe-area-inset-bottom)); z-index: 3; }
@media (prefers-reduced-motion: reduce) {
  .mp-you .ring { animation: none; opacity: .3; }
  .mp-peek { animation: none; }
}
/* ════════════════════════════════════════════════════════════════
   Desktop layout (≥ 900px) — additive only.

   The base stylesheets describe a 600px phone column with a fixed
   bottom tab bar and bottom-sheet overlays. Everything here is a
   wide-screen *override*: the bottom tab bar becomes a left sidebar,
   the single-column feed becomes a multi-column card grid, and the
   bottom sheets re-centre as dialogs. Nothing below this breakpoint
   is touched, so mobile (and the 600–900px tablet column from
   toast.css) is unchanged.

   This file is @imported last in main.css so its rules win the
   cascade over the per-screen sheets at equal specificity.
   ════════════════════════════════════════════════════════════════ */
@media (min-width: 900px) {
  :root {
    --sidebar-w: 236px;   /* fixed left nav rail */
    --content-w: 1180px;  /* max width of the scrolling content column */
  }

  /* ── Shell ───────────────────────────────────────────────────
     Sidebar is a fixed left layer; the content frame clears it with
     padding and centres its inner column. */
  #app-frame {
    max-width: none;
    margin: 0;
    padding-left: var(--sidebar-w);
  }
  .screen {
    max-width: var(--content-w);
    margin: 0 auto;
    padding: 0 32px 64px;
  }

  /* ── Left sidebar (was the bottom tab bar) ───────────────────── */
  #tabbar {
    top: 0; bottom: 0; left: 0;
    width: var(--sidebar-w);
    max-width: none; height: auto;
    transform: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    padding: 18px 14px;
    overflow-y: auto;
    border-top: none;
    border-right: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
  }
  /* Detail screen hides the tab bar on mobile (CTA bar takes over);
     on desktop the sidebar stays put across every screen. */
  body.no-tabs #tabbar { display: flex; }

  #tabbar button {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 13px;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    font-size: .92rem;
    font-weight: 600;
    color: var(--ink-2);
  }
  #tabbar button:hover { background: var(--surface-2); color: var(--ink); }
  #tabbar button.active {
    background: var(--accent-dim);
    color: var(--accent-deep);
    font-weight: 700;
  }

  /* Brand wordmark atop the rail — hidden on the mobile tab bar. */
  .tabbar-brand {
    display: flex; align-items: center; gap: 9px;
    padding: 6px 12px 16px;
    font-family: var(--font-display);
    font-weight: 800; font-size: 1.18rem;
    letter-spacing: -.01em;
    color: var(--ink);
  }
  .tabbar-brand .tb-logo {
    width: 28px; height: 28px;
    object-fit: contain;
    flex: none;
  }

  /* ── Card grids ───────────────────────────────────────────────
     The explore feed and the wrapped Saved / Venue lists flow into
     responsive columns; the per-card stacking margin gives way to
     the grid gap. */
  #feed,
  .card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 14px;
    align-items: start;
  }
  #feed .card,
  .card-grid .card { margin-bottom: 0; }
  /* Non-card grid children span every column so they stay full-width: the
     windowed feed's lazy-load sentinel (else it steals a card cell and dents
     the last row), and the empty/loading states feedHtml() renders when there
     are no cards (else the message is crammed into the first track at the left
     instead of staying centred). */
  #feed-sentinel,
  #feed > .empty,
  #feed > .loading { grid-column: 1 / -1; }

  .card:hover {
    border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
    box-shadow: var(--shadow-float);
    transform: translateY(-2px);
  }

  /* ── Explore controls ────────────────────────────────────────
     Drop the phone-edge bleed (negative margins from base/toast.css)
     so the rails align with the grid inside the 32px gutter. */
  .lg-head { padding-top: 26px; }
  .kid-row, .cat-strip, .active-row {
    margin: 0; padding-left: 0; padding-right: 0;
  }
  .qbar {
    margin: 8px 0 0; padding: 10px 0;
  }

  /* Pointer affordances for the chip/segment controls. */
  .qchip:hover:not(.on),
  .f-chip:hover:not(.active),
  .seg-btn:hover:not(.active),
  .kid-chip:hover:not(.selected),
  .loc-btn:hover:not(.active) { border-color: var(--accent); color: var(--accent-deep); }
  .cat-strip .cat:hover .bub { border-color: var(--accent); }
  .add-kid:hover { border-color: var(--accent); color: var(--accent-deep); }
  .icon-tap:hover { color: var(--accent-deep); }
  .nav-btn:hover { color: var(--accent); }

  /* ── Per-screen content widths ───────────────────────────────
     Grid screens stay wide; reading/settings screens narrow to a
     comfortable measure. (data-route is set in render().) */
  body[data-route="kids"] .screen,
  body[data-route="admin"] .screen { max-width: 760px; }
  body[data-route="activity"] .screen {
    max-width: 820px;
    padding-bottom: 120px;   /* clear the fixed CTA bar */
  }
  body[data-route="venue"] .screen { max-width: 960px; }

  /* Pushed-screen nav bar bleeds to the (narrower) column edges. */
  .navbar { margin: 0 -32px; padding: 12px 32px; }

  /* ── Detail CTA bar ──────────────────────────────────────────
     Was a frame-width bar centred in the viewport; now it spans the
     content area to the right of the sidebar with a centred inner. */
  .cta-bar {
    left: var(--sidebar-w); right: 0;
    width: auto; max-width: none;
    transform: none;
    padding-left: 32px; padding-right: 32px;
  }
  .cta-inner { max-width: 760px; margin: 0 auto; }

  /* ── Compare pill — centre within the content area. ──────────── */
  .compare-pill {
    left: calc(50% + var(--sidebar-w) / 2);
    bottom: 28px;
  }

  /* ── Map — fill the area beside the sidebar. ─────────────────── */
  .mp-screen {
    left: var(--sidebar-w); right: 0;
    width: auto; max-width: none;
    transform: none;
  }

  /* ── Toast — centre over the content area, lift off the bottom. */
  #toast {
    left: calc(50% + var(--sidebar-w) / 2);
    bottom: 28px;
  }

  /* ── Filters sheet & kid modal → centred dialogs ─────────────── */
  .sheet-dim,
  .modal-backdrop { align-items: center; padding: 24px; }
  .sheet {
    width: 100%; max-width: 560px;
    max-height: 86vh;
    border-radius: var(--radius-lg);
    animation: ka-dialog-in .2s ease;
  }
  .modal-sheet {
    width: 100%; max-width: 460px;
    border-radius: var(--radius-lg);
    padding: 26px 26px 24px;
    animation: ka-dialog-in .2s ease;
  }
  .sheet-grip { display: none; }          /* drag handle is a touch affordance */
  .sheet-foot { padding-bottom: 14px; }   /* no safe-area inset needed */

  .cal-menu button:hover,
  .cal-menu a:hover { background: var(--accent-dim); }
}
@keyframes ka-dialog-in {
  from { transform: translateY(8px) scale(.985); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
/* After desktop.css so the bulk admin queue's width override wins the cascade. */
/* ── Desktop high-volume admin queue (render/admin-desktop.js) ──────────────
   Lays the report queue out as a dense table. The general desktop layout
   (desktop.css, ≥900px) gives body[data-route="admin"] a narrow 760px column
   sized for the mobile card queue; the bulk table wants the full content area,
   so widen it when body.admin-wide is set (render/core.js, only on #/admin/queue).
   Imported after desktop.css (main.css) so this override wins. Below the desktop
   breakpoint the table stays in the column and scrolls horizontally. */
@media (min-width: 900px) {
  body.admin-wide[data-route="admin"] .screen { max-width: none; }
}
.ad { padding: 4px 0 24px; }
.ad-toolbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 8px 0; background: var(--bg); border-bottom: 1px solid var(--line);
}
.ad-filter {
  font-family: var(--font-body); font-size: .85rem;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); color: var(--ink);
}
.ad-domain { min-width: 180px; }
.ad-refresh {
  margin-left: auto; cursor: pointer; font-weight: 700; font-size: .82rem;
  font-family: var(--font-display);
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--accent-deep);
}
.ad-bulkbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 8px 10px; margin: 8px 0; border-radius: var(--radius-md);
  background: var(--accent-dim); border: 1px solid var(--line);
}
.ad-bulkbar[hidden] { display: none; }
.ad-selcount { font-weight: 700; margin-right: 6px; }
/* No overflow (and so no nested scroll container) on desktop — the table fits the
   widened frame. Horizontal scroll is enabled only on narrow screens below. */
.ad-table-wrap { margin-top: 8px; }
.ad-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.ad-table thead th {
  text-align: left; font-family: var(--font-display); font-weight: 700;
  font-size: .78rem; color: var(--muted); text-transform: uppercase;
  padding: 8px; background: var(--bg); border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ad-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ad-table tbody tr:hover { background: var(--accent-dim); }
.ad-row.ad-cursor { box-shadow: inset 3px 0 0 var(--accent); background: var(--accent-dim); }
.ad-cb { width: 1%; white-space: nowrap; }
.ad-num { text-align: right; width: 1%; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ad-date { white-space: nowrap; color: var(--muted); }
.ad-name { font-weight: 700; cursor: pointer; }
.ad-name:hover { text-decoration: underline; }
.ad-namecell { max-width: 320px; }
.ad-sub { color: var(--muted); font-size: .76rem; margin-top: 2px; }
.ad-srclink { text-decoration: none; }
/* Disclosure caret + expandable per-listing detail row (render/admin-desktop.js).
   The detail block itself (.li-info) is the shared style in screens.css. */
.ad-caret {
  border: none; background: none; cursor: pointer; color: var(--muted);
  font-size: .8rem; padding: 0 6px 0 0; line-height: 1;
  transition: transform .12s ease; display: inline-block;
}
.ad-caret.open { transform: rotate(90deg); color: var(--accent-deep); }
.ad-detail-row > td { border-top: none; padding-top: 0; }
.ad-detail { padding-bottom: 10px; }
.ad-comment {
  display: inline-block; max-width: 240px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: bottom; color: var(--muted); font-style: italic;
}
.ad-actions { white-space: nowrap; }
.ad-btn {
  cursor: pointer; font-weight: 700; font-size: .78rem; font-family: var(--font-display);
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); margin: 0 2px;
}
.ad-approve { border: none; background: var(--accent); color: #fff; }
.ad-quar { border: none; background: var(--danger); color: #fff; }
.ad-unq { border: 1px solid var(--danger); background: var(--danger-dim); color: var(--danger); }
.ad-dismiss { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.ad-clear { background: transparent; }
/* Training-set label buttons (reused on the mobile report cards + the training
   panel): reliable = green, inaccurate = amber/danger outline. */
.at-mark-rel { border: 1px solid var(--green); background: var(--green-dim); color: var(--green); }
.at-mark-inacc { border: 1px solid var(--danger); background: var(--danger-dim); color: var(--danger); }
.ad-loading { color: var(--muted); padding: 24px; text-align: center; }
.ad-help { color: var(--muted); font-size: .78rem; margin: 12px 4px; }
.ad-nav-cards {
  cursor: pointer; font-weight: 700; font-size: .8rem; font-family: var(--font-display);
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--accent-deep);
}
/* Below the desktop breakpoint the dense table is wider than the column — allow
   horizontal scroll (the only place .ad-table-wrap becomes a scroll container). */
@media (max-width: 899px) {
  .ad-table-wrap { overflow-x: auto; }
  .ad-comment { max-width: 120px; }
}
/* Admin usage-analytics dashboard (render/admin-analytics.js, #/admin/analytics).
   Dependency-free charts: CSS bars + one inline SVG column chart. Uses the shared
   design tokens (tokens.css). Widened to the bulk-admin column via body.admin-wide
   (set in render/core.js). */
.aa-daybar {
  display: flex;
  gap: 8px;
  padding: 12px 16px 4px;
}
.aa-day {
  text-decoration: none;
  font: 600 13px/1 var(--font-body);
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
}
.aa-day.on {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.aa-body { padding: 8px 16px 40px; }
.aa-loading, .aa-empty {
  color: var(--ink-2);
  font: 400 14px/1.4 var(--font-body);
  padding: 16px 2px;
}
.aa-empty { padding: 8px 2px; }
/* Headline stat cards */
.aa-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 8px 0 14px;
}
.aa-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-card);
}
.aa-stat-v { font: 700 26px/1.1 var(--font-display); color: var(--ink); }
.aa-stat-l { font: 600 12px/1.2 var(--font-body); color: var(--ink-2); margin-top: 4px; }
.aa-stat-s { font: 400 11px/1.3 var(--font-body); color: var(--muted); margin-top: 2px; }
/* Pain-point banner */
.aa-pain {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  font: 600 13px/1 var(--font-body);
  color: var(--ink-2);
}
.aa-pain.hot {
  background: var(--danger-dim);
  color: var(--danger);
}
.aa-section { margin: 0 0 18px; }
.aa-h {
  font: 700 14px/1.2 var(--font-display);
  color: var(--ink);
  margin: 0 0 8px;
}
/* Two-up grid of bar-list sections on wide screens */
.aa-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0 24px;
}
/* Horizontal bar lists */
.aa-bars { list-style: none; margin: 0; padding: 0; }
.aa-bars li {
  display: grid;
  grid-template-columns: minmax(60px, 38%) 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}
.aa-bar-l {
  font: 400 12px/1.3 var(--font-body);
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.aa-bar-track {
  background: var(--surface-2);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}
.aa-bar-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}
.aa-bar-v {
  font: 600 12px/1 var(--font-body);
  color: var(--ink);
  text-align: right;
  min-width: 34px;
}
/* SVG daily column chart */
.aa-chart {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px 6px;
}
.aa-chart svg { display: block; width: 100%; height: 110px; }
.aa-chart rect { fill: var(--accent); }
.aa-chart-x {
  display: flex;
  justify-content: space-between;
  font: 400 10px/1 var(--font-body);
  color: var(--muted);
  margin-top: 4px;
}
