/* Warm paper teaching desk: quiet surfaces, editorial headings, focused work areas. */
.teacher-page { --teaching-green: #355c4b; --teaching-paper: #f5f2eb; }
html:has(body.teacher-page) { height: auto; min-height: 100dvh; overflow: auto; }
body.teacher-page { overflow: visible; }
.teacher-page .teacher-header { position: sticky; top: 0; z-index: 20; background: var(--panel); }
.teacher-main:has(.teaching-shell) { max-width: none; width: 100%; padding: 0; }
.teaching-shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: calc(100dvh - 78px); }
.teaching-sidebar { position: sticky; top: 78px; align-self: start; min-height: calc(100dvh - 78px); padding: 34px 20px; border-right: 1px solid var(--border); background: var(--panel); display: flex; flex-direction: column; gap: 6px; }
.teaching-eyebrow { font-size: 11px; color: var(--muted); letter-spacing: .14em; margin: 0 0 10px; }
.teaching-nav-link { display: flex; align-items: center; gap: 13px; padding: 13px 12px; border-radius: 6px; color: var(--muted); text-decoration: none; font-size: 14px; }
.teaching-nav-no { font: 11px ui-monospace,monospace; opacity: .55; }
.teaching-nav-link:hover { background: var(--panel-2); color: var(--text); }
.teaching-nav-link[aria-current="page"] { background: #e8ede5; color: var(--teaching-green); font-weight: 650; }
.teaching-nav-return { margin-top: 45px; padding: 10px 12px; color: var(--muted); font-size: 13px; text-decoration: none; }
.teaching-content { min-width: 0; padding: 36px clamp(20px, 3.5vw, 54px) 70px; max-width: 1600px; width: 100%; box-sizing: border-box; }
.teaching-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.teaching-heading h1 { font-size: clamp(25px, 2.5vw, 34px); font-weight: 620; letter-spacing: -.04em; line-height: 1.25; margin: 0; }
.teaching-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.teaching-row.end { justify-content: end; }
.teaching-section { margin: 18px 0; padding: 22px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.teaching-section h2 { margin: 0 0 14px; font-size: 16px; font-weight: 620; }
.teaching-section p { line-height: 1.8; }
.teaching-content .field, .teaching-student-root .field { align-items: stretch; flex-direction: column; gap: 7px; margin: 12px 0; font-size: 13px; }
.teaching-content input:not([type="checkbox"]):not([type="radio"]), .teaching-content select, .teaching-content textarea,
.teaching-student-root input:not([type="checkbox"]):not([type="radio"]), .teaching-student-root select, .teaching-student-root textarea { width: 100%; max-width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); background: var(--panel); box-sizing: border-box; font: inherit; }
.teaching-content textarea, .teaching-student-root textarea { min-height: 85px; resize: vertical; }
.teaching-content :is(input, select, textarea):focus, .teaching-student-root :is(input, select, textarea):focus { outline: 2px solid var(--teaching-green); outline-offset: 2px; }
.teaching-content input[type="checkbox"], .teaching-content input[type="radio"], .teaching-student-root input[type="checkbox"], .teaching-student-root input[type="radio"] { width: 18px; height: 18px; accent-color: var(--teaching-green); }
.teaching-empty { padding: 54px 28px; margin: 24px 0; border: 1px dashed var(--border-strong); border-radius: 10px; background: var(--panel); }
.teaching-empty h2 { margin: 0 0 12px; font-size: 22px; }
.teaching-empty p { margin-bottom: 24px; }
.teaching-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 10px; background: var(--panel); overflow: hidden; margin: 26px 0; }
.teaching-metric { display: flex; flex-direction: column; padding: 23px; gap: 10px; text-decoration: none; color: var(--text); border-right: 1px solid var(--border); }
.teaching-metric:last-child { border: 0; }
.teaching-metric strong { font-size: 38px; font-weight: 550; font-variant-numeric: tabular-nums; color: var(--teaching-green); }
.teaching-metric:hover { background: var(--panel-2); }
.teaching-assignment-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--border); }
.teaching-assignment-row:last-child { border: 0; }
.teaching-title-link, .teaching-class-link { color: var(--text); text-decoration: none; font-weight: 600; }
.teaching-title-link { font-size: 16px; }
.teaching-title-link:hover, .teaching-class-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.teaching-assignment-row .teaching-row { margin-top: 9px; }
.teaching-count { font-variant-numeric: tabular-nums; font-size: 13px; }
.teaching-badge { display: inline-flex; white-space: nowrap; padding: 4px 8px; font-size: 11px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); background: var(--panel-2); }
.teaching-badge.published { color: var(--teaching-green); background: #edf2e9; }
.teaching-badge.late { color: #9d532f; background: #f7e9dd; }
.teaching-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); overflow-x: auto; margin: 20px 0; }
.teaching-tabs button { white-space: nowrap; border: 0; background: none; padding: 12px 16px; border-bottom: 2px solid transparent; cursor: pointer; font: inherit; font-size: 13px; color: var(--muted); min-height: 44px; }
.teaching-tabs button[aria-selected="true"] { color: var(--teaching-green); border-bottom-color: var(--teaching-green); font-weight: 650; }
.teaching-stepper { display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; padding: 0; margin: 25px 0; border-bottom: 1px solid var(--border); }
.teaching-stepper li { padding: 14px 8px; color: var(--muted); font-size: 13px; border-bottom: 2px solid transparent; }
.teaching-stepper li[aria-current="step"] { color: var(--teaching-green); border-color: var(--teaching-green); font-weight: 650; }
.teaching-editor-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, 1fr); gap: 24px; align-items: start; }
.teaching-question-editor > .field { margin-top: 0; }
.teaching-recipient-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 8px; }
.teaching-recipient-grid .field { flex-direction: row; align-items: center; justify-content: space-between; border: 1px solid var(--border); padding: 10px; border-radius: 6px; }
.teaching-notice { padding: 12px 16px; background: #eeeede; color: #54573e; border-left: 3px solid #8a936a; font-size: 13px; line-height: 1.7; }
.teaching-save-status { color: var(--teaching-green); font-size: 12px; min-height: 1.8em; }
.teaching-prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.teaching-pdf { min-width: 0; }
.teaching-pdf > .teaching-row { margin-bottom: 12px; }
.teaching-pdf-scroll { max-width: 100%; overflow: auto; }
.teaching-pdf-page { position: relative; width: fit-content; max-width: 100%; background: #fff; border: 1px solid var(--border); box-shadow: 0 8px 28px #30291c0b; }
.teaching-pdf-page canvas { display: block; width: 100%; height: auto; }
.teaching-pdf-page.drawing { cursor: crosshair; touch-action: none; }
.teaching-pdf-mark { position: absolute; pointer-events: none; border: 2px solid #607944; background: #60794422; }
.teaching-grading-layout { display: grid; grid-template-columns: 175px minmax(0, 1fr) minmax(290px, 340px); gap: 18px; align-items: start; }
.teaching-grading-students { position: sticky; top: 96px; max-height: calc(100dvh - 145px); overflow: auto; }
.teaching-grading-students h2, .teaching-grading-feedback > h2 { font-size: 16px; }
.teaching-student-item { display: flex; flex-direction: column; gap: 8px; color: var(--text); padding: 14px 10px; border-bottom: 1px solid var(--border); text-decoration: none; }
.teaching-student-item.active { border-left: 3px solid var(--teaching-green); background: #e8ede5; }
.teaching-grading-feedback { padding: 18px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; }
.teaching-grading-feedback .teaching-section { padding: 14px; }
.teaching-grade-footer { position: sticky; bottom: 0; padding: 14px; justify-content: center; background: var(--panel); border-top: 1px solid var(--border); z-index: 10; }
.teaching-answer-image { width: 100%; max-height: 700px; object-fit: contain; display: block; margin-top: 16px; }
.teaching-distribution { display: grid; gap: 10px; margin: 20px 0; }
.teaching-distribution > div { display: grid; grid-template-columns: 80px minmax(100px,1fr) 30px; align-items: center; gap: 12px; font-size: 13px; }
.teaching-distribution meter { width: 100%; height: 20px; accent-color: var(--teaching-green); }
.teaching-menu-toggle { display: none; }
.teaching-student-root { max-width: 1440px; padding: 30px clamp(16px,4vw,60px) 65px; margin: auto; }
.teaching-student-layout { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(320px,1fr); gap: 28px; align-items: start; }
.teaching-student-material { position: sticky; top: 95px; }
.teaching-ai-history { max-height: 450px; overflow: auto; }
.teacher-more-actions { position: relative; font-size: 13px; }
.teacher-more-actions > summary { padding: 10px; cursor: pointer; }
.teacher-more-actions[open] { padding: 8px; border: 1px solid var(--border); background: var(--panel); }
.teacher-more-actions[open] .btn { margin: 5px; }
[hidden] { display: none !important; }
@media (max-width: 1200px) { .teaching-grading-layout { grid-template-columns: 140px minmax(0,1fr) 280px; gap: 12px; } .teaching-content { padding: 28px 22px 60px; } .teaching-shell { grid-template-columns: 180px minmax(0,1fr); } }
@media (max-width: 960px) {
  .teaching-shell { display: block; }
  .teaching-sidebar { display: none; position: static; min-height: 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .teaching-shell.menu-open .teaching-sidebar { display: flex; }
  .teaching-menu-toggle { display: inline-flex; margin: 12px 20px 0; }
  .teaching-grading-layout { grid-template-columns: 140px minmax(0,1fr) 280px; }
}
@media (max-width: 760px) {
  .teaching-heading { align-items: start; flex-direction: column; }
  .teaching-content { padding: 24px 16px 50px; }
  .teaching-metrics { grid-template-columns: repeat(2,1fr); }
  .teaching-metric { padding: 18px; border-bottom: 1px solid var(--border); }
  .teaching-metric strong { font-size: 30px; }
  .teaching-section { padding: 17px; }
  .teaching-editor-grid, .teaching-student-layout { grid-template-columns: minmax(0,1fr); }
  .teaching-student-material { position: static; }
  .teaching-stepper li { font-size: 11px; padding: 12px 4px; }
  .teaching-assignment-row { align-items: start; flex-direction: column; gap: 8px; }
  .teaching-grading-layout { display: block; }
  .teaching-grading-students { position: static; max-height: none; overflow: visible; margin-bottom: 20px; }
  .teaching-grading-students > div { display: flex; overflow-x: auto; }
  .teaching-student-item { min-width: 110px; }
  .teaching-grading-layout[data-mobile-tab="document"] .teaching-grading-feedback { display: none; }
  .teaching-grading-layout[data-mobile-tab="feedback"] .teaching-grading-document { display: none; }
  .teacher-table thead { display: none; }
  .teacher-table tbody { display: grid; gap: 12px; }
  .teacher-table tr { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; border-bottom: 1px solid var(--border); }
  .teacher-table td { border: 0; padding: 5px 6px; }
  .teacher-table-wrap { background: none; }
}
@media (prefers-reduced-motion: reduce) { .teacher-page * { scroll-behavior: auto !important; } }
