/* Hallmark · pre-emit critique: P5 H4 E5 S4 R4 V4
 * Hallmark · genre: playful · design-system: design.md · designed-as-app
 * macrostructure families: home = Workbench Walkthrough · room = Viewing Shell
 *                           preview = Component Playground · theme: tuned custom (dark-first warm-coral)
 */

/* ---------- Shared ---------- */
.kicker {
  color: var(--color-muted);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footnote {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

/* Global site chrome — wordmark left, theme switch right (layout header). */
.site-bar {
  max-width: 56rem;
  margin: 0 auto;
  padding: var(--space-md) var(--space-md) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.site-bar__wordmark {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-ink);
  letter-spacing: -0.01em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
}

.site-bar__logo {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
}

.site-bar__wordmark:hover { color: var(--color-accent); }

.site-bar__dot { color: var(--color-accent); }

.site-bar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}

.site-bar__toggle {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--color-rule);
  color: var(--color-ink);
  cursor: pointer;
  transition: border-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}

.site-bar__toggle .site-bar__icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-bar__icon svg {
  width: 1.125rem;
  height: 1.125rem;
  display: block;
}

html[data-theme="dark"] .site-bar__icon--sun { display: flex; }
html[data-theme="dark"] .site-bar__icon--moon { display: none; }
html[data-theme="light"] .site-bar__icon--sun { display: none; }
html[data-theme="light"] .site-bar__icon--moon { display: flex; }
html:not([data-theme]) .site-bar__icon--sun { display: flex; }
html:not([data-theme]) .site-bar__icon--moon { display: none; }

.site-bar__toggle:hover { border-color: var(--color-accent); color: var(--color-accent); }
.site-bar__toggle:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.site-bar__toggle:active { transform: scale(0.96); }

/* ============================================================
 * Home — Narrative Workflow (pages/home.html.erb)
 * Rebalanced: asymmetric hero, workbench walkthrough, connected sync,
 * privacy as quiet strip. One numbered spine (01/02/03) — sync stays
 * un-numbered. All spacing via tokens, no inline values.
 * ============================================================ */

.home {
  max-width: 56rem;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md) var(--space-3xl);
  display: grid;
  gap: var(--space-3xl);
}

/* Hero — asymmetric 1.15fr / 0.9fr so copy breathes and visual doesn't dominate.
 * Columns stretch to equal height: the room visual grows to meet the copy
 * column's bottom edge, so no dead space sits under the cover image. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.92fr);
  gap: var(--space-2xl);
  align-items: stretch;
  padding-top: var(--space-lg);
}

.hero__copy {
  display: grid;
  gap: var(--space-md);
  align-content: start;
  padding-top: var(--space-xs);
}

.hero__copy h1 {
  font-size: var(--text-display);
  line-height: 0.92;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero__copy .hero__dot { color: var(--color-accent); }

.hero__lede {
  color: var(--color-muted);
  font-size: var(--text-md);
  line-height: 1.65;
  max-width: 32rem;
}

.cta-block {
  display: grid;
  gap: var(--space-2xs);
  max-width: 20rem;
  padding-top: var(--space-xs);
}

.btn--party {
  background: var(--color-accent);
  border-color: var(--color-accent);
  /* Paper flips per theme (15% dark / 97% light), so contrast on the
   * accent holds in both modes with this single declaration. */
  color: var(--color-paper);
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 0.85em 1.6em;
  box-shadow: 0 1px 0 oklch(from var(--color-accent) l c h / 0.2), 0 4px 16px oklch(from var(--color-accent) l c h / 0.18);
}

.btn--party:hover,
.btn--party.is-hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn--party:active,
.btn--party.is-active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.cta-block__assurance {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0;
}

.cta-block__status {
  min-height: 1em;
  color: var(--color-muted);
  font-size: var(--text-xs);
  margin: 0;
}

/* Room visual — honest mockup of the product surface. No re-drawn chrome.
 * Stretches to the hero's full height (rows: surface 1fr + caption auto)
 * so its bottom edge aligns with the copy column — no whitespace below. */
.room-visual {
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: var(--space-xs);
  height: 100%;
}

.room-visual__surface {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  border: 1px solid var(--color-rule);
  background: var(--color-paper-2);
  box-shadow: var(--shadow-whisper);
  overflow: hidden;
}

.room-visual__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.room-visual__surface::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, oklch(from var(--color-paper) l c h / 0.52), transparent 32%, transparent 62%, oklch(from var(--color-paper) l c h / 0.68));
  pointer-events: none;
}

