:root {
  --bg: #081018;
  --bg-soft: #0c1621;
  --panel: #101d2a;
  --panel-2: #142536;
  --panel-3: #172b3e;
  --line: #23384b;
  --line-strong: #31506b;
  --text: #f5f8fb;
  --muted: #93a7ba;
  --muted-2: #6f8599;
  --accent: #66e3b4;
  --accent-2: #7bb8ff;
  --warn: #f4c66b;
  --bad: #ff7b83;
  --ok: #66e3b4;
  --shadow: 0 18px 50px rgba(0,0,0,.18);
  --radius: 18px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% -10%, rgba(102,227,180,.08), transparent 34rem),
    radial-gradient(circle at 92% 10%, rgba(123,184,255,.06), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, select, input { font: inherit; }
code { font-family: var(--mono); color: #c7dcf1; font-size: .92em; }

.shell { width: min(1480px, calc(100% - 40px)); margin: 0 auto; }
.page { padding-top: 42px; padding-bottom: 72px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(49,80,107,.65);
  background: rgba(8,16,24,.88);
  backdrop-filter: blur(18px);
}
.header-inner {
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  text-decoration: none;
}
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid rgba(102,227,180,.38);
  background: rgba(102,227,180,.08);
  color: var(--accent);
  font: 700 12px/1 var(--mono);
  letter-spacing: .06em;
}
.brand strong { display: block; font-size: 15px; letter-spacing: -.01em; }
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }
.main-nav { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); background: var(--bg-soft); border-radius: 12px; }
.nav-link {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); background: var(--panel-2); box-shadow: inset 0 0 0 1px rgba(123,184,255,.08); }
.header-status { justify-self: end; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); box-shadow: 0 0 0 4px rgba(111,133,153,.08); }
.status-dot.ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(102,227,180,.08); }
.status-dot.bad { background: var(--bad); box-shadow: 0 0 0 4px rgba(255,123,131,.08); }

.hero { padding: 32px 0 26px; }
.compact-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 36px; }
.docs-hero { max-width: 980px; padding-bottom: 38px; }
.eyebrow { color: var(--accent); font: 700 11px/1.25 var(--mono); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 10px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(32px, 4vw, 54px); line-height: 1.03; letter-spacing: -.045em; max-width: 950px; }
h2 { margin-bottom: 8px; font-size: clamp(20px, 2vw, 28px); line-height: 1.15; letter-spacing: -.025em; }
h3 { margin-bottom: 6px; font-size: 17px; letter-spacing: -.015em; }
.lead { max-width: 920px; margin-bottom: 0; color: var(--muted); font-size: 16px; }
.hero-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; min-width: 280px; }
.chip, .metric-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(20,37,54,.72);
  color: var(--muted);
  font: 650 11px/1 var(--mono);
}
.chip.ok, .metric-pill.ok { color: var(--ok); border-color: rgba(102,227,180,.35); }
.chip.warn, .metric-pill.warn { color: var(--warn); border-color: rgba(244,198,107,.35); }
.chip.bad, .metric-pill.bad { color: var(--bad); border-color: rgba(255,123,131,.35); }

.notice {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin: 0 0 24px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(16,29,42,.72);
  color: var(--muted);
  font-size: 13px;
}
.notice.bad { border-color: rgba(255,123,131,.34); color: #f4c2c6; }
.notice-icon { flex: 0 0 20px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--panel-3); color: var(--accent-2); font: 700 11px/1 var(--mono); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.metrics-grid { margin-bottom: 18px; }
.kpi-card {
  min-height: 142px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(20,37,54,.88), rgba(16,29,42,.9));
  box-shadow: var(--shadow);
}
.kpi-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.kpi-value { margin: 12px 0 8px; font: 760 28px/1.05 var(--mono); letter-spacing: -.04em; }
.kpi-value.small { font-size: 20px; }
.kpi-value.tiny { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.kpi-value.good { color: var(--ok); }
.kpi-value.bad { color: var(--bad); }
.kpi-note { color: var(--muted-2); font-size: 11px; }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(16,29,42,.96), rgba(13,25,36,.96));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel + .panel { margin-top: 0; }
.chart-panel { margin-bottom: 20px; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 21px 22px 17px; }
.panel-header p { color: var(--muted); font-size: 12px; max-width: 780px; margin-bottom: 0; }
.panel-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.select-label { color: var(--muted-2); font-size: 11px; }
.select { appearance: none; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); border-radius: 9px; padding: 7px 28px 7px 10px; font-size: 12px; cursor: pointer; }
.select:focus-visible, a:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.chart-stage { position: relative; min-height: 330px; padding: 0 14px 0 4px; border-top: 1px solid rgba(35,56,75,.7); }
#forwardChart { display: block; width: 100%; height: 320px; overflow: visible; }
.chart-grid { stroke: rgba(147,167,186,.14); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-zero { stroke: rgba(147,167,186,.3); stroke-width: 1; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; }
.chart-area { fill: rgba(102,227,180,.08); }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.3; vector-effect: non-scaling-stroke; }
.chart-label { fill: var(--muted-2); font: 11px var(--mono); }
.empty-state { position: absolute; inset: 0; display: none; place-items: center; color: var(--muted); font-size: 13px; text-align: center; padding: 28px; }
.empty-state.visible { display: grid; }
.chart-legend { display: flex; justify-content: space-between; gap: 20px; padding: 13px 22px 18px; color: var(--muted-2); font-size: 11px; }
.chart-legend span { display: flex; align-items: center; gap: 7px; }
.legend-line { width: 18px; height: 2px; background: var(--accent); border-radius: 2px; }

