/* =============================================================================
   Kahu Ola — Civic Design System  v4.3.1
   Material 3-Inspired · Light Edition · Kupuna-First
   =============================================================================
   §1  Design tokens
   §2  Reset + base
   §3  Typography helpers
   §4  Layout (container, grid, section)
   §5  Navigation + header
   §6  Buttons (4 variants + sizes)
   §7  Chips + badges
   §8  Cards (standard, tile, callout, glass)
   §9  Hero  (index.html)
   §10 Section blocks (index.html: roadmap, compliance)
   §11 Footer
   §12 Live-map panel shell
   §13 Live-map tabs
   §14 Live-map layer rows
   §15 Live-map status chips
   §16 Data Freshness card
   §17 Legend
   §18 KV table (diagnostics + config)
   §19 Source links
   §20 Kupuna advisory
   §21 Policy + disclosure blocks
   §22 Animation
   §23 Accessibility overrides
   §24 Responsive
   ============================================================================= */


/* ═════════════════════════════════════════════════════════════════════════════
   §1  DESIGN TOKENS  (single source of truth for all pages)
   ═════════════════════════════════════════════════════════════════════════════ */
:root {
  color-scheme: light;

  /* Fonts */
  --font:      "DM Sans", ui-sans-serif, system-ui, -apple-system,
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "Cascadia Code",
               "SFMono-Regular", Menlo, monospace;

  /* Kupuna type scale — 18px body floor, never below 14px for readable content */
  --t-2xs:  12px;
  --t-xs:   13px;
  --t-sm:   14px;
  --t-md:   16px;
  --t-body: 18px;   /* ← Kupuna body floor */
  --t-lg:   20px;
  --t-xl:   24px;
  --t-2xl:  28px;
  --t-3xl:  32px;
  --t-hero: clamp(34px, 4.2vw, 56px);
  --lh:     1.75;

  /* Interactive target — minimum 48px, never less */
  --tap: 48px;

  /* Spacing (4-point grid) */
  --s1: 4px;   --s2: 8px;   --s3: 12px;  --s4: 16px;
  --s5: 20px;  --s6: 24px;  --s7: 32px;  --s8: 40px;
  --s9: 56px;  --s10: 80px;

  /* Radius */
  --r-xs:  6px;
  --r-sm:  10px;
  --r:     14px;
  --r-lg:  20px;
  --r-xl:  28px;
  --r-pill: 9999px;

  /* Surfaces — bright, calm, high trust */
  --bg:        #f5f7fb;
  --bg-alt:    #edf0f7;
  --surface:   #ffffff;
  --surface-2: #f2f4f8;
  --surface-3: #e8ebf2;

  /* Text */
  --text:     #0c1220;   /* near-black — passes AAA at all sizes */
  --muted:    #3f526a;   /* passes AA at 18px+ */
  --subtle:   #60718a;
  --disabled: #99a8be;

  /* Borders */
  --b:      rgba(12, 18, 32, 0.09);
  --b-md:   rgba(12, 18, 32, 0.14);
  --b-lg:   rgba(12, 18, 32, 0.20);
  --b-focus: rgba(37, 99, 235, 0.55);

  /* Brand — civic blue */
  --blue:    #2563eb;
  --blue-dk: #1d4ed8;
  --blue-lt: #3b82f6;
  --blue-bg: rgba(37, 99, 235, 0.09);
  --blue-bd: rgba(37, 99, 235, 0.28);

  /* Accent — civic teal */
  --teal:    #0284c7;
  --teal-dk: #0369a1;
  --teal-bg: rgba(2, 132, 199, 0.09);
  --teal-bd: rgba(2, 132, 199, 0.28);

  /* Status: green / FRESH */
  --green:    #15803d;
  --green-bg: #f0fdf4;
  --green-bd: rgba(21, 128, 61, 0.28);

  /* Status: amber / STALE */
  --amber:    #b45309;
  --amber-bg: #fffbeb;
  --amber-bd: rgba(180, 83, 9, 0.28);

  /* Status: red / OUTDATED */
  --red:    #c62828;
  --red-bg: #fef2f2;
  --red-bd: rgba(198, 40, 40, 0.28);

  /* Status: orange / WARNING */
  --orange:    #c2410c;
  --orange-bg: #fff7ed;
  --orange-bd: rgba(194, 65, 12, 0.22);

  /* Shadows */
  --sh-xs: 0 1px 3px rgba(12, 18, 32, 0.06);
  --sh-sm: 0 2px 8px  rgba(12, 18, 32, 0.07), 0 1px 2px rgba(12, 18, 32, 0.04);
  --sh-md: 0 4px 18px rgba(12, 18, 32, 0.08), 0 1px 4px rgba(12, 18, 32, 0.05);
  --sh-lg: 0 8px 36px rgba(12, 18, 32, 0.11), 0 2px 8px rgba(12, 18, 32, 0.06);
  --sh-xl: 0 16px 56px rgba(12, 18, 32, 0.13), 0 4px 16px rgba(12, 18, 32, 0.07);

  /* Transitions */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur:  160ms;
  --tr:   var(--dur) var(--ease);

  /* Layout */
  --w-content: 76rem;
  --w-wide:    92rem;
  --w-prose:   68ch;

  /* Live-map */
  --panel-w: 420px;
  --legal-h: 36px;
}