.room-visual__live {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  font-size: var(--text-xs);
  color: var(--color-danger);
  letter-spacing: 0.08em;
}

.room-visual__presence {
  position: absolute;
  right: var(--space-sm);
  bottom: var(--space-sm);
  font-size: var(--text-xs);
  color: var(--color-paper);
  background: oklch(from var(--color-paper) l c h / 0.18);
  backdrop-filter: blur(6px);
  border: 1px solid oklch(from var(--color-paper) l c h / 0.12);
  border-radius: 999px;
  padding: 0.25em 0.6em;
  letter-spacing: 0.04em;
}

.room-visual__bubble {
  position: absolute;
  font-size: var(--text-xs);
  color: var(--color-ink);
  background: var(--color-paper);
  border: 1px solid var(--color-rule);
  border-radius: 999px;
  padding: 0.4em 0.85em;
  bottom: var(--space-lg);
  left: var(--space-sm);
  box-shadow: var(--shadow-whisper);
}

.room-visual__bubble--muted {
  bottom: calc(var(--space-lg) + 2.6em);
  left: calc(var(--space-sm) + 2.2em);
  background: oklch(from var(--color-paper) l c h / 0.82);
  backdrop-filter: blur(6px);
  color: var(--color-muted);
}

.room-visual__cap {
  text-align: center;
  color: var(--color-muted);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

/* Walkthrough — Workbench: figure left (1.45fr), steps stacked right (1fr).
 * Breaks the previous 3-col monotony and lets the screenshot breathe. */
.walkthrough {
  display: grid;
  gap: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-rule);
}

.walkthrough__head {
  display: grid;
  gap: var(--space-2xs);
  max-width: 36rem;
}

.walkthrough__head h2 {
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
}

.walkthrough__head p {
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.walkthrough__workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr);
  gap: var(--space-xl);
  align-items: start;
}

.walkthrough__figure {
  margin: 0;
  display: grid;
  gap: 0;
  border: 1px solid var(--color-rule);
  border-radius: 14px;
  background: var(--color-paper-2);
  box-shadow: var(--shadow-whisper);
  overflow: hidden;
}

.walkthrough__img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.walkthrough__cap {
  padding: var(--space-2xs) var(--space-sm);
  text-align: center;
  color: var(--color-muted);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  border-top: 1px solid var(--color-rule);
  background: oklch(from var(--color-paper) l c h / 0.4);
}

.walkthrough__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-lg);
  align-content: start;
  padding-top: var(--space-xs);
}

.walkthrough__step {
  display: grid;
  gap: var(--space-2xs);
  align-content: start;
  border-top: 1px solid var(--color-rule);
  padding-top: var(--space-md);
  transition: transform var(--dur-fast) var(--ease-out);
}

.walkthrough__step:first-child {
  border-top: none;
  padding-top: 0;
}

.walkthrough__step:hover {
  transform: translateX(2px);
}

.walkthrough__num {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
}

.walkthrough__step h3 {
  font-size: var(--text-md);
  letter-spacing: -0.01em;
}

.walkthrough__step p {
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 1.55;
  margin: 0;
}

/* Sync — un-numbered counter-move. Horizontal connected path with a
 * hairline behind the dots so it reads as one journey, not three cards. */
.sync {
  display: grid;
  gap: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-rule);
}

.sync__head {
  display: grid;
  gap: var(--space-2xs);
  max-width: 36rem;
}

.sync__head h2 {
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
}

.sync__path {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-lg);
  position: relative;
}

.sync__path::before {
  content: "";
  position: absolute;
  top: 0.32rem;
  left: calc(var(--space-md) + 0.3rem);
  right: calc(var(--space-md) + 0.3rem);
  height: 1px;
  background: var(--color-rule);
}

.sync__node {
  display: grid;
  gap: var(--space-sm);
  align-content: start;
  position: relative;
}

.sync__dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--color-accent);
  border: 2px solid var(--color-paper);
  box-shadow: 0 0 0 1px var(--color-rule);
  position: relative;
  z-index: 1;
}

.sync__body {
  display: grid;
  gap: var(--space-2xs);
}

.sync__body h3 {
  font-size: var(--text-md);
  letter-spacing: -0.01em;
}

.sync__body p {
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 1.55;
  margin: 0;
}

/* Talk — chat + voice messaging. Two-up cards with Tier-A CSS-art demos
 * mirroring the real room-shell components (chat-bubble opacity behaviour,
 * voice-note play pill with waveform + timer). Un-numbered: the walkthrough
 * owns the page's single numbered spine. */
