:root {
  --navy: #0b3557;
  --navy-deep: #07243a;
  --teal: #078783;
  --teal-dark: #076965;
  --aqua: #bce9df;
  --gold: #f4bb4f;
  --cream: #f7f5ef;
  --paper: #fffefa;
  --white: #fff;
  --ink: #17364d;
  --muted: #637b8b;
  --line: #d9e3e5;
  --danger: #b72f42;
  --sidebar: 278px;
  --header: 76px;
  --shadow: 0 18px 50px rgba(6, 38, 59, .15);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { height: 100%; }

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: #e9efef;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea { font: inherit; }

button,
select,
input[type="color"] { cursor: pointer; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(244, 187, 79, .85);
  outline-offset: 3px;
}

button:disabled,
select:disabled,
input:disabled { cursor: not-allowed; opacity: .42; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 15px;
  color: #fff;
  background: var(--navy);
  border-radius: 10px;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus { transform: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-header {
  position: relative;
  z-index: 50;
  display: grid;
  min-height: var(--header);
  grid-template-columns: minmax(235px, var(--sidebar)) minmax(180px, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 10px 18px;
  color: #fff;
  background: linear-gradient(120deg, var(--navy-deep), var(--navy));
  box-shadow: 0 8px 26px rgba(6, 35, 54, .16);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand > span:last-child,
.document-heading { display: grid; gap: 3px; }

.brand small,
.document-heading span {
  color: #b8ced9;
  font-size: .67rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.brand strong { font-size: 1.07rem; letter-spacing: -.02em; }
.brand strong em { color: var(--gold); font-style: normal; }

.brand-mark {
  position: relative;
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid #63cbc3;
  border-radius: 50%;
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  width: 19px;
  height: 2px;
  background: #63cbc3;
  content: "";
}

.brand-mark::before { transform: rotate(45deg); }
.brand-mark::after { transform: rotate(-45deg); }

.brand-mark i {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--gold);
  border: 2px solid var(--navy-deep);
  border-radius: 50%;
}

.brand-mark i:nth-child(1) { top: -3px; }
.brand-mark i:nth-child(2) { right: -3px; }
.brand-mark i:nth-child(3) { bottom: -3px; left: 2px; }

.document-heading strong {
  max-width: 46vw;
  overflow: hidden;
  font-size: .91rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-heading span { letter-spacing: .035em; text-transform: none; }
.document-heading span.is-saving { color: #ffe096; }
.document-heading span.is-saved { color: #98e1c8; }
.document-heading span.is-error { color: #ffacb6; }

.header-actions { display: flex; align-items: center; gap: 9px; }

.button,
.icon-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 11px;
  font-weight: 800;
}

.button { padding: 10px 15px; }
.icon-button { width: 42px; color: #fff; border: 1px solid rgba(255,255,255,.25); background: transparent; }
.button-light { color: #fff; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); }
.button-gold { color: var(--navy-deep); background: var(--gold); box-shadow: 0 8px 20px rgba(0,0,0,.1); }
.button:not(:disabled):hover, .icon-button:hover { transform: translateY(-1px); }

.workspace {
  display: grid;
  height: calc(100vh - var(--header));
  min-height: 620px;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.library-panel {
  position: relative;
  z-index: 25;
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 22px 16px 16px;
  overflow: hidden;
  border-right: 1px solid #d3dfe1;
  background: #f9faf7;
}

.library-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 17px; }
.library-heading small,
.library-list-heading span { color: var(--teal-dark); font-size: .66rem; font-weight: 850; letter-spacing: .1em; }
.library-heading h1 { margin: 3px 0 0; color: var(--navy); font-size: 1.35rem; line-height: 1; letter-spacing: -.03em; }
.close-library { display: none; }

.upload-button {
  display: flex;
  width: 100%;
  min-height: 68px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  color: #fff;
  border: 0;
  border-radius: 14px;
  background: var(--teal-dark);
  box-shadow: 0 10px 24px rgba(7, 105, 101, .16);
  text-align: left;
}

.upload-button > span:first-child {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--navy);
  background: var(--gold);
  border-radius: 10px;
  font-size: 1.35rem;
}

.upload-button > span:last-child { display: grid; gap: 3px; }
.upload-button strong { font-size: .86rem; }
.upload-button small { color: #bce6df; font-size: .69rem; }
.upload-button:hover { background: #087873; }

.library-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 25px 5px 9px;
}

.library-list-heading small {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  color: var(--muted);
  background: #e8efed;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
}

.document-list { min-height: 0; overflow: auto; overscroll-behavior: contain; }

.document-card {
  position: relative;
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 9px;
  margin-bottom: 5px;
  padding: 10px 8px;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  text-align: left;
}

.document-card:hover { background: #edf5f2; }
.document-card.is-active { border-color: #addad4; background: #e6f5f1; }
.document-open { display: grid; min-width: 0; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 9px; padding: 0; color: inherit; border: 0; background: transparent; text-align: left; }
.document-open > span:first-child { display: grid; width: 36px; height: 42px; place-items: center; color: #fff; background: var(--navy); border-radius: 6px 10px 6px 6px; font-size: .65rem; font-weight: 900; }
.document-open > span:nth-child(2) { display: grid; min-width: 0; gap: 4px; }
.document-card strong { overflow: hidden; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.document-card small { color: var(--muted); font-size: .64rem; }
.document-card .delete-document { display: grid; width: 28px; height: 28px; place-items: center; color: #78909d; border: 0; border-radius: 8px; background: transparent; }
.document-card .delete-document:hover { color: var(--danger); background: #f9e7e9; }

.empty-library { display: grid; place-items: center; gap: 7px; padding: 26px 15px; color: #748994; text-align: center; }
.empty-library > span { font-size: 2rem; }
.empty-library p { margin: 0; font-size: .73rem; line-height: 1.55; }

.privacy-note {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 9px;
  margin-top: auto;
  padding: 13px;
  color: #526d7b;
  border: 1px solid #dbe7e4;
  border-radius: 12px;
  background: #eef7f3;
}

.privacy-note > span { display: grid; width: 27px; height: 27px; place-items: center; color: #fff; background: var(--teal); border-radius: 50%; font-size: .72rem; }
.privacy-note p { margin: 0; font-size: .66rem; line-height: 1.45; }
.privacy-note strong { display: block; margin-bottom: 3px; color: var(--navy); font-size: .7rem; }

.editor { display: grid; min-width: 0; min-height: 0; grid-template-rows: auto auto minmax(0, 1fr) 34px; }

.editor-topbar,
.teacher-toolbar,
.statusbar { position: relative; z-index: 20; background: #fff; }

.editor-topbar {
  display: grid;
  min-height: 54px;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--line);
}

.tool-button,
.utility-button,
.zoom-control select,
.compact-select select {
  min-height: 38px;
  color: var(--ink);
  border: 1px solid #d8e1e3;
  border-radius: 9px;
  background: #fff;
}

.tool-button,
.utility-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 10px; font-size: .72rem; font-weight: 750; }
.tool-button:not(:disabled):hover, .utility-button:not(:disabled):hover { border-color: #93c9c3; background: #eef8f5; }
.icon-only { width: 38px; padding: 0; font-size: 1rem; }
.library-toggle { display: none; }

.page-controls { display: flex; justify-self: center; align-items: center; gap: 7px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.page-controls input { width: 54px; height: 36px; color: var(--navy); border: 1px solid #d8e1e3; border-radius: 8px; text-align: center; font-weight: 800; }
.history-controls { display: flex; gap: 5px; }
.zoom-control select { padding: 0 28px 0 10px; font-size: .72rem; font-weight: 700; }

.teacher-toolbar {
  display: grid;
  min-height: 76px;
  grid-template-columns: auto minmax(320px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 9px 15px;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 5px 18px rgba(12, 49, 70, .05);
}

.primary-tools { display: flex; gap: 4px; padding: 4px; background: #eef3f2; border-radius: 13px; }
.mode-button { display: grid; min-width: 62px; min-height: 50px; place-items: center; gap: 2px; padding: 5px 10px; color: #486574; border: 0; border-radius: 10px; background: transparent; font-size: .68rem; }
.mode-button > span { font-size: 1.03rem; line-height: 1; }
.mode-button strong { font-size: .65rem; }
.mode-button:hover { color: var(--teal-dark); background: #fff; }
.mode-button.is-active { color: #fff; background: var(--navy); box-shadow: 0 5px 12px rgba(11, 53, 87, .16); }

.tool-options { display: flex; min-width: 0; align-items: center; gap: 8px; }
.tool-options label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .64rem; font-weight: 800; }
.compact-select select { padding: 0 25px 0 8px; font-size: .7rem; }
.color-control input { width: 38px; height: 38px; padding: 4px; border: 1px solid #d8e1e3; border-radius: 9px; background: #fff; }
.utility-button.is-active { color: #fff; border-color: var(--danger); background: var(--danger); }

.layer-controls { display: flex; align-items: center; gap: 8px; }
.layer-controls fieldset { display: flex; gap: 3px; margin: 0; padding: 3px; border: 1px solid #d9e3e5; border-radius: 11px; }
.layer-controls legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.layer-controls fieldset label { cursor: pointer; }
.layer-controls fieldset input { position: absolute; opacity: 0; }
.layer-controls fieldset label span { display: flex; min-height: 34px; align-items: center; gap: 6px; padding: 6px 9px; color: #58717f; border-radius: 8px; font-size: .66rem; font-weight: 750; }
.layer-controls fieldset input:checked + span { color: var(--navy); background: #edf5f2; box-shadow: inset 0 0 0 1px #c6dfda; }
.layer-dot { width: 8px; height: 8px; border-radius: 50%; }
.answer-dot { background: #d72d3f; }
.explanation-dot { background: #e3a127; }
.visibility-menu { position: relative; }
.visibility-popover { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; display: grid; width: 225px; gap: 3px; padding: 8px; border: 1px solid #d7e3e4; border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.visibility-popover[hidden] { display: none; }
.visibility-popover label { display: flex; min-height: 39px; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 8px; font-size: .7rem; cursor: pointer; }
.visibility-popover label:hover { background: #eff7f5; }

.canvas-scroller {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 34px;
  overflow: auto;
  overscroll-behavior: contain;
  background-color: #dfe6e6;
  background-image: radial-gradient(rgba(12, 55, 80, .07) 1px, transparent 1px);
  background-size: 17px 17px;
}

.page-stage {
  position: relative;
  width: max-content;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 14px 44px rgba(7, 39, 59, .22), 0 0 0 1px rgba(5, 42, 66, .08);
}

.page-stage[hidden] { display: none; }
.page-stage canvas { display: block; }
#pdf-canvas { position: relative; z-index: 1; }
#annotation-canvas { position: absolute; inset: 0; z-index: 2; touch-action: none; }
#annotation-canvas[data-tool="pen"], #annotation-canvas[data-tool="highlight"], #annotation-canvas[data-tool="shape"] { cursor: crosshair; }
#annotation-canvas[data-tool="text"] { cursor: text; }
#annotation-canvas[data-tool="eraser"] { cursor: cell; }

.text-editor-panel {
  position: absolute;
  z-index: 5;
  display: grid;
  width: min(310px, calc(100% - 16px));
  gap: 7px;
  padding: 10px;
  border: 2px solid var(--teal);
  border-radius: 11px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 8px 26px rgba(7, 46, 68, .2);
}

.text-editor-panel > label {
  color: var(--teal-dark);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .04em;
}

#text-editor {
  width: 100%;
  min-height: 78px;
  padding: 8px 10px;
  resize: vertical;
  color: var(--navy);
  border: 1px solid #bed7d4;
  border-radius: 7px;
  background: #fff;
  line-height: 1.35;
}

.text-editor-panel > div { display: flex; justify-content: flex-end; gap: 6px; }
.text-editor-panel button { min-height: 34px; padding: 6px 10px; color: var(--navy); border: 1px solid #d4e0e1; border-radius: 8px; background: #fff; font-size: .68rem; font-weight: 800; }
.text-editor-panel button:last-child { color: #fff; border-color: var(--teal-dark); background: var(--teal-dark); }
.text-editor-panel button:hover { border-color: #8bc6c0; background: #edf8f5; }
.text-editor-panel button:last-child:hover { background: var(--teal); }

.welcome-panel {
  width: min(780px, 100%);
  margin: max(28px, 6vh) auto;
  padding: clamp(30px, 5vw, 58px);
  color: #fff;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 28px;
  background: linear-gradient(145deg, #082c47, #0a5c67);
  box-shadow: 0 24px 64px rgba(7, 37, 56, .22);
  text-align: center;
}

.welcome-icon { display: grid; width: 64px; height: 64px; margin: 0 auto 15px; place-items: center; color: var(--navy); background: var(--gold); border-radius: 20px; font-size: 1.6rem; font-weight: 900; transform: rotate(-3deg); }
.welcome-panel .kicker { margin: 0 0 12px; color: #8fe0d6; font-size: .68rem; font-weight: 900; letter-spacing: .16em; }
.welcome-panel h2 { max-width: 630px; margin: 0 auto 15px; font-size: clamp(2rem, 4.5vw, 3.35rem); line-height: 1; letter-spacing: -.045em; }
.welcome-panel > p:not(.kicker) { max-width: 620px; margin: 0 auto 23px; color: #d1e1e7; font-size: .95rem; line-height: 1.65; }
.welcome-panel > .button { margin-bottom: 32px; }
.welcome-panel ul { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; padding: 0; list-style: none; text-align: left; }
.welcome-panel li { display: grid; grid-template-columns: 35px 1fr; gap: 3px 9px; padding: 13px; border: 1px solid rgba(255,255,255,.12); border-radius: 13px; background: rgba(255,255,255,.055); }
.welcome-panel li > span { grid-row: span 2; display: grid; width: 34px; height: 34px; place-items: center; color: var(--navy); background: #bde9df; border-radius: 9px; }
.welcome-panel li strong { font-size: .72rem; }
.welcome-panel li small { color: #bad0d9; font-size: .64rem; line-height: 1.4; }

.loading-panel { position: absolute; inset: 0; z-index: 15; display: grid; place-content: center; gap: 12px; color: var(--navy); background: rgba(232, 239, 239, .86); text-align: center; }
.loading-panel[hidden] { display: none; }
.loading-panel span { width: 36px; height: 36px; margin: auto; border: 4px solid #c4d8d6; border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
.loading-panel strong { font-size: .78rem; }

.statusbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 6px 16px; color: #6b818d; border-top: 1px solid #d5e0e2; font-size: .64rem; }
.statusbar p { margin: 0; }
.statusbar kbd { padding: 1px 4px; border: 1px solid #cbd7da; border-bottom-width: 2px; border-radius: 4px; background: #f5f7f6; font-size: .59rem; }

.student-view { position: fixed; inset: 0; z-index: 500; display: grid; grid-template-rows: 72px minmax(0, 1fr) 80px; color: #fff; background: #102d41; }
.student-view[hidden] { display: none; }
.student-view > header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; padding: 10px 22px; border-bottom: 1px solid rgba(255,255,255,.12); background: #08273e; }
.student-view > header > div:first-child { display: flex; align-items: center; gap: 10px; }
.student-view > header span:not(.student-brand) { display: grid; gap: 2px; }
.student-view > header small { color: #8adad1; font-size: .62rem; font-weight: 850; letter-spacing: .12em; }
.student-view > header strong { font-size: .88rem; }
.student-brand { display: grid; width: 39px; height: 39px; place-items: center; color: var(--navy); background: var(--gold); border-radius: 11px; font-weight: 900; }
.student-page-controls { display: flex; align-items: center; gap: 9px; }
.student-page-controls button, .exit-student, .student-view > footer button { min-height: 42px; padding: 8px 14px; color: #fff; border: 1px solid rgba(255,255,255,.23); border-radius: 10px; background: rgba(255,255,255,.08); font-weight: 750; }
.student-page-controls button { width: 42px; padding: 0; font-size: 1.1rem; }
.exit-student { justify-self: end; }
.student-main { min-height: 0; padding: 24px; overflow: auto; background: radial-gradient(circle at center, #294c60, #0f2e42 70%); }
.student-stage { position: relative; width: max-content; margin: 0 auto; background: #fff; box-shadow: 0 18px 60px rgba(0,0,0,.38); }
.student-stage canvas { display: block; }
#student-annotation-canvas { position: absolute; inset: 0; }
.student-view > footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 22px; background: #08273e; }
.student-view > footer p { margin: 0; color: #c4d6de; font-size: .78rem; }
.student-view > footer > div { display: flex; gap: 8px; }
.student-view > footer .reveal-next { color: var(--navy); border-color: var(--gold); background: var(--gold); }

.help-dialog { width: min(660px, calc(100% - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow: auto; border: 0; border-radius: 22px; box-shadow: 0 28px 90px rgba(3, 29, 46, .35); }
.help-dialog::backdrop { background: rgba(4, 28, 44, .66); backdrop-filter: blur(5px); }
.help-card { padding: 27px; }
.help-card header { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.help-card header small { color: var(--teal-dark); font-size: .65rem; font-weight: 850; letter-spacing: .12em; }
.help-card h2 { margin: 5px 0 0; color: var(--navy); font-size: 1.65rem; letter-spacing: -.035em; }
.help-card header button { width: 38px; height: 38px; flex: 0 0 auto; color: var(--muted); border: 0; border-radius: 10px; background: #edf2f1; font-size: 1.25rem; }
.help-card ol { display: grid; gap: 8px; margin: 22px 0; padding: 0; list-style: none; }
.help-card li { display: grid; grid-template-columns: 38px 1fr; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.help-card li > span { display: grid; width: 36px; height: 36px; place-items: center; color: #fff; background: var(--navy); border-radius: 10px; font-weight: 850; }
.help-card li strong { color: var(--navy); font-size: .82rem; }
.help-card li p { margin: 3px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.help-note { padding: 12px 14px; color: #5c6f78; border-radius: 11px; background: #f8efd9; font-size: .72rem; line-height: 1.5; }
.help-card > .button { width: 100%; }

.toast { position: fixed; right: 18px; bottom: 18px; z-index: 900; max-width: min(390px, calc(100% - 36px)); padding: 13px 17px; color: #fff; border-radius: 11px; background: var(--navy-deep); box-shadow: var(--shadow); font-size: .75rem; font-weight: 700; }
.toast.is-error { background: var(--danger); }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  :root { --sidebar: 250px; }
  .teacher-toolbar { grid-template-columns: auto 1fr; }
  .layer-controls { grid-column: 1 / -1; justify-content: space-between; border-top: 1px solid #edf1f1; padding-top: 8px; }
  .editor { grid-template-rows: auto auto minmax(0,1fr) 34px; }
  .tool-options { justify-content: flex-end; }
}

@media (max-width: 920px) {
  :root { --header: 70px; }
  .app-header { grid-template-columns: 1fr auto; gap: 10px; }
  .document-heading { display: none; }
  .header-actions .button span + * { display: none; }
  .workspace { grid-template-columns: 1fr; min-height: 560px; }
  .library-panel { position: fixed; top: var(--header); bottom: 0; left: 0; z-index: 200; width: min(310px, 88vw); box-shadow: 18px 0 50px rgba(5,36,55,.25); transform: translateX(-105%); transition: transform .22s ease; }
  .library-panel.is-open { transform: none; }
  .close-library { display: grid; width: 38px; height: 38px; place-items: center; color: var(--muted); border: 0; border-radius: 9px; background: #e9efed; font-size: 1.25rem; }
  .library-toggle { display: inline-flex; }
  .editor-topbar { grid-template-columns: auto 1fr auto; }
  .history-controls { display: none; }
  .teacher-toolbar { gap: 9px; padding: 8px 10px; }
  .tool-options label > span { display: none; }
  .utility-button { padding-inline: 9px; }
  .student-view > header { grid-template-columns: 1fr auto; }
  .student-page-controls { order: 3; grid-column: 1 / -1; justify-content: center; }
  .student-view { grid-template-rows: auto minmax(0,1fr) auto; }
}

@media (max-width: 680px) {
  .app-header { padding: 8px 10px; }
  .brand small { display: none; }
  .brand strong { font-size: .88rem; }
  .brand-mark { width: 35px; height: 35px; }
  .header-actions { gap: 5px; }
  .header-actions .button { width: 42px; padding: 0; font-size: 0; }
  .header-actions .button span { font-size: .95rem; }
  .editor-topbar { gap: 7px; padding-inline: 8px; }
  .library-toggle span:last-child { display: none; }
  .page-controls { gap: 4px; }
  .zoom-control { display: none; }
  .teacher-toolbar { grid-template-columns: 1fr; }
  .primary-tools { display: grid; grid-template-columns: repeat(4, 1fr); }
  .mode-button { min-width: 0; }
  .tool-options { flex-wrap: wrap; justify-content: center; }
  .tool-options .utility-button:last-child { display: none; }
  .layer-controls { gap: 5px; }
  .layer-controls fieldset label span { padding-inline: 7px; }
  #visibility-button { width: 39px; padding: 0; font-size: 0; }
  #visibility-button span { font-size: .9rem; }
  .canvas-scroller { padding: 18px 10px; }
  .welcome-panel { margin-top: 12px; padding: 27px 19px; border-radius: 20px; }
  .welcome-panel ul { grid-template-columns: 1fr; }
  .welcome-panel li { display: none; }
  .welcome-panel li:first-child { display: grid; }
  .statusbar { justify-content: center; }
  .statusbar p:last-child { display: none; }
  .student-view > header { padding: 9px 12px; }
  .student-view > header > div:first-child strong { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .exit-student { width: 42px; padding: 0; font-size: 0; }
  .exit-student span { font-size: 1rem; }
  .student-main { padding: 12px 6px; }
  .student-view > footer { align-items: stretch; flex-direction: column; gap: 8px; padding: 10px 12px; }
  .student-view > footer > div { display: grid; grid-template-columns: 1fr 1fr; }
  .student-view > footer p { text-align: center; }
}

@media print {
  body > * { display: none !important; }
}
