/* Voice Stage. The cafe (applied-ai web/web/src/app/cafe) is the source: its frame, card, orb slot,
   call bar and chat bubbles are copied from its StyleX. The Figma "Voice Agent Playground Revamp"
   demo page (b7Xyw6FLXTl1JvvDi7d7LO, frame 4124:46699, read through the Figma connector) fills
   what the cafe has no screen for: the desktop layout, title, the right panel ("Demo Panel"
   4124:47059), the dial chips and the actors' colours. Where the two differ, the cafe wins. */

:root {
    /* Figma variables (get_variable_defs on 4124:47059). */
    --dg-surface-canvas: #0a0a0a;
    --dg-surface-default: #141414;
    --dg-surface-glass: #ffffff0d;
    --dg-surface-active: #ffffff1a;
    --dg-surface-inverse: #fcfaf8;
    --dg-border-subtle: #242424;
    --dg-border-default: #2d2d2d;
    --dg-border-hover: #5f5e5e;
    --dg-border-inverse: #fcfaf8;
    --dg-text-primary: #fcfaf8;
    --dg-text-secondary: #cccccc;
    --dg-text-tertiary: #989898;
    --dg-text-inverse: #1d1d1d;
    --dg-text-link: #00b2ff;
    --dg-accent-solid: #e042ff;
    --dg-special-sky-blue: #a1d7fd;
    --dg-special-light-mustard: #fedf89;
    --dg-special-light-teal: #a1f9d4;
    --dg-font-sans: 'Work Sans', Arial, sans-serif;
    --dg-font-mono: 'Azeret Mono', ui-monospace, monospace;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
button { font: inherit; color: inherit; }
h1, h2, p, dl, dd { margin: 0; }
.label { color: var(--dg-text-tertiary); }

/* Frame: cafe-frame.tsx (screen, topBar, wordmark, aside, footer). */
body {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
    background-color: #0a0a0a;
    color: #fcfaf8;
    font-family: "Work Sans", Arial, sans-serif;
    font-size: 14px;
    line-height: 18.2px;
    letter-spacing: -0.14px;
}
.topbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12.6px 18px;
}
.wordmark { display: block; flex-shrink: 0; height: 24px; width: auto; }
.aside {
    min-width: 0;
    margin-left: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-top: 4px;
    font-size: 14px;
    line-height: 18.2px;
    letter-spacing: -0.14px;
    color: #989898;
}
/* The footer's text is cafe-styles.ts caption. */
.footer {
    flex-shrink: 0;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    text-align: center;
    font-size: 13px;
    line-height: 16.9px;
    letter-spacing: -0.13px;
    color: #989898;
}

.layout { flex: 1; min-height: 0; display: flex; }

/* Content column: Figma 4124:46699 (24px padding, title row, then the card). */
.content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 12px 24px 14px;
}
.title-row { display: flex; align-items: center; gap: 14px; }
.title-icon { width: 24px; height: 24px; }
/* Figma: Perfektta SemiBold 44, line height 90%, -3%. Perfektta isn't a web font here: Work Sans 600. */
h1 {
    font-weight: 600;
    font-size: 44px;
    line-height: 0.9;
    letter-spacing: -1.32px;
}
.mode {
    margin-left: auto;
    font: 500 12px/16px var(--dg-font-mono);
    letter-spacing: 0.36px;
    color: var(--dg-text-tertiary);
}

/* Card: cafe-card.tsx (card, texture, grain, scrim, clipped). */
.card {
    position: relative;
    isolation: isolate;
    flex-grow: 1;
    min-height: 0;
    border-radius: 16px;
    overflow: clip;
    display: flex;
    flex-direction: column;
    background-color: #141414;
}
.texture {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    filter: blur(3.3px);
    transform: scale(1.04);
}
.grain {
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background-image: url(assets/grain-tile.png);
    background-repeat: repeat;
    background-size: 65px 65px;
    mix-blend-mode: overlay;
}
.scrim {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: linear-gradient(180deg, rgba(0,0,0,0) 33.654%, rgba(0,0,0,0.75) 96.154%);
}