/* ═════════════════════════════════════════════════════════════════════════════
   §2  RESET + BASE
   ═════════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: var(--lh);
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  min-width: 320px;
}

img, video, svg { max-width: 100%; display: block; }

a {
  color: var(--teal);
  text-decoration: none;
  transition: color var(--tr);
}
a:hover { text-decoration: underline; color: var(--teal-dk); }

button, input, select, textarea { font-family: var(--font); }

code, pre, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

:focus-visible {
  outline: 3px solid var(--b-focus);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

::selection { background: rgba(37, 99, 235, 0.16); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

.site-shell { min-height: 100vh; display: flex; flex-direction: column; }


/* ═════════════════════════════════════════════════════════════════════════════
   §3  TYPOGRAPHY HELPERS
   ═════════════════════════════════════════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--text);
}

p { margin: 0; }
p + p { margin-top: var(--s4); }

ul, ol {
  padding-left: 1.4em;
  margin: var(--s3) 0 0;
  color: var(--muted);
}
li { margin-bottom: var(--s2); font-size: var(--t-body); }

.kicker {
  display: block;
  font-size: var(--t-2xs);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--s3);
}
.kicker--blue { color: var(--blue); }

.lead {
  font-size: var(--t-lg);
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

/* Utilities */
.text-muted   { color: var(--muted); }
.text-subtle  { color: var(--subtle); }
.text-primary { color: var(--blue); }
.text-teal    { color: var(--teal); }
.text-sm      { font-size: var(--t-sm); }
.text-md      { font-size: var(--t-md); }
.text-mono    { font-family: var(--font-mono); }
.fw-700       { font-weight: 700; }
.fw-800       { font-weight: 800; }

/* Short-form aliases used by live-map components */
.muted  { color: var(--muted); }
.subtle { color: var(--subtle); }

.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;
}


/* ═════════════════════════════════════════════════════════════════════════════
   §4  LAYOUT
   ═════════════════════════════════════════════════════════════════════════════ */
.container       { width: min(100% - 2.5rem, var(--w-content)); margin-inline: auto; }
.container--wide { width: min(100% - 2.5rem, var(--w-wide));    margin-inline: auto; }
.container--prose{ width: min(100% - 2.5rem, var(--w-prose));   margin-inline: auto; }

.section      { padding: var(--s9) 0; }
.section--sm  { padding: var(--s7) 0; }
.section--lg  { padding: var(--s10) 0; }

.section-head {
  display: grid;
  gap: var(--s3);
  margin-bottom: var(--s7);
}

.section-label {
  font-size: var(--t-sm);
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--subtle);
  margin: 0;
}

.section-title {
  font-size: clamp(var(--t-2xl), 3vw, var(--t-3xl));
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.02em;
}

