/* Lantana Now: styles
 *
 * 1. Tokens (light, then dark)   5. Home              9. Report box
 * 2. Base and type               6. Detail layout    10. Timeline and charts
 * 3. Header and footer           7. Verdict card     11. Admin map picker
 * 4. Shared components           8. Conditions       12. About page, misc
 *
 * Status and chart colors were checked for contrast and color-blind
 * separation; change them with care. Status is never shown by color alone:
 * every colored state also has an icon and words.
 */

/* ---------- 1. Tokens ---------- */

:root {
  /* Surfaces and ink */
  --bg: #f4f7fb;
  --bg-tint: rgb(14 165 233 / 9%);
  --surface: #ffffff;
  --surface-2: #f5f8fc;
  --ink: #0f1b2d;
  --ink-2: #334155;
  --muted: #56657a;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  /* Darker than the brand sky blue, which is too light for text on white. */
  --link: #0b63b5;

  /* Brand: navy (trust), sky blue (action), green (community), orange (alert) */
  --brand: #0b3d91;
  --brand-2: #1250b5;
  --brand-ink: #ffffff;
  --brand-text: #0b3d91;   /* wordmark and headings */
  --logo-navy: #0b3d91;
  --logo-blue: #0ea5e9;    /* logo and accents only, never body text */
  --logo-green: #43a047;
  --alert: #f97316;

  /* Home banner: sunset over the treeline */
  --bn-sky-1: #8cc0ec; --bn-sky-2: #d6e6f3; --bn-sky-3: #f7dcb9;
  --bn-glow-1: rgb(255 214 140 / 95%); --bn-glow-2: rgb(255 170 90 / 35%); --bn-glow-3: rgb(255 170 90 / 0%);
  --bn-sun: #fff4d6;
  --bn-cloud: rgb(255 255 255 / 55%);
  --bn-hill: #9fb9b6;
  --bn-tree-1: #7f9f78; --bn-tree-2: #557e4c; --bn-tree-3: #365f33;
  --bn-wall: #e9dfd2; --bn-roof: #7c6a62;
  --bn-haze: 0.35;
  --bn-ink: #0b3d91; --bn-ink-2: #1f3354;

  /* Status: tinted background, dark ink, strong mark */
  --bad-bg: #fdecea;   --bad-ink: #8c1c17;   --bad-dot: #d23b33;
  --good-bg: #e3f4e6;  --good-ink: #125a1e;  --good-dot: #1f9b3a;
  --mixed-bg: #fff2d4; --mixed-ink: #694600; --mixed-dot: #d48e00;
  --none-bg: #eef2f7;  --none-ink: #44516a;  --none-dot: #8a95a8;

  /* Charts (validated set) */
  --spark: #d03b3b;
  --spark-base: #d5dde8;
  --chart-bad: #d03b3b;
  --chart-good: #5b6ee8;
  --chart-rain: #1f86b8;
  --chart-creek: #0f7f7a;
  --chart-grid: #e6ebf2;
  --trend-up: #a8331f;
  --trend-down: #145a14;

  /* Buttons */
  --btn-bad-bg: #b92f2f;
  --btn-bad-ink: #ffffff;

  /* Shape, depth, rhythm */
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --radius: var(--r-md);
  --shadow-sm: 0 1px 2px rgb(15 27 45 / 6%);
  --shadow-md: 0 1px 2px rgb(15 27 45 / 5%), 0 10px 30px -12px rgb(15 27 45 / 18%);
  --shadow-lg: 0 2px 4px rgb(15 27 45 / 6%), 0 18px 40px -16px rgb(15 27 45 / 26%);
  --gutter: 16px;
  --gap: 16px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Dark mode applies when the device is dark and the visitor hasn't chosen
   light, or when they've chosen dark with the header's theme button (which
   sets data-theme on <html>; see theme.js). The two token blocks below must
   stay identical; tests/theme.test.js checks that. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1120;
    --bg-tint: rgb(14 165 233 / 10%);
    --surface: #111a2c;
    --surface-2: #16213a;
    --ink: #e6edf7;
    --ink-2: #b4c0d3;
    --muted: #8a99b0;
    --border: #1e2a42;
    --border-strong: #2c3b5a;
    --link: #5cc8f5;

    --brand: #1d5fc4;
    --brand-2: #2a6fd6;
    --brand-text: #e6edf7;
    --logo-navy: #2f6fd8;
    --logo-blue: #38bdf8;

    --bn-sky-1: #0f1d3d; --bn-sky-2: #3a3560; --bn-sky-3: #b0605a;
    --bn-glow-1: rgb(255 168 92 / 85%); --bn-glow-2: rgb(214 104 76 / 30%); --bn-glow-3: rgb(214 104 76 / 0%);
    --bn-sun: #ffd9a0;
    --bn-cloud: rgb(255 200 180 / 18%);
    --bn-hill: #3c4560;
    --bn-tree-1: #2d3a4a; --bn-tree-2: #1f2b36; --bn-tree-3: #141d26;
    --bn-wall: #4a4650; --bn-roof: #2a2630;
    --bn-haze: 0.25;
    --bn-ink: #ffffff; --bn-ink-2: #e6e9f5;

    --bad-bg: #3b1715;   --bad-ink: #ffb4ab;   --bad-dot: #f0645b;
    --good-bg: #12301a;  --good-ink: #9fe3a9;  --good-dot: #3cc35c;
    --mixed-bg: #382a0b; --mixed-ink: #ffd27a; --mixed-dot: #f2b01e;
    --none-bg: #1a2438;  --none-ink: #c2cbd9;  --none-dot: #7d8aa0;

    --spark: #ef6b62;
    --spark-base: #2f3c55;
    --chart-bad: #e0625b;
    --chart-good: #6f80ea;
    --chart-rain: #4aa8d4;
    --chart-creek: #3aaa9f;
    --chart-grid: #1f2a40;
    --trend-up: #ffab91;
    --trend-down: #9be09b;

    --btn-bad-bg: #ef6b62;
    --btn-bad-ink: #1d0b0a;

    --shadow-sm: none;
    --shadow-md: 0 0 0 1px rgb(255 255 255 / 2%);
    --shadow-lg: 0 18px 40px -16px rgb(0 0 0 / 60%);
  }
  /* Darken only the admin picker's base tiles; the circle and pin keep color. */
  :root:not([data-theme="light"]) .picker .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9); }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a1120;
  --bg-tint: rgb(14 165 233 / 10%);
  --surface: #111a2c;
  --surface-2: #16213a;
  --ink: #e6edf7;
  --ink-2: #b4c0d3;
  --muted: #8a99b0;
  --border: #1e2a42;
  --border-strong: #2c3b5a;
  --link: #5cc8f5;

  --brand: #1d5fc4;
  --brand-2: #2a6fd6;
  --brand-text: #e6edf7;
  --logo-navy: #2f6fd8;
  --logo-blue: #38bdf8;

  --bn-sky-1: #0f1d3d; --bn-sky-2: #3a3560; --bn-sky-3: #b0605a;
  --bn-glow-1: rgb(255 168 92 / 85%); --bn-glow-2: rgb(214 104 76 / 30%); --bn-glow-3: rgb(214 104 76 / 0%);
  --bn-sun: #ffd9a0;
  --bn-cloud: rgb(255 200 180 / 18%);
  --bn-hill: #3c4560;
  --bn-tree-1: #2d3a4a; --bn-tree-2: #1f2b36; --bn-tree-3: #141d26;
  --bn-wall: #4a4650; --bn-roof: #2a2630;
  --bn-haze: 0.25;
  --bn-ink: #ffffff; --bn-ink-2: #e6e9f5;

  --bad-bg: #3b1715;   --bad-ink: #ffb4ab;   --bad-dot: #f0645b;
  --good-bg: #12301a;  --good-ink: #9fe3a9;  --good-dot: #3cc35c;
  --mixed-bg: #382a0b; --mixed-ink: #ffd27a; --mixed-dot: #f2b01e;
  --none-bg: #1a2438;  --none-ink: #c2cbd9;  --none-dot: #7d8aa0;

  --spark: #ef6b62;
  --spark-base: #2f3c55;
  --chart-bad: #e0625b;
  --chart-good: #6f80ea;
  --chart-rain: #4aa8d4;
  --chart-creek: #3aaa9f;
  --chart-grid: #1f2a40;
  --trend-up: #ffab91;
  --trend-down: #9be09b;

  --btn-bad-bg: #ef6b62;
  --btn-bad-ink: #1d0b0a;

  --shadow-sm: none;
  --shadow-md: 0 0 0 1px rgb(255 255 255 / 2%);
  --shadow-lg: 0 18px 40px -16px rgb(0 0 0 / 60%);
}
:root[data-theme="dark"] .picker .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9); }
:root[data-theme="light"] { color-scheme: light; }

