* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Some TV WebViews focus the document/root surface itself after remote or
   mouse input and paint that focus as a bright border around the full screen.
   Root surfaces are not controls, so suppress only their outline; real
   buttons, links and fields keep their normal accessible focus indicators. */
html:focus, html:focus-visible,
body:focus, body:focus-visible,
#appContainer:focus, #appContainer:focus-visible,
main:focus, main:focus-visible {
  outline:none !important;
}

/* Profile-scoped typography preferences. The default values intentionally
   reproduce the existing design exactly. text-size-adjust changes glyph size
   without zooming the whole interface or changing responsive breakpoints. */
html[data-font-family="system"] body { font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif; }
html[data-font-family="rounded"] body { font-family:'Trebuchet MS','Arial Rounded MT Bold',Arial,sans-serif; }
html[data-font-family="accessible"] body { font-family:Verdana,Tahoma,'Segoe UI',sans-serif; letter-spacing:.01em; }
html[data-text-size="small"] { -webkit-text-size-adjust:90%; text-size-adjust:90%; font-size-adjust:.45; }
html[data-text-size="large"] { -webkit-text-size-adjust:112%; text-size-adjust:112%; font-size-adjust:.58; }
html[data-text-size="xlarge"] { -webkit-text-size-adjust:125%; text-size-adjust:125%; font-size-adjust:.66; }
html[data-text-weight="regular"] body { font-weight:400; }
html[data-text-weight="bold"] body { font-weight:550; }
html[data-text-weight="bold"] :is(button,input,select,textarea,.card-title,.song-row,.home-mix-name) { font-weight:650; }

/* ── Scrollbar ── */
/* Page scrolling stays native; only the browser-drawn scrollbar is hidden. */
* { scrollbar-width:none; }
::-webkit-scrollbar { width:0; height:0; }

.page-scroll-indicator {
  --page-scroll-thumb-height:32px;
  --page-scroll-thumb-y:0px;
  position:fixed;
  z-index:98;
  top:calc(var(--nav-height) + env(safe-area-inset-top, 0px) + 6px);
  right:3px;
  bottom:6px;
  width:4px;
  opacity:0;
  pointer-events:none;
  transition:opacity .22s ease;
}
.page-scroll-indicator.visible { opacity:.88; }
.page-scroll-indicator-thumb {
  position:absolute;
  top:0;
  right:0;
  width:100%;
  height:var(--page-scroll-thumb-height);
  border-radius:999px;
  background:color-mix(in srgb,var(--text-muted) 78%,transparent);
  box-shadow:0 0 0 1px color-mix(in srgb,var(--bg) 36%,transparent);
  transform:translate3d(0,var(--page-scroll-thumb-y),0);
  will-change:transform;
}
body.player-active .page-scroll-indicator { bottom:calc(var(--player-height) + 7px); }

/* Functional panels retain draggable native thumbs on desktop. */
:is(.settings-sidebar,.managed-profile-scroll,.queue-list,.jobs-list,
    .nav-search-menu,.fp-dj-body,.fp-player-side,.lyrics-lines,
    .video-candidates,.remote-devices-panel) {
  scrollbar-width:thin;
  scrollbar-color:var(--border-strong, var(--border)) transparent;
}
:is(.settings-sidebar,.managed-profile-scroll,.queue-list,.jobs-list,
    .nav-search-menu,.fp-dj-body,.fp-player-side,.lyrics-lines,
    .video-candidates,.remote-devices-panel)::-webkit-scrollbar { width:6px; height:6px; }
:is(.settings-sidebar,.managed-profile-scroll,.queue-list,.jobs-list,
    .nav-search-menu,.fp-dj-body,.fp-player-side,.lyrics-lines,
    .video-candidates,.remote-devices-panel)::-webkit-scrollbar-track { background:transparent; }
:is(.settings-sidebar,.managed-profile-scroll,.queue-list,.jobs-list,
    .nav-search-menu,.fp-dj-body,.fp-player-side,.lyrics-lines,
    .video-candidates,.remote-devices-panel)::-webkit-scrollbar-thumb {
  background:var(--border-strong, var(--border));
  border-radius:999px;
}

/* Device mode is authoritative on wide Android/TV displays; width and
   standalone mode cover mobile browsers and installed apps. */
html[data-device="mobile"] *,
html[data-device="tv"] * { scrollbar-width:none !important; }
html[data-device="mobile"] ::-webkit-scrollbar,
html[data-device="tv"] ::-webkit-scrollbar { width:0 !important; height:0 !important; display:none; }
html[data-device="mobile"] .page-scroll-indicator,
html[data-device="tv"] .page-scroll-indicator { display:none !important; }
@media (max-width:768px), (display-mode:standalone) {
  * { scrollbar-width:none !important; }
  ::-webkit-scrollbar { width:0 !important; height:0 !important; display:none; }
  .page-scroll-indicator { display:none !important; }
}

/* ── Main ── */
main { max-width: 1200px; margin: 0 auto; padding: 28px; }
/* Keep the final page controls scrollable above the fixed mini player. */
body.player-active main { padding-bottom: calc(28px + var(--player-height) + 20px); }

.page-title {
  font-size: 26px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 24px;
}

/* An <img> with no src used to be rendered as src="" — which the browser
   resolves to the page URL, fetches the HTML document, and then draws as a
   broken image. Artwork is now omitted rather than emptied, so this styles the
   srcless placeholder to look deliberate instead of missing. */
img:not([src]) {
  background: var(--bg-elevated);
  border: 0;
}
/* Persistent connection state. Playback is deliberately untouched: cached or
   downloaded audio continues beneath this status banner. */
.connection-banner {
  position:fixed;
  top:calc(env(safe-area-inset-top, 0px) + 12px);
  left:50%;
  z-index:2200;
  display:flex;
  align-items:center;
  gap:9px;
  max-width:min(620px, calc(100vw - 28px));
  padding:10px 16px;
  border:1px solid var(--border);
  border-radius:999px;
  background:color-mix(in srgb, var(--bg-elevated) 96%, transparent);
  color:var(--text);
  box-shadow:0 12px 36px rgba(0,0,0,.38);
  font-size:13px;
  font-weight:600;
  line-height:1.3;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform:translate(-50%, -14px);
  transition:opacity .22s ease, transform .22s ease, visibility .22s;
}
.connection-banner.visible { opacity:1;visibility:visible;transform:translate(-50%, 0); }
.connection-banner-dot { width:9px;height:9px;border-radius:50%;flex:0 0 9px;background:var(--error,#ef4444);box-shadow:0 0 0 4px color-mix(in srgb,var(--error,#ef4444) 18%,transparent); }
.connection-banner.is-local .connection-banner-dot { background:#f5a524;box-shadow:0 0 0 4px rgba(245,165,36,.18); }
.connection-banner.is-restored { border-color:color-mix(in srgb,var(--accent) 55%,var(--border)); }
.connection-banner.is-restored .connection-banner-dot { background:var(--accent);box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 18%,transparent); }
html[data-device="tv"] .connection-banner { top:24px;padding:14px 22px;font-size:18px;gap:13px; }
@media (max-width:768px) {
  .connection-banner { top:calc(env(safe-area-inset-top, 0px) + 8px);padding:9px 13px;border-radius:18px;font-size:12px; }
}