/* Grids */
.grid      { display: grid; gap: var(--s5); }
.grid--2   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3   { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4   { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--auto{ grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.flex         { display: flex; }
.flex--center { display: flex; align-items: center; }
.flex--between{ display: flex; align-items: center; justify-content: space-between; }
.flex--wrap   { flex-wrap: wrap; }
.gap-2 { gap: var(--s2); }
.gap-3 { gap: var(--s3); }
.gap-4 { gap: var(--s4); }
.gap-5 { gap: var(--s5); }

.spacer    { height: var(--s5); }
.spacer-sm { height: var(--s3); }
.spacer-lg { height: var(--s7); }

.hr { border: none; border-top: 1px solid var(--b); margin: var(--s6) 0; }


/* ═════════════════════════════════════════════════════════════════════════════
   §5  NAVIGATION + HEADER
   ═════════════════════════════════════════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--b);
  box-shadow: var(--sh-xs);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s5);
  padding: var(--s3) 0;
  min-height: var(--tap);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  text-decoration: none;
  color: var(--text);
  min-height: var(--tap);
  border-radius: var(--r);
  padding: 2px 6px;
  transition: background var(--tr);
}
.brand:hover { text-decoration: none; background: var(--surface-2); }

.brand-mark {
  width: 42px; height: 42px;
  border-radius: var(--r-sm);
  background: var(--blue);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.22);
}
.brand-mark svg { width: 26px; height: 26px; }

.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-size: var(--t-md); font-weight: 800; line-height: 1.1; color: var(--text); }
.brand-copy span   { font-size: var(--t-xs); color: var(--subtle); line-height: 1.1; }

.nav-stack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s4);
  justify-content: flex-end;
}

.nav-links,
.nav-utilities {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  padding: 0; margin: 0;
  align-items: center;
}

.nav-links a,
.nav-utilities a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 var(--s3);
  border-radius: var(--r-pill);
  font-size: var(--t-md);
  font-weight: 700;
  color: var(--muted);
  border: 1px solid transparent;
  transition: background var(--tr), border-color var(--tr), color var(--tr);
}
.nav-links a:hover,
.nav-utilities a:hover {
  background: var(--surface-2);
  border-color: var(--b-md);
  color: var(--text);
  text-decoration: none;
}
.nav-links a[aria-current="page"] {
  background: var(--blue-bg);
  border-color: var(--blue-bd);
  color: var(--blue-dk);
}

.nav-divider { width: 1px; height: 22px; background: var(--b-md); flex-shrink: 0; }

@media (max-width: 860px) {
  .site-nav  { align-items: flex-start; flex-wrap: wrap; }
  .nav-stack { justify-content: flex-start; }
  .nav-divider { display: none; }
}


/* ═════════════════════════════════════════════════════════════════════════════
   §6  BUTTONS  (all ≥ 48px, clear label, distinct from surrounding text)
   ═════════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s3);
  min-height: var(--tap);
  padding: 0 22px;
  border-radius: var(--r-pill);
  font-family: var(--font);
  font-size: var(--t-md);
  font-weight: 800;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  white-space: nowrap;
  user-select: none;
  transition: background var(--tr), border-color var(--tr),
              box-shadow var(--tr), transform var(--tr), color var(--tr);
}
.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* Primary */
.btn--primary {
  background: var(--blue);
  color: #fff;
  border-color: rgba(29, 78, 216, 0.35);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.22);
}
.btn--primary:hover { background: var(--blue-dk); box-shadow: 0 6px 18px rgba(37, 99, 235, 0.30); }

/* Secondary */
.btn--secondary {
  background: var(--surface);
  color: var(--blue-dk);
  border-color: var(--blue-bd);
}
.btn--secondary:hover { background: var(--blue-bg); border-color: var(--blue); box-shadow: var(--sh-sm); }

/* Ghost */
.btn--ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--b-md);
}
.btn--ghost:hover { background: var(--surface-2); border-color: var(--b-lg); color: var(--text); }

/* Teal (map/data actions) */
.btn--teal {
  background: var(--teal);
  color: #fff;
  border-color: rgba(2, 105, 161, 0.35);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.22);
}
.btn--teal:hover { background: var(--teal-dk); box-shadow: 0 6px 18px rgba(2, 132, 199, 0.28); }

/* Sizes */
.btn--sm { min-height: 38px; padding: 0 14px; font-size: var(--t-sm); }
.btn--lg { min-height: 56px; padding: 0 28px; font-size: var(--t-body); }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }

/* Backward-compat aliases */
/* .button: use .btn class directly */
.button { display: inline-flex; align-items: center; justify-content: center; gap: var(--s3); min-height: var(--tap); padding: 0 22px; border-radius: var(--r-pill); font-family: var(--font); font-size: var(--t-md); font-weight: 800; letter-spacing: 0.01em; border: 1px solid transparent; cursor: pointer; text-decoration: none !important; white-space: nowrap; user-select: none; transition: background var(--tr), border-color var(--tr), box-shadow var(--tr), transform var(--tr), color var(--tr); }


/* ═════════════════════════════════════════════════════════════════════════════
   §7  CHIPS + BADGES
   ═════════════════════════════════════════════════════════════════════════════ */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--b-md);
  background: var(--surface-2);
  font-size: var(--t-sm);
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  cursor: default;
}

.chip--live     { background: var(--green-bg); border-color: var(--green-bd); color: var(--green);    }
.chip--stale    { background: var(--amber-bg); border-color: var(--amber-bd); color: var(--amber);    }
.chip--outdated { background: var(--red-bg);   border-color: var(--red-bd);   color: var(--red);      }
.chip--warn     { background: var(--orange-bg);border-color: var(--orange-bd);color: var(--orange);   }
.chip--blue     { background: var(--blue-bg);  border-color: var(--blue-bd);  color: var(--blue-dk);  }
.chip--teal     { background: var(--teal-bg);  border-color: var(--teal-bd);  color: var(--teal-dk);  }
.chip--off      { background: var(--surface-2);border-color: var(--b);        color: var(--subtle);   font-style: italic; }
.chip--unknown  { background: var(--surface-2);border-color: var(--b);        color: var(--subtle);   }