/* ---------- 2. Base and type ---------- */

*, *::before, *::after { box-sizing: border-box; }
/* The hidden attribute always wins, even over components that set display. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 420px at 50% -120px, var(--bg-tint), transparent 70%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { letter-spacing: -0.015em; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible + span {
  outline: 3px solid var(--link);
  outline-offset: 2px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
@media (min-width: 720px) { :root { --gutter: 24px; } }

main { flex: 1; padding-top: 12px; padding-bottom: 48px; }

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Numbers that update line up instead of jittering. */
.cond-value, .stats dd, .creek-value, .card-foot, .live-chip, .report-msg, .spark-axis {
  font-variant-numeric: tabular-nums;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- 3. Header and footer ---------- */

/* A light sticky bar, as in the brand sheet, with a thin navy-to-sky-to-green
   stripe along the bottom. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1100; /* above Leaflet's map controls */
  color: var(--ink);
  background: var(--surface); /* fallback: iOS before 16.2 has no color-mix() */
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 20px -14px rgb(15 27 45 / 35%);
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 3px;
  background: linear-gradient(90deg, var(--logo-navy) 0%, var(--logo-blue) 55%, var(--logo-green) 100%);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 760;
  letter-spacing: -0.02em;
}
.brand-mark { width: 32px; height: 38px; flex: none; }
.lm-pin, .lm-house { fill: var(--logo-navy); }
.lm-face { fill: #ffffff; }
.lm-water { fill: var(--logo-blue); }
.lm-land, .lm-tree { fill: var(--logo-green); }
.lm-trunk { fill: none; stroke: var(--logo-navy); stroke-width: 1.4; stroke-linecap: round; }

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { color: var(--brand-text); font-weight: 800; letter-spacing: -0.03em; }
.site-header .brand-name { font-size: 1.35rem; }
/* "Now" is the logo's sky blue: fine for a logotype, too light for body text. */
.brand-now { color: var(--logo-blue); }
.brand-tag { margin-top: 2px; color: var(--muted); font-size: 0.72rem; font-weight: 550; letter-spacing: 0.01em; }
@media (max-width: 560px) { .brand-tag { display: none; } }
/* "Beta" next to the wordmark while the site is new; links to the contact
   form. Neutral, not red: red means "Closed" and "Power out" here. Remove
   the .beta-badge links (and .beta-note on the home page) at full launch. */
.brand-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.beta-badge {
  padding: 2px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--brand-text);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.beta-badge:hover { border-color: var(--logo-blue); }
.beta-note { margin: 4px 0 0; color: var(--muted); font-size: 0.85rem; }
.brand-name { white-space: nowrap; }
/* Narrow phones: a smaller wordmark and pill so the header stays on one line. */
@media (max-width: 400px) {
  .site-header .brand { gap: 7px; }
  .site-header .brand-mark { width: 28px; height: 33px; }
  .site-header .brand-name { font-size: 1.18rem; }
  .brand-row { gap: 6px; }
  .beta-badge { padding: 1px 6px; font-size: 0.62rem; }
  .header-actions { gap: 6px; }
}
/* The smallest phones: no room for the pill; the home page's beta line remains. */
@media (max-width: 349px) { .beta-badge { display: none; } }

.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.28em; /* the space in "About this site": flex layout drops typed spaces */
  min-height: 38px;
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--brand-text);
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.header-btn:hover { background: var(--surface-2); border-color: var(--logo-blue); }
.header-actions { display: flex; align-items: center; gap: 8px; }
/* "About this site" becomes "About" where the header gets tight. */
@media (max-width: 420px) { .header-btn-more { display: none; } }

/* Light/dark switch: shows the moon in light mode and the sun in dark mode
   (what you'd switch to). */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--brand-text);
  cursor: pointer;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.theme-toggle:hover { background: var(--surface-2); border-color: var(--logo-blue); }
.theme-toggle:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.theme-toggle .icon { width: 19px; height: 19px; }
.theme-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-moon { display: none; }
  :root:not([data-theme="light"]) .theme-sun { display: block; }
}
:root[data-theme="dark"] .theme-moon { display: none; }
:root[data-theme="dark"] .theme-sun { display: block; }
.header-btn[aria-current="page"] { background: var(--surface-2); background: color-mix(in srgb, var(--logo-blue) 12%, transparent); border-color: var(--logo-blue); }

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.875rem;
  padding: 24px 0 32px;
}
.footer-inner {
  display: grid;
  gap: 8px 24px;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .footer-inner { grid-template-columns: auto 1fr auto; align-items: center; }
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}
.footer-brand .brand-mark { width: 22px; height: 26px; }
.footer-brand .brand-name { font-size: 1.05rem; }
.footer-note { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: var(--ink-2); font-weight: 600; }

/* Home banner: the drawn sunset scene with the logo, name and tagline in the
   sky. The art is cropped from the left on narrow screens so the sun stays
   in view. */
