/*
 * The Green - styles. Mobile first. Calm "premium village" look (v2.1, tightened): a deep-green hero band on Home and the
 * access-code screen, compact rounded cards on one 4/8/12/16/24 spacing scale, two-tone page titles, one strong green
 * accent; the dark theme is frosted glass with a soft green glow. Spec: docs/DESIGN.md.
 * Every text/background pair below is checked against WCAG AA (4.5:1 body text, 3:1 large text and icons).
 * No inline styles are used anywhere (the CSP forbids them), so everything visual lives in this file.
 */

/* ---- Tokens ---------------------------------------------------------------------------------- */
:root {
  color-scheme: light dark;

  /* One spacing scale: 4 / 8 / 12 / 16 / 24 */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s6: 1.5rem;

  --bg: #eef5f1;
  --bg-2: #f7faf8;
  --surface: #ffffff;
  --glass-blur: none;
  --ink: #10231c;
  --ink-soft: #566a61;
  --line: #dce8e1;
  --field-line: #788f83; /* input borders need 3:1 against the page */

  --green-900: #0b3d2e;
  --green-600: #1f7a55;
  --green-400: #3dbe85;
  --primary: #1f7a55;
  --on-primary: #ffffff;
  --link: #1a6c4a;
  --soft: #e1efe7; /* quiet button / icon-well fill */

  /* Pastel tints (chips, avatars) - always paired with --ink */
  --t-mint: #ddf3e6;
  --t-sage: #e6eedd;
  --t-butter: #fbf1d6;
  --t-sky: #ddebfa;
  --t-blush: #fbe3e1;
  --t-lilac: #ece5f8;

  /* Status: tinted background + dark text (+ a stronger dot) */
  --open-bg: #ddf3e6;
  --open-ink: #0b5a38;
  --open-dot: #1f9d63;
  --soon-bg: #fbf1d6;
  --soon-ink: #7a5300;
  --soon-dot: #c98a0b;
  --closed-bg: #fbe3e1;
  --closed-ink: #9a2b24;
  --closed-dot: #b4443c;

  --seg-track: #e1ebe5;
  --seg-on: #ffffff;
  --header-bg: rgba(238, 245, 241, 0.92);
  --nav-bg: rgba(255, 255, 255, 0.9);
  --nav-ink: #566a61;
  --nav-active: #0b3d2e;
  --sheet-bg: #ffffff;
  --scrim: rgba(8, 24, 17, 0.42);
  --tip-bg: #ddf3e6;

  --bin-edge: rgba(0, 0, 0, 0.3); /* thin outline so pale bin colours stay visible */
  --hero-bg: linear-gradient(160deg, var(--t-mint) 0%, var(--surface) 78%);
  --edge: 0 0 0 0 transparent; /* dark mode: the 1px light inner border of a glass panel */
  --glow: 0 0 0 0 transparent; /* dark mode: green glow behind the active tab */
  --glow-btn: 0 0 0 0 transparent; /* dark mode: green glow under primary buttons */

  --shadow: 0 4px 16px rgba(16, 35, 28, 0.06);
  --shadow-float: 0 8px 28px rgba(16, 35, 28, 0.16);
  --radius: 18px;
  --body-image: none;

  /* Hero band (Home and the access-code screen): the same deep green in both themes. Text on it is white. */
  --band-grad: radial-gradient(70% 120% at 88% -10%, rgba(95, 211, 156, 0.26), transparent 68%), linear-gradient(172deg, #0b3d2e 0%, #1f7a55 100%);
  --header-h: calc(env(safe-area-inset-top) + 3.5rem);
  --band-h: calc(var(--header-h) + 6.25rem);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/*
 * Appearance: no data-theme on <html> = Auto (follow the phone); data-theme="light" or "dark" is the person's choice
 * (js/theme-boot.js sets it before first paint). CSS cannot share one rule between a media query and an attribute,
 * so the dark tokens appear twice, below. They MUST stay identical: tests/theme.test.mjs fails if they drift.
 * Components never test the theme themselves; they only use the tokens above, so every surface follows.
 */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* DARK TOKENS (1 of 2): Auto, on a phone set to dark */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1412;
    --bg-2: #0e1412;
    --surface: rgba(255, 255, 255, 0.06);
    --glass-blur: blur(16px);
    --ink: #e8f1ec;
    --ink-soft: #9db0a7;
    --line: rgba(255, 255, 255, 0.09);
    --field-line: rgba(255, 255, 255, 0.45);

    --primary: #3dbe85;
    --on-primary: #06140d;
    --link: #5fd39c;
    --soft: rgba(61, 190, 133, 0.16);

    --t-mint: rgba(61, 190, 133, 0.16);
    --t-sage: rgba(160, 200, 110, 0.15);
    --t-butter: rgba(240, 200, 80, 0.15);
    --t-sky: rgba(90, 160, 240, 0.17);
    --t-blush: rgba(240, 110, 100, 0.16);
    --t-lilac: rgba(170, 140, 240, 0.17);

    --open-bg: rgba(61, 190, 133, 0.17);
    --open-ink: #86e3b4;
    --open-dot: #3dbe85;
    --soon-bg: rgba(240, 190, 70, 0.17);
    --soon-ink: #f3cb6b;
    --soon-dot: #f0be46;
    --closed-bg: rgba(240, 110, 100, 0.17);
    --closed-ink: #ffa097;
    --closed-dot: #f0786e;

    --seg-track: rgba(255, 255, 255, 0.07);
    --seg-on: rgba(255, 255, 255, 0.16);
    --header-bg: rgba(14, 20, 18, 0.55);
    --nav-bg: rgba(28, 38, 33, 0.78);
    --nav-ink: #a9bbb2;
    --nav-active: #1f7a55;
    --sheet-bg: rgba(24, 33, 29, 0.94);
    --scrim: rgba(0, 0, 0, 0.55);
    --tip-bg: rgba(61, 190, 133, 0.16);

    --bin-edge: rgba(255, 255, 255, 0.4);
    --hero-bg: linear-gradient(160deg, rgba(61, 190, 133, 0.2) 0%, var(--surface) 80%);
    --edge: inset 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --glow: 0 0 20px rgba(61, 190, 133, 0.5);
    --glow-btn: 0 4px 18px rgba(61, 190, 133, 0.34);

    --shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-float: 0 10px 32px rgba(0, 0, 0, 0.5);
    --body-image: radial-gradient(90% 46% at 12% -8%, rgba(61, 190, 133, 0.17), transparent 62%),
      radial-gradient(70% 40% at 105% 34%, rgba(31, 122, 85, 0.14), transparent 66%);
  }
}

