/* ───────────────────────────────────────────────
   ApiRepublic
   Theme: deep blue-black · brand red accent · ocean blue for data/water
   Type:  Space Grotesk (headings + body) · JetBrains Mono (code, readings,
          units, labels) - both self-hosted, see static/fonts/fonts.css
─────────────────────────────────────────────── */

:root {
  --bg:           #05070a;
  --bg-1:        #0a0e14;
  --bg-2:        #0f141c;
  --bg-3:        #151b25;
  --bg-elev:     #121823;
  --border:      #1b2330;
  --border-2:    #263142;
  --text:        #f4f6fa;
  --text-2:      #aeb7c4;
  --text-3:      #8e98a8;
  --text-4:      #768192;   /* >= 4.5:1 on every surface for small text */

  /* Brand red. --accent-rgb feeds every translucent red (rgba(var(--accent-rgb), a)). */
  --accent:      #d62b3a;   /* white text on it: 4.9:1 */
  --accent-2:    #ff4656;   /* accent as text on dark surfaces */
  --accent-hover:#b92231;   /* buttons darken on hover so the label keeps its contrast */
  --accent-deep: #8f1420;
  --accent-rgb:  214, 43, 58;
  --accent-dim:  rgba(var(--accent-rgb), 0.16);
  --accent-glow: rgba(var(--accent-rgb), 0.35);

  /* Ocean blue: water, data, links-in-prose, the globe's atmosphere. */
  --ocean:       #2f8cff;
  --ocean-2:     #6cb0ff;
  --ocean-deep:  #0a2a57;
  --ocean-rgb:   47, 140, 255;
  --ocean-dim:   rgba(var(--ocean-rgb), 0.14);

  /* Glass surfaces (nav, popovers, floating panels). */
  --glass:        rgba(10, 14, 20, 0.66);
  --glass-strong: rgba(12, 17, 25, 0.84);
  --glass-border: rgba(170, 200, 240, 0.10);
  --glass-blur:   blur(16px) saturate(140%);

  --ok:          #4ade80;
  --warn:        #f4c430;
  --info:        #60a5fa;

  /* JSON syntax colors (subtle on black) */
  --c-key:       #ffffff;
  --c-str:       #95e6cb;
  --c-num:       #f78c6c;
  --c-bool:      #c792ea;
  --c-punc:      #7a8394;

  --radius-sm:   8px;
  --radius:      14px;
  --radius-lg:   20px;
  --radius-pill: 999px;

  --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-accent: 0 6px 28px rgba(var(--accent-rgb), 0.18);

  --font-sans: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --content-max: 1180px;
  --nav-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
code {
  font-family: var(--font-mono);
  background: var(--bg-3);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.92em;
  color: var(--text);
  border: 1px solid var(--border);
}
em { font-style: italic; color: var(--text-2); }
.filter-modal-close svg { display: block; margin: auto; }
/* No blinking text caret on read-only content (it appears when caret browsing
   is on, or on some clicks); text stays selectable and copyable. Real text
   fields keep their caret. */
html { caret-color: transparent; }
input, textarea, select, [contenteditable]:not([contenteditable="false"]) { caret-color: auto; }
/* One keyboard focus ring site-wide. :where() keeps specificity at zero so
   any component with its own focus treatment still wins. */
:where(a, button, [role="button"], [role="tab"], [tabindex], input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--ocean-2);
  outline-offset: 3px;
}
.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }
pre, kbd, samp,
.hero-terminal .terminal-body,
.terminal-title,
.term-meta-bar { font-family: var(--font-mono); }
strong { font-weight: 600; color: var(--text); }

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 32px;
}

/* ───────────────────────────────────────────────
   Buttons
─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 22px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  user-select: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}
@media (hover: hover) {
  .btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 8px 30px rgba(var(--accent-rgb), 0.32);
    transform: translateY(-1px);
  }
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-2);
}
@media (hover: hover) {
  .btn-ghost:hover {
    border-color: var(--text-3);
    background: var(--bg-2);
  }
}
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 28px; font-size: 15px; }
.btn-block { width: 100%; }

/* ───────────────────────────────────────────────
   Nav
─────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  height: var(--nav-h);
}
.nav-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 36px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.015em;
}
.brand-mark {
  color: var(--accent);
  font-size: 24px;
  line-height: 1;
}
.brand-accent { color: var(--accent); font-weight: 600; }
.nav-links {
  display: flex;
  gap: 28px;
  /* margins moved to the `.nav-cluster` wrapper so the same wrapper can
     host both the desktop inline layout and the mobile drawer panel. */
}
.nav-links a {
  font-size: 13px;
  color: var(--text-2);
  transition: color 0.15s;
  position: relative;
}
@media (hover: hover) {
  .nav-links a:hover { color: var(--text); }
}
/* Login nav links: Map · API · MCP (open feature popups) + the "Learn more"
   link. They now live inside .nav-cluster > .nav-links, so the shared hamburger
   drawer (mobile-nav.js) collapses them on mobile/tablet — no bespoke login nav,
   and nothing clips on narrow phones. */
.nav-features-link,
.login-nav-link {
  font-size: 13px;
  color: var(--text);
  letter-spacing: 0.02em;
  transition: color 0.15s;
}
.login-nav-link { cursor: pointer; }
@media (hover: hover) {
  .nav-features-link:hover,
  .login-nav-link:hover,
  /* These links sit inside .nav-links now, whose own `a:hover` rule (white)
     would otherwise win — keep the accent hover. */
  .page-login .nav-links a:hover { color: var(--accent); }
}

/* ───────────────────────────────────────────────
   Hero
─────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 90px 0 80px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -200px;
  background:
    radial-gradient(900px 480px at 80% 10%, rgba(var(--accent-rgb), 0.10), transparent 60%),
    radial-gradient(700px 400px at 10% 80%, rgba(var(--accent-rgb), 0.05), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.hero .container { position: relative; z-index: 1; }
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-2);
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}
.hero-tag .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.45);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}
.hero-title {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin-bottom: 24px;
  max-width: 980px;
}
.hero-title .accent { color: var(--accent); }
.hero-sub {
  font-size: 17px;
  color: var(--text-2);
  max-width: 720px;
  line-height: 1.65;
  margin-bottom: 14px;
}
.hero-sub:last-of-type { margin-bottom: 36px; }
.hero-sub-pitch {
  color: var(--text);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-top: 6px;
}
.hero-sub-quote em {
  color: var(--text);
  font-style: italic;
}
.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 60px;
}
.meta-item {
  display: flex;
  flex-direction: column;
  padding: 6px 24px;
  min-width: 140px;
}
.meta-item:first-child { padding-left: 0; }
.meta-num {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.meta-label {
  font-size: 11.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}
.meta-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

/* Hero terminal */
.hero-terminal {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  max-width: 820px;
  margin: 0 auto;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.t-dot {
  width: 11px; height: 11px; border-radius: 50%;
  display: inline-block;
}
.t-red    { background: #ff5f56; }
.t-amber  { background: #ffbd2e; }
.t-green  { background: #27c93f; }
.terminal-title {
  margin-left: 12px;
  font-size: 12px;
  color: var(--text-3);
}
.terminal-body {
  padding: 18px 22px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-2);
  overflow-x: auto;          /* long code lines scroll inside the terminal, never the page */
}
.hero-terminal { max-width: min(820px, 100%); }
.terminal-body .line { white-space: pre; }
.terminal-body .indent  { padding-left: 22px; }
.terminal-body .indent2 { padding-left: 44px; }
.terminal-body .prompt { color: var(--accent); font-weight: 600; margin-right: 6px; }
.terminal-body .key  { color: var(--c-key); }
.terminal-body .str  { color: var(--c-str); }
.terminal-body .num  { color: var(--c-num); }
.terminal-body .bool { color: var(--c-bool); }
.terminal-body .punc { color: var(--c-punc); }

/* ───────────────────────────────────────────────
   Generic sections
─────────────────────────────────────────────── */
.section {
  padding: 100px 0;
  border-top: 1px solid var(--border);
  position: relative;
}
.section-tight { padding: 80px 0; }
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-2);
  letter-spacing: 0.16em;
  margin-bottom: 16px;
  text-transform: uppercase;
}
.section-title {
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 16px;
  max-width: 840px;
}
.section-lede {
  font-size: 15.5px;
  color: var(--text-2);
  max-width: 720px;
  line-height: 1.7;
  margin-bottom: 48px;
}
.grid { display: grid; gap: 36px; }
.two-col { grid-template-columns: 1.1fr 0.9fr; }
/* minmax(0, 1fr): a single track must be allowed to shrink below its longest
   unbreakable code token, otherwise it widens the whole page on phones. */
@media (max-width: 880px) { .two-col { grid-template-columns: minmax(0, 1fr); } }
.prose pre, .card pre { overflow-x: auto; max-width: 100%; }
.prose code { overflow-wrap: anywhere; }
/* A lone trailing card in a two-col grid is centred rather than left-hung. */
.two-col .card-center { grid-column: 1 / -1; justify-self: center; width: calc(50% - 18px); }
@media (max-width: 880px) { .two-col .card-center { grid-column: auto; justify-self: stretch; width: auto; } }
.prose p { margin-bottom: 16px; color: var(--text-2); font-size: 15px; line-height: 1.7; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--text); }

/* ───────────────────────────────────────────────
   Cards
─────────────────────────────────────────────── */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 16px;
}
.card-label {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.12em;
}
.badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
}
.badge-live {
  background: rgba(74, 222, 128, 0.10);
  color: var(--ok);
  border: 1px solid rgba(74, 222, 128, 0.30);
}
.badge-accent {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.40);
  margin-left: 10px;
  vertical-align: middle;
}

.spec-list { list-style: none; }
.spec-list li {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  column-gap: 18px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13.5px;
  color: var(--text-2);
  align-items: start;
}
.spec-list li:first-child { padding-top: 4px; }
.spec-list li:last-child  { border-bottom: none; padding-bottom: 0; }
.spec-k {
  color: var(--text-3);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 3px;
}
.spec-v {
  color: var(--text);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.6;
}
.spec-v code {
  font-size: 12.5px;
  white-space: nowrap;
  padding: 1px 5px;
}
@media (max-width: 420px) { .spec-v code { white-space: normal; overflow-wrap: anywhere; } }
/* Stacked variant: keys are long code tokens (e.g. the MCP ENVIRONMENT
   variables) that overflow the fixed 96px key column, so put the key on its
   own line above the value. */
