/* ============================================================================
 * apps/demo — "Talk to Alia" public demo widget
 *
 * PROVENANCE: everything down to the "LANE 2" banner is the design handoff
 * (transcript-orb-mockup/index.html) carried over VERBATIM — same tokens, same
 * numbers, same easings. Do not "tidy" it; it is the reference the marketing
 * surface is matched against. Additions for the live lane sit below the banner
 * and are built only out of the tokens declared here.
 * ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Asta+Sans:wght@400;500;600&display=swap");

:root {
  --off-white: #f8f8f8;
  --paper: #fbfbfa;
  --ink: #282828;
  --muted: #858585;
  --cool-grey: #b8b8b8;
  --soft-line: rgba(40, 40, 40, 0.08);
  --periwinkle: #e2e8ef;
  --periwinkle-strong: #cfdbe8;
  --blue: #3155d9;
  --recording-control: rgba(40, 40, 40, 0.68);
  --mono: "GETST Mono", "SFMono-Regular", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-family: "Asta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--off-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--off-white);
}

body {
  display: grid;
  place-items: center;
  padding: clamp(16px, 2.6vw, 34px);
}

.voice-preview {
  position: relative;
  width: min(1180px, 100%);
  min-height: min(560px, calc(100vh - 42px));
  overflow: hidden;
  border-radius: 8px;
  background: var(--paper);
  box-shadow:
    0 1px 0 rgba(40, 40, 40, 0.05),
    0 22px 60px rgba(40, 40, 40, 0.06);
  isolation: isolate;
}

.preview-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(230px, 0.78fr) minmax(280px, 1.08fr);
  gap: clamp(28px, 4.4vw, 66px);
  min-height: inherit;
  padding: clamp(26px, 4.8vw, 58px);
  align-items: center;
}

.transcript-shell,
.notes-shell {
  position: relative;
  min-width: 0;
  height: clamp(330px, 46vh, 420px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
}

.transcript-shell {
  align-content: center;
}

.section-label {
  z-index: 4;
  margin: 0 0 16px;
  color: rgba(40, 40, 40, 0.56);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0;
}

.transcript-shell .section-label {
  justify-self: end;
  padding-inline-end: 10px;
}

.notes-shell .section-label {
  justify-self: start;
  padding-inline-start: 6px;
}

.transcript-window,
.notes-window {
  width: 100%;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 88%, transparent 100%);
}

.transcript-window {
  padding-inline-end: 10px;
  text-align: end;
}

.transcript-track {
  display: grid;
  gap: 13px;
  padding: 32px 0 96px;
  justify-items: end;
  transform: translateY(0);
  transition: transform 520ms cubic-bezier(0.2, 0, 0, 1);
}

.line {
  margin: 0;
  max-width: 35ch;
  color: rgba(40, 40, 40, 0.23);
  font-size: clamp(12px, 1.25vw, 15px);
  line-height: 1.52;
  font-weight: 400;
  letter-spacing: 0;
  transition:
    color 220ms ease-out,
    opacity 220ms ease-out,
    transform 220ms ease-out;
}

.line.is-past {
  color: rgba(40, 40, 40, 0.42);
}

.line.is-active {
  color: var(--ink);
  transform: translateX(0);
}

.notes-window {
  padding-inline-start: 6px;
}

.orb-stage {
  position: relative;
  height: clamp(300px, 38vw, 420px);
  display: grid;
  place-items: center;
  pointer-events: none;
}

.orb-aura {
  position: absolute;
  width: min(330px, 76vw);
  aspect-ratio: 1;
  border-radius: 999px;
  background:
    radial-gradient(circle at 68% 45%, rgba(49, 85, 217, 0.12), transparent 19%),
    radial-gradient(circle at 52% 50%, rgba(226, 232, 239, 0.58), transparent 58%);
  filter: blur(22px);
  opacity: 0.9;
  transform: scale(1.02);
}

.orb {
  position: relative;
  width: min(218px, 52vw);
  aspect-ratio: 1;
  border-radius: 48% 52% 51% 49% / 50% 45% 55% 50%;
  background:
    radial-gradient(circle at 37% 30%, rgba(255, 255, 255, 0.84) 0 9%, transparent 20%),
    radial-gradient(circle at 68% 43%, rgba(49, 85, 217, 0.16), transparent 23%),
    radial-gradient(circle at 58% 62%, rgba(184, 184, 184, 0.42), transparent 35%),
    radial-gradient(circle at 50% 50%, rgba(226, 232, 239, 0.78), rgba(184, 184, 184, 0.48) 60%, rgba(40, 40, 40, 0.18));
  box-shadow:
    inset -26px -16px 34px rgba(40, 40, 40, 0.08),
    inset 18px 18px 38px rgba(255, 255, 255, 0.6),
    26px 28px 60px rgba(40, 40, 40, 0.1);
  opacity: 0.9;
  animation: breathe 8s ease-in-out infinite alternate;
  overflow: hidden;
}

.orb::before,
.orb::after {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 44% 56% 52% 48% / 54% 47% 53% 46%;
  background:
    linear-gradient(118deg, transparent 18%, rgba(40, 40, 40, 0.08), transparent 54%),
    radial-gradient(circle at 68% 56%, rgba(49, 85, 217, 0.09), transparent 33%);
  filter: blur(5px);
  opacity: 0.75;
  animation: drift 14s linear infinite;
  transform-origin: 48% 52%;
}

.orb::after {
  inset: 19%;
  background:
    linear-gradient(32deg, transparent 15%, rgba(40, 40, 40, 0.06), transparent 68%),
    radial-gradient(circle at 34% 64%, rgba(255, 255, 255, 0.42), transparent 38%);
  animation-duration: 19s;
  animation-direction: reverse;
}

.notes-window {
  mask-image: linear-gradient(to bottom, transparent 0, #000 8%, #000 92%, transparent 100%);
}

.notes-window.is-showing-summary {
  overflow: visible;
  mask-image: none;
  padding-bottom: 36px;
}

.notes-list {
  display: grid;
  gap: 0;
  padding: 54px 0;
  transform: translateY(0);
  transition: transform 520ms cubic-bezier(0.2, 0, 0, 1);
}

.notes-list.is-complete {
  height: calc(100% - 36px);
  align-content: center;
  gap: 0;
  padding: 0;
  transform: translateY(0) !important;
}

.notes-list.is-complete .note {
  display: none;
}

.note {
  opacity: 0;
  transform: translateY(8px);
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
  padding-block: 10px;
  padding-inline-start: 0;
  color: rgba(40, 40, 40, 0.48);
  font-size: clamp(13px, 1.14vw, 16px);
  line-height: 1.36;
  font-weight: 400;
  letter-spacing: 0;
  transition:
    color 260ms ease-out,
    opacity 380ms ease-out,
    transform 380ms cubic-bezier(0.2, 0, 0, 1);
}

.note + .note {
  border-top: 1px solid rgba(40, 40, 40, 0.08);
}

.note.has-app {
  color: rgba(40, 40, 40, 0.56);
}

.note-bullet {
  width: 5px;
  height: 5px;
  justify-self: center;
  margin-top: 0.58em;
  border-radius: 999px;
  background: rgba(40, 40, 40, 0.34);
  transform: scale(0.68);
  transition:
    background 260ms ease-out,
    transform 260ms ease-out;
}

.note-app {
  position: relative;
  display: grid;
  place-items: center;
  justify-self: center;
  width: 18px;
  height: 18px;
  margin-top: 0.14em;
  color: rgba(40, 40, 40, 0.5);
}

.note-app svg {
  display: block;
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.note-app-calendar {
  color: rgba(49, 85, 217, 0.58);
}

.note-text {
  min-width: 0;
  padding-top: 1px;
}

.note-text::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 0.96em;
  margin-inline-start: 2px;
  vertical-align: -0.12em;
  background: currentColor;
  opacity: 0;
}

.note.is-typing .note-text::after {
  opacity: 0.55;
  animation: caretBlink 900ms steps(2, start) infinite;
}

.note.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.note.is-current {
  color: rgba(40, 40, 40, 0.86);
}

.note.is-current .note-bullet {
  background: rgba(40, 40, 40, 0.62);
  transform: scale(1);
}

.summary {
  opacity: 0;
  transform: translateY(8px);
  justify-self: stretch;
  margin-top: 18px;
  transition:
    opacity 520ms ease-out,
    transform 520ms cubic-bezier(0.2, 0, 0, 1);
}

.summary.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.brief-card {
  max-height: 100%;
  overflow: visible;
  padding: 17px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 0 0 1px rgba(40, 40, 40, 0.08),
    0 18px 46px rgba(40, 40, 40, 0.08);
}

.brief-kicker {
  margin: 0 0 8px;
  color: rgba(40, 40, 40, 0.48);
  font: 500 10px/1.2 var(--mono);
  letter-spacing: 0;
}

.brief-title {
  margin: 0;
  color: rgba(40, 40, 40, 0.92);
  font-size: clamp(16px, 1.35vw, 19px);
  line-height: 1.16;
  font-weight: 500;
  letter-spacing: 0;
  text-wrap: balance;
}

.brief-divider {
  height: 1px;
  margin: 12px 0;
  background: rgba(40, 40, 40, 0.1);
}

.brief-section-label {
  margin: 0 0 8px;
  color: rgba(40, 40, 40, 0.5);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 500;
}

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

.brief-list li {
  position: relative;
  padding-inline-start: 18px;
  color: rgba(40, 40, 40, 0.84);
  font-size: clamp(11px, 0.9vw, 13px);
  line-height: 1.28;
}

.brief-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.66em;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(40, 40, 40, 0.5);
}

.brief-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.brief-attachment {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 21px;
  max-width: 100%;
  padding: 0 8px 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  color: rgba(40, 40, 40, 0.52);
  font-size: 9.5px;
  line-height: 1;
  white-space: nowrap;
  box-shadow:
    0 0 0 1px rgba(40, 40, 40, 0.09),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.attachment-type {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 13px;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(40, 40, 40, 0.055);
  color: rgba(40, 40, 40, 0.46);
  font: 600 7.5px/1 var(--mono);
}

.brief-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.brief-action {
  display: grid;
  place-items: center;
  min-height: 32px;
  padding: 0 10px;
  background: var(--recording-control);
  color: var(--off-white);
  font-size: 11px;
  line-height: 1.15;
  font-weight: 500;
  text-align: center;
}

.stream-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: visible;
}

.particle {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(49, 85, 217, 0.2);
  box-shadow: 0 0 16px rgba(49, 85, 217, 0.16);
  filter: blur(0.2px);
  transform: translate3d(var(--x0), var(--y0), 0) scale(1);
  will-change: transform, opacity, filter;
}

.particle.streak {
  width: 26px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(40, 40, 40, 0.18), transparent);
  box-shadow: none;
}

.controls {
  position: absolute;
  z-index: 7;
  left: clamp(26px, 4.8vw, 58px);
  right: clamp(26px, 4.8vw, 58px);
  bottom: clamp(22px, 3.2vw, 32px);
  display: grid;
  grid-template-columns: auto auto minmax(120px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  width: 32px;
  min-height: 32px;
  height: 32px;
  padding: 0;
  background: var(--ink);
  color: var(--off-white);
  font: 500 11px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition:
    transform 140ms ease-out,
    opacity 140ms ease-out,
    background 140ms ease-out;
}

.toggle-icon {
  position: relative;
  display: block;
  width: 12px;
  height: 12px;
  color: currentColor;
}

.toggle-icon::before,
.toggle-icon::after {
  content: "";
  position: absolute;
  top: 0;
  transition:
    opacity 140ms ease-out,
    transform 140ms ease-out;
}

.toggle-button[data-state="play"] .toggle-icon {
  transform: translateX(1px);
}

.toggle-button[data-state="play"] .toggle-icon::before {
  left: 2px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid currentColor;
}

.toggle-button[data-state="play"] .toggle-icon::after {
  opacity: 0;
}

.toggle-button[data-state="pause"] .toggle-icon::before,
.toggle-button[data-state="pause"] .toggle-icon::after {
  width: 2px;
  height: 11px;
  border-radius: 999px;
  background: currentColor;
}

.toggle-button[data-state="pause"] .toggle-icon::before {
  left: 3px;
}

.toggle-button[data-state="pause"] .toggle-icon::after {
  right: 3px;
}

button:active {
  transform: scale(0.96);
}

button:focus-visible {
  outline: 3px solid rgba(49, 85, 217, 0.28);
  outline-offset: 3px;
}

.mute-button {
  background: transparent;
  color: rgba(40, 40, 40, 0.56);
}

.mute-button svg {
  display: block;
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.mute-slash {
  opacity: 0;
  transform-origin: center;
  transition:
    opacity 140ms ease-out,
    transform 140ms ease-out;
}

.sound-wave {
  transition: opacity 140ms ease-out;
}

.mute-button[data-muted="true"] .mute-slash {
  opacity: 1;
  transform: scale(1);
}

.mute-button[data-muted="true"] .sound-wave {
  opacity: 0;
}

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(40, 40, 40, 0.08);
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--recording-control);
  transition: width 120ms linear;
}

.time {
  color: rgba(40, 40, 40, 0.48);
  font: 500 11px/1 var(--mono);
  font-variant-numeric: tabular-nums;
}

@keyframes breathe {
  0% {
    transform: translate3d(-1px, 2px, 0) scale(0.985);
    border-radius: 49% 51% 51% 49% / 48% 47% 53% 52%;
  }
  100% {
    transform: translate3d(2px, -3px, 0) scale(1.018);
    border-radius: 45% 55% 49% 51% / 54% 44% 56% 46%;
  }
}

@keyframes drift {
  0% {
    transform: translate3d(-5%, 2%, 0) rotate(0deg) scale(1.05);
  }
  100% {
    transform: translate3d(4%, -2%, 0) rotate(360deg) scale(1.12);
  }
}

@keyframes caretBlink {
  50% {
    opacity: 0;
  }
}

@media (max-width: 860px) {
  body {
    padding: 12px;
  }

  .voice-preview {
    min-height: 760px;
  }

  .preview-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 215px 190px 215px;
    gap: 10px;
    padding: 22px 22px 78px;
  }

  .transcript-shell,
  .notes-shell {
    height: 215px;
  }

  .orb-stage {
    height: 190px;
  }

  .orb {
    width: 138px;
  }

  .orb-aura {
    width: 210px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .orb,
  .orb::before,
  .orb::after {
    animation-duration: 40s;
  }

  .line,
  .note,
  .summary,
  .transcript-track,
  .notes-list,
  .progress-fill {
    transition-duration: 1ms;
  }
}

/* ============================================================================
 * LANE 2 — "Talk to Alia" live mode, and the shell that hosts both lanes.
 *
 * Everything below is NEW, and is deliberately assembled only out of the tokens
 * and idioms already declared above: the same 8px radius, the same
 * rgba(40,40,40,·) ink ramp, the same `.section-label` / `.brief-card` /
 * `.line` type, the same 140/220/520ms + cubic-bezier(0.2,0,0,1) motion. The two
 * lanes must read as one page by the same hand.
 * ========================================================================== */