/* DARK TOKENS (2 of 2): chosen explicitly. Keep identical to the block above. */
:root[data-theme="dark"] {
  --bg: #0e1412;
  --bg-2: #0e1412;
  --surface: rgba(255, 255, 255, 0.06);
  --glass-blur: blur(16px);
  --ink: #e8f1ec;
  --ink-soft: #9db0a7;
  --line: rgba(255, 255, 255, 0.09);
  --field-line: rgba(255, 255, 255, 0.45);

  --primary: #3dbe85;
  --on-primary: #06140d;
  --link: #5fd39c;
  --soft: rgba(61, 190, 133, 0.16);

  --t-mint: rgba(61, 190, 133, 0.16);
  --t-sage: rgba(160, 200, 110, 0.15);
  --t-butter: rgba(240, 200, 80, 0.15);
  --t-sky: rgba(90, 160, 240, 0.17);
  --t-blush: rgba(240, 110, 100, 0.16);
  --t-lilac: rgba(170, 140, 240, 0.17);

  --open-bg: rgba(61, 190, 133, 0.17);
  --open-ink: #86e3b4;
  --open-dot: #3dbe85;
  --soon-bg: rgba(240, 190, 70, 0.17);
  --soon-ink: #f3cb6b;
  --soon-dot: #f0be46;
  --closed-bg: rgba(240, 110, 100, 0.17);
  --closed-ink: #ffa097;
  --closed-dot: #f0786e;

  --seg-track: rgba(255, 255, 255, 0.07);
  --seg-on: rgba(255, 255, 255, 0.16);
  --header-bg: rgba(14, 20, 18, 0.55);
  --nav-bg: rgba(28, 38, 33, 0.78);
  --nav-ink: #a9bbb2;
  --nav-active: #1f7a55;
  --sheet-bg: rgba(24, 33, 29, 0.94);
  --scrim: rgba(0, 0, 0, 0.55);
  --tip-bg: rgba(61, 190, 133, 0.16);

  --bin-edge: rgba(255, 255, 255, 0.4);
  --hero-bg: linear-gradient(160deg, rgba(61, 190, 133, 0.2) 0%, var(--surface) 80%);
  --edge: inset 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --glow: 0 0 20px rgba(61, 190, 133, 0.5);
  --glow-btn: 0 4px 18px rgba(61, 190, 133, 0.34);

  --shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-float: 0 10px 32px rgba(0, 0, 0, 0.5);
  --body-image: radial-gradient(90% 46% at 12% -8%, rgba(61, 190, 133, 0.17), transparent 62%),
    radial-gradient(70% 40% at 105% 34%, rgba(31, 122, 85, 0.14), transparent 66%);
}

/* ---- Base ------------------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  position: relative; isolation: isolate; /* so the hero band can sit behind the page content but above the page background */
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--body-image), linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-color: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font);
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
}
/* With a translucent iPhone status bar the clock is white, so the strip behind it is always dark green. It matches the top of the hero band. */
body::before {
  content: ""; position: fixed; z-index: 40; top: 0; left: 0; right: 0; height: env(safe-area-inset-top);
  background: var(--green-900); pointer-events: none;
}
a { color: var(--link); }
h1, h2, h3 { margin: 0; }
h1 { font-size: 1.625rem; line-height: 1.875rem; font-weight: 700; letter-spacing: -0.02em; margin: var(--s2) 0 var(--s3); text-wrap: balance; }
h2 { font-size: 1.0625rem; line-height: 1.3; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; margin: var(--s4) 0 var(--s1); }
p { margin: 0 0 var(--s3); }
svg.icon { width: 1.5rem; height: 1.5rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
h1:focus, h2:focus { outline: none; }
[hidden] { display: none !important; } /* author display rules must not defeat the hidden attribute */

/* Two-tone page titles: the main words in ink, a short tagline in the muted colour. The whole sentence is the heading's name. */
.t-main { color: var(--ink); }
.t-sub { display: inline-block; color: var(--ink-soft); font-weight: 600; } /* the tagline wraps as one piece, never split awkwardly */

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  clip-path: inset(50%); white-space: nowrap;
}
.skip-link { position: absolute; left: -999px; top: 0; border: 0; font: inherit; cursor: pointer; background: var(--primary); color: var(--on-primary); padding: 0.625rem 1rem; z-index: 60; border-radius: 0 0 12px 0; }
.skip-link:focus { left: 0; top: env(safe-area-inset-top); }

.small { font-size: 0.875rem; color: var(--ink-soft); }
.eyebrow { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: var(--s1); }
.big { font-size: 1.125rem; line-height: 1.3; font-weight: 700; margin-bottom: var(--s2); letter-spacing: -0.01em; }
.big-ish { font-weight: 600; font-size: 1rem; }
.notice { background: var(--soon-bg); color: var(--soon-ink); padding: var(--s3) var(--s4); border-radius: 14px; font-weight: 500; }
.date-line { color: var(--ink-soft); font-size: 0.9375rem; margin: calc(-1 * var(--s2)) 0 var(--s4); }
.section-title { font-size: 1.125rem; font-weight: 600; margin: var(--s4) 0 var(--s2); }
.find { margin-bottom: var(--s2); }

