.classroom-tools-launcher {
  position: fixed;
  top: 72px;
  right: 18px;
  z-index: 999;
  display: grid;
  gap: 8px;
  width: 220px;
  padding: 10px;
  border: 1px solid #263d51;
  border-radius: 8px;
  background: #071018;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.classroom-tools-launcher[hidden] {
  display: none !important;
}

.classroom-launcher-item {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0 12px;
  border: 2px solid #263d51;
  border-radius: 8px;
  color: #ffffff;
  background: #122436;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.classroom-launcher-item:hover,
.classroom-launcher-item:focus-visible {
  border-color: #8fd8f3;
  color: #06111a;
  background: #149bd7;
}

.annotation-active {
  overflow: hidden !important;
}

.annotation-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  color: #ffffff;
  pointer-events: none;
}

.annotation-overlay[hidden] {
  display: none !important;
}

.annotation-canvas {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  cursor: crosshair;
  pointer-events: auto;
  touch-action: none;
}

.annotation-overlay.is-capturing .annotation-canvas {
  opacity: 0;
}

.annotation-toolbar {
  position: fixed;
  z-index: 2147483001;
  display: flex;
  gap: 5px;
  padding: 6px;
  border: 1px solid #263d51;
  border-radius: 8px;
  background: rgba(7, 16, 24, 0.96);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
  pointer-events: auto;
}