.spec-list-stack li { grid-template-columns: 1fr; row-gap: 5px; }
.spec-list-stack .spec-k {
  text-transform: none; letter-spacing: 0; font-size: 12.5px; padding-top: 0;
}
.spec-list-stack .spec-k code { white-space: nowrap; }

/* ───────────────────────────────────────────────
   Sources strip
─────────────────────────────────────────────── */
.sources-grid {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}
.sources-grid .source-tile {
  flex: 0 0 240px;
  scroll-snap-align: start;
}
.source-tile {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.2s ease;
}
@media (hover: hover) {
  .source-tile:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
  }
}
.src-id {
  font-size: 10.5px;
  color: var(--accent);
  letter-spacing: 0.12em;
  margin-bottom: 8px;
  font-weight: 600;
}
.src-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}
.src-meta {
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.55;
}

/* ───────────────────────────────────────────────
   Taxonomy
─────────────────────────────────────────────── */
.tax-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 980px) { .tax-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .tax-grid { grid-template-columns: 1fr; } }
.tax-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.tax-domain {
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  font-weight: 600;
}
.tax-leaves { list-style: none; }
.tax-leaves li {
  font-size: 13px;
  padding: 5px 0;
  color: var(--text-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tax-leaves .unit {
  color: var(--text-4);
  font-size: 11.5px;
  margin-left: 12px;
}
.tax-card-meta { background: var(--bg-2); border-color: var(--border-2); }
.tax-meta-list { list-style: none; }
.tax-meta-list li {
  font-size: 12.5px;
  padding: 5px 0;
  color: var(--text-2);
}
.tax-meta-list code { font-size: 12px; }

/* ───────────────────────────────────────────────
   Endpoints
─────────────────────────────────────────────── */
.endpoint-group { margin-bottom: 56px; }
.endpoint-group:last-child { margin-bottom: 0; }
.group-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}
.group-lede {
  font-size: 14px;
  color: var(--text-3);
  margin-bottom: 22px;
  max-width: 700px;
}
.endpoint-group-featured {
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.04) 0%, transparent 100%);
  border: 1px solid rgba(var(--accent-rgb), 0.20);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.endpoint-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.endpoint-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease;
}
@media (hover: hover) {
  .endpoint-card:hover { border-color: var(--border-2); }
}
.endpoint-row {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
}
.endpoint-method {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: 6px;
  text-align: center;
  background: rgba(96, 165, 250, 0.10);
  color: var(--info);
  border: 1px solid rgba(96, 165, 250, 0.25);
  width: fit-content;
}
.endpoint-method.post {
  background: rgba(74, 222, 128, 0.10);
  color: var(--ok);
  border-color: rgba(74, 222, 128, 0.30);
}
.endpoint-body { min-width: 0; }
.endpoint-path {
  font-size: 14.5px;
  color: var(--text);
  font-weight: 500;
  word-break: break-all;
  margin-bottom: 4px;
}
.endpoint-path .accent-light {
  color: var(--accent);
}
.endpoint-desc {
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.55;
}
.endpoint-tier {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-4);
  margin-right: 12px;
}
.endpoint-tier.tier-pro { color: var(--accent); }
.demo-btn {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 12.5px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
@media (hover: hover) {
  .demo-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
  }
}
.demo-btn.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.endpoint-terminal {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
  border-top: 1px solid transparent;
  background: var(--bg);
}
.endpoint-terminal.is-open {
  max-height: 1200px;
  border-top-color: var(--border);
}
.endpoint-terminal .terminal-body {
  font-size: 12.5px;
  padding: 18px 22px;
  color: var(--text-2);
  white-space: pre-wrap;
  font-family: var(--font-mono);
  min-height: 60px;
}
.endpoint-terminal .cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--accent);
  vertical-align: -2px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.term-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.term-meta-bar .ok { color: var(--ok); }

/* JSON colour spans applied by JS */
.js-key  { color: var(--c-key); }
.js-str  { color: var(--c-str); }
.js-num  { color: var(--c-num); }
.js-bool { color: var(--c-bool); }
.js-null { color: var(--c-bool); }
.js-punc { color: var(--c-punc); }
.js-comment { color: var(--text-4); font-style: italic; }
.js-cmd     { color: var(--text); }
.js-flag    { color: var(--accent); }

/* ───────────────────────────────────────────────
   Use cases
─────────────────────────────────────────────── */
.usecase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 980px) { .usecase-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .usecase-grid { grid-template-columns: 1fr; } }
.usecase-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: all 0.2s ease;
}
@media (hover: hover) {
  .usecase-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow-accent);
  }
}
.uc-icon {
  font-size: 26px;
  margin-bottom: 14px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-3);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.usecase-card h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.usecase-card p {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 16px;
}
.uc-tag {
  font-size: 11.5px;
  color: var(--text-4);
  letter-spacing: 0.04em;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.uc-tag code { font-size: 11px; }

/* ───────────────────────────────────────────────
   Tier cards
─────────────────────────────────────────────── */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 920px;
}
@media (max-width: 780px) { .tier-grid { grid-template-columns: 1fr; } }
.tier-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
}
.tier-card-pro {
  background:
    radial-gradient(600px 260px at 50% 0%, rgba(var(--accent-rgb), 0.10), transparent 70%),
    var(--bg-1);
  border-color: rgba(var(--accent-rgb), 0.4);
}
.tier-flag {
  position: absolute;
  top: -10px;
  left: 28px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}
.tier-name {
  font-size: 13px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}
.tier-price {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}
.tier-cycle {
  font-size: 14px;
  color: var(--text-3);
  font-weight: 400;
  margin-left: 6px;
}
.tier-list {
  list-style: none;
  margin-bottom: 28px;
}
.tier-list li {
  font-size: 13.5px;
  color: var(--text-2);
  padding: 8px 0;
  display: flex;
  gap: 10px;
  border-bottom: 1px dashed var(--border);
}
.tier-list li:last-child { border-bottom: none; }
.tick {
  color: var(--accent);
  font-weight: 700;
}

.cta-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 36px 0 56px;
  background: var(--bg);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}
/* `.accent` has no base rule — it is only ever scoped (hero titles, .cdw-wordmark),
   so the footer wordmark's <span class="accent">API</span> inherited plain white.
   Scope it here too so the footer lockup matches the nav: red API, white Republic. */
.footer-brand .accent { color: var(--accent); }
.footer-meta {
  font-size: 12.5px;
  color: var(--text-3);
}
.footer-sep { margin: 0 8px; color: var(--text-4); }
.footer-legal {
  font-size: 12px;
  color: var(--text-4);
  letter-spacing: 0.02em;
}
/* Legal company disclosure (templates/_company_legal.html): its own full-width
   row at the bottom of every footer. */
.footer-company {
  flex-basis: 100%;
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-4);
  letter-spacing: 0.01em;
  text-wrap: pretty;
}
.footer-nowrap { white-space: nowrap; }   /* a postcode never splits across lines */

/* ───────────────────────────────────────────────
   Narrow-screen tweaks
─────────────────────────────────────────────── */
@media (max-width: 720px) {
  .nav-inner { gap: 16px; }
  .hero { padding: 60px 0 50px; }
  .section { padding: 70px 0; }
  .endpoint-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .endpoint-method { justify-self: start; }
  .demo-btn { justify-self: start; }
  .meta-divider { display: none; }
  .meta-item { padding: 6px 0; min-width: 50%; }

  /* Tighten the Pro-tier featured group's inner padding so the cards
     have breathing room at narrow widths. */
  .endpoint-group-featured { padding: 18px 14px; }

  /* Touch targets: bump everything below the 44 px iOS HIG / 48 dp Material
     minimum. Padding/min-height only — visual identity stays the same. */
  .btn-sm { padding: 11px 18px; min-height: 44px; }
  .demo-btn { padding: 11px 18px; min-height: 44px; }
  .source-chip { padding: 10px 14px; min-height: 40px; }
  .modal-close { width: 40px; height: 40px; }
  .form-check { padding: 10px 12px; min-height: 44px; }

  /* Inputs ≥ 16 px prevents iOS Safari's auto-zoom-on-focus. */
  .form-control,
  #postcode-input,
  .control-timewindow input[type="datetime-local"] { font-size: 16px; }

  /* Terminals: horizontal scroll on long lines instead of clipping (hero)
     or wrapping mid-token (endpoint). The parent .hero-terminal /
     .endpoint-terminal keeps overflow:hidden so the rounded corners and
     slide-open animation still mask correctly; the scroll lives on the
     inner .terminal-body. */
  .hero-terminal .terminal-body,
  .endpoint-terminal .terminal-body {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
}

/* ───────────────────────────────────────────────
   /map page — V-12
   New components built from existing :root tokens only.
   No new fonts, accents, radii, or shadow tokens.
─────────────────────────────────────────────── */

.nav-links a.nav-active {
  color: var(--text);
  position: relative;
}
.nav-links a.nav-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -22px;
  height: 2px;
  background: var(--accent);
}

.page-map .footer { border-top: 1px solid var(--border); }

