/* Generated from DESIGN.md. Run scripts/generate_design_tokens.py after token changes. */
:root {
  --color-primary: #4F46E5;
  --color-primary-hover: #4338CA;
  --color-primary-soft: #EEF2FF;
  --color-primary-subtle: #F5F3FF;
  --color-accent-speaking: #6366F1;
  --color-accent-listening: #2563EB;
  --color-accent-thinking: #8B5CF6;
  --color-accent-speaking-ai: #7C3AED;
  --color-canvas: #F7F8FC;
  --color-surface: #FFFFFF;
  --color-surface-soft: #F2F4F8;
  --color-surface-raised: #FFFFFF;
  --color-ink: #18212F;
  --color-ink-secondary: #475569;
  --color-ink-muted: #7A8597;
  --color-ink-disabled: #A8B0BD;
  --color-on-primary: #FFFFFF;
  --color-border: #E2E7EF;
  --color-border-strong: #CBD3DF;
  --color-focus-ring: #818CF8;
  --color-success: #16875D;
  --color-success-soft: #EAF8F2;
  --color-warning: #B7791F;
  --color-warning-soft: #FFF8E6;
  --color-error: #C2414B;
  --color-error-soft: #FEF0F1;
  --color-correction: #B45309;
  --color-correction-soft: #FFF7E6;
  --color-vocabulary: #0F766E;
  --color-vocabulary-soft: #ECFDF8;
  --color-transcript-student: #F2F4F8;
  --color-transcript-tutor: #EEF2FF;
  --type-display-font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  --type-display-font-size: 40px;
  --type-display-font-weight: 650;
  --type-display-line-height: 1.15;
  --type-display-letter-spacing: -0.8px;
  --type-heading-xl-font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  --type-heading-xl-font-size: 30px;
  --type-heading-xl-font-weight: 650;
  --type-heading-xl-line-height: 1.2;
  --type-heading-xl-letter-spacing: -0.5px;
  --type-heading-lg-font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  --type-heading-lg-font-size: 24px;
  --type-heading-lg-font-weight: 620;
  --type-heading-lg-line-height: 1.25;
  --type-heading-lg-letter-spacing: -0.3px;
  --type-heading-md-font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  --type-heading-md-font-size: 20px;
  --type-heading-md-font-weight: 600;
  --type-heading-md-line-height: 1.3;
  --type-heading-md-letter-spacing: -0.2px;
  --type-body-lg-font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  --type-body-lg-font-size: 18px;
  --type-body-lg-font-weight: 400;
  --type-body-lg-line-height: 1.55;
  --type-body-lg-letter-spacing: 0;
  --type-body-font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  --type-body-font-size: 16px;
  --type-body-font-weight: 400;
  --type-body-line-height: 1.5;
  --type-body-letter-spacing: 0;
  --type-body-sm-font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  --type-body-sm-font-size: 14px;
  --type-body-sm-font-weight: 400;
  --type-body-sm-line-height: 1.45;
  --type-body-sm-letter-spacing: 0;
  --type-label-font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  --type-label-font-size: 14px;
  --type-label-font-weight: 550;
  --type-label-line-height: 1.3;
  --type-label-letter-spacing: 0;
  --type-button-font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  --type-button-font-size: 15px;
  --type-button-font-weight: 600;
  --type-button-line-height: 1.2;
  --type-button-letter-spacing: 0;
  --type-caption-font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  --type-caption-font-size: 12px;
  --type-caption-font-weight: 450;
  --type-caption-line-height: 1.4;
  --type-caption-letter-spacing: 0.1px;
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-xxl: 28px;
  --radius-pill: 9999px;
  --radius-full: 9999px;
  --space-xxs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;
  --space-section: 64px;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.04);
  --shadow-raised: 0 8px 30px rgba(15, 23, 42, 0.08);
  --shadow-microphone: 0 10px 32px rgba(79, 70, 229, 0.24);
  --motion-fast: 120ms;
  --motion-normal: 180ms;
  --motion-slow: 300ms;
  --motion-easing: cubic-bezier(0.2, 0, 0, 1);
  --component-app-shell-background-color: var(--color-canvas);
  --component-app-shell-text-color: var(--color-ink);
  --component-app-shell-typography: var(--type-body-font-weight) var(--type-body-font-size)/var(--type-body-line-height) var(--type-body-font-family);
  --component-top-bar-background-color: var(--color-surface);
  --component-top-bar-border-color: var(--color-border);
  --component-top-bar-height: 64px;
  --component-button-primary-background-color: var(--color-primary);
  --component-button-primary-text-color: var(--color-on-primary);
  --component-button-primary-typography: var(--type-button-font-weight) var(--type-button-font-size)/var(--type-button-line-height) var(--type-button-font-family);
  --component-button-primary-rounded: var(--radius-md);
  --component-button-primary-padding: 12px 18px;
  --component-button-primary-hover-background-color: var(--color-primary-hover);
  --component-button-primary-hover-text-color: var(--color-on-primary);
  --component-button-primary-hover-typography: var(--type-button-font-weight) var(--type-button-font-size)/var(--type-button-line-height) var(--type-button-font-family);
  --component-button-primary-hover-rounded: var(--radius-md);
  --component-button-secondary-background-color: var(--color-surface);
  --component-button-secondary-text-color: var(--color-ink);
  --component-button-secondary-border-color: var(--color-border);
  --component-button-secondary-typography: var(--type-button-font-weight) var(--type-button-font-size)/var(--type-button-line-height) var(--type-button-font-family);
  --component-button-secondary-rounded: var(--radius-md);
  --component-button-secondary-padding: 12px 18px;
  --component-button-ghost-background-color: transparent;
  --component-button-ghost-text-color: var(--color-ink-secondary);
  --component-button-ghost-typography: var(--type-button-font-weight) var(--type-button-font-size)/var(--type-button-line-height) var(--type-button-font-family);
  --component-button-ghost-rounded: var(--radius-md);
  --component-button-ghost-padding: 10px 14px;
  --component-lesson-card-background-color: var(--color-surface);
  --component-lesson-card-text-color: var(--color-ink);
  --component-lesson-card-border-color: var(--color-border);
  --component-lesson-card-rounded: var(--radius-lg);
  --component-lesson-card-padding: 24px;
  --component-lesson-card-shadow: var(--shadow-card);
  --component-upload-zone-background-color: var(--color-surface);
  --component-upload-zone-text-color: var(--color-ink-secondary);
  --component-upload-zone-border-color: var(--color-border-strong);
  --component-upload-zone-rounded: var(--radius-xl);
  --component-upload-zone-padding: 40px;
  --component-upload-zone-active-background-color: var(--color-primary-soft);
  --component-upload-zone-active-text-color: var(--color-primary);
  --component-upload-zone-active-border-color: var(--color-primary);
  --component-upload-zone-active-rounded: var(--radius-xl);
  --component-upload-zone-active-padding: 40px;
  --component-level-selector-background-color: var(--color-surface-soft);
  --component-level-selector-text-color: var(--color-ink-secondary);
  --component-level-selector-rounded: var(--radius-pill);
  --component-level-selector-padding: 4px;
  --component-level-option-background-color: transparent;
  --component-level-option-text-color: var(--color-ink-secondary);
  --component-level-option-typography: var(--type-label-font-weight) var(--type-label-font-size)/var(--type-label-line-height) var(--type-label-font-family);
  --component-level-option-rounded: var(--radius-pill);
  --component-level-option-padding: 8px 14px;
  --component-level-option-selected-background-color: var(--color-surface);
  --component-level-option-selected-text-color: var(--color-primary);
  --component-level-option-selected-typography: var(--type-label-font-weight) var(--type-label-font-size)/var(--type-label-line-height) var(--type-label-font-family);
  --component-level-option-selected-rounded: var(--radius-pill);
  --component-level-option-selected-padding: 8px 14px;
  --component-speaking-workspace-background-color: var(--color-surface);
  --component-speaking-workspace-border-color: var(--color-border);
  --component-speaking-workspace-rounded: var(--radius-xxl);
  --component-speaking-workspace-shadow: var(--shadow-card);
  --component-speaking-workspace-padding: 32px;
  --component-tutor-message-background-color: var(--color-transcript-tutor);
  --component-tutor-message-text-color: var(--color-ink);
  --component-tutor-message-typography: var(--type-body-lg-font-weight) var(--type-body-lg-font-size)/var(--type-body-lg-line-height) var(--type-body-lg-font-family);
  --component-tutor-message-rounded: var(--radius-lg);
  --component-tutor-message-padding: 18px 20px;
  --component-student-message-background-color: var(--color-transcript-student);
  --component-student-message-text-color: var(--color-ink);
  --component-student-message-typography: var(--type-body-font-weight) var(--type-body-font-size)/var(--type-body-line-height) var(--type-body-font-family);
  --component-student-message-rounded: var(--radius-lg);
  --component-student-message-padding: 16px 18px;
  --component-correction-card-background-color: var(--color-correction-soft);
  --component-correction-card-text-color: var(--color-ink);
  --component-correction-card-border-color: #F6D79B;
  --component-correction-card-rounded: var(--radius-md);
  --component-correction-card-padding: 14px 16px;
  --component-vocabulary-chip-background-color: var(--color-vocabulary-soft);
  --component-vocabulary-chip-text-color: var(--color-vocabulary);
  --component-vocabulary-chip-typography: var(--type-label-font-weight) var(--type-label-font-size)/var(--type-label-line-height) var(--type-label-font-family);
  --component-vocabulary-chip-rounded: var(--radius-pill);
  --component-vocabulary-chip-padding: 6px 10px;
  --component-microphone-idle-background-color: var(--color-primary);
  --component-microphone-idle-text-color: var(--color-on-primary);
  --component-microphone-idle-rounded: var(--radius-full);
  --component-microphone-idle-size: 72px;
  --component-microphone-idle-shadow: var(--shadow-microphone);
  --component-microphone-listening-background-color: var(--color-accent-listening);
  --component-microphone-listening-text-color: var(--color-on-primary);
  --component-microphone-listening-rounded: var(--radius-full);
  --component-microphone-listening-size: 80px;
  --component-microphone-listening-shadow: var(--shadow-microphone);
  --component-microphone-disabled-background-color: var(--color-surface-soft);
  --component-microphone-disabled-text-color: var(--color-ink-disabled);
  --component-microphone-disabled-rounded: var(--radius-full);
  --component-microphone-disabled-size: 72px;
  --component-status-idle-background-color: var(--color-surface-soft);
  --component-status-idle-text-color: var(--color-ink-muted);
  --component-status-idle-rounded: var(--radius-pill);
  --component-status-idle-padding: 6px 10px;
  --component-status-listening-background-color: #EAF2FF;
  --component-status-listening-text-color: var(--color-accent-listening);
  --component-status-listening-rounded: var(--radius-pill);
  --component-status-listening-padding: 6px 10px;
  --component-status-transcribing-background-color: var(--color-primary-soft);
  --component-status-transcribing-text-color: var(--color-primary);
  --component-status-transcribing-rounded: var(--radius-pill);
  --component-status-transcribing-padding: 6px 10px;
  --component-status-thinking-background-color: #F3EFFF;
  --component-status-thinking-text-color: var(--color-accent-thinking);
  --component-status-thinking-rounded: var(--radius-pill);
  --component-status-thinking-padding: 6px 10px;
  --component-status-speaking-background-color: #F1ECFF;
  --component-status-speaking-text-color: var(--color-accent-speaking-ai);
  --component-status-speaking-rounded: var(--radius-pill);
  --component-status-speaking-padding: 6px 10px;
  --component-session-sidebar-background-color: var(--color-surface);
  --component-session-sidebar-border-color: var(--color-border);
  --component-session-sidebar-rounded: var(--radius-lg);
  --component-session-sidebar-padding: 20px;
  --component-lesson-context-panel-background-color: var(--color-surface-soft);
  --component-lesson-context-panel-text-color: var(--color-ink-secondary);
  --component-lesson-context-panel-rounded: var(--radius-lg);
  --component-lesson-context-panel-padding: 16px;
  --component-progress-bar-background-color: var(--color-surface-soft);
  --component-progress-bar-fill-color: var(--color-primary);
  --component-progress-bar-height: 6px;
  --component-progress-bar-rounded: var(--radius-pill);
  --component-summary-card-background-color: var(--color-surface);
  --component-summary-card-border-color: var(--color-border);
  --component-summary-card-rounded: var(--radius-lg);
  --component-summary-card-padding: 24px;
  --component-summary-card-shadow: var(--shadow-card);
  --component-success-feedback-background-color: var(--color-success-soft);
  --component-success-feedback-text-color: var(--color-success);
  --component-success-feedback-rounded: var(--radius-md);
  --component-success-feedback-padding: 12px 14px;
  --component-error-feedback-background-color: var(--color-error-soft);
  --component-error-feedback-text-color: var(--color-error);
  --component-error-feedback-rounded: var(--radius-md);
  --component-error-feedback-padding: 12px 14px;
  --component-text-practice-input-background-color: var(--color-surface);
  --component-text-practice-input-text-color: var(--color-ink);
  --component-text-practice-input-border-color: var(--color-border-strong);
  --component-text-practice-input-typography: var(--type-body-font-weight) var(--type-body-font-size)/var(--type-body-line-height) var(--type-body-font-family);
  --component-text-practice-input-rounded: var(--radius-md);
  --component-text-practice-input-padding: 12px 16px;
}
* { box-sizing: border-box; }
:root {
  font-family: var(--type-body-font-family);
  font-size: var(--type-body-font-size);
  line-height: var(--type-body-line-height);
  color: var(--color-ink);
  background: var(--color-canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1 {
  font-size: var(--type-heading-xl-font-size);
  font-weight: var(--type-heading-xl-font-weight);
  line-height: var(--type-heading-xl-line-height);
  letter-spacing: var(--type-heading-xl-letter-spacing);
}
.skip-link { position: fixed; top: var(--space-xs); left: var(--space-xs); padding: var(--space-sm); background: var(--color-surface); z-index: 1; transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }
.top-bar { background: var(--component-top-bar-background-color); border-bottom: 1px solid var(--color-border); }
.top-bar-inner { max-width: 1100px; min-height: var(--component-top-bar-height); margin: auto; padding: var(--space-sm) var(--space-lg); display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }
.brand { display: flex; align-items: center; gap: var(--space-sm); font-weight: var(--type-heading-md-font-weight); min-height: 44px; }
.brand svg { color: var(--color-primary); flex-shrink: 0; }
.preview-label { color: var(--color-ink-secondary); font-size: var(--type-body-sm-font-size); text-align: right; }
.page { width: min(100%, 1000px); margin: auto; padding: var(--space-xl) var(--space-lg); }
.page-heading { display: grid; gap: var(--space-xs); }
.eyebrow { font-size: var(--type-label-font-size); font-weight: var(--type-label-font-weight); line-height: var(--type-label-line-height); color: var(--color-ink-secondary); }
.supporting-text { color: var(--color-ink-secondary); font-size: var(--type-body-sm-font-size); line-height: var(--type-body-sm-line-height); }
.preview-note { margin: var(--space-lg) 0 var(--space-md); color: var(--color-ink-secondary); font-size: var(--type-body-sm-font-size); }
.speaking-workspace { background: var(--component-speaking-workspace-background-color); border: 1px solid var(--component-speaking-workspace-border-color); border-radius: var(--component-speaking-workspace-rounded); box-shadow: var(--component-speaking-workspace-shadow); padding: var(--component-speaking-workspace-padding); }
.tutor-prompt { display: grid; gap: var(--space-sm); max-width: 640px; margin: auto; }
.tutor-message { background: var(--component-tutor-message-background-color); color: var(--component-tutor-message-text-color); border-radius: var(--component-tutor-message-rounded); padding: var(--component-tutor-message-padding); font-size: var(--type-body-lg-font-size); line-height: var(--type-body-lg-line-height); text-align: center; }
.microphone-area { display: flex; flex-direction: column; align-items: center; gap: var(--space-sm); padding: var(--space-xl) 0; text-align: center; }
.microphone { display: grid; place-items: center; width: var(--component-microphone-disabled-size); height: var(--component-microphone-disabled-size); border: 0; border-radius: var(--component-microphone-disabled-rounded); background: var(--component-microphone-disabled-background-color); color: var(--component-microphone-disabled-text-color); flex-shrink: 0; }
.microphone-label { font-weight: var(--type-label-font-weight); }
.microphone-live { width: var(--component-microphone-idle-size); height: var(--component-microphone-idle-size); background: var(--component-microphone-idle-background-color); color: var(--component-microphone-idle-text-color); box-shadow: var(--component-microphone-idle-shadow); cursor: pointer; }
.microphone-live:disabled { background: var(--component-microphone-disabled-background-color); color: var(--component-microphone-disabled-text-color); box-shadow: none; cursor: default; }
.microphone-listening { width: var(--component-microphone-listening-size); height: var(--component-microphone-listening-size); background: var(--component-microphone-listening-background-color); animation: microphone-pulse calc(var(--motion-slow) * 6) var(--motion-easing) infinite; }
@keyframes microphone-pulse { 50% { opacity: .85; } }
@media (prefers-reduced-motion: reduce) { .microphone-listening { animation: none; } }
.transcript-placeholder { max-width: 640px; margin: auto; border-top: 1px solid var(--color-border); padding-top: var(--space-lg); display: grid; gap: var(--space-xs); color: var(--color-ink-secondary); }
.support-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--space-lg); margin-top: var(--space-lg); align-items: start; }
.conversation-history { padding: var(--space-xs) 0; color: var(--color-ink-secondary); }
.lesson-context-panel { background: var(--component-lesson-context-panel-background-color); border-radius: var(--component-lesson-context-panel-rounded); color: var(--component-lesson-context-panel-text-color); padding: var(--component-lesson-context-panel-padding); }
summary { cursor: pointer; min-height: 44px; align-content: center; font-weight: var(--type-label-font-weight); }
details p { margin-top: var(--space-xs); font-size: var(--type-body-sm-font-size); line-height: var(--type-body-sm-line-height); }
.button-primary, .button-secondary { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); min-height: 44px; border-radius: var(--component-button-primary-rounded); padding: var(--component-button-primary-padding); font-size: var(--type-button-font-size); font-weight: var(--type-button-font-weight); line-height: var(--type-button-line-height); }
.button-primary { border: 1px solid transparent; background: var(--color-primary); color: var(--color-on-primary); }
.button-primary:hover { background: var(--color-primary-hover); }
.button-secondary { border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-ink); }
.button-primary:disabled, .button-secondary:disabled { background: var(--color-surface-soft); color: var(--color-ink-secondary); border-color: var(--color-border); }
.setup-page { max-width: 760px; }
.lesson-setup { margin-top: var(--space-lg); display: grid; justify-items: start; gap: var(--space-md); }
.upload-zone { width: 100%; padding: var(--component-upload-zone-padding); border: 1px dashed var(--component-upload-zone-border-color); border-radius: var(--component-upload-zone-rounded); background: var(--component-upload-zone-background-color); color: var(--component-upload-zone-text-color); display: grid; justify-items: center; text-align: center; gap: var(--space-sm); }
.upload-zone h2, .lesson-card h2 { font-size: var(--type-heading-md-font-size); font-weight: var(--type-heading-md-font-weight); line-height: var(--type-heading-md-line-height); }
.upload-zone.is-dragging { background: var(--component-upload-zone-active-background-color); color: var(--component-upload-zone-active-text-color); border-color: var(--component-upload-zone-active-border-color); }
.selected-filename, .document-name, .lesson-card h2 { overflow-wrap: anywhere; max-width: 100%; }
.upload-status { color: var(--color-ink-secondary); font-size: var(--type-body-sm-font-size); }
.upload-status:empty { display: none; }
.error-feedback { background: var(--component-error-feedback-background-color); color: var(--component-error-feedback-text-color); padding: var(--component-error-feedback-padding); border-radius: var(--component-error-feedback-rounded); width: 100%; }
.lesson-card { width: 100%; background: var(--component-lesson-card-background-color); color: var(--component-lesson-card-text-color); border: 1px solid var(--component-lesson-card-border-color); border-radius: var(--component-lesson-card-rounded); padding: var(--component-lesson-card-padding); box-shadow: var(--component-lesson-card-shadow); display: grid; gap: var(--space-sm); }
.ready-label { color: var(--color-success); font-weight: var(--type-label-font-weight); }
.document-name { display: flex; align-items: start; gap: var(--space-xs); color: var(--color-ink-secondary); font-size: var(--type-body-sm-font-size); }
.document-name svg { flex-shrink: 0; margin-top: var(--space-xxs); }
.lesson-preview { white-space: pre-wrap; overflow-wrap: anywhere; border-top: 1px solid var(--color-border); padding-top: var(--space-md); }
.level-fieldset { padding: 0; margin: var(--space-xs) 0; border: 0; min-width: 0; }
.level-fieldset legend { padding: 0; margin-bottom: var(--space-sm); font-size: var(--type-label-font-size); font-weight: var(--type-label-font-weight); }
.level-selector { display: inline-flex; background: var(--component-level-selector-background-color); padding: var(--component-level-selector-padding); border-radius: var(--component-level-selector-rounded); }
.level-option { position: relative; }
.level-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.level-option span { display: grid; place-items: center; min-height: 44px; padding: var(--component-level-option-padding); border-radius: var(--component-level-option-rounded); color: var(--component-level-option-text-color); font: var(--component-level-option-typography); cursor: pointer; }
.level-option input:checked + span { background: var(--component-level-option-selected-background-color); color: var(--component-level-option-selected-text-color); }
.level-option input:focus-visible + span { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.start-practice { display: grid; gap: var(--space-sm); }
.preview-link { display: inline-block; color: var(--color-ink-secondary); min-height: 44px; padding-block: var(--space-sm); margin-top: var(--space-lg); font-size: var(--type-body-sm-font-size); text-decoration: underline; text-underline-offset: var(--space-xxs); }
.text-practice-form { display: grid; gap: var(--space-sm); max-width: 640px; margin: 0 auto var(--space-lg); }
.text-workspace .microphone-area { padding: var(--space-md) 0; gap: var(--space-xs); }
.tutor-continues { margin-top: var(--space-lg); }
.tutor-audio-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-xs); }
.button-ghost { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); min-height: 44px; background: var(--component-button-ghost-background-color); color: var(--component-button-ghost-text-color); border: 1px solid transparent; border-radius: var(--component-button-ghost-rounded); padding: var(--component-button-ghost-padding); font: var(--component-button-ghost-typography); }
.button-ghost:disabled { color: var(--color-ink-disabled); }
.text-practice-form label { font: var(--type-label-font-weight) var(--type-label-font-size)/var(--type-label-line-height) var(--type-label-font-family); }
.text-practice-form textarea { width: 100%; min-height: 88px; resize: vertical; font: var(--component-text-practice-input-typography); color: var(--component-text-practice-input-text-color); background: var(--component-text-practice-input-background-color); border: 1px solid var(--component-text-practice-input-border-color); border-radius: var(--component-text-practice-input-rounded); padding: var(--component-text-practice-input-padding); }
.text-practice-form button { justify-self: start; }
.student-message { color: var(--component-student-message-text-color); background: var(--component-student-message-background-color); border-radius: var(--component-student-message-rounded); padding: var(--component-student-message-padding); overflow-wrap: anywhere; }
.correction-card { display: grid; gap: var(--space-xs); color: var(--component-correction-card-text-color); background: var(--component-correction-card-background-color); border: 1px solid var(--component-correction-card-border-color); border-radius: var(--component-correction-card-rounded); padding: var(--component-correction-card-padding); overflow-wrap: anywhere; }
.practice-heading { display: flex; justify-content: space-between; align-items: start; gap: var(--space-md); }
.practice-heading h1 { overflow-wrap: anywhere; }
.practice-heading button { flex-shrink: 0; }
.practice-status { margin: var(--space-md) 0; color: var(--color-ink-secondary); }
.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; }
.session-preparation { display: grid; gap: var(--space-lg); padding-block: var(--space-lg); }
.preparation-meter { display: flex; align-items: center; gap: 16px; }
.preparation-meter progress { flex: 1; min-width: 0; width: 100%; height: 16px; border: 0; border-radius: 12px; overflow: hidden; appearance: none; background: var(--color-surface-soft); }
.preparation-meter progress::-webkit-progress-bar { background: var(--color-surface-soft); border-radius: 12px; }
.preparation-meter progress::-webkit-progress-value { background: var(--color-primary); border-radius: 12px; transition: width 350ms ease; }
.preparation-meter progress::-moz-progress-bar { background: var(--color-primary); border-radius: 12px; transition: width 350ms ease; }
.session-preparation [role="status"] { display: flex; align-items: center; gap: 12px; }
.preparation-spinner { display: inline-block; width: 18px; height: 18px; flex-shrink: 0; border: 2px solid var(--color-border); border-top-color: var(--color-primary); border-radius: 50%; animation: preparation-spin 1s linear infinite; }
@keyframes preparation-spin { to { transform: rotate(360deg); } }
.practice-error { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); margin-block: var(--space-md); }
.practice-error p { flex-basis: 100%; }

