/* Minimized Timer and Noise Meter on the classroom display (classroom-corner-tools.js).
   The dock sits above the projected PDF, Whiteboard, Snap & Project and dashboard (z-index 1550–1600)
   and below windows, which open in the browser's top layer. */
.corner-dock {
  position: fixed;
  top: 68px;
  right: 16px;
  z-index: 1690;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(270px, calc(100vw - 32px));
  pointer-events: none;
  transition: top 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
.corner-dock[hidden] { display: none !important; }

.corner-tool {
  --corner-line: rgba(249, 184, 13, 0.45);
  box-sizing: border-box;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 62px;
  padding: 10px 14px;
  color: #fff;
  background: rgba(12, 32, 66, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--corner-line);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  pointer-events: auto;
  transform-origin: top right;
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
  font-family: inherit;
  line-height: 1.2;
}
.corner-tool.corner-instant { transition: none !important; }
.corner-tool.is-leaving { pointer-events: none; }
.corner-noise { --corner-line: rgba(148, 184, 232, 0.28); }

/* Timer */
.corner-timer { gap: 8px; }
.corner-ring { flex: none; width: 32px; height: 32px; overflow: visible; }
.corner-ring circle { fill: none; stroke-width: 3.6; }
.corner-ring-track { stroke: rgba(249, 184, 13, 0.2); }
.corner-ring-fill {
  stroke: #F9B80D;
  stroke-linecap: round;
  stroke-dasharray: 94.25 94.25;
  filter: drop-shadow(0 0 3px rgba(249, 184, 13, 0.55));
  transition: stroke-dasharray 200ms linear;
}
.corner-ring-hand { fill: none; stroke: #F9B80D; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.corner-clock {
  flex: 1;
  min-width: 0;
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-align: start;
  unicode-bidi: isolate;
}
.corner-clock[data-hours] { font-size: 24px; letter-spacing: 0; }
.corner-timer[data-state="paused"] .corner-clock { opacity: 0.72; }
.corner-timer[data-state="done"] { --corner-line: rgba(249, 184, 13, 0.9); animation: corner-done 1.1s ease-in-out 4; }
@keyframes corner-done {
  50% { box-shadow: 0 0 0 4px rgba(249, 184, 13, 0.35), 0 8px 24px rgba(0, 0, 0, 0.22); }
}

/* Buttons */
.corner-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.corner-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}
.corner-btn[hidden] { display: none; }
.corner-btn svg { width: 16px; height: 16px; fill: currentColor; }
.corner-btn .corner-stroke, .corner-wave .corner-stroke, .climb-tool-minimize .corner-stroke {
  fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.corner-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
.corner-btn:focus-visible { color: #fff; outline: 2px solid #F9B80D; outline-offset: 1px; }

/* Noise Meter */
.corner-wave { flex: none; display: grid; place-items: center; width: 34px; height: 34px; color: #2DD4BF; }
.corner-wave svg { width: 30px; height: 30px; filter: drop-shadow(0 0 4px rgba(45, 212, 191, 0.5)); }
.corner-noise-body { flex: 1; min-width: 0; display: grid; gap: 7px; }
.corner-noise-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.corner-noise-mode {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 700;
}
.corner-btn { width: 26px; height: 26px; }
.corner-noise-bar {
  --level: 0%;
  --target: 61%;
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}
.corner-noise-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #22C55E 0%, #84CC16 35%, #FBBF24 62%, #F97316 80%, #EF4444 100%);
  clip-path: inset(0 calc(100% - var(--level)) 0 0 round 999px);
  transition: clip-path 120ms linear;
}
[dir="rtl"] .corner-noise-fill {
  background: linear-gradient(270deg, #22C55E 0%, #84CC16 35%, #FBBF24 62%, #F97316 80%, #EF4444 100%);
  clip-path: inset(0 0 0 calc(100% - var(--level)) round 999px);
}
.corner-noise-target {
  position: absolute;
  top: -4px;
  bottom: -4px;
  inset-inline-start: var(--target);
  width: 3px;
  margin-inline-start: -1.5px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(12, 32, 66, 0.65), 0 0 6px rgba(255, 255, 255, 0.7);
}
.corner-noise.is-off .corner-noise-mode { color: rgba(255, 255, 255, 0.82); }
.corner-noise.is-off .corner-wave { opacity: 0.55; }
.corner-tool.corner-noise.is-warned { --corner-line: rgba(239, 68, 68, 0.85); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.28), 0 8px 24px rgba(0, 0, 0, 0.22); }

/* Alpine Night: the cards keep their navy glass, with a brighter edge so they stand out on dark screens. */
html[data-climb-theme="dark"] .corner-tool {
  background: rgba(10, 26, 54, 0.96);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 10px 28px rgba(0, 0, 0, 0.5);
}
html[data-climb-theme="dark"] .corner-timer { --corner-line: rgba(249, 184, 13, 0.62); }
html[data-climb-theme="dark"] .corner-noise { --corner-line: rgba(148, 184, 232, 0.5); }

/* The PC minimize button next to the Timer and Noise Meter close buttons, matching that button in each theme.
   Phone-size screens never show it, so the phone layout does not change. */
.climb-utility .climb-tool-minimize {
  display: grid;
  place-items: center;
  border: 1px solid #7eadd4;
  border-radius: 10px;
  min-height: 38px;
  min-width: 38px;
  padding: 0 7px;
}
.climb-tool-minimize svg { width: 20px; height: 20px; }
:root:not([data-climb-theme="dark"]) #climbTimer .climb-tool-minimize {
  color: #142f50;
  background: #f7fbff;
  border-color: #9cb9d6;
  box-shadow: 0 2px 4px #19375724;
}
:root[data-climb-theme="dark"] #climbNoise .climb-tool-minimize {
  color: var(--theme-control-ink);
  background: var(--theme-raised);
  border: 1px solid var(--theme-elevated-line);
  box-shadow: none;
}
:is(#climbTimer, #climbNoise) .climb-tool-minimize:focus-visible { outline: 3px solid #F9B80D; outline-offset: 2px; }
@media (max-width: 899px) {
  .climb-utility .climb-tool-minimize { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .corner-tool, .corner-ring-fill, .corner-noise-fill { transition: none; }
  .corner-timer[data-state="done"] { animation: none; }
}