/* ───── Map hero ───── */
.map-hero {
  position: relative;
  padding: 70px 0 28px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.map-hero::before {
  content: "";
  position: absolute;
  inset: -200px;
  background:
    radial-gradient(700px 360px at 80% 10%, rgba(var(--accent-rgb), 0.08), transparent 60%),
    radial-gradient(500px 300px at 10% 80%, rgba(var(--accent-rgb), 0.04), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.map-hero .container { position: relative; z-index: 1; }
.map-hero-title {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 14px;
  max-width: 920px;
}
.map-hero-sub {
  font-size: 15.5px;
  color: var(--text-2);
  line-height: 1.65;
  max-width: 820px;
}
.map-hero-hint {
  font-size: 13.5px;
  color: var(--text-3);
  margin-top: 6px;
}
.map-hero-hint em { color: var(--text-2); }

/* ───── Filter controls strip ───── */
.map-controls-section {
  padding: 20px 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
}
.map-controls {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(260px, 1.4fr);
  gap: 32px;
  align-items: start;
}
@media (max-width: 980px) { .map-controls { grid-template-columns: 1fr; } }

.control-group label {
  display: block;
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.control-postcode {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.control-postcode #postcode-go {
  align-self: flex-start;
  margin-top: 6px;
}
.control-postcode input[type="text"] {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s ease;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.control-postcode input[type="text"]::placeholder {
  color: var(--text-4);
  text-transform: none;
  letter-spacing: 0;
}
.control-postcode input[type="text"]:focus {
  border-color: var(--accent);
}

.control-radius input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-3);
  border-radius: var(--radius-pill);
  outline: none;
  margin-top: 6px;
}
.control-radius input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 0 4px var(--accent-dim);
}
.control-radius input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 0 4px var(--accent-dim);
}
.radius-value {
  color: var(--text);
  font-weight: 600;
  margin-left: 8px;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: none;
}

.source-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.source-chip {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-2);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s ease;
}
@media (hover: hover) {
  .source-chip:hover { border-color: var(--text-3); color: var(--text-2); }
}
.source-chip.is-on {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.40);
}
/* Pro chips: unselectable, dimmed, "coming soon" tooltip on hover. */
.source-chip.is-pro {
  cursor: default;
  opacity: 0.5;
  position: relative;
}
@media (hover: hover) {
  .source-chip.is-pro:hover { opacity: 1; }
  .source-chip.is-pro:hover::after {
    content: "coming soon";
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(var(--accent-rgb), 0.40);
    border-radius: var(--radius-pill);
    padding: 3px 10px;
    font-size: 11px;
    pointer-events: none;
    z-index: 5;
  }
}

/* ───── Map + sidebar layout ───── */
.map-main { padding: 28px 0 60px; }
.map-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 980px) { .map-grid { grid-template-columns: 1fr; } }
.map-column-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.map-pane {
  position: relative;          /* anchor for the on-map onboarding callout */
  z-index: 0;                  /* contain Leaflet's panes/controls (z up to ~1000)
                                  in their own stacking context so they scroll
                                  UNDER the sticky nav (z-50) instead of over it */
  isolation: isolate;          /* belt-and-braces: force a new stacking context */
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.map-sources-section h3 { margin-bottom: 14px; }
.map-sources-section .source-chips {
  gap: 6px;
  margin-bottom: 14px;
}
.map-sources-disclaimer {
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 11.5px;
  color: var(--text-4);
  line-height: 1.55;
  margin-bottom: 0;
}
.map-sources-disclaimer #snapshot-date { color: var(--text-3); }
#map {
  width: 100%;
  height: 70vh;
  min-height: 480px;
  background: var(--bg);
}
.map-status {
  padding: 10px 16px;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-3);
  letter-spacing: 0.02em;
}

.map-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sidebar-section {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.sidebar-section h3 {
  font-size: 13px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-lede {
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.55;
  margin-bottom: 4px;
}

.visible-summary {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.visible-summary li {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-2);
}
.vs-dot {
  width: 12px; height: 12px; border-radius: 50%;
  display: inline-block;
}
.vs-station { background: var(--ok); }
.vs-bathing { background: var(--info); }
.vs-outfall { background: var(--accent); }
.vs-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text);
}

.pro-sources-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pro-sources-list li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.5;
}
.pro-sources-list li:last-child { border-bottom: none; }
.pro-source-name { color: var(--text); font-weight: 500; }
.pro-source-id {
  font-size: 11px;
  color: var(--text-4);
  padding: 1px 5px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: inline-block;
  margin-top: 2px;
}

/* ───── Custom markers ───── */
.map-marker {
  background: transparent !important;
  border: none !important;
}
.map-dot {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.85);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

/* Flood-warning key — sits inside the sidebar Legend box, shown only while the
   "Flood warning" filter is applied (map.js toggles [hidden]); it rides into
   the on-map stack in fullscreen with the rest of the legend. */
.flood-legend[hidden] { display: none; }
.legend-subhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.vs-flood-severe { background: #dc2626; }
.vs-flood-warning { background: #f97316; }
.vs-flood-alert { background: #facc15; }
.map-popup .flood-msg { margin-top: 4px; max-height: 7.5em; overflow: auto; }

/* Query-anchor "X" — visually distinct from the round per-type icons.
   Must stay interactive: clicking the ✕ is how "your point" data (weather,
   waves) is loaded, so it cannot be pointer-events:none. */
.map-anchor {
  background: transparent !important;
  border: none !important;
  cursor: pointer;
}
.map-anchor-x {
  display: block;
  width: 10px;
  height: 10px;
  line-height: 10px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  color: #ffffff;
  text-shadow:
    0 0 3px rgba(0, 0, 0, 0.95),
    0 0 2px rgba(0, 0, 0, 0.95),
    0 1px 0 rgba(0, 0, 0, 0.9);
  letter-spacing: 0;
}

/* ───── Leaflet override for dark theme ───── */
.leaflet-container { background: var(--bg); font-family: var(--font-mono); }
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--bg-1);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}
.leaflet-popup-content {
  margin: 14px 18px;
  font-size: 13px;
  line-height: 1.55;
  /* Size-normalise every popup: a tall/wide one (e.g. the dropped pin with
     weather + waves all selected) scrolls both ways instead of
     overflowing the map. */
  max-height: 360px;
  overflow: auto;
}
.leaflet-popup-close-button {
  color: var(--text-3) !important;
}
@media (hover: hover) {
  .leaflet-popup-close-button:hover { color: var(--accent) !important; }
}
.leaflet-control-attribution {
  background: rgba(5, 7, 10, 0.7) !important;
  color: var(--text-3) !important;
  font-size: 10.5px !important;
}
.leaflet-control-attribution a { color: var(--text-2) !important; }
.leaflet-control-zoom a {
  background: var(--bg-1) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
@media (hover: hover) {
  .leaflet-control-zoom a:hover {
    background: var(--bg-2) !important;
    color: var(--accent) !important;
  }
}

/* Cluster bubbles (map.js clusterIcon): a ring in the legend colours, split by
   what the cluster contains, around a dark glass core carrying the count. */
.cdw-cluster { background: none; border: 0; }
.cdw-cluster-ring {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  padding: 3px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
}
.cdw-cluster-core {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(8, 11, 16, 0.92);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
}

/* ───── Popup body ───── */
.map-popup .popup-eyebrow {
  font-size: 10.5px;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.map-popup .popup-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}
.map-popup .popup-source {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 12px;
}
.map-popup .popup-section-head {
  font-size: 10.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.map-popup .popup-params {
  list-style: none;
  padding: 0;
  margin: 0 0 10px 0;
  max-height: 220px;
  overflow-y: auto;
}
.map-popup .popup-params li {
  padding: 5px 0;
  font-size: 12.5px;
  border-bottom: 1px dashed var(--border);
}
.map-popup .popup-params li:last-child { border-bottom: none; }
.map-popup .popup-friendly { color: var(--text); }
.map-popup .popup-path {
  font-size: 11px;
  color: var(--text-3);
  padding: 1px 5px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.map-popup .popup-slug {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-4);
}
.map-popup .popup-slug code {
  font-size: 11px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 2px 6px;
}

@media (max-width: 980px) {
  #map { height: 60vh; min-height: 360px; }
  .map-hero { padding: 50px 0 22px; }
  .map-main { padding: 18px 0 40px; }
}

/* ───────────────────────────────────────────────
   Contact modal — polish patch
   Triggered by [data-open-contact]. Existing :root
   tokens only; no new fonts / accents / radii.
─────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  cursor: pointer;
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 32px 28px;
  box-shadow: var(--shadow-soft);
  z-index: 1;
}
@media (max-width: 560px) {
  .modal-card { padding: 24px 22px 22px; }
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-3);
  font-family: var(--font-sans);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}
@media (hover: hover) {
  .modal-close:hover {
    border-color: var(--accent);
    color: var(--accent);
  }
}
.modal-eyebrow {
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  text-transform: lowercase;
}
.modal-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 8px;
}
.modal-sub {
  font-size: 13.5px;
  color: var(--text-3);
  line-height: 1.55;
  margin-bottom: 22px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.form-optional {
  color: var(--text-4);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.form-control {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 400;
  outline: none;
  transition: border-color 0.15s ease;
  width: 100%;
  resize: vertical;
}
.form-control::placeholder {
  color: var(--text-4);
  font-style: italic;
}
.form-control:focus {
  border-color: var(--accent);
}
textarea.form-control {
  min-height: 90px;
  line-height: 1.5;
}

.form-checks { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 2px; }
.form-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-2);
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-2);
  transition: all 0.15s ease;
}
@media (hover: hover) {
  .form-check:hover { border-color: var(--text-3); color: var(--text); }
}
.form-check input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
  margin: 0;
}
.form-check:has(input:checked) {
  background: var(--accent-dim);
  border-color: rgba(var(--accent-rgb), 0.40);
  color: var(--accent);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}
.form-status {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-3);
  min-height: 18px;
  line-height: 1.5;
}
.form-status.is-ok  { color: var(--ok); }
.form-status.is-err { color: var(--accent); }

/* ───────────────────────────────────────────────
   Tier cards — equal-size fix
   flex column pins the CTA button at the card
   bottom so the Free + Pro cards present as equal
   weight regardless of bullet text length.
─────────────────────────────────────────────── */

.tier-grid { align-items: stretch; }
.tier-card {
  display: flex;
  flex-direction: column;
}
.tier-card .tier-list {
  flex: 1 1 auto;
}

/* ───────────────────────────────────────────────
   Mobile polish (post-V-12) — hamburger drawer
   New components built from existing :root tokens only.
   Desktop UX is preserved: .nav-cluster simply replaces
   the inline layout role previously carried by
   .nav-links's auto-margin, and .nav-toggle stays
   display:none above 720 px.
─────────────────────────────────────────────── */

.nav-cluster {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
  font-family: var(--font-sans);
  margin-left: auto;
}
.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

@media (max-width: 820px) {
  /* The CTA + section links collapse into a slide-down drawer. The
     cluster wrapper is the panel itself: positioned below the sticky
     nav, hidden by default, revealed when .nav.is-drawer-open. The
     brand (glyph + wordmark) stays in the header on mobile/tablet —
     only the brand and the hamburger live in the persistent nav row.
     Breakpoint raised to 820 px so portrait tablets (768 px) get the
     hamburger instead of a crammed 5-link + Account bar. Kept in
     lockstep with the account-panel + api/mcp table breakpoints and
     mobile-nav.js's matchMedia. */
  .nav-cluster {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    margin: 0;
    gap: 4px;
    padding: 16px 24px 22px;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.2s ease, opacity 0.2s ease, visibility 0s linear 0.2s;
  }
  .nav.is-drawer-open .nav-cluster {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.2s ease, opacity 0.2s ease, visibility 0s;
  }
  .nav-cluster .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
  }
  .nav-cluster .nav-links a {
    font-size: 15px;
    padding: 14px 8px;
    border-bottom: 1px dashed var(--border);
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  /* The desktop nav-active underline floats 22 px below each link, which
     is wrong inside the drawer — swap for an accent-coloured label. */
  .nav-cluster .nav-links a.nav-active::after { display: none; }
  .nav-cluster .nav-links a.nav-active { color: var(--accent); }

  .nav-cluster .nav-cta {
    margin-top: 14px;
    width: 100%;
    padding: 14px 18px;
    justify-content: center;
    min-height: 44px;
  }

  .nav-toggle { display: inline-flex; }

  /* Hamburger animates into an X when open. */
  .nav.is-drawer-open .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav.is-drawer-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
  .nav.is-drawer-open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* ──────────────────────────────────────────────────────────
   APIRepublic components (Live map). Uses existing :root
   tokens only — no new colours/fonts/accents introduced.
   ────────────────────────────────────────────────────────── */

/* Hero wordmark — "API" accent · "Republic" white (#1). */
.cdw-wordmark .accent { color: var(--accent); }
.cdw-wordmark span { letter-spacing: -0.01em; }

/* Segmented toggles (time mode + units). */
.seg-toggle {
  display: inline-flex; border: 1px solid var(--border-2);
  border-radius: var(--radius-pill); overflow: hidden; background: var(--bg-2);
}
.seg-toggle .seg {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  color: var(--text-2); font-family: var(--font-sans); font-size: 0.78rem;
  padding: 6px 14px; transition: background 0.15s, color 0.15s;
}
.seg-toggle .seg:hover:not(.is-disabled) { color: var(--text); }
.seg-toggle .seg.is-on { background: var(--accent-dim); color: var(--text); }
.seg-toggle .seg.is-disabled { color: var(--text-4); cursor: not-allowed; }

/* Category → Parameter selector (replaces source chips). */
.param-group { border-top: 1px solid var(--border); padding: 8px 0; }
.param-group:first-child { border-top: 0; }
.param-group-head {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 0.82rem; font-weight: 600; color: var(--text);
}
.param-list { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 8px 0 2px 22px; }
.param-item {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 0.76rem; color: var(--text-2);
}
.param-item:hover { color: var(--text); }
.param-item input, .param-group-head input { accent-color: var(--accent); cursor: pointer; }

/* Apply button row (commit the staged selection). */
.param-apply-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.param-apply-hint { color: var(--text-3); font-size: 0.72rem; }
#apply-selection.is-dirty { box-shadow: 0 0 0 2px var(--accent-glow); }

/* "Click to show filters" button (replaces the old How-it-works panel). */
.filter-open-btn {
  width: 100%; text-align: left; cursor: pointer;
  background: var(--bg-2); color: var(--text); border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); padding: 12px 16px;
  font-family: var(--font-sans); font-size: 0.85rem; font-weight: 600;
  transition: border-color 0.15s, background 0.15s;
}
.filter-open-btn:hover { border-color: var(--accent); background: var(--bg-3); }

/* Applied-filters summary — expands under the button after Apply. */
.applied-filters { margin-top: 12px; }
.applied-filters[hidden] { display: none; }
.applied-filters-head {
  font-size: 11px; color: var(--text-3); text-transform: uppercase;
  letter-spacing: 0.1em; margin-bottom: 8px;
}
.applied-filters-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.applied-filter-chip {
  display: inline-block; padding: 3px 9px; font-size: 0.72rem;
  color: var(--text-2); background: var(--accent-dim);
  border: 1px solid var(--border-2); border-radius: var(--radius-pill);
}

/* Acknowledgements — source cards (// 02). Gives each source its own card and
   adds breathing room between each source and between its detail lines. */
.acks-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 22px; margin-top: 26px;
}
.acks-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
}
.acks-card-multi { grid-column: 1 / -1; }
.acks-provider {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent);
}
.acks-name { margin: 0; font-size: 1rem; color: var(--text); }
.acks-desc { margin: 0; font-size: 0.85rem; line-height: 1.55; color: var(--text-2); }
.acks-meta {
  list-style: none; margin: 6px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.acks-meta li { display: flex; gap: 12px; font-size: 0.8rem; }
.acks-k {
  flex: 0 0 78px; padding-top: 1px;
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3);
}
.acks-v { color: var(--text-2); }
.acks-meta a, .acks-v a { color: var(--accent-2); }