.banner {
  position: relative;
  height: 240px;
  overflow: hidden;
  background: var(--bn-sky-2);
}
body[data-view="detail"] .banner { display: none; }
.banner-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bn-sky-1 { stop-color: var(--bn-sky-1); }
.bn-sky-2 { stop-color: var(--bn-sky-2); }
.bn-sky-3 { stop-color: var(--bn-sky-3); }
.bn-glow-1 { stop-color: var(--bn-glow-1); }
.bn-glow-2 { stop-color: var(--bn-glow-2); }
.bn-glow-3 { stop-color: var(--bn-glow-3); }
.bn-sun { fill: var(--bn-sun); }
.bn-cloud { fill: var(--bn-cloud); }
.bn-hill { fill: var(--bn-hill); }
.bn-tree-1 { fill: var(--bn-tree-1); }
.bn-tree-2 { fill: var(--bn-tree-2); }
.bn-tree-3 { fill: var(--bn-tree-3); }
.bn-wall { fill: var(--bn-wall); }
.bn-roof { fill: var(--bn-roof); }
.bn-haze { opacity: var(--bn-haze); }

.banner-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 30px;
}
.banner-mark { width: 64px; height: 77px; filter: drop-shadow(0 4px 10px rgb(11 61 145 / 25%)); }
.banner-name {
  margin: 0;
  color: var(--bn-ink);
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.035em;
}
.banner-tag {
  margin: 8px 0 0;
  color: var(--bn-ink-2);
  font-size: clamp(0.9rem, 2.2vw, 1.15rem);
  font-weight: 550;
  letter-spacing: 0.02em;
}
/* On phones the sky is shorter: a smaller mark, and the text sits higher. */
@media (max-width: 560px) {
  .banner { height: 190px; }
  .banner-inner { gap: 12px; padding-top: 22px; }
  .banner-mark { width: 46px; height: 55px; }
}
/* The banner already shows the tagline on the home page. */
body[data-view="home"] .site-header .brand-tag { display: none; }

/* ---------- 4. Shared components ---------- */

.section-title {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel, .report, .cond, .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}
.panel { padding: 20px; }
.panel-title { margin: 0; font-size: 1.12rem; }
.panel-sub { margin: 4px 0 6px; color: var(--muted); font-size: 0.9rem; }
.caption { margin: 8px 0 0; color: var(--muted); font-size: 0.8rem; }
.caption a { color: inherit; }

.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-2);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.live-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good-dot);
}
.live-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--good-dot);
  opacity: 0;
  animation: pulse 2.4s var(--ease) infinite;
}
.live-chip.is-offline .live-dot, .live-chip.is-waiting .live-dot { background: var(--mixed-dot); }
.live-chip.is-offline .live-dot::after, .live-chip.is-waiting .live-dot::after { animation: none; }
@keyframes pulse {
  0% { transform: scale(0.6); opacity: 0.7; }
  80%, 100% { transform: scale(1.6); opacity: 0; }
}

.pill-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--none-dot); }
.dot-bad { background: var(--bad-dot); }
.dot-good { background: var(--good-dot); }

.notice {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--mixed-bg);
  color: var(--mixed-ink);
  font-size: 0.9rem;
}
.empty { color: var(--muted); padding: 24px 0; }
.unavailable { color: var(--muted); font-style: italic; margin: 4px 0 8px; }
.cond-loading { color: var(--muted); margin: 4px 0 8px; }

/* ---------- 5. Home ---------- */

/* Kept small so the cards below are what the eye lands on. */
.intro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  margin: 16px 0 18px;
}
.intro-text { max-width: 640px; }
.intro-title {
  margin: 0;
  color: var(--brand-text);
  font-size: clamp(1.15rem, 3vw, 1.35rem);
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: -0.01em;
}
.intro-lead { margin: 2px 0 0; color: var(--muted); font-size: 0.88rem; }

.what-is {
  max-width: 720px;
  margin: 0 0 22px;
  padding: 16px 18px;
  border-radius: var(--r-lg);
  /* Always the brand navy, in light and dark mode. */
  background: linear-gradient(135deg, #0b3d91 0%, #1250b5 100%);
  color: rgb(255 255 255 / 92%);
  font-size: 0.92rem;
  box-shadow: var(--shadow-md);
}
.what-is strong { color: #7dd3fc; }
.what-is a { color: #ffffff; font-weight: 700; }
.what-is a:focus-visible { outline-color: #ffffff; }

.category { margin-bottom: 32px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: var(--gap);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 210px;
  padding: 20px 20px 16px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
/* Status stripe across the top edge, so cards scan at a glance. */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--none-dot);
}
.card-bad::before { background: var(--bad-dot); }
.card-good::before { background: var(--good-dot); }
.card-mixed::before { background: var(--mixed-dot); }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.card:active { transform: translateY(0); }
.card:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }

.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-titles { min-width: 0; }
.card-category {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.card-name { margin: 0; font-size: 1.15rem; line-height: 1.25; font-weight: 720; }
.card-sub { margin: 3px 0 0; color: var(--muted); font-size: 0.9rem; }
.card-go {
  color: var(--muted);
  transition: transform 0.2s var(--ease), color 0.2s var(--ease);
}
.card:hover .card-go { transform: translateX(3px); color: var(--link); }

.card-verdict {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--none-ink);
}
.card-verdict .hero-icon { width: 1.05em; height: 1.05em; }
.card-bad .card-verdict { color: var(--bad-ink); }
.card-good .card-verdict { color: var(--good-ink); }
.card-mixed .card-verdict { color: var(--mixed-ink); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .card-bad .card-verdict .hero-icon { color: var(--bad-dot); }
  :root:not([data-theme="dark"]) .card-good .card-verdict .hero-icon { color: var(--good-dot); }
  :root:not([data-theme="dark"]) .card-mixed .card-verdict .hero-icon { color: var(--mixed-dot); }
}
:root[data-theme="light"] .card-bad .card-verdict .hero-icon { color: var(--bad-dot); }
:root[data-theme="light"] .card-good .card-verdict .hero-icon { color: var(--good-dot); }
:root[data-theme="light"] .card-mixed .card-verdict .hero-icon { color: var(--mixed-dot); }

.spark-wrap { margin-top: auto; }
.spark { display: block; width: 100%; height: 52px; }
.spark rect { fill: var(--spark); }
.spark-base { stroke: var(--spark-base); stroke-width: 1; vector-effect: non-scaling-stroke; }
.spark-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.card-foot { margin: 0; color: var(--ink-2); font-size: 0.85rem; }

.card-skeleton {
  min-height: 210px;
  background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.steps {
  margin: 36px 0 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.steps .section-title { font-size: 0.72rem; }
.steps-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 12px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.steps-list li { display: flex; gap: 10px; }
.steps-list h3 { margin: 0 0 2px; font-size: 0.88rem; color: var(--ink-2); }
.steps-list p { margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.45; }
.step-n {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.75rem;
}

/* ---------- 6. Detail layout ---------- */

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 0;
  font-weight: 650;
  font-size: 0.95rem;
  text-decoration: none;
}
.back:hover { text-decoration: underline; }

.detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 20px;
  margin: 4px 0 18px;
}
.detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--link);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none; /* also used for the "Open in Maps" link */
  cursor: pointer;
}
.share-btn:hover { background: var(--surface-2); }
.share-btn .icon { width: 16px; height: 16px; }

