.teacher-page {
  --teacher-bg:#f1f5f3;
  --teacher-paper:#fff;
  --teacher-ink:#18332e;
  --teacher-muted:#48625c;
  --teacher-line:#d7e2dc;
  --teacher-green:#176451;
  --teacher-tint:#eaf2ed;
  min-height:100dvh;
  background:var(--teacher-bg);
  color:var(--teacher-ink);
}
.teacher-page .mast { background:var(--teacher-paper); color:var(--teacher-ink); border-bottom:1px solid var(--teacher-line); }
.teacher-page .teacher-mast { width:min(1140px, 100% - 2rem); max-width:none; height:64px; margin:auto; padding:0; justify-content:space-between; }
.teacher-brand,.teacher-profile { display:flex; align-items:center; gap:.7rem; }
.teacher-brand { color:var(--teacher-ink); text-decoration:none; }
.teacher-brand .brand-mark { width:33px; height:33px; border:0; border-radius:9px; color:white; background:var(--teacher-green); }
.teacher-brand .brand { color:inherit; font-size:1.05rem; letter-spacing:0; }
.teacher-profile { gap:1.25rem; font-size:.8rem; color:var(--teacher-muted); }
.teacher-profile-menu { position:relative; }
.teacher-profile-menu summary { list-style:none; cursor:pointer; color:var(--teacher-ink); font-weight:700; }
.teacher-profile-menu summary::-webkit-details-marker { display:none; }
.teacher-profile-menu button { position:absolute; z-index:2; inset:.4rem 0 auto auto; transform:translateY(1rem); padding:.45rem .8rem; border:1px solid var(--teacher-line); border-radius:6px; background:var(--teacher-paper); color:var(--teacher-ink); white-space:nowrap; }
.teacher-main { width:min(1140px, 100% - 2rem); margin:1.85rem auto 3.5rem; }
.teacher-entry { max-width:420px; margin:3rem auto; padding:1.5rem; border:1px solid var(--teacher-line); border-radius:9px; background:var(--teacher-paper); }
.teacher-entry form { display:grid; gap:.5rem; margin-top:1rem; }
.teacher-entry input { width:100%; min-width:0; border:1px solid #9caeae; border-radius:5px; padding:.57rem; background:white; color:var(--teacher-ink); font:inherit; }
.teacher-entry .primary-action { margin:.5rem 0 0; }

.teacher-school-address { display:flex; align-items:center; border:1px solid #9caeae; border-radius:5px; background:white; }
.teacher-school-address input { border:0; background:transparent; }
.teacher-school-address span { flex:none; padding-inline:.35rem .6rem; color:var(--teacher-muted); font-size:.82rem; }
.teacher-entry-links { display:flex; justify-content:space-between; flex-wrap:wrap; gap:.45rem; margin-bottom:0; font-size:.86rem; }
.teacher-entry-links button,.teacher-entry-links a { padding:0; color:var(--teacher-green); text-decoration:underline; text-underline-offset:.12em; }

.teacher-title { display:flex; align-items:baseline; gap:1rem; margin:0 0 1.1rem; }
.teacher-title h1 { font-size:clamp(1.6rem,2.6vw,2.15rem); line-height:1.25; letter-spacing:-.02em; }
#teacher-status { margin:0; font-size:.92rem; color:var(--teacher-muted); }
.teacher-filters { display:grid; grid-template-columns:1fr 2.15fr 2.75fr; gap:.625rem; }
.teacher-filters label { display:flex; align-items:center; min-width:0; gap:.7rem; min-height:43px; padding:0 .8rem; border:1px solid var(--teacher-line); border-radius:7px; background:var(--teacher-paper); }
.teacher-filters label span { color:var(--teacher-muted); font-size:.78rem; flex:none; }
.teacher-filters select { width:100%; min-width:0; align-self:stretch; font:inherit; font-size:.88rem; font-weight:650; color:var(--teacher-ink); border:0; background:transparent; cursor:pointer; }
.teacher-filters:focus-within label:focus-within { outline:2px solid var(--teacher-green); outline-offset:1px; }
.teacher-filters select:focus { outline:none; }

.teacher-completion { display:flex; margin-top:1.3rem; border:1px solid var(--teacher-line); border-radius:12px; background:var(--teacher-paper); }
.teacher-group { flex:1; min-width:0; padding:.9rem 1.35rem 1rem; }
.teacher-group + .teacher-group { border-inline-start:1px solid var(--teacher-line); }
.teacher-group-heading { display:flex; align-items:baseline; justify-content:space-between; gap:.5rem; }
.teacher-group-heading strong { font-size:.98rem; }
.teacher-group-heading span { font-size:.76rem; color:var(--teacher-muted); }
.teacher-group-ratio { display:flex; align-items:baseline; gap:.45rem; margin:.18rem 0 .38rem; }
.teacher-group-ratio strong { font-size:2rem; line-height:1.12; }
.teacher-group-ratio b { font-size:1.08rem; }
.teacher-group-ratio span { margin-inline-start:.2rem; font-size:.76rem; }
.teacher-distribution { display:flex; gap:3px; height:.52rem; margin:.45rem 0 .45rem; }
.teacher-distribution span { flex-basis:0; border-radius:2px; }
.distribution-complete { background:#2f8268; }
.distribution-started { background:#a6cdbc; }
.distribution-pending { background:#e0e9e4; }
.teacher-distribution-counts { display:flex; flex-wrap:wrap; gap:.25rem 1.15rem; font-size:.76rem; color:var(--teacher-muted); }
.teacher-distribution-counts b { color:var(--teacher-ink); }

.teacher-tabs { display:flex; gap:1.55rem; margin:1rem 0 .75rem; border-bottom:1px solid #cbdad2; }
.teacher-tabs button { min-height:42px; margin-bottom:-1px; padding:0 .15rem; border:0; border-bottom:3px solid transparent; background:none; color:var(--teacher-muted); font-size:.92rem; font-weight:650; cursor:pointer; }
.teacher-tabs button:focus-visible { outline:2px solid var(--teacher-green); outline-offset:2px; }
.teacher-tabs button[aria-selected="true"] { border-bottom-color:var(--teacher-green); color:var(--teacher-green); }
.teacher-panel { border:1px solid var(--teacher-line); border-radius:10px; background:var(--teacher-paper); }
.teacher-panel-head { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.35rem .8rem; min-height:46px; padding:.55rem 1.1rem; }
.teacher-panel-head p,.teacher-panel-note { margin:0; font-size:.76rem; color:var(--teacher-muted); }
.teacher-panel-note { padding:.65rem 1.1rem; }
.progress-legend { display:flex; flex-wrap:wrap; gap:.25rem .75rem; list-style:none; margin:0; padding:0; color:var(--teacher-muted); font-size:.76rem; }
.progress-legend li { display:flex; align-items:center; gap:.25rem; }
.progress-legend .progress-cell { width:10px; height:10px; border-radius:2px; }

.teacher-table-wrap { overflow:auto; }
.teacher-table { width:100%; border-collapse:collapse; font-size:.9rem; }
.teacher-table th,.teacher-table td { border:0; border-bottom:1px solid #dfe8e3; text-align:left; padding:.59rem 1.1rem; vertical-align:middle; background:transparent; }
.teacher-table thead { background:var(--teacher-tint); }
.teacher-table thead th { font-weight:720; font-size:.78rem; }
.teacher-table td:not(:first-child) { font-variant-numeric:tabular-nums; }
.teacher-table tr > :last-child { padding-inline-end:1.1rem; }
.progress-table tr > :nth-last-child(-n+2),.ranking-table tr > :not(:first-child) { text-align:right; white-space:nowrap; }
.progress-table th:first-child { width:21.5%; }
.progress-table td:nth-child(2) { width:50%; }
.progress-table tbody tr > * { height:66px; }
.progress-table .student-name,.ranking-table th button { border:0; background:none; color:inherit; padding:0; text-align:left; font:inherit; font-weight:700; cursor:pointer; }
.progress-table .student-name:hover,.ranking-table th button:hover { text-decoration:underline; text-underline-offset:.17em; color:var(--teacher-green); }
.student-id,.student-metric-count { display:block; margin-top:.11rem; color:var(--teacher-muted); font-size:.72rem; font-weight:520; }
.progress-table strong { font-size:1rem; }
.student-progress-track { display:flex; height:17px; border:1px solid #cad7cf; border-radius:5px; overflow:hidden; }
.progress-cell { display:block; flex:1; min-width:0; }
.student-progress-track .progress-cell + .progress-cell { border-inline-start:1px solid #ffffff57; }
.progress-cell.is-pending { background:#dfe6e2; }
.progress-cell.is-completed { background:#478f77; }
.progress-cell.is-saved { background:#e9b64c; }
.teacher-muted { color:var(--teacher-muted); font-size:.78rem; font-weight:500; }
.teacher-table summary,.teacher-examples summary { cursor:pointer; }
.ranking-table tbody th summary { list-style:none; color:var(--teacher-ink); font-weight:650; }
.ranking-table tbody th summary::-webkit-details-marker { display:none; }
.ranking-table tbody th summary:hover { color:var(--teacher-green); text-decoration:underline; }
.ranking-table tbody tr > * { height:40px; padding-block:.49rem; }
.question-error-rate { display:inline-flex; gap:.65rem; align-items:center; }
.question-error-rate .has-errors { color:#973921; }
.question-error-track { display:block; width:clamp(36px,7vw,86px); height:5px; border-radius:3px; background:#e6ede9; }
.question-error-track span { display:block; height:100%; border-radius:3px; background:#ad5138; }
.teacher-examples { padding:.55rem 1.1rem; color:var(--teacher-green); font-size:.78rem; border-top:1px solid var(--teacher-line); }
.teacher-examples ul { list-style:none; margin:.5rem 0 0; padding:0 .75rem; }
.teacher-examples li + li { margin-top:.35rem; }
.teacher-question-preview p { margin:.4rem 0; overflow-wrap:anywhere; white-space:pre-line; font-weight:400; color:var(--teacher-ink); }

.teacher-book-content { padding:.5rem 1rem 1rem; max-height:70dvh; overflow:auto; }
#teacher-book { width:min(820px,calc(100% - 1.4rem)); }
.teacher-book-content h2 { font-size:1rem; margin:.75rem 0 .4rem; }
.student-detail-group { overflow:auto; }
.student-detail-table { min-width:320px; }
#teacher-error { color:#862a22; }

@media (max-width:640px) {
  .teacher-title { flex-wrap:wrap; gap:.25rem .65rem; }
  .teacher-filters { grid-template-columns:minmax(88px,.64fr) minmax(0,1.8fr); }
  .teacher-filters label { padding-inline:.6rem; gap:.45rem; }
  .teacher-filters select { font-size:.82rem; }
  .teacher-filters label:last-child { grid-column:1/-1; }
  .teacher-group { padding:.7rem; }
  .teacher-distribution-counts { column-gap:.45rem; }
  .teacher-panel-head,.teacher-panel-note { padding-inline:.7rem; }
  .teacher-table th,.teacher-table td,.teacher-table tr > :last-child { padding-inline:.45rem; }
  .teacher-table thead th { font-size:.7rem; }
  .progress-table td:nth-child(2) { width:auto; min-width:5.8rem; }
  .teacher-profile { gap:.6rem; }
  .question-error-track { width:2.1rem; }
}
@media (max-width:350px) {
  .question-error-track { display:none; }
  .progress-table th:first-child { min-width:4.5rem; }
}
