/* DM Sans (body) and Inter (design-system detail/small/micro face + chart values, SIL OFL, Brief 07) come from Google
   Fonts. Brief 175 P4: they are loaded by <link> tags in each page's <head> (index.html, my.html, join.html), after a
   preconnect to both Google hosts — not by @import here, which held the first paint behind style.css, then
   fonts.googleapis.com, then fonts.gstatic.com, one after the other. */

/* Stolzl display typeface — woff2 only (Brief 171 P7, L-3): the desktop .otf files are not served. */
@font-face {
  font-family: 'Stolzl';
  src: url('/fonts/stolzl_bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Stolzl';
  src: url('/fonts/stolzl_medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
/* Stolzl Book (weight 400) — design-system wayfinding face: hero stats, page/pillar
   titles, section headings. This is the primary Stolzl display weight per the ramp. */
@font-face {
  font-family: 'Stolzl';
  src: url('/fonts/stolzl_book.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* Stolzl Light (weight 300) — design-system lede + scrolling rail body. */
@font-face {
  font-family: 'Stolzl';
  src: url('/fonts/stolzl_light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* ========================================
   CSS VARIABLES — LIGHT & DARK THEMES
   (from design prototype)
   ======================================== */
:root {
  --font-display: 'Stolzl', 'DM Sans', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  /* Brief 26 Part 1: the legacy colour names, re-pointed to the Assembly tokens of public/tokens.css
     (usage counts in STATUS, D-26.1a). `--green` is no longer declared here: the root's wins. */
  --bg-primary: var(--cream);
  --bg-section-alt: #F0EDEA;
  --bg-section-green: #EDF7F1;
  --text-primary: var(--ink);
  --text-secondary: var(--ink-soft);
  --text-tertiary: var(--ink-faint);
  --accent: var(--green);
  --accent-bright: var(--green);
  --accent-bg: #E8F5EE;
  --amber: var(--orange);
  --coral: var(--brick);
  --blue: var(--denim);
  --popover-bg: rgba(255,255,255,0.92);
  --popover-shadow: 0 8px 40px rgba(0,0,0,0.08), 0 2px 12px rgba(0,0,0,0.04);
  --topbar-bg: rgba(247,245,242,0.88);
  --divider: rgba(0,0,0,0.06);
  --chart-grid: #E8E5E0;
  --badge-bg: #F0EDEA;
  --badge-text: #777777;
  --card-hover: rgba(27,107,74,0.04);
}

/* ========================================
   DESIGN SYSTEM v0.1 (Brief 07) — single source of truth
   Added in Part 3; consumed by the sweep (Part 4) onward. Deltas from the DS spec
   where the app's real brand values differ are noted inline (brief §61).
   ======================================== */
:root {
  /* Type — three faces, three jobs. Stolzl Book = wayfinding · Stolzl Light = warmth
     (weight 300, placeholder until real Light) · Inter = detail. */
  --font-light: 'Stolzl', 'DM Sans', system-ui, sans-serif;      /* use with --w-light */
  --font-detail: 'Inter', system-ui, sans-serif;
  --w-light: 300;
  --w-book: 400;
  --w-medium: 500;
  /* Ramp: size / line-height pairs */
  --size-stat: 64px;   --lh-stat: 1.05;   /* hero stats (64–88) */
  --size-title: 32px;  --lh-title: 40px;  /* page/pillar title */
  --size-h2: 22px;     --lh-h2: 30px;     /* section headings — --ink-soft, never black */
  --size-lede: 19px;   --lh-lede: 28px;   /* warm explainer (Stolzl Light) */
  --size-body: 16px;   --lh-body: 26px;   /* scrolling rail body (Stolzl Light) */
  --size-detail: 14px; --lh-detail: 22px; /* small/dense: tables, fine print (Inter) */
  --size-small: 13px;  --lh-small: 20px;  /* meta, captions (Inter) */
  --size-micro: 11px;  --lh-micro: 16px;  /* tiny UPPERCASE labels (Inter Medium) */
  --size-chart-label: 13px;               /* chart titles + category labels (Stolzl) */
  --size-chart-value: 12px;               /* values, axes, legends, tooltips (Inter) */

  /* Colour. Brief 26 Part 1: --ink, --ink-soft and --surface are Assembly names, declared once in
     public/tokens.css — declaring them here (later in the cascade) would override it. --brand and
     --bg were copies of the old accent and page colours; they now point at the tokens. */
  --brand: var(--green);
  --chart-blue: #4A7FD4;          /* app --blue is #3B82C4 (delta) */
  --chart-amber: #E0A93E;         /* app --amber is #D4940A (delta) */
  --bg: var(--cream);
  --on-accent: #FFFFFF;           /* text/icons on brand/accent fills */
  --line: #E5E1D8;
  --warn-bg: #FBF3E0;
  --warn-ink: #B07A1F;

  /* Spacing — 8px scale */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 16px; --sp-4: 24px; --sp-5: 32px; --sp-6: 48px; --sp-7: 64px;

  /* Shape + pillar-template geometry */
  --radius-card: 12px;
  --card-pad: 24px;
  --section-gap: 48px;
  --rail-gutter: 64px;    /* gap between rail text column and interactive canvas */
  --rail-offset: 48px;    /* rail inner padding / text offset from edge */
}

/* ============================================================================
   DISPLAY-SCALING RULES (design system) — how every tier page adapts to LARGE screens.
   Promoted from the Top Hazards page (brief: responsive-scaling) so the whole app behaves
   the same way. Two knobs, both 1 on laptops/tablets (so those render exactly as tuned):
     --app-zoom : whole-page proportional scale (text + icons together) via `zoom`.
     --app-emph : extra size lift for KEY read-from-distance text only (page titles, hero stats,
                  headline numbers) — apply as  font-size: calc(<size> * var(--app-emph)).
   The rules (identical in spirit to .crx-canvas's DISPLAY-SCALING RULES):
     1. FILL THE HEIGHT, CAP THE WIDTH — a page centres within a capped width with whitespace on
        the sides on big screens (good aspect ratio), rather than stretching wide.
     2. SCALE UP MODERATELY — --app-zoom is capped per tier so content never grows past ~2/3 of
        the screen width: readable across a room, never oversized/sprawling.
     3. LIFT KEY TEXT A LITTLE MORE via --app-emph, without widening the layout.
     4. LAPTOPS & TABLETS UNTOUCHED — tiers gated on BOTH width AND height, so both knobs stay 1.
   Tiers match the hazards page exactly. */
/* --app-maxw: width cap for the page content. `none` on laptops/tablets (content spills to use the
   width, unchanged); a cap on big screens so the page centres with whitespace instead of stretching.
   Pages opt in with:  max-width: var(--app-maxw); margin-inline: auto;  (rendered width = cap × zoom). */
:root { --app-zoom: 1; --app-emph: 1; --app-maxw: none; }
@media (min-width: 1600px) and (min-height: 950px)  { :root { --app-zoom: 1.20; --app-emph: 1.30; --app-maxw: 1200px; } }  /* large desktop monitor */
@media (min-width: 2200px) and (min-height: 1250px) { :root { --app-zoom: 1.55; --app-emph: 1.45; --app-maxw: 1200px; } }  /* 1440p large display */
@media (min-width: 3200px) and (min-height: 1700px) { :root { --app-zoom: 2.10; --app-emph: 1.65; --app-maxw: 1200px; } }  /* 4K TV / big display */

/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  transition: background-color 0.4s ease, color 0.3s ease;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ========================================
   STICKY TOP BAR
   ======================================== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 100;
  border-bottom: 1px solid var(--divider);
  transition: background-color 0.4s ease;
}
/* Chris, 24 Oct: top-left reads NZA roundel · a rule · decodED. The roundel and the rule are the brand green;
   the roundel links to netzeroadvisory.uk. */
.topbar-brand { display: flex; align-items: center; gap: 14px; }
.topbar-nza {
  /* The roundel only: nza-logo.svg is the 1000×120 wordmark, so it is drawn as a mask cropped to the
     mark (x 22–138 of the viewBox) — the landing credit's crop, scaled to 32 px. */
  flex: 0 0 auto;
  position: relative;
  width: 31px; height: 32px;
  border-radius: 50%;
}
/* Brief 167: the mask sits on ::before so the focus ring (on the link itself) is not masked away. */
.topbar-nza::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--green);     /* tokens.css #235546 — --brand-green is scoped to the screens, not the bar */
  -webkit-mask: url('/assets/nza-logo.svg') no-repeat -5.9px 50% / 266.7px 32px;
  mask: url('/assets/nza-logo.svg') no-repeat -5.9px 50% / 266.7px 32px;
}
.topbar-nza:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.topbar-brand-rule { flex: 0 0 auto; width: 1px; height: 28px; background: var(--green); }
.topbar-logo {
  /* decodED logo in its own colours (green + orange). This is the SVG itself, not a
     mask, so the per-pillar tint no longer applies to it — deliberate: the brand mark
     keeps its own palette while the rest of the chrome still themes. */
  width: 176px; height: 48px;
  background: url('/assets/decoded-logo.svg') no-repeat left center / contain;
}
.topbar-section {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar-school-wrap { position: relative; display: flex; align-items: center; }
.topbar-school {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-school:empty { display: none; }              /* no trigger until a school is loaded */
.topbar-school:hover { background: var(--badge-bg); color: var(--text-primary); }
.topbar-school::after { content: '\25BE'; font-size: 10px; opacity: 0.55; }
.school-popout {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 200;
  display: none;
  width: 300px;
  padding: var(--card-pad);
  text-align: left;
  background: var(--popover-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--popover-shadow);
}
.school-popout.open { display: block; }
.school-popout .school-card-name { margin-bottom: var(--sp-2); }
.school-popout .school-card-badges { margin-top: var(--sp-3); display: flex; flex-wrap: wrap; gap: var(--sp-2); }
/* ========================================
   LANDING PAGE
   ======================================== */
.landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 32px 40px;
}
.landing-inner {
  text-align: center;
  max-width: 600px;
}
.landing-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 6vw, 56px);
  letter-spacing: -0.03em;
  color: var(--accent);
  margin-bottom: 16px;
}
.landing-subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.6;
}
.landing-note {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 24px;
}

/* V2: Landing page enhancements */
.landing-tagline {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(18px, 2.4vw, 24px);
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}
.landing-body {
  max-width: 640px;
  margin: 0 auto 32px;
  font-size: clamp(15px, 1.6vw, 17px);
  color: var(--text-secondary);
  line-height: 1.7;
  text-align: center;
}
.how-it-works {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 40px 0 32px;
  text-align: left;
}
.how-step {
  padding: 24px;
  border-radius: 16px;
  background: var(--bg-section-alt);
  border: 1px solid var(--divider);
  transition: background 0.2s ease;
}
.how-step:hover {
  background: var(--card-hover);
}
.how-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 14px;
}
.how-step-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 6px;
  color: var(--text-primary);
}
.how-step-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.landing-powered {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 32px;
  letter-spacing: 0.02em;
}