/* ---- Hero band (Home) ------------------------------------------------------------------------- */
/* A full-bleed deep-green band behind the header and the greeting. White text on it is checked against the whole gradient. */
.hero-band {
  /* At least --band-h, and always tall enough for what is on it: app.js measures the greeting and date (which wrap at large text sizes
     or on narrow phones) and sets --band-fit, so white text never spills onto the pale page. */
  display: none; position: absolute; z-index: -1; top: 0; left: 0; right: 0; height: max(var(--band-h), var(--band-fit, 0px));
  background: var(--band-grad); background-color: var(--green-900); border-radius: 0 0 var(--radius) var(--radius);
}
body[data-route="home"]:not(.is-gate) .hero-band { display: block; }
#h-home { color: #fff; font-size: 1.75rem; line-height: 2rem; margin: var(--s1) 0 0; }
#view-home .date-line { color: #e9f5ee; margin: 0 0 var(--s6); }
#view-home .date-line:has(+ .road-banner) { margin-bottom: calc(var(--s6) + var(--s3)); } /* a road notice sits just below the band; the cards overlap the band slightly */

/* ---- Header ----------------------------------------------------------------------------------- */
.app-header {
  position: sticky; top: 0; z-index: 15;
  background: var(--header-bg); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  max-width: 40rem; margin: 0 auto; min-height: var(--header-h);
  padding: env(safe-area-inset-top) max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left));
}
.header-start { display: flex; align-items: center; gap: var(--s2); }
body:not([data-route="home"]) .header-support { display: none; }
.header-support:focus-visible { outline-color: currentColor; }
.village-pill {
  margin: 0; display: inline-flex; align-items: center; gap: var(--s2); min-height: 2.25rem; padding: 0 var(--s4) 0 var(--s3);
  border-radius: 999px; background: var(--surface); box-shadow: var(--shadow), var(--edge); font-weight: 600; font-size: 0.9375rem;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
/* Round buttons look 36px but keep a 44px touch area: the box is 44px, the visible disc is drawn inside it. */
.icon-btn {
  position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 2.75rem; height: 2.75rem; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; font: inherit;
}
.icon-btn::before {
  content: ""; position: absolute; z-index: -1; inset: 0.25rem; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow), var(--edge);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.icon-btn .icon { width: 1.25rem; height: 1.25rem; }
/* On Home, before scrolling, the header is see-through over the green band and its controls are frosted white-on-green. */
body[data-route="home"]:not(.is-scrolled):not(.is-gate) .app-header { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
body[data-route="home"]:not(.is-scrolled):not(.is-gate) .village-pill { background: rgba(255, 255, 255, 0.14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24); }
body[data-route="home"]:not(.is-scrolled):not(.is-gate) .icon-btn { color: #fff; }
body[data-route="home"]:not(.is-scrolled):not(.is-gate) .icon-btn::before { background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24); }
body[data-route="home"]:not(.is-scrolled):not(.is-gate) .app-header :focus-visible { outline-color: #fff; }

/* ---- Layout ----------------------------------------------------------------------------------- */
main { max-width: 40rem; margin: 0 auto; padding: var(--s1) max(1rem, env(safe-area-inset-right)) var(--s4) max(1rem, env(safe-area-inset-left)); }
#status { max-width: 40rem; margin: 0 auto; padding: var(--s1) max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left)); }
#status:empty { padding: 0; }
#status .notice { margin: 0; font-size: 0.9375rem; }

.card {
  background: var(--surface); border-radius: var(--radius); padding: var(--s4); margin: 0 0 var(--s3); box-shadow: var(--shadow), var(--edge);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.card-title { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s2); }
.card-title .icon { color: var(--link); width: 1.25rem; height: 1.25rem; }
.card-link {
  display: flex; align-items: center; justify-content: space-between; min-height: 2.75rem; margin-top: var(--s1); padding-top: var(--s1);
  border-top: 1px solid var(--line); font-weight: 600; text-decoration: none; color: var(--link);
}
.card-link .icon { width: 1.25rem; height: 1.25rem; }
.card > p:last-child { margin-bottom: 0; }
.card > h2 + p { margin-top: var(--s2); }

.plain-list, .collections, .chip-row, .bin-dots, .bin-stage, .bin-minis { list-style: none; padding: 0; margin: 0; }
:where(.plain-list) > li { padding: var(--s1) 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s2) 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; padding-top: 0; }
.row-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }

/* Banners and badges (the words always say it; colour only backs the words up) */
.banner { display: flex; align-items: center; gap: var(--s2); width: fit-content; max-width: 100%; margin: 0 0 var(--s2); padding: var(--s1) var(--s3); border-radius: 14px; font-weight: 600; font-size: 0.875rem; }
.banner .icon { width: 1.125rem; height: 1.125rem; }
.banner-warn { background: var(--soon-bg); color: var(--soon-ink); }
.banner-ok { background: var(--open-bg); color: var(--open-ink); }

.badge { flex: none; display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.125rem var(--s2); border-radius: 999px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.badge-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; }
.badge-open { background: var(--open-bg); color: var(--open-ink); }
.badge-open .badge-dot { background: var(--open-dot); }
.badge-closing { background: var(--soon-bg); color: var(--soon-ink); }
.badge-closing .badge-dot { background: var(--soon-dot); }
.badge-closed { background: var(--closed-bg); color: var(--closed-ink); }
.badge-closed .badge-dot { background: var(--closed-dot); }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s3) 0 0; }
.pill-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 2.75rem; padding: 0 1.25rem; border: 0;
  border-radius: 999px; background: var(--primary); color: var(--on-primary); font: inherit; font-size: 0.9375rem; font-weight: 700; text-decoration: none; cursor: pointer;
  box-shadow: var(--glow-btn);
}
.pill-btn .icon { width: 1.125rem; height: 1.125rem; }
.pill-btn-quiet { background: var(--soft); color: var(--link); box-shadow: none; }

