:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --ink: #172033;
  --muted: #697386;
  --line: #dce3ee;
  --panel: #ffffff;
  --primary: #2364d2;
  --primary-dark: #174aa0;
  --accent: #0f8f7a;
  --danger: #c2413a;
  --soft: #eef4ff;
}

/* Teacher wrong-answer extractor */
.wrong-answer-module {
  display: grid;
  gap: 18px;
}

.wrong-answer-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr);
  gap: 12px;
}

.wrong-answer-controls label {
  display: grid;
  gap: 7px;
  font-size: 0.9rem;
  color: #685c63;
}

.wrong-answer-controls select {
  width: 100%;
}

.wrong-answer-help {
  margin: 0;
  color: #756970;
}

.wrong-answer-question-list {
  display: grid;
  gap: 14px;
}

.wrong-answer-book-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #eadfe2;
  border-radius: 8px;
  background: #fffdfd;
}

.wrong-answer-book-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wrong-answer-book-head div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.wrong-answer-book-head span {
  font-size: 1.06rem;
  font-weight: 700;
}

.wrong-answer-book-head strong {
  color: #cf786b;
}

.wrong-answer-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 8px;
  max-height: 310px;
  overflow-y: auto;
  padding: 2px;
}

.wrong-answer-check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #eee4e6;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.wrong-answer-check-grid label:has(input:checked) {
  border-color: #dda095;
  background: #fff5f2;
}

.wrong-answer-check-grid input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
}

.wrong-answer-check-grid span {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.wrong-answer-book-card > .primary {
  justify-self: start;
}

.wrong-answer-book-card small,
.wrong-answer-unsupported {
  color: #85777d;
}

@media (max-width: 640px) {
  .wrong-answer-controls {
    grid-template-columns: 1fr;
  }

  .wrong-answer-book-head {
    align-items: flex-start;
  }

  .wrong-answer-check-grid {
    grid-template-columns: 1fr 1fr;
  }

  .wrong-answer-book-card > .primary {
    width: 100%;
  }
}

/* Learning materials */
.student-main-tabs {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.teacher-main-tabs {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.student-materials-panel {
  padding: 22px;
}

#studentMaterialsWorkspace[hidden],
#studentMaterialsEmpty[hidden] {
  display: none !important;
}

.student-materials-head,
.student-material-viewer-head,
.material-list-head,
.teacher-material-row,
.material-upload-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.student-materials-head {
  margin-bottom: 18px;
}

/* 학습자료 내려받기(2026-11-16): 인터넷 없이 보려면 미리 받아 두게 안내 */
.student-material-offline-hint {
  margin: -8px 0 14px;
  color: #6b6064;
  font-size: 13px;
}

.student-material-fullscreen-head #studentMaterialDownload {
  position: static;
  flex: none;
  width: auto;
  height: 36px;
  margin-left: auto;
  padding: 0 14px;
  border: 1px solid var(--student-line, var(--line));
  border-radius: 18px;
  background: #fff;
  color: #3d3437;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.student-material-fullscreen-head #studentMaterialDownload:disabled {
  opacity: 0.6;
}

.student-materials-head h2,
.student-materials-head p,
.material-list-head h3 {
  margin: 0;
}

.student-materials-workspace {
  display: block;
}

.student-material-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}

.student-material-list button {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--student-line, var(--line));
  border-radius: 7px;
  padding: 13px;
  background: #fff;
  color: #29252a;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.student-material-list button:active {
  border-color: var(--student-coral);
  background: var(--student-coral-soft);
}

.student-material-list button > span {
  grid-row: 1 / span 2;
  align-self: start;
  color: var(--student-coral-dark);
  font-size: 13px;
}

.student-material-list button > strong,
.student-material-list button > small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-material-list button > small {
  color: #857e82;
}

.material-viewer-open {
  overflow: hidden;
}

.student-material-fullscreen[hidden] {
  display: none !important;
}

.student-material-fullscreen {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100vw;
  max-width: 100vw;
  min-width: 0;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: #f3f1f1;
}

.student-material-fullscreen-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 56px;
  padding: max(8px, env(safe-area-inset-top)) max(66px, calc(54px + env(safe-area-inset-right))) 8px
    max(12px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--student-line, var(--line));
  background: #fff8f5;
}

.student-material-fullscreen-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.student-material-fullscreen-head button {
  position: absolute;
  top: max(7px, env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
  z-index: 3;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #5f5558;
  font: inherit;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

#studentMaterialFrame {
  display: block;
  width: 100%;
  max-width: 100vw;
  min-width: 0;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #f3f1f1;
}

#studentMaterialFrame[hidden],
#studentMaterialPageViewer[hidden] {
  display: none !important;
}

.student-material-page-viewer {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.student-material-page-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 48px;
  padding: 5px 12px;
  background: #fff;
  border-bottom: 1px solid var(--student-line, var(--line));
}

.student-material-page-nav button {
  min-width: 64px;
  padding: 7px 10px;
}

.student-material-page-nav button:disabled {
  opacity: .45;
}

.student-material-canvas-scroll {
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.student-material-pages {
  position: relative;
  display: grid;
  gap: 12px;
}

.student-material-sheet {
  position: relative;
  width: min(100%, 1200px);
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 2px 12px #0002;
}

.student-material-sheet span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #75696d;
}

.student-material-sheet canvas {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  background: #fff;
}

.student-material-sheet img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

.student-material-sheet canvas[hidden],
.student-material-sheet span[hidden] {
  display: none !important;
}

.student-exit-confirm[hidden] {
  display: none !important;
}

.student-exit-confirm {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(35 28 31 / 56%);
}

.student-exit-confirm-panel {
  width: min(100%, 360px);
  padding: 24px;
  border: 1px solid var(--student-line, var(--line));
  border-radius: 8px;
  background: #fffaf8;
  box-shadow: 0 18px 48px rgb(35 28 31 / 24%);
  text-align: center;
}

.student-exit-confirm-panel strong {
  display: block;
  color: #2f272a;
  font-size: 19px;
}

.student-exit-confirm-panel p {
  margin: 9px 0 20px;
  color: #75696d;
  font-size: 14px;
}

.student-exit-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.student-exit-confirm-actions button {
  min-height: 46px;
}

.material-upload-form {
  align-items: end;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--teacher-line, var(--line));
  border-radius: 8px;
  background: #fffaf8;
}

.material-upload-form label {
  flex: 1 1 260px;
}

.material-upload-form button {
  flex: 0 0 auto;
  min-height: 46px;
}

.material-list-head {
  margin: 24px 0 10px;
}

.teacher-material-list {
  display: grid;
  gap: 8px;
}

.teacher-material-row {
  min-height: 76px;
  border-bottom: 1px solid var(--teacher-line, var(--line));
  padding: 12px 2px;
}

.teacher-material-row > div:first-child {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 10px;
  min-width: 0;
}