/* ========================================
   SEARCH
   ======================================== */
.search-container {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
}
.search-input {
  width: 100%;
  padding: 16px 24px;
  border-radius: 16px;
  border: 2px solid var(--divider);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 17px;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(27,107,74,0.1);
}
.search-input::placeholder {
  color: var(--text-tertiary);
}
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--popover-bg);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  box-shadow: var(--popover-shadow);
  overflow: hidden;
  display: none;
  z-index: 50;
  max-height: 400px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.search-results.visible { display: block; }
.search-result-item {
  padding: 14px 20px;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid var(--divider);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--card-hover); }
.search-result-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}
.search-result-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.search-result-reason {
  font-size: 13px;
  color: var(--text-primary);
  margin-top: 4px;
}

/* ========================================
   TAB BAR
   ======================================== */
.tab-bar {
  position: sticky;
  top: 56px;
  z-index: 90;
  display: flex;
  gap: 4px;
  padding: 8px 32px;
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--divider);
  overflow-x: auto;
}
.tab-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.tab-btn:hover { background: var(--card-hover); color: var(--text-primary); }
.tab-btn.active {
  background: var(--pillar-accent-bg, var(--accent-bg));
  color: var(--pillar-accent, var(--accent));
  font-weight: 600;
}
.tab-content { display: none; padding: 40px 32px 80px; }
.tab-content.active { display: block; }

/* ========================================
   REPORT VIEW
   ======================================== */
.report { padding-top: 56px; }

/* ========================================
   SCHOOL INFO CARD
   ======================================== */
.school-card {
  padding: 24px 32px;
  background: var(--bg-section-alt);
  border-bottom: 1px solid var(--divider);
}
.school-card-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}
.school-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.school-card-meta {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.divider-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-tertiary);
}
.school-card-address {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.school-card-badges {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
.school-card-mat {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ========================================
   CAVEAT BANNER
   ======================================== */
.caveat-banner {
  padding: 12px 32px;
  background: rgba(245,158,11,0.08);
  border-bottom: 1px solid rgba(245,158,11,0.15);
  font-size: 13px;
  color: var(--amber);
  text-align: center;
  line-height: 1.5;
}

/* ========================================
   SCROLL ANIMATIONS
   ======================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.2s; }
.reveal-d3 { transition-delay: 0.3s; }
.reveal-d4 { transition-delay: 0.4s; }

/* ========================================
   TYPOGRAPHY
   ======================================== */
.hero-metric {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(56px, 10vw, 96px);
  line-height: 1.0;
  letter-spacing: -0.03em;
}
.hero-metric .unit {
  font-size: 0.4em;
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: 4px;
}
.hero-subtitle {
  font-size: clamp(17px, 2.2vw, 21px);
  color: var(--text-secondary);
  max-width: 560px;
  margin: 20px auto 0;
  line-height: 1.55;
}
.section-inner {
  max-width: 900px;
  margin: 0 auto;
}
.section-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}
.section-subheading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(18px, 2.5vw, 24px);
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}
.body-text {
  font-size: clamp(15px, 1.6vw, 17px);
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 640px;
}
.body-text.centered { margin: 0 auto; text-align: center; }

/* ========================================
   BADGE
   ======================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--badge-bg);
  font-size: 13px;
  font-weight: 500;
  color: var(--badge-text);
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ========================================
   FLOATING METRICS
   ======================================== */
.metrics-row {
  display: flex;
  justify-content: center;
  gap: clamp(32px, 6vw, 80px);
  flex-wrap: wrap;
  margin: 48px 0;
}
.floating-metric {
  text-align: center;
  padding: 16px;
  border-radius: 16px;
  transition: background 0.3s ease;
}
.floating-metric:hover { background: var(--card-hover); }
.floating-metric .number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.floating-metric .label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 4px;
}
.floating-metric .sublabel {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.color-amber { color: var(--amber); }
.color-coral { color: var(--coral); }
.color-green { color: var(--green); }
.color-blue { color: var(--blue); }

/* ========================================
   MODULE SECTIONS
   ======================================== */
.module-section {
  margin: 48px 0;
  padding-top: 24px;
  border-top: 1px solid var(--divider);
}

/* ========================================
   BUILDINGS GRID
   ======================================== */
.buildings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.buildings-stat {
  padding: 16px;
  border-radius: 12px;
  background: var(--bg-section-alt);
}
.buildings-stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.buildings-stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  margin-top: 4px;
}
.buildings-stat-note {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ========================================
   CHARTS
   ======================================== */
.charts-row {
  display: flex;
  gap: 24px;
  margin: 32px 0;
  flex-wrap: wrap;
}
.chart-card {
  flex: 1;
  min-width: 260px;
  padding: 24px;
  border-radius: 16px;
  background: var(--bg-section-alt);
  border: 1px solid var(--divider);
}
.chart-card h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

/* ========================================
   PEER COMPARISON BAR
   ======================================== */
.peer-bar-container { margin: 32px auto; max-width: 640px; }
.peer-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.peer-bar-track {
  height: 8px;
  border-radius: 4px;
  background: var(--chart-grid);
  position: relative;
  overflow: visible;
}
.peer-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  transition: width 1.2s ease-out;
  width: 0;
}
.peer-marker {
  position: absolute;
  top: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--coral);
  border: 3px solid var(--bg-primary);
  transition: left 1.2s ease-out;
  left: 0;
}
.peer-marker-label {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  color: var(--coral);
  white-space: nowrap;
}