/* Scene caption: Figma's use-case block at the card's top left (frame 1000003182: 33/32 in, gap 8). */
.scene {
    flex-shrink: 0;
    max-width: 320px;
    padding: 32px 33px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.scene h2 { font-size: 18px; font-weight: 500; line-height: 1.2; letter-spacing: -0.36px; }
.goal { font-size: 15px; line-height: 19.5px; letter-spacing: -0.15px; color: var(--dg-text-secondary); }
.goal.empty { color: var(--dg-text-tertiary); }
.beat { font-size: 13px; line-height: 16.9px; letter-spacing: -0.13px; color: var(--dg-text-link); }
.rehearsal {
    position: relative;
    align-self: flex-start;
    max-width: 100%;
    padding: 18px 12px 10px;
    border: 1px solid var(--dg-border-hover);
    border-radius: 8px;
    overflow: hidden;
    background: var(--dg-surface-canvas);
}
.rehearsal::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 7px;
    background: repeating-linear-gradient(120deg, var(--dg-text-primary) 0 12px, var(--dg-surface-canvas) 12px 24px);
}
.rehearsal strong { font-size: 16px; line-height: 1.2; font-weight: 600; }
#checkin { font-size: 13px; color: var(--dg-special-light-teal); overflow-wrap: anywhere; }

/* Two actors side by side (no cafe screen has two). Each orb slot is voice-orb.tsx's: up to 250px,
   Figma's 140px orb at rest plus room for the speaking bloom. Each actor has a colour (Figma's two
   "Special colors") shown as Orthrus shows its agents': a dot by the name, glowing while audible,
   and here a halo behind the cafe orb that follows its level (--level, 0..1, set per frame). */
.actors {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 0 32px;
}
.actor { --actor: var(--dg-text-primary); --level: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.actor:nth-child(1) { --actor: var(--dg-special-sky-blue); }
.actor:nth-child(2) { --actor: var(--dg-special-light-mustard); }
.actor-info { display: contents; }

/* The Director voice (producer mode): a smaller orb in the Director panel, Figma's Light Teal. It
   only moves while the Director speaks a note. */
.director-voice-slot[hidden] { display: none; }
.actor.director-voice {
    --actor: var(--dg-special-light-teal);
    display: grid;
    grid-template-columns: 96px 1fr;
    align-items: center;
    gap: 12px;
    padding: 8px 12px 8px 0;
    border-radius: 8px;
    border: 0.5px solid var(--dg-border-subtle);
    background: var(--dg-surface-canvas);
}
.actor.director-voice .orb-slot { min-height: 0; height: 96px; width: 96px; }
.actor.director-voice .actor-info { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.actor.director-voice .actor-name { font-size: 15px; font-weight: 600; letter-spacing: -0.3px; }
.actor.director-voice .chips { justify-content: flex-start; min-height: 0; }
.actor.director-voice .chip { font-size: 10px; padding: 3px 7px; }
.orb-slot { position: relative; flex-grow: 1; min-height: 120px; width: 100%; }
.orb-host {
    position: absolute;
    inset: 0;
    margin: auto;
    width: min(250px, 100%);
    height: min(250px, 100%);
}
.orb-host::before {
    content: '';
    position: absolute;
    inset: 18%;
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--actor), transparent);
    opacity: calc(0.1 + 0.6 * var(--level));
    transform: scale(calc(0.85 + 0.5 * var(--level)));
    pointer-events: none;
}
/* No opacity or filter on the orb or its host: either makes the cafe orb's canvas drop out. An
   offstage actor's orb is greyed by a layer over it instead. */
