:root {
  --bg: #ede4d3;
  --ink: #162019;
  --muted: #5b6257;
  --line: rgba(22, 32, 25, 0.12);
  --panel: rgba(254, 250, 241, 0.92);
  --panel-strong: rgba(255, 252, 246, 0.98);
  --live: #0c7d4f;
  --live-soft: rgba(12, 125, 79, 0.14);
  --delay: #bc6210;
  --delay-soft: rgba(188, 98, 16, 0.14);
  --unknown: #6f6a60;
  --unknown-soft: rgba(111, 106, 96, 0.16);
  --accent: #243f2f;
  --shadow: 0 28px 70px rgba(38, 33, 23, 0.12);
  --section-gap: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  background:
    radial-gradient(circle at 0% 0%, rgba(188, 98, 16, 0.18), transparent 26%),
    radial-gradient(circle at 100% 10%, rgba(12, 125, 79, 0.14), transparent 24%),
    linear-gradient(180deg, #f4ecdf 0%, var(--bg) 52%, #e7dcc7 100%);
}

button,
input,
select {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.site-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--section-gap);
  width: min(1460px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 30px 0 44px;
}

.hero-card,
.viz-card,
.secondary-card {
  position: relative;
  isolation: isolate;
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hero-card {
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.94), rgba(249, 243, 230, 0.96)),
    var(--panel);
}

.eyebrow,
.section-kicker,
.control-label {
  margin: 0;
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-card h1,
.section-head h2 {
  margin: 8px 0 0;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.hero-card h1 {
  max-width: 17ch;
  font-size: clamp(3rem, 6vw, 5.8rem);
  line-height: 0.92;
}

.hero-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin-top: 24px;
}

.hero-block {
  display: block;
  padding: 16px 0;
  border-top: 1px solid rgba(22, 32, 25, 0.09);
}

.hero-block:first-child {
  border-top: 0;
  padding-top: 0;
}

.hero-rich,
.featured-prose,
.commercial-copy,
.commercial-copy p,
.methodology-copy,
.methodology-copy p,
.methodology-copy li {
  margin: 0;
  color: #434a41;
  line-height: 1.72;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: clamp(1.18rem, 0.9rem + 0.7vw, 1.46rem);
}

.hero-rich p,
.commercial-copy p,
.methodology-copy p,
.methodology-copy ul,
.methodology-copy ol {
  margin: 0;
}

.hero-rich a,
.featured-prose a,
.commercial-copy a,
.methodology-copy a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}

.hero-rich strong,
.featured-prose strong,
.commercial-copy strong,
.methodology-copy strong {
  font-weight: 700;
  color: #243125;
}

.hero-rich em,
.featured-prose em,
.commercial-copy em,
.methodology-copy em {
  font-style: italic;
}

.section-note,
.filter-note,
.detail-meta,
.detail-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 0;
}

.summary-card {
  position: relative;
  isolation: isolate;
  padding: 18px 18px 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 10px 30px rgba(38, 33, 23, 0.08);
}

.summary-label {
  margin: 0;
  color: var(--muted);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-value {
  margin: 10px 0 0;
  font-size: 2.15rem;
  line-height: 1;
  font-weight: 700;
}

.summary-subvalue {
  margin: 8px 0 0;
  color: var(--muted);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: 0.88rem;
}

.viz-card,
.secondary-card {
  padding: 24px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.section-note {
  max-width: 34rem;
  text-align: right;
}

.controls-grid {
  display: grid;
  grid-template-columns: 1.1fr minmax(220px, 300px) 1.2fr minmax(220px, 320px);
  gap: 14px;
  margin-top: 20px;
  align-items: end;
}

.control-group {
  display: grid;
  gap: 8px;
}

.segmented,
.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segment,
.pill-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.64);
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
}

.segment {
  cursor: pointer;
}

.segment.is-active {
  background: var(--accent);
  border-color: rgba(36, 63, 47, 0.9);
  color: #f3ead8;
}

.pill-toggle input {
  margin: 0;
}

.control-input,
.slider-wrap {
  width: 100%;
}

.control-input {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  padding: 11px 14px;
  color: var(--ink);
}

.slider-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.slider-wrap input {
  width: 100%;
}

.slider-value {
  min-width: 46px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
}

.commercial-timeline-wrap {
  position: relative;
  margin-top: 20px;
}

.commercial-copy {
  margin-top: 18px;
}

.commercial-copy p {
  margin: 0;
}