/* ========================================
   FLOOD RISK PANEL
   ======================================== */
.flood-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.flood-card {
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--bg-section-alt);
  border-left: 4px solid var(--chart-grid);
}
.flood-card.risk-high { border-left-color: var(--coral); }
.flood-card.risk-medium { border-left-color: var(--amber); }
.flood-card.risk-low, .flood-card.risk-very_low { border-left-color: var(--green); }
.flood-card-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.flood-card-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  margin-top: 4px;
  text-transform: capitalize;
}

/* ========================================
   RISK TIMELINE
   ======================================== */
.risk-timeline {
  display: flex;
  justify-content: center;
  gap: clamp(24px, 5vw, 64px);
  margin: 40px auto;
  max-width: 720px;
}
.risk-year { text-align: center; flex: 1; }
.risk-year-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.risk-year-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.1;
}
.risk-year-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.4;
}

/* ========================================
   PROJECTIONS GRID
   ======================================== */
.projections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.projection-card {
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--bg-section-alt);
  border: 1px solid var(--divider);
}
.projection-card-period {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.projection-card-stat {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14px;
  color: var(--text-secondary);
}
.projection-card-stat span:last-child {
  font-weight: 600;
  color: var(--text-primary);
}

/* ========================================
   NARRATIVE
   ======================================== */
.narrative { max-width: 640px; margin: 0 auto; padding: 24px 0; }
.narrative p {
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.narrative .highlight { color: var(--text-primary); font-weight: 600; }

/* ========================================
   INSIGHTS
   ======================================== */
.insights-container {
  margin: 32px 0;
}
.insight-card {
  padding: 20px 24px;
  border-radius: 16px;
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.15);
  margin-bottom: 12px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.insight-card.severity-high {
  background: rgba(224,107,82,0.06);
  border-color: rgba(224,107,82,0.2);
}
.insight-card.severity-low {
  background: rgba(58,170,109,0.06);
  border-color: rgba(58,170,109,0.2);
}
.insight-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}
.insight-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}
.insight-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ========================================
   COMING SOON (Energy Transition)
   ======================================== */
.coming-soon {
  padding: 40px 0;
}
.coming-soon-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.energy-teaser {
  margin: 24px auto;
  max-width: 400px;
}
.energy-bar {
  display: flex;
  height: 32px;
  border-radius: 8px;
  overflow: hidden;
  margin: 12px 0;
}
.energy-bar-elec {
  background: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
}
.energy-bar-gas {
  background: var(--coral);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
}
.energy-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ========================================
   CTA BUTTON
   ======================================== */
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 32px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}
.cta-btn:hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(27,107,74,0.2);
}

/* ========================================
   DOWNLOAD BUTTONS
   ======================================== */
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--divider);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 16px;
}
.download-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

/* ========================================
   V2: OVERVIEW SPLIT-SCREEN HERO
   ======================================== */
.overview-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin: 32px 0;
  align-items: start;
}
.overview-hero-map {
  min-width: 0;
}
.overview-hero-stats {
  min-width: 0;
}
.map-container {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-section-alt);
  border: 1px solid var(--divider);
  position: relative;
}
.map-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
}
.map-container-large {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-section-alt);
  border: 1px solid var(--divider);
  position: relative;
}
.map-container-large iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
}
/* The Brief 05 twin site panel (.twin-site-panel / .twin-stat-* / .twin-site-received)
   was removed with its markup — the map viewer shows those figures itself. Only the
   restore-failure notice survived, rehomed under the map. */
.site-restore-warn {
  margin-top: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-card);
  background: var(--warn-bg);
  border: 1px solid var(--warn-ink);
  color: var(--warn-ink);
  font-family: var(--font-detail);
  font-size: var(--size-small);
  line-height: var(--lh-small);
}
.map-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 14px;
  color: var(--text-tertiary);
  text-align: center;
  padding: 24px;
}
.overview-pie-container {
  margin-top: 24px;
  padding: 20px;
  border-radius: 16px;
  background: var(--bg-section-alt);
  border: 1px solid var(--divider);
}

/* ========================================
   V2: OVERVIEW RISK SUMMARY CARDS
   ======================================== */
.risk-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 24px 0;
}
.risk-summary-card {
  padding: 16px;
  border-radius: 12px;
  background: var(--bg-section-alt);
  border: 1px solid var(--divider);
  text-align: center;
  transition: background 0.2s ease;
}
.risk-summary-card:hover {
  background: var(--card-hover);
}
.risk-summary-card .icon {
  font-size: 24px;
  margin-bottom: 8px;
}
.risk-summary-card .label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.risk-summary-card .value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  text-transform: capitalize;
}
.overview-risk-cards,
.overview-bio-cards {
  margin: 32px 0;
}

/* ========================================
   V2: BIODIVERSITY PLACEHOLDER CARDS
   ======================================== */
.bio-placeholder-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}
.bio-placeholder-card {
  padding: 24px;
  border-radius: 16px;
  background: var(--bg-section-alt);
  border: 1px solid var(--divider);
  text-align: center;
  transition: background 0.2s ease;
}
.bio-placeholder-card:hover {
  background: var(--card-hover);
}
.bio-placeholder-icon {
  font-size: 40px;
  margin-bottom: 12px;
  display: block;
}
.bio-placeholder-card h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 6px;
  color: var(--text-primary);
}
.bio-placeholder-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.bio-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 10px;
}

/* ========================================
   V2: EMISSIONS STACKED BAR
   ======================================== */
.stacked-bar-container {
  margin: 24px 0;
}
.stacked-bar {
  display: flex;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--chart-grid);
}
.stacked-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1px;
  cursor: pointer;
  transition: opacity 0.2s ease, filter 0.2s ease;
  position: relative;
  min-width: 0;
}
.stacked-segment:hover {
  opacity: 0.88;
  filter: brightness(1.08);
}
.seg-buildings {
  background: var(--amber);
}
.seg-transport {
  background: var(--coral);
}
.seg-procurement {
  background: var(--blue);
}
.seg-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--on-accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 8px;
  line-height: 1.2;
}
.seg-value {
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 8px;
  line-height: 1.2;
}
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   V2: CLIMATE RISK TAB — HARTPURY STYLE
   ======================================== */
