:root {
  --bg: #0f0f10;
  --panel: #161618;
  --panel-2: #202023;
  --ink: #f4f4f5;
  --ink-dim: #a1a1aa;
  --ink-faint: #6b6b74;
  --line: #29292e;
  --accent: #e5484d;
  --accent-soft: #b83b3f;
  --accent-2: #8ab4d8;
  --green: #12805c; /* ControlAI-ish green, for the light take-action card */
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 780px;
  --font-sans: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Fragment Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  overflow-x: clip; /* the full-bleed take-action band uses 100vw, which
                       includes the scrollbar gutter on Windows */
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.screen[hidden] { display: none !important; }

/* A button that reads as a link (used for "change" birth year). */
.linklike {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent-2);
  cursor: pointer;
}
.linklike:hover { text-decoration: underline; }

/* ============================ INTRO ============================ */
.intro {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.intro-card {
  width: 100%;
  max-width: 480px;
  text-align: center;
}
.intro-title {
  font-size: clamp(2rem, 6vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 0 0 14px;
  line-height: 1.05;
}
.intro-sub {
  color: var(--ink-dim);
  font-size: 1.02rem;
  margin: 0 auto 30px;
  max-width: 440px;
}
.intro-form label {
  display: block;
  text-align: left;
  font-size: 0.85rem;
  color: var(--ink-dim);
  margin-bottom: 8px;
}
.intro-input-row { display: flex; gap: 10px; }
.intro-input-row input {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 1.15rem;
  font-family: inherit;
}
.intro-input-row input:focus {
  outline: none;
  border-color: var(--accent-2);
}
.intro-err { color: var(--accent); font-size: 0.85rem; min-height: 1.2em; margin: 10px 0 0; text-align: left; }

/* Buttons */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 22px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary:hover { background: #f05a5f; }
.btn-ghost {
  margin-top: 16px;
  background: transparent;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--accent-2); color: var(--ink); }

/* =========================== RESULTS =========================== */
.app {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 20px 72px;
}

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.brand {
  background: none;
  border: none;
  color: var(--ink-dim);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-align: left;
}
.brand:hover { color: var(--ink); }
.born-line { font-size: 0.9rem; color: var(--ink-dim); }
.born-line strong { color: var(--ink); font-weight: 600; }

/* Headline figure */
.lead { margin-bottom: 40px; }
.lead-num {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 10vw, 4.5rem);
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.03em;
}
.lead-cap {
  font-size: 1.1rem;
  color: var(--ink);
  max-width: 560px;
  margin: 14px 0 6px;
}
.lead-top { font-size: 0.95rem; color: var(--ink-dim); margin: 0; }
.lead-cta {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--accent-2);
}

/* Section headings share one quiet style — no boxes unless needed. */
.app h2 { font-size: 1.05rem; font-weight: 600; margin: 0 0 10px; }
.app h3 { font-size: 0.98rem; font-weight: 600; margin: 22px 0 8px; }

/* Worldview selector — the control everything else hangs on. */
.worldview-block {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 18px;
  margin-bottom: 40px;
}
.worldview-intro {
  color: var(--ink-dim);
  font-size: 0.95rem;
  margin: 0 0 14px;
}
.worldview-block select {
  display: block;
  width: 100%;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
}
.worldview-block select:focus { outline: none; border-color: var(--accent-2); }
/* Shown in place of the worldview blurb/caveat once the user goes custom. */
.worldview-custom {
  color: var(--ink-dim);
  font-size: 0.9rem;
  margin: 12px 0 0;
}
.preset-blurb {
  color: var(--ink-dim);
  font-size: 0.9rem;
  margin: 10px 0 0;
}
.preset-blurb .stated { color: var(--ink-faint); }

/* Official interpretation: the forecaster's OWN words on this model. Lives
   inside the "caveat" disclaimer panel; uses a darker inset + accent-2 edge so
   the reader can tell "this is them, not us." Aligned with the caveat's text. */
.interpretation {
  margin: 4px 14px 12px;
  border-left: 3px solid var(--accent-2);
  background: var(--panel);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.interp-label {
  margin: 0 0 6px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--accent-2);
}
.interp-quote {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  font-style: italic;
  color: var(--ink);
}
.interp-by {
  margin: 8px 0 0;
  font-size: 0.8rem;
  font-style: normal;
  color: var(--ink-dim);
}
/* Pending state: no response yet — quieter than a real quote (muted border). */
.interpretation.is-pending { border-left-color: var(--line); }
.interp-pending {
  margin: 0;
  padding-bottom: 0 !important;
  font-size: 0.84rem;
  font-style: italic;
  color: var(--ink-faint);
}

/* Honesty box: the worldviews are our reconstructions, not anyone's verbatim
   beliefs. Quiet panel so it reads as a caveat, not an alarm. Collapsible —
   open by default so the message lands, but the reader can minimize it. */