/* ---- Bin illustrations ------------------------------------------------------------------------ */
.bin-art { display: block; height: auto; }
.bin-art-sm { width: 1.5rem; }
.bin-art-xs { width: 1.25rem; }
.bin-edge { stroke: var(--bin-edge); stroke-width: 1; }
.bin-art-lg { width: 4.25rem; filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.2)); }
.bin-dots { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); margin: 0 0 var(--s2); }
.bin-dot { display: inline-flex; align-items: center; gap: var(--s2); padding: var(--s1) var(--s3) var(--s1) var(--s2); border-radius: 999px; background: var(--soft); font-weight: 600; font-size: 0.875rem; }

.hero-card { background: var(--hero-bg); padding: var(--s4); }
.hero-title { font-size: 1.375rem; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; margin-bottom: var(--s1); }
.bin-stage { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s3) var(--s4); padding: var(--s4) 0 var(--s1); }
.bin-stage-item { display: flex; flex-direction: column; align-items: center; gap: var(--s2); min-width: 5rem; max-width: 7rem; text-align: center; }
.bin-name { font-size: 0.875rem; font-weight: 600; line-height: 1.25; }
.place-line { display: flex; align-items: center; gap: 0.375rem; color: var(--ink-soft); }
.place-line .icon { width: 1.125rem; height: 1.125rem; }

.coming { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); margin-bottom: var(--s2); }
.coming-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.bin-minis { display: flex; gap: var(--s2); flex: none; }

/* ---- Chips ------------------------------------------------------------------------------------ */
.tint-mint { --tint: var(--t-mint); }
.tint-sage { --tint: var(--t-sage); }
.tint-butter { --tint: var(--t-butter); }
.tint-sky { --tint: var(--t-sky); }
.tint-blush { --tint: var(--t-blush); }
.tint-lilac { --tint: var(--t-lilac); }
.tint-all { --tint: var(--surface); }

.chip-row { display: flex; gap: 0 var(--s2); }
.find .chip-row, .chip-scroll { overflow-x: auto; margin-inline: calc(-1 * max(1rem, env(safe-area-inset-left))); padding: var(--s1) max(1rem, env(safe-area-inset-left)) var(--s2); scrollbar-width: none; }
.find .chip-row::-webkit-scrollbar, .chip-scroll::-webkit-scrollbar { display: none; }
/* Chips look 36px tall and keep a 44px touch area (the tinted pill is drawn inside the 44px box). */
.cat-chip {
  position: relative; isolation: isolate; flex: none; display: inline-flex; align-items: center; gap: var(--s2); min-height: 2.75rem; padding: 0 var(--s4); border: 0; border-radius: 999px;
  background: transparent; color: var(--ink); font: inherit; font-size: 0.875rem; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.cat-chip::before { content: ""; position: absolute; z-index: -1; inset: 0.25rem 0; border-radius: 999px; background: var(--tint); box-shadow: 0 0 0 1px var(--line); }
.cat-chip[aria-pressed="true"] { color: #fff; }
.cat-chip[aria-pressed="true"]::before { background: var(--nav-active); box-shadow: var(--glow); }

/* ---- Services --------------------------------------------------------------------------------- */
.searchbox { position: relative; margin: var(--s2) 0 var(--s1); }
.searchbox .icon { position: absolute; left: var(--s4); top: 50%; margin-top: -0.75rem; color: var(--ink-soft); pointer-events: none; z-index: 1; }
input[type="search"] {
  width: 100%; min-height: 3rem; padding: 0 var(--s4) 0 3rem; font: inherit; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--field-line); border-radius: 999px; -webkit-appearance: none; appearance: none;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
input::placeholder { color: var(--ink-soft); opacity: 1; }
.trade-toolbar { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); margin: var(--s1) 0 var(--s2); }
.trade-trigger, .trade-clear { min-width: 2.75rem; max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: start; }
.trade-trigger::before { box-shadow: 0 0 0 1px var(--field-line); }
body:has(.trade-sheet[open]) { overflow: hidden; }
.trade-sheet[open] { display: flex; flex-direction: column; overflow: hidden; }
.trade-sheet .sheet-grab { flex: none; }
.trade-sheet .sheet-pane { display: flex; flex-direction: column; min-height: 0; padding-bottom: calc(var(--s3) + env(safe-area-inset-bottom)); }
.trade-sheet .sheet-head { flex: none; padding-inline: var(--s1); }
.trade-sheet .trade-sheet-list { overflow: auto; overscroll-behavior: contain; padding: var(--s1); }
.trade-option {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2); width: 100%; min-height: 2.75rem;
  padding: var(--s1) var(--s2); border: 0; border-radius: var(--s3); background: transparent;
  color: var(--ink); font: inherit; font-weight: 600; text-align: start; cursor: pointer;
}
.trade-option:hover, .trade-option[aria-pressed="true"] { background: var(--soft); }
.trade-option:focus-visible { outline-offset: -3px; }
.trade-option-label { display: flex; align-items: center; gap: var(--s3); min-width: 0; overflow-wrap: anywhere; }
.trade-emoji { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--tint); }
.trade-count { color: var(--ink-soft); font-weight: 400; }
.trade-check { flex: none; color: var(--link); visibility: hidden; }
.trade-option[aria-pressed="true"] .trade-check { visibility: visible; }
.result-count { margin: 0 0 var(--s2) var(--s1); }
.fineprint { margin: var(--s2) var(--s1) 0; }
/* Travel: trains and buses (time, where to, status) */
.tt-group + .tt-group { margin-top: var(--s2); }
.tt-group h3 { margin-top: var(--s2); }
.tt-row { gap: var(--s3); }
.tt-time { flex: none; min-width: 3.25rem; font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tt-main { flex: 1; }
.tt-cancelled .tt-time, .tt-cancelled .tt-main strong { text-decoration: line-through; text-decoration-thickness: 1px; }
.tt-empty { margin: var(--s1) 0 0; }
.tt-none .tt-main { padding-left: 0; }
.tt-credit a { color: var(--link); }

.contact-top { display: flex; align-items: center; gap: var(--s3); }
.contact-title { flex: 1; min-width: 0; line-height: 1.3; }
.contact-title p { margin: 0; overflow-wrap: anywhere; }
.contact-title h2 { overflow-wrap: anywhere; }
.contact > p { overflow-wrap: anywhere; }
.contact-unlisted { margin: var(--s2) 0 0; font-style: italic; }
.contact .contact-top { margin-bottom: var(--s2); }
.avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--tint); font-size: 1.125rem; line-height: 1; }
/* Notes show two lines; a "More" button opens the rest (it appears only when the notes are really cut off). */
.contact-notes { margin: 0 0 var(--s2); font-size: 0.9375rem; line-height: 1.4; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.contact-notes.is-open { display: block; overflow: visible; }
.more-btn {
  position: relative; display: inline-block; margin: calc(-1 * var(--s1)) 0 var(--s2); padding: 0; border: 0; background: none; color: var(--link);
  font: inherit; font-size: 0.875rem; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em;
}
.more-btn::after { content: ""; position: absolute; inset: -0.875rem -0.75rem; } /* at least 44px tall touch area around the small text button */
.contact-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: 0; }
.contact-foot .small { margin: 0; }
.round-actions { display: flex; margin-left: auto; margin-right: calc(-1 * var(--s1)); }
/* 36px discs with a 44px touch area each */
.round-btn { position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; color: var(--link); text-decoration: none; }
.round-btn::before { content: ""; position: absolute; z-index: -1; inset: 0.25rem; border-radius: 50%; background: var(--soft); }
.round-btn .icon { width: 1.25rem; height: 1.25rem; }
.round-btn-primary { color: var(--on-primary); }
.round-btn-primary::before { background: var(--primary); box-shadow: var(--glow-btn); }
.recommended { margin: 0 0 var(--s2); }

