/* singbad: karaoke player styles.
   Conservative CSS for older Android WebViews. No backdrop-filter (too costly on mobile GPUs);
   nothing animates behind the lyrics. Touch targets >= 48px, mostly 56px. No hover-only UI. */

/* ---------------------------------------------------------- self-hosted fonts (variable weight) */
@font-face {
  font-family: "Noto Sans"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/noto-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Noto Sans"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/noto-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Noto Sans Devanagari"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/noto-sans-devanagari-devanagari-wght-normal.woff2") format("woff2");
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF;
}
@font-face {
  font-family: "Noto Sans Telugu"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/noto-sans-telugu-telugu-wght-normal.woff2") format("woff2");
  unicode-range: U+0C00-0C7F, U+200C-200D, U+25CC;
}

:root {
  --bg: #090B10;
  --bg-2: #111625;
  --panel: #121826;
  --panel-2: #1A2234;
  --panel-3: #222C42;
  --hair: rgba(255, 255, 255, 0.09);
  --text: #F4F6FB;
  --muted: #9AA4B8;
  --accent: #FF4F9A;
  --accent-2: #FFB547;
  --sung: #FFCD3C;
  --vocal: #38BDF8;
  --ok: #4FE3C8;
  --grad: linear-gradient(120deg, #FF4F9A, #FF8A5C 55%, #FFB547);
  --font: "Noto Sans", "Noto Sans Devanagari", "Noto Sans Telugu", system-ui, -apple-system, "Segoe UI", Roboto,
    "Nirmala UI", "Mangal", "Gautami", sans-serif;
  --radius: 18px;
  --dw: clamp(340px, 40vw, 560px);   /* drawer width */
  --strip-w: 112px;                   /* collapsed queue strip */
  color-scheme: dark;
}

[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; }
[data-icon] { display: inline-flex; line-height: 0; }

/* ---------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; min-width: 56px; padding: 0 20px;
  border: 0; border-radius: 999px;
  background: var(--panel-3); color: var(--text);
  font-size: 18px; font-weight: 700; white-space: nowrap;
  transition: background-color 0.15s, transform 0.1s, opacity 0.2s;
}
.btn svg { width: 26px; height: 26px; flex: none; }
.btn:active { transform: scale(0.95); }
.btn:disabled { opacity: 0.3; pointer-events: none; }
.btn.round { padding: 0; width: 56px; }
.btn.big { width: 80px; height: 80px; }
.btn.big svg { width: 36px; height: 36px; }
.btn.primary { background: var(--grad); color: #1B0A14; }
.btn.ghost { background: transparent; border: 2px solid rgba(255, 255, 255, 0.16); }
.btn.wide { width: 100%; }
.count {
  min-width: 28px; height: 28px; padding: 0 8px; border-radius: 14px;
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn.primary .count { background: #1B0A14; color: #fff; }
.spacer { flex: 1; }

/* ---------------------------------------------------------- home */
#library {
  min-height: 100vh; padding-bottom: 48px;
  background: radial-gradient(1200px 700px at 50% -20%, var(--bg-2), var(--bg) 70%) fixed, var(--bg);
}
.lib-head {
  display: flex; align-items: center; gap: 14px;
  padding: max(14px, env(safe-area-inset-top)) max(16px, 3vw) 6px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.head-actions { display: flex; gap: 10px; margin-left: auto; }

/* ---------------------------------------------------------- song browser (shared) */
.sb { display: flex; flex-direction: column; min-height: 0; }
.sb-top { display: flex; flex-direction: column; gap: 12px; padding: 10px 0 12px; }
.sb-grid .sb-top {
  position: sticky; top: 0; z-index: 5;
  padding: 10px max(16px, 3vw) 14px; background: var(--bg);
  border-bottom: 1px solid var(--hair);
}
.search {
  display: flex; align-items: center; gap: 10px;
  min-height: 64px; padding: 0 6px 0 20px; border-radius: 999px;
  background: var(--panel-2); border: 2px solid transparent;
}
.search:focus-within { border-color: rgba(255, 181, 71, 0.75); }
.search-ico svg { width: 26px; height: 26px; color: var(--muted); display: block; }
.search input { flex: 1; min-width: 0; height: 60px; border: 0; background: transparent; font-size: 22px; }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear {
  flex: none; width: 52px; height: 52px; border-radius: 50%; border: 0;
  background: var(--panel-3); display: flex; align-items: center; justify-content: center;
}
.search .clear svg { width: 26px; height: 26px; }
.chips {
  display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 52px; padding: 0 20px; border-radius: 999px;
  border: 2px solid var(--hair); background: var(--panel);
  font-size: 18px; font-weight: 700; color: var(--muted); white-space: nowrap;
}
.chip .native { margin-left: 6px; opacity: 0.75; font-weight: 600; }
.chip.on { background: var(--text); color: #0E1320; border-color: var(--text); }
.sb-count { font-size: 15px; color: var(--muted); padding: 0 2px 8px; }
.sb-grid .sb-count { padding: 14px max(16px, 3vw) 0; }
.sb-msg { padding: 60px 24px; text-align: center; font-size: 22px; color: var(--muted); }
.sb-msg .btn { margin-top: 20px; }

/* grid cards (home) */
.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  padding: 12px max(16px, 3vw);
}
.card {
  display: flex; flex-direction: column;
  background: var(--panel); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--hair);
}
.card.playing { border-color: var(--accent-2); }
.thumb { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #24306B, #6B2A5A); overflow: hidden; cursor: pointer; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 60px; font-weight: 800; color: rgba(255, 255, 255, 0.8); }
.tag {
  position: absolute; z-index: 1; padding: 5px 12px; border-radius: 999px;
  font-size: 15px; font-weight: 800; background: rgba(0, 0, 0, 0.72); color: #fff;
}
.tag.lang { top: 10px; left: 10px; }
.tag.lang.hi { background: rgba(234, 110, 50, 0.95); }
.tag.lang.te { background: rgba(32, 150, 132, 0.95); }
.tag.dur { bottom: 10px; right: 10px; font-variant-numeric: tabular-nums; }
.tag.nolyr { bottom: 10px; left: 10px; color: var(--accent-2); }
.tag.now { top: 10px; right: 10px; background: var(--accent-2); color: #1B0A14; display: none; }
.playing .tag.now { display: block; }
.card .info { padding: 14px 16px 10px; flex: 1; min-width: 0; }
.title { font-size: 21px; font-weight: 800; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta, .people { margin-top: 3px; font-size: 16px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; gap: 10px; }
.card .actions { padding: 0 14px 14px; }
.actions .btn { flex: 1; padding: 0 12px; font-size: 17px; }
.actions .btn svg { width: 22px; height: 22px; }
.playing .actions .sing { display: none; }
.q-add.queued { background: rgba(79, 227, 200, 0.16); color: var(--ok); }

/* compact rows (drawer) */
.rows { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; flex: 1; min-height: 0; padding-bottom: 16px; -webkit-overflow-scrolling: touch; }
.row {
  display: grid; grid-template-columns: 104px 1fr; grid-template-areas: "thumb txt" "thumb actions";
  gap: 8px 12px; padding: 10px; border-radius: 14px; background: var(--panel-2); border: 1px solid transparent;
}
.row.playing { border-color: var(--accent-2); }
.row .thumb { grid-area: thumb; border-radius: 10px; align-self: start; cursor: default; }
.row .thumb .ph { font-size: 28px; }
.row .tag.now { top: auto; bottom: 4px; right: 4px; left: 4px; padding: 2px 6px; font-size: 12px; text-align: center; }
.row .txt { grid-area: txt; min-width: 0; }
.row .title { font-size: 19px; -webkit-line-clamp: 1; }
.row .meta { font-size: 14px; }
.row .actions { grid-area: actions; }
.row .actions .btn { min-height: 52px; font-size: 16px; }

/* ---------------------------------------------------------- player (stage area) */
#player { position: fixed; top: 0; bottom: 0; left: 0; right: 0; background: #05060A; overflow: hidden; touch-action: manipulation; }
body.docked[data-drawer="open"] #player { right: var(--dw); }
body.docked[data-drawer="strip"] #player { right: var(--strip-w); }
#stageWrap { position: absolute; inset: 0; overflow: hidden; }
#stage {
  position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px;
  transform-origin: center center; overflow: hidden;
  display: flex; flex-direction: column; padding: 54px 5.5% 44px;
}
#player.idle { cursor: none; }

/* deep midnight backdrop, static */
.bg { position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 55% 35% at 50% 102%, rgba(255, 79, 154, 0.10), transparent 70%),
    radial-gradient(ellipse 45% 30% at 50% -4%, rgba(56, 189, 248, 0.07), transparent 70%),
    radial-gradient(ellipse 85% 70% at 50% 48%, #111625 0%, #090B10 75%);
}
.st-head, .st-main, .st-progress { position: relative; z-index: 1; }
.st-head { flex: none; display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; }
.st-meta { min-width: 0; }
.st-title { font-size: 40px; font-weight: 800; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-artist { font-size: 28px; color: var(--muted); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; flex: none; max-width: 50%; }
.st-badges .badge { padding: 8px 20px; border-radius: 999px; font-size: 26px; font-weight: 700; background: rgba(255, 255, 255, 0.08); border: 2px solid rgba(255, 255, 255, 0.14); }
.st-main { flex: 1; min-height: 0; }

/* countdown */
.countdown { position: absolute; left: 0; right: 0; top: 10px; height: 250px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.cd-label { font-size: 30px; font-weight: 800; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent-2); }
.cd-num { font-size: 120px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown.final .cd-num { color: var(--sung); }
.cd-dots { display: none; gap: 30px; }
.countdown.final .cd-dots { display: flex; }
.cd-dots i { width: 34px; height: 34px; border-radius: 50%; border: 5px solid rgba(255, 255, 255, 0.25); }
.cd-dots i.on { background: var(--sung); border-color: var(--sung); }
.countdown.final .cd-bar { display: none; }
.cd-bar { width: 620px; max-width: 80%; height: 12px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.cd-bar i { display: block; height: 100%; background: var(--grad); transform-origin: left center; transform: scaleX(0); }

/* lyrics */
.lyrics { position: absolute; left: 0; right: 0; top: 270px; bottom: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.slot { width: 100%; }
.l-main, .l-sub { width: 100%; line-height: 1.42; overflow-wrap: break-word; }
.slot.cur .l-main { font-weight: 800; }
.slot.cur .l-sub { font-weight: 650; margin-top: 6px; --base: rgba(235, 240, 255, 0.82); }
.slot.cur { transition: opacity 0.35s; }
.slot.cur.upcoming { opacity: 0.55; }
.slot.cur .w {
  display: inline-block;
  /* padding so tall matras / deep Telugu vowel signs stay inside the clipped background */
  padding: 0.3em 0.08em; margin: -0.3em -0.08em;
  background-image: linear-gradient(90deg,
    var(--sung) calc(var(--p, 0) * (100% + 20px) - 20px),
    var(--base, #fff) calc(var(--p, 0) * (100% + 20px)));
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.slot.next { margin-top: 40px; color: rgba(220, 228, 245, 0.5); font-weight: 650; }
.slot.next .l-sub { margin-top: 2px; opacity: 0.85; }
.slot.enter { animation: rise 0.3s cubic-bezier(0.2, 0.75, 0.25, 1); }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 36px, 0); } }
/* duet part pill (only when a line has "part") */
.part {
  display: inline-block; vertical-align: 0.25em; margin-right: 0.2em;
  padding: 0.12em 0.45em; border-radius: 999px;
  font: 800 0.34em/1.2 var(--font); letter-spacing: 0.08em; color: #0B0F1A;
  -webkit-text-fill-color: #0B0F1A;
}
.part-m { background: #38BDF8; }
.part-f { background: #FB7185; }
.part-all { background: #FBBF24; }
.slot.next .part { opacity: 0.8; }

.st-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; }
.msg-big { font-size: 96px; font-weight: 800; }
.msg-small { font-size: 40px; color: var(--muted); }
.msg-note { font-size: 200px; color: rgba(255, 255, 255, 0.3); }

/* song timeline on the stage: vocal sections tinted so you can see when singing starts */
.st-progress { flex: none; height: 12px; margin-top: 20px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.st-progress .sec { position: absolute; top: 0; bottom: 0; background: rgba(56, 189, 248, 0.42); }
.st-progress .fill { position: absolute; inset: 0; background: rgba(255, 181, 71, 0.7); transform-origin: left center; transform: scaleX(0); }

/* ---------------------------------------------------------- controls (viewport px) */
.controls { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; transition: opacity 0.3s; }
.controls > * { pointer-events: auto; }
.controls.hide { opacity: 0; }
.controls.hide > * { pointer-events: none; }
.ctl-top {
  position: relative; z-index: 11; /* stays usable above the loading / up-next overlay */
  display: flex; align-items: center; gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) 16px 32px;
  background: linear-gradient(rgba(5, 6, 10, 0.96), rgba(5, 6, 10, 0.88) 62%, rgba(5, 6, 10, 0));
}
.ctl-bottom {
  padding: 36px 16px max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(rgba(5, 6, 10, 0), rgba(5, 6, 10, 0.92) 30%, rgba(5, 6, 10, 0.96));
}
.seek-row { display: flex; align-items: center; gap: 12px; max-width: 1400px; margin: 0 auto; }
.time { font-size: 16px; font-variant-numeric: tabular-nums; color: var(--muted); min-width: 46px; text-align: center; }
.seek { position: relative; flex: 1; height: 56px; min-width: 0; }
.seek-track { position: absolute; left: 15px; right: 15px; top: 50%; height: 12px; margin-top: -6px; border-radius: 6px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.seek-secs i { position: absolute; top: 0; bottom: 0; background: rgba(56, 189, 248, 0.55); }
.seek-fill { position: absolute; inset: 0; background: rgba(255, 181, 71, 0.75); transform-origin: left center; transform: scaleX(0); }
.seek input { position: absolute; inset: 0; width: 100%; height: 100%; }
.ctl-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 12px; margin-top: 8px; }
.grp { display: flex; align-items: center; gap: 6px; min-height: 64px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); }
.grp-label { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px 0 14px; font-size: 15px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.grp-label svg { width: 20px; height: 20px; }
.val { min-width: 60px; text-align: center; font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.val-btn { min-height: 56px; border: 0; background: transparent; border-radius: 12px; }
.grp.vocal { padding-right: 16px; }
.grp.vocal input { width: 160px; }
.grp.disabled { opacity: 0.4; }
.grp.disabled input, .grp.disabled button { pointer-events: none; }
#keyVal.loading { color: transparent; position: relative; }
#keyVal.loading::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border: 3px solid rgba(255, 255, 255, 0.25); border-top-color: var(--accent-2); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.controls.adjust-closed .ctl-row.settings { display: none; }
body.docked[data-drawer="open"] .controls:not(.adjust-open) .ctl-row.settings { display: none; }
#adjustBtn[aria-pressed="true"] { background: rgba(255, 255, 255, 0.14); border-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); }
.seg button { min-height: 56px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; font-size: 17px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.seg button.on { background: var(--text); color: #0E1320; }

/* range inputs */
input[type="range"] { -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; height: 56px; background: transparent; margin: 0; touch-action: none; }
input[type="range"]::-webkit-slider-runnable-track { height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--accent-2) var(--fill, 0%), rgba(255, 255, 255, 0.2) var(--fill, 0%)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -10px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
input[type="range"]::-moz-range-track { height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.2); }
input[type="range"]::-moz-range-progress { height: 10px; border-radius: 5px; background: var(--accent-2); }
input[type="range"]::-moz-range-thumb { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 0; }
#seek::-webkit-slider-runnable-track { background: transparent; height: 12px; }
#seek::-webkit-slider-thumb { margin-top: -9px; }
#seek::-moz-range-track, #seek::-moz-range-progress { background: transparent; }

/* ---------------------------------------------------------- overlay (loading / tap to start / errors / up next) */
.overlay { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(6, 8, 14, 0.9); overflow: auto; }
.ov-card { position: relative; width: min(560px, 100%); text-align: center; }
.ov-art { width: min(360px, 70%); aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); background: var(--panel-2); }
.ov-art:not([src]) { display: none; }
.ov-title { margin-top: 16px; font-size: 30px; font-weight: 800; line-height: 1.25; }
.ov-artist { margin-top: 4px; font-size: 20px; color: var(--muted); }
.ov-body { margin-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ov-progress { width: min(420px, 90%); height: 12px; border-radius: 6px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.ov-progress i { display: block; height: 100%; width: 0; background: var(--grad); transition: width 0.15s; }
.ov-progress.indet i { width: 35% !important; animation: indet 1.1s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.ov-status { font-size: 18px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ov-start {
  width: 128px; height: 128px; border-radius: 50%; border: 0;
  background: var(--grad); color: #1B0A14; display: flex; align-items: center; justify-content: center;
}
.ov-start svg { width: 60px; height: 60px; margin-left: 8px; }
.ov-hint { font-size: 22px; font-weight: 700; }
.ov-error { font-size: 20px; color: #FF8FA8; max-width: 460px; }
.ov-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.ov-next-label { font-size: 16px; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent-2); }
.ov-next { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ov-next .ov-title { margin-top: 0; }
.ov-ring { font-size: 64px; font-weight: 800; color: var(--sung); line-height: 1; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- drawer: browse & queue */
.scrim { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, 0.6); }
.drawer {
  position: fixed; z-index: 30; top: 0; right: 0; bottom: 0; width: var(--dw);
  display: flex; background: var(--panel); border-left: 1px solid var(--hair);
}
body:not(.docked) .drawer { width: min(560px, 100vw); box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5); }
.drawer[data-state="strip"] { width: var(--strip-w); }
.dr-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: max(12px, env(safe-area-inset-top)) 14px 0; }
.drawer[data-state="strip"] .dr-panel { display: none; }
.dr-head { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; }
.dr-head .tabs button { padding: 0 20px; font-size: 18px; }
.dr-head .tabs .count { background: var(--accent); color: #fff; }
.dr-body { flex: 1; min-height: 0; display: none; flex-direction: column; }
.drawer[data-tab="queue"] .dr-queue, .drawer[data-tab="browse"] .dr-browse { display: flex; }
.drawer.home-mode .tabs, .drawer.home-mode #drCollapse { display: none; }
.dr-browse > .sb { flex: 1; }
.dr-queue { overflow-y: auto; padding-bottom: 12px; }
.now-playing { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--panel-2); border: 2px solid var(--accent-2); margin: 6px 0 10px; }
.now-playing .np-label { font-size: 13px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-2); }
.now-playing .np-title { font-size: 19px; font-weight: 800; }
.now-playing .np-txt { min-width: 0; flex: 1; }
.now-playing .np-txt div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qlist { list-style: none; margin: 4px 0; padding: 0; }
.qlist li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 0; border-bottom: 1px solid var(--hair); }
.qlist .n { width: 26px; text-align: center; color: var(--muted); font-weight: 800; font-size: 18px; }
.qthumb { position: relative; width: 72px; height: 40px; border-radius: 8px; overflow: hidden; background: linear-gradient(135deg, #24306B, #6B2A5A); display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.qthumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.qlist .t { flex: 1 1 120px; min-width: 0; }
.qlist .t div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qlist .ti { font-size: 18px; font-weight: 700; line-height: 1.25; white-space: normal !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.qlist .a { font-size: 14px; color: var(--muted); }
.qbtns { display: flex; gap: 6px; margin-left: auto; }
.qbtns .btn { width: 52px; min-width: 52px; min-height: 52px; height: 52px; }
.qbtns .btn svg { width: 24px; height: 24px; }
.q-empty { color: var(--muted); padding: 24px 6px; font-size: 18px; }
.dr-foot { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 12px; }
.dr-strip {
  display: none; flex: 1; flex-direction: column; align-items: center; gap: 12px;
  padding: 18px 8px; border: 0; background: var(--panel); color: var(--text); text-align: center;
}
.drawer[data-state="strip"] .dr-strip { display: flex; }
.dr-strip svg { width: 30px; height: 30px; }
.strip-label { font-size: 14px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-2); }
.strip-title { font-size: 15px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }

/* ---------------------------------------------------------- confirm modal */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.72); }
.modal-card { position: relative; width: min(600px, 100%); padding: 30px 28px 26px; border-radius: 24px; background: var(--panel-2); border: 1px solid var(--hair); text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.modal-title { font-size: 30px; font-weight: 800; line-height: 1.25; }
.modal-body { margin-top: 10px; font-size: 20px; color: var(--muted); }
.modal-actions { display: flex; gap: 16px; margin-top: 26px; }
.big-choice { flex: 1; min-height: 76px; font-size: 24px; font-weight: 800; }

.toast {
  position: fixed; z-index: 60; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  max-width: calc(100vw - 32px); padding: 16px 26px; border-radius: 18px;
  background: #F4F6FB; color: #0E1320; font-size: 19px; font-weight: 700; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------- responsive */
@media (max-width: 760px) {
  .brand { font-size: 24px; }
  .brand img { width: 36px; height: 36px; }
  .head-actions .label, .ctl-top .label { display: none; }
  .grid { gap: 14px; }
  .grp-label { padding-left: 10px; font-size: 13px; }
  .grp.vocal input { width: 100px; }
  .search input { font-size: 19px; }
}
/* narrow stage area (drawer docked on a tablet): tighter controls */
@media (max-width: 1100px) {
  body.docked[data-drawer="open"] .ctl-top .label { display: none; }
  body.docked[data-drawer="open"] .grp-label { font-size: 13px; padding-left: 10px; }
  body.docked[data-drawer="open"] .grp.vocal input { width: 100px; }
  body.docked[data-drawer="open"] .seg button { padding: 0 12px; }
  body.docked[data-drawer="open"] #restartBtn .label, body.docked[data-drawer="open"] #adjustBtn .label { display: none; }
  body.docked[data-drawer="open"] #restartBtn, body.docked[data-drawer="open"] #adjustBtn { padding: 0; width: 56px; }
}
@media (max-height: 560px) {
  .ctl-top { padding-bottom: 14px; }
  .ctl-bottom { padding-top: 18px; }
  .grp { min-height: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  .slot.enter, .ov-progress.indet i { animation: none; }
}