.orb-host::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(40,40,40,0.6), rgba(40,40,40,0.5) 45%, transparent);
    opacity: 0;
    transition: opacity 400ms ease;
    pointer-events: none;
}
.actor[data-state="offstage"] .orb-host::after { opacity: 1; }
.actor[data-state="offstage"] .actor-name { color: var(--dg-text-tertiary); }
.actor[data-state="offstage"] .actor-name::before { background: var(--dg-border-hover); }
.actor[data-state="offstage"] .actor-state {
    padding: 2px 8px;
    border-radius: 999px;
    border: 0.5px solid var(--dg-border-hover);
    font: 500 11px/1.2 var(--dg-font-mono);
    letter-spacing: 0.33px;
    text-transform: uppercase;
}
/* Figma Heading/md, with cafe-styles.ts labelShadow. */
.actor-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.36px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
.actor-name::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--actor);
    transition: box-shadow 300ms;
}
.actor[data-state="speaking"] .actor-name::before { box-shadow: 0 0 12px var(--actor); }
/* cafe-styles.ts caption */
.actor-state { font-size: 13px; line-height: 16.9px; letter-spacing: -0.13px; color: #989898; }
.actor[data-state="speaking"] .actor-state { color: var(--actor); }
.actor[data-state="stopped"] .actor-state { color: var(--dg-accent-solid); }

/* Dial chips: Figma's selected tab chip (surface/active, 0.5px border/inverse, Mono/label), at the
   pill radius its Button / Pill notes reserve for chips and tags. */
.chips { min-height: 22px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.chip {
    padding: 4.5px 8.5px;
    border-radius: 999px;
    border: 0.5px solid var(--dg-border-inverse);
    background: var(--dg-surface-active);
    font: 500 12px/1.05 var(--dg-font-mono);
    letter-spacing: 0.36px;
    color: var(--dg-text-primary);
    white-space: nowrap;
}
.chip.upcoming { border-style: dashed; border-color: var(--dg-text-tertiary); background: transparent; color: var(--dg-text-tertiary); }
.chip.neutral { color: var(--dg-text-tertiary); }

/* Call bar: call-bar.tsx on cafe-styles.ts glass (orb/glass.js draws it), stop-button.tsx. Wider than
   the cafe's 326px to fit the mute button, which the cafe phone doesn't have. */
.glass {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-width: 0;
    border-style: none;
    border-radius: 999px;
    background-color: transparent;
    color: #fcfaf8;
}
.callbar {
    flex-shrink: 0;
    align-self: center;
    width: min(390px, calc(100% - 24px));
    margin: 2px 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 19px 24px;
}
.who { display: flex; align-items: center; gap: 16px; }
.names, .clock {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.36px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
.names { white-space: nowrap; }
.clock { font-variant-numeric: tabular-nums; }
.divider { width: 1px; height: 34px; background-color: #fcfaf8; }
.round {
    position: relative;
    flex-shrink: 0;
    width: 44.465px;
    height: 44.465px;
    padding: 0;
    border-width: 0;
    border-style: none;
    background-color: transparent;
    cursor: pointer;
}
.round:disabled { opacity: 0.6; cursor: default; }
/* Mute and start: stop.svg's ring (r 21.73 of 52.46: white at 5%, 1px #fcfaf8) around an icon. */
#mute, .call:not(.live) {
    display: grid;
    place-items: center;
    width: 36.85px;
    height: 36.85px;
    margin: 3.8px;
    border: 1px solid #fcfaf8;
    border-radius: 999px;
    background-color: rgba(255,255,255,0.05);
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.25));
}
#mute svg { width: 18px; height: 18px; fill: none; stroke: #fcfaf8; stroke-width: 1.6; stroke-linecap: round; }
#mute .slash { display: none; }
#mute[aria-pressed="true"] .slash { display: inline; }
#mute[aria-pressed="true"] { background-color: var(--dg-surface-active); }
.call .start { width: 20px; height: 19px; }
.call .stop {
    display: none;
    position: absolute;
    inset: -9%;
    width: 118%;
    height: 118%;
    max-width: none;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.25));
}
.call.live .start { display: none; }
.call.live .stop { display: block; }

