.teacher-shell { width: min(1480px, 100%); margin: 0 auto; padding: 30px 28px 64px; }
.teacher-header { position: sticky; z-index: 5; top: 0; }
.teacher-header-note { margin-left: auto; color: #c4dad7; font-size: 13px; }
.teacher-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.teacher-title-row h1 { margin: 0; font-size: 29px; line-height: 1.2; }
.teacher-title-row p:last-child { margin: 8px 0 0; color: var(--muted); }
.local-badge { padding: 6px 10px; color: #70440d; background: #fff4d6; border: 1px solid #ead49c; border-radius: 4px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.local-warning { display: flex; align-items: flex-start; gap: 13px; margin: 0 0 25px; padding: 13px 15px; color: #6b5121; background: #fff9e9; border: 1px solid #ead9ab; border-radius: 5px; font-size: 13px; line-height: 1.55; }
.local-warning strong { white-space: nowrap; }
.teacher-section { min-width: 0; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.room-section { margin-bottom: 18px; }
.room-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.room-toolbar label, .assignment-form label, .record-filters label, .student-identity-panel label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 650; }
.room-picker { width: min(340px, 100%); }
.room-create-form { display: grid; grid-template-columns: minmax(112px, 1fr) auto; align-items: end; gap: 8px; }
.room-create-form label { align-self: auto; }
.teacher-shell input, .teacher-shell select { min-width: 0; min-height: 40px; padding: 8px 10px; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 4px; }
.room-create-form input { width: 100%; }
.student-access-section { margin-bottom: 18px; }
.student-access-section .section-heading > div { display: grid; gap: 4px; }
.student-access-section .section-heading small { color: var(--muted); font-size: 12px; }
.access-password-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
.access-password-form { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(150px, 1fr) auto; align-items: end; gap: 10px; padding: 14px 0 4px; }
.access-password-form + .access-password-form { border-left: 1px solid var(--line); padding-left: 20px; }
.access-password-form > div strong { font-size: 13px; }
.access-password-form > div p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.access-password-form label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 650; }
.access-password-form input { width: 100%; }
.teacher-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 18px; border: 1px solid var(--line); border-radius: 5px; }
.teacher-stats > div { display: grid; gap: 7px; padding: 13px 15px; }
.teacher-stats > div + div { border-left: 1px solid var(--line); }
.teacher-stats span { color: var(--muted); font-size: 12px; }
.teacher-stats strong { color: var(--teal-dark); font-size: 21px; }
.teacher-columns { display: grid; grid-template-columns: minmax(320px, .86fr) minmax(0, 1.7fr); align-items: start; gap: 18px; }
.teacher-section .section-heading { margin-top: 0; }
.teacher-section .section-heading h2 { font-size: 18px; }
.assignment-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.assignment-form button { align-self: end; }
.assignment-test-picker { grid-column: 1 / -1; min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 5px; }
.assignment-test-picker legend { padding: 0 5px; color: var(--muted); font-size: 12px; font-weight: 650; }
.assignment-test-tools { display: grid; grid-template-columns: minmax(150px, 1fr) auto auto; gap: 8px; margin-bottom: 10px; }
.assignment-test-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-height: 220px; overflow: auto; padding: 2px; }
.assignment-test-option { display: flex !important; align-items: center; gap: 8px !important; min-width: 0; padding: 8px; color: var(--ink) !important; background: #fbfdfc; border: 1px solid var(--line); border-radius: 4px; font-size: 12px !important; cursor: pointer; }
.assignment-test-option[hidden] { display: none !important; }
.assignment-test-option input[type="checkbox"] { width: 16px; min-width: 16px; min-height: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--teal-dark); }
.assignment-test-option span { overflow: hidden; color: var(--teal-dark); font-size: 14px; font-weight: 750; white-space: nowrap; }
.assignment-test-picker > small { display: block; margin-top: 8px; color: var(--muted); }
.assignment-list-heading { margin-top: 27px !important; }
.assignment-list-heading h3 { margin: 0; font-size: 15px; }
.teacher-assignment-list { display: grid; gap: 8px; }
.teacher-assignment { display: flex; align-items: stretch; gap: 8px; padding: 11px; background: #fbfdfc; border: 1px solid var(--line); border-radius: 5px; }
.teacher-assignment.active { background: var(--teal-pale); border-color: #9fc5c0; }
.teacher-assignment-main { flex: 1; min-width: 0; display: grid; gap: 7px; padding: 0; text-align: left; background: transparent; border: 0; cursor: pointer; }
.teacher-assignment-main strong { line-height: 1.35; }
.teacher-assignment-main small { color: var(--muted); }
.assignment-meta { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
.teacher-tag { padding: 3px 6px; color: var(--teal-dark); background: #e5f2ef; border-radius: 3px; font-weight: 700; }
.icon-button { width: 34px; height: 34px; flex: 0 0 auto; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; font-size: 20px; }
.danger-icon { color: var(--red); }
.teacher-empty { padding: 18px 12px; color: var(--muted); background: #fafcfb; border: 1px dashed var(--line-strong); border-radius: 5px; text-align: center; font-size: 13px; }
.records-section { overflow: hidden; }
.record-filters { display: grid; grid-template-columns: minmax(150px, .9fr) minmax(150px, 1fr) minmax(190px, 1.2fr) auto; align-items: end; gap: 10px; margin: 18px 0 14px; }
.btn.small-btn { min-height: 36px; padding: 6px 10px; font-size: 12px; }
.table-scroll { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 5px; }
.teacher-record-table { width: 100%; min-width: 1080px; border-collapse: collapse; font-size: 12px; }
.teacher-record-table th, .teacher-record-table td { padding: 10px 9px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.teacher-record-table th { color: var(--teal-dark); background: #eef7f5; font-weight: 700; }
.teacher-record-table tbody tr:last-child td { border-bottom: 0; }
.teacher-record-table td small { display: block; margin-top: 4px; color: var(--muted); }
.teacher-record-table a.btn { color: inherit; text-decoration: none; }
.part-performance { display: grid; gap: 3px; }
.part-performance strong { color: var(--teal-dark); font-size: 13px; }
.part-performance small { color: var(--muted); font-size: 11px; }
.part-performance-empty { color: var(--muted); }
.teacher-accuracy { color: var(--teal-dark); }
.teacher-record-table .grant-active { color: #7a4410; background: #fff5df; border-color: #e3c486; }
.teacher-no-records { padding: 30px !important; color: var(--muted); text-align: center !important; white-space: normal !important; }
.teacher-footnote { margin: 16px 0 0; color: var(--muted); font-size: 12px; }
.teacher-modal-backdrop { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 20px; background: rgb(15 30 29 / 48%); }
.teacher-modal { width: min(680px, 100%); max-height: 85vh; overflow: auto; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 18px 52px rgb(10 35 33 / 22%); }
.teacher-modal > header { display: flex; justify-content: space-between; gap: 15px; align-items: flex-start; }
.teacher-modal h2 { margin: 0; font-size: 19px; }
.detail-score { margin-top: 20px; color: var(--teal-dark); font-size: 23px; font-weight: 750; }
.detail-distribution { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.detail-distribution span { padding: 8px 10px; color: #91453b; background: var(--red-pale); border-radius: 4px; font-size: 13px; }
.detail-wrongs { margin-top: 20px; padding: 15px; background: #f7faf9; border: 1px solid var(--line); border-radius: 5px; }
.detail-wrongs p { margin: 8px 0 0; line-height: 1.7; }
.teacher-question-modal { width: min(1080px, 100%); max-height: 90vh; padding: 0; }
.teacher-detail-sticky { position: sticky; z-index: 5; top: 0; padding: 22px 22px 12px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 7px 14px rgb(10 35 33 / 5%); }
.teacher-detail-sticky > header { display: flex; justify-content: space-between; gap: 15px; align-items: flex-start; }
.teacher-detail-sticky > header > div { min-width: 0; overflow-wrap: anywhere; }
.teacher-detail-sticky .detail-score { margin-top: 16px; }
.teacher-detail-sticky .detail-distribution { margin-bottom: 0; }
.teacher-question-modal > .detail-wrongs { margin: 16px 22px 0; }
.teacher-question-modal > .teacher-wrong-question-list { margin: 18px 22px 22px; }
.teacher-question-modal .detail-distribution { gap: 7px; }
.teacher-question-modal .detail-distribution span { color: var(--teal-dark); background: #eef7f5; }
.detail-question-links { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; color: var(--muted); }
.wrong-question-link { color: #a7352d; background: #fff4f2; border-color: #e8c5c1; }
.teacher-wrong-question-list { display: grid; gap: 18px; margin-top: 18px; }
.teacher-wrong-group { min-width: 0; padding-top: 15px; border-top: 1px solid var(--line); }
.teacher-wrong-group > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 12px; }
.teacher-wrong-group > header h3 { margin: 0; font-size: 16px; }
.teacher-wrong-group > header > span { color: var(--red); font-size: 12px; white-space: nowrap; }
.teacher-stimulus { display: grid; gap: 10px; margin-bottom: 12px; padding: 14px; background: #f7faf9; border: 1px solid var(--line); border-radius: 4px; }
.teacher-stimulus-image { display: block; max-width: 100%; max-height: 520px; margin: 0 auto; object-fit: contain; }
.teacher-stimulus-passage { color: var(--ink); font-size: 14px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.teacher-vocab-entry { padding: 0 2px; color: #9b342e; background: #fff0ee; font-weight: 750; }
.teacher-stimulus-passage sup { color: var(--muted); font-size: 10px; }
.teacher-insertion-marker { padding: 1px 4px; color: var(--teal-dark); background: #e5f2ef; font-weight: 700; }
.teacher-vocabulary-review { display: grid; gap: 18px; margin-top: 14px; }
.teacher-vocab-student-answer h4, .teacher-vocab-answer-key h4 { margin: 0 0 9px; font-size: 14px; }
.teacher-vocab-student-answer .teacher-stimulus { margin: 0; }
.teacher-vocab-answer-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.teacher-vocab-key-item { min-width: 0; padding: 9px; background: #fff; border: 1px solid var(--line); border-left-width: 3px; border-radius: 3px; }
.teacher-vocab-key-item.answer-correct { border-left-color: #248366; }
.teacher-vocab-key-item.answer-wrong { border-left-color: #c5483f; }
.teacher-vocab-key-item > div { display: flex; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 11px; }
.teacher-vocab-key-item.answer-wrong > div span { color: #a7352d; }
.teacher-vocab-full-answer { display: block; margin-top: 5px; color: var(--teal-dark); font-size: 16px; }
.teacher-vocab-key-item small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.teacher-reading-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 14px; }
.teacher-reading-stimulus { position: sticky; top: 0; max-height: calc(90vh - 180px); margin: 0; overflow: auto; }
.teacher-question-modal .teacher-reading-stimulus { top: 210px; max-height: calc(90vh - 230px); }
.teacher-reading-questions { display: grid; gap: 10px; min-width: 0; }
.teacher-reading-questions .teacher-question-card { margin: 0; }
.teacher-question-card, .teacher-vocab-key-item { scroll-margin-top: 250px; }
.teacher-question-card { margin-top: 10px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.teacher-question-card h4 { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--red); font-size: 16px; }
.teacher-question-card h4 span { color: var(--muted); font-size: 11px; font-weight: 500; }
.teacher-question-prompt { margin: 10px 0; font-weight: 650; line-height: 1.55; }
.teacher-answer-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.teacher-answer-summary > span { display: grid; gap: 4px; min-width: 0; padding: 9px; background: #f8faf9; border: 1px solid var(--line); border-radius: 3px; }
.teacher-answer-summary small { color: var(--muted); font-size: 11px; }
.teacher-answer-summary strong { overflow-wrap: anywhere; }
.teacher-question-options { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.teacher-option { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: start; gap: 7px; padding: 9px; border: 1px solid var(--line); border-radius: 3px; line-height: 1.45; }
.teacher-option.student-selected { color: #96372f; background: #fff4f2; border-color: #e6bcb7; }
.teacher-option.correct-option { color: #176b55; background: #eff8f4; border-color: #b7d9ca; }
.teacher-option small { color: inherit; font-size: 10px; font-weight: 700; text-align: right; }

.student-identity-panel { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(170px, .7fr) minmax(140px, .5fr) auto; align-items: end; gap: 13px; margin: 0 0 22px; padding: 15px; background: #fff; border: 1px solid var(--line); border-radius: 5px; }
.student-identity-panel > div strong { font-size: 15px; }
.student-identity-panel > div p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.assigned-reading { margin: 0 0 24px; }
.assigned-reading .section-heading { margin: 0 0 10px; }
.assigned-reading-list { display: grid; gap: 7px; }
.assigned-reading-item { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 58px; padding: 10px 13px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.assigned-reading-item:hover { background: #f5faf9; border-color: #90bbb5; }
.assigned-reading-item span:first-child { display: grid; gap: 4px; }
.assigned-reading-item small { color: var(--muted); }

@media (max-width: 800px) {
  .teacher-reading-layout { grid-template-columns: 1fr; }
  .teacher-reading-stimulus { position: static; max-height: none; }
  .teacher-question-modal .teacher-reading-stimulus { position: static; top: auto; max-height: none; }
}

@media (max-width: 1000px) {
  .teacher-columns { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .teacher-shell { padding: 22px 14px 42px; }
  .teacher-title-row { align-items: flex-start; }
  .teacher-title-row h1 { font-size: 25px; }
  .local-warning { flex-direction: column; gap: 4px; }
  .room-toolbar { align-items: stretch; flex-direction: column; }
  .room-create-form { align-items: end; flex-wrap: wrap; }
  .room-create-form { grid-template-columns: 1fr; }
  .room-create-form label { width: 100%; }
  .teacher-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teacher-stats > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .teacher-stats > div:nth-child(4) { border-top: 1px solid var(--line); }
  .teacher-section { padding: 15px; }
  .assignment-form { grid-template-columns: 1fr; }
  .assignment-test-picker { grid-column: auto; }
  .assignment-test-tools { grid-template-columns: 1fr 1fr; }
  .assignment-test-tools input { grid-column: 1 / -1; }
  .assignment-test-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record-filters { grid-template-columns: 1fr; }
  .teacher-modal-backdrop { padding: 8px; }
  .teacher-question-modal { max-height: 94vh; padding: 0; }
  .teacher-detail-sticky { padding: 15px 15px 12px; }
  .teacher-question-modal > .detail-wrongs { margin-right: 15px; margin-left: 15px; }
  .teacher-question-modal > .teacher-wrong-question-list { margin-right: 15px; margin-left: 15px; }
  .teacher-question-card, .teacher-vocab-key-item { scroll-margin-top: 220px; }
  .teacher-answer-summary { grid-template-columns: 1fr; }
  .teacher-option { grid-template-columns: 22px minmax(0, 1fr); }
  .teacher-option small { grid-column: 2; text-align: left; }
  .teacher-vocab-answer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teacher-reading-layout { grid-template-columns: 1fr; }
  .teacher-reading-stimulus { position: static; max-height: none; }
  .teacher-header-note { display: none; }
  .student-identity-panel { grid-template-columns: 1fr 1fr; }
  .student-identity-panel > div { grid-column: 1 / -1; }
  .student-identity-panel .btn { grid-column: 1 / -1; }
  .access-password-grid { grid-template-columns: 1fr; }
  .access-password-form { grid-template-columns: 1fr; padding: 14px 0; }
  .access-password-form + .access-password-form { border-left: 0; border-top: 1px solid var(--line); padding: 15px 0 4px; }
}