.detail-name {
  margin: 0;
  color: var(--brand-text);
  font-size: clamp(1.6rem, 4.5vw, 2.25rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.detail-sub { margin: 4px 0 0; color: var(--muted); font-size: 1rem; }

/* Phones: one column, with "order" interleaving the two column wrappers so
   the safety note and conditions come before the report buttons. */
.detail-grid { display: flex; flex-direction: column; gap: var(--gap); }
.col-main, .col-side { display: contents; }
.verdict-card { order: 1; }
.disclaimer { order: 2; }
#d-conditions, .areas-panel { order: 3; }
#d-report { order: 4; }
.timeline { order: 5; }
/* Outage items (neighborhood pickers): reporting is the main action, so it
   comes right after the verdict, with the safety note and chart below. */
.report-first #d-report { order: 2; }
.report-first .disclaimer { order: 3; }
.fold-panel { order: 6; }

/* Wide screens: verdict and reporting on the left, data on the right. */
@media (min-width: 1000px) {
  .detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 24px;
    align-items: start;
  }
  .col-main, .col-side { display: flex; flex-direction: column; gap: var(--gap); }
}
/* When the window is tall enough to show the whole left column, keep the
   verdict and report buttons in view while the charts scroll past. */
@media (min-width: 1000px) and (min-height: 900px) {
  .col-main { position: sticky; top: 76px; }
}

.disclaimer {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink-2);
  font-size: 0.9rem;
}
.disclaimer .icon { color: var(--alert); width: 22px; height: 22px; margin-top: 1px; }
.disclaimer p { margin: 0; }
.disclaimer-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  color: var(--link);
  font-weight: 700;
}
.disclaimer .disclaimer-link .icon { width: 16px; height: 16px; margin: 0; color: currentColor; }
.disclaimer strong { color: var(--ink); }

.admin-message {
  margin-bottom: var(--gap);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  border: 1px solid var(--alert);
  color: var(--ink-2);
  font-size: 0.9rem;
}
.admin-message .icon { color: var(--alert); width: 22px; height: 22px; margin-top: 1px; flex: none; }
.admin-message p { margin: 4px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.admin-message .admin-message-until { font-size: 0.8rem; color: var(--muted); }
.admin-message strong { color: var(--ink); }

/* ---------- 7. Verdict card ---------- */

.verdict-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--none-bg);
  color: var(--none-ink);
  box-shadow: var(--shadow-md);
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
/* A soft highlight in the corner adds depth without noise. */
.verdict-card::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(255 255 255 / 35%), transparent);
  pointer-events: none;
}
.verdict-bad   { background: var(--bad-bg);   color: var(--bad-ink); }
.verdict-good  { background: var(--good-bg);  color: var(--good-ink); }
.verdict-mixed { background: var(--mixed-bg); color: var(--mixed-ink); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .verdict-card::before { background: radial-gradient(closest-side, rgb(255 255 255 / 6%), transparent); }
}
:root[data-theme="dark"] .verdict-card::before { background: radial-gradient(closest-side, rgb(255 255 255 / 6%), transparent); }

.hero { position: relative; padding: 20px 22px 14px; }
.hero p { margin: 0; }
.hero-kicker {
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}
.hero-verdict {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 8px !important;
  font-size: clamp(2rem, 8vw, 2.7rem);
  line-height: 1.05;
  font-weight: 850;
  letter-spacing: -0.035em;
}
.hero-icon {
  flex: none;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hero-detail { font-size: 0.98rem; line-height: 1.5; }
.hero-headsup {
  margin-top: 12px !important;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: rgb(0 0 0 / 6%);
  font-size: 0.92rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero-headsup { background: rgb(255 255 255 / 7%); }
}
:root[data-theme="dark"] .hero-headsup { background: rgb(255 255 255 / 7%); }

.hero-how {
  position: relative;
  margin: 0 22px;
  padding: 2px 0 12px;
  border-top: 1px solid currentColor;
  border-top-color: color-mix(in srgb, currentColor 18%, transparent);
  font-size: 0.86rem;
}
.hero-how summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0 2px;
  cursor: pointer;
  font-weight: 650;
  list-style: none;
}
.hero-how summary::-webkit-details-marker { display: none; }
.hero-how summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.15s var(--ease);
}
.hero-how[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.hero-how p { margin: 8px 0 2px; opacity: 0.92; }

/* ---------- 8. Conditions ---------- */

#d-conditions:empty { display: none; }
.conditions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.cond { padding: 14px 16px; border-radius: var(--r-lg); }
.cond p { margin: 0; }
.cond-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}
.cond-label .icon { width: 16px; height: 16px; color: var(--link); }
.cond-value {
  margin-top: 6px !important;
  font-size: 1.55rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.cond-sub { margin-top: 2px !important; color: var(--muted); font-size: 0.8rem; }
.conditions-note { margin: 8px 2px 0; color: var(--muted); font-size: 0.78rem; }

.trend { font-size: 0.82rem; font-weight: 700; letter-spacing: 0; white-space: nowrap; }
.trend-rising { color: var(--trend-up); }
.trend-falling { color: var(--trend-down); }
.trend-steady { color: var(--ink-2); }

/* ---------- 9. Report box ---------- */

.report { padding: 20px; }
.report-head { margin-bottom: 14px; }
.report-title { margin: 0; font-size: 1.15rem; }
.report-sub { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }

.area-pick { display: grid; gap: 6px; margin-bottom: 12px; }
.area-pick label { font-size: 0.88rem; font-weight: 700; }
.area-pick select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
.area-pick select:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.area-pick select[aria-invalid="true"] { border-color: var(--bad-dot); }

/* Tick-boxes for items that ask what was affected (Waste: trash, recycling). */
.service-pick { display: grid; gap: 8px; margin: 0 0 12px; padding: 0; border: 0; min-width: 0; }
.service-pick legend { padding: 0; margin-bottom: 6px; font-size: 0.88rem; font-weight: 700; }
.service-hint { color: var(--muted); font-weight: 500; }
.service-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
  cursor: pointer;
}
.service-option input { width: 22px; height: 22px; accent-color: var(--link); flex: none; }
.service-option:has(input:checked) { border-color: var(--link); background: var(--surface-2); }
.service-option:has(input:focus-visible) { outline: 3px solid var(--link); outline-offset: 2px; }
.service-pick[aria-invalid="true"] .service-option { border-color: var(--bad-dot); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.12s var(--ease), filter 0.15s var(--ease), border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.btn:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.btn:disabled { opacity: 0.42; cursor: not-allowed; }
.btn:not(:disabled):active { transform: scale(0.985); }
.btn .icon { width: 20px; height: 20px; }

.btn-bad {
  background: var(--btn-bad-bg);
  color: var(--btn-bad-ink);
  font-size: 1.1rem;
  box-shadow: 0 1px 0 rgb(255 255 255 / 15%) inset, 0 6px 16px -8px rgb(185 47 47 / 60%);
}
.btn-bad:not(:disabled):hover { filter: brightness(1.06); }

.btn-quiet { background: var(--surface-2); color: var(--ink); border-color: var(--border); }
.btn-quiet:not(:disabled):hover { border-color: var(--border-strong); background: var(--surface); }
.icon-bad { color: var(--bad-dot); }
.icon-good { color: var(--good-dot); }

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.btn-row > :only-child { grid-column: 1 / -1; }

.report-msg {
  margin: 12px 0 0;
  padding: 11px 14px;
  border-radius: var(--r-md);
  font-size: 0.93rem;
  background: var(--none-bg);
  color: var(--none-ink);
}
.report-msg-ok { background: var(--good-bg); color: var(--good-ink); }
.report-msg-error { background: var(--bad-bg); color: var(--bad-ink); }
.report-msg-cooldown { background: var(--mixed-bg); color: var(--mixed-ink); }

/* "Before you report": explains location and the cookie before the
   browser's own prompt. Continue and Not now are the same size on purpose. */
.notice-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
}
.notice-title { margin: 0; font-size: 1.05rem; color: var(--brand-text); }
.notice-points { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; font-size: 0.92rem; color: var(--ink-2); }
.notice-points li { display: flex; gap: 10px; align-items: flex-start; }
.notice-points strong { color: var(--ink); }
.notice-icon { width: 18px; height: 18px; margin-top: 2px; color: var(--link); }
.notice-foot { margin: 0; color: var(--muted); font-size: 0.86rem; }
.notice-steps { display: grid; gap: 6px; margin: 0; padding-left: 1.3em; color: var(--ink-2); font-size: 0.92rem; }
.notice-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.notice-actions-one { grid-template-columns: 1fr; }
.notice-actions .btn { min-height: 48px; }
/* On the public page these panels open as a modal dialog (see
   syncReportDialog in app.js), centered and scrollable on small phones. */
