/* Dashboard only: stronger scoped selectors prevent legacy public-page rules from overriding player geometry. */
body.cy-dashboard .dash-layout { width: 100%; max-width: calc(var(--cy-page-max) + 2 * var(--cy-gutter)); padding: clamp(16px, 2vw, 24px) var(--cy-gutter); gap: clamp(14px, 2vw, 24px); margin-inline: auto; }
body.cy-dashboard .dash-sidebar { width: clamp(228px, 22vw, 260px); gap: 14px; min-width: 0; }
body.cy-dashboard .dash-main { min-width: 0; gap: clamp(12px, 2vw, 20px); }
body.cy-dashboard .glass-panel { padding: clamp(14px, 2vw, 20px); border-radius: var(--cy-radius); }
body.cy-dashboard .player-card { gap: clamp(14px, 2vw, 24px); }
body.cy-dashboard .player-art { width: clamp(190px, 24vw, 280px); min-height: 190px; aspect-ratio: 1; }
body.cy-dashboard .player-info { min-width: 0; }
body.cy-dashboard .player-info .track-title { font-size: clamp(1.15rem, 2vw, 1.55rem); }
body.cy-dashboard .controls-row { justify-content: center; }
body.cy-dashboard :is(.glass-panel, .player-card, .player-info, .search-bar-modern) { min-width: 0; }
body.cy-dashboard .search-bar-modern input { min-width: 0; max-width: 100%; }
body.cy-dashboard .ctrl-btn { width: 42px; height: 42px; flex-shrink: 0; }
body.cy-dashboard .progress-wrap { min-width: 0; }
body.cy-dashboard .progress-bar-track { min-width: 0; }
body.cy-dashboard .dash-layout :is(img, svg, video) { max-width: 100%; }
body.cy-dashboard :is(.playlist-card, .stat-card, .folder-card, .server-card) { min-width: 0; }
body.cy-dashboard #login-wall { width: min(100%, 900px); margin-inline: auto; }
body.cy-dashboard .login-wall-modern { padding: 48px var(--cy-gutter); }
@media (max-width: 1024px) {
  body.cy-dashboard .player-card { flex-direction: column; }
  body.cy-dashboard .player-art { width: min(100%, 300px); min-height: 0; max-height: none; margin-inline: auto; }
}
@media (max-width: 768px) {
  body.cy-dashboard .dash-layout { flex-direction: column; }
  body.cy-dashboard .dash-sidebar { width: 100%; }
  body.cy-dashboard .player-card { gap: 16px; }
  body.cy-dashboard .player-info .track-title { font-size: 1.2rem; }
  body.cy-dashboard .login-wall-modern { min-height: 54vh; padding: 32px var(--cy-gutter); }
}
@media (max-width: 480px) {
  body.cy-dashboard .glass-panel { padding: 14px; }
  body.cy-dashboard .controls-row { gap: 7px; }
  body.cy-dashboard .ctrl-btn { width: 40px; height: 40px; }
}

/* Authenticated workspace: the shared site header is position:fixed.
   Reserve its space inside #dash-app (not the unauthenticated login wall).
   Previously the first dashboard row started at y=24 while the header ended
   at y=80, hiding player tabs and covering the search box. */
body.cy-dashboard #dash-app.dash-layout {
  --cy-dashboard-width: 1480px;
  width: 100%;
  max-width: calc(var(--cy-dashboard-width) + 2 * var(--cy-gutter));
  padding-block-start: calc(var(--cy-header-height) + clamp(14px, 1.8vw, 26px));
  padding-block-end: clamp(24px, 3vw, 42px);
  min-height: 100dvh;
  align-items: flex-start;
}
/* Header and main workspace share the same horizontal origin. */
body.cy-dashboard header#header.cy-public-header .container {
  max-width: calc(1480px + 2 * var(--cy-gutter));
}
body.cy-dashboard #dash-app .dash-sidebar {
  flex: 0 0 clamp(230px, 20vw, 260px);
  width: clamp(230px, 20vw, 260px);
}
body.cy-dashboard #dash-app .dash-main { flex: 1 1 0; min-width: 0; }
body.cy-dashboard #dash-app .dash-tabs {
  max-width: 100%;
  flex-wrap: wrap;
}
body.cy-dashboard #dash-app .dash-tab { min-width: 0; }
body.cy-dashboard #dash-app .player-card { min-width: 0; }
body.cy-dashboard #dash-app .player-info { min-width: 0; }
@media (max-width: 1024px) {
  body.cy-dashboard #dash-app.dash-layout {
    padding-block-start: calc(var(--cy-header-height) + 16px);
  }
}
@media (max-width: 768px) {
  body.cy-dashboard #dash-app .dash-sidebar {
    width: 100%;
    flex: none;
  }
}

