:root {
  --ivory: #f6ecd7;
  --muted: rgba(246, 236, 215, 0.68);
  --faint: rgba(246, 236, 215, 0.22);
  --accent: #d6b06f;
  --panel: rgba(13, 17, 30, 0.91);
  --panel-solid: #111624;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  --safe-top: max(20px, env(safe-area-inset-top));
  --safe-right: max(20px, env(safe-area-inset-right));
  --safe-bottom: max(20px, env(safe-area-inset-bottom));
  --safe-left: max(20px, env(safe-area-inset-left));
  --ease: cubic-bezier(.2, .72, .2, 1);
  --serif: "Iowan Old Style", "Palatino Linotype", Baskerville, Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--sans);
  color: var(--ivory);
  background: #111323;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { width: 100%; min-height: 100%; background: #111323; overscroll-behavior: none; }
body { width: 100%; min-height: 100%; margin: 0; overflow: hidden; background: #111323; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button { color: inherit; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 72%, var(--ivory)); outline-offset: 4px; }

.skip-link {
  position: fixed; z-index: 100; top: 8px; left: 8px; transform: translateY(-160%);
  padding: 9px 13px; border-radius: 10px; background: #0d111e; color: var(--ivory); text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

.app {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  overflow: hidden;
  background: #111323;
  isolation: isolate;
}

.world { position: absolute; inset: 0; z-index: -3; overflow: hidden; background: #111323; }
.world-layer {
  position: absolute; inset: -2px;
  background-size: cover;
  background-position: center center;
  opacity: 0;
  transform: scale(1.003);
  transition: opacity 900ms var(--ease), filter 900ms var(--ease);
  will-change: opacity;
}
.world-layer.is-visible { opacity: 1; }
.world-vignette {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(7,8,18,.10) 0%, rgba(7,8,18,.015) 30%, rgba(7,8,18,.13) 68%, rgba(7,8,18,.56) 100%),
    radial-gradient(circle at 50% 46%, rgba(5,7,16,.015) 0 20%, rgba(5,7,16,.07) 56%, rgba(5,7,16,.2) 100%);
  pointer-events: none;
}
.world-ambient {
  position: absolute;
  left: 38%; right: 38%; bottom: 17%; height: 1px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 36%, transparent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 18%, transparent);
  opacity: .12;
  transform: scaleX(.72);
  transition: background-color 700ms var(--ease), box-shadow 700ms var(--ease), opacity 350ms ease;
  pointer-events: none;
}
.app.is-playing .world-ambient { opacity: .22; }

.topbar {
  position: absolute; inset: 0 0 auto 0; z-index: 8;
  display: flex; justify-content: space-between; align-items: center;
  padding: clamp(24px, 3vw, 44px) clamp(28px, 3.5vw, 58px);
  padding-left: max(clamp(28px, 3.5vw, 58px), var(--safe-left));
  padding-right: max(clamp(28px, 3.5vw, 58px), var(--safe-right));
}
.brand {
  color: var(--ivory); text-decoration: none;
  font-family: var(--serif);
  font-size: clamp(25px, 2.05vw, 38px); letter-spacing: .018em;
  text-shadow: 0 2px 20px rgba(0,0,0,.4);
}
.utilities { display: flex; align-items: center; gap: clamp(7px, 1vw, 14px); }
.icon-button, .transport, .heart-button {
  appearance: none; border: 0; background: transparent; padding: 8px;
  display: grid; place-items: center; cursor: pointer; border-radius: 999px;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}
.icon-button svg, .transport svg, .heart-button svg {
  width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round;
}
@media (hover: hover) {
  .icon-button:hover, .transport:hover, .heart-button:hover { background: rgba(255,255,255,.07); }
  .genre-button:hover { color: var(--ivory); }
  .browse-button:hover span { border-color: color-mix(in srgb, var(--accent) 60%, var(--ivory)); }
}
.icon-button:active, .transport:active, .heart-button:active { transform: scale(.94); }
.has-badge { position: relative; }
.utility-badge {
  position: absolute; top: 2px; right: 1px; min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 999px; display: none; place-items: center;
  background: var(--accent); color: #17131b; font-size: 9px; line-height: 1; font-weight: 700;
}
.utility-badge.show { display: grid; }

.player-shell {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto auto auto auto 1fr;
  align-content: center;
  justify-items: center;
  padding: clamp(104px, 10vh, 148px) 22px max(28px, 3.5vh);
}
.track-block {
  grid-row: 2;
  text-align: center;
  max-width: min(760px, 78vw);
  text-shadow: 0 3px 26px rgba(0,0,0,.58);
  transform-origin: center;
}
.genre-eyebrow {
  margin: 0 0 8px; color: var(--ivory); font-size: clamp(13px, 1.05vw, 18px);
  text-transform: uppercase; letter-spacing: .055em;
}
.song-title {
  margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: clamp(42px, 4.65vw, 70px); line-height: 1.01; text-wrap: balance;
}
.track-block.is-long-title .song-title { font-size: clamp(36px, 3.8vw, 58px); }
.track-block.is-very-long-title .song-title { font-size: clamp(31px, 3.25vw, 50px); }
.artist-row { display: flex; justify-content: center; align-items: center; gap: 10px; }
.artist { margin: 12px 0 0; max-width: min(620px, 82vw); color: rgba(246,236,215,.9); font-size: clamp(15px, 1.35vw, 21px); text-wrap: balance; }
.mobile-heart { display: none; margin-top: 8px; }

.controls {
  grid-row: 3; display: flex; align-items: center; gap: clamp(23px, 3.1vw, 46px);
  margin-top: clamp(20px, 2.8vh, 36px);
}
.transport { width: 48px; height: 48px; }
.transport svg { width: 29px; height: 29px; }
.play-button {
  position: relative; width: 70px; height: 70px; border-radius: 50%;
  border: 1px solid rgba(246,236,215,.78); color: var(--ivory); background: rgba(12,15,25,.24);
  display: grid; place-items: center; cursor: pointer;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 24%, transparent), 0 6px 28px rgba(0,0,0,.18);
  transition: transform 160ms ease, border-color 220ms ease, box-shadow 220ms ease;
}
.play-button:active { transform: scale(.96); }
.play-button svg { width: 31px; height: 31px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.pause-icon { display: none; }
.is-playing .play-icon { display: none; }
.is-playing .pause-icon { display: block; }
.ambient-ring {
  position: absolute; inset: -34px; border: 1px solid color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 50%; opacity: .2; pointer-events: none;
}
.ambient-ring::before, .ambient-ring::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(246,236,215,.03); }
.ambient-ring::before { inset: 11px; }
.ambient-ring::after { inset: 22px; }

