@font-face {
  font-family: "Inter";
  src: url("/fonts/InterVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #111111;
  --muted: #6d6d6d;
  --line: #d9d9d6;
  --paper: #ffffff;
  --wash: #f4f4f1;
  --soft: #fafaf8;
  --red: #e4002b;
  --red-dark: #bd0024;
  --green: #176a4c;
  --focus: #1d5cff;
  --shadow: 0 18px 50px rgba(17, 17, 17, .16);
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--paper); color: var(--ink); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
button:disabled { cursor: wait; opacity: .5; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { min-height: 82px; border-bottom: 2px solid var(--ink); display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 17px 28px 13px; }
.brand { color: inherit; text-decoration: none; display: inline-flex; flex-direction: column; gap: 4px; min-width: 0; }
.brand-name { font-size: 22px; line-height: 1; font-weight: 700; letter-spacing: -.045em; white-space: nowrap; }
.brand-dot { color: var(--red); }
.brand-subtitle { color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.demo-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; letter-spacing: .075em; text-transform: uppercase; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--muted); }
.demo-status.ready .status-dot { background: var(--green); }
.demo-status.ready .status-label { color: var(--ink); }
.demo-status.warn .status-dot { background: var(--red); }
.text-button { border: 0; border-bottom: 1px solid var(--ink); background: transparent; padding: 2px 0; font-size: 12px; }
.grade-mark { color: var(--red); font-size: 56px; font-weight: 700; letter-spacing: -.08em; line-height: .75; }

.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: 272px minmax(0, 1fr) 304px; }
.left-rail { border-right: 1px solid var(--ink); min-width: 0; overflow: auto; }
.curriculum-nav { display: flex; flex-direction: column; border-bottom: 2px solid var(--ink); }
.curriculum-tab { width: 100%; display: block; border: 0; border-bottom: 1px solid var(--line); background: var(--paper); padding: 15px 22px 14px; text-align: left; }
.curriculum-tab:last-child { border-bottom: 0; }
.curriculum-tab strong { display: block; font-size: 14px; line-height: 1.15; }
.curriculum-tab span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.25; }
.curriculum-tab.is-active { background: var(--ink); color: var(--paper); }
.curriculum-tab.is-active span { color: #bdbdbd; }
.unit-nav-heading { display: flex; justify-content: space-between; align-items: center; padding: 17px 22px 9px; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; line-height: 1.2; text-transform: uppercase; }
.eyebrow.accent { color: var(--red); }
.unit-count { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.units-nav { display: flex; flex-direction: column; }
.unit-tab { border: 0; border-left: 3px solid transparent; border-bottom: 1px solid var(--line); background: var(--paper); padding: 12px 18px 13px; text-align: left; }
.unit-tab .unit-number { display: block; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.unit-tab .unit-name { display: block; margin-top: 3px; font-size: 14px; font-weight: 700; line-height: 1.2; }
.unit-tab .unit-short-tag { display: block; overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.unit-tab.is-active { border-left-color: var(--red); background: var(--soft); }
.unit-tab.is-active .unit-number { color: var(--red); }

.conversation-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.conversation-header { flex: 0 0 auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); padding: 25px 34px 20px; }
.conversation-heading { min-width: 0; }
.heading-rule { display: inline-block; width: 42px; height: 2px; margin: 0 0 3px 8px; background: var(--red); vertical-align: middle; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 650px; margin: 11px 0 5px; font-size: clamp(28px, 3vw, 47px); font-weight: 700; letter-spacing: -.065em; line-height: .98; }
.unit-tag { max-width: 700px; margin: 0; color: var(--muted); font-size: 12px; }
.coach-lockup { flex: 0 0 auto; min-width: 118px; border-left: 2px solid var(--red); padding-left: 12px; text-align: left; }
.coach-label, .coach-meta { display: block; color: var(--muted); font-size: 10px; line-height: 1.3; }
.coach-lockup strong { display: block; margin: 3px 0 2px; font-size: 18px; letter-spacing: -.04em; }
.mobile-session-strip { display: none; }
.transcript { flex: 1 1 auto; min-height: 160px; overflow-y: auto; overscroll-behavior: contain; padding: 28px 34px 26px; scroll-behavior: smooth; }
.transcript-empty { display: grid; place-items: center; height: 100%; min-height: 180px; color: var(--muted); font-size: 13px; text-align: center; }
.message { display: flex; flex-direction: column; max-width: min(690px, 90%); margin-bottom: 23px; animation: rise-in .24s ease-out both; }
.message.is-user { align-items: flex-end; margin-left: auto; }
.message-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.message.is-user .message-meta { justify-content: flex-end; }
.message.is-max .message-meta { color: var(--red); }
.message-bubble { font-size: 16px; line-height: 1.48; }
.message.is-user .message-bubble { background: var(--ink); color: var(--paper); padding: 11px 14px; }
.message.is-max .message-bubble { max-width: 650px; }
.message-actions { display: flex; align-items: center; gap: 9px; margin-top: 6px; }
.listen-button { border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 0 0 1px; color: var(--muted); font-size: 11px; }
.message-provider { color: var(--muted); font-size: 10px; }
.better-note { align-self: flex-end; width: min(620px, 88%); margin: -8px 0 25px auto; border-left: 3px solid var(--red); padding: 4px 0 4px 12px; }
.better-label { color: var(--red); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.better-text { margin-top: 2px; font-size: 14px; line-height: 1.4; }
.better-why { margin-top: 3px; color: var(--muted); font-size: 12px; }
.target-note { align-self: flex-end; margin: -11px 0 22px auto; color: var(--green); font-size: 11px; font-weight: 700; }
.target-note::before { content: "✓ "; }
.hint-note { width: min(540px, 86%); margin: 2px 0 25px; border-left: 2px solid var(--line); padding: 5px 0 5px 12px; color: var(--muted); font-size: 13px; }
.hint-note strong { color: var(--ink); }
.inline-error { width: min(620px, 90%); margin: -5px 0 21px; border: 1px solid #e8a9b5; background: #fff7f8; padding: 10px 12px; color: #8b172c; font-size: 13px; }
.inline-error button { margin-left: 8px; border: 0; border-bottom: 1px solid currentColor; background: transparent; padding: 0; font-size: 12px; font-weight: 700; }
.pending-line { display: flex; align-items: center; gap: 8px; margin: -7px 0 24px; color: var(--muted); font-size: 12px; }
.pending-spinner { width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: spin .75s linear infinite; }
.task-card { width: min(620px, 94%); margin: 3px 0 26px; border: 2px solid var(--ink); padding: 16px 17px 17px; }
.task-card h2 { margin: 6px 0 7px; font-size: 22px; letter-spacing: -.04em; line-height: 1.05; }
.task-card p { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.task-card ul { margin: 0; padding-left: 19px; font-size: 14px; }
.task-card li + li { margin-top: 4px; }
.task-card-footer { display: flex; align-items: center; gap: 15px; margin-top: 16px; }
.task-timer { min-width: 70px; font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.06em; }
.task-timer-label { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .09em; }
.task-card.is-speaking { background: var(--ink); color: var(--paper); }
.task-card.is-speaking p, .task-card.is-speaking .task-timer-label { color: #b9b9b9; }

.composer-wrap { flex: 0 0 auto; border-top: 2px solid var(--ink); padding: 0 34px env(safe-area-inset-bottom); background: var(--paper); }
.composer-status { min-height: 0; color: var(--muted); font-size: 12px; }
.composer-status:not(:empty) { padding: 9px 0 0; }
.composer { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; align-items: stretch; min-height: 63px; }
.mic-button, .secondary-button, .send-button { border: 0; background: transparent; }
.mic-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-right: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; }
.mic-glyph { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1px solid currentColor; border-radius: 50%; font-size: 9px; line-height: 1; }
.mic-button.is-recording { background: var(--red); color: var(--paper); }
.mic-button.is-recording .mic-glyph { border-color: currentColor; }
#messageInput { width: 100%; min-height: 63px; max-height: 160px; resize: none; border: 0; outline: 0; background: transparent; padding: 18px 14px 12px; font-size: 16px; line-height: 1.4; }
#messageInput::placeholder { color: #9a9a97; }
.composer-actions { display: flex; align-items: stretch; }
.secondary-button, .send-button { min-width: 76px; padding: 0 15px; font-size: 12px; font-weight: 700; }
.secondary-button { border-left: 1px solid var(--line); }
.send-button { background: var(--red); color: var(--paper); }
.send-button:hover, .send-button:focus-visible { background: var(--red-dark); }
.composer-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; border-top: 1px solid var(--line); padding: 8px 0 10px; color: var(--muted); font-size: 11px; }
.level-control { display: inline-flex; align-items: center; gap: 6px; }
.level-control select { border: 0; border-bottom: 1px solid var(--line); background: var(--paper); padding: 0 1px 2px; color: var(--ink); font-size: 11px; }
.auto-read-control { display: inline-flex; align-items: center; gap: 5px; }
.auto-read-control input { accent-color: var(--red); }
.speech-note { margin-left: auto; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid var(--line); padding: 9px 0 11px; }
.end-button { border: 0; border-bottom: 1px solid var(--ink); background: transparent; padding: 1px 0; font-size: 12px; font-weight: 700; }
.footer-note { color: var(--muted); font-size: 10px; }

.mission-panel { min-width: 0; border-left: 1px solid var(--ink); background: var(--wash); }
.mission-panel details { height: 100%; }
.mission-panel summary { list-style: none; padding: 24px 22px 0; cursor: default; }
.mission-panel summary::-webkit-details-marker { display: none; }
.mission-panel summary .eyebrow { display: block; }
.mission-summary-text { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }
.details-chevron { display: none; }
.mission-content { padding: 0 22px 22px; }
.mission-goal { margin: 10px 0 16px; font-size: 21px; font-weight: 700; letter-spacing: -.045em; line-height: 1.1; }
.alignment-block { border-left: 3px solid var(--red); padding: 2px 0 2px 10px; font-size: 12px; line-height: 1.4; }
.alignment-block strong { display: block; margin-bottom: 3px; font-size: 11px; }
.mission-section { margin-top: 26px; }
.vocab-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.vocab-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--ink); background: var(--paper); padding: 4px 7px; font-size: 12px; line-height: 1.2; }
.vocab-chip.is-used { border-color: var(--green); background: #eef8f2; color: var(--green); }
.vocab-mark { font-weight: 700; }
.vocab-help { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.stat-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 7px 0; font-size: 13px; }
.stat-row:first-of-type { margin-top: 8px; border-top: 2px solid var(--ink); }
.stat-row strong { font-size: 23px; letter-spacing: -.05em; }
.outline-button { width: 100%; border: 1px solid var(--ink); background: transparent; padding: 10px 12px; font-size: 12px; font-weight: 700; }
.outline-button:hover, .outline-button:focus-visible { background: var(--ink); color: var(--paper); }
.mission-end { margin-top: 24px; }
.pilot-note { margin: 15px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(17, 17, 17, .62); padding: 22px; }
.modal-sheet { width: min(620px, 100%); max-height: min(88dvh, 740px); overflow: auto; border-top: 7px solid var(--red); background: var(--paper); box-shadow: var(--shadow); padding: 25px 28px 30px; }
.modal-topline { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.icon-button { width: 32px; height: 32px; border: 1px solid var(--ink); background: transparent; font-size: 24px; line-height: 1; }
.feedback-sheet h2, .about-sheet h2 { margin: 9px 0 5px; font-size: clamp(27px, 4vw, 40px); letter-spacing: -.06em; line-height: .98; }
.feedback-sheet h2 em, .about-sheet h2 em { color: var(--red); font-style: normal; }
.modal-subtitle { color: var(--muted); font-size: 12px; }
.feedback-metrics { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); margin: 20px 0 22px; }
.metric { padding: 9px 0; }
.metric + .metric { border-left: 1px solid var(--line); padding-left: 12px; }
.metric-label { display: block; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.metric-value { display: block; margin-top: 2px; font-size: 28px; font-weight: 700; letter-spacing: -.06em; }
.feedback-section { margin-top: 20px; }
.feedback-section h3, .about-sheet h3 { margin: 0 0 7px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.feedback-summary { font-size: 15px; }
.feedback-rubric { width: 100%; border-collapse: collapse; font-size: 13px; }
.feedback-rubric td { border-bottom: 1px solid var(--line); padding: 8px 0; vertical-align: top; }
.feedback-rubric td:last-child { width: 34%; padding-left: 12px; text-align: right; font-weight: 700; }
.feedback-rubric small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 400; text-align: left; }
.feedback-advice { border-left: 3px solid var(--red); padding-left: 11px; font-size: 14px; }
.feedback-review { margin: 0; padding: 0; list-style: none; }
.feedback-review li { border-bottom: 1px solid var(--line); padding: 9px 0; font-size: 13px; }
.review-original { color: var(--muted); text-decoration: line-through; }
.review-better { display: block; margin-top: 2px; font-weight: 700; }
.review-explanation { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.feedback-disclaimer { margin: 23px 0 0; color: var(--muted); font-size: 11px; }
.feedback-close { margin-top: 22px; }
.about-sheet p { max-width: 540px; font-size: 15px; }
.about-rule { height: 1px; margin: 24px 0; background: var(--line); }
.about-sheet h3 { margin-top: 23px; }
.plain-list { margin: 0; padding-left: 18px; font-size: 13px; }
.plain-list li + li { margin-top: 9px; }
.muted { color: var(--muted); }

@keyframes rise-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1080px) and (min-width: 1025px) {
  .workspace { grid-template-columns: 228px minmax(0, 1fr) 260px; }
  .conversation-header, .transcript, .composer-wrap { padding-left: 24px; padding-right: 24px; }
  .mission-content, .mission-panel summary { padding-left: 18px; padding-right: 18px; }
  .mission-goal { font-size: 18px; }
  .coach-lockup { display: none; }
}

@media (max-width: 1024px) {
  .app-shell { height: 100dvh; min-height: 0; overflow: hidden; }
  .topbar { min-height: 68px; align-items: center; padding: 13px 16px 11px; }
  .brand-name { font-size: 19px; }
  .brand-subtitle { font-size: 9px; letter-spacing: .045em; }
  .topbar-right { gap: 12px; }
  .topbar-right .text-button { display: none; }
  .demo-status { font-size: 9px; }
  .grade-mark { font-size: 38px; }
  .workspace { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  .left-rail { display: contents; }
  .curriculum-nav { order: 1; flex-shrink: 0; display: flex; flex-direction: row; overflow-x: auto; border-bottom: 1px solid var(--ink); scrollbar-width: none; }
  .curriculum-nav::-webkit-scrollbar, .units-nav::-webkit-scrollbar { display: none; }
  .curriculum-tab { flex: 0 0 auto; width: auto; min-width: 147px; border-right: 1px solid var(--line); border-bottom: 0; padding: 11px 14px 10px; }
  .curriculum-tab strong { font-size: 12px; }
  .curriculum-tab span { font-size: 10px; }
  .unit-nav-heading { display: none; }
  .units-nav { order: 3; flex-shrink: 0; display: flex; flex-direction: row; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .unit-tab { flex: 0 0 auto; min-width: 180px; border: 0; border-right: 1px solid var(--line); border-bottom: 3px solid transparent; padding: 9px 14px 10px; }
  .unit-tab.is-active { border-left: 0; border-bottom-color: var(--red); }
  .unit-tab .unit-short-tag { display: none; }
  .conversation-panel { order: 5; flex: 1; min-height: 0; }
  .conversation-header { padding: 14px 16px 12px; }
  .conversation-header .eyebrow { font-size: 9px; }
  h1 { margin-top: 8px; font-size: clamp(27px, 8.5vw, 40px); }
  .unit-tag { font-size: 11px; }
  .coach-lockup { display: none; }
  .mobile-session-strip { display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); padding: 8px 16px; color: var(--muted); font-size: 10px; }
  .strip-divider { width: 3px; height: 3px; border-radius: 50%; background: var(--red); }
  .transcript { flex: 1 1 0; min-height: 50px; max-height: none; padding: 20px 16px 17px; }
  .message { max-width: 95%; margin-bottom: 19px; }
  .message-bubble { font-size: 15px; }
  .better-note { width: 93%; margin-bottom: 20px; }
  .task-card { width: 100%; }
  .composer-wrap { padding: 0 16px env(safe-area-inset-bottom); }
  .composer { grid-template-columns: 42px minmax(0, 1fr) 108px; min-height: 58px; }
  .mic-button { font-size: 0; }
  .mic-button .mic-glyph { font-size: 8px; }
  #messageInput { min-height: 58px; padding: 15px 10px; font-size: 16px; }
  .composer-actions { display: flex; min-height: 44px; }
  .secondary-button, .send-button { min-width: 0; padding: 0 10px; min-height: 44px; }
  .speech-note { display: none; }
  .composer-tools { gap: 8px; font-size: 10px; }
  .composer-footer { padding-bottom: 10px; }
  .footer-note { max-width: 170px; text-align: right; }
  .mission-panel { order: 4; flex-shrink: 0; max-height: 38dvh; overflow: auto; border-top: 1px solid var(--ink); border-left: 0; }
  .mission-panel details { height: auto; }
  .mission-panel summary { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 13px 16px; cursor: pointer; }
  .mission-panel summary .eyebrow { color: var(--red); }
  .mission-summary-text { overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; }
  .details-chevron { display: block; font-size: 19px; line-height: .8; }
  .mission-panel details[open] .details-chevron { transform: rotate(180deg); }
  .mission-content { padding: 0 16px 22px; }
  .mission-goal { margin-top: 0; font-size: 20px; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal-sheet { max-height: 92dvh; border-top-width: 6px; padding: 19px 16px calc(22px + env(safe-area-inset-bottom)); }
  .feedback-metrics { margin-top: 17px; }
  .metric-value { font-size: 24px; }
}

@media (max-width: 480px) {
  .topbar .demo-status { display: none; }
  .topbar { gap: 10px; }
  .grade-mark { font-size: 40px; }
}

/* Viewport is the application frame: internal work areas own any necessary scrolling. */
.app-shell { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.topbar { flex: 0 0 70px; min-height: 70px; align-items: center; padding-top: 10px; padding-bottom: 10px; }
.workspace { grid-template-rows: minmax(0, 1fr); min-height: 0; overflow: hidden; }
.left-rail, .conversation-panel, .mission-panel { min-height: 0; }
.transcript { min-height: 0; }
.mission-panel { overflow-y: auto; overscroll-behavior: contain; }
.mission-panel details { height: auto; min-height: 100%; }
.mobile-selectors, .mission-preview { display: none; }
.mission-close-hint { display: none; }

@media (min-width: 1025px) and (max-height: 820px) {
  .topbar { flex-basis: 62px; min-height: 62px; padding-top: 8px; padding-bottom: 8px; }
  .curriculum-tab { padding-top: 11px; padding-bottom: 10px; }
  .unit-nav-heading { padding-top: 12px; }
  .unit-tab { padding-top: 9px; padding-bottom: 9px; }
  .conversation-header { padding-top: 17px; padding-bottom: 13px; }
  h1 { margin-top: 8px; font-size: clamp(29px, 2.8vw, 39px); }
  .transcript { padding-top: 18px; padding-bottom: 16px; }
  .composer { min-height: 56px; }
  #messageInput { min-height: 56px; padding-top: 14px; }
  .composer-tools { padding-top: 6px; padding-bottom: 7px; }
  .composer-footer { padding-top: 6px; padding-bottom: 7px; }
  .mission-panel summary { padding-top: 16px; }
  .mission-content { padding-bottom: 14px; }
  .mission-goal { margin-top: 7px; margin-bottom: 10px; font-size: 18px; }
  .mission-section { margin-top: 18px; }
  .stat-row { padding-top: 5px; padding-bottom: 5px; }
  .mission-end { margin-top: 15px; }
  .pilot-note { margin-top: 9px; }
}

@media (max-width: 1024px) {
  .app-shell { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  .topbar { flex: 0 0 calc(54px + env(safe-area-inset-top)); min-height: calc(54px + env(safe-area-inset-top)); align-items: center; padding: calc(7px + env(safe-area-inset-top)) 14px 7px; }
  .brand-name { font-size: 18px; }
  .brand-subtitle { font-size: 8px; }
  .grade-mark { font-size: 36px; }
  .topbar-right { gap: 10px; }
  .topbar-right .text-button { display: none; }
  .left-rail { display: none; }
  .workspace { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; overflow: hidden; }
  .mobile-selectors { order: 1; display: grid; flex: 0 0 48px; grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr); gap: 12px; align-items: center; padding: 4px 14px; border-bottom: 1px solid var(--line); background: var(--paper); }
  .mobile-selectors label { display: grid; min-width: 0; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 7px; }
  .mobile-selectors label > span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
  .mobile-selectors select { width: 100%; min-width: 0; height: 34px; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; background: var(--paper); padding: 3px 16px 3px 2px; font-size: 12px; font-weight: 700; }

  .mission-panel { order: 2; position: relative; z-index: auto; flex: 0 0 auto; max-height: none; overflow: visible; border-top: 0; border-right: 0; border-bottom: 1px solid var(--line); border-left: 0; background: var(--wash); }
  .mission-preview { display: block; padding: 8px 14px 9px; }
  .mission-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .mission-preview-heading .text-button { padding: 3px 0; font-size: 11px; }
  .mission-preview-goal { display: block; margin: 4px 0 6px; font-size: 13px; font-weight: 600; line-height: 1.3; }
  .mission-preview .vocab-list { display: flex; flex-wrap: wrap; gap: 4px 5px; margin: 0; }
  .mission-preview .vocab-chip { flex: 0 0 auto; padding: 3px 6px; font-size: 11px; white-space: nowrap; }
  .mission-preview .vocab-more { border: 0; background: transparent; padding: 3px 1px; color: var(--muted); font-size: 10px; white-space: nowrap; }
  .mission-panel details:not([open]) { display: none; }
  .mission-panel details[open] { display: flex; height: 100%; min-height: 0; flex-direction: column; }
  .mission-panel.is-open { position: fixed; z-index: 51; inset: auto 0 0; display: block; height: min(74dvh, 560px); max-height: calc(100dvh - env(safe-area-inset-top) - 16px); overflow: hidden; border-top: 3px solid var(--ink); background: var(--wash); }
  .mission-panel.is-open .mission-preview { display: none; }
  .mission-panel.is-open details { height: 100%; min-height: 0; }
  .mission-panel.is-open summary { display: grid; flex: 0 0 auto; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 12px 15px; border-bottom: 1px solid var(--line); cursor: pointer; }
  .mission-panel.is-open summary .eyebrow { color: var(--red); }
  .mission-panel.is-open .mission-summary-text { overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; }
  .mission-panel.is-open .details-chevron { display: none; }
  .mission-close-hint { display: inline; color: var(--muted); font-size: 11px; white-space: nowrap; }
  .mission-panel.is-open .mission-content { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 11px 15px calc(18px + env(safe-area-inset-bottom)); }
  .mission-panel.is-open .mission-goal { margin-top: 0; font-size: 19px; }
  .mission-panel.is-open .mission-section { margin-top: 17px; }
  .mission-panel.is-open .mission-end { margin-top: 17px; }
  .mission-scrim:not([hidden]) { position: fixed; z-index: 50; inset: 0; display: block; width: 100%; height: 100%; border: 0; background: rgba(17, 17, 17, .36); }

  .conversation-panel { order: 3; display: flex; flex: 1 1 0; width: 100%; min-height: 0; flex-direction: column; }
  .conversation-header { flex: 0 0 auto; padding: 8px 14px 7px; }
  .conversation-heading > .eyebrow { display: none; }
  h1 { max-width: 100%; margin: 0 0 2px; font-size: clamp(21px, 5.8vw, 27px); line-height: 1.04; }
  .unit-tag { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .coach-lockup { display: none; }
  .mobile-session-strip { flex: 0 0 auto; min-height: 25px; padding: 5px 14px; font-size: 10px; }
  .transcript { flex: 1 1 0; min-height: 0; max-height: none; overflow-y: auto; padding: 13px 14px 12px; scroll-behavior: auto; }
  .message { max-width: 96%; margin-bottom: 15px; }
  .message-bubble { font-size: 15px; }
  .better-note { width: 95%; margin-bottom: 15px; }
  .hint-note { width: 96%; margin-bottom: 16px; }
  .composer-wrap { flex: 0 0 auto; padding: 0 12px env(safe-area-inset-bottom); }
  .composer-status:not(:empty) { padding-top: 5px; }
  .composer { grid-template-columns: 38px minmax(0, 1fr) 104px; min-height: 50px; }
  .mic-button { font-size: 0; }
  .mic-button .mic-glyph { font-size: 8px; }
  #messageInput { min-height: 50px; max-height: 90px; padding: 11px 8px; font-size: 16px; }
  .composer-actions { display: flex; min-height: 42px; }
  .secondary-button, .send-button { min-width: 0; min-height: 42px; padding: 0 8px; }
  .secondary-button { flex: 0 0 44px; }
  .send-button { flex: 1 1 auto; white-space: nowrap; }
  .composer-tools { gap: 4px 10px; padding: 5px 0; font-size: 10px; line-height: 1.25; }
  .speech-note { display: none; }
  .composer-footer { min-height: 32px; gap: 8px; padding: 4px 0 6px; }
  .composer-footer .text-button { min-height: 26px; padding: 2px 0; font-size: 11px; }
  .end-button { font-size: 11px; }
  .footer-note { max-width: none; font-size: 10px; white-space: nowrap; }
  .modal-backdrop { z-index: 60; }
  .modal-sheet { max-height: calc(92dvh - env(safe-area-inset-top)); }
}

@media (max-width: 480px) {
  .topbar .demo-status { display: none; }
  .topbar { gap: 9px; }
  .grade-mark { font-size: 36px; }
  .mobile-selectors { gap: 8px; padding-right: 11px; padding-left: 11px; }
  .mobile-selectors label { gap: 5px; }
  .mobile-selectors label > span { font-size: 8px; letter-spacing: .04em; }
  .mobile-selectors select { font-size: 11px; }
}

@media (max-width: 360px) {
  .mobile-selectors { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 7px; }
  .mobile-selectors label { display: block; }
  .mobile-selectors label > span { display: none; }
  .mobile-selectors select { height: 34px; }
  .mission-preview { padding-right: 11px; padding-left: 11px; }
  .mission-preview-goal { font-size: 12px; }
  .composer { grid-template-columns: 34px minmax(0, 1fr) 96px; }
  .composer-tools { gap: 4px 7px; }
  .auto-read-control { font-size: 9px; }
  .footer-note { font-size: 9px; }
}

/* Landscape is a split practice surface, not a crushed portrait stack. */
@media (min-width: 600px) and (max-width: 1024px) and (max-height: 500px) {
  .workspace { display: grid; grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: 44px minmax(0, 1fr); }
  .mobile-selectors { grid-column: 1 / -1; grid-row: 1; padding-top: 1px; padding-bottom: 1px; }
  .mission-panel:not(.is-open) { grid-column: 1; grid-row: 2; height: 100%; min-height: 0; overflow-y: auto; border-right: 1px solid var(--ink); }
  .conversation-panel { grid-column: 2; grid-row: 2; height: 100%; }
  .mission-preview .vocab-list { gap: 5px; }
  .conversation-header { padding-top: 7px; padding-bottom: 5px; }
  h1 { font-size: 22px; }
  .composer-tools { padding-top: 3px; padding-bottom: 3px; }
}

@media (max-width: 1024px) {
  .app-shell { height: var(--app-height, 100dvh); }
  .app-shell.keyboard-open .topbar { flex-basis: calc(40px + env(safe-area-inset-top)); min-height: calc(40px + env(safe-area-inset-top)); padding-top: calc(5px + env(safe-area-inset-top)); padding-bottom: 5px; }
  .app-shell.keyboard-open .brand-subtitle { display: none; }
  .app-shell.keyboard-open .grade-mark { font-size: 28px; }
  .app-shell.keyboard-open .mobile-selectors { display: none; }
  .app-shell.keyboard-open .mission-preview { padding-top: 4px; padding-bottom: 5px; }
  .app-shell.keyboard-open .mission-preview-goal { margin-top: 3px; margin-bottom: 4px; font-size: 11px; }
  .app-shell.keyboard-open .mission-preview .vocab-list { flex-wrap: nowrap; overflow-x: auto; }
  .app-shell.keyboard-open .conversation-header { padding-top: 4px; padding-bottom: 4px; }
  .app-shell.keyboard-open .unit-tag { display: none; }
  .app-shell.keyboard-open h1 { font-size: 20px; }
  .app-shell.keyboard-open #messageInput { max-height: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