/* Panel status chip (compact, monospace) */
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 2px 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--b);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  font-weight: 700;
  color: var(--subtle);
  white-space: nowrap;
  flex-shrink: 0;
}
.status-chip.chip--live    { background: var(--green-bg); border-color: var(--green-bd); color: var(--green);  }
.status-chip.chip--error   { background: var(--amber-bg); border-color: var(--amber-bd); color: var(--amber);  }
.status-chip.chip-live     { background: var(--green-bg); border-color: var(--green-bd); color: var(--green);  }
.status-chip.chip-error    { background: var(--amber-bg); border-color: var(--amber-bd); color: var(--amber);  }
.status-chip.chip-unknown  { color: var(--subtle); }
.status-chip.chip-off      { color: var(--disabled); font-style: italic; }

.chip-row { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }


/* ═════════════════════════════════════════════════════════════════════════════
   §8  CARDS
   ═════════════════════════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--b);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  padding: var(--s6);
}

.card--sm {
  padding: var(--s4) var(--s5);
  border-radius: var(--r);
}

.card-eyebrow {
  font-size: var(--t-2xs);
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: var(--s3);
}

/* live-map panel card title (was .card-title) */
.card-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: var(--s3);
}

/* index.html card heading */
.card h2,
.card-heading {
  font-size: var(--t-xl);
  letter-spacing: -0.01em;
  margin: 0 0 var(--s4);
  line-height: 1.22;
}

.tile {
  background: var(--surface);
  border: 1px solid var(--b);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  padding: var(--s6);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  transition: box-shadow var(--tr), border-color var(--tr), transform var(--tr);
}
.tile:hover { box-shadow: var(--sh-md); border-color: var(--b-md); transform: translateY(-2px); }

.tile-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  font-size: 22px;
  background: var(--surface-2);
  border: 1px solid var(--b);
}

.tile h3 { font-size: var(--t-xl); letter-spacing: -0.01em; margin: 0; }
.tile p  { font-size: var(--t-body); color: var(--muted); line-height: var(--lh); margin: 0; }

.callout {
  background: linear-gradient(175deg, var(--surface), var(--surface-2) 90%);
  border: 1px solid var(--b-md);
  border-radius: var(--r-lg);
  padding: var(--s6);
}

.glass {
  background: rgba(255, 255, 255, 0.90);
  border: 1px solid var(--b-md);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}


/* ═════════════════════════════════════════════════════════════════════════════
   §9  HERO  (index.html)
   ═════════════════════════════════════════════════════════════════════════════ */
.hero {
  padding: calc(var(--s9) + var(--s5)) 0 var(--s9);
  background: linear-gradient(170deg, #ffffff 0%, var(--bg) 55%, #eff4fc 100%);
  border-bottom: 1px solid var(--b);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s8);
  align-items: center;
  position: relative;
}

.hero-kicker {
  font-size: var(--t-sm);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 var(--s4) 0;
}

.hero-title {
  font-size: var(--t-hero);
  line-height: 1.04;
  margin: 0;
  letter-spacing: -0.03em;
}

.hero-subhead {
  font-size: var(--t-2xl);
  color: var(--muted);
  margin: var(--s3) 0 var(--s5) 0;
  font-weight: 400;
  line-height: 1.35;
}

.hero-note {
  font-size: var(--t-body);
  color: var(--muted);
  margin: 0 0 var(--s6) 0;
  max-width: var(--w-prose);
  line-height: var(--lh);
}

.hero-art     { padding: var(--s6); }
.hero-caption { margin: var(--s4) 0 0; font-size: var(--t-md); color: var(--subtle); text-align: center; }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art  { display: none; }
}


/* ═════════════════════════════════════════════════════════════════════════════
   §10 SECTION BLOCKS  (index.html)
   ═════════════════════════════════════════════════════════════════════════════ */
.phase-stack  { display: grid; gap: var(--s6); }
.phase-group  { display: grid; gap: var(--s4); }

.phase-label {
  font-size: var(--t-sm);
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--subtle);
}

.phase-title { font-size: var(--t-xl); margin: 0; letter-spacing: -0.01em; }

.phase-desc  { margin: 0; color: var(--muted); font-size: var(--t-body); line-height: var(--lh); }

.about-grid      { display: grid; gap: var(--s6); }
.compliance-grid { display: grid; gap: var(--s5); }

.disclaimer,
.disclaimer-block {
  font-size: var(--t-md);
  color: var(--subtle);
  line-height: var(--lh);
}


/* ═════════════════════════════════════════════════════════════════════════════
   §11 FOOTER
   ═════════════════════════════════════════════════════════════════════════════ */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--b);
  background: #ffffff;
}

.footer-inner {
  padding: var(--s7) 0;
  display: grid;
  gap: var(--s6);
}