.climate-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.climate-pill {
  padding: 8px 20px;
  border-radius: 100px;
  border: 1px solid var(--divider);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.climate-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}
.climate-pill.active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.climate-chart-area {
  margin: 24px 0;
  padding: 24px;
  border-radius: 16px;
  background: var(--bg-section-alt);
  border: 1px solid var(--divider);
  position: relative;
}
.climate-chart-area canvas {
  width: 100%;
  max-height: 360px;
}
.climate-stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 24px 0;
}
.climate-stat-card {
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--bg-section-alt);
  border: 1px solid var(--divider);
}
.climate-stat-card .period-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}
.climate-stat-card .rcp-split {
  display: flex;
  gap: 16px;
}
.climate-stat-card .rcp-value {
  flex: 1;
  text-align: center;
}
.climate-stat-card .rcp-value .rcp-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.climate-stat-card .rcp-value .rcp-label.low {
  color: var(--blue);
}
.climate-stat-card .rcp-value .rcp-label.high {
  color: var(--coral);
}
.climate-stat-card .rcp-value .rcp-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
}
.climate-stat-card .rcp-value.low .rcp-number {
  color: var(--blue);
}
.climate-stat-card .rcp-value.high .rcp-number {
  color: var(--coral);
}
/* Climate stat card classes used by JS */
.climate-stat-period {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}
.climate-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
}
.climate-stat-rcp45 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--blue);
}
.climate-stat-rcp85 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--coral);
}
.climate-stat-label-small {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.climate-stat-card-indicator {
  grid-column: 1 / -1;
}
.climate-stat-indicator-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-secondary);
}
.climate-stat-indicator-row strong {
  color: var(--text-primary);
}
.climate-stat-unit {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Flood row layout used by JS */
.flood-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}
.flood-explainer {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Map placeholder styled (when no API key) */
.map-placeholder-styled {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 280px;
  background: var(--bg-section-alt);
  border-radius: 12px;
  border: 2px dashed var(--divider);
  text-align: center;
  padding: 32px;
}
.map-placeholder-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.map-placeholder-styled p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.map-placeholder-sub {
  font-size: 13px;
  color: var(--text-tertiary) !important;
}

.key-finding {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 20px 24px;
  border-radius: 16px;
  background: rgba(245,158,11,0.06);
  border-left: 4px solid var(--amber);
  margin: 24px 0;
}
.key-finding-icon {
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 1px;
}
.key-finding-text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
}
.key-finding-text strong {
  color: var(--text-primary);
  font-weight: 600;
}
.flood-panel-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.flood-explainer-card {
  padding: 20px 24px;
  border-radius: 16px;
  background: var(--bg-section-alt);
  border: 1px solid var(--divider);
  border-left: 4px solid var(--chart-grid);
}
.flood-explainer-card.risk-high { border-left-color: var(--coral); }
.flood-explainer-card.risk-medium { border-left-color: var(--amber); }
.flood-explainer-card.risk-low,
.flood-explainer-card.risk-very_low { border-left-color: var(--green); }
.flood-explainer-card h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}
.flood-explainer-card .flood-level {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  text-transform: capitalize;
  margin-bottom: 8px;
}
.flood-explainer-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.risk-assessment-cta {
  margin: 40px 0;
  padding: 40px;
  border-radius: 20px;
  background: var(--bg-section-green);
  border: 1px solid var(--divider);
  text-align: center;
}
.risk-assessment-cta h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  margin-bottom: 12px;
}
.risk-assessment-cta p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto 20px;
}

/* ========================================
   V2: BIODIVERSITY TAB
   ======================================== */
.bio-map-container {
  margin: 24px 0;
}
.bio-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--bg-section-alt);
  border: 1px solid var(--divider);
}
.bio-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}
.bio-icon {
  font-size: 18px;
  line-height: 1;
}
.bio-map-note {
  font-size: 12px;
  font-style: italic;
  color: var(--text-tertiary);
  margin-top: 8px;
  line-height: 1.5;
}
.bio-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.bio-action-card {
  padding: 24px;
  border-radius: 16px;
  background: var(--bg-section-alt);
  border: 1px solid var(--divider);
  transition: background 0.2s ease, transform 0.2s ease;
}
.bio-action-card:hover {
  background: var(--card-hover);
  transform: translateY(-2px);
}
.bio-action-icon {
  font-size: 36px;
  margin-bottom: 12px;
  display: block;
}
.bio-action-card h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 6px;
  color: var(--text-primary);
}
.bio-action-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
}
.bio-cost {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--green);
}

/* ========================================
   DEC BUILDINGS SIDEBAR
   ======================================== */