/* ---- Opening times ---------------------------------------------------------------------------- */
.segmented { display: flex; gap: var(--s1); padding: var(--s1); margin: var(--s2) 0 var(--s3); border-radius: 999px; background: var(--seg-track); }
.segmented button {
  flex: 1; min-height: 2.75rem; padding: 0 var(--s2); border: 0; border-radius: 999px; background: transparent; color: var(--ink-soft);
  font: inherit; font-size: 0.9375rem; font-weight: 600; cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--seg-on); color: var(--ink); box-shadow: 0 2px 8px rgba(16, 35, 28, 0.12); font-weight: 700; }

.status-text { margin: var(--s2) 0 var(--s1); font-weight: 700; font-size: 1rem; }
.status-unlisted { margin: var(--s2) 0; font-weight: 600; color: var(--ink-soft); }
.today-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); margin: 0 0 var(--s2); color: var(--ink-soft); font-size: 0.9375rem; }
.today-tag { padding: 0.0625rem var(--s2); border-radius: 999px; background: var(--nav-active); color: #fff; font-size: 0.75rem; font-weight: 700; }
.week { margin-top: var(--s1); border-top: 1px solid var(--line); }
.week summary { display: flex; align-items: center; justify-content: space-between; min-height: 2.75rem; cursor: pointer; list-style: none; font-weight: 600; color: var(--link); }
.week summary::-webkit-details-marker { display: none; }
.summary-chevron { width: 1.25rem; height: 1.25rem; transition: transform 0.18s ease; }
.week[open] .summary-chevron { transform: rotate(90deg); }
table.hours { width: 100%; border-collapse: collapse; margin: 0 0 var(--s2); font-size: 0.9375rem; }
.hours th, .hours td { text-align: left; padding: var(--s1) var(--s2); font-weight: 400; }
.hours th { width: 42%; font-weight: 600; }
.hours tr.today th, .hours tr.today td { background: var(--soft); color: var(--ink); font-weight: 700; } /* neutral: today's row must not look "open" while the badge says Closed */
.hours tr.today th { border-radius: 12px 0 0 12px; }
.hours tr.today td { border-radius: 0 12px 12px 0; }
.special h3 { margin-top: var(--s2); }
.special li { padding: 0.125rem 0; }
.schedule li { display: flex; flex-wrap: wrap; gap: 0.125rem var(--s3); padding: var(--s2) var(--s3); margin: 0 calc(-1 * var(--s3)); border-radius: 12px; font-size: 0.9375rem; }
.schedule strong { min-width: 5.5rem; }
.schedule li.today { background: var(--open-bg); color: var(--open-ink); }
.schedule li.today .small { color: inherit; }

/* ---- Parish digest & OpenStreetMap credit ------------------------------------------------------ */
.news-list { margin: 0; }
.news-item { display: flex; flex-direction: column; gap: var(--s1); padding: var(--s2) 0; border-top: 1px solid var(--line); }
.news-item:first-child { border-top: 0; padding-top: 0; }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); font-size: 0.8125rem; color: var(--ink-soft); }
.news-link { font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--ink-soft); text-underline-offset: 0.2em; overflow-wrap: anywhere; }
.news-link:hover { text-decoration-thickness: 2px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 0.3125rem; padding: 0.125rem var(--s2); border-radius: 999px;
  background: var(--tint); color: var(--ink); font-size: 0.8125rem; font-weight: 600; box-shadow: 0 0 0 1px var(--line);
}
.card-parish .card-link { text-decoration: none; }
.credit { margin: var(--s3) 0 0; }
.credit-top { margin: 0 var(--s1) var(--s3); }
.doc-list { margin: 0; }
.doc-row { display: flex; flex-direction: column; gap: 0.125rem; padding: var(--s2) 0; border-top: 1px solid var(--line); }
.doc-row:first-child { border-top: 0; padding-top: var(--s1); }
.doc-label { font-weight: 700; }
.doc-row a { color: var(--link); overflow-wrap: anywhere; }
.road-banner {
  display: flex; align-items: center; gap: var(--s3); margin: 0 0 var(--s3); padding: var(--s2) var(--s2) var(--s2) var(--s4);
  border-radius: var(--radius); background: var(--soon-bg); color: var(--soon-ink);
}
.road-emoji { font-size: 1.5rem; line-height: 1; flex: none; }
.road-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 0.9375rem; line-height: 1.35; }
.road-text a { color: inherit; font-weight: 600; text-underline-offset: 0.2em; overflow-wrap: anywhere; }
.banner-dismiss {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer;
}
.banner-dismiss .icon { width: 1.25rem; height: 1.25rem; }
.banner-dismiss:hover { background: rgba(0, 0, 0, 0.08); }
.osm-credit { margin-top: var(--s1); color: var(--ink-soft); }
.osm-credit p, .osm-credit ul { margin: var(--s1) 0 0; }
.osm-credit a { color: var(--link); }

