:root {
  --ink: #1e2a29;
  --muted: #687674;
  --line: #dce3e0;
  --soft-line: #e9eeec;
  --canvas: #f4f7f5;
  --surface: #ffffff;
  --primary: #176b55;
  --primary-dark: #10513f;
  --primary-soft: #e5f2ed;
  --blue: #2f628f;
  --blue-soft: #e9f1f8;
  --yellow: #b87508;
  --yellow-soft: #fff3d4;
  --coral: #b64a42;
  --coral-soft: #fbe9e7;
  --danger: #ad3434;
  --shadow: 0 8px 24px rgba(24, 51, 45, 0.07);
  --radius: 7px;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--canvas); }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

button, input, select { font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.48; }
button:focus-visible, input:focus-visible, select:focus-visible, .file-button:focus-within {
  outline: 3px solid rgba(47, 98, 143, 0.24);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 28px;
  color: #fff;
  background: #153f37;
  border-bottom: 3px solid #e2ad37;
}

.brand, .topbar-actions, .brand-copy { display: flex; align-items: center; }
.brand { gap: 12px; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  background: #fff;
  color: var(--primary-dark);
  font: 700 23px/1 Georgia, serif;
}
.brand-copy { align-items: flex-start; flex-direction: column; min-width: 0; }
.brand-copy strong { font-size: 20px; line-height: 1.2; }
.brand-copy small { color: rgba(255, 255, 255, 0.73); white-space: nowrap; }
.topbar-actions { gap: 14px; }
.local-badge { display: inline-flex; align-items: center; gap: 7px; color: rgba(255,255,255,.82); font-size: 13px; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #74d6a7; box-shadow: 0 0 0 3px rgba(116,214,167,.14); }
.sync-badge.offline .status-dot { background: #f2bd58; box-shadow: 0 0 0 3px rgba(242,189,88,.16); }
.sync-badge.connecting .status-dot { background: #8bc7dd; box-shadow: 0 0 0 3px rgba(139,199,221,.16); animation: sync-pulse 1.4s ease-in-out infinite; }
.topbar-icon-button { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.24); border-radius: 6px; background: rgba(255,255,255,.09); color: #fff; font-size: 20px; cursor: pointer; }
.topbar-icon-button:hover { background: rgba(255,255,255,.16); }
@keyframes sync-pulse { 50% { opacity: .42; } }
.account-button { min-height: 46px; display: grid; grid-template-columns: 32px minmax(0, 1fr) 14px; align-items: center; gap: 9px; padding: 5px 9px; border: 1px solid rgba(255,255,255,.16); border-radius: 6px; color: #fff; background: rgba(255,255,255,.08); text-align: left; }
.account-button:hover { background: rgba(255,255,255,.14); }
.account-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--primary-dark); background: #fff; font-weight: 700; }
.account-copy { min-width: 0; display: flex; flex-direction: column; }
.account-copy strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.account-copy small { color: rgba(255,255,255,.7); font-size: 10px; }
.account-chevron { color: rgba(255,255,255,.68); font-size: 16px; }

.app-layout { display: grid; grid-template-columns: 188px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.app-nav {
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 24px 14px;
  background: #fff;
  border-right: 1px solid var(--line);
}
.nav-item {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  color: #52605e;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
}
.nav-item:hover { background: #f2f6f4; }
.nav-item.active { color: var(--primary-dark); background: var(--primary-soft); font-weight: 700; }
.nav-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 5px; background: #f2f6f4; }
.nav-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active .nav-icon { background: #fff; }

.main-content { min-width: 0; width: 100%; max-width: 1500px; margin: 0 auto; padding: 30px 34px 48px; }
.view { animation: view-in 160ms ease-out; }
@keyframes view-in { from { opacity: .35; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view { animation: none; } }

.app-alert { position: sticky; top: 86px; z-index: 15; margin: 0 0 16px; padding: 11px 14px; border: 1px solid #b8d9cc; border-radius: 6px; color: #124c3c; background: #edf8f3; box-shadow: var(--shadow); }
.app-alert.error { border-color: #edb9b5; color: #8f2f2f; background: #fff0ef; }

.merge-result { margin: 12px 0 0; padding: 10px 12px; border-left: 3px solid var(--primary); color: var(--primary-dark); background: var(--primary-soft); }
.merge-result.warning { border-left-color: var(--coral); color: #8f2f2f; background: var(--coral-soft); }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading h1 { margin: 2px 0 0; font-size: 27px; line-height: 1.25; }
.eyebrow { margin: 0; color: var(--primary); font-size: 12px; font-weight: 700; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading h2, .danger-zone h2 { margin: 0; font-size: 17px; }
.section-heading p, .danger-zone p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

.primary-button, .secondary-button, .danger-button, .text-button, .icon-button, .file-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 15px;
  text-decoration: none;
  white-space: nowrap;
}
.primary-button { color: #fff; background: var(--primary); border-color: var(--primary); font-weight: 700; }
.primary-button:hover { background: var(--primary-dark); }
.secondary-button, .file-button { color: #263735; background: #fff; border-color: #bfcac6; }
.secondary-button:hover, .file-button:hover { background: #f5f8f7; }
.danger-button { color: #fff; background: var(--danger); border-color: var(--danger); font-weight: 700; }
.text-button { min-height: 34px; padding: 0 4px; color: var(--primary); background: transparent; border: 0; }
.icon-button { width: 38px; padding: 0; color: var(--muted); background: transparent; border-color: var(--line); font-size: 22px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-card { min-height: 128px; padding: 19px 20px; border: 1px solid var(--line); border-top: 3px solid #899894; border-radius: var(--radius); background: var(--surface); box-shadow: 0 3px 12px rgba(24,51,45,.035); }
.kpi-card span { display: block; color: var(--muted); font-size: 13px; }
.kpi-card strong { display: block; margin: 10px 0 3px; font-size: 29px; line-height: 1; }
.kpi-card small { color: var(--muted); }
.kpi-green { border-top-color: var(--primary); }
.kpi-blue { border-top-color: var(--blue); }
.kpi-yellow { border-top-color: #d69d26; }
.kpi-coral { border-top-color: var(--coral); }
.compact-kpis .kpi-card { min-height: 105px; }

.content-grid { display: grid; gap: 18px; margin-bottom: 18px; }
.dashboard-grid { grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); }
.roster-grid, .data-grid { grid-template-columns: minmax(310px, .8fr) minmax(440px, 1.2fr); }
.analytics-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.surface { min-width: 0; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }

.priority-list { display: grid; gap: 12px; }
.priority-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--soft-line); }
.priority-item:last-child { border-bottom: 0; }
.priority-item h3 { margin: 6px 0 4px; font-size: 17px; }
.priority-item p { margin: 0; color: var(--muted); font-size: 13px; }
.priority-progress { min-width: 180px; display: grid; gap: 7px; }
.priority-progress-copy { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.priority-progress-copy strong { color: var(--ink); font-size: 18px; }
.priority-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.dashboard-recent-surface { margin-bottom: 18px; }

.teacher-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: -4px 0 18px; border-block: 1px solid var(--line); background: rgba(255,255,255,.45); }
.teacher-flow button { min-width: 0; display: grid; grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; padding: 13px 16px; border: 0; border-right: 1px solid var(--line); color: var(--ink); background: transparent; text-align: left; }
.teacher-flow button:last-child { border-right: 0; }
.teacher-flow button:hover { background: #fff; }
.teacher-flow button > span { grid-row: 1 / 3; align-self: center; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--primary); font-weight: 700; }
.teacher-flow button:nth-child(2) > span { background: var(--blue); }
.teacher-flow button:nth-child(3) > span { color: #6d4700; background: #f1c35d; }
.teacher-flow strong { line-height: 1.25; }
.teacher-flow small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--soft-line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
td { font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
.empty-state { padding: 30px 16px; color: var(--muted); text-align: center; border: 1px dashed #ccd6d2; border-radius: 6px; background: #fafcfb; }
.tag, .status-pill, .topic-badge, .difficulty-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 2px 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.tag, .topic-badge { color: #205b4b; background: var(--primary-soft); }
.tag.demo, .status-pill.demo { color: #805300; background: var(--yellow-soft); }
.status-pill.active { color: #155843; background: #e2f4eb; }
.status-pill.ended { color: #6a5552; background: #f2eceb; }
.status-pill.completed { color: #285980; background: var(--blue-soft); }

.bar-list { display: grid; gap: 14px; }
.bar-item { display: grid; grid-template-columns: minmax(88px, 130px) minmax(90px, 1fr) 44px; gap: 10px; align-items: center; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #3d4b49; font-size: 13px; }
.bar-track { height: 9px; overflow: hidden; border-radius: 5px; background: #e9efec; }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.bar-fill.medium { background: #d09828; }
.bar-fill.low { background: var(--coral); }
.bar-value { text-align: right; font-weight: 700; }

.demo-notice { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 19px; border: 1px solid #ecd49e; border-left: 4px solid #d29b25; border-radius: var(--radius); background: #fffaf0; }
.demo-notice strong { color: #664712; }
.demo-notice p { margin: 2px 0 0; color: #796944; }

.form-surface { margin-bottom: 18px; }
.builder-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0 0 22px; padding: 0; list-style: none; border-block: 1px solid var(--soft-line); }
.builder-steps li { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; color: var(--muted); font-size: 13px; font-weight: 600; }
.builder-steps li:not(:last-child)::after { content: ""; position: absolute; right: 0; width: 1px; height: 20px; background: var(--line); }
.builder-steps span { width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid #acbab5; border-radius: 50%; font-size: 12px; }
.builder-steps li.active { color: var(--primary-dark); }
.builder-steps li.active span { color: #fff; border-color: var(--primary); background: var(--primary); }
.builder-steps li.complete { color: #3b6b5d; }
.builder-steps li.complete span { color: #fff; border-color: #5b9c83; background: #5b9c83; }
.builder-panel { min-height: 300px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.field > span, .compact-field > span { color: #53615f; font-size: 12px; font-weight: 600; }
.field input, .field select, .compact-field select, .compact-field input {
  width: 100%; min-height: 42px; padding: 8px 10px; color: var(--ink); background: #fff; border: 1px solid #bfcac6; border-radius: 5px;
}
.field-wide { grid-column: span 2; }
.check-field { display: flex; align-items: center; gap: 8px; color: #40504d; }
.check-field input { width: 18px; height: 18px; accent-color: var(--primary); }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--soft-line); }
.form-action-spacer { flex: 1 1 auto; }
.compact-field { display: inline-flex; align-items: center; gap: 8px; min-width: 140px; }
.compact-field select { min-height: 38px; padding: 6px 9px; }
.inline-form { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
.inline-form .grow { flex: 1 1 auto; }
.align-end { align-self: flex-end; }
.student-form-actions { display: flex; gap: 8px; }

.assignment-audience { margin: 22px 0 0; padding: 18px 0 0; border: 0; border-top: 1px solid var(--soft-line); }
.assignment-audience legend { padding: 0; font-size: 15px; font-weight: 700; }
.audience-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 2px 0 12px; }
.audience-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.audience-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.audience-person { min-height: 44px; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--soft-line); border-radius: 5px; background: #fafcfb; cursor: pointer; }
.audience-person:has(input:checked) { border-color: #8eb6a7; background: var(--primary-soft); }
.audience-person input { width: 18px; height: 18px; accent-color: var(--primary); }
.audience-person span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assignment-preview { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--soft-line); }
.builder-panel[data-builder-panel="3"] .assignment-preview { margin-top: 14px; }
.adaptive-toggle { min-height: 68px; display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: start; gap: 11px; margin-top: 20px; padding: 14px 16px; border: 1px solid #a9cbbd; border-radius: 6px; background: var(--primary-soft); cursor: pointer; }
.adaptive-toggle input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--primary); }
.adaptive-toggle strong, .adaptive-toggle small { display: block; }
.adaptive-toggle small { margin-top: 2px; color: #4e625d; }
.route-preview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.route-preview article { min-width: 0; display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 9px; align-items: start; padding: 13px; border: 1px solid var(--soft-line); border-radius: 6px; background: #fff; }
.route-preview strong, .route-preview small { display: block; }
.route-preview small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.route-dot { width: 10px; height: 10px; display: inline-block; margin-top: 5px; border-radius: 50%; background: #879692; }
.route-dot.support { background: var(--coral); }
.route-dot.steady { background: var(--blue); }
.route-dot.challenge { background: #c38a16; }
.publish-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--line); background: #fafcfb; }
.publish-summary > div { padding: 13px 15px; border-right: 1px solid var(--line); }
.publish-summary > div:last-child { border-right: 0; }
.publish-summary span, .publish-summary strong { display: block; }
.publish-summary span { color: var(--muted); font-size: 11px; }
.publish-summary strong { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.question-preview-item.diagnostic { border-left: 3px solid var(--blue); padding-left: 10px; }
.question-preview-item.route-support { border-left: 3px solid var(--coral); padding-left: 10px; }
.question-preview-item.route-challenge { border-left: 3px solid #c38a16; padding-left: 10px; }
.assignment-preview .section-heading h3 { margin: 0; font-size: 17px; }
.question-preview-list { display: grid; gap: 0; counter-reset: question-preview; }
.question-preview-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 64px; padding: 11px 0; border-bottom: 1px solid var(--soft-line); }
.question-preview-item:last-child { border-bottom: 0; }
.question-preview-number { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 5px; color: var(--primary-dark); background: var(--primary-soft); font-weight: 700; }
.question-preview-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.question-preview-copy small { display: block; margin-top: 3px; color: var(--muted); }

.assignment-list, .student-assignment-list, .class-list, .error-list { display: grid; gap: 10px; }
.assignment-row { display: grid; grid-template-columns: minmax(220px, 1.4fr) minmax(130px, .7fr) minmax(110px, .55fr) auto; gap: 18px; align-items: center; padding: 15px 4px; border-bottom: 1px solid var(--soft-line); }
.assignment-row:last-child { border-bottom: 0; }
.assignment-main strong { display: block; margin-bottom: 5px; font-size: 15px; }
.assignment-main small, .assignment-meta span { color: var(--muted); }
.assignment-meta { display: grid; gap: 4px; font-size: 12px; }
.row-actions { display: flex; gap: 7px; align-items: center; justify-content: flex-end; }
.small-button { min-height: 34px; padding: 0 10px; border: 1px solid #c8d2ce; border-radius: 5px; background: #fff; color: #354542; }
.small-button.danger { color: var(--danger); }

.class-list { margin-top: 12px; }
.class-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px; border: 1px solid var(--soft-line); border-radius: 6px; }
.class-item strong { display: block; }
.class-item small { color: var(--muted); }

.filter-band { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; padding: 12px 16px; border-block: 1px solid var(--line); background: rgba(255,255,255,.5); }
.filter-result { margin-left: auto; color: var(--muted); font-size: 12px; }
.route-analytics { margin-bottom: 18px; }
.route-analytics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--soft-line); }
.route-analytics-grid article { display: grid; grid-template-columns: 13px minmax(0, 1fr); gap: 10px; padding: 16px 18px 2px; border-right: 1px solid var(--soft-line); }
.route-analytics-grid article:last-child { border-right: 0; }
.route-analytics-grid small, .route-analytics-grid strong, .route-analytics-grid p { display: block; }
.route-analytics-grid small { color: var(--muted); }
.route-analytics-grid strong { margin-top: 3px; font-size: 25px; line-height: 1.1; }
.route-analytics-grid p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.error-item { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--soft-line); }
.error-item:last-child { border: 0; }
.error-rank { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 5px; color: #8c3434; background: var(--coral-soft); font-weight: 700; }
.error-copy strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 13px; }
.error-copy small { color: var(--muted); }
.error-count { color: var(--coral); font-weight: 700; white-space: nowrap; }

.data-summary { display: grid; gap: 0; margin: 0; }
.data-summary div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--soft-line); }
.data-summary div:last-child { border: 0; }
.data-summary dt { color: var(--muted); }
.data-summary dd { margin: 0; font-weight: 700; text-align: right; }
.button-stack { display: grid; gap: 10px; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-color: #ecc7c3; box-shadow: none; }
.danger-actions { display: flex; gap: 10px; }

.student-heading { position: relative; align-items: center; }
.student-heading-copy > p:last-child { margin: 6px 0 0; color: var(--muted); }
.student-selectors { display: flex; gap: 12px; }
.student-selectors .compact-field { min-width: 180px; }
.student-identity { position: relative; width: 280px; flex: 0 0 auto; }
.student-identity summary { min-height: 58px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #cbd7d2; border-radius: 6px; background: #fff; cursor: pointer; list-style: none; }
.student-identity summary::-webkit-details-marker { display: none; }
.student-identity[open] summary { border-color: #7faa9b; box-shadow: 0 0 0 3px rgba(23,107,85,.1); }
.student-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--blue); font-weight: 700; }
.student-identity-copy { min-width: 0; display: flex; flex-direction: column; }
.student-identity-copy small { color: var(--muted); }
.student-identity-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-identity-action { color: var(--primary); font-size: 12px; font-weight: 700; }
.student-identity .student-selectors { position: absolute; z-index: 25; top: calc(100% + 8px); right: 0; width: 420px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: 0 18px 44px rgba(22,49,43,.16); }
.student-today-card { min-height: 286px; display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 42px; align-items: stretch; margin-bottom: 14px; padding: 28px 30px; border: 1px solid #b9d3c9; border-top: 5px solid var(--primary); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.student-today-card.empty { border-top-color: #95a39e; }
.student-today-label { margin: 22px 0 2px; color: var(--primary); font-size: 12px; font-weight: 700; }
.student-today-card h2 { margin: 0; font-size: 26px; line-height: 1.35; }
.student-today-card h2 + p { max-width: 680px; margin: 8px 0 0; color: var(--muted); }
.status-pill.level { color: #76500b; background: var(--yellow-soft); }
.student-today-meta { display: flex; flex-wrap: wrap; gap: 20px; margin: 24px 0 0; }
.student-today-meta div { min-width: 100px; }
.student-today-meta dt { color: var(--muted); font-size: 12px; }
.student-today-meta dd { margin: 2px 0 0; font-weight: 700; }
.student-today-side { display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.student-today-action { width: 100%; min-height: 50px; }
.learning-route { display: grid; gap: 0; margin: 0; padding: 2px 0; list-style: none; }
.learning-route li { position: relative; min-height: 58px; display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: start; gap: 10px; color: #82908d; }
.learning-route li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 31px; bottom: -1px; width: 2px; background: #dfe7e4; }
.learning-route li > span { position: relative; z-index: 1; width: 32px; height: 32px; display: grid; place-items: center; border: 2px solid #cbd7d2; border-radius: 50%; background: #fff; font-weight: 700; }
.learning-route li > div { padding-top: 2px; }
.learning-route strong, .learning-route small { display: block; }
.learning-route small { margin-top: 2px; color: inherit; }
.learning-route li.active { color: var(--primary-dark); }
.learning-route li.active > span { color: #fff; border-color: var(--primary); background: var(--primary); }
.learning-route li.complete { color: #3b6b5d; }
.learning-route li.complete > span { color: #fff; border-color: #5b9c83; background: #5b9c83; }
.learning-route li.complete:not(:last-child)::after { background: #91bdaa; }
.learning-snapshot { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 18px; padding: 14px 18px; border-block: 1px solid var(--line); background: rgba(255,255,255,.58); }
.learning-snapshot > div { padding: 2px 18px; border-right: 1px solid var(--line); }
.learning-snapshot > div:first-child { padding-left: 0; }
.learning-snapshot > div:last-of-type { border-right: 0; }
.learning-snapshot span { display: block; color: var(--muted); font-size: 12px; }
.learning-snapshot strong { display: block; margin-top: 2px; font-size: 21px; }
.learning-snapshot > div:nth-child(1) strong { color: var(--blue); }
.learning-snapshot > div:nth-child(2) strong { color: var(--primary); }
.learning-snapshot > div:nth-child(3) strong { color: var(--coral); }
.learning-snapshot > div:nth-child(4) strong { color: #966300; }
.student-assignment-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 17px; border: 1px solid var(--soft-line); border-left: 4px solid var(--primary); border-radius: 6px; }
.student-assignment-card.ended { border-left-color: #9b8985; }
.student-assignment-card strong { display: block; margin: 6px 0 4px; font-size: 16px; }
.student-assignment-card p { margin: 0; color: var(--muted); font-size: 12px; }
.assignment-card-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.mistake-surface { margin-top: 18px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.student-tabbar { display: none; }

.practice-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; margin-bottom: 12px; }
.practice-title { display: flex; flex-direction: column; align-items: center; }
.practice-title span { color: var(--muted); }
.progress-track { height: 7px; overflow: hidden; margin-bottom: 22px; border-radius: 4px; background: #dfe7e4; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--primary); transition: width 180ms ease; }
.practice-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 18px; align-items: start; }
.question-surface { min-height: 0; display: flex; flex-direction: column; padding: 32px 36px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.practice-stage-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: -8px 0 22px; border-bottom: 1px solid var(--soft-line); }
.practice-stage-bar span { position: relative; min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 6px; color: #84918e; font-size: 12px; }
.practice-stage-bar span::after { content: ""; position: absolute; inset: auto 0 -1px; height: 3px; background: transparent; }
.practice-stage-bar i { width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid #bdc9c5; border-radius: 50%; font-style: normal; font-size: 10px; }
.practice-stage-bar span.active { color: var(--primary-dark); font-weight: 700; }
.practice-stage-bar span.active::after { background: var(--primary); }
.practice-stage-bar span.active i, .practice-stage-bar span.complete i { color: #fff; border-color: var(--primary); background: var(--primary); }
.practice-stage-bar span.complete { color: #507167; }
.question-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.difficulty-badge { color: #805300; background: var(--yellow-soft); }
.question-index-badge { margin-left: auto; color: var(--muted); font-size: 12px; }
.question-surface > h1 { max-width: 760px; margin: 26px 0 5px; font-size: 26px; line-height: 1.5; }
.practice-instruction { margin: 0 0 22px; color: var(--muted); }
.practice-answer-form { max-width: 720px; display: grid; gap: 11px; }
.answer-option { min-height: 54px; display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 10px; align-items: center; padding: 10px 13px; border: 1px solid #cbd5d1; border-radius: 6px; cursor: pointer; }
.answer-option:hover { border-color: #7ea99a; background: #f7fbf9; }
.answer-option.selected { border-color: var(--primary); background: var(--primary-soft); }
.answer-option input { width: 18px; height: 18px; accent-color: var(--primary); }
.answer-option.correct { border-color: #58a47e; background: #edf8f3; }
.answer-option.incorrect { border-color: #d7847d; background: #fff1f0; }
.number-answer { max-width: 360px; }
.number-answer input { min-height: 50px; width: 100%; padding: 10px 14px; border: 1px solid #bfcac6; border-radius: 6px; font-size: 18px; }
.practice-feedback { margin-top: 18px; padding: 14px 16px; border-left: 4px solid var(--primary); background: #edf8f3; }
.practice-feedback.incorrect { border-left-color: var(--coral); background: #fff1f0; }
.practice-feedback.retry { border-left-color: #d09828; background: var(--yellow-soft); }
.practice-feedback strong { display: block; margin-bottom: 4px; }
.practice-feedback p { margin: 0; }
.practice-actions { width: min(560px, 100%); display: grid; grid-template-columns: minmax(110px, .7fr) minmax(180px, 1.3fr); gap: 10px; margin-top: 28px; padding-top: 4px; }
.question-sheet { position: sticky; top: 94px; }
.question-sheet > summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: -2px 0 16px; cursor: pointer; list-style: none; }
.question-sheet > summary::-webkit-details-marker { display: none; }
.question-sheet > summary span { font-size: 17px; font-weight: 700; }
.question-sheet > summary strong { color: var(--muted); font-size: 12px; font-weight: 500; }
.question-number-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.question-number { aspect-ratio: 1; display: grid; place-items: center; border: 1px solid #cbd5d1; border-radius: 5px; color: #475653; background: #fff; }
.question-number.answered { border-color: #86b7a5; color: var(--primary-dark); background: var(--primary-soft); }
.question-number.current { color: #fff; background: var(--primary); border-color: var(--primary); font-weight: 700; }
.sheet-legend { display: flex; gap: 14px; margin-top: 16px; color: var(--muted); font-size: 12px; }
.sheet-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; border: 1px solid #cbd5d1; background: #fff; }
.legend-dot.answered { background: var(--primary-soft); border-color: #86b7a5; }
.legend-dot.current { background: var(--primary); border-color: var(--primary); }

.adaptive-route-panel { min-height: 480px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 42px; border: 1px solid #b9d3c9; border-top: 5px solid var(--primary); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); text-align: center; }
.route-panel-kicker { color: var(--primary); font-size: 12px; font-weight: 700; }
.route-panel-icon { width: 64px; height: 64px; display: grid; place-items: center; margin: 14px 0 10px; border-radius: 50%; color: #fff; background: var(--blue); font-size: 22px; font-weight: 700; }
.route-panel-icon.support { background: var(--coral); }
.route-panel-icon.challenge { background: #c38a16; }
.adaptive-route-panel h1 { margin: 0; font-size: 27px; }
.adaptive-route-panel > p { max-width: 560px; margin: 8px 0 0; color: var(--muted); }
.route-evidence { width: min(460px, 100%); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 24px; border-block: 1px solid var(--line); }
.route-evidence > div { padding: 14px; border-right: 1px solid var(--line); }
.route-evidence > div:last-child { border-right: 0; }
.route-evidence span, .route-evidence strong { display: block; }
.route-evidence span { color: var(--muted); font-size: 11px; }
.route-evidence strong { margin-top: 2px; font-size: 19px; }
.adaptive-route-panel .route-rule-note { margin-top: 12px; font-size: 11px; }
.adaptive-route-panel .primary-button { min-width: 240px; min-height: 48px; margin-top: 22px; }

.result-layout { min-height: calc(100vh - 160px); display: grid; grid-template-columns: minmax(0, 590px) 150px; align-items: center; justify-content: center; gap: 42px; }
.result-ring { grid-column: 2; grid-row: 1; width: 142px; height: 142px; display: grid; place-content: center; text-align: center; border: 9px solid var(--primary-soft); outline: 4px solid var(--primary); border-radius: 50%; background: #fff; }
.result-ring small { color: var(--muted); }
.result-ring strong { font-size: 44px; line-height: 1; }
.result-ring span { color: var(--muted); }
.result-copy h1 { margin: 6px 0 8px; font-size: 30px; }
.result-copy > p:not(.eyebrow) { color: var(--muted); }
.result-copy { grid-column: 1; grid-row: 1; width: min(590px, 100%); }
.result-route-badge { display: inline-flex; min-height: 27px; align-items: center; margin-top: 8px; padding: 2px 9px; border-radius: 4px; color: #285980; background: var(--blue-soft); font-size: 12px; font-weight: 700; }
.result-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 18px; border-block: 1px solid var(--line); }
.result-metrics > div { padding: 12px 14px; border-right: 1px solid var(--line); }
.result-metrics > div:last-child { border-right: 0; }
.result-metrics span { display: block; color: var(--muted); font-size: 12px; }
.result-metrics strong { display: block; margin-top: 2px; font-size: 22px; }
.result-metrics > div:nth-child(1) strong { color: var(--primary); }
.result-metrics > div:nth-child(2) strong { color: var(--blue); }
.result-metrics > div:nth-child(3) strong { color: var(--coral); }
.result-metrics > div:nth-child(4) strong { color: #9a690b; }
.result-insight { margin-top: 18px; padding: 14px 16px; border-left: 4px solid var(--primary); background: var(--primary-soft); }
.result-insight strong { display: block; margin-bottom: 3px; }
.result-insight p { margin: 0; color: #40504d; }
.result-topic-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.result-topic-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--soft-line); border-radius: 5px; background: #fff; }
.result-topic-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.result-actions { display: flex; gap: 10px; margin-top: 22px; }

body.practice-active .topbar, body.practice-active .app-nav { display: none; }
body.practice-active .view { animation: none; }
body.practice-active .app-layout { min-height: 100vh; display: block; }
body.practice-active .main-content { max-width: 1240px; min-height: 100vh; margin: 0 auto; }
body.student-role:not(.practice-active) .app-nav { display: none; }
body.student-role:not(.practice-active) .app-layout { display: block; }
body.student-role:not(.practice-active) .main-content { max-width: 1180px; margin: 0 auto; }

.dialog-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(20,31,29,.52); }
.dialog { width: min(430px, 100%); padding: 24px; border-radius: var(--radius); background: #fff; box-shadow: 0 24px 60px rgba(0,0,0,.24); }
.dialog h2 { margin: 0 0 8px; }
.dialog p { margin: 0; color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.account-dialog { width: min(520px, 100%); }
.account-dialog .section-heading { align-items: flex-start; }
.account-dialog-note { margin: -4px 0 18px; padding: 10px 12px; border-left: 3px solid #d39b27; color: #685936; background: #fff8e8; font-size: 12px; }
.strict-login-backdrop { z-index: 300; background: rgba(17, 36, 32, .78); }
.strict-login-dialog { width: min(460px, 100%); }
.strict-login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.strict-login-brand h2, .strict-login-brand p { margin: 0; }
.strict-login-brand p { margin-top: 3px; color: var(--muted); font-size: 13px; }
.strict-login-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.strict-login-tabs .active { color: #fff; border-color: var(--primary); background: var(--primary); }
.strict-login-form { display: grid; gap: 14px; }
.strict-login-form label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.strict-login-form input { width: 100%; }
.strict-login-message { margin: 14px 0 0; padding: 10px 12px; color: #8a2e2e; background: #fff0f0; border-radius: 8px; }
.access-code-form { align-items: end; margin-bottom: 14px; }
.access-code-result { margin: 12px 0; padding: 14px; color: #174c3d; background: #e9f7f1; border: 1px solid #aedbca; border-radius: 10px; font-weight: 700; word-break: break-word; }
.access-code-list { display: grid; gap: 8px; margin: 14px 0; }
.access-code-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; }
.access-code-item p { margin: 0; }
.access-code-item small { display: block; margin-top: 3px; color: var(--muted); }
.student-identity.identity-locked summary { cursor: default; }
.student-identity.identity-locked .student-selectors { display: none; }
.role-entry-list { display: grid; gap: 10px; }
.role-entry { min-height: 76px; display: grid; grid-template-columns: 44px minmax(0, 1fr) 16px; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: #fff; text-align: left; }
.role-entry:hover, .role-entry.active { border-color: #8fb8a9; background: var(--primary-soft); }
.role-entry-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; }
.role-entry-icon.teacher { background: var(--primary); }
.role-entry-icon.student { background: var(--blue); }
.role-entry strong, .role-entry small { display: block; }
.role-entry small { margin-top: 2px; color: var(--muted); }
.role-entry i { color: var(--muted); font-size: 24px; font-style: normal; }

@media (max-width: 1040px) {
  .main-content { padding-inline: 24px; }
  .dashboard-grid, .analytics-grid, .roster-grid, .data-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .assignment-row { grid-template-columns: minmax(200px, 1fr) 130px auto; }
  .assignment-row .assignment-meta.secondary { display: none; }
  .audience-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .publish-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .publish-summary > div:nth-child(2) { border-right: 0; }
  .publish-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 760px) {
  body { padding-bottom: 68px; }
  .topbar { min-height: 64px; padding: 9px 14px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-copy strong { font-size: 18px; }
  .brand-copy small, .sync-badge #syncStatusText { display: none; }
  .sync-badge { gap: 0; }
  .account-button { min-height: 40px; grid-template-columns: 30px auto; padding: 4px 7px; }
  .account-avatar { width: 28px; height: 28px; }
  .account-copy small, .account-chevron { display: none; }
  .app-layout { display: block; min-height: calc(100vh - 64px); }
  .app-nav { position: fixed; inset: auto 0 0; z-index: 30; width: 100%; height: 68px; flex-direction: row; justify-content: space-around; gap: 2px; padding: 6px 8px; border-top: 1px solid var(--line); border-right: 0; box-shadow: 0 -8px 22px rgba(24,51,45,.07); }
  .nav-item { min-width: 0; flex: 1 1 0; min-height: 55px; flex-direction: column; justify-content: center; gap: 2px; padding: 2px; font-size: 11px; }
  .nav-icon { width: 23px; height: 23px; }
  .main-content { padding: 22px 14px 30px; }
  .app-alert { top: 72px; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 23px; }
  .page-heading > .primary-button { min-height: 38px; padding-inline: 11px; }
  .teacher-flow button { grid-template-columns: 24px minmax(0, 1fr); column-gap: 6px; padding: 10px 8px; }
  .teacher-flow button > span { width: 24px; height: 24px; font-size: 12px; }
  .teacher-flow strong { font-size: 12px; }
  .teacher-flow small { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-card { min-height: 106px; padding: 15px; }
  .kpi-card strong { font-size: 25px; }
  .surface { padding: 17px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .builder-steps li { gap: 5px; font-size: 12px; }
  .builder-panel { min-height: 0; }
  .route-preview { grid-template-columns: 1fr; }
  .publish-summary { grid-template-columns: 1fr; }
  .publish-summary > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .publish-summary > div:last-child { border-bottom: 0; }
  .audience-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .question-preview-item { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; }
  .question-preview-copy strong { white-space: normal; }
  .assignment-row { grid-template-columns: 1fr auto; gap: 10px; }
  .assignment-row .assignment-meta { grid-column: 1 / -1; grid-row: 2; }
  .filter-band { overflow-x: auto; align-items: flex-end; margin-inline: -14px; padding-inline: 14px; }
  .filter-band .compact-field { flex-direction: column; align-items: flex-start; min-width: 170px; }
  .filter-result { display: none; }
  .route-analytics-grid { grid-template-columns: 1fr; }
  .route-analytics-grid article { border-right: 0; border-bottom: 1px solid var(--soft-line); }
  .route-analytics-grid article:last-child { border-bottom: 0; }
  .inline-form { flex-wrap: wrap; }
  .inline-form .field { flex: 1 1 120px; }
  .inline-form .align-end { flex: 1 0 100%; }
  .student-form-actions .primary-button, .student-form-actions .secondary-button { flex: 1 1 0; }
  .demo-notice, .danger-zone { align-items: flex-start; flex-direction: column; }
  .danger-actions { width: 100%; flex-direction: column; }
  .student-heading { flex-direction: column; }
  .student-heading-copy { width: 100%; }
  .student-identity { width: 100%; }
  .student-identity .student-selectors { position: static; width: 100%; margin-top: 8px; box-shadow: none; }
  .student-selectors { width: 100%; }
  .student-selectors .compact-field { min-width: 0; flex: 1 1 0; flex-direction: column; align-items: stretch; }
  .student-today-card { min-height: 0; grid-template-columns: 1fr; gap: 20px; padding: 20px 18px; border-top-width: 4px; }
  .student-today-card h2 { font-size: 23px; }
  .student-today-label { margin-top: 18px; }
  .student-today-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .student-today-meta div { min-width: 0; }
  .student-today-action { width: 100%; }
  .student-today-side { gap: 14px; }
  .learning-route { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .learning-route li { min-height: 70px; grid-template-columns: 1fr; justify-items: center; gap: 4px; text-align: center; }
  .learning-route li:not(:last-child)::after { left: calc(50% + 18px); right: calc(-50% + 18px); top: 15px; bottom: auto; width: auto; height: 2px; }
  .learning-route li > span { width: 30px; height: 30px; }
  .learning-route li > div { padding: 0; }
  .learning-route strong { font-size: 12px; }
  .learning-route small { font-size: 10px; }
  .learning-snapshot { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 12px 0; }
  .learning-snapshot > div { padding: 0 9px; text-align: center; }
  .learning-snapshot > div:first-child { padding-left: 9px; }
  .learning-snapshot strong { font-size: 19px; }
  .student-assignment-card { grid-template-columns: 1fr; }
  .student-assignment-card .primary-button { width: 100%; }
  .student-tabbar { position: fixed; inset: auto 0 0; z-index: 34; height: 66px; display: grid; grid-template-columns: repeat(4, 1fr); padding: 5px 8px max(5px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.98); box-shadow: 0 -8px 22px rgba(24,51,45,.08); }
  .student-tabbar button { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; color: var(--muted); background: transparent; font-size: 11px; }
  .student-tabbar button::before { content: ""; position: absolute; top: -5px; width: 28px; height: 3px; background: transparent; }
  .student-tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .student-tabbar button.active { color: var(--primary-dark); font-weight: 700; }
  .student-tabbar button.active::before { background: var(--primary); }
  .practice-header { position: sticky; top: 0; z-index: 18; grid-template-columns: auto 1fr auto; gap: 7px; margin-inline: -10px; padding: 0 10px 10px; background: var(--canvas); }
  .practice-header button { min-height: 38px; padding: 0 9px; }
  .practice-title span { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .practice-layout { grid-template-columns: 1fr; }
  .question-surface { min-height: 0; padding: 16px 4px 92px; border: 0; background: transparent; box-shadow: none; }
  .practice-stage-bar { margin: -4px 0 18px; }
  .practice-stage-bar span { min-height: 36px; font-size: 11px; }
  .question-surface > h1 { margin: 20px 0 5px; font-size: 22px; }
  .practice-instruction { margin-bottom: 18px; }
  .number-answer { max-width: none; }
  .number-answer input { min-height: 56px; background: #fff; }
  .answer-option { min-height: 58px; background: #fff; }
  .practice-feedback { margin-top: 14px; border-radius: 5px; }
  .practice-actions { position: fixed; inset: auto 0 0; z-index: 35; width: 100%; grid-template-columns: .72fr 1.28fr; gap: 8px; margin: 0; padding: 10px 14px max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; box-shadow: 0 -8px 22px rgba(24,51,45,.08); }
  .practice-actions button { padding-inline: 8px; }
  .question-sheet { position: static; order: -1; margin: -4px 0 0; padding: 11px 13px; box-shadow: none; }
  .question-sheet > summary { margin: 0; }
  .question-sheet > summary::after { content: "展开"; margin-left: auto; color: var(--primary); font-size: 12px; font-weight: 700; }
  .question-sheet[open] > summary { margin-bottom: 13px; }
  .question-sheet[open] > summary::after { content: "收起"; }
  .question-number-grid { grid-template-columns: repeat(8, 1fr); }
  .adaptive-route-panel { min-height: calc(100vh - 155px); padding: 32px 20px 96px; border-width: 0; border-top-width: 4px; box-shadow: none; }
  .adaptive-route-panel h1 { font-size: 24px; }
  .adaptive-route-panel .primary-button { width: 100%; min-width: 0; }
  .result-layout { min-height: calc(100vh - 150px); display: flex; flex-direction: column; gap: 24px; text-align: center; }
  .result-copy { order: 1; }
  .result-ring { order: 2; width: 118px; height: 118px; }
  .result-ring strong { font-size: 36px; }
  .result-copy h1 { font-size: 25px; }
  .result-actions { justify-content: center; }
  .field input, .field select, .compact-field select, .compact-field input, .number-answer input { font-size: 16px; }
  body.practice-active { padding-bottom: 0; }
  body.practice-active .main-content { padding-top: 10px; padding-bottom: 24px; }
  body.student-role:not(.practice-active) { padding-bottom: 66px; }
}

@media (max-width: 390px) {
  .brand-copy small { display: none; }
  .account-copy strong { max-width: 78px; }
  .main-content { padding-inline: 10px; }
  .kpi-grid { gap: 8px; }
  .kpi-card { padding: 13px; }
  .student-selectors { flex-direction: column; }
  .student-identity .student-selectors { padding: 12px; }
  .audience-list { grid-template-columns: 1fr; }
  .learning-snapshot { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 0; }
  .learning-snapshot > div:nth-child(2) { border-right: 0; }
  .result-topic-list { grid-template-columns: 1fr; }
  .result-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-metrics > div { display: flex; align-items: center; justify-content: space-between; border-right: 0; border-bottom: 1px solid var(--line); }
  .result-metrics > div:nth-child(odd) { border-right: 1px solid var(--line); }
  .result-metrics > div:nth-last-child(-n+2) { border-bottom: 0; }
  .question-number-grid { grid-template-columns: repeat(6, 1fr); }
  .practice-title { font-size: 12px; }
}
