/* Aero materials on the existing Média interface.
   Component rules below change paint only: original layout, spacing, typography,
   radii, borders' widths and playback controls remain owned by their stylesheets.
   The ambient light sits on its own layer behind the app. */
:root[data-glass=true] body.authenticated {
  --aero-base:#f5f5f7;
  --aero-chrome:#f8f8fac9;
  --aero-panel:#ffffffa3;
  --aero-field:#ffffff69;
  --aero-solid:#fafafa;
  --aero-shade:#f5f5f7;
}
:root[data-glass=true][data-theme=dark] body.authenticated {
  --aero-base:#171719;
  --aero-chrome:#1e1e21ab;
  --aero-panel:#232326a3;
  --aero-field:#2c2c3069;
  --aero-solid:#1e1e21;
  --aero-shade:#101012;
}
/* The backdrop stays behind the app without changing its fixed descendants. */
:root[data-glass=true] #media-aero-light {
  position:fixed;inset:0;z-index:0;overflow:hidden;pointer-events:none;
  background:linear-gradient(110deg,var(--aero-base,#171719),var(--aero-shade,#101012));
}
:root[data-glass=true] #media-aero-light > canvas {position:absolute;inset:0;width:100%;height:100%;}
:root[data-glass=true] body:not(.authenticated) #media-aero-light {display:none;}
:root[data-glass=true] body.authenticated > #app {position:relative;z-index:1;}
/* Full-page workspaces must let the one backdrop remain visible. No video,
   artwork, Cover Flow, caption plane or fullscreen-player selector is included. */
:root[data-glass=true] body.authenticated #main-view :is(.youtube-page,.torrent-tools,.iptv-page) {background-color:transparent;background-image:none;}
/* Keep fine catalogue labels readable even over the brightest dark-mode reflection. */
:root[data-glass=true][data-theme=dark] body.authenticated #main-view.online-catalog-view .content-area {
  background-color:rgb(23 23 25 / .87);
}
/* Large materials: one group is translucent instead of blurring every item. */
:root[data-glass=true] body.authenticated :is(.sidebar,.topbar,.mobile-bottom-nav,.iptv-page .app-header,.torrent-header,.torrent-sidebar) {background-color:var(--aero-chrome);-webkit-backdrop-filter:none;backdrop-filter:none;}
:root[data-glass=true] body.authenticated #main-view :is(.settings-panel,.account-card,.managed-account,.account-form,.collection-card,.playlist-card,.video-category-card,.video-category-admin-card,.video-episode-card,.music-detail-hero,.video-series-hero,.youtube-home-entry,.torrent-result,.torrent-explainer,.torrent-transfer-notice:not(:empty),.torrent-transmission-view,.file-manager .fm-workspace,.file-manager .fm-sidebar) {background-color:var(--aero-panel);}
/* File-manager variables are local to its interface, never to the media viewer. */
:root[data-glass=true] body.authenticated .file-manager {--fm-bg:#ffffffa3;--fm-raised:#faf8faa3;}
:root[data-glass=true][data-theme=dark] body.authenticated .file-manager {--fm-bg:#171c27a3;--fm-raised:#1d2431a3;}
/* Popovers and native dialogs retain their original size, radius and placement.
   Native select popup windows keep an opaque accessible platform fallback. */
:root[data-glass=true] body.authenticated :is(.torrent-confirm-dialog,.external-video-dialog,.music-collection-dialog,.confirm-dialog,.account-source-dialog,.music-track-menu,.youtube-destination-dialog,.file-manager .fm-dialog,.iptv-page #settings-dialog,.iptv-page #choice-dialog) {background-color:var(--aero-chrome);-webkit-backdrop-filter:none;backdrop-filter:none;}
/* Preserve select chevron background images and the OS-native controls. */
:root[data-glass=true] body.authenticated #main-view :is(select,textarea,input:not([type=range]):not([type=checkbox]):not([type=radio]):not([type=file]):not(.search-box input):not(.search-bar input),.search-box,.iptv-page .search-bar,.button-outline),
:root[data-glass=true] body.authenticated :is(.torrent-confirm-dialog,.account-source-dialog,.external-video-dialog,.file-manager .fm-dialog,.iptv-page #settings-dialog,.iptv-page #choice-dialog) :is(select,textarea,input:not([type=range]):not([type=checkbox]):not([type=radio]):not([type=file]):not(.search-box input):not(.search-bar input)) {background-color:var(--aero-field);}
:root[data-glass=true] body.authenticated #main-view .search-box input {background-color:transparent;background-image:none;}
:root[data-glass=true] body.authenticated #main-view select option {background-color:var(--aero-solid);color:var(--ink);}
/* Original gradients, with alpha added to their original color stops only. */
:root[data-glass=true] body.authenticated #main-view .music-detail-hero {background-color:transparent;background-image:radial-gradient(ellipse at 78% 4%,#efe3f4b8 0,transparent 43%),linear-gradient(125deg,#f8f4f8b8,#f1f0f7b8 62%,#f8f1efb8);}
:root[data-glass=true] body.authenticated #main-view .video-series-hero {background-color:transparent;background-image:linear-gradient(125deg,#f8f3f8b8,#f1eff7b8 65%,#f8f1eeb8);}
:root[data-glass=true] body.authenticated #main-view .video-category-card {background-color:transparent;background-image:linear-gradient(125deg,#f8f3f8b8,#f4f1f7b8);}
:root[data-glass=true] body.authenticated #main-view .youtube-home-entry {background-color:transparent;background-image:linear-gradient(110deg,#fff8fab8,#f7f5fab8);}
:root[data-glass=true][data-theme=dark] body.authenticated #main-view :is(.music-detail-hero,.video-series-hero) {background-color:transparent;background-image:linear-gradient(125deg,#2d2730b8,#24242bb8 65%,#30262bb8);}
:root[data-glass=true][data-theme=dark] body.authenticated #main-view .video-category-card {background-color:var(--aero-panel);background-image:none;}
:root[data-glass=true][data-theme=dark] body.authenticated #main-view .youtube-home-entry {background-color:transparent;background-image:linear-gradient(110deg,#34272fb8,#27262eb8);}
/* Mini-players retain their original colors and controls, with background alpha. */
:root[data-glass=true] body.authenticated :is(.mini-player,.youtube-mini-player) {background-color:#292e39b3;-webkit-backdrop-filter:none;backdrop-filter:none;}
/* Only capable devices blur the few foreground groups. No per-card blur. */
@supports ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
  :root[data-glass=true][data-aero-quality=full] body.authenticated :is(.topbar,.mobile-bottom-nav,.iptv-page .app-header,.torrent-header,.torrent-confirm-dialog,.external-video-dialog,.music-collection-dialog,.confirm-dialog,.account-source-dialog,.music-track-menu,.youtube-destination-dialog,.file-manager .fm-dialog,.iptv-page #settings-dialog,.iptv-page #choice-dialog) {-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);}
}
/* Denser mobile navigation keeps covers behind it from competing with labels.
   Retain the original palette, geometry and existing blur capability limits. */
@media (max-width:760px) {
  :root[data-glass=true][data-theme] body.authenticated .mobile-bottom-nav {background-color:var(--aero-mobile-chrome,#f8f8faf2);}
  :root[data-glass=true][data-theme=dark] body.authenticated .mobile-bottom-nav {--aero-mobile-chrome:#1e1e21f2;}
}
@media (prefers-reduced-transparency:reduce),(prefers-contrast:more) {
  :root[data-glass=true] body.authenticated .file-manager {--fm-bg:#fff;--fm-raised:#faf8fa;}
  :root[data-glass=true][data-theme=dark] body.authenticated .file-manager {--fm-bg:#171c27;--fm-raised:#1d2431;}
  :root[data-glass=true][data-theme] body.authenticated #main-view :is(.music-detail-hero,.video-series-hero,.video-category-card,.youtube-home-entry) {background-color:var(--aero-solid);background-image:none;}
  :root[data-glass=true][data-theme] body.authenticated {--aero-chrome:var(--aero-solid);--aero-panel:var(--aero-solid);--aero-field:var(--aero-solid);}
  :root[data-glass=true][data-theme] body.authenticated .mobile-bottom-nav {--aero-mobile-chrome:var(--aero-solid);}
  :root[data-glass=true] body.authenticated :is(.sidebar,.topbar,.mobile-bottom-nav,.iptv-page .app-header,.torrent-header,.torrent-confirm-dialog,.external-video-dialog,.music-collection-dialog,.confirm-dialog,.account-source-dialog,.music-track-menu,.youtube-destination-dialog,.file-manager .fm-dialog,.iptv-page #settings-dialog,.iptv-page #choice-dialog,.mini-player,.youtube-mini-player) {-webkit-backdrop-filter:none!important;backdrop-filter:none!important;}
}
