.toolbox-page, .teacher-tool-document { background: #f4f7fb; color: #192c45; }
.toolbox-page--detail {
  --toolbox-header-height: 72px;
  min-height: calc(100vh - var(--toolbox-header-height));
  min-height: calc(100svh - var(--toolbox-header-height));
}
.toolbox-mobile-header-spacer ~ .toolbox-page--detail { --toolbox-header-height: 3.52rem; }
.toolbox-content { max-width: 1200px; min-height: 280px; margin: 0 auto; padding: 32px 16px; }
.toolbox-page--detail .toolbox-content { width: calc(100% - 32px); padding-inline: 0; }
.toolbox-page h1 { margin: 0 0 20px; font-size: clamp(26px, 4vw, 36px); line-height: 1.4; }
.toolbox-back { display: inline-block; margin-bottom: 12px; color: #1757a6; font-size: 14px; }
.teacher-tools-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.teacher-tools-grid a {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  min-height: 92px;
  padding: 16px;
  border: 1px solid #dce5f0;
  border-radius: 12px;
  background: #fff;
  color: #1757a6;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.teacher-tools-grid a:hover, .teacher-tools-grid a:focus-visible {
  border-color: #025bff;
  background: #eaf3ff;
}
.toolbox-mobile-header-spacer ~ .toolbox-page .teacher-tools-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 640px) {
  .teacher-tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .teacher-tools-grid a { min-height: 76px; padding: 12px 8px; }
}
.toolbox-frame { display: block; width: 100%; height: 72vh; min-height: 540px; border: 0; border-radius: 8px; }
.toolbox-frame[data-fit-content] { height: 540px; min-height: 0; }

.tool-card {
  background: #fff;
  border: 1px solid #dce5f0;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(31, 74, 116, 0.08);
}
.tool-primary, .tool-secondary {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: 600 0.9rem/1.35 system-ui, sans-serif;
  cursor: pointer;
}
.tool-primary {
  background: #025bff;
  color: #fff;
  box-shadow: 0 10px 15px -5px rgba(2, 91, 255, 0.18);
}
.tool-primary:hover:not(:disabled) { background: #0046c7; color: #fff; }
.tool-secondary { background: #fff; border-color: #8b9db5; color: #1757a6; }
.tool-secondary:hover:not(:disabled) { background: #eaf3ff; border-color: #52647c; color: #1757a6; }
.tool-primary:focus-visible, .tool-secondary:focus-visible {
  outline: 2px solid #025bff;
  outline-offset: 2px;
}
.tool-primary:disabled, .tool-secondary:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

.classroom-tool {
  width: 100%;
  padding: clamp(16px, 3vw, 32px);
  margin: 0 auto;
  box-sizing: border-box;
  font: 16px/1.5 system-ui, sans-serif;
}
.classroom-tool [hidden] { display: none; }
.classroom-tool[data-classroom-tool="timer"] { text-align: center; }
.classroom-tool a { display: inline-block; margin-top: 12px; color: #1757a6; text-decoration: underline; }
.classroom-presets, .classroom-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.classroom-presets, [data-classroom-tool="timer"] .classroom-actions { justify-content: center; }
.classroom-presets [aria-pressed="true"] { background: #eaf3ff; border-color: #025bff; }
.classroom-clock {
  font-size: clamp(56px, 18vw, 150px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  padding: 16px 0 0;
}
.classroom-status { min-height: 1.5em; margin: 8px 0; color: #52647c; }
.classroom-check { display: inline-flex; align-items: center; min-height: 40px; gap: 6px; cursor: pointer; }
.classroom-check input { accent-color: #025bff; }
.classroom-roster textarea, .classroom-actions input[type="number"], .classroom-actions select {
  box-sizing: border-box;
  border: 1px solid #8b9db5;
  border-radius: 8px;
  padding: 8px 12px;
  background: #fff;
  color: #192c45;
  font: inherit;
}
.classroom-roster textarea { display: block; width: 100%; resize: vertical; }
.classroom-roster label, .classroom-actions label { font-weight: 600; }
.classroom-roster #roster-help { margin: 4px 0 8px; color: #52647c; }
.classroom-actions input[type="number"] { width: 6em; }
.classroom-result, .classroom-board { margin-top: 16px; padding: 16px; border-radius: 12px; background: #f4f7fb; }
.classroom-result { font-size: clamp(20px, 5vw, 48px); overflow-wrap: anywhere; text-align: center; }
.classroom-board h2 { margin: 0; font-size: 1.35em; }
.classroom-groups { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.classroom-group { padding: 12px; background: #fff; border: 1px solid #dce5f0; border-radius: 8px; overflow-wrap: anywhere; }
.classroom-group h3 { margin: 0 0 6px; font-size: 1em; color: #1757a6; }
.classroom-group p { margin: 0; }
.classroom-tool:fullscreen, .classroom-board:fullscreen, .classroom-projection {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  padding: clamp(16px, 5vw, 48px);
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: #f4f7fb;
  color: #192c45;
}
.classroom-projection { position: fixed; inset: 0; z-index: 2147483647; }
html.classroom-projection-open, html.classroom-projection-open body { overflow: hidden; }
.classroom-tool:fullscreen .classroom-clock, .classroom-tool.classroom-projection .classroom-clock {
  font-size: clamp(72px, 24vw, 280px);
}
.classroom-board:fullscreen .classroom-groups, .classroom-board.classroom-projection .classroom-groups {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  font-size: clamp(18px, 2.5vw, 32px);
}
