:root {
  color: #243b53;
  background: #f5f7fb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, textarea { font: inherit; }
.app-header { align-items: center; background: #102a43; color: white; display: flex; gap: 10px; justify-content: space-between; padding: 20px clamp(20px, 5vw, 72px); }
.app-header h1 { font-size: 1.35rem; margin: 0; }
.eyebrow { color: #9fb3c8; font-size: .7rem; letter-spacing: .16em; margin: 0 0 3px; }
.import-button, button { background: #f0b429; border: 0; border-radius: 9px; color: #102a43; cursor: pointer; font-weight: 700; padding: 10px 15px; }
.import-button input { display: none; }
.app-header > button { background: #e3f8ff; color: #102a43; }
.shell { margin: 0 auto; max-width: 1040px; padding: 36px 20px 80px; }
.empty-state { background: white; border: 2px dashed #bcccdc; border-radius: 20px; margin: 8vh auto; max-width: 620px; padding: 52px 28px; text-align: center; }
.drop-icon { align-items: center; background: #e3f8ff; border-radius: 50%; color: #007c91; display: flex; font-size: 2rem; height: 64px; justify-content: center; margin: 0 auto 20px; width: 64px; }
.drop-zone { border: 1px solid #d9e2ec; border-radius: 10px; color: #627d98; margin-top: 25px; padding: 18px; }
.drop-zone.active { background: #e3f8ff; border-color: #00a3c4; }
.dashboard-header { align-items: center; background: white; border: 1px solid #d9e2ec; border-radius: 15px; display: flex; justify-content: space-between; padding: 22px 26px; }
.dashboard-header h2 { margin: 0 0 5px; }
.dashboard-header p { margin: 0; }
.dashboard-actions { display: flex; gap: 8px; }
.course-group { margin-top: 28px; }
.course-group > h3 { color: #486581; margin-bottom: 12px; }
.course-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.course-tile { background: white; border: 1px solid #d9e2ec; border-radius: 15px; box-shadow: 0 5px 16px #102a430b; padding: 20px; }
.course-tile h4 { font-size: 1.1rem; margin: 0 0 8px; }
.course-tile p { min-height: 48px; }
.course-tile button { margin-top: 14px; }
.progress-track { background: #e6edf3; border-radius: 99px; height: 8px; overflow: hidden; }
.progress-fill { background: #1f7a8c; border-radius: inherit; height: 100%; transition: width .2s ease; }
.back-button { background: transparent; color: #1f7a8c; padding-left: 0; }
.lesson-completion { align-items: center; border-top: 1px solid #d9e2ec; display: flex; justify-content: space-between; margin-top: 28px; padding-top: 20px; }
.course-card, .lesson-card, .block, .question-card { background: white; border: 1px solid #d9e2ec; border-radius: 15px; box-shadow: 0 5px 16px #102a430b; }
.course-card { padding: 26px; }
.course-card h2 { margin: 0 0 7px; }
.muted { color: #627d98; }
.lesson-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.lesson-nav button { background: white; border: 1px solid #bcccdc; color: #334e68; }
.lesson-nav button.active { background: #102a43; border-color: #102a43; color: white; }
.lesson-card { padding: clamp(20px, 4vw, 40px); }
.lesson-meta { color: #627d98; font-size: .9rem; }
.block { margin: 16px 0; padding: 20px; }
.block h3, .block h4 { margin-top: 0; }
.dialogue-line { border-left: 3px solid #f0b429; margin: 10px 0; padding: 7px 14px; }
.speaker { color: #627d98; display: block; font-size: .8rem; font-weight: 700; text-transform: uppercase; }
.speech-row { align-items: center; display: flex; gap: 10px; justify-content: space-between; }
.speech-text { font-size: 1.1rem; font-weight: 700; }
.speech-translation { color: #627d98; display: block; font-size: .9rem; }
.play { background: #e3f8ff; border-radius: 50%; color: #007c91; min-width: 42px; padding: 9px; }
.formula { align-items: center; background: #f0f4f8; display: inline-flex; font-family: Georgia, serif; font-size: 1.25rem; gap: 3px; overflow-x: auto; padding: 3px 8px; }
.formula sup, .formula sub { font-size: .7em; }
.fraction { align-items: center; display: inline-flex; flex-direction: column; line-height: 1.05; vertical-align: middle; }
.fraction .numerator { border-bottom: 1px solid currentColor; padding: 0 5px 2px; }
.fraction .denominator { padding: 2px 5px 0; }
.structured-svg { background: #fbfdff; border: 1px solid #d9e2ec; border-radius: 10px; display: block; max-width: 100%; }
.shape-line { stroke: #1f7a8c; stroke-linecap: round; stroke-width: 3; }
.axis-line { stroke: #829ab1; stroke-width: 1.5; }
.sin-line, .cos-line { fill: none; stroke-width: 3; }
.sin-line { stroke: #1f7a8c; }
.cos-line { stroke: #f0b429; }
.sin-label { fill: #1f7a8c; }
.cos-label { fill: #b7791f; }
.bar-0 { fill: #2f80ed; }
.bar-1 { fill: #27ae60; }
.bar-2 { fill: #f0b429; }
.chart-label-0 { fill: #2f80ed; }
.chart-label-1 { fill: #27ae60; }
.chart-label-2 { fill: #b7791f; }
.diagram-edge { stroke: #829ab1; stroke-dasharray: 5 4; stroke-width: 2; }
.diagram-label { fill: #627d98; font-size: 10px; text-anchor: middle; }
.diagram-node { fill: #e3f8ff; stroke: #1f7a8c; stroke-width: 2; }
.diagram-node-label { fill: #243b53; font-size: 12px; text-anchor: middle; }
.visual-json { background: #102a43; color: #e3f8ff; overflow: auto; padding: 14px; }
.lesson-image { border-radius: 11px; display: block; max-height: 390px; max-width: 100%; object-fit: cover; width: 100%; }
.question-option { display: block; margin: 9px 0; }
.question-option input { margin-right: 8px; }
.feedback { border-radius: 8px; margin-top: 13px; padding: 10px; }
.feedback.correct { background: #e3fcef; color: #147d64; }
.feedback.incorrect { background: #fff3f0; color: #b44b3e; }
.reflection-input { border: 1px solid #bcccdc; border-radius: 8px; min-height: 80px; padding: 10px; width: 100%; }
.toast { background: #102a43; border-radius: 9px; bottom: 20px; color: white; display: none; left: 50%; max-width: calc(100% - 40px); padding: 12px 16px; position: fixed; transform: translateX(-50%); z-index: 5; }
.toast.show { display: block; }
code { background: #f0f4f8; border-radius: 4px; padding: 2px 5px; }
@media (max-width: 620px) { .app-header { align-items: stretch; flex-direction: column; gap: 12px; } .import-button, .app-header > button { text-align: center; width: 100%; } .dashboard-header, .lesson-completion { align-items: stretch; flex-direction: column; gap: 14px; } }
