/* Copied unchanged from prototype/static/styles.css so both tutors look alike. Rules for this page alone are in conversation-page.css. */
:root {
  color-scheme: light;
  --ink: #13222b;
  --muted: #667680;
  --paper: #f4f7f8;
  --surface: #ffffff;
  --line: #d7e0e4;
  --signal: #1e8297;
  --signal-bright: #6bd3df;
  --night: #0d1b24;
  --night-line: #253844;
  --danger: #b64838;
  --focus: #006f8a;
  --radius: 18px;
  font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); background:
  linear-gradient(90deg, rgba(30,130,151,.045) 1px, transparent 1px) 0 0 / 28px 28px,
  var(--paper); }
button, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 45%, transparent);
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.shell { width: min(760px, calc(100% - 28px)); margin: 0 auto; padding: 24px 0 44px; }
.brandline { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.brand { margin: 0; font-size: .72rem; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; color: #365c6b; }
.build-label { font: 700 .68rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; color: #71818a; }
.panel { background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 18px 48px rgba(24,49,61,.09); overflow: hidden; }
.panel-head { padding: clamp(22px, 5vw, 38px); border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 10px; color: var(--signal); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
h1 { margin: 0; max-width: 15ch; font-size: clamp(2rem, 7vw, 3.7rem); line-height: .98; letter-spacing: -.045em; font-weight: 760; }
.lede { margin: 14px 0 0; max-width: 52ch; color: var(--muted); font-size: 1rem; line-height: 1.5; }
.panel-body { padding: clamp(18px, 5vw, 34px); }

.field-group { margin: 0 0 25px; }
.field-label { display: block; margin-bottom: 9px; font-size: .76rem; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; color: #4c626d; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.choice { position: relative; min-height: 76px; padding: 13px 14px; text-align: left; border: 1px solid #cdd8dd; border-radius: 14px; background: var(--surface); color: var(--ink); }
.choice strong, .choice span { display: block; }
.choice strong { font-size: .92rem; }
.choice span { margin-top: 4px; color: var(--muted); font-size: .75rem; line-height: 1.3; }
.choice.selected { border: 2px solid var(--signal); padding: 12px 13px; background: #ebf6f7; box-shadow: inset 0 0 0 1px rgba(30,130,151,.1); }
.public-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.catalog-choice { width: 100%; min-height: 0; }
.choice[disabled] { cursor: not-allowed; opacity: .46; }
.primary, .secondary, .danger-button { width: 100%; min-height: 54px; border-radius: 14px; font-weight: 800; }
.primary { border: 0; background: var(--danger); color: #fff; box-shadow: 0 9px 20px rgba(182,72,56,.2); }
.primary:hover { background: #a93f31; }
.primary:disabled { cursor: wait; opacity: .58; }
.secondary { border: 1px solid var(--signal); background: transparent; color: #176d80; }
.safety { margin: 12px auto 0; max-width: 48ch; text-align: center; color: var(--muted); font-size: .72rem; line-height: 1.4; }
.error { margin: 0 0 16px; padding: 11px 13px; border-left: 4px solid var(--danger); background: #fff0ed; color: #7b2f24; border-radius: 0 10px 10px 0; }
/* Microphone choice on the setup screen, with a live input-level bar. */
.microphone-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
.microphone-select { min-width: 0; min-height: 54px; padding: 0 12px; border: 1px solid #cdd8dd; border-radius: 14px; background: var(--surface); color: var(--ink); }
.microphone-row .secondary { width: auto; padding: 0 16px; }
.microphone-level { height: 8px; margin-top: 10px; border-radius: 999px; background: #e3eaed; overflow: hidden; }
.microphone-level span { display: block; width: 0; height: 100%; background: var(--signal); transition: width 80ms linear; }
.microphone-note { margin: 8px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.4; }
.microphone-note.warning { color: #7b2f24; font-weight: 700; }
@media (max-width: 420px) { .microphone-row { grid-template-columns: 1fr; } .microphone-row .secondary { width: 100%; } }

.live-panel { min-height: min(760px, calc(100vh - 36px)); display: flex; flex-direction: column; background: var(--night); color: #eef8fa; border-color: var(--night-line); }
.live-head { display: flex; justify-content: space-between; gap: 16px; padding: 22px; border-bottom: 1px solid var(--night-line); }
.live-title { margin: 4px 0 0; font-size: 1.35rem; }
.live-meta { color: #92a9b4; font-size: .76rem; }
.status-pill { align-self: flex-start; padding: 7px 10px; border: 1px solid #31505e; border-radius: 999px; color: #9fc1ca; font-size: .72rem; }
.status-pill.live { border-color: #2f7c69; color: #8fe0c0; }
.status-pill.error { border-color: #87493f; color: #ffb5a8; }
/* Startup steps: visibly working, not stalled. The dot pulses so a 5s wait
   reads as progress rather than a hang. */
.status-pill.pending { border-color: #5a6f2f; color: #d7e88f; }
.status-pill.pending::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px;
  border-radius: 50%; background: currentColor; vertical-align: middle;
  animation: pending-pulse 1s ease-in-out infinite;
}
@keyframes pending-pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .status-pill.pending::before { animation: none; opacity: .8; }
}
/* Screen-only live captions. They are never sent to the server journal. */
.transcript-box { margin: 0 18px 4px; border: 1px solid var(--night-line); border-radius: 10px; background: #0d1f27; }
.transcript-summary { padding: 9px 12px; cursor: pointer; color: #9fc1ca; font-size: .74rem; }
.transcript-note { color: #6f8a95; }
.transcript { max-height: 190px; overflow-y: auto; padding: 4px 12px 12px; font-size: .82rem; line-height: 1.45; }
.transcript-line { margin: 0 0 7px; color: #dceaf0; overflow-wrap: anywhere; }
.transcript-time { display: inline-block; min-width: 68px; color: #5d7883; font-size: .7rem; font-variant-numeric: tabular-nums; }
.transcript-who { display: inline-block; min-width: 66px; color: #6f8a95; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
/* Interim segments are still being revised — shown, but visibly provisional. */
.transcript-line.is-interim .transcript-text { color: #8fa8b2; font-style: italic; }
.signal-stage { display: grid; place-content: center; flex: 1; padding: 42px 22px; text-align: center; }
.waveform { display: flex; align-items: center; justify-content: center; gap: 5px; height: 62px; margin-bottom: 20px; }
.waveform i { width: 4px; height: 8px; border-radius: 999px; background: #4b8794; transform: scaleY(var(--level, .18)); transition: transform 70ms linear, background 180ms ease, box-shadow 180ms ease; transform-origin: center; }
.waveform.heard i { background: var(--signal-bright); box-shadow: 0 0 11px rgba(107,211,223,.34); }
.signal-state { margin: 0; font-size: 1.15rem; font-weight: 780; }
.signal-state.warning { color: #ffb5a8; }
.signal-help { margin: 9px auto 0; max-width: 38ch; color: #9cafb8; font-size: .82rem; line-height: 1.45; }
.live-actions { padding: 18px; }
.danger-button { border: 1px solid #925145; background: transparent; color: #ffc0b5; }
.recovery { margin: 0 18px 10px; min-height: 48px; border: 0; border-radius: 12px; background: #a85a21; color: #fff; font-weight: 800; }

.study-state { margin: 0 18px 4px; padding: 15px; border: 1px solid var(--night-line); border-radius: 12px; background: #102732; }
.study-state .field-label { color: #8faab4; }
.study-state p { margin: 6px 0; }
.study-state .study-progress { color: #8fe0c0; font-size: .78rem; }
.study-prompt { font-size: 1.02rem; line-height: 1.4; }
.study-feedback { color: #c6d9df; font-size: .86rem; line-height: 1.4; }
.study-state .secondary { width: 100%; min-height: 44px; margin-top: 10px; border-color: #4c9eaa; color: #a7e3e8; }

.results { display: grid; gap: 10px; margin: 18px 0; }
.result-row { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.result-top { display: flex; justify-content: space-between; gap: 12px; font-weight: 760; }
.result-meta { margin-top: 5px; color: var(--muted); font-size: .73rem; }
.feedback-grid { display: grid; gap: 18px; }
.rating { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.rating button { min-height: 43px; border: 1px solid #ccd7dc; border-radius: 11px; background: #fff; }
.rating button.selected { border: 2px solid var(--signal); background: #ebf6f7; font-weight: 750; }
textarea { width: 100%; min-height: 78px; padding: 10px; resize: vertical; border: 1px solid #ccd7dc; border-radius: 11px; }
.dev-details { margin-top: 18px; color: var(--muted); font-size: .75rem; }
.dev-details pre { max-height: 180px; overflow: auto; white-space: pre-wrap; }

@media (max-width: 560px) {
  .shell { width: min(100% - 18px, 760px); padding-top: 10px; }
  .brandline { padding: 0 5px; margin-bottom: 10px; }
  .panel { border-radius: 19px; }
  .choice-grid { grid-template-columns: 1fr; }
  .panel-head { padding: 24px 20px 20px; }
  .panel-body { padding: 18px; }
  .live-panel { min-height: calc(100vh - 20px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
  .waveform i { transition: background 120ms ease; }
}
/* Owner-only debug transcript recording: setup checkbox and live-panel indicator. */
.debug-transcript-toggle { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); cursor: pointer; }
.debug-transcript-toggle input { width: 20px; height: 20px; accent-color: var(--danger); }
.debug-transcript-indicator { margin: 0; padding: 8px 22px; border-bottom: 1px solid var(--night-line); background: rgba(146,81,69,.28); color: #ffc0b5; font-size: .8rem; font-weight: 780; letter-spacing: .02em; }

/* Voice engine switch: the same study content served by two voice stacks, each its own Worker. */
.engine-switch { display: inline-flex; border: 1px solid #2a3c47; border-radius: 999px; overflow: hidden; }
.engine-switch a { padding: 7px 12px; font: 700 .68rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; color: #71818a; text-decoration: none; }
.engine-switch a[aria-current="page"] { background: #d8e6ec; color: #0d1b24; }
.engine-switch a:focus-visible { outline: 2px solid #8fd3e8; outline-offset: -2px; }