/* Source links render as a clean "open in new tab" icon instead of a long URL. */
.acks-ext {
  display: inline-block; width: 15px; height: 15px; vertical-align: -2px;
  background-color: var(--accent-2);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: background-color 0.15s;
}
.acks-ext:hover { background-color: var(--accent); }
.acks-attribution {
  margin: auto 0 0; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 0.78rem; color: var(--text-3);
}
/* Keep the meta block from stretching so the auto-margin lands on attribution,
   giving every card an aligned bottom band regardless of description length. */
.acks-card .acks-meta { margin-bottom: 0; }

/* Glassmorphic filter modal. */
.filter-modal[hidden] { display: none; }
.filter-modal {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.filter-modal-backdrop {
  position: absolute; inset: 0; background: rgba(5, 7, 10, 0.5);
  backdrop-filter: blur(9px) saturate(120%);
  -webkit-backdrop-filter: blur(9px) saturate(120%);
}
.filter-modal-card {
  position: relative; z-index: 1; width: min(580px, 100%);
  /* Never wider than the viewport (matches the .filter-modal 24px padding), so a
     popup can't overflow/clip even if an upstream layout inflates `100%`. */
  max-width: calc(100vw - 48px);
  max-height: 82vh; overflow-y: auto;
  background: rgba(12, 17, 25, 0.92); border: 1px solid var(--border-2);
  border-radius: var(--radius); box-shadow: var(--shadow-soft);
  padding: 22px 24px 18px;
}
@media (max-width: 560px) {
  .filter-modal { padding: 16px; }
  .filter-modal-card { max-width: calc(100vw - 32px); padding: 18px 18px 14px; }
}
.filter-modal-close {
  position: absolute; top: 12px; right: 14px; background: transparent; border: 0;
  color: var(--text-3); font-size: 1rem; line-height: 1; cursor: pointer;
}
.filter-modal-close:hover { color: var(--text); }
.filter-modal-title { margin: 0 4px 8px 0; color: var(--text); font-size: 1.02rem; }
.filter-modal-actions {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
  position: sticky; bottom: -18px; background: rgba(12, 17, 25, 0.92);
}

/* Contact modal (reuses the .filter-modal* shell). */
.contact-modal-card { width: min(440px, 100%); }
.contact-modal-body { padding-top: 2px; }
.contact-lede { color: var(--text-2); font-size: 0.9rem; line-height: 1.5; margin: 0 0 14px; }
.contact-email {
  display: inline-block; color: var(--accent-2); font-weight: 600; font-size: 1.05rem;
  text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.15s;
}
.contact-email:hover { border-bottom-color: currentColor; }
/* Clickable contact triggers that sit inline in body/footer text.
   .footer-privacy-link shares this rule rather than carrying its own near-copy,
   so the two footer-meta buttons cannot drift apart in treatment. */
.footer-contact-link, .footer-privacy-link, .contact-inline-link {
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: inherit;
}
.footer-contact-link:hover,
.footer-privacy-link:hover { color: var(--accent-2); }
.contact-inline-link {
  color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px;
}
.contact-inline-link:hover { color: var(--text); }

/* Live popup body. */
.map-popup .popup-loading, .map-popup .popup-empty { color: var(--text-3); font-size: 0.8rem; padding: 4px 0; }
.map-popup .popup-drift { color: var(--warn); font-size: 0.8rem; padding: 4px 0; line-height: 1.45; }
.map-popup .popup-drift a { color: var(--accent-2); }
.map-popup .popup-eyebrow { color: var(--text-3); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; }
.map-popup .popup-name { color: var(--text); font-weight: 700; font-size: 0.95rem; margin: 2px 0 6px; }
.map-popup .popup-source { color: var(--text-3); font-size: 0.72rem; margin-top: 6px; }
.map-popup .popup-coverage {
  margin-top: 8px; padding: 6px 0 0 10px;
  border-left: 2px solid rgba(var(--ocean-rgb), 0.5);
  color: var(--text-3); font-size: 0.72rem; line-height: 1.45;
}
.map-popup .popup-source strong { color: var(--text-2); }
.map-popup .popup-note { color: var(--text-3); font-size: 0.72rem; margin-top: 4px; }
.map-popup .popup-rows { list-style: none; margin: 4px 0 0; padding: 0; }
.map-popup .popup-rows li {
  /* Label track floors at min-content so it can NEVER collapse to zero and let
     its text paint over the reading column. The reading track stays `auto`, so
     it takes max-content when there is room (keeping "1.234 m" on one line) but
     can fall back toward min-content and WRAP rather than overflow the popup -
     which it can now do, because .popup-reading below is no longer nowrap. */
  display: grid; grid-template-columns: minmax(min-content, 1fr) auto;
  align-items: baseline;
  gap: 2px 10px; padding: 3px 0; border-bottom: 1px dashed var(--border);
}
.map-popup .popup-friendly { color: var(--text-2); font-size: 0.78rem; }
/* Deliberately NOT nowrap: a label-kind reading is a phrase plus an ISO
   timestamp ("Recently discharged since 2026-07-02T07:49:43Z"), which on one
   unbreakable line overflowed the popup by ~45px. nowrap is applied to the
   value and unit instead, which is all it was ever needed for - it keeps a
   number welded to its unit without letting prose overflow. */
.map-popup .popup-reading { color: var(--text); font-size: 0.84rem; text-align: right; }
.map-popup .popup-val { color: var(--c-num); font-weight: 600; white-space: nowrap; }
.map-popup .popup-unit { color: var(--text-3); font-size: 0.72rem; white-space: nowrap; }
.map-popup .popup-detail { color: var(--text-3); font-size: 0.7rem; }
.map-popup .popup-asof { grid-column: 1 / -1; color: var(--text-4); font-size: 0.66rem; }
.map-popup .popup-observed { grid-column: 1 / -1; color: var(--text-4); font-size: 0.66rem; }

/* ───── Time-window control (Historic / Forecast — RSAWEB-32) ───── */
.control-timewindow { grid-column: 1 / -1; }
.control-timewindow .tz-note { color: var(--text-4); text-transform: none; letter-spacing: 0; font-size: 10px; }
.timewindow-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tw-fields { display: inline-flex; align-items: center; gap: 8px; }
.tw-fields[hidden] { display: none; }  /* author display: must beat the inline-flex above */
.tw-sep, .tw-cap-note { color: var(--text-3); font-size: 0.74rem; }
.tw-cap-note { color: var(--text-4); font-style: italic; }
.control-timewindow input[type="datetime-local"] {
  appearance: none; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border-2); border-radius: var(--radius-sm, 8px);
  font-family: var(--font-mono); font-size: 0.76rem; padding: 6px 10px;
}
.control-timewindow input[type="datetime-local"]::-webkit-calendar-picker-indicator { filter: invert(0.8); cursor: pointer; }
.control-timewindow input[type="datetime-local"]:focus { outline: none; border-color: var(--accent); }