.disclaimer {
  margin: 16px 0 0;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.5;
}
.disclaimer > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  color: var(--ink);
  font-weight: 600;
}
.disclaimer > summary::-webkit-details-marker { display: none; }
.disclaimer > summary::after {
  content: "+";
  color: var(--ink-dim);
  font-size: 1.1rem;
  line-height: 1;
}
.disclaimer[open] > summary::after { content: "\2212"; }
.disclaimer > summary:hover { color: var(--accent-2); }
.disclaimer p { margin: 0; padding: 0 14px 12px; color: var(--ink-dim); }

/* Chart panel */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 28px;
}
.panel h2 { margin-bottom: 18px; }
.hint { color: var(--ink-dim); font-size: 0.85rem; margin: 0 0 14px; }
.chart-note { color: var(--ink-faint); font-size: 0.8rem; line-height: 1.45; margin: -6px 0 18px; }

/* Chart bars */
.chart { display: flex; flex-direction: column; gap: 14px; }
.bar { display: flex; flex-direction: column; gap: 6px; }
.bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.bar-name { font-size: 0.92rem; color: var(--ink); min-width: 0; }
.bar-name.ai { font-weight: 600; }
.ai-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--accent-soft);
  padding: 2px 5px;
  border-radius: 3px;
  margin-right: 7px;
  vertical-align: middle;
}
.bar-pct { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 0.84rem; color: var(--ink-dim); white-space: nowrap; }
.bar-track { background: var(--panel-2); border-radius: 7px; height: 12px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 7px; min-width: 3px; transition: width 0.45s ease; }
.src {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.64rem;
}
.src:hover { color: var(--ink-dim); }

/* Share */
.share { margin-bottom: 40px; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.86rem;
  padding: 7px 15px;
  cursor: pointer;
  text-decoration: none;
}
.share-btn:hover { border-color: var(--accent-2); text-decoration: none; }
.share-opt {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--ink-dim);
  font-size: 0.88rem;
  margin: 0 0 12px;
  cursor: pointer;
}
.share-opt input { accent-color: var(--accent-2); cursor: pointer; }

/* Explainer prose */
.explainer { margin-bottom: 40px; }
.explainer p { color: var(--ink-dim); font-size: 0.95rem; margin: 0 0 12px; }
.explainer strong { color: var(--ink); }
/* Inline citations in the prose reuse the global [src] style (.src). */

/* Take action — a light card on desktop, so the white-and-green ControlAI
   tool sits in its own palette instead of clashing with the dark page. On
   phones (see the media query below) the card becomes a full-bleed band so
   it doesn't read as a floating box. */