.commercial-copy p + p {
  margin-top: 12px;
}

.methodology-copy p + p,
.methodology-copy p + ul,
.methodology-copy p + ol,
.methodology-copy ul + p,
.methodology-copy ol + p {
  margin-top: 14px;
}

.methodology-copy ul,
.methodology-copy ol {
  padding-left: 1.3rem;
}

.methodology-copy li + li {
  margin-top: 8px;
}

.commercial-axis {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: 0.84rem;
}

.commercial-band {
  position: relative;
  min-height: 44px;
}

.commercial-band-base {
  width: 100%;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(12, 125, 79, 0.26);
  background:
    linear-gradient(90deg, rgba(12, 125, 79, 0.84), rgba(12, 125, 79, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.commercial-window {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: 999px;
  cursor: pointer;
  background:
    linear-gradient(90deg, rgba(188, 98, 16, 0.92), rgba(222, 128, 31, 0.98));
  box-shadow:
    0 6px 18px rgba(188, 98, 16, 0.24),
    inset 0 1px 0 rgba(255, 244, 232, 0.4);
}

.commercial-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.commercial-tooltip {
  position: absolute;
  min-width: 180px;
  max-width: 240px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(21, 28, 22, 0.94);
  color: #f5edd9;
  box-shadow: 0 18px 50px rgba(15, 20, 16, 0.28);
  pointer-events: none;
  z-index: 5;
}

.commercial-tooltip-title,
.commercial-tooltip-meta,
.commercial-tooltip-note {
  margin: 0;
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
}

.commercial-tooltip-title {
  font-size: 0.98rem;
  line-height: 1.2;
}

.commercial-tooltip-meta,
.commercial-tooltip-note {
  margin-top: 4px;
  color: rgba(245, 237, 217, 0.82);
  font-size: 0.84rem;
  line-height: 1.45;
}

.commercial-stat-card {
  position: relative;
  isolation: isolate;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 10px 26px rgba(38, 33, 23, 0.06);
}

.commercial-stat-label,
.commercial-stat-subvalue {
  margin: 0;
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  color: var(--muted);
}

.commercial-stat-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.commercial-stat-value {
  margin: 10px 0 0;
  font-size: 2rem;
  line-height: 1;
  font-weight: 700;
}

.commercial-stat-subvalue {
  margin-top: 8px;
  font-size: 0.86rem;
  line-height: 1.45;
}

.chart-wrap {
  position: relative;
  margin-top: 22px;
  height: min(70vh, 700px);
  border-radius: 24px;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(19, 32, 25, 0.02), rgba(19, 32, 25, 0.08)),
    var(--panel-strong);
  border: 1px solid rgba(22, 32, 25, 0.08);
}

.timeline-chart {
  display: block;
  width: 100%;
  min-height: 100%;
}

.chart-tooltip {
  position: absolute;
  min-width: 220px;
  max-width: 300px;
  width: max-content;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(21, 28, 22, 0.94);
  color: #f5edd9;
  box-shadow: 0 18px 50px rgba(15, 20, 16, 0.28);
  pointer-events: none;
  z-index: 5;
}

.tooltip-title {
  margin: 0 0 4px;
  font-size: 1rem;
  line-height: 1.2;
}

.tooltip-meta,
.tooltip-note {
  margin: 0;
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: 0.84rem;
  line-height: 1.45;
  color: rgba(245, 237, 217, 0.82);
}

.detail-card {
  position: relative;
  isolation: isolate;
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.detail-title {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.1;
}

.detail-inline-link {
  margin-left: 0.5rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.detail-inline-link:hover {
  text-decoration: underline;
}

.featured-shot {
  margin-top: 0;
}

.featured-shot + .featured-shot {
  margin-top: var(--section-gap);
}

.featured-prose {
  margin-top: 14px;
}

.featured-prose p,
.featured-prose ul,
.featured-prose ol {
  margin: 0;
}

.featured-prose p + p,
.featured-prose p + ul,
.featured-prose p + ol,
.featured-prose ul + p,
.featured-prose ol + p {
  margin-top: 14px;
}

.featured-prose ul,
.featured-prose ol {
  padding-left: 1.3rem;
}

.featured-prose li + li {
  margin-top: 8px;
}

.detail-evidence {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 220px) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
  align-items: stretch;
}

.evidence-card,
.detail-delay-panel {
  position: relative;
  isolation: isolate;
  margin: 0;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
}

.evidence-label,
.detail-delay-kicker {
  margin: 0;
  color: var(--muted);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.evidence-frame {
  display: grid;
  place-items: center;
  margin-top: 10px;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(180deg, rgba(21, 28, 22, 0.04), rgba(21, 28, 22, 0.12)),
    rgba(255, 255, 255, 0.92);
}

.evidence-frame-empty {
  border: 1px dashed rgba(22, 32, 25, 0.16);
}

.evidence-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.evidence-empty,
.evidence-filename {
  margin: 0;
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
}

.evidence-empty {
  color: var(--muted);
}

.evidence-filename {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
  word-break: break-word;
}

.detail-delay-panel {
  display: grid;
  align-content: center;
  text-align: center;
}

.detail-delay-value {
  margin: 10px 0 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.96;
  font-weight: 700;
}

.detail-delay-status {
  margin: 10px 0 0;
  color: var(--muted);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  line-height: 1.5;
}

.detail-delay-times {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.detail-delay-row {
  display: grid;
  gap: 4px;
}

.detail-delay-label,
.detail-delay-time {
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
}

.detail-delay-label {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.detail-delay-time {
  font-size: 0.98rem;
  line-height: 1.3;
}

.secondary-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  margin-top: 0;
}

.player-coverage-list,
.hourly-bars {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.player-row,
.hour-row {
  display: grid;
  gap: 10px;
  align-items: center;
}

.player-row {
  grid-template-columns: minmax(0, 160px) minmax(0, 1fr) auto;
}

.hour-row {
  grid-template-columns: 72px minmax(0, 1fr) auto;
}

.player-name,
.hour-label {
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: 0.92rem;
}

.bar-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: rgba(22, 32, 25, 0.08);
  overflow: hidden;
}

.bar-live,
.bar-delayed {
  position: absolute;
  inset: 0 auto 0 0;
}

.bar-live {
  background: linear-gradient(90deg, rgba(12, 125, 79, 0.78), rgba(12, 125, 79, 0.95));
}

.bar-delayed {
  background: linear-gradient(90deg, rgba(188, 98, 16, 0.78), rgba(188, 98, 16, 0.95));
  opacity: 0.88;
}

.row-meta {
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  color: var(--muted);
  font-size: 0.86rem;
}

.axis-label,
.axis-tick {
  fill: var(--muted);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
}

.axis-label {
  font-size: 0.9rem;
}

.axis-tick {
  font-size: 0.76rem;
}

.grid-line {
  stroke: rgba(22, 32, 25, 0.12);
  stroke-width: 1;
}

.axis-line {
  stroke: rgba(22, 32, 25, 0.2);
  stroke-width: 1.2;
}

.point-live {
  fill: var(--live);
}

.point-delayed {
  fill: var(--delay);
}

.point-unknown {
  fill: var(--unknown);
}

.point-ring {
  stroke: rgba(255, 255, 255, 0.94);
  stroke-width: 1.5;
}

.point-is-selected {
  stroke: #1b1813;
  stroke-width: 2.5;
}

.chart-caption {
  fill: var(--muted);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: 0.82rem;
}

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

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

  .detail-evidence {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  body {
    overflow-x: hidden;
  }

  .site-shell {
    width: calc(100vw - 20px);
    padding: 16px 0 28px;
  }

  .hero-card,
  .viz-card,
  .secondary-card {
    border-radius: 22px;
    padding: 18px;
  }

  .hero-card h1 {
    max-width: 7ch;
    font-size: clamp(2.8rem, 10vw, 4.2rem);
    line-height: 0.9;
  }

  .hero-copy {
    margin-top: 18px;
  }

  .hero-block {
    padding: 12px 0;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-note {
    max-width: none;
    text-align: left;
  }

  .hero-rich,
  .featured-prose,
  .commercial-copy,
  .commercial-copy p,
  .methodology-copy,
  .methodology-copy p,
  .methodology-copy li {
    font-size: 1rem;
    line-height: 1.58;
  }

  .summary-grid,
  .commercial-stats {
    grid-template-columns: 1fr;
  }

  .summary-card {
    padding: 16px;
  }

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

  .player-row,
  .hour-row {
    grid-template-columns: 1fr;
  }

  .commercial-axis {
    font-size: 0.78rem;
  }

  .chart-wrap {
    height: 520px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .timeline-chart {
    width: 1280px;
    min-height: 100%;
  }

  .chart-tooltip {
    min-width: 0;
    width: min(280px, calc(100% - 24px));
    max-width: calc(100% - 24px);
  }
}
