/* G6 Training. Soft sage surfaces, white cards and pills, dark charcoal actions,
   one coral accent for live moments.

   Fit view: the app always fills the screen exactly (100dvh) and the page itself
   never scrolls. Panels that can outgrow their space (transcript, cards, report)
   scroll inside. Layout sizes use rem on a fixed root, and only text sizes are
   multiplied by --t, so Small/Medium/Large change the text and nothing else. */
:root {
  color-scheme: light;
  --t: 1;
  --page: #f1f2ef;
  --frame: #e8ece4;
  --card: #f8f9f6;
  --pill: #ffffff;
  --chip: #e9eee6;
  --ink: #1b1f1b;
  --muted: #586058;
  --line: #d7ddd3;
  --sage-deep: #4d6a52;
  --dark: #1f2420;
  --coral: #d9643a;
  --coral-ink: #a8431d;
  --danger: #a8341d;
  --radius-xl: 1.6rem;
  --radius-l: 1.2rem;
  --radius-m: 0.9rem;
  --gap: 1rem;
  --body-glow: #ffffff;
  --frame-edge: #fbfcfa;
  --on-dark: #ffffff;
  --dark-hover: #000000;
  --ring: var(--sage-deep);
  --stage-bg: radial-gradient(75% 70% at 50% 38%, #f6f8f3 0%, #e2e9dd 50%, #cfdccb 100%);
  --disc: radial-gradient(circle at 50% 38%, #34423a 0%, #232b25 55%, #1a201c 100%);
  --glass: rgb(255 255 255 / 62%);
  --glass-edge: rgb(255 255 255 / 70%);
  --tile-bg: rgb(255 255 255 / 72%);
  --tile-hover-edge: #c3cbbe;
  --panel-bg: linear-gradient(170deg, #5f7d63 0%, #6f8c72 50%, #86a184 100%);
  --line-bg: rgb(255 255 255 / 95%);
  --line-quiet: #eef2ec;
  --line-coach: #fff3ec;
  --coach-bg: #fff7f2;
  --coach-edge: #f3d3c4;
  --orb-mint: 0.62 0.90 0.74;
  --orb-sage: 0.50 0.70 0.54;
  --orb-reeds: 0.37 0.55 0.37 0.26;
  --shadow: 0 0.05rem 0.1rem rgb(27 31 27 / 5%), 0 0.6rem 1.6rem rgb(27 31 27 / 6%);
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
}
html[data-font="small"] { --t: 0.88; }
html[data-font="medium"] { --t: 1; }
html[data-font="large"] { --t: 1.2; }
html { font-size: 100%; background: var(--page); height: 100%; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; height: 100%; overflow: hidden; color: var(--ink); padding: 0.6rem 0;
  font: 400 calc(1rem * var(--t)) / 1.45 var(--font);
  background: radial-gradient(90% 70% at 50% 0%, var(--body-glow) 0%, var(--page) 60%) no-repeat;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
h1, h2, h3, p, dl, dd { margin: 0; }
a { color: inherit; text-underline-offset: 0.2em; }
:focus-visible { outline: 3px solid var(--dark); outline-offset: 3px; }
.sage-panel :focus-visible { outline-color: #fff; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 50; padding: 0.6rem 1rem; border-radius: 999px; background: var(--dark); color: var(--on-dark); font-weight: 650; }
.skip:focus { top: 1rem; }

/* ---------- the fitted frame ---------- */
.frame {
  display: flex; flex-direction: column; overflow: hidden;
  width: min(100% - 1.2rem, 96rem); height: 100%; margin: 0 auto;
  padding: clamp(0.6rem, 1.4vw, 1.2rem); gap: var(--gap);
  border-radius: 2rem; background: var(--frame); border: 0.3rem solid var(--frame-edge);
  box-shadow: 0 2rem 4rem rgb(27 31 27 / 8%);
}
main { flex: 1 1 auto; min-height: 0; display: flex; }
.view { flex: 1 1 auto; min-height: 0; min-width: 0; }
.scroll { overflow: auto; overscroll-behavior: contain; }

/* ---------- controls ---------- */
button, input, select, textarea { font: inherit; color: inherit; }
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 2.6rem; padding: 0.45rem 1.15rem; border-radius: 999px; border: 1px solid transparent;
  background: var(--pill); font-size: calc(0.92rem * var(--t)); font-weight: 550; cursor: pointer; line-height: 1.2;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow); }
button:disabled { cursor: not-allowed; opacity: 0.45; transform: none; box-shadow: none; }
button.dark { background: var(--dark); color: var(--on-dark); }
button.dark:hover:not(:disabled) { background: var(--dark-hover); }
button.accent { background: var(--coral-ink); color: #fff; }
button.accent:hover:not(:disabled) { background: #8a3414; }
button.pill-light { background: var(--pill); border-color: var(--line); }
button.small { min-height: 2.1rem; padding: 0.25rem 0.85rem; font-size: calc(0.84rem * var(--t)); }
button.wide { width: 100%; }
input, select, textarea { border: 1px solid var(--line); border-radius: 999px; background: var(--pill); padding: 0.6rem 1.05rem; min-height: 2.75rem; width: 100%; font-size: calc(0.95rem * var(--t)); }
select { padding-right: 2.2rem; appearance: none; cursor: pointer; text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 55%, calc(100% - 0.8rem) 55%; background-size: 0.35rem 0.35rem; background-repeat: no-repeat; }
input:disabled, select:disabled, textarea:disabled { opacity: 0.6; cursor: not-allowed; }
.status { font-size: calc(0.88rem * var(--t)); color: var(--muted); }
.status:empty { display: none; }
.status[data-error="true"] { color: var(--danger); font-weight: 550; }
.help { color: var(--muted); font-size: calc(0.88rem * var(--t)); }
.eyebrow { font-size: calc(0.7rem * var(--t)); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 550; }

/* ---------- top bar ---------- */
/* Fixed height with room for Large metrics, so the text size never moves the panels below. */
.topbar { flex: 0 0 auto; height: 4.6rem; display: flex; align-items: center; justify-content: space-between; gap: 0.8rem 2rem; padding: 0 0.2rem; }
.topbar:has(.mode-switch:not([hidden])) { height: auto; min-height: 4.6rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.brand-mark { flex: 0 0 auto; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 0.8rem; background: var(--dark); }
.brand-mark img { filter: brightness(0) invert(1); width: 1.35rem; height: 1.35rem; }
.brand-text { display: grid; line-height: 1.15; min-width: 0; }
.brand-name { font-size: calc(1.25rem * var(--t)); font-weight: 500; letter-spacing: -0.01em; white-space: nowrap; }
.brand-sub { font-size: calc(0.66rem * var(--t)); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.metrics { display: flex; gap: clamp(1rem, 3vw, 3rem); flex: 1 1 auto; justify-content: center; min-width: 0; }
.metrics dt { font-size: calc(0.78rem * var(--t)); color: var(--muted); white-space: nowrap; }
.metrics dd { font-size: calc(clamp(1.5rem, 0.9rem + 1.3vw, 2.3rem) * var(--t)); font-weight: 300; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metrics .metric-word { font-size: calc(clamp(1.1rem, 0.7rem + 0.9vw, 1.5rem) * var(--t)); padding-top: 0.3rem; }
.topbar-tools { flex: 0 0 auto; display: flex; align-items: center; gap: 0.5rem; }
.header-session-actions { display: flex; align-items: center; gap: inherit; white-space: nowrap; }
.header-session-actions:not(:has(button:not([hidden]))) { display: none; }
.topbar-tools:has(.mode-switch:not([hidden])) { flex: 0 1 auto; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
.font-size { display: flex; gap: 0.15rem; padding: 0.2rem; border-radius: 999px; background: var(--pill); box-shadow: var(--shadow); }
/* The text size buttons keep fixed sizes so they never move under the pointer. */
.font-size button { min-height: 2.2rem; min-width: 2.3rem; padding: 0 0.55rem; background: transparent; font-size: 1rem; }
.font-size button[aria-pressed="true"] { background: var(--dark); color: var(--on-dark); }
.font-size .a { font-weight: 600; line-height: 1; }
.a-s { font-size: 0.75rem; }
.a-m { font-size: 0.95rem; }
.a-l { font-size: 1.2rem; }
.topbar-tools :is(#sign-out, #to-plan) { font-size: calc(0.9rem * var(--t)); white-space: nowrap; }

/* ---------- cards ---------- */
.card { padding: 1.15rem 1.25rem; border-radius: var(--radius-xl); background: var(--card); box-shadow: var(--shadow); min-height: 0; overflow: auto; overscroll-behavior: contain; }
.card h2 { font-size: calc(1.12rem * var(--t)); font-weight: 500; margin-bottom: 0.25rem; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0.8rem 0 0; }
.chips li { padding: 0.3rem 0.8rem; border-radius: 999px; background: var(--chip); font-size: calc(0.82rem * var(--t)); }

/* ---------- one stage: the coach sphere stays on screen from sign-in to the report ---------- */
/* Every view is a layer over the same stage. The ring's place and size come from
   --orb-x, --orb-y and --orb-size per view and glide between screens; orb.js reads
   the ring's box each frame, so the drawing follows it. */
.stage {
  --glide: cubic-bezier(0.65, 0, 0.25, 1);
  --drawer: min(30rem, 40cqw);
  --orb-x: 50%; --orb-y: 36%; --orb-size: min(44cqh, 24rem, 60cqw);
  --orb-travel-time: 900ms; --orb-travel-ease: var(--glide);
  --orb-edge-time: 900ms; --orb-edge-delay: 0ms;
  --orb-light-time: 900ms; --orb-light-delay: 0ms;
  --below: calc(var(--orb-y) + var(--orb-size) / 2);
  --dock-h: 4.5rem;
  position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; overflow: hidden; overflow: clip; isolation: isolate;
  border-radius: var(--radius-xl); container-type: size;
  background: var(--stage-bg);
  transition: background 600ms ease;
}
.stage[data-view="plan"] {
  --orb-y: 112%; --orb-size: min(140cqh, 92cqw);
  --orb-edge: transparent; --orb-disc-opacity: 0.2; --shader-opacity: 0.48;
}
.stage[data-view="session"] { --orb-y: 41%; --orb-size: min(50cqh, 27rem, 46cqw); }
.stage[data-orb-motion="to-call"] {
  --orb-travel-time: 820ms; --orb-travel-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --orb-edge-time: 300ms; --orb-edge-delay: 450ms;
  --orb-light-time: 600ms; --orb-light-delay: 200ms;
}
.stage[data-orb-motion="to-plan"] {
  --orb-travel-time: 760ms; --orb-travel-ease: cubic-bezier(0.33, 0, 0.15, 1);
  --orb-edge-time: 200ms; --orb-light-time: 500ms;
}
.stage::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 65% 56% at 50% 100%, color-mix(in srgb, var(--ring) 23%, transparent), transparent);
  opacity: 0; transition: opacity var(--orb-light-time) ease;
}
.stage[data-view="plan"]::before { opacity: 1; }
/* On wide screens the sphere moves a little left to give the conversation room. */
@media (min-width: 75.01rem) { .stage[data-view="session"] { --orb-x: 44%; } }
@media (min-width: 48.01rem) {
  .stage[data-view="session"]:has(.session-grid[data-pane="call"]:not([data-report="true"]) #agent-action-checklist:not([hidden])) {
    --orb-x: 49%; --orb-size: min(44cqh, 24rem, 42cqw);
    --action-lane: min(18rem, calc(var(--orb-x) - var(--orb-size) / 2 - 2.4rem));
  }
  .session-grid[data-pane="call"]:not([data-report="true"]) .customer-card:has(#agent-action-checklist:not([hidden])) {
    width: var(--action-lane);
  }
  .session-grid[data-pane="call"]:not([data-report="true"]):has(#agent-action-checklist:not([hidden])) .dock {
    width: min(40rem, calc((var(--orb-x) - var(--action-lane) - 2rem) * 2));
  }
}
.stage[data-view="session"]:has(.session-grid:is([data-pane="chat"], [data-report="true"])) {
  --orb-x: calc((100% - var(--drawer) - 1rem) / 2); --orb-size: min(42cqh, 24rem, calc((100cqw - var(--drawer)) * 0.5));
}
.ring {
  position: absolute; z-index: 0; left: var(--orb-x); top: var(--orb-y); width: var(--orb-size); aspect-ratio: 1; translate: -50% -50%;
  border-radius: 50%; border: 0.2rem solid var(--orb-edge, var(--ring)); pointer-events: none;
  transition: left var(--orb-travel-time) var(--orb-travel-ease), top var(--orb-travel-time) var(--orb-travel-ease),
    width var(--orb-travel-time) var(--orb-travel-ease), border-color var(--orb-edge-time) ease var(--orb-edge-delay);
}
/* The dark centre disc the visual sits on. */
.ring::after { content: ""; position: absolute; inset: 7%; border-radius: 50%; background: var(--disc); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 6%), 0 1.2rem 2.5rem -1.2rem rgb(31 36 32 / 45%); opacity: var(--orb-disc-opacity, 1); transition: opacity var(--orb-light-time) ease var(--orb-light-delay); }
.ring-dot { position: absolute; inset: 0; transition: rotate 600ms linear; }
.ring-dot::before { content: ""; position: absolute; left: 50%; top: -0.5rem; width: 0.85rem; height: 0.85rem; translate: -50% 0; border-radius: 50%; background: #fff; border: 0.18rem solid var(--sage-deep); }
.stage[data-call="active"] .ring-dot::before { border-color: var(--coral); }
.stage:not([data-view="session"]) .ring-dot { display: none; }
.orb-host { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: var(--shader-opacity, 1); transition: opacity var(--orb-light-time) ease var(--orb-light-delay); }
.orb-canvas { width: 100%; height: 100%; display: block; }
.orb-fallback { display: none; }
.no-webgl .orb-fallback {
  display: block; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  --disc-radius: calc(var(--orb-size) * 0.43);
  clip-path: circle(var(--disc-radius) at var(--orb-x) var(--orb-y)); opacity: var(--shader-opacity, 1);
  transition: clip-path var(--orb-travel-time) var(--orb-travel-ease), opacity var(--orb-light-time) ease var(--orb-light-delay);
}
.no-webgl .orb-fallback::before {
  content: ""; position: absolute; left: var(--orb-x);
  top: calc((max(0%, var(--orb-y) - var(--disc-radius)) + min(100%, var(--orb-y) + var(--disc-radius))) / 2);
  width: calc(var(--orb-size) * 0.56); height: clamp(0.65rem, var(--orb-size) * 0.065, 1.55rem);
  translate: -50% -50%; border-radius: 50%;
  background: repeating-linear-gradient(to bottom, transparent 0 0.3rem, rgb(255 255 255 / 70%) 0.3rem calc(0.3rem + 1.5px));
  transition: left var(--orb-travel-time) var(--orb-travel-ease), top var(--orb-travel-time) var(--orb-travel-ease),
    width var(--orb-travel-time) var(--orb-travel-ease), height var(--orb-travel-time) var(--orb-travel-ease);
}
.no-webgl .stage[data-state="speaking"] .orb-fallback::before { animation: pulse 0.9s ease-in-out infinite; }
@keyframes pulse { 50% { scale: 1.06; } }

.view { position: absolute; inset: 0; z-index: 2; min-width: 0; min-height: 0; }
.view:not([hidden]) { animation: view-in 560ms 180ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: no-preference) {
  .stage[data-orb-motion="to-call"] .view-plan[data-orb-exit] { display: block !important; pointer-events: none; animation: orb-plan-depart 240ms ease-in both; }
  .stage[data-orb-motion="to-call"] .view-session:not([hidden]) { animation: none; }
  .stage[data-orb-motion="to-call"] .view-session:not([hidden]) .session-grid > :not(.dock) { animation: orb-call-arrive 360ms ease-out 520ms both; }
  .stage[data-orb-motion="to-call"] .ring-dot { animation: orb-call-arrive var(--orb-edge-time) ease var(--orb-edge-delay) both; }
  .stage[data-orb-motion="to-plan"] .view-session[data-orb-exit] { display: block !important; pointer-events: none; animation: orb-call-depart 200ms ease-out both; }
  .stage[data-orb-motion="to-plan"] .view-plan:not([hidden]) { animation: orb-plan-arrive 320ms ease-out 460ms both; }
}
@keyframes orb-plan-depart { to { opacity: 0; transform: translateY(12px) scale(0.96); } }
@keyframes orb-call-arrive { from { opacity: 0; } }
@keyframes orb-call-depart { to { opacity: 0; } }
@keyframes orb-plan-arrive { from { opacity: 0; transform: scale(1.02); } }
/* No backdrop blur: over the live sphere canvas it would be redone every frame. */
.glass, .dock, .customer-card .setup { background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); }

/* The orb's space shrinks before the form does. Very short screens can scroll the login view. */
.stage[data-view="login"] { --orb-y: 28%; --orb-size: min(35cqh, 20rem, 52cqw); }
.stage[data-view="login"]:has(.account-form:not([hidden])) {
  --orb-y: 20%; --orb-size: min(26cqh, 15rem, 45cqw);
}
@media (max-height: 42rem) {
  .stage[data-view="login"]:has(#login-form:not([hidden])):has(#login-status:not(:empty)) {
    --orb-y: 19%; --orb-size: min(21cqh, 12rem, 45cqw);
  }
  .stage[data-view="login"]:has(:is(#password-login-form, #activate-account-form):not([hidden])) {
    --orb-y: 9%; --orb-size: min(11cqh, 4rem);
  }
}
@media (min-width: 64rem) and (max-height: 42rem) {
  .stage[data-view="login"]:has(:is(#password-login-form, #activate-account-form):not([hidden])) {
    --orb-x: calc((100% - min(44rem, 100%)) / 4);
    --orb-y: 46%; --orb-size: min(23cqh, 10rem, 14cqw);
  }
  .view-login:has(:is(#password-login-form, #activate-account-form):not([hidden]))::before { flex-basis: 0; }
}
.view-login {
  display: flex; flex-direction: column; align-items: center; overflow: auto; overscroll-behavior: contain;
  padding: clamp(0.65rem, 2cqh, 1.25rem) clamp(0.65rem, 4cqw, 2rem); scroll-padding-block: 0.7rem;
}
.view-login::before { content: ""; flex: 0 1 calc(var(--below) + 0.8rem); }
.login-card {
  flex: none; width: min(44rem, 100%); margin-bottom: auto;
  display: grid; justify-items: center; gap: clamp(0.45rem, 1.6cqh, 0.75rem); text-align: center;
}
.login-card h1 { font-size: calc(clamp(1.2rem, 0.6rem + 2.4vw, 2.3rem) * var(--t)); font-weight: 300; letter-spacing: -0.02em; line-height: 1.12; text-wrap: balance; }
.login-card #login-form { width: min(32rem, 100%); }
.login-card .account-form { width: min(22rem, 100%); display: grid; gap: 0.35rem; text-align: left; }
.login-card .account-form label { font-size: calc(0.84rem * var(--t)); font-weight: 600; }
.login-card .account-form button { justify-self: end; margin-top: 0.2rem; }
.login-card #claim-account-key { justify-self: center; }
.login-card .account-actions { display: flex; justify-content: end; flex-wrap: wrap; gap: 0.35rem; }
.login-card #register-account-form .account-actions { justify-content: center; }
.login-card .lead { color: var(--muted); font-size: calc(1rem * var(--t)); max-width: 28rem; }
#login-form { width: 100%; display: grid; gap: 0.5rem; margin-top: 0.3rem; }
.key-row { display: flex; align-items: center; gap: 0.35rem; padding: 0.3rem; border-radius: 999px; background: var(--pill); border: 1px solid var(--line); box-shadow: var(--shadow); }
.key-row input { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; min-height: 2.5rem; padding-inline: 0.9rem; }
.key-row input:focus-visible { outline: none; }
.key-row:focus-within { outline: 3px solid var(--dark); outline-offset: 2px; }
.key-row #toggle-key { background: var(--chip); border-color: transparent; }
.key-row #sign-in { white-space: nowrap; padding-inline: 1.4rem; }
.login-card .help a { font-weight: 650; }
.fine { font-size: calc(0.78rem * var(--t)); color: var(--muted); }

/* ---------- session: everything is placed around the sphere ---------- */
.session-grid { position: absolute; inset: 0; }
.customer-card { position: absolute; top: 1.2rem; left: 1.4rem; width: min(22rem, 30cqw); padding: 0; background: none; box-shadow: none; overflow: visible; border-radius: 0; }
.customer-card .setup { border-top: 0; padding: 0.8rem; border-radius: var(--radius-l); }
.stage-top { position: absolute; top: 1.2rem; right: 1.4rem; display: flex; align-items: center; justify-content: end; gap: 0.45rem; flex-wrap: wrap; max-width: 46cqw; }
.orb-text { position: absolute; z-index: 1; left: var(--orb-x); translate: -50% 0; top: calc(var(--below) + 1rem); width: min(36rem, 46cqw); display: grid; justify-items: center; gap: 0.55rem; transition: left 900ms var(--glide); pointer-events: none; }
.voice-status { padding: 0.45rem 1.1rem; border-radius: 999px; background: var(--pill); box-shadow: var(--shadow); font-size: calc(0.92rem * var(--t)); font-weight: 550; text-align: center; line-height: 1.3; max-width: 100%; }
.stage[data-state="speaking"] .voice-status { background: var(--dark); color: var(--on-dark); }
.stage[data-state="listening"] .voice-status { background: var(--coral-ink); color: #fff; }
.supervisor-call-status { padding: 0.3rem 0.7rem; border-radius: 999px; background: var(--pill); color: var(--ink); font-size: calc(0.82rem * var(--t)); }
.greeting-status { display: flex; justify-content: center; gap: 0.45rem; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.greeting-status > span { padding: 0.3rem 0.7rem; border-radius: 999px; background: var(--pill); font-size: calc(0.82rem * var(--t)); }
#greeting-alert { background: var(--dark); color: var(--on-dark); }
.caption { text-align: center; font-size: calc(1.05rem * var(--t)); line-height: 1.4; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.caption[data-kind="coach"] { color: var(--coral-ink); font-weight: 550; }
/* During a call the words show in the deck beside the sphere, not under it. */
.session-grid .caption { display: none; }
/* With the report open, setup steps aside for the sphere. */
.session-grid[data-report="true"] .setup { display: none; }
.stage-actions { display: flex; gap: 0.4rem; align-items: center; }
.style-pick { display: inline-flex; align-items: center; gap: 0.4rem; }
.call-pill { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.1rem; padding: 0.3rem 0.9rem; border-radius: 999px; background: var(--pill); border: 1px solid var(--line); font-size: calc(0.82rem * var(--t)); font-weight: 550; white-space: nowrap; }
.call-pill .dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #9aa39a; }
.pill-time { display: none; font-variant-numeric: tabular-nums; color: var(--muted); }
.stage[data-call="active"] .call-pill .dot { background: var(--coral); box-shadow: 0 0 0 0.25rem rgb(217 100 58 / 18%); }
.stage[data-call="paused"] .call-pill .dot { background: #d9a43a; }
/* The conversation bends around the sphere and tapers away from the selected bubble. */
.stream {
  --side: 9.5rem;
  position: absolute; z-index: 2;
  left: calc(var(--orb-x) + var(--orb-size) * 0.32 + 0.75rem); right: 1.4rem;
  top: 4.2rem; bottom: calc(100% - var(--orb-y) - var(--orb-size) * 0.43);
  container: stream / inline-size; overflow: hidden auto; overscroll-behavior-y: contain; scrollbar-width: none;
  transition: left 900ms var(--glide), opacity 400ms ease;
}
.stream::-webkit-scrollbar { display: none; }
.stream-deck { position: relative; list-style: none; margin: 0; padding: 0.4rem; padding-inline-end: calc(0.4rem + min(72px, 18cqw)); min-height: 100%; display: flex; flex-direction: column; gap: 0.55rem; }
.stream-deck > :first-child { margin-top: auto; }
.sb {
  --depth: 4;
  --arc-x: 0px;
  --taper: 0.05;
  flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 22rem) var(--side); align-items: start; gap: 0.5rem;
  transform-origin: left center;
  translate: var(--arc-x) 0;
  scale: calc(1 - max(1, var(--depth)) * var(--taper));
  opacity: calc(1 - var(--depth) * 0.035);
  transition: scale 280ms var(--glide), opacity 280ms ease;
}
.sb:not(.is-live, .sb-marker) { cursor: pointer; }
.sb[aria-current="true"] { scale: 1; opacity: 1; }
.sb[aria-current="true"] .sb-main { border-color: var(--coral-ink); }
.sb-main {
  position: relative; display: grid; gap: 0.15rem; padding: 0.65rem 0.95rem 0.7rem;
  border-radius: 1.15rem 1.15rem 1.15rem 0.3rem; background: var(--card); color: var(--ink);
  border: 1px solid var(--line); box-shadow: 0 0.6rem 1.6rem -0.8rem rgb(27 31 27 / 35%);
  animation: card-in 560ms cubic-bezier(0.2, 0.9, 0.25, 1.15) both; transform-origin: 0% 100%;
}
@keyframes card-in { from { opacity: 0; transform: translate(-1.6rem, 1rem) scale(0.7) rotateY(-14deg); } }
.sb-who { font-size: calc(0.66rem * var(--t)); font-weight: 650; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink); opacity: 0.78; }
.sb-text { font-size: calc(0.93rem * var(--t)); line-height: 1.4; overflow-wrap: anywhere; }
.sb-coach .sb-main { background: var(--coach-bg); border-color: var(--coach-edge); box-shadow: inset 0.22rem 0 0 var(--coral), 0 0.6rem 1.6rem -0.8rem rgb(27 31 27 / 35%); }
.sb-coach .sb-who { opacity: 1; }
.sb-coach .sb-who::before { content: ""; display: inline-block; width: 0.45rem; height: 0.45rem; margin-right: 0.4rem; border-radius: 50%; background: var(--coral); vertical-align: 0.05em; }
.sb-agent .sb-main { background: var(--dark); color: var(--on-dark); border-color: transparent; border-radius: 1.15rem 1.15rem 0.3rem 1.15rem; }
.sb-agent .sb-who { color: var(--on-dark); opacity: 0.8; }
/* Words not yet spoken wait as dots, then appear one by one. */
.sb.is-held .sb-text, .sb.is-revealing .w:not(.on) { opacity: 0; }
.sb.is-held .sb-text { height: 1.3em; overflow: hidden; }
.sb.is-held .sb-main::after { content: ""; position: absolute; left: 0.95rem; bottom: 0.85rem; width: 0.38rem; height: 0.38rem; border-radius: 50%; background: currentColor; opacity: 0.5; box-shadow: 0.6rem 0 0 currentColor, 1.2rem 0 0 currentColor; animation: dots 1s ease-in-out infinite; }
@keyframes dots { 50% { opacity: 0.15; } }
.w { transition: opacity 220ms ease; }
.sb.is-live .sb-main { opacity: 0.88; }
.sb.is-live.is-waiting .sb-text { height: 1.3em; }
.sb.is-live.is-waiting .sb-main::after { content: ""; position: absolute; left: 0.95rem; bottom: 0.85rem; width: 0.38rem; height: 0.38rem; border-radius: 50%; background: currentColor; opacity: 0.5; box-shadow: 0.6rem 0 0 currentColor, 1.2rem 0 0 currentColor; animation: dots 1s ease-in-out infinite; }
.w.fresh { animation: word-in 320ms ease-out both; }
@keyframes word-in { from { opacity: 0; filter: blur(3px); } }
.sb.is-live .sb-who::after { content: ""; display: inline-block; width: 0.45rem; height: 0.45rem; margin-left: 0.45rem; border-radius: 50%; background: var(--coral); vertical-align: 0.05em; animation: dots 0.9s ease-in-out infinite; }
/* Side chips: actions, checks and timings beside the message they belong to. */
.sb-side { display: flex; flex-direction: column; align-items: start; gap: 0.3rem; padding-top: 0.35rem; }
.sb-chip {
  --n: 0;
  max-width: 100%; padding: 0.22rem 0.65rem; border-radius: 999px; background: var(--pill); border: 1px solid var(--line);
  font-size: calc(0.74rem * var(--t)); font-weight: 600; line-height: 1.25; color: var(--ink); box-shadow: var(--shadow);
  animation: chip-in 420ms cubic-bezier(0.2, 0.9, 0.25, 1.3) both; animation-delay: calc(260ms + var(--n) * 90ms);
}
@keyframes chip-in { from { opacity: 0; transform: translateX(-0.8rem) scale(0.8); } }
.sb-chip.sb-good { border-color: transparent; }
.sb-chip.sb-good, .coach-panel .coach-pass { background: var(--pass-bg, var(--sage-deep)); color: var(--pass-ink, #fff); }
.sb-chip.sb-bad { background: var(--pill); border-color: var(--coral); color: var(--ink); box-shadow: inset 0.2rem 0 0 var(--coral), var(--shadow); }
.sb-chip.sb-note { background: var(--coach-bg); border-color: var(--coach-edge); color: var(--ink); }
.sb-marker { grid-template-columns: minmax(0, 22rem); justify-items: center; }
.sb-marker span { padding: 0.15rem 0.7rem; border-radius: 999px; background: var(--line-quiet); color: var(--muted); font-size: calc(0.72rem * var(--t)); font-weight: 600; animation: chip-in 400ms ease both; }
/* A narrow deck puts the chips under the message. */
@container stream (max-width: 30rem) {
  .sb { grid-template-columns: minmax(0, 1fr); gap: 0.3rem; }
  .sb-side { flex-direction: row; flex-wrap: wrap; padding: 0 0 0 0.4rem; }
}
/* The full log is in the drawer; the deck steps aside while it or the report is open. */
.session-grid:is([data-pane="chat"], [data-report="true"]) .stream { opacity: 0; visibility: hidden; }
/* One dock under it all: call buttons, the open microphone or the reply box. */
.dock { position: absolute; left: var(--orb-x); translate: -50% 0; bottom: 1.2rem; width: min(40rem, calc(100cqw - 2.8rem)); display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.5rem; border-radius: 1.9rem; transition: left 900ms var(--glide); }
.dock .call-controls { flex: 0 0 auto; flex-wrap: nowrap; }
.dock .call-controls:has(:is(#coach-play, #coach-retry, #coach-continue, #coach-countdown, #duplex-reconnect):not([hidden])) { flex-basis: 100%; flex-wrap: wrap; }
.coach-countdown { display: grid; place-items: center; min-width: 2.75rem; min-height: 2.75rem; padding-inline: 0.65rem; border: 1px solid var(--line); border-radius: 999px; background: var(--pill); font-size: calc(1.1rem * var(--t)); font-weight: 650; font-variant-numeric: tabular-nums; }
.coach-pass { width: fit-content; padding: 0.15rem 0.65rem; border-radius: 999px; font-weight: 650; }
.dock:has(.coach-panel:not([hidden])) { z-index: 3; }
.dock:has(.coach-panel:not([hidden])) :is(.live-mic, .reply) { display: none; }
.coach-panel { flex: 1 1 100%; min-width: 0; padding: 0.75rem 0.9rem; border: 1px solid var(--coach-edge); border-radius: var(--radius-l); background: var(--coach-bg); }
.coach-panel h2 { font-size: calc(1.06rem * var(--t)); font-weight: 650; line-height: 1.3; }
.coach-panel p { color: var(--muted); font-size: calc(0.86rem * var(--t)); }
.coach-panel p:not(:empty) { margin-top: 0.25rem; }
#coach-status[data-loading="true"] { display: flex; align-items: center; gap: 0.45rem; }
#coach-status[data-loading="true"]::before {
  content: "";
  width: 0.85rem;
  height: 0.85rem;
  flex: 0 0 auto;
  border: 2px solid var(--coach-edge);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: coach-loading 800ms linear infinite;
}
@keyframes coach-loading { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  #coach-status[data-loading="true"]::before { animation: none; }
}
.coach-feedback { display: grid; gap: 0.55rem; max-height: min(13rem, 25cqh); margin: 0.5rem 0 0; padding-inline-end: 0.4rem; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--muted) var(--coach-bg); scrollbar-gutter: stable; font-size: calc(0.9rem * var(--t)); line-height: 1.4; overflow-wrap: anywhere; }
.coach-feedback:not(:has(> :not([hidden]))) { display: none; }
.coach-feedback dt { font-weight: 650; }
.coach-feedback dd { margin: 0.15rem 0 0; }
.coach-panel .coach-feedback-hint { font-size: calc(0.76rem * var(--t)); }
.incoming-call { display: flex; flex: 1 1 100%; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.65rem; min-width: 0; padding: 0.45rem 0.6rem; }
.incoming-call > div:first-child { flex: 1 1 9rem; min-width: 0; }
.incoming-call h2 { font-size: calc(1.06rem * var(--t)); font-weight: 650; line-height: 1.3; }
.incoming-call p { color: var(--muted); font-size: calc(0.86rem * var(--t)); overflow-wrap: anywhere; }
.incoming-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.incoming-actions button { flex: 1 0 auto; }
.dock:has(.incoming-call:not([hidden])) :is(.call-controls, .live-mic, .reply) { display: none; }
.dock:has(.call-brief:not([hidden])) { z-index: 3; }
.dock:has(.call-brief:not([hidden])) :is(.call-controls, .live-mic, .reply) { display: none; }
.call-brief { display: grid; flex: 1 1 100%; min-width: 0; gap: 0.45rem; padding: 0.7rem 0.85rem; border-radius: var(--radius-l); background: var(--card); }
.call-brief h2 { font-size: calc(1.05rem * var(--t)); font-weight: 650; }
.call-brief-content { display: grid; gap: 0.45rem; max-height: min(15rem, 33dvh); overflow: auto; scrollbar-width: thin; font-size: calc(0.9rem * var(--t)); }
.call-brief-content p { overflow-wrap: anywhere; }
.call-brief-scenario { font-weight: 650; }
.call-brief ul { display: grid; gap: 0.28rem; margin: 0; padding-inline-start: 1.2rem; }
.call-brief li { overflow-wrap: anywhere; }
.call-brief li strong { font-weight: 650; }
.call-brief-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; }
.call-brief-footer p { flex: 1 1 12ch; }
/* With the transcript open, leave room beside the dock for the drawer. */
.session-grid[data-pane="chat"]:not([data-report="true"]) .dock { left: 1.4rem; right: calc(var(--drawer) + 1.6rem); width: auto; translate: none; }
.dock .live-mic, .dock .reply { flex: 1 1 16rem; min-width: 0; }
.dock .consent, .dock .status { flex: 1 1 100%; padding: 0 0.6rem 0.2rem; }
/* Transcript and report slide in from the right; the sphere moves over to make room. */
.sage-panel, .report { position: absolute; top: 0.8rem; right: 0.8rem; bottom: 0.8rem; width: var(--drawer); }
.sage-panel { z-index: 4; transform: translateX(calc(100% + 1.5rem)); visibility: hidden; transition: transform 640ms var(--glide), visibility 0s linear 640ms; box-shadow: 0 1.5rem 3rem rgb(27 31 27 / 18%); }
.session-grid[data-pane="chat"] .sage-panel { transform: none; visibility: visible; transition: transform 640ms var(--glide), visibility 0s; }
.report { z-index: 3; animation: drawer-in 640ms var(--glide); }
@keyframes drawer-in { from { transform: translateX(calc(100% + 1.5rem)); } }
.drawer-head { display: flex; align-items: start; justify-content: space-between; gap: 0.5rem; }
.drawer-close { min-height: 2.3rem; width: 2.3rem; padding: 0; background: rgb(255 255 255 / 18%); color: #fff; border: 1px solid rgb(255 255 255 / 35%); }
/* Transcript and Details toggles sit with the call status, top right. */
.pane-tabs { display: flex; gap: 0.3rem; }
.pane-tabs button { position: relative; min-height: 2.1rem; padding: 0.25rem 0.85rem; font-size: calc(0.84rem * var(--t)); background: var(--pill); border-color: var(--line); }
.pane-tabs button[aria-pressed="true"] { background: var(--dark); color: var(--on-dark); }
.pane-tabs [data-pane-tab="call"], .pane-tabs [data-pane-tab="details"] { display: none; }
.tab-badge { position: absolute; top: -0.35rem; right: -0.3rem; min-width: 1.15rem; height: 1.15rem; padding: 0 0.3rem; border-radius: 999px; background: var(--coral-ink); color: #fff; font-size: 0.7rem; line-height: 1.15rem; }

.customer-card h1 { font-size: calc(clamp(1.3rem, 0.9rem + 0.9vw, 1.8rem) * var(--t)); font-weight: 400; letter-spacing: -0.02em; line-height: 1.15; margin-top: 0.3rem; }
.setup { display: grid; gap: 0.6rem; margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.setup label { display: grid; gap: 0.25rem; font-size: calc(0.8rem * var(--t)); color: var(--muted); }
.setup select { color: var(--ink); }

.call-controls { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.consent { display: flex; gap: 0.6rem; align-items: start; font-size: calc(0.86rem * var(--t)); color: var(--muted); }
.consent input { width: auto; min-height: 0; margin-top: 0.25rem; }
.hosted-consent-row { display: flex; align-items: center; gap: 0.45rem; }
.hosted-consent-row .consent { align-items: center; min-width: 0; gap: 0.45rem; }
.hosted-consent-row .consent input { flex: 0 0 auto; margin-top: 0; }
button.hosted-consent-info { flex: 0 0 auto; display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; min-height: 0; padding: 0; font-size: 0.85rem; font-weight: 700; }
.reply { display: flex; gap: 0.45rem; align-items: end; padding: 0.3rem; border-radius: 1.5rem; background: var(--pill); border: 1px solid var(--line); }
/* Tall enough for one line of Large text, so the text size never changes the layout. */
.reply textarea { flex: 1 1 auto; min-width: 0; border: 0; border-radius: 0; background: transparent; resize: none; height: 2.75rem; min-height: 2.75rem; max-height: 7.5rem; padding: 0.4rem 0.5rem; line-height: 1.3; }
.reply textarea:focus-visible { outline: none; }
.reply:focus-within { outline: 3px solid var(--dark); outline-offset: 2px; }
/* The open call microphone: same height as the reply box so the layout never moves. */
.live-mic { display: flex; align-items: center; gap: 0.6rem; min-height: calc(3.35rem + 2px); padding: 0.3rem 0.3rem 0.3rem 1rem; border-radius: 1.5rem; background: var(--pill); border: 1px solid var(--line); }
.live-mic[hidden] { display: none; }
.live-mic-text { flex: 1 1 auto; min-width: 0; font-size: calc(0.92rem * var(--t)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mic-dot { flex: 0 0 auto; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--sage-deep); box-shadow: 0 0 0 0.25rem rgb(77 106 82 / 18%); }
.live-mic[data-state="hearing"] .mic-dot { background: var(--coral); box-shadow: 0 0 0 0.3rem rgb(217 100 58 / 22%); }
.live-mic[data-state="hearing"] { animation: rec 1.4s ease-in-out infinite; }
.live-mic[data-state="muted"] .mic-dot { background: #a9b1a9; box-shadow: none; }
@keyframes rec { 50% { box-shadow: 0 0 0 0.5rem rgb(217 100 58 / 22%); } }

.sage-panel {
  min-height: 0; display: flex; flex-direction: column; padding: 1.2rem 1.1rem 0.9rem; border-radius: var(--radius-xl); color: #fff;
  background: var(--panel-bg);
}
.sage-panel .eyebrow { color: rgb(255 255 255 / 88%); }
.sage-panel h2 { font-size: calc(clamp(1.4rem, 0.9rem + 1.2vw, 2rem) * var(--t)); font-weight: 400; letter-spacing: -0.02em; margin: 0.15rem 0 0.35rem; }
.sage-panel .help { color: #fff; }
.transcript-wrap { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; margin-top: 0.6rem; }
.transcript { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; list-style: none; margin: 0; padding: 0 0.2rem 0 0; display: flex; flex-direction: column; gap: 0.5rem; scroll-behavior: smooth; }
.transcript::-webkit-scrollbar { display: none; }
.line { flex: 0 0 auto; display: grid; gap: 0.12rem; padding: 0.65rem 0.85rem; border-radius: var(--radius-m); background: var(--line-bg); color: var(--ink); }
.line .who { font-size: calc(0.68rem * var(--t)); font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.line p { font-size: calc(0.92rem * var(--t)); }
.line-agent { background: var(--dark); color: var(--on-dark); margin-left: 1rem; }
.line-agent .who { color: var(--on-dark); opacity: 0.7; }
.line-customer { margin-right: 1rem; }
.line-tool, .line-system { background: var(--line-quiet); }
.line-coach { background: var(--line-coach); box-shadow: inset 0.25rem 0 0 var(--coral); }
.line .replay-line { justify-self: start; margin-top: 0.25rem; min-height: 1.9rem; padding: 0.15rem 0.75rem; font-size: calc(0.8rem * var(--t)); background: var(--chip); }
.line.flash { outline: 3px solid var(--coral-ink); }
@media (prefers-reduced-motion: no-preference) { .line.is-new { animation: rise 260ms ease-out; } }
@keyframes rise { from { opacity: 0; translate: 0 0.4rem; } }

/* ---------- report: covers the stage, scrolls inside ---------- */
.report { display: flex; flex-direction: column; gap: 0.9rem; }
.report > h2 { font-size: calc(clamp(1.3rem, 0.9rem + 1vw, 1.8rem) * var(--t)); font-weight: 400; }
.report-action-groups { display: grid; gap: 0.55rem; }
.report-action-groups section { padding: 0.65rem 0.75rem; border-radius: var(--radius-m); background: var(--pill); }
.report-action-groups h3 { margin: 0; font-size: calc(0.9rem * var(--t)); font-weight: 650; }
.report-action-groups ul { display: grid; gap: 0.4rem; margin: 0.4rem 0 0; padding: 0; list-style: none; }
.report-action-groups li { display: grid; gap: 0.15rem; overflow-wrap: anywhere; font-size: calc(0.86rem * var(--t)); }
.report-action-groups li a { justify-self: start; font-size: calc(0.76rem * var(--t)); }
.report-action-groups li[data-kind="bad"] span { color: var(--coral-ink); }
.report-details { border-top: 1px solid var(--line); padding-top: 0.55rem; }
.report-details > summary { cursor: pointer; font-size: calc(0.86rem * var(--t)); font-weight: 650; }
.report-details[open] > summary { margin-bottom: 0.6rem; }
.report-details .criteria, .report-details .replay-buttons { margin-top: 0.65rem; }
.report-details .plan-next { margin-top: 0.65rem; }
.report #replay-status:empty, #learner-feedback-dialog .status:empty, #learner-feedback-dialog .fine:empty { display: none; }
#learner-feedback-dialog textarea { width: 100%; resize: vertical; }
.report-coach-voice { display: grid; justify-content: start; gap: 0.35rem; margin-bottom: 0.65rem; }
.call-timing { display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; margin: 0 0 0.7rem; font-variant-numeric: tabular-nums; }
.call-timing dt { color: var(--muted); font-size: calc(0.84rem * var(--t)); }
.call-timing dd { margin: 0; font-weight: 650; }
.score { font-size: calc(1.05rem * var(--t)); color: var(--muted); }
.score strong { font-size: calc(clamp(2.6rem, 1.8rem + 2.4vw, 4rem) * var(--t)); font-weight: 300; color: var(--ink); letter-spacing: -0.04em; }
.criteria { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.criteria li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 0.9rem; padding: 0.65rem 1rem; border-radius: 999px; background: var(--pill); font-size: calc(0.95rem * var(--t)); }
.criteria li.loading { grid-template-columns: 1fr; color: var(--muted); }
.criteria .points { font-variant-numeric: tabular-nums; font-weight: 600; padding: 0.12rem 0.7rem; border-radius: 999px; background: var(--chip); }
.criteria li[data-met="true"] .points { background: var(--sage-deep); color: #fff; }
.criteria .evidence { font-size: calc(0.86rem * var(--t)); color: var(--muted); }
.criteria a.evidence { color: var(--ink); font-weight: 600; }
.criteria .report-audio-button { grid-column: 1 / -1; justify-self: start; }
.replay h3 { font-size: calc(1rem * var(--t)); font-weight: 600; margin-bottom: 0.5rem; }
.replay-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ---------- Practice list ---------- */
.convo { display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; align-items: start; padding: 0.8rem 0.9rem; border-radius: var(--radius-l); background: var(--pill); border: 1.5px solid var(--line); cursor: pointer; transition: border-color 160ms ease, box-shadow 160ms ease; }
.convo:hover { box-shadow: var(--shadow); }
.convo:has(input:checked) { border-color: var(--dark); box-shadow: inset 0 0 0 1px var(--dark); }
.convo:has(input:focus-visible) { outline: 3px solid var(--dark); outline-offset: 2px; }
.convo input { width: 1.2rem; height: 1.2rem; min-height: 0; margin: 0.15rem 0 0; padding: 0; accent-color: var(--dark); }
.convo-body { display: grid; gap: 0.25rem; min-width: 0; }
.convo-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.convo-tags span { padding: 0.1rem 0.55rem; border-radius: 999px; background: var(--chip); font-size: calc(0.72rem * var(--t)); font-weight: 600; letter-spacing: 0.02em; }
.convo strong { font-weight: 600; font-size: calc(0.98rem * var(--t)); line-height: 1.3; }
.convo-summary { color: var(--muted); font-size: calc(0.85rem * var(--t)); line-height: 1.4; }
.convo-persona { font-size: calc(0.82rem * var(--t)); }
.convo-remove { justify-self: start; min-height: 1.9rem; padding: 0.1rem 0.7rem; font-size: calc(0.8rem * var(--t)); background: var(--chip); }
.persona { margin: 0.5rem 0 0; font-size: calc(0.9rem * var(--t)); color: var(--muted); }
.plan-next { margin-bottom: 1.1rem; padding: 0.9rem 1rem; border-radius: var(--radius-l); background: var(--chip); }
.plan-progress { margin: 0 0 0.7rem; font-weight: 550; }
.plan-results { margin: 0 0 0.8rem; padding: 0; list-style: none; display: grid; gap: 0.3rem; font-size: calc(0.9rem * var(--t)); }
.plan-results li { display: flex; justify-content: space-between; gap: 1rem; }
.custom-dialog { width: min(36rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); border: 0; border-radius: var(--radius-xl); padding: 1.4rem 1.5rem; background: var(--card); color: var(--ink); box-shadow: 0 1.5rem 4rem rgb(27 31 27 / 25%); overflow: auto; }
.custom-dialog::backdrop { background: rgb(27 31 27 / 35%); }
.custom-dialog form { display: grid; gap: 0.8rem; }
.custom-dialog h2 { margin: 0; font-weight: 400; font-size: calc(1.45rem * var(--t)); }
.custom-dialog label { display: grid; gap: 0.35rem; font-size: calc(0.88rem * var(--t)); font-weight: 550; }
.custom-dialog textarea { border-radius: var(--radius-m); resize: vertical; min-height: 6rem; }
.custom-dialog input[type="file"] { border-radius: var(--radius-m); padding: 0.5rem; }
.custom-dialog:is(#agent-action-dialog, #custom-dialog) { --dialog-padding: 1.15rem; padding: var(--dialog-padding); overflow: hidden; }
:is(#agent-action-form, #custom-form) { max-height: calc(100dvh - 2rem - var(--dialog-padding) - var(--dialog-padding)); grid-template-rows: auto minmax(0, 1fr) auto; gap: 0.65rem; }
:is(.agent-action-content, .custom-conversation-content) { display: grid; gap: 0.6rem; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.agent-action-options { border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--pill); }
.agent-action-options label { display: grid; grid-template-columns: 1.15rem minmax(0, 1fr); align-items: start; gap: 0.6rem; min-height: 2.75rem; padding: 0.55rem 0.7rem; cursor: pointer; }
.agent-action-options label + label { border-top: 1px solid var(--line); }
.agent-action-options input[type="checkbox"] { width: 1.15rem; height: 1.15rem; min-height: 0; padding: 0; margin: 0.1rem 0 0; accent-color: var(--dark); cursor: pointer; }
.agent-action-options small { display: block; color: var(--muted); }
.agent-action-timing { display: grid; grid-template-columns: minmax(0, 1fr) 5rem; align-items: center; gap: 0.2rem 0.6rem; }
.agent-action-timing .fine { grid-column: 1 / -1; }
#greeting-timeout { width: 100%; padding-inline: 0.65rem; }
.agent-action-checklist { margin-top: 0.75rem; padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--card); font-size: calc(0.86rem * var(--t)); }
.agent-action-checklist h2, .agent-action-checklist summary { font-size: inherit; font-weight: 650; }
.agent-action-checklist ul { display: grid; gap: 0.45rem; margin: 0.5rem 0 0; padding: 0; list-style: none; }
.agent-action-checklist li { display: flex; align-items: baseline; justify-content: space-between; gap: 0.45rem; padding: 0.3rem 0.35rem; border-inline-start: 0.15rem solid transparent; border-radius: 0.4rem; }
.agent-action-checklist li > :first-child { min-width: 0; overflow-wrap: anywhere; }
.agent-action-checklist .action-state { flex: 0 0 auto; color: var(--muted); }
.report-cti li { display: grid; gap: 0.25rem; padding: 0; border: 0; }
.report-cti-field { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.25rem 0.7rem; }
.report-cti li p { margin: 0; overflow-wrap: anywhere; }
.agent-action-checklist [data-matched="true"] .action-state { color: var(--ink); font-weight: 650; }
.agent-action-checklist [data-matched="true"][data-kind="good"] { border-inline-start-color: var(--sage-deep); background: var(--chip); }
.agent-action-checklist [data-matched="true"][data-kind="bad"] { border-inline-start-color: var(--coral); background: var(--coach-bg); }
.customer-card .agent-action-checklist ul { max-height: min(15rem, 36cqh); overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.session-grid[data-report="true"] .customer-card .agent-action-checklist { display: none; }
.level-pick { display: flex; gap: 0.5rem; border: 0; padding: 0; margin: 0; flex-wrap: wrap; }
.level-pick legend { font-size: calc(0.88rem * var(--t)); font-weight: 550; margin-bottom: 0.35rem; padding: 0; }
.level-pick label { display: flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.9rem; border-radius: 999px; background: var(--pill); border: 1px solid var(--line); cursor: pointer; }
.level-pick label:has(input:checked) { border-color: var(--dark); box-shadow: inset 0 0 0 1px var(--dark); }
.level-pick input { width: auto; min-height: 0; margin: 0; accent-color: var(--dark); }
.privacy-note { margin: 0; padding: 0.7rem 0.9rem; border-radius: var(--radius-m); background: var(--chip); font-size: calc(0.84rem * var(--t)); }
.dialog-actions { display: flex; justify-content: end; gap: 0.5rem; }

@media (max-width: 26rem) {
  .style-pick .style-name { display: none; }
  .brand-text { display: none; }
  .pane-tabs button span:not(.tab-badge) { font-size: calc(0.72rem * var(--t)); }
}
/* Short landscape phones: keep the controls, shrink the stage. */
@media (max-height: 30rem) and (max-width: 60rem) {
  .topbar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  button, .card, .stage, .line, .sage-panel { border: 1px solid CanvasText; }
}

/* Hover tips (js/tip.js): descriptions show on hover, focus or tap to save space. */
[data-tip] { cursor: help; }
.convo[data-tip] { cursor: pointer; }
.tip { position: fixed; z-index: 50; max-width: min(20rem, calc(100vw - 1rem)); padding: 0.55rem 0.8rem; border-radius: 0.8rem; background: var(--dark); color: var(--on-dark); font-size: calc(0.85rem * var(--t)); line-height: 1.4; white-space: pre-line; box-shadow: 0 0.6rem 1.6rem rgb(27 31 27 / 22%); pointer-events: none; animation: tip-in 120ms ease-out; }
@keyframes tip-in { from { opacity: 0; transform: translateY(2px); } }
@media (prefers-reduced-motion: reduce) { .tip { animation: none; } }

/* ---------- practice setup: one card that slides step by step ---------- */
.view-plan { display: flex; justify-content: center; align-items: stretch; animation: view-in 420ms cubic-bezier(.2,.8,.2,1); }
.wizard { width: min(62rem, 100%); height: min(38rem, 100%); align-self: center; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; padding: 0; overflow: hidden; }
.wizard-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 0.8rem 2rem; padding: 1.4rem 1.6rem 1.1rem; position: relative; }
.wizard-title h1 { margin: 0.2rem 0 0; font-weight: 300; font-size: calc(clamp(1.45rem, 1.1rem + 1vw, 2rem) * var(--t)); letter-spacing: -0.01em; }
.wizard-steps { display: flex; gap: 0.3rem; margin: 0; padding: 0.25rem; list-style: none; border-radius: 999px; background: var(--pill); box-shadow: var(--shadow); }
.wizard-steps button { display: flex; align-items: center; gap: 0.45rem; min-height: 2.3rem; padding: 0.25rem 0.85rem 0.25rem 0.3rem; border: 0; border-radius: 999px; background: transparent; box-shadow: none; color: var(--muted); font-size: calc(0.85rem * var(--t)); transition: background 280ms ease, color 280ms ease; }
.wizard-steps button:disabled { opacity: 0.55; cursor: default; }
.step-dot { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--chip); color: var(--ink); font-weight: 650; font-size: calc(0.78rem * var(--t)); transition: background 280ms ease, color 280ms ease, transform 280ms ease; }
.wizard-steps li[data-state="current"] button { background: var(--dark); color: var(--on-dark); }
.wizard-steps li[data-state="current"] .step-dot { background: var(--on-dark); color: var(--dark); transform: scale(1.04); }
.wizard-steps li[data-state="done"] button { color: var(--ink); }
.wizard-steps li[data-state="done"] .step-dot { background: var(--sage-deep); color: #fff; }
.wizard-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--line); }
.wizard-bar span { display: block; height: 100%; width: 0; background: var(--dark); transition: width 520ms cubic-bezier(.2,.8,.2,1); }
.wizard-viewport { overflow: hidden; min-height: 0; position: relative; }
.wizard-track { --step: 0; display: flex; height: 100%; transform: translateX(calc(-100% * var(--step))); transition: transform 560ms cubic-bezier(.22,.9,.24,1); }
.wizard-panel { flex: 0 0 100%; min-width: 0; height: 100%; overflow: auto; overscroll-behavior: contain; scrollbar-width: none; scroll-padding-block: 0.75rem; padding: 1.6rem 1.6rem 1rem; display: flex; flex-direction: column; gap: 1.1rem; opacity: 0.25; transition: opacity 420ms ease; }
.wizard-panel::-webkit-scrollbar { display: none; }
.wizard-panel.is-current { opacity: 1; }
.wizard-panel h2 { margin: 0; font-weight: 400; font-size: calc(1.4rem * var(--t)); outline-offset: 6px; }
/* Headings take focus only so screen readers hear the new step; no ring. */
.wizard-panel h2:focus { outline: none; }
.wizard-panel[data-panel="0"], .wizard-panel[data-panel="1"] { justify-content: center; padding-bottom: 3rem; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; }
.panel-actions { display: flex; gap: 0.4rem; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.9rem; }
.tile { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; justify-items: start; align-content: start; font-weight: 400; gap: 0.35rem; min-height: 12rem; padding: 1.3rem 1.3rem 1.2rem; border-radius: var(--radius-l); border: 1.5px solid var(--line); background: var(--pill); color: var(--ink); text-align: left; box-shadow: none; cursor: pointer; transition: transform 220ms cubic-bezier(.2,.8,.2,1), box-shadow 220ms ease, border-color 220ms ease, background 220ms ease; }
.tile:hover:not(:disabled) { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--tile-hover-edge); }
.tile:active:not(:disabled) { transform: translateY(0) scale(0.985); }
.tile[aria-pressed="true"] { border-color: var(--dark); box-shadow: inset 0 0 0 1px var(--dark), var(--shadow); }
.tile[aria-pressed="true"]::after { content: ""; position: absolute; top: 0.9rem; right: 0.9rem; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--dark) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 0.9rem no-repeat; animation: tick-in 260ms cubic-bezier(.2,.9,.3,1.4); }
.tile:disabled { opacity: 0.45; cursor: not-allowed; }
.tile-icon { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; margin-bottom: auto; border-radius: 0.85rem; background: var(--chip); }
.tile-icon svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tile-custom .tile-icon { background: #fbe3d8; }
.tile-custom .tile-icon svg { stroke: var(--coral-ink); }
.tile-name { margin-top: 1.4rem; font-size: calc(1.25rem * var(--t)); font-weight: 400; }
.tile-meta { color: var(--muted); font-size: calc(0.85rem * var(--t)); }
.tile[data-intent-id] .tile-name { overflow-wrap: anywhere; }
@media (max-width: 48rem) {
  .tile[data-intent-id] { min-height: 5.6rem; padding: 0.6rem 0.72rem; gap: 0.2rem; }
  .tile[data-intent-id] .tile-icon { width: 1.7rem; height: 1.7rem; border-radius: 0.5rem; }
  .tile[data-intent-id] .tile-icon svg { width: 1rem; height: 1rem; }
  .tile[data-intent-id] .tile-name { margin-top: 0.14rem; font-size: calc(1rem * var(--t)); }
}
.convo-list { list-style: none; margin: 0; padding: 0; display: grid; align-content: start; gap: 0.6rem; }
.convo-list li { display: flex; align-items: center; gap: 0.5rem; }
.convo-list .convo { flex: 1 1 auto; grid-template-columns: auto 1fr auto; align-items: center; }
.convo-list .convo strong { font-weight: 500; }
/* The footer already sums up the list; the line stays for screen readers. */
.ready-meta { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; }
.ready-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.3rem; }
.ready-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; padding: 0.4rem 0.7rem; border-radius: var(--radius-m); background: var(--pill); border: 1px solid var(--line); }
.ready-scenario-title { flex: 1 1 10rem; min-width: 0; overflow-wrap: anywhere; }
.ready-level-badges { display: flex; flex-wrap: wrap; gap: 0.22rem 0.3rem; }
.ready-min { padding: 0.13rem 0.42rem; border-radius: 999px; background: var(--chip); white-space: nowrap; color: var(--muted); font-size: calc(0.74rem * var(--t)); }
.ready-notes { list-style: none; margin: 0; padding: 0.6rem 1rem; display: grid; gap: 0.35rem; border-radius: var(--radius-l); background: var(--chip); }
.ready-notes li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.8rem; align-items: baseline; font-size: calc(0.86rem * var(--t)); line-height: 1.4; }
.ready-notes strong { font-weight: 650; }
.panel-help { margin: 0.2rem 0 0; color: var(--muted); font-size: calc(0.88rem * var(--t)); }
.wizard-foot { display: flex; align-items: center; gap: 0.8rem; padding: 0.9rem 1.2rem; border-top: 1px solid var(--line); background: var(--card); }
.plan-summary { flex: 1 1 auto; margin: 0; min-width: 0; text-align: center; color: var(--muted); font-size: calc(0.92rem * var(--t)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-start-hint { flex: 1 1 auto; min-width: 0; margin: 0; color: var(--danger); text-align: center; font-size: calc(0.82rem * var(--t)); line-height: 1.25; }
.plan-start-hint a { color: var(--danger); font-weight: 400; text-underline-offset: 0.14em; }
.plan-start-hint:has(a)::before { content: '* '; color: var(--danger); }
.wizard-foot button { min-width: 7.5rem; }
/* Tiles and rows rise in, one after another, when their step slides in. */
.wizard-panel.is-current .tile, .wizard-panel.is-current .convo-list li, .wizard-panel.is-current .ready-list li { animation: rise-in 460ms cubic-bezier(.2,.8,.2,1) both; }
.wizard-panel.is-current :is(.tile, li):nth-child(2) { animation-delay: 60ms; }
.wizard-panel.is-current :is(.tile, li):nth-child(3) { animation-delay: 120ms; }
.wizard-panel.is-current :is(.tile, li):nth-child(4) { animation-delay: 180ms; }
.wizard-panel.is-current :is(.tile, li):nth-child(n+5) { animation-delay: 240ms; }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes tick-in { from { transform: scale(0.3); opacity: 0; } }
@keyframes view-in { from { opacity: 0; transform: translateY(8px) scale(0.995); } }
@media (prefers-reduced-motion: reduce) {
  .wizard-track, .wizard-panel, .wizard-bar span, .tile, .view-plan { transition: none; animation: none; }
  .wizard-panel.is-current :is(.tile, li), .tile[aria-pressed="true"]::after { animation: none; }
}
@media (max-width: 48rem) {
  .wizard { height: 100%; border-radius: var(--radius-l); }
  .wizard-head { padding: 1rem 1rem 0.9rem; }
  .wizard-steps { width: 100%; justify-content: space-between; }
  .wizard-steps button { padding-right: 0.3rem; }
  .wizard-steps li:not([data-state="current"]) .step-name { display: none; }
  .wizard-steps li[data-state="current"] button { padding-right: 0.8rem; }
  .wizard-panel { padding: 1.1rem 1rem 0.8rem; }
  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .tile { min-height: 8rem; padding: 0.9rem; }
  .tile-name { margin-top: 0.8rem; }
  .wizard-panel[data-panel="0"], .wizard-panel[data-panel="1"] { justify-content: start; padding-bottom: 0.8rem; }
  /* Levels: one row each, dot on the left, so Hard is not left alone. */
  .wizard-foot { padding: 0.7rem; gap: 0.5rem; }
  .wizard-foot button { min-width: 0; flex: 0 0 auto; }
}
/* ---------- setup on the stage: the sphere sits behind the wizard ---------- */
.view-plan { display: block; animation: view-in 560ms 180ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.wizard { position: absolute; inset: clamp(0.7rem, 2.6cqh, 1.6rem) 0 0; width: auto; height: auto; align-self: stretch; justify-self: stretch; padding: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: none; box-shadow: none; border-radius: 0; overflow: hidden; }
.wizard-head { justify-content: center; padding: 0 1rem 0.2rem; }
.wizard-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wizard-bar { display: none; }
.wizard-panel { align-items: center; padding: 1.1rem 1.6rem 1rem; }
.wizard-panel > * { width: min(58rem, 100%); }
.wizard-panel h2 { text-align: center; font-weight: 300; font-size: calc(clamp(1.4rem, 1rem + 1vw, 2rem) * var(--t)); letter-spacing: -0.01em; }
.wizard-panel[data-panel="0"], .wizard-panel[data-panel="1"] { justify-content: start; padding-bottom: 1rem; }
.wizard-panel[data-panel="2"] > * { width: min(44rem, 100%); }
.wizard-panel[data-panel="2"] > .ready-grid { width: min(62rem, 100%); }
.panel-head { justify-content: center; flex-direction: column; }
.tile { background: var(--tile-bg); min-height: 10.5rem; }
.wizard-foot { width: min(58rem, 100% - 2rem); margin: 0 auto 1.1rem; padding: 0; border: 0; background: none; }
.pane-tabs svg { width: 16px; height: 16px; }

/* ---------- mid widths ---------- */
@media (max-width: 75rem) {
  .metrics { gap: 1.4rem; }
  .stage { --drawer: min(26rem, 48cqw); }
}

/* ---------- phones: the same stage, stacked ---------- */
@media (max-width: 48rem) {
  :root { --gap: 0.6rem; --radius-xl: 1.3rem; }
  body { padding: 0; }
  .frame { width: 100%; height: 100%; margin: 0; border: 0; border-radius: 0; padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom)); box-shadow: none; gap: 0.5rem; }
  .topbar { height: 3rem; }
  .brand-sub, .metrics { display: none; }
  .pill-time { display: inline; }
  .stage { --orb-y: 27%; --orb-size: min(58cqw, 34cqh); --drawer: calc(100% - 1rem); }
  .stage[data-view="plan"] { --orb-y: 118%; --orb-size: 170cqw; }
  .stage[data-view="session"] { --orb-y: 31%; --orb-size: min(54cqw, 29cqh); }
  .stage[data-view="session"]:has(.session-grid:is([data-pane="chat"], [data-report="true"])) { --orb-x: 50%; --orb-size: min(60cqw, 34cqh); }
  .key-row { flex-wrap: wrap; border-radius: 1.4rem; }
  .key-row input { flex-basis: 60%; }
  .key-row #sign-in { flex: 1 1 100%; }
  .stage-top { top: 0.6rem; left: 0.6rem; right: 0.6rem; max-width: none; justify-content: space-between; flex-wrap: nowrap; }
  .stage-actions { display: flex; gap: 0.3rem; }
  .call-pill { padding-inline: 0.7rem; }
  .style-pick .style-name { display: none; }
  .pane-tabs [data-pane-tab="details"] { display: inline-flex; }
  .pane-tabs button { padding: 0.25rem 0.6rem; }
  .pane-tabs button span:not(.tab-badge) { display: none; }
  .pane-tabs button[data-pane-tab="details"] span { display: inline; }
  .pane-tabs [data-pane-tab="details"] svg { display: none; }
  .customer-card { top: 3.4rem; left: 0.8rem; right: 0.8rem; width: auto; text-align: center; }
  .customer-card .chips, .customer-card .setup { display: none; }
  .session-grid:not([data-pane="details"]) .customer-card .agent-action-checklist { display: none; }
  .customer-card .agent-action-checklist ul { max-height: min(11rem, 26cqh); }
  .customer-card h1 { font-size: calc(1.2rem * var(--t)); }
  /* Details open as a sheet with the chips and the setup choices. */
  .session-grid[data-pane="details"] .customer-card { z-index: 5; top: auto; bottom: 0.6rem; left: 0.6rem; right: 0.6rem; padding: 1rem; border-radius: var(--radius-xl); background: var(--card); box-shadow: 0 -1rem 3rem rgb(27 31 27 / 18%); text-align: left; animation: sheet-in 420ms var(--glide); }
  .session-grid[data-pane="details"] .customer-card :is(.chips, .setup) { display: flex; }
  .session-grid[data-pane="details"] .customer-card .setup { display: grid; padding: 0; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  @keyframes sheet-in { from { transform: translateY(110%); } }
  .orb-text { width: calc(100% - 1.6rem); top: calc(var(--below) + 0.8rem); }
  .stream { left: 0.8rem; right: 0.8rem; top: calc(var(--below) + 3.4rem); bottom: calc(var(--dock-h) + 3.25rem); }
  .sb { --taper: 0.028; }
  .sb[data-edge-fragment]:not([aria-current="true"]) { opacity: 0; pointer-events: none; }
  .dock, .session-grid[data-pane="chat"]:not([data-report="true"]) .dock { left: 0.6rem; right: 0.6rem; bottom: 0.6rem; width: auto; translate: none; border-radius: 1.5rem; }
  .dock .call-controls { flex: 1 1 100%; }
  .dock .call-controls button { flex: 1 1 0; }
  .incoming-actions { flex: 1 1 100%; }
  .sage-panel, .report { top: 0.5rem; right: 0.5rem; bottom: 0.5rem; left: 0.5rem; width: auto; }
  .wizard-head { padding-inline: 0.6rem; }
  .wizard-panel { padding: 0.8rem 0.8rem 0.8rem; }
  .wizard-foot { width: calc(100% - 1rem); margin-bottom: 0.5rem; }
  .criteria li { grid-template-columns: 1fr auto; border-radius: var(--radius-m); }
  .criteria .evidence { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .ring, .orb-host, .orb-fallback, .orb-text, .dock, .sage-panel, .stream { transition: none; }
  .view:not([hidden]), .report, .sb-main, .sb-chip, .sb-marker span, .w.fresh { animation: none; }
  .sb { transition: none; }
}

/* ---------- setup steps dissolve into each other instead of sliding ---------- */
.wizard-track { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); min-width: 0; transform: none; transition: none; }
.ready-setup select { min-width: 0; }
.wizard { grid-template-columns: minmax(0, 1fr); }
.wizard-viewport { min-width: 0; }
.wizard-panel {
  grid-area: 1 / 1; opacity: 0; visibility: hidden; filter: blur(8px); transform: scale(0.985);
  transition: opacity 560ms ease, filter 560ms ease, transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 560ms;
}
.wizard-panel.is-current {
  opacity: 1; visibility: visible; filter: none; transform: none;
  transition: opacity 560ms ease 120ms, filter 560ms ease 120ms, transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1) 120ms, visibility 0s;
}
.wizard-panel.is-current .tile, .wizard-panel.is-current .convo-list li, .wizard-panel.is-current .ready-list li { animation-delay: 200ms; }
.wizard-panel.is-current :is(.tile, li):nth-child(2) { animation-delay: 260ms; }
.wizard-panel.is-current :is(.tile, li):nth-child(3) { animation-delay: 320ms; }
.wizard-panel.is-current :is(.tile, li):nth-child(4) { animation-delay: 380ms; }
.wizard-panel.is-current :is(.tile, li):nth-child(n+5) { animation-delay: 440ms; }
@media (prefers-reduced-motion: reduce) {
  .wizard-panel, .wizard-panel.is-current { transition: none; filter: none; transform: none; }
}
/* The pick: the chosen tile bumps and glows, the others step back, then the step dissolves. */
.tile.bump { animation: bump 460ms cubic-bezier(0.3, 1.6, 0.5, 1) both !important; }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.045); } 70% { transform: scale(0.99); } 100% { transform: scale(1.015); } }
.tile.bump { box-shadow: inset 0 0 0 1px var(--dark), 0 0.9rem 2.2rem -0.6rem rgb(27 31 27 / 30%); }
.wizard-panel.has-pick .tile:not(.bump) { animation: none !important; opacity: 0.45; transition: opacity 300ms ease; }
@media (prefers-reduced-motion: reduce) { .tile.bump { animation: none !important; } }

/* ---------- colour themes (ocean depths), next to the text sizes ---------- */
/* Sage is the default. The four others follow the "ocean depth" gradients:
   Sunlit (0 m), Coral Reef (30 m), Whale Dive (300 m) and Midnight (1,000 m). */
html[data-theme="sunlit"] {
  --page: #eefaf0; --frame: #e2f6ea; --card: #fbfff7; --pill: #ffffff; --chip: #dcf6e8;
  --ink: #0d2b2a; --muted: #46655f; --line: #c6e9da; --sage-deep: #2a8a78; --dark: #0d2b2a;
  --body-glow: #fbfff2; --frame-edge: #f9fffb;
  --stage-bg: linear-gradient(180deg, #F0FCDE 0%, #D6FCE3 33%, #A7EECB 67%, #95EDD8 100%);
  --disc: radial-gradient(circle at 50% 38%, #24504a 0%, #163732 55%, #0f2724 100%);
  --panel-bg: linear-gradient(170deg, #1f7a6a 0%, #2a9580 55%, #4bb79d 100%);
  --tile-hover-edge: #a9dcc6; --line-quiet: #e6f7ee;
  --orb-mint: 0.70 0.98 0.84; --orb-sage: 0.58 0.92 0.80;
  --orb-reeds: 0.28 0.61 0.49 0.25;
}
html[data-theme="reef"] {
  --page: #e8f9fd; --frame: #d8f3fb; --card: #f6fdff; --pill: #ffffff; --chip: #d2f1fa;
  --ink: #05293a; --muted: #3a6576; --line: #b9e3f0; --sage-deep: #0a7fb2; --dark: #05293a;
  --body-glow: #f4feff; --frame-edge: #f7fdff;
  --stage-bg: linear-gradient(180deg, #48EEFD 0%, #35E7FD 33%, #14C1EF 67%, #15BAF1 100%);
  --disc: radial-gradient(circle at 50% 38%, #0c4a66 0%, #08344b 55%, #052538 100%);
  --panel-bg: linear-gradient(170deg, #06618d 0%, #0a7fb2 55%, #1aa2d6 100%);
  --glass: rgb(255 255 255 / 70%); --tile-bg: rgb(255 255 255 / 80%);
  --tile-hover-edge: #8fd3ea; --line-quiet: #e3f5fb;
  --orb-mint: 0.48 0.94 1.00; --orb-sage: 0.30 0.80 0.96;
  --orb-reeds: 0.76 1.00 0.82 0.26;
}
html[data-theme="whale"] {
  --page: #082f6c; --frame: #0b3a84; --card: #0d3f90; --pill: #154c9f; --chip: #1a58b0;
  --ink: #eef6ff; --muted: #aac8ee; --line: #2c63b4; --sage-deep: #7cc4ff; --dark: #eaf4ff; --on-dark: #06275e; --dark-hover: #ffffff;
  --coral: #ff9a6e; --coral-ink: #b4441b; --danger: #ffb4a0;
  --body-glow: #1868c6; --frame-edge: #1a55a8;
  --stage-bg: linear-gradient(180deg, #168CE5 0%, #0E83DE 33%, #034DB8 67%, #0248B9 100%);
  --disc: radial-gradient(circle at 50% 38%, #0d468f 0%, #072e66 55%, #041f4b 100%);
  --glass: rgb(4 30 80 / 38%); --glass-edge: rgb(255 255 255 / 16%); --tile-bg: rgb(4 30 80 / 34%); --tile-hover-edge: #6aa9ec;
  --panel-bg: linear-gradient(170deg, #052a69 0%, #08377f 55%, #0b4598 100%);
  --line-bg: rgb(255 255 255 / 12%); --line-quiet: rgb(255 255 255 / 7%); --line-coach: rgb(255 154 110 / 18%);
  --coach-bg: #0b3576; --coach-edge: #ff9a6e;
  --shadow: 0 0.05rem 0.1rem rgb(0 10 40 / 25%), 0 0.6rem 1.6rem rgb(0 10 40 / 30%);
  --orb-mint: 0.55 0.84 1.00; --orb-sage: 0.36 0.62 0.98;
}
html[data-theme="midnight"] {
  --page: #0d1050; --frame: #141963; --card: #1a2075; --pill: #222a85; --chip: #29318f;
  --ink: #eef0ff; --muted: #aeb3e8; --line: #343d9e; --sage-deep: #a3adff; --dark: #eef0ff; --on-dark: #101462; --dark-hover: #ffffff;
  --coral: #ff8fa8; --coral-ink: #b0385d; --danger: #ffb4c2;
  --body-glow: #2a318f; --frame-edge: #232b86;
  --stage-bg: linear-gradient(180deg, #2A318F 0%, #232D87 33%, #121968 67%, #101462 100%);
  --disc: radial-gradient(circle at 50% 38%, #1b2272 0%, #121852 55%, #0b0f3b 100%);
  --glass: rgb(8 10 50 / 40%); --glass-edge: rgb(255 255 255 / 14%); --tile-bg: rgb(8 10 50 / 36%); --tile-hover-edge: #6f79d8;
  --panel-bg: linear-gradient(170deg, #11166a 0%, #1a2080 55%, #252c95 100%);
  --line-bg: rgb(255 255 255 / 11%); --line-quiet: rgb(255 255 255 / 6%); --line-coach: rgb(255 143 168 / 18%);
  --coach-bg: #1c2278; --coach-edge: #ff8fa8;
  --shadow: 0 0.05rem 0.1rem rgb(0 0 20 / 30%), 0 0.6rem 1.6rem rgb(0 0 20 / 35%);
  --orb-mint: 0.74 0.78 1.00; --orb-sage: 0.66 0.56 0.98;
}
/* Dark themes: light text on the light primary buttons stays dark, inputs and the
   orb's white lines read on navy, and the accent button keeps white text. */
html:is([data-theme="whale"], [data-theme="midnight"]) { color-scheme: dark; }
html:is([data-theme="whale"], [data-theme="midnight"]) { --orb-reeds: 0.94 0.98 1.00 0.16; }
html[data-theme="sunlit"] { --pass-bg: #206f60; }
html[data-theme="reef"] { --pass-bg: #096f9e; }
html:is([data-theme="whale"], [data-theme="midnight"]) { --pass-ink: var(--on-dark); }
html:is([data-theme="whale"], [data-theme="midnight"]) button.accent { color: #fff; }
html:is([data-theme="whale"], [data-theme="midnight"]) .brand-mark { background: var(--dark); }
html:is([data-theme="whale"], [data-theme="midnight"]) .brand-mark img { filter: brightness(0) saturate(100%) invert(12%) sepia(50%) saturate(4000%) hue-rotate(220deg); }
html:is([data-theme="whale"], [data-theme="midnight"]) .ring-dot::before { background: var(--on-dark); }
html:is([data-theme="whale"], [data-theme="midnight"]) .criteria li[data-met="true"] .points { color: var(--on-dark); }
html:is([data-theme="whale"], [data-theme="midnight"]) .tile-custom .tile-icon { background: rgb(255 154 110 / 22%); }
html:is([data-theme="whale"], [data-theme="midnight"]) .tile-icon svg { stroke: var(--ink); }
html:is([data-theme="whale"], [data-theme="midnight"]) .tile-custom .tile-icon svg { stroke: var(--coral); }
html:is([data-theme="whale"], [data-theme="midnight"]) .wizard-steps li[data-state="done"] .step-dot { color: var(--on-dark); }

.theme-pick { display: flex; gap: 0.25rem; padding: 0.3rem; border-radius: 999px; background: var(--pill); box-shadow: var(--shadow); }
.theme-pick button { position: relative; min-height: 0; width: 1.75rem; height: 1.75rem; padding: 0; border-radius: 50%; border: 2px solid transparent; background: var(--swatch); box-shadow: inset 0 0 0 1px rgb(0 0 0 / 12%); }
.theme-pick button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--pill); }
.theme-pick [data-theme-pick="sage"] { --swatch: linear-gradient(180deg, #f6f8f3, #cfdccb 55%, #4d6a52); }
.theme-pick [data-theme-pick="sunlit"] { --swatch: linear-gradient(180deg, #F0FCDE, #A7EECB 60%, #95EDD8); }
.theme-pick [data-theme-pick="reef"] { --swatch: linear-gradient(180deg, #48EEFD, #14C1EF 60%, #15BAF1); }
.theme-pick [data-theme-pick="whale"] { --swatch: linear-gradient(180deg, #168CE5, #034DB8 60%, #0248B9); }
.theme-pick [data-theme-pick="midnight"] { --swatch: linear-gradient(180deg, #2A318F, #121968 60%, #101462); }
/* Phones: only the current swatch shows; pressing it moves to the next theme. */
@media (max-width: 48rem) {
  .theme-pick { padding: 0.25rem; }
  .theme-pick button:not([aria-pressed="true"]) { display: none; }
}
@media (max-width: 27rem) {
  .frame > .topbar { gap: 0.4rem; }
  .frame > .topbar .brand-mark { width: 2.25rem; height: 2.25rem; }
  .frame > .topbar .topbar-tools { gap: 0.3rem; }
  .frame > .topbar:has(.mode-switch:not([hidden])) { min-height: 3rem; }
  .frame > .topbar .font-size button { min-width: clamp(1.45rem, 7vw, 2rem); padding-inline: 0.18rem; }
  .frame > .topbar .topbar-tools :is(#sign-out, #to-plan) { padding-inline: clamp(0.45rem, 2vw, 0.8rem); }
}

.wizard-panel[data-panel="2"] { overflow: hidden; gap: 0.75rem; padding-block: 0.75rem; }
.ready-grid { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr); grid-template-rows: minmax(0, 1fr); align-items: start; gap: 1rem; }
.ready-brief, .ready-setup { display: grid; gap: 0.5rem; min-width: 0; min-height: 0; max-height: 100%; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.ready-levels { display: flex; align-items: center; gap: 0.45rem; }
#ready-level-title { font-size: calc(0.8rem * var(--t)); font-weight: 600; }
#level-tiles { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.16fr) minmax(0, 1fr); gap: 0.3rem; }
#level-tiles button.small {
  box-sizing: border-box; min-width: 0; min-height: 2.75rem; padding-inline: 0.13rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.18rem; font-size: calc(0.79rem * var(--t));
}
#level-tiles button[aria-pressed="true"] { color: var(--on-dark); background: var(--dark); }
#level-tiles button[aria-pressed="true"]::before { content: '✓' / ''; font-size: 0.8em; }
.ready-list { overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.ready-list { max-height: min(8.5rem, 20cqh); grid-auto-rows: max-content; gap: 0.3rem; }
.ready-list:not(:has(> :nth-child(2))) { max-height: none; }
.ready-list:focus-visible, #ready-guide-content:focus-visible { outline-offset: -3px; }
.ready-tools { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.ready-tools > button { flex: 1 1 auto; }
.ready-help-content { max-height: min(56dvh, 28rem); overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; font-size: calc(0.88rem * var(--t)); }
.ready-delivery { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
.ready-delivery select { width: 100%; min-width: 0; }
.ready-delivery > p { grid-column: 1 / -1; margin: 0; }
#ready-guide-content { padding: 0.1rem 0.25rem; }
#ready-guide-content summary { cursor: pointer; font-weight: 650; }
#ready-guide-content h3 { margin-block: 0.5rem 0.25rem; font-size: inherit; }
#ready-guide-content ul, #ready-guide-content ol { margin-block: 0.25rem; padding-inline-start: 1.25rem; }
#ready-guide-content .guide-conversation { display: grid; gap: 0.45rem; list-style: none; padding: 0; margin-block: 0.5rem 0.3rem; }
.guide-conversation > li { justify-self: start; max-inline-size: min(88%, 32rem); min-inline-size: 0; padding: 0.5rem 0.7rem; border: 1px solid var(--line); border-radius: 0.95rem 0.95rem 0.95rem 0.25rem; background: var(--pill); color: var(--ink); overflow-wrap: anywhere; }
.guide-conversation > li[data-speaker="agent"] { justify-self: end; background: var(--dark); color: var(--on-dark); border-color: transparent; border-radius: 0.95rem 0.95rem 0.25rem 0.95rem; }
.guide-conversation strong { display: block; font-size: 0.75em; font-weight: 650; opacity: 0.85; }
.guide-conversation p { margin: 0.18rem 0 0; white-space: pre-wrap; line-height: 1.4; }
#ready-guide-content section + section { margin-top: 0.65rem; }
.ready-setup { display: flex; flex-direction: column; padding: 0.7rem 0.8rem; overflow: hidden; border-radius: var(--radius-l); background: color-mix(in srgb, var(--card) 94%, transparent); border: 1px solid var(--glass-edge); }
.ready-setup > :not(.ready-fields) { flex: none; }
.ready-fields { display: grid; gap: inherit; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.ready-fields :focus-visible { outline-offset: -3px; }
.ready-setup .setup { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 0.5rem 0.65rem; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.ready-setup :is(.setup, .voice-talent-control) label { display: grid; grid-template-rows: auto auto; gap: 0.18rem; min-width: 0; font-size: calc(0.82rem * var(--t)); line-height: 1.2; color: var(--muted); font-weight: 550; }
.ready-setup .field-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ready-setup :is(.setup, .voice-talent-control) :is(select, input) { height: max(2.3rem, calc(2.35rem * var(--t))); min-height: 0; padding-block: 0; font-size: calc(0.9rem * var(--t)); font-weight: 500; line-height: normal; color: var(--ink); }
.voice-talent-controls { display: contents; }
.voice-talent-controls:has(.customer-emotion-control:not([hidden])) { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: inherit; }
.voice-talent-controls .customer-emotion-control select { width: 100%; }
.voice-role-compact { display: none; }
.voice-talent-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 0.18rem 0.3rem; min-width: 0; }
.ready-setup .voice-talent-control label { display: contents; }
.voice-talent-control .field-name { grid-column: 1 / -1; }
.voice-talent-control button.small { min-height: max(2.3rem, calc(2.35rem * var(--t))); padding-inline: 0.55rem; }
#voice-preview-status { grid-column: 1 / -1; }
.ready-setup .consent { align-items: start; gap: 0.22rem; font-size: calc(0.86rem * var(--t)); color: var(--ink); }
.ready-setup .consent input { flex: 0 0 auto; margin-top: 0.25rem; margin-inline: 0; }
.ready-switches { display: flex; flex-wrap: wrap; gap: 0.22rem 0.65rem; }
.ready-switches .consent { width: fit-content; padding-block: 0.1rem; }
@media (max-width: 48rem) {
  .wizard-panel[data-panel="2"] { gap: 0.45rem; padding-block: 0.45rem; }
  .ready-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 0.5rem; }
  .ready-brief { max-height: min(12rem, 29cqh); gap: 0.35rem; }
  .ready-list { max-height: max(3rem, 9cqh); }
  .ready-setup { gap: 0.4rem; padding: 0.55rem 0.65rem; }
  .ready-setup .setup { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35rem 0.5rem; }
  .customer-emotion-control .emotion-role { display: none; }
  .ready-tools > button.small { padding-inline: 0.45rem; font-size: calc(0.78rem * var(--t)); }
  .ready-notes li { display: block; font-size: calc(0.8rem * var(--t)); }
  .ready-notes strong { margin-inline-end: 0.45rem; }
  .ready-setup :is(select, input[type="text"]) { padding-inline-start: 0.65rem; }
  .ready-setup select { padding-inline-end: 1.6rem; background-position: calc(100% - 0.85rem) 55%, calc(100% - 0.55rem) 55%; }
}
@media (max-height: 42rem) and (max-width: 48rem) {
  .ready-setup .setup { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.25rem 0.4rem; }
  .ready-setup :is(.setup, .voice-talent-control) label { font-size: calc(0.75rem * var(--t)); }
  .ready-setup :is(.setup, .voice-talent-control) :is(select, input) { height: max(2rem, calc(1.9rem * var(--t))); font-size: calc(0.78rem * var(--t)); }
  .ready-setup :is(select, input[type="text"]) { padding-inline-start: 0.5rem; }
  .ready-setup select { padding-inline-end: 1.15rem; background-position: calc(100% - 0.62rem) 55%, calc(100% - 0.32rem) 55%; }
  .voice-talent-control { column-gap: 0.17rem; }
  .ready-setup .voice-talent-control button.small { min-height: max(2rem, calc(1.9rem * var(--t))); padding-inline: 0.32rem; }
}
@media (max-height: 42rem) {
  .wizard-panel[data-panel="2"] > h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .frame:has(.view-plan:not([hidden]) .wizard[data-step="2"]) .topbar:not(:has(.mode-switch:not([hidden]))) { height: 3rem; }
}
@media (max-width: 27rem) and (max-height: 42rem) {
  .ready-list li { font-size: calc(0.82rem * var(--t)); line-height: 1.3; }
  .ready-level-badges { column-gap: 0.2rem; }
  .ready-min { padding-inline: 0.2rem; font-size: calc(0.66rem * var(--t)); }
  .ready-switches .background-noise-prefix { display: none; }
  .ready-setup .consent { font-size: calc(0.75rem * var(--t)); }
  .voice-talent-controls:has(.customer-emotion-control:not([hidden])) .voice-role-full { display: none; }
  .voice-talent-controls:has(.customer-emotion-control:not([hidden])) .voice-role-compact { display: inline; }
  .voice-talent-controls:has(.customer-emotion-control:not([hidden])) .voice-talent-control .field-name { grid-column: 1; grid-row: 1; }
  .voice-talent-controls:has(.customer-emotion-control:not([hidden])) .voice-talent-control select { grid-column: 1 / -1; grid-row: 2; }
  .voice-talent-controls:has(.customer-emotion-control:not([hidden])) .voice-talent-control button.small { grid-column: 2; grid-row: 1; min-width: 1.5rem; min-height: 1.5rem; padding: 0; }
}
@media (max-width: 22rem) {
  .ready-tools { flex-wrap: nowrap; }
  .ready-tools > button.small { padding-inline: 0.2rem; font-size: calc(0.72rem * var(--t)); }
  .ready-setup .setup label, .ready-setup .consent { font-size: calc(0.69rem * var(--t)); }
  .ready-setup .hosted-consent-info { width: 1.5rem; height: 1.5rem; }
  .wizard-foot:has(.plan-start-hint:not([hidden])) { display: grid; grid-template-columns: auto 1fr auto; }
  .wizard-foot .plan-start-hint { grid-column: 1 / -1; grid-row: 1; }
  .wizard-foot:has(.plan-start-hint:not([hidden])) #plan-start { grid-column: 3; }
}