.progress-wrap {
  grid-row: 4; display: grid; grid-template-columns: auto minmax(210px, 330px) auto; align-items: center; gap: 12px;
  margin-top: clamp(22px, 3.2vh, 40px);
}
.time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress { width: 100%; accent-color: var(--accent); cursor: pointer; }
input[type="range"] { appearance: none; height: 18px; background: transparent; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(to right, var(--ivory) 0 var(--progress,0%), var(--faint) var(--progress,0%) 100%); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: -3px; box-shadow: 0 0 9px color-mix(in srgb, var(--accent) 50%, transparent); }
input[type="range"]::-moz-range-track { height: 2px; background: var(--faint); }
input[type="range"]::-moz-range-progress { height: 2px; background: var(--ivory); }
input[type="range"]::-moz-range-thumb { border: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.genre-strip {
  grid-row: 5;
  display: flex; gap: clamp(20px, 2.55vw, 41px); align-items: flex-end;
  max-width: min(770px, 88vw); overflow-x: auto; scrollbar-width: none; overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity; scroll-padding-inline: 32px;
  padding: 20px 10px 9px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
.genre-strip::-webkit-scrollbar { display: none; }
.genre-button {
  position: relative; flex: 0 0 auto; appearance: none; border: 0; background: transparent; color: rgba(246,236,215,.72); cursor: pointer;
  padding: 0 0 10px; font-size: clamp(14px, 1.2vw, 19px); white-space: nowrap; scroll-snap-align: center;
  transition: color 180ms ease;
}
.genre-button::after { content: ""; position: absolute; height: 1px; left: 16%; right: 16%; bottom: 0; background: transparent; }
.genre-button::before { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; left: 50%; bottom: -4px; transform: translateX(-50%); background: transparent; }
.genre-button.active { color: var(--ivory); }
.genre-button.active::after { background: color-mix(in srgb, var(--accent) 70%, var(--ivory)); }
.genre-button.active::before { background: var(--accent); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 48%, transparent); }

.browse-button {
  grid-row: 6; align-self: start; margin-top: clamp(17px, 2.6vh, 28px);
  appearance: none; border: 0; background: transparent; color: var(--ivory); cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 2px;
  font-size: clamp(14px, 1.15vw, 18px);
}
.browse-button span { border-bottom: 1px solid rgba(246,236,215,.2); padding-bottom: 3px; transition: border-color 180ms ease; }
.browse-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.4; transition: transform 260ms var(--ease); }
.app:not([data-sheet-snap="closed"]) .browse-button svg { transform: rotate(180deg); }

