/* =========================================================
   Niggun · iOS 26 "Liquid Glass" design language
   ========================================================= */
:root {
  color-scheme: light dark;
  --accent: #fa2d48;          /* Apple Music red */
  --gold: var(--accent);       /* legacy names used inline by app.js */
  --gold2: var(--accent);
  --bg: #ffffff;
  --bg2: #f2f2f7;              /* systemGroupedBackground */
  --fill: rgba(120, 120, 128, 0.12);
  --fill2: rgba(120, 120, 128, 0.2);
  --ink: #000000;
  --mute: rgba(60, 60, 67, 0.6);  /* secondaryLabel */
  --dim: rgba(60, 60, 67, 0.3);
  --line: rgba(60, 60, 67, 0.18); /* separator */
  --glass-tint: rgba(255, 255, 255, 0.55);
  --glass-edge: rgba(255, 255, 255, 0.75);
  --glass-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Arial Hebrew", system-ui, sans-serif;
  --round: ui-rounded, -apple-system, "SF Pro Rounded", system-ui, sans-serif;
  --serif: var(--sans);
  --he: var(--sans);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tabh: 62px;
  --minih: 58px;
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #ff375f;
    --bg: #000000;
    --bg2: #1c1c1e;
    --fill: rgba(118, 118, 128, 0.24);
    --fill2: rgba(118, 118, 128, 0.32);
    --ink: #ffffff;
    --mute: rgba(235, 235, 245, 0.6);
    --dim: rgba(235, 235, 245, 0.3);
    --line: rgba(84, 84, 88, 0.6);
    --glass-tint: rgba(40, 40, 44, 0.5);
    --glass-edge: rgba(255, 255, 255, 0.22);
    --glass-shadow: 0 14px 44px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.3);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; overscroll-behavior-y: none; letter-spacing: -0.01em; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:active { opacity: 0.6; transition: opacity 0s; }
input { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }

/* ---------- Liquid Glass material ---------- */
.lg, .tabs, .mini, .action, .toast, .shab-chip, .yt .x, .yt .grow, .panel, .search, .glass {
  position: relative;
  background: var(--glass-tint);
  -webkit-backdrop-filter: blur(24px) saturate(190%) brightness(1.05);
  backdrop-filter: blur(24px) saturate(190%) brightness(1.05);
  box-shadow: var(--glass-shadow), inset 0 0.5px 0 var(--glass-edge), inset 0 -0.5px 0 rgba(255, 255, 255, 0.08);
  border: 0.5px solid rgba(255, 255, 255, 0.18);
}
/* specular highlight: the "liquid" lensing sheen along the top edge */
.tabs::before, .mini::before, .action::before, .glass::before, .search::before, .shab-chip::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 38%),
    radial-gradient(120% 60% at 15% -10%, rgba(255, 255, 255, 0.25), transparent 60%);
  mix-blend-mode: soft-light;
}

/* ---------- top / large title ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  padding: calc(var(--safe-t) + 10px) 20px 10px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
}
.brand { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.logo { display: flex; align-items: baseline; gap: 8px; }
.logo h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: 0.012em; line-height: 1.1; }
.logo .he { color: var(--mute); font-size: 17px; font-weight: 500; }
.hdate { font-size: 13px; color: var(--mute); margin-top: 3px; font-weight: 500; }
.shab-chip {
  display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap;
}
.shab-chip svg { color: #ff9f0a; }
.chips { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--fill); color: var(--ink); transition: background 0.25s var(--spring), color 0.25s;
}
.chip.on { background: var(--ink); color: var(--bg); }
.chip.toggle { display: inline-flex; align-items: center; gap: 5px; }
.chip.toggle.on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.banner {
  margin: 10px 16px 0; padding: 12px 14px; border-radius: 18px; font-size: 14px; line-height: 1.4;
  background: var(--bg2);
}
.banner b { font-weight: 600; }
.banner button { color: var(--accent); margin-left: 4px; font-size: 14px; font-weight: 600; }

/* ---------- main ---------- */
main { padding: 0 0 calc(var(--tabh) + var(--minih) + var(--safe-b) + 44px); }
.view { animation: fade 0.35s var(--spring); }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sec { padding: 22px 20px 6px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.sec-h h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.01em; }
.sec-h h2 svg { display: inline; }
.sec-h .more { font-size: 15px; color: var(--accent); font-weight: 500; }
.sub { font-size: 15px; color: var(--mute); margin: -4px 0 12px; line-height: 1.35; }

