:root {
  color-scheme: dark;
  --bg: #05070c;
  --panel: rgba(14, 20, 34, 0.86);
  --panel-strong: rgba(20, 30, 52, 0.94);
  --line: rgba(145, 190, 255, 0.18);
  --line-strong: rgba(128, 222, 255, 0.42);
  --text: #f6f8ff;
  --muted: #9ca9bd;
  --cyan: #73e4ff;
  --violet: #9e86ff;
  --gold: #ffcf73;
  --red: #ff8a9a;
  --green: #9effc7;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}
body {
  background:
    radial-gradient(circle at 12% 8%, rgba(158, 134, 255, 0.18), transparent 30rem),
    radial-gradient(circle at 82% 4%, rgba(115, 228, 255, 0.14), transparent 30rem),
    linear-gradient(150deg, #05070c 0%, #0b1020 54%, #111729 100%);
  color: var(--text);
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
}

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

.hero-card,
.topic-rail-card,
.recursive-lab,
.evidence-card,
.pressure-board,
.takeaway-card,
.audio-card,
.transcript-tools,
.transcript-group {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-card {
  min-height: 340px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 28px;
  align-items: stretch;
  padding: clamp(24px, 5vw, 56px);
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background:
    linear-gradient(120deg, rgba(158, 134, 255, 0.16), transparent 42%, rgba(115, 228, 255, 0.14)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 82px);
  pointer-events: none;
}
.hero-copy,
.hero-thesis {
  position: relative;
  z-index: 1;
}
.eyebrow,
.section-kicker,
.focus-meta,
.copy-status,
.result-count,
.transcript-note {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1 {
  max-width: 860px;
  margin: 12px 0 18px;
  font-size: clamp(32px, 6vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.06em;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.lede {
  max-width: 780px;
  color: #d7e2f7;
  font-size: clamp(15px, 2vw, 20px);
  line-height: 1.75;
}
.hero-thesis {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background: rgba(2, 6, 14, 0.38);
  color: #d9e4f7;
  line-height: 1.68;
}
.hero-thesis strong {
  color: var(--gold);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.legend span {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.legend .fact {
  background: rgba(158, 255, 199, 0.14);
  color: var(--green);
}
.legend .view {
  background: rgba(115, 228, 255, 0.14);
  color: var(--cyan);
}
.legend .spec {
  background: rgba(255, 207, 115, 0.14);
  color: var(--gold);
}

.mode-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(2, 6, 14, 0.54);
}
.mode-tab {
  padding: 10px 16px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  border: 0;
}
.mode-tab.is-active {
  color: #02111a;
  background: linear-gradient(135deg, var(--cyan), var(--gold));
}
.panel {
  display: none;
}
.panel.is-active {
  display: block;
}

.brief-grid {
  display: grid;
  grid-template-columns: minmax(200px, 0.7fr) minmax(340px, 1.5fr) minmax(280px, 0.85fr);
  gap: 18px;
  margin-top: 18px;
  align-items: stretch;
}
.topic-rail-card,
.recursive-lab,
.evidence-card {
  padding: 20px;
}
.topic-rail-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#topicRail {
  display: grid;
  gap: 10px;
}
.topic-button {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  text-align: left;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(4, 8, 18, 0.44);
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.topic-button:hover,
.topic-button.is-active {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(158, 134, 255, 0.18);
}
.topic-button span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(158, 134, 255, 0.16);
  color: var(--violet);
  font-weight: 800;
}
.topic-button strong {
  overflow-wrap: anywhere;
}
.topic-button em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  line-height: 1.45;
}

.recursive-lab {
  min-height: 520px;
}
.map-heading h2,
.takeaway-card h2,
.audio-card h2 {
  margin: 6px 0 10px;
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}
.map-heading p:not(.section-kicker),
.audio-card p,
.takeaway-card p {
  color: #c8d4e8;
  line-height: 1.68;
}
.canvas-wrap {
  position: relative;
  min-height: 400px;
  border: 1px solid rgba(158, 134, 255, 0.18);
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, rgba(158, 134, 255, 0.14), transparent 48%),
    rgba(2, 6, 14, 0.56);
}
#recursiveCanvas {
  display: block;
  width: 100%;
  height: 400px;
}
.canvas-fallback {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  color: rgba(236, 245, 255, 0.74);
  font-size: 13px;
  line-height: 1.5;
  pointer-events: none;
}
.pressure-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.pressure-chip {
  padding: 7px 10px;
  border: 1px solid rgba(158, 134, 255, 0.22);
  border-radius: 999px;
  color: #e6e0ff;
  background: rgba(158, 134, 255, 0.1);
  font-size: 13px;
}

.evidence-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.focus-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#focusNumber {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(158, 134, 255, 0.22), rgba(115, 228, 255, 0.18));
  color: var(--gold);
  font-weight: 900;
  font-size: 18px;
}
.time-pill,
.timecode {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 207, 115, 0.12);
  color: var(--gold);
  border: 0;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
.time-pill:hover,
.timecode:hover {
  background: rgba(255, 207, 115, 0.2);
}
.claim-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.claim-tags span {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.claim-tags .fact {
  background: rgba(158, 255, 199, 0.14);
  color: var(--green);
}
.claim-tags .view {
  background: rgba(115, 228, 255, 0.14);
  color: var(--cyan);
}
.claim-tags .spec {
  background: rgba(255, 207, 115, 0.14);
  color: var(--gold);
}
#focusTitle {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}
.focus-hook {
  color: var(--violet);
  font-weight: 700;
  line-height: 1.55;
}
.focus-summary {
  color: #d6deed;
  line-height: 1.75;
}
blockquote {
  margin: 0;
  padding: 14px 16px;
  border-left: 3px solid var(--violet);
  border-radius: 16px;
  background: rgba(158, 134, 255, 0.08);
  color: #f4fbff;
  line-height: 1.68;
}
.evidence-list {
  margin: 0;
  padding-left: 18px;
  color: #ccd7e9;
  line-height: 1.7;
}
.action-row,
.audio-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  white-space: nowrap;
  border: 0;
  color: var(--text);
}
.primary {
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #05111a;
  font-weight: 800;
}
.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: #dce8ff;
}

.pressure-board {
  display: grid;
  grid-template-columns: 1fr repeat(4, minmax(120px, 1fr));
  gap: 12px;
  align-items: center;
  padding: 18px;
  margin-top: 18px;
}
.meter {
  display: grid;
  gap: 8px;
}
.meter span {
  color: #dce8ff;
}
.meter div {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}
.meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  transition: width 0.3s ease;
}
.meter strong {
  color: var(--gold);
}
.takeaway-card {
  margin-top: 18px;
  padding: 24px;
}
.takeaway-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.takeaway-grid article {
  min-height: 120px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  background: rgba(2, 6, 14, 0.38);
}
.takeaway-grid span {
  color: var(--violet);
  font-weight: 900;
}