.sheet {
  position: fixed; z-index: 20; inset: auto 50% 0 auto;
  width: min(1120px, 74vw); height: min(68vh, 710px); height: min(68dvh, 710px);
  transform: translate(50%, calc(100% + 14px));
  border: 1px solid rgba(246,236,215,.115); border-bottom: 0; border-radius: 24px 24px 0 0;
  background: var(--panel); backdrop-filter: blur(24px) saturate(.82); -webkit-backdrop-filter: blur(24px) saturate(.82);
  box-shadow: var(--shadow);
  transition: transform 420ms var(--ease), height 420ms var(--ease), width 320ms var(--ease);
  overflow: hidden;
  contain: layout paint;
}
.sheet[data-snap="medium"], .sheet[data-snap="full"], .sheet[data-snap="collapsed"] { transform: translate(50%, 0); }
.sheet-handle {
  display: none; appearance: none; border: 0; background: transparent; width: 100%; height: 28px; padding: 0; cursor: ns-resize;
}
.sheet-handle span { display: block; width: 50px; height: 5px; border-radius: 999px; background: rgba(246,236,215,.23); margin: 11px auto 0; }
.sheet-inner { height: 100%; display: grid; grid-template-rows: auto auto 1fr auto; padding: 26px 34px 0; }
.sheet-header { display: grid; grid-template-columns: 1fr minmax(170px, 260px) auto; align-items: center; gap: 16px; }
.sheet-header h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(27px, 2.2vw, 36px); margin: 0; }
.search-field { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid rgba(246,236,215,.42); padding: 7px 0; }
.search-field svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.4; flex: 0 0 auto; }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ivory); }
.search-field input::placeholder { color: rgba(246,236,215,.42); }
.sheet-close svg { width: 21px; height: 21px; }
.sheet-genres { grid-row: auto; max-width: 100%; margin: 4px 0 7px; padding-left: 0; }
.sheet.mode-favourites .sheet-genres, .sheet.mode-queue .sheet-genres, .sheet.mode-search .sheet-genres { display: none; }
.song-list { overflow-y: auto; min-height: 0; padding-right: 4px; scrollbar-width: thin; scrollbar-color: rgba(246,236,215,.16) transparent; }
.song-row {
  display: grid; grid-template-columns: 34px minmax(0,1fr) 56px 40px; gap: 10px; align-items: center;
  min-height: 68px; border-top: 1px solid rgba(246,236,215,.1); position: relative; color: rgba(246,236,215,.8);
}
.song-row:first-child { border-top: 0; }
.song-row.current::before { content: ""; position: absolute; left: -34px; top: 10px; bottom: 10px; width: 2px; background: var(--accent); }
.song-index { color: rgba(246,236,215,.5); text-align: right; font-variant-numeric: tabular-nums; }
.song-row.current .song-index::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 7px; box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 55%, transparent); }
.song-copy { min-width: 0; cursor: pointer; border: 0; background: transparent; color: inherit; text-align: left; padding: 8px 0; }
.song-copy strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 450; font-size: 16px; }
.song-row.current .song-copy strong { color: var(--ivory); }
.song-copy small { display: block; color: rgba(246,236,215,.52); margin-top: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.song-duration { color: rgba(246,236,215,.58); font-size: 13px; font-variant-numeric: tabular-nums; }
.song-favourite { justify-self: center; }
.song-favourite.active svg, .heart-button.active svg { fill: var(--accent); stroke: var(--accent); }
.empty-state { display: grid; align-content: center; justify-items: start; min-height: 180px; color: rgba(246,236,215,.6); line-height: 1.55; }
.empty-state strong { color: var(--ivory); font-weight: 500; margin-bottom: 4px; }

.mini-player {
  position: relative; height: 76px; border-top: 1px solid rgba(246,236,215,.15);
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px;
  background: linear-gradient(to bottom, rgba(17,22,36,.05), rgba(17,22,36,.22));
}
.mini-progress { position: absolute; top: -1px; left: 0; right: 0; height: 2px; background: rgba(246,236,215,.1); }
.mini-progress span { display: block; width: 0; height: 100%; background: var(--accent); }
.mini-track { min-width: 0; }
.mini-track strong, .mini-track span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-track strong { font-weight: 500; }
.mini-track span { color: rgba(246,236,215,.52); margin-top: 3px; font-size: 12px; }
.mini-controls { display: flex; align-items: center; gap: 1px; }
.mini-controls .transport { width: 41px; height: 41px; }
.mini-controls .transport svg { width: 23px; height: 23px; }

.install-banner {
  position: fixed; z-index: 35; left: 50%; bottom: max(24px, calc(var(--safe-bottom) + 8px)); transform: translateX(-50%);
  width: min(560px, calc(100vw - 36px)); display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 13px 14px 13px 18px; border: 1px solid rgba(246,236,215,.14); border-radius: 18px;
  background: rgba(11,15,26,.92); backdrop-filter: blur(18px); box-shadow: 0 18px 55px rgba(0,0,0,.34);
}
.install-banner[hidden] { display: none; }
.install-banner strong, .install-banner span { display: block; }
.install-banner strong { font-weight: 600; font-size: 14px; }
.install-banner span { margin-top: 3px; color: rgba(246,236,215,.58); font-size: 12px; }
.install-actions { display: flex; flex: 0 0 auto; gap: 5px; }
.install-actions button { border: 0; background: transparent; color: rgba(246,236,215,.7); padding: 9px 11px; border-radius: 10px; cursor: pointer; font-size: 12px; }
.install-actions .install-primary { color: #17131b; background: var(--accent); font-weight: 700; }
.app:not([data-sheet-snap="closed"]) .install-banner { display: none !important; }

.toast {
  position: fixed; z-index: 40; left: 50%; bottom: max(28px, calc(var(--safe-bottom) + 12px)); transform: translate(-50%, 18px);
  opacity: 0; pointer-events: none; background: rgba(10,13,23,.92); border: 1px solid rgba(246,236,215,.14); color: var(--ivory);
  border-radius: 999px; padding: 10px 16px; font-size: 13px; box-shadow: 0 10px 35px rgba(0,0,0,.28); transition: opacity 180ms ease, transform 180ms ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Tablet and compact desktop */
@media (min-width: 701px) and (max-width: 1100px) {
  .topbar { padding: max(24px, var(--safe-top)) max(30px, var(--safe-right)) 0 max(30px, var(--safe-left)); }
  .brand { font-size: clamp(28px, 3.6vw, 36px); }
  .player-shell { padding-top: clamp(108px, 11vh, 138px); padding-bottom: max(28px, var(--safe-bottom)); }
  .track-block { max-width: 82vw; }
  .song-title { font-size: clamp(48px, 6.8vw, 66px); }
  .artist { font-size: clamp(17px, 2.2vw, 21px); }
  .genre-eyebrow { font-size: clamp(14px, 1.7vw, 17px); }
  .controls { margin-top: clamp(22px, 2.5vh, 32px); }
  .play-button { width: 66px; height: 66px; }
  .progress-wrap { margin-top: clamp(20px, 2.6vh, 32px); }
  .genre-strip { max-width: 84vw; gap: clamp(25px, 3.5vw, 38px); }
  .genre-button { font-size: clamp(16px, 2vw, 19px); }
  .sheet { width: min(880px, 88vw); height: min(68dvh, 700px); }
  .sheet-inner { padding-inline: 30px; }
  .song-row.current::before { left: -30px; }
}

@media (min-width: 701px) and (max-width: 920px) and (orientation: portrait) {
  .world-layer { background-position: center 46%; }
  .world-vignette { background: linear-gradient(to bottom, rgba(7,8,18,.06), rgba(7,8,18,.035) 33%, rgba(7,8,18,.18) 69%, rgba(7,8,18,.58)); }
  .player-shell { grid-template-rows: 1.15fr auto auto auto auto .85fr; padding-top: 112px; }
  .song-title { font-size: clamp(50px, 7.7vw, 64px); }
  .track-block { max-width: 86vw; }
  .genre-strip { width: 88vw; max-width: 88vw; }
  .browse-button { margin-top: 22px; }
  .sheet { width: 92vw; }
}

/* Phone */
@media (max-width: 700px) {
  .world-layer { background-position: center 47%; }
  .world-vignette {
    background:
      linear-gradient(to bottom, rgba(5,7,16,.015), rgba(5,7,16,.055) 34%, rgba(5,7,16,.22) 70%, rgba(5,7,16,.66)),
      radial-gradient(circle at 50% 51%, transparent 0 20%, rgba(5,7,16,.08) 54%, rgba(5,7,16,.16) 100%);
  }
  .world-ambient { left: 42%; right: 42%; bottom: 24%; opacity: .08; }

  .topbar { padding: var(--safe-top) max(22px, var(--safe-right)) 0 max(22px, var(--safe-left)); align-items: flex-start; }
  .brand { font-size: clamp(27px, 7.6vw, 32px); }
  .utilities { gap: 2px; }
  .icon-button { min-width: 42px; min-height: 42px; padding: 8px; }
  .icon-button svg { width: 23px; height: 23px; }
  .desktop-only { display: none; }

  .player-shell {
    min-height: 100svh; min-height: 100dvh;
    grid-template-rows: minmax(120px, 1.05fr) auto auto auto minmax(90px, .68fr) auto;
    padding: 86px 0 calc(var(--safe-bottom) + 14px);
  }
  .track-block { max-width: min(90vw, 560px); }
  .genre-eyebrow { font-size: clamp(12px, 3.5vw, 14px); margin-bottom: 8px; letter-spacing: .045em; }
  .song-title { font-size: clamp(39px, 10.7vw, 50px); line-height: .99; }
  .track-block.is-long-title .song-title { font-size: clamp(34px, 9.1vw, 43px); }
  .track-block.is-very-long-title .song-title { font-size: clamp(30px, 8vw, 38px); }
  .artist-row { flex-direction: column; gap: 4px; }
  .artist { font-size: clamp(16px, 4.6vw, 19px); margin-top: 11px; }
  .mobile-heart { display: grid; width: 38px; height: 38px; margin-top: 2px; }
  .mobile-heart svg { width: 21px; height: 21px; }

  .controls { margin-top: 8px; gap: clamp(18px, 5.8vw, 26px); }
  .transport { width: 44px; height: 44px; }
  .transport svg { width: 27px; height: 27px; }
  .play-button { width: 54px; height: 54px; border: 0; background: transparent; box-shadow: none; }
  .play-button svg { width: 32px; height: 32px; }
  .ambient-ring { display: none; }

  .progress-wrap { width: min(430px, 78vw); grid-template-columns: 1fr 1fr; gap: 2px 10px; margin-top: 4px; }
  .progress-wrap .progress { grid-column: 1 / -1; grid-row: 1; }
  .progress-wrap .time { grid-row: 2; font-size: 10px; }
  .progress-wrap .time:last-child { text-align: right; }

  .genre-strip {
    width: 100%; max-width: 100%; gap: clamp(25px, 7.2vw, 34px);
    padding: 17px max(26px, var(--safe-right)) 8px max(26px, var(--safe-left));
    justify-content: flex-start; align-self: end;
    scroll-padding-inline: 32px;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
  }
  .genre-button { font-size: clamp(16px, 4.4vw, 18px); }
  .browse-button { align-self: end; margin: 10px 0 0; min-height: 44px; font-size: 16px; }
  .browse-button span { border: 0; }

  .sheet {
    width: 100%; max-width: none; height: 82vh; height: 82dvh;
    border-radius: 26px 26px 0 0; border-left: 0; border-right: 0;
    background: rgba(12,16,29,.955); transform: translate(50%, calc(100% + 10px));
    transition: transform 380ms var(--ease), height 380ms var(--ease);
    contain: layout paint;
  }
  .sheet[data-snap="collapsed"] { height: calc(102px + var(--safe-bottom)); transform: translate(50%, 0); }
  .sheet[data-snap="medium"] { height: 56vh; height: 56dvh; transform: translate(50%, 0); }
  .sheet[data-snap="full"] { height: 82vh; height: 82dvh; transform: translate(50%, 0); }
  .sheet-handle { display: block; height: 31px; touch-action: none; }
  .sheet-handle span { width: 48px; height: 5px; margin-top: 12px; }
  .sheet-inner { padding: 8px max(22px, var(--safe-right)) var(--safe-bottom) max(22px, var(--safe-left)); grid-template-rows: auto auto 1fr auto; }
  .sheet-header { grid-template-columns: 1fr auto auto; gap: 6px; }
  .sheet-header h2 { font-size: clamp(32px, 9vw, 38px); }
  .search-field { width: 42px; height: 42px; border: 0; padding: 8px; justify-self: end; }
  .search-field svg { width: 23px; height: 23px; }
  .search-field input {
    position: fixed; z-index: 3; left: max(18px, var(--safe-left)); right: max(18px, var(--safe-right)); top: calc(var(--safe-top) + 72px);
    width: auto; background: rgba(12,16,29,.985); border: 1px solid rgba(246,236,215,.16); border-radius: 14px;
    padding: 13px 16px; opacity: 0; pointer-events: none; transform: translateY(-8px); transition: opacity 150ms ease, transform 150ms ease;
    box-shadow: 0 12px 40px rgba(0,0,0,.3);
  }
  .sheet.searching .search-field input { opacity: 1; pointer-events: auto; transform: translateY(0); }
  .sheet-close { display: none; }
  .sheet-genres { margin: 3px calc(-1 * max(22px, var(--safe-right))) 8px calc(-1 * max(22px, var(--safe-left))); padding-left: max(22px, var(--safe-left)); padding-right: max(22px, var(--safe-right)); }
  .sheet.mode-favourites .sheet-genres, .sheet.mode-queue .sheet-genres, .sheet.mode-search .sheet-genres { display: none; }
  .song-list { margin-right: -4px; }
  .song-row { grid-template-columns: 34px minmax(0,1fr) 45px 38px; min-height: 76px; gap: 8px; }
  .song-row.current::before { left: calc(-1 * max(22px, var(--safe-left))); }
  .song-copy { min-height: 62px; display: grid; align-content: center; }
  .song-copy strong { font-size: 17px; }
  .song-copy small { font-size: 13px; }
  .song-duration { font-size: 13px; }
  .heart-button { min-width: 40px; min-height: 40px; }
  .mini-player { height: 84px; min-height: 84px; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
  .mini-track strong { font-size: 15px; }
  .mini-track span { font-size: 12px; }
  .mini-controls .transport { width: 40px; height: 40px; }

  .sheet[data-snap="collapsed"] .sheet-handle { position: absolute; top: 0; left: 0; right: 0; z-index: 2; }
  .sheet[data-snap="collapsed"] .sheet-inner { display: block; height: 100%; padding-top: 18px; }
  .sheet[data-snap="collapsed"] .sheet-header,
  .sheet[data-snap="collapsed"] .sheet-genres,
  .sheet[data-snap="collapsed"] .song-list { display: none; }
  .sheet[data-snap="collapsed"] .mini-player { height: calc(100% - 18px); border-top: 0; }

  .install-banner { align-items: flex-end; bottom: max(16px, var(--safe-bottom)); border-radius: 16px; padding: 12px 12px 12px 15px; }
  .install-banner span { max-width: 230px; }
  .install-actions button { padding: 8px 9px; }

  .toast { max-width: calc(100vw - 40px); text-align: center; white-space: normal; }
}
@media (max-width: 390px) {
  .topbar { padding-left: max(18px, var(--safe-left)); padding-right: max(18px, var(--safe-right)); }
  .brand { font-size: 27px; }
  .song-title { font-size: clamp(36px, 10.2vw, 42px); }
  .track-block.is-long-title .song-title { font-size: clamp(32px, 8.9vw, 37px); }
  .track-block.is-very-long-title .song-title { font-size: clamp(29px, 8vw, 34px); }
  .genre-strip { gap: 23px; padding-left: max(22px, var(--safe-left)); padding-right: max(22px, var(--safe-right)); }
  .sheet-inner { padding-left: max(18px, var(--safe-left)); padding-right: max(18px, var(--safe-right)); }
  .sheet-genres { margin-left: calc(-1 * max(18px, var(--safe-left))); margin-right: calc(-1 * max(18px, var(--safe-right))); padding-left: max(18px, var(--safe-left)); padding-right: max(18px, var(--safe-right)); }
  .song-row.current::before { left: calc(-1 * max(18px, var(--safe-left))); }
  .song-row { grid-template-columns: 31px minmax(0,1fr) 42px 36px; }
  .mini-controls .transport { width: 36px; height: 38px; }
}

/* Short landscape screens */
@media (max-height: 560px) and (orientation: landscape) {
  .world-layer { background-position: center 52%; }
  .topbar { padding: max(12px, var(--safe-top)) max(18px, var(--safe-right)) 0 max(18px, var(--safe-left)); }
  .brand { font-size: 24px; }
  .utilities .icon-button { min-width: 38px; min-height: 38px; }
  .player-shell {
    grid-template-rows: auto auto auto auto auto;
    align-content: center;
    padding: 48px 18px max(10px, var(--safe-bottom));
  }
  .track-block { grid-row: 1; max-width: 68vw; }
  .genre-eyebrow { font-size: 11px; margin-bottom: 3px; }
  .song-title { font-size: clamp(29px, 6vw, 43px); }
  .artist { font-size: 14px; margin-top: 5px; }
  .mobile-heart { display: none; }
  .controls { grid-row: 2; margin-top: 6px; gap: 14px; }
  .transport { width: 38px; height: 38px; }
  .transport svg { width: 24px; height: 24px; }
  .play-button { width: 46px; height: 46px; }
  .play-button svg { width: 27px; height: 27px; }
  .progress-wrap { grid-row: 3; width: min(420px, 50vw); margin-top: 0; }
  .genre-strip { grid-row: 4; width: min(720px, 78vw); padding-top: 3px; padding-bottom: 2px; }
  .genre-button { font-size: 14px; padding-bottom: 8px; }
  .browse-button { grid-row: 5; position: fixed; right: max(18px, var(--safe-right)); bottom: max(9px, var(--safe-bottom)); margin: 0; font-size: 13px; }
  .sheet[data-snap="medium"] { height: 72dvh; }
  .sheet[data-snap="full"] { height: 94dvh; }
}

@media (display-mode: standalone) {
  .app { min-height: 100dvh; }
  .topbar { padding-top: max(24px, env(safe-area-inset-top)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
  .world-layer { transform: none; }
}
/* Final product polish layer. Keep this file last so it can improve the core system without duplicating it. */

:root {
  --glass-border: rgba(246, 236, 215, 0.14);
  --glass-highlight: rgba(255, 255, 255, 0.075);
  --focus-ring: color-mix(in srgb, var(--accent) 82%, white);
}

html { text-rendering: optimizeLegibility; }
body { -webkit-font-smoothing: antialiased; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline-color: var(--focus-ring);
  outline-width: 2px;
}

/* First paint should feel intentional instead of flashing demo metadata. */
.app[data-loading="true"] .track-block > * {
  visibility: hidden;
}
.app[data-loading="true"] .track-block {
  position: relative;
  width: min(650px, 78vw);
  min-height: 122px;
}
.app[data-loading="true"] .track-block::after {
  content: "";
  position: absolute;
  inset: 10px 8% auto;
  height: 94px;
  border-radius: 24px;
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(246,236,215,.09) 35%, rgba(246,236,215,.15) 50%, rgba(246,236,215,.09) 65%, transparent 82%) 0 42px / 220% 34px no-repeat,
    linear-gradient(rgba(246,236,215,.12), rgba(246,236,215,.12)) center 8px / 34% 10px no-repeat,
    linear-gradient(rgba(246,236,215,.08), rgba(246,236,215,.08)) center 78px / 26% 8px no-repeat;
  opacity: .82;
  animation: garba-loading 1.7s ease-in-out infinite;
}
@keyframes garba-loading { 50% { background-position: 100% 42px, center 8px, center 78px; opacity: 1; } }

/* A local scrim protects text without hiding the courtyard. */
.track-block { position: relative; isolation: isolate; }
.track-block::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -32px -54px -28px;
  border-radius: 48px;
  background: radial-gradient(ellipse at center, rgba(7,9,18,.30), rgba(7,9,18,.10) 52%, transparent 76%);
  filter: blur(4px);
  pointer-events: none;
}

/* Keep the two bottom actions side-by-side. This also fixes the dynamically inserted
   Nonstop Garba button sharing the same grid cell as Browse Songs. */
.browse-actions {
  grid-row: 6;
  align-self: start;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: clamp(17px, 2.6vh, 28px);
}
.browse-actions .browse-button {
  grid-row: auto;
  margin-top: 0;
  min-height: 42px;
  padding: 8px 4px;
}
.browse-actions .nonstop-section-button { margin-bottom: 0; }
.browse-actions .nonstop-section-button span:last-child {
  border: 0;
  color: var(--accent);
  font-size: 19px;
  line-height: 1;
}

/* Current-track favourite belongs next to the track on every device. */
.mobile-heart {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}
@media (min-width: 701px) {
  .mobile-heart { display: grid; margin-top: 7px; }
  .artist-row { gap: 4px; }
}

.play-button {
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}
@media (hover: hover) {
  .play-button:hover {
    border-color: var(--ivory);
    box-shadow:
      inset 0 0 0 1px color-mix(in srgb, var(--accent) 36%, transparent),
      0 0 0 7px rgba(246,236,215,.035),
      0 10px 34px rgba(0,0,0,.24);
  }
  .song-row:hover { background: rgba(246,236,215,.035); }
  .song-row:hover .song-copy strong { color: var(--ivory); }
}

.progress { min-height: 28px; }
input[type="range"]::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -5px;
}
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; }

/* Utilities should feel like controls, not bare glyphs floating over busy artwork. */
.icon-button {
  min-width: 42px;
  min-height: 42px;
}
.utilities .icon-button {
  background: rgba(8,10,18,.14);
  border: 1px solid transparent;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
@media (hover: hover) {
  .utilities .icon-button:hover {
    background: rgba(8,10,18,.36);
    border-color: rgba(246,236,215,.12);
  }
}

/* Small trust/status indicators added by ux-polish.js. */
.source-badge,
.network-status,
.sheet-summary {
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
}
.source-badge {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  padding: 4px 9px;
  border: 1px solid rgba(246,236,215,.12);
  border-radius: 999px;
  background: rgba(8,10,18,.20);
  color: rgba(246,236,215,.67);
  font-size: 11px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .06em;
  backdrop-filter: blur(8px);
}
.source-badge.show { display: inline-flex; }
.source-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 9px color-mix(in srgb, var(--accent) 55%, transparent);
}
.network-status {
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(246,236,215,.14);
  background: rgba(8,10,18,.48);
  color: rgba(246,236,215,.78);
  font-size: 11px;
  backdrop-filter: blur(9px);
}
.network-status.show { display: inline-flex; }
.network-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #ffbd7a; }
.sheet-summary {
  color: rgba(246,236,215,.48);
  font-size: 12px;
  white-space: nowrap;
}

.sheet {
  border-color: var(--glass-border);
  background: linear-gradient(to bottom, rgba(18,21,35,.935), rgba(10,14,25,.965));
}
.sheet::before {
  content: "";
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(246,236,215,.26), transparent);
  pointer-events: none;
}
.sheet-header { min-height: 52px; }
.sheet-header-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.song-list { overscroll-behavior: contain; }
.song-row {
  border-radius: 12px;
  transition: background-color 150ms ease, color 150ms ease;
  content-visibility: auto;
  contain-intrinsic-size: 68px;
}
.song-copy:focus-visible {
  outline-offset: -2px;
  border-radius: 9px;
}
.song-copy strong { letter-spacing: -.005em; }
.song-copy small { line-height: 1.35; }

.search-field:focus-within { border-color: var(--accent); }
.search-field input { caret-color: var(--accent); }
.search-field input::-webkit-search-cancel-button { filter: invert(1); opacity: .6; }

/* Make provider playback feel like part of GARBA instead of a second app. */
.provider-overlay {
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)) !important;
  background: rgba(6,8,15,.77) !important;
  backdrop-filter: blur(28px) saturate(.85) !important;
  -webkit-backdrop-filter: blur(28px) saturate(.85) !important;
}
.provider-panel {
  border-color: rgba(246,236,215,.15) !important;
  background: linear-gradient(180deg, rgba(21,24,39,.98), rgba(11,14,25,.985)) !important;
  box-shadow: 0 36px 120px rgba(0,0,0,.6) !important;
}
.provider-head {
  background: rgba(17,20,33,.94) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.provider-head h2 {
  font-family: var(--serif) !important;
  font-weight: 400 !important;
  color: var(--ivory) !important;
}
.provider-close { min-width: 44px !important; min-height: 44px !important; }
.provider-action {
  min-height: 44px !important;
  background: var(--ivory) !important;
  color: #17131b !important;
}
.provider-action.secondary { background: rgba(246,236,215,.09) !important; color: var(--ivory) !important; }
.provider-frame { box-shadow: 0 14px 45px rgba(0,0,0,.28); }
.provider-chapter,
.nonstop-item { border-color: rgba(246,236,215,.10) !important; }
.provider-chapter:focus-visible,
.nonstop-play:focus-visible,
.provider-close:focus-visible,
.provider-action:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }

/* Toast should remain readable over both artwork and open sheets. */
.toast {
  border-color: rgba(246,236,215,.18);
  background: rgba(8,11,20,.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  line-height: 1.35;
}

@media (max-width: 700px) {
  .track-block::before { inset: -26px -12px -22px; border-radius: 36px; }
  .app[data-loading="true"] .track-block { width: 88vw; min-height: 108px; }
  .app[data-loading="true"] .track-block::after { inset-inline: 12%; height: 86px; }

  .browse-actions {
    width: 100%;
    align-self: end;
    gap: 6px 18px;
    margin-top: 7px;
    padding-inline: max(18px, var(--safe-left));
  }
  .browse-actions .browse-button { min-height: 44px; font-size: 15px; }
  .browse-actions .nonstop-section-button span:last-child { font-size: 17px; }

  .source-badge { margin-top: 6px; }
  .sheet-header-title { gap: 8px; }
  .sheet-summary { font-size: 11px; }

  .provider-overlay { padding: 0 !important; align-items: flex-end !important; }
  .provider-panel {
    max-height: calc(92dvh - env(safe-area-inset-top)) !important;
    padding-bottom: env(safe-area-inset-bottom);
  }
}

@media (max-width: 390px) {
  #shareButton { display: none; }
  .browse-actions { gap: 4px 14px; }
  .browse-actions .browse-button { font-size: 14px; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .browse-actions {
    position: fixed;
    z-index: 7;
    right: max(18px, var(--safe-right));
    bottom: max(7px, var(--safe-bottom));
    width: auto;
    gap: 4px 12px;
    margin: 0;
    padding: 0;
  }
  .browse-actions .browse-button { position: static; margin: 0; font-size: 12px; min-height: 38px; }
}

@media (pointer: coarse) {
  .genre-button { min-height: 44px; }
  .song-favourite { min-width: 44px; min-height: 44px; }
  input[type="range"] { min-height: 30px; }
}

@media (prefers-contrast: more) {
  :root { --muted: rgba(246,236,215,.82); --faint: rgba(246,236,215,.38); }
  .world-vignette { background: linear-gradient(to bottom, rgba(5,7,16,.16), rgba(5,7,16,.08) 35%, rgba(5,7,16,.36) 72%, rgba(5,7,16,.72)); }
  .song-row { border-top-color: rgba(246,236,215,.22); }
  .sheet, .provider-panel { border-color: rgba(246,236,215,.35) !important; }
}

@media (prefers-reduced-motion: reduce) {
  .app[data-loading="true"] .track-block::after { animation: none; }
}
/* Follow-up states for accessibility and truthful catalogue UX. */

.progress:disabled {
  cursor: default;
  opacity: .48;
}
.progress:disabled::-webkit-slider-thumb { opacity: 0; }
.progress:disabled::-moz-range-thumb { opacity: 0; }

.retry-catalogue {
  appearance: none;
  margin-top: 18px;
  min-height: 42px;
  padding: 9px 17px;
  border: 1px solid rgba(246,236,215,.28);
  border-radius: 999px;
  background: rgba(8,10,18,.24);
  color: var(--ivory);
  cursor: pointer;
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.retry-catalogue:hover { background: rgba(8,10,18,.42); border-color: rgba(246,236,215,.48); }
.retry-catalogue:active { transform: scale(.97); }

.search-empty-prompt {
  min-height: 180px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 5px;
  padding: 22px 2px;
  color: rgba(246,236,215,.58);
  line-height: 1.5;
}
.search-empty-prompt strong {
  color: var(--ivory);
  font-family: var(--serif);
  font-size: clamp(23px, 2vw, 30px);
  font-weight: 400;
}
.search-empty-prompt[hidden] { display: none; }
.sheet.search-awaiting-query .song-row,
.sheet.search-awaiting-query .empty-state:not(.search-empty-prompt) { display: none; }

/* Inert content is genuinely unavailable while the mobile sheet is modal. */
@media (max-width: 700px) {
  .sheet[aria-modal="true"] {
    box-shadow: 0 -22px 70px rgba(0,0,0,.48);
  }
  .sheet[aria-modal="true"]::after {
    content: "";
    position: fixed;
    inset: -100vh 0 100% 0;
    background: rgba(3,5,11,.20);
    pointer-events: none;
  }
  .retry-catalogue { min-height: 44px; }
  .search-empty-prompt { min-height: 150px; }
}

@media (prefers-contrast: more) {
  .retry-catalogue { border-color: rgba(246,236,215,.58); }
  .search-empty-prompt { color: rgba(246,236,215,.78); }
}
/* Discovery, device and data-saver refinements layered after the core UI. */

.enhanced-search-note {
  padding: 8px 2px 11px;
  color: rgba(246,236,215,.48);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.enhanced-search-row .enhanced-search-arrow {
  display: grid;
  place-items: center;
  width: 40px;
  min-height: 40px;
  color: color-mix(in srgb, var(--accent) 72%, var(--ivory));
  font-size: 18px;
  opacity: .72;
  transition: transform 160ms ease, opacity 160ms ease;
}

@media (hover: hover) {
  .enhanced-search-row:hover .enhanced-search-arrow {
    transform: translateX(3px);
    opacity: 1;
  }
}

.source-badge[data-metadata-only="true"] {
  color: rgba(246,236,215,.52);
}
.source-badge[data-metadata-only="true"]::before {
  background: rgba(246,236,215,.42);
  box-shadow: none;
}

/* Pause purely decorative work while the page is hidden. */
.app.page-hidden .world-ambient,
.app.page-hidden .ambient-ring {
  animation-play-state: paused !important;
  transition: none !important;
}

/* Respect Save-Data / very slow network hints without changing the product structure. */
.app[data-save-data="true"] .world-ambient,
.app[data-save-data="true"] .ambient-ring {
  display: none;
}
.app[data-save-data="true"] .sheet,
.app[data-save-data="true"] .utilities .icon-button,
.app[data-save-data="true"] .source-badge,
.app[data-save-data="true"] .network-status,
.app[data-save-data="true"] .retry-catalogue {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.app[data-save-data="true"] .world-layer {
  transition-duration: 180ms;
}

.sheet-handle[aria-expanded="true"] span {
  background: color-mix(in srgb, var(--accent) 42%, rgba(246,236,215,.34));
}

@media (max-width: 700px) {
  .enhanced-search-note {
    position: sticky;
    top: 0;
    z-index: 2;
    margin-inline: -2px;
    padding: 9px 2px 10px;
    background: linear-gradient(to bottom, rgba(12,16,29,.98), rgba(12,16,29,.88));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  .enhanced-search-row {
    min-height: 72px;
  }
}

@media (prefers-contrast: more) {
  .enhanced-search-note { color: rgba(246,236,215,.78); }
  .enhanced-search-row .enhanced-search-arrow { color: var(--ivory); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .enhanced-search-row .enhanced-search-arrow { transition: none; }
}
/* Minimal player, responsive and genre-art tuning. Loaded last. */

.source-badge { display: none !important; }

/* Edge-to-edge viewport contract. Artwork always fills the actual browser viewport,
   including the area beneath iPhone safe-area insets. Safe-area variables are only
   for controls, never for the background itself. */
html,
body {
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  overscroll-behavior: none;
  background: #111323;
}

.app {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100svh !important;
  height: 100dvh !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  overscroll-behavior: none;
  background: #111323;
}

.world {
  position: absolute !important;
  inset: -3px !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.world-layer {
  position: absolute !important;
  inset: -3px !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  transform-origin: center center;
  image-rendering: auto;
}

.player-shell {
  width: 100%;
  height: 100%;
  min-height: 0 !important;
  box-sizing: border-box;
}

/* Playback truth stays visible without reviving the legacy source badge. */
.playback-status {
  display: none;
  width: max-content;
  max-width: min(92vw, 440px);
  margin: 8px auto 0;
  padding: 5px 9px;
  border: 1px solid rgba(246,236,215,.11);
  border-radius: 999px;
  background: rgba(8,10,18,.18);
  color: rgba(246,236,215,.62);
  font: 600 10px/1 var(--sans);
  letter-spacing: .055em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.playback-status.show { display: inline-flex; align-items: center; }
.playback-status::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.playback-status[data-kind="release"] { color: rgba(246,236,215,.52); }

/* Keep the UI lighter than the artwork. */
.track-block::before {
  inset: -24px -42px -20px;
  background: radial-gradient(ellipse at center, rgba(7,9,18,.24), rgba(7,9,18,.075) 55%, transparent 78%);
}
.utilities .icon-button { background: rgba(8,10,18,.10); }
.play-button { background: rgba(9,12,22,.16); }
.browse-actions { gap: 0; }

/* The approved 2K courtyard pack is art-directed per genre. */
.app[data-genre="traditional"] .world-layer { background-position: center 48%; }
.app[data-genre="dandiya"] .world-layer { background-position: center 49%; }
.app[data-genre="devotional"] .world-layer { background-position: center 47%; }
.app[data-genre="folk"] .world-layer { background-position: center 49%; }
.app[data-genre="sanedo"] .world-layer { background-position: center 49%; }
.app[data-genre="fusion"] .world-layer { background-position: center 50%; }

/* In-app provider playback stays above interactive browser surfaces and below toast UI. */
.provider-dock {
  position: fixed;
  z-index: 30;
  top: max(92px, calc(var(--safe-top) + 68px));
  right: max(20px, var(--safe-right));
  width: min(356px, calc(100vw - 40px));
  border: 1px solid rgba(246,236,215,.13);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(8,11,20,.96);
  box-shadow: 0 22px 60px rgba(0,0,0,.38);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(.985);
  transition: opacity 180ms ease, transform 220ms var(--ease), visibility 0s linear 220ms;
}
.provider-dock.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
}
.provider-media {
  width: 100%;
  height: 200px;
  min-width: 200px;
  min-height: 200px;
  background: #050609;
}
.provider-media iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 200px;
  min-height: 200px;
  border: 0;
  background: #050609;
}
.provider-dock.is-spotify .provider-media { height: 152px; min-height: 152px; }
.provider-dock.is-spotify .provider-media iframe { min-height: 152px; }
.provider-dock.is-apple .provider-media { height: 260px; min-height: 260px; }
.provider-dock.is-apple .provider-media iframe { min-height: 260px; }
.provider-dock.is-soundcloud .provider-media { height: 166px; min-height: 166px; }
.provider-dock.is-soundcloud .provider-media iframe { min-height: 166px; }
.provider-dock.is-external .provider-media { height: auto; min-height: 0; }
.provider-external {
  min-height: 166px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 8px;
  padding: 22px;
  color: var(--ivory);
  background:
    radial-gradient(circle at 85% 15%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 40%),
    #0a0d16;
}
.provider-external strong { font: 500 18px/1.2 var(--serif); }
.provider-external span { color: rgba(246,236,215,.58); font: 12px/1.45 var(--sans); }
.provider-external-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-top: 4px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--ivory);
  color: #141620;
  text-decoration: none;
  font: 700 12px/1 var(--sans);
}
.provider-external-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.provider-dock-bar {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 8px 2px 12px;
  border-top: 1px solid rgba(246,236,215,.09);
  color: rgba(246,236,215,.54);
  font-size: 11px;
  letter-spacing: .01em;
}
.provider-dock-bar > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.provider-dock-actions { display: flex; align-items: center; flex: 0 0 auto; gap: 1px; }
.provider-dock-open,
.provider-dock-bar button {
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  padding: 0 7px;
  background: transparent;
  color: rgba(246,236,215,.76);
  font: inherit;
}
.provider-dock-open {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}
.provider-dock-bar button { cursor: pointer; }
.provider-dock-open:hover,
.provider-dock-bar button:hover { background: rgba(246,236,215,.07); color: var(--ivory); }
.provider-dock-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.provider-dock.is-loading .provider-dock-bar span::after { content: "…"; }
.provider-dock.needs-tap .provider-dock-bar span { color: var(--ivory); }

/* Compact laptops and tablets should keep the whole player above the fold. */
@media (min-width: 701px) and (max-height: 760px) {
  .player-shell { padding-top: 82px; padding-bottom: 16px; }
  .genre-eyebrow { margin-bottom: 5px; }
  .song-title { font-size: clamp(38px, 4.25vw, 58px); }
  .artist { margin-top: 8px; }
  .controls { margin-top: 14px; }
  .progress-wrap { margin-top: 14px; }
  .genre-strip { padding-top: 10px; }
  .browse-actions { margin-top: 8px; }
  .provider-dock { top: max(74px, calc(var(--safe-top) + 54px)); }
}

@media (min-width: 1101px) and (min-aspect-ratio: 2/1) {
  .player-shell { padding-top: 92px; padding-bottom: 22px; }
  .track-block { max-width: min(760px, 52vw); }
  .song-title { font-size: clamp(44px, 3.65vw, 66px); }
  .genre-strip { max-width: min(760px, 62vw); }
}

@media (min-width: 701px) and (max-width: 1024px) {
  .sheet { width: min(900px, 92vw); }
  .provider-dock { width: min(336px, calc(100vw - 44px)); }
}

@media (max-width: 700px) {
  .app[data-genre="traditional"] .world-layer { background-position: center 46%; }
  .app[data-genre="dandiya"] .world-layer { background-position: center 47%; }
  .app[data-genre="devotional"] .world-layer { background-position: center 46%; }
  .app[data-genre="folk"] .world-layer { background-position: center 45%; }
  .app[data-genre="sanedo"] .world-layer { background-position: center 47%; }
  .app[data-genre="fusion"] .world-layer { background-position: center 47%; }

  .topbar {
    padding-top: max(18px, var(--safe-top));
    padding-left: max(20px, var(--safe-left));
    padding-right: max(20px, var(--safe-right));
  }
  .player-shell {
    padding-left: max(18px, var(--safe-left));
    padding-right: max(18px, var(--safe-right));
    padding-bottom: max(12px, var(--safe-bottom));
  }
  .track-block::before { inset: -20px -8px -18px; }
  .song-title { font-size: clamp(36px, 10vw, 46px); }
  .artist { font-size: clamp(15px, 4.25vw, 18px); }
  .controls { margin-top: 4px; }
  .progress-wrap { margin-top: 0; }
  .genre-strip { padding-top: 12px; }
  .browse-actions { margin-top: 2px; }
  .install-banner {
    width: calc(100vw - 24px);
    bottom: max(12px, calc(var(--safe-bottom) + 8px));
    padding: 12px 12px 12px 14px;
    border-radius: 15px;
  }

  .provider-dock {
    z-index: 30;
    top: auto;
    right: max(12px, var(--safe-right));
    bottom: max(82px, calc(var(--safe-bottom) + 70px));
    width: min(calc(100vw - 24px), calc(100vw - var(--safe-left) - var(--safe-right) - 24px));
    border-radius: 14px;
  }
  .provider-media { height: 200px; }
  .provider-dock.is-spotify .provider-media { height: 152px; }
  .provider-dock.is-apple .provider-media { height: 235px; min-height: 235px; }
  .provider-dock.is-soundcloud .provider-media { height: 166px; min-height: 166px; }
  .playback-status { max-width: 88vw; margin-top: 6px; font-size: 9px; }
}

@media (max-width: 390px) {
  .provider-dock { right: max(8px, var(--safe-right)); width: calc(100vw - 16px); }
  .provider-dock-bar { padding-inline: 8px; }
  .provider-dock-bar > span { max-width: 54%; }
  .provider-dock-open, .provider-dock-bar button { padding-inline: 6px; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .provider-dock {
    top: max(48px, calc(var(--safe-top) + 38px));
    right: max(10px, var(--safe-right));
    bottom: auto;
    width: 300px;
  }
  .provider-media { height: 200px; }
}

@media (display-mode: standalone) {
  .install-banner { display: none !important; }
}