/* ---------- Mood Mix card (glass over a color field) ---------- */
.glass { border-radius: 26px; }
.mix {
  padding: 18px; overflow: hidden; isolation: isolate;
  background: linear-gradient(135deg, #ff375f 0%, #bf5af2 55%, #5e5ce6 100%);
  color: #fff; box-shadow: 0 20px 50px rgba(191, 90, 242, 0.35);
}
.mix > * { position: relative; z-index: 1; }
.mix h3 { margin: 0 0 4px; font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.mix .sub { color: rgba(255, 255, 255, 0.82); }
.mix .chips { margin-top: 12px; }
.mix .chip { background: rgba(255, 255, 255, 0.2); color: #fff; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: inset 0 0.5px 0 rgba(255,255,255,0.5); }
.mix .chip.on { background: #fff; color: #000; }
.mix-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.mix-row input[type="range"] { flex: 1; accent-color: #fff; }
.mix-row .mins { width: 64px; text-align: right; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mix .btn-gold { background: #fff; color: #000; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); }

.btn-gold {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 12px 22px; border-radius: 999px;
  font-size: 16px; font-weight: 600; color: #fff; background: var(--accent);
}
.btn-ghost { padding: 9px 16px; border-radius: 999px; background: var(--fill); font-size: 15px; font-weight: 600; color: var(--accent); }

/* ---------- rails ---------- */
.rail { display: flex; gap: 14px; overflow-x: auto; padding: 0 20px 6px; scroll-snap-type: x mandatory; scroll-padding: 0 20px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.card { flex: none; width: 164px; scroll-snap-align: start; text-align: left; }
.card .art { position: relative; width: 164px; height: 164px; border-radius: 12px; overflow: hidden; background: var(--bg2); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); }
.card .art img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.35); }
.card .art::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.12); }
.card .t { font-size: 14px; font-weight: 500; margin-top: 8px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .a { font-size: 14px; color: var(--mute); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- track list (inset hairline rows) ---------- */
.list { padding: 0 0 0 20px; }
.row { position: relative; display: flex; align-items: center; gap: 14px; padding: 7px 12px 7px 0; width: 100%; text-align: left; }
.row::after { content: ""; position: absolute; left: 62px; right: 0; bottom: 0; height: 0.5px; background: var(--line); }
.row:last-child::after { display: none; }
.row:active { opacity: 1; background: var(--fill); }
.row .thumb { position: relative; flex: none; width: 48px; height: 48px; border-radius: 8px; overflow: hidden; background: var(--bg2); }
.row .thumb img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.35); }
.row .meta { flex: 1; min-width: 0; }
.row .t { font-size: 16px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.playing .t { color: var(--accent); font-weight: 500; }
.row .a { font-size: 13px; color: var(--mute); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .dots { flex: none; width: 34px; height: 34px; display: grid; place-items: center; color: var(--ink); border-radius: 50%; }
.tag { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 5px; border-radius: 4px; margin-left: 6px; background: var(--fill); color: var(--mute); vertical-align: 1px; }
.eq { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 2px; background: rgba(0, 0, 0, 0.4); }
.eq i { display: inline-block; width: 3px; background: #fff; border-radius: 2px; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: 0.2s; } .eq i:nth-child(3) { animation-delay: 0.4s; }
@keyframes eq { 0%, 100% { height: 5px; } 50% { height: 17px; } }
.paused .eq i { animation-play-state: paused; }

/* skeleton */
.sk { background: linear-gradient(100deg, var(--fill) 30%, var(--fill2) 50%, var(--fill) 70%); background-size: 300% 100%; animation: sh 1.4s linear infinite; border-radius: 8px; }
@keyframes sh { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.sk-row { display: flex; gap: 14px; align-items: center; padding: 7px 20px; }
.sk-row .a1 { width: 48px; height: 48px; }
.sk-row .l1 { height: 13px; width: 70%; } .sk-row .l2 { height: 11px; width: 40%; margin-top: 8px; }

/* ---------- artists ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 20px 14px; padding: 0 20px; }
.artist { text-align: center; }
.artist .av {
  width: 96px; height: 96px; margin: 0 auto; border-radius: 50%; overflow: hidden; background: var(--bg2);
  display: grid; place-items: center; font-size: 36px; font-weight: 600; color: var(--mute);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.artist .av img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.4); }
.artist .n { font-size: 14px; font-weight: 500; margin-top: 8px; }
.artist .h { font-size: 13px; color: var(--mute); }
.hero-artist { display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; padding: 10px 20px 4px; }
.hero-artist .av { width: 160px !important; height: 160px !important; }
.hero-artist h2 { font-size: 28px; font-weight: 700; margin: 0; }
.hero-artist > div:last-child > div:last-child { justify-content: center; }
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-size: 17px; padding: 10px 14px 0; }

/* ---------- radio ---------- */
.stations { display: grid; gap: 12px; padding: 0 20px; }
.station { display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px 12px; text-align: left; width: 100%; border-radius: 22px; }
.station .ic {
  flex: none; width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #ff375f, #ff9f0a);
  box-shadow: inset 0 0.5px 0 rgba(255,255,255,0.5);
}
.station:nth-child(2) .ic { background: linear-gradient(135deg, #0a84ff, #5e5ce6); }
.station:nth-child(3) .ic { background: linear-gradient(135deg, #30d158, #0a84ff); }
.station:nth-child(4) .ic { background: linear-gradient(135deg, #bf5af2, #ff375f); }
.station:nth-child(5) .ic { background: linear-gradient(135deg, #ff9f0a, #ffd60a); }
.station:nth-child(6) .ic { background: linear-gradient(135deg, #64d2ff, #30d158); }
.station .n { font-size: 17px; font-weight: 600; } .station .d { font-size: 14px; color: var(--mute); margin-top: 2px; }
.station.on { box-shadow: var(--glass-shadow), 0 0 0 2px var(--accent); }
.live { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: var(--accent); }
.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

/* ---------- search ---------- */
.search { margin: 12px 20px; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px; color: var(--mute); }
.search input { flex: 1; background: none; border: 0; outline: 0; font-size: 17px; color: var(--ink); }
.empty { text-align: center; color: var(--mute); font-size: 15px; padding: 44px 32px; line-height: 1.45; }
.empty svg { display: inline; vertical-align: -2px; }
.empty .big { font-size: 22px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }

/* ---------- floating Liquid Glass tab bar ---------- */
.tabs {
  position: fixed; left: 50%; bottom: calc(var(--safe-b) + 8px); z-index: 30; transform: translateX(-50%);
  width: min(calc(100% - 32px), 440px); height: var(--tabh);
  display: flex; align-items: center; justify-content: space-between; padding: 4px; border-radius: 999px;
}
.tab {
  position: relative; z-index: 1; flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; font-size: 10px; font-weight: 600; color: var(--ink); border-radius: 999px; transition: color 0.25s, background 0.35s var(--spring);
}
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--accent); background: var(--fill); }
.tab:active { opacity: 1; transform: scale(0.94); }

/* ---------- mini player: glass capsule above the tab bar ---------- */
.mini {
  position: fixed; left: 50%; z-index: 31; bottom: calc(var(--tabh) + var(--safe-b) + 16px);
  width: min(calc(100% - 32px), 440px); height: var(--minih);
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 7px; border-radius: 999px;
  transform: translateX(-50%); transition: transform 0.45s var(--spring), opacity 0.3s;
}
.mini.hide { transform: translate(-50%, 160%); opacity: 0; pointer-events: none; }
.mini .thumb { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; flex: none; background: var(--bg2); }
.mini .thumb img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.35); }
.mini .meta { flex: 1; min-width: 0; text-align: left; }
.mini .t { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .a { font-size: 13px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.mini .ctl { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
.mini .bar { position: absolute; left: 60px; right: 100px; bottom: 5px; height: 2px; border-radius: 2px; background: var(--fill); overflow: hidden; }
.mini .bar i { display: block; height: 100%; width: 0; background: var(--ink); opacity: 0.6; }

/* ---------- Now Playing (artwork-tinted, blurred) ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; overflow: hidden; isolation: isolate;
  padding: calc(var(--safe-t) + 6px) 26px calc(var(--safe-b) + 14px);
  background: #1c1c1e; color: #fff;
  --ink: #fff; --mute: rgba(255, 255, 255, 0.62); --dim: rgba(255, 255, 255, 0.4); --fill: rgba(255, 255, 255, 0.16); --line: rgba(255, 255, 255, 0.14);
  transform: translateY(100%); transition: transform 0.5s var(--spring), border-radius 0.5s var(--spring);
  border-radius: 40px 40px 0 0; touch-action: none;
}
.sheet::before {
  content: ""; position: absolute; inset: -30%; z-index: -2;
  background-image: var(--art, none); background-size: cover; background-position: center;
  filter: blur(70px) saturate(1.8) brightness(0.75); transform: scale(1.2);
  animation: drift 24s ease-in-out infinite alternate;
}
.sheet::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0,0,0,0.1), rgba(0,0,0,0.45)); }
@keyframes drift { to { transform: scale(1.35) rotate(8deg); } }
.sheet.open { transform: translateY(0); border-radius: 0; }
.sheet.dragging { transition: none; border-radius: 40px 40px 0 0; }
.grab { width: 38px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.4); margin: 6px auto 4px; }
.sheet-top { display: flex; align-items: center; justify-content: space-between; }
.sheet-top .ctx { font-size: 13px; font-weight: 600; color: var(--mute); text-align: center; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); }
.icon-btn.on { color: var(--accent); }

.stage { flex: 1; display: grid; place-items: center; min-height: 0; position: relative; }
/* big square artwork: full size while playing, shrinks when paused (Apple Music behaviour) */
.vinyl-wrap {
  position: relative; width: min(84vw, 380px, 44vh); aspect-ratio: 1;
  transform: scale(0.8); transition: transform 0.6s var(--spring);
}
.playing-now .vinyl-wrap { transform: scale(1); }
.ring, .vinyl { display: none; }
.label {
  position: absolute; inset: 0; border-radius: 14px; overflow: hidden; background: #2c2c2e;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 0.5px rgba(255, 255, 255, 0.1);
  transition: box-shadow 0.6s var(--spring);
}
.playing-now .label { box-shadow: 0 34px 80px rgba(0, 0, 0, 0.55), 0 0 0 0.5px rgba(255, 255, 255, 0.1); }
.label img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.34); }
.radio-disc .label { background: linear-gradient(135deg, #ff375f, #bf5af2); }
.radio-disc .label img { opacity: 0.0; }
.radio-disc .label::after {
  content: ""; position: absolute; inset: 30%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.95) 0 14%, transparent 15% 34%, rgba(255,255,255,0.55) 35% 40%, transparent 41% 62%, rgba(255,255,255,0.3) 63% 68%, transparent 69%);
  animation: pulse 2s ease-in-out infinite;
}

.now { margin-top: 22px; display: flex; align-items: center; gap: 12px; }
.now .meta { flex: 1; min-width: 0; }
.now .t { font-size: 22px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now .a { font-size: 20px; color: var(--mute); margin-top: 2px; text-align: left; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now .icon-btn { background: var(--fill); width: 34px; height: 34px; }
.now .icon-btn svg { width: 18px; height: 18px; }
.prog { margin-top: 20px; }
.prog input {
  -webkit-appearance: none; appearance: none; width: 100%; height: 7px; border-radius: 4px; outline: 0;
  background: rgba(255, 255, 255, 0.22); transition: height 0.2s var(--spring);
}
.prog input:active { height: 12px; }
.prog input::-webkit-slider-thumb { -webkit-appearance: none; width: 1px; height: 1px; box-shadow: -400px 0 0 400px rgba(255, 255, 255, 0.85); }
.prog input { overflow: hidden; }
.prog input::-moz-range-progress { background: rgba(255, 255, 255, 0.85); height: 100%; }
.times { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--mute); font-variant-numeric: tabular-nums; margin-top: 7px; }
.ctls { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding: 0 4px; }
.ctls .big { width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.ctls .big svg { width: 44px; height: 44px; }
.ctls .big:active, .ctls .mid:active { opacity: 1; transform: scale(0.86); background: rgba(255,255,255,0.12); }
.ctls .mid { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 50%; transition: transform 0.25s var(--spring); }
.ctls .mid svg { width: 34px; height: 34px; }
.ctls .sm { width: 40px; height: 40px; display: grid; place-items: center; color: var(--mute); position: relative; border-radius: 50%; }
.ctls .sm.on { color: #fff; background: var(--fill); }
.ctls .sm .one { position: absolute; font-size: 9px; font-weight: 800; right: 5px; top: 6px; }
.dock { display: flex; justify-content: space-around; margin-top: 16px; }
.dock button { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--mute); padding: 6px 14px; border-radius: 14px; }
.dock button.on { color: #fff; background: var(--fill); }
.src-note { text-align: center; font-size: 11px; color: var(--dim); margin: 8px 0 4px; min-height: 14px; }

/* panels inside Now Playing (Up Next / Lyrics) */
.panel {
  position: absolute; left: 8px; right: 8px; bottom: calc(var(--safe-b) + 8px); top: 26%; z-index: 5; display: flex; flex-direction: column;
  --glass-tint: rgba(30, 30, 34, 0.55);
  border-radius: 34px; padding: 16px 16px 12px;
  transform: translateY(115%); transition: transform 0.5s var(--spring);
}
.panel.open { transform: none; }
.panel-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; padding: 0 4px; }
.panel-h h3 { margin: 0; font-size: 20px; font-weight: 700; }
.panel .icon-btn { background: var(--fill); width: 32px; height: 32px; }
.panel .btn-ghost { color: #fff; background: var(--fill); padding: 7px 14px; font-size: 14px; }
.panel-body { -webkit-mask-image: linear-gradient(#000 88%, transparent); mask-image: linear-gradient(#000 88%, transparent); flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.q-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 12px; }
.q-row.cur { background: var(--fill); }
.q-row .thumb { width: 44px; height: 44px; border-radius: 7px; overflow: hidden; flex: none; }
.q-row .thumb img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.35); }
.q-row .meta { flex: 1; min-width: 0; text-align: left; }
.q-row .t { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-row .a { font-size: 13px; color: var(--mute); }
.q-row .mv { width: 30px; height: 30px; display: grid; place-items: center; color: var(--mute); }
.q-label { font-size: 15px; font-weight: 700; color: var(--ink); margin: 12px 4px 4px; }
/* lyrics: Apple Music karaoke-style */
.lyrics { padding: 6px 6px 40vh; }
.lyrics p {
  margin: 0; padding: 10px 4px; font-size: 28px; font-weight: 800; line-height: 1.22; letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.3); filter: blur(0.6px);
  transition: color 0.4s, transform 0.5s var(--spring), filter 0.4s; cursor: pointer; transform-origin: left center;
}
.lyrics p[dir="rtl"] { transform-origin: right center; }
.lyrics p.on { color: #fff; transform: scale(1.04); filter: none; text-shadow: 0 0 24px rgba(255,255,255,0.35); }
.lyrics p.past { color: rgba(255, 255, 255, 0.45); filter: none; }
.lyrics.plain p { font-size: 19px; font-weight: 600; color: rgba(255, 255, 255, 0.85); filter: none; cursor: default; }

/* ---------- context menu / action sheet ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.3); opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.action {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 12px); z-index: 61;
  border-radius: 34px; padding: 8px; max-height: 80vh; overflow-y: auto;
  transform: translateY(120%) scale(0.96); transition: transform 0.45s var(--spring);
}
@media (prefers-color-scheme: light) { .action { --glass-tint: rgba(255, 255, 255, 0.72); } }
@media (prefers-color-scheme: dark) { .action { --glass-tint: rgba(44, 44, 48, 0.72); } }
.action.open { transform: none; }
.action .head { display: flex; gap: 12px; align-items: center; padding: 8px 10px 12px; border-bottom: 0.5px solid var(--line); margin-bottom: 4px; }
.action .head img { width: 50px; height: 50px; border-radius: 8px; object-fit: cover; }
.action .head .t { font-weight: 600; font-size: 15px; } .action .head .a { font-size: 13px; color: var(--mute); }
.action .it { display: flex; align-items: center; justify-content: space-between; flex-direction: row-reverse; gap: 14px; width: 100%; padding: 13px 14px; border-radius: 18px; font-size: 17px; text-align: left; }
.action .it:active { opacity: 1; background: var(--fill); }
.action .it svg { color: var(--ink); }
.action input.pl-new { width: 100%; padding: 12px 14px; border-radius: 14px; background: var(--fill); border: 0; outline: 0; margin: 6px 0; font-size: 17px; }

/* ---------- floating YouTube stage (glass PiP) ---------- */
.yt {
  position: fixed; z-index: 55; right: 12px; top: calc(var(--safe-t) + 64px); width: 200px; aspect-ratio: 16/9;
  border-radius: 18px; overflow: hidden; background: #000; box-shadow: 0 20px 50px rgba(0,0,0,0.45), 0 0 0 0.5px rgba(255,255,255,0.2);
  transition: all 0.45s var(--spring);
}
.yt.big { left: 12px; right: 12px; width: auto; top: calc(var(--safe-t) + 56px); }
.yt.offstage { width: 2px; height: 2px; opacity: 0.01; pointer-events: none; right: 0; top: 0; }
.yt #yt-slot, .yt iframe { width: 100%; height: 100%; display: block; }
.yt .x, .yt .grow { position: absolute; top: 6px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; z-index: 2; color: #fff; --glass-tint: rgba(0,0,0,0.35); }
.yt .x { right: 6px; } .yt .grow { left: 6px; }

/* ---------- toast: Dynamic Island-style pill ---------- */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 10px); z-index: 90; transform: translate(-50%, -160%) scale(0.9);
  max-width: 92vw; padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; line-height: 1.35; text-align: center;
  --glass-tint: rgba(0, 0, 0, 0.82); color: #fff;
  transition: transform 0.5s var(--spring);
}
.toast svg { display: inline; vertical-align: -3px; }
.toast.show { transform: translate(-50%, 0) scale(1); }

/* ---------- Shabbos overlay ---------- */
.shabbos {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; text-align: center; padding: 30px; color: #fff;
  background: radial-gradient(600px 600px at 50% 38%, rgba(255, 159, 10, 0.22), transparent 60%), #000;
}
.shabbos .candles { display: flex; gap: 26px; justify-content: center; margin-bottom: 30px; }
.candle { width: 14px; height: 70px; border-radius: 4px; background: linear-gradient(#fbf6ea, #d8cdb2); position: relative; }
.candle::before { content: ""; position: absolute; left: 50%; top: -26px; width: 14px; height: 24px; transform: translateX(-50%); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle at 50% 70%, #fff6c8, #ffcc00 45%, rgba(255,140,0,0.4) 70%, transparent 72%); filter: drop-shadow(0 0 14px rgba(255,204,0,0.9)); animation: flick 2.2s ease-in-out infinite; }
@keyframes flick { 50% { transform: translateX(-50%) scale(0.92, 1.06) rotate(-2deg); } }
.shabbos h2 { font-size: 40px; font-weight: 800; margin: 0; letter-spacing: -0.01em; }
.shabbos p { color: rgba(255,255,255,0.65); font-size: 16px; line-height: 1.5; max-width: 340px; margin: 12px auto 0; }
.shabbos .btn-ghost { color: #fff; background: rgba(255,255,255,0.14); }

/* ---------- Reduce Transparency / Motion (Apple accessibility settings) ---------- */
@media (prefers-reduced-transparency: reduce) {
  .tabs, .mini, .action, .panel, .glass, .search, .toast { -webkit-backdrop-filter: none; backdrop-filter: none; --glass-tint: var(--bg2); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- iPad / desktop ---------- */
@media (min-width: 900px) {
  main, .top { max-width: 960px; margin: 0 auto; }
  .sheet { max-width: 560px; margin: 0 auto; }
  .sheet.open { box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.55); border-radius: 0; }
}