/* ── stage: the card plus a footer strip that swaps content per lane ──────── */

.stage {
  width: min(1180px, 100%);
  display: grid;
  gap: 14px;
  justify-items: stretch;
}

.stage .voice-preview {
  width: 100%;
}

/* ── variant header ────────────────────────────────────────────────────────
 * A slot, not a feature: the default demo never renders this (the `hidden`
 * attribute on the element keeps it out of the grid entirely, so there is no
 * box and no 14px gap), and js/app.js un-hides it only when a `?variant=`
 * brought a headline or subtitle. Built from the handoff's tokens so a variant
 * page still reads as one hand. */

.stage-head {
  display: grid;
  gap: 6px;
  padding: 0 4px;
  text-align: center;
}

/* Beats the UA `[hidden] { display: none }`, which loses to `.stage-head` on
 * origin — the same reason `.lane[hidden]` exists. */
.stage-head[hidden],
.stage-headline[hidden],
.stage-subtitle[hidden] {
  display: none !important;
}

.stage-headline {
  margin: 0;
  color: rgba(40, 40, 40, 0.92);
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.16;
  font-weight: 500;
  letter-spacing: 0;
  text-wrap: balance;
}

.stage-subtitle {
  margin: 0;
  color: rgba(40, 40, 40, 0.56);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 400;
  text-wrap: balance;
}