/* Right panel: Figma "Demo Panel" 4124:47059 (get_design_context). */
.panel {
    flex-shrink: 0;
    width: 350px;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--dg-surface-default);
    border-left: 1px solid var(--dg-border-default);
    border-top: 1px solid var(--dg-border-default);
}
/* "Configuration": p 24, gap 24; head gap 18; Button / Pill (inverse) and the arrow-circle chevron. */
.director { flex: 0 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; padding: 24px; display: flex; flex-direction: column; gap: 24px; }
.director .panel-head { position: sticky; top: -24px; margin-top: -24px; padding-top: 24px; background: var(--dg-surface-default); z-index: 1; }
.panel-head { display: flex; align-items: center; gap: 18px; }
.panel-head h2 { font-size: 18px; font-weight: 500; line-height: 1.2; letter-spacing: -0.36px; margin-right: auto; }
.panel-head .pill + .pill { margin-left: -10px; }
.pill {
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--dg-surface-inverse);
    font: 500 12px/16px var(--dg-font-mono);
    letter-spacing: 0.36px;
    white-space: nowrap;
    cursor: pointer;
}
.pill.solid { background: var(--dg-surface-inverse); color: var(--dg-text-inverse); }
.pill.outline { background: var(--dg-surface-glass); color: var(--dg-text-primary); }
.pill:disabled { opacity: 0.45; cursor: default; }
.chevron { padding: 0; border: 0; background: none; width: 16px; height: 16px; cursor: pointer; }
.chevron img { display: block; width: 16px; height: 16px; transform: rotate(180deg); transition: transform 200ms; }
.director.collapsed .chevron img { transform: none; }
.director.collapsed .director-body { display: none; }
.director-body { display: flex; flex-direction: column; gap: 12px; }
.goal-box { display: flex; flex-direction: column; gap: 6px; font-size: 12px; line-height: 1.3; letter-spacing: -0.12px; }
/* Figma field: surface/canvas inset, Field radius 4. */
textarea, input[type=text] {
    width: 100%;
    resize: none;
    padding: 8px 10px;
    border-radius: 4px;
    border: 0.5px solid var(--dg-border-default);
    background: var(--dg-surface-canvas);
    color: var(--dg-text-secondary);
    font: 12px/1.3 var(--dg-font-sans);
    letter-spacing: -0.12px;
}
textarea:focus, input[type=text]:focus { outline: 1px solid var(--dg-border-hover); }
/* "COnfiguration Details" rows: border-top, py 6, gap 8, a 160px label column, Body/xs tertiary. */
.rows > div {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 8px;
    padding: 6px 0;
    border-top: 1px solid var(--dg-border-default);
    font-size: 12px;
    line-height: 1.3;
    letter-spacing: -0.12px;
    color: var(--dg-text-tertiary);
}
.rows dd { overflow-wrap: anywhere; }
#command { color: var(--dg-text-primary); }
/* Standing notes: Body/xs, numbered, newest last (the director keeps three). */
.notes-box { display: flex; flex-direction: column; gap: 6px; font-size: 12px; line-height: 1.3; letter-spacing: -0.12px; }
.notes { margin: 0; padding-left: 18px; color: var(--dg-text-secondary); display: flex; flex-direction: column; gap: 4px; }
.notes .empty { list-style: none; margin-left: -18px; color: var(--dg-text-tertiary); }

/* Transcript section: border-top, p 24, gap 24. */
/* The transcript keeps at least 300px; the director section above scrolls instead. */
.feed {
    flex: 1 0 300px;
    min-height: 300px;
    padding: 24px 24px 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border-top: 1px solid var(--dg-border-default);
}
.tabs { display: flex; gap: 16px; }
.tab {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    border: 0.5px solid transparent;
    background: none;
    font: 500 12px/1.05 var(--dg-font-mono);
    letter-spacing: 0.36px;
    white-space: nowrap;
    filter: drop-shadow(0 0 4px rgba(0,0,0,0.5));
    cursor: pointer;
}
.tab img { height: 16px; width: auto; }
.tab[aria-selected="true"] {
    gap: 8px;
    padding: 4.5px 8.5px;
    background: var(--dg-surface-active);
    border-color: var(--dg-border-inverse);
    filter: none;
}
.tab[aria-selected="true"] img { height: 13px; }
.tab[hidden] { display: none; }
/* The checkbox bar: border-top 0.5 border/subtle, pt 8.5, pb 12, a 40px Checkbox row, Copy on the right. */
.feed-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: -8px;
    padding: 8.5px 0 12px;
    border-top: 0.5px solid var(--dg-border-subtle);
}
.checkbox {
    height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    line-height: 1.3;
    letter-spacing: -0.12px;
    color: var(--dg-text-secondary);
    cursor: pointer;
}
.checkbox input { position: absolute; opacity: 0; pointer-events: none; }
/* Checkbox Box: 16px, radius 4; checked is accent/solid with an accent border. */
.checkbox .box { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--dg-border-default); background: var(--dg-surface-default); display: grid; place-items: center; }
.checkbox .box svg { width: 9px; height: 7px; fill: none; stroke: var(--dg-text-inverse); stroke-width: 2; visibility: hidden; }
.checkbox:hover .box { border-color: var(--dg-border-hover); }
.checkbox input:checked + .box { background: var(--dg-accent-solid); border-color: var(--dg-accent-solid); }
.checkbox input:checked + .box svg { visibility: visible; }
.checkbox input:focus-visible + .box { outline: 2px solid var(--dg-text-primary); outline-offset: 2px; }
.copy {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: none;
    font-size: 12px;
    line-height: 1.3;
    letter-spacing: -0.12px;
    color: var(--dg-text-tertiary);
    cursor: pointer;
}
.copy img { width: 12px; height: 12px; }