.dec-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.dec-sidebar-backdrop.open {
  display: block;
  opacity: 1;
}
.dec-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 92vw);
  height: 100vh;
  background: var(--bg-primary);
  box-shadow: -8px 0 40px rgba(0,0,0,0.15);
  z-index: 210;
  transform: translateX(100%);
  /* Closed, it is also hidden, so Tab and screen readers do not land on its unseen "Close" button. Visibility waits for
     the slide out to finish, and comes back at once on open. */
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.35s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dec-sidebar.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
}
.dec-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}
.dec-sidebar-header h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  margin: 0;
}
.dec-sidebar-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--badge-bg);
  color: var(--text-secondary);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.dec-sidebar-close:hover {
  background: var(--accent-bg);
  color: var(--accent);
}
.dec-sidebar-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 20px 24px;
}
.dec-sidebar-summary {
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.dec-site-summary {
  padding: 20px;
  border-radius: 16px;
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  margin-bottom: 20px;
}
.dec-site-summary h4 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
}
.dec-site-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.dec-site-stat {
  text-align: center;
}
.dec-site-stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--text-primary);
  display: block;
}
.dec-site-stat-label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dec-building-card {
  padding: 20px;
  border-radius: 16px;
  background: var(--bg-section-alt, var(--bg-secondary));
  border: 1px solid var(--divider);
  margin-bottom: 12px;
  transition: all 0.2s ease;
}
.dec-building-card:hover {
  border-color: var(--text-tertiary);
}
.dec-building-primary {
  border-left: 4px solid var(--green);
}
.dec-selected-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  background: rgba(58,170,109,0.1);
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.dec-building-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
  color: var(--text-primary);
}
.dec-building-address {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.dec-building-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.dec-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dec-field-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dec-field-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.dec-field-value.dec-emissions {
  color: var(--coral);
}
/* DEC rating colour accents */
.dec-rating-a, .dec-rating-b { color: var(--green); }
.dec-rating-c, .dec-rating-d { color: var(--amber); }
.dec-rating-e, .dec-rating-f, .dec-rating-g { color: var(--coral); }

/* Clickable DEC badge */
#dataQuality.dec-clickable {
  cursor: pointer;
  transition: opacity 0.2s ease;
}
#dataQuality.dec-clickable:hover {
  opacity: 0.8;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .topbar { padding: 0 16px; }
  .tab-bar { padding: 8px 16px; }
  .tab-content { padding: 24px 16px 60px; }
  .school-card { padding: 16px; }
  .school-card-inner { flex-direction: column; }
  .school-card-badges { align-items: flex-start; }
  .metrics-row { gap: 16px; }
  .floating-metric { padding: 12px; }
  .risk-timeline { flex-direction: column; gap: 24px; }
  .topbar-school { display: none; }
  /* A phone has no room for the section label beside the logo and Sign in: it wrapped to two lines, and so did "Sign in". */
  .topbar-section { display: none; }
  .topbar-login-btn { white-space: nowrap; }
  .charts-row { flex-direction: column; }
  .topbar-logo { font-size: 15px; }

  /* V2 responsive overrides */
  .how-it-works {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .overview-hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .risk-summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .bio-placeholder-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .stacked-bar {
    height: 40px;
  }
  .seg-label {
    font-size: 10px;
  }
  .seg-value {
    display: none;
  }
  .climate-stat-cards {
    grid-template-columns: 1fr;
  }
  .flood-panel-v2 {
    grid-template-columns: 1fr;
  }
  .flood-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .risk-assessment-cta {
    padding: 24px;
  }
  .bio-action-grid {
    grid-template-columns: 1fr;
  }
  .dec-sidebar {
    width: 100vw;
  }
  .dec-building-grid {
    grid-template-columns: 1fr;
  }
  .dec-site-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ========================================
   ONBOARDING V2: SCREEN NAVIGATION
   ======================================== */
.screen { padding-top: 56px; }
.hidden { display: none !important; }

/* ========================================
   V2: TOPBAR LOGIN BUTTON
   ======================================== */
.topbar-login-btn {
  padding: 8px 20px;
  border-radius: 8px;
  border: 1px solid var(--divider);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.topbar-login-btn:hover {
  border-color: var(--pillar-accent, var(--accent));
  color: var(--pillar-accent, var(--accent));
  background: var(--pillar-accent-bg, var(--accent-bg));
}

/* ========================================
   V2: SCREEN 1 — WELCOME
   ======================================== */
/* Brief 18 — "Assembly" tokens (the partner demo's palette), scoped to the landing only.
   --brand-green acts (buttons, active) · --brand-orange selects (lit dots, chosen result,
   the "ED") · --land / --sea paint the basemap · --river the waterways. The app's global
   --accent / --coral are untouched: other screens keep their colours. landing.js reads
   these via getComputedStyle — no hex literal ever lands in JS. */
.screen-welcome,
.screen-twin,
.auth-overlay {
  --brand-green: #235546;
  --brand-orange: #E28F2C;
  --land: #F4F1EA;
  --sea: #DCE6E1;
  --river: #CFE0D8;
}
/* ========================================
   V2: SCREEN 2 — INSTITUTION TYPE
   ======================================== */
.screen-institution {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 32px 40px;
}
.institution-inner {
  text-align: center;
  max-width: 700px;
  animation: fadeUp 0.6s ease-out;
}
.institution-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 4vw, 36px);
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.institution-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}
.institution-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.institution-card {
  padding: 24px 16px;
  border-radius: 16px;
  border: 2px solid var(--divider);
  background: var(--bg-section-alt);
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  position: relative;
}
.institution-card:hover {
  border-color: var(--text-tertiary);
  transform: translateY(-2px);
}
.institution-card.institution-card-active:hover,
.institution-card.institution-card-selected {
  border-color: var(--accent);
  background: var(--accent-bg);
  box-shadow: 0 4px 20px rgba(27,107,74,0.12);
}
.institution-card-disabled {
  opacity: 0.55;
  cursor: default;
}
.institution-card-disabled:hover {
  transform: none;
  border-color: var(--divider);
}
.institution-icon {
  font-size: 40px;
  margin-bottom: 8px;
}
.institution-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
}
.institution-status {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 6px;
}
.institution-status-live { color: var(--accent); }
.institution-status-soon { color: var(--text-tertiary); }
.institution-continue-btn { margin-top: 16px; }
.institution-continue-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s ease;
}
.back-link:hover { color: var(--accent); }

.coming-soon-message {
  margin-top: 16px;
  padding: 20px;
  border-radius: 12px;
  background: var(--bg-section-alt);
  border: 1px solid var(--divider);
  animation: fadeUp 0.3s ease-out;
}
.coming-soon-message p { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }
.coming-soon-email { display: flex; gap: 8px; max-width: 360px; margin: 0 auto; }
.coming-soon-input {
  flex: 1; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--divider);
  background: var(--bg-primary); color: var(--text-primary); font-family: var(--font-body); font-size: 14px; outline: none;
}
.coming-soon-input:focus { border-color: var(--accent); }
.coming-soon-notify-btn {
  padding: 10px 20px; border-radius: 8px; border: none; background: var(--accent); color: var(--on-accent);
  font-family: var(--font-body); font-size: 14px; font-weight: 500; cursor: pointer;
}
.coming-soon-notify-btn:hover { background: var(--accent-bright); }

/* ========================================
   V2: SCREEN 3 — FIND YOUR SCHOOL
   ======================================== */
.screen-search {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 32px 40px;
}
.search-screen-inner {
  text-align: center;
  max-width: 600px;
  width: 100%;
  animation: fadeUp 0.6s ease-out;
}
.search-screen-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.search-screen-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* ========================================
   V2: SCREEN 4 — MAP + DATA REVIEW
   ======================================== */
.screen-review { padding-top: 56px; height: 100vh; overflow: hidden; }
.review-split { display: flex; height: calc(100vh - 56px); }
.review-map-panel { flex: 0 0 55%; position: relative; }
.review-map-container { width: 100%; height: 100%; position: relative; background: var(--bg-section-alt); }
.review-data-panel {
  flex: 0 0 45%; overflow-y: auto; scrollbar-gutter: stable; padding: 24px 28px;
  background: var(--bg-primary); border-left: 1px solid var(--divider);
}
.review-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 300px; gap: 16px; color: var(--text-secondary); font-size: 14px;
}
.review-content { animation: fadeUp 0.5s ease-out; }
.review-section { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--divider); }
.review-section:last-child { border-bottom: none; }
.review-school-name {
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  letter-spacing: -0.02em; color: var(--text-primary); margin-bottom: 4px;
}
.review-school-meta { font-size: 14px; color: var(--text-secondary); margin-bottom: 2px; }
.review-school-la { font-size: 13px; color: var(--text-tertiary); }
.review-section-title {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); margin-bottom: 12px;
}
.review-section-hint { font-size: 13px; color: var(--text-tertiary); margin-bottom: 16px; line-height: 1.5; }
.review-data-grid { display: flex; flex-direction: column; gap: 8px; }
.review-data-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-radius: 8px; background: var(--bg-section-alt); border: 1px solid var(--divider);
}
.review-data-label { flex: 1; font-size: 14px; color: var(--text-secondary); }
.review-data-value { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--text-primary); }
.review-edit-btn {
  width: 28px; height: 28px; border-radius: 6px; border: none; background: transparent;
  color: var(--text-tertiary); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s ease;
}
.review-edit-btn:hover { background: var(--accent-bg); color: var(--accent); }
.review-edit-input {
  width: 80px; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--accent);
  background: var(--bg-primary); color: var(--text-primary); font-family: var(--font-body); font-size: 14px; outline: none;
}
.review-dec-summary {
  padding: 16px; border-radius: 12px; background: var(--bg-section-alt);
  border: 1px solid var(--divider); font-size: 14px; line-height: 1.7; color: var(--text-secondary);
}
.review-dec-summary .dec-rating-display {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
}
.review-dec-summary .dec-no-data { font-style: italic; color: var(--text-tertiary); }