.stage-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 16px;
  min-height: 34px;
  padding: 0 4px;
  text-align: center;
}

.footer-note {
  margin: 0;
  color: rgba(40, 40, 40, 0.42);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 400;
}

.footer-note em {
  font-style: normal;
  color: rgba(40, 40, 40, 0.56);
}

/* Both lanes live INSIDE the one `.voice-preview` card, so the card's chrome
 * (radius, paper, shadow) and the absolutely-positioned `.controls` row are
 * shared rather than duplicated.
 *
 * `display: contents` makes the lane wrapper generate no box at all: the
 * mockup's `.preview-grid` therefore still lays out as a direct child of the
 * card, and `.controls` (position: absolute) still resolves against the card.
 * The one thing `display: contents` breaks is the `min-height: inherit` chain
 * the mockup relies on — so the lane re-inherits it and passes it down. */
.lane {
  display: contents;
  min-height: inherit;
}

/* Beats the UA `[hidden] { display: none }`, which loses to `.lane` on origin. */
.lane[hidden] {
  display: none !important;
}

/* Turnstile mounts here. In the happy path the widget is invisible and this box
 * has no content; if Cloudflare escalates to an interactive challenge it
 * overlays its own UI, which is why this sits above the card rather than inside
 * a clipped column. */
.turnstile-host {
  position: fixed;
  inset-block-end: 16px;
  inset-inline-end: 16px;
  z-index: 60;
}