/* ───── Historic / Forecast range table (in-popup) ───── */
.map-popup .popup-mode { color: var(--text-3); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 2px; }
.map-popup .popup-table-wrap { max-height: 260px; overflow: auto; margin-top: 4px; border: 1px solid var(--border); border-radius: 6px; }
.map-popup table.popup-table { border-collapse: collapse; width: 100%; font-size: 0.72rem; }
.map-popup table.popup-table th, .map-popup table.popup-table td {
  padding: 4px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border);
}
.map-popup table.popup-table thead th {
  position: sticky; top: 0; background: var(--bg-2); color: var(--text-2);
  font-weight: 600; z-index: 1; border-bottom: 1px solid var(--border-2);
}
.map-popup table.popup-table th.col-time, .map-popup table.popup-table td.col-time {
  text-align: left; color: var(--text-3); position: sticky; left: 0; background: var(--bg-1);
}
.map-popup table.popup-table tbody tr:hover td { background: rgba(255, 255, 255, 0.03); }
.map-popup table.popup-table .cell-val { color: var(--c-num); font-weight: 600; }
.map-popup table.popup-table .cell-unit { color: var(--text-4); font-size: 0.66rem; }
.map-popup table.popup-table .cell-gap { color: var(--text-4); cursor: help; }
.map-popup .popup-bucket-note { color: var(--text-4); font-size: 0.64rem; margin-top: 4px; }
.map-popup .popup-unavailable { color: var(--text-3); font-size: 0.8rem; padding: 4px 0; line-height: 1.45; }

/* Anchor ✕ marker. */
.map-anchor-x { color: var(--text); font-weight: 700; font-size: 14px; text-shadow: 0 0 4px var(--accent-glow); cursor: pointer; }

/* Provenance map table (Acknowledgements #9). */
.prov-table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-top: 18px; }
.prov-row {
  display: grid; grid-template-columns: 1.1fr 1.4fr 1fr; gap: 12px;
  padding: 10px 16px; border-top: 1px solid var(--border); align-items: baseline;
}
.prov-row:first-child { border-top: 0; }
.prov-head { background: var(--bg-2); color: var(--text-3); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.06em; }
.prov-name { color: var(--text); font-weight: 600; font-size: 0.82rem; }
.prov-sources { color: var(--text-2); font-size: 0.8rem; }
.prov-src { color: var(--text-2); }
.prov-lic code { color: var(--c-str); font-size: 0.72rem; }
@media (max-width: 720px) {
  .prov-row { grid-template-columns: 1fr; gap: 2px; }
  .prov-head { display: none; }
  .prov-name { font-size: 0.85rem; }
}

/* ───────────────────────────────────────────────
   Auth — login page, Account dropdown, cookie notice
   (RSAWEB-33). Existing :root tokens only — no new
   colours / fonts / radii / shadows introduced.
─────────────────────────────────────────────── */

.login-card-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 6px;
}
.login-card-sub {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.5;
  margin-bottom: 20px;
}
.login-form { display: flex; flex-direction: column; gap: 8px; }
.login-field-label {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.login-input { font-size: 14px; }
.login-error {
  font-size: 12.5px;
  color: var(--accent-2);
  line-height: 1.45;
  margin: 2px 0;
  min-height: 18px;
}
.login-error-slot { color: transparent; }
.login-submit { margin-top: 8px; }
.page-login .footer { border-top: 1px solid var(--border); }

/* ───── Account dropdown (top-right nav popover) ───── */
.account-menu { position: relative; }
.account-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-pill);
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
@media (hover: hover) {
  .account-toggle:hover { border-color: var(--text-3); color: var(--text); }
}
.account-menu.is-open .account-toggle {
  border-color: var(--accent);
  color: var(--text);
  background: var(--bg-3);
}
.account-toggle-dot { color: var(--accent); font-size: 13px; line-height: 1; }
.account-caret { color: var(--text-3); font-size: 10px; transition: transform 0.15s ease; }
.account-menu.is-open .account-caret { transform: rotate(180deg); }

