:root {
  color-scheme: light;
  --paper: #faf8f4;
  --sheet: #fffdf9;
  --ink: #191613;
  --muted: #6f6a61;
  --faint: #a39d92;
  --line: #e5e0d7;
  --rose: #d8476e;
  --rose-soft: #f9e3e9;
  --green: #2f7d58;
  --shadow: 0 28px 72px -48px rgba(25, 22, 19, .45);
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(25, 22, 19, .035) 1px, transparent 1px) 0 0 / 88px 88px,
    linear-gradient(rgba(25, 22, 19, .03) 1px, transparent 1px) 0 0 / 88px 88px,
    var(--paper);
  font: 16px/1.5 var(--sans);
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.demo-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 32px;
}

.demo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 4px 0 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 850;
  letter-spacing: .04em;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, var(--paper) 0 25%, transparent 27%),
    radial-gradient(circle at 50% 8%, var(--rose) 0 21%, transparent 22%),
    radial-gradient(circle at 89% 38%, var(--rose) 0 21%, transparent 22%),
    radial-gradient(circle at 74% 86%, var(--rose) 0 21%, transparent 22%),
    radial-gradient(circle at 26% 86%, var(--rose) 0 21%, transparent 22%),
    radial-gradient(circle at 11% 38%, var(--rose) 0 21%, transparent 22%);
}

.claim-label,
.eyebrow,
.chart-label,
.chart-sub,
.day-pill,
.legend,
.status,
.metrics span,
.feed-head,
.event-day {
  font-family: var(--mono);
}

.claim-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: right;
}

.player-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: stretch;
}

.chart-workspace,
.side-panel {
  min-width: 0;
}

.intro {
  padding: 28px 0 24px;
  max-width: 760px;
}