.speaking-workspace:has(.speaking-advanced) .tutor-prompt { text-align: center; }
.speaking-workspace { position: relative; }
.session-time { display: grid; flex: 1; min-width: 120px; gap: var(--space-xs); color: var(--color-ink-secondary); font-size: var(--type-caption-font-size); }
.session-time progress { width: 100%; height: 6px; accent-color: var(--color-success); }
.session-time span[role="status"] { width: 100%; }
.speaking-advanced { position: relative; max-width: 100%; font-size: var(--type-body-sm-font-size); z-index: 2; }
.speaking-advanced summary { cursor: pointer; padding: 10px; }
.advanced-content { position: absolute; right: 0; width: min(300px, calc(100vw - 64px)); padding: 16px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-raised); display: grid; gap: 16px; }
.advanced-content > label { display: grid; gap: 8px; }
.advanced-content select { padding: 8px; min-height: 44px; font: inherit; }
.advanced-content .listening-mode { flex-wrap: wrap; }
.advanced-content { max-height: 70vh; overflow-y: auto; }
.finish-confirm { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.practice-source { border: 0; padding: 0; margin: 0 0 24px; }
.practice-source legend { margin-bottom: 12px; font-weight: 600; }
.topic-input { display: grid; gap: 10px; }
.topic-input textarea { width: 100%; box-sizing: border-box; padding: 12px; min-height: 100px; font: inherit; border: 1px solid var(--color-border); border-radius: 8px; resize: vertical; }
.session-secondary-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-block: 16px; align-items: center; }
.tutor-response-tools { display: grid; justify-items: center; gap: 8px; margin-bottom: 16px; }
.voice-transcript { margin-top: 24px; }