.footer-copy { display: grid; gap: var(--s2); }
.footer-copy strong { font-size: var(--t-md); font-weight: 800; color: var(--text); }
.footer-copy small  { font-size: var(--t-sm); color: var(--subtle); line-height: 1.65; display: block; }

.footer-links {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 var(--s3);
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-size: var(--t-md);
  font-weight: 700;
  color: var(--muted);
  transition: background var(--tr), border-color var(--tr), color var(--tr);
}
.footer-links a:hover { background: var(--surface-2); border-color: var(--b-md); color: var(--text); text-decoration: none; }

.footer-legal { font-size: var(--t-sm); color: var(--subtle); line-height: 1.65; }


/* ═════════════════════════════════════════════════════════════════════════════
   §12 LIVE-MAP — PANEL SHELL
   ═════════════════════════════════════════════════════════════════════════════ */
#map {
  position: fixed;
  top: var(--legal-h);
  left: 0;
  right: var(--panel-w);
  bottom: 0;
  z-index: 1;
}

.legal-bar {
  position: fixed;
  top: 0; left: 0;
  right: var(--panel-w);
  z-index: 80;
  height: var(--legal-h);
  background: var(--amber-bg);
  border-bottom: 1px solid var(--amber-bd);
  padding: 0 var(--s4);
  font-size: var(--t-xs);
  font-weight: 700;
  color: var(--amber);
  display: flex;
  align-items: center;
  gap: var(--s3);
}
.legal-bar a { color: var(--amber); font-weight: 800; text-decoration: underline; }
.legal-bar a:last-child { margin-left: auto; color: var(--muted); text-decoration: none; font-weight: 700; }
.legal-bar a:last-child:hover { text-decoration: underline; }

.panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: var(--panel-w);
  background: var(--surface);
  border-left: 1px solid var(--b-md);
  box-shadow: var(--sh-xl);
  z-index: 70;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: var(--s4) var(--s4) 0;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--b);
}

.panel-back {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 36px;
  padding: 4px var(--s3) 4px var(--s2);
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-size: var(--t-sm);
  font-weight: 700;
  color: var(--muted);
  margin-bottom: var(--s3);
  transition: background var(--tr), border-color var(--tr), color var(--tr);
}
.panel-back:hover { background: var(--surface-2); border-color: var(--b-md); color: var(--text); text-decoration: none; }

.panel-brand {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s4);
}

.panel-brand-mark {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  background: var(--blue);
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.22);
}

.panel-brand-copy strong { display: block; font-size: 17px; font-weight: 800; color: var(--text); }
.panel-brand-copy span   { font-size: var(--t-2xs); color: var(--subtle); font-family: var(--font-mono); }

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--s4);
  scrollbar-width: thin;
  scrollbar-color: var(--b-md) transparent;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}
.panel-body::-webkit-scrollbar       { width: 4px; }
.panel-body::-webkit-scrollbar-track { background: transparent; }
.panel-body::-webkit-scrollbar-thumb { background: var(--b-md); border-radius: 4px; }

/* Cards inside panel get compact padding */
.panel-body .card { padding: var(--s4) var(--s4); border-radius: var(--r); margin-bottom: 0; }

.panel-footer {
  padding: var(--s3) var(--s4);
  border-top: 1px solid var(--b);
  font-size: var(--t-xs);
  color: var(--subtle);
  flex-shrink: 0;
  background: var(--surface-2);
  line-height: 1.6;
}

.mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--b);
  flex-shrink: 0;
  background: var(--surface-2);
}
.mode-label { font-size: var(--t-sm); font-weight: 700; color: var(--muted); }
.mode-btns  { display: flex; gap: var(--s2); }

.mode-btn {
  min-height: 36px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--b-md);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font);
  font-size: var(--t-xs);
  font-weight: 800;
  cursor: pointer;
  transition: background var(--tr), border-color var(--tr), color var(--tr), box-shadow var(--tr);
}
.mode-btn:hover { background: var(--surface-3); color: var(--text); }
.mode-btn.active,
.mode-btn[aria-pressed="true"] {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}


/* ═════════════════════════════════════════════════════════════════════════════
   §13 LIVE-MAP — TABS
   ═════════════════════════════════════════════════════════════════════════════ */
.tabs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--s1);
  padding: 0 var(--s3) var(--s3);
  flex-shrink: 0;
}

.tab {
  height: 40px;
  border-radius: var(--r-sm);
  border: 1px solid var(--b);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--tr), border-color var(--tr), color var(--tr);
}
.tab:hover { background: var(--surface-2); border-color: var(--b-md); color: var(--text); }
.tab[aria-selected="true"] {
  background: var(--blue-bg);
  border-color: var(--blue-bd);
  color: var(--blue-dk);
}


