:root {
  --ink: #17130f;
  --paper: #efe1bd;
  --paper-deep: #d3b97d;
  --cream: #fbf2d7;
  --wood: #3b2318;
  --walnut: #1f1612;
  --green: #163527;
  --green-soft: #527b58;
  --blue: #163b5f;
  --blue-bright: #246190;
  --brass: #c59b4d;
  --brass-soft: #f0d68a;
  --white: #fff9e8;
  --muted: rgba(255, 249, 232, 0.7);
  --panel: rgba(13, 18, 15, 0.78);
  --panel-solid: #111711;
  --line: rgba(239, 214, 138, 0.22);
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.48);
  --radius: 8px;
  font-family: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--white);
  background: #090807;
  min-width: 320px;
  overflow: hidden;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  height: 100svh;
  overflow: hidden;
  background: #070706;
  max-width: 100vw;
}

.intro-door {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(320px, 1fr);
  align-items: center;
  gap: 6vw;
  padding: clamp(24px, 6vw, 78px);
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(5, 4, 3, 0.1), rgba(3, 4, 3, 0.12)),
    url("/assets/door-scene.jpg") center / cover;
  transition: opacity 420ms ease, visibility 420ms ease;
}

.intro-door::after {
  content: "";
  position: absolute;
  left: clamp(28px, 7vw, 86px);
  bottom: clamp(28px, 7vh, 78px);
  width: clamp(110px, 13vw, 168px);
  aspect-ratio: 3 / 2;
  background: url("/assets/dispatch-letter.png") center / contain no-repeat;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.58));
  opacity: 0.9;
  transform: rotate(-8deg);
  pointer-events: none;
}

.intro-door.is-entering,
.intro-door.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-door__door {
  display: none;
}

.intro-door.is-entering .intro-door__door {
  transform: perspective(900px) rotateY(-18deg) translateX(-18px);
}

.intro-door__panel {
  position: absolute;
  inset: 54px 44px;
  border: 1px solid rgba(240, 214, 138, 0.14);
  box-shadow: inset 0 0 0 10px rgba(14, 8, 5, 0.55), inset 0 0 70px rgba(0, 0, 0, 0.38);
}

.intro-door__knob {
  position: absolute;
  right: 54px;
  top: 52%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fff1af, #9b682b 62%, #4c2b12);
  box-shadow: 0 0 22px rgba(240, 214, 138, 0.35);
}

.intro-door__content {
  grid-column: 2;
  max-width: 640px;
}

.intro-door__title {
  margin: 0 0 22px;
  font-family: american-scribe, "Snell Roundhand", "Apple Chancery", cursive;
  font-size: clamp(4.4rem, 9vw, 9rem);
  font-weight: 400;
  line-height: 0.78;
  color: #f4d98f;
  text-shadow: 0 10px 34px rgba(0, 0, 0, 0.76), 0 0 18px rgba(240, 214, 138, 0.18);
}

.intro-door__copy {
  max-width: 560px;
  margin: 0 0 30px;
  color: rgba(255, 249, 232, 0.86);
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.45;
}

.intro-door__button {
  min-height: 54px;
  padding: 0 34px;
  border: 1px solid rgba(255, 229, 145, 0.72);
  border-radius: 4px;
  color: #fff2bb;
  background:
    linear-gradient(180deg, rgba(103, 75, 32, 0.96), rgba(43, 31, 17, 0.96)),
    radial-gradient(circle at 50% 20%, rgba(255, 239, 170, 0.3), transparent 38%);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 246, 193, 0.34), inset 0 -8px 18px rgba(0, 0, 0, 0.22);
}

.stage {
  position: relative;
  height: 100svh;
  width: 100%;
  max-width: 100vw;
  isolation: isolate;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(360px, 1fr) minmax(340px, 460px);
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  overflow: hidden;
}

.stage.record-collapsed {
  grid-template-columns: minmax(220px, 300px) minmax(360px, 1fr) 76px;
}

.stage__image,
.stage__wash {
  position: absolute;
  inset: 0;
  z-index: -3;
}

