:root {
  color-scheme: light;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  line-height: 1.5;
  color: #1d322c;
  background: #f6f8f4;
  --ink: #173e35;
  --muted: #50635c;
  --line: #cdd9d1;
  --paper: #fff;
  --accent: #e8c36a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button, a, input { touch-action: manipulation; }
button { min-height: 44px; padding: .6rem 1.05rem; border: 1px solid #a7b9ae; border-radius: .55rem; background: white; color: var(--ink); font-weight: 650; cursor: pointer; }
button:hover:enabled { background: #ecf2ec; }
button.primary { color: white; background: var(--ink); border-color: var(--ink); }
button.primary:hover:enabled { background: #265746; }
button[aria-pressed="true"] { background: #d9eadf; border-color: #537866; }
button.exit { color: #853e33; border-color: #d5b1a9; }
button.exit:hover:enabled { background: #fbebe6; }
:disabled { opacity: .56; cursor: default; }
:focus-visible { outline: 3px solid #197482; outline-offset: 3px; }
input { accent-color: var(--ink); }
input:not([type="checkbox"]):not([type="color"]):not([type="file"]) { width: 100%; display: block; margin-top: .38rem; padding: .68rem .85rem; min-height: 46px; color: var(--ink); background: white; border: 1px solid #a8b9ae; border-radius: .46rem; }
input::placeholder { color: #607068; opacity: 1; }
label { font-weight: 600; }
.wrap { width: min(1120px, calc(100% - 3rem)); margin-inline: auto; }
.site-head { border-bottom: 1px solid var(--line); background: #fff; }
.masthead, .account, .brand, .controls, .section-head, .panel-heading, .lesson-status { display: flex; align-items: center; }
.masthead { min-height: 76px; justify-content: space-between; gap: 1rem; }
.brand { gap: .64rem; text-decoration: none; color: var(--ink); font-size: 1.48rem; font-weight: 750; letter-spacing: -.055em; }
.account { gap: 1rem; }
.school-name { font-size: .93rem; font-weight: 650; color: #455f50; }
main { padding: clamp(1.6rem, 5vw, 4.7rem) 0 3rem; }
h1, h2, p { margin: 0; }
h1, h2, legend { color: var(--ink); }
h1 { font-family: "DM Serif Text", Georgia, serif; font-weight: 500; font-size: clamp(2.5rem, 5.1vw, 4.5rem); line-height: 1.04; letter-spacing: -.055em; overflow-wrap: anywhere; }
h2 { font-size: clamp(1.35rem, 2vw, 1.75rem); line-height: 1.22; letter-spacing: -.035em; }
#notice:empty, #activeLessons:empty, #breakStatus:empty { display: none; }
#notice { background: #fff6de; border-inline-start: 3px solid #976d20; padding: .8rem 1rem; margin: 0 0 1.2rem; color: #5f441a; overflow-wrap: anywhere; }
.entry { display: grid; grid-template-columns: 1fr .94fr; border: 1px solid var(--line); background: white; border-radius: 1.2rem; overflow: hidden; }
.entry-form { padding: clamp(2rem, 5vw, 4.5rem); }
.entry-form p { color: var(--muted); max-width: 34ch; margin: 1rem 0 1.8rem; }
.entry-form label { display: block; margin-top: 1.05rem; }
.entry-form button { width: 100%; margin-top: 1.5rem; }
.chalkboard { position: relative; display: grid; place-items: center; overflow: hidden; min-height: 280px; background-color: #174638; background-image: radial-gradient(#9ebcab55 .9px, transparent 1px); background-size: 23px 23px; border-left: 1px solid var(--line); }
.chalk-drawing { position: relative; width: min(69%, 310px); aspect-ratio: 1.05; color: #fff9df; transform: rotate(-5deg); }
.triangle-leg { position: absolute; left: 9%; bottom: 30%; width: 76%; height: 53%; border-left: 3px solid; border-bottom: 3px solid; border-radius: 0 0 0 3px; }
.triangle-slope { position: absolute; left: 9%; top: 17%; width: 91.3%; border-top: 3px solid; transform: rotate(33.6deg); transform-origin: 0 50%; }
.right-angle { position: absolute; left: 9%; bottom: 30%; width: 9%; aspect-ratio: 1; border-top: 2px solid #e5c572; border-right: 2px solid #e5c572; }
.angle-arc { position: absolute; bottom: 30%; left: 68%; width: 18%; height: 12%; border-left: 2px solid #e5c572; border-radius: 70% 0 0 15%; }
.chalk-drawing span { position: absolute; font: italic clamp(1.25rem, 3vw, 2.25rem)/1 Georgia, serif; }
.leg-a { left: 0; top: 41%; }
.leg-b { bottom: 15%; left: 49%; }
.leg-c { top: 29%; left: 53%; }
.chalk-drawing .equation { left: 23%; bottom: -2%; white-space: nowrap; font-size: clamp(1.55rem, 3.5vw, 2.65rem); color: #efd28b; }
.chalk-tray { position: absolute; inset: auto 0 0; height: 9px; background: #c29c6b; box-shadow: 0 -3px 0 #113b2d; }
.chalk-tray i { position: absolute; width: 38px; height: 6px; right: 15%; bottom: 10px; background: #fff7de; border-radius: 2px; transform: rotate(-2deg); }
.chalk-tray i + i { right: calc(15% + 43px); width: 28px; background: #ecd187; transform: rotate(2deg); }

.section-head, .panel-heading { justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-head { margin: 0 0 1.6rem; }
.panel, .meeting { border: 1px solid var(--line); border-radius: 1rem; background: var(--paper); margin-bottom: 1.2rem; }
.panel { padding: clamp(1.25rem, 3vw, 2.4rem); }
.panel-heading { margin-bottom: 1.4rem; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; font-size: 1.08rem; font-weight: 700; }
.hint, .units, .file-label { color: var(--muted); }
.hint { margin-top: .35rem; }
.student-list, .lesson-list { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1rem 0; }
.student-list label, .check, .tools label { display: inline-flex; gap: .55rem; align-items: center; min-height: 44px; cursor: pointer; }
.student-list label { border-radius: .5rem; padding: .5rem .8rem; border: 1px solid var(--line); }
.student-list label:has(input:checked) { background: #edf4ee; border-color: #719281; }
input[type="checkbox"] { flex: 0 0 auto; width: 1.1rem; height: 1.1rem; }
.settings-grid, .teacher-grid { display: grid; gap: 1.4rem; margin: 1.3rem 0; }
.settings-grid { max-width: 660px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.units { font-size: .88rem; font-weight: 400; margin-left: .2rem; }
.lesson-status { gap: .7rem; flex-wrap: wrap; }
#clock { border: 1px solid var(--line); border-radius: 2rem; padding: .5rem .9rem; font-variant-numeric: tabular-nums; font-weight: 700; background: white; }
#breakStatus { color: #71531d; }
.meeting { overflow: hidden; background: #15382f; }
#participants { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 1rem; padding: 1rem; color: white; min-height: 100px; }
#participants > * { min-width: 0; overflow-wrap: anywhere; margin: 0; background: #23493d; border-radius: .65rem; padding: .65rem; }
#participants :is(video, img, canvas), #sharedImage, #sharedPlayer { display: block; width: 100%; max-height: 64vh; object-fit: contain; border-radius: .4rem; background: #102b24; }
#participants figure :is(video, img, canvas) { aspect-ratio: 4/3; }
#participants figcaption { font-size: .92rem; padding: .45rem .15rem 0; }
.controls { flex-wrap: wrap; gap: .55rem; }
.meeting > .controls { padding: .9rem 1rem; background: #eff4ef; }
.meeting #leave { margin-left: auto; }
.teacher-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 0; }
.teacher-grid fieldset + fieldset { padding-inline-start: 1.4rem; border-inline-start: 1px solid var(--line); }
.field-actions { display: flex; flex-direction: column; align-items: flex-start; gap: .55rem; margin-top: .85rem; }
#videoFile { max-width: 100%; margin: 0 0 .7rem; }
#videoFile::file-selector-button { padding: .45rem .7rem; margin-right: .5rem; border: 1px solid var(--line); background: #eff5ef; border-radius: .4rem; cursor: pointer; }
.file-label { display: block; margin: .65rem 0 .3rem; font-size: .88rem; }
#sharedPlayer { margin-bottom: .7rem; }
.media-panel h2 { margin-bottom: 1rem; }
.assign-form { display: grid; grid-template-columns: minmax(8rem,.9fr) minmax(9rem,1fr) minmax(12rem,1.4fr) auto; align-items: end; gap: .85rem; }
.assign-form label { min-width: 0; }
.assign-form select { display: block; width: 100%; min-height: 46px; margin-top: .38rem; padding: .5rem; border: 1px solid #a8b9ae; border-radius: .46rem; background-color: white; color: var(--ink); }
#assignNotice:not(:empty), #activityNotice:not(:empty) { margin-top: .8rem; color: var(--muted); }
#retryInventory { margin-top: .6rem; }
#activityDisclosure { margin-bottom: 1rem; color: var(--muted); }
.task-instructions { margin: .85rem 0; border-inline-start: 3px solid #c4d7c9; padding-inline-start: .8rem; white-space: pre-line; overflow-wrap: anywhere; }
#activityWorkspace iframe { display: block; width: 100%; height: min(80vh, 52rem); min-height: 20rem; margin-top: 1rem; border: 1px solid var(--line); border-radius: .6rem; background: white; }
#studentViews { border-top: 1px solid var(--line); margin-top: 1.5rem; }
#studentViews h3 { margin: 1rem 0 .8rem; }
#viewTiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px,100%),1fr)); gap: .85rem; }
#viewTiles figure { display: flex; flex-direction: column; gap: .6rem; min-width: 0; margin: 0; padding: .8rem; border: 1px solid var(--line); border-radius: .65rem; }
#viewTiles figcaption { display: grid; gap: .2rem; overflow-wrap: anywhere; }
#viewTiles figcaption span { font-size: .94rem; color: var(--muted); }
#viewTiles img { display: block; width: 100%; object-fit: contain; max-height: 56vh; }
@media (max-width: 990px) { .assign-form { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 550px) { .assign-form { grid-template-columns: 1fr; } }
#board { display: block; width: 100%; height: auto; border: 1px solid #b3c3b8; border-radius: .5rem; touch-action: none; background: white; }
.tools input[type="color"] { width: 44px; height: 38px; padding: 2px; border: 1px solid #b3c3b8; border-radius: .4rem; cursor: pointer; background: white; }
.privacy { display: flex; align-items: flex-start; gap: .75rem; color: var(--muted); max-width: 86ch; font-size: .94rem; margin: 1.45rem 0 0; }
.privacy-symbol { flex: 0 0 14px; width: 14px; height: 12px; margin: .58rem 0 0 .15rem; border: 1.6px solid #527464; border-radius: 3px; position: relative; }
.privacy-symbol::before { content: ""; width: 6px; height: 6px; position: absolute; bottom: 100%; left: 2px; border: 1.5px solid #527464; border-bottom: 0; border-radius: 5px 5px 0 0; }
.privacy p + p { margin-block-start: .65rem; }
@media (max-width: 780px) {
  .teacher-grid { grid-template-columns: 1fr; gap: 1.1rem; }
  .teacher-grid fieldset + fieldset { padding-inline-start: 0; border-inline-start: 0; }
  .chalk-drawing { width: 80%; }
}
@media (max-width: 620px) {
  .wrap { width: calc(100% - 2rem); }
  .masthead { min-height: 64px; }
  .account { gap: .5rem; }
  .account:has(#logout:not([hidden])) .school-name { display: none; }
  .entry { grid-template-columns: 1fr; }
  .entry-form { padding: clamp(1.35rem, 6vw, 2rem); }
  .chalkboard { display: none; }
  .settings-grid { grid-template-columns: 1fr; gap: 1.1rem; }
  .meeting #leave { margin-left: 0; }
  .meeting .controls > button { flex: 1 1 45%; }
}