.takeaction {
  background: #fafaf8;
  color: #1b201d;
  border-radius: var(--radius);
  padding: 26px 24px 24px;
  margin-bottom: 40px;
}
.takeaction-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green);
  margin: 0 0 6px;
}
.takeaction h2 { color: #131416; }
.cta-list a, .cta-widget .linklike { color: #001f5a; }
.takeaction-intro { color: #4a524d; font-size: 0.95rem; margin: 0 0 16px; max-width: 100%; }

/* CTA widget: CES-branded shell with tabs. "Contact your reps" embeds the
   ControlAI tool (cropped to just the lawmakers form); the other tabs are our
   own paths so visitors without representatives still have somewhere to go. */
.cta-widget {
  border: 1px solid #e2e6e1;
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}
.cta-tabs {
  display: flex;
  gap: 2px;
  background: #eef0ec;
  padding: 4px;
  flex-wrap: wrap;
}
.cta-tab {
  flex: 1 1 auto;
  min-width: 96px;
  padding: 10px 12px;
  border: 0;
  border-radius: calc(var(--radius) - 6px);
  background: transparent;
  color: #4a524d;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.cta-tab:hover { color: #131614; }
.cta-tab.is-active { background: #fff; color: #131614; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.cta-panel { padding: 0; }
.cta-panel[hidden] { display: none; }

/* Plain ControlAI embed — full widget, its own scrolling, no crop. */
.cta-iframe {
  display: block;
  width: 100%;
  height: 680px;
  border: 0;
  background: #fff;
}
.cta-foot {
  margin: 0;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: #4a524d;
  border-top: 1px solid #eef0ec;
}
.cta-foot .linklike { font-size: inherit; }

.cta-action { padding: 22px 20px 24px; }
.cta-action h3 { margin: 0 0 8px; color: #131614; }
.cta-action p { color: #4a524d; font-size: 0.92rem; margin: 0 0 14px; }
.cta-note { font-size: 0.82rem; color: #6b716b; margin: 10px 0 0 !important; }
.btn-cta {
  display: inline-block;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.btn-cta:hover { filter: brightness(1.06); }
.cta-action .cta-subhead { font-weight: 600; color: #131614; font-size: 0.9rem; margin: 20px 0 8px; }
.cta-list { margin: 0; padding-left: 18px; color: #4a524d; font-size: 0.92rem; }
.cta-list li { margin-bottom: 10px; line-height: 1.5; }
.cta-list strong { color: #131614; }

/* Other organizations to support — compact rows, one per org */
.orgs { margin-bottom: 40px; }
.orgs h3 { margin-top: 0; }
.org-list { border-top: 1px solid var(--line); }
.org {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.org:hover { text-decoration: none; }
.org:hover strong { color: var(--accent-2); }
.org strong { flex: 0 0 216px; font-size: 0.92rem; }
.org span { color: var(--ink-dim); font-size: 0.86rem; line-height: 1.45; }
.org::after { content: "\2197"; margin-left: auto; color: var(--ink-faint); font-size: 0.85rem; }

/* Disclosure (progressive detail) */
.disclosure {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
}
.disclosure > summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 20px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::after {
  content: "+";
  color: var(--ink-dim);
  font-size: 1.2rem;
  line-height: 1;
}
.disclosure[open] > summary::after { content: "\2212"; }
.disclosure > summary:hover { color: var(--accent-2); }
.disclosure-body { padding: 0 20px 20px; }

/* Sliders */
.sliders { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 24px; padding-top: 6px; }
.slider-group { grid-column: 1 / -1; margin: 16px 0 2px; padding-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--accent-2); font-family: var(--font-mono); font-size: 0.74rem; font-weight: 400; text-transform: uppercase; letter-spacing: 0.04em; }
.slider-group:first-child { margin-top: 0; }
.slider { display: flex; flex-direction: column; gap: 5px; }
.slider .row { display: flex; justify-content: space-between; gap: 8px; font-size: 0.84rem; align-items: baseline; }
.slider .row .name { color: var(--ink-dim); min-width: 0; }
.slider .row .num { color: var(--ink); font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.slider input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  height: 4px;
  cursor: pointer;
}

/* Master "AI timeline" dial — full-width control above the grouped sliders. */
.master-timeline {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  margin-bottom: 4px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.master-timeline .row { display: flex; justify-content: space-between; gap: 8px; font-size: 0.9rem; align-items: baseline; }
.master-timeline .row .name { color: var(--ink); font-weight: 600; }
.master-timeline .row .num { color: var(--accent-2); font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.master-timeline input[type="range"] { width: 100%; accent-color: var(--accent-2); height: 5px; cursor: pointer; }
.master-scale { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.68rem; color: var(--ink-faint); }

/* Advanced (nested) disclosure inside the sliders grid: a distinct pill button
   so the gateway to the full model is unmistakable. */
.sliders .advanced { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 16px; text-align: center; }
.sliders .advanced > summary {
  display: inline-block;
  cursor: pointer;
  list-style: none;
  background: var(--panel-2);
  border: 1px dashed var(--ink-faint);
  border-radius: 999px;
  padding: 9px 20px;
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: border-color 0.15s, color 0.15s;
}
.sliders .advanced > summary::-webkit-details-marker { display: none; }
.sliders .advanced > summary::after { content: "\002B"; color: var(--ink-faint); margin-left: 10px; }
.sliders .advanced > summary:hover { border-color: var(--accent-2); color: var(--ink); }
.sliders .advanced[open] > summary { border-style: solid; border-color: var(--accent-2); }
.sliders .advanced[open] > summary::after { content: "\2212"; }
.adv-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 24px; padding-top: 16px; text-align: left; }

/* Sources — grouped, readable citations (no internal ids exposed) */
.sources-list { display: flex; flex-direction: column; gap: 22px; }
.source-group h4 {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-2);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
.source-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px 26px; }
.source { font-size: 0.8rem; line-height: 1.5; }
.source a { display: block; color: var(--ink); font-weight: 600; }
.source a:hover { color: var(--accent-2); }
.source span { display: block; color: var(--ink-dim); margin-top: 1px; }

.foot { color: var(--ink-faint); font-size: 0.78rem; text-align: center; margin-top: 26px; }

/* Responsive */
@media (max-width: 620px) {
  .topbar { margin-bottom: 28px; }
  .lead, .worldview-block, .share, .explainer { margin-bottom: 32px; }
  .source-items { grid-template-columns: 1fr; }
  .org { flex-wrap: wrap; gap: 2px 10px; }
  .org strong { flex: 1 1 auto; order: 1; }
  .org::after { order: 2; }
  .org span { flex-basis: 100%; order: 3; }
  .panel { padding: 18px; }
  /* Full-bleed light band: negative margins stretch the card to the
     viewport edges; the padding puts its content back in line with the page. */
  .takeaction {
    margin: 0 calc(50% - 50vw) 32px;
    padding: 26px 20px 22px;
    border-radius: 0;
  }
  /* Mobile: the form reflows taller, give the iframe more room. */
  .cta-iframe { height: 760px; }
}