.talk {
  display: grid;
  gap: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-rule);
}

.talk__head {
  display: grid;
  gap: var(--space-2xs);
  max-width: 36rem;
}

.talk__head h2 {
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
}

.talk__head p {
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.talk__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg);
}

.talk__card {
  display: grid;
  gap: var(--space-sm);
  align-content: start;
}

.talk__card h3 {
  font-size: var(--text-md);
  letter-spacing: -0.01em;
}

.talk__card p {
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 1.55;
  margin: 0;
}

.talk__demo {
  min-height: 9rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-md);
  border: 1px solid var(--color-rule);
  border-radius: 14px;
  background: var(--color-paper-2);
  box-shadow: var(--shadow-whisper);
  overflow: hidden;
}

/* Chat demo — bubbles anchor right like the real overlay; the faint one
 * shows the at-rest whisper opacity, the solid one the focused state. */
.talk__bubble {
  align-self: flex-end;
  width: fit-content;
  max-width: 100%;
  font-size: var(--text-xs);
  color: var(--color-ink);
  background: var(--color-paper);
  border: 1px solid var(--color-rule);
  border-radius: 999px;
  padding: 0.4em 0.85em;
  box-shadow: var(--shadow-whisper);
}

.talk__bubble--faint {
  opacity: var(--chat-opacity-low);
  margin-right: var(--space-lg);
}

/* Voice demo — the play pill: triangle, waveform (played bars lit), timer. */
.talk__demo--voice { align-items: center; }

.talk__voice {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: 0.35em 0.8em 0.35em 0.45em;
  border-radius: 999px;
  background: oklch(from var(--color-paper) l c h / 0.6);
  border: 1px solid var(--color-rule);
  color: var(--color-ink);
}

.talk__voice svg {
  width: 1em;
  height: 1em;
  flex: none;
}

.talk__waves {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 22px;
}

.talk__wave {
  width: 3px;
  border-radius: 1px;
  background: oklch(from var(--color-ink) l c h / 0.35);
}

.talk__wave:nth-child(1) { height: 8px; }
.talk__wave:nth-child(2) { height: 16px; }
.talk__wave:nth-child(3) { height: 22px; }
.talk__wave:nth-child(4) { height: 12px; }
.talk__wave:nth-child(5) { height: 18px; }
.talk__wave:nth-child(6) { height: 9px; }

.talk__wave--played { background: var(--color-focus); }

.talk__time {
  font-size: var(--text-xs);
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}

/* Privacy — quiet strip, not a boxed card. Three columns with subtle
 * left-rule dividers so it feels like a footer-rule, not another feature grid. */
.privacy {
  display: grid;
  gap: var(--space-lg);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-rule);
}

.privacy__head {
  display: grid;
  gap: var(--space-2xs);
  max-width: 32rem;
}

.privacy__head h2 {
  font-size: var(--text-xl);
  letter-spacing: -0.02em;
}

.privacy__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-lg);
}

.privacy__list li {
  display: grid;
  gap: var(--space-2xs);
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 1.55;
  padding-left: var(--space-md);
  border-left: 1px solid var(--color-rule);
}

.privacy__list li:first-child {
  border-left: none;
  padding-left: 0;
}

.privacy__list strong {
  color: var(--color-ink);
  font-weight: 600;
  font-size: var(--text-sm);
}

.privacy__list span {
  color: var(--color-muted);
}

.home__foot {
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-rule);
}

/* ============================================================
 * Room shell — Viewing Shell (rooms/show.html.erb)
 * Immersive: the shared screen fills the viewport and the
 * controls float above it in an auto-hiding overlay.
 * ============================================================ */

.room-mode { background: #000; }

.room-mode .site-bar { display: none; }

.room-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #000;
}

.room-shell__stage {
  position: absolute;
  inset: 0;
  background: #000;
}

.room-shell__stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.room-shell__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--color-ink);
}

.room-shell__tap-unmute {
  position: absolute;
  left: 50%;
  bottom: var(--space-xl);
  transform: translateX(-50%);
  z-index: 3;
}

/* The `hidden` attribute must win over .btn's inline-flex layout. */
.room-shell__tap-unmute[hidden] {
  display: none;
}

/* ---- Overlay chrome (auto-hides via .is-idle) ---- */

.room-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md);
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out);
}

.room-overlay.is-idle {
  opacity: 0;
}

.room-overlay.is-idle,
.room-overlay.is-idle * {
  pointer-events: none;
}