/* ═════════════════════════════════════════════════════════════════════════════
   §14 LIVE-MAP — LAYER ROWS
   ═════════════════════════════════════════════════════════════════════════════ */
.layer-row {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  min-height: var(--tap);
  padding: var(--s3) var(--s2);
  border-bottom: 1px solid var(--b);
  cursor: pointer;
  border-radius: var(--r-xs);
  transition: background var(--tr);
}
.layer-row:hover { background: var(--surface-2); }
.layer-row:last-child { border-bottom: none; }

.layer-row input[type="checkbox"] {
  width: 20px; height: 20px;
  margin-top: 3px;
  accent-color: var(--blue);
  flex-shrink: 0;
  cursor: pointer;
}

.layer-info { flex: 1; min-width: 0; }
.layer-name { font-size: var(--t-md); font-weight: 700; color: var(--text); line-height: 1.3; }
.layer-meta { font-size: var(--t-sm); color: var(--muted); margin-top: 3px; line-height: 1.5; }

.placeholder {
  font-size: var(--t-body);
  color: var(--muted);
  line-height: var(--lh);
  padding: var(--s2) 0;
}
.placeholder em {
  display: block;
  margin-top: var(--s3);
  font-style: normal;
  font-size: var(--t-sm);
  color: var(--subtle);
  background: var(--surface-2);
  border: 1px solid var(--b);
  border-radius: var(--r-xs);
  padding: var(--s2) var(--s3);
}


/* ═════════════════════════════════════════════════════════════════════════════
   §15 LIVE-MAP — STATUS CHIPS  (wired to JS setChip() state names)
   ═════════════════════════════════════════════════════════════════════════════ */
.chip-live    { background: var(--green-bg); border-color: var(--green-bd); color: var(--green);  }
.chip-error   { background: var(--amber-bg); border-color: var(--amber-bd); color: var(--amber);  }
.chip-unknown { background: var(--surface-2);border-color: var(--b);        color: var(--subtle); }
.chip-off     { background: var(--surface-2);border-color: var(--b);        color: var(--disabled); font-style: italic; }


/* ═════════════════════════════════════════════════════════════════════════════
   §16 DATA FRESHNESS CARD
   ═════════════════════════════════════════════════════════════════════════════ */
.freshness-banner {
  border-radius: var(--r-sm);
  border: 1px solid var(--b);
  padding: var(--s3) var(--s4);
  font-size: var(--t-md);
  font-weight: 800;
  line-height: 1.4;
  display: none;        /* JS sets display:block */
  margin-bottom: var(--s4);
}

/* Class-based (live-map.html JS uses className = 'freshness-banner fresh') */
.freshness-banner.fresh    { background: var(--green-bg); border-color: var(--green-bd); color: var(--green);  display: block; }
.freshness-banner.stale    { background: var(--amber-bg); border-color: var(--amber-bd); color: var(--amber);  display: block; }
.freshness-banner.outdated { background: var(--red-bg);   border-color: var(--red-bd);   color: var(--red);    display: block; }

/* Attribute-based alternative */
.freshness-banner[data-state="fresh"]    { background: var(--green-bg); border-color: var(--green-bd); color: var(--green);  display: block; }
.freshness-banner[data-state="stale"]    { background: var(--amber-bg); border-color: var(--amber-bd); color: var(--amber);  display: block; }
.freshness-banner[data-state="outdated"] { background: var(--red-bg);   border-color: var(--red-bd);   color: var(--red);    display: block; }

.verify-link { margin-top: var(--s3); font-size: var(--t-sm); color: var(--muted); }
.verify-link a { font-weight: 800; color: var(--blue); }
.verify-link a:hover { color: var(--blue-dk); }


/* ═════════════════════════════════════════════════════════════════════════════
   §17 LEGEND
   ═════════════════════════════════════════════════════════════════════════════ */
.legend-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 4px 0;
  font-size: var(--t-md);
  color: var(--text);
}

.swatch {
  width: 16px; height: 16px;
  border-radius: var(--r-xs);
  border: 1px solid var(--b-md);
  flex-shrink: 0;
}

.legend-empty { font-size: var(--t-md); color: var(--subtle); font-style: italic; }


/* ═════════════════════════════════════════════════════════════════════════════
   §18 KV TABLE
   ═════════════════════════════════════════════════════════════════════════════ */
.kv {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 9px 14px;
  align-items: start;
  font-size: var(--t-md);
}
.kv .k { color: var(--subtle);  font-weight: 700; line-height: 1.4; }
.kv .v { color: var(--text); font-family: var(--font-mono); font-size: var(--t-sm); font-weight: 600; word-break: break-all; line-height: 1.4; }


/* ═════════════════════════════════════════════════════════════════════════════
   §19 SOURCE LINKS
   ═════════════════════════════════════════════════════════════════════════════ */