.two-column { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(280px, .8fr); gap: 20px; margin-bottom: 20px; }
.two-column.equal { grid-template-columns: repeat(2, minmax(0,1fr)); }
.model-panel { padding-bottom: 20px; }
.model-panel > .eyebrow, .model-panel > h2, .model-panel > .definition-list, .model-panel > .text-link { margin-left: 22px; margin-right: 22px; }
.model-panel > .eyebrow { margin-top: 22px; }
.definition-list { margin: 15px 0 20px; }
.definition-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid rgba(35,56,75,.7); }
.definition-list > div:last-child { border-bottom: 0; }
.definition-list dt { color: var(--muted); font-size: 12px; }
.definition-list dd { margin: 0; text-align: right; font: 650 12px/1.35 var(--mono); color: var(--text); }
.definition-list.wide { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 0 24px; margin: 0; padding: 0 22px 20px; }
.definition-list.wide > div { min-width: 0; }
.text-link { color: var(--accent); font-size: 12px; font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.table-wrap { overflow: auto; border-top: 1px solid rgba(35,56,75,.7); }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th { padding: 11px 13px; text-align: left; color: var(--muted-2); font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; background: rgba(20,37,54,.72); }
td { padding: 12px 13px; border-top: 1px solid rgba(35,56,75,.55); font-size: 12px; color: #d9e3ec; }
tbody tr:first-child td { border-top: 0; }
tbody tr:hover td { background: rgba(123,184,255,.025); }
.right { text-align: right; }
.mono { font-family: var(--mono); }
.score { color: var(--accent); font-weight: 750; }
.table-empty { color: var(--muted-2); text-align: center; padding: 30px; }
.state-pill { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font: 700 10px/1.2 var(--mono); text-transform: uppercase; }
.state-pill.closed { color: var(--ok); border-color: rgba(102,227,180,.28); }
.state-pill.open, .state-pill.pending_entry { color: var(--warn); border-color: rgba(244,198,107,.3); }
.panel-foot { display: flex; justify-content: space-between; gap: 20px; padding: 13px 22px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 10px; }

.section-block { margin: 8px 0 38px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin: 0 0 15px; }
.section-heading p { color: var(--muted); font-size: 12px; max-width: 620px; margin-bottom: 3px; }
.info-panel { margin-top: 0; }
.methodology-note { padding: 22px; }
.methodology-note p { color: var(--muted); margin-bottom: 0; max-width: 1100px; }

.docs-layout { display: grid; grid-template-columns: 210px minmax(0, 930px); gap: 54px; align-items: start; }
.docs-toc { position: sticky; top: 104px; display: flex; flex-direction: column; gap: 3px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: rgba(16,29,42,.8); }
.docs-toc strong { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); padding: 6px 8px 10px; }
.docs-toc a { padding: 7px 8px; border-radius: 7px; text-decoration: none; color: var(--muted); font-size: 12px; }
.docs-toc a:hover { color: var(--text); background: var(--panel-2); }
.docs-content { min-width: 0; }
.doc-section { scroll-margin-top: 110px; padding: 0 0 42px; margin-bottom: 42px; border-bottom: 1px solid var(--line); }
.doc-section:last-child { border-bottom: 0; }
.doc-section p { color: #b9c7d4; font-size: 14px; max-width: 900px; }
.flow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 18px 0 22px; }
.flow span { padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: #d9e3ec; font: 650 11px/1.2 var(--mono); }
.flow b { color: var(--muted-2); font-weight: 500; }
.doc-dl { padding: 0; margin-top: 18px; }
.callout { margin: 18px 0 0; padding: 14px 16px; border-left: 3px solid var(--accent); background: rgba(102,227,180,.05); color: #c8d5df; font-size: 13px; border-radius: 0 10px 10px 0; }
.steps { list-style: none; padding: 0; margin: 22px 0 0; }
.steps li { display: grid; grid-template-columns: 34px 1fr; gap: 14px; padding: 15px 0; border-top: 1px solid var(--line); }
.steps li > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: rgba(123,184,255,.08); color: var(--accent-2); font: 700 11px/1 var(--mono); }
.steps strong { font-size: 13px; }
.steps p { margin: 4px 0 0; }
.security-list { margin: 18px 0 0; padding-left: 20px; color: #b9c7d4; font-size: 14px; }
.security-list li { margin: 9px 0; }
.error-page { min-height: 55vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.error-page p { color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); background: rgba(8,16,24,.7); }
.footer-inner { min-height: 130px; display: flex; justify-content: space-between; align-items: center; gap: 30px; }
.footer-inner strong { font-size: 13px; }
.footer-inner p { color: var(--muted-2); font-size: 11px; margin: 5px 0 0; max-width: 620px; }
.footer-meta { display: flex; flex-direction: column; gap: 5px; text-align: right; color: var(--muted-2); font: 11px/1.35 var(--mono); }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .docs-layout { grid-template-columns: 180px minmax(0,1fr); gap: 30px; }
}
@media (max-width: 900px) {
  .header-inner { grid-template-columns: 1fr auto; }
  .main-nav { order: 3; grid-column: 1 / -1; margin-bottom: 10px; overflow-x: auto; justify-self: stretch; }
  .nav-link { flex: 1 0 auto; text-align: center; }
  .compact-hero { align-items: flex-start; flex-direction: column; }
  .hero-meta { justify-content: flex-start; min-width: 0; }
  .two-column, .two-column.equal { grid-template-columns: 1fr; }
  .definition-list.wide { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-toc { position: static; flex-direction: row; flex-wrap: wrap; }
  .docs-toc strong { width: 100%; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
}
@media (max-width: 620px) {
  .shell { width: min(100% - 24px, 1480px); }
  .page { padding-top: 24px; }
  .header-status { display: none; }
  .header-inner { grid-template-columns: 1fr; gap: 8px; }
  .main-nav { grid-column: 1; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .kpi-card { min-height: 128px; padding: 14px; }
  .kpi-value { font-size: 22px; }
  .kpi-value.small { font-size: 16px; }
  .panel-header { flex-direction: column; padding: 17px 16px 14px; }
  .panel-actions { justify-content: flex-start; }
  .chart-stage { min-height: 260px; }
  #forwardChart { height: 250px; }
  .definition-list.wide { grid-template-columns: 1fr; padding: 0 16px 18px; }
  .panel-foot, .chart-legend { flex-direction: column; gap: 6px; }
  .footer-inner { align-items: flex-start; flex-direction: column; padding: 30px 0; min-height: 0; }
  .footer-meta { text-align: left; }
  .flow { align-items: flex-start; }
}
@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr; }
  h1 { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
.ticker-cell { font-weight: 700; }

/* Accessible metric definitions: hover with a mouse, focus with a keyboard. */
.metric-help {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-left: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--accent-2);
  background: rgba(123,184,255,.05);
  font: 800 10px/1 var(--mono);
  letter-spacing: 0;
  text-transform: none;
  cursor: help;
  vertical-align: 1px;
  outline: none;
  z-index: 20;
}
.metric-help::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  width: min(280px, 70vw);
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #0b1722;
  color: #dce7ef;
  box-shadow: 0 14px 36px rgba(0,0,0,.35);
  font: 500 12px/1.45 var(--sans);
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity .12s ease, transform .12s ease;
}
.metric-help:hover::after,
.metric-help:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
.metric-help:focus-visible { box-shadow: 0 0 0 2px rgba(123,184,255,.25); }
.model-panel, .info-panel { overflow: visible; }
.company-cell { min-width: 180px; color: #c6d3de; }
