@font-face {
  font-family: "Source Sans 3";
  src: url("/source-sans-3.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #FFFFFF;
  --band: #F2F6FC;
  --surface-subtle: #F8FAFD;
  --ink: #13294B;
  --ink-deep: #0D1F3A;
  --muted: #4A5B73;
  --rule: #DCE3EE;
  --cobalt: #1452C4;
  --cobalt-hover: #0F3E96;
  --cobalt-soft: #EDF3FF;
  --ok: #0F7B58;
  --ok-bg: #E6F6F0;
  --bad: #B42318;
  --bad-bg: #FEE4E2;
  --warn: #9A4A06;
  --warn-bg: #FEF0C7;
  --highlight: #FFE16B;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --pill: 999px;
  --shadow-sm: 0 4px 14px -6px rgba(19, 41, 75, 0.08), 0 1px 3px rgba(19, 41, 75, 0.04);
  --shadow-md: 0 20px 48px -20px rgba(19, 41, 75, 0.14), 0 4px 14px -4px rgba(19, 41, 75, 0.05);
  --font-sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.56;
  -webkit-font-smoothing: antialiased;
}
.portal-body { background: var(--surface-subtle); min-height: 100vh; display: flex; flex-direction: column; }
.portal-main { flex: 1; padding: 36px 0 72px; }

h1, h2, h3 { margin: 0; color: var(--ink); font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(2.15rem, 4.4vw, 3.55rem); line-height: 1.08; }
h2 { font-size: clamp(1.5rem, 2.7vw, 2.25rem); line-height: 1.16; }
h3 { font-size: 1.2rem; line-height: 1.25; }
p, ul, dl, dd, pre { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }

.mono, code, pre { font-family: var(--font-mono); font-variant-numeric: tabular-nums lining-nums; }
code { font-size: 0.9em; background: var(--cobalt-soft); color: var(--ink-deep); padding: 2px 6px; border-radius: 5px; }
pre code { background: transparent; color: inherit; padding: 0; }
.hl { background: linear-gradient(transparent 58%, var(--highlight) 58%, var(--highlight) 92%, transparent 92%); padding: 0 3px; }
.muted { color: var(--muted); }
.text-ok { color: var(--ok); }
.text-bad { color: var(--bad); }

.skip-link { position: fixed; top: 10px; left: 10px; z-index: 100; padding: 10px 16px; background: var(--ink); color: #fff; border-radius: var(--radius-sm); transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.sr-only, .hp-field { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.wrap { width: min(100% - 44px, 1220px); margin-inline: auto; }

/* Header & Navigation */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.nav-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.12rem; letter-spacing: -0.02em; color: var(--ink); }
.brand-word span { font-weight: 500; color: var(--cobalt); }
.desktop-nav, .nav-actions, .portal-user-bar { display: flex; align-items: center; gap: 22px; }
.desktop-nav a, .nav-link { font-size: 0.95rem; font-weight: 600; color: var(--ink); padding: 6px 0; border-bottom: 2px solid transparent; }
.desktop-nav a:hover, .desktop-nav a[aria-current="page"], .nav-link:hover { color: var(--cobalt); border-bottom-color: var(--cobalt); }

.menu-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 42px; height: 42px; background: transparent; border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: 9px; }
.menu-toggle span { display: block; height: 2px; width: 100%; background: var(--ink); }
.mobile-drawer { border-top: 1px solid var(--rule); background: var(--paper); padding: 16px 22px 24px; }
.mobile-drawer nav { display: grid; gap: 12px; }
.mobile-drawer nav a:not(.btn) { font-weight: 600; padding: 6px 0; border-bottom: 1px solid var(--band); }