.annotation-overlay[data-position="right"] .annotation-toolbar,
.annotation-overlay[data-position="left"] .annotation-toolbar {
  top: max(76px, env(safe-area-inset-top));
  bottom: max(12px, env(safe-area-inset-bottom));
  width: min(64px, calc(100vw - 24px));
  flex-direction: column;
  align-items: stretch;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.annotation-overlay[data-position="right"] .annotation-toolbar {
  right: max(12px, env(safe-area-inset-right));
}

.annotation-overlay[data-position="left"] .annotation-toolbar {
  left: max(12px, env(safe-area-inset-left));
}

.annotation-overlay[data-position="bottom"] .annotation-toolbar {
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  max-height: min(42vh, 230px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.annotation-toolbar.is-capturing,
.annotation-status.is-capturing {
  opacity: 0;
}

.annotation-toolbar-header {
  display: grid;
  gap: 5px;
}

.annotation-placement {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
}

.annotation-position {
  min-height: 28px;
  padding: 0 1px;
  border: 2px solid #263d51;
  border-radius: 8px;
  color: #ffffff;
  background: #122436;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.annotation-tool,
.annotation-action {
  min-height: 34px;
  padding: 0 4px;
  border: 2px solid #263d51;
  border-radius: 8px;
  color: #ffffff;
  background: #122436;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.annotation-tool .icon,
.annotation-action .icon {
  width: 20px;
  height: 20px;
  margin: auto;
}

.annotation-tool:hover,
.annotation-tool:focus-visible,
.annotation-tool.is-active,
.annotation-position:hover,
.annotation-position:focus-visible,
.annotation-position.is-active,
.annotation-action:hover,
.annotation-action:focus-visible {
  border-color: #8fd8f3;
  color: #06111a;
  background: #149bd7;
}

.annotation-save {
  border-color: #f4ce73;
  color: #102131;
  background: #f8d77d;
}

.annotation-control-label {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
  border: 2px solid #263d51;
  border-radius: 8px;
  color: #ffffff;
  background: #122436;
  font-weight: 800;
  white-space: nowrap;
}

.annotation-colour-label {
  padding: 2px;
}

.annotation-overlay[data-position="right"] .annotation-tool,
.annotation-overlay[data-position="right"] .annotation-action,
.annotation-overlay[data-position="left"] .annotation-tool,
.annotation-overlay[data-position="left"] .annotation-action,
.annotation-overlay[data-position="right"] .annotation-control-label,
.annotation-overlay[data-position="left"] .annotation-control-label {
  width: 100%;
  justify-content: center;
}

.annotation-overlay[data-position="right"] .annotation-size-label,
.annotation-overlay[data-position="left"] .annotation-size-label {
  flex-direction: column;
  gap: 2px;
  padding: 4px 2px;
}

.annotation-control-label input[type="color"] {
  width: 42px;
  height: 28px;
  padding: 2px;
  border: 1px solid #8fa4b5;
  border-radius: 6px;
  background: #ffffff;
}

.annotation-size-step {
  width: 28px;
  min-height: 28px;
  padding: 0;
  border: 2px solid #263d51;
  border-radius: 8px;
  color: #ffffff;
  background: #122436;
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  font-weight: 900;
  cursor: pointer;
}

.annotation-size-step:hover,
.annotation-size-step:focus-visible {
  border-color: #8fd8f3;
  color: #06111a;
  background: #149bd7;
}

.annotation-size-output {
  min-width: 28px;
  color: #ffffff;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.annotation-swatches {
  display: grid;
  grid-template-columns: repeat(6, 20px);
  justify-content: center;
  gap: 4px;
  min-height: 34px;
  padding: 0 4px;
  border: 2px solid #263d51;
  border-radius: 8px;
  background: #122436;
}

.annotation-overlay[data-position="right"] .annotation-swatches,
.annotation-overlay[data-position="left"] .annotation-swatches {
  grid-template-columns: repeat(2, 20px);
  padding: 5px;
}

.annotation-swatches button {
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: var(--swatch);
  cursor: pointer;
}

.annotation-swatches button:hover,
.annotation-swatches button:focus-visible {
  outline: 3px solid rgba(143, 216, 243, 0.7);
  outline-offset: 2px;
}

.annotation-status {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 2147483001;
  max-width: min(620px, calc(100vw - 24px));
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  color: #ffffff;
  background: rgba(7, 16, 24, 0.9);
  font-weight: 800;
  pointer-events: none;
}

.annotation-status:empty {
  display: none;
}

.annotation-overlay[data-position="bottom"] .annotation-status {
  top: max(76px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  bottom: auto;
}

.classroom-window-page {
  margin: 0;
  min-height: 100vh;
  color: #102131;
  background: #eef4f8;
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

.classroom-window-page * {
  box-sizing: border-box;
}

.classroom-window-page button,
.classroom-window-page input,
.classroom-window-page select {
  font: inherit;
}

.classroom-window-page button:focus-visible,
.classroom-window-page input:focus-visible,
.classroom-window-page select:focus-visible {
  outline: 4px solid rgba(20, 155, 215, 0.35);
  outline-offset: 2px;
}

.classroom-standalone-header {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  color: #ffffff;
  background: #071018;
}

.classroom-standalone-header h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: clamp(1.15rem, 4vw, 1.65rem);
  line-height: 1.1;
  font-weight: 900;
}

.classroom-standalone-header a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 2px solid #263d51;
  border-radius: 8px;
  color: #ffffff;
  background: #122436;
  text-decoration: none;
  font-weight: 800;
}

.classroom-standalone-header a:hover,
.classroom-standalone-header a:focus-visible {
  border-color: #8fd8f3;
  color: #06111a;
  background: #149bd7;
}

.classroom-standalone-main {
  min-height: calc(100vh - 62px);
  display: grid;
  padding: 16px;
}

.classroom-tool-panel {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 16px;
  width: 100%;
}

.classroom-tool-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.classroom-tool-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #5c6b78;
  font-weight: 800;
}

.classroom-tool-row input,
.classroom-tool-row select {
  min-height: 44px;
  max-width: 150px;
  border: 2px solid #d8e2ea;
  border-radius: 8px;
  padding: 0 10px;
  color: #102131;
  background: #ffffff;
  font-weight: 800;
}

.classroom-tool-row input[type="color"] {
  width: 52px;
  padding: 4px;
}

.classroom-tool-row input[type="range"] {
  width: min(34vw, 190px);
  max-width: none;
  padding: 0;
}

.classroom-tool-row output {
  min-width: 42px;
  color: #102131;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.classroom-toggle {
  min-height: 44px;
  padding: 0 12px;
  border: 2px solid #d8e2ea;
  border-radius: 8px;
  background: #ffffff;
}

.classroom-toggle input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: #149bd7;
}

.classroom-tool-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 2px solid #263d51;
  border-radius: 8px;
  color: #ffffff;
  background: #122436;
  font-weight: 800;
  cursor: pointer;
}

.classroom-tool-action:hover,
.classroom-tool-action:focus-visible {
  border-color: #8fd8f3;
  color: #06111a;
  background: #149bd7;
}

.classroom-tool-action.secondary {
  border-color: #d8e2ea;
  color: #102131;
  background: #ffffff;
}

.classroom-tool-readout {
  display: grid;
  place-items: center;
  min-height: min(54vh, 360px);
  padding: 16px;
  border: 2px solid #d8e2ea;
  border-radius: 8px;
  background: #ffffff;
}

.classroom-noise-panel {
  gap: 10px;
}

.classroom-noise-panel .classroom-tool-readout {
  min-height: 86px;
  padding: 12px;
}

.classroom-timer-display {
  font-size: clamp(4.5rem, 19vw, 11rem);
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.classroom-timer-display.is-finished {
  color: #b4243a;
}

.classroom-meter-track {
  position: relative;
  width: min(100%, 720px);
  height: 46px;
  overflow: hidden;
  border: 2px solid #d8e2ea;
  border-radius: 999px;
  background: linear-gradient(90deg, #74d3ae 0 42%, #f2b84b 42% 70%, #f29aa3 70% 100%);
}

.classroom-meter-fill {
  width: 0%;
  height: 100%;
  background: rgba(7, 16, 24, 0.42);
  transition: width 120ms linear;
}

.classroom-meter-marker {
  position: absolute;
  top: -2px;
  bottom: -2px;
  z-index: 2;
  width: 4px;
  transform: translateX(-50%);
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(7, 16, 24, 0.35);
}

.classroom-meter-marker-amber {
  left: 35%;
}

.classroom-meter-marker-red {
  left: 70%;
}

.classroom-noise-alert {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  min-height: 100vh;
  display: none;
  place-items: center;
  border: 0;
  border-radius: 0;
  color: #ffffff;
  background: #000000;
  pointer-events: none;
}

.classroom-noise-alert svg {
  width: min(82vw, 620px);
  height: min(82vh, 620px);
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.35));
}

.classroom-noise-alert.is-visible {
  display: grid;
}

.classroom-noise-alert.is-flashing {
  animation: classroom-noise-flash 0.46s steps(2, jump-none) infinite;
}

@keyframes classroom-noise-flash {
  0% {
    background: #000000;
    color: #ffffff;
  }

  100% {
    background: #ffffff;
    color: #000000;
  }
}

.classroom-tool-status {
  margin: 0;
  color: #5c6b78;
  font-weight: 700;
}

.classroom-camera-frame {
  width: 100%;
  max-height: calc(100vh - 190px);
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  border: 2px solid #d8e2ea;
  border-radius: 8px;
  background: #071018;
}

.classroom-camera-preview {
  width: 100%;
  height: 100%;
  display: block;
  background: #071018;
  object-fit: contain;
}

.classroom-blackboard-wrap {
  --paper-bg: #1f473a;
  width: 100%;
  min-height: calc(100vh - 190px);
  border: 8px solid #8d5f35;
  border-radius: 8px;
  background-color: var(--paper-bg);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.classroom-blackboard {
  width: 100%;
  height: calc(100vh - 206px);
  min-height: 420px;
  display: block;
  touch-action: none;
}

.paper-ruled {
  background-image: repeating-linear-gradient(to bottom, transparent 0 32px, rgba(65, 130, 190, 0.58) 33px, transparent 35px);
}

.paper-handwriting {
  background-image:
    repeating-linear-gradient(to bottom, transparent 0 13px, rgba(242, 184, 75, 0.36) 14px, transparent 15px),
    repeating-linear-gradient(to bottom, transparent 0 40px, rgba(65, 130, 190, 0.58) 41px, transparent 43px);
}

.paper-squares {
  background-image:
    repeating-linear-gradient(to right, transparent 0 31px, rgba(100, 145, 180, 0.45) 32px, transparent 33px),
    repeating-linear-gradient(to bottom, transparent 0 31px, rgba(100, 145, 180, 0.45) 32px, transparent 33px);
}

.paper-graph {
  background-image:
    repeating-linear-gradient(to right, transparent 0 11px, rgba(150, 180, 205, 0.35) 12px, transparent 13px),
    repeating-linear-gradient(to bottom, transparent 0 11px, rgba(150, 180, 205, 0.35) 12px, transparent 13px),
    repeating-linear-gradient(to right, transparent 0 59px, rgba(70, 120, 160, 0.48) 60px, transparent 61px),
    repeating-linear-gradient(to bottom, transparent 0 59px, rgba(70, 120, 160, 0.48) 60px, transparent 61px);
}

.paper-dots {
  background-image: radial-gradient(circle, rgba(70, 120, 160, 0.62) 1.6px, transparent 1.8px);
  background-size: 24px 24px;
}

.paper-isometric {
  background-image:
    repeating-linear-gradient(30deg, transparent 0 27px, rgba(100, 145, 180, 0.42) 28px, transparent 29px),
    repeating-linear-gradient(150deg, transparent 0 27px, rgba(100, 145, 180, 0.42) 28px, transparent 29px),
    repeating-linear-gradient(90deg, transparent 0 27px, rgba(100, 145, 180, 0.35) 28px, transparent 29px);
}

.classroom-camera-frame:fullscreen,
.classroom-blackboard-wrap:fullscreen,
.classroom-camera-frame.is-expanded,
.classroom-blackboard-wrap.is-expanded {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  width: 100vw;
  height: 100vh;
  max-height: none;
  min-height: 100vh;
  border: 0;
  border-radius: 0;
  background-color: #071018;
}

.classroom-blackboard-wrap:fullscreen,
.classroom-blackboard-wrap.is-expanded {
  background-color: var(--paper-bg);
}

.classroom-camera-frame:fullscreen .classroom-camera-preview,
.classroom-camera-frame.is-expanded .classroom-camera-preview,
.classroom-blackboard-wrap:fullscreen .classroom-blackboard,
.classroom-blackboard-wrap.is-expanded .classroom-blackboard {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
}

@media (max-width: 680px) {
  .classroom-standalone-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .classroom-standalone-main {
    min-height: calc(100vh - 112px);
    padding: 12px;
  }

  .annotation-overlay[data-position="right"] .annotation-toolbar,
  .annotation-overlay[data-position="left"] .annotation-toolbar {
    top: max(68px, env(safe-area-inset-top));
    bottom: 8px;
    width: min(62px, calc(100vw - 16px));
  }

  .annotation-overlay[data-position="right"] .annotation-toolbar {
    right: 8px;
  }

  .annotation-overlay[data-position="left"] .annotation-toolbar {
    left: 8px;
  }

  .annotation-overlay[data-position="bottom"] .annotation-toolbar {
    right: 8px;
    bottom: 8px;
    left: 8px;
    max-height: min(48vh, 250px);
  }

  .classroom-tool-readout {
    min-height: 220px;
  }

  .classroom-blackboard,
  .classroom-blackboard-wrap {
    min-height: 420px;
  }
}

@media print {
  .classroom-tools-launcher,
  .classroom-tools-button,
  .annotation-overlay,
  .annotation-toggle-button,
  .classroom-standalone-header,
  .classroom-tool-row,
  .classroom-tool-status {
    display: none !important;
  }

  .classroom-window-page,
  .classroom-standalone-main {
    background: #ffffff;
    padding: 0;
  }
}