/* Quick questions */
.quick-question { margin-bottom: 16px; }
.quick-question-label { display: block; font-size: 14px; font-weight: 500; color: var(--text-primary); margin-bottom: 8px; }
.quick-question-options { display: flex; flex-wrap: wrap; gap: 6px; }
.qq-btn {
  padding: 6px 14px; border-radius: 100px; border: 1px solid var(--divider); background: transparent;
  color: var(--text-secondary); font-family: var(--font-body); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s ease;
}
.qq-btn:hover { border-color: var(--accent); color: var(--accent); }
.qq-btn.qq-btn-selected { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.review-generate-section { text-align: center; padding-top: 24px; border-bottom: none; }
.review-generate-btn { width: 100%; justify-content: center; font-size: 16px; padding: 16px 24px; }
.review-generate-note { font-size: 13px; color: var(--text-tertiary); margin-top: 8px; }

.map-loading-spinner {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  color: var(--text-tertiary); font-size: 14px; z-index: 10;
}
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--divider);
  border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========================================
   V2: SCREEN 5 — BUILDING PROFILE
   ======================================== */
.screen-building {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 80px 32px 40px;
}
.building-inner { text-align: center; max-width: 480px; animation: fadeUp 0.6s ease-out; }
.building-icon-pulse { position: relative; display: inline-block; margin-bottom: 24px; }
.building-icon-emoji { font-size: 64px; position: relative; z-index: 1; }
.building-icon-ring {
  position: absolute; top: 50%; left: 50%; width: 80px; height: 80px;
  margin-top: -40px; margin-left: -40px; border-radius: 50%;
  border: 2px solid var(--accent); opacity: 0.3; animation: pulse-ring 2s ease-out infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 0.4; }
  70% { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}
.building-heading {
  font-family: var(--font-display); font-weight: 700; font-size: 28px;
  letter-spacing: -0.02em; color: var(--text-primary); margin-bottom: 12px;
}
.building-summary { font-size: 15px; color: var(--text-secondary); margin-bottom: 32px; line-height: 1.6; }
.building-checklist { text-align: left; max-width: 340px; margin: 0 auto; }
.building-check-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  opacity: 0.4; transition: opacity 0.4s ease, transform 0.4s ease; transform: translateX(-8px);
}
.building-check-item.active { opacity: 1; transform: translateX(0); }
.building-check-item.done { opacity: 0.7; transform: translateX(0); }
.check-icon { font-size: 20px; width: 24px; text-align: center; }
.check-text { font-size: 15px; color: var(--text-secondary); }
.building-check-item.active .check-text { color: var(--text-primary); font-weight: 500; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Review screen: embedded twin + collapse-to-full-width handle */
.review-map-container iframe,
.review-twin-frame { width: 100%; height: 100%; border: 0; display: block; }
.review-map-panel, .review-data-panel {
  transition: flex-basis 0.28s ease, padding 0.28s ease;
}
.review-split.panel-collapsed .review-map-panel { flex-basis: 100%; }
.review-split.panel-collapsed .review-data-panel {
  flex-basis: 0; width: 0; padding-left: 0; padding-right: 0;
  overflow: hidden; border-left: 0;
}
.review-panel-toggle {
  position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
  z-index: 5; width: 26px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--divider); border-radius: 8px;
  background: var(--popover-bg); color: var(--text-secondary);
  box-shadow: var(--popover-shadow); backdrop-filter: blur(8px);
  cursor: pointer; font-size: 20px; line-height: 1; padding: 0;
  transition: color 0.15s ease, background 0.15s ease;
}
.review-panel-toggle:hover { color: var(--text-primary); background: var(--bg-primary); }

/* V2 responsive — onboarding screens */
@media (max-width: 768px) {
  .institution-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .institution-card { padding: 16px 12px; }
  .institution-icon { font-size: 28px; }
  .institution-label { font-size: 14px; }
  .review-split { flex-direction: column; height: auto; min-height: calc(100vh - 56px); }
  .review-map-panel { flex: 0 0 auto; height: 45vh; }
  .review-data-panel { flex: 1; border-left: none; border-top: 1px solid var(--divider); padding: 20px 16px; }
  .screen-review { height: auto; overflow: auto; scrollbar-gutter: stable; }
  .qq-btn { font-size: 12px; padding: 5px 10px; }
  .building-icon-emoji { font-size: 48px; }
  .building-heading { font-size: 22px; }
}

/* ========================================
   DESIGN SYSTEM — PILLAR PAGE TEMPLATE (Brief 07)
   Shared shell for the Climate Risk / Biodiversity / Energy & Green Skills tabs.
   50/50 columns · gutter 64 · text offset 48 · white canvas card. DS type ramp
   throughout; structural colours use the app's theme-aware tokens so light + dark
   both render (DS greys map to these in light). Reuse this — don't reinvent it.
   ======================================== */
.pillar-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;          /* 50/50 FILL */
  gap: var(--rail-gutter);                 /* 64 */
  align-items: stretch;
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--section-gap) var(--rail-offset);   /* 48 */
  min-height: calc(100vh - 180px);
}
/* Big-screen scale-up (design-system DISPLAY-SCALING RULES). Scoped to the Education tab so the
   shared .pillar-shell (also used by the Biodiversity mapper) is unaffected. The shell is already
   max-width:1440 + centred, so at these capped zooms it stays well within the screen with
   whitespace on the sides (rule 1). */