/* ---- Events ("What's on"), the suggestion form and the owner's review page -------------------------- */
.event-list { margin: 0 0 var(--s1); }
.event-list > li { padding: 0; }
.event-top { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s2); }
.date-tile {
  flex: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 3rem; height: 3rem;
  border-radius: 12px; background: var(--soft); color: var(--ink); line-height: 1;
}
.date-tile-day { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.date-tile-month { margin-top: 0.125rem; font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
.event-title { flex: 1; min-width: 0; line-height: 1.3; }
.event-title h2 { overflow-wrap: anywhere; }
.event-when { margin: 0.125rem 0 0; color: var(--ink-soft); font-weight: 600; font-size: 0.9375rem; }
.nowrap { white-space: nowrap; }
.event-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: 0 0 var(--s2); }
.event .place-line { margin: 0 0 var(--s2); overflow-wrap: anywhere; font-size: 0.9375rem; }
.event-desc { white-space: pre-line; overflow-wrap: anywhere; margin: 0 0 var(--s2); font-size: 0.9375rem; line-height: 1.4; }
.event-by { margin: 0 0 var(--s1); overflow-wrap: anywhere; }
.event-by:empty { display: none; }
.event-contact { margin: 0 0 var(--s1); }
.event-contact-link { display: inline-flex; align-items: center; gap: var(--s2); min-height: 2.75rem; font-weight: 600; overflow-wrap: anywhere; }
.event-contact-link .icon { width: 1.25rem; height: 1.25rem; }
.event .actions { margin-top: var(--s1); }
.event-waiting { margin: 0 0 var(--s3); }
.event-thanks { width: auto; }
.event-add p { margin-bottom: 0; }

/* Form fields (also used by the review page's buttons below) */
.event-form h2, .suggest-form h2 { margin-bottom: var(--s1); }
.field { margin: 0 0 var(--s4); }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin-bottom: 0.375rem; }
.field label, .field-head label { font-weight: 600; font-size: 0.9375rem; }
.optional { font-weight: 400; color: var(--ink-soft); }
.counter { flex: none; font-size: 0.8125rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.field input[type="text"], .field input[type="date"], .field input[type="time"], .field select, .field textarea {
  display: block; width: 100%; min-height: 3rem; padding: var(--s2) var(--s4); font: inherit; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--field-line); border-radius: 14px; -webkit-appearance: none; appearance: none;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.field select { padding-right: 2.5rem; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 1.375rem) 50%, calc(100% - 1rem) 50%; background-size: 0.375rem 0.375rem; background-repeat: no-repeat; }
.field textarea { min-height: 7rem; resize: vertical; line-height: 1.45; }
.field input[type="date"], .field input[type="time"] { min-width: 0; }
.field [aria-invalid="true"] { border-color: var(--closed-dot); border-width: 2px; }
.field-hint { margin: 0.375rem 0 0; }
.field-error { margin: 0.375rem 0 0; color: var(--closed-ink); font-weight: 600; font-size: 0.9375rem; }
.field-error::before { content: "\26A0\FE0E  "; }
.check { display: flex; align-items: center; gap: var(--s3); min-height: 2.75rem; font-weight: 600; cursor: pointer; }
.check input { width: 1.5rem; height: 1.5rem; margin: 0; accent-color: var(--primary); flex: none; }
.form-summary { margin: 0 0 var(--s4); padding: var(--s3) var(--s4); border-radius: 14px; background: var(--closed-bg); color: var(--closed-ink); font-weight: 600; }
.form-summary:focus { outline: 3px solid var(--primary); outline-offset: 2px; }
.form-summary ul { margin: 0.375rem 0 0; padding-left: 1.25rem; }
.form-summary a { color: inherit; }
.event-form .actions, .suggest-form .actions { margin-top: var(--s4); }
.card-regular-activities { overflow-wrap: anywhere; }