.report-dialog { max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; }
.report-dialog .notice-panel { margin: 0; padding: 22px; border: 0; background: none; gap: 14px; }
.report-dialog .notice-title { font-size: 1.2rem; }

/* The "i" after "the community boundary" (area-info.js): opens a small map
   of the reporting area. A 20px dot with a 44px tap target. */
.info-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin: 0 2px 0 4px;
  padding: 0;
  border: 1.5px solid var(--link);
  border-radius: 50%;
  background: none;
  color: var(--link);
  font: italic 700 0.75rem/1 Georgia, "Times New Roman", serif;
  vertical-align: 0.1em;
  cursor: pointer;
}
.info-btn::after { content: ""; position: absolute; inset: -12px; }
.info-btn:hover { background: var(--surface-2); }
.info-btn-static { cursor: default; }
.info-btn-static::after { content: none; }
.area-dialog, .sample-dialog { width: min(94vw, 520px); max-height: calc(100dvh - 32px); overflow: auto; }
.area-panel { display: grid; gap: 12px; padding: 20px; }
.area-panel .notice-title { margin: 0; font-size: 1.2rem; }
.area-panel .notice-foot { margin: 0; }
.area-map { min-height: 120px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); display: grid; place-items: center; }
.area-map img { display: block; width: 100%; height: auto; }
.area-outline { margin: 0; padding: 16px; display: grid; gap: 8px; justify-items: center; }
.area-outline svg { width: min(100%, 240px); height: auto; }
.area-outline polygon, .area-outline circle { fill: rgb(47 111 237 / 14%); stroke: #2f6fed; stroke-width: 1.2; stroke-linejoin: round; }
.area-outline .hint { margin: 0; text-align: center; }
.area-preview { display: block; width: 100%; max-width: 480px; height: auto; border-radius: var(--r-md); border: 1px solid var(--border); }
.btn-go { background: var(--brand); color: var(--brand-ink); }
.btn-go:not(:disabled):hover { filter: brightness(1.1); }

.official-source {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--ink-2);
  font-size: 0.9rem;
}
.official-source a { font-weight: 700; }

.privacy {
  display: flex;
  gap: 8px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.privacy .icon { width: 15px; height: 15px; margin-top: 2px; }

/* ---------- 10. Timeline and charts ---------- */

.tl-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 12px;
}

/* 6h / 24h segmented control (radio buttons, so it's one tap and fully
   keyboard accessible with arrow keys). */
.segmented {
  display: inline-flex;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
}
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented input + span {
  display: block;
  min-width: 52px;
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.segmented input:focus-visible + span { outline: 3px solid var(--link); outline-offset: 1px; }

.tl-block { padding-top: 16px; }
.tl-block + .tl-block { margin-top: 12px; border-top: 1px solid var(--border); }
.tl-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 8px;
}
.tl-title { margin: 0; font-size: 0.98rem; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
  color: var(--ink-2);
}
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; }
.swatch-bad { background: var(--chart-bad); }
.swatch-good { background: var(--chart-good); }

/* Reports by neighborhood: name and counts on one line, bar below. */
.areas-panel .tl-head { margin-bottom: 12px; }
.area-bars { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.area-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: baseline;
  font-size: 0.9rem;
}
.area-name { font-weight: 700; overflow-wrap: anywhere; }
.area-count { color: var(--ink-2); font-size: 0.84rem; font-variant-numeric: tabular-nums; text-align: right; }
.area-count strong { color: var(--ink); }
.area-track {
  grid-column: 1 / -1;
  display: flex;
  gap: 2px;
  height: 10px;
  border-radius: 4px;
  background: var(--chart-grid);
  overflow: hidden;
}
.area-seg { display: block; height: 100%; }
.area-seg:first-child { border-radius: 4px 0 0 4px; }
.area-seg:last-child { border-radius: 0 4px 4px 0; }
.area-seg:only-child { border-radius: 4px; }
.area-seg-bad { background: var(--chart-bad); }
.area-seg-good { background: var(--chart-good); }
.area-other .area-name { color: var(--ink-2); font-weight: 600; }
.areas-empty { margin: 0; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); color: var(--muted); font-size: 0.9rem; }
@media (forced-colors: active) {
  .area-seg { forced-color-adjust: none; }
  .area-seg-bad { background: CanvasText; }
  .area-seg-good { background: repeating-linear-gradient(45deg, CanvasText 0 2px, Canvas 2px 5px); }
}

.chart-box { position: relative; height: 170px; }
.chart-box-sm { height: 130px; }
@media (min-width: 1000px) {
  .chart-box { height: 200px; }
  .chart-box-sm { height: 150px; }
}
.chart-box .unavailable { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 8px 0 10px;
}
.stats div { padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.stats dt { color: var(--muted); font-size: 0.74rem; font-weight: 650; }
.stats dd { margin: 0; font-size: 1.1rem; font-weight: 800; letter-spacing: -0.01em; }

.creek-now { margin-bottom: 10px; }
.creek-now p { margin: 0; }
.creek-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.creek-meta { color: var(--muted); font-size: 0.85rem; }

.official-note {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--ink-2);
  font-size: 0.85rem;
}

