:root {
  color-scheme: light;
  --paper: #f3f0e8;
  --ink: #070707;
  --muted: #6d6a63;
  --line: rgba(7, 7, 7, 0.78);
  --line-soft: rgba(7, 7, 7, 0.18);
  --orange: #ff6400;
  --acid: #dfff32;
  --white: #fffdf7;
  --max: 1560px;
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

@property --hold-progress {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(to right, transparent calc(100% - 1px), rgba(7, 7, 7, 0.04) 1px) 0 0 / 24px 24px,
    var(--paper);
}

button,
a {
  color: inherit;
}

button {
  border-radius: 0;
  font: inherit;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
.turn-card:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
}

.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 240, 232, 0.96);
  backdrop-filter: blur(12px);
}

.wordmark,
.eyebrow,
.meta,
.timestamp,
.tag,
.control-label,
.section-index {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.wordmark {
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.live-state {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-dot {
  width: 8px;
  height: 8px;
  border: 1px solid var(--ink);
  background: transparent;
}

.status-dot[data-state="connected"] {
  background: var(--orange);
}

.status-dot[data-state="fallback"] {
  background: #e6bd00;
}

.event-hero {
  border-bottom: 1px solid var(--line);
}

.event-hero-grid {
  display: grid;
  padding: 20px 16px 24px;
}

.hero-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 32px;
}

.preview-mark {
  padding: 5px 8px;
  border: 1px solid var(--ink);
  background: var(--orange);
  color: var(--ink);
  font: 700 10px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.08em;
}

.event-title {
  max-width: 1000px;
  margin: 0;
  font-size: clamp(38px, 11vw, 108px);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.075em;
  text-wrap: balance;
}

.event-subtitle {
  max-width: 720px;
  margin: 20px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 28px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.stat {
  min-height: 70px;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat strong {
  display: block;
  margin-top: 12px;
  font-size: 20px;
}

.reader-controls {
  position: sticky;
  top: 48px;
  z-index: 25;
  display: grid;
  grid-template-columns: 1fr auto;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 240, 232, 0.98);
}

.layer-switch,
.view-actions {
  display: flex;
}

.layer-switch button,
.view-actions button,
.segmented button,
.chip,
.drawer-head button,
.text-action {
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.layer-switch button[aria-selected="true"],
.segmented button[aria-pressed="true"],
.chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.view-actions button {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.reader-layout {
  width: 100%;
}

.filter-bar {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row + .filter-row {
  margin-top: 10px;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.control-label {
  flex: 0 0 auto;
  width: 52px;
  font-size: 9px;
  color: var(--muted);
}

.segmented {
  display: flex;
  flex: 0 0 auto;
  border: 1px solid var(--ink);
}

.segmented button {
  min-height: 32px;
  padding: 0 12px;
}

.segmented button:last-child {
  border-right: 0;
}

.chip {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  font-size: 10px;
}

.content-column {
  min-width: 0;
}

.stream {
  display: grid;
}

.turn-tabs {
  position: sticky;
  top: 95px;
  z-index: 24;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 240, 232, 0.96);
  backdrop-filter: blur(12px);
}

.turn-tabs button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.turn-tabs button:last-child {
  border-right: 0;
}

.turn-tabs button[aria-selected="true"] {
  background: var(--ink);
  color: var(--paper);
}

.turn-count {
  font: 700 8px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.05em;
}

.turn-card,
.section-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 22px 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 240, 232, 0.92);
}

.turn-card {
  --hold-x: 50%;
  --hold-y: 50%;
  overflow: clip;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

.turn-card[data-distillable="true"] {
  -webkit-touch-callout: none;
  touch-action: pan-y;
}

.turn-card::before {
  position: absolute;
  z-index: -1;
  left: var(--hold-x);
  top: var(--hold-y);
  width: 18px;
  height: 18px;
  border: 1px solid rgba(7, 7, 7, 0.5);
  border-radius: 50%;
  background: rgba(223, 255, 50, 0.72);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.25);
}

.turn-card.is-holding {
  background: var(--white);
  user-select: none;
}

.turn-card.is-holding::before {
  animation: turn-press-ripple 560ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes turn-press-ripple {
  0% { opacity: 0.8; transform: translate(-50%, -50%) scale(0.2); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(30); }
}

.turn-card[data-role="analyst"] {
  box-shadow: inset 4px 0 0 var(--orange);
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 800;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.turn-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 7px 12px;
  margin-bottom: 14px;
}

.turn-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timestamp {
  padding: 0;
  border: 0;
  background: transparent;
}

.hold-meter {
  --hold-progress: 0deg;
  position: relative;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  background: conic-gradient(var(--orange) var(--hold-progress), var(--line-soft) 0deg);
  transition: transform 180ms ease;
}

.hold-meter::after {
  width: 17px;
  height: 17px;
  border-radius: inherit;
  background: var(--paper);
  content: "";
}

.is-holding .hold-meter {
  animation: turn-hold-progress 560ms linear forwards;
  transform: scale(1.08);
}

.is-distilled .hold-meter {
  background: var(--acid);
  box-shadow: inset 0 0 0 6px var(--ink);
}

@keyframes turn-hold-progress {
  from { --hold-progress: 0deg; }
  to { --hold-progress: 360deg; }
}

.speaker {
  font-size: 14px;
  font-weight: 800;
}

.speaker-role,
.timestamp,
.meta {
  color: var(--muted);
  font-size: 9px;
}

.speaker-role {
  margin-left: 7px;
}

.turn-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 22px;
  margin-bottom: 12px;
}

.compression {
  display: none;
  flex: 0 0 auto;
  padding: 4px 6px;
  border: 1px solid var(--ink);
  background: var(--acid);
  color: var(--ink);
  font: 800 8px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.is-distilled .compression {
  display: inline-block;
}

.turn-paragraph,
.digest-copy {
  margin: 0;
  font-size: 16px;
  line-height: 1.75;
}

.turn-paragraph + .turn-paragraph,
.digest-copy + .digest-copy {
  margin-top: 13px;
}

.source-copy {
  position: relative;
  z-index: 1;
  transition:
    color 380ms ease,
    font-size 520ms cubic-bezier(0.2, 0.75, 0.2, 1),
    line-height 520ms cubic-bezier(0.2, 0.75, 0.2, 1),
    transform 520ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.turn-card:not(.is-distilled) .source-copy [data-signal] {
  view-transition-name: var(--vt-name);
}

.is-distilled .source-copy {
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--line-soft);
  color: rgba(7, 7, 7, 0.3);
  font-size: 11px;
  line-height: 1.62;
  transform: translateY(2px);
}

.is-distilled .source-copy::before {
  display: block;
  margin-bottom: 8px;
  color: rgba(7, 7, 7, 0.45);
  content: "SOURCE TRACE · 30%";
  font: 700 7px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.12em;
}

.distilled-shell {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 540ms cubic-bezier(0.2, 0.75, 0.2, 1),
    opacity 240ms ease 100ms;
}

.is-distilled .distilled-shell {
  grid-template-rows: 1fr;
  opacity: 1;
}

.distilled-clip {
  overflow: hidden;
}

.signal-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.signal-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 280ms ease, transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.is-distilled .signal-item {
  opacity: 1;
  transform: translateY(0);
}

.is-distilled .signal-item:nth-child(2) { transition-delay: 55ms; }
.is-distilled .signal-item:nth-child(3) { transition-delay: 110ms; }
.is-distilled .signal-item:nth-child(4) { transition-delay: 165ms; }
.is-distilled .signal-item:nth-child(5) { transition-delay: 220ms; }
.is-distilled .signal-item:nth-child(6) { transition-delay: 275ms; }

.signal-index {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font: 800 8px/1 "SFMono-Regular", Consolas, monospace;
}

.signal-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font: 700 7px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.signal-copy {
  font-size: clamp(16px, 2.6vw, 21px);
  font-weight: 760;
  line-height: 1.35;
  letter-spacing: -0.018em;
}

.signal-copy [data-signal-target] {
  padding: 1px 3px 2px;
  background: linear-gradient(transparent 7%, var(--acid) 7% 94%, transparent 94%);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.is-distilled .signal-copy [data-signal-target] {
  view-transition-name: var(--vt-name);
}

.distill-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 9px;
}

.hint-key {
  flex: 0 0 auto;
  padding: 3px 5px;
  border: 1px solid var(--line-soft);
  font: 700 7px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.07em;
}

.hint-distilled,
.is-distilled .hint-raw {
  display: none;
}

.is-distilled .hint-distilled {
  display: inline;
}

.original {
  margin-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.original summary {
  padding: 12px 0 0;
  cursor: pointer;
  font: 700 10px/1.3 "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.original p {
  margin: 12px 0 0;
  color: #3d3b37;
  font-size: 13px;
  line-height: 1.65;
}

.event-digest {
  padding: 24px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--ink);
  color: var(--paper);
}

.event-digest h2 {
  margin: 10px 0 20px;
  font-size: 34px;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.top-list {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: rgba(243, 240, 232, 0.35);
}

.top-item {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  padding: 16px 0;
  background: var(--ink);
}

.top-number {
  color: var(--orange);
  font: 800 20px/1 "SFMono-Regular", Consolas, monospace;
}

.top-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.top-item p {
  margin: 0;
  color: #c9c5bb;
  font-size: 12px;
  line-height: 1.55;
}

.section-card {
  grid-template-columns: 46px minmax(0, 1fr);
  padding-top: 26px;
}

.section-card[data-mode="qa"] {
  box-shadow: inset 4px 0 0 var(--orange);
}

.section-index {
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
}

.section-title {
  margin: 4px 0 13px;
  font-size: clamp(22px, 6vw, 34px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tag {
  padding: 4px 6px;
  border: 1px solid var(--line-soft);
  font-size: 8px;
}

.text-action {
  min-height: auto;
  margin-top: 18px;
  padding: 7px 9px;
  border: 1px solid var(--ink);
}

.highlight-rail {
  display: none;
}

.highlight-list {
  display: grid;
  gap: 0;
}

.highlight-card {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.highlight-card h3 {
  margin: 10px 0 8px;
  font-size: 16px;
  line-height: 1.15;
}

.highlight-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.highlight-kind {
  color: var(--orange);
  font: 800 9px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.empty-state,
.loading-state,
.error-state {
  min-height: 65vh;
  padding: 64px 16px;
  border-bottom: 1px solid var(--line);
}

.empty-state.compact {
  min-height: 30vh;
}

.empty-state h2,
.loading-state h1,
.error-state h1 {
  max-width: 900px;
  margin: 14px 0;
  font-size: clamp(38px, 10vw, 86px);
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.empty-state p,
.loading-state p,
.error-state p {
  max-width: 560px;
  line-height: 1.6;
  color: var(--muted);
}

.highlight-drawer {
  width: 100%;
  max-width: none;
  max-height: 78vh;
  margin: auto 0 0;
  padding: 0;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
}

.highlight-drawer::backdrop {
  background: rgba(7, 7, 7, 0.55);
}

.interaction-toast {
  position: fixed;
  z-index: 100;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  max-width: min(360px, calc(100vw - 28px));
  padding: 11px 13px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.interaction-toast.show {
  opacity: 1;
  transform: translateY(0);
}

::view-transition-group(*) {
  animation-duration: 520ms;
  animation-timing-function: cubic-bezier(0.22, 0.74, 0.16, 1);
}

::view-transition-old(*),
::view-transition-new(*) {
  height: 100%;
  mix-blend-mode: normal;
}

.drawer-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.drawer-head button {
  border-left: 1px solid var(--line);
  border-right: 0;
}

@media (min-width: 720px) {
  .masthead,
  .event-hero-grid,
  .filter-bar,
  .turn-card,
  .section-card,
  .event-digest {
    padding-left: 28px;
    padding-right: 28px;
  }

  .hero-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .turn-tabs button {
    padding-right: 28px;
    padding-left: 28px;
  }

  .turn-card {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 18px;
  }

  .avatar {
    width: 52px;
    height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

@media (min-width: 1080px) {
  .event-hero-grid,
  .reader-controls,
  .reader-layout {
    max-width: var(--max);
    margin: 0 auto;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }

  .event-hero-grid {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 48px;
    padding-top: 36px;
    padding-bottom: 36px;
  }

  .hero-kicker,
  .event-title,
  .event-subtitle {
    grid-column: 1;
  }

  .hero-stats {
    grid-column: 2;
    grid-row: 1 / span 3;
    grid-template-columns: repeat(2, 1fr);
    align-self: end;
    margin: 0;
  }

  .reader-layout[data-layer="summary"] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
  }

  .reader-layout[data-layer="summary"] .content-column {
    border-right: 1px solid var(--line);
  }

  .highlight-rail {
    position: sticky;
    top: 95px;
    display: block;
    align-self: start;
    max-height: calc(100vh - 95px);
    overflow-y: auto;
  }

  .highlight-rail-head {
    padding: 16px;
    border-bottom: 1px solid var(--line);
  }

  .view-actions {
    display: none;
  }

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

  .turn-card,
  .section-card {
    padding-top: 30px;
    padding-bottom: 36px;
  }
}