.stage__image {
  background-image: url("/assets/chamber-bg.png");
  background-size: cover;
  background-position: center;
  filter: saturate(0.96) contrast(1.05);
}

.stage__wash {
  z-index: -2;
  background:
    radial-gradient(circle at 18% 70%, rgba(198, 133, 45, 0.2), transparent 30%),
    linear-gradient(90deg, rgba(7, 8, 6, 0.5), transparent 42%, rgba(6, 8, 7, 0.68)),
    linear-gradient(0deg, rgba(6, 5, 4, 0.72) 0%, rgba(6, 5, 4, 0.35) 44%, rgba(6, 5, 4, 0.15) 100%);
  pointer-events: none;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  min-height: 74px;
}

.brand {
  color: var(--white);
  text-decoration: none;
  display: grid;
  gap: 6px;
}

.brand__title {
  font-family: american-scribe, "Snell Roundhand", "Apple Chancery", cursive;
  font-size: clamp(2.35rem, 4.4vw, 4.8rem);
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0;
  line-height: 0.78;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

.brand__subtitle,
.session-card__label,
.speaker-card__role,
.source-note__meta,
.turn__stance {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.brand__subtitle {
  color: var(--brass-soft);
  font-size: 0.74rem;
}

.nav {
  display: flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(255, 249, 232, 0.12);
  background: rgba(8, 10, 9, 0.42);
  backdrop-filter: blur(18px);
  border-radius: var(--radius);
}

.nav__item,
.panel-tabs__tab,
.prompt-row button {
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  border-radius: 6px;
  min-height: 38px;
  padding: 0 14px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.nav__item.is-active,
.panel-tabs__tab.is-active {
  color: var(--brass-soft);
  border-color: rgba(240, 214, 138, 0.36);
  background: rgba(197, 155, 77, 0.12);
}

.session-card {
  align-self: start;
  grid-column: 1;
  grid-row: 2;
  max-width: 300px;
  padding: 18px;
  border: 1px solid rgba(240, 214, 138, 0.24);
  border-radius: var(--radius);
  background: rgba(13, 28, 20, 0.62);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.session-card__label {
  margin: 0 0 10px;
  color: var(--brass-soft);
  font-size: 0.76rem;
  font-weight: 700;
}

.session-card__place {
  margin: 0 0 18px;
  color: var(--white);
  font-size: 0.98rem;
}

.session-card__copy {
  margin: 0;
  color: rgba(255, 249, 232, 0.82);
  font-size: 1rem;
  line-height: 1.5;
}

.speaker-rail {
  position: absolute;
  top: 112px;
  right: 24px;
  width: 306px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(240, 214, 138, 0.14);
  border-radius: var(--radius);
  background: rgba(8, 13, 10, 0.56);
  backdrop-filter: blur(18px);
}

.speaker-rail {
  scrollbar-width: none;
}

.speaker-rail::-webkit-scrollbar {
  display: none;
}

.speaker-hotspots {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.reading-theater {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  width: min(760px, 58vw);
  min-height: min(470px, 62vh);
  padding: 0;
  border: 1px solid rgba(240, 214, 138, 0.28);
  border-radius: var(--radius);
  color: var(--white);
  background:
    linear-gradient(180deg, transparent 0 46%, rgba(5, 8, 6, 0.18) 58%, rgba(4, 6, 5, 0.94) 100%),
    url("/assets/clerk-reading-scene.jpg") center / cover;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(18px);
  overflow: hidden;
  transform: translate(-50%, -50%);
}

.reading-theater.is-hidden {
  display: none;
}

.reading-theater__paper {
  display: none;
}

.reading-theater > div:last-child {
  position: relative;
  margin: 0 22px 22px;
  padding: 18px 20px;
  border: 1px solid rgba(240, 214, 138, 0.26);
  border-radius: 7px;
  background:
    linear-gradient(110deg, rgba(8, 24, 16, 0.95), rgba(10, 13, 11, 0.82)),
    radial-gradient(circle at 40% 0%, rgba(240, 214, 138, 0.12), transparent 48%);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.48);
}

.reading-theater__label {
  margin: 0 0 6px;
  color: var(--brass-soft);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.reading-theater__copy {
  margin: 0 0 12px;
  color: rgba(255, 249, 232, 0.8);
  line-height: 1.42;
}

.reading-theater__ticks {
  display: flex;
  gap: 6px;
}

.reading-theater__ticks span {
  width: 34px;
  height: 2px;
  background: var(--brass-soft);
  opacity: 0.32;
  animation: clerk-tick 1.2s ease-in-out infinite;
}

.reading-theater__ticks span:nth-child(2) {
  animation-delay: 160ms;
}

.reading-theater__ticks span:nth-child(3) {
  animation-delay: 320ms;
}

.speaker-hotspots__svg {
  width: 100%;
  height: 100%;
  display: block;
}

.speaker-hotspot {
  opacity: 0;
  fill: rgba(240, 214, 138, 0.08);
  stroke: transparent;
  stroke-width: 2.2;
  transition: opacity 220ms ease, fill 220ms ease, stroke 220ms ease;
}

.speaker-hotspot.is-active {
  opacity: 1;
  fill: rgba(240, 214, 138, 0.1);
  stroke: rgba(240, 214, 138, 0.88);
  filter: url("#speaker-glow");
}

.document-voice {
  opacity: 0;
  transition: opacity 220ms ease, transform 220ms ease;
}

.document-voice.is-active {
  opacity: 0;
  filter: url("#speaker-glow");
}

.document-voice__asset {
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.45));
}

.speech-bubble {
  position: absolute;
  left: var(--bubble-x);
  top: var(--bubble-y);
  z-index: 4;
  width: min(430px, 34vw);
  overflow: visible;
  max-height: min(310px, 34vh);
  padding: 16px 18px 15px;
  border: 1px solid rgba(240, 214, 138, 0.36);
  border-left: 3px solid var(--green-soft);
  border-radius: var(--radius);
  color: var(--white);
  background:
    linear-gradient(110deg, rgba(15, 23, 17, 0.94), rgba(14, 18, 15, 0.78)),
    radial-gradient(circle at 12% 20%, rgba(240, 214, 138, 0.1), transparent 36%);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 249, 232, 0.07);
  backdrop-filter: blur(18px);
  animation: bubble-arrives 260ms ease-out both;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  left: 24px;
  bottom: -10px;
  width: 18px;
  height: 18px;
  border-right: 1px solid rgba(240, 214, 138, 0.28);
  border-bottom: 1px solid rgba(240, 214, 138, 0.28);
  background: rgba(14, 18, 15, 0.86);
  transform: rotate(45deg);
}

.speech-bubble.is-hidden {
  display: none;
}

.speech-bubble.is-outside {
  border-left-color: #d7947a;
}

.speech-bubble.is-dispatch:not(.is-placard) {
  left: 50%;
  top: 118px;
  width: min(560px, 42vw);
  max-height: min(330px, 36vh);
  border-left-width: 1px;
  border-top: 3px solid #d7947a;
  translate: -50% 0;
}

.speech-bubble.is-dispatch:not(.is-placard)::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 14px);
  width: clamp(178px, 18vw, 250px);
  aspect-ratio: 3 / 2;
  background: url("/assets/dispatch-letter.png") center / contain no-repeat;
  filter: drop-shadow(0 18px 20px rgba(0, 0, 0, 0.52));
  transform: translateX(-50%) rotate(5deg);
  pointer-events: none;
}