/* Collapsible rows (native <details>). */
.fold-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  min-height: 48px;
  padding: 10px 32px 10px 0;
  position: relative;
  cursor: pointer;
  list-style: none;
}
.fold-summary::-webkit-details-marker { display: none; }
.fold-summary::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s var(--ease);
}
.fold[open] > .fold-summary::after { transform: translateY(-30%) rotate(-135deg); }
.fold-summary:hover .fold-title { color: var(--link); }
.fold-title { font-weight: 720; font-size: 1rem; transition: color 0.15s var(--ease); }
.fold-toggle {
  margin-left: auto;
  padding: 3px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--link);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}
.fold-hide, .fold[open] > .fold-summary .fold-show { display: none; }
.fold[open] > .fold-summary .fold-hide { display: inline; }
.fold-summary:hover .fold-toggle { background: var(--surface-2); }
.fold-peek { color: var(--ink-2); font-size: 0.9rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.fold-body { padding-bottom: 6px; animation: fold-in 0.25s var(--ease); }
@keyframes fold-in { from { opacity: 0; transform: translateY(-4px); } }
.tl-block.fold { padding-top: 6px; }
.fold-panel { padding: 6px 20px; }
.fold-panel > .fold-summary .fold-title { font-size: 1.12rem; }
.fold-panel[open] { padding-bottom: 18px; }

/* ---------- 11. Admin map picker ---------- */

/* The public pages have no map ("Open in Maps" links out instead); only the
   admin dashboard's location picker uses Leaflet. Its marker: */
.gauge-pin { background: none; border: 0; }
.gauge-pin svg { display: block; filter: drop-shadow(0 2px 3px rgb(0 0 0 / 35%)); }
/* Corner handles for a custom reporting shape. The element is the (larger,
   invisible) hit area; ::after is the dot people see. Leaflet positions the element itself, so the dot is centered absolutely. */
.shape-corner, .shape-mid { background: none; border: 0; }
.shape-corner { cursor: move; }
.shape-mid { cursor: copy; }
.shape-corner::after, .shape-mid::after {
  content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  border-radius: 50%; border: 2px solid #2f6fed;
}
.shape-corner::after { width: 14px; height: 14px; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 35%); transition: transform 0.15s var(--ease); }
.shape-corner.is-selected::after { background: #2f6fed; border-color: #fff; transform: translate(-50%, -50%) scale(1.35); }
.shape-mid::after { width: 12px; height: 12px; background: rgb(255 255 255 / 55%); opacity: 0.75; }
.shape-mid:hover::after { opacity: 1; background: #fff; }

/* ---------- 12. About page, misc ---------- */

.about { max-width: 780px; }
.about-title {
  margin: 8px 0 18px;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.about section { margin-top: 30px; }
.about h2 { margin: 0 0 8px; font-size: 1.2rem; }
.about p, .about li { color: var(--ink-2); }
.about ul { margin: 0; padding-left: 1.2em; }
.about li { margin: 7px 0; }
.about li::marker { color: var(--link); }
.about li strong, .about p strong { color: var(--ink); }

/* About page: a short lead, a jump bar, then sections built from tiles
   (safety, official sources, privacy promises), icon rows (how it works) and
   a label/description list (privacy details). */
.about-page { max-width: 980px; }
.about-page .about-title { margin-bottom: 8px; color: var(--brand-text); }
.about-lead { max-width: 68ch; margin: 0; font-size: 1.08rem; }
.about-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 6px; }
.about-jump a {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--brand-text);
  font-size: 0.86rem;
  font-weight: 650;
  text-decoration: none;
}
.about-jump a:hover { border-color: var(--logo-blue); }

.about-page .about-block { margin-top: 40px; scroll-margin-top: 84px; }
/* Terms of use: collapsed under its title until opened. */
.terms-fold { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.terms-fold > .fold-summary h2 { margin: 0; font-size: 1.2rem; }
.about .terms h3 { margin: 20px 0 4px; font-size: 1rem; }
.about .terms p { margin: 0; color: var(--ink-2); }
.about .terms .terms-updated { margin-top: 4px; color: var(--muted); font-size: 0.9rem; }
.about-page h2 { margin: 0 0 6px; font-size: 1.35rem; color: var(--brand-text); }
.about-page h3 { margin: 0; font-size: 1rem; color: var(--ink); }
.block-lead { max-width: 70ch; margin: 0 0 16px; }

/* Tiles: equal cards in a grid that drops to one column on phones. */
.about-page .tile-grid { display: grid; gap: 14px; margin: 14px 0 0; padding: 0; list-style: none; }
.about-page .tile-grid li { margin: 0; }
.tile-grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.tile-grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.tile, .link-tile {
  display: grid;
  align-content: start;
  gap: 8px;
  height: 100%;
  padding: 18px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.tile p, .link-tile span { margin: 0; font-size: 0.93rem; color: var(--ink-2); }
.tile-911 { border-color: var(--bad-dot); }
.tile-911 h3 { color: var(--bad-ink); }

.tile-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface-2);
}
.tile-icon .icon { width: 20px; height: 20px; }
.tone-alert { color: var(--alert); background: var(--mixed-bg); }
.tone-danger { color: var(--bad-dot); background: var(--bad-bg); }
.tone-good { color: var(--good-dot); background: var(--good-bg); }
.tone-water, .tone-brand { color: var(--link); background: color-mix(in srgb, var(--logo-blue) 13%, transparent); }

a.link-tile { color: inherit; text-decoration: none; transition: border-color 0.15s var(--ease); }
a.link-tile:hover { border-color: var(--logo-blue); }
a.link-tile:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.about-page .link-tile .link-tile-name { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 1rem; font-weight: 720; }
.about-page a.link-tile .link-tile-name { color: var(--link); }
.link-tile-name .icon { width: 16px; height: 16px; }

/* How it works: icon beside a short heading and paragraph, two columns. */
.about-page .feature-list {
  display: grid;
  gap: 22px 32px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.about-page .feature-list li { display: flex; gap: 14px; align-items: flex-start; margin: 0; }
.about-page .feature-list li > div { min-width: 0; }
.about-page .feature-list p { margin: 4px 0 0; font-size: 0.95rem; }

/* Privacy details: label column beside the text on wide screens. */
.about-page .details-title { margin: 26px 0 4px; font-size: 0.8rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.detail-list { margin: 0; }
.detail-list > div {
  display: grid;
  gap: 2px 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { font-weight: 720; color: var(--ink); }
.detail-list dd { margin: 0; color: var(--ink-2); max-width: 70ch; }
@media (min-width: 720px) {
  .detail-list > div { grid-template-columns: 190px minmax(0, 1fr); }
}

.about-page .plain-list { padding-left: 1.2em; }

.credits {
  margin: 12px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 12px;
}
.credits div {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.credits dt { font-weight: 720; color: var(--ink); }
.credits dd { margin: 3px 0 0; color: var(--ink-2); font-size: 0.9rem; }
.credits-note { margin-top: 14px; font-size: 0.9rem; }

/* ---------- Support page ---------- */

.support-lead { font-size: 1.05rem; margin: 0 0 18px; }
.support .notice { margin: 0 0 8px; }
.sponsors { margin-top: 22px; }
/* Sponsorship is collapsed until real sponsors sign up: a preview for
   anyone curious, with the promises and contact form always shown. */
.sponsor-fold {
  margin-top: 30px;
  padding: 6px 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
}
.sponsor-fold[open] { padding-bottom: 18px; }
.sponsor-fold > .fold-summary .fold-title { font-size: 1.12rem; }
.sponsor-fold > .fold-summary .soon-badge { margin: 0; }
.sponsor-fold .fold-body > section:first-child { margin-top: 8px; }
/* "Coming soon" above the sponsors until real ones are signed up. */
.soon-badge {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--brand-text);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Featured community sponsor: logo beside name and description. */
.sponsor-community {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: inherit;
  text-decoration: none;
}
.sponsor-community img { width: 104px; height: 104px; flex: none; border-radius: var(--r-md); }
.sponsor-community > span { display: grid; gap: 3px; min-width: 0; }
.sponsor-label { color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.sponsor-community-name { font-size: 1.25rem; font-weight: 780; color: var(--ink); }
.sponsor-blurb { color: var(--ink-2); font-size: 0.92rem; }

.sponsor-group { margin: 22px 0 10px; color: var(--muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.about .sponsor-grid { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.about .sponsor-grid li { margin: 0; }
.sponsor-grid-partner { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.sponsor-grid-supporter { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.sponsor-tile {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  text-decoration: none;
  text-align: center;
  height: 100%;
}
.sponsor-tile img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 10px; }
.sponsor-name { font-size: 0.85rem; font-weight: 650; line-height: 1.25; }
.sponsor-grid-supporter .sponsor-name { font-size: 0.78rem; }
.sponsor-community, .sponsor-tile { transition: border-color 0.15s var(--ease), transform 0.15s var(--ease); }
.sponsor-community:hover, .sponsor-tile:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.sponsor-community:focus-visible, .sponsor-tile:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.sponsor-fine { margin-top: 14px; color: var(--muted) !important; font-size: 0.82rem; }
.sponsor-empty { padding: 18px; border: 1px dashed var(--border-strong); border-radius: var(--r-md); text-align: center; }

.tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 12px;
  margin: 14px 0 0 !important;
  padding: 0 !important;
  list-style: none;
}
.about .tier {
  margin: 0;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}
.tier h3 { margin: 0; font-size: 1rem; }
.tier-alt { margin: 4px 0 0; font-size: 0.85rem; color: var(--muted) !important; }
.tier h3 + p:not(.tier-alt), .tier-alt + p { margin-top: 6px; }
.sponsor-ask {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  margin-top: 14px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.sponsor-ask p { margin: 0; }
.sponsor-contact-btn { width: auto; min-height: 46px; }

/* Contact form */
.contact-form { display: grid; gap: 14px; max-width: 640px; margin-top: 14px; }
.contact-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-fine { margin: 0; font-size: 0.85rem; color: var(--muted); }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.contact-actions .btn { width: auto; min-height: 46px; padding: 10px 20px; }
.contact-status { margin: 0; font-weight: 650; }
.contact-status:empty { display: none; }
.tier p:last-child { margin-bottom: 0; font-size: 0.9rem; }
.tip-btn {
  width: auto; min-height: 46px; gap: 8px; padding: 10px 22px;
  background: #00b9fe; border-color: #00b9fe; color: #062a3d; font-weight: 750; text-decoration: none;
}
.tip-btn:hover { background: #33c7fe; border-color: #33c7fe; }
.tip-cup { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.tip-hint { margin-top: 8px; }
@media (prefers-reduced-motion: reduce) {
  .sponsor-community, .sponsor-tile { transition: none; }
  .sponsor-community:hover, .sponsor-tile:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- 13. Admin dashboard ---------- */

.admin-badge {
  margin-left: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.admin-who { display: flex; align-items: center; gap: 12px; font-size: 0.85rem; }
.admin-user { opacity: 0.85; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .admin-user { display: none; } }

.admin-head { margin: 20px 0 18px; }
.admin-title { margin: 0; font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 800; letter-spacing: -0.03em; }
.admin-lead { margin: 4px 0 0; color: var(--ink-2); }

.admin-grid { display: grid; gap: var(--gap); align-items: start; }
@media (min-width: 960px) {
  .admin-grid { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); gap: 24px; }
  .admin-side { position: sticky; top: 76px; }
}
.admin-side, .admin-main { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 12px;
}
.hint { margin: 4px 0 0; color: var(--muted); font-size: 0.82rem; }

.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: var(--brand);
  color: var(--brand-ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn-sm .icon { width: 16px; height: 16px; }
.btn-sm:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--border); }
.btn-ghost:hover { filter: none; border-color: var(--border-strong); color: var(--ink); background: var(--surface-2); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:not(:disabled):hover { filter: brightness(1.1); }
.btn-danger { background: transparent; color: var(--bad-ink); border-color: color-mix(in srgb, var(--bad-dot) 45%, transparent); }
.btn-danger:not(:disabled):hover { background: var(--bad-bg); }
.dialog .btn-danger { background: var(--btn-bad-bg); color: var(--btn-bad-ink); border-color: transparent; }

.item-list, .blocked-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.item-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.item-row:hover { background: var(--surface-2); }
.item-row.is-selected { background: var(--surface-2); border-color: var(--border-strong); box-shadow: inset 3px 0 0 var(--link); }
.item-row-name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-row-meta { grid-column: 1 / -1; color: var(--muted); font-size: 0.8rem; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  align-self: start;
}
.tag .icon { width: 13px; height: 13px; }
.tag-live { background: var(--good-bg); color: var(--good-ink); }
.tag-hidden { background: var(--none-bg); color: var(--none-ink); }
.empty-box { padding: 16px; border: 1px dashed var(--border-strong); border-radius: var(--r-md); text-align: center; }
.empty-box p { margin: 0 0 10px; color: var(--muted); }

.blocked-list { margin-top: 10px; }
.blocked-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.blocked-list li > div { display: grid; min-width: 0; }
code { font: 0.85em ui-monospace, SFMono-Regular, Menlo, monospace; padding: 1px 5px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); }

.admin-placeholder { display: grid; place-items: center; gap: 8px; min-height: 240px; text-align: center; color: var(--muted); }
.admin-placeholder .icon { width: 36px; height: 36px; color: var(--border-strong); }

/* Editor form */
.editor { display: grid; gap: 4px; }
.form-error { padding: 10px 14px; border-radius: var(--r-md); background: var(--bad-bg); color: var(--bad-ink); font-weight: 600; }
.form-section { margin: 0; padding: 18px 0 10px; border: 0; border-top: 1px solid var(--border); min-width: 0; }
.form-section > legend, .advanced > summary {
  float: left;
  width: 100%;
  margin-bottom: 10px;
  padding: 0;
  font-weight: 750;
  font-size: 0.95rem;
}
.form-section > legend + * { clear: both; }
.advanced > summary { float: none; cursor: pointer; color: var(--ink); }

.field-grid { display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.field-grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.field { display: grid; gap: 5px; align-content: start; }
.field > label, .field > span { font-size: 0.85rem; font-weight: 650; color: var(--ink); }
.field input:not([type=checkbox]):not([type=range]), .field textarea, .field select, .hours input, .dialog input {
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}
.field input:focus, .field textarea:focus, .field select:focus, .hours input:focus, .dialog input:focus { outline: 3px solid color-mix(in srgb, var(--link) 35%, transparent); border-color: var(--link); }
.field input[readonly] { background: var(--surface-2); color: var(--muted); }
.field input[type=range] { width: 100%; accent-color: var(--link); }
.field-error { margin: 0; color: var(--bad-ink); font-size: 0.82rem; font-weight: 650; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--bad-dot) !important; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; }
.test-result { margin: 0; font-size: 0.82rem; color: var(--muted); }
.test-result:empty { display: none; }
.test-result.is-good { color: var(--good-ink); }
.test-result.is-bad { color: var(--bad-ink); }

.check { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 0.92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--link); }

.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 0.9rem; font-weight: 650; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background-color 0.2s var(--ease);
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 30%);
  transition: transform 0.2s var(--ease);
}
.switch input:checked + .switch-track { background: var(--good-dot); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--link); outline-offset: 2px; }

.picker { height: 300px; margin: 6px 0 14px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); cursor: crosshair; }
.picker.leaflet-container { background: var(--bg); font: inherit; }
.area-mode { margin-bottom: 8px; }
.area-estimate { margin: -8px 0 12px; }
.area-estimate:empty { display: none; }
.shape-tools { display: grid; gap: 6px; margin: -6px 0 14px; }
.shape-tools .input-row { flex-wrap: wrap; align-items: center; }
.shape-count { font-size: 0.88rem; font-weight: 650; color: var(--ink-2); margin-right: auto; }

.preview { margin-top: 16px; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px dashed var(--border-strong); }
.preview-label { margin: 0 0 10px; font-size: 0.72rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.preview-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); align-items: start; }
.preview-card { min-height: 0; pointer-events: none; box-shadow: var(--shadow-sm); }
.preview-card .spark { height: 40px; }
.preview-buttons .btn { pointer-events: none; min-height: 46px; }

.hours { display: grid; gap: 8px; margin-top: 12px; }
.hours-row { display: grid; grid-template-columns: 7rem auto 1fr 1fr; gap: 8px 12px; align-items: center; }
.hours-row .check { margin: 0; }
.hours-row .field-error { grid-column: 1 / -1; }
.hours-day { font-weight: 650; font-size: 0.9rem; }
@media (max-width: 520px) { .hours-row { grid-template-columns: 1fr auto; } .hours-row label:not(.check) { grid-column: span 1; } }

.editor-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 18px; border-top: 1px solid var(--border); }
.editor-actions .btn { width: auto; min-height: 46px; padding: 10px 20px; }
.editor-actions .btn-danger { margin-left: auto; }

/* Usage panel (admin): anonymous daily totals. */
.messages { margin-bottom: 18px; }
.messages .panel-head { justify-content: flex-start; gap: 10px; }
.tag-unread { background: color-mix(in srgb, var(--link) 16%, transparent); color: var(--link); }
.message-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.message { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); }
.message.is-unread { border-color: var(--border-strong); box-shadow: inset 3px 0 0 var(--link); }
.message-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 0.9rem; }
.message-head a { overflow-wrap: anywhere; }
.message-head time { margin-left: auto; color: var(--muted); font-size: 0.85rem; }
.message-body { margin: 8px 0; white-space: pre-line; overflow-wrap: anywhere; }
.usage .panel-head { flex-wrap: wrap; gap: 10px; }
.usage-off { margin: 12px 0 0; padding: 10px 14px; border-radius: var(--r-md); background: var(--surface-2); color: var(--ink-2); font-size: 0.9rem; }
.usage-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 14px; }
.usage-tile { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); color: var(--muted); font-size: 0.85rem; }
.usage-num { color: var(--ink); font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.usage-chart { margin: 16px 0 0; }
.usage-chart svg { display: block; width: 100%; height: 90px; border-bottom: 1px solid var(--border); }
.usage-chart rect { fill: var(--link); }
.usage-chart figcaption { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; color: var(--muted); font-size: 0.78rem; }
.usage-sub { margin: 18px 0 0; font-size: 0.95rem; }
.table .num { text-align: right; }
.table tbody th {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: none;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
}
.usage-taps { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 500; }

/* Moderation table */
.table-wrap { margin-top: 12px; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.table th { text-align: left; padding: 10px 12px; background: var(--surface-2); color: var(--muted); font-size: 0.75rem; font-weight: 750; letter-spacing: 0.05em; text-transform: uppercase; }
.table td { padding: 10px 12px; border-top: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.table tr.is-blocked td { opacity: 0.6; }
.row-actions { text-align: right; display: flex; gap: 6px; justify-content: flex-end; }
.type { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.type::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--none-dot); }
.type-bad::before, .type-stillBad::before { background: var(--bad-dot); }
.type-good::before { background: var(--good-dot); }

.signin { max-width: 520px; margin: 48px auto; text-align: center; }
.signin h1 { margin: 0 0 6px; font-size: 1.5rem; }
.signin p { color: var(--ink-2); }
.signin-buttons { display: grid; gap: 10px; margin-top: 18px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 2000;
  max-width: min(92vw, 520px);
  padding: 12px 18px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--bg);
  font-weight: 650;
  box-shadow: var(--shadow-lg);
}
.toast.is-error { background: var(--btn-bad-bg); color: var(--btn-bad-ink); }

.dialog {
  width: min(92vw, 440px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.dialog::backdrop { background: rgb(5 12 11 / 55%); backdrop-filter: blur(2px); }
.dialog-body { padding: 22px; }
.dialog-body h2 { margin: 0 0 6px; font-size: 1.2rem; }
.dialog-body p { margin: 0 0 14px; color: var(--ink-2); }
.dialog-body .field { margin-bottom: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.dialog-actions .btn { width: auto; min-height: 44px; padding: 8px 18px; }
/* Wide screens: partners stay larger than supporters but never huge. */
@media (min-width: 700px) {
  .sponsor-grid-partner { grid-template-columns: repeat(auto-fill, minmax(180px, 220px)); }
  .sponsor-grid-supporter { grid-template-columns: repeat(auto-fill, minmax(120px, 140px)); }
}
