:root {
  color-scheme: light;
  --paper: #f4f7f5;
  --surface: #ffffff;
  --ink: #101820;
  --muted: #536068;
  --line: #cbd5d1;
  --teal: #087e6d;
  --teal-soft: #dcefe9;
  --coral: #df654e;
  --yellow: #efbd42;
  --blue: #315b8a;
  --dark: #17242a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.site-header {
  min-height: 66px;
  padding: 0 4vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand { display: flex; align-items: baseline; gap: 9px; text-decoration: none; }
.brand span { color: var(--coral); font: 800 20px/1 ui-monospace, "SFMono-Regular", Consolas, monospace; }
.brand strong { font-size: 14px; letter-spacing: 0; }
.site-header nav { display: flex; align-items: center; gap: 20px; font-size: 13px; font-weight: 700; }
.site-header nav a { text-decoration: none; border-bottom: 1px solid transparent; }
.site-header nav a:hover, .site-header nav a:focus-visible { border-color: var(--ink); }

main { width: min(1440px, 100%); margin: 0 auto; }
.intro-band {
  min-height: 330px;
  padding: 64px max(32px, 5vw) 48px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
  background: var(--dark);
  color: #f8fbfa;
  border-bottom: 8px solid var(--yellow);
}
.intro-copy { max-width: 850px; }
.kicker, .section-index { margin: 0 0 13px; font: 800 12px/1.4 ui-monospace, "SFMono-Regular", Consolas, monospace; color: var(--teal); }
.intro-band .kicker { color: #75d5c4; }
h1, h2, p { letter-spacing: 0; }
h1 { margin: 0; max-width: 780px; font-size: 48px; line-height: 1.02; font-weight: 780; }
.intro-text { margin: 24px 0 0; max-width: 760px; color: #c9d3d0; font-size: 17px; line-height: 1.6; }
.window-control { flex: 0 0 auto; display: grid; grid-template-columns: repeat(3, 58px); gap: 5px; align-items: center; }
.window-control span { grid-column: 1 / -1; color: #aebcb8; font: 700 11px/1.4 ui-monospace, monospace; text-transform: uppercase; }
.window-control button { min-height: 42px; border: 1px solid #5b6c70; border-radius: 4px; background: transparent; color: white; font-weight: 800; cursor: pointer; }
.window-control button[aria-pressed="true"] { border-color: var(--yellow); background: var(--yellow); color: var(--ink); }

.status-line { min-height: 46px; padding: 0 max(24px, 5vw); display: flex; align-items: center; gap: 10px; color: var(--muted); font: 650 12px/1.3 ui-monospace, monospace; border-bottom: 1px solid var(--line); }
.status-line #as-of { margin-left: auto; text-align: right; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); }
.status-line.is-ready .status-dot { background: var(--teal); }
.status-line.is-error .status-dot { background: var(--coral); }

.metric-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: var(--surface); }
.metric-strip article { min-height: 158px; padding: 28px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line); }
.metric-strip article:last-child { border-right: 0; }
.metric-strip article.accent { background: var(--teal-soft); }
.metric-strip span, .metric-strip small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.metric-strip strong { font-size: 39px; line-height: 1; font-variant-numeric: tabular-nums; }

.data-section { padding: 52px max(24px, 5vw); border-bottom: 1px solid var(--line); background: var(--surface); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 40px; margin-bottom: 34px; }
.section-heading.compact { margin-bottom: 24px; }
.section-heading h2, .boundary-band h2, .action-band h2 { margin: 0; font-size: 27px; line-height: 1.15; }
.section-heading > p { max-width: 510px; margin: 0; color: var(--muted); line-height: 1.55; }

.funnel { min-height: 126px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.funnel article { position: relative; min-height: 124px; padding: 23px; border-right: 1px solid var(--line); }
.funnel article:last-child { border-right: 0; }
.funnel article::after { content: ">"; position: absolute; right: -9px; top: 50%; z-index: 1; width: 17px; height: 24px; margin-top: -12px; display: grid; place-items: center; color: var(--muted); background: var(--surface); font: 800 14px/1 monospace; }
.funnel article:last-child::after { display: none; }
.funnel span { display: block; color: var(--muted); font-size: 12px; }
.funnel strong { display: block; margin: 10px 0 8px; font-size: 32px; font-variant-numeric: tabular-nums; }
.funnel small { color: var(--teal); font: 700 11px/1.4 ui-monospace, monospace; }

.timeline { height: 202px; display: flex; align-items: end; gap: 8px; padding: 14px 4px 0; border-bottom: 1px solid var(--line); }
.timeline-day { flex: 1 1 0; min-width: 0; height: 100%; display: grid; grid-template-rows: 1fr 20px; gap: 8px; align-items: end; }
.bar-stack { height: 100%; display: flex; align-items: end; justify-content: center; gap: 3px; }
.bar { width: min(26px, 44%); min-height: 2px; border-radius: 2px 2px 0 0; background: var(--teal); }
.bar.tool { background: var(--coral); }
.timeline-day time { overflow: hidden; color: var(--muted); font: 650 10px/1 ui-monospace, monospace; text-align: center; white-space: nowrap; }
.chart-legend { display: flex; gap: 24px; margin-top: 16px; color: var(--muted); font-size: 12px; }
.chart-legend span { display: flex; align-items: center; gap: 7px; }
.chart-legend i { width: 17px; height: 5px; border-radius: 1px; background: var(--teal); }
.chart-legend .legend-tool { background: var(--coral); }

.split-section { display: grid; grid-template-columns: 1.12fr .88fr; }
.split-section .data-section { min-width: 0; }
.split-section .data-section:first-child { border-right: 1px solid var(--line); }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 0 12px 12px 0; color: var(--muted); font-size: 11px; text-align: left; text-transform: uppercase; }
td { padding: 15px 12px 15px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
td code { font-size: 12px; white-space: nowrap; }
.class-list { display: grid; gap: 19px; }
.class-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr 62px; gap: 13px; align-items: center; }
.class-row span { color: var(--muted); font-size: 12px; }
.class-track { height: 8px; background: #e5eae8; }
.class-fill { width: var(--chart-level, 3px); height: 100%; background: var(--blue); }
.bar[data-level] { height: var(--chart-level, 2px); }
[data-level="1"] { --chart-level: 5%; }
[data-level="2"] { --chart-level: 10%; }
[data-level="3"] { --chart-level: 15%; }
[data-level="4"] { --chart-level: 20%; }
[data-level="5"] { --chart-level: 25%; }
[data-level="6"] { --chart-level: 30%; }
[data-level="7"] { --chart-level: 35%; }
[data-level="8"] { --chart-level: 40%; }
[data-level="9"] { --chart-level: 45%; }
[data-level="10"] { --chart-level: 50%; }
[data-level="11"] { --chart-level: 55%; }
[data-level="12"] { --chart-level: 60%; }
[data-level="13"] { --chart-level: 65%; }
[data-level="14"] { --chart-level: 70%; }
[data-level="15"] { --chart-level: 75%; }
[data-level="16"] { --chart-level: 80%; }
[data-level="17"] { --chart-level: 85%; }
[data-level="18"] { --chart-level: 90%; }
[data-level="19"] { --chart-level: 95%; }
[data-level="20"] { --chart-level: 100%; }
.class-row strong { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.empty-state { min-height: 90px; display: grid; place-items: center; padding: 20px; border: 1px dashed var(--line); color: var(--muted); text-align: center; }

.boundary-band { padding: 54px max(24px, 5vw); display: grid; grid-template-columns: .8fr 1.35fr; gap: 52px; color: #f6faf8; background: var(--dark); }
.boundary-band > * { min-width: 0; }
.boundary-band .section-index { color: #75d5c4; }
.boundary-band ul { margin: 0; padding: 0; list-style: none; }
.boundary-band li { padding: 13px 0; border-top: 1px solid #415056; color: #d1dad7; line-height: 1.45; }
.boundary-band li::before { content: "NOT "; color: var(--yellow); font: 800 11px/1 ui-monospace, monospace; }
.snapshot-line { min-width: 0; grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; padding-top: 18px; border-top: 1px solid #415056; }
.snapshot-line span { color: #75d5c4; font: 800 11px/1 ui-monospace, monospace; }
.snapshot-line code { min-width: 0; max-width: 100%; display: block; overflow: hidden; color: #c7d2cf; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.action-band { padding: 58px max(24px, 5vw); display: grid; grid-template-columns: .85fr 1.15fr; gap: 38px 60px; background: #eef3ef; border-bottom: 1px solid var(--line); }
.action-copy p:last-child { max-width: 570px; color: var(--muted); line-height: 1.55; }
.audit-form { align-self: end; }
.audit-form label { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 750; }
.audit-form > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.audit-form input { min-width: 0; height: 48px; padding: 0 14px; border: 1px solid #899691; border-right: 0; border-radius: 5px 0 0 5px; background: white; color: var(--ink); }
.audit-form button, .action-links button, .action-links a { min-height: 44px; padding: 0 17px; border: 1px solid var(--ink); border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; background: var(--ink); color: white; font-weight: 750; text-decoration: none; cursor: pointer; }
.audit-form button { height: 48px; border-radius: 0 5px 5px 0; }
.audit-form button:hover, .action-links button:hover, .action-links a:hover { background: var(--teal); border-color: var(--teal); }
#url-error { min-height: 20px; margin: 7px 0 0; color: #a43e31; font-size: 12px; }
.action-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; padding-top: 22px; border-top: 1px solid var(--line); }
.action-links button { background: var(--surface); color: var(--ink); }
.action-links #paid-pack { margin-left: auto; background: var(--coral); border-color: var(--coral); }
.payment-boundary { grid-column: 1 / -1; margin: -25px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: right; }

footer { min-height: 90px; padding: 24px 4vw; display: flex; align-items: center; gap: 24px; color: #c9d3d0; background: #0d1418; font-size: 12px; }
footer span { color: white; font-weight: 800; }
footer p { margin: 0; }
footer a { margin-left: auto; }

@media (max-width: 980px) {
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-strip article { border-bottom: 1px solid var(--line); }
  .metric-strip article:nth-child(2n) { border-right: 0; }
  .metric-strip article:last-child { grid-column: 1 / -1; }
  .split-section, .action-band { grid-template-columns: 1fr; }
  .split-section .data-section:first-child { border-right: 0; }
  .action-links, .payment-boundary { grid-column: 1; }
  .payment-boundary { margin: 0; text-align: left; }
}

@media (max-width: 720px) {
  .site-header { min-height: 58px; padding: 0 18px; }
  .site-header nav a:nth-child(-n+2) { display: none; }
  .intro-band { min-height: 390px; padding: 46px 22px 34px; flex-direction: column; align-items: stretch; justify-content: flex-end; gap: 28px; }
  h1 { font-size: 34px; }
  .intro-text { font-size: 15px; }
  .window-control { grid-template-columns: repeat(3, 1fr); }
  .status-line { padding: 0 18px; }
  .status-line #as-of { display: none; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric-strip article { min-height: 132px; padding: 20px; }
  .metric-strip strong { font-size: 31px; }
  .data-section { padding: 40px 20px; }
  .section-heading { align-items: start; flex-direction: column; gap: 12px; }
  .funnel { grid-template-columns: 1fr; }
  .funnel article { min-height: 105px; border-right: 0; border-bottom: 1px solid var(--line); }
  .funnel article:last-child { border-bottom: 0; }
  .funnel article::after { right: 50%; top: auto; bottom: -12px; transform: rotate(90deg); }
  .timeline { gap: 3px; }
  .timeline-day time { font-size: 8px; }
  .boundary-band { padding: 43px 20px; grid-template-columns: 1fr; gap: 28px; }
  .snapshot-line { grid-column: 1; }
  .action-band { padding: 44px 20px; gap: 26px; }
  .audit-form > div { grid-template-columns: 1fr; gap: 8px; }
  .audit-form input { border-right: 1px solid #899691; border-radius: 5px; }
  .audit-form button { border-radius: 5px; }
  .action-links { display: grid; }
  .action-links #paid-pack { margin-left: 0; }
  footer { align-items: flex-start; flex-direction: column; gap: 8px; }
  footer a { margin-left: 0; }
}
