/* A reserved, fixed strip keeps the switch visible without covering the game. */
body.has-game-sound { margin-top: calc(52px + env(safe-area-inset-top, 0px)); min-height: calc(100dvh - 52px); }
.has-game-sound .app-frame { min-height: calc(100dvh - 52px - env(safe-area-inset-top, 0px) - clamp(24px, 6vw, 68px)); }
html:has(.sound-toolbar) { scroll-padding-top: calc(60px + env(safe-area-inset-top, 0px)); }
.sound-toolbar { position: fixed; inset: 0 0 auto; z-index: 50; padding-top: env(safe-area-inset-top, 0px); background: var(--paper); border-bottom: 2px solid var(--ink); }
.sound-toolbar-inner { width: min(1120px, 100%); height: 50px; padding: 3px max(10px, env(safe-area-inset-right, 0px)) 3px max(10px, env(safe-area-inset-left, 0px)); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sound-toolbar .brand { min-height: 44px; }
.sound-toolbar .brand-logo { width: 124px; height: auto; }
.sound-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 108px; min-height: 44px; margin-left: auto; padding: 6px 10px; border: 2px solid var(--ink); border-radius: var(--control-radius); background: var(--paper); color: var(--ink); font-size: 15px; font-weight: 800; cursor: pointer; touch-action: manipulation; white-space: nowrap; }
.sound-toggle[aria-pressed="true"] { background: var(--mint-soft); }
.sound-toggle:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.sound-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sound-toggle[aria-pressed="false"] .sound-waves, .sound-toggle[aria-pressed="true"] .sound-mute { display: none; }
.has-game-sound .app-header.sound-empty-header { display: none; }
.has-game-sound .app-header { justify-content: flex-end; }
@media (max-width: 720px) {
  .has-game-sound .app-frame { min-height: calc(100dvh - 52px - env(safe-area-inset-top, 0px)); }
  .has-game-sound .notebook.jw-playing { padding-top: 4px; }
}
@media print {
  .sound-toolbar { display: none; }
  body.has-game-sound { margin-top: 0; }
}
