/* A discreet, independent sound control; native dialogs remain above it. */
.soundscape {
  position: fixed;
  left: max(26px, env(safe-area-inset-left));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  color: #373b33;
  font-family: inherit;
}
.soundscape [hidden] { display: none !important; }
.soundscape button { -webkit-tap-highlight-color: transparent; cursor: pointer; font-family: inherit; }
.soundscape button:focus-visible { outline: 2px solid #7c795a; outline-offset: 4px; }
.soundscape-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 138px;
  min-height: 46px;
  padding: 12px 19px;
  border: 1px solid #a5a18b70;
  border-radius: 0;
  color: #414538;
  background: #f8f7f1f0;
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 15px #242c2712;
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: .15em;
  font-weight: 500;
  transition: background .3s, border-color .3s;
}
.soundscape-toggle:hover { background: #fffef8; border-color: #777d65; }
.soundscape-bars { display: flex; align-items: center; justify-content: center; gap: 3px; width: 23px; height: 18px; }
.soundscape-bars i { display: block; width: 1px; height: 3px; background: currentColor; transform-origin: center; }
.soundscape[data-state="playing"] .soundscape-bars i { height: 14px; animation: soundscape-wave 1.6s ease-in-out infinite alternate; }
.soundscape[data-state="playing"] .soundscape-bars i:nth-child(2) { animation-delay: -.7s; height: 10px; }
.soundscape[data-state="playing"] .soundscape-bars i:nth-child(3) { animation-delay: -.3s; height: 17px; }
.soundscape[data-state="playing"] .soundscape-bars i:nth-child(4) { animation-delay: -1.1s; height: 11px; }
.soundscape[data-state="playing"] .soundscape-bars i:nth-child(5) { animation-delay: -.5s; height: 7px; }
@keyframes soundscape-wave { from { transform: scaleY(.35); } to { transform: scaleY(1); } }
.soundscape-invitation {
  position: relative;
  width: min(345px, calc(100vw - 52px));
  max-height: calc(100svh - 135px);
  overflow: auto;
  padding: 29px 25px 19px;
  background: #f7f6effa;
  border: 1px solid #b1ae9770;
  box-shadow: 0 12px 45px #1c28251f;
}
.soundscape-close {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #787b6a;
  font-size: 26px;
  line-height: 1;
  font-weight: 300;
}
.soundscape-eyebrow { margin: 0 20px 16px 0; font-size: 8px; letter-spacing: .18em; line-height: 1.5; color: #7d7d68; }
.soundscape-invitation h2 { margin: 0 0 13px; font-size: 20px; font-weight: 400; line-height: 1.6; letter-spacing: -.025em; color: #404738; }
.soundscape-intro { margin: 0; font-size: 12px; font-weight: 400; line-height: 1.85; color: #747568; word-break: keep-all; }
.soundscape-choices { display: flex; flex-direction: column; align-items: stretch; gap: 4px; margin-top: 23px; }
.soundscape-choices button { min-height: 44px; padding: 11px 14px; border: 1px solid #696d59; font-size: 11px; line-height: 1.6; font-weight: 400; background: #676d58; color: #fffdf4; }
.soundscape-choices [data-sound-off] { background: transparent; border-color: transparent; color: #777967; }
.soundscape-choices [data-sound-on]:hover { background: #515a47; }
.soundscape-choices [data-sound-off]:hover { color: #333d2f; text-decoration: underline; text-underline-offset: 4px; }
.soundscape-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
body.modal-open .soundscape, body:has(#main-nav.open) .soundscape { visibility: hidden; pointer-events: none; }
@media (max-width: 600px) {
  .soundscape { left: max(14px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); gap: 9px; }
  .soundscape-toggle { min-width: 124px; min-height: 44px; gap: 10px; padding: 10px 15px; font-size: 8px; }
  .soundscape-invitation { width: min(310px, calc(100vw - 28px)); padding: 27px 21px 14px; max-height: calc(100svh - 115px); }
  .soundscape-invitation h2 { font-size: 19px; }
  .soundscape-choices { margin-top: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .soundscape *, .soundscape *::before, .soundscape *::after { animation: none !important; transition: none !important; }
  .soundscape[data-state="playing"] .soundscape-bars i { transform: none; }
}
@media print { .soundscape { display: none !important; } }