.eyebrow {
  margin: 0;
  color: var(--rose);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

h1 {
  margin: 14px 0 0;
  max-width: 760px;
  font-size: clamp(42px, 7vw, 84px);
  line-height: .9;
  letter-spacing: 0;
}

.lede {
  max-width: 640px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.42;
}

.chart-frame,
.verdict,
.metrics,
.feed-wrap {
  background: rgba(255, 253, 249, .86);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.chart-frame {
  border-radius: 8px;
  overflow: hidden;
}

.chart-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px 8px;
  border-bottom: 1px solid var(--line);
}

.chart-label {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.chart-sub {
  margin: 5px 0 0;
  color: var(--faint);
  font-size: 12px;
}

.day-pill {
  flex: 0 0 auto;
  color: var(--rose);
  border: 1px solid var(--rose-soft);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: #fff;
}

.timeline {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 900 / 340;
  background: var(--sheet);
}

.timeline .grid {
  stroke: var(--line);
  stroke-width: 1;
}

.timeline .axis-label {
  fill: var(--faint);
  font: 11px var(--mono);
}

.timeline .zero {
  stroke: rgba(25, 22, 19, .22);
  stroke-dasharray: 4 6;
}

.timeline .reference-line,
.timeline .treated-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.timeline .reference-line {
  stroke: #b9b2a5;
  stroke-width: 3;
}

.timeline .treated-line {
  stroke: var(--rose);
  stroke-width: 3.5;
  filter: drop-shadow(0 8px 10px rgba(216, 71, 110, .13));
}

.timeline .cursor {
  stroke: var(--ink);
  stroke-width: 1.4;
}

.timeline .cursor-dot {
  fill: var(--rose);
  stroke: var(--sheet);
  stroke-width: 3;
}

.timeline .agent-marker {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity .25s ease, transform .28s cubic-bezier(.22, 1, .36, 1);
}

.timeline .agent-marker.on {
  opacity: 1;
  transform: scale(1);
}

.timeline .agent-marker:not(.on) {
  transform: scale(.3);
}

.timeline .agent-marker circle {
  fill: var(--sheet);
  stroke: var(--rose);
  stroke-width: 2;
}

.timeline .agent-marker text {
  fill: var(--rose);
  font: 700 10px var(--mono);
  text-anchor: middle;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 12px 20px 16px;
  color: var(--muted);
  font-size: 12px;
}

.swatch {
  display: inline-block;
  width: 22px;
  height: 3px;
  margin-right: 7px;
  border-radius: 999px;
  vertical-align: 3px;
}

.swatch.reference {
  background: #b9b2a5;
}

.swatch.treated,
.swatch.marker {
  background: var(--rose);
}

.controls {
  display: grid;
  grid-template-columns: auto auto minmax(220px, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

.control {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 20px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease, color .18s ease;
}

.control:hover {
  transform: translateY(-1px);
  border-color: var(--rose);
  color: var(--rose);
}

.control.primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.control.primary:hover {
  background: var(--rose);
  border-color: var(--rose);
  color: #fff;
}

.scrub-label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  color: var(--muted);
  font: 700 12px var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--rose);
}

.side-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  align-self: end;
}

.verdict {
  border-radius: 8px;
  padding: 20px;
  min-height: 198px;
  transition: border-color .3s ease, background-color .3s ease;
}

.verdict.revealed {
  border-color: rgba(216, 71, 110, .4);
  background: linear-gradient(180deg, #fffdf9 0%, #fff8fa 100%);
}

.verdict-kicker {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.verdict strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: clamp(36px, 4vw, 50px);
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.verdict.revealed strong {
  color: var(--rose);
}

.verdict[data-economic-verdict="pass"] strong {
  color: var(--green);
}

.verdict[data-economic-verdict="risk"] strong {
  color: var(--ink);
}

.verdict span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.verdict-cta {
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: max-height .34s ease, margin-top .34s ease, opacity .24s ease, transform .34s cubic-bezier(.22, 1, .36, 1);
}

.verdict.revealed .verdict-cta {
  max-height: 130px;
  margin-top: 16px;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.verdict-cta p {
  margin: 0 0 10px;
  color: var(--ink);
  font-weight: 800;
}

.verdict-cta div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.verdict-cta a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border-radius: 999px;
  padding: 0 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  transition: transform .18s ease, background-color .18s ease;
}

.verdict-cta a + a {
  background: var(--rose);
  color: #fff;
}

.verdict-cta a:hover {
  transform: translateY(-1px);
}

.metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--line);
}

.metrics div {
  background: rgba(255, 253, 249, .94);
  padding: 14px 16px;
}

.metrics-help {
  margin: 0;
  background: rgba(255, 253, 249, .94);
  padding: 14px 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.metrics span {
  display: block;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.metrics b {
  display: block;
  margin-top: 3px;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.feed-wrap {
  min-height: 320px;
  border-radius: 8px;
  overflow: hidden;
}

.feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.feed-head span {
  color: var(--faint);
  font-size: 12px;
}

.call-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 420px;
  overflow: auto;
}

.call-feed li {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 249, .76);
  animation: feedIn .24s ease both;
}

.event-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.event-kind {
  font-weight: 850;
}

.event-kind.decline {
  color: var(--rose);
}

.event-kind.approve {
  color: var(--green);
}

.event-day {
  color: var(--faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.event-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.42;
}

.accepted {
  color: var(--ink);
  font: 700 11px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.accepted.no {
  color: var(--rose);
}

.status {
  margin: 16px 0 0;
  color: var(--faint);
  font-size: 12px;
}

.load-error {
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px solid rgba(216, 71, 110, .35);
  border-radius: 8px;
  color: var(--ink);
  background: var(--rose-soft);
}

@keyframes feedIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}

@media (max-width: 920px) {
  .player-grid {
    grid-template-columns: 1fr;
  }

  .side-panel {
    align-self: stretch;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .feed-wrap {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .demo-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  .demo-header,
  .chart-topline,
  .event-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .claim-label {
    text-align: left;
  }

  .intro {
    padding-top: 14px;
  }

  .chart-topline {
    gap: 10px;
  }

  .controls {
    grid-template-columns: 1fr 1fr;
  }

  .scrub-label {
    grid-column: 1 / -1;
  }

  .side-panel {
    grid-template-columns: 1fr;
  }

  .call-feed {
    max-height: 360px;
  }
}