.teacher-material-row span {
  grid-row: 1 / span 2;
  color: var(--teacher-coral-dark, #a94f45);
  font-size: 13px;
}

.teacher-material-row strong,
.teacher-material-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-material-row small {
  color: var(--teacher-muted, var(--muted));
}

@media (max-width: 720px) {
  .student-materials-panel {
    padding: 15px;
  }

  .student-materials-workspace {
    display: block;
  }

  .student-material-list {
    display: grid;
    grid-template-columns: 1fr;
  }

  .student-material-list button {
    width: 100%;
  }

  .material-upload-form {
    display: grid;
    align-items: stretch;
  }

  .material-upload-form label,
  .material-upload-form button {
    width: 100%;
  }

  .teacher-material-row {
    align-items: flex-start;
  }

  .student-main-tab,
  .teacher-main-tab {
    font-size: 12px;
  }
}

@media print {
  body {
    background: #fff !important;
  }

  body > main > :not(#monthlyManagementModule),
  #monthlyManagementModule > :not(#monthlyReportPreview),
  .monthly-report-actions {
    display: none !important;
  }

  #monthlyManagementModule,
  #monthlyReportPreview {
    display: block !important;
    border: 0;
    padding: 0;
  }

  .monthly-report-sheet {
    border: 0;
    border-top: 8px solid #173957;
    print-color-adjust: exact;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Jua", "Malgun Gothic", sans-serif;
}

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

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.student-shell {
  width: min(860px, calc(100% - 32px));
}

.student-hero {
  position: relative;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  min-height: 156px;
  margin-bottom: 18px;
  padding: 22px 22px 20px;
  border: 1px solid rgba(220, 227, 238, 0.85);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 30px rgba(30, 45, 80, 0.08);
  overflow: hidden;
}

.student-class-pill {
  position: absolute;
  top: 16px;
  right: 18px;
  max-width: 42%;
  border: 1px solid rgba(15, 143, 122, 0.28);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(233, 248, 244, 0.9);
  color: var(--accent);
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-character {
  width: 112px;
  height: 112px;
  object-fit: contain;
  align-self: start;
  margin-top: 4px;
  filter: drop-shadow(0 10px 16px rgba(23, 32, 51, 0.14));
}

.hero-copy {
  min-width: 0;
  padding-right: 150px;
}

.range-text {
  margin: 8px 0 8px;
  color: #2d3748;
  font-size: 20px;
  font-weight: 900;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: 20px;
}

h3 {
  margin-bottom: 4px;
  font-size: 20px;
}

.panel,
.assignment {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(30, 45, 80, 0.06);
}

.panel {
  padding: 22px;
  margin-bottom: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #2d3748;
  font-weight: 700;
}

.student-password-field[hidden] {
  display: none;
}

.student-password-field small {
  color: var(--muted);
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(35, 100, 210, 0.14);
}

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

button,
.student-link {
  border: 0;
  border-radius: 6px;
  padding: 11px 14px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  font-weight: 800;
}

.primary {
  width: fit-content;
  background: var(--primary);
  color: #fff;
}

.primary:hover {
  background: var(--primary-dark);
}

.secondary {
  background: #e9f8f4;
  color: var(--accent);
}

.secondary:hover {
  background: #d7f0ea;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.ghost,
.copy-link,
.copy-class-link,
.copy-fixed-class,
.copy-summary,
.student-link {
  background: var(--soft);
  color: var(--primary);
}

.full {
  width: 100%;
  margin-top: 18px;
}

.section-head,
.assignment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-head.compact {
  align-items: center;
  margin-bottom: 14px;
}

.section-head.compact h2 {
  margin-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e9f8f4;
  color: var(--accent);
  font-weight: 800;
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

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

.teacher-day-label {
  margin: 7px 0 0;
  font-weight: 700;
}

.teacher-class-tabs {
  position: sticky;
  top: 8px;
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(241, 245, 252, 0.96);
  box-shadow: 0 8px 20px rgba(24, 35, 60, 0.08);
  backdrop-filter: blur(10px);
}

.teacher-class-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 48px;
  padding: 9px 10px;
  background: transparent;
  color: var(--muted);
}

.teacher-class-tab span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-class-tab em {
  border-radius: 999px;
  padding: 3px 6px;
  background: #e9f8f4;
  color: var(--accent);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.teacher-class-tab.is-active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(35, 100, 210, 0.12);
}

.teacher-view-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.teacher-view-head h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.teacher-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  min-width: 360px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f4f6fa;
}

.teacher-mode-tab {
  min-height: 40px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
}

.teacher-mode-tab.is-active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 5px rgba(35, 100, 210, 0.12);
}

.teacher-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fafcff;
}

.teacher-summary-strip > div {
  display: grid;
  gap: 4px;
  padding: 14px 18px;
  border-right: 1px solid var(--line);
}

.teacher-summary-strip > div:last-child {
  border-right: 0;
}

.teacher-summary-strip span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.teacher-summary-strip strong {
  font-size: 20px;
}

.teacher-summary-strip .summary-missing strong {
  color: #a34716;
}

.teacher-summary-strip .summary-questions strong {
  color: var(--primary);
}

.focused-assignment-list .assignment {
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.teacher-past-picker {
  max-width: 760px;
}

.empty-focused-view {
  margin: 0;
  padding: 24px 0;
  text-align: center;
}

.teacher-tools-panel {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: none;
}

.nested-tool {
  margin: 14px 0 0;
  padding: 12px 0 0;
}

.assignment-list {
  display: grid;
  gap: 18px;
}

.class-list {
  display: grid;
  gap: 10px;
}

.password-settings-help {
  margin: 12px 0;
}

.student-password-list {
  display: grid;
  gap: 8px;
}

.student-password-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 130px auto auto;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.student-password-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.student-password-name .badge {
  background: #f1f4f8;
  color: var(--muted);
}

.student-password-name .badge.is-enabled {
  background: #e9f8f4;
  color: var(--accent);
}

.student-password-row input {
  min-width: 0;
}

.compact-section {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.compact-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compact-section .class-list {
  margin-top: 14px;
}

.class-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fafcff;
}

.class-row strong {
  display: block;
  margin-bottom: 3px;
  font-size: 17px;
}

.assignment {
  padding: 18px;
}

.class-assignment-group {
  display: grid;
  gap: 10px;
}

.latest-assignment-card {
  border-color: rgba(35, 100, 210, 0.2);
}

.past-assignment-list {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.past-assignment-list > summary {
  display: inline-flex;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
  background: #fafcff;
  color: var(--primary);
}

.past-assignment-items {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.past-assignment-card {
  box-shadow: none;
  background: #fbfcff;
}

.no-past {
  margin: 0 0 0 2px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
  background: #fafcff;
  font-weight: 800;
}

.teacher-insights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.teacher-insights section {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fafcff;
}

.teacher-insights section:first-child {
  border-color: rgba(163, 71, 22, 0.22);
  background: #fff8f2;
}

.teacher-insights section:last-child {
  border-color: rgba(35, 100, 210, 0.2);
  background: #f5f8ff;
}

.teacher-insights h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.teacher-insights p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.problem-grid,
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 8px;
}

.book-section {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.book-section h3 {
  margin: 10px 0 0;
  font-size: 18px;
}

.problem-cell,
.check-cell {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #fff;
  font-weight: 800;
}

.problem-cell.hot {
  border-color: rgba(194, 65, 58, 0.5);
  background: #fff1ef;
  color: var(--danger);
}

.check-cell {
  cursor: pointer;
  user-select: none;
}

.check-cell input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  flex: 0 0 22px;
  place-content: center;
  width: 22px;
  height: 22px;
  margin: 0 2px 0 0;
  padding: 0;
  border: 2px solid #9b8f8b;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
}

.check-cell input[type="checkbox"]::before {
  content: "";
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg) scale(0);
  transform-origin: center;
}

.check-cell input[type="checkbox"]:checked {
  border-color: var(--primary);
  background: var(--primary);
}

.check-cell input[type="checkbox"]:checked::before {
  transform: rotate(45deg) scale(1);
}

.check-cell input[type="checkbox"]:focus-visible {
  outline: 3px solid rgba(217, 125, 106, 0.3);
  outline-offset: 2px;
}

.check-cell:has(input:checked) {
  border-color: var(--primary);
  background: var(--soft);
  color: var(--primary);
}

.no-question-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  margin-top: 14px;
  padding: 12px 16px;
  border: 2px solid rgba(24, 134, 113, 0.24);
  border-radius: 8px;
  background: #f1faf7;
  color: #166c5c;
  cursor: pointer;
}

.no-question-option input {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--accent);
}

.no-question-option span {
  display: grid;
  gap: 2px;
}

.no-question-option strong {
  font-size: 17px;
}

.no-question-option small {
  color: var(--muted);
  font-size: 14px;
}

.no-question-option:has(input:checked) {
  border-color: var(--accent);
  background: #e5f7f1;
}

