:root {
  color-scheme: light;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --page: #f6f4f0;
  --paper: #ffffff;
  --paper-soft: #faf8f4;
  --ink: #161f2e;
  --muted: #586274;
  --line: rgba(22, 31, 46, 0.11);
  --line-strong: rgba(22, 31, 46, 0.18);
  --accent: #22478a;
  --accent-bright: #2f5eb3;
  --accent-deep: #14264a;
  --accent-tint: #eaf0fb;
  --stage-bg: #131c2e;
  --stage-bg-2: #1d2b47;
  --coral: #d94b2b;
  --coral-soft: #fdece7;
  --amber-bg: #fdf1d9;
  --amber-ink: #8a4e0b;
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-card: 0 12px 34px -10px rgba(18, 30, 54, 0.10), 0 2px 6px rgba(18, 30, 54, 0.04);
  --shadow-stage: 0 18px 40px -16px rgba(13, 22, 42, 0.42);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(660px 440px at 8% -4%, rgba(47, 94, 179, 0.11), transparent 68%),
    radial-gradient(560px 380px at 94% 12%, rgba(217, 75, 43, 0.09), transparent 66%),
    radial-gradient(700px 480px at 52% 108%, rgba(34, 71, 138, 0.06), transparent 70%);
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, textarea:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, .deck-viewer:focus-visible {
  outline: 3px solid rgba(47, 94, 179, 0.42);
  outline-offset: 2px;
}
button:disabled { cursor: not-allowed; opacity: 0.56; }

.shell { width: min(1240px, calc(100% - 56px)); margin-inline: auto; }

/* Masthead */
.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 244, 240, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  animation: fadeDown 0.45s var(--ease-spring) both;
}
.masthead-inner { min-height: 58px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand strong { font-size: 1.18rem; letter-spacing: 0.04em; color: var(--accent-deep); font-weight: 800; }
.brand-caption { font-size: 0.85rem; color: var(--muted); padding-left: 11px; border-left: 1px solid var(--line-strong); }
.brand-mark {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; gap: 3px;
  border-radius: 10px 10px 10px 3px;
  background: linear-gradient(145deg, var(--accent-deep), var(--accent));
  box-shadow: 0 6px 14px -6px rgba(20, 38, 74, 0.55);
}
.brand-mark i { display: block; width: 3px; height: 9px; border-radius: 4px; background: #dbe8ff; transition: transform 0.35s var(--ease-spring); }
.brand-mark i:nth-child(2) { height: 16px; background: #ffb89e; }
.brand-mark i:nth-child(3) { height: 12px; }
.brand:hover .brand-mark i:nth-child(1) { transform: scaleY(1.35); }
.brand:hover .brand-mark i:nth-child(2) { transform: scaleY(0.72); }
.brand:hover .brand-mark i:nth-child(3) { transform: scaleY(1.25); }

.masthead-right { display: flex; align-items: center; gap: 8px; }
.demo-tag {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  color: var(--accent-deep); font-size: 0.84rem; font-weight: 650;
}
.demo-tag i { width: 7px; height: 7px; background: #6b7b96; border-radius: 50%; flex-shrink: 0; }
.mode-pill {
  padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.78); border: 1px solid var(--line);
}
.status-button {
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.88);
  border-radius: 999px; padding: 6px 13px;
  transition: transform 0.2s var(--ease-spring), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.status-button:hover { background: #fff; border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 6px 16px -8px rgba(34, 71, 138, 0.35); }
.status-button[data-state="verified"] { background: #e6effc; border-color: #93b5ec; color: var(--accent-deep); }
.status-button[data-state="verified"] i { background: #2c6ae5; box-shadow: 0 0 0 3px rgba(44, 106, 229, 0.22); }
.status-button[data-state="unverified"] { background: var(--amber-bg); border-color: #e4bd76; color: var(--amber-ink); }
.status-button[data-state="unverified"] i { background: #d68518; }
.status-button[data-state="error"] { background: var(--coral-soft); border-color: #e8a395; color: #9c2e1c; }
.status-button[data-state="error"] i { background: var(--coral); }

/* Hero Intro - compact so desktop fits above the fold */
.page-intro {
  padding: 18px 0 16px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  animation: fadeUp 0.5s var(--ease-spring) 0.04s both;
}
.page-intro h1 {
  margin: 0;
  font-size: clamp(1.65rem, 2.7vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: 820;
  color: var(--accent-deep);
}
.page-intro h1 .title-stop { color: var(--coral); }
.page-intro p { margin: 0; color: var(--muted); font-size: 0.94rem; line-height: 1.55; max-width: 60ch; }

/* Main Layout */
.layout {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  animation: fadeUp 0.55s var(--ease-spring) 0.09s both;
}
body[data-mode="ppt"][data-has-deck="true"] .layout {
  grid-template-columns: 184px minmax(0, 1fr);
  gap: 18px;
}

.sidebar { min-width: 0; position: sticky; top: 74px; }
.practice-modes {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px;
  margin-bottom: 16px; padding: 4px;
  border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 2px rgba(22, 31, 46, 0.04);
}
.mode-link {
  display: grid; place-items: center; min-height: 36px; padding: 4px 6px;
  border-radius: 8px; text-align: center; color: var(--muted);
  font-weight: 680; font-size: 0.84rem; text-decoration: none;
  transition: color 0.2s ease, background 0.25s var(--ease-spring), box-shadow 0.25s var(--ease-spring);
}
.mode-link:hover { color: var(--accent-deep); background: rgba(255, 255, 255, 0.9); }
.mode-link[aria-current="page"] {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent-bright));
  box-shadow: 0 6px 14px -6px rgba(34, 71, 138, 0.58);
}

.small-heading { display: block; color: var(--muted); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; margin: 0 0 9px; }
.scenario-list { display: grid; gap: 6px; max-height: 430px; overflow-y: auto; padding-right: 3px; }
.scenario-button {
  position: relative; display: flex; min-width: 0; align-items: center; gap: 10px; text-align: left;
  padding: 8px 10px; color: var(--ink);
  border: 1px solid transparent; background: rgba(255, 255, 255, 0.5); border-radius: 11px;
  transition: transform 0.22s var(--ease-spring), background 0.2s ease, border-color 0.2s ease, box-shadow 0.22s var(--ease-spring);
}
.scenario-button:hover { background: rgba(255, 255, 255, 0.92); transform: translateX(3px); }
.scenario-button[aria-current="true"] {
  background: #fff; border-color: rgba(34, 71, 138, 0.28); color: var(--accent-deep);
  box-shadow: 0 8px 20px -12px rgba(34, 71, 138, 0.35);
}
.scenario-icon {
  flex: 0 0 32px; height: 32px; display: grid; place-items: center; border-radius: 9px;
  color: var(--accent); background: var(--accent-tint); font-weight: 800; font-size: 0.94rem;
  transition: transform 0.25s var(--ease-spring), background 0.2s ease, color 0.2s ease;
}
.scenario-button[aria-current="true"] .scenario-icon { color: #fff; background: linear-gradient(135deg, var(--accent-deep), var(--accent)); transform: scale(1.04); }
.scenario-text { min-width: 0; display: grid; gap: 2px; }
.scenario-text strong { font-size: 0.93rem; }
.scenario-text small { font-size: 0.8rem; color: var(--muted); }

.structure { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 15px; }
.structure h2 { margin: 0 0 10px; font-size: 0.88rem; color: var(--accent-deep); }
.structure ol { color: var(--muted); list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 0.84rem; }
.structure li { display: flex; align-items: center; gap: 8px; }
.structure li span {
  display: inline-grid; min-width: 2.55rem; place-items: center; padding: 2px 6px;
  border: 1px solid var(--line); border-radius: 6px; font-weight: 700;
  color: var(--accent-deep); background: rgba(255, 255, 255, 0.85); font-size: 0.78rem;
}

/* Workbench Shell */
.workbench {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.steps {
  display: flex; gap: 22px; align-items: center; margin: 0; padding: 11px 22px;
  background: var(--paper-soft); border-bottom: 1px solid var(--line); list-style: none;
}
.steps li {
  display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 0.85rem;
  transition: color 0.25s ease;
}
.steps li span {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: #e8e6e0; font-size: 0.75rem; font-weight: 750;
  transition: transform 0.3s var(--ease-spring), background 0.25s ease, color 0.25s ease;
}
.steps li[aria-current="step"] { color: var(--accent-deep); font-weight: 760; }
.steps li[aria-current="step"] span { background: var(--accent); color: #fff; transform: scale(1.1); box-shadow: 0 0 0 4px rgba(34, 71, 138, 0.15); }
.steps li[data-complete] span { background: #dce7fa; color: var(--accent-deep); }

.workbench-body { padding: 18px 22px 20px; }

/* Fallback alert banner */
.fallback-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; margin-bottom: 14px;
  border-radius: 11px; border: 1px solid #ebb2a6; background: var(--coral-soft); color: #8c2615;
  font-size: 0.87rem; line-height: 1.5;
  animation: fadeDown 0.3s var(--ease-spring) both;
}
.banner-close {
  flex: 0 0 auto; border: 1px solid rgba(140, 38, 21, 0.25); background: #fff; color: #8c2615;
  border-radius: 7px; padding: 4px 10px; font-size: 0.8rem; font-weight: 680;
}
.banner-close:hover { background: #fff5f2; }

/* Split Studio Layout for PPT Mode when Deck is Loaded */
.practice-stage { display: block; }
body[data-mode="ppt"][data-has-deck="true"] .practice-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.92fr);
  gap: 20px;
  align-items: start;
}
body[data-mode="ppt"][data-has-deck="true"] .deck-panel {
  position: sticky;
  top: 74px;
  margin-bottom: 0;
}
.speak-column { min-width: 0; }

/* Section Top & Notes */
.section-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.role { display: flex; align-items: center; gap: 6px; color: var(--accent); font-size: 0.84rem; font-weight: 700; margin-bottom: 4px; }
.icon-person { display: block; position: relative; width: 14px; height: 14px; }
.icon-person::before, .icon-person::after { content: ""; position: absolute; border: 1.5px solid var(--accent); left: 50%; transform: translateX(-50%); }
.icon-person::before { width: 6px; height: 6px; border-radius: 50%; top: 0; }
.icon-person::after { width: 11px; height: 5px; border-radius: 7px 7px 2px 2px; bottom: 1px; }
.section-top h2, .result-heading h2 { margin: 0; font-size: clamp(1.3rem, 2.1vw, 1.62rem); letter-spacing: -0.025em; color: var(--accent-deep); }
.scene-intro { color: var(--muted); margin: 6px 0 10px; font-size: 0.9rem; line-height: 1.5; }

.scene-context {
  margin: 0 0 11px; padding: 11px 13px; border-radius: 12px;
  background: linear-gradient(135deg, #f3f6fc, #faf9f5);
  border: 1px solid rgba(34, 71, 138, 0.14);
  display: grid; gap: 7px;
  animation: fadeUp 0.3s var(--ease-spring) both;
}
.context-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.context-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--ink); }
.context-chip strong {
  padding: 1px 7px; border-radius: 6px; background: var(--accent-tint);
  color: var(--accent-deep); font-size: 0.75rem; font-weight: 740;
}
.context-bg { margin: 0; font-size: 0.88rem; line-height: 1.58; color: var(--ink); }
.context-focus { margin: 0; font-size: 0.84rem; line-height: 1.5; color: #9c3018; display: flex; align-items: baseline; gap: 7px; }
.context-focus strong {
  flex: 0 0 auto; padding: 1px 7px; border-radius: 6px; background: var(--coral-soft);
  color: #b83b1e; font-size: 0.75rem; font-weight: 740;
}

.notes {
  list-style: none; margin: 0 0 14px; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px;
}
.notes li {
  border: 1px solid var(--line); background: var(--paper-soft); border-radius: 10px;
  padding: 8px 10px; line-height: 1.45; font-size: 0.85rem; word-break: break-word;
  transition: transform 0.2s var(--ease-spring), border-color 0.2s ease, background 0.2s ease;
}
.notes li:hover { transform: translateY(-1px); border-color: rgba(34, 71, 138, 0.28); background: #fff; }

/* Buttons */
.primary-button {
  position: relative; overflow: hidden;
  min-height: 41px; padding: 8px 18px; flex: 0 0 auto;
  border: none; border-radius: 10px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  font-size: 0.92rem; font-weight: 720; letter-spacing: 0.01em;
  box-shadow: 0 8px 18px -8px rgba(34, 71, 138, 0.65);
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s var(--ease-spring), filter 0.2s ease;
}
.primary-button::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.22) 50%, transparent 65%);
  transform: translateX(-120%); transition: transform 0.55s ease;
}
.primary-button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 22px -8px rgba(34, 71, 138, 0.72); filter: brightness(1.05); }
.primary-button:hover:not(:disabled)::after { transform: translateX(120%); }
.primary-button:active:not(:disabled) { transform: translateY(0) scale(0.98); }

.plain-button {
  border: 1px solid var(--line-strong); padding: 7px 12px; border-radius: 9px;
  background: #fff; color: var(--accent-deep); white-space: nowrap; font-size: 0.85rem; font-weight: 660;
  transition: transform 0.18s var(--ease-spring), background 0.18s ease, border-color 0.18s ease;
}
a.plain-button { display: inline-flex; align-items: center; text-decoration: none; }
.plain-button:hover:not(:disabled) { background: var(--accent-tint); border-color: rgba(34, 71, 138, 0.35); transform: translateY(-1px); }
.plain-button:active:not(:disabled) { transform: translateY(0) scale(0.98); }

.ghost-button {
  border: 1px solid transparent; padding: 7px 10px; border-radius: 9px;
  background: transparent; color: var(--muted); white-space: nowrap; font-size: 0.84rem; font-weight: 650;
  transition: color 0.18s ease, background 0.18s ease;
}
.ghost-button:hover:not(:disabled) { color: var(--accent-deep); background: rgba(22, 31, 46, 0.05); }

.danger-button { color: #a6321e; border-color: rgba(166, 50, 30, 0.25); }
.danger-button:hover:not(:disabled) { background: var(--coral-soft); border-color: rgba(217, 75, 43, 0.45); color: #8c2615; }

/* Broadcast Studio Recorder */
.recorder {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(135deg, #eef3fc, #f7f9fd);
  border: 1px solid rgba(34, 71, 138, 0.15);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.recorder[data-recording] {
  background: linear-gradient(135deg, #fdf0ed, #fff6f3);
  border-color: rgba(217, 75, 43, 0.38);
  box-shadow: 0 0 0 4px rgba(217, 75, 43, 0.09);
}
.record-message, .record-actions { display: flex; align-items: center; gap: 11px; }
.record-actions { margin-left: auto; }

.wave {
  display: flex; flex: 0 0 64px; width: 64px; height: 42px;
  align-items: center; justify-content: center; gap: 3px;
  background: rgba(34, 71, 138, 0.09); border-radius: 10px;
  transition: background 0.3s ease;
}
.recorder[data-recording] .wave { background: rgba(217, 75, 43, 0.12); }
.wave i {
  width: 3px; height: 8px; display: block; border-radius: 99px;
  background: var(--accent);
  transform-origin: center;
  transition: background 0.25s ease;
}
.wave i:nth-child(2), .wave i:nth-child(8) { height: 13px; }
.wave i:nth-child(3), .wave i:nth-child(7) { height: 19px; }
.wave i:nth-child(4), .wave i:nth-child(6) { height: 15px; }
.wave i:nth-child(5) { height: 24px; }

.recorder[data-recording] .wave i {
  background: var(--coral);
  animation: eqBounce 0.62s ease-in-out infinite alternate;
}
.recorder[data-recording] .wave i:nth-child(1) { animation-delay: -0.08s; }
.recorder[data-recording] .wave i:nth-child(2) { animation-delay: -0.24s; }
.recorder[data-recording] .wave i:nth-child(3) { animation-delay: -0.40s; }
.recorder[data-recording] .wave i:nth-child(4) { animation-delay: -0.15s; }
.recorder[data-recording] .wave i:nth-child(5) { animation-delay: -0.52s; }
.recorder[data-recording] .wave i:nth-child(6) { animation-delay: -0.29s; }
.recorder[data-recording] .wave i:nth-child(7) { animation-delay: -0.44s; }
.recorder[data-recording] .wave i:nth-child(8) { animation-delay: -0.18s; }
.recorder[data-recording] .wave i:nth-child(9) { animation-delay: -0.35s; }

.record-title { margin: 0; font-size: 0.94rem; font-weight: 760; color: var(--accent-deep); }
.record-hint, .field-note { color: var(--muted); font-size: 0.84rem; margin: 3px 0 0; line-height: 1.48; }
.timer { color: var(--accent-deep); font-size: 0.86rem; font-variant-numeric: tabular-nums; font-weight: 760; }
.recorder[data-recording] .timer { color: var(--coral); }

.record-button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 7px 13px;
  border: 1px solid rgba(34, 71, 138, 0.26); background: #fff; border-radius: 10px;
  color: var(--accent-deep); font-size: 0.88rem; font-weight: 720; white-space: nowrap;
  transition: transform 0.18s var(--ease-spring), background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.record-button:hover:not(:disabled) { background: var(--accent-tint); transform: translateY(-1px); }
.recorder[data-recording] .record-button {
  background: var(--coral); border-color: var(--coral); color: #fff;
}
.record-dot {
  position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--coral);
  transition: border-radius 0.2s ease, background 0.2s ease;
}
.recorder[data-recording] .record-dot { border-radius: 2px; background: #fff; }
.recorder[data-recording] .record-dot::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.75);
  animation: recordPulse 1.15s ease-out infinite;
}

.record-options { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 4px 0 10px; }
.record-options label { color: var(--accent-deep); font-size: 0.83rem; font-weight: 600; }
.record-options input { accent-color: var(--accent); vertical-align: -0.1em; }
audio { display: block; height: 38px; width: min(320px, 100%); margin-bottom: 10px; }

#answer-label { display: block; color: var(--ink); font-weight: 740; font-size: 0.9rem; margin-bottom: 6px; }
textarea {
  width: 100%; min-height: 76px; display: block; resize: vertical;
  border: 1px solid var(--line-strong); border-radius: 11px; padding: 10px 12px;
  color: var(--ink); background: #fff; line-height: 1.55;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 71, 138, 0.12); }
textarea::placeholder { color: #7b8494; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 11px; }
.starter { color: var(--muted); font-size: 0.84rem; line-height: 1.5; }
.form-error { color: #a6321e; margin: 6px 0 0; font-size: 0.86rem; font-weight: 600; }

/* Coaching & Follow-up Inset Cards */
.inset {
  padding: 14px 16px; margin: 0 0 14px;
  border: 1px solid rgba(34, 71, 138, 0.18);
  border-left: 4px solid var(--accent);
  border-radius: 13px;
  background: linear-gradient(135deg, #f2f6fd, #f9fbff);
  animation: stageEnter 0.38s var(--ease-spring) both;
}
.inset.review {
  border-left-color: var(--coral);
  border-color: rgba(217, 75, 43, 0.22);
  background: linear-gradient(135deg, #fdf5f1, #fffcfa);
}
.inset .small-heading { margin-bottom: 4px; color: var(--accent); }
.inset.review .small-heading { color: #b83b1e; }
.inset h2 { margin: 0; font-size: 1.12rem; line-height: 1.45; color: var(--accent-deep); }
.inset p, .result-heading p { margin: 6px 0 0; color: var(--muted); line-height: 1.6; font-size: 0.9rem; }
blockquote {
  margin: 8px 0; padding: 8px 11px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.82); border: 1px solid var(--line);
  color: var(--accent-deep); font-size: 0.94rem; font-weight: 650; overflow-wrap: anywhere;
}
details { margin-top: 9px; }
summary { cursor: pointer; width: fit-content; color: var(--accent-deep); font-size: 0.87rem; font-weight: 680; }
.recap-details { margin-top: 8px; }
.recap-details summary { font-size: 0.82rem; color: var(--muted); }
.recap-details summary:hover { color: var(--accent-deep); }

/* Result Comparison */
#result { animation: stageEnter 0.4s var(--ease-spring) both; }
.result-checks { margin: 11px 0; list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.result-checks li {
  background: #f1efe9; color: #5b6372; border-radius: 999px; padding: 5px 11px; font-size: 0.84rem; font-weight: 640;
  animation: badgePop 0.35s var(--ease-spring) both;
}
.result-checks li:nth-child(2) { animation-delay: 0.06s; }
.result-checks li:nth-child(3) { animation-delay: 0.12s; }
.result-checks li[data-said] { background: #e3edfc; color: var(--accent-deep); }

.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.compare div { padding: 12px; background: var(--paper-soft); border: 1px solid var(--line); border-radius: 12px; }
.compare div:last-child { background: #f2f6fd; border-color: rgba(34, 71, 138, 0.22); }
.compare h3, .compare p { margin: 0; }
.compare h3 { font-size: 0.85rem; color: var(--accent-deep); letter-spacing: 0.02em; }
.compare p { margin-top: 6px; line-height: 1.6; font-size: 0.9rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.result-footer { justify-content: flex-end; }
.footnote { margin: 14px 0 22px; text-align: right; font-size: 0.81rem; color: var(--muted); line-height: 1.5; }

/* PPT Material Setup */
.material-setup { margin: 0; }
.material-setup:has(+ :not([hidden])) { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.material-setup > summary { font-size: 0.98rem; color: var(--accent-deep); }
.material-brief { margin-top: 12px; }
.material-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.field { min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 5px; font-size: 0.86rem; font-weight: 700; color: var(--ink); }
.field label span { color: var(--muted); margin-left: 5px; font-size: 0.79rem; font-weight: 500; }
.field input[type="text"] {
  width: 100%; color: var(--ink); min-height: 39px; border-radius: 9px;
  border: 1px solid var(--line-strong); padding: 7px 11px; background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 71, 138, 0.12); }
.field input[type="file"] { width: 100%; color: var(--ink); font-size: 0.86rem; }
.material-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.material-brief > .field-note { margin-top: 7px; }
.material-status:empty { display: none; }
.material-status[data-error] { color: #a6321e; font-weight: 600; }
.copy-fallback { margin-top: 9px; }

.own-material {
  margin-top: 11px; border: 1px solid var(--line); padding: 10px 12px;
  border-radius: 12px; background: var(--paper-soft);
}
.own-material .field { margin-block: 9px; }
.import-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 14px; margin-top: 8px; }
.apply-outline-btn { margin-top: 8px; }

/* Midnight Navy Presentation Stage Viewer */
.deck-panel { margin-bottom: 14px; }
.deck-toolbar { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 8px; }
.deck-source { color: var(--muted); font-size: 0.83rem; font-weight: 680; }
.deck-toolbar-actions { display: flex; gap: 6px; align-items: center; }

.deck-viewer {
  margin: 0; border-radius: 15px; overflow: hidden;
  border: 1px solid rgba(19, 28, 46, 0.2);
  background: var(--stage-bg);
  box-shadow: var(--shadow-stage);
}
.deck-image { display: block; width: 100%; height: auto; background: #fff; }
.deck-text {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  min-height: clamp(200px, 26vw, 275px);
  padding: clamp(20px, 3vw, 32px) clamp(20px, 3.2vw, 34px);
  background:
    radial-gradient(340px 230px at 96% 8%, rgba(75, 130, 232, 0.22), transparent 70%),
    radial-gradient(240px 180px at 4% 96%, rgba(217, 75, 43, 0.14), transparent 70%),
    linear-gradient(155deg, var(--stage-bg), var(--stage-bg-2));
  border-top: 4px solid #4b82e8;
  color: #f4f6fb;
  overflow-wrap: anywhere;
}
.deck-text.anim-next { animation: slideNext 0.34s var(--ease-spring) both; }
.deck-text.anim-prev { animation: slidePrev 0.34s var(--ease-spring) both; }

.slide-badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; margin-bottom: 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12); color: #a9c6ff;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em;
}
.deck-text h3 {
  margin: 0; max-width: 100%; color: #ffffff;
  font-size: clamp(1.16rem, 1.9vw, 1.52rem); line-height: 1.32; font-weight: 780; letter-spacing: -0.015em;
}
.deck-text ul {
  margin: 12px 0 0; padding-left: 1.25em; line-height: 1.68;
  font-size: 0.92rem; color: rgba(240, 244, 252, 0.90);
}
.deck-text li + li { margin-top: 4px; }

.deck-controls {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: #f5f7fb; border-top: 1px solid rgba(22, 31, 46, 0.08);
}
.deck-count { text-align: center; color: var(--muted); font-size: 0.83rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.deck-controls button:disabled { cursor: default; }

.todo-tag {
  display: inline-block; padding: 1px 7px; margin-inline: 2px; border-radius: 6px;
  background: rgba(255, 206, 122, 0.2); border: 1px solid rgba(255, 206, 122, 0.45);
  color: #ffe0a3; font-size: 0.86em; font-weight: 650;
}

/* Slide Coach Card (Compact, right under slide) */
.slide-coach {
  margin-top: 10px; padding: 11px 13px;
  border: 1px solid rgba(34, 71, 138, 0.16); border-radius: 12px;
  background: linear-gradient(180deg, #f5f8fe, #fbfcff);
}
.slide-coach-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.slide-coach-top .small-heading { margin: 0; color: var(--accent); }
.slide-coach-body { margin-top: 8px; display: grid; gap: 7px; }
.coach-row { margin: 0; display: flex; align-items: baseline; gap: 8px; font-size: 0.86rem; line-height: 1.5; }
.coach-row strong { flex: 0 0 4.2rem; color: var(--accent-deep); font-size: 0.79rem; font-weight: 740; }
.cue-list { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 5px; }
.cue-list li {
  padding: 2px 9px; border-radius: 999px;
  background: var(--accent-tint); border: 1px solid rgba(34, 71, 138, 0.2);
  color: var(--accent-deep); font-size: 0.8rem; font-weight: 680;
  animation: badgePop 0.3s var(--ease-spring) both;
}
.cue-list li:nth-child(2) { animation-delay: 0.04s; }
.cue-list li:nth-child(3) { animation-delay: 0.08s; }
.coach-missing { color: var(--amber-ink); }
.coach-missing strong { color: var(--amber-ink); }

.rationale-block { margin-top: 9px; }
.rationale-block h4 { margin: 0 0 4px; font-size: 0.84rem; color: var(--accent-deep); }
.missing-list { margin: 4px 0 0; padding-left: 1.3em; color: var(--amber-ink); font-size: 0.85rem; line-height: 1.55; }

.slide-manage-bar {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px;
  padding-bottom: 10px; border-bottom: 1px dashed var(--line-strong);
}

.inset-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.source-pill {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
  font-size: 0.74rem; font-weight: 700; background: #eceae4; color: #4a5568;
}
.source-pill[data-source="ai"] { background: #e1ecfc; color: var(--accent-deep); }

/* Settings Dialog */
.settings-dialog {
  width: min(490px, calc(100% - 28px)); padding: 0;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 28px 64px -18px rgba(13, 22, 42, 0.35);
}
.settings-dialog[open] { animation: dialogIn 0.28s var(--ease-spring) both; }
.settings-dialog::backdrop { background: rgba(15, 23, 42, 0.44); backdrop-filter: blur(4px); }
.settings-dialog form { padding: 20px 22px; display: grid; gap: 11px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dialog-head h2 { margin: 0; font-size: 1.12rem; color: var(--accent-deep); }
.settings-dialog select, .settings-dialog input[type="password"] {
  width: 100%; min-height: 39px; border-radius: 9px;
  border: 1px solid var(--line-strong); padding: 7px 11px; color: var(--ink); background: #fff; font: inherit;
}
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.dialog-tip { font-size: 0.8rem; border-top: 1px solid var(--line); padding-top: 9px; margin-top: 2px; }
.dialog-tip code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86em; background: #eef1f7; padding: 1px 4px; border-radius: 4px; }

/* Keyframe Animations */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes stageEnter {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes slideNext {
  from { opacity: 0.3; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slidePrev {
  from { opacity: 0.3; transform: translateX(-18px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes badgePop {
  from { opacity: 0; transform: scale(0.92) translateY(4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes eqBounce {
  from { transform: scaleY(0.35); }
  to { transform: scaleY(1.25); }
}
@keyframes recordPulse {
  from { transform: scale(0.8); opacity: 0.9; }
  to { transform: scale(1.9); opacity: 0; }
}
@keyframes dialogIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Responsive Breakpoints */
@media (max-width: 1120px) {
  body[data-mode="ppt"][data-has-deck="true"] .layout {
    grid-template-columns: 152px minmax(0, 1fr);
    gap: 14px;
  }
}

@media (max-width: 900px) {
  body[data-mode="ppt"][data-has-deck="true"] .practice-stage {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  body[data-mode="ppt"][data-has-deck="true"] .deck-panel { position: static; }
  .import-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 820px) {
  .shell { width: calc(100% - 32px); }
  .layout, body[data-mode="ppt"][data-has-deck="true"] .layout {
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 14px;
  }
  .workbench-body { padding: 15px; }
  .steps { padding-inline: 15px; }
  .scenario-button { gap: 7px; padding: 8px; }
}

@media (max-width: 640px) {
  .shell { width: calc(100% - 24px); }
  .masthead-inner { min-height: 52px; gap: 8px; }
  .brand { gap: 7px; }
  .brand-caption { display: none; }
  .brand-mark { width: 28px; height: 28px; }
  .page-intro { padding: 14px 0 10px; gap: 4px; }
  .page-intro p { font-size: 0.88rem; }
  .layout, body[data-mode="ppt"][data-has-deck="true"] .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .sidebar { position: static; }
  .practice-modes { margin-bottom: 8px; }
  .material-fields { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .scenario-list { display: flex; overflow-x: auto; gap: 6px; max-height: none; padding: 0 0 4px; -webkit-overflow-scrolling: touch; }
  .scenario-button { flex: 0 0 auto; justify-content: center; padding: 7px 11px; min-height: 36px; white-space: nowrap; }
  .scenario-icon, .scenario-text small, .structure { display: none; }
  .scenario-text strong { font-size: 0.84rem; }
  .small-heading { margin-bottom: 5px; }
  .workbench { border-radius: 15px; }
  .workbench-body { padding: 12px; }
  .steps { gap: 8px 12px; padding: 9px 12px; flex-wrap: wrap; }
  .steps li { gap: 5px; font-size: 0.8rem; }
  .notes { grid-template-columns: minmax(0, 1fr); gap: 5px; margin-bottom: 11px; }
  .notes li { padding: 6px 9px; }
  .record-message { gap: 8px; }
  .wave { flex-basis: 48px; width: 48px; height: 36px; gap: 2px; }
  .recorder { padding: 10px; gap: 8px; }
  .record-actions { gap: 7px; }
  .inset { padding: 11px 12px; }
  .compare { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