.speech-bubble.is-dispatch:not(.is-placard)::after {
  display: none;
}

.stage:not(.record-collapsed) .speech-bubble:not(.is-placard) {
  left: calc(318px + (100vw - 844px) / 2);
  top: 118px;
  width: min(520px, max(420px, calc(100vw - 900px)));
  max-height: min(300px, 34vh);
  translate: -50% 0;
}

.speech-bubble.is-placard {
  left: 170px;
  top: auto;
  bottom: clamp(194px, 24vh, 230px);
  width: min(900px, calc(100vw - 540px));
  max-height: 185px;
  overflow: hidden;
  padding: 15px 20px 16px;
  border-left-width: 1px;
  border-top: 3px solid var(--green-soft);
  background:
    linear-gradient(105deg, rgba(17, 28, 20, 0.95), rgba(16, 18, 15, 0.86)),
    radial-gradient(circle at 18% 0%, rgba(240, 214, 138, 0.14), transparent 34%);
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 249, 232, 0.08);
}

.speech-bubble.is-placard::after {
  display: none;
}

.speech-bubble.is-placard.is-outside {
  border-left-color: rgba(240, 214, 138, 0.36);
  border-top-color: #d7947a;
}

.speech-bubble__kicker {
  margin: 0 0 8px;
  color: var(--brass-soft);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.speech-bubble__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.speech-bubble__speaker {
  font-size: 1.35rem;
  line-height: 1.05;
  font-weight: 700;
}

.speech-bubble__stance {
  color: var(--brass-soft);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.speech-bubble__reply {
  margin: -2px 0 8px;
  color: rgba(255, 249, 232, 0.58);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.68rem;
}

.speech-bubble__text {
  margin: 0;
  color: rgba(255, 249, 232, 0.86);
  font-size: 0.98rem;
  line-height: 1.52;
  max-height: 150px;
  overflow: auto;
  padding-right: 4px;
}

.speech-bubble.is-placard .speech-bubble__title {
  margin-bottom: 6px;
}

.speech-bubble.is-placard .speech-bubble__speaker {
  font-size: 1.25rem;
}

.speech-bubble.is-placard .speech-bubble__reply {
  margin-bottom: 6px;
}

.speech-bubble.is-placard .speech-bubble__text {
  max-height: 78px;
  font-size: 0.95rem;
  line-height: 1.45;
}

.speech-bubble.is-placard .speech-bubble__record {
  margin-top: 8px;
}

.speech-bubble__record {
  display: inline-flex;
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brass-soft);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.76rem;
}

.speaker-card {
  position: relative;
  min-height: 76px;
  padding: 11px 10px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: rgba(255, 249, 232, 0.035);
  color: var(--white);
  text-align: left;
  overflow: hidden;
}

.speaker-card::before {
  content: none;
}

.speaker-card.is-active {
  border-color: rgba(240, 214, 138, 0.72);
  background: rgba(197, 155, 77, 0.16);
  box-shadow: 0 0 28px rgba(240, 214, 138, 0.18), inset 0 0 24px rgba(240, 214, 138, 0.07);
}

.speaker-card__name {
  display: block;
  font-size: 0.96rem;
  line-height: 1.05;
}

.speaker-card__role {
  display: block;
  margin-top: 7px;
  color: rgba(255, 249, 232, 0.58);
  font-size: 0.55rem;
  line-height: 1.35;
}

.desk {
  grid-column: 1 / 3;
  grid-row: 3;
  align-self: end;
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 16px;
  margin-top: 72px;
  padding: 96px 18px 28px;
  pointer-events: none;
}

.seat-marker,
.question-form {
  pointer-events: auto;
}

.seat-marker {
  align-self: start;
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--cream);
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.68);
}

