:root {
  color-scheme: light;
  --ink: #17211e;
  --ink-soft: #53615d;
  --ink-faint: #7a8783;
  --paper: #fffdfa;
  --paper-warm: #faf8f3;
  --canvas: #f2f2ee;
  --line: #dce2df;
  --line-strong: #cbd4d0;
  --green-950: #12342f;
  --green-900: #173d36;
  --green-800: #205448;
  --green-700: #28715f;
  --green-600: #34856f;
  --green-100: #e4f1ec;
  --green-50: #f0f7f4;
  --red-700: #a94135;
  --red-600: #c55345;
  --red-100: #f8e8e5;
  --red-50: #fdf4f2;
  --amber-700: #9b6423;
  --amber-100: #f6ead7;
  --blue-700: #376d86;
  --shadow-sm: 0 1px 2px rgba(23, 33, 30, 0.04), 0 5px 18px rgba(23, 33, 30, 0.04);
  --shadow-md: 0 16px 45px rgba(20, 42, 36, 0.14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --sidebar-width: 224px;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(52, 133, 111, 0.2);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 24px 14px 18px;
  color: #dbe9e4;
  background: var(--green-950);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 48px;
  padding: 0 10px;
  margin-bottom: 28px;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: white;
  background: #2d7e69;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
}

.brand-mark span {
  font-family: Georgia, serif;
  font-size: 23px;
  line-height: 1;
  transform: translateY(-1px);
}

.brand-mark i {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 5px;
  height: 5px;
  background: #f0b665;
  border-radius: 50%;
}

.brand > div:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.brand strong {
  color: white;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 22px;
  font-weight: 700;
}

.brand > div:last-child span {
  color: #97b4aa;
  font-size: 11px;
}

.main-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  height: 44px;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  color: #a9c0b8;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 14px;
  text-align: left;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.nav-item:hover {
  color: #edf6f2;
  background: rgba(255, 255, 255, 0.055);
}

.nav-item.is-active {
  color: white;
  background: rgba(71, 157, 133, 0.2);
  border-color: rgba(117, 192, 171, 0.14);
}

.nav-item.is-active::before {
  position: absolute;
  left: -14px;
  width: 3px;
  height: 22px;
  background: #79bea9;
  border-radius: 0 4px 4px 0;
  content: "";
}

.nav-item em {
  display: grid;
  min-width: 22px;
  height: 20px;
  place-items: center;
  margin-left: auto;
  padding: 0 6px;
  color: #cbe3da;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  font-size: 11px;
  font-style: normal;
}

.sidebar-spacer {
  flex: 1;
}

.class-card {
  padding: 13px 14px;
  margin: 0 2px 13px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 11px;
}

.eyebrow {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 700;
}

.eyebrow.accent {
  color: var(--green-700);
}

.class-card .eyebrow {
  display: block;
  margin-bottom: 6px;
  color: #8fab9f;
}

.class-card > strong {
  color: white;
  font-size: 14px;
  font-weight: 650;
}

.class-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 9px;
  color: #92aca2;
  font-size: 11px;
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 3px;
  background: #6fc2a7;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(111, 194, 167, 0.1);
}