.voice-feedback { margin-top: var(--space-lg); }
.voice-feedback[open] { display: grid; gap: var(--space-sm); }
.listening-mode { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 0; border: 0; font-size: var(--type-body-sm-font-size); }
.listening-mode legend { float: left; margin-right: 8px; }
.listening-mode label { position: relative; cursor: pointer; }
.listening-mode input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.listening-mode span { display: inline-block; min-height: 44px; padding: 10px; border-radius: 6px; }
.listening-mode input:checked + span { background: var(--color-surface-soft); font-weight: 700; }
.listening-mode input:focus-visible + span { outline: 3px solid var(--color-focus-ring); }
.settings-panel { position: relative; margin-left: auto; }
.settings-panel summary { cursor: pointer; padding: 10px; }
.settings-content { position: absolute; z-index: 10; right: 0; width: min(300px, 85vw); display: grid; gap: 16px; padding: 20px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-raised); }
.settings-content label { display: grid; gap: 6px; }
.settings-content select { min-height: 44px; padding: 8px; font: inherit; border: 1px solid var(--color-border); border-radius: 6px; background: white; color: var(--color-ink); }
.history-scroll { max-height: 300px; overflow-y: auto; }
.history-turn { padding: var(--space-sm) 0; display: grid; gap: var(--space-xs); border-bottom: 1px solid var(--color-border); overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .practice-heading { flex-direction: column; }
  .top-bar-inner { padding-inline: var(--space-md); }
  .page { padding: var(--space-lg) var(--space-md); }
  .speaking-workspace { padding: var(--space-lg) var(--space-md); }
  .support-grid { grid-template-columns: 1fr; gap: var(--space-xs); }
  h1 { font-size: var(--type-heading-lg-font-size); line-height: var(--type-heading-lg-line-height); }
  .brand { font-size: var(--type-body-sm-font-size); }
  .preview-label { max-width: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.reference-evaluation { margin-top: 1.5rem; padding: 1.5rem; border: 1px solid var(--color-border); border-radius: 16px; background: var(--color-surface); }
 .reference-evaluation h2 { margin-top: 0; }
 .reference-evaluation h3 { font-size: 1rem; margin-bottom: .5rem; }
 .evaluation-overall { display: flex; justify-content: space-between; gap: 1rem; font-size: 1.15rem; }



/* Pilot: calm, obvious, rewarding. Existing semantic palette only. */
.practice-source { margin-top: var(--space-lg); }
.source-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); }
.source-card { position: relative; min-width: 0; }
.source-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.source-card > span { display: grid; grid-template-columns: 28px 1fr; gap: var(--space-xs) var(--space-sm); min-height: 104px; padding: var(--space-md); border: 2px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); cursor: pointer; transition: border-color var(--motion-normal), box-shadow var(--motion-normal); }
.source-card svg { color: var(--color-primary); grid-row: span 2; }
.source-card small { color: var(--color-ink-secondary); font-size: var(--type-body-sm-font-size); }
.source-card input:checked + span { background: var(--color-primary-soft); border-color: var(--color-primary); }
.source-card input:focus-visible + span { outline: 3px solid var(--color-focus-ring); outline-offset: 3px; }
.source-card input:disabled + span { opacity: .65; cursor: default; }
.topic-input { width: 100%; }
.topic-examples { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.topic-examples .button-ghost { border-color: var(--color-border); color: var(--color-vocabulary); }
.level-fieldset { width: 100%; }
.level-fieldset .level-selector { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 540px; border-radius: var(--radius-md); }
.level-fieldset .level-option span { gap: var(--space-xxs); height: 100%; border-radius: var(--radius-sm); padding: var(--space-sm) var(--space-xs); text-align: center; }
.level-option small { font-size: var(--type-body-sm-font-size); overflow-wrap: anywhere; }
.level-option input:checked + span { box-shadow: var(--shadow-card); }
.level-option input:disabled + span { cursor: default; }
.settings-panel summary { display: flex; align-items: center; gap: var(--space-xs); }
.speaking-header { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: var(--space-sm); margin-bottom: var(--space-lg); }
.tutor-prompt { width: 100%; }
.tutor-prompt > .button-ghost { justify-self: center; }
.tutor-hidden { color: var(--color-ink-secondary); font-size: var(--type-body-font-size); }
.microphone-label { font-size: var(--type-body-lg-font-size); }
.microphone-listening { outline: 6px solid var(--color-primary-soft); outline-offset: 4px; }
.microphone-tutor { background: var(--color-primary-soft); color: var(--color-primary); box-shadow: none; }
.better-sentence { font-size: var(--type-body-lg-font-size); }
.transcript-placeholder, .tutor-message, .reference-evaluation { overflow-wrap: anywhere; min-width: 0; }
.reference-evaluation { display: grid; gap: var(--space-lg); padding: var(--space-lg); border-radius: var(--radius-lg); }
.completion-intro { display: grid; justify-items: center; gap: var(--space-sm); text-align: center; }
.success-check { color: var(--color-success); }
.completion-check { box-sizing: content-box; padding: var(--space-sm); border-radius: var(--radius-full); background: var(--color-success-soft); animation: completion-appear var(--motion-slow) var(--motion-easing); }
@keyframes completion-appear { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.completion-feedback { display: grid; gap: var(--space-lg); }
.completion-feedback h2 { font-size: var(--type-heading-md-font-size); }
.completion-feedback ul { padding-left: var(--space-lg); margin-bottom: 0; }
.next-focus { border-left: 3px solid var(--color-vocabulary); padding-left: var(--space-md); }
.next-focus p { margin-top: var(--space-xs); }
.evaluation-scores { display: grid; gap: var(--space-md); border-top: 1px solid var(--color-border); padding-top: var(--space-lg); }
.evaluation-scores h2 { font-size: var(--type-heading-md-font-size); }
.evaluation-dimensions { display: grid; gap: var(--space-md); margin: 0; }
.evaluation-dimensions div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(100px, 1fr); gap: var(--space-sm); align-items: center; }
.evaluation-dimensions dd { display: grid; gap: var(--space-xxs); margin: 0; min-width: 0; }
.evaluation-dimensions progress { width: 100%; height: 6px; accent-color: var(--color-primary); }
.completion-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
@media (hover: hover) {
  .source-card input:not(:disabled) + span:hover { box-shadow: var(--shadow-card); border-color: var(--color-primary); }
}
@media (max-width: 600px) {
  .source-cards { grid-template-columns: minmax(0, 1fr); }
  .source-card > span { min-height: 88px; }
  .top-bar .preview-label { display: none; }
  .top-bar-inner { gap: var(--space-xs); }
  .upload-zone { padding: var(--space-lg) var(--space-md); }
  .completion-actions { flex-direction: column; }
}
@media (max-width: 390px) {
  .level-fieldset .level-selector { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
