/* The meeting room. Tokens from tokens.css only; the page reuses site.css parts (panels, turns, asks, chip, btn). */
.room { padding-block: var(--space-2xl) var(--space-3xl); display: grid; gap: var(--space-lg); }
.room__head { display: flex; flex-wrap: wrap; gap: var(--space-md); justify-content: space-between; align-items: end; }
.room h1 { font-size: var(--text-display-s); max-width: 14ch; }
.room .lead { margin-top: var(--space-sm); color: var(--color-ink-2); }
.room__mode { max-width: 44ch; white-space: normal; padding-block: var(--space-2xs); }
.room__mode.is-live { background: var(--color-ok-soft); border-color: var(--color-ok); }
.room__mode.is-replay { background: var(--color-cool-soft); border-color: var(--color-cool); }
.room__h2 { font-size: var(--text-title); margin-bottom: var(--space-sm); }

.room__label { color: var(--color-muted); font-size: var(--text-sm); }
.field { min-height: 40px; padding: 0 var(--space-sm); border: var(--rule-hair) solid var(--color-muted); border-radius: 4px; background: var(--color-paper-3); color: var(--color-ink); min-width: 0; }
.field::placeholder { color: var(--color-muted); }
.room__q { flex: 1 1 18rem; }
.btn.is-busy { opacity: 0.6; cursor: progress; }

.room__grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--space-lg); align-items: start; }
.room__main, .room__side { display: grid; gap: var(--space-lg); min-width: 0; }
@media (max-width: 60rem) { .room__grid { grid-template-columns: minmax(0, 1fr); } }

/* three steps across the top; the current one lights up */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-sm); }
.steps li { display: flex; gap: var(--space-sm); align-items: center; padding: var(--space-sm) var(--space-md); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-2); color: var(--color-muted); font-size: var(--text-sm); transition: border-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out); }
.steps b { color: var(--color-ink-2); font-weight: 500; }
.steps__n { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: var(--rule-hair) solid var(--color-rule-2); font-family: var(--font-outlier); font-size: var(--text-xs); }
.steps li[aria-current="step"] { border-color: var(--color-accent); background: var(--color-accent-soft); color: var(--color-ink); }
.steps li[aria-current="step"] b { color: var(--color-ink); }
.steps li[aria-current="step"] .steps__n { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.steps li.is-done .steps__n { background: var(--color-ok-soft); border-color: var(--color-ok); color: var(--color-ok); }
kbd { display: inline-block; padding: 0 6px; border: var(--rule-hair) solid currentColor; border-bottom-width: 2px; border-radius: 4px; font-family: var(--font-outlier); font-size: 0.8em; line-height: 1.5; }
@media (max-width: 48rem) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* avatars */
.face { flex: none; display: inline-grid; width: 36px; height: 36px; }
.face .av { width: 100%; height: 100%; display: block; }
.face--sm { width: 24px; height: 24px; }

/* the call: a seat per person; the card slides in on the right like the heads-up card */
.stage { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; aspect-ratio: 16 / 9; min-height: 20rem; overflow: hidden; border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: radial-gradient(120% 90% at 30% 0%, var(--color-stage-glow), var(--color-paper-3) 70%); }
.stage.has-card { grid-template-columns: minmax(0, 1fr) minmax(16rem, 23rem); }
.stage__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage__tiles { grid-column: 1; grid-row: 1; margin: 0; padding: var(--space-md); list-style: none; display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: var(--space-sm); min-height: 0; }
.stage__video:not([hidden]) ~ .stage__tiles { align-self: end; grid-auto-rows: auto; grid-template-columns: repeat(auto-fit, minmax(6rem, 8rem)); padding: var(--space-sm); z-index: 1; }
.tile { position: relative; display: grid; place-items: center; align-content: center; gap: var(--space-xs); min-height: 0; padding: var(--space-sm); border: 2px solid transparent; border-radius: 14px; background: color-mix(in oklab, var(--color-paper-2) 85%, transparent); transition: border-color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out); }
.tile__face { width: clamp(48px, 7vw, 84px); height: clamp(48px, 7vw, 84px); border-radius: 50%; transition: transform var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out); }
.tile__name { display: inline-flex; gap: var(--space-xs); align-items: center; padding: 2px var(--space-xs); border-radius: 4px; background: color-mix(in oklab, var(--color-paper-3) 80%, transparent); color: var(--color-ink-2); font-size: var(--text-sm); }
.tile__bars { display: none; gap: 2px; align-items: end; height: 12px; }
.tile__bars span { width: 3px; height: 100%; border-radius: 2px; background: var(--color-accent); transform-origin: bottom; animation: bars 0.9s var(--ease-in-out) infinite; }
.tile__bars span:nth-child(2) { animation-delay: -0.3s; }
.tile__bars span:nth-child(3) { animation-delay: -0.6s; }
@keyframes bars { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
.tile.is-talking { border-color: var(--color-accent); background: color-mix(in oklab, var(--color-accent-soft) 70%, var(--color-paper-2)); }
.tile.is-talking .tile__face { transform: scale(1.06); box-shadow: 0 0 0 4px color-mix(in oklab, var(--color-accent) 45%, transparent); }
.tile.is-talking .tile__name { color: var(--color-ink); }
.tile.is-talking .tile__bars { display: inline-flex; }
.tile.is-talking .av-mouth { animation: talk 0.32s var(--ease-in-out) infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes talk { to { transform: scaleY(1.9); } }
.av-eyes { animation: blink 5s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes blink { 0%, 94%, 100% { transform: none; } 97% { transform: scaleY(0.1); } }

.stage__cc { grid-column: 1; grid-row: 2; margin: 0 var(--space-md) var(--space-md); min-height: 2.75rem; padding: var(--space-xs) var(--space-sm); border-radius: 6px; background: var(--color-scrim); color: var(--color-ink); font-size: var(--text-md); line-height: 1.4; z-index: 1; }
.stage__cc:empty { visibility: hidden; }
.stage__cc b { color: var(--color-accent); font-weight: 500; }

.stage__play { position: absolute; inset: 0; margin: auto; width: max-content; height: max-content; display: inline-flex; gap: var(--space-sm); align-items: center; padding: var(--space-md) var(--space-lg); border: 0; border-radius: 999px; background: var(--color-accent); color: var(--color-accent-ink); font: inherit; font-size: var(--text-lg); font-weight: 500; cursor: pointer; z-index: 3; box-shadow: var(--shadow-float); }
.stage__play:hover { background: var(--color-ink); }
.stage__play[hidden] { display: none; }
.stage__tri { width: 0; height: 0; border-block: 9px solid transparent; border-inline-start: 15px solid currentColor; }
.stage__nudge { position: absolute; top: var(--space-md); left: 50%; transform: translateX(-50%); padding: var(--space-xs) var(--space-md); border: var(--rule-hair) solid var(--color-accent); border-radius: 999px; background: var(--color-paper); color: var(--color-ink-2); font: inherit; font-size: var(--text-sm); cursor: pointer; z-index: 3; animation: nudge 1.6s var(--ease-in-out) infinite; }
.stage__nudge b { color: var(--color-accent); font-weight: 500; }
.stage__nudge[hidden] { display: none; }
@keyframes nudge { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--color-accent) 50%, transparent); } 50% { box-shadow: 0 0 0 8px transparent; } }