.room-overlay__bar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
  padding: var(--space-sm) var(--space-md);
  border-radius: 14px;
  background: oklch(from var(--color-paper) l c h / 0.82);
  backdrop-filter: blur(8px);
  border: 1px solid var(--color-rule);
  box-shadow: var(--shadow-modal);
}

.room-overlay__status {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
}

.room-overlay__share {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.room-overlay__share .copyfield {
  width: min(46vw, 26rem);
}

.room-overlay__host {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* The `hidden` attribute must win over the flex layout above, or the host
 * controls (incl. "End room") show for viewers too. */
.room-overlay__host[hidden] {
  display: none;
}

/* The bottom bar only carries host controls; hide it entirely for viewers
 * (and before the host surface is revealed) so no empty pill floats around. */
.room-overlay__bar--bottom:has([data-host-surface][hidden]) {
  display: none;
}

/* The bottom bar fits its content and pins to the left so it never spans the
 * full width and overlaps the chat compose (anchored bottom-right). */
.room-overlay__bar--bottom {
  width: fit-content;
  align-self: flex-start;
  justify-content: flex-start;
}

.room-overlay__presence {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.room-overlay__actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* ---- Chat overlay (PRD-08 §4.2) — bubbles float over the video; compose at bottom ---- */
.chat-overlay {
  position: absolute;
  right: var(--space-md);
  /* Sit above the compose bar (bottom-right) so the newest bubbles never
   * hide behind it; the cluster grows upward as bubbles accumulate. */
  bottom: calc(var(--space-md) + var(--space-2xl) + var(--space-xs));
  max-width: min(38vw, 22rem);
  z-index: 2;
  pointer-events: none; /* let clicks fall through to the video / fullscreen */
}

.chat-overlay__bubbles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2xs);
  justify-items: end;
  max-height: 45vh;
  overflow: hidden; /* newest (bottom) kept in view via scrollTop; old clip off the top */
}

/* Each bubble = avatar dot + name + text. Default low opacity so the video
 * stays dominant; rises to high opacity near the cursor/focus/touch. */
.chat-bubble {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  max-width: 100%;
  padding: var(--space-2xs) var(--space-sm);
  border-radius: 999px;
  background: oklch(from var(--color-paper) l c h / 0.82);
  border: 1px solid var(--color-rule);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-whisper);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-ink);
  opacity: var(--chat-opacity-low);
  transition: opacity var(--dur-base) var(--ease-out);
}

.chat-bubble.is-high,
.chat-overlay__bubbles.is-high .chat-bubble {
  opacity: var(--chat-opacity-high);
}

.chat-bubble__avatar {
  flex: none;
  width: 1.75em;
  height: 1.75em;
  border-radius: 50%;
  overflow: hidden;
  display: block;
}

.chat-bubble__avatar svg {
  display: block;
  width: 100%;
  height: 100%;
}

.chat-bubble__name {
  font-weight: 600;
  color: var(--color-accent);
}

.chat-bubble__text {
  overflow-wrap: anywhere;
}

/* ---- Chat compose bar (input + send) — anchored bottom-right, under bubbles ---- */
.chat-compose {
  position: absolute;
  right: var(--space-md);
  bottom: var(--space-md);
  left: auto;
  transform: none;
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  width: min(38vw, 22rem);
  padding: var(--space-2xs);
  border-radius: 999px;
  background: oklch(from var(--color-paper) l c h / 0.82);
  border: 1px solid var(--color-rule);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-modal);
  z-index: 3;
  pointer-events: auto;
}

.chat-compose__input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: 0.5em 0.75em;
  border-radius: 999px;
}

.chat-compose__input::placeholder {
  color: var(--color-muted);
}

.chat-compose__input:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.chat-compose__send {
  flex: none;
}