/* ── the pill CTA (mockup button type, widened for a text label) ────────────
 * Applied to BOTH <button> and <a> (the pre-order CTA is a link so it can carry
 * target="_top" out of the Framer iframe), so it restates the base `button {}`
 * properties an anchor would not inherit. */

.pill {
  appearance: none;
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 140ms ease-out,
    opacity 140ms ease-out,
    background 140ms ease-out;
  width: auto;
  height: auto;
  min-height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--off-white);
  font: 500 11px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.pill:hover {
  background: rgba(40, 40, 40, 0.86);
}

.pill[disabled] {
  opacity: 0.45;
  cursor: default;
}

.pill.is-quiet {
  background: transparent;
  color: rgba(40, 40, 40, 0.56);
  box-shadow: inset 0 0 0 1px rgba(40, 40, 40, 0.14);
}

.pill.is-quiet:hover {
  background: rgba(40, 40, 40, 0.04);
}

.pill.is-danger {
  background: transparent;
  color: rgba(40, 40, 40, 0.56);
  box-shadow: inset 0 0 0 1px rgba(40, 40, 40, 0.14);
}

.pill.is-danger:hover {
  background: rgba(40, 40, 40, 0.04);
  color: var(--ink);
}

.pill.is-accent {
  background: var(--blue);
}