/* ---- Suggestions (Support page) and Local producers --------------------------------------------- */
.suggest-card { margin-top: var(--s3); }
.suggest-card h2 { margin-bottom: var(--s1); }
.suggest-thanks { width: auto; margin: var(--s2) 0 0; }
.producer-list { margin: 0 0 var(--s1); }
.producer-list > li { padding: 0; }
.producer-desc { margin: 0 0 var(--s2); font-size: 0.9375rem; line-height: 1.4; overflow-wrap: anywhere; }
.producer .actions { margin-top: var(--s1); }
.card-producers p { margin: 0 0 var(--s2); }

#view-church .row-main, .card-church p { overflow-wrap: anywhere; }

/* Review page (review.html): standalone, the link's token is the only credential */
.review-main { max-width: 34rem; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 1rem) max(1rem, env(safe-area-inset-right)) 2rem max(1rem, env(safe-area-inset-left)); }
.review-brand { display: flex; align-items: center; gap: var(--s2); margin: 0 0 var(--s2); font-weight: 700; color: var(--ink-soft); }
.review-main h1 { font-size: 1.625rem; line-height: 1.2; margin: var(--s1) 0 var(--s4); overflow-wrap: anywhere; }
.review-facts { margin: 0 0 var(--s4); padding: 0; }
.review-facts div { padding: var(--s3) 0; border-top: 1px solid var(--line); }
.review-facts div:first-child { border-top: 0; padding-top: 0; }
.review-facts dt { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); }
.review-facts dd { margin: 0.125rem 0 0; overflow-wrap: anywhere; white-space: pre-line; }
.review-actions { display: grid; gap: var(--s3); margin-top: var(--s4); }
.review-actions .pill-btn { width: 100%; min-height: 3.75rem; font-size: 1.125rem; }
.pill-btn[disabled] { opacity: 0.6; cursor: progress; }
.review-note { margin: var(--s3) 0 0; }
.review-result { display: flex; align-items: flex-start; gap: var(--s3); }
.review-result .icon { width: 1.75rem; height: 1.75rem; margin-top: 0.125rem; }
@media (forced-colors: active) { .date-tile, .field input, .field select, .field textarea { border: 1px solid CanvasText; } }

