:root {
  --ink: #202631;
  --muted: #616b78;
  --accent: #245b91;
  --line: #e2e5e9;
  --paper: #fff;
  --white: #fff;
  --danger: #a12f2f;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
header { min-height: 64px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 12px 4vw; gap: 24px; }
.brand { font-size: 19px; font-weight: 650; text-decoration: none; color: var(--ink); white-space: nowrap; }
nav { display: flex; align-items: center; gap: 16px; margin-left: auto; }
nav span { color: var(--muted); font-size: 13px; }
.school-bar { border-bottom: 1px solid var(--line); background: #fafbfc; }
.school-context { max-width: 1200px; margin: 0 auto; padding: 15px 4vw; display: flex; align-items: center; gap: 14px; font-size: 13px; }
.school-context strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.school-context > a { margin-left: auto; white-space: nowrap; color: var(--muted); text-decoration: none; }
main { max-width: 1200px; margin: 0 auto; padding: 32px 4vw 64px; min-height: 65vh; }
h1 { font-size: 28px; line-height: 1.3; margin: 4px 0 8px; font-weight: 600; letter-spacing: -.5px; }
h2 { font-size: 18px; line-height: 1.4; margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
p { margin: 8px 0 16px; }
.quiet { color: var(--muted); }
.small { font-size: 12px; }
.eyebrow { font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
.heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.heading p:last-child { margin-bottom: 0; }
.badge { border: 1px solid var(--line); padding: 4px 10px; border-radius: 4px; white-space: nowrap; font-size: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 16px; margin: 20px 0; }
.card { display: block; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: var(--ink); margin-bottom: 16px; min-width: 0; }
.cards > .card { margin: 0; }
a.card:hover { border-color: #a6b5c6; text-decoration: none; }
.school-card > div:first-child { display: flex; justify-content: space-between; gap: 10px; }
.enter { display: block; font-size: 13px; font-weight: 500; margin-top: 16px; color: var(--accent); }
.metrics { display: flex; border-top: 1px solid var(--line); padding-top: 12px; gap: 24px; }
.metrics span { font-size: 12px; color: var(--muted); }
.metrics b { display: block; color: var(--ink); font-size: 20px; font-weight: 600; }
.overview-metrics { display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid var(--line); border-radius: 6px; margin-top: 24px; }
.overview-metrics > div { padding: 18px 20px; border-right: 1px solid var(--line); }
.overview-metrics > div:last-child { border-right: 0; }
.overview-metrics span { display: block; font-size: 12px; color: var(--muted); }
.overview-metrics strong { display: block; font-size: 26px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.status { display: inline-block; font-size: 12px; font-weight: 500; border-radius: 4px; padding: 2px 8px; background: #f0f2f5; color: #45505e; }
.complete, .ready { background: #edf4f0; color: #2e5b45; }
.failed, .invalid { background: #fbefef; color: var(--danger); }
.blocked, .queued, .uploading { background: #faf4e8; color: #79571f; }
.running { background: #edf3fa; color: #245b91; }
section { margin: 28px 0; }
.empty { padding: 28px; background: #fafbfc; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap: 16px; align-items: start; }
details { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 16px 20px; margin: 16px 0; }
summary { font-weight: 600; cursor: pointer; }
.admin-grid details { margin: 0; }
form { margin-top: 20px; }
label { display: block; margin-bottom: 16px; font-size: 13px; font-weight: 500; }
label .small { display: block; margin-top: 4px; font-weight: 400; }
input, select, textarea { display: block; width: 100%; border: 1px solid #cbd1d9; background: #fff; border-radius: 5px; color: var(--ink); font: inherit; padding: 9px 11px; margin-top: 6px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #7b9dbf; outline-offset: 1px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid #245b91; outline-offset: 3px; }
input[type=checkbox] { display: inline-block; width: auto; margin: 0 8px 0 0; }
input[type=file] { font-size: 13px; }
.check { display: flex; align-items: center; }
button { border: 1px solid transparent; border-radius: 5px; padding: 9px 15px; background: var(--accent); color: #fff; font: 500 13px system-ui; cursor: pointer; }
button:hover { filter: brightness(.93); }
button:disabled { opacity: .5; cursor: wait; }
.ghost { background: transparent; color: var(--accent); padding: 5px 8px; }
.secondary { background: #fff; border-color: #cbd1d9; color: var(--ink); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap: 16px; }
.two-column { display: grid; grid-template-columns: minmax(260px,.8fr) minmax(350px,1.2fr); gap: 24px; }
.two-column > section { min-width: 0; }
.auth { max-width: 400px; margin: 64px auto; }
.auth button { width: 100%; }
.toolbar { max-width: 360px; margin-bottom: 16px; }
video, audio { width: 100%; margin: 12px 0; border-radius: 5px; }
video { background: #15191f; max-height: 360px; }
.topic { border-left: 2px solid #cbd5e0; padding: 4px 14px; margin: 20px 0; }
.highlight { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.preserve { white-space: pre-wrap; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); font-size: 13px; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); }
th { background: #f8f9fb; font-weight: 500; color: var(--muted); }
td a { text-decoration: none; }
footer { border-top: 1px solid var(--line); padding: 16px 4vw; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.publisher-logo { display: block; width: 88px; height: 88px; object-fit: contain; flex-shrink: 0; }
#notice { position: sticky; top: 10px; z-index: 10; background: #fff8e9; color: #694d19; border: 1px solid #e3d0a6; border-radius: 5px; padding: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
progress { width: 100%; height: 6px; margin-top: 20px; accent-color: var(--accent); }
.row-form { border-bottom: 1px solid var(--line); padding-bottom: 20px; }
@media(max-width:760px) {
  header { gap: 10px; padding-inline: 5vw; }
  nav { gap: 8px; }
  nav span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .two-column { grid-template-columns: 1fr; }
  .heading { align-items: start; flex-wrap: wrap; }
  main { padding: 24px 5vw 40px; }
  h1 { font-size: 25px; }
  table { min-width: 500px; }
  .admin-grid { grid-template-columns: 1fr; }
  .auth { margin: 32px auto; }
  .overview-metrics { grid-template-columns: repeat(2,1fr); }
  .overview-metrics > div { padding: 14px; }
  .overview-metrics > div:nth-child(2) { border-right: 0; }
  .overview-metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
.week-filter { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin: 12px 0 18px; }
.week-filter label { margin: 0; }
.week-filter a { padding-bottom: 8px; }
.coverage-table { min-width: 900px; table-layout: fixed; }
.coverage-table caption { text-align: left; padding: 0 0 12px; }
.coverage-table th, .coverage-table td { border: 1px solid var(--line); padding: 12px; vertical-align: top; }
.coverage-cell > strong, .coverage-cell > span { display: block; }
.coverage-cell > strong { font-size: 18px; font-weight: 600; }
.coverage-none, .coverage-future { background: #fafbfc; color: var(--muted); }
.coverage-missing, .coverage-waiting { background: #fff; }
.coverage-partial { background: #eaf1f8; color: #214e79; }
.coverage-full { background: #cddff1; color: #173e64; }
.coverage-pending { background: #f1f4f8; }
.coverage-cell details { padding: 0; margin: 8px 0 0; border: 0; background: transparent; font-size: 11px; }
.coverage-cell details a { display: block; margin-top: 8px; overflow-wrap: anywhere; }

@media(max-width:760px) { table { display:block; overflow-x:auto; min-width:0; } .table-wrap table { display:table; } .table-wrap .coverage-table { min-width:900px; } }

.button-link { display:inline-block; padding:9px 15px; border-radius:5px; background:var(--accent); color:white; text-decoration:none; font-size:13px; font-weight:500; }
.button-link:hover { background:#1d4b78; text-decoration:none; }
/* Page navigation uses links styled as tabs, retaining native keyboard behaviour. */
.school-tabs { display: flex; align-items: stretch; gap: 28px; margin: -10px 0 30px; padding: 0 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.school-tabs a { flex: 0 0 auto; padding: 14px 2px 13px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; font-size: 13px; font-weight: 500; white-space: nowrap; }
.school-tabs a:hover { color: var(--ink); border-bottom-color: #cbd5e1; }
.school-tabs a[aria-current=page] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.school-tabs a:focus-visible { outline-offset: -3px; border-radius: 3px; }
@media(max-width:600px) { .school-tabs { gap: 22px; margin-bottom: 24px; } .school-context { gap: 10px; } }
.report-page { max-width: 960px; }
.report-group { margin-top: 24px; }
.report-meta { display:flex; align-items:center; flex-wrap:wrap; gap:12px; color:var(--muted); font-size:12px; margin:16px 0 24px; }
.report-summary { font-size:15px; line-height:1.8; max-width:80ch; }
.report-summary p { white-space:pre-line; }
.lesson-report > section { padding-bottom:24px; border-bottom:1px solid var(--line); }
.lesson-report h3 { margin-top:0; font-size:16px; }
.topic-table th:first-child, .topic-table td:first-child { width:80px; white-space:nowrap; }
.topic-table th:nth-child(2) { width:25%; }
.topic-table td { vertical-align:top; }
.evidence-links { margin:10px 0 0; border:0; padding:0; font-size:12px; }
.evidence-links a { margin-right:10px; }
.report-clips { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr)); gap:24px; }
.report-clip h4 { margin:0 0 4px; font-size:14px; font-weight:600; }
.transcript { max-height:480px; overflow-y:auto; margin-top:16px; }
.transcript-line { display:grid; grid-template-columns:75px 1fr; gap:12px; padding:8px 0; border-bottom:1px solid var(--line); scroll-margin-top:20px; }
.transcript-line:target { background:#edf3fa; }
.transcript-line p { margin:0; }
.time-link { font-size:12px; font-variant-numeric:tabular-nums; align-self:start; text-align:left; }
.analysis-info { display:grid; grid-template-columns:120px 1fr; gap:8px 16px; font-size:13px; }
.analysis-info dt { color:var(--muted); }
.analysis-info dd { margin:0; overflow-wrap:anywhere; }
.lesson-report + .lesson-report { margin-top:32px; padding-top:24px; border-top:1px solid var(--line); }

/* A sequential scale keeps recording coverage distinct from teacher scoring. */
.coverage-chart { margin: 28px 0; }
.heatmap-key { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 24px; font-size: 12px; color: var(--muted); }
.heatmap-scale { display: flex; gap: 3px; }
.heatmap-scale span { padding: 7px 10px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.heat-0 { background: #f0f4f8; color: #425466; }
.heat-1 { background: #d8e9f8; color: #183e60; }
.heat-2 { background: #9cc6e7; color: #163954; }
.heat-3 { background: #427eae; color: #fff; }
.heat-4 { background: #174d78; color: #fff; }
.heat-none { background: repeating-linear-gradient(135deg, #fafbfc, #fafbfc 5px, #eef1f4 5px, #eef1f4 6px); color: #6b7785; }
.heat-future { background: #fff; color: #64748b; border: 1px dashed #a3afbb; }
.heatmap-neutral-key { display: inline-flex; gap: 8px; align-items: center; }
.heatmap-neutral-key i { display: inline-block; width: 18px; height: 18px; border-radius: 3px; }
.table-wrap .coverage-heatmap { min-width: 680px; table-layout: fixed; border: 0; border-collapse: separate; border-spacing: 6px; }
.coverage-heatmap caption { text-align: left; color: var(--muted); padding: 0 6px 14px; font-size: 12px; }
.coverage-heatmap th, .coverage-heatmap td { border: 0; padding: 0; background: transparent; }
.coverage-heatmap thead th { text-align: center; padding-bottom: 12px; color: var(--ink); }
.coverage-heatmap thead th span { display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 4px; }
.coverage-heatmap th:first-child { width: 150px; text-align: left; padding-right: 14px; overflow-wrap: anywhere; }
.heatmap-tile { display: block; width: 100%; min-height: 74px; margin: 0; padding: 12px 4px; border-radius: 5px; border: 2px solid transparent; font-size: 17px; font-weight: 600; box-shadow: none; }
.heatmap-tile.heat-future { border: 1px dashed #a3afbb; }
.heatmap-tile:hover { filter: brightness(.95); }
.heatmap-tile[aria-pressed="true"], .heatmap-tile:focus-visible { outline: 2px solid #0f172a; outline-offset: 2px; }
.heatmap-soon { font-size: 12px; font-weight: 400; }
.heatmap-selection { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; }
.heatmap-selection h3 { margin: 0 0 8px; }
.heatmap-selection [hidden] { display: none; }
.heatmap-recordings { padding-left: 20px; }
.heatmap-recordings li { margin: 8px 0; }

.visualizer { border: 1px solid var(--line); border-radius: 8px; padding: 24px; margin-bottom: 32px; }
.visualizer .heading { margin-bottom: 12px; align-items: flex-start; }
.visual-controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin: 20px 0; }
.visual-controls label { margin: 0; flex: 1 1 100px; }
.visual-controls label:first-child { flex: 2 1 240px; }
.visual-controls button { margin: 0; }
.visual-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin: 20px 0; }
.visual-tabs button { background: transparent; color: var(--muted); padding: 10px 0; border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin: 0; }
.visual-tabs button[aria-pressed=true] { color: var(--accent); border-bottom-color: var(--accent); }
.visual-stage { position: relative; width: 100%; aspect-ratio: 16/9; background: #17202c; border-radius: 6px; overflow: hidden; }
.visual-stage video { width: 100%; height: 100%; max-height: none; margin: 0; display: block; object-fit: contain; }
.visual-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.visual-no-source { color: #fff; padding: 24px; font-size: 13px; position: relative; z-index: 1; }
.motion-status { min-height: 24px; margin: 12px 0; }
.motion-legend { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 11px; }
.motion-gradient { width: 140px; height: 8px; border-radius: 4px; background: linear-gradient(to right,#26364b,#4382b0,#deb653,#ff2400); }
.motion-timeline { margin: 20px 0; }
.motion-timeline svg { display: block; width: 100%; height: 70px; background: #f4f6f8; cursor: crosshair; border-radius: 4px; }
.motion-timeline input { padding: 0; }
.motion-timeline label { margin-top: 12px; }
@media(max-width:600px) { .visualizer { padding: 16px; } .visualizer .heading { flex-direction: column; align-items: stretch; gap: 8px; } .visual-tabs { gap: 18px; } }