/* Transcript list: py 16, gap 12; the "Session Started" pill (border 0.5 border/default, radius 24). */
.transcript, .console { flex: 1; min-height: 0; overflow-y: auto; margin-top: -12px; padding: 4px 0 16px; scrollbar-width: thin; }
.transcript { display: flex; flex-direction: column; gap: 12px; }
.console[hidden], .transcript[hidden] { display: none; }
.marker {
    align-self: center;
    padding: 8.5px 12.5px;
    border-radius: 24px;
    border: 0.5px solid var(--dg-border-default);
    font-size: 12px;
    line-height: 1.3;
    letter-spacing: -0.12px;
    color: var(--dg-text-secondary);
}

/* Bubbles: chat-bubble-styles.ts (bubble, agent, customer); the time is cafe-styles.ts caption. */
.bubble {
    flex-shrink: 0;
    max-width: 300px;
    padding: 10.5px 14.5px;
    border-radius: 8px;
    border: 0.5px solid #242424;
    background-color: rgba(10,10,10,0.62);
    backdrop-filter: blur(8px);
    box-shadow: 0 0 4px rgba(0,0,0,0.25);
    font-size: 15px;
    line-height: 19.5px;
    letter-spacing: -0.15px;
    color: #cccccc;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.bubble.agent { align-self: flex-start; }
.bubble.human { align-self: flex-end; border-radius: 4px; }
.bubble .meta { display: flex; gap: 8px; align-items: baseline; font-size: 13px; line-height: 16.9px; letter-spacing: -0.13px; color: #989898; }
.bubble .meta .who { color: var(--dg-text-primary); font-weight: 500; gap: 0; }
.bubble.actor-0 .meta .who { color: var(--dg-special-sky-blue); }
.bubble.actor-1 .meta .who { color: var(--dg-special-light-mustard); }
.bubble.director-voice .meta .who { color: var(--dg-special-light-teal); }
.bubble .meta .tag {
    margin-left: auto;
    font: 500 11px/1 var(--dg-font-mono);
    letter-spacing: 0.33px;
    text-transform: uppercase;
    color: var(--dg-accent-solid);
}
.bubble .meta .tag.resumed { color: var(--dg-text-link); }
.bubble .rest { color: var(--dg-border-hover); text-decoration: line-through; display: none; }
.bubble.live .text::after { content: ' …'; color: #989898; }
.bubble .dials { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.bubble .dials .chip { font-size: 10px; padding: 3px 7px; }
.bubble.dropped { opacity: 0.45; border-style: dashed; display: none; }

/* Turn-taking rows: Figma's INTERRUPTION / FUNCTION event rows (border 0.5 border/subtle, p 12.5,
   radius 8; SemiBold 13 caps in tertiary, link blue for resumes). */
.turn-row {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 12.5px;
    border-radius: 8px;
    border: 0.5px solid var(--dg-border-subtle);
}
.turn-row .head { display: flex; gap: 12px; align-items: baseline; }
.turn-row b { font-weight: 600; font-size: 13px; line-height: 1.2; letter-spacing: -0.26px; color: var(--dg-text-tertiary); }
.turn-row b.good { color: var(--dg-text-link); }
.turn-row time { font-size: 12px; line-height: 1.3; letter-spacing: -0.12px; color: var(--dg-text-tertiary); }
.turn-row p { font-size: 12px; line-height: 1.3; letter-spacing: -0.12px; color: var(--dg-text-primary); }
body.debug .bubble.dropped, body.debug .turn-row { display: flex; }
body.debug .bubble .rest { display: inline; }

/* Developer console: the mic test page's gate readout and log, in the panel's row style. */
.console { display: flex; flex-direction: column; gap: 12px; }
.readout { border-collapse: collapse; font-size: 12px; line-height: 1.3; }
.readout td { padding: 6px 0; border-top: 1px solid var(--dg-border-default); color: var(--dg-text-tertiary); font-variant-numeric: tabular-nums; }
.readout td + td { color: var(--dg-text-secondary); text-align: right; }
#gate.open { color: #5bba21; font-weight: 600; }
#gate.shut { color: var(--dg-accent-solid); font-weight: 600; }
.endpoint { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.log { font: 11px/1.4 var(--dg-font-mono); color: var(--dg-text-tertiary); white-space: pre-wrap; overflow-wrap: anywhere; }

/* Narrower than a landscape iPad: the panel goes under the stage. */
@media (max-width: 900px) {
    body { height: auto; overflow: auto; }
    .layout { flex-direction: column; }
    .content { min-height: 640px; }
    .panel { width: auto; border-left: 0; }
    .feed { max-height: 70vh; }
}

/* -- Simple by default ------------------------------------------------------------------------
   A first-time visitor sees the intro, the orbs, Start, and a short transcript. "Details" (the
   top bar switch, body.debug) shows the rest: the director's rows, dial numbers, turn-taking notes,
   the developer console and the scene text. */
body:not(.debug) .details-only,
body:not(.debug) .chips,
body:not(.debug) .bubble .dials { display: none !important; }

.details-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
    font-size: 13px;
    line-height: 16.9px;
    color: var(--dg-text-tertiary);
    cursor: pointer;
    white-space: nowrap;
}
.details-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.details-toggle .switch {
    position: relative;
    width: 28px;
    height: 16px;
    border-radius: 999px;
    border: 1px solid var(--dg-border-hover);
    background: var(--dg-surface-canvas);
    transition: background 200ms;
}
.details-toggle .switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--dg-text-tertiary);
    transition: transform 200ms, background 200ms;
}
.details-toggle input:checked + .switch { background: var(--dg-accent-solid); border-color: var(--dg-accent-solid); }
.details-toggle input:checked + .switch::after { transform: translateX(12px); background: var(--dg-text-inverse); }
.details-toggle input:focus-visible + .switch { outline: 2px solid var(--dg-text-primary); outline-offset: 2px; }

/* The intro before the start: cafe-idle.tsx's about block, heading, description and examples. */
.intro {
    flex-shrink: 0;
    max-width: 360px;
    padding: 32px 32px 0;
    display: grid;
    gap: 10px;
}
.intro h2 { margin: 0; font-size: 22px; font-weight: 500; line-height: 1.2; letter-spacing: -0.44px; }
.intro p { margin: 0; font-size: 16px; line-height: 20.8px; letter-spacing: -0.16px; color: #cccccc; }
.examples {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid rgba(252,250,248,0.5);
}
.examples li { border-bottom: 0.5px solid rgba(252,250,248,0.5); }
.examples li:last-child { border-bottom: 0; }
.example {
    width: 100%;
    padding: 12px 0;
    border: 0;
    background: none;
    text-align: left;
    font-size: 15px;
    line-height: 19.5px;
    letter-spacing: -0.15px;
    color: #cccccc;
    text-shadow: 0 0 4px rgba(0,0,0,0.4);
    cursor: pointer;
}
.example:hover, .example:focus-visible { color: var(--dg-text-primary); }
body.live .intro { display: none; }
body.idle .scene, body.ended .scene, body.connecting .scene { display: none; }

/* Live: the take, the check-in, a one-line nudge and notes to try. */
.coach { margin: 0; font-size: 15px; line-height: 19.5px; letter-spacing: -0.15px; color: #cccccc; }
.try { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.try .label { font-size: 13px; color: var(--dg-text-tertiary); margin-right: 2px; }
.try-chip {
    padding: 4.5px 10px;
    border-radius: 999px;
    border: 0.5px solid rgba(252,250,248,0.5);
    background: var(--dg-surface-glass);
    font-size: 13px;
    line-height: 16.9px;
    color: var(--dg-text-primary);
    cursor: pointer;
}
.try-chip:hover, .try-chip:focus-visible { background: var(--dg-surface-active); }
#checkin { font-size: 15px; line-height: 19.5px; color: var(--dg-special-light-teal); }
#checkin:not([hidden]) ~ .coach { display: none; }

/* Start: cafe-idle.tsx's glass start button, with a label in Work Sans (the cafe's is a Perfektta SVG). */
.start {
    align-self: center;
    flex-shrink: 0;
    margin: 0 0 22px;
    padding: 19px 42.7px;
    border: 0;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.44px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
    cursor: pointer;
}
.start[hidden] { display: none; }
body.idle #cut, body.ended #cut, body.connecting #cut { display: none; }
.start:disabled { opacity: 0.6; cursor: default; }
.callbar[hidden] { display: none; }
/* The status line: cafe-idle.tsx's error is #ffb4a9; everything else is the cafe caption. */
.status {
    align-self: center;
    min-height: 18.2px;
    margin: -12px 24px 14px;
    font-size: 14px;
    line-height: 18.2px;
    text-align: center;
    color: #cccccc;
    text-shadow: 0 0 4px rgba(0,0,0,0.6);
}
.status.error { color: #ffb4a9; }
.status:empty { visibility: hidden; }

/* Change the scene: one line until it's opened. */
.change-scene summary {
    cursor: pointer;
    list-style: none;
    font-size: 13px;
    line-height: 16.9px;
    color: var(--dg-text-link);
}
.change-scene summary::-webkit-details-marker { display: none; }
.change-scene[open] summary { margin-bottom: 10px; color: var(--dg-text-tertiary); }
.change-scene .pill { margin-top: 10px; }
.panel-head .pill + .pill { margin-left: 0; }

/* Narrower: the phone. The card first, at a height that fits the intro, orbs and Start. */
@media (max-width: 600px) {
    .topbar { padding: 10px 16px; }
    .wordmark { height: 24px; }
    .aside { display: none; }
    .details-toggle { margin-left: auto; }
    .content { padding: 8px 16px 16px; gap: 16px; }
    h1 { font-size: 32px; }
    .title-icon { width: 20px; height: 20px; }
    .content { min-height: 600px; }
    .intro { padding: 22px 20px 0; }
    .intro h2 { font-size: 20px; }
    .intro p { font-size: 15px; line-height: 19.5px; }
    .example { padding: 10px 0; font-size: 14px; }
    .scene { padding: 22px 20px 0; }
    .actors { padding: 0 12px; gap: 8px; }
    .orb-slot { min-height: 100px; }
    .actor-name { font-size: 16px; }
    .start { padding: 16px 32px; font-size: 20px; }
    .callbar { gap: 14px; padding: 14px 16px; }
    .names { display: none; }
    .feed { max-height: none; }
    .transcript { max-height: 60vh; }
}

/* The consent line under Start: shown until the scene starts (cafe-styles.ts caption, smaller). */
.consent {
    align-self: center;
    max-width: 440px;
    margin: -8px 24px 16px;
    font-size: 12px;
    line-height: 1.3;
    letter-spacing: -0.12px;
    text-align: center;
    color: #989898;
    text-shadow: 0 0 4px rgba(0,0,0,0.6);
}
body.live .consent { display: none; }
/* The last 30 s of the session. */
.clock.ending { color: var(--dg-special-light-mustard); }