.stage__cards { grid-column: 2; grid-row: 1 / -1; display: grid; gap: var(--space-sm); align-content: start; padding: var(--space-md) var(--space-md) var(--space-md) 0; min-height: 0; overflow: auto; z-index: 2; }
.stage__cards:empty { display: none; }
@media (max-width: 48rem) {
  .stage, .stage.has-card { aspect-ratio: auto; min-height: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; }
  .stage__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; }
  .tile { padding-block: var(--space-md); }
  .stage__cards { grid-column: 1; grid-row: 3; padding: 0 var(--space-md) var(--space-md); }
}

/* the card, the same shape as the desktop overlay */
.rcard { display: grid; gap: var(--space-sm); padding: var(--space-md); border: var(--rule-hair) solid var(--color-rule-2); border-top: 3px solid var(--color-accent); border-radius: var(--radius-card); background: var(--color-paper); color: var(--color-ink); box-shadow: var(--shadow-pop); animation: rcard-in var(--dur-long) var(--ease-out); }
.rcard--wait { border-top-color: var(--color-cool); }
@keyframes rcard-in { from { opacity: 0; transform: translateX(var(--space-md)); } to { opacity: 1; transform: none; } }
.rcard__top { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; justify-content: space-between; }
.rcard__brand { display: inline-flex; gap: var(--space-xs); align-items: center; }
.rcard__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); }
.rcard__name { font-weight: 500; }
.rcard__asof { color: var(--color-muted); font-size: var(--text-xs); }
.rcard ul { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-md); }
.rcard li { display: grid; gap: var(--space-xs); }
.rcard__stmt { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: baseline; font-size: var(--text-md); line-height: 1.4; }
.rcard__q { display: flex; gap: var(--space-xs); align-items: start; padding: var(--space-xs); border-radius: 6px; background: var(--color-paper-2); color: var(--color-ink-2); font-size: var(--text-sm); overflow-wrap: anywhere; }
.rcard__q b { color: var(--color-ink); font-weight: 500; }
.rcard__cites { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.rcard__why, .rcard__suggest { font-size: var(--text-sm); color: var(--color-ink-2); }
.rcard__suggest b { color: var(--color-ink); font-weight: 500; }
.rcard__x { justify-self: end; min-height: 32px; padding: 0 var(--space-sm); font-size: var(--text-sm); }

.cite { min-height: 28px; padding: 0 var(--space-xs); border: var(--rule-hair) solid var(--color-rule-2); border-radius: 4px; background: transparent; color: var(--color-cool); cursor: pointer; font-family: var(--font-outlier); font-size: var(--text-xs); }
.cite:hover { background: var(--color-cool-soft); }
.chip--warn { background: var(--color-accent-soft); border-color: var(--color-accent); }
.chip--mute { color: var(--color-muted); }

/* controls under the call */
.controls { padding: 0; }
.controls__row { display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: center; padding: var(--space-sm) var(--space-lg); }
.controls__play { min-width: 5.5rem; justify-content: center; }
.controls__press { font-size: var(--text-md); gap: var(--space-xs); }
.controls__press kbd { border-color: color-mix(in oklab, var(--color-accent-ink) 50%, transparent); }
.controls__time { color: var(--color-ink-2); white-space: nowrap; }
.controls__status { padding: var(--space-xs) var(--space-lg) var(--space-sm); color: var(--color-muted); font-size: var(--text-sm); }
.controls__row--opts .field[hidden], .room__label[hidden] { display: none; }
.track { position: relative; flex: 1 1 12rem; min-width: 8rem; display: grid; align-items: center; }
.track__seek { width: 100%; accent-color: var(--color-accent); }
.track__marks { position: absolute; inset-inline: 8px; top: 0; height: 6px; pointer-events: none; }
.track__mark { position: absolute; top: -2px; width: 3px; height: 8px; margin-left: -1px; border-radius: 2px; }
.track__mark--warn { background: var(--color-accent); }
.track__mark--bad { background: var(--color-bad); }
.room__q { flex: 1 1 16rem; }
.room__q[hidden] { display: none; }
@media (max-width: 40rem) { .controls__row { padding-inline: var(--space-md); } .controls__press { flex: 1 0 100%; justify-content: center; } }

/* the transcript reads like a chat */
.chat { list-style: none; margin: 0; padding: var(--space-xs) 0; max-height: 26rem; overflow: auto; display: grid; align-content: start; background: var(--color-paper-2); }
.chat > li { display: flex; gap: var(--space-sm); align-items: start; padding: var(--space-xs) var(--space-lg); animation: rcard-in var(--dur-long) var(--ease-out); }
.chat__body { display: grid; gap: 2px; min-width: 0; }
.chat__meta { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: baseline; }
.chat__who { color: var(--color-ink); font-weight: 500; }
.chat__at { color: var(--color-muted); font-size: var(--text-xs); }
.chat__tag { display: none; padding: 0 6px; border-radius: 4px; background: var(--color-accent); color: var(--color-accent-ink); font-size: var(--text-xs); font-weight: 500; }
.chat__text { margin: 0; color: var(--color-ink-2); overflow-wrap: anywhere; }
.chat > li.is-cited { background: var(--color-accent-soft); box-shadow: inset 3px 0 0 var(--color-accent); }
.chat > li.is-cited .chat__tag { display: inline-block; }
.chat > li.is-cited .chat__text { color: var(--color-ink); }
.chat:empty::before { content: "The transcript fills in as people talk."; display: block; padding: var(--space-sm) var(--space-lg); color: var(--color-muted); font-size: var(--text-sm); }

.room__who { color: var(--color-ink); font-weight: 500; }
.room__conf { color: var(--color-muted); font-size: var(--text-xs); }

/* under the hood, closed by default */
.hood { border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-2); }
.hood > summary { padding: var(--space-md) var(--space-lg); cursor: pointer; font-weight: 500; }
.hood > summary:hover { color: var(--color-accent); }
.hood[open] > summary { border-bottom: var(--rule-hair) solid var(--color-rule); }
.hood .room__traces { padding: var(--space-lg); }

