/* Hammersmith.info — premium community design system */
:root {
  --ink: #0b1c24;
  --ink-soft: #2a3f4a;
  --muted: #5a6f7a;
  --paper: #f6f3ec;
  --paper-2: #fffdf8;
  --card: #ffffff;
  --line: rgba(13, 79, 107, 0.12);
  --teal: #0d4f6b;
  --teal-2: #16718f;
  --teal-deep: #083447;
  --river: #7ec8d8;
  --sand: #e8c48a;
  --coral: #c45c4a;
  --ok: #1f7a4d;
  --warn: #a67c2d;
  --bad: #a33b2b;
  --shadow: 0 12px 40px rgba(8, 52, 71, 0.10);
  --shadow-sm: 0 4px 16px rgba(8, 52, 71, 0.07);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --display: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --max: 1140px;
  --ease: cubic-bezier(.22,1,.36,1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef5f8;
    --ink-soft: #c5d5de;
    --muted: #8aa0ab;
    --paper: #07141b;
    --paper-2: #0b1c24;
    --card: #0f2430;
    --line: rgba(126, 200, 216, 0.14);
    --shadow: 0 12px 40px rgba(0,0,0,.35);
    --shadow-sm: 0 4px 16px rgba(0,0,0,.25);
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(126,200,216,.18), transparent 55%),
    radial-gradient(900px 400px at 90% 0%, rgba(232,196,138,.14), transparent 50%),
    var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-underline-offset: 2px; }
a:hover { color: var(--coral); }
:focus-visible { outline: 3px solid var(--river); outline-offset: 3px; border-radius: 4px; }
.skip {
  position: absolute; left: -999px; top: 0; background: var(--teal); color: #fff;
  padding: .6rem 1rem; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }
.wrap { width: min(var(--max), calc(100% - 2rem)); margin-inline: auto; }
.top {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(1.2);
  background: color-mix(in srgb, var(--paper-2) 86%, transparent);
  border-bottom: 1px solid var(--line);
}
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 4.1rem; padding-block: .55rem;
}
.brand {
  display: flex; align-items: center; gap: .75rem; text-decoration: none; color: inherit;
}
.brand svg { width: 2.35rem; height: 2.35rem; flex: none; }
.brand span { display: flex; flex-direction: column; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.brand small { font-weight: 550; color: var(--muted); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; margin-top: .15rem; }
.nav { display: flex; flex-wrap: nowrap; gap: .2rem; align-items: center; }
.nav a, .nav-more-btn {
  text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: .88rem;
  padding: .45rem .65rem; border-radius: 999px; transition: background .2s var(--ease), color .2s;
  white-space: nowrap; border: 0; background: transparent; cursor: pointer; font-family: inherit;
}
.nav-more-btn { display: inline-flex; align-items: center; gap: .3rem; }
.nav-more-btn::after {
  content: ""; width: .4rem; height: .4rem; border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-1px);
  opacity: .7;
}
.nav-more-btn:hover, .nav-more-btn:focus-visible {
  background: color-mix(in srgb, var(--teal) 12%, transparent); color: var(--teal); outline: none;
}
.nav-more--current .nav-more-btn, .nav-more-btn[data-has-current="true"] {
  background: color-mix(in srgb, var(--teal) 14%, transparent); color: var(--teal-deep);
}
.nav-more { position: relative; flex: none; }
.nav-more-panel {
  position: absolute; right: 0; top: calc(100% + .35rem); min-width: 11.5rem;
  display: flex; flex-direction: column; gap: .15rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: .4rem; box-shadow: var(--shadow); z-index: 50;
}
.nav-more-panel[hidden] { display: none !important; }
.nav-more-panel a {
  border-radius: 10px; padding: .55rem .75rem; font-size: .88rem;
}
.nav-more-panel a[aria-current="page"] {
  background: var(--teal); color: #fff !important;
}
.nav a:hover { background: color-mix(in srgb, var(--teal) 12%, transparent); color: var(--teal); }
.nav a[aria-current="page"] {
  background: var(--teal); color: #fff !important;
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.nav a[aria-current="page"]:hover { background: var(--teal-deep); color: #fff !important; }
.notice {
  margin: 0; padding: .55rem 0; background: color-mix(in srgb, var(--sand) 35%, var(--paper));
  color: var(--ink-soft); font-size: .88rem; border-bottom: 1px solid var(--line);
}
.emergency-strip {
  background: linear-gradient(90deg, #6b1d16, #8f2f24 40%, #6b1d16);
  color: #fff; padding: .7rem 0;
}
.emergency-strip .wrap {
  display: flex; flex-wrap: wrap; gap: .55rem .9rem; align-items: center; justify-content: space-between;
}
.emergency-strip strong { letter-spacing: .04em; text-transform: uppercase; font-size: .72rem; opacity: .9; }
.emergency-strip .nums { display: flex; flex-wrap: wrap; gap: .4rem; }
.emergency-strip a {
  color: #fff; text-decoration: none; background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: .35rem .7rem;
  font-weight: 700; font-size: .88rem; transition: background .2s;
}
.emergency-strip a:hover { background: rgba(255,255,255,.22); color: #fff; }
.emergency-strip a span { font-weight: 500; opacity: .85; margin-left: .25rem; font-size: .78rem; }

.hero {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(145deg, #083447 0%, #0d4f6b 48%, #1a6a7a 100%);
  padding: 3.2rem 0 4.2rem;
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 48px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 48' preserveAspectRatio='none'%3E%3Cpath fill='%23f6f3ec' d='M0,32 C240,48 480,0 720,16 C960,32 1200,48 1440,20 L1440,48 L0,48 Z'/%3E%3C/svg%3E") center/100% 100% no-repeat;
}
@media (prefers-color-scheme: dark) {
  .hero::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 48' preserveAspectRatio='none'%3E%3Cpath fill='%2307141b' d='M0,32 C240,48 480,0 720,16 C960,32 1200,48 1440,20 L1440,48 L0,48 Z'/%3E%3C/svg%3E"); }
}
.hero-grid { display: grid; gap: 1.5rem; align-items: end; }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.2fr .9fr; gap: 2rem; }
}
.eyebrow { margin: 0 0 .6rem; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--sand); font-weight: 700; }
.hero h1 {
  margin: 0 0 .75rem; font-size: clamp(2rem, 4.5vw, 3.15rem); line-height: 1.08;
  letter-spacing: -.03em; font-weight: 800;
}
.lead { margin: 0 0 1.25rem; font-size: 1.08rem; max-width: 38rem; color: rgba(255,255,255,.88); }
.hero-meta { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: .4rem; border-radius: 999px;
  padding: .4rem .8rem; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18);
  font-size: .82rem; font-weight: 600;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border-radius: 999px; padding: .62rem 1.1rem; font-weight: 700; text-decoration: none;
  background: #fff; color: var(--teal-deep); border: 0; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); color: var(--teal-deep); }
.btn.ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45); box-shadow: none; }
.btn.ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn.teal { background: var(--teal); color: #fff; }
.btn.teal:hover { color: #fff; }

.hero-photo {
  position: relative; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.18); aspect-ratio: 4/3; background: #083447;
}
.hero-photo picture { display: block; width: 100%; height: 100%; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.credit {
  font-size: .72rem; color: var(--muted); margin: .35rem 0 0; line-height: 1.35;
}
.credit a { color: inherit; }
.hero-photo .credit {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0;
  padding: .55rem .75rem; background: linear-gradient(transparent, rgba(0,0,0,.7));
  color: rgba(255,255,255,.92);
}
.hero-photo .credit a { color: #fff; }

.section { padding: 2.4rem 0; }
.section h2 { margin: 0 0 .4rem; font-size: clamp(1.45rem, 2.5vw, 1.9rem); letter-spacing: -.02em; }
.muted { color: var(--muted); margin: 0 0 1.2rem; }
.dash {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; min-height: 12rem;
  overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s;
}
.panel:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.panel.wide { grid-column: 1 / -1; }
.panel-h {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem;
  padding: .95rem 1.05rem .35rem; 
}
.panel-h h2, .panel-h h3 { margin: 0; font-size: 1.02rem; font-weight: 700; }
.badge {
  font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: .28rem .5rem; border-radius: 999px; background: color-mix(in srgb, var(--river) 28%, transparent);
  color: var(--teal-deep);
}
@media (prefers-color-scheme: dark) { .badge { color: var(--river); } }
.badge.live { background: color-mix(in srgb, var(--ok) 22%, transparent); color: var(--ok); }
.badge.warn { background: color-mix(in srgb, var(--sand) 40%, transparent); color: #7a5a20; }
.badge.err { background: color-mix(in srgb, var(--coral) 25%, transparent); color: var(--coral); }
.panel-body { padding: .55rem 1.05rem 1rem; flex: 1; }
.panel-foot { padding: .55rem 1.05rem .85rem; font-size: .75rem; color: var(--muted); border-top: 1px solid var(--line); }
.skeleton {
  height: .85rem; border-radius: 6px; margin: .55rem 0;
  background: linear-gradient(90deg, var(--line), color-mix(in srgb, var(--river) 20%, var(--line)), var(--line));
  background-size: 200% 100%; animation: shimmer 1.2s infinite linear;
}
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.feature-cards {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
  display: flex; flex-direction: column; transition: transform .25s var(--ease);
}
.feature:hover { transform: translateY(-3px); color: inherit; }
.feature .media { aspect-ratio: 16/10; overflow: hidden; background: #123; }
.feature .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.feature:hover .media img { transform: scale(1.04); }
.feature .body { padding: 1rem 1.05rem 1.15rem; }
.feature h3 { margin: 0 0 .35rem; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); font-size: .92rem; }

.footer {
  margin-top: 2rem; border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--teal-deep) 92%, black); color: rgba(255,255,255,.86);
  padding: 2.4rem 0 2rem;
}
.footer a { color: #fff; }
.footer-grid {
  display: grid; gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 1.5rem;
}
.footer h3 { margin: 0 0 .55rem; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--sand); }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin: .3rem 0; }
.footer .fine { font-size: .82rem; color: rgba(255,255,255,.7); max-width: 50rem; }

/* Services map */
.services-layout {
  display: grid; gap: 1rem;
}
@media (min-width: 980px) {
  .services-layout { grid-template-columns: 360px 1fr; align-items: start; }
}
.services-side {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 1rem; max-height: min(78vh, 820px); overflow: auto;
  position: sticky; top: 5rem;
}
.layer-toggles { display: flex; flex-wrap: wrap; gap: .35rem; margin: .75rem 0 1rem; }
.layer-toggles button {
  border: 1px solid var(--line); background: var(--paper-2); color: var(--ink);
  border-radius: 999px; padding: .35rem .65rem; font-size: .78rem; font-weight: 700; cursor: pointer;
}
.layer-toggles button[aria-pressed="true"] {
  background: var(--teal); color: #fff; border-color: var(--teal);
}
.search-row { display: flex; gap: .5rem; margin-bottom: .75rem; }
.search-row input, .search-row select {
  flex: 1; border: 1px solid var(--line); border-radius: 12px; padding: .65rem .75rem;
  background: var(--paper-2); color: var(--ink); font: inherit;
}
.map-shell {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  box-shadow: var(--shadow); min-height: 520px; background: #d9e6ea;
}
#services-map { height: min(72vh, 760px); width: 100%; }
.list-item {
  border: 1px solid var(--line); border-radius: 14px; padding: .75rem .8rem; margin: .45rem 0;
  background: var(--paper-2); cursor: pointer;
}
.list-item:hover, .list-item:focus { border-color: var(--river); }
.list-item h4 { margin: 0 0 .2rem; font-size: .95rem; }
.list-item p { margin: 0; font-size: .82rem; color: var(--muted); }
.tag {
  display: inline-block; font-size: .68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; padding: .18rem .4rem; border-radius: 6px; margin-right: .25rem;
}
.tag.ae { background: #fde8e4; color: #8a2e22; }
.tag.utc { background: #fff3d6; color: #7a5a20; }
.tag.none { background: #e8eef1; color: #456; }
.tag.fire { background: #ffe0d6; color: #9a3412; }
.tag.police { background: #dde8ff; color: #1e3a8a; }
.tag.gp { background: #dcfce7; color: #166534; }
.tag.pharm { background: #e0e7ff; color: #3730a3; }
.tag.station { background: #fce7f3; color: #9d174d; }
.tag.bus { background: #ccfbf1; color: #0f766e; }

.leaflet-container, .maplibregl-map { font: inherit; }
.maplibregl-popup-content { font-family: inherit; padding: .85rem 1rem; }
.maplibregl-popup-content h3 { margin: 0 0 .35rem; font-size: 1rem; }
.maplibregl-ctrl-attrib a { color: inherit; }
#services-map .maplibregl-canvas { outline: none; }
.map-popup h3 { margin: 0 0 .25rem; font-size: 1rem; }
.map-popup p { margin: .2rem 0; font-size: .85rem; }

.prose { max-width: 44rem; }
.prose h2 { margin-top: 1.8rem; }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: .5rem .6rem; text-align: left; vertical-align: top; }
.card-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.news-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.news-card a.cover { display: block; aspect-ratio: 16/9; overflow: hidden; }
.news-card img { width: 100%; height: 100%; object-fit: cover; }
.news-card .pad { padding: 1rem 1.05rem 1.2rem; }
.form label { display: block; font-weight: 650; margin: .8rem 0 .3rem; }
.form input, .form textarea, .form select {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: .7rem .8rem;
  background: var(--card); color: var(--ink); font: inherit;
}
.form button { margin-top: 1rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Legacy footer class used on older pages */
.foot { background: var(--teal-deep); color: rgba(255,255,255,.88); margin-top: 3rem; padding: 2.5rem 0 1.5rem; }
.foot a { color: #fff; }
.foot-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 1.5rem; }
.foot h3 { margin: 0 0 .55rem; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--sand); }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin: .3rem 0; }
.foot .copy, .foot .small { font-size: .82rem; color: rgba(255,255,255,.7); }
.foot p { color: rgba(255,255,255,.8); font-size: .92rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; padding: 0; margin: 0 0 1rem; font-size: .85rem; color: var(--muted); }
.crumbs li:not(:last-child)::after { content: "›"; margin-left: .35rem; opacity: .5; }
.alert { padding: .75rem 1rem; border-radius: 12px; margin: 1rem 0; }
.alert.warn { background: #fff3d6; color: #7a5a20; }
.alert.ok { background: #e6f6ee; color: #1f7a4d; }
.alert.err { background: #fde8e4; color: #8a2e22; }
.badge { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: .2rem .5rem; border-radius: 999px; background: #e8eef1; color: var(--muted); }
.panel-foot { font-size: .78rem; color: var(--muted); padding: .65rem 1rem 1rem; border-top: 1px solid var(--line); }
.skeleton { height: .85rem; border-radius: 6px; background: linear-gradient(90deg, #e8eef1, #f6f3ec, #e8eef1); background-size: 200% 100%; animation: sk 1.2s ease infinite; margin: .45rem 0; }
@keyframes sk { to { background-position: -200% 0; } }
.pill { display: inline-flex; align-items: center; gap: .35rem; background: rgba(255,255,255,.14); color: #fff; border-radius: 999px; padding: .35rem .7rem; font-size: .8rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 700; color: var(--sand); margin: 0 0 .5rem; }
.hero { background: linear-gradient(135deg, var(--teal-deep), var(--teal) 55%, #16718f); color: #fff; padding: 2.2rem 0 2.8rem; }
.hero h1 { margin: 0 0 .6rem; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.02em; }
.hero .lead { color: rgba(255,255,255,.88); font-size: 1.08rem; max-width: 36rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1.1rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; background: var(--sand); color: var(--teal-deep); font-weight: 700; border: 0; border-radius: 999px; padding: .65rem 1.1rem; text-decoration: none; box-shadow: var(--shadow-sm); cursor: pointer; }
.btn:hover { color: var(--teal-deep); filter: brightness(1.05); }
.btn.teal { background: var(--teal); color: #fff; }
.section { padding: 2.2rem 0; }
.muted { color: var(--muted); }
.wrap { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
.top { position: sticky; top: 0; z-index: 40; backdrop-filter: blur(10px); background: rgba(246,243,236,.88); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); font-weight: 750; }
.brand svg { width: 36px; height: 36px; flex: none; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: .72rem; }
.notice { background: #fff3d6; color: #7a5a20; margin: 0; font-size: .85rem; padding: .45rem 0; border-bottom: 1px solid rgba(166,124,45,.2); }
.sources { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.1rem; margin: 1.5rem 0; }
.sources h3 { margin: 0 0 .5rem; font-size: .95rem; }
.bridge-status { font-size: 1.15rem; font-weight: 650; }

/* —— City-app IA: mobile menu, bottom tabs, live panels —— */
.nav-toggle {
  display: none; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: .45rem .9rem; font-weight: 700; font-size: .88rem; cursor: pointer;
}
@media (max-width: 980px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: .15rem;
    flex-wrap: nowrap;
    background: var(--paper-2); border-bottom: 1px solid var(--line);
    padding: .6rem 1rem 1rem; box-shadow: var(--shadow);
    max-height: min(70vh, 520px); overflow: auto;
  }
  .nav.open { display: flex; }
  .nav a, .nav-more-panel a { border-radius: 12px; padding: .7rem .85rem; }
  .nav-more { display: contents; }
  .nav-more-btn { display: none !important; }
  .nav-more-panel {
    display: contents; position: static; min-width: 0; padding: 0;
    border: 0; box-shadow: none; background: transparent;
  }
  .nav-more-panel[hidden] { display: contents !important; }
  .bar { position: relative; }
}
body.has-tabbar { padding-bottom: 5.25rem; }
.tabbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: color-mix(in srgb, var(--paper-2) 92%, transparent);
  backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  padding: .35rem .4rem calc(.35rem + env(safe-area-inset-bottom));
  justify-content: space-around; gap: .15rem;
}
.tabbar a {
  flex: 1; text-align: center; text-decoration: none; color: var(--muted);
  font-size: .68rem; font-weight: 700; padding: .35rem .2rem; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; gap: .15rem;
}
.tabbar a .tab-ico { font-size: 1.05rem; line-height: 1; }
.tabbar a[aria-current="page"] { color: var(--teal); background: color-mix(in srgb, var(--teal) 10%, transparent); }
@media (max-width: 900px) { .tabbar { display: flex; } }

.hero-compact { padding: 2rem 0 2.6rem; }
.hero-compact .lead { margin-bottom: .8rem; }
.pill.ghost { background: transparent; border-color: rgba(255,255,255,.35); }
.page-hero {
  background: linear-gradient(145deg, #083447 0%, #0d4f6b 55%, #1a6a7a 100%);
  color: #fff; padding: 2rem 0 2.2rem;
}
.page-hero .lead { color: rgba(255,255,255,.88); max-width: 40rem; }
.page-hero-alert { background: linear-gradient(145deg, #5a1812, #8f2f24 55%, #6b1d16); }
.h-sm { font-size: .92rem; margin: 0 0 .5rem; letter-spacing: -.01em; }

.glance {
  display: grid; gap: .75rem; margin-bottom: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.tile, a.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .75rem .85rem; box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: .2rem; transition: transform .2s var(--ease);
}
a.tile:hover { transform: translateY(-2px); color: inherit; }
.tile-k { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.tile-v { font-size: 1.05rem; font-weight: 750; letter-spacing: -.01em; }

.badge.ok { background: color-mix(in srgb, var(--ok) 22%, transparent); color: var(--ok); }
.status-list { list-style: none; margin: 0; padding: 0; }
.status-list li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.status-list li:last-child { border-bottom: 0; }
.line-name { font-weight: 650; margin-right: .5rem; }
.status-pill {
  display: inline-block; font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .04em; padding: .18rem .45rem; border-radius: 999px;
  background: #e8eef1; color: var(--muted);
}
.status-pill.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.status-pill.warn { background: color-mix(in srgb, var(--sand) 45%, transparent); color: #7a5a20; }
.status-pill.bad { background: color-mix(in srgb, var(--coral) 22%, transparent); color: var(--coral); }
.reason { margin: .25rem 0 0; font-size: .82rem; color: var(--muted); }
.weather-big { font-size: 1.6rem; font-weight: 800; margin: 0 0 .35rem; letter-spacing: -.02em; }
.weather-big span { font-size: 1rem; font-weight: 600; color: var(--muted); }

ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: .4rem 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }
ul.plain.compact li { padding: .3rem 0; font-size: .9rem; }
ul.arrivals { list-style: none; margin: 0; padding: 0; }
ul.arrivals li {
  display: grid; grid-template-columns: 3.2rem 1fr auto; gap: .55rem; align-items: baseline;
  padding: .4rem 0; border-bottom: 1px solid var(--line); font-size: .92rem;
}
ul.arrivals .route {
  font-weight: 800; background: #DC241F; color: #fff; text-align: center;
  border-radius: 8px; padding: .2rem .15rem; font-size: .78rem;
}
ul.arrivals .dest { color: var(--ink-soft); }
ul.arrivals .eta { font-weight: 750; color: var(--teal); white-space: nowrap; }

.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.toolbar .grow { flex: 1; min-width: min(100%, 220px); }
.toolbar input[type="search"], .side-panel input[type="search"] {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: .7rem .85rem;
  background: var(--card); color: var(--ink); font: inherit;
}
.split {
  display: grid; gap: 1rem;
}
@media (min-width: 960px) {
  .split { grid-template-columns: minmax(260px, 340px) 1fr; align-items: start; }
}
.side-panel, .main-panel { min-width: 0; }
.side-panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow-sm);
  max-height: min(78vh, 860px); overflow: auto; position: sticky; top: 5rem;
}
.list { display: flex; flex-direction: column; gap: .35rem; }
.list.compact .list-item { padding: .55rem .65rem; }
button.list-item {
  display: block; width: 100%; text-align: left; font: inherit; color: inherit;
}
button.list-item strong { display: block; }
.chip-cloud { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip {
  border: 1px solid var(--line); background: var(--paper-2); color: var(--ink);
  border-radius: 999px; padding: .35rem .65rem; font-size: .82rem; font-weight: 700; cursor: pointer;
}
.chip:hover, .chip:focus-visible { border-color: var(--teal); color: var(--teal); }
.linkish {
  background: none; border: 0; color: var(--teal); font: inherit; cursor: pointer;
  padding: 0; text-decoration: underline; text-underline-offset: 2px;
}
.layer-toggle {
  display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--line);
  border-radius: 999px; padding: .35rem .65rem; font-size: .8rem; font-weight: 650;
  background: var(--paper-2); cursor: pointer;
}
.layer-toggle .swatch { width: .7rem; height: .7rem; border-radius: 50%; display: inline-block; }
.emergency-grid {
  display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
a.em-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; text-decoration: none; color: inherit; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: .25rem; transition: transform .2s var(--ease);
}
a.em-card:hover { transform: translateY(-2px); color: inherit; }
.em-n { font-size: 1.55rem; font-weight: 850; color: var(--coral); letter-spacing: -.02em; }
.em-l { font-weight: 750; }
.status-pill.closed { background: color-mix(in srgb, var(--muted) 18%, transparent); color: var(--muted); }
.badge.closed { background: color-mix(in srgb, var(--muted) 18%, transparent); color: var(--muted); }

/* —— In numbers —— */
.stat-teaser {
  display: grid; gap: 1rem; align-items: center;
  grid-template-columns: 1fr;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1.35rem; box-shadow: var(--shadow-sm); margin: 1.5rem 0 0;
}
@media (min-width: 720px) {
  .stat-teaser { grid-template-columns: 1.4fr auto; }
}
.stat-teaser h2 { margin: 0 0 .35rem; font-size: 1.25rem; letter-spacing: -.02em; }
.stat-teaser p { margin: 0; color: var(--ink-soft); }
.stat-teaser-metrics {
  display: flex; flex-wrap: wrap; gap: .65rem;
}
.stat-teaser-metrics span {
  background: color-mix(in srgb, var(--teal) 8%, var(--paper-2));
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .55rem .75rem; min-width: 6.5rem;
}
.stat-teaser-metrics strong { display: block; font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; color: var(--teal-deep); }
.stat-teaser-metrics small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }

.stat-toc {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.15rem; margin: 0 0 1.5rem; box-shadow: var(--shadow-sm);
}
.stat-toc ol {
  display: flex; flex-wrap: wrap; gap: .45rem .85rem;
  list-style: none; margin: 0; padding: 0;
}
.stat-toc a { font-size: .88rem; font-weight: 650; text-decoration: none; }
.stat-toc a:hover { text-decoration: underline; }

.stat-section {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.1rem; margin: 0 0 1.15rem; box-shadow: var(--shadow-sm);
}
.stat-sec-h h2 { margin: 0 0 .35rem; font-size: 1.28rem; letter-spacing: -.02em; }
.stat-sec-h .muted { margin: 0 0 .85rem; }

.stat-cards {
  display: grid; gap: .85rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: .85rem;
}
.stat-card {
  background: color-mix(in srgb, var(--teal) 5%, var(--paper-2));
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .85rem .9rem;
}
.stat-card-k { margin: 0; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 750; }
.stat-card-v { margin: .25rem 0 0; font-size: 1.55rem; font-weight: 800; letter-spacing: -.03em; color: var(--teal-deep); line-height: 1.15; }
.stat-card-u { margin: .2rem 0 0; font-size: .82rem; color: var(--ink-soft); }
.stat-card-n { margin: .35rem 0 0; font-size: .78rem; color: var(--muted); }
.stat-card-s { margin: .45rem 0 0; font-size: .72rem; color: var(--muted); }
.stat-card-s a { font-weight: 600; }

.stat-chart { margin: .5rem 0 0; }
.stat-chart svg { width: 100%; height: auto; display: block; background: color-mix(in srgb, var(--paper) 40%, transparent); border-radius: 12px; }
.stat-bar { fill: var(--teal); opacity: .88; }
.stat-ylab, .stat-val, .stat-tick { fill: var(--ink-soft); font-size: 11px; font-family: var(--font); }
.stat-val { fill: var(--muted); font-size: 10.5px; }
.stat-cap { margin: .45rem 0 0; font-size: .75rem; color: var(--muted); }
.stat-alt { margin: .35rem 0 0; font-size: .82rem; }
.stat-alt summary { cursor: pointer; color: var(--teal); font-weight: 650; }
.stat-alt p { margin: .4rem 0 0; color: var(--ink-soft); }

@media (prefers-color-scheme: dark) {
  .stat-card-v, .stat-teaser-metrics strong { color: var(--river); }
  .stat-bar { fill: var(--river); }
}

/* —— Live colour / life —— */
:root {
  --slate: #5a6f7a;
  --accent-tube: #0d4f6b;
  --accent-bus: #c45c4a;
  --accent-roads: #a67c2d;
  --accent-weather: #16718f;
  --accent-bridge: #7ec8d8;
  --accent-events: #1f7a4d;
}
.pill.live-pill {
  display: inline-flex; align-items: center; gap: .45rem;
  background: color-mix(in srgb, var(--ok) 28%, transparent);
  color: #fff; font-weight: 800; letter-spacing: .04em;
}
.pill.live-pill::before {
  content: ""; width: .55rem; height: .55rem; border-radius: 50%;
  background: #6dffb0; box-shadow: 0 0 0 0 rgba(109, 255, 176, .7);
  animation: live-pulse 1.6s var(--ease) infinite;
}
.pill.live-pill.is-stale {
  background: color-mix(in srgb, var(--warn) 55%, transparent); color: #fff;
}
.pill.live-pill.is-stale::before { background: #ffe08a; animation: none; }
.pill.live-pill.is-err {
  background: color-mix(in srgb, var(--bad) 70%, transparent); color: #fff;
}
.pill.live-pill.is-err::before { background: #ffb4a8; animation: none; }
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(109, 255, 176, .55); }
  70% { box-shadow: 0 0 0 .55rem rgba(109, 255, 176, 0); }
  100% { box-shadow: 0 0 0 0 rgba(109, 255, 176, 0); }
}
.live-ago-tick { transition: opacity .35s var(--ease); }
.live-ago-tick.is-fresh { opacity: 1; }
.refresh-ring {
  display: inline-grid; place-items: center; width: 1.15rem; height: 1.15rem;
  border-radius: 50%; border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; animation: spin 1s linear infinite;
  vertical-align: -0.15em; margin-right: .35rem;
}
.refresh-ring[hidden] { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.tile { position: relative; overflow: hidden; border-left: 3px solid var(--teal); }
.tile::after {
  content: ""; position: absolute; inset: auto -20% -40% auto; width: 6rem; height: 6rem;
  border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--tile-accent, var(--teal)) 22%, transparent), transparent 70%);
  pointer-events: none;
}
.tile[data-accent="tube"] { --tile-accent: var(--accent-tube); border-left-color: var(--accent-tube); }
.tile[data-accent="bus"] { --tile-accent: var(--accent-bus); border-left-color: var(--accent-bus); }
.tile[data-accent="roads"] { --tile-accent: var(--accent-roads); border-left-color: var(--accent-roads); }
.tile[data-accent="weather"] { --tile-accent: var(--accent-weather); border-left-color: var(--accent-weather); }
.tile[data-accent="bridge"] { --tile-accent: var(--accent-bridge); border-left-color: var(--accent-bridge); }
.tile[data-accent="events"] { --tile-accent: var(--accent-events); border-left-color: var(--accent-events); }
.tile[data-status="ok"] .tile-v { color: var(--ok); }
.tile[data-status="warn"] .tile-v { color: var(--warn); }
.tile[data-status="bad"] .tile-v { color: var(--bad); }
.tile[data-status="closed"] .tile-v { color: var(--slate); }
.panel[data-status="ok"] { border-top: 3px solid var(--ok); }
.panel[data-status="warn"] { border-top: 3px solid var(--warn); }
.panel[data-status="bad"] { border-top: 3px solid var(--bad); }
.panel[data-status="closed"] { border-top: 3px solid var(--slate); }
.panel[data-status="ok"] .panel-h,
.panel[data-status="warn"] .panel-h,
.panel[data-status="bad"] .panel-h,
.panel[data-status="closed"] .panel-h {
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel-tint, transparent) 14%, transparent), transparent);
}
.panel[data-status="ok"] { --panel-tint: var(--ok); }
.panel[data-status="warn"] { --panel-tint: var(--warn); }
.panel[data-status="bad"] { --panel-tint: var(--bad); }
.panel[data-status="closed"] { --panel-tint: var(--slate); }

/* Buses / Trains / Roads — shared status accents */
.arrivals .eta { font-weight: 800; color: var(--ok); }
.status-pill.ok { color: var(--ok); }
.status-pill.warn { color: #7a5a20; }
.status-pill.bad { color: var(--bad); }
.status-pill.closed { color: var(--slate); }
@media (prefers-color-scheme: dark) {
  .status-pill.warn, .badge.warn { color: #e8c48a; }
  .tile[data-status="warn"] .tile-v { color: #e8c48a; }
  .pill.live-pill { color: #041a10; }
  .pill.live-pill.is-stale { color: #1a1200; }
}

/* —— In numbers (own design language) —— */
.stat-hero {
  display: flex; flex-direction: column; gap: 1rem;
  margin: 0 0 1.5rem;
}
.stat-hero-feature {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(4, 1fr);
}
.stat-hero-rest {
  display: grid; gap: 1rem;
  /* auto-fit at 220px; cap at 3 cols on desktop so 6 cards form 2 even rows (no orphan) */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
@media (min-width: 901px) {
  .stat-hero-rest {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
  }
}
.stat-hero-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 1rem 1.25rem; /* 16–24px */
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--teal);
  display: flex; flex-direction: column; gap: .35rem;
}
.stat-hero-card.is-feature {
  padding: 1.25rem 1.35rem;
  border-top-width: 4px;
}
.stat-hero-k {
  margin: 0; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 750;
}
.stat-hero-v {
  margin: 0; font-size: clamp(1.85rem, 2.8vw, 2.15rem); font-weight: 800;
  letter-spacing: -.02em; color: var(--teal-deep); line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-hero-card.is-feature .stat-hero-v {
  font-size: clamp(2.25rem, 3.5vw, 2.5rem);
}
.stat-hero-unit {
  font-size: .55em; font-weight: 650; color: var(--ink-soft);
  letter-spacing: 0; margin-left: .15rem;
}
.stat-hero-s {
  margin: .15rem 0 0; font-size: .75rem; color: var(--muted); line-height: 1.35;
}
.stat-hero-s a { font-weight: 650; }

.stat-pill {
  display: inline-flex; align-items: center; align-self: flex-start;
  margin-top: .25rem; padding: .15rem .55rem;
  font-size: .68rem; font-weight: 700; letter-spacing: .02em;
  color: var(--teal-deep);
  background: color-mix(in srgb, var(--sand) 45%, var(--card));
  border: 1px solid color-mix(in srgb, var(--sand) 55%, var(--line));
  border-radius: 999px; white-space: nowrap;
}
.stat-table .stat-pill { margin-top: .35rem; }

/* Sticky category tabs — stronger contrast + clear active */
.stat-chips {
  position: sticky; top: 4.1rem; z-index: 30;
  margin: 0 0 1.5rem;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.stat-chips-track {
  display: flex; gap: .45rem; flex-wrap: nowrap;
  overflow-x: auto; padding: .65rem 0;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 28px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 28px), transparent 100%);
}
.stat-chips-track::-webkit-scrollbar { display: none; }
.stat-chip {
  flex: none; text-decoration: none; color: var(--ink-soft); font-weight: 700; font-size: .82rem;
  padding: .45rem .9rem; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card); white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.stat-chip:hover {
  border-color: color-mix(in srgb, var(--teal) 40%, var(--line));
  color: var(--teal-deep);
}
.stat-chip.is-active {
  background: var(--teal); color: #fff; border-color: var(--teal);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--teal) 35%, transparent);
}

.stat-section {
  margin: 3.25rem 0; /* ~52px between sections */
  padding-top: .25rem;
}
.stat-section + .stat-section { margin-top: 3.5rem; }
.stat-block { margin: 1.75rem 0; }
.stat-sec-h h2 {
  margin: 0 0 1rem; font-size: 1.45rem;
  padding-bottom: .45rem;
  border-bottom: 2px solid color-mix(in srgb, var(--teal) 35%, transparent);
}
.stat-sec-h h3 { margin: 0 0 .4rem; font-size: 1.1rem; }
.stat-sec-h .muted { margin: 0 0 .85rem; }

.stat-table-wrap {
  overflow-x: auto; margin: .75rem 0 0;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); box-shadow: var(--shadow-sm);
}
.stat-table {
  width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--card);
}
.stat-table th, .stat-table td {
  padding: .7rem .85rem; text-align: left; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.stat-table th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 750;
  background: color-mix(in srgb, var(--paper) 55%, var(--card));
}
.stat-table tr:last-child td { border-bottom: 0; }
.stat-table .num {
  font-variant-numeric: tabular-nums; font-weight: 750;
  color: var(--teal-deep); white-space: nowrap; font-size: 1.05rem;
}
.stat-table .src { font-size: .75rem; color: var(--muted); }

.stat-chart {
  margin: 1.25rem 0 0; max-width: 760px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 1rem 1.1rem 0.75rem;
  box-shadow: var(--shadow-sm);
}
.stat-chart svg { display: block; }
.stat-line {
  fill: none; stroke: var(--teal); stroke-width: 2;
  stroke-linejoin: round; stroke-linecap: round;
}
.stat-line-area {
  fill: color-mix(in srgb, var(--teal) 14%, transparent); stroke: none;
}
.stat-dot { fill: var(--teal); }
.stat-bar { fill: var(--teal); }
.stat-grid {
  stroke: color-mix(in srgb, var(--line) 85%, var(--ink));
  stroke-width: 1; stroke-dasharray: none;
}
.stat-tick, .stat-ylab, .stat-val, .stat-pt-label {
  font-size: 11px; fill: var(--muted); font-family: inherit;
}
.stat-pt-label {
  font-size: 12px; font-weight: 700; fill: var(--teal-deep);
}
.stat-pt-peak { fill: var(--teal); }
.stat-val { fill: var(--teal-deep); font-weight: 650; }
.stat-cap { font-size: .75rem; color: var(--muted); margin: .55rem 0 .35rem; }
.stat-alt { font-size: .8rem; color: var(--muted); margin: 0 0 .5rem; }

/* London comparison accent (secondary palette colour) */
.stat-london { color: #9a5b1a; }
.stat-pill { /* sand/gold = London comparison colour */ }

.stat-how, .stat-sources {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1.35rem; margin-top: 3.25rem; box-shadow: var(--shadow-sm);
}
.stat-how h2, .stat-sources h2 { margin: 0 0 .65rem; font-size: 1.15rem; }
.stat-how ul, .stat-sources ul { margin: 0; padding-left: 1.1rem; }
.stat-how li, .stat-sources li { margin: .45rem 0; }

/* Mobile: 2-col hero, 1-col rest; tab fade scroll; tabbar clearance */
@media (max-width: 900px) {
  .stat-hero-feature {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-hero-rest {
    grid-template-columns: 1fr;
  }
  .stat-hero-v, .stat-hero-card.is-feature .stat-hero-v {
    font-size: clamp(1.85rem, 7vw, 2.25rem);
  }
  .stat-chips { top: 3.6rem; }
  body.has-tabbar .stat-section:last-of-type,
  body.has-tabbar .stat-how,
  body.has-tabbar .stat-sources {
    margin-bottom: 0;
  }
  body.has-tabbar #main {
    padding-bottom: 2.75rem; /* keep last cards clear of bottom tabbar */
  }
}
@media (max-width: 520px) {
  .stat-hero-feature { gap: .75rem; }
  .stat-hero-card { padding: 1rem; }
}

@media (prefers-color-scheme: dark) {
  .stat-hero-v, .stat-table .num, .stat-pt-label { color: var(--river); }
  .stat-chip.is-active { background: var(--river); color: var(--teal-deep); border-color: var(--river); }
  .stat-chip:hover { color: var(--river); }
  .stat-pill {
    color: var(--sand);
    background: color-mix(in srgb, var(--sand) 18%, var(--card));
    border-color: color-mix(in srgb, var(--sand) 35%, var(--line));
  }
  .stat-line { stroke: var(--river); }
  .stat-line-area { fill: color-mix(in srgb, var(--river) 18%, transparent); }
  .stat-dot, .stat-bar { fill: var(--river); }
  .stat-pt-peak { fill: var(--river); }
}

/* Neighbourhood stats reuse the same card + chart system */
.nh-stats .stat-hero,
.nh-stats .stat-chart { /* same tokens */ }

/* ===== A–Z design system pass ===== */
.theme-toggle {
  border: 1px solid rgba(255,255,255,.25);
  background: transparent;
  color: #fff;
  border-radius: 999px;
  width: 2.25rem; height: 2.25rem;
  cursor: pointer; font-size: 1rem;
  margin-left: .35rem;
}
.theme-toggle:hover { background: rgba(255,255,255,.1); }
.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.25rem; }
.chip {
  border: 1px solid var(--line, #c9d5dc);
  background: var(--card, #fff);
  color: var(--ink, #14252d);
  border-radius: 999px;
  padding: .4rem .85rem;
  font-size: .88rem;
  cursor: pointer;
}
.chip.is-on, .chip[aria-pressed="true"] {
  background: var(--teal, #0d4f6b);
  border-color: var(--teal, #0d4f6b);
  color: #fff;
}
.venue-block { margin: 0 0 2rem; }
.venue-h { margin-bottom: .75rem; }
.venue-h h2 { margin: 0 0 .25rem; font-size: 1.25rem; }
.nh-page .nh-highlights { margin: 1rem 0 1.5rem; }
.nh-page .nh-block { margin: 2rem 0; }
.nh-page .nh-hero { margin: 1rem 0 1.5rem; border-radius: 12px; overflow: hidden; }
.nh-page .nh-hero { aspect-ratio: 16/9; background: #083447; }
.nh-page .nh-hero picture { display: block; width: 100%; height: 100%; }
.nh-page .nh-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.form .check { display: flex; gap: .6rem; align-items: flex-start; font-size: .95rem; }
.form .check input { margin-top: .35rem; }
.form .hp { position: absolute; left: -9999px; height: 0; width: 0; opacity: 0; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 1rem 0; }
.table th, .table td { border: 1px solid var(--line, #c9d5dc); padding: .55rem .7rem; text-align: left; vertical-align: top; }
.table th { background: var(--wash, #eef3f5); }
.narrow { max-width: 42rem; }
.prose.narrow :is(h1,h2,h3) { line-height: 1.25; }

/* Explicit dark theme via data-theme (overrides system when set) */
html[data-theme="dark"] {
  color-scheme: dark;
}
html[data-theme="dark"] body,
html[data-theme="dark"] {
  --bg: #0b1a21;
  --ink: #e8eef1;
  --muted: #9bb3bf;
  --card: #12262f;
  --line: #1e3a46;
  --wash: #0f222a;
  --teal: #7ec8d8;
  --teal-deep: #0a3a4f;
  --sand: #e8c48a;
  --river: #7ec8d8;
}
html[data-theme="light"] {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    color-scheme: dark;
  }
}

html[data-theme="dark"] .chip { background: var(--card); color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .chip.is-on { background: var(--teal-deep); border-color: var(--teal); color: #fff; }
html[data-theme="dark"] .table th { background: #0f222a; }
html[data-theme="dark"] .stat-hero-card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .news-card,
html[data-theme="dark"] .feature {
  background: var(--card);
  border-color: var(--line);
}
html[data-theme="dark"] .form input,
html[data-theme="dark"] .form textarea {
  background: #0f222a;
  color: var(--ink);
  border-color: var(--line);
}

@media (prefers-reduced-motion: reduce) {
  .stat-hero-v { transition: none !important; }
}


/* ===== Contrast AA fixes ===== */
.eyebrow { color: #7a5a1a; }
.status-pill.closed, .badge.closed { color: #2f4552; background: rgba(47,69,82,.12); }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .eyebrow { color: #e8c48a; }
  html:not([data-theme="light"]) .status-pill.closed,
  html:not([data-theme="light"]) .badge.closed { color: #c5d4dc; background: rgba(197,212,220,.12); }
}
html[data-theme="dark"] .eyebrow { color: #e8c48a; }
html[data-theme="dark"] .status-pill.closed,
html[data-theme="dark"] .badge.closed { color: #c5d4dc; background: rgba(197,212,220,.12); }
html[data-theme="light"] .eyebrow { color: #7a5a1a; }

.footer-label, .foot .footer-label { margin: 0 0 .55rem; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--sand); font-weight: 700; }


/* Neighbourhood borough context: even rows (4 cards → 2×2 or 4×1), no 3-col orphan */
.nh-stats .stat-hero-rest {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
@media (min-width: 900px) {
  .nh-stats .stat-hero-rest {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}
@media (min-width: 1100px) {
  .nh-stats .stat-hero-rest {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
  }
}
@media (max-width: 699px) {
  .nh-stats .stat-hero-rest { grid-template-columns: 1fr; }
}