details {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.create-assignment {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.create-assignment > summary {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
  background: var(--soft);
  color: var(--primary);
}

.create-assignment .form-grid {
  margin-top: 16px;
}

.assignment-detail > summary {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
  background: #fafcff;
  color: var(--primary);
}

.assignment-actions-menu {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.assignment-actions-menu > summary {
  display: inline-flex;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
  background: var(--soft);
  color: var(--primary);
}

.assignment-actions-menu .actions {
  justify-content: flex-start;
  margin-top: 10px;
}

.assignment-detail[open] > summary {
  margin-bottom: 12px;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

.responses {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.missing-notice-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.missing-notice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fafcff;
}

.mini-actions {
  justify-content: flex-end;
}

.mini-actions button {
  padding: 8px 10px;
}

.no-missing {
  margin: 10px 0 0;
}

.cumulative-missing-list {
  display: grid;
  gap: 10px;
}

.cumulative-missing-row {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

.cumulative-missing-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.cumulative-missing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cumulative-missing-head > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.cumulative-missing-head strong {
  font-size: 18px;
}

.cumulative-missing-head span {
  color: var(--danger);
  font-weight: 800;
}

.cumulative-missing-row ul {
  display: grid;
  gap: 5px;
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-weight: 700;
}

.response-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.7fr) minmax(160px, 2fr) minmax(92px, auto);
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #edf1f7;
}

.response-row em {
  color: var(--muted);
  font-style: normal;
  text-align: right;
  white-space: nowrap;
}

.message {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--accent);
  font-weight: 800;
}

.message.error {
  color: var(--danger);
}

.message.success {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(15, 143, 122, 0.24);
  border-radius: 8px;
  padding: 14px;
  background: #e9f8f4;
}

.message.success strong {
  font-size: 18px;
}

.message.success span {
  color: var(--muted);
  font-weight: 700;
}

.photo-upload {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.student-missing-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.student-missing-check > div,
.student-missing-title,
.student-missing-clear {
  display: grid;
  gap: 4px;
}

.student-missing-result {
  margin-top: 12px;
}

.student-missing-result[hidden] {
  display: none;
}

.student-missing-title {
  margin-bottom: 10px;
}

.student-missing-title span,
.student-missing-clear span,
.student-missing-item span {
  color: var(--muted);
  font-weight: 700;
}

.student-missing-clear {
  border-left: 4px solid var(--accent);
  padding: 10px 12px;
  background: #f5fbf9;
}

.student-missing-items {
  display: grid;
  border-top: 1px solid var(--line);
}

.student-missing-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.student-missing-item > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.student-question-history {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 2px solid var(--line);
}

.student-question-items {
  display: grid;
  border-top: 1px solid var(--line);
}

.student-question-item {
  display: grid;
  gap: 5px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.student-question-item span {
  color: var(--primary);
  font-weight: 800;
  line-height: 1.5;
}

.open-missing-assignment {
  flex: 0 0 auto;
  background: var(--soft);
  color: var(--primary);
}

.photo-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.photo-picker {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(35, 100, 210, 0.28);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--soft);
  color: var(--primary);
  cursor: pointer;
  text-align: center;
  font-weight: 800;
}

.photo-picker.camera {
  border-color: rgba(15, 143, 122, 0.28);
  background: #e9f8f4;
  color: var(--accent);
}

.photo-picker.video-camera {
  border-color: rgba(72, 104, 184, 0.28);
  background: #eef2ff;
  color: #4868b8;
}

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

.photo-picker:focus-within {
  box-shadow: 0 0 0 3px rgba(35, 100, 210, 0.14);
}

@media (max-width: 520px) {
  .photo-actions {
    grid-template-columns: 1fr;
  }

  .student-missing-check,
  .student-missing-item,
  .cumulative-missing-head {
    align-items: stretch;
    flex-direction: column;
  }

  .student-missing-check button,
  .open-missing-assignment {
    width: 100%;
  }

  .student-password-row {
    grid-template-columns: 1fr 1fr;
  }

  .student-password-name {
    grid-column: 1 / -1;
  }
}

.submission-tabs {
  position: sticky;
  top: 8px;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 18px 0 22px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(241, 245, 252, 0.96);
  box-shadow: 0 8px 20px rgba(24, 35, 60, 0.08);
  backdrop-filter: blur(10px);
}

.submission-tabs[hidden],
.current-submission-panel[hidden] {
  display: none;
}

.submission-tab {
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.submission-tab.is-active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(35, 100, 210, 0.12);
}

.past-assignment-panel {
  display: grid;
  gap: 12px;
  margin-top: 0;
}

.past-assignment-panel[hidden] {
  display: none;
}

.past-problem-wrap {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(35, 100, 210, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.past-problem-wrap[hidden] {
  display: none;
}

.past-problem-wrap h3 {
  margin-bottom: 0;
  font-size: 17px;
}

.photo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.photo-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fafcff;
  color: var(--muted);
  font-weight: 700;
}

.class-videos {
  margin: 16px 0;
  border-top: 3px solid #0f8f7a;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px 20px;
  background: rgba(255, 255, 255, 0.82);
}

.student-auth-loading,
.student-login-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.student-auth-loading[hidden],
.student-login-gate[hidden],
.student-main-view[hidden],
#videoEmptyState[hidden],
#studentApp[hidden] {
  display: none !important;
}

.student-auth-loading {
  align-content: center;
  gap: 16px;
  color: var(--ink);
  text-align: center;
}

.student-auth-loading img {
  width: 112px;
  height: 112px;
  object-fit: contain;
}

.student-auth-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #f3d8d2;
  border-top-color: #dc7665;
  border-radius: 50%;
  animation: student-auth-spin 0.9s linear infinite;
}

@keyframes student-auth-spin {
  to { transform: rotate(360deg); }
}

.student-login-card {
  width: min(100%, 460px);
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 18px;
  border: 1px solid var(--line);
  border-top: 4px solid #0f8f7a;
  border-radius: 8px;
  padding: 26px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 50px rgba(30, 45, 80, 0.14);
}

.student-login-card > img {
  width: 90px;
  height: 90px;
  object-fit: contain;
}

.student-login-card h1 {
  margin: 4px 0 8px;
  font-size: 27px;
}

.student-login-card form {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
}

.login-help {
  margin: 0;
  text-align: center;
}

.login-school-name {
  display: block;
  width: fit-content;
  margin-top: 8px;
  border: 1px solid #e3b9af;
  border-radius: 999px;
  padding: 5px 10px;
  background: #fff1ed;
  color: #a45142;
  font-size: 14px;
  font-weight: 700;
}

.login-school-name[hidden] {
  display: none;
}

.student-dashboard-profile > div {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.student-dashboard-profile > div > span {
  border-radius: 999px;
  padding: 2px 8px;
  background: #fff0eb;
  color: #a45142;
  font-size: 12px;
  font-weight: 700;
}

.student-dashboard-profile > div > span[hidden] {
  display: none;
}

.student-account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
}

.student-account-bar > div {
  display: grid;
  gap: 2px;
}

.student-main-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 12px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.student-main-tab {
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.student-main-tab.is-active {
  background: #fff;
  color: #245fd3;
  box-shadow: 0 2px 10px rgba(30, 45, 80, 0.1);
}

.student-records-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.student-records-head h2,
.student-records-head p {
  margin: 0;
}

.student-record-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 20px;
  border: 1px solid var(--student-line, var(--line));
  border-radius: 8px;
  padding: 4px;
  background: #f8f5f4;
}

.student-record-tab {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--student-muted, var(--muted));
  font-weight: 900;
}

.student-record-tab.is-active {
  background: #fff;
  color: var(--student-coral-dark, #a65042);
  box-shadow: 0 2px 8px rgba(87, 68, 70, 0.09);
}

.student-record-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.student-record-summary > div {
  min-width: 0;
  display: grid;
  gap: 5px;
  border-left: 5px solid #3475e8;
  padding: 14px 16px;
  background: #f6f9ff;
}

.student-record-summary > div:nth-child(2) {
  border-left-color: #0f8f7a;
  background: #f1faf7;
}

.student-record-summary > div:nth-child(3) {
  border-left-color: #e7a100;
  background: #fff9e9;
}

.student-record-summary > div:nth-child(4) {
  border-left-color: #d78572;
  background: #fff4f1;
}

.student-record-summary span,
.student-record-summary small {
  color: var(--muted);
}

.student-record-summary strong {
  font-size: 25px;
}

.student-record-summary .comparison-summary {
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border-left-color: #82aee0;
  background: #f2f7fd;
}

.student-record-summary .comparison-summary.comparison-above {
  border-left-color: #72ad8d;
  background: #eff8f3;
}

.student-record-summary .comparison-summary.comparison-excellent {
  border-left-color: #46956a;
  background: #e8f6ee;
}

.student-record-summary .comparison-summary.comparison-developing {
  border-left-color: #d7a34e;
  background: #fff9e9;
}

.student-record-summary .comparison-summary.comparison-below {
  border-left-color: #d78572;
  background: #fff4f1;
}

.student-record-summary .comparison-summary.comparison-unavailable {
  border-left-color: #aaa1a2;
  background: #f7f5f5;
}

.student-record-summary .comparison-summary .comparison-label {
  font-size: 20px;
  text-align: center;
}

.student-score-trend {
  margin: 0 0 24px;
  border-top: 1px solid var(--student-line, var(--line));
  border-bottom: 1px solid var(--student-line, var(--line));
  padding: 18px 0;
}

.student-assessment-section {
  margin: 0 0 24px;
  border-top: 5px solid var(--student-coral, #d78572);
  border-bottom: 1px solid var(--student-line, var(--line));
  padding: 18px 0;
}

.student-assessment-section.student-clinic-trend {
  border-top-color: #72ad8d;
}

.student-assessment-badge {
  border-radius: 6px !important;
  padding: 7px 10px !important;
  background: var(--student-coral-soft, #fff3ef) !important;
  color: var(--student-coral-dark, #a65042) !important;
}

.student-clinic-trend .student-assessment-badge {
  background: var(--student-mint-soft, #eff8f3) !important;
  color: #39735d !important;
}

.student-analysis-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.student-analysis-heading p,
.student-analysis-heading h3 {
  margin: 0;
}

.student-analysis-heading > span,
.student-analysis-heading > .student-month-trigger {
  border: 1px solid #eadedb;
  border-radius: 999px;
  padding: 5px 9px;
  background: #fff8f5;
  color: var(--student-muted, var(--muted));
  font-size: 12px;
  font-weight: 800;
}

.student-shared-month-input {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.student-month-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--student-line, #eadedb);
  border-radius: 999px;
  padding: 5px 11px;
  background: #fff;
  color: var(--student-muted, var(--muted));
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.student-month-trigger::after {
  content: "▾";
  font-size: 11px;
}

.student-month-trigger:hover {
  border-color: var(--student-coral, #d78572);
  color: var(--student-coral-dark, #a65042);
}

.student-score-trend-chart {
  overflow-x: auto;
  border: 1px solid var(--student-line, var(--line));
  border-radius: 8px;
  padding: 10px 8px 4px;
  background: #fff;
  scrollbar-width: thin;
}

.student-score-trend-chart svg {
  display: block;
  max-width: none;
}

.assessment-chart-legend {
  position: sticky;
  left: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  width: fit-content;
  gap: 8px 14px;
  margin: 1px 8px 4px;
  border-radius: 6px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--student-muted, var(--muted));
  font-size: 12px;
  font-weight: 800;
}

.assessment-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.assessment-chart-legend i {
  width: 20px;
  border-top: 3px solid #6f9dce;
}

.assessment-chart-legend .mine {
  color: #bd2443;
  font-size: 14px;
}

.assessment-chart-legend .mine i {
  border-top: 5px solid #eb3f63;
}

.assessment-chart-legend .class-average i {
  border-top-color: #579b80;
}

.grade-legend .grade-1 i { border-top-color: #668ec4; }
.grade-legend .grade-2 i { border-top-color: #579b80; }
.grade-legend .grade-3 i { border-top-color: #d1a953; }
.grade-legend .grade-4 i { border-top-color: #9a8aab; }

.grade-cutoff-line {
  fill: none;
  stroke-width: 2.5;
  stroke-dasharray: 7 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.78;
}

.grade-cutoff-line.grade-1 { stroke: #668ec4; }
.grade-cutoff-line.grade-2 { stroke: #579b80; }
.grade-cutoff-line.grade-3 { stroke: #d1a953; }
.grade-cutoff-line.grade-4 { stroke: #9a8aab; }

.grade-cutoff-dots circle { fill: #fff; stroke-width: 2.5; }
.grade-cutoff-dots.grade-1 circle { stroke: #668ec4; }
.grade-cutoff-dots.grade-2 circle { stroke: #579b80; }
.grade-cutoff-dots.grade-3 circle { stroke: #d1a953; }
.grade-cutoff-dots.grade-4 circle { stroke: #9a8aab; }
.grade-cutoff-dots text { fill: #665f68; font-size: 10px; font-weight: 800; }

.past-exam-score-line {
  fill: none;
  stroke: #eb3f63;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.past-exam-score-dot circle {
  fill: #eb3f63;
  stroke: #fff;
  stroke-width: 4;
}

.past-exam-score-dot > text:not(.assessment-date):not(.assessment-name) {
  fill: #bd2443;
  font-size: 15px;
  font-weight: 900;
}

.assessment-date { fill: #49434b; font-size: 12px; font-weight: 900; }
.assessment-name { fill: #857d84; font-size: 10px; }

.clinic-bar-mine { fill: #eb3f63; }
.clinic-bar-class { fill: #579b80; opacity: 0.82; }
.clinic-value { fill: #39735d; font-size: 11px; font-weight: 900; }
.clinic-value.mine { fill: #bd2443; font-size: 13px; }

.score-chart-legend {
  position: sticky;
  left: 0;
  z-index: 1;
  display: flex;
  width: fit-content;
  gap: 14px;
  margin: 1px 8px 4px;
  border-radius: 6px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--student-muted, var(--muted));
  font-size: 12px;
  font-weight: 800;
}

.score-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.score-chart-legend i {
  width: 22px;
  border-top: 3px solid #d78572;
}

.score-chart-legend .class-average i {
  border-top-color: #6f9dce;
  border-top-style: dashed;
}

.score-grid line {
  stroke: #eee5e2;
  stroke-width: 1;
}

.score-grid text,
.score-dots text {
  fill: #8b8080;
  font-size: 11px;
}

.score-line {
  fill: none;
  stroke: #d78572;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.score-class-line {
  fill: none;
  stroke: #6f9dce;
  stroke-dasharray: 8 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.score-dots circle {
  fill: #fff;
  stroke: #d78572;
  stroke-width: 4;
}

.score-class-dots circle {
  fill: #fff;
  stroke: #6f9dce;
  stroke-width: 3;
}

.score-dots .score-value {
  fill: #b66050;
  font-weight: 900;
}

.student-record-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.student-record-test-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.student-record-single-column {
  width: min(560px, 100%);
}

.student-record-columns h3 {
  margin: 0 0 12px;
}

.student-history-list {
  border-top: 1px solid var(--line);
}

.student-history-row {
  min-height: 52px;
  display: grid;
  grid-template-columns: 72px 72px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 9px 4px;
}

.student-history-row small {
  color: var(--muted);
}

.record-status {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 9px;
  background: #edf8f5;
  color: #087663;
  font-size: 13px;
  font-weight: 800;
}

.record-status.status-absent {
  background: #fff0ef;
  color: #b83d37;
}

.record-status.status-late,
.record-status.status-early {
  background: #fff7df;
  color: #9a6700;
}

.test-history-row {
  grid-template-columns: minmax(0, 1fr) auto 56px;
}

.test-history-row > div {
  display: grid;
  gap: 3px;
}

.test-history-row em {
  color: #245fd3;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.test-topic-list {
  color: #8a6258 !important;
  font-weight: 700;
}

.student-past-exam-card {
  border-bottom: 1px solid var(--student-line, var(--line));
  padding-bottom: 10px;
}

.student-past-exam-card .student-history-row {
  border-bottom: 0;
}

.student-estimated-grade {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1.5fr);
  gap: 12px;
  margin: 4px 4px 12px;
  border: 1px solid #ead58f;
  padding: 12px;
  background: #fffbed;
}

.student-estimated-grade-result {
  display: grid;
  align-content: center;
  gap: 4px;
}

.student-estimated-grade-result span,
.student-estimated-grade-result small {
  color: #796b48;
  font-size: 12px;
}

.student-estimated-grade-result strong {
  color: #9a5b2d;
  font-size: 21px;
}

.student-grade-cutoff-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(68px, 1fr));
  gap: 5px;
}

.student-grade-cutoff-list > div {
  display: grid;
  gap: 3px;
  border: 1px solid #e7dcc0;
  padding: 8px 6px;
  background: #fff;
  text-align: center;
}

.student-grade-cutoff-list > div.is-current {
  border-color: #d77967;
  background: #fff0ec;
}

.student-grade-cutoff-list span {
  color: #786f60;
  font-size: 11px;
}

.student-grade-cutoff-list strong {
  color: #463f33;
  font-size: 12px;
}

.student-past-exam-analysis {
  margin: 0 4px;
  border-left: 3px solid #7ab9a7;
  padding: 10px 12px;
  background: #f2faf7;
}

.student-past-exam-analysis > strong {
  display: block;
  margin-bottom: 8px;
  color: #176958;
  font-size: 13px;
}

.student-wrong-question-list {
  display: grid;
  gap: 7px;
}

.student-wrong-question-list > div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.student-wrong-question-list span {
  color: #c15349;
  font-weight: 900;
}

.student-wrong-question-list p,
.student-perfect-result {
  margin: 0;
}

.student-wrong-question-list small {
  color: #c15349;
  font-weight: 800;
}

.student-perfect-result {
  color: #176958;
  font-weight: 800;
}

.student-assessment-result-label {
  width: fit-content;
  margin: 3px 4px 10px;
  border-radius: 5px;
  padding: 5px 8px;
  background: var(--student-mint-soft, #eff8f3);
  color: #39735d;
  font-size: 12px;
  font-weight: 900;
}

.student-assessment-weakness {
  margin: 0 0 24px;
  border-top: 1px solid var(--student-line, var(--line));
  border-bottom: 1px solid var(--student-line, var(--line));
  padding: 18px 0;
}

.student-weakness-list {
  display: grid;
  gap: 9px;
}

.student-weakness-card {
  border: 1px solid var(--student-line, var(--line));
  border-radius: 7px;
  background: #fff;
}

.student-weakness-card summary {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.student-weakness-card summary::-webkit-details-marker { display: none; }

.student-weakness-rank {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--student-coral-soft, #fff3ef);
  color: var(--student-coral-dark, #a65042);
  font-size: 16px;
  font-weight: 900;
}

.student-weakness-title {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.student-weakness-title strong { font-size: 15px; }
.student-weakness-title small { color: var(--student-muted, var(--muted)); line-height: 1.35; }
.student-weakness-count { color: var(--student-coral-dark, #a65042); font-size: 12px; white-space: nowrap; }
.student-weakness-count b { font-size: 18px; }

.student-weakness-sources {
  display: grid;
  gap: 5px;
  margin: 0 12px 12px 56px;
  border-left: 3px solid #82aee0;
  padding: 9px 11px;
  background: var(--student-blue-soft, #f2f7fd);
  color: #53677f;
  font-size: 12px;
}

.student-weakness-sources small { color: var(--student-muted, var(--muted)); }
.student-assessment-perfect { padding: 13px; background: var(--student-mint-soft, #eff8f3); }

.student-learning-analysis {
  margin: 0 0 24px;
  border-top: 1px solid var(--student-line, var(--line));
  border-bottom: 1px solid var(--student-line, var(--line));
  padding: 18px 0;
}

.student-learning-analysis h3 {
  margin: 0 0 12px;
}

.student-learning-analysis .student-analysis-heading h3 {
  margin: 0;
}

.topic-achievement-list {
  display: grid;
  gap: 14px;
}

.topic-achievement-row {
  display: grid;
  gap: 7px;
}

.topic-achievement-row > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topic-achievement-row > div:first-child span {
  color: var(--student-muted, var(--muted));
  font-weight: 900;
}

.topic-achievement-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #f0eae8;
}

.topic-achievement-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #d78572;
}

.topic-achievement-row.is-strong .topic-achievement-track i {
  background: #72ad8d;
}

.topic-achievement-row.is-steady .topic-achievement-track i {
  background: #e2b85c;
}

.weak-type-summary {
  margin-top: 18px;
  border-top: 1px dashed var(--student-line, var(--line));
  padding-top: 14px;
}

.weak-type-summary > span {
  color: var(--student-muted, var(--muted));
  font-size: 13px;
  font-weight: 800;
}

.weak-type-summary p {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 9px 0 0;
}

.weak-type-summary strong {
  border-radius: 6px;
  padding: 6px 10px;
  background: var(--student-coral-soft, #fff3ef);
  color: #8a5145;
  font-size: 13px;
}

.student-learning-analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.student-learning-group {
  min-width: 0;
  padding: 14px;
  background: var(--student-mint-soft, #f1faf7);
}

.student-learning-group.weak,
.student-learning-group.types {
  background: var(--student-coral-soft, #fff3ef);
}

.student-learning-group > span {
  color: var(--student-muted, var(--muted));
  font-size: 13px;
  font-weight: 800;
}

.student-learning-group p {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 9px 0 0;
}

.student-learning-group p strong,
.student-learning-group p small {
  border-radius: 4px;
  padding: 5px 7px;
  background: #fff;
  font-size: 13px;
}

.student-learning-group p small {
  margin-left: -6px;
  color: var(--student-coral-dark, #b65f50);
}

.student-empty-state {
  display: grid;
  gap: 6px;
  text-align: center;
}

.teacher-main-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin: 14px 0 10px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.teacher-main-tab {
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.teacher-main-tab.is-active {
  background: #173957;
  color: #fff;
}

.teacher-class-switcher {
  margin-bottom: 12px;
  padding: 10px;
}

.teacher-module[hidden] {
  display: none !important;
}

.management-module-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.management-module-head h2,
.management-module-head p {
  margin: 0;
}

.management-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.management-summary-strip > div {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

.management-summary-strip > div:last-child {
  border-right: 0;
}

.management-summary-strip span {
  color: var(--muted);
  font-size: 13px;
}

.management-summary-strip strong {
  font-size: 22px;
}

.attendance-date-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.attendance-date-tab {
  flex: 0 0 104px;
  min-height: 66px;
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.attendance-date-tab span {
  color: var(--muted);
  font-size: 12px;
}

.attendance-date-tab.is-active {
  border-color: #0f8f7a;
  background: #edf8f5;
}

.attendance-date-tab.is-future {
  opacity: 0.62;
}

.attendance-editor {
  margin-top: 16px;
  border-top: 2px solid #173957;
  padding-top: 18px;
}

.attendance-editor-head,
.test-score-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.attendance-editor-head h3,
.attendance-editor-head p,
.test-score-editor-head h3,
.test-score-editor-head p {
  margin: 0;
}

.no-class-toggle,
.test-absent-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  white-space: nowrap;
}

.attendance-student-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin-bottom: 16px;
}

.attendance-student-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 8px 2px;
}

.test-create-form {
  display: grid;
  grid-template-columns: 145px 130px minmax(190px, 1fr) 85px minmax(210px, 1fr) auto;
  align-items: end;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}

.test-workspace {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 22px;
  margin-top: 22px;
}

.test-workspace aside h3,
.test-cumulative-section h3 {
  margin-top: 0;
}

.teacher-test-list {
  display: grid;
  gap: 7px;
}

.teacher-test-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.teacher-test-item span {
  color: var(--muted);
  font-size: 13px;
}

.teacher-test-item small {
  overflow: hidden;
  color: #587087;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-test-item.is-active {
  border-color: #3475e8;
  background: #f1f6ff;
}

.test-score-rows {
  border-top: 1px solid var(--line);
  margin-bottom: 14px;
}

.selected-test-meta-fields {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  margin: 14px 0;
}

.selected-test-meta-fields label {
  display: grid;
  gap: 6px;
}

.estimated-grade-cutoff-fields {
  margin: 0 0 16px;
  border: 1px solid #d9cfae;
  padding: 13px;
  background: #fffaf0;
}

.estimated-grade-cutoff-fields > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.estimated-grade-cutoff-fields small,
.estimated-grade-cutoff-fields p {
  color: var(--muted);
  font-size: 12px;
}

.estimated-grade-cutoff-fields p {
  margin: 8px 0 0;
}

.estimated-grade-cutoff-inputs {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 8px;
}

.estimated-grade-cutoff-inputs label {
  display: grid;
  gap: 5px;
}

.test-score-row {
  display: grid;
  grid-template-columns: 90px 100px 86px minmax(150px, 1fr);
  align-items: end;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.test-score-row.is-past-exam {
  grid-template-columns: 90px minmax(170px, 1.2fr) 100px 86px minmax(150px, 1fr);
}

.past-exam-row-analysis {
  grid-column: 2 / -1;
  border-left: 3px solid #8ccfbe;
  padding: 7px 10px;
  background: #f2faf7;
  color: #316c61;
  font-size: 12px;
  line-height: 1.45;
}

.past-exam-row-analysis.is-error {
  border-left-color: #e28378;
  background: #fff2f0;
  color: #ad3e36;
}

.test-score-row > strong {
  align-self: center;
}

.danger {
  color: #b83d37;
}

.test-cumulative-section {
  margin-top: 26px;
  border-top: 2px solid #0f8f7a;
  padding-top: 18px;
}

.test-cumulative-table,
.monthly-student-list {
  border-top: 1px solid var(--line);
}

.test-cumulative-row,
.monthly-student-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.3fr) repeat(4, minmax(72px, 0.7fr));
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
}

.test-cumulative-row {
  grid-template-columns: minmax(110px, 1.3fr) repeat(5, minmax(72px, 0.7fr));
}

.test-cumulative-row.is-head,
.monthly-student-row.is-head {
  min-height: 40px;
  background: #f5f7fa;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.monthly-student-row {
  grid-template-columns: minmax(110px, 1.3fr) repeat(3, minmax(70px, 0.7fr)) auto;
}

.monthly-report-preview {
  margin-top: 24px;
  scroll-margin-top: 12px;
}

.monthly-report-sheet {
  border: 1px solid #cdd8e5;
  border-top: 8px solid #173957;
  padding: 32px;
  background: #f8fbff;
}

.monthly-report-title {
  border-bottom: 1px solid #cdd8e5;
  padding-bottom: 20px;
}

.monthly-report-title p,
.monthly-report-title h2,
.monthly-report-title span {
  margin: 0;
}

.monthly-report-title p {
  color: #0f8f7a;
  font-weight: 900;
}

.monthly-report-title h2 {
  margin: 6px 0;
  font-size: 32px;
}

.monthly-report-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.monthly-report-metrics > div {
  display: grid;
  gap: 5px;
  border-left: 5px solid #3475e8;
  padding: 14px;
  background: #fff;
}

.monthly-report-metrics > div:nth-child(2) { border-left-color: #0f8f7a; }
.monthly-report-metrics > div:nth-child(3) { border-left-color: #e7a100; }
.monthly-report-metrics > div:nth-child(4) { border-left-color: #c2413a; }
.monthly-report-metrics > div:nth-child(5) { border-left-color: #9a72b8; }
.monthly-report-metrics > div:nth-child(6) { border-left-color: #72ad8d; }

.monthly-report-metrics span,
.monthly-report-metrics small {
  color: var(--muted);
}

.monthly-report-metrics strong {
  font-size: 24px;
}

.monthly-learning-analysis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.monthly-learning-analysis > div {
  min-width: 0;
  padding: 14px;
  background: #fff;
}

.monthly-learning-analysis > div > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.monthly-learning-analysis p {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 9px 0 0;
}

.monthly-learning-analysis p strong,
.monthly-learning-analysis p small {
  border-radius: 4px;
  padding: 5px 7px;
  background: #f1f6ff;
  font-size: 13px;
}

.monthly-learning-analysis p small {
  margin-left: -6px;
  background: #e4eefc;
  color: #426d9d;
}

.monthly-report-comment {
  border: 1px solid #cdd8e5;
  padding: 20px;
  background: #fff;
}

.monthly-report-comment h3 {
  margin-top: 0;
}

.monthly-report-comment p {
  min-height: 88px;
  margin-bottom: 0;
  line-height: 1.7;
}

.monthly-report-sign {
  margin-top: 18px;
  color: var(--muted);
  font-weight: 900;
  text-align: right;
}

.monthly-report-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
}

.class-videos-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.class-videos-head h2,
.class-videos-head p {
  margin: 0;
}

.class-video-scope {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  border: 1px solid var(--student-line, var(--line));
  border-radius: 7px;
  padding: 3px;
  background: #f8f5f4;
}

.class-video-scope button {
  min-height: 38px;
  border: 0;
  border-radius: 5px;
  padding: 7px 12px;
  background: transparent;
  color: var(--student-muted, var(--muted));
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.class-video-scope button.is-active {
  background: #fff;
  color: var(--student-coral-dark, #a65042);
  box-shadow: 0 2px 8px rgba(87, 68, 70, 0.09);
}

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

.class-video-month-empty {
  grid-column: 1 / -1;
  margin: 10px 0 4px;
  text-align: center;
}

.class-video-item {
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.class-video-item strong {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.class-video-thumbnail {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: #172033;
}

.class-video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.class-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 32px;
  border-radius: 7px;
  background: rgba(194, 32, 38, 0.92);
  transform: translate(-50%, -50%);
}

.class-video-play::after {
  position: absolute;
  top: 9px;
  left: 17px;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid #fff;
  content: "";
}

body[data-theme] {
  background-attachment: fixed;
}

body[data-theme="focus"] {
  background:
    radial-gradient(circle at 15% 12%, rgba(35, 100, 210, 0.16), transparent 28%),
    radial-gradient(circle at 85% 18%, rgba(15, 143, 122, 0.14), transparent 30%),
    linear-gradient(135deg, #f7f9ff 0%, #edf5f3 100%);
}

body[data-theme="fresh"] {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.5)),
    repeating-linear-gradient(135deg, rgba(15, 143, 122, 0.12) 0 2px, transparent 2px 18px),
    #eef8f5;
}

body[data-theme="paper"] {
  background:
    linear-gradient(#f8fbff 31px, rgba(35, 100, 210, 0.12) 32px),
    linear-gradient(90deg, rgba(194, 65, 58, 0.14) 1px, transparent 1px),
    #fbfcff;
  background-size: 100% 32px, 42px 100%;
}

body[data-theme="night"] {
  --bg: #172033;
  --ink: #f4f7fb;
  --muted: #c4ccd8;
  --line: rgba(255, 255, 255, 0.18);
  --panel: rgba(255, 255, 255, 0.08);
  --soft: rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(135deg, rgba(23, 32, 51, 0.96), rgba(22, 55, 66, 0.94)),
    #172033;
}

body[data-theme="night"] input,
body[data-theme="night"] textarea {
  background: rgba(255, 255, 255, 0.95);
  color: #172033;
}

body[data-theme="night"] .check-cell,
body[data-theme="night"] .panel,
body[data-theme="night"] .student-hero {
  backdrop-filter: blur(10px);
}

body[data-theme="night"] .range-text {
  color: #f4f7fb;
}

.theme-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.theme-card {
  min-height: 250px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.theme-focus {
  background:
    radial-gradient(circle at 15% 12%, rgba(35, 100, 210, 0.16), transparent 28%),
    radial-gradient(circle at 85% 18%, rgba(15, 143, 122, 0.14), transparent 30%),
    linear-gradient(135deg, #f7f9ff 0%, #edf5f3 100%);
}

.theme-fresh {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.5)),
    repeating-linear-gradient(135deg, rgba(15, 143, 122, 0.12) 0 2px, transparent 2px 18px),
    #eef8f5;
}

.theme-paper {
  background:
    linear-gradient(#f8fbff 31px, rgba(35, 100, 210, 0.12) 32px),
    linear-gradient(90deg, rgba(194, 65, 58, 0.14) 1px, transparent 1px),
    #fbfcff;
  background-size: 100% 32px, 42px 100%;
}

.theme-night {
  background: linear-gradient(135deg, rgba(23, 32, 51, 0.96), rgba(22, 55, 66, 0.94)), #172033;
  color: #f4f7fb;
}

.mini-panel {
  width: 100%;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 12px 28px rgba(30, 45, 80, 0.12);
}

.theme-night .mini-panel {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.mini-panel h2 {
  margin-bottom: 8px;
}

.mini-panel p {
  margin-bottom: 14px;
}

.mini-checks {
  display: flex;
  gap: 8px;
}

.mini-checks span {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: #172033;
  font-weight: 800;
}

@media (max-width: 760px) {
  .theme-preview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    width: calc(100vw - 20px);
    max-width: 1180px;
    margin-right: 10px;
    margin-left: 10px;
    padding-top: 16px;
  }

  .topbar,
  .section-head,
  .assignment-head {
    display: grid;
  }

  .teacher-class-tabs {
    gap: 3px;
  }

  .teacher-class-tab {
    display: grid;
    gap: 2px;
    min-height: 54px;
    padding: 7px 4px;
    font-size: 13px;
  }

  .teacher-view-head {
    display: grid;
    align-items: stretch;
  }

  .teacher-mode-tabs {
    min-width: 0;
    width: 100%;
  }

  .teacher-summary-strip > div {
    padding: 12px 10px;
  }

  .teacher-summary-strip strong {
    font-size: 17px;
  }

  .student-hero {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
    min-height: 128px;
    padding: 18px 14px;
  }

  .class-videos {
    margin: 12px 0;
    padding: 15px 14px 17px;
  }

  .class-videos-head {
    align-items: end;
  }

  .class-video-scope button {
    min-height: 36px;
    padding: 6px 9px;
    font-size: 13px;
  }

  .class-video-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    overflow-x: visible;
  }

  .class-video-item {
    width: 100%;
  }

  .class-video-list.is-expanded {
    display: grid;
    grid-template-columns: 1fr;
    overflow-x: visible;
    scroll-snap-type: none;
  }

  .class-video-list.is-expanded .class-video-item {
    width: 100%;
  }

  .test-cumulative-table {
    overflow-x: auto;
  }

  .test-cumulative-row {
    min-width: 720px;
  }

  .student-login-gate {
    padding: 14px;
  }

  .student-login-card {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 14px;
    padding: 20px 18px;
  }

  .student-login-card > img {
    width: 72px;
    height: 72px;
  }

  .student-login-card h1 {
    font-size: 22px;
  }

  .student-main-tab {
    min-height: 44px;
    padding: 8px 4px;
    font-size: 14px;
  }

  .student-records-head,
  .student-record-columns {
    display: grid;
    grid-template-columns: 1fr;
  }

  .student-record-summary {
    grid-template-columns: 1fr;
  }

  .student-record-summary > div {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .student-record-summary > div small {
    grid-column: 1 / -1;
  }

  .student-record-summary .comparison-summary {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .student-record-summary .comparison-summary .comparison-label {
    text-align: left;
  }

  .student-analysis-heading {
    align-items: start;
  }

  .student-analysis-heading > span,
  .student-analysis-heading > .student-month-trigger {
    flex: 0 0 auto;
  }

  .teacher-main-tab {
    min-height: 44px;
    padding: 7px 2px;
    font-size: 13px;
  }

  .management-module-head,
  .attendance-editor-head,
  .test-score-editor-head,
  .monthly-report-actions {
    display: grid;
    align-items: stretch;
  }

  .management-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .management-summary-strip > div:nth-child(2) {
    border-right: 0;
  }

  .management-summary-strip > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .attendance-student-list,
  .test-workspace,
  .test-create-form,
  .selected-test-meta-fields {
    grid-template-columns: 1fr;
  }

  .student-estimated-grade,
  .estimated-grade-cutoff-inputs {
    grid-template-columns: 1fr;
  }

  .student-grade-cutoff-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .student-grade-cutoff-list > div:last-child {
    grid-column: 1 / -1;
  }

  .test-score-row {
    grid-template-columns: minmax(80px, 1fr) 92px 78px;
  }

  .test-score-row.is-past-exam {
    grid-template-columns: minmax(80px, 1fr) minmax(150px, 1.5fr) 82px;
  }

  .test-score-row.is-past-exam .past-exam-row-analysis {
    grid-column: 1 / -1;
  }

  .test-score-row.is-past-exam > label:nth-of-type(4) {
    grid-column: 1 / -1;
  }

  .test-score-row > label:last-child {
    grid-column: 1 / -1;
  }

  .monthly-student-row,
  .monthly-student-row.is-head {
    grid-template-columns: minmax(82px, 1.2fr) repeat(3, 54px) auto;
    gap: 5px;
    padding-right: 3px;
    padding-left: 3px;
    font-size: 13px;
  }

  .monthly-report-sheet {
    padding: 22px 16px;
  }

  .monthly-report-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .student-class-pill {
    top: 10px;
    right: 10px;
    max-width: 48%;
    font-size: 13px;
  }

  .hero-character {
    width: 80px;
    height: 80px;
  }

  .hero-copy {
    padding-right: 0;
    padding-top: 18px;
  }

  .range-text {
    font-size: 17px;
  }

  .form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .teacher-insights,
  .missing-notice-row,
  .submission-options,
  .response-row {
    grid-template-columns: 1fr;
  }

  .missing-notice-row {
    display: grid;
  }

  .response-row em {
    text-align: left;
  }

  .primary {
    width: 100%;
  }

  .actions {
    justify-content: stretch;
  }

  .actions > * {
    flex: 1;
  }
}

/* Student dashboard: approved coral layout */
.student-app-body {
  --student-coral: #d98170;
  --student-coral-dark: #bd5d4b;
  --student-coral-soft: #faece8;
  --student-yellow-soft: #fff7ce;
  --student-blue-soft: #eaf3ff;
  --student-mint-soft: #e8f5ee;
  --student-paper: #ffffff;
  --student-bg: #f8faf9;
  --student-ink: #313039;
  --student-muted: #77727d;
  --student-line: #e7e4e5;
  background: var(--student-bg);
  color: var(--student-ink);
  font-family: "Jua", "Malgun Gothic", sans-serif;
}

.student-app-body h1,
.student-app-body h2,
.student-app-body h3,
.student-app-body button,
.student-app-body .student-dashboard-stat strong,
.student-app-body .student-dashboard-brand strong,
.student-app-body .student-dashboard-profile strong,
.student-app-body .student-dashboard-assignment-title,
.student-app-body .student-dashboard-progress strong {
  font-family: "Jua", "Malgun Gothic", sans-serif;
  font-weight: 400;
  letter-spacing: 0;
}

.student-dashboard-shell {
  width: min(860px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 0 88px;
  background: var(--student-paper);
  box-shadow: 0 0 36px rgba(84, 75, 77, 0.08);
}

.student-dashboard-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 6px solid var(--student-coral);
  border-bottom: 1px solid var(--student-line);
  padding: 8px 22px 9px;
  background: #fff;
}

.student-dashboard-brand,
.student-dashboard-profile {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.student-dashboard-brand img {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  object-fit: contain;
}

.student-dashboard-brand > div,
.student-dashboard-profile > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.student-dashboard-brand strong {
  color: #3f3a3c;
  font-size: 20px;
}

.student-dashboard-brand span,
.student-dashboard-profile span {
  color: var(--student-muted);
  font-size: 13px;
}

.student-dashboard-profile {
  justify-content: flex-end;
  text-align: right;
}

.student-dashboard-profile > div {
  justify-items: end;
}

.student-dashboard-profile strong {
  overflow: hidden;
  color: #4e474a;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-dashboard-profile #loggedInSchoolName {
  width: fit-content;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--student-coral-soft);
  color: var(--student-coral-dark);
  font-size: 12px;
}

.student-dashboard-profile #studentLogoutButton {
  min-height: 36px;
  border-color: #ead8d3;
  padding: 7px 11px;
  background: #fffaf8;
  color: var(--student-coral-dark);
}

.student-dashboard-welcome {
  min-height: 154px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 27px 30px 30px;
  background: var(--student-coral);
  color: #fff;
}

.student-dashboard-today {
  width: max-content;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 4px;
  padding: 3px 7px;
  font-family: "Jua", "Malgun Gothic", sans-serif;
  font-size: 12px;
}

.student-dashboard-welcome h1 {
  margin: 0;
  font-size: clamp(29px, 5vw, 42px);
  line-height: 1.16;
}

.student-dashboard-welcome p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
}

.student-dashboard-main {
  display: grid;
  gap: 18px;
  padding: 24px 28px 30px;
  background: #fbfcfb;
}

.student-practice-feature {
  display: grid;
  gap: 4px;
  border: 1px solid #b8d9d3;
  border-radius: 10px;
  padding: 17px 19px;
  background: linear-gradient(110deg, #e8f6f1, #f6fbf7);
  color: #164e49;
  text-decoration: none;
  box-shadow: 0 3px 12px rgba(15, 107, 107, 0.07);
}

.student-practice-feature:hover,
.student-practice-feature:focus-visible {
  border-color: #0f6b6b;
  box-shadow: 0 4px 16px rgba(15, 107, 107, 0.16);
}

.student-practice-feature-label {
  font-size: 12px;
  font-weight: 800;
}

.student-practice-feature strong {
  font-size: 23px;
  line-height: 1.2;
}

.student-practice-feature-description {
  font-size: 13px;
  line-height: 1.45;
}

.student-practice-feature-action {
  justify-self: end;
  font-size: 14px;
  font-weight: 800;
}

.student-dashboard-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.student-dashboard-section-head.compact {
  margin-bottom: 10px;
}

.student-dashboard-section-head h2 {
  margin: 0;
  color: #403a3d;
  font-size: 22px;
}

.student-dashboard-section-head span {
  color: var(--student-muted);
  font-size: 13px;
}

.student-dashboard-section-head .student-month-trigger {
  color: var(--student-muted);
}

.student-dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.student-dashboard-stat {
  min-width: 0;
  min-height: 104px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  border: 0;
  border-bottom: 4px solid #d58b7c;
  border-radius: 7px;
  padding: 15px 14px 13px;
  background: var(--student-coral-soft);
  color: var(--student-ink);
  text-align: left;
  cursor: pointer;
}

.student-dashboard-stat.attendance {
  border-bottom-color: #d5c34e;
  background: var(--student-yellow-soft);
}

.student-dashboard-stat.tests {
  border-bottom-color: #82aee0;
  background: var(--student-blue-soft);
}

.student-dashboard-stat.videos {
  border-bottom-color: #72ad8d;
  background: var(--student-mint-soft);
}

.student-dashboard-stat:hover,
.student-dashboard-stat:focus-visible {
  transform: translateY(-1px);
  filter: brightness(0.99);
}

.student-dashboard-stat span {
  overflow-wrap: anywhere;
  color: #6e686c;
  font-size: 13px;
}

.student-dashboard-stat strong {
  overflow-wrap: anywhere;
  color: #3b383a;
  font-size: 24px;
  line-height: 1.05;
}

.student-dashboard-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px 16px;
  border: 1px solid var(--student-line);
  border-radius: 8px;
  padding: 15px 16px;
  background: #fff;
}

.student-dashboard-progress > div:first-child {
  display: grid;
  gap: 8px;
}

.student-dashboard-progress span {
  color: var(--student-muted);
  font-size: 13px;
}

.student-dashboard-progress > b {
  grid-column: 2;
  grid-row: 1;
  color: var(--student-coral-dark);
  font-family: "Jua", "Malgun Gothic", sans-serif;
  font-weight: 400;
  font-size: 24px;
}

.student-dashboard-track {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 5px;
  background: #eee9e8;
}

.student-dashboard-track span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--student-coral);
  transition: width 240ms ease;
}

.student-dashboard-content {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  align-items: start;
  gap: 18px;
}

.student-dashboard-assignment {
  border: 1px solid var(--student-line);
  border-top: 4px solid var(--student-coral);
  border-radius: 8px;
  padding: 17px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(84, 75, 77, 0.06);
}

.student-dashboard-assignment-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.student-dashboard-assignment-top > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.student-dashboard-assignment-label {
  color: var(--student-coral-dark);
  font-size: 13px;
  font-weight: 700;
}

.student-dashboard-assignment-title {
  margin: 0;
  overflow-wrap: anywhere;
  color: #343033;
  font-size: 24px;
}

.student-dashboard-assignment-range {
  margin: 0;
  color: #665f63;
  font-size: 15px;
  font-weight: 700;
}

.student-dashboard-due {
  flex: 0 0 auto;
  border-radius: 5px;
  padding: 7px 9px;
  background: var(--student-yellow-soft);
  color: #796f32;
  font-size: 12px;
  font-weight: 700;
}

.student-dashboard-due.is-complete {
  background: var(--student-mint-soft);
  color: #397659;
}

.student-dashboard-detail {
  margin: 12px 0 15px;
  color: var(--student-muted);
  font-size: 14px;
  line-height: 1.6;
}

.student-dashboard-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.student-dashboard-actions button {
  min-height: 44px;
  border: 1px solid #e4d6d2;
  border-radius: 6px;
  background: #fff;
  color: var(--student-coral-dark);
  cursor: pointer;
}

.student-dashboard-actions button:first-child {
  border-color: var(--student-coral);
  background: var(--student-coral);
  color: #fff;
}

#homePastAssignmentButton {
  grid-column: 1 / -1;
  min-height: 38px;
  background: #fffaf8;
}

.student-dashboard-alert {
  width: 100%;
  min-height: 74px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--student-line);
  border-left: 5px solid var(--student-coral);
  border-radius: 7px;
  padding: 12px 13px;
  background: #fff;
  color: var(--student-ink);
  text-align: left;
  cursor: pointer;
}

.student-dashboard-alert + .student-dashboard-alert {
  margin-top: 9px;
}

.student-dashboard-alert.video {
  border-left-color: #82aee0;
  background: #f4f8ff;
}

.student-dashboard-alert.is-clear {
  border-left-color: #72ad8d;
  background: #f4fbf7;
}

.student-dashboard-alert strong {
  overflow-wrap: anywhere;
  color: #3f3a3d;
  font-size: 15px;
}

.student-dashboard-alert span {
  overflow-wrap: anywhere;
  color: var(--student-muted);
  font-size: 12px;
  line-height: 1.45;
}

.student-assignment-context {
  display: grid;
  gap: 5px;
  border-bottom: 1px solid var(--student-line);
  padding: 24px 28px 17px;
  background: #fff6f3;
}

.student-assignment-context span {
  color: var(--student-coral-dark);
  font-weight: 700;
}

.student-assignment-context h2,
.student-assignment-context p {
  margin: 0;
}

.student-assignment-context h2 {
  overflow-wrap: anywhere;
  font-size: 27px;
}

.student-app-body #studentAssignmentView > .panel,
.student-app-body .student-records-panel,
.student-app-body .class-videos,
.student-app-body .student-empty-state {
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 24px 28px 30px;
  background: #fff;
  box-shadow: none;
}

.student-app-body label {
  color: #4d474a;
}

.student-app-body input,
.student-app-body select {
  border-color: #ddd7d8;
  border-radius: 6px;
  background: #fff;
}

.student-app-body input:focus,
.student-app-body select:focus {
  border-color: var(--student-coral);
  box-shadow: 0 0 0 3px rgba(217, 129, 112, 0.16);
}

.student-app-body .primary,
.student-app-body .secondary {
  border-color: var(--student-coral-dark);
  border-radius: 6px;
  background: var(--student-coral);
  color: #fff;
}

.student-app-body .primary:hover,
.student-app-body .secondary:hover {
  background: var(--student-coral-dark);
}

.student-app-body .ghost {
  border-color: #e4d6d2;
  border-radius: 6px;
  color: var(--student-coral-dark);
}

.student-app-body .submission-tabs {
  border-color: #eadedb;
  background: #fff7f5;
}

.student-app-body .submission-tab.is-active {
  background: var(--student-coral);
  color: #fff;
}

.student-app-body .check-grid input:checked + span,
.student-app-body .no-question-option:has(input:checked) {
  border-color: var(--student-coral);
  background: #fff1ed;
  color: var(--student-coral-dark);
}

.student-app-body .photo-picker {
  border-color: #e2c4bc;
  background: #fff6f3;
  color: var(--student-coral-dark);
}

.student-app-body .photo-picker.camera {
  border-color: #b9d9c8;
  background: #edf8f2;
  color: #3d7b5b;
}

.student-app-body .photo-picker.video-camera {
  border-color: #c9d2ec;
  background: #f2f5ff;
  color: #526ba7;
}

.student-app-body .student-missing-check,
.student-app-body .student-missing-result,
.student-app-body .past-problem-wrap {
  border-color: #eadedb;
  background: #fffaf8;
}

.student-app-body .class-videos-head {
  border-bottom-color: var(--student-line);
}

.student-app-body .class-video-item {
  border-color: var(--student-line);
  border-radius: 8px;
}

.student-app-body .student-record-summary > div {
  border-left-color: var(--student-coral);
  background: var(--student-coral-soft);
}

.student-app-body .student-record-summary > div:nth-child(2) {
  border-left-color: #72ad8d;
  background: var(--student-mint-soft);
}

.student-app-body .student-record-summary > div:nth-child(3) {
  border-left-color: #82aee0;
  background: var(--student-blue-soft);
}

.student-app-body .student-record-summary > div:nth-child(4) {
  border-left-color: #d78572;
  background: var(--student-coral-soft);
}

.student-main-tabs {
  position: fixed;
  z-index: 20;
  bottom: 0;
  left: 50%;
  width: min(860px, 100%);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border: 1px solid var(--student-line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  padding: 5px 8px max(5px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -7px 22px rgba(73, 64, 67, 0.09);
  transform: translateX(-50%);
}

.student-main-tab {
  min-height: 48px;
  border-radius: 6px;
  color: #857e82;
  font-size: 15px;
}

.student-main-tab.is-active {
  background: var(--student-coral-soft);
  color: var(--student-coral-dark);
  box-shadow: none;
}

.student-auth-loading,
.student-login-gate {
  background: #fff7f4;
}

.student-auth-loading img {
  width: 126px;
  height: 126px;
}

.student-login-card {
  border-color: #eadedb;
  border-top-color: var(--student-coral);
  background: #fff;
  box-shadow: 0 18px 45px rgba(109, 75, 69, 0.13);
}

.student-login-card h1 {
  color: #40393c;
}

.student-login-card .primary {
  width: 100%;
}

@media (max-width: 760px) {
  .student-dashboard-shell {
    width: 100%;
    box-shadow: none;
  }

  .student-dashboard-header {
    min-height: 64px;
    padding: 6px 13px 7px 8px;
  }

  .student-dashboard-brand {
    gap: 7px;
  }

  .student-dashboard-brand img {
    width: 46px;
    height: 46px;
  }

  .student-dashboard-brand strong {
    font-size: 17px;
  }

  .student-dashboard-brand span,
  .student-dashboard-profile span {
    font-size: 11px;
  }

  .student-dashboard-profile {
    gap: 5px;
  }

  .student-dashboard-profile strong {
    max-width: 84px;
    font-size: 15px;
  }

  .student-dashboard-profile #studentLogoutButton {
    min-height: 32px;
    padding: 5px 8px;
    font-size: 12px;
  }

  .student-dashboard-welcome {
    min-height: 145px;
    padding: 24px 18px 27px;
  }

  .student-dashboard-welcome h1 {
    font-size: 31px;
  }

  .student-dashboard-welcome p {
    font-size: 14px;
  }

  .student-dashboard-main {
    gap: 15px;
    padding: 19px 15px 25px;
  }

  .student-dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .student-dashboard-stat {
    min-height: 94px;
    padding: 13px 12px 11px;
  }

  .student-dashboard-stat strong {
    font-size: 22px;
  }

  .student-dashboard-content {
    grid-template-columns: 1fr;
    gap: 17px;
  }

  .student-dashboard-assignment {
    padding: 15px;
  }

  .student-dashboard-assignment-title {
    font-size: 22px;
  }

  .student-dashboard-actions {
    grid-template-columns: 1fr 1fr;
  }

  .student-assignment-context,
  .student-app-body #studentAssignmentView > .panel,
  .student-app-body .student-records-panel,
  .student-app-body .class-videos,
  .student-app-body .student-empty-state {
    padding-right: 15px;
    padding-left: 15px;
  }

  .student-main-tabs {
    border-radius: 0;
    padding-right: 4px;
    padding-left: 4px;
  }

  .student-main-tab {
    min-height: 46px;
    padding: 7px 3px;
    font-size: 13px;
  }

  .student-record-summary {
    grid-template-columns: 1fr;
  }

  .student-learning-analysis-grid,
  .monthly-learning-analysis {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .student-dashboard-brand span {
    display: none;
  }

  .student-dashboard-profile strong {
    max-width: 64px;
  }

  .student-dashboard-welcome h1 {
    font-size: 28px;
  }

  .student-dashboard-actions {
    grid-template-columns: 1fr;
  }

  #homePastAssignmentButton {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .assessment-chart-legend {
    gap: 7px 10px;
  }

  .student-weakness-card summary {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .student-weakness-count {
    grid-column: 2;
  }

  .student-weakness-sources {
    margin: 0 10px 10px;
  }
}

.student-main-tabs,
.teacher-main-tabs {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.student-main-tabs {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.student-practice-tab {
  min-height: 48px;
  display: grid;
  place-content: center;
  border-radius: 6px;
  background: #dff3ed;
  color: #11665d;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
}

.student-practice-tab:hover,
.student-practice-tab:focus-visible {
  background: #c7e9df;
  color: #0b514a;
}

@media (max-width: 720px) {
  .student-main-tab {
    font-size: 11px;
  }

  .teacher-main-tab {
    font-size: 12px;
  }
}

/* Teacher dashboard: coral management theme */
.teacher-app-body {
  --teacher-coral: #d98170;
  --teacher-coral-dark: #bd5d4b;
  --teacher-coral-soft: #faece8;
  --teacher-yellow-soft: #fff7ce;
  --teacher-blue-soft: #eaf3ff;
  --teacher-mint-soft: #e8f5ee;
  --teacher-ink: #343033;
  --teacher-muted: #77727d;
  --teacher-line: #e7e2e3;
  background: #f8faf9;
  color: var(--teacher-ink);
  font-family: "Jua", "Malgun Gothic", sans-serif;
}

.teacher-app-body h1,
.teacher-app-body h2,
.teacher-app-body h3,
.teacher-app-body h4,
.teacher-app-body button,
.teacher-app-body summary,
.teacher-app-body .teacher-summary-strip strong,
.teacher-app-body .management-summary-strip strong {
  font-family: "Jua", "Malgun Gothic", sans-serif;
  font-weight: 400;
  letter-spacing: 0;
}

.teacher-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 0 24px 54px;
}

.teacher-dashboard-header {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 -24px;
  border-top: 7px solid var(--teacher-coral);
  border-bottom: 1px solid var(--teacher-line);
  padding: 11px 24px 12px;
  background: #fff;
}

.teacher-dashboard-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.teacher-dashboard-brand img {
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
  object-fit: contain;
}

.teacher-dashboard-brand > div {
  min-width: 0;
}

.teacher-dashboard-brand .eyebrow,
.teacher-dashboard-brand h1,
.teacher-dashboard-brand p {
  margin: 0;
}

.teacher-dashboard-brand .eyebrow {
  color: var(--teacher-coral-dark);
  font-size: 13px;
}

.teacher-dashboard-brand h1 {
  overflow-wrap: anywhere;
  color: #3e383b;
  font-size: 31px;
  line-height: 1.15;
}

.teacher-dashboard-brand .teacher-day-label {
  margin-top: 4px;
  color: var(--teacher-muted);
  font-size: 13px;
}

.teacher-app-body #refreshButton {
  min-height: 42px;
  border: 1px solid #e4cfc9;
  border-radius: 6px;
  padding: 9px 16px;
  background: #fff7f4;
  color: var(--teacher-coral-dark);
}

.teacher-main-tabs {
  position: sticky;
  z-index: 30;
  top: 0;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  margin: 0 -24px 16px;
  border: 0;
  border-bottom: 1px solid var(--teacher-line);
  border-radius: 0;
  padding: 6px 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 7px 18px rgba(84, 75, 77, 0.06);
}

.teacher-main-tab {
  min-height: 49px;
  border-radius: 6px;
  color: #7c7478;
  font-size: 17px;
}

.teacher-main-tab.is-active {
  background: var(--teacher-coral);
  color: #fff;
  box-shadow: none;
}

.teacher-app-body .panel,
.teacher-app-body .assignment {
  border-color: var(--teacher-line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(84, 75, 77, 0.055);
}

.teacher-class-switcher {
  margin: 0 0 14px;
  border: 0;
  border-bottom: 1px solid var(--teacher-line);
  border-radius: 0;
  padding: 0 0 14px;
  background: transparent;
  box-shadow: none;
}

.teacher-class-tabs {
  position: static;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.teacher-class-tab {
  min-height: 54px;
  border: 1px solid var(--teacher-line);
  border-bottom: 4px solid #d5c34e;
  border-radius: 7px;
  background: var(--teacher-yellow-soft);
  color: #5f585c;
}

.teacher-class-tab:nth-child(2) {
  border-bottom-color: #d58b7c;
  background: var(--teacher-coral-soft);
}

.teacher-class-tab:nth-child(3) {
  border-bottom-color: #82aee0;
  background: var(--teacher-blue-soft);
}

.teacher-class-tab em {
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.74);
  color: #6f686b;
}

.teacher-class-tab.is-active {
  border-color: var(--teacher-coral);
  border-bottom-color: var(--teacher-coral-dark);
  background: #fff;
  color: var(--teacher-coral-dark);
  box-shadow: 0 5px 14px rgba(112, 77, 70, 0.1);
}

.teacher-dashboard,
.teacher-module.panel {
  padding: 24px;
  background: #fff;
}

.teacher-app-body .eyebrow {
  color: var(--teacher-coral-dark);
}

.teacher-view-head,
.management-module-head {
  align-items: center;
}

.teacher-view-head h2,
.management-module-head h2 {
  color: #3f393c;
  font-size: 26px;
}

.teacher-mode-tabs {
  border-color: #eadedb;
  background: #fff7f5;
}

.teacher-mode-tab {
  color: #7b7477;
}

.teacher-mode-tab.is-active {
  background: var(--teacher-coral);
  color: #fff;
  box-shadow: none;
}

.teacher-summary-strip {
  gap: 10px;
  margin: 20px 0;
  border: 0;
  background: transparent;
}

.teacher-summary-strip > div {
  min-height: 82px;
  align-content: center;
  border: 0;
  border-bottom: 4px solid #d58b7c;
  border-radius: 7px;
  padding: 13px 15px;
  background: var(--teacher-coral-soft);
}

.teacher-summary-strip > div:nth-child(2) {
  border-bottom-color: #d5c34e;
  background: var(--teacher-yellow-soft);
}

.teacher-summary-strip > div:nth-child(3) {
  border-bottom-color: #82aee0;
  background: var(--teacher-blue-soft);
}

.teacher-summary-strip span,
.management-summary-strip span {
  color: #70696d;
}

.teacher-summary-strip strong {
  color: #403b3d;
  font-size: 25px;
}

.teacher-summary-strip .summary-missing strong {
  color: #b75c48;
}

.teacher-summary-strip .summary-questions strong {
  color: #557fae;
}

.focused-assignment-list .assignment {
  border-top: 4px solid var(--teacher-coral);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 7px 18px rgba(84, 75, 77, 0.05);
}

.teacher-tools-panel {
  border-style: dashed;
  border-color: #ddcfcc;
  background: #fffcfb;
}

.teacher-app-body .compact-section > summary,
.teacher-app-body .create-assignment > summary,
.teacher-app-body .assignment-detail > summary,
.teacher-app-body .assignment-actions-menu > summary {
  color: #514a4d;
}

.teacher-app-body input,
.teacher-app-body select,
.teacher-app-body textarea {
  border-color: #ddd7d8;
  border-radius: 6px;
  background: #fff;
}

.teacher-app-body input:focus,
.teacher-app-body select:focus,
.teacher-app-body textarea:focus {
  border-color: var(--teacher-coral);
  box-shadow: 0 0 0 3px rgba(217, 129, 112, 0.16);
}

.teacher-app-body .primary {
  border-radius: 6px;
  background: var(--teacher-coral);
  color: #fff;
}

.teacher-app-body .primary:hover {
  background: var(--teacher-coral-dark);
}

.teacher-app-body .secondary {
  background: var(--teacher-mint-soft);
  color: #397659;
}

.teacher-app-body .ghost,
.teacher-app-body .copy-link,
.teacher-app-body .copy-class-link,
.teacher-app-body .copy-fixed-class,
.teacher-app-body .copy-summary,
.teacher-app-body .student-link {
  border: 1px solid #eadedb;
  border-radius: 6px;
  background: #fff7f5;
  color: var(--teacher-coral-dark);
}

.teacher-app-body .badge {
  border-radius: 5px;
  background: var(--teacher-mint-soft);
  color: #397659;
}

.management-summary-strip {
  gap: 9px;
  border: 0;
}

.management-summary-strip > div {
  min-height: 76px;
  align-content: center;
  border: 0;
  border-bottom: 4px solid #d58b7c;
  border-radius: 7px;
  background: var(--teacher-coral-soft);
}

.management-summary-strip > div:nth-child(2) {
  border-bottom-color: #72ad8d;
  background: var(--teacher-mint-soft);
}

.management-summary-strip > div:nth-child(3) {
  border-bottom-color: #82aee0;
  background: var(--teacher-blue-soft);
}

.management-summary-strip > div:nth-child(4) {
  border-bottom-color: #d5c34e;
  background: var(--teacher-yellow-soft);
}

.management-summary-strip strong {
  color: #403b3d;
  font-size: 25px;
}

.attendance-date-tab {
  border-color: var(--teacher-line);
  border-bottom: 3px solid #d5c34e;
  background: #fffdf3;
}

.attendance-date-tab.is-active {
  border-color: #72ad8d;
  background: var(--teacher-mint-soft);
  color: #397659;
}

.attendance-editor {
  border-top-color: var(--teacher-coral);
}

.teacher-test-item {
  border-color: var(--teacher-line);
  background: #fff;
}

.teacher-test-item.is-active {
  border-color: #82aee0;
  background: var(--teacher-blue-soft);
  color: #426d9d;
}

.test-cumulative-section {
  border-top-color: #72ad8d;
}

.test-cumulative-row.is-head,
.monthly-student-row.is-head {
  background: #f8f5f4;
  color: #716a6d;
}

.monthly-report-sheet {
  border-color: #dfd2cf;
  border-top-color: var(--teacher-coral);
  background: #fffaf8;
}

.monthly-report-title p {
  color: var(--teacher-coral-dark);
}

@media (max-width: 760px) {
  .teacher-shell {
    width: 100%;
    padding: 0 12px 38px;
  }

  .teacher-dashboard-header {
    min-height: 78px;
    margin: 0 -12px;
    padding: 8px 12px 9px 7px;
  }

  .teacher-dashboard-brand {
    gap: 8px;
  }

  .teacher-dashboard-brand img {
    width: 54px;
    height: 54px;
  }

  .teacher-dashboard-brand h1 {
    font-size: 23px;
  }

  .teacher-dashboard-brand .eyebrow {
    font-size: 11px;
  }

  .teacher-dashboard-brand .teacher-day-label {
    max-width: 220px;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .teacher-app-body #refreshButton {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 13px;
  }

  .teacher-main-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0 -12px 12px;
    padding: 5px 8px;
  }

  .teacher-main-tab {
    min-height: 44px;
    padding: 7px 3px;
    font-size: 13px;
  }

  .teacher-class-tabs {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .teacher-class-tab {
    flex: 0 0 min(66vw, 220px);
    min-height: 50px;
  }

  .teacher-dashboard,
  .teacher-module.panel {
    padding: 17px 14px;
  }

  .teacher-view-head,
  .management-module-head {
    align-items: stretch;
  }

  .teacher-view-head h2,
  .management-module-head h2 {
    font-size: 23px;
  }

  .teacher-mode-tabs {
    width: 100%;
    min-width: 0;
  }

  .teacher-summary-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .teacher-summary-strip > div {
    min-height: 76px;
    padding: 10px 8px;
  }

  .teacher-summary-strip strong,
  .management-summary-strip strong {
    font-size: 21px;
  }

  .focused-assignment-list .assignment {
    padding: 14px;
  }

  .management-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .management-summary-strip > div:nth-child(2),
  .management-summary-strip > div:nth-child(-n + 2) {
    border-right: 0;
    border-bottom-width: 4px;
  }

  .test-workspace,
  .test-create-form,
  .attendance-student-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .teacher-dashboard-brand .eyebrow,
  .teacher-dashboard-brand .teacher-day-label {
    display: none;
  }

  .teacher-dashboard-brand h1 {
    font-size: 21px;
  }

  .teacher-main-tab {
    font-size: 12px;
  }

  .teacher-mode-tab {
    padding-right: 6px;
    padding-left: 6px;
    font-size: 12px;
  }
}


/* 오답 추출 → 문제은행 앱 (2026-10-17) */
.wrong-answer-open { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.wrong-answer-open .wrong-answer-unsupported { flex-basis: 100%; }
.wrong-answer-book-head small { margin-left: 8px; color: var(--muted, #6b7a80); }

/* 2026-11-10 사용자 "숨겨줘": 학생창 출결(홈 숫자 칸·내 기록 출결 탭)을 숨긴다. 출결 자료와 관리창 출결은 그대로. */
.student-app-body .student-dashboard-stat.attendance,
.student-app-body .student-record-tab[data-record-section="attendance"],
.student-app-body #studentRecordAttendance { display: none !important; }
.student-app-body .student-dashboard-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.student-app-body .student-record-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) {
  .student-app-body .student-dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .student-app-body .student-dashboard-stat.videos { grid-column: span 2; }
}
/* 읽기 전용 성적표(2026-11-10 사용자 "관리창에서 아이들 성적 보기가 힘들어") */
.test-list-filter { width: 100%; margin: 0 0 8px; }
.test-result-board { display: grid; gap: 8px; margin: 4px 0 14px; }
.test-board-pair { margin: 0; font-size: 13px; color: #716a6d; }
.test-board-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.test-board-stat { border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; font-size: 13px; background: #fff; }
.test-board-stat b { margin-right: 4px; }
.test-board-missed, .test-board-missing { margin: 0; font-size: 13px; color: #555; }
.test-board-missed b, .test-board-missing b { margin-right: 6px; color: #333; }
.test-board-table { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.test-board-row { display: grid; grid-template-columns: 44px minmax(80px, 1fr) 82px minmax(90px, 1.6fr); align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
.test-board-row.is-paired { grid-template-columns: 44px minmax(80px, 1fr) 74px 82px minmax(90px, 1.6fr); }
.test-board-row:last-child { border-bottom: 0; }
.test-board-row.is-head { background: #f8f5f4; color: #716a6d; font-size: 12px; font-weight: 800; padding: 6px 10px; }
.test-board-rank { color: #716a6d; font-weight: 700; text-align: center; }
.test-board-score b { font-size: 16px; }
.test-board-score small { color: #8a8486; margin-left: 1px; }
.test-board-wrong { color: #555; font-size: 13px; word-break: keep-all; }
.test-board-range { font-style: normal; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 8px; background: #eef4fb; color: #426d9d; }
.test-board-range.is-alt { background: #fdf0ec; color: #b4553f; }
.test-edit-details { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: #fcfbfa; }
.test-edit-details > summary { cursor: pointer; font-weight: 700; color: #716a6d; font-size: 14px; }
.test-edit-details[open] > summary { margin-bottom: 10px; }
@media (max-width: 760px) {
  .test-board-row { grid-template-columns: 30px minmax(70px, 1fr) 70px; }
  .test-board-row.is-paired { grid-template-columns: 30px minmax(70px, 1fr) 66px 66px; }
  .test-board-wrong { grid-column: 2 / -1; }
}