@media (prefers-reduced-motion: reduce) {
  .tile__bars span, .tile.is-talking .av-mouth, .av-eyes, .stage__nudge, .chat > li, .rcard { animation: none; }
}
.room__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--rule-hair); background: var(--color-paper-2); min-height: 3rem; }
.room__list > li { display: grid; gap: var(--space-2xs); padding: var(--space-sm) var(--space-lg); background: var(--color-paper-2); font-size: var(--text-sm); color: var(--color-ink-2); animation: rcard-in var(--dur-long) var(--ease-out); }
.room__list > li.is-empty { color: var(--color-muted); animation: none; }
.room__list s { color: var(--color-muted); }
.room__item { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; }
.room__item .cite { margin-inline-start: auto; }
.room__credit { color: var(--color-muted); font-size: var(--text-xs); }

.room__traces { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: var(--space-lg); }
.trace { display: grid; gap: var(--space-sm); padding: var(--space-md) var(--space-lg); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-2); font-size: var(--text-sm); color: var(--color-ink-2); }
.trace h3 { font-size: var(--text-md); font-weight: 500; line-height: 1.2; max-width: none; color: var(--color-ink); }
.trace h4 { margin: var(--space-xs) 0 0; font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); letter-spacing: 0.04em; text-transform: uppercase; }
.trace ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-xs); }
.stages li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) 4.5rem; gap: var(--space-xs); align-items: center; }
.stages__bar { height: var(--space-xs); border-radius: 4px; background: var(--color-paper-3); overflow: hidden; }
.stages__bar > span { display: block; height: 100%; background: var(--color-accent); transform-origin: left; animation: bar-in var(--dur-long) var(--ease-out); }
@keyframes bar-in { from { transform: scaleX(0); } to { transform: none; } }
.stages__note { grid-column: 2 / -1; color: var(--color-muted); font-size: var(--text-xs); margin-top: calc(var(--space-2xs) * -1); }
.stages .measured { text-align: end; }
.trace__row { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: baseline; }
.trace__quiet { color: var(--color-muted); }
.controls__row .field { width: auto; }
.controls__row select.field { flex: 1 1 14rem; }