.pill.is-accent:hover {
  background: #2947bd;
}

.pill.is-small {
  min-height: 32px;
  padding: 0 14px;
}

.pill:active {
  transform: scale(0.96);
}

.pill:focus-visible {
  outline: 3px solid rgba(49, 85, 217, 0.28);
  outline-offset: 3px;
}

/* The live CTA that sits under the scripted lane. */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
}

/* Beats the UA `[hidden] { display: none }`, which loses to `.cta-row` on
 * origin — without this the scripted-lane CTA leaks into the live view. */
.cta-row[hidden] {
  display: none !important;
}

.cta-hint {
  margin: 0;
  color: rgba(40, 40, 40, 0.42);
  font: 500 10px/1.2 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── live lane: same three-column grid, different cargo ───────────────────── */

.live-shell {
  position: relative;
  min-width: 0;
  height: clamp(330px, 46vh, 420px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
}

.live-shell.is-transcript .section-label {
  justify-self: end;
  padding-inline-end: 10px;
}

.live-shell.is-side .section-label {
  justify-self: start;
  padding-inline-start: 6px;
}

/* The live transcript reuses `.transcript-window` / `.line`, but grows downward
 * (newest at the bottom) instead of scrubbing a fixed script, so it scrolls
 * rather than translating a track. */
.live-transcript {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-inline-end: 10px;
  text-align: end;
  scrollbar-width: none;
  mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 88%, transparent 100%);
}

.live-transcript::-webkit-scrollbar {
  display: none;
}

.live-transcript-track {
  display: grid;
  gap: 13px;
  padding: 24px 0 24px;
  justify-items: end;
  align-content: end;
  min-height: 100%;
}

/* A live line is the mockup's `.line`, tinted by who said it. */
.live-line {
  margin: 0;
  max-width: 35ch;
  font-size: clamp(12px, 1.25vw, 15px);
  line-height: 1.52;
  font-weight: 400;
  color: rgba(40, 40, 40, 0.42);
  opacity: 0;
  transform: translateY(6px);
  animation: lineIn 320ms cubic-bezier(0.2, 0, 0, 1) forwards;
  transition: color 220ms ease-out;
}

.live-line[data-who="bot"] {
  color: var(--ink);
}

.live-line[data-who="user"] {
  color: rgba(40, 40, 40, 0.42);
}

/* Interim STT — still being revised, so it reads as provisional. */
.live-line.is-interim {
  color: rgba(40, 40, 40, 0.26);
  font-style: italic;
}

.live-line-who {
  display: block;
  margin-bottom: 3px;
  color: rgba(40, 40, 40, 0.34);
  font: 500 9px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

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

/* Placeholder shown while there is nothing to render (or if RTVI never arrives:
 * the widget degrades to orb-only and this stays put, saying something useful). */
.live-empty {
  margin: 0;
  color: rgba(40, 40, 40, 0.3);
  font-size: clamp(12px, 1.25vw, 15px);
  line-height: 1.52;
  max-width: 32ch;
}

/* ── orb reactivity + the countdown ring ──────────────────────────────────── */

/* A HAIRLINE ring, sized to sit clear of the orb rather than hug it. The
 * viewBox is 100 units wide and the element renders ~292px, so stroke-width is
 * ~0.34 CSS px per unit — 0.45 here lands just under 1.5px on a 2× screen,
 * which is the weight the mockup uses for `.brief-divider` and the `.note`
 * rules. Anything heavier reads as a border on the orb, not as a countdown. */
.orb-stage .orb-ring {
  position: absolute;
  width: min(292px, 68vw);
  aspect-ratio: 1;
  transform: rotate(-90deg);
  opacity: 0;
  transition: opacity 420ms ease-out;
  pointer-events: none;
}

.orb-stage.has-ring .orb-ring {
  opacity: 1;
}

.orb-ring-track {
  fill: none;
  stroke: rgba(40, 40, 40, 0.06);
  stroke-width: 0.45;
}

.orb-ring-value {
  fill: none;
  stroke: rgba(40, 40, 40, 0.24);
  stroke-width: 0.45;
  stroke-linecap: round;
  transition: stroke-dashoffset 480ms linear, stroke 320ms ease-out;
}

/* Last 30 seconds: the wind-down window the Mouth also acts on. */
.orb-stage.is-winding .orb-ring-value {
  stroke: rgba(49, 85, 217, 0.5);
}

/* Alia speaking — the aura swells. Listening — it settles and cools. */
.orb-stage .orb-aura {
  transition:
    transform 520ms cubic-bezier(0.2, 0, 0, 1),
    opacity 520ms ease-out,
    filter 520ms ease-out;
}

.orb-stage.is-speaking .orb-aura {
  transform: scale(1.16);
  opacity: 1;
  filter: blur(26px);
}

.orb-stage.is-listening .orb-aura {
  transform: scale(0.98);
  opacity: 0.72;
}

.orb-stage .orb {
  transition: opacity 520ms ease-out;
}

.orb-stage.is-connecting .orb {
  opacity: 0.55;
}

.orb-stage.is-done .orb {
  opacity: 0.4;
}

/* ── the live side panel (status / topics / errors / done CTA) ────────────── */

/* `overflow-y: auto` clips at the PADDING box, so the block padding is what
 * gives `.panel-card`'s drop shadow room to fall — without it the shadow is
 * sheared off at the panel edge and reads as a stray rectangle behind the card. */
.live-panel {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 26px 14px 26px 6px;
  display: grid;
  align-content: center;
  gap: 14px;
  scrollbar-width: none;
}

.live-panel::-webkit-scrollbar {
  display: none;
}

/* Same 24px gutter as `.note` / `.topic-list li`, so the status dot sits in the
 * exact column the bullets below it use. */
.status-line {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
  color: rgba(40, 40, 40, 0.56);
  font-size: 13px;
  line-height: 1.36;
}

.status-dot {
  width: 6px;
  height: 6px;
  justify-self: center;
  margin-top: 0.42em;
  border-radius: 999px;
  background: rgba(40, 40, 40, 0.28);
  transition: background 220ms ease-out;
}

.status-line[data-state="connecting"] .status-dot {
  background: rgba(49, 85, 217, 0.55);
  animation: pulseDot 1.4s ease-in-out infinite;
}

.status-line[data-state="live"] .status-dot {
  background: var(--blue);
}

.status-line[data-state="error"] .status-dot {
  background: rgba(40, 40, 40, 0.5);
}

@keyframes pulseDot {
  50% {
    opacity: 0.3;
  }
}

.topic-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.topic-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
  padding-block: 10px;
  color: rgba(40, 40, 40, 0.48);
  font-size: clamp(13px, 1.14vw, 16px);
  line-height: 1.36;
}

.topic-list li + li {
  border-top: 1px solid rgba(40, 40, 40, 0.08);
}

.topic-list li::before {
  content: "";
  width: 5px;
  height: 5px;
  justify-self: center;
  margin-top: 0.58em;
  border-radius: 999px;
  background: rgba(40, 40, 40, 0.34);
}

/* Errors + the done state both ride the brief-card, permanently visible. The
 * shadow is tightened from the mockup's `0 18px 46px` because this card sits in
 * a scroll container rather than free on the paper. */
.panel-card {
  opacity: 1;
  transform: none;
  margin-top: 0;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 0 0 1px rgba(40, 40, 40, 0.08),
    0 8px 22px rgba(40, 40, 40, 0.055);
}

.panel-card .brief-title {
  text-wrap: balance;
}

.panel-body {
  margin: 10px 0 0;
  color: rgba(40, 40, 40, 0.6);
  font-size: clamp(11px, 0.9vw, 13px);
  line-height: 1.42;
}

.panel-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  justify-items: stretch;
}