.source-links { display: flex; flex-wrap: wrap; gap: var(--s2); }

.source-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--b-md);
  background: var(--surface-2);
  font-size: var(--t-sm);
  font-weight: 800;
  color: var(--text);
  transition: background var(--tr), border-color var(--tr), box-shadow var(--tr);
}
.source-link:hover { background: var(--surface-3); border-color: var(--b-lg); text-decoration: none; box-shadow: var(--sh-xs); }


/* ═════════════════════════════════════════════════════════════════════════════
   §20 KUPUNA ADVISORY
   ═════════════════════════════════════════════════════════════════════════════ */
.kupuna-advisory {
  padding: var(--s3) var(--s4);
  border-radius: var(--r-sm);
  background: var(--orange-bg);
  border: 1px solid var(--orange-bd);
  font-size: var(--t-md);
  font-weight: 700;
  color: #7c2d12;
  line-height: 1.6;
  margin-top: var(--s3);
}


/* ═════════════════════════════════════════════════════════════════════════════
   §21 POLICY + DISCLOSURE BLOCKS
   ═════════════════════════════════════════════════════════════════════════════ */
.policy-card {
  background: var(--surface);
  border: 1px solid var(--b);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  padding: var(--s6);
  display: grid;
  gap: var(--s4);
}
.policy-card h2 { font-size: var(--t-2xl); margin: 0; letter-spacing: -0.015em; }
.policy-card p  { color: var(--muted); font-size: var(--t-body); line-height: var(--lh); margin: 0; }

.disclaimer-block {
  font-size: var(--t-md);
  color: var(--subtle);
  line-height: var(--lh);
  padding: var(--s4);
  background: var(--surface-2);
  border: 1px solid var(--b);
  border-radius: var(--r);
}

.map-wrap { border: 1px solid var(--b-md); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-md); }

/* Leaflet overrides — light theme */
.leaflet-popup-content-wrapper {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--b-md) !important;
  border-radius: var(--r) !important;
  box-shadow: var(--sh-lg) !important;
  font-family: var(--font) !important;
  font-size: var(--t-md) !important;
}
.leaflet-popup-tip          { background: var(--surface) !important; }
.leaflet-popup-close-button { color: var(--muted) !important; font-size: 18px !important; }
.leaflet-control-attribution { font-size: var(--t-2xs); }


/* ═════════════════════════════════════════════════════════════════════════════
   §22 ANIMATION
   ═════════════════════════════════════════════════════════════════════════════ */
@keyframes kf-up   { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes kf-fade { from { opacity:0; } to { opacity:1; } }
@keyframes kf-pulse{ 0%,100%{ opacity:1; } 50%{ opacity:.55; } }

.reveal            { animation: kf-up   .5s var(--ease) both; }
.reveal--fade      { animation: kf-fade .4s var(--ease) both; }
.reveal--delay-1   { animation-delay: .10s; }
.reveal--delay-2   { animation-delay: .20s; }
.reveal--delay-3   { animation-delay: .30s; }
.pulse             { animation: kf-pulse 1.6s ease-in-out infinite; }


/* ═════════════════════════════════════════════════════════════════════════════
   §23 ACCESSIBILITY OVERRIDES
   ═════════════════════════════════════════════════════════════════════════════ */
/* Forced colors (Windows High Contrast) */
@media (forced-colors: active) {
  .btn, .chip, .tab, .status-chip, .freshness-banner { border: 2px solid ButtonText; }
}

/* Coarse pointer — expand already-large targets */
@media (pointer: coarse) {
  .tab, .mode-btn, .source-link { min-height: var(--tap); }
}


/* ═════════════════════════════════════════════════════════════════════════════
   §24 RESPONSIVE
   ═════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 980px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

/* Live-map: panel to bottom sheet */
@media (max-width: 860px) {
  :root { --panel-w: 100vw; }

  .legal-bar {
    right: 0;
    position: sticky;
    height: auto;
    padding: 8px var(--s4);
    flex-wrap: wrap;
  }

  #map {
    top: 0;
    bottom: 45vh;
    right: 0;
    left: 0;
  }

  .panel {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 45vh;
    min-height: 300px;
    border-left: none;
    border-top: 1px solid var(--b-md);
  }

  .panel-brand,
  .panel-back { display: none; }

  .tabs { grid-template-columns: repeat(3, 1fr); padding: 0 var(--s3) var(--s3); }
}

@media (max-width: 640px) {
  body { font-size: var(--t-body); }  /* Lock 18px — never allow browser to shrink below this */

  .section    { padding: var(--s7) 0; }
  .section--sm{ padding: var(--s6) 0; }
  .hero       { padding: var(--s8) 0 var(--s7); }
  .hero-title { font-size: clamp(30px, 8vw, 40px); }

  .grid--2 { grid-template-columns: 1fr; }
  .btn-row { flex-direction: column; }
  .btn     { width: 100%; justify-content: center; }
}