/* ---- Watch it work (room.html): the guided demo ---- */
.room__head .lead { max-width: 60ch; }
.stage--demo { grid-template-columns: minmax(0, 1fr) minmax(17rem, 24rem); }
.stage--demo .stage__cards { grid-column: 2; }
.rcard--idle { border-top-color: var(--color-rule-2); box-shadow: none; }
.rcard--idle .rcard__dot { background: var(--color-ok); animation: pulse 1.8s var(--ease-in-out) infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.rcard__trigger { margin: 0; font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.02em; }
.rcard__trigger--auto { color: var(--color-accent); }
.rcard__trigger--press { color: var(--color-cool); }
.controls__speed { min-width: 6.5rem; justify-content: center; font-size: var(--text-sm); }
.controls__speed[aria-pressed="true"] { border-color: var(--color-cool); background: var(--color-cool-soft); }
.track__mark--cool { background: var(--color-cool); }

.moments { display: grid; gap: var(--space-sm); }
.moments__head { display: flex; flex-wrap: wrap; gap: var(--space-sm) var(--space-lg); align-items: baseline; justify-content: space-between; }
.moments__head .room__h2 { margin: 0; }
.moments__key { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-sm); align-items: center; color: var(--color-muted); font-size: var(--text-sm); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot--auto { background: var(--color-accent); }
.dot--press { background: var(--color-cool); margin-inline-start: var(--space-xs); }
.moments__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-sm); }
.moment { width: 100%; height: 100%; display: grid; gap: var(--space-2xs); align-content: start; text-align: start; padding: var(--space-sm) var(--space-md); border: var(--rule-hair) solid var(--color-rule); border-left: 3px solid var(--color-accent); border-radius: var(--radius-card); background: var(--color-paper-2); color: var(--color-ink); font: inherit; cursor: pointer; transition: border-color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out); }
.moment--press { border-left-color: var(--color-cool); }
.moment:hover { background: var(--color-paper-3); }
.moment__time { color: var(--color-muted); font-size: var(--text-xs); }
.moment__title { font-weight: 500; line-height: 1.3; }
.moment__kind { color: var(--color-muted); font-size: var(--text-xs); }
.moment.is-past { opacity: 0.7; }
.moment[aria-current="true"] { border-color: var(--color-accent); background: var(--color-accent-soft); opacity: 1; }
.moment--press[aria-current="true"] { border-color: var(--color-cool); background: var(--color-cool-soft); }
@media (max-width: 60rem) { .moments__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 40rem) { .moments__list { grid-template-columns: minmax(0, 1fr); } }

.room__foot { display: grid; gap: var(--space-xs); }
.room__more { color: var(--color-ink-2); }
@media (max-width: 48rem) { .stage--demo { grid-template-columns: minmax(0, 1fr); } .stage--demo .stage__cards { grid-column: 1; } }
@media (prefers-reduced-motion: reduce) { .rcard--idle .rcard__dot { animation: none; } }
.room__head:has(> h1:only-of-type) { display: grid; gap: var(--space-sm); justify-content: start; }
.stage--demo { aspect-ratio: auto; height: clamp(24rem, 44vw, 34rem); }
.stage--demo .stage__cards { max-height: 100%; }
@media (max-width: 48rem) { .stage--demo { height: auto; } }