.panel-actions .pill {
  width: 100%;
  min-height: 34px;
}

/* ── live controls row ────────────────────────────────────────────────────── */

.live-controls {
  grid-template-columns: auto minmax(90px, 1fr) auto auto;
}

/* Keeps the element's grid column so the controls row cannot reflow. */
.is-invisible {
  visibility: hidden;
  pointer-events: none;
}

.live-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: rgba(40, 40, 40, 0.42);
  font-size: 12px;
  line-height: 1.2;
}

.live-meta .time {
  flex: none;
}

.live-hint {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 860px) {
  /* The mockup's mobile grid pins all three rows to fixed heights, which is
   * right for the scripted lane (its content is a fixed-length script) and
   * wrong for the live one: the done/error card is taller than 215px and was
   * being sheared top and bottom. The live lane therefore gets a shorter
   * transcript and orb, and an `auto` panel row that grows to fit the card. */
  #laneLive .preview-grid {
    grid-template-rows: 176px 150px auto;
  }

  .live-shell.is-transcript {
    height: 176px;
  }

  #laneLive .orb-stage {
    height: 150px;
  }

  .live-shell.is-side {
    height: auto;
    min-height: 0;
  }

  /* No scroll box on mobile means no clipped shadow and no cut-off card. */
  .live-panel {
    height: auto;
    overflow: visible;
    padding: 4px 2px 4px 6px;
  }

  .live-controls {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 8px;
  }

  .live-hint {
    display: none;
  }

  .pill {
    padding: 0 14px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-line,
  .status-line[data-state="connecting"] .status-dot {
    animation-duration: 1ms;
  }

  .orb-stage .orb-aura,
  .orb-ring-value {
    transition-duration: 1ms;
  }
}