/* Buttons & Links */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border: 1px solid transparent; border-radius: var(--pill);
  background: var(--cobalt); color: #fff; font-weight: 650; font-size: 0.96rem; white-space: nowrap;
  box-shadow: 0 8px 20px -10px rgba(20, 82, 196, 0.5);
  transition: background-color 120ms ease, transform 120ms ease;
}
.btn:hover { background: var(--cobalt-hover); color: #fff; transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--rule); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--cobalt-soft); border-color: #BDD0FA; color: var(--cobalt); }
.btn-sm { min-height: 39px; padding: 0 16px; font-size: 0.9rem; }
.btn-xs { min-height: 32px; padding: 0 11px; font-size: 0.82rem; }
.btn-full { width: 100%; }
.text-link, .link-btn { color: var(--cobalt); font-weight: 650; text-decoration: underline; text-underline-offset: 0.2em; background: none; border: 0; padding: 0; font-size: 0.94rem; }
.text-link:hover, .link-btn:hover { color: var(--cobalt-hover); text-decoration-thickness: 2px; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 22px; }

/* Pills & Alerts */
.pill { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: var(--pill); font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-bad { background: var(--bad-bg); color: var(--bad); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-info, .pill-neutral { background: var(--cobalt-soft); color: var(--cobalt); }

.alert { padding: 13px 16px; border-radius: var(--radius-sm); border: 1px solid var(--rule); margin-bottom: 18px; font-size: 0.94rem; }
.alert-ok { background: var(--ok-bg); border-color: #B4E4D2; color: #0B5C41; }
.alert-bad { background: var(--bad-bg); border-color: #FBC7C3; color: #8A1A11; }
.alert-info { background: var(--cobalt-soft); border-color: #C7D7FE; color: var(--ink); }
.alert a { text-decoration: underline; font-weight: 700; }

/* Hero & Sections */
.hero-band { background: linear-gradient(180deg, #F4F8FE 0%, #FFFFFF 100%); border-bottom: 1px solid var(--rule); padding: clamp(40px, 6vw, 76px) 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(28px, 4.5vw, 56px); align-items: start; }
.eyebrow { font-size: 0.8rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.07em; color: var(--cobalt); margin-bottom: 10px; }
.lede { margin-top: 16px; font-size: clamp(1.05rem, 1.45vw, 1.2rem); color: var(--muted); max-width: 56ch; }
.micro-trust { margin-top: 14px; font-size: 0.86rem; color: var(--muted); }

.rate-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 22px; padding: 13px 15px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.rate-strip strong { display: block; font-size: 1.12rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.rate-strip span { font-size: 0.8rem; color: var(--muted); }

/* Hero Inspector Card */
.inspector-card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; }
.inspector-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--band); border-bottom: 1px solid var(--rule); }
.inspector-tabs button { border: 0; background: transparent; padding: 13px 14px; font-weight: 700; font-size: 0.92rem; color: var(--muted); border-bottom: 2px solid transparent; }
.inspector-tabs button.is-active { background: var(--paper); color: var(--cobalt); border-bottom-color: var(--cobalt); }
.inspector-body { padding: 20px; display: grid; gap: 14px; }
.ins-input-row { display: flex; gap: 8px; }
.ins-input-row input { flex: 1; min-width: 0; height: 42px; padding: 0 13px; border: 1px solid #B9C4D6; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 0.96rem; }
.preset-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.preset-chips button { border: 1px solid var(--rule); background: var(--surface-subtle); color: var(--ink); border-radius: var(--pill); padding: 4px 10px; font-size: 0.78rem; font-weight: 600; }
.preset-chips button:hover { border-color: var(--cobalt); color: var(--cobalt); background: var(--cobalt-soft); }
.ins-result { border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--surface-subtle); padding: 14px 16px; }
.ins-verdict-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.ins-verdict-label { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.verdict-text { font-size: 1.08rem; font-weight: 800; }
.verdict-text.is-ok { color: var(--ok); }
.verdict-text.is-bad { color: var(--bad); }
.verdict-text.is-warn { color: var(--warn); }
.ins-kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; padding-top: 12px; font-size: 0.87rem; }
.ins-kv-grid dt { color: var(--muted); font-size: 0.77rem; }
.ins-kv-grid dd { font-weight: 650; overflow-wrap: anywhere; }
.panel-note { font-size: 0.88rem; color: var(--muted); }
.ins-csv-actions { display: flex; align-items: center; gap: 14px; }
.mini-audit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; background: var(--band); padding: 11px; border-radius: var(--radius-sm); text-align: center; }
.mini-audit-grid strong { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.mini-audit-grid span { font-size: 0.75rem; color: var(--muted); }
.mini-cost-line { font-size: 0.88rem; font-weight: 650; color: var(--ok); }

/* General Layout, Cards & Tables */
.page-hero { background: var(--band); border-bottom: 1px solid var(--rule); padding: clamp(36px, 5vw, 60px) 0; }
.section { padding: clamp(44px, 6vw, 78px) 0; }
.band-ice { background: var(--band); border-block: 1px solid var(--rule); }
.section-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 14px; margin-bottom: 24px; }
.split-showcase { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(24px, 4vw, 52px); align-items: center; }
.prose-lead { margin-top: 12px; color: var(--muted); max-width: 54ch; }
.check-list { list-style: none; padding: 0; margin-top: 18px; display: grid; gap: 10px; }
.check-list li { position: relative; padding-left: 24px; font-size: 0.95rem; }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--ok); font-weight: 800; }

.card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-md); padding: clamp(18px, 2.6vw, 28px); box-shadow: var(--shadow-sm); }
.card p + p, .card h2 + p, .card h3 + p { margin-top: 8px; }
.feature-triad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.dual-cards, .calc-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 24px; align-items: start; }
.bundle-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 16px; margin-top: 20px; }
.bundle-card { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.bundle-pay { font-size: 1.85rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.bundle-pay small { font-size: 0.85rem; font-weight: 500; color: var(--muted); }

.table-card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-md); overflow-x: auto; box-shadow: var(--shadow-sm); }
.card-bar { display: flex; justify-content: space-between; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--rule); font-size: 0.9rem; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.92rem; }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--rule); vertical-align: top; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
thead th { background: var(--surface-subtle); font-weight: 700; color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.col-highlight { background: #F5F9FF; }

/* Code & Docs */
.code-card { border: 1px solid #243757; border-radius: var(--radius-md); background: #0E1D35; color: #E8EFFC; overflow: hidden; box-shadow: var(--shadow-md); }
.code-tab-bar { display: flex; gap: 4px; padding: 8px 12px; background: #152847; border-bottom: 1px solid #253B5E; }
.code-tab-bar button { border: 0; background: transparent; color: #A9B9D4; padding: 6px 12px; border-radius: 6px; font-size: 0.84rem; font-weight: 650; }
.code-tab-bar button.is-active { background: var(--cobalt); color: #fff; }
.code-box { background: #0E1D35; color: #E8EFFC; padding: 16px 18px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 0.84rem; line-height: 1.52; }
.code-card .code-box { border-radius: 0; }
.docs-stack { display: grid; gap: 22px; }
.docs-stack pre { margin-top: 12px; }
.prose-doc h2 { font-size: 1.3rem; margin-top: 22px; }
.prose-doc h2:first-child { margin-top: 0; }

/* Forms, Sliders & Portal */
.stack-form { display: grid; gap: 12px; }
label { display: block; font-weight: 650; font-size: 0.92rem; margin-bottom: 4px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #B8C4D6; border-radius: var(--radius-sm); background: #fff;
}
textarea { resize: vertical; font-family: var(--font-mono); font-size: 0.88rem; }
.form-row-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-hint { font-size: 0.85rem; color: var(--muted); margin-top: 8px; }
.slider-row { margin-top: 16px; }
.slider-head { display: flex; justify-content: space-between; font-weight: 650; font-size: 0.93rem; }
.slider-head output { font-family: var(--font-mono); color: var(--cobalt); }
input[type="range"] { width: 100%; accent-color: var(--cobalt); }
.big-price { font-size: 2.75rem; font-weight: 800; font-variant-numeric: tabular-nums; margin: 6px 0; }
.calc-compare { font-size: 0.93rem; color: var(--ok); padding-bottom: 12px; border-bottom: 1px solid var(--rule); }

.filter-bar { margin-bottom: 16px; }
.pill-tabs { display: inline-flex; flex-wrap: wrap; gap: 6px; background: var(--band); padding: 5px; border-radius: var(--pill); }
.pill-tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: var(--pill); font-weight: 650; font-size: 0.86rem; color: var(--muted); }
.pill-tabs button.is-active { background: var(--ink); color: #fff; }
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 18px 0; }
.stat-strip > div { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: 13px 15px; }
.stat-strip strong { display: block; font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.stat-strip span { font-size: 0.8rem; color: var(--muted); }

/* Portal Specific */
.portal-tabs { background: var(--paper); border-top: 1px solid var(--band); }
.portal-tabs-inner { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0; }
.portal-tabs a { padding: 7px 13px; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 650; color: var(--muted); white-space: nowrap; }
.portal-tabs a:hover, .portal-tabs a.is-active { background: var(--cobalt-soft); color: var(--cobalt); }
.balance-chip { padding: 5px 12px; border: 1px solid var(--rule); border-radius: var(--pill); background: var(--surface-subtle); font-size: 0.88rem; }
.inline-form { display: inline-flex; align-items: center; gap: 6px; }
.portal-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.portal-section { margin-top: 30px; }
.portal-section h2 { margin-bottom: 14px; font-size: 1.35rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi-card { display: grid; gap: 4px; }
.kpi-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; }
.kpi-val { font-size: 1.65rem; font-variant-numeric: tabular-nums; }
.checks-fieldset { border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: 14px 16px; margin: 4px 0; }
.checks-fieldset legend { font-weight: 700; padding: 0 6px; }
.checks-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check-tile { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--radius-sm); cursor: pointer; }
.check-tile span { display: block; font-size: 0.82rem; font-weight: 400; color: var(--muted); }
.checks-inline { display: flex; flex-wrap: wrap; gap: 16px; }
.checks-inline label { display: inline-flex; align-items: center; gap: 6px; margin: 0; cursor: pointer; }
.preflight-banner { padding: 11px 14px; background: var(--cobalt-soft); border-radius: var(--radius-sm); font-size: 0.88rem; }
.auth-wrap { max-width: 470px; margin: 12px auto; }
.auth-card h1 { font-size: 2rem; margin-bottom: 6px; }
.auth-divider { text-align: center; margin: 16px 0; color: var(--muted); font-size: 0.85rem; }
.auth-foot { margin-top: 14px; font-size: 0.9rem; text-align: center; color: var(--muted); }
.key-reveal { display: inline-block; margin-top: 6px; padding: 6px 10px; background: #fff; border: 1px solid #A9D8C6; font-size: 0.92rem; user-select: all; }
.mini-num { width: 78px !important; padding: 5px 8px !important; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cert-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; padding-bottom: 16px; border-bottom: 2px solid var(--ink); margin-bottom: 18px; }
.cert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; margin-bottom: 20px; }
.cert-grid dt { font-size: 0.78rem; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.cert-grid dd { font-weight: 650; overflow-wrap: anywhere; }

/* Footer */
.site-footer { background: var(--ink-deep); color: #D7E2F4; padding: 52px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 28px; padding-bottom: 32px; border-bottom: 1px solid rgba(255,255,255,0.12); }
.site-footer .brand { color: #fff; }
.site-footer .brand-word span { color: #8AB4FF; }
.footer-col-brand p { margin-top: 12px; font-size: 0.92rem; color: #B2C2DC; max-width: 40ch; }
.footer-heading { font-weight: 750; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: #fff; margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: 8px; font-size: 0.92rem; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-legal { padding-top: 20px; font-size: 0.83rem; color: #96AAC8; }
.portal-footer { border-top: 1px solid var(--rule); background: var(--paper); padding: 0 0 20px; }
.portal-footer .footer-legal { color: var(--muted); }

@media (max-width: 960px) {
  .desktop-nav, .nav-actions { display: none; }
  .menu-toggle { display: flex; }
  .hero-grid, .split-showcase, .feature-triad, .dual-cards, .calc-grid, .kpi-grid, .footer-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .wrap { width: calc(100% - 28px); }
  .rate-strip, .ins-kv-grid, .mini-audit-grid, .form-row-split, .checks-grid, .cert-grid { grid-template-columns: minmax(0, 1fr); }
  .ins-input-row { flex-direction: column; }
}

@media print {
  .site-header, .portal-footer, [data-print-btn] { display: none !important; }
  .portal-body { background: #fff; }
  .card { box-shadow: none; border-color: #000; }
}

/* Pipeline Figure & FAQ */
.pipeline-fig { padding: 18px; overflow-x: auto; }
.pipeline-fig svg { display: block; width: 100%; min-width: 720px; height: auto; font-family: var(--font-sans); }
.sector-grid { margin-top: 22px; }
.faq-wrap h2 { margin-bottom: 18px; }
.faq-list { display: grid; gap: 12px; }
.faq-item { padding: 16px 20px; }
.faq-item summary { font-weight: 700; font-size: 1.03rem; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--cobalt); font-weight: 700; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin-top: 10px; color: var(--muted); max-width: 72ch; }