.seat-marker__icon {
  width: 42px;
  height: 42px;
  border-radius: 50% 50% 45% 45%;
  border: 1px solid rgba(255, 249, 232, 0.35);
  background: linear-gradient(180deg, rgba(255, 249, 232, 0.8), rgba(132, 104, 65, 0.4));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.question-form {
  display: grid;
  gap: 10px;
  max-width: 900px;
  padding: 20px 24px 22px;
  border: 1px solid rgba(67, 42, 24, 0.42);
  border-radius: 8px 8px 0 0;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(255, 252, 236, 0.82), rgba(232, 205, 143, 0.9)),
    radial-gradient(circle at 20% 20%, rgba(118, 77, 26, 0.14), transparent 44%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.question-form__label {
  color: #523720;
  font-size: clamp(1.4rem, 2.2vw, 2.25rem);
  line-height: 1.05;
  font-style: italic;
}

.question-form textarea {
  width: 100%;
  resize: none;
  border: 0;
  border-top: 1px solid rgba(52, 34, 18, 0.18);
  border-bottom: 1px solid rgba(52, 34, 18, 0.16);
  background: transparent;
  color: var(--ink);
  outline: none;
  padding: 10px 0;
  min-height: 62px;
  font-size: 1.05rem;
  line-height: 1.45;
}

.question-form textarea::placeholder {
  color: rgba(59, 35, 24, 0.58);
}

.question-form.is-action-mode {
  gap: 14px;
}

.question-form.is-action-mode textarea,
.question-form.is-action-mode .submit-button {
  display: none;
}

.question-form__actions {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.question-form.is-action-mode .question-form__actions {
  justify-content: flex-start;
}

.prompt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.question-form.is-action-mode .prompt-row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
}

.prompt-row button {
  min-height: 34px;
  color: #4f3925;
  border-color: rgba(75, 49, 26, 0.2);
  background: rgba(255, 249, 232, 0.38);
  font-size: 0.74rem;
}

.prompt-row button[data-action] {
  color: #2f271d;
  background: rgba(255, 249, 232, 0.58);
}

.question-form.is-action-mode .prompt-row button[data-action] {
  min-height: 44px;
  padding-inline: 14px;
  font-size: 0.78rem;
}

.prompt-row button[data-action="next-speaker"] {
  border-color: rgba(35, 86, 126, 0.32);
  background: rgba(230, 241, 246, 0.72);
  font-weight: 700;
}

.prompt-row button:disabled {
  opacity: 0.68;
  cursor: wait;
}

.submit-button {
  min-width: 220px;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid rgba(246, 226, 162, 0.38);
  border-radius: 7px;
  color: var(--white);
  background: linear-gradient(180deg, #215c88, #133656);
  box-shadow: 0 16px 32px rgba(20, 48, 82, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-size: 1.04rem;
  font-weight: 700;
}

.submit-button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.submit-button__quill {
  width: 18px;
  height: 30px;
  transform: rotate(28deg);
  background: linear-gradient(135deg, transparent 46%, var(--white) 47% 56%, transparent 57%),
    linear-gradient(180deg, transparent 12%, var(--white) 13% 84%, transparent 85%);
  opacity: 0.88;
}

.proceedings {
  grid-column: 3;
  grid-row: 2 / 4;
  align-self: end;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: min(720px, calc(100vh - 140px));
  max-height: calc(100vh - 116px);
  border: 1px solid rgba(240, 214, 138, 0.24);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.proceedings.sources-active {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.record-toggle {
  display: none;
  min-height: 42px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--brass-soft);
  background: rgba(255, 249, 232, 0.04);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.proceedings.is-collapsed {
  position: absolute;
  right: 24px;
  bottom: 72px;
  width: 306px;
  min-height: 46px;
  max-height: 46px;
  margin-top: 0;
}

.proceedings.is-collapsed .record-toggle {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-bottom: 0;
}

.proceedings.is-collapsed .panel-tabs,
.proceedings.is-collapsed .proceedings__body,
.proceedings.is-collapsed .source-drawer {
  display: none;
}

.proceedings:not(.is-collapsed) .record-toggle {
  display: block;
}

.stage:not(.record-collapsed) .speaker-rail {
  display: none;
}

.panel-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.panel-tabs__tab {
  flex: 1;
  height: 38px;
  min-height: 38px;
}

.proceedings__body {
  overflow: auto;
  padding: 16px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 360px;
  text-align: center;
  color: rgba(255, 249, 232, 0.72);
}

.empty-state strong {
  display: block;
  color: var(--white);
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.motion {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(240, 214, 138, 0.2);
  border-radius: 7px;
  background: rgba(239, 225, 189, 0.08);
  color: var(--cream);
  font-style: italic;
  line-height: 1.42;
}

.turn {
  position: relative;
  margin: 0 0 12px;
  padding: 14px 14px 14px 16px;
  border-left: 2px solid var(--green-soft);
  border-radius: 0 7px 7px 0;
  background: rgba(255, 249, 232, 0.045);
  animation: turn-arrives 320ms ease-out both;
}

.turn.is-clerk {
  border-left-color: var(--brass);
}

.turn.is-outside {
  border-left-color: #d7947a;
  background: rgba(121, 60, 44, 0.16);
}

.turn.is-current {
  background: rgba(255, 249, 232, 0.075);
  box-shadow: inset 0 0 0 1px rgba(240, 214, 138, 0.1), 0 16px 34px rgba(0, 0, 0, 0.18);
}

.turn__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.turn__speaker {
  color: var(--white);
  font-size: 1.02rem;
  font-weight: 700;
}

.turn__stance {
  color: var(--brass-soft);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.58rem;
}

.turn__reply {
  margin: -2px 0 8px;
  color: rgba(255, 249, 232, 0.54);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.68rem;
}

.turn__text {
  margin: 0;
  color: rgba(255, 249, 232, 0.84);
  line-height: 1.52;
  font-size: 0.98rem;
}

.record-button {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brass-soft);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.76rem;
}

.source-drawer {
  max-height: 240px;
  overflow: auto;
  border-top: 1px solid var(--line);
  background: rgba(11, 19, 14, 0.78);
  padding: 14px 16px;
}

.proceedings.sources-active .source-drawer {
  max-height: none;
  min-height: 0;
  height: 100%;
  border-top: 0;
}

.source-note {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid rgba(240, 214, 138, 0.13);
  color: inherit;
  text-decoration: none;
}

.source-note[href] {
  cursor: pointer;
}

.source-note[href]:hover .source-note__title,
.source-note[href]:focus-visible .source-note__title {
  color: var(--brass-soft);
}

.source-note:last-child {
  border-bottom: 0;
}

.source-note__title {
  color: var(--white);
  margin: 0 0 5px;
  font-size: 0.95rem;
}

.source-note__meta {
  color: rgba(255, 249, 232, 0.58);
  font-size: 0.58rem;
}

.source-note__citation {
  display: block;
  margin-top: 3px;
  color: var(--brass-soft);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.source-note__summary {
  margin: 7px 0 0;
  color: rgba(255, 249, 232, 0.75);
  font-size: 0.88rem;
  line-height: 1.45;
}

.source-note__open {
  display: inline-flex;
  margin-top: 8px;
  color: var(--brass-soft);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

@media (max-width: 1320px) and (min-width: 1121px) {
  .stage.record-collapsed .question-form {
    max-width: 740px;
  }

  .stage.record-collapsed .question-form.is-action-mode .prompt-row {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

.share-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
}

.share-modal[hidden] {
  display: none;
}

.share-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(5, 5, 4, 0.72);
  backdrop-filter: blur(8px);
}

.share-modal__panel {
  position: relative;
  width: min(760px, calc(100vw - 48px));
  min-width: 0;
  max-height: calc(100svh - 48px);
  overflow: auto;
  overflow-x: hidden;
  padding: 24px;
  border: 1px solid rgba(240, 214, 138, 0.28);
  border-radius: var(--radius);
  background: rgba(12, 18, 14, 0.94);
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.66);
}

.share-modal__close {
  position: absolute;
  right: 16px;
  top: 16px;
  min-height: 34px;
  border: 1px solid rgba(255, 249, 232, 0.12);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 249, 232, 0.04);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
}

.share-modal__eyebrow {
  margin: 0 0 8px;
  color: var(--brass-soft);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.share-modal h2 {
  margin: 0 0 18px;
  font-size: 2rem;
  line-height: 1.05;
}

.share-card {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 330px;
  padding: 48px 118px 44px;
  border: 1px solid rgba(240, 214, 138, 0.28);
  border-radius: 8px;
  color: #24190f;
  background: url("/assets/share-parchment-bg.jpg") center / cover no-repeat;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.share-card::before {
  content: "";
  position: absolute;
  inset: 9% 9%;
  border-radius: 8px;
  background: rgba(255, 244, 208, 0.12);
  pointer-events: none;
}

.share-card__brand,
.share-card__label,
.share-card__speaker {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  overflow-wrap: anywhere;
}

.share-card__brand {
  position: relative;
  z-index: 1;
  margin: 0 0 14px;
  color: #6c4b22;
  font-size: 0.62rem;
  font-weight: 800;
}

.share-card__question {
  position: relative;
  z-index: 1;
  margin: 0 0 18px;
  font-size: clamp(1.34rem, 3.2vw, 1.88rem);
  line-height: 1.12;
  font-style: italic;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.share-card__line {
  position: relative;
  z-index: 1;
  height: 1px;
  margin: 0 0 16px;
  background: rgba(52, 34, 18, 0.2);
}

.share-card__speaker {
  position: relative;
  z-index: 1;
  margin: 0 0 8px;
  color: #6c4b22;
  font-size: 0.64rem;
  font-weight: 800;
}

.share-card__quote {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.38;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
}

.share-modal__actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
  min-width: 0;
}

.share-modal__actions button {
  min-width: 0;
  min-height: 42px;
  border: 1px solid rgba(240, 214, 138, 0.25);
  border-radius: 6px;
  color: var(--white);
  background: rgba(255, 249, 232, 0.06);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
}

.share-modal__status {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--brass-soft);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
}

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

  .app-shell {
    height: auto;
    min-height: 100svh;
    overflow: visible;
  }

  .stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto 1fr auto;
    height: auto;
    min-height: 100svh;
    padding: 16px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .topbar,
  .session-card,
  .speaker-rail,
  .speech-bubble,
  .reading-theater,
  .proceedings,
  .desk {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
  }

  .nav__item {
    flex: 1;
    min-width: 0;
  }

  .session-card {
    max-width: none;
    overflow-wrap: anywhere;
  }

  .speaker-rail {
    position: static;
    display: flex;
    width: 100%;
    overflow-x: auto;
    margin-right: 0;
  }

  .speech-bubble {
    position: static;
    width: 100%;
    min-height: 0;
    max-height: none;
  }

  .stage:not(.record-collapsed) .speech-bubble:not(.is-placard) {
    position: static;
    left: auto;
    top: auto;
    width: 100%;
    max-height: none;
    translate: none;
  }

  .reading-theater {
    position: static;
    transform: none;
    grid-template-columns: 62px 1fr;
  }

  .speech-bubble::after,
  .speaker-hotspots {
    display: none;
  }

  .speaker-card {
    flex: 0 0 138px;
  }

  .proceedings {
    position: static;
    width: 100%;
    min-height: 460px;
    max-height: none;
  }

  .proceedings.is-collapsed {
    position: static;
    width: 100%;
    min-height: 46px;
    max-height: 46px;
  }

  .desk {
    padding: 0;
    margin-top: 0;
    grid-template-columns: 1fr;
  }

  .question-form {
    width: 100%;
    max-width: 100%;
  }

  .seat-marker {
    display: none;
  }
}

@media (max-width: 680px) {
  .intro-door {
    grid-template-columns: 1fr;
    align-content: center;
    justify-items: center;
    gap: 22px;
    padding: 28px 24px;
    overflow: hidden;
    text-align: center;
    background:
      radial-gradient(circle at 50% 42%, rgba(8, 6, 4, 0.08), rgba(5, 4, 3, 0.72) 64%, rgba(3, 3, 3, 0.86) 100%),
      url("/assets/door-scene.jpg") 17% center / cover;
  }

  .intro-door__content {
    grid-column: 1;
    justify-self: center;
    width: min(100%, 300px);
    max-width: calc(100vw - 48px);
    padding-top: 18svh;
  }

  .intro-door__door {
    justify-self: start;
    width: min(58vw, 240px);
    min-width: 190px;
  }

  .intro-door__title {
    margin-bottom: 18px;
    font-size: clamp(3rem, 15vw, 3.62rem);
    line-height: 0.84;
  }

  .intro-door__title span {
    display: block;
  }

  .intro-door__copy {
    width: 100%;
    max-width: 286px;
    margin-inline: auto;
    margin-bottom: 26px;
    font-size: 0.96rem;
    line-height: 1.4;
  }

  .intro-door::after {
    left: 22px;
    bottom: 34px;
    width: 116px;
    opacity: 0.82;
  }

  .stage {
    width: 100vw;
    grid-template-rows: auto;
    align-content: start;
    padding: 12px 12px 14px;
    gap: 12px;
    justify-items: start;
  }

    .topbar,
    .nav,
    .speech-bubble,
    .desk,
    .question-form,
    .proceedings {
    width: min(calc(100vw - 24px), 366px);
    max-width: min(calc(100vw - 24px), 366px);
  }

  .session-card,
  .speaker-rail {
    display: none;
  }

  .reading-theater {
    position: fixed;
    inset: 0;
    z-index: 18;
    display: grid;
    width: 100vw;
    max-width: none;
    min-height: 100svh;
    border: 0;
    border-radius: 0;
    background:
      linear-gradient(180deg, transparent 0 38%, rgba(5, 8, 6, 0.14) 54%, rgba(4, 6, 5, 0.96) 100%),
      url("/assets/clerk-reading-scene.jpg") 18% center / cover;
    box-shadow: none;
  }

  .reading-theater.is-hidden {
    display: none;
  }

  .reading-theater > div:last-child {
    width: calc(100vw - 32px);
    margin: auto 16px 28px;
    padding: 20px;
  }

  .reading-theater__label {
    font-size: 0.76rem;
  }

  .reading-theater__copy {
    font-size: 1rem;
  }

  .stage__image {
    background-position: 24% center;
  }

  .stage__wash {
    background:
      linear-gradient(180deg, rgba(6, 5, 4, 0.4), rgba(6, 5, 4, 0.86)),
      linear-gradient(90deg, rgba(6, 5, 4, 0.35), rgba(6, 5, 4, 0.55));
  }

  .brand__title {
    font-size: 2.65rem;
    line-height: 0.82;
  }

  .topbar {
    gap: 10px;
  }

  .brand__subtitle {
    font-size: 0.66rem;
  }

  .speech-bubble {
    position: relative;
    left: auto;
    top: auto;
    width: min(calc(100vw - 24px), 366px);
    max-height: none;
    transform: none;
  }

  .speech-bubble.is-dispatch:not(.is-placard) {
    left: auto;
    top: auto;
    width: min(calc(100vw - 24px), 366px);
    max-height: none;
    translate: none;
    transform: none;
  }

  .speech-bubble.is-dispatch:not(.is-placard)::before {
    display: none;
  }

  .speech-bubble__text {
    max-height: 220px;
  }

  .question-form {
    padding: 18px;
  }

  .question-form__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .prompt-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .submit-button {
    width: 100%;
  }

  .share-modal {
    padding: 12px;
    place-items: center;
  }

  .share-modal__panel {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    padding: 18px;
  }

  .share-modal__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .share-modal__actions button {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .share-card {
    min-height: 0;
    max-width: 100%;
    padding: 46px 36px 42px;
  }

  .share-card > * {
    min-width: 0;
    max-width: 100%;
  }

  .share-card__brand {
    margin-bottom: 12px;
    font-size: 0.56rem;
    line-height: 1.25;
    white-space: normal;
  }

  .share-card__question {
    margin-bottom: 14px;
    font-size: clamp(1.32rem, 9.2vw, 2rem);
    line-height: 1.04;
    -webkit-line-clamp: 3;
  }

  .share-card__line {
    margin-bottom: 14px;
  }

  .share-card__speaker {
    font-size: 0.58rem;
  }

  .share-card__quote {
    font-size: 1rem;
    line-height: 1.26;
    -webkit-line-clamp: 5;
  }

  .prompt-row button {
    flex: 1;
    min-width: 0;
    padding-inline: 8px;
  }

  .panel-tabs__tab,
  .nav__item {
    padding-inline: 10px;
  }
}

@keyframes turn-arrives {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bubble-arrives {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes paper-breathes {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }

  50% {
    transform: translateY(-4px) rotate(1deg);
  }
}

@keyframes clerk-tick {
  0%,
  100% {
    opacity: 0.26;
    transform: scaleX(0.72);
    transform-origin: left center;
  }

  45% {
    opacity: 0.9;
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .turn,
  .speech-bubble,
  .reading-theater__paper,
  .reading-theater__ticks span {
    animation: none;
  }
}
