:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #647084;
  --surface: #ffffff;
  --canvas: #f3f6fb;
  --line: #dfe5ee;
  --primary: #3157d5;
  --primary-dark: #2343ad;
  --accent: #f5c344;
  --success: #19734a;
  --success-bg: #e9f8f0;
  --error: #a83838;
  --error-bg: #fff0f0;
  --shadow: 0 18px 45px rgba(28, 42, 71, .1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); line-height: 1.6; }
a { color: var(--primary); }
button, input, textarea { font: inherit; }
button, .button { min-height: 44px; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 20; background: var(--ink); color: white; padding: .75rem 1rem; }
.skip-link:focus { top: 1rem; }
.topbar { min-height: 72px; padding: .75rem clamp(1rem, 4vw, 4rem); display: flex; align-items: center; justify-content: space-between; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); font-weight: 800; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: #171717; background: var(--accent); font-weight: 900; }
.topbar nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 1.4rem; }
.topbar nav a, .link-button { color: var(--ink); text-decoration: none; font-weight: 650; }
.inline-form { display: inline; }
.link-button { border: 0; background: transparent; cursor: pointer; padding: 0; }
.page-shell { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; padding: 3.2rem 0 5rem; }
h1, h2 { line-height: 1.18; letter-spacing: -.025em; }
h1 { margin: .2rem 0 1.5rem; font-size: clamp(2rem, 5vw, 3.35rem); }
h2 { font-size: clamp(1.35rem, 3vw, 2rem); }
.eyebrow { margin: 0; color: var(--primary); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: .77rem; }
.muted { color: var(--muted); }
.hero-card { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: end; background: linear-gradient(135deg, #17223b, #253866); color: white; border-radius: 22px; padding: clamp(1.5rem, 4vw, 3rem); box-shadow: var(--shadow); }
.hero-card h2 { margin: .8rem 0 1.25rem; font-size: clamp(1.7rem, 4vw, 2.6rem); }
.status-chip, .mode-chip { display: inline-block; width: fit-content; padding: .35rem .7rem; border-radius: 999px; background: rgba(255,255,255,.13); font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
.recommendation-grid { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 0; }
.recommendation-grid div { min-width: 120px; }
.recommendation-grid dt { color: #bac7df; font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; }
.recommendation-grid dd { margin: .12rem 0 0; font-weight: 700; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .4rem; border: 0; border-radius: 10px; padding: .72rem 1.1rem; font-weight: 800; text-decoration: none; cursor: pointer; }
.button.primary { color: white; background: var(--primary); }
.button.primary:hover { background: var(--primary-dark); }
.hero-card .button.primary { color: #182038; background: var(--accent); }
.button.secondary { color: var(--primary); background: #edf1ff; border: 1px solid #ccd7ff; }
.button.ghost { color: var(--ink); background: transparent; border: 1px solid var(--line); }
.button.large { padding: 1rem 1.35rem; white-space: nowrap; }
.dashboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 1.25rem; }
.metric-card, .lesson-card, .exercise-card, .progress-overview { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.4rem; }
.metric-card { display: flex; flex-direction: column; min-height: 155px; }
.metric-card span, .metric-card small { color: var(--muted); }
.metric-card strong { margin-top: auto; font-size: 1.8rem; }
progress { width: 100%; height: 8px; border: 0; border-radius: 20px; overflow: hidden; accent-color: var(--primary); }
.secondary-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.5rem; }
.study-plan-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1.5rem 0 2rem; }
.study-plan-overview > article, .study-goal-form { display: grid; align-content: start; gap: .65rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 16px; background: white; }
.study-plan-overview article > span, .study-plan-overview article > small { color: var(--muted); }
.study-plan-overview article > strong { font-size: 1.65rem; }
.study-goal-form h2 { margin: 0; font-size: 1.15rem; }
.study-goal-form .button { align-self: end; }
.study-task-list { display: grid; gap: .8rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.study-task-list li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; padding: 1.2rem; border: 1px solid var(--line); border-radius: 14px; background: white; }
.study-task-number { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: white; background: var(--primary); font-size: 1.1rem; font-weight: 900; }
.study-task-list h3 { margin: .2rem 0; }
.study-task-list p { margin: 0; color: var(--muted); }
.study-task-list small { color: var(--primary); font-weight: 800; text-transform: uppercase; }
.achievement-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1.5rem 0 2rem; }
.achievement-summary article { display: grid; min-height: 125px; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: white; }
.achievement-summary span, .achievement-summary small { color: var(--muted); }
.achievement-summary strong { align-self: end; font-size: 1.7rem; }
.badge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.badge-card { display: grid; grid-template-columns: auto 1fr; gap: .8rem 1rem; padding: 1.2rem; border: 1px solid var(--line); border-radius: 16px; background: white; }
.badge-card.locked { opacity: .72; }
.badge-card.unlocked { border-color: #d7ba54; background: linear-gradient(145deg, #fffdf4, #fff8dc); }
.badge-icon { display: grid; place-items: center; width: 54px; height: 54px; border: 4px double #a97900; border-radius: 50%; color: #5f4500; background: var(--accent); font-size: 1.05rem; font-weight: 900; }
.badge-card.locked .badge-icon { border-color: #aeb8c8; color: #647084; background: #e4e8ee; }
.badge-card .status-chip { margin: 0; color: #5f4500; background: #fff0b8; }
.badge-card h3 { margin: .4rem 0 .2rem; }
.badge-card p { margin: 0; color: var(--muted); }
.badge-card progress, .badge-card > small { grid-column: 1 / -1; }
.badge-card > small { color: var(--muted); }
.certificate-list { display: grid; gap: .7rem; }
.certificate-list article { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: 14px; background: white; }
.certificate-list article.locked { opacity: .7; }
.certificate-list h3 { margin: .15rem 0; }
.certificate-list p, .certificate-list small { margin: 0; color: var(--muted); }
.certificate-seal { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; color: white; background: var(--primary); font-weight: 900; }
.certificate-list .unlocked .certificate-seal { background: var(--success); }
.certificate-locked { color: var(--muted); font-weight: 800; }
.certificate-actions { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.certificate-sheet { min-height: 650px; padding: clamp(2rem, 7vw, 5rem); border: 12px double #24396f; background: radial-gradient(circle at center, #fffdf5, #ffffff 65%); box-shadow: var(--shadow); text-align: center; }
.certificate-brand { display: flex; justify-content: center; align-items: center; gap: .8rem; margin-bottom: 3rem; font-size: 1.2rem; }
.certificate-sheet h1 { margin: 1.5rem 0 .5rem; font-size: 1.6rem; }
.certificate-sheet h2 { margin: .7rem auto 1.5rem; max-width: 700px; color: #24396f; font-size: clamp(1.5rem, 4vw, 2.5rem); }
.certificate-name { margin: 0; color: #9a6b00; font-family: Georgia, serif; font-size: clamp(2rem, 6vw, 4rem); font-weight: 700; }
.certificate-footer { display: flex; justify-content: space-between; gap: 1rem; margin-top: 5rem; padding-top: 1rem; border-top: 1px solid #b8a76c; color: var(--muted); font-size: .85rem; }
.profile-summary { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0; padding: 1.2rem; border: 1px solid #ccd7ff; border-radius: 16px; background: #f5f7ff; }
.profile-avatar { display: grid; place-items: center; flex: 0 0 64px; height: 64px; border-radius: 50%; color: white; background: var(--primary); font-size: 1.8rem; font-weight: 900; }
.profile-summary h2, .profile-summary p { margin: .1rem 0; }
.profile-summary p, .profile-summary small { color: var(--muted); }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.profile-panel { padding: 1.4rem; border: 1px solid var(--line); border-radius: 16px; background: white; }
.profile-panel h2 { margin-top: 0; }
.profile-panel > p, .profile-panel form > small { color: var(--muted); }
.profile-panel .button { justify-self: start; }
.personal-notes { margin-top: 1.5rem; padding: 1.3rem; border: 1px solid #ccd7ff; border-radius: 16px; background: #f5f7ff; }
.personal-notes-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.personal-notes-heading h2 { margin: .2rem 0; }
.personal-notes > p { color: var(--muted); }
.personal-notes textarea { min-height: 140px; resize: vertical; line-height: 1.55; background: white; }
.personal-notes-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.personal-notes-actions small { color: var(--muted); }
.notes-filters { display: grid; grid-template-columns: minmax(240px, 2fr) minmax(220px, 1.4fr) auto auto auto; align-items: end; gap: .75rem; margin: 1.5rem 0 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: white; }
.notes-checkbox { display: flex; align-items: center; gap: .45rem; min-height: 44px; white-space: nowrap; }
.notes-checkbox input { width: auto; }
.notes-summary { display: flex; flex-wrap: wrap; gap: .7rem; margin-bottom: 1.5rem; }
.notes-summary span { padding: .45rem .75rem; border-radius: 999px; color: var(--muted); background: #e8edff; }
.notes-summary strong { color: var(--primary); }
.notes-list { display: grid; gap: 1rem; }
.notes-list article { padding: 1.3rem; border: 1px solid var(--line); border-radius: 16px; background: white; }
.notes-list header, .notes-list footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.notes-list header small, .notes-list footer small { color: var(--muted); }
.notes-list h2 { margin: .15rem 0; font-size: 1.25rem; }
.notes-list .status-chip { color: #5f4500; background: #fff0b8; }
.saved-note { margin: 1rem 0; padding: 1rem; border-left: 4px solid var(--primary); border-radius: 0 10px 10px 0; background: var(--canvas); white-space: pre-wrap; overflow-wrap: anywhere; }
.auth-shell { min-height: calc(100vh - 50px); display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(circle at 20% 20%, #e4eaff, transparent 40%), var(--canvas); }
.auth-card { width: min(450px, 100%); padding: clamp(1.5rem, 5vw, 2.7rem); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.auth-brand { margin-bottom: 2.4rem; }
.auth-help { margin: 1.2rem 0 0; text-align: center; }
.stack { display: grid; gap: 1rem; margin-top: 1.5rem; }
label { display: grid; gap: .4rem; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid #bfc9d8; border-radius: 9px; padding: .78rem; color: var(--ink); background: white; }
input:focus, textarea:focus, select:focus, button:focus, a:focus { outline: 3px solid rgba(49,87,213,.25); outline-offset: 2px; }
.alert, .feedback, .hint-panel, .tool-panel { padding: .9rem 1rem; border-radius: 10px; }
.error { color: var(--error); background: var(--error-bg); }
.success { color: var(--success); background: var(--success-bg); }
.warning { color: #624300; background: #fff8e6; border: 1px solid #e3bd66; }
.site-footer { padding: 1rem; color: var(--muted); text-align: center; font-size: .8rem; }
.pwa-install-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; padding: 1rem 1.2rem; border: 1px solid #ccd7ff; border-radius: 14px; background: #edf1ff; }
.pwa-install-card[hidden] { display: none; }
.pwa-install-card div { display: grid; }
.pwa-install-card span { color: var(--muted); font-size: .86rem; }
.connection-status { margin: 0 0 1rem; padding: .75rem 1rem; border: 1px solid #ecd989; border-radius: 10px; color: #765700; background: #fff8dc; font-weight: 700; }
.offline-shell { width: min(620px, calc(100% - 2rem)); min-height: 100vh; margin: 0 auto; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.offline-shell .brand-mark { margin-bottom: 1.5rem; }
.offline-shell h1 { margin-bottom: .5rem; }
.offline-shell p:not(.eyebrow) { max-width: 55ch; margin-bottom: 1.5rem; color: var(--muted); font-size: 1.05rem; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: .55rem; color: var(--muted); font-size: .85rem; }
.breadcrumb a { color: inherit; }
.lesson-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.mode-chip { color: #304580; background: #e8edff; margin-bottom: 1.7rem; }
.mode-switch { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.mode-switch .mode-chip { margin: 0; }
.mode-switch .link-button { color: var(--primary); font-size: .8rem; }
.learning-mode-card { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; margin-bottom: 1rem; padding: 1rem 1.2rem; border: 1px solid #ccd7ff; border-radius: 14px; background: #f5f7ff; }
.learning-mode-card h2 { margin: .35rem 0 .2rem; font-size: 1.1rem; }
.learning-mode-card p { margin: 0; color: var(--muted); }
.learning-mode-card .mode-chip { margin: 0; }
.mode-options { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.mode-options form { display: inline-flex; }
.mode-options .button { min-height: 38px; padding: .5rem .75rem; font-size: .78rem; }
.button:disabled { cursor: default; opacity: .72; }
.step-progress { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 1rem; margin-bottom: 1rem; color: var(--muted); font-size: .85rem; font-weight: 700; }
.guided-context { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; margin-bottom: 1rem; }
.guided-context div { display: grid; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: white; }
.guided-context div.current { color: white; border-color: var(--primary); background: var(--primary); }
.guided-context span { color: var(--muted); font-size: .65rem; font-weight: 900; letter-spacing: .1em; }
.guided-context .current span { color: #dbe3ff; }
.guided-instruction { padding: .7rem .9rem; border-left: 4px solid var(--primary); border-radius: 0 8px 8px 0; color: #304580; background: #edf1ff; font-weight: 700; }
.learning-mode-normal .guided-context, .learning-mode-normal .guided-instruction, .learning-mode-normal .exercise-guide { display: none; }
.lesson-card { min-height: 330px; display: flex; flex-direction: column; padding: clamp(1.3rem, 4vw, 2.5rem); }
.lesson-step p { max-width: 70ch; font-size: 1.07rem; }
.step-type { color: var(--primary); text-transform: uppercase; letter-spacing: .09em; font-weight: 800; font-size: .72rem; }
pre { overflow: auto; padding: 1rem; border-radius: 10px; color: #e8edf7; background: #151d2d; }
.lesson-controls { display: flex; justify-content: space-between; gap: 1rem; margin-top: auto; padding-top: 2rem; }
.learning-tools { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
.learning-tools button { border: 1px solid var(--line); border-radius: 999px; background: var(--surface); padding: .55rem .9rem; cursor: pointer; }
.tool-panel { margin-top: .75rem; background: #fff8dc; border: 1px solid #ecd989; }
.exercise-shell { max-width: 840px; }
.exercise-card { padding: clamp(1.3rem, 4vw, 2.4rem); }
.exercise-card h2 { margin-top: 0; }
.exercise-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.exercise-heading h1 { margin-right: auto; }
.exercise-guide { margin-bottom: 1rem; padding: 1rem 1.2rem; border: 1px solid #ccd7ff; border-radius: 14px; background: #f5f7ff; }
.exercise-guide h2 { margin: 0 0 .8rem; font-size: 1rem; }
.exercise-guide ol { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: 0; padding: 0; list-style: none; }
.exercise-guide li { display: flex; align-items: center; gap: .55rem; padding: .65rem; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: white; }
.exercise-guide li > span { display: grid; place-items: center; flex: 0 0 28px; height: 28px; border-radius: 50%; background: #e4e8ee; font-weight: 900; }
.exercise-guide li div { display: grid; line-height: 1.25; }
.exercise-guide li small { font-size: .68rem; }
.exercise-guide li.current { color: #263c7c; border-color: #92a7f2; background: #e8edff; }
.exercise-guide li.current > span { color: white; background: var(--primary); }
.exercise-guide li.completed > span { color: white; background: var(--success); }
.exercise-guide li.completed > span::after { content: '✓'; }
.exercise-guide li.completed > span { font-size: 0; }
.exercise-guide li.completed > span::after { font-size: .9rem; }
#guide-instruction { margin: .8rem 0 0; font-weight: 750; }
fieldset { padding: 0; border: 0; }
legend { margin-bottom: .7rem; font-weight: 700; }
.answer-option { grid-template-columns: auto 1fr; align-items: start; padding: .9rem; margin: .6rem 0; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.answer-option input { width: auto; margin-top: .28rem; }
.editor-panel { overflow: hidden; margin-top: .4rem; border: 1px solid #364258; border-radius: 12px; background: #151d2d; }
.editor-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .65rem .85rem; color: #eef3ff; border-bottom: 1px solid #364258; background: #202a3c; }
.editor-toolbar > div:first-child { display: grid; }
.editor-toolbar span, .editor-position { color: #aebbd0; font-size: .72rem; }
.editor-workspace { display: grid; grid-template-columns: 48px minmax(0, 1fr); height: 300px; }
.line-numbers { height: 100%; margin: 0; padding: .9rem .65rem; overflow: hidden; color: #718099; border-radius: 0; border-right: 1px solid #364258; background: #111827; text-align: right; user-select: none; }
.editor-code-layer { position: relative; min-width: 0; height: 100%; }
.code-highlight, .code-editor { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: .9rem; overflow: auto; border: 0; border-radius: 0; white-space: pre; overflow-wrap: normal; font-family: "Cascadia Code", Consolas, monospace; font-size: .92rem; line-height: 1.55; tab-size: 2; }
.code-highlight { pointer-events: none; color: #d8e0ef; background: #151d2d; }
.code-highlight code { font: inherit; }
.code-editor { z-index: 1; resize: none; color: transparent; caret-color: #ffffff; background: transparent; -webkit-text-fill-color: transparent; }
.code-editor::selection { background: rgba(80, 120, 230, .45); }
.syntax-keyword { color: #dca7ff; font-weight: 700; }
.syntax-string { color: #a9dc76; }
.syntax-number { color: #ffd580; }
.syntax-comment { color: #7f8da3; font-style: italic; }
.editor-shortcuts { display: flex; flex-wrap: wrap; gap: 1rem; padding: .5rem .85rem; color: #aebbd0; border-top: 1px solid #364258; background: #111827; font-size: .72rem; }
kbd { padding: .08rem .28rem; border: 1px solid #65718a; border-radius: 4px; color: #f0f4ff; background: #2d384d; font: inherit; }
.editor-actions, .exercise-actions { display: flex; gap: .7rem; margin-top: .8rem; }
.exercise-actions { justify-content: space-between; padding-top: 1rem; border-top: 1px solid var(--line); }
.console { margin: 1rem 0; padding: 0; overflow: hidden; border: 1px solid #3c485f; border-radius: 10px; background: #252f43; color: #e8edf7; }
.console header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem .8rem; border-bottom: 1px solid #3c485f; background: #1d2637; }
.console header > div { display: flex; align-items: center; gap: .8rem; }
.console .link-button { min-height: auto; color: #cbd5e7; font-size: .75rem; }
.console-status { padding: .18rem .5rem; border-radius: 999px; color: #cad5e8; background: #344056; font-size: .7rem; font-weight: 800; }
.console[data-state="success"] .console-status { color: #c4f4d6; background: #24553c; }
.console[data-state="error"] .console-status, .console[data-state="timeout"] .console-status { color: #ffd5d5; background: #663434; }
.console[data-state="running"] .console-status { color: #fff0b8; background: #67561f; }
.console pre { min-height: 4rem; margin: 0; padding: .8rem; border-radius: 0; background: transparent; white-space: pre-wrap; }
.hint-panel, .feedback { margin-top: 1rem; }
#continue-after { margin-top: 1rem; }
.progress-overview { margin-bottom: 2rem; }
.progress-number { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.progress-number strong { font-size: 2.4rem; }
.empty-state { padding: 1.5rem; border: 1px dashed #adb8c8; border-radius: 12px; color: var(--muted); background: rgba(255,255,255,.5); }
.mastery-list { display: grid; gap: .7rem; }
.mastery-list article { display: grid; grid-template-columns: minmax(150px, 1fr) 2fr auto; align-items: center; gap: 1rem; padding: 1rem; background: white; border: 1px solid var(--line); border-radius: 12px; }
.mastery-list article div { display: grid; }
.mastery-list span { color: var(--muted); font-size: .8rem; }
.lead { max-width: 68ch; color: var(--muted); font-size: 1.05rem; }
.requirement-panel { margin: 1rem 0 1.4rem; padding: 1rem 1.1rem; border: 1px solid #ccd7ff; border-radius: 12px; background: #f5f7ff; }
.requirement-panel h3 { margin: 0 0 .65rem; font-size: 1rem; }
.requirement-panel ul, .test-results ul { margin: 0; padding: 0; list-style: none; }
.requirement-panel li, .test-results li { display: flex; gap: .55rem; padding: .25rem 0; }
.requirement-panel .passed, .test-results .passed { color: var(--success); }
.requirement-panel .failed, .test-results .failed { color: var(--error); }
.feedback-summary { margin-top: 0; font-weight: 800; }
.feedback-details { display: grid; gap: .8rem; margin-top: .8rem; }
.feedback-item { padding: 1rem; color: var(--ink); border: 1px solid rgba(168,56,56,.22); border-radius: 10px; background: white; }
.feedback-item h3 { margin: 0 0 .45rem; color: var(--error); }
.feedback.warning .feedback-item { border-color: rgba(176,117,0,.35); background: #fffdf5; }
.feedback.warning .feedback-item h3 { color: #765000; }
.feedback-item p { margin: .4rem 0; }
.feedback-location { display: inline-flex; min-height: 36px; padding: .4rem .65rem; border: 1px solid #cf9b9b; border-radius: 7px; color: var(--error); background: #fff7f7; font-weight: 800; cursor: pointer; }
.hint-inline, .concept-reminder { padding: .6rem .7rem; border-radius: 8px; background: #fff8dc; }
.code-label { display: block; margin-top: .75rem; font-size: .8rem; font-weight: 800; text-transform: uppercase; }
.mini-code { margin: .35rem 0 0; white-space: pre-wrap; }
.test-results { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid currentColor; }
.test-results h3 { margin: 0 0 .45rem; font-size: 1rem; }
.practice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 2.2rem; }
.practice-card { display: flex; flex-direction: column; align-items: flex-start; padding: 1.3rem; border: 1px solid var(--line); border-radius: 14px; background: white; }
.practice-card h3 { margin: .65rem 0 .4rem; }
.practice-card p { color: var(--muted); }
.practice-card small { margin: auto 0 1rem; color: var(--muted); }
.practice-card .status-chip { color: #304580; background: #e8edff; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-top: 2.5rem; }
.section-heading h2 { margin-top: .2rem; }
.error-history-list { display: grid; gap: .75rem; }
.error-history-list article { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: white; }
.error-history-list article > div:last-child { display: flex; flex-direction: column; align-items: end; gap: .6rem; white-space: nowrap; }
.error-history-list .status-chip { color: #304580; background: #e8edff; }
.review-message { padding: .7rem; border-radius: 8px; color: #304580; background: #edf1ff; font-weight: 700; }
.count-badge { display: grid; place-items: center; min-width: 42px; height: 42px; border-radius: 50%; color: white; background: var(--primary); font-weight: 900; }
.review-list { display: grid; gap: .8rem; margin-bottom: 2.5rem; }
.review-card, .challenge-card { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 14px; background: white; }
.review-card h3 { margin: .65rem 0 .2rem; }
.review-card p, .challenge-card p { margin: .25rem 0; color: var(--muted); }
.review-card small { color: var(--muted); }
.review-card .status-chip { color: #304580; background: #e8edff; }
.review-complete { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; padding: 1.4rem; border: 1px solid #a8d8bd; border-radius: 14px; background: var(--success-bg); }
.review-complete > span { display: grid; place-items: center; flex: 0 0 46px; height: 46px; border-radius: 50%; color: white; background: var(--success); font-size: 1.4rem; font-weight: 900; }
.review-complete h2, .review-complete p { margin: .15rem 0; }
.upcoming-reviews { display: grid; gap: .6rem; }
.upcoming-reviews article { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: white; }
.upcoming-reviews article div { display: grid; }
.upcoming-reviews span, .upcoming-reviews time { color: var(--muted); }
.resolved-error-list { display: grid; gap: .7rem; }
.resolved-error-list article { display: flex; align-items: center; gap: .9rem; padding: 1rem; border: 1px solid #b9dfc9; border-radius: 12px; background: var(--success-bg); }
.resolved-error-list p { margin: .2rem 0 0; color: var(--muted); }
.resolved-mark { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 50%; color: white; background: var(--success); font-weight: 900; }
.map-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: .8rem; margin: 1.5rem 0; }
.map-summary article { display: grid; min-height: 110px; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: white; }
.map-summary span { color: var(--muted); font-size: .85rem; }
.map-summary strong { align-self: end; font-size: 1.8rem; }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; padding: 1rem; border-radius: 12px; background: #e9eef8; }
.map-legend span, .concept-status { padding: .28rem .62rem; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.legend-not-started, .status-not-started .concept-status { color: #4f5d72; background: #e4e8ee; }
.legend-attention, .status-attention .concept-status { color: #8d2929; background: #ffe0e0; }
.legend-practicing, .status-practicing .concept-status { color: #765700; background: #fff0b8; }
.legend-consolidated, .status-consolidated .concept-status { color: #11643e; background: #dff5e8; }
.map-course { margin-top: 2.5rem; }
.map-course-heading { padding-left: 1rem; border-left: 5px solid var(--primary); }
.map-course-heading span, .map-stage header span, .map-module-heading span { color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.map-course-heading h2, .map-stage h3, .map-module h4 { margin: .15rem 0; }
.map-stage { position: relative; margin: 1rem 0 0 1.2rem; padding: 1.25rem 0 0 1.5rem; border-left: 2px solid #bdc9dc; }
.map-stage::before { content: ''; position: absolute; left: -7px; top: 2rem; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); }
.map-stage > header { display: flex; justify-content: space-between; gap: 1.5rem; align-items: center; }
.stage-mastery { width: min(220px, 45%); text-align: right; }
.stage-mastery strong { font-size: 1.25rem; }
.map-modules { display: grid; gap: 1rem; margin-top: 1rem; }
.map-module { padding: 1rem; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.55); }
.map-module-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.map-module-heading b { color: var(--primary); }
.concept-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.concept-node { display: flex; flex-direction: column; min-width: 0; padding: 1rem; border: 1px solid var(--line); border-top-width: 5px; border-radius: 12px; background: white; }
.concept-node.status-not-started { border-top-color: #8793a4; }
.concept-node.status-attention { border-top-color: #bc4747; }
.concept-node.status-practicing { border-top-color: #d19d00; }
.concept-node.status-consolidated { border-top-color: var(--success); }
.concept-node-heading { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.concept-node h5 { margin: .8rem 0 .3rem; font-size: 1.05rem; }
.concept-node > p { margin: .2rem 0 .8rem; color: var(--muted); font-size: .88rem; }
.concept-node progress { margin: .35rem 0 .8rem; }
.concept-signals { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; margin: 0 0 .8rem; }
.concept-signals div { display: grid; padding: .4rem; border-radius: 7px; text-align: center; background: var(--canvas); }
.concept-signals dt { color: var(--muted); font-size: .62rem; text-transform: uppercase; }
.concept-signals dd { margin: 0; font-weight: 800; }
.concept-node .map-alert { color: var(--error); font-weight: 700; }
.concept-node small { margin: auto 0 .75rem; color: var(--muted); }
.concept-node .button { width: 100%; }
.curriculum-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin: 1.5rem 0; }
.curriculum-summary article { display: grid; min-height: 110px; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: white; }
.curriculum-summary span { color: var(--muted); font-size: .82rem; }
.curriculum-summary strong { align-self: end; font-size: 1.8rem; }
.curriculum-overall { display: grid; grid-template-columns: minmax(200px, 320px) 1fr; align-items: center; gap: 1.5rem; padding: 1rem 1.2rem; border: 1px solid #ccd7ff; border-radius: 14px; background: #f5f7ff; }
.curriculum-overall div { display: grid; }
.curriculum-overall span { color: var(--muted); font-size: .84rem; }
.curriculum-section { margin-top: 2.5rem; }
.curriculum-stages { display: grid; gap: .8rem; }
.curriculum-stage { overflow: hidden; border: 1px solid var(--line); border-left: 5px solid #8793a4; border-radius: 14px; background: white; }
.curriculum-stage.status-completed { border-left-color: var(--success); }
.curriculum-stage.status-in-progress { border-left-color: var(--primary); }
.curriculum-stage summary { display: grid; grid-template-columns: auto 1fr minmax(130px, 220px); align-items: center; gap: 1rem; padding: 1rem 1.2rem; cursor: pointer; list-style: none; }
.curriculum-stage summary::-webkit-details-marker { display: none; }
.curriculum-stage-number { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%; color: white; background: var(--primary); font-weight: 900; }
.curriculum-stage-title h3 { margin: .15rem 0; }
.curriculum-stage-title small, .curriculum-stage-body > p, .curriculum-module header small, .curriculum-lessons p, .curriculum-lessons > li > small { color: var(--muted); }
.curriculum-status { width: fit-content; padding: .2rem .55rem; border-radius: 999px; color: #4f5d72; background: #e4e8ee; font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.status-completed .curriculum-status { color: #11643e; background: #dff5e8; }
.status-in-progress .curriculum-status { color: #304580; background: #e8edff; }
.curriculum-stage-progress { text-align: right; }
.curriculum-stage-progress progress { display: block; margin-top: .3rem; }
.curriculum-stage-body { padding: 0 1.2rem 1.2rem; border-top: 1px solid var(--line); }
.curriculum-module { margin-top: 1rem; padding: 1rem; border-radius: 12px; background: var(--canvas); }
.curriculum-module header { display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.curriculum-module header span { color: var(--primary); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.curriculum-module h4 { margin: .15rem 0; }
.curriculum-lessons { display: grid; gap: .5rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.curriculum-lessons li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .8rem; padding: .8rem; border: 1px solid var(--line); border-radius: 10px; background: white; }
.lesson-state { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #4f5d72; background: #e4e8ee; font-weight: 900; }
.lesson-status-completed .lesson-state { color: white; background: var(--success); }
.lesson-status-in-progress .lesson-state { color: white; background: var(--primary); }
.curriculum-lessons a { font-weight: 800; text-decoration: none; }
.curriculum-lessons p { margin: .15rem 0 0; font-size: .82rem; }
.planned-stage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.planned-stage-card { padding: 1.2rem; border: 1px dashed #adb8c8; border-radius: 14px; background: rgba(255,255,255,.55); }
.planned-stage-card > div { display: flex; justify-content: space-between; align-items: center; }
.planned-stage-card h3 { margin: .8rem 0 .3rem; }
.planned-stage-card p { color: var(--muted); }
.planned-stage-card ul { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.planned-stage-card li { padding: .25rem .55rem; border-radius: 999px; color: #4f5d72; background: #e4e8ee; font-size: .72rem; }
.intensive-activation { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; margin: 1.4rem 0; padding: 1.2rem; border: 1px solid #ecd989; border-radius: 14px; background: #fff8dc; }
.intensive-activation p { margin: .25rem 0 0; color: var(--muted); }
.intensive-active { display: flex; align-items: center; gap: .6rem; margin: 1.4rem 0; padding: .8rem 1rem; border: 1px solid #a8d8bd; border-radius: 10px; color: var(--success); background: var(--success-bg); font-weight: 800; }
.intensive-active span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: white; background: var(--success); }
.intensive-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin: 1.2rem 0 2rem; }
.intensive-summary article { display: grid; min-height: 105px; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: white; }
.intensive-summary span { color: var(--muted); font-size: .8rem; }
.intensive-summary strong { align-self: end; font-size: 1.65rem; }
.intensive-queue { margin-top: 1rem; }
.intensive-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; margin-bottom: .8rem; padding: 1.1rem; border: 1px solid var(--line); border-radius: 14px; background: white; }
.intensive-position { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: white; background: var(--primary); font-size: 1.1rem; font-weight: 900; }
.intensive-content .status-chip { color: #304580; background: #e8edff; }
.intensive-content h3 { margin: .45rem 0 .2rem; }
.intensive-content p { margin: .2rem 0; color: var(--muted); }
.intensive-content small { color: var(--muted); }
.intensive-action { display: grid; justify-items: end; min-width: 150px; }
.intensive-action strong { font-size: 1.5rem; }
.intensive-action span { margin-bottom: .5rem; color: var(--muted); font-size: .75rem; }
.project-catalog { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.project-catalog-card { display: flex; flex-direction: column; padding: 1.4rem; border: 1px solid var(--line); border-radius: 16px; background: white; }
.project-catalog-card.locked { background: #f7f8fb; }
.project-catalog-card h2 { margin: .8rem 0 .35rem; }
.project-catalog-card > p { margin: 0 0 1rem; color: var(--muted); }
.project-card-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: var(--muted); font-size: .8rem; }
.project-card-heading .status-chip { color: #304580; background: #e8edff; }
.project-catalog-card dl { display: flex; gap: 1.5rem; margin: auto 0 1rem; }
.project-catalog-card dl div { display: grid; }
.project-catalog-card dt { color: var(--muted); font-size: .7rem; text-transform: uppercase; }
.project-catalog-card dd { margin: .15rem 0 0; font-weight: 800; }
.project-catalog-card progress { margin-bottom: .3rem; }
.project-catalog-card > small { margin-bottom: 1rem; color: var(--muted); }
.project-lock-panel { display: grid; grid-template-columns: auto 1fr; gap: 1rem; margin: 1.5rem 0; padding: 1.4rem; border: 1px solid #e3bd66; border-radius: 16px; background: #fff8e6; }
.project-lock-panel h2 { margin-top: 0; }
.project-lock-panel progress { display: block; width: 100%; margin: 1rem 0 .35rem; }
.project-lock-icon { font-size: 2rem; }
.map-stage.locked, .curriculum-stage.locked { border-color: #d7dce5; background: #f7f8fb; }
.concept-node.locked { border-style: dashed; background: #f7f8fb; }
.project-heading { display: grid; grid-template-columns: 1fr minmax(170px, 240px); align-items: end; gap: 2rem; margin: 1.5rem 0; }
.project-heading h1 { margin: .2rem 0 .5rem; }
.project-progress { display: grid; gap: .5rem; text-align: right; }
.project-progress strong { color: var(--primary); font-size: 2rem; }
.project-complete { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; padding: 1.2rem; border: 1px solid #a8d8bd; border-radius: 14px; background: var(--success-bg); }
.project-complete > span { display: grid; place-items: center; flex: 0 0 44px; height: 44px; border-radius: 50%; color: white; background: var(--success); font-size: 1.25rem; font-weight: 900; }
.project-complete h2, .project-complete p { margin: .15rem 0; }
.project-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); align-items: start; gap: 1rem; }
.project-steps { padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: white; }
.project-steps h2 { margin: 0 0 1rem; font-size: 1rem; }
.project-steps ol { display: grid; gap: .65rem; margin: 0; padding: 0; list-style: none; }
.project-steps li { display: flex; align-items: center; gap: .7rem; padding: .7rem; border-radius: 10px; color: var(--muted); background: var(--canvas); }
.project-steps li > span { display: grid; place-items: center; flex: 0 0 30px; height: 30px; border-radius: 50%; background: #dfe5ed; font-weight: 900; }
.project-steps li div { display: grid; line-height: 1.3; }
.project-steps li small { font-size: .7rem; }
.project-steps li.current { color: #263c7c; background: #e8edff; }
.project-steps li.current > span { color: white; background: var(--primary); }
.project-steps li.completed > span { color: white; background: var(--success); }
.project-steps li.locked { opacity: .7; }
.project-workspace { min-width: 0; padding: 1.2rem; border: 1px solid var(--line); border-radius: 14px; background: white; }
.project-instruction { margin-bottom: 1rem; padding: 1rem 1.1rem; border-left: 5px solid var(--primary); border-radius: 0 10px 10px 0; background: #f2f5ff; }
.project-instruction h2 { margin: .35rem 0; }
.project-instruction p { margin: 0; }
.project-workspace > .button.large { width: 100%; margin-top: .5rem; }
.project-preview { margin: 1rem 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; }
.project-preview header { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); background: var(--canvas); }
.project-preview header span { color: var(--muted); font-size: .75rem; }
.project-preview iframe { display: block; width: 100%; min-height: 320px; border: 0; background: #f6f8fc; }
.community-compose, .community-question, .community-answer, .community-card { border: 1px solid var(--line); border-radius: 14px; background: white; }
.community-compose { margin: 1.5rem 0 2.5rem; padding: 1.25rem; }
.community-compose h2 { margin-top: 0; }
.community-compose form { display: grid; gap: 1rem; }
.community-compose label { display: grid; gap: .4rem; font-weight: 700; }
.community-compose input, .community-compose textarea { width: 100%; padding: .75rem; border: 1px solid #aeb8c8; border-radius: 9px; font: inherit; resize: vertical; }
.community-compose .button { justify-self: start; }
.community-list, .community-answers { display: grid; gap: 1rem; }
.community-card, .community-answer, .community-question { padding: 1.2rem; }
.community-card > div, .community-question > div { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.community-card h3 { margin: .8rem 0 .4rem; }
.community-card h3 a { color: var(--ink); }
.community-card p, .community-question > p, .community-answer p { white-space: pre-wrap; }
.community-card footer, .community-answer footer, .community-question small { color: var(--muted); font-size: .8rem; }
.community-question { margin: 1.5rem 0 2rem; }
.community-question h1 { margin: 1rem 0 .5rem; }
.community-answers .section-heading { margin-bottom: 0; }
.moderation-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.moderation-actions form { margin: 0; }
.button.danger { border-color: #b42318; color: #b42318; }
.admin-options { display: grid; gap: .8rem; }
.admin-option-row { display: grid; grid-template-columns: minmax(80px, .35fr) minmax(220px, 2fr) auto; gap: .75rem; align-items: end; }
.admin-option-row label { margin: 0; }
.admin-option-row .correct-option { display: flex; align-items: center; gap: .4rem; min-height: 42px; }
.admin-option-row .correct-option input { width: auto; }
.admin-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin: 1.5rem 0 2rem; }
.admin-metrics article { display: grid; min-height: 110px; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: white; }
.admin-metrics span { color: var(--muted); font-size: .82rem; }
.admin-metrics strong { align-self: end; font-size: 1.8rem; }
.admin-section { margin-top: 2.5rem; }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: white; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.admin-table th { color: var(--muted); background: var(--canvas); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table td { min-width: 110px; }
.admin-table td:first-child { min-width: 220px; }
.admin-table td:last-child { min-width: 90px; text-align: right; }
.admin-table td > strong, .admin-table td > small { display: block; }
.admin-table small { margin-top: .2rem; color: var(--muted); }
.admin-table .status-chip { color: #304580; background: #e8edff; }
.audit-list { display: grid; gap: .6rem; }
.audit-list article { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: white; }
.audit-list article div { display: grid; }
.audit-list span, .audit-list time { color: var(--muted); font-size: .82rem; }
.audit-list article > div:last-child { align-items: end; text-align: right; }
.audit-list article a { font-size: .82rem; font-weight: 700; }
.audit-metadata { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.25rem 0; }
.audit-metadata > div { display: grid; gap: .25rem; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: white; }
.audit-metadata span, .audit-metadata small, .audit-diff-grid span { color: var(--muted); font-size: .82rem; }
.audit-diff-list { display: grid; gap: 1rem; }
.audit-diff-list article { padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: white; }
.audit-diff-list h3 { margin-top: 0; }
.audit-diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.audit-diff-grid > div { min-width: 0; }
.audit-diff-grid pre { min-height: 3rem; margin: .35rem 0 0; padding: .8rem; border-radius: 8px; background: var(--surface-alt); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.audit-restore-list { display: grid; gap: .75rem; }
.audit-restore-list article { display: grid; gap: .4rem; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: white; }
.audit-restore-list pre { margin: 0; padding: .8rem; border-radius: 8px; background: var(--surface-alt); white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-form { display: grid; gap: 1rem; margin-top: 1.5rem; padding: clamp(1rem, 4vw, 2rem); border: 1px solid var(--line); border-radius: 16px; background: white; }
.admin-form textarea { resize: vertical; line-height: 1.5; }
.admin-form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.admin-form-actions { display: flex; justify-content: flex-end; gap: .8rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.admin-filters { display: grid; grid-template-columns: minmax(240px, 2fr) repeat(2, minmax(150px, 1fr)) auto auto; gap: .75rem; align-items: end; margin: 1rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: white; }
.admin-filters label { display: grid; gap: .35rem; font-size: .82rem; font-weight: 700; }
.admin-filters input, .admin-filters select { min-height: 42px; padding: .65rem; border: 1px solid #aeb8c8; border-radius: 8px; font: inherit; }
.admin-results { color: var(--muted); font-size: .88rem; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1rem; }
.preview-banner { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; padding: .9rem 1rem; border: 2px solid #c78300; border-radius: 12px; background: #fff8e6; }
.preview-banner span { flex: 1; color: #624300; }

@media (max-width: 850px) {
  .notes-filters { grid-template-columns: 1fr 1fr; }
  .notes-checkbox { grid-column: 1 / -1; }
  .profile-grid { grid-template-columns: 1fr; }
  .achievement-summary { grid-template-columns: repeat(2, 1fr); }
  .badge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .study-plan-overview { grid-template-columns: 1fr 1fr; }
  .study-goal-form { grid-column: 1 / -1; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-card { grid-template-columns: 1fr; align-items: start; }
  .hero-card .button { justify-self: start; }
  .exercise-guide ol { grid-template-columns: repeat(2, 1fr); }
  .map-summary { grid-template-columns: repeat(3, 1fr); }
  .curriculum-summary { grid-template-columns: repeat(2, 1fr); }
  .concept-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intensive-summary { grid-template-columns: repeat(2, 1fr); }
  .project-layout { grid-template-columns: 1fr; }
  .project-steps ol { grid-template-columns: repeat(3, 1fr); }
  .admin-metrics { grid-template-columns: repeat(2, 1fr); }
  .admin-filters { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .personal-notes-heading, .personal-notes-actions, .notes-list header, .notes-list footer { align-items: flex-start; flex-direction: column; }
  .personal-notes-actions .button, .notes-list footer .button { width: 100%; }
  .notes-filters { grid-template-columns: 1fr; }
  .notes-checkbox { grid-column: auto; }
  .profile-summary { align-items: flex-start; }
  .achievement-summary, .badge-grid { grid-template-columns: 1fr; }
  .certificate-list article { grid-template-columns: auto 1fr; align-items: start; }
  .certificate-list .button, .certificate-locked { grid-column: 2; justify-self: start; }
  .certificate-actions, .certificate-footer { flex-direction: column; }
  .study-plan-overview { grid-template-columns: 1fr; }
  .study-goal-form { grid-column: auto; }
  .study-task-list li { grid-template-columns: auto 1fr; align-items: start; }
  .study-task-list .button { grid-column: 2; justify-self: start; }
  .audit-metadata, .audit-diff-grid { grid-template-columns: 1fr; }
  .topbar { height: auto; padding: .75rem 1rem; align-items: flex-start; }
  .topbar .brand span:last-child { display: none; }
  .topbar nav { gap: .8rem; font-size: .85rem; }
  .page-shell { padding-top: 2rem; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .recommendation-grid { display: grid; gap: .8rem; }
  .lesson-heading { align-items: start; flex-direction: column; }
  .mode-switch { align-items: flex-start; }
  .mode-chip { margin: -1rem 0 1rem; }
  .mode-switch .mode-chip { margin: 0; }
  .learning-mode-card, .exercise-heading, .intensive-activation, .pwa-install-card { align-items: flex-start; flex-direction: column; }
  .preview-banner { align-items: flex-start; flex-direction: column; }
  .mode-options { justify-content: flex-start; }
  .guided-context { grid-template-columns: 1fr; }
  .exercise-guide ol { grid-template-columns: 1fr; }
  .step-progress { grid-template-columns: 1fr; }
  .lesson-controls, .exercise-actions { flex-direction: column-reverse; }
  .lesson-controls .button, .exercise-actions .button { width: 100%; }
  .editor-actions { flex-wrap: wrap; }
  .editor-actions .button:first-child { width: 100%; }
  .editor-shortcuts { gap: .55rem; }
  .mastery-list article { grid-template-columns: 1fr auto; }
  .mastery-list progress { grid-column: 1 / -1; grid-row: 2; }
  .practice-grid { grid-template-columns: 1fr; }
  .section-heading, .error-history-list article { align-items: flex-start; flex-direction: column; }
  .error-history-list article > div:last-child { align-items: flex-start; }
  .review-card, .challenge-card { align-items: flex-start; flex-direction: column; }
  .map-summary { grid-template-columns: repeat(2, 1fr); }
  .map-stage { margin-left: .2rem; padding-left: .9rem; }
  .map-stage > header { align-items: flex-start; flex-direction: column; }
  .stage-mastery { width: 100%; text-align: left; }
  .concept-grid { grid-template-columns: 1fr; }
  .curriculum-summary, .planned-stage-grid { grid-template-columns: 1fr; }
  .curriculum-overall { grid-template-columns: 1fr; }
  .curriculum-stage summary { grid-template-columns: auto 1fr; }
  .curriculum-stage-progress { grid-column: 2; text-align: left; }
  .curriculum-module header { align-items: flex-start; flex-direction: column; }
  .curriculum-lessons li { grid-template-columns: auto 1fr; align-items: flex-start; }
  .curriculum-lessons > li > small { grid-column: 2; }
  .intensive-card { grid-template-columns: auto 1fr; align-items: start; }
  .intensive-action { grid-column: 2; justify-items: start; }
  .project-catalog, .project-steps ol { grid-template-columns: 1fr; }
  .project-heading { grid-template-columns: 1fr; gap: .5rem; }
  .project-progress { text-align: left; }
  .project-workspace { padding: .8rem; }
  .admin-form-row { grid-template-columns: 1fr; }
  .admin-filters { grid-template-columns: 1fr; }
  .admin-option-row { grid-template-columns: 1fr; }
  .admin-form-actions { flex-direction: column-reverse; }
  .admin-form-actions .button { width: 100%; }
}

.waiting-card { max-width: 38rem; }
.waiting-position { display: grid; justify-items: center; gap: .4rem; margin: 1.5rem 0; padding: 1.25rem; border-radius: 1rem; background: var(--surface-soft, #f3f6ff); }
.waiting-position strong { color: var(--primary, #3157d5); font-size: 2.5rem; line-height: 1; }

@media print {
  body { background: white; }
  .topbar, .site-footer, .certificate-actions, .skip-link { display: none !important; }
  .certificate-page { width: 100%; margin: 0; padding: 0; }
  .certificate-sheet { min-height: 95vh; box-shadow: none; break-inside: avoid; }
}