#tab-energy-transition { zoom: var(--app-zoom); }
.pillar-rail {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  overflow-y: auto;
  scrollbar-gutter: stable;
  max-height: calc(100vh - 180px);
}
.pillar-title {
  position: sticky;                        /* persistent while rail text scrolls */
  top: 0;
  background: var(--bg-primary);
  padding-bottom: var(--sp-3);
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--w-book);
  font-size: var(--size-title);
  line-height: var(--lh-title);
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.pillar-lede {
  margin: 0;
  font-family: var(--font-light);
  font-weight: var(--w-light);
  font-size: var(--size-lede);
  line-height: var(--lh-lede);
  color: var(--text-secondary);
}
.pillar-canvas {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: var(--card-pad);
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pillar-placeholder {
  max-width: 34ch;
  text-align: center;
  font-family: var(--font-light);
  font-weight: var(--w-light);
  font-size: var(--size-body);
  line-height: var(--lh-body);
  color: var(--ink-soft);
}
@media (max-width: 900px) {
  .pillar-shell { grid-template-columns: 1fr; gap: var(--sp-5); min-height: 0; }
  .pillar-rail { overflow: visible; max-height: none; }
  .pillar-title { position: static; }
  .pillar-canvas { min-height: 40vh; }
}

/* ========================================
   OVERVIEW — WELCOME + THE FOUR PILLARS
   Split screen, locked to the viewport. The PAGE never scrolls; the left column scrolls
   inside itself when the copy is long — the same move the pillar shells' left columns make.
   ======================================== */
#tab-overview { overflow: hidden; }   /* the height-locked host for .ov-root (see sizeOverview) */
.ov-root {
  display: grid; grid-template-columns: 38% 62%;   /* left panel ~50% wider (was 25%) */
  min-height: 0; overflow: hidden;              /* height locked by sizeOverview() — no page scroll */
  height: 100%;                                 /* fills #tab-overview (sizeOverview locks that to the viewport) */
  zoom: var(--app-zoom);                        /* big-screen scale-up — DISPLAY-SCALING RULES */
  /* NOTE: the house/pillars diagram is a fixed wide layout, so this page FILLS the width (no cap) —
     capping it would squeeze the pillars. Card/text pages use max-width: var(--app-maxw) instead. */
  background: var(--bg-primary);
}
/* ---------- left: welcome ---------- */
/* No cream — the left panel is the same paper as the rest (Chris). */
.ov-intro { min-height: 0; display: flex; background: var(--bg-primary); }
.ov-intro-inner {
  display: flex; flex-direction: column; min-height: 0; width: 100%;
  padding: var(--sp-6) var(--sp-5) var(--sp-4) var(--rail-offset);
}
/* One line: "Welcome to" + the real logo, centred on the line, never wrapping. */
.ov-welcome {
  flex: 0 0 auto; margin: 0 0 var(--sp-4);
  display: flex; align-items: center; flex-wrap: nowrap; gap: 10px;
  font-family: var(--font-display); line-height: 1.04; letter-spacing: -0.02em;
}
.ov-w-1 { flex: 0 0 auto; font-weight: 500; font-size: clamp(24px, 1.9vw, 34px); color: var(--amber); }
/* the real decodED SVG (graduation hat, green "decod" + amber "ED") sized to sit on the line */
.ov-w-logo {
  flex: 0 1 auto;
  width: clamp(140px, 14vw, 200px); aspect-ratio: 2 / 1;
  background: url('/assets/decoded-logo.svg') no-repeat left center / contain;
}
/* the copy scrolls in here, not the page */
.ov-scroll {
  flex: 1 1 auto; overflow-y: auto; scrollbar-gutter: stable; min-height: 0; padding-right: var(--sp-3);
}
/* The opening paragraph is BODY type, not the display lede (Chris: it was too big and the
   wrong font). Inter, 15/24 — one clear reading size for all the running copy on the left.
   The ONE piece of display emphasis is "decodED is here to fix that": that's the point of
   the paragraph, so it's the only thing that gets the accent treatment. */
.ov-lede {
  font-family: var(--font-detail); font-weight: var(--w-book);
  font-size: 15px; line-height: 24px;
  color: var(--ink); margin: 0 0 var(--sp-3);
}
.ov-fix { margin: 0 0 var(--sp-4); }
.ov-fix strong {
  font-family: var(--font-display); font-weight: 500;
  font-size: 20px; line-height: 27px; color: var(--brand);
}
.ov-explain p {
  font-family: var(--font-detail); font-weight: var(--w-book);
  font-size: 15px; line-height: 24px;
  color: var(--ink); margin: 0 0 var(--sp-3);
}
/* the only inline emphasis in the running copy — "four pillars" — and it's meaningful */
.ov-explain strong { font-weight: 600; color: var(--ink); }
/* The four-pillar list: each row carries its pillar's ICON (same glyph as the temple column)
   in that pillar's colour, the name in the same colour, the description plain. Hovering a row
   lights it AND its column on the right; the whole row is the target. */
.ov-pillar-list { list-style: none; margin: var(--sp-2) 0 var(--sp-3); padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ov-pl-item {
  display: flex; align-items: flex-start; gap: 12px; cursor: pointer;
  padding: 7px 10px; margin: 0 -10px; border-radius: 10px;
  transition: background 0.16s ease;
}
.ov-pl-item:hover, .ov-pl-item.is-lit { background: color-mix(in srgb, var(--ov-li, var(--brand)) 9%, transparent); }
.ov-pl-icon {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ov-li, var(--brand)); background: color-mix(in srgb, var(--ov-li, var(--brand)) 12%, transparent);
}
.ov-pl-icon svg { width: 20px; height: 20px; }
.ov-pl-text {
  flex: 1 1 auto; min-width: 0; align-self: center;
  font-family: var(--font-detail); font-weight: var(--w-book);
  font-size: 14px; line-height: 20px; color: var(--ink);
}
.ov-pl-text b { font-family: var(--font-detail); font-weight: 600; color: var(--ov-li, var(--brand)); }
.ov-ready { font-family: var(--font-display) !important; font-weight: 500; font-size: 17px !important; line-height: 24px !important; color: var(--brand) !important; margin-bottom: 0 !important; }
.ov-ready-sub { font-family: var(--font-detail); font-weight: var(--w-book); font-size: 13px; color: var(--text-tertiary); letter-spacing: 0; }
.ov-foot { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-1); padding-top: var(--sp-3); }
/* Kept deliberately: the ONLY route to Learn's data pages (Brief 202 P4, a link) and the JSON export (a button) now
   the rest of the old Overview has gone. */
.ov-foot-link {
  background: none; border: 0; padding: 0; cursor: pointer; text-align: left; text-decoration: none;
  font-family: var(--font-detail); font-size: 11px; line-height: 16px;
  color: var(--text-tertiary); transition: color 0.18s ease;
}
.ov-foot-link:hover { color: var(--brand); }

/* ---------- right: the stage ---------- */
.ov-stage { position: relative; min-height: 0; overflow: hidden; }
.ov-view { display: none; position: absolute; inset: 0; }
.ov-view.active { display: flex; }

/* ONE floating chip instead of a two-segment pill. The map viewer already has its own
   chrome top-LEFT, so this sits top-RIGHT and can't collide with it. It names the view
   you'd GO to and flips when you arrive — so a glance tells you where the other half is,
   and the map keeps the whole stage. */
.ov-swap {
  position: absolute; z-index: 6; top: var(--sp-4); right: var(--sp-4);
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 9px 16px 9px 12px; border-radius: 999px; cursor: pointer;
  font-family: var(--font-display); font-size: 13px; font-weight: 500;
  color: var(--ink);
  background: rgba(255,255,255,0.92); backdrop-filter: blur(8px);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, #FFFFFF);
  box-shadow: 0 2px 10px rgba(0,0,0,0.10);
  transition: background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}
.ov-swap:hover { color: var(--brand); box-shadow: 0 6px 18px rgba(0,0,0,0.16); }
/* Over the map: needs a heavier shadow to hold against the tiles, and it has to drop below
   the twin's own toolbar — that runs the FULL width of the viewer (Map Viewer · Boundary ·
   Buildings … Liberty · Positron · Bright), so top-right is not actually clear, which only
   showed up in a screenshot. Sitting under it also keeps clear of the twin's search box,
   which is top-LEFT, and its zoom controls, bottom-right. */
.ov-stage.is-map .ov-swap { top: 60px; box-shadow: 0 4px 16px rgba(0,0,0,0.28); }
.ov-swap-ico { width: 16px; height: 16px; flex: none; background: currentColor; }
/* the icon shows the DESTINATION: a map when you're on the pillars, columns when you're on the map */
.ov-swap[data-goto="map"] .ov-swap-ico {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 3 3 5.5v15L9 18l6 3 6-2.5v-15L15 6z'/%3E%3Cpath d='M9 3v15M15 6v15'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 3 3 5.5v15L9 18l6 3 6-2.5v-15L15 6z'/%3E%3Cpath d='M9 3v15M15 6v15'/%3E%3C/svg%3E") no-repeat center / contain;
}
.ov-swap[data-goto="pillars"] .ov-swap-ico {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='4' height='16' rx='1'/%3E%3Crect x='10' y='4' width='4' height='16' rx='1'/%3E%3Crect x='17' y='4' width='4' height='16' rx='1'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='4' height='16' rx='1'/%3E%3Crect x='10' y='4' width='4' height='16' rx='1'/%3E%3Crect x='17' y='4' width='4' height='16' rx='1'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ---------- map view: FULL BLEED, the whole stage ---------- */
.ov-view-map { flex-direction: column; padding: 0; }
.ov-view-map .map-container { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; overflow: hidden; }
/* The restore-failure notice sits on #ovStage (which hosts BOTH views), so it shows on
   pillars or map. The views are absolute/inset-0, so it must ride over them. */
.ov-stage > .site-restore-warn {
  position: absolute; z-index: 6; left: var(--sp-4); right: var(--sp-4); bottom: var(--sp-4);
  margin-top: 0; backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.16);
}

