/* Flood Zone API: developer docs layout. Geist + Geist Mono, water-blue accent, dark code. */
:root {
  --bg: #ffffff;
  --bg-soft: #f4f6f9;
  --ink: #0e1621;
  --ink-2: #334155;
  --muted: #56616e;
  --rule: #e2e8f0;
  --field: #737f8c;
  --accent: #0a62b8;
  --accent-dark: #084f96;
  --accent-soft: #e8f1fb;
  --code-bg: #0b1622;
  --code-bar: #111f2e;
  --code-ink: #d7e1ec;
  --code-dim: #8fa3b8;
  --c-key: #7cc4ff;
  --c-str: #9fe0b9;
  --c-num: #f5c77e;
  --c-lit: #f0a3c8;
  --ok: #0f7a3d;
  --warn: #8a5a00;
  --err: #b42318;
  --topbar-h: 60px;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.65 var(--sans); font-feature-settings: 'ss01' on;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }
code, kbd, samp, pre { font-family: var(--mono); }
:not(pre) > code {
  font-size: .88em; background: var(--bg-soft); border: 1px solid var(--rule);
  border-radius: 5px; padding: .08em .35em; color: var(--ink); overflow-wrap: anywhere;
}

/* Accessibility utilities */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 1000; background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 6px; font-weight: 600; text-decoration: none; transition: top .15s ease;
}
.skip-link:focus { top: 8px; color: #fff; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px;
}

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--topbar-h);
  background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--rule);
  backdrop-filter: saturate(1.4) blur(6px);
}
.topbar-inner {
  height: 100%; max-width: 1320px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-name { font-size: 1.02rem; }
.brand-name span { font-family: var(--mono); font-weight: 500; color: var(--accent); }
.topnav { display: flex; gap: 22px; margin-left: 8px; }
.topnav a { color: var(--ink-2); text-decoration: none; font-size: .95rem; padding: 6px 0; }
.topnav a:hover, .topnav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.topbar-cta { margin-left: auto; }
.menu-btn {
  display: none; margin-left: auto; font: 500 .95rem var(--sans); color: var(--ink);
  background: var(--bg); border: 1px solid var(--field); border-radius: 8px; padding: 7px 14px; cursor: pointer;
}

/* Shell: sidebar + content */
.shell {
  max-width: 1320px; margin: 0 auto; display: grid;
  grid-template-columns: 250px minmax(0, 1fr); gap: 0;
}
.sidebar {
  position: sticky; top: var(--topbar-h); align-self: start;
  height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  padding: 28px 20px 40px 24px; border-right: 1px solid var(--rule);
}
.sidebar .side-h { font-size: .9rem; font-weight: 600; color: var(--ink); margin: 22px 0 6px; }
.sidebar .side-h:first-child { margin-top: 0; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a {
  display: block; padding: 5px 10px; margin-left: -10px; border-radius: 6px;
  color: var(--ink-2); text-decoration: none; font-size: .94rem;
}
.sidebar li a:hover { background: var(--bg-soft); color: var(--ink); }
.sidebar li a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-dark); font-weight: 500; }
.sidebar .side-mobile { display: none; }

.content { min-width: 0; padding: 40px 48px 80px; }
.content > * { max-width: 820px; }
.content > .wide { max-width: 1000px; }

/* Type */
h1 { font-size: 2.15rem; line-height: 1.15; letter-spacing: -.025em; font-weight: 700; margin: 0 0 16px; }
h2 { font-size: 1.45rem; line-height: 1.25; letter-spacing: -.015em; font-weight: 650; margin: 48px 0 12px; padding-top: 4px; }
h3 { font-size: 1.1rem; line-height: 1.3; font-weight: 600; margin: 30px 0 8px; }
p, ul, ol { margin: 0 0 16px; }
li { margin-bottom: 6px; }
.lede { font-size: 1.14rem; color: var(--ink-2); max-width: 720px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 40px 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 .95rem/1 var(--sans); text-decoration: none; cursor: pointer;
  border-radius: 8px; padding: 11px 18px; border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { background: var(--bg); color: var(--ink); border-color: var(--field); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--ink); }
.btn[disabled] { opacity: .6; cursor: progress; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 10px; }

/* Home hero */
.hero h1 { font-size: 2.6rem; max-width: 760px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 0; margin: 18px 0 0; list-style: none; color: var(--ink-2); font-size: .95rem; }
.facts li { margin: 0; padding-left: 18px; position: relative; }
.facts li::before { content: ''; position: absolute; left: 0; top: .62em; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }

/* Code */
.code {
  position: relative; margin: 18px 0 24px; background: var(--code-bg); color: var(--code-ink);
  border-radius: 10px; overflow: hidden; border: 1px solid #1c2c3d;
}
.code-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--code-bar); border-bottom: 1px solid #1c2c3d; padding: 8px 10px 8px 16px;
  font: 500 .84rem var(--mono); color: var(--code-dim);
}
.code-bar .label { color: var(--code-ink); }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-size: .86rem; line-height: 1.6; tab-size: 2; }
.code pre:focus-visible { outline-offset: -3px; }
.code .divider { border-top: 1px solid #1c2c3d; }
.copy-btn {
  font: 500 .8rem var(--sans); color: var(--code-ink); background: transparent;
  border: 1px solid #3a4f66; border-radius: 6px; padding: 4px 10px; cursor: pointer;
}
.copy-btn:hover { background: #1a2b3d; }
.copy-btn:focus-visible { outline-color: var(--c-key); }
.tk { color: var(--c-key); }
.ts { color: var(--c-str); }
.tn { color: var(--c-num); }
.tl { color: var(--c-lit); }
.tc { color: var(--code-dim); }
.hero-code pre { max-height: 560px; }

/* Field list (definition rows) */
.fields { border-top: 1px solid var(--rule); margin: 14px 0 26px; }
.field-row { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.field-row dt { font: 500 .9rem var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.field-row dt .type { display: block; font: 400 .82rem var(--mono); color: var(--muted); margin-top: 2px; }
.field-row dd { margin: 0; color: var(--ink-2); }
.field-row dd p:last-child { margin-bottom: 0; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 16px 0 26px; border: 1px solid var(--rule); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { background: var(--bg-soft); font-weight: 600; color: var(--ink); vertical-align: bottom; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td code, td.mono { font-family: var(--mono); font-size: .86rem; }
.table-wrap caption { text-align: left; padding: 10px 14px; color: var(--muted); font-size: .9rem; caption-side: bottom; }

/* Notes */
.note { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 14px 18px; border-radius: 0 8px 8px 0; margin: 20px 0; }
.note p:last-child { margin-bottom: 0; }
.note-plain { border-left-color: var(--field); background: var(--bg-soft); }

/* Stat strip (true product/data facts only) */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0; border: 1px solid var(--rule); border-radius: 10px; margin: 22px 0 28px; overflow: hidden; }
.stat { padding: 16px 18px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: -1px; }
.stat:last-child { border-right: 0; }
.stat b { display: block; font: 600 1.45rem/1.2 var(--mono); letter-spacing: -.02em; color: var(--ink); }
.stat span { display: block; color: var(--muted); font-size: .88rem; margin-top: 4px; }

/* Steps */
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 44px; margin-bottom: 26px; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font: 600 .88rem var(--mono); color: #fff; background: var(--accent);
}
.steps > li > h3 { margin-top: 0; }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; margin: 22px 0 28px; }
.plan { padding: 22px 20px; border-right: 1px solid var(--rule); }
.plan:last-child { border-right: 0; }
.plan h3 { margin: 0 0 6px; font-size: 1.05rem; }
.plan .price { font: 600 1.9rem/1.1 var(--sans); letter-spacing: -.03em; margin: 6px 0 2px; }
.plan .price small { font-size: .9rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan .calls { font-family: var(--mono); font-size: .92rem; color: var(--ink-2); margin: 0 0 4px; }
.plan .per { font-size: .86rem; color: var(--muted); margin: 0; }

/* Forms */
.form { border: 1px solid var(--rule); border-radius: 12px; padding: 22px; margin: 22px 0; background: var(--bg); }
.form h2, .form h3 { margin-top: 0; }
.form label { display: block; font-weight: 500; margin: 0 0 6px; }
.form input[type=email], .form input[type=text] {
  width: 100%; max-width: 420px; font: 400 1rem var(--sans); color: var(--ink);
  border: 1px solid var(--field); border-radius: 8px; padding: 10px 12px; background: #fff;
}
.form .row { margin: 0 0 16px; }
.form .hint { font-size: .88rem; color: var(--muted); margin: 6px 0 0; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
legend { font-weight: 500; margin-bottom: 8px; padding: 0; }
.plan-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.plan-pick { position: relative; }
.plan-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.plan-pick label {
  display: block; border: 1px solid var(--field); border-radius: 10px; padding: 12px 14px; cursor: pointer; margin: 0; font-weight: 400;
}
.plan-pick label b { display: block; font-weight: 600; }
.plan-pick label span { font-family: var(--mono); font-size: .86rem; color: var(--ink-2); }
.plan-pick input:checked + label { border: 2px solid var(--accent); padding: 11px 13px; background: var(--accent-soft); }
.plan-pick input:checked + label b::after { content: ' (selected)'; font-weight: 500; color: var(--accent-dark); font-size: .86rem; }
.plan-pick input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }
.status { margin: 14px 0 0; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--rule); background: var(--bg-soft); color: var(--ink); }
.status[hidden] { display: none; }
.status.ok { border-color: #9bd3b1; background: #eefaf2; }
.status.err { border-color: #f0b3ac; background: #fdf1f0; }
.status strong { display: block; margin-bottom: 2px; }

/* Account */
.meter { height: 10px; background: var(--bg-soft); border: 1px solid var(--rule); border-radius: 99px; overflow: hidden; margin: 8px 0 6px; max-width: 520px; }
.meter > i { display: block; height: 100%; background: var(--accent); }
.key-new { background: var(--code-bg); color: var(--code-ink); border-radius: 10px; padding: 16px; margin: 14px 0; }
.key-new code { background: transparent; border: 0; color: var(--c-str); font-size: .95rem; word-break: break-all; padding: 0; }
.key-new p { margin: 0 0 10px; }
.key-new .copy-btn { margin-top: 6px; }
.panel { border: 1px solid var(--rule); border-radius: 12px; padding: 20px 22px; margin: 18px 0; }
.panel h2 { margin: 0 0 10px; font-size: 1.2rem; }
.inline-list { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0; list-style: none; }
.inline-list li { margin: 0; }

/* Coverage */
.county-list { columns: 3 200px; column-gap: 28px; padding-left: 18px; font-size: .94rem; }
.county-list li { break-inside: avoid; }
.bar-cell { min-width: 120px; }
.bar { display: inline-block; height: 8px; background: var(--accent); border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.age-bars { margin: 14px 0 26px; }
.age-row { display: grid; grid-template-columns: 190px minmax(0, 1fr) 90px; gap: 12px; align-items: center; padding: 6px 0; font-size: .93rem; }
.age-row .track { background: var(--bg-soft); border: 1px solid var(--rule); height: 14px; border-radius: 3px; overflow: hidden; }
.age-row .track i { display: block; height: 100%; background: var(--accent); }
.age-row .val { font-family: var(--mono); text-align: right; font-size: .88rem; }

/* Footer */
.footer { border-top: 1px solid var(--rule); background: var(--bg-soft); margin-top: 20px; }
.footer-inner { max-width: 1320px; margin: 0 auto; padding: 26px 24px 34px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px 48px; font-size: .9rem; color: var(--ink-2); }
.footer p { margin: 0 0 8px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; align-content: flex-start; }
.footer nav a { color: var(--ink-2); }

/* Prose pages (legal) */
.prose h2 { font-size: 1.2rem; margin-top: 34px; }

/* Responsive */
@media (max-width: 1080px) {
  .topnav { display: none; }
  .content { padding: 34px 32px 72px; }
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan:nth-child(2) { border-right: 0; }
  .plan:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: inline-block; }
  .topbar-cta { display: none; }
  .sidebar {
    display: none; position: fixed; top: var(--topbar-h); left: 0; right: 0; bottom: 0; z-index: 40;
    /* align-self applies to fixed grid items too; stretch so the panel fills the screen. */
    height: auto; align-self: stretch; justify-self: stretch; overflow-y: auto;
    background: var(--bg); border-right: 0; padding: 20px 24px 40px;
  }
  .sidebar.open { display: block; }
  .sidebar .side-mobile { display: block; }
  .content { padding: 28px 16px 64px; }
  h1, .hero h1 { font-size: 1.85rem; }
  h2 { font-size: 1.3rem; }
  .field-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); padding: 22px 16px 30px; }
  .age-row { grid-template-columns: 120px minmax(0, 1fr) 70px; }
}
@media (max-width: 560px) {
  .plans { grid-template-columns: minmax(0, 1fr); }
  .plan { border-right: 0; border-bottom: 1px solid var(--rule); }
  .plan:last-child { border-bottom: 0; }
  .topbar-inner { padding: 0 16px; gap: 12px; }
  .code pre { font-size: .8rem; padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