/* ---- Voice note recording — hold-to-record mic button in the compose bar ---- */
.chat-compose__record {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  flex: none;
  border: none;
  background: transparent;
  color: var(--color-muted);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  padding: 0.4em 0.6em;
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.chat-compose__record svg {
  width: 1.1em;
  height: 1.1em;
}

.chat-compose__record:hover {
  color: var(--color-ink);
}

.chat-compose__record:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.chat-compose__record.is-recording {
  color: var(--color-danger, #d64545);
  background: oklch(from var(--color-danger, #d64545) l c h / 0.14);
  animation: voice-record-pulse 1.2s ease-in-out infinite;
}

.chat-compose__record[hidden] {
  display: none;
}

@keyframes voice-record-pulse {
  0%, 100% { box-shadow: 0 0 0 0 oklch(from var(--color-danger, #d64545) l c h / 0.4); }
  50% { box-shadow: 0 0 0 6px oklch(from var(--color-danger, #d64545) l c h / 0); }
}

/* ---- Voice-note bubbles — play button replaces the message text ---- */
.chat-bubble__voice {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  flex: none;
  pointer-events: auto; /* bubbles sit in a pointer-events:none overlay; the play button must stay clickable */
  border: none;
  background: oklch(from var(--color-paper) l c h / 0.6);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  padding: 0.3em 0.7em 0.3em 0.4em;
  border-radius: 999px;
  cursor: pointer;
}

.chat-bubble__voice svg {
  width: 1em;
  height: 1em;
  flex: none;
}

.chat-bubble__voice:hover {
  background: oklch(from var(--color-paper) l c h / 1);
}

.chat-bubble__voice.is-playing {
  background: oklch(from var(--color-focus) l c h / 0.25);
}

.chat-bubble__waveform {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 24px;
  flex: none;
}

.chat-bubble__wave {
  display: inline-block;
  width: 3px;
  border-radius: 1px;
  background: oklch(from var(--color-ink) l c h / 0.35);
  transition: background-color 120ms ease;
}

.chat-bubble__wave.is-played {
  background: var(--color-focus);
}

.chat-bubble__voice-time {
  font-variant-numeric: tabular-nums;
}

/* ---- NamePrompt (PRD-08 §4.4) — reuses .modal-overlay / .modal ---- */
.name-prompt {
  display: grid;
  gap: var(--space-sm);
}

.name-prompt__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin: 0;
}

.name-prompt__lede {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.name-prompt__input {
  border: 1px solid var(--color-rule);
  border-radius: 999px;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  padding: 0.7em 1em;
}

.name-prompt__input:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.name-prompt__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* The `hidden` attribute must win over .modal-overlay's grid layout. */
.modal-overlay[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .chat-bubble { transition-duration: 0.001ms; }
}

/* ============================================================
 * Preview — Component Playground (preview/index.html.erb)
 * ============================================================ */

.preview {
  margin: var(--space-2xl) auto;
  max-width: 60rem;
  padding: 0 var(--space-md);
  display: grid;
  gap: var(--space-3xl);
}

.sample-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
}

.sample-stack {
  display: grid;
  gap: var(--space-sm);
  max-width: 30rem;
}

.sample-stack--wide {
  max-width: none;
}

.toast--static {
  position: static;
  transform: none;
}

/* ---------- Mobile floor (320 / 375 / 414) ---------- */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2xl);
    padding-top: var(--space-xs);
  }

  /* Single column: no taller copy neighbour to stretch to — restore the
   * natural 16:9 stage and let it center under the copy. */
  .room-visual {
    height: auto;
    grid-template-rows: none;
    justify-items: center;
  }

  .room-visual__surface {
    height: auto;
    aspect-ratio: 16 / 9;
    max-width: 26rem;
  }

  .hero__copy h1 {
    font-size: clamp(2.75rem, 13vw + 0.5rem, 4.5rem);
  }

  /* Workbench collapses: figure first, steps stacked beneath it */
  .walkthrough__workbench {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-lg);
  }

  .walkthrough__figure {
    max-width: 30rem;
    justify-self: center;
    width: 100%;
  }

  .walkthrough__list,
  .sync__path,
  .talk__grid,
  .privacy__list {
    grid-template-columns: minmax(0, 1fr);
  }

  /* The connector hairline only makes sense horizontally — drop it when
   * the path stacks; each node keeps its dot as a plain marker. */
  .sync__path::before {
    display: none;
  }

  .sync__node {
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: var(--space-sm);
    align-items: start;
  }

  .sync__dot {
    margin-top: 0.3em;
  }

  .privacy__list li:first-child {
    border-left: 1px solid var(--color-rule);
    padding-left: var(--space-md);
  }

  .room-overlay {
    padding: var(--space-sm);
  }

  .room-overlay__bar {
    padding: var(--space-sm);
  }

  .room-overlay__share .copyfield {
    width: 100%;
  }

  .room-overlay__host {
    align-items: flex-start;
  }

  .chat-overlay {
    right: var(--space-sm);
    max-width: min(70vw, 18rem);
  }

  .chat-compose {
    right: var(--space-sm);
    width: min(72vw, 18rem);
  }

  .chat-compose__record span {
    display: none;
  }
}