/* ==========================================================================
   KAHU OLA V4 — SECONDARY PAGE NORMALIZATION PATCH
   Secondary pages: compact header only, no giant duplicate hero branding
   ========================================================================== */

.document-shell,
.portal-shell,
.page-shell {
  padding: var(--s7) 0 var(--s9);
  background: linear-gradient(180deg, #f7f9fd 0%, var(--bg) 100%);
  min-height: calc(100vh - 72px);
}

.document-grid,
.portal-grid {
  display: grid;
  gap: var(--s6);
  align-content: start;
}

.document-hero,
.portal-hero,
.page-hero {
  position: relative;
  padding: clamp(24px, 3.2vw, 40px);
  border-radius: var(--r-xl);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--b);
  box-shadow: var(--sh-md);
  overflow: hidden;
}

.document-hero::before,
.portal-hero::before,
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top right, rgba(37,99,235,.05), transparent 32%),
    radial-gradient(circle at bottom left, rgba(2,132,199,.05), transparent 28%);
}

.document-hero > *,
.portal-hero > *,
.page-hero > * {
  position: relative;
  z-index: 1;
}

.document-title,
.page-title {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--text);
}

.document-meta,
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  align-items: center;
}

.doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: center;
  margin-top: var(--s4);
}

/* Legacy giant-brand suppression on secondary pages */
.document-shell .hero-brand,
.document-shell .brand-hero,
.document-shell .logo-hero,
.document-shell .page-brand-hero,
.document-shell .brand-lockup-hero,
.document-shell .hero-logo-wrap,
.document-shell .hero-logo,
.document-shell .brand-lockup,
.document-shell .brand-banner,
.document-shell .masthead-brand,
.document-shell .site-hero-logo,
.document-shell .site-brand-hero,
.document-shell img[src*="logo-lockup"],
.document-shell img[src*="logo-header"],

.portal-shell .hero-brand,
.portal-shell .brand-hero,
.portal-shell .logo-hero,
.portal-shell .page-brand-hero,
.portal-shell .brand-lockup-hero,
.portal-shell .hero-logo-wrap,
.portal-shell .hero-logo,
.portal-shell .brand-lockup,
.portal-shell .brand-banner,
.portal-shell .masthead-brand,
.portal-shell .site-hero-logo,
.portal-shell .site-brand-hero,
.portal-shell img[src*="logo-lockup"],
.portal-shell img[src*="logo-header"],

.page-shell .hero-brand,
.page-shell .brand-hero,
.page-shell .logo-hero,
.page-shell .page-brand-hero,
.page-shell .brand-lockup-hero,
.page-shell .hero-logo-wrap,
.page-shell .hero-logo,
.page-shell .brand-lockup,
.page-shell .brand-banner,
.page-shell .masthead-brand,
.page-shell .site-hero-logo,
.page-shell .site-brand-hero,
.page-shell img[src*="logo-lockup"],
.page-shell img[src*="logo-header"] {
  display: none !important;
}

.policy-stack {
  display: grid;
  gap: var(--s4);
}

.policy-block {
  background: var(--surface);
  border: 1px solid var(--b);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  padding: clamp(20px, 2.4vw, 28px);
  display: grid;
  gap: var(--s3);
}

.policy-block h2 {
  font-size: clamp(22px, 2.2vw, 30px);
  letter-spacing: -0.02em;
  margin: 0;
}

.policy-block h3 {
  font-size: clamp(18px, 1.8vw, 22px);
  margin: 0;
}

.policy-block p,
.policy-block li {
  color: var(--muted);
}

.faq-list,
.checklist,
.official-links {
  margin: 0;
}

.faq-item + .faq-item {
  margin-top: var(--s4);
}

.footer-copy span {
  display: block;
  color: var(--subtle);
  font-size: var(--t-sm);
  line-height: 1.45;
}

body.page-live-map .hero,
body.page-live-map .brand-hero,
body.page-live-map .logo-hero,
body.page-live-map .document-hero,
body.page-live-map .page-brand-hero,
body.page-live-map img[src*="logo-lockup"],
body.page-live-map img[src*="logo-header"] {
  display: none !important;
}

@media (max-width: 860px) {
  .document-shell,
  .portal-shell,
  .page-shell {
    padding: var(--s5) 0 var(--s7);
  }

  .document-hero,
  .portal-hero,
  .page-hero,
  .policy-block {
    border-radius: var(--r-lg);
  }

  .doc-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .doc-actions > a,
  .doc-actions > button {
    width: 100%;
    justify-content: center;
  }
}