.audio-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 24px;
  margin-top: 18px;
}
.clock {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.source-link {
  color: var(--cyan);
  text-decoration: none;
}
.transcript-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 14px;
  margin-top: 14px;
}
.transcript-tools input,
.speaker-filter select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(2, 6, 14, 0.62);
  outline: none;
}
.transcript-tools input {
  flex: 1 1 240px;
  padding: 0 16px;
}
.speaker-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.speaker-filter select {
  padding: 0 14px;
}
.copy-status,
.result-count,
.transcript-note {
  margin: 12px 4px 0;
}
.transcript-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.transcript-group {
  padding: 18px;
}
.transcript-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.transcript-speaker {
  color: var(--violet);
  font-weight: 800;
}
.transcript-group p {
  margin: 10px 0 0;
  color: #d5dfef;
  line-height: 1.8;
}
.transcript-row-time {
  color: var(--gold);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.transcript-group.is-current {
  border-color: rgba(255, 207, 115, 0.56);
  box-shadow: 0 0 0 1px rgba(255, 207, 115, 0.1), var(--shadow);
}
mark {
  color: #05111a;
  background: var(--gold);
  border-radius: 4px;
  padding: 0 3px;
}

@media (max-width: 980px) {
  .hero-card,
  .brief-grid,
  .audio-card {
    grid-template-columns: 1fr;
  }
  .brief-grid {
    gap: 14px;
  }
  .recursive-lab {
    min-height: auto;
  }
  .pressure-board {
    grid-template-columns: 1fr 1fr;
  }
  .meter-title {
    grid-column: 1 / -1;
  }
  .takeaway-grid {
    grid-template-columns: 1fr;
  }
  #topicRail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .recursive-shell {
    width: min(100% - 20px, 520px);
    padding: 14px 0 96px;
  }
  .hero-card,
  .topic-rail-card,
  .recursive-lab,
  .evidence-card,
  .pressure-board,
  .takeaway-card,
  .audio-card,
  .transcript-tools,
  .transcript-group {
    border-radius: 20px;
  }
  .hero-card {
    padding: 22px;
  }
  h1 {
    font-size: clamp(26px, 11vw, 42px);
    letter-spacing: -0.05em;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .lede {
    font-size: 14px;
  }
  #topicRail {
    grid-template-columns: 1fr;
  }
  .topic-button {
    grid-template-columns: 34px minmax(0, 1fr);
  }
  .canvas-wrap {
    min-height: 260px;
  }
  #recursiveCanvas {
    height: 260px;
  }
  .pressure-board {
    grid-template-columns: 1fr;
  }
  .audio-controls,
  .action-row,
  .transcript-tools {
    align-items: stretch;
  }
  .primary,
  .secondary,
  .source-link {
    width: 100%;
  }
  .speaker-filter {
    width: 100%;
    justify-content: space-between;
  }
  .speaker-filter select {
    flex: 1;
  }
}