/* ---------- pillar view: the four columns read as a building ---------- */
.ov-view-pillars { align-items: center; justify-content: center; padding: var(--sp-5) var(--sp-4); }
/* The temple sizes to the pillar grid; the roof and base overhang it, the way a pediment and
   stylobate sit proud of the columns. Thin ink line-art — all the colour is in the columns. */
.ov-temple { display: flex; flex-direction: column; align-items: center; width: fit-content; max-width: 100%; color: var(--ink-soft); }
.ov-roof { position: relative; width: calc(100% + 44px); height: 116px; margin-bottom: 2px; }
.ov-roof-svg { width: 100%; height: 100%; display: block; }
/* the school's name in an emblem in the pediment — a nameplate, centred */
.ov-emblem { position: absolute; left: 50%; top: 62%; transform: translate(-50%, -50%); width: 60%; max-width: 320px; display: flex; justify-content: center; }
.ov-emblem span {
  display: inline-block; text-align: center;
  padding: 6px 20px; border-radius: 999px;
  background: var(--bg-primary); border: 1.5px solid currentColor;
  font-family: var(--font-display); font-weight: 500; font-size: 15px; line-height: 1.25; color: var(--ink);
}
/* stepped base (stylobate) — two thin bars, the lower one wider, echoing the reference */
.ov-base { display: flex; flex-direction: column; align-items: center; width: calc(100% + 32px); margin-top: 8px; gap: 5px; }
.ov-base span { height: 8px; border-radius: 2px; background: currentColor; opacity: 0.7; }
.ov-base span:nth-child(1) { width: 92%; }
.ov-base span:nth-child(2) { width: calc(100% + 30px); }
/* MASSIVE columns — the temple is the hero of the page (Chris). */
.ov-pillars {
  display: grid; grid-template-columns: repeat(4, clamp(140px, 11vw, 200px));
  gap: clamp(30px, 3.6vw, 64px);
  justify-content: center; align-items: stretch;
  height: min(60vh, 520px);
}
.ov-pillar {
  position: relative; display: flex; flex-direction: column;
  border: 0; padding: 0; cursor: pointer; text-align: left;
  background: var(--ov-a); color: #FFFFFF;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  /* Movement lives HERE and nowhere else. It used to be split between this transition and a
     `forwards` entrance that ALSO wrote `transform` — so the first hover fought the
     animation's held end-state, and you got the jitter. The entrance now animates opacity
     only, leaving transform to the hover alone: one property, one owner, no contention.
     Long, soft, gently overshooting curve = floaty rather than twitchy. */
  transform: translateY(0) scale(1);
  transition: transform 0.65s cubic-bezier(.22,1,.36,1), box-shadow 0.65s cubic-bezier(.22,1,.36,1);
  will-change: transform;
}
.ov-pillar:hover, .ov-pillar:focus-visible, .ov-pillar.is-lit {
  transform: translateY(-10px) scale(1.015);
  box-shadow: 0 22px 50px rgba(0,0,0,0.18);
}
/* lit from the list hover: a bright ring in the pillar's own colour so the link is obvious */
.ov-pillar.is-lit { outline: 3px solid color-mix(in srgb, var(--ov-a) 55%, #FFFFFF); outline-offset: 3px; }
.ov-pillar:active { transform: translateY(-4px) scale(1.005); transition-duration: 0.18s; }
.ov-pillar:focus-visible { outline: 3px solid var(--ov-a); outline-offset: 3px; }
.ov-pillar-cap, .ov-pillar-base { flex: 0 0 auto; height: 10px; background: rgba(255,255,255,0.16); }
.ov-pillar-body { flex: 1 1 auto; display: flex; flex-direction: column; padding: var(--sp-4) var(--sp-4); gap: 8px; }
.ov-metric { display: flex; flex-direction: column; gap: 2px; margin-bottom: var(--sp-3); }
.ov-metric-v {
  font-family: var(--font-display); font-weight: var(--w-book);
  font-size: clamp(32px, 2.6vw, 48px); line-height: 1.02; letter-spacing: -0.02em;
}
.ov-metric-u { font-family: var(--font-detail); font-size: 12px; line-height: 16px; color: rgba(255,255,255,0.82); }
.ov-pillar-icon { margin-top: auto; opacity: 0.92; }
.ov-pillar-icon svg { width: 52px; height: 52px; }   /* massive, per Chris */
.ov-pillar-name { font-family: var(--font-display); font-weight: var(--w-book); font-size: 20px; line-height: 25px; }
.ov-pillar-blurb { font-family: var(--font-detail); font-size: 12px; line-height: 17px; color: rgba(255,255,255,0.86); }
.ov-pillar-cap-note { font-family: var(--font-detail); font-size: 11px; line-height: 15px; color: rgba(255,255,255,0.6); margin-top: 3px; }

/* Entrance = TWO animations, and the split is what lets them MOVE in without the old jitter:
   · ovFade — opacity 0→1, `forwards`, so the pillar STAYS visible after. It's opacity-only,
     so holding its end-state can't touch the hover.
   · ovRise — translate + scale, NO fill-mode, so when it finishes it RELEASES back to the
     base `transform` and the hover takes over cleanly. (A `forwards` transform is exactly
     what deadlocked the first hover before — so this one deliberately doesn't hold.)
   One at a time, ~0.25s apart, slower, with a soft overshoot so each one rises and then
   settles onto its spot rather than snapping. Hover during the ~0.8s entrance is briefly
   suppressed — a fine trade for the landing. */
.ov-pillar {
  opacity: 0;
  animation: ovFade 0.5s ease forwards, ovRise 0.8s cubic-bezier(.34,1.12,.64,1);
}
.ov-pillar:nth-child(1) { animation-delay: 0.15s; }
.ov-pillar:nth-child(2) { animation-delay: 0.40s; }
.ov-pillar:nth-child(3) { animation-delay: 0.65s; }
.ov-pillar:nth-child(4) { animation-delay: 0.90s; }
@keyframes ovFade { to { opacity: 1; } }
@keyframes ovRise { from { transform: translateY(38px) scale(0.96); } to { transform: translateY(0) scale(1); } }

@media (max-width: 1100px) {
  .ov-root { grid-template-columns: 1fr; overflow: auto; scrollbar-gutter: stable; }
  .ov-stage { min-height: 70vh; }
  .ov-pillars { grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); height: auto; }
}
@media (max-width: 560px) {
  .ov-pillars { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .ov-pillar { opacity: 1 !important; animation: none !important; transition: none !important; }
  .ov-pillar:hover { transform: none !important; }
}

/* Brief 175 P3: the skip link, first in <body> (index.html). Off-screen until it has keyboard focus, then a green pill
   over the top bar: white on the brand green 8.5:1; the ring is white inside green, so one of its edges is ≥ 3:1 on
   any ground (white on the forest landing 14.5:1, green on the bar's white 8.5:1). Nothing else about the page moves. */
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 100001;
  padding: 10px 16px; border-radius: 999px;
  background: var(--green); color: #FFFFFF;
  font-family: var(--font-body); font-size: 15px; font-weight: 600; line-height: 1.2; text-decoration: none;
  transform: translateY(-200%); opacity: 0;
}
.skip-link:focus-visible, .skip-link:focus {
  transform: none; opacity: 1;
  outline: none; box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 5px var(--green);
}