.account-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1200;
  width: 268px;
  background: rgba(12, 17, 25, 0.96);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(9px) saturate(120%);
  -webkit-backdrop-filter: blur(9px) saturate(120%);
  padding: 14px 16px 16px;
}
.account-panel[hidden] { display: none; }
.account-row { padding: 2px 0; line-height: 1.45; }
.account-name { color: var(--text); font-weight: 600; font-size: 14px; }
.account-email {
  color: var(--text-3); font-size: 12px; word-break: break-all; margin-bottom: 6px;
}
.account-expiry {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.account-expiry-date {
  display: block;
  color: var(--text);
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  margin-top: 3px;
}
.account-hint {
  display: inline-block;
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--warn);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.account-expiry.is-expired .account-hint { color: var(--accent-2); }
.account-logout { margin-top: 14px; }

/* On mobile/tablet the nav-cluster becomes a drawer; let the popover sit inline.
   Breakpoint matches the nav drawer (820 px) so the panel never tries to render
   as a 268 px absolute popover inside the column drawer. */
@media (max-width: 820px) {
  .account-menu { width: 100%; margin-top: 8px; }
  .account-toggle { width: 100%; justify-content: center; min-height: 44px; }
  .account-panel {
    position: static; width: 100%; margin-top: 8px; box-shadow: none;
  }
}

/* ───── Cookie notice — floating launcher + centred popup ─────
   A small circular "cookie" button pinned bottom-left on every page. Tapping it
   opens the notice in the shared glassmorphic .filter-modal shell. "I understand"
   dismisses the launcher for good; closing the popup any other way keeps it.
   Sits below the modal layer (z 1200) so it never floats over an open dialog. */
.cookie-launcher {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 1100;
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(12, 17, 25, 0.92);
  border: 1px solid var(--border-2);
  color: var(--accent);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.cookie-launcher[hidden] { display: none; }
@media (max-width: 600px) {
  .cookie-launcher { left: 12px; bottom: 12px; width: 40px; height: 40px; }
  .cookie-launcher-icon { width: 20px; height: 20px; }
}
@media (hover: hover) {
  .cookie-launcher:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    color: var(--accent-2);
    box-shadow: var(--shadow-accent);
  }
}
.cookie-launcher:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.cookie-launcher-icon { width: 26px; height: 26px; display: block; }
/* Hover/focus tooltip ("Cookie notice"), reading out to the right of the icon. */
.cookie-launcher-tip {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  white-space: nowrap;
  background: rgba(12, 17, 25, 0.96);
  color: var(--text-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  font-size: 12px;
  letter-spacing: 0.02em;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%) translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.cookie-launcher:hover .cookie-launcher-tip,
.cookie-launcher:focus-visible .cookie-launcher-tip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Cookie popup reuses the .filter-modal shell. */
.cookie-modal-card { width: min(420px, 100%); }
.cookie-modal-body { padding-top: 2px; }
.cookie-modal-body .cookie-notice-text {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.55;
  margin: 0 0 16px;
}
.cookie-modal-body .cookie-notice-btn { white-space: nowrap; }

/* ───── Privacy policy popup (reuses the .filter-modal shell) ─────
   A long document, so unlike the other popups the CARD does not scroll: it is a
   flex column with the header (title + download + close + version line) pinned
   and only .privacy-modal-body scrolling. Same technique as #filter-modal. */
.privacy-modal-card {
  width: min(760px, 100%);
  display: flex; flex-direction: column;
  max-height: min(82vh, 800px);
  overflow: hidden;                 /* overrides the shell's overflow-y: auto */
  padding-bottom: 0;
}
/* Bottom fade — signals "there is more below" on a card whose content is always
   taller than the viewport. Sits inside the card's overflow: hidden. */
.privacy-modal-card::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 26px;
  background: linear-gradient(to bottom, rgba(12, 17, 25, 0), rgba(12, 17, 25, 0.92));
  pointer-events: none;
}
.privacy-modal-head {
  flex: 0 0 auto; position: relative;
  padding-right: 64px;              /* clear of the download + ✕ button pair */
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.privacy-modal-head .filter-modal-title { margin-bottom: 4px; }
.privacy-meta {
  margin: 0; font-size: 11.5px; color: var(--text-4); letter-spacing: 0.02em;
}
/* Download + close, grouped top-right. The shell positions .filter-modal-close
   absolutely, so it is re-anchored here to sit beside the download button. */
.privacy-modal-tools {
  position: absolute; top: -2px; right: 0;
  display: inline-flex; align-items: center; gap: 6px;
}
.privacy-modal-tools .filter-modal-close { position: static; top: auto; right: auto; }
.privacy-download {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0;
  background: transparent; border: 0; border-radius: var(--radius-sm);
  color: var(--text-3); cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.privacy-download svg { width: 17px; height: 17px; display: block; }
.privacy-download:hover { color: var(--accent-2); background: var(--accent-dim); }
.privacy-download:focus-visible {
  outline: none; color: var(--accent-2);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.privacy-modal-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  overscroll-behavior: contain;     /* don't chain the scroll to the page behind */
  padding: 14px 12px 20px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}
.privacy-modal-body:focus-visible { outline: none; }
.privacy-modal-body::-webkit-scrollbar { width: 9px; }
.privacy-modal-body::-webkit-scrollbar-track { background: transparent; }
.privacy-modal-body::-webkit-scrollbar-thumb {
  background: var(--border-2); border-radius: var(--radius-pill);
  border: 2px solid transparent; background-clip: content-box;
}
.privacy-modal-body::-webkit-scrollbar-thumb:hover { background: var(--text-4); background-clip: content-box; }

.privacy-sec { margin-bottom: 20px; }
.privacy-sec:first-child h4 { margin-top: 0; }
.privacy-sec:last-child { margin-bottom: 0; }
.privacy-sec h4 {
  margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--text);
  letter-spacing: 0.01em;
}
.privacy-sec p {
  margin: 0 0 9px; font-size: 12.7px; color: var(--text-2); line-height: 1.62;
}
.privacy-sec p:last-child { margin-bottom: 0; }
.privacy-sec strong { color: var(--text); font-weight: 600; }
.privacy-sec ul { margin: 0 0 9px; padding-left: 17px; }
.privacy-sec li {
  font-size: 12.7px; color: var(--text-2); line-height: 1.6; margin-bottom: 7px;
}
.privacy-sec li::marker { color: var(--text-4); }
.privacy-sec li:last-child { margin-bottom: 0; }
.privacy-sec code {
  font-size: 0.92em; color: var(--text); background: var(--bg-3);
  border: 1px solid var(--border); border-radius: 4px; padding: 0 4px;
}
.privacy-link {
  color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px;
}
.privacy-link:hover { color: var(--text); }
/* Unfinished company/retention details. Deliberately conspicuous so they cannot
   ship unnoticed — see the placeholder list in templates/_privacy_modal.html. */
.privacy-todo {
  color: var(--warn); border-bottom: 1px dotted currentColor; font-style: normal;
}

@media (max-width: 560px) {
  .privacy-modal-card { max-height: 88vh; }
  .privacy-modal-body { padding-right: 6px; }
  .privacy-sec p, .privacy-sec li { font-size: 12.4px; }
  /* Comfortable tap targets for the header controls. */
  .privacy-download { width: 34px; height: 34px; }
  .privacy-modal-head { padding-right: 76px; }
}

@media (max-width: 560px) {
  .cookie-launcher { left: 12px; bottom: 12px; width: 40px; height: 40px; opacity: 0.85; }
  .cookie-launcher-icon { width: 20px; height: 20px; }
  /* No hover on touch — the tap opens the popup, so the tip is redundant. */
  .cookie-launcher-tip { display: none; }
  .cookie-modal-body .cookie-notice-btn { min-height: 44px; }
}

/* ───────────────────────────────────────────────
   RSAWEB-34 — customer-facing UI/UX + copy pass.
   Existing :root tokens only (no new colours / fonts /
   radii / shadows). Covers: accent nav wordmark, hero
   benefit headline + trust strip, control hierarchy,
   promoted Filters CTA + on-map callout, activity
   presets, friendlier acks (pills + visible source
   domains + two-zone), login polish, and a mobile
   horizontal-overflow containment pass.
─────────────────────────────────────────────── */

/* ── Brand mark (real wave-signal icon, replaces the ▣ glyph) ── */
.brand-mark-img {
  display: inline-block; width: 30px; height: 27px; flex: 0 0 auto;
  vertical-align: middle; object-fit: contain;
}
.footer-brand .brand-mark-img { width: 24px; height: 22px; vertical-align: -5px; }

/* ── Nav: accent wordmark + Contact link ── */
.brand .brand-name.cdw-wordmark { letter-spacing: -0.015em; }
.brand .brand-name.cdw-wordmark .accent { color: var(--accent); }
.nav-links a.nav-contact { cursor: pointer; }

/* ── API page: source pills ── */
.api-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.api-pill {
  font-size: 0.8rem; color: var(--text-2); padding: 7px 14px;
  border-radius: var(--radius-pill); border: 1px solid var(--border-2); background: var(--bg-2);
}

/* ── Login marketing tweaks (RSAWEB-36 review) — additive only ── */
/* "Talk to us / free trial" CTA directly under the login box. */
.login-card-cta { margin-top: 14px; font-size: 13px; color: var(--text-3); line-height: 1.5; }
/* ── Features: sticky-scroll showcase ──
   Left rail of four steps; a single sticky panel on the right swaps to whichever
   step is nearest the middle of the viewport (login-showcase.js).

   Built as ONE grid with explicit placement rather than two wrapper columns, so
   the DOM can stay in reading order (step, panel, step, panel...) and collapse to
   a single column on narrow screens with each panel already beneath its step.
   grid-template-rows is pinned to the number of steps - update it if a fifth
   capability is ever added. ── */
.login-showcase {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  grid-template-rows: repeat(4, auto);   /* one row per step; see note above */
  column-gap: 54px;
  margin-top: 30px;
}

/* Steps: tall enough that scrolling moves through them one at a time. */
.showcase-step {
  grid-column: 1;
  display: flex; flex-direction: column; justify-content: center;
  min-height: 66vh; padding: 34px 0 34px 22px;
  border-left: 2px solid var(--border);
  transition: border-color 0.35s ease, opacity 0.35s ease;
}
.showcase-index {
  font-size: 11px; font-weight: 600; letter-spacing: 0.18em;
  color: var(--text-4); margin-bottom: 10px;
  transition: color 0.35s ease;
}
.showcase-step-title {
  margin: 0 0 10px; font-size: clamp(19px, 2vw, 26px); font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.25; color: var(--text);
}
.showcase-step-desc {
  margin: 0; font-size: 13.5px; line-height: 1.65; color: var(--text-2);
  max-width: 46ch;
}

/* Sticky stage. Every panel occupies the SAME grid area (column 2, all rows), so
   they stack and cross-fade in place; each is sticky within that shared area. */
.showcase-panel {
  grid-column: 2; grid-row: 1 / -1;
  position: sticky; top: calc(var(--nav-h) + 42px);
  align-self: start;
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-soft);
  padding: 20px 22px;
}
.showcase-panel-title {
  margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--text);
  letter-spacing: 0.01em;
}
.showcase-panel-body > :last-child { margin-bottom: 0; }

/* Captured UI screenshots. object-fit: contain keeps the very different aspect
   ratios (a tall picker, a wide toggle strip, a JSON block) inside one frame
   without cropping or distortion. */