.class-meta button,
.teacher-profile button {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  padding: 0;
  color: #91aba1;
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.class-meta button:hover,
.teacher-profile button:hover {
  color: white;
  background: rgba(255, 255, 255, 0.07);
}

.class-meta .icon {
  width: 14px;
  height: 14px;
}

.teacher-profile {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  padding: 12px 7px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.avatar,
.teacher-profile .avatar {
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-style: normal;
  font-weight: 700;
}

.teacher-profile .avatar {
  width: 36px;
  height: 36px;
  color: #14382f;
  background: #d3e4dd;
  font-size: 13px;
}

.teacher-profile div:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.teacher-profile strong {
  overflow: hidden;
  color: #f5faf8;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-profile span {
  color: #86a197;
  font-size: 10px;
}

.main-area {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 0 clamp(18px, 2.4vw, 34px) 36px;
}

.topbar {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.breadcrumb {
  margin: 0 0 5px;
  color: var(--ink-faint);
  font-size: 11px;
}

.topbar h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.topbar-actions,
.assignment-actions,
.paper-tools {
  display: flex;
  align-items: center;
  gap: 9px;
}

.prototype-badge {
  padding: 4px 8px;
  color: var(--green-700);
  background: var(--green-100);
  border: 1px solid #d4e8e0;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.prototype-badge.is-online {
  color: var(--green-700);
  background: var(--green-100);
  border-color: #cfe4dc;
}

.prototype-badge.is-checking {
  color: var(--amber-700);
  background: var(--amber-100);
  border-color: #ead7b8;
}

.prototype-badge.is-offline {
  color: var(--red-700);
  background: var(--red-100);
  border-color: #efd1cc;
}

.button {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 650;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
  text-decoration: none;
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-primary {
  color: white;
  background: var(--green-700);
  border: 1px solid var(--green-700);
  box-shadow: 0 1px 2px rgba(18, 52, 47, 0.12);
}

.button-primary:hover:not(:disabled) {
  background: var(--green-800);
  border-color: var(--green-800);
}

.button-quiet {
  color: #34443f;
  background: white;
  border: 1px solid var(--line-strong);
}

.button-quiet:hover:not(:disabled) {
  color: var(--green-700);
  background: var(--green-50);
  border-color: #b7cec5;
}

.icon-button {
  display: inline-grid;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  color: #53625d;
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.icon-button:hover {
  color: var(--green-700);
  background: var(--green-50);
  border-color: #b7cec5;
}

.icon-button.compact {
  width: 31px;
  height: 31px;
  border-color: var(--line);
  border-radius: 8px;
}

.icon-button.compact .icon {
  width: 15px;
  height: 15px;
}

.notification-button {
  position: relative;
}

.notification-button i {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  background: var(--red-600);
  border: 2px solid white;
  border-radius: 50%;
}

.view {
  display: none;
  animation: view-in 220ms ease both;
}

.view.is-active {
  display: block;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.assignment-strip {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.assignment-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.student-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--green-800);
  background: #dfece7;
  border-radius: 10px;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 18px;
  font-weight: 700;
}

.title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.title-row h2 {
  overflow: hidden;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-identity p {
  margin: 5px 0 0;
  color: var(--ink-faint);
  font-size: 11px;
}

.status-chip {
  display: inline-flex;
  height: 24px;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.status-chip i {
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
}

.status-chip.success {
  color: var(--green-700);
  background: var(--green-100);
}

.status-chip.processing {
  color: var(--blue-700);
  background: #e8f1f5;
}

.status-chip.processing i {
  animation: blink 1.2s ease infinite;
}

.status-chip.warning {
  color: var(--amber-700);
  background: var(--amber-100);
}

@keyframes blink {
  50% { opacity: 0.25; }
}

.score-overview {
  display: grid;
  min-height: 92px;
  grid-template-columns: 190px repeat(3, minmax(104px, 0.55fr)) minmax(260px, 1.6fr);
  align-items: stretch;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.score-main,
.metric,
.overview-insight {
  display: flex;
  align-items: center;
  padding: 15px 18px;
}

.score-main,
.metric {
  border-right: 1px solid var(--line);
}

.score-main {
  gap: 12px;
}

.score-ring {
  position: relative;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
}

.score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring circle {
  fill: none;
  stroke-width: 6;
}

.ring-track {
  stroke: #e4ebe7;
}

.ring-value {
  stroke: var(--green-600);
  stroke-dasharray: 188.5;
  stroke-dashoffset: 33.9;
  stroke-linecap: round;
}

.score-ring > strong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.score-main > div:last-child,
.metric {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
}

.score-main span,
.metric span {
  color: var(--ink-faint);
  font-size: 10px;
  white-space: nowrap;
}

.score-main > div:last-child > strong {
  font-size: 13px;
}

.metric strong {
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}

.metric strong b {
  font: inherit;
}

.metric small {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 500;
}

.text-success { color: var(--green-700); }
.text-error { color: var(--red-600); }

.overview-insight {
  gap: 11px;
  background: var(--green-50);
  border-radius: 0 0 11px 0;
}

.insight-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--green-700);
  background: white;
  border: 1px solid #d5e7df;
  border-radius: 9px;
}

.overview-insight span {
  color: var(--green-700);
  font-size: 10px;
  font-weight: 750;
}

.overview-insight p {
  margin: 4px 0 0;
  color: #40514b;
  font-size: 11px;
  line-height: 1.5;
}

.grading-workspace {
  display: grid;
  min-height: 650px;
  grid-template-columns: 166px minmax(390px, 1fr) minmax(340px, 0.82fr);
  gap: 12px;
  margin-top: 14px;
}

.question-rail,
.paper-panel,
.analysis-panel,
.knowledge-filter,
.mastery-panel {
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.question-rail {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.panel-heading {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.panel-heading > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.panel-heading span {
  color: var(--ink-faint);
  font-size: 9px;
}

.panel-heading strong {
  font-size: 13px;
}

.question-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px 5px;
  color: var(--ink-faint);
  font-size: 9px;
}

.question-legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.legend-dot.correct { background: var(--green-600); }
.legend-dot.wrong { background: var(--red-600); }

.question-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  padding: 7px 8px 12px;
}

.question-button {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 49px;
  grid-template-columns: 28px 1fr 16px;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
  transition: background 150ms ease, border-color 150ms ease;
}

.question-button:hover {
  background: var(--paper-warm);
  border-color: var(--line);
}

.question-button.is-active {
  background: var(--green-50);
  border-color: #cbe0d8;
}

.question-button.is-active::before {
  position: absolute;
  left: -9px;
  width: 3px;
  height: 24px;
  background: var(--green-600);
  border-radius: 0 3px 3px 0;
  content: "";
}

.question-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #55645f;
  background: #f1f3f1;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.question-button.is-active .question-index {
  color: white;
  background: var(--green-700);
}

.question-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.question-info strong {
  overflow: hidden;
  color: #34423e;
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-info span {
  color: var(--ink-faint);
  font-size: 9px;
}

.question-state {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
}

.question-state .icon {
  width: 11px;
  height: 11px;
  stroke-width: 2.4;
}

.question-state.correct {
  color: white;
  background: var(--green-600);
}

.question-state.wrong {
  color: white;
  background: var(--red-600);
}

.question-state.partial {
  color: var(--amber-700);
  background: var(--amber-100);
}

.paper-panel,
.analysis-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.paper-toolbar,
.analysis-header {
  display: flex;
  min-height: 58px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.paper-toolbar > div:first-child,
.analysis-header > div:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.paper-kicker {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 700;
}

.paper-toolbar strong,
.analysis-header strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-indicator {
  color: var(--ink-faint);
  font-size: 9px;
}

.paper-scroll {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: clamp(16px, 2.2vw, 28px);
  background: #e8e9e5;
}

.paper-sheet {
  position: relative;
  min-height: 540px;
  padding: clamp(26px, 4vw, 48px);
  overflow: hidden;
  background-color: #fffefb;
  background-image:
    linear-gradient(rgba(62, 115, 99, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 115, 99, 0.045) 1px, transparent 1px);
  background-size: 25px 25px;
  border: 1px solid #d5d8d4;
  box-shadow: 0 12px 30px rgba(32, 44, 39, 0.08);
}

.paper-sheet::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--green-700);
  content: "";
}

.paper-watermark {
  padding-bottom: 12px;
  margin-bottom: 24px;
  color: #92a09c;
  border-bottom: 1px solid rgba(83, 97, 93, 0.18);
  font-size: 9px;
}

.problem-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  margin-bottom: 14px;
  color: white;
  background: var(--ink);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.paper-sheet h3 {
  margin: 0;
  color: #1a2421;
  font-family: "Cambria Math", "STSong", "SimSun", serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.85;
}

.student-work-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 27px 0 10px;
  color: #697671;
  font-size: 10px;
}

.student-work-label span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #35433e;
  border: 1px solid #bfc7c3;
  border-radius: 50%;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 12px;
}

.student-work {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 8px;
  font-family: "KaiTi", "STKaiti", "Cambria Math", serif;
  font-size: 17px;
  line-height: 1.85;
}

.work-line {
  position: relative;
  display: flex;
  min-height: 37px;
  align-items: center;
  padding: 2px 36px 2px 7px;
  border-radius: 6px;
}

.work-line.is-error {
  color: #7c2922;
  background: rgba(197, 83, 69, 0.08);
  text-decoration-color: rgba(197, 83, 69, 0.5);
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-underline-offset: 5px;
}

.work-line.is-correct {
  color: #283a34;
}

.work-line.is-neutral {
  color: #596762;
  background: #f3f5f3;
}

.markup-symbol {
  position: absolute;
  right: 8px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: white;
  border-radius: 50%;
  font-family: "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 700;
}

.markup-symbol.wrong { background: var(--red-600); }
.markup-symbol.correct { background: var(--green-600); }

.teacher-annotation {
  position: relative;
  max-width: 92%;
  padding: 9px 12px;
  margin: 2px 0 4px 8px;
  color: var(--red-700);
  background: var(--red-50);
  border-left: 2px solid var(--red-600);
  border-radius: 0 7px 7px 0;
  font-family: "Segoe UI", "PingFang SC", sans-serif;
  font-size: 10px;
  line-height: 1.55;
}

.paper-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  margin-top: 26px;
  color: var(--green-700);
  background: rgba(228, 241, 236, 0.9);
  border: 1px solid #cee3da;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 650;
}

.paper-note .icon {
  width: 13px;
  height: 13px;
}

.analysis-header {
  min-height: 58px;
}

.ai-label {
  display: inline-flex;
  height: 25px;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  color: var(--green-700);
  background: var(--green-100);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 750;
}

.ai-label .icon {
  width: 12px;
  height: 12px;
}

.analysis-tabs {
  display: flex;
  height: 42px;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 20px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.analysis-tabs button {
  position: relative;
  height: 42px;
  padding: 0 2px;
  color: var(--ink-faint);
  background: transparent;
  border: 0;
  font-size: 11px;
  font-weight: 650;
}

.analysis-tabs button.is-active {
  color: var(--green-700);
}

.analysis-tabs button.is-active::after {
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  background: var(--green-700);
  border-radius: 2px 2px 0 0;
  content: "";
}

.analysis-scroll {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.verdict {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 13px;
  margin-bottom: 17px;
  background: var(--red-50);
  border: 1px solid #f0d4cf;
  border-radius: 10px;
}

.verdict.correct {
  background: var(--green-50);
  border-color: #cfe4dc;
}

.verdict > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.verdict-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: white;
  background: var(--red-600);
  border-radius: 50%;
}

.verdict.correct .verdict-icon { background: var(--green-600); }

.verdict-icon .icon {
  width: 17px;
  height: 17px;
  stroke-width: 2.5;
}

.verdict-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.verdict-copy span {
  color: var(--ink-faint);
  font-size: 9px;
}

.verdict-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.verdict-score {
  color: var(--red-700);
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.verdict.correct .verdict-score { color: var(--green-700); }

.analysis-section {
  margin-bottom: 18px;
}

.analysis-section > h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
  font-size: 11px;
}

.analysis-section > h3 span {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 500;
}

.process-list {
  display: flex;
  flex-direction: column;
}

.process-row {
  display: grid;
  min-height: 39px;
  grid-template-columns: 19px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  color: #41504b;
  font-size: 10px;
}

.process-marker {
  position: relative;
  z-index: 1;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  color: white;
  background: var(--green-600);
  border-radius: 50%;
}

.process-marker::after {
  position: absolute;
  z-index: -1;
  top: 17px;
  width: 1px;
  height: 22px;
  background: var(--line);
  content: "";
}

.process-row:last-child .process-marker::after { display: none; }

.process-marker .icon {
  width: 10px;
  height: 10px;
  stroke-width: 2.5;
}

.process-marker.wrong { background: var(--red-600); }
.process-marker.partial { color: var(--amber-700); background: var(--amber-100); }
.process-marker.review { color: var(--amber-700); background: var(--amber-100); }

.process-row p {
  margin: 1px 0 0;
  line-height: 1.45;
}

.process-row p strong {
  display: block;
  margin-bottom: 2px;
  color: #27342f;
  font-size: 10px;
}

.process-row > strong {
  color: #34443f;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.error-analysis {
  padding: 11px 12px;
  color: #57332f;
  background: var(--red-50);
  border-left: 3px solid var(--red-600);
  border-radius: 0 9px 9px 0;
}

.error-analysis strong {
  display: block;
  margin-bottom: 5px;
  color: var(--red-700);
  font-size: 10px;
}

.error-analysis p {
  margin: 0;
  font-size: 10px;
  line-height: 1.65;
}

.error-analysis.correct-analysis {
  color: #37564c;
  background: var(--green-50);
  border-left-color: var(--green-600);
}

.error-analysis.correct-analysis strong {
  color: var(--green-700);
}

.knowledge-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.knowledge-tags span {
  padding: 5px 8px;
  color: #476159;
  background: #edf2ef;
  border-radius: 6px;
  font-size: 9px;
}

.comment-box {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  padding: 9px 10px;
  color: #35413d;
  background: #fafaf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 10px;
  line-height: 1.55;
}

.analysis-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 8px;
  padding: 11px 13px;
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.analysis-actions .button {
  padding: 0 9px;
  font-size: 11px;
}

/* Secondary views */
.section-intro {
  display: flex;
  min-height: 124px;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 22px 24px;
  margin-bottom: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.section-intro h2 {
  margin: 5px 0 7px;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.section-intro p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 12px;
}

.student-link-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 9px;
}

.compact-intro {
  min-height: 112px;
}

.class-management-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.managed-class-card {
  display: flex;
  min-height: 230px;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.managed-class-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.managed-class-icon { display: grid; width: 43px; height: 43px; place-items: center; color: white; background: var(--green-700); border-radius: 11px; font-size: 18px; font-weight: 800; }
.managed-class-card h3 { margin: 6px 0 7px; font-size: 21px; }
.managed-class-card p { margin: 0; color: var(--ink-faint); font-size: 14px; }
.managed-class-card p strong { color: var(--ink); font-size: 20px; font-variant-numeric: tabular-nums; }
.managed-class-card .button { align-self: stretch; margin-top: 18px; }
.class-empty-state { grid-column: 1 / -1; padding: 54px 24px; color: var(--ink-faint); background: var(--paper); border: 1px dashed var(--line-strong); border-radius: var(--radius-md); text-align: center; }
.class-empty-state strong { display: block; color: var(--ink); font-size: 19px; }
.class-empty-state p { margin: 8px 0 18px; font-size: 14px; }.class-empty-state.compact { padding: 28px 18px; }

.class-create-modal { width: min(560px, 100%); }
.class-create-form { padding: 22px 24px 24px; }
.class-create-form .form-grid { margin-bottom: 0; }

.class-detail-sheet { width: min(680px, 100%); }
.class-detail-loading { padding: 50px 20px; color: var(--ink-faint); text-align: center; }
.class-join-panel { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: center; padding: 20px; background: var(--green-50); border: 1px solid #d0e4dc; border-radius: 12px; }
.class-join-panel > img { width: 220px; height: 220px; padding: 10px; background: white; border: 1px solid var(--line); border-radius: 11px; }
.class-join-panel h3 { margin: 6px 0 7px; font-size: 24px; }.class-join-panel p { margin: 0 0 16px; color: var(--ink-faint); font-size: 14px; line-height: 1.65; }
.class-join-panel label { display: flex; flex-direction: column; gap: 7px; }.class-join-panel label span { font-size: 13px; font-weight: 700; }.class-join-panel input { width: 100%; height: 40px; padding: 0 10px; color: var(--ink-soft); background: white; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.class-link-actions { display: flex; gap: 8px; margin-top: 10px; }.class-link-actions .button { flex: 1; padding-inline: 9px; }
.class-assignment-section, .class-student-section { margin-top: 24px; }
.class-section-count { color: var(--green-700); font-size: 13px; font-weight: 750; }
.class-assignment-form { display: grid; grid-template-columns: 1.15fr 1.25fr 1fr auto; gap: 9px; align-items: end; padding: 14px; background: #f7f8f5; border: 1px solid var(--line); border-radius: 11px; }
.class-assignment-form label { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
.class-assignment-form label span { font-size: 12px; font-weight: 700; }
.class-assignment-form input { width: 100%; min-width: 0; height: 40px; padding: 0 10px; background: white; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 13px; }
.class-assignment-form input:focus { outline: 3px solid rgba(41, 112, 91, .12); border-color: var(--green-600); }
.class-assignment-form .button { min-height: 40px; padding-inline: 13px; }
.class-assignment-list { margin-top: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.class-assignment-list article { display: grid; min-height: 64px; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.class-assignment-list article:last-child { border-bottom: 0; }
.class-assignment-list article > div { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.class-assignment-list strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.class-assignment-list small { overflow: hidden; color: var(--ink-faint); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.assignment-state { padding: 5px 8px; color: var(--green-700); background: var(--green-50); border-radius: 999px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.assignment-state.closed { color: var(--ink-faint); background: #eef0ed; }.assignment-state.draft { color: #8b5c21; background: #f8ecd9; }
.class-student-list { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.class-student-list > div { display: grid; min-height: 64px; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 13px; border-bottom: 1px solid var(--line); }.class-student-list > div:last-child { border-bottom: 0; }
.class-student-name { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.class-student-list strong { font-size: 14px; }.class-student-list small { color: var(--ink-faint); font-size: 12px; }
.class-student-actions { display: flex; align-items: center; gap: 3px; }
.class-student-actions button { padding: 7px 8px; color: var(--green-700); background: transparent; border: 0; border-radius: 7px; font-size: 12px; font-weight: 700; }
.class-student-actions button:hover { background: var(--green-50); }
.student-filter-bar { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 13px; color: var(--green-800); background: var(--green-50); border: 1px solid #cfe1da; border-top: 0; font-size: 13px; }
.student-filter-bar strong { font-size: 14px; }.student-filter-bar button { padding: 6px 10px; color: var(--green-700); background: white; border: 1px solid #bdd5cc; border-radius: 7px; font-size: 12px; font-weight: 700; }

.command-bar {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.search-box {
  display: flex;
  width: min(310px, 35%);
  min-width: 205px;
  height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  color: var(--ink-faint);
  background: #fafbf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.search-box input {
  min-width: 0;
  flex: 1;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 11px;
}

.search-box .icon {
  width: 15px;
  height: 15px;
}

.select-button {
  display: flex;
  height: 38px;
  align-items: center;
  gap: 15px;
  padding: 0 11px;
  color: #53615d;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
}

.select-button .icon {
  width: 13px;
  height: 13px;
  transform: rotate(90deg);
}

.result-count {
  margin-left: auto;
  color: var(--ink-faint);
  font-size: 10px;
}

.data-table-wrap {
  overflow-x: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.submission-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.submission-metrics > div {
  display: grid;
  min-height: 96px;
  grid-template-columns: auto 1fr;
  align-content: center;
  align-items: baseline;
  gap: 5px 9px;
  padding: 15px 20px;
  border-right: 1px solid var(--line);
}

.submission-metrics > div:last-child { border-right: 0; }
.submission-metrics span { grid-column: 1 / -1; color: var(--ink-faint); font-size: 12px; }
.submission-metrics strong { font-size: 27px; font-variant-numeric: tabular-nums; }
.submission-metrics small { color: var(--ink-faint); font-size: 11px; }
.submission-metrics .attention strong { color: var(--red-600); }

.table-empty-state {
  padding: 38px 20px;
  color: var(--ink-faint);
  font-size: 14px;
  text-align: center;
}

.submission-source {
  display: inline-block;
  padding: 3px 6px;
  margin-left: 5px;
  color: var(--green-700);
  background: var(--green-100);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
}

.review-sheet {
  display: flex;
  width: min(600px, 100%);
  height: 100%;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
  box-shadow: -16px 0 45px rgba(20, 42, 36, .16);
  animation: sheet-in 260ms ease both;
}

.review-sheet-scroll {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 22px;
}

.review-summary {
  padding: 18px;
  margin-bottom: 14px;
  background: var(--green-50);
  border: 1px solid #d0e4dc;
  border-radius: 11px;
}

.review-summary-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.review-summary h3 { margin: 4px 0 5px; font-size: 20px; }
.review-summary p { margin: 0; color: var(--ink-faint); font-size: 13px; }
.review-big-score { color: var(--green-700); font-size: 26px; font-weight: 800; white-space: nowrap; }
.review-ai-summary { margin: 15px 0 0; color: #40514b; font-size: 14px; line-height: 1.7; }
.review-note-box { padding: 13px 14px; margin-bottom: 14px; color: #644e2e; background: #faf4e8; border-left: 3px solid #bd8742; border-radius: 0 9px 9px 0; font-size: 13px; line-height: 1.6; }
.review-question-list { display: flex; flex-direction: column; gap: 10px; }
.review-question { padding: 14px; background: #fafbf9; border: 1px solid var(--line); border-radius: 10px; }
.review-question-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.review-question-head strong { font-size: 14px; }.review-question-head span { color: var(--green-700); font-size: 14px; font-weight: 800; }
.review-question.is-wrong .review-question-head span { color: var(--red-600); }
.review-question p { margin: 0; font-family: "Cambria Math", "STSong", serif; font-size: 14px; line-height: 1.65; }
.review-question small { display: block; margin-top: 8px; color: var(--ink-faint); font-size: 12px; line-height: 1.55; }
.review-note-field { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.review-note-field > span { font-size: 14px; font-weight: 750; }
.review-note-field > span small { color: var(--ink-faint); font-size: 12px; font-weight: 500; }
.review-note-field textarea { width: 100%; min-height: 96px; resize: vertical; padding: 12px 13px; color: var(--ink); background: #fbfcfa; border: 1px solid var(--line-strong); border-radius: 9px; font-size: 14px; line-height: 1.65; }
.review-sheet-actions { display: grid; grid-template-columns: .9fr 1.1fr; gap: 9px; padding: 14px 22px; border-top: 1px solid var(--line); }

.teacher-login-backdrop { z-index: 300; }
.teacher-login-modal { width: min(430px, 100%); padding: 34px; text-align: center; background: var(--paper); border-radius: 16px; box-shadow: var(--shadow-md); }
.login-mark { display: grid; width: 52px; height: 52px; place-items: center; margin: 0 auto 17px; color: white; background: var(--green-700); border-radius: 13px; font-family: Georgia, serif; font-size: 30px; }
.teacher-login-modal h2 { margin: 7px 0 8px; font-size: 23px; }
.teacher-login-modal > p { margin: 0 0 20px; color: var(--ink-faint); font-size: 13px; line-height: 1.65; }
.teacher-login-modal form { text-align: left; }
.teacher-login-modal form .button { width: 100%; }
.teacher-login-modal > a { display: inline-block; margin-top: 18px; color: var(--green-700); font-size: 12px; font-weight: 700; text-decoration: none; }

.data-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 11px;
}

.data-table th {
  height: 43px;
  padding: 0 15px;
  color: var(--ink-faint);
  background: #fafaf8;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
  font-weight: 700;
  text-align: left;
}

.data-table td {
  height: 64px;
  padding: 0 15px;
  color: #4a5753;
  border-bottom: 1px solid #e8ecea;
  white-space: nowrap;
}

.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcfa; }

.table-student {
  display: flex;
  align-items: center;
  gap: 9px;
}

.table-student .avatar {
  width: 31px;
  height: 31px;
  font-size: 10px;
}

.avatar.teal { color: #276452; background: #dcece6; }
.avatar.blue { color: #375e77; background: #e2edf3; }
.avatar.amber { color: #80551f; background: #f3e8d5; }
.avatar.violet { color: #655383; background: #ece7f3; }
.avatar.rose { color: #884c55; background: #f3e4e7; }

.table-student strong,
.data-table td > strong {
  color: var(--ink);
}

.error-count {
  color: var(--red-700);
}

.table-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
  color: var(--green-700);
  background: transparent;
  border: 0;
  font-size: 10px;
  font-weight: 700;
}

.table-link .icon {
  width: 13px;
  height: 13px;
  transition: transform 150ms ease;
}

.table-link:hover .icon { transform: translateX(2px); }

.mistake-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 14px;
}

.knowledge-filter {
  align-self: start;
  overflow: hidden;
  padding-bottom: 8px;
}

.knowledge-item {
  display: flex;
  width: calc(100% - 16px);
  height: 42px;
  align-items: center;
  justify-content: space-between;
  padding: 0 11px;
  margin: 5px 8px 0;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 11px;
}

.knowledge-item:hover { background: #f7f8f5; }
.knowledge-item.is-active { color: var(--green-700); background: var(--green-50); border-color: #d5e6df; font-weight: 700; }
.knowledge-item strong { font-size: 10px; }

.mistake-feed {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mistake-card {
  min-width: 0;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.mistake-card:first-child { grid-column: 1 / -1; }

.mistake-top,
.student-stack,
.generated-label,
.suggestion-meta,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.question-id {
  color: var(--green-700);
  font-size: 10px;
  font-weight: 700;
}

.frequency {
  padding: 4px 7px;
  color: var(--amber-700);
  background: var(--amber-100);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
}

.frequency.high { color: var(--red-700); background: var(--red-100); }

.mistake-card h3 {
  margin: 15px 0;
  font-family: "Cambria Math", "STSong", serif;
  font-size: 14px;
  line-height: 1.7;
}

.mistake-diagnosis {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  color: #5b5142;
  background: #faf6ee;
  border-left: 2px solid #c59554;
  border-radius: 0 8px 8px 0;
}

.mistake-diagnosis .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--amber-700);
}

.mistake-diagnosis p {
  margin: 0;
  font-size: 10px;
  line-height: 1.55;
}

.mistake-diagnosis strong {
  display: block;
  margin-bottom: 2px;
}

.student-stack {
  justify-content: flex-start;
  margin-top: 16px;
}

.mini-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  margin-left: -6px;
  color: #3d5c52;
  background: #e5efeb;
  border: 2px solid var(--paper);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
}

.mini-avatar:first-child { margin-left: 0; }
.mini-avatar.more { color: var(--ink-soft); background: #edf0ee; }
.student-stack .table-link { margin-left: auto; }

.insight-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.insight-metrics > div {
  display: grid;
  min-height: 90px;
  grid-template-columns: auto 1fr;
  align-content: center;
  align-items: baseline;
  gap: 5px 9px;
  padding: 14px 20px;
  border-right: 1px solid var(--line);
}

.insight-metrics > div:last-child { border-right: 0; }
.insight-metrics span { grid-column: 1 / -1; color: var(--ink-faint); font-size: 10px; }
.insight-metrics strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.insight-metrics small { color: var(--ink-faint); font-size: 9px; }
.trend.up { color: var(--green-700); }

.insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.7fr);
  gap: 14px;
}

.mastery-panel {
  padding: 20px;
}

.section-heading {
  align-items: flex-start;
  margin-bottom: 22px;
}

.section-heading h3 {
  margin: 4px 0 0;
  font-size: 16px;
}

.small-note {
  color: var(--ink-faint);
  font-size: 9px;
}

.mastery-list {
  display: flex;
  flex-direction: column;
  gap: 19px;
}

.mastery-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(120px, 1fr) 38px;
  align-items: center;
  gap: 16px;
}

.mastery-row > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mastery-row strong { font-size: 11px; }
.mastery-row span { color: var(--ink-faint); font-size: 9px; }
.mastery-row b { color: var(--green-700); font-size: 11px; font-variant-numeric: tabular-nums; }
.mastery-row.alert b { color: var(--red-600); }

.progress-track {
  height: 7px;
  overflow: hidden;
  background: #e8edea;
  border-radius: 999px;
}

.progress-track i {
  display: block;
  height: 100%;
  background: var(--green-600);
  border-radius: 999px;
}

.mastery-row.alert .progress-track i { background: var(--red-600); }

.teaching-suggestion {
  position: relative;
  min-width: 0;
  padding: 24px;
  overflow: hidden;
  color: #e8f2ee;
  background: var(--green-950);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.suggestion-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  margin-bottom: 22px;
  color: #d6eee5;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.teaching-suggestion .eyebrow { color: #7fc2ad; }
.teaching-suggestion h3 { margin: 8px 0 12px; color: white; font-size: 18px; line-height: 1.45; }
.teaching-suggestion > p { margin: 0; color: #b4cac2; font-size: 11px; line-height: 1.75; }
.suggestion-meta { justify-content: flex-start; margin: 18px 0; color: #87a69b; font-size: 9px; }
.suggestion-meta span + span::before { margin-right: 10px; content: "·"; }
.teaching-suggestion .button-primary { width: 100%; color: #173a31; background: #dcebe5; border-color: #dcebe5; }
.teaching-suggestion .button-primary:hover { background: white; border-color: white; }

/* Upload dialog */
.modal-backdrop,
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 29, 25, 0.5);
  backdrop-filter: blur(3px);
  animation: fade-in 180ms ease both;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.upload-modal {
  display: flex;
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  animation: modal-in 220ms ease both;
}

@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

.modal-header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 4px 0 5px;
  font-size: 20px;
}

.modal-header p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 10px;
}

.upload-modal form {
  min-height: 0;
  overflow-y: auto;
}

.upload-form-state {
  padding: 14px 22px 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 10px;
}

.form-field > span {
  color: #45534f;
  font-size: 10px;
  font-weight: 700;
}

.form-field input,
.form-field select {
  width: 100%;
  height: 37px;
  padding: 0 11px;
  color: var(--ink);
  background: #fbfbf9;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 11px;
}

.drop-zone {
  display: flex;
  width: 100%;
  min-height: 116px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
  color: var(--ink-soft);
  background: #fbfcfa;
  border: 1.5px dashed #b8cac3;
  border-radius: 11px;
  transition: background 160ms ease, border-color 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  background: var(--green-50);
  border-color: var(--green-600);
}

.upload-illustration {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 8px;
  color: var(--green-700);
  background: var(--green-100);
  border-radius: 10px;
}

.upload-illustration i {
  position: absolute;
  right: -3px;
  bottom: -3px;
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  color: white;
  background: var(--green-700);
  border: 2px solid white;
  border-radius: 50%;
  font-size: 10px;
  font-style: normal;
}

.drop-zone strong {
  font-size: 11px;
}

.drop-zone small {
  margin-top: 7px;
  color: var(--ink-faint);
  font-size: 9px;
}

.upload-error {
  padding: 8px 10px;
  margin-top: 9px;
  color: var(--red-700);
  background: var(--red-50);
  border: 1px solid #f1d6d1;
  border-radius: 7px;
  font-size: 10px;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
}

.file-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.file-type {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--green-700);
  background: var(--green-100);
  border-radius: 7px;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.file-type.pdf { color: var(--red-700); background: var(--red-100); }
.file-type.doc, .file-type.docx { color: #356984; background: #e3eef3; }

.file-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.file-copy strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-copy span {
  color: var(--ink-faint);
  font-size: 9px;
}

.remove-file {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  padding: 0;
  color: var(--ink-faint);
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.remove-file:hover { color: var(--red-700); background: var(--red-50); }
.remove-file .icon { width: 14px; height: 14px; }

.privacy-note,
.ai-disclaimer {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  color: var(--ink-faint);
  font-size: 9px;
}

.privacy-note .icon,
.ai-disclaimer .icon {
  width: 13px;
  height: 13px;
  color: var(--green-700);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.grading-progress {
  padding: 42px 36px 32px;
  text-align: center;
}

.progress-orbit {
  position: relative;
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  margin: 0 auto 18px;
  border: 1px solid #d0e4dc;
  border-radius: 50%;
}

.progress-orbit span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: white;
  background: var(--green-700);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.progress-orbit > i {
  position: absolute;
  top: -3px;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  background: #e3a954;
  border-radius: 50%;
  transform-origin: 3.5px 40px;
  animation: orbit 2s linear infinite;
}

.progress-orbit > i:nth-child(3) { animation-delay: -0.65s; opacity: 0.55; }
.progress-orbit > i:nth-child(4) { animation-delay: -1.3s; opacity: 0.3; }

@keyframes orbit { to { transform: rotate(360deg); } }

.grading-progress h3 {
  margin: 0 0 7px;
  font-size: 18px;
}

.grading-progress > p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 10px;
}

.progress-bar {
  height: 7px;
  margin: 22px 0 28px;
  overflow: hidden;
  background: #e6ebe8;
  border-radius: 999px;
}

.progress-bar i {
  display: block;
  width: 4%;
  height: 100%;
  background: var(--green-600);
  border-radius: 999px;
  transition: width 550ms ease;
}

.progress-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: left;
}

.progress-steps > div {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--ink-faint);
  opacity: 0.55;
}

.progress-steps > div.is-active,
.progress-steps > div.is-done {
  color: var(--ink);
  opacity: 1;
}

.progress-steps > div > span {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--ink-faint);
  background: #edf0ee;
  border-radius: 50%;
  font-size: 8px;
  font-weight: 800;
}

.progress-steps > div.is-active > span { color: white; background: var(--green-700); }
.progress-steps > div.is-done > span { color: white; background: var(--green-600); }

.progress-steps > div > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.progress-steps strong { font-size: 9px; }
.progress-steps small { color: var(--ink-faint); font-size: 8px; }

/* Practice sheet */
.sheet-backdrop {
  place-items: stretch end;
  padding: 0;
  overflow: hidden;
}

.practice-sheet {
  display: flex;
  width: min(480px, 100%);
  height: 100%;
  min-height: 0;
  max-height: 100vh;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
  box-shadow: -16px 0 45px rgba(20, 42, 36, 0.16);
  animation: sheet-in 260ms ease both;
}

@keyframes sheet-in { from { transform: translateX(30px); opacity: 0.7; } to { transform: translateX(0); opacity: 1; } }

.sheet-header {
  display: flex;
  min-height: 92px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.sheet-header h2 {
  margin: 7px 0 0;
  font-size: 17px;
}

.sheet-scroll {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
}

.source-mistake {
  padding: 10px 12px;
  margin-bottom: 20px;
  background: var(--red-50);
  border-left: 3px solid var(--red-600);
  border-radius: 0 8px 8px 0;
}

.source-mistake span {
  color: var(--red-700);
  font-size: 9px;
  font-weight: 700;
}

.source-mistake p {
  margin: 4px 0 0;
  color: #5e3934;
  font-size: 10px;
}

.generated-label {
  margin-bottom: 9px;
}

.generated-label span {
  color: #3e4c47;
  font-size: 10px;
  font-weight: 700;
}

.generated-label em {
  color: var(--green-700);
  font-size: 9px;
  font-style: normal;
}

.practice-problem {
  display: flex;
  min-height: 130px;
  align-items: flex-start;
  gap: 12px;
  padding: 19px;
  background-color: #fffefb;
  background-image: linear-gradient(rgba(62, 115, 99, 0.045) 1px, transparent 1px);
  background-size: 100% 25px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
}

.practice-number {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  color: white;
  background: var(--green-700);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
}

.practice-problem h3 {
  margin: 1px 0 0;
  font-family: "Cambria Math", "STSong", serif;
  font-size: 14px;
  line-height: 1.8;
}

.answer-area {
  margin-top: 19px;
}

.answer-area label {
  display: block;
  margin-bottom: 8px;
  color: #45534f;
  font-size: 10px;
  font-weight: 700;
}

.answer-area textarea {
  width: 100%;
  min-height: 95px;
  resize: vertical;
  padding: 11px;
  color: var(--ink);
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 11px;
  line-height: 1.6;
}

.hint-ladder {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.hint-button {
  display: flex;
  width: 100%;
  height: 43px;
  align-items: center;
  justify-content: space-between;
  padding: 0 11px;
  color: #465650;
  background: #fbfcfa;
  border: 0;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 650;
}

.hint-button:last-of-type { border-bottom: 0; }
.hint-button > span { display: flex; align-items: center; gap: 7px; }
.hint-button .icon { width: 14px; height: 14px; }
.hint-button > .icon { width: 12px; height: 12px; transition: transform 160ms ease; }
.hint-button.is-open > .icon { transform: rotate(90deg); }

.hint-content {
  display: none;
  padding: 10px 12px;
  color: #5f6c68;
  background: white;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  line-height: 1.6;
}

.hint-content.is-open { display: block; }

.answer-toggle {
  display: flex;
  width: 100%;
  height: 39px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 13px;
  color: var(--green-700);
  background: var(--green-50);
  border: 1px solid #d1e5dd;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
}

.reference-answer {
  padding: 12px;
  margin-top: 8px;
  color: #35443f;
  background: #f6f9f7;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: "Cambria Math", "STSong", serif;
  font-size: 11px;
  line-height: 1.7;
}

.reference-answer strong { font-family: "Segoe UI", "PingFang SC", sans-serif; }
.reference-answer p { margin: 6px 0 0; }

.sheet-actions {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 9px;
  padding: 13px 22px;
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  z-index: 200;
  right: 24px;
  bottom: 24px;
  display: grid;
  width: min(340px, calc(100vw - 32px));
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  color: #273630;
  background: white;
  border: 1px solid #d0dcd7;
  border-radius: 11px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: white;
  background: var(--green-700);
  border-radius: 8px;
}

.toast strong {
  display: block;
  font-size: 11px;
}

.toast p {
  margin: 3px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
}

@media (max-width: 1180px) {
  .class-management-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .score-overview {
    grid-template-columns: 180px repeat(3, minmax(90px, 1fr));
  }

  .overview-insight {
    grid-column: 1 / -1;
    min-height: 60px;
    border-top: 1px solid var(--line);
    border-radius: 0 0 11px 11px;
  }

  .grading-workspace {
    grid-template-columns: 155px minmax(370px, 1fr);
  }

  .analysis-panel {
    grid-column: 1 / -1;
    min-height: 560px;
  }

  .analysis-scroll {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 0 20px;
  }

  .verdict { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 78px; }

  .sidebar { padding: 20px 10px 14px; }
  .brand { justify-content: center; padding: 0; }
  .brand > div:last-child,
  .nav-item span,
  .nav-item em,
  .class-card,
  .teacher-profile > div:nth-child(2),
  .teacher-profile button { display: none; }
  .main-nav { align-items: center; }
  .nav-item { width: 50px; justify-content: center; padding: 0; }
  .nav-item.is-active::before { left: -11px; }
  .teacher-profile { display: flex; justify-content: center; padding: 13px 0 0; }

  .main-area { padding-inline: 18px; }
  .topbar { min-height: 82px; }
  .prototype-badge { display: none; }

  .mistake-feed { grid-template-columns: 1fr; }
  .mistake-card:first-child { grid-column: auto; }
  .insight-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .class-management-grid { grid-template-columns: 1fr; }
  .managed-class-card { min-height: 205px; }
  .class-join-panel { grid-template-columns: 1fr; padding: 16px; }
  .class-join-panel > img { width: min(220px, 100%); height: auto; justify-self: center; }
  .class-link-actions { flex-direction: column; }
  :root { --sidebar-width: 0px; }

  body { padding-bottom: 72px; }

  .sidebar {
    inset: auto 0 0;
    display: block;
    width: 100%;
    height: 68px;
    padding: 7px 8px;
    background: rgba(18, 52, 47, 0.97);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 0;
    backdrop-filter: blur(10px);
  }

  .brand,
  .sidebar-spacer,
  .teacher-profile { display: none; }

  .main-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }

  .nav-item {
    display: flex;
    width: 100%;
    height: 54px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
  }

  .nav-item .icon { width: 18px; height: 18px; }
  .nav-item span { display: block; font-size: 9px; }
  .nav-item.is-active::before { inset: -7px 30% auto; width: 40%; height: 2px; border-radius: 0 0 3px 3px; }

  .main-area { margin-left: 0; padding: 0 12px 24px; }
  .topbar { min-height: 76px; }
  .topbar h1 { font-size: 19px; }
  .breadcrumb { font-size: 9px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .notification-button { display: none; }
  .topbar-actions .button { width: 40px; padding: 0; font-size: 0; }
  .topbar-actions .button .icon { width: 18px; height: 18px; }

  .assignment-strip { align-items: flex-start; padding: 12px; }
  .assignment-identity { align-items: flex-start; }
  .student-avatar { width: 36px; height: 36px; }
  .title-row { display: block; }
  .title-row h2 { max-width: 200px; font-size: 13px; }
  .title-row .status-chip { margin-top: 5px; }
  .assignment-identity p { max-width: 200px; line-height: 1.45; }
  .assignment-actions .button { width: 36px; min-height: 36px; padding: 0; font-size: 0; }
  .assignment-actions .icon-button { display: none; }

  .score-overview { grid-template-columns: repeat(3, 1fr); }
  .score-main { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line); }
  .metric { padding: 12px; }
  .metric:nth-of-type(4) { border-right: 0; }
  .overview-insight { grid-column: 1 / -1; }

  .grading-workspace { grid-template-columns: 1fr; min-height: auto; }
  .question-rail { min-height: 116px; }
  .panel-heading { min-height: 48px; }
  .question-legend { display: none; }
  .question-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 8px; }
  .question-list { scrollbar-width: none; }
  .question-list::-webkit-scrollbar { display: none; }
  .question-button { width: 58px; min-width: 58px; min-height: 51px; grid-template-columns: 1fr 14px; gap: 1px; padding: 5px; }
  .question-button.is-active::before { inset: auto 10px -9px; width: calc(100% - 20px); height: 3px; }
  .question-index { width: 27px; height: 27px; }
  .question-info { display: none; }
  .paper-panel { min-height: 555px; }
  .paper-scroll { padding: 10px; }
  .paper-sheet { min-height: 490px; padding: 25px 20px; }
  .paper-sheet h3 { font-size: 14px; }
  .student-work { font-size: 15px; }
  .analysis-panel { grid-column: auto; min-height: 650px; }
  .analysis-scroll { display: block; }

  .section-intro { min-height: 0; align-items: flex-start; padding: 17px; }
  .section-intro h2 { font-size: 17px; line-height: 1.4; }
  .section-intro p { line-height: 1.55; }
  .section-intro > .button { width: 40px; min-height: 40px; padding: 0; font-size: 0; }
  .command-bar { flex-wrap: wrap; }
  .search-box { width: 100%; }
  .result-count { display: none; }
  .mistake-layout { grid-template-columns: 1fr; }
  .knowledge-filter { display: flex; overflow-x: auto; padding: 8px; }
  .knowledge-filter .panel-heading { display: none; }
  .knowledge-item { width: auto; min-width: max-content; height: 36px; margin: 0 5px 0 0; gap: 10px; }
  .mistake-card { padding: 15px; }
  .mistake-card h3 { font-size: 13px; }
  .insight-metrics { grid-template-columns: repeat(2, 1fr); }
  .insight-metrics > div { min-height: 82px; border-bottom: 1px solid var(--line); }
  .insight-metrics > div:nth-child(2) { border-right: 0; }
  .insight-metrics > div:nth-child(n + 3) { border-bottom: 0; }
  .mastery-panel { padding: 16px; }
  .mastery-row { grid-template-columns: minmax(120px, 1fr) 36px; gap: 10px; }
  .mastery-row .progress-track { grid-column: 1 / -1; grid-row: 2; }
  .mastery-row b { grid-column: 2; grid-row: 1; text-align: right; }

  .modal-backdrop { padding: 0; place-items: stretch; }
  .upload-modal { width: 100%; max-height: 100vh; border-radius: 0; }
  .modal-header { padding: 18px; }
  .upload-form-state { padding: 16px 18px 20px; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .drop-zone { min-height: 135px; }
  .grading-progress { padding: 40px 20px 28px; }
  .progress-steps { grid-template-columns: repeat(2, 1fr); gap: 14px; }

  .sheet-header { min-height: 82px; padding: 15px 17px; }
  .sheet-header h2 { font-size: 15px; }
  .sheet-scroll { padding: 17px; }
  .sheet-actions { padding: 12px 17px; }
  .toast { right: 16px; bottom: 84px; }
  .student-link-button { display: none; }
  .submission-metrics { grid-template-columns: repeat(2, 1fr); }
  .submission-metrics > div { min-height: 82px; border-bottom: 1px solid var(--line); }
  .submission-metrics > div:nth-child(2) { border-right: 0; }
  .submission-metrics > div:nth-child(n + 3) { border-bottom: 0; }
  .review-sheet { width: 100%; }
  .review-sheet-scroll { padding: 17px; }
  .review-sheet-actions { padding: 12px 17px; }
  .class-join-panel { grid-template-columns: 1fr; }.class-join-panel > img { width: min(220px, 100%); height: auto; margin: 0 auto; }
  .class-assignment-form { grid-template-columns: 1fr; }.class-assignment-form input { height: 44px; font-size: 14px; }.class-assignment-form .button { min-height: 44px; }
  .class-assignment-list article { grid-template-columns: auto minmax(0, 1fr); }.class-assignment-list article .button { grid-column: 2; justify-self: start; }
  .class-student-list > div { grid-template-columns: 34px minmax(0, 1fr); padding-block: 12px; }.class-student-actions { grid-column: 2; flex-wrap: wrap; }.class-student-actions button { padding: 7px 8px; background: #f6f8f5; }
  .student-filter-bar { align-items: flex-start; flex-direction: column; }.student-filter-bar button { align-self: stretch; }
}

/* Desktop readability pass: teacher-facing text should remain legible on wide displays. */
@media (min-width: 701px) {
  .brand > div:last-child span,
  .eyebrow,
  .class-card .eyebrow,
  .class-meta,
  .teacher-profile span,
  .breadcrumb,
  .prototype-badge,
  .assignment-identity p,
  .status-chip,
  .score-main span,
  .metric > span,
  .metric small,
  .overview-insight span,
  .panel-heading span,
  .question-legend,
  .question-info span,
  .paper-kicker,
  .page-indicator,
  .paper-watermark,
  .student-work-label,
  .paper-note,
  .ai-label,
  .analysis-section > h3 span,
  .knowledge-tags span,
  .result-count,
  .data-table th,
  .frequency,
  .mini-avatar,
  .small-note,
  .mastery-row span,
  .insight-metrics span,
  .insight-metrics small,
  .suggestion-meta,
  .modal-header p,
  .form-field > span,
  .drop-zone small,
  .file-copy span,
  .privacy-note,
  .ai-disclaimer,
  .progress-steps small,
  .source-mistake span,
  .generated-label em {
    font-size: 14px;
  }

  .nav-item {
    height: 48px;
    font-size: 17px;
  }

  .teacher-profile strong,
  .button,
  .score-main > div:last-child > strong,
  .overview-insight p,
  .question-info strong,
  .analysis-tabs button,
  .verdict-copy strong,
  .analysis-section > h3,
  .process-row,
  .process-row p strong,
  .process-row > strong,
  .error-analysis strong,
  .error-analysis p,
  .comment-box,
  .analysis-actions .button,
  .search-box input,
  .select-button,
  .data-table,
  .table-link,
  .knowledge-item,
  .question-id,
  .mistake-diagnosis p,
  .mastery-row strong,
  .mastery-row b,
  .teaching-suggestion > p,
  .drop-zone strong,
  .form-field input,
  .form-field select,
  .file-copy strong,
  .grading-progress > p,
  .progress-steps strong,
  .source-mistake p,
  .generated-label span,
  .answer-area label,
  .answer-area textarea,
  .hint-button,
  .hint-content,
  .answer-toggle,
  .reference-answer,
  .toast strong,
  .toast p {
    font-size: 15px;
  }

  .topbar h1 {
    font-size: 28px;
  }

  .title-row h2 {
    font-size: 20px;
  }

  .assignment-strip {
    min-height: 88px;
    padding: 16px 20px;
  }

  .score-overview {
    min-height: 112px;
  }

  .score-main,
  .metric,
  .overview-insight {
    padding: 19px 22px;
  }

  .metric strong {
    font-size: 28px;
  }

  .overview-insight p {
    line-height: 1.65;
  }

  .panel-heading {
    min-height: 70px;
    padding: 13px 15px;
  }

  .panel-heading strong,
  .paper-toolbar strong,
  .analysis-header strong {
    font-size: 17px;
  }

  .question-legend {
    padding: 12px 14px 6px;
  }

  .question-button {
    min-height: 64px;
    grid-template-columns: 35px minmax(0, 1fr) 20px;
    gap: 9px;
    padding: 9px 10px;
  }

  .question-index {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }

  .paper-toolbar,
  .analysis-header {
    min-height: 72px;
    padding: 14px 18px;
  }

  .paper-sheet h3 {
    font-size: 22px;
    line-height: 1.9;
  }

  .student-work-label span {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  .student-work {
    font-size: 22px;
    line-height: 1.95;
  }

  .work-line {
    min-height: 48px;
  }

  .teacher-annotation {
    font-size: 14px;
    line-height: 1.75;
  }

  .ai-label {
    height: 32px;
    padding-inline: 11px;
  }

  .analysis-tabs {
    height: 52px;
    gap: 26px;
    padding-inline: 18px;
  }

  .analysis-tabs button {
    height: 52px;
  }

  .analysis-scroll {
    padding: 20px;
  }

  .verdict {
    min-height: 82px;
    padding: 16px 17px;
  }

  .verdict-copy span {
    font-size: 14px;
  }

  .verdict-score {
    font-size: 24px;
  }

  .analysis-section {
    margin-bottom: 25px;
  }

  .process-row {
    min-height: 62px;
    grid-template-columns: 23px minmax(0, 1fr) auto;
    gap: 11px;
    line-height: 1.6;
  }

  .process-marker {
    width: 21px;
    height: 21px;
  }

  .process-marker::after {
    top: 21px;
    height: 40px;
  }

  .process-row p {
    line-height: 1.6;
  }

  .error-analysis {
    padding: 15px 16px;
  }

  .error-analysis p {
    line-height: 1.75;
  }

  .knowledge-tags {
    gap: 9px;
  }

  .knowledge-tags span {
    padding: 7px 10px;
  }

  .comment-box {
    min-height: 96px;
    padding: 13px 14px;
    line-height: 1.7;
  }

  .analysis-actions {
    padding: 14px 16px;
  }

  .analysis-actions .button {
    min-height: 46px;
  }

  .section-intro p {
    font-size: 16px;
  }

  .data-table th {
    height: 47px;
  }

  .data-table td {
    height: 68px;
  }

  .mistake-card h3 {
    font-size: 18px;
  }

  .insight-metrics strong {
    font-size: 30px;
  }

  .teaching-suggestion h3 {
    font-size: 22px;
  }

  .modal-header h2 {
    font-size: 24px;
  }

  .grading-progress h3 {
    font-size: 22px;
  }

  .practice-problem h3 {
    font-size: 18px;
  }

  .sheet-header h2 {
    font-size: 21px;
  }
}

@media (min-width: 701px) and (max-width: 1180px) {
  .grading-workspace {
    grid-template-columns: 175px minmax(370px, 1fr);
  }
}

@media (min-width: 1181px) and (max-width: 1279px) {
  .grading-workspace {
    grid-template-columns: 190px minmax(370px, 1fr);
  }

  .analysis-panel {
    grid-column: 1 / -1;
    min-height: 620px;
  }
}

@media (min-width: 1280px) {
  .grading-workspace {
    grid-template-columns: 200px minmax(360px, 1fr) minmax(360px, 0.9fr);
  }
}

@media (min-width: 1600px) {
  .grading-workspace {
    grid-template-columns: 200px minmax(400px, 0.95fr) minmax(460px, 1.05fr);
  }
}

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

@media print {
  body { padding: 0; background: white; }
  .sidebar,
  .topbar,
  .assignment-actions,
  .question-rail,
  .analysis-actions,
  .prototype-badge { display: none !important; }
  .main-area { margin: 0; padding: 0; }
  .grading-workspace { grid-template-columns: 1.1fr 0.9fr; }
  .paper-panel,
  .analysis-panel { min-height: 680px; box-shadow: none; }
  .paper-scroll { background: white; }
}
