/* v0.99: the same restrained green/gold family as music, FX and chat. */
#audio-hud{display:flex;align-items:center;gap:6px}
#audio-hud[hidden]{display:none}
/* Keep the viewport header free of a stacking context so only audio rises
   above dialogs. The page itself never scrolls; its geometry is unchanged. */
.topbar{position:absolute;z-index:auto}
.topbar>.brand,.header-actions>:not(#audio-hud){position:relative;z-index:400}
#audio-hud{position:relative;z-index:1100}
@media(max-width:850px){#audio-hud{position:fixed}}
/* The gear shares its button surface and interaction rules with music/FX. */
#audio-hud #audio-device-toggle{flex:0 0 auto;margin:0}
#audio-hud #audio-device-toggle svg{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
/* The fold control uses the bar's existing spacing, keeping the sliders and surface size. */
#audio-hud #audio-controls{column-gap:0;padding-inline-end:0}
#audio-hud #audio-fold{flex:0 0 24px;width:24px;height:28px;padding:4px;border-inline-start:1px solid #ceb9812b;border-radius:0 5px 5px 0}
#audio-hud #audio-unfold{justify-content:center;gap:6px;padding-inline:8px;color:#e5d3a7;touch-action:manipulation}
#audio-hud #audio-unfold:hover{filter:brightness(1.12)}
#audio-hud #audio-unfold:focus-visible{outline:2px solid #e3c98a;outline-offset:1px}
#audio-hud :is(#audio-fold,#audio-unfold) svg{display:block;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:650px){
  #audio-hud #audio-controls{padding-inline-start:2px}
  #audio-hud .audio-channel{column-gap:1px}
  #audio-hud #audio-fold{flex-basis:20px;width:20px;height:27px;padding:2px}
}
#audio-device-panel{position:fixed;z-index:1100!important;box-sizing:border-box;width:310px;max-width:calc(100vw - 20px);max-height:calc(100dvh - 20px);overflow-y:auto;overscroll-behavior:contain;left:10px;top:108px;border:1px solid var(--ui-border);border-radius:9px;background:var(--ui-green);box-shadow:0 10px 28px #071c2538;color:var(--ui-cream);font:500 12px/1.5 var(--ui-copy);letter-spacing:.02em;text-transform:uppercase;pointer-events:auto}
#audio-device-panel[hidden]{display:none}
#audio-device-panel *{box-sizing:border-box}
#audio-device-panel .audio-device-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:37px;margin:0;padding:5px 7px 5px 13px;border-bottom:1px solid var(--ui-border);font:600 11px/1.4 var(--ui-copy);letter-spacing:.1em;color:var(--ui-gold);touch-action:none}
#audio-device-panel .audio-device-heading>span{flex:1}
#audio-device-panel .audio-device-grip{width:16px;height:16px;fill:none;stroke:var(--ui-gold);stroke-width:1.4;stroke-linecap:round;opacity:.5}
#audio-device-panel #audio-device-close{display:grid;place-items:center;flex:0 0 26px;width:26px;height:26px;min-width:0;min-height:0;padding:0;border:0;border-radius:5px;background:transparent;color:var(--ui-gold);font:22px/1 var(--ui-copy)}
#audio-device-panel #audio-device-close:hover{background:#d5c99014}
#audio-device-panel .audio-device-body{display:grid;gap:13px;padding:13px}
#audio-device-panel .audio-device-field{display:grid;gap:6px;min-width:0}
#audio-device-panel label{display:flex;align-items:center;gap:7px;margin:0;color:var(--ui-gold);font:600 11px/1.4 var(--ui-copy);letter-spacing:.075em}
#audio-device-panel label svg,#audio-device-panel .audio-device-test svg{display:block;width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
#audio-device-panel select{display:block;width:100%;min-width:0;height:36px;padding:7px 9px;border:1px solid #81956966;border-radius:5px;background:var(--ui-deep);color:var(--ui-cream);font:500 11px/1.4 var(--ui-copy);letter-spacing:.02em;text-transform:uppercase;text-overflow:ellipsis;color-scheme:dark;touch-action:manipulation}
#audio-device-panel option{text-transform:uppercase}
#audio-device-panel .audio-device-note{margin:0;color:var(--ui-muted);font:500 10px/1.5 var(--ui-copy);letter-spacing:.05em}
#audio-device-panel button{cursor:pointer;touch-action:manipulation;text-transform:uppercase}
#audio-device-panel .audio-device-test{display:flex;align-items:center;justify-content:flex-start;gap:7px;min-height:30px;padding:3px 0;border:0;background:transparent;color:var(--ui-gold);font:600 11px/1.4 var(--ui-copy);letter-spacing:.035em}
#audio-device-panel .audio-device-permission{width:100%;min-height:32px;padding:7px 8px;border:1px solid var(--ui-border);border-radius:5px;background:var(--ui-deep);color:var(--ui-cream);font:500 10px/1.5 var(--ui-copy);letter-spacing:.025em}
#audio-device-panel .audio-device-status{margin:0;color:var(--ui-muted);font:500 11px/1.5 var(--ui-copy);overflow-wrap:anywhere}
#audio-device-panel :is([hidden],.audio-device-status:empty,.panel-resize-handle){display:none!important}
#audio-device-panel :is(button,select):focus-visible{outline:2px solid var(--ui-gold);outline-offset:3px}
#audio-device-panel :is(button,select):disabled{opacity:.5;cursor:default}
@media(pointer:coarse){#audio-device-panel select{height:44px;font-size:16px}#audio-device-panel :is(.audio-device-test,.audio-device-permission){min-height:44px}#audio-device-panel #audio-device-close{width:38px;height:38px;flex-basis:38px}#audio-device-panel .audio-device-heading{padding-top:3px;padding-bottom:3px}}