.showcase-shot {
  margin: 0 0 14px; padding: 10px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.showcase-shot img {
  display: block; width: 100%; height: auto;
  max-height: 330px; object-fit: contain; object-position: left top;
  border-radius: 4px;
}
/* A secondary shot of a small UI control renders at its NATURAL size, centred -
   stretching a 300px-wide segmented control to the panel width would blur it,
   and shrinking a wide one makes its labels unreadable. */
.showcase-shot-stack img + img {
  width: auto; max-width: 100%; height: auto; max-height: none;
  margin: 12px auto 0;
}

/* Progressive enhancement: with no JS every panel renders (stacked), so the copy
   is never hidden behind a script. login-showcase.js adds .is-enhanced, which is
   what turns on the one-at-a-time behaviour and the dimming of inactive steps. */
.login-showcase.is-enhanced .showcase-panel {
  opacity: 0; visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.login-showcase.is-enhanced .showcase-panel.is-active {
  opacity: 1; visibility: visible;
}
.login-showcase.is-enhanced .showcase-step { opacity: 0.4; }
.login-showcase.is-enhanced .showcase-step.is-active { opacity: 1; }
.login-showcase.is-enhanced .showcase-step.is-active { border-left-color: var(--accent); }
.login-showcase.is-enhanced .showcase-step.is-active .showcase-index { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .login-showcase.is-enhanced .showcase-panel,
  .showcase-step, .showcase-index { transition: none; }
}

/* Single column: sticky is dropped and each panel simply follows its own step,
   which the DOM order already provides. */
@media (max-width: 980px) {
  .login-showcase {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    column-gap: 0;
  }
  .showcase-step {
    grid-column: 1; min-height: 0; padding: 0 0 12px 18px;
  }
  .showcase-panel {
    grid-column: 1; grid-row: auto;
    position: static; margin: 0 0 34px 18px;
  }
  /* The step's own heading sits directly above, so the panel title is noise. */
  .showcase-panel-title { display: none; }
  /* Never hide content when there is no sticky stage to swap it into. */
  .login-showcase.is-enhanced .showcase-panel {
    opacity: 1; visibility: visible;
  }
  .login-showcase.is-enhanced .showcase-step { opacity: 1; }
  .showcase-shot img { max-height: 340px; }
}

@media (max-width: 560px) {
  .showcase-step { padding-left: 14px; }
  .showcase-panel { margin-left: 14px; padding: 16px 16px 14px; }
}

/* ── Feature popups (reuse the .filter-modal shell). One consistent size; the
   inherited max-height: 82vh + overflow-y: auto handle longer content. ── */
.feature-modal-card { width: min(620px, 100%); }
.feature-modal-body { padding-top: 2px; }
.feature-lede {
  color: var(--text-2); font-size: 0.9rem; line-height: 1.55; margin: 0 0 12px;
}
.feature-subhead {
  color: var(--text); font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.02em; margin: 14px 0 8px;
}
/* Red ▸-triangle bullets, matching the login hero's .login-points list. */
.feature-points { list-style: none; margin: 4px 0 2px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.feature-points li {
  position: relative; padding-left: 20px;
  font-size: 13.5px; color: var(--text-2); line-height: 1.5;
}
.feature-points li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); }
.feature-points li strong { color: var(--text); font-weight: 600; }
/* Two-column variant for the long "readings you can explore" list. */
.feature-points-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 22px; }
@media (max-width: 460px) { .feature-points-cols { grid-template-columns: 1fr; } }
/* The map screenshot inside the Interactive map popup. */
.feature-shot-wrap { position: relative; margin-top: 6px; }
.feature-shot {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--border); border-radius: 10px;
}
/* Full-screen button, bottom-right of the screenshot → opens the lightbox. */
.feature-shot-expand {
  position: absolute; right: 10px; bottom: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  background: rgba(5, 7, 10, 0.72); color: var(--text);
  border: 1px solid var(--border-2); border-radius: 8px; cursor: pointer;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.feature-shot-expand:hover { border-color: var(--accent); color: var(--accent); }
.feature-shot-expand svg { display: block; }

/* Screenshot lightbox: the same glassmorphic shell, image at ~80% of viewport. */
.feature-lightbox { z-index: 1300; }
.feature-lightbox-img {
  position: relative; z-index: 1;
  max-width: 80vw; max-height: 80vh; width: auto; height: auto;
  border: 1px solid var(--border-2); border-radius: 10px; box-shadow: var(--shadow-soft);
}
.feature-lightbox-close {
  position: absolute; top: 18px; right: 22px; z-index: 2;
  background: transparent; border: 0; color: var(--text-2);
  font-size: 1.45rem; line-height: 1; cursor: pointer;
}
.feature-lightbox-close:hover { color: var(--text); }
/* Static code terminals inside popups: keep them compact and wrap long lines
   within the block (rather than scroll/clip) so nothing is cut off. */
.feature-terminal { margin-top: 6px; max-width: 100%; }
.feature-terminal .terminal-body { font-size: 11.5px; line-height: 1.6; }
.feature-terminal .terminal-body .line { white-space: pre-wrap; overflow-wrap: anywhere; }
/* A line of copy below a terminal needs breathing room — match the gap above it. */
.feature-terminal + .feature-lede { margin-top: 14px; }

/* Triple-chevron scroll cue at the bottom of the login hero → #who. */
html { scroll-behavior: smooth; }  /* Hide the triple-chevron scroll cue on mobile (desktop unchanged). */
@keyframes scrollCue {
  0%, 100% { transform: rotate(45deg) translate(0, 0); }
  50%      { transform: rotate(45deg) translate(3px, 3px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  }

/* ── Map hero: benefit headline accent + trust strip ── */
.map-hero-title .accent { color: var(--accent); }
.trust-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 18px; font-size: 12.5px; color: var(--text-2); letter-spacing: 0.01em;
}
.trust-strip .trust-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.45); animation: pulse 2.4s ease-in-out infinite;
}
.trust-strip .trust-item { white-space: nowrap; }
.trust-strip .trust-sep { color: var(--text-4); }

/* ── Controls strip: two rows (where + how far · when + units) ── */
.map-controls { display: flex; flex-direction: column; gap: 20px; align-items: stretch; }
.controls-row { display: flex; flex-wrap: wrap; gap: 18px 32px; align-items: flex-end; }
.controls-row .control-postcode { flex: 1 1 300px; }
.controls-row .control-radius { flex: 1 1 240px; }
.controls-row-bottom .control-group { flex: 0 0 auto; }
.control-primary > label { color: var(--text-2); }
.postcode-row { display: flex; gap: 8px; align-items: stretch; }
.postcode-row #postcode-input { flex: 1 1 auto; min-width: 0; }
.postcode-row #postcode-go { flex: 0 0 auto; align-self: auto; margin-top: 0; white-space: nowrap; }
.control-quiet { opacity: 0.82; transition: opacity 0.15s ease; }
.control-quiet:hover, .control-quiet:focus-within { opacity: 1; }

/* ── Promoted Filters CTA (sidebar) ── */
.sidebar-filters { border-color: rgba(var(--accent-rgb), 0.30); }
.filter-open-btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: var(--shadow-accent); text-align: center;
}
.filter-open-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* ── On-map onboarding callout (glass overlay) ── */
.map-callout {
  position: absolute; z-index: 500; top: 18px; left: 50%; transform: translateX(-50%);
  max-width: min(420px, calc(100% - 32px));
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  padding: 18px 22px;
  background: rgba(12, 17, 25, 0.82); border: 1px solid var(--border-2);
  border-radius: var(--radius); box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px) saturate(120%); -webkit-backdrop-filter: blur(10px) saturate(120%);
}
.map-callout.is-hidden { display: none; }
.map-callout-text { margin: 0; font-size: 13.5px; color: var(--text-2); line-height: 1.5; }

/* ── Filters modal: helper line + activity presets ── */
.filter-modal-help { margin: 0 0 14px; font-size: 0.82rem; color: var(--text-3); line-height: 1.5; }
.filter-presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.filter-presets[hidden] { display: none; }
.preset-chip {
  font-family: var(--font-sans); font-size: 0.8rem; cursor: pointer;
  padding: 8px 14px; border-radius: var(--radius-pill);
  background: var(--bg-2); color: var(--text-2); border: 1px solid var(--border-2);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.preset-chip:hover { border-color: var(--text-3); color: var(--text); }
.preset-chip.is-on {
  background: var(--accent-dim); color: var(--accent); border-color: rgba(var(--accent-rgb), 0.40);
}

/* Filters modal: pin the header (title + helper + presets) and the footer
   (Apply / Reset) so only the parameter list scrolls. Scoped to #filter-modal
   so the contact modal (same shell) is unaffected. */
#filter-modal .filter-modal-card {
  display: flex; flex-direction: column;
  max-height: 82vh; overflow: hidden; padding-bottom: 0;
}
#filter-modal #param-selector {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  border-top: 1px solid var(--border);
  margin-top: 6px; padding-top: 8px; padding-right: 4px;
}
#filter-modal .filter-modal-actions {
  position: static; flex: 0 0 auto;
  margin-top: 0; padding: 14px 0 18px; background: transparent;
}

/* ── Acknowledgements / Data & sources: licence pills + visible source domains ── */
.lic-pill {
  display: inline-block; padding: 2px 10px; font-size: 0.72rem; line-height: 1.5;
  border-radius: var(--radius-pill); background: var(--accent-dim);
  color: var(--accent-2); border: 1px solid rgba(var(--accent-rgb), 0.30); white-space: nowrap;
}
a.lic-pill { text-decoration: none; }
a.lic-pill:hover { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.50); }
.lic-note { display: inline; margin-left: 6px; font-size: 0.72rem; color: var(--text-4); }
.acks-ext-link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-2); }
.acks-ext-link:hover { color: var(--accent); }
.acks-ext-link .acks-ext { width: 14px; height: 14px; }
.acks-ext-link:hover .acks-ext { background-color: var(--accent); }
.acks-k { font-size: 0.72rem; }   /* nudge up from 0.66rem for readability */

