.climb-utility {
  box-sizing: border-box;
  width: min(690px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  overflow: auto;
  border: 1px solid #6792c3;
  border-radius: 22px;
  padding: clamp(16px, 4vw, 32px);
  box-shadow: 0 18px 48px #04102c66;
}
.climb-utility::backdrop { background: #06132eb8; }
.climb-dark {
  color: #f5faff;
  background: #0a2347;
  background-image: linear-gradient(0deg, #102f58, transparent 68%),
    linear-gradient(138deg, transparent 80%, #164071 80%, #164071 91%, transparent 91%),
    linear-gradient(32deg, #123762 16%, transparent 16%);
  text-align: center;
}
.climb-utility header { display: flex; align-items: center; gap: 10px; text-align: start; }
.climb-utility h2 { margin: 0; flex: 1; font-size: clamp(1.35rem, 4vw, 2.2rem); }
.climb-utility button { cursor: pointer; }
.climb-utility button:disabled { opacity: .5; cursor: default; }
.climb-dark button {
  color: inherit;
  border: 1px solid #7eadd4;
  border-radius: 12px;
  background: #16375d;
  min-height: 42px;
  padding: 7px 15px;
  font-weight: 750;
}
.climb-dark .climb-gold-button, .climb-noise-modes button[aria-pressed="true"] {
  color: #112643;
  background: #ffca55;
  border-color: #ffdf88;
}
.climb-utility .climb-tool-close {
  color: inherit;
  background: transparent;
  border: 1px solid #7eadd4;
  border-radius: 10px;
  font-size: 1.4rem;
  min-height: 38px;
  min-width: 38px;
  padding: 0 7px;
}
.climb-tool-actions { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 15px 0; }
.climb-tool-actions label { display: inline-flex; align-items: center; gap: 6px; }
.climb-dark input[type="number"] { width: 4.25em; padding: 6px; border-radius: 8px; border: 1px solid #b2cce5; color: #112643; }
.climb-dark input[type="range"], .climb-dark input[type="checkbox"] { accent-color: #ffca55; }
.climb-tool-badge { color: #102c50; background: #c3dff6; border-radius: 20px; padding: 5px 12px; font-weight: 750; }
.climb-tool-status { margin: 8px 0; min-height: 1.35em; color: #cae8ff; }
.climb-tool-error { color: #a3233e; }
.climb-dark .climb-tool-error { color: #ffd4de; }
.climb-tool-error:empty { margin: 0; }
.climb-timer-ring {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  width: min(250px, 55vw);
  aspect-ratio: 1;
  margin: 18px auto 0;
  border-radius: 50%;
  background: conic-gradient(#ffd363 var(--timer-remaining, 100%), #37577a 0);
}
.climb-timer-ring::before { content: ""; position: absolute; inset: 8px; z-index: -1; border-radius: inherit; background: #0b2448; }
#timerFace { font-variant-numeric: tabular-nums; font-size: clamp(2.7rem, 9vw, 5.1rem); font-weight: 900; }
#timerStatus { color: #ffda77; font-weight: 800; }
#climbTimer:fullscreen, #climbTimer.timer-project { width: 100%; height: 100%; max-height: none; max-width: none; border-radius: 0; }
#climbTimer:fullscreen .climb-timer-ring, #climbTimer.timer-project .climb-timer-ring { width: min(48vh, 55vw); }
#timerRing { container-type: inline-size; }
#timerFace[data-hours] {
  font-size: clamp(.9rem, 15cqi, 6.5rem);
  white-space: nowrap;
}
#climbTimer :is(.timer-fields, .timer-buttons) { flex-wrap: nowrap; }
#climbTimer .timer-fields label { white-space: nowrap; }
#climbTimer .timer-fields input { min-height: 42px; }
#climbTimer .timer-buttons button { white-space: nowrap; }
#climbTimer:is(:fullscreen, .timer-project) .climb-timer-ring { width: min(51dvh, 76vw); }

@media (max-width: 540px) {
  #climbTimer .timer-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(4px, 2vw, 10px);
    padding-inline: 8px;
  }
  #climbTimer .timer-fields label { display: grid; gap: 4px; }
  #climbTimer .timer-fields input { width: 100%; min-width: 0; box-sizing: border-box; font-size: 1rem; }
  #climbTimer .timer-buttons { gap: clamp(3px, 1vw, 9px); padding-inline: 5px; }
  #climbTimer .timer-buttons button { padding-inline: clamp(5px, 2vw, 12px); font-size: clamp(.79rem, 3.7vw, 1rem); }
}

@media (orientation: landscape) and (max-height: 480px) {
  #climbTimer .climb-timer-ring, #climbTimer:is(:fullscreen, .timer-project) .climb-timer-ring {
    width: min(39dvh, 44vw);
    margin-block-start: 8px;
  }
  #climbTimer #timerStatus:empty { margin-block: 6px; min-height: 0; }
}

.climb-picker-reel { width: min(100%, 450px); margin: 16px auto; }
.climb-picker-reel div { border-radius: 12px; min-height: 1.65em; padding: 4px 10px; overflow-wrap: anywhere; }
#pickerName { background: #e0f1ff; color: #112b4e; font-weight: 900; font-size: clamp(1.7rem, 6vw, 3.4rem); }
#pickerName.picked { background: #ffca55; }
#pickerAbove, #pickerBelow { color: #abcae4; font-size: 1.1rem; }
.climb-check { display: inline-flex; align-items: center; gap: 6px; }
.climb-noise-meter { position: relative; margin: 32px 5px 14px; padding-top: 20px; }
#noiseTargetLabel { position: absolute; inset-block-start: -6px; translate: -50% 0; white-space: nowrap; }
[dir="rtl"] #noiseTargetLabel { translate: 50% 0; }
#noiseMeterBar { height: clamp(26px, 6vw, 46px); position: relative; background: #16385f; border: 2px solid #a2c7e5; border-radius: 40px; }
#noiseMeterBar::before { content: ""; position: absolute; inset-block: 3px; inset-inline-start: 3px; width: max(0px, calc(var(--level, 0%) - 6px)); border-radius: inherit; background: var(--noise-meter-fill, #61e5bb); }
#noiseMeterBar::after { content: ""; position: absolute; inset-block: -5px; inset-inline-start: var(--target, 61%); width: 3px; border-radius: 3px; background: #f5faff; }
.noise-warned #noiseMeterBar { --noise-meter-fill: #ffbf4f; }
#noiseStatus { font-size: clamp(1.65rem, 6vw, 3.45rem); font-weight: 900; line-height: 1.08; margin: 19px 0 5px; color: #8df1cd; }
.noise-warned #noiseStatus { color: #ffd474; }
#noiseHint { margin: 6px 0 18px; }
#noiseMic.mic-live { background: #a4f2d7; }
.climb-noise-controls { padding-top: 12px; border-top: 1px solid #668db2; }
.climb-noise-controls input[type="range"] { width: 108px; }
.climb-roster { background: #f3faff; color: #0c274c; }
.climb-roster fieldset { border: 0; padding: 0; margin: 0; }
.climb-roster-list { max-height: 35vh; overflow: auto; }
.climb-roster-list > div { display: flex; gap: 8px; margin-bottom: 7px; }
.climb-roster-list input { min-width: 0; flex: 1; padding: 8px; border: 1px solid #9ec3e5; border-radius: 8px; }
.class-roster-paste { width: 100%; border: 1px solid #9ec3e5; border-radius: 10px; padding: 9px; resize: vertical; }
.climb-utility-anchor { position: relative; min-height: 80px; }
.quick-tools-panel { max-height: min(480px, 72vh, calc(100% - 12px)); overflow: auto; }
.climb-utility-anchor .quick-tools-panel { top: 0; transform: none; max-height: min(480px, 72vh); }
.quick-tool[data-state="utility"] .quick-tool-action { text-align: start; color: inherit; }
@media (max-width: 480px) {
  .climb-utility header { flex-wrap: wrap; }
  .climb-utility h2 { flex-basis: 55%; }
}

@media (max-width: 760px) {
  .teacher-class-actions {
    flex: 0 0 100%;
    flex-wrap: wrap;
    min-width: 0;
    gap: 8px;
  }

  .teacher-class-actions .btn {
    max-width: 100%;
    padding-inline: 10px;
    white-space: normal;
  }

  .teacher-class-actions > .menu-dropdown {
    position: static;
    max-width: 100%;
  }

  #classroomShell #classMenuPanel {
    inset-inline-start: 12px;
    inset-inline-end: auto;
    max-width: calc(100% - 24px);
  }
}
