/* Untinted glass: all colour comes from the scene behind the controls. */
:root {
  --glass: rgba(255, 255, 255, .025);
  --glass-shadow: 0 6px 24px #0000001f, inset 0 1px #ffffff3b, inset 0 -1px #ffffff14;
  --clear-dock: linear-gradient(125deg, #ffffff0d, #ffffff00 48%, #ffffff05), #0000000a;
  --clear-sheet: linear-gradient(135deg, #ffffff08, transparent 58%), rgba(24, 24, 24, .14);
  --clear-blur: blur(8px);
  --clear-field: #00000040;
  --clear-text-shadow: 0 1px 2px rgba(0, 0, 0, .32);
}

html[data-scene] .sound-player {
  background: var(--clear-dock);
  border-color: #ffffff47;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  text-shadow: var(--clear-text-shadow);
}
html[data-scene] .account-header .account-header-profile,
html[data-scene] .circle-button {
  background: var(--clear-dock);
  box-shadow: var(--glass-shadow);
  border-color: #ffffff47;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
html[data-scene] .account-header .account-header-profile:hover { background-color: #ffffff14; }
html[data-scene] .player-tools button[aria-expanded=true] {
  background: #ffffff1c;
  border-color: #ffffff4a;
}
html[data-scene] .player-tools button[aria-expanded=true]::after { background: #fff; }

/* A single soft edge keeps type crisp; no wide halo or stacked shadows. */
html[data-scene] :is(.player-tools button, .sound-presets button, .circle-button, .weather-forecast-action, .scene-caption, #focus-intention) {
  text-shadow: var(--clear-text-shadow);
}
html[data-scene] :is(.audio-orb, .player-tools, .player-volume) svg {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .2));
}

/* Clear sheet; readability lives on the text and individual controls. */
html[data-scene] :is(.panel, .postcard-dialog, .panel.workspace-window, #signin-dialog, #membership-dialog, .dock-more) {
  background: var(--clear-sheet);
  backdrop-filter: var(--clear-blur);
  -webkit-backdrop-filter: var(--clear-blur);
  border-color: var(--clear-sheet-border, #ffffff47);
  box-shadow: var(--clear-sheet-shadow, 0 18px 58px #0000002e, inset 0 1px #ffffff59, inset 0 -1px #ffffff1f);
  text-shadow: var(--clear-text-shadow);
  color: #fafafa;
}
/* Keep the Forest's refracted rim and a light diffusion through its centre. */
html[data-scene] :is(.panel, .postcard-dialog).glass-optics {
  backdrop-filter: var(--clear-blur) !important;
  -webkit-backdrop-filter: var(--clear-blur) !important;
}
html[data-scene] .panel.workspace-window.window-active {
  --clear-sheet-border: #ffffff66;
  --clear-sheet-shadow: 0 18px 58px #00000038, inset 0 1px #ffffff70, inset 0 -1px #ffffff24;
}
/* Floating board menus use the same untinted sheet, with finer diffusion. */
html[data-scene] :is(.board-menu, .spaces-item-actions) {
  background: var(--clear-sheet);
  border: 1px solid #ffffff59;
  box-shadow: 0 8px 24px #0000001f, inset 0 1px #ffffff59, inset 0 -1px #ffffff1f;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  text-shadow: var(--clear-text-shadow);
}
html[data-scene] :is(.board-menu, .spaces-item-actions) button {
  font-weight: 500;
  text-shadow: var(--clear-text-shadow);
}
html[data-scene] :is(.board-menu, .spaces-item-actions)[popover] { position: fixed; inset: auto; margin: 0; }
html[data-scene] :is(.board-menu, .spaces-item-actions)[popover]:not(:popover-open) { display: none; }
html[data-scene] :is(.board-menu, .spaces-item-actions)::backdrop { background: transparent; }
html[data-scene] :is(.panel, .postcard-dialog, :is(#mixer-dialog,:is(#now-dialog,#view-dialog))) .panel-head {
  background: linear-gradient(#ffffff08, #ffffff02);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
html[data-scene] :is(#dock-tooltip, #toast, #error) {
  background: #242424d9;
  border-color: #ffffff35;
  text-shadow: 0 1px 3px #00000040;
}

html[data-scene] :is(.sound-presets, .brb-timer-tabs, .notebook-tabs) { background: #00000014; }
html[data-scene] .panel :is(textarea, input[type=text], input[type=email], input[type=number], select) {
  background: var(--clear-field);
  color: #fff;
  border-color: #ffffff40;
  text-shadow: var(--clear-text-shadow);
}
html[data-scene] .panel :is(input, textarea)::placeholder { color: #d4d4d4; }
html[data-scene] :is(.brb-focus-start, .account-panel .account-primary, .notebook-tabs button[aria-selected=true]) {
  background: #f3f3f3 !important;
  color: #292929 !important;
  text-shadow: none;
}
html[data-scene] :is(.brb-focus-start, .account-panel .account-primary):hover { background: #fff !important; }
html[data-scene] .space-card[aria-current] { background: #ffffff0d; border-color: #ffffff99; }
html[data-scene] .account-preview-note { background: #ffffff08; border-color: #ffffff25; }
html[data-scene] .account-plan-plus { background: linear-gradient(140deg, #ffffff0f, #ffffff02); }
html[data-scene] .account-plan-plus .account-plan-button { background: #ffffff12; }

/* Small copy needs extra contrast when the glass passes over a white peak. */
html[data-scene] :is(.panel, .dock-more) :is(p, small, .panel-intro, .fine-print, .account-subtle, .account-description, .dock-more-heading) {
  color: #f5f5f5;
}
html[data-scene] .links-panel .links-status-error { color: #f0d6c8; }

/* Mixer controls have their own higher-specificity contrast rules. */
html[data-scene] :is(#mixer-dialog,:is(#now-dialog,#view-dialog)) { --mix-text: #f8f8f8; --mix-shadow: var(--clear-text-shadow); }
html[data-scene] :is(#mixer-dialog,:is(#now-dialog,#view-dialog)) h2 { text-shadow: var(--clear-text-shadow); }
html[data-scene] :is(#mixer-dialog,:is(#now-dialog,#view-dialog)) .mix-channel {
  background: linear-gradient(180deg, #00000026, #0000000a);
  border-color: #ffffff24;
}
html[data-scene] :is(#mixer-dialog,:is(#now-dialog,#view-dialog)) :is(details, .outline-button, .close) { background-color: #00000014; }
html[data-scene] :is(#mixer-dialog,:is(#now-dialog,#view-dialog)) :is(#saved-mixes, #mix-name) { background: var(--clear-field); text-shadow: var(--clear-text-shadow); }
html[data-scene] :is(#mixer-dialog,:is(#now-dialog,#view-dialog)) .mix-channel:focus-within { border-color: #ffffff99; box-shadow: inset 0 1px #ffffff26, 0 0 0 1px #ffffff30; }
html[data-scene] :is(#mixer-dialog,:is(#now-dialog,#view-dialog)) .channel-name svg { stroke: #f2f2f2; }
html[data-scene] :is(#mixer-dialog,:is(#now-dialog,#view-dialog)) .mixer-sliders input[type=range]::-webkit-slider-runnable-track {
  background: linear-gradient(to right, #f5f5f5 0%, #dedede var(--range-progress,0%), #ffffff33 var(--range-progress,0%), #ffffff33 100%);
  box-shadow: inset 0 1px #ffffff1a, 0 1px 2px #00000040;
}
html[data-scene] :is(#mixer-dialog,:is(#now-dialog,#view-dialog)) .mixer-sliders input[type=range]::-moz-range-track {
  background: linear-gradient(to right, #f5f5f5 0%, #dedede var(--range-progress,0%), #ffffff33 var(--range-progress,0%), #ffffff33 100%);
  box-shadow: inset 0 1px #ffffff1a, 0 1px 2px #00000040;
}
html[data-scene] :is(#mixer-dialog,:is(#now-dialog,#view-dialog)) .mixer-sliders input[type=range]::-webkit-slider-thumb {
  background: linear-gradient(145deg, #fff, #ededed);
  border-color: #29292980;
  box-shadow: inset 0 1px #fff, 0 1px 3px #0000004d;
}
html[data-scene] :is(#mixer-dialog,:is(#now-dialog,#view-dialog)) .mixer-sliders input[type=range]::-moz-range-thumb {
  background: linear-gradient(145deg, #fff, #ededed);
  border-color: #29292980;
  box-shadow: inset 0 1px #fff, 0 1px 3px #0000004d;
}

@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
  :root { --clear-dock: #292929cc; --clear-sheet: #292929f2; }
  html[data-scene] :is(.panel, .postcard-dialog, :is(#mixer-dialog,:is(#now-dialog,#view-dialog))) .panel-head { background: #292929; }
}
@media(prefers-reduced-transparency:reduce) {
  html[data-scene] :is(.sound-player, .panel, .postcard-dialog, .panel.workspace-window, #signin-dialog, #membership-dialog, .dock-more, .circle-button, .account-header .account-header-profile, .board-menu, .spaces-item-actions) {
    background: #292929 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  html[data-scene] :is(.panel, .postcard-dialog, :is(#mixer-dialog,:is(#now-dialog,#view-dialog))) .panel-head { background: #292929; backdrop-filter: none; -webkit-backdrop-filter: none; }
  html[data-scene] .glass-optic { display: none; }
  html[data-scene] .audio-orb { background: #484848; }
}