/* ── Two-zone split: "for developers & re-publishers" ── */
.dev-zone { background: var(--bg-1); }
.dev-zone-banner {
  border: 1px solid var(--border-2); border-radius: var(--radius);
  padding: 24px; background: var(--bg-2); margin-bottom: 40px;
}
.dev-block { margin-top: 0; }
.dev-block + .dev-block { margin-top: 48px; }
.dev-block-title {
  font-size: clamp(20px, 2.4vw, 26px); font-weight: 700; letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.dev-block-lede { font-size: 14px; color: var(--text-3); margin-bottom: 18px; line-height: 1.6; }

.login-help { font-size: 12px; color: var(--text-4); margin: 2px 0 0; line-height: 1.5; }
.login-input[aria-invalid="true"] { border-color: var(--accent); }

/* ── Login: nav "Login" button + glassmorphic top-right popover, and a centred
   single-column hero (the key login now lives in the popover) ── */
.nav-login-btn {
  border-radius: var(--radius-sm);   /* rectangular, not the pill default */
  padding: 8px 20px;
  margin-left: 4px;
}

/* trust strip -> disclaimer  */

.login-api-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: rgba(var(--accent-rgb), 0.06);
  color: #fff;                       /* strong white text */
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  box-shadow: 0 0 18px var(--accent-glow);   /* light red glow on the outline */
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
@media (hover: hover) {
  .login-api-btn:hover {
    background: var(--accent-dim);
    border-color: var(--accent-2);
    box-shadow: 0 0 30px var(--accent-glow);
    transform: translateY(-1px);
  }
}

/* ════════ Login hero launchers + near-fullscreen capability popups ════════
   Replaces the old "Explore the API → / Interested?" CTA pair. Three rounded
   launcher discs open the Map / API / AI & MCP popups; those popups are now
   near-fullscreen and (for API/MCP) host replayable MacBook terminals driven
   by login-demos.js. All additive + scoped to the login surface. */

/* ── Large popups (Map / API / AI & MCP): wide, but sized to their content and
   capped at 90vh, so they stay vertically centred (no empty space on tall
   monitors) and only scroll when the content actually overflows. ── */
.feature-modal-xl {
  width: 94vw;
  max-width: 1400px;
  max-height: 90vh;          /* cap only — height follows content, stays centred */
  display: flex;
  flex-direction: column;
  padding: 22px 26px 20px;
}
.feature-modal-xl-body {
  flex: 0 1 auto;            /* take content height; shrink + scroll only if capped */
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}
@media (max-width: 560px) {
  .feature-modal-xl { width: calc(100vw - 24px); max-height: 92vh; padding: 18px 16px 14px; }
}

/* ── Map demo video (replaces the old screenshot + lightbox) ── */
.feature-video-wrap {
  margin-top: 12px;
  display: flex; align-items: center; justify-content: center;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.feature-video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
}

/* ── Replayable demo cards (API baked calls / MCP transcripts) ──
   Reuse the global endpoint-row + .hero-terminal/.terminal-* classes; these
   are the login-only bits the post-login api.html otherwise ships via
   api-docs.css. */
.login-demo { margin-top: 14px; }
/* Chip row: pick which baked example replays into the single shared terminal. */
.login-demo-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.login-demo-tab {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.login-demo-tab::before { content: "\25B6"; color: var(--accent); font-size: 9px; }
@media (hover: hover) { .login-demo-tab:hover { border-color: var(--accent); color: var(--text); } }
.login-demo-tab.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.login-demo-tab.is-on::before { color: #fff; }
/* The single shared MacBook terminal (keeps .hero-terminal's border + radius). */
.login-demo-terminal { max-width: 100%; margin: 0; }
.login-demo-terminal.is-active { box-shadow: 0 0 0 1px var(--accent-glow), var(--shadow-soft); }
.login-demo-terminal .terminal-body {
  max-height: 360px; overflow: auto;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.login-demo-terminal .terminal-body .term-line { white-space: pre-wrap; word-break: break-word; min-height: 1.2em; }
.login-demo-terminal .js-cmd { color: var(--text); white-space: pre-wrap; word-break: break-all; }
.login-demo-terminal .term-resp { margin: 8px 0 0; }
.login-demo-hint { color: var(--text-4); font-size: 12.5px; }
.login-demo-terminal .cursor {
  display: inline-block; width: 8px; height: 14px;
  background: var(--accent); vertical-align: -2px;
  animation: blink 1s steps(2) infinite;
}
.login-demo-cta { display: flex; justify-content: center; margin-top: 24px; }
/* MCP popover: custom-ML prompt + centred Contact CTA under the shared terminal. */
.login-mcp-cta {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center;
}
.login-mcp-ml-line {
  margin: 0;
  color: var(--text-2); font-size: 0.92rem; line-height: 1.6;
  text-wrap: pretty;   /* one line where it fits; never a lone last word */
}

/* ── Login demo terminal: hold a constant, roomy size whether or not a call has
   been replayed. Without a height the terminal collapses to the single "Pick an
   example…" hint line, leaving the near-fullscreen popup mostly empty; here it
   stays put and streamed JSON scrolls *inside* the body instead of growing/
   reflowing the card. Scoped to .login-demo-terminal, so the landing-hero
   .hero-terminal is untouched; covers both the API and MCP popups. ── */
.login-demo-terminal {
  display: flex;
  flex-direction: column;
  height: clamp(420px, 56vh, 620px);   /* KNOB: constant + responsive */
}
.login-demo-terminal .terminal-body {
  flex: 1 1 auto;
  min-height: 0;        /* load-bearing: lets the body scroll, not expand the card */
  max-height: none;     /* was 360px — the flex height owns sizing now */
}
/* Centre the placeholder while the terminal is empty. */
.login-demo-terminal .login-demo-hint {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
/* MCP chats are short, so give that terminal a slightly shorter box than the API
   one (which streams long JSON) - still roomy, just less empty space below the
   transcript. Scoped to the MCP demo only. */
.login-demo[data-demo-kind="mcp"] .login-demo-terminal {
  height: clamp(340px, 44vh, 460px);
}

/* Pitch on a single line at tablet/desktop widths (wraps on small phones). */
/* Glassmorphic login dropdown, anchored top-right under the nav. */
.login-popover[hidden] { display: none; }
.login-popover-backdrop {
  position: fixed; inset: 0; z-index: 1190;
  /* Soft glassmorphic blur + faint dim of the page behind the open dropdown. */
  background: rgba(5, 7, 10, 0.40);
  backdrop-filter: blur(9px) saturate(115%);
  -webkit-backdrop-filter: blur(9px) saturate(115%);
}
.login-popover-card {
  position: fixed;
  top: calc(var(--nav-h) + 12px);
  right: 24px;
  z-index: 1200;
  width: min(380px, calc(100vw - 32px));
  max-height: calc(100vh - var(--nav-h) - 28px);
  overflow-y: auto;
  background: rgba(18, 18, 18, 0.78);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  padding: 24px 24px 20px;
  animation: loginPopIn 0.16s ease;
}
@keyframes loginPopIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .login-popover-card { animation: none; }
}
/* Mobile/tablet (Login lives in the hamburger drawer): centre the panel as a
   modal in the middle of the screen instead of anchoring it top-right. */
@media (max-width: 820px) {
  .login-popover-card {
    top: 50%; left: 50%; right: auto;
    transform: translate(-50%, -50%);
    width: min(380px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    animation: loginPopInCentre 0.16s ease;
  }
  /* In the drawer the Login button stretches like the other drawer items. */
  .nav-cluster .nav-login-btn { width: 100%; margin: 10px 0 0; min-height: 44px; }
}
@keyframes loginPopInCentre {
  from { opacity: 0; transform: translate(-50%, -46%); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}
@media (prefers-reduced-motion: reduce) {
  .login-popover-card { animation: none; }
}

/* ── Mobile horizontal-overflow containment (390px primary device) ── */
@media (max-width: 720px) {
  .seg-toggle .seg { min-height: 44px; }
  /* Stacked provenance rows: surface the hidden header as inline labels. */
  .prov-row > span[data-label]::before {
    content: attr(data-label);
    display: block; margin-bottom: 2px;
    font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-4);
  }
}
@media (max-width: 560px) {
  .container { padding: 0 18px; }
  .nav-inner { padding: 0 18px; }
  .trust-strip { font-size: 12px; gap: 6px; }
}
@media (max-width: 480px) {
  .controls-row { flex-direction: column; align-items: stretch; gap: 16px; }
  /* Stacked: flex-basis would become a height, leaving tall empty gaps. */
  .controls-row > *,
  .controls-row .control-postcode,
  .controls-row .control-radius { flex: 0 0 auto; }
  /* Clear the fullscreen button in the map's top-right corner. */
  .map-callout { top: 64px; }
  .controls-row .seg-toggle { width: 100%; }
  .controls-row .seg-toggle .seg { flex: 1 1 0; }
  .postcode-row { flex-wrap: wrap; }
  .postcode-row #postcode-go { width: 100%; }
  /* Historic/Forecast range: let the two datetime inputs stack full-width
     instead of overflowing the row on small phones. */
  .timewindow-row .tw-fields { flex-wrap: wrap; }
  #tw-range input[type="datetime-local"] { flex: 1 1 100%; }
}

/* ───────────────────────────────────────────────
   Map fullscreen (pseudo-fullscreen)
   Only the .map-pane goes fixed/full-viewport; the sidebar, legend and page
   stay put. The filter modal (.filter-modal, z-1200) lives at body level and
   paints ABOVE the fullscreen pane (z-1000) with no reparenting, so filters
   keep working. Existing :root tokens only; no new colours/fonts.
─────────────────────────────────────────────── */
.map-pane.is-fullscreen {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 100vh;            /* fallback for browsers without dvh */
  height: 100dvh;           /* mobile-safe against the dynamic URL bar */
  z-index: 1000;
  margin: 0;
  border: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;   /* #map flexes to fill, #map-status stays a thin bar */
}
.map-pane.is-fullscreen #map {
  flex: 1 1 auto;
  height: auto;             /* override the fixed 70vh so it fills the pane */
  min-height: 0;
}
.map-pane.is-fullscreen .map-status { flex: 0 0 auto; }
body.map-fullscreen { overflow: hidden; }   /* lock background scroll while fullscreen */

/* Themed glass overlay buttons that sit on the map (toggle / show-more / filters). */
.map-overlay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;         /* >=44px tap target */
  padding: 10px 16px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  background: rgba(12, 17, 25, 0.82);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
@media (hover: hover) {
  .map-overlay-btn:hover { color: var(--accent); border-color: var(--accent); }
}
.map-overlay-btn .fs-ic { width: 16px; height: 16px; display: block; }

/* Enter/exit fullscreen toggle - always top-right (normal AND fullscreen). */
.map-fs-toggle {
  position: absolute;
  z-index: 600;             /* above the callout (500), below the modal (1200) */
  top: 12px; right: 12px;
}

/* Legend + "Show more" stack - top-left, fullscreen only. Its top offset clears
   the Leaflet +/- zoom control (and the toggle's row) so the legend sits below
   them; the shared gap keeps the legend and "Show more" equidistant. */
.map-fs-stack {
  position: absolute;
  z-index: 600;
  display: none;
  top: 91px; left: 12px;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  max-width: calc(100% - 24px);
  pointer-events: none;     /* let map drag through the gaps between items */
}
.map-fs-stack > * { pointer-events: auto; }
.map-pane.is-fullscreen .map-fs-stack { display: flex; }

/* Fullscreen toggle - icon swaps on state. */
.map-fs-toggle .fs-ic-collapse { display: none; }
.map-pane.is-fullscreen .map-fs-toggle .fs-ic-expand { display: none; }
.map-pane.is-fullscreen .map-fs-toggle .fs-ic-collapse { display: block; }

/* "Show more" controls button - fullscreen only. */
.map-fs-more { display: none; }
.map-pane.is-fullscreen .map-fs-more { display: inline-flex; }

/* Legend parked in the stack while fullscreen - glass treatment to match. */
.map-fs-stack #legend-section {
  width: auto;
  min-width: 190px;
  background: rgba(12, 17, 25, 0.82);
  border-color: var(--border-2);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

/* Filters entry point - fullscreen only; lifted above the status line, centred. */
.map-fs-filters {
  position: absolute;
  z-index: 600;
  display: none;
  bottom: 58px; left: 50%; transform: translateX(-50%);
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
}
@media (hover: hover) {
  .map-fs-filters:hover { color: #fff; background: var(--accent-hover); border-color: var(--accent-hover); }
}
.map-pane.is-fullscreen .map-fs-filters { display: inline-flex; }