/* On very narrow phones, four variable-width tabs wrapped unpredictably. */
@media (max-width: 480px) {
  body.cy-dashboard #dash-app .dash-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 4px;
    padding: 5px;
  }
  body.cy-dashboard #dash-app .dash-tab {
    width: 100%;
    min-height: 40px;
    padding: 8px 6px;
    text-align: center;
  }
  body.cy-dashboard #dash-app .queue-panel {
    min-width: 0 !important; /* legacy inline min-width:300px */
    flex: 1 1 100% !important;
  }
  body.cy-dashboard #dash-app .queue-panel + .glass-panel {
    min-width: 0 !important; /* legacy inline min-width:240px */
    flex: 1 1 100% !important;
  }
}


/* Guild/voice chooser: always visible even if the user has not joined voice yet. */
body.cy-dashboard #guild-select { display:flex; flex-direction:column; gap:7px; min-width:0; }
body.cy-dashboard .guild-option { width:100%; min-width:0; text-align:left; color:var(--cy-text); font-family:inherit; }
body.cy-dashboard .guild-option:hover { color:var(--cy-text); }
body.cy-dashboard .guild-option.active { border-color:rgba(212,175,55,.48); background:rgba(212,175,55,.10); color:var(--cy-text); }
body.cy-dashboard .guild-option .guild-title { flex:1; min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:inherit; line-height:1.4; }
body.cy-dashboard .guild-option:focus-visible { outline:2px solid var(--cy-gold-bright); outline-offset:2px; }
/* Guild logo is layered over the initial fallback, never placed on a second grid row. */
body.cy-dashboard .guild-option .guild-icon { position:relative; display:flex; align-items:center; justify-content:center; flex:0 0 31px; width:31px; height:31px; background:rgba(212,175,55,.12); border:0; box-shadow:none; border-radius:9px; color:var(--cy-gold); font-weight:700; overflow:hidden; }
body.cy-dashboard .guild-option .guild-icon img { position:absolute; inset:0; display:block; width:100%; height:100%; object-fit:cover; border-radius:inherit; }
body.cy-dashboard .guild-hint { font-size:.77rem; line-height:1.55; color:var(--cy-muted); overflow-wrap:anywhere; margin:4px 0; }
body.cy-dashboard .guild-connect-status { font-size:.72rem; color:var(--cy-muted); margin-top:8px; line-height:1.45; overflow-wrap:anywhere; }
body.cy-dashboard .guild-connect-status.connected { color:#b4d8a4; }
body.cy-dashboard .guild-recheck { display:flex; align-items:center; justify-content:center; gap:8px; width:100%; margin-top:10px; border:1px solid var(--cy-line); border-radius:10px; min-height:35px; background:rgba(255,255,255,.035); color:var(--cy-text); font-size:.75rem; cursor:pointer; }
body.cy-dashboard .guild-recheck:hover { border-color:rgba(212,175,55,.44); }
body.cy-dashboard .guild-recheck:disabled { opacity:.6; cursor:wait; }
body.cy-dashboard .dash-notice { display:grid; grid-template-columns:22px 1fr 24px; align-items:start; gap:9px; background:rgba(23,20,18,.97); border:1px solid rgba(212,175,55,.36); color:var(--cy-text); padding:12px; border-radius:12px; margin-bottom:9px; max-width:390px; box-shadow:0 10px 30px rgba(0,0,0,.3); }
body.cy-dashboard .dash-notice.error { border-color:rgba(237,99,99,.55); }
body.cy-dashboard .dash-notice .dash-notice-body { min-width:0; font-size:.78rem; overflow-wrap:anywhere; line-height:1.5; }
body.cy-dashboard .dash-notice strong { display:block; margin-bottom:3px; font-size:.85rem; }
body.cy-dashboard .dash-notice-close { border:0; background:transparent; color:var(--cy-muted); cursor:pointer; font-size:1.1rem; }
body.cy-dashboard #search-results-modal .search-results-panel { width:min(92vw,620px); padding:clamp(14px,2vw,24px); margin:min(7vh,60px) auto; }
body.cy-dashboard #search-results-list { display:grid; gap:8px; }
body.cy-dashboard #search-results-list .search-result-item { display:flex; align-items:center; gap:12px; padding:12px; border-radius:10px; border:1px solid rgba(255,255,255,.07); background:rgba(255,255,255,.035); min-width:0; }
body.cy-dashboard #search-results-list .search-result-info { flex:1; min-width:0; }
body.cy-dashboard #search-results-list .search-result-title { font-weight:600; color:var(--cy-text); font-size:.86rem; white-space:nowrap; text-overflow:ellipsis; overflow:hidden; }
body.cy-dashboard #search-results-list .search-result-artist { color:var(--cy-muted); font-size:.75rem; }
body.cy-dashboard #search-results-list .search-result-actions { display:flex; gap:5px; flex-shrink:0; }
body.cy-dashboard #search-results-list .search-result-actions button { border:1px solid var(--cy-line); background:rgba(212,175,55,.08); color:var(--cy-gold); border-radius:9px; min-width:34px; min-height:34px; cursor:pointer; }
@media(max-width:480px){ body.cy-dashboard #search-results-list .search-result-item{gap:7px;padding:9px;} }