/* ---- Dock (floating bottom navigation) -------------------------------------------------------- */
.dock {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: calc(var(--s2) + env(safe-area-inset-bottom)); margin-inline: auto; width: max-content; max-width: calc(100% - 1.5rem);
  display: flex; gap: 0.125rem; padding: 0.375rem; border-radius: 999px; background: var(--nav-bg);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); box-shadow: var(--shadow-float), 0 0 0 1px var(--line), var(--edge);
}
.dock a {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-width: 2.75rem; height: 2.75rem; padding: 0 var(--s3); border-radius: 999px;
  color: var(--nav-ink); text-decoration: none; font-size: 0.875rem; font-weight: 700; white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.dock svg { width: 1.375rem; height: 1.375rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dock a { flex: none; }
.dock-label { display: none; }
/* The active tab shows its name in a green pill (with a soft glow in dark mode). If the bar is too narrow (small phone, big text) that label shrinks with an ellipsis rather than spilling out. */
.dock a[aria-current="page"] { flex: 0 1 auto; min-width: 0; background: var(--nav-active); color: #fff; padding: 0 var(--s4) 0 var(--s3); box-shadow: var(--glow); }
.dock a[aria-current="page"] .dock-label { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* Narrow screens or large text (these units follow the browser's text size): icon-only, the highlighted tab still marks where you are. */
@media (max-width: 19.99rem) {
  .dock a[aria-current="page"] .dock-label { display: none; }
  .dock a[aria-current="page"] { padding: 0 var(--s3); }
}

/* ---- Menu sheet ------------------------------------------------------------------------------- */
.sheet {
  position: fixed; inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: 34rem; max-height: min(90vh, 42rem); max-height: min(90dvh, 42rem);
  padding: 0; border: 0; border-radius: 24px 24px 0 0; overflow: auto; background: var(--sheet-bg); color: var(--ink);
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.25), var(--edge); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
}
.sheet[open] { animation: sheet-up 0.2s ease-out; }
.sheet::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade-in 0.2s ease-out; }
@keyframes sheet-up { from { transform: translateY(1.5rem); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
.sheet-grab { width: 2.5rem; height: 0.3125rem; margin: var(--s2) auto 0; border-radius: 999px; background: var(--field-line); opacity: 0.6; }
.sheet-pane { padding: var(--s2) var(--s4) calc(var(--s6) + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s2); }
.sheet-head h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; margin-right: auto; }
.sheet-head .icon-btn { color: var(--link); }
.sheet-head .icon-btn::before { box-shadow: none; background: var(--soft); }
.sheet-pane[data-pane="help"] .sheet-head, .sheet-pane[data-pane="about"] .sheet-head { justify-content: flex-start; }
.sheet-pane[data-pane="help"] .sheet-head h2, .sheet-pane[data-pane="about"] .sheet-head h2 { margin-right: 0; }
.sheet-list { list-style: none; margin: 0; padding: 0; }
.sheet-item {
  display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 3rem; padding: var(--s1) var(--s2); border: 0; border-radius: 14px;
  background: transparent; color: var(--ink); font: inherit; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer;
}
.sheet-item:hover { background: var(--soft); }
.sheet-ico { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--soft); color: var(--link); flex: none; }
.sheet-ico .icon { width: 1.25rem; height: 1.25rem; }
.sheet-appearance { padding: var(--s1) var(--s2) var(--s1); }
.sheet-appearance-head { display: flex; align-items: center; gap: var(--s3); min-height: 2.75rem; font-weight: 600; }
.sheet-appearance .segmented { margin: var(--s1) 0 0.375rem; }
.sheet-appearance .small { margin: 0 0 var(--s1) var(--s1); }
.steps { padding-left: 1.25rem; margin: 0 0 var(--s2); }
.steps li { margin-bottom: 0.375rem; }
body:has(dialog[open]) { overflow: hidden; }

/* Tip card (iPhone, Safari) */
.tip { background: var(--tip-bg); }

/* ---- Access-code screen ----------------------------------------------------------------------- */
/* A full-bleed green gradient in both themes, the tree softly glowing. Everything on it is white or a very light green. */
body.is-gate {
  padding-bottom: 0; color: #fff; background-color: var(--green-900);
  background-image: radial-gradient(75% 36% at 50% 21%, rgba(95, 211, 156, 0.34), transparent 70%), linear-gradient(180deg, #0b3d2e 0%, #145a41 58%, #1f7a55 100%);
}
html:has(body.is-gate) { background: var(--green-900); }
.gate {
  position: relative; max-width: 26rem; min-height: 100vh; min-height: 100dvh; margin: 0 auto; display: flex; flex-direction: column; align-items: stretch;
  padding: calc(env(safe-area-inset-top) + var(--s6)) max(1.5rem, env(safe-area-inset-right)) calc(var(--s6) + env(safe-area-inset-bottom)) max(1.5rem, env(safe-area-inset-left));
}
.gate :focus-visible { outline-color: #fff; }
.gate-theme { position: absolute; z-index: 1; top: calc(env(safe-area-inset-top) + var(--s2)); right: max(0.75rem, env(safe-area-inset-right)); color: #fff; }
.gate-theme::before { background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26); }
.gate-art { margin: 0 auto var(--s2); width: 100%; max-width: 19rem; }
/* The tree is drawn once, in icons/tree.svg; the app icon is built from the same file (scripts/make-icon-svg.py). */
.gate-art img { display: block; width: 100%; height: auto; filter: drop-shadow(0 0 14px rgba(111, 217, 166, 0.5)); }
.wordmark { margin: var(--s2) 0 var(--s6); text-align: center; text-wrap: initial; }
.wm-main { display: block; font-size: 3rem; line-height: 1.05; font-weight: 800; letter-spacing: -0.04em; color: #fff; }
.wm-sub { display: block; margin-top: 0.375rem; font-size: 1.125rem; line-height: 1.3; font-weight: 400; letter-spacing: 0; color: #cfe9db; }
.gate-form { margin-top: auto; }
.gate-form label { display: block; margin: 0 0 0.375rem var(--s2); font-weight: 600; font-size: 0.9375rem; }
.gate-form input[type="password"] {
  width: 100%; min-height: 3.25rem; padding: 0 1.25rem; font: inherit; font-size: 1.0625rem; color: #fff; background: rgba(4, 28, 20, 0.4);
  border: 1.5px solid rgba(255, 255, 255, 0.7); border-radius: 999px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.gate-form input[aria-invalid="true"] { border: 2px solid #ffb4ab; }
.gate-form .small { margin: var(--s2) var(--s2) var(--s4); color: #f0f9f4; }
.gate-error { background: #fbe3e1; color: #9a2b24; padding: var(--s3) var(--s4); border-radius: 14px; margin: 0 0 var(--s4); font-weight: 600; }
/* A solid mint-green primary button: clearly a button beside the dark, outlined code field. The mint (#8ee6bb) is 3.6:1 or more against every
   part of the gradient (#1f7a55 at its lightest) for the button's edge, and its dark-green label (#052e20) is 10:1 on the fill. */
.enter-btn {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 3.25rem; padding: 0.5rem var(--s6); border: 0;
  border-radius: 999px; background: #8ee6bb; color: #052e20; font: inherit; font-size: 1.0625rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}
.enter-btn:hover { background: #a6edc9; }
.enter-btn:active { background: #7ee0b0; }
.enter-btn[disabled] { opacity: 0.85; cursor: progress; background: #8ee6bb; }

/* ---- Donation thanks -------------------------------------------------------------------------- */
.thanks-main { justify-content: center; text-align: center; }
.thanks-title { margin: var(--s2) 0 0; }
.thanks-tagline { color: #e6f5ec; }
.thanks-message { margin: var(--s2) auto var(--s6); max-width: 30ch; }
.thanks-back { text-decoration: none; }
.thanks-note { width: 100%; padding: var(--s1) var(--s3); }
.thanks-note p { flex: 1; margin: 0; }
.thanks-note .icon-btn { color: inherit; }

/* ---- Motion and contrast preferences ---------------------------------------------------------- */
@media (min-width: 48rem) {
  main, #status, .header-inner { max-width: 44rem; }
  .gate { justify-content: center; }
  .gate-form { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .card, .dock, .sheet, .village-pill, .enter-btn { border: 1px solid CanvasText; }
  /* Gradients and tints do not survive forced colours: no band, plain Canvas on the access-code screen, and each control gets a border. */
  .hero-band { display: none; }
  body.is-gate { background: Canvas; color: CanvasText; }
  .wm-main, .wm-sub, .gate-form .small, #h-home, #view-home .date-line { color: CanvasText; }
  .icon-btn, .cat-chip, .round-btn { border: 1px solid CanvasText; border-radius: 50%; }
  .cat-chip { border-radius: 999px; }
  .icon-btn::before, .cat-chip::before, .round-btn::before { display: none; }
  /* "Today" rows must not rely on a tint: add a border (table rows) or a bar (schedule rows) and keep them bold. */
  .hours tr.today th, .hours tr.today td { border-block: 2px solid CanvasText; font-weight: 700; }
  .schedule li.today { border-left: 0.375rem solid CanvasText; font-weight: 700; }
  .dock a[aria-current="page"], .cat-chip[aria-pressed="true"], .segmented button[aria-pressed="true"] { outline: 2px solid Highlight; }
}
