:root {
  color-scheme: dark;
  --bg: #060910;
  --panel: #0d131d;
  --panel-raised: #121a27;
  --surface: #171f2d;
  --surface-strong: #202a3c;
  --stroke: #273246;
  --stroke-strong: #3a4861;
  --text: #f7f8fc;
  --muted: #9da7b8;
  --soft: #727d90;
  --accent: #6d80ff;
  --accent-strong: #8d61ed;
  --pink: #ff6f96;
  --success: #73dca0;
  --page-inline: clamp(16px, 5vw, 28px);
  --radius-lg: 24px;
  --radius-md: 17px;
  --shadow: 0 20px 60px rgb(0 0 0 / 36%);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 85% -8%, rgb(73 53 137 / 26%) 0, transparent 30rem),
    linear-gradient(180deg, #080b13 0%, var(--bg) 42%);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Inter, sans-serif;
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(rgb(255 255 255 / 1.4%) 1px, transparent 1px);
  background-size: 100% 4px;
  content: "";
  pointer-events: none;
  opacity: .35;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

#app {
  width: 100%;
  max-width: 760px;
  min-height: 100svh;
  margin: 0 auto;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: calc(14px + env(safe-area-inset-top)) var(--page-inline) 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  border-radius: 14px;
}

.brand-copy {
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 12px;
  background: linear-gradient(145deg, #304cd3, #7a56e9 58%, #bd5de0);
  box-shadow: 0 8px 24px rgb(83 84 230 / 40%);
  font-size: 23px;
  font-style: italic;
  font-weight: 900;
  line-height: 1;
}

.brand-name {
  display: block;
  overflow: hidden;
  font-size: clamp(18px, 5vw, 21px);
  font-weight: 800;
  letter-spacing: -.8px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-name em {
  color: #8fa0ff;
  font-style: normal;
}

.brand-subtitle {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .05px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.circle-button {
  display: grid;
  flex: 0 0 auto;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 1px solid var(--stroke);
  border-radius: 50%;
  color: #dbe2ee;
  background: rgb(15 22 33 / 88%);
  box-shadow: inset 0 1px rgb(255 255 255 / 4%);
}

.circle-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

main {
  min-width: 0;
  padding: 4px var(--page-inline) 22px;
}

.view {
  min-width: 0;
}

.hidden {
  display: none !important;
}

.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;
}

.searchbox {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 6px 6px 6px 14px;
  border: 1px solid #303b4f;
  border-radius: 15px;
  background: linear-gradient(145deg, #151d29, #101721);
  box-shadow: inset 0 1px rgb(255 255 255 / 3%), 0 12px 30px rgb(0 0 0 / 18%);
}

.searchbox > svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  color: #8c98aa;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.searchbox input,
.linkbox input,
.modal input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 16px;
}

.searchbox input {
  width: 100%;
  height: 42px;
  padding: 0;
}

.searchbox input::placeholder,
.linkbox input::placeholder,
.modal input::placeholder {
  color: #7d899b;
  opacity: 1;
}

.searchbox button {
  display: grid;
  width: 43px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(130deg, var(--accent), var(--accent-strong));
  box-shadow: 0 9px 22px rgb(92 89 239 / 28%);
}

.searchbox button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  min-width: 0;
  margin: 14px 0 28px;
  padding: 4px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: #0c121c;
}

.chip {
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  color: #aeb7c7;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip.active {
  color: #fff;
  background: linear-gradient(120deg, #5c76f5, #8f5ae7);
  box-shadow: 0 7px 18px rgb(83 90 228 / 30%);
}

.section-intro {
  padding: 15px 0 24px;
}

.eyebrow {
  color: #a9b2ff;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 2.1px;
}

.section-intro h1 {
  margin: 8px 0 7px;
  font-size: clamp(28px, 8vw, 38px);
  letter-spacing: -1.5px;
  line-height: 1.08;
}

.section-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.heading-heart {
  color: var(--pink);
}

.section-row {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 13px;
}

.section-row h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 18px;
  font-weight: 780;
  letter-spacing: -.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.muted {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.results {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.track-row {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 67px;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgb(13 19 29 / 78%);
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

@media (hover: hover) {
  .track-row:hover {
    border-color: var(--stroke);
    background: var(--panel-raised);
    transform: translateY(-1px);
  }
}

.track-row:active {
  background: #192232;
}

.track-click {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  color: inherit;
  background: none;
  text-align: left;
}

.thumb {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 9px;
  object-fit: cover;
  background: linear-gradient(145deg, #27344d, #3d3158);
  box-shadow: 0 5px 16px rgb(0 0 0 / 24%);
}

.artist-row .thumb {
  border-radius: 50%;
}

.track-main {
  min-width: 0;
  flex: 1 1 auto;
}

.track-title,
.track-meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-title {
  color: #f5f7fb;
  font-size: 14px;
  font-weight: 690;
  letter-spacing: -.2px;
  line-height: 1.3;
}

.track-meta {
  margin-top: 4px;
  color: #8f9aad;
  font-size: 11.5px;
}

.track-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 1px;
}

.track-duration {
  min-width: 34px;
  color: #8792a4;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.favorite-button,
.more-button {
  display: grid;
  flex: 0 0 auto;
  min-width: 35px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: #c6cfdd;
  background: transparent;
  font-size: 21px;
  font-weight: 500;
  line-height: 1;
}

.favorite-button.active,
.heading-heart {
  color: var(--pink);
}

.more-button {
  color: #909bad;
  font-size: 20px;
}

.row-open {
  flex: 0 0 auto;
  padding-right: 7px;
  color: #8e9aac;
  font-size: 11px;
}

.empty-state {
  display: grid;
  min-height: 235px;
  place-items: center;
  align-content: center;
  padding: 34px 20px;
  border: 1px dashed #303c50;
  border-radius: var(--radius-lg);
  color: var(--text);
  background: linear-gradient(145deg, rgb(16 23 35 / 82%), rgb(10 15 24 / 72%));
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  margin-bottom: 16px;
  border: 1px solid #39445d;
  border-radius: 50%;
  color: #b7baff;
  background: #1b2335;
  font-size: 28px;
  box-shadow: 0 10px 28px rgb(0 0 0 / 24%);
}

.empty-state strong {
  font-size: 15px;
}

.empty-state p {
  max-width: 320px;
  margin: 9px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.loading-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 150px;
  color: var(--muted);
  font-size: 13px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #3b465c;
  border-top-color: #a7a8ff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.link-panel {
  margin: 24px 0 6px;
  padding: 0 15px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  color: #c6cfdd;
  background: rgb(13 19 29 / 72%);
}

.link-panel summary {
  padding: 15px 0;
  font-size: 13px;
  font-weight: 700;
  list-style-position: inside;
  cursor: pointer;
}

.link-panel[open] summary {
  padding-bottom: 11px;
}

.link-panel p {
  margin: 10px 0 15px;
  color: var(--soft);
  font-size: 11px;
}

.linkbox {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.linkbox input {
  width: 100%;
  min-height: 45px;
  padding: 10px 12px;
  border: 1px solid #354158;
  border-radius: 11px;
  background: #080d15;
}

.linkbox button,
.primary-button {
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(120deg, #5874ef, #925ee8);
  font-weight: 750;
}

.linkbox button {
  min-width: 64px;
  padding: 0 14px;
}

.primary-button {
  min-height: 46px;
  padding: 12px 17px;
  box-shadow: 0 10px 24px rgb(84 85 223 / 24%);
}

.plus {
  margin-right: 6px;
  font-size: 19px;
  vertical-align: -1px;
}

.library-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 15px 0 20px;
}

.outline-button {
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid #3b4964;
  border-radius: 11px;
  color: #d5ddf6;
  background: #172033;
  font-size: 13px;
  font-weight: 700;
}

.load-more {
  width: 100%;
  margin-top: 12px;
}

.playlist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.playlist-tile {
  display: flex;
  min-width: 0;
  min-height: 138px;
  flex-direction: column;
  justify-content: space-between;
  padding: 17px 14px;
  border: 1px solid #324059;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, #243e70, #171c2b 70%);
  text-align: left;
}

.playlist-tile:nth-child(3n + 2) {
  background: linear-gradient(145deg, #4b3d73, #1c1929 70%);
}

.playlist-icon {
  color: #b7c5ff;
  font-size: 26px;
}

.playlist-tile strong,
.playlist-tile span:last-child {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist-tile strong {
  font-size: 14px;
}

.playlist-tile span:last-child {
  margin-top: 4px;
  color: #bac5d8;
  font-size: 11px;
}

.back-button {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  padding: 5px 5px 5px 0;
  border: 0;
  border-radius: 10px;
  color: #d5dcf5;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.back-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

#view-detail {
  padding-top: 3px;
}

.detail-hero {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 250px;
  margin: 18px 0 12px;
  overflow: hidden;
  border: 1px solid #35425a;
  border-radius: 24px;
  background: linear-gradient(145deg, #1c2a45, #291f3c);
  box-shadow: var(--shadow);
}

.detail-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-hero::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 25%, rgb(4 7 12 / 26%) 55%, rgb(4 7 12 / 96%) 100%);
  content: "";
}

.detail-copy {
  position: absolute;
  right: 18px;
  bottom: 17px;
  left: 18px;
  z-index: 1;
  min-width: 0;
}

.detail-copy h1 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(27px, 8vw, 38px);
  letter-spacing: -1.4px;
  line-height: 1.04;
  text-shadow: 0 4px 20px rgb(0 0 0 / 70%);
}

.detail-copy p {
  margin: 7px 0 0;
  color: #c2cbdb;
  font-size: 12px;
}

.detail-hero.local-detail {
  display: flex;
  min-height: 180px;
  align-items: flex-end;
  background: linear-gradient(145deg, #273f73, #271f42 68%, #10141e);
}

.detail-hero.local-detail .detail-cover {
  opacity: .14;
  filter: blur(2px);
}

.detail-actions {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin: 0 0 25px;
}

.detail-play {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 8px;
  padding: 11px 21px;
}

.detail-play svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  width: 100%;
  max-width: 760px;
  min-height: calc(60px + env(safe-area-inset-bottom));
  height: auto;
  margin: 0 auto;
  padding: 6px 12px max(6px, env(safe-area-inset-bottom));
  border-top: 1px solid rgb(48 59 77 / 85%);
  background: rgb(10 15 24 / 92%);
  box-shadow: 0 -12px 35px rgb(0 0 0 / 28%);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}

.navitem {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  max-height: 48px;
  padding: 0 8px;
  border: 0;
  border-radius: 13px;
  color: #7f8b9f;
  background: transparent;
  font-size: 10.5px;
  font-weight: 680;
}

.navitem svg {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.navitem.selected {
  color: #aebcff;
  background: rgb(105 123 237 / 9%);
}

.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(14px + env(safe-area-inset-top)) var(--page-inline) calc(24px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% -5%, rgb(70 67 139 / 45%) 0, transparent 27rem),
    #060910;
}

.player-shell {
  width: 100%;
  max-width: 560px;
  min-width: 0;
  margin: 0 auto;
}

.player-top {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 19px;
}

.player-top .back-button {
  flex: 0 1 auto;
  overflow: hidden;
}

.player-top .back-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-kicker {
  flex: 0 0 auto;
  color: #a8b2c4;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.35px;
  white-space: nowrap;
}

.video-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #35425a;
  border-radius: 21px;
  aspect-ratio: 16 / 9;
  min-height: 200px;
  background: #000;
  box-shadow: 0 22px 60px rgb(0 0 0 / 50%);
}

.video-wrap > div,
.video-wrap iframe {
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-width: 0;
  border: 0;
}

.now-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin: 22px 0 17px;
}

.now-copy {
  min-width: 0;
}

.now-details h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(24px, 7vw, 34px);
  letter-spacing: -1px;
  line-height: 1.08;
}

.now-details p {
  margin: 7px 0 0;
  overflow: hidden;
  color: #a9b3c4;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.favorite-button.large {
  min-width: 50px;
  height: 50px;
  font-size: 32px;
}

.timeline {
  width: 100%;
  min-width: 0;
}

.timeline input {
  width: 100%;
  height: 24px;
  margin: 0;
  accent-color: #8da0ff;
  cursor: pointer;
}

.time-row {
  display: flex;
  justify-content: space-between;
  margin-top: -2px;
  color: #818da1;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.player-controls {
  display: grid;
  grid-template-columns: 54px 78px 54px;
  align-items: center;
  justify-content: center;
  gap: clamp(22px, 10vw, 48px);
  margin: 24px 0 26px;
}

.player-controls button {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #eef2fb;
  background: transparent;
}

.player-controls button svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.player-controls .play-circle {
  width: 78px;
  height: 78px;
  border: 2px solid #8298ff;
  background: linear-gradient(145deg, #304777, #26365d);
  box-shadow: 0 0 26px rgb(101 124 253 / 35%);
}

.player-controls .play-circle svg {
  width: 29px;
  height: 29px;
  fill: none;
}

.player-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.player-actions .outline-button {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-actions .streaming-options-button {
  grid-column: 1 / -1;
}

.streaming-options-button.attention {
  border-color: #8298ff;
  color: #fff;
  background: linear-gradient(110deg, rgb(73 101 190 / 44%), rgb(119 67 187 / 42%));
  box-shadow: 0 0 24px rgb(105 124 253 / 18%);
}

.player-status {
  margin-top: 15px;
  padding: 11px 13px;
  border: 1px solid #2d3950;
  border-radius: 11px;
  color: #bbc5d5;
  background: rgb(18 26 40 / 76%);
  font-size: 11px;
  line-height: 1.5;
}

.player-status.success {
  border-color: rgb(67 122 92 / 70%);
  color: #bceacf;
  background: rgb(29 75 49 / 28%);
}

.player-status.error {
  border-color: rgb(132 67 83 / 70%);
  color: #f0c5cf;
  background: rgb(84 31 45 / 28%);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 31;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  padding: 0;
  overflow-x: hidden;
  background: rgb(0 0 0 / 72%);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal {
  width: 100%;
  max-width: 600px;
  max-height: min(76vh, 700px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 21px 20px calc(25px + env(safe-area-inset-bottom));
  border: 1px solid #39465c;
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background: linear-gradient(160deg, #17202f, #101722);
  box-shadow: 0 -22px 60px rgb(0 0 0 / 45%);
}

.modal-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 17px;
}

.modal-head h3 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 20px;
}

.close-small {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #303a4d;
}

.modal input {
  width: 100%;
  min-height: 47px;
  margin: 0 0 11px;
  padding: 11px 12px;
  border: 1px solid #3c4a62;
  border-radius: 12px;
  background: #0a1019;
}

.modal p {
  margin: 10px 0;
  color: #bac4d4;
  font-size: 13px;
  line-height: 1.65;
}

.provider-track {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-width: 0;
  margin-bottom: 17px;
  padding: 11px;
  border: 1px solid #354258;
  border-radius: 15px;
  background: rgb(6 10 18 / 62%);
}

.provider-track img {
  width: 64px;
  height: 64px;
  border-radius: 11px;
  object-fit: cover;
}

.provider-track span,
.provider-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.provider-track strong,
.provider-track small,
.provider-copy strong,
.provider-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-track strong {
  font-size: 15px;
}

.provider-track small {
  color: #9faabd;
  font-size: 12px;
}

.provider-option {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  margin: 0 0 9px;
  padding: 10px 13px;
  border: 1px solid #3a475d;
  border-radius: 14px;
  color: #fff;
  background: #202a3c;
  font: inherit;
  text-align: left;
  text-decoration: none;
}

.provider-option:hover,
.provider-option:focus-visible {
  border-color: #8298ff;
  background: #27334a;
}

.provider-badge {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: #34405a;
  font-size: 17px;
  font-weight: 900;
}

.provider-youtube .provider-badge {
  background: #f10d36;
}

.provider-spotify .provider-badge {
  color: #07150d;
  background: #1ed760;
}

.provider-amazon .provider-badge {
  color: #08131a;
  background: #25b7e8;
}

.provider-copy strong {
  font-size: 14px;
}

.provider-copy small {
  color: #aab5c7;
  font-size: 11px;
  font-weight: 500;
}

.modal .provider-note {
  margin: 13px 2px 0;
  color: #8f9bad;
  font-size: 11px;
}

.modal-option {
  width: 100%;
  min-height: 47px;
  margin-bottom: 7px;
  padding: 12px 13px;
  overflow: hidden;
  border: 1px solid #354258;
  border-radius: 11px;
  color: #fff;
  background: #202a3c;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-action {
  margin-top: 6px;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: calc(82px + env(safe-area-inset-bottom));
  left: 14px;
  z-index: 40;
  width: fit-content;
  max-width: min(420px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 12px 16px;
  border-radius: 13px;
  color: #151c33;
  background: #e5eaff;
  box-shadow: 0 14px 36px rgb(0 0 0 / 45%);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.track-row:focus-within,
.brand:focus-visible,
.chip:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid #9aafff;
  outline-offset: 2px;
}

@media (min-width: 650px) {
  :root {
    --page-inline: 42px;
  }

  .topbar {
    padding-top: calc(22px + env(safe-area-inset-top));
  }

  .bottom-nav {
    border-right: 1px solid var(--stroke);
    border-left: 1px solid var(--stroke);
  }

  .navitem {
    flex-direction: column;
    gap: 3px;
  }
}

@media (max-width: 430px) {
  .track-duration {
    display: none;
  }

  .player-controls {
    grid-template-columns: 48px 72px 48px;
    gap: clamp(20px, 9vw, 38px);
  }

  .player-controls button {
    width: 48px;
    height: 48px;
  }

  .player-controls .play-circle {
    width: 72px;
    height: 72px;
  }
}

@media (max-width: 360px) {
  :root {
    --page-inline: 14px;
  }

  .brand-subtitle {
    display: none;
  }

  .track-row {
    gap: 4px;
  }

  .track-click {
    gap: 9px;
  }

  .track-actions .more-button {
    display: none;
  }

  .player-actions {
    grid-template-columns: 1fr;
  }

  .player-actions .streaming-options-button {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .switch-control::after {
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* V1.5: persistent visible player, queue, history and settings. */
body.has-compact-player #app {
  padding-bottom: calc(390px + env(safe-area-inset-bottom));
}

body.modal-open .player-overlay {
  visibility: hidden;
}

.stop-player-button {
  min-width: 48px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #38455d;
  border-radius: 11px;
  color: #c6cfdd;
  background: #101722;
  font-size: 11px;
  font-weight: 750;
}

.playback-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: -4px 0 16px;
}

.playback-modes button {
  min-width: 0;
  min-height: 40px;
  overflow: hidden;
  padding: 8px 9px;
  border: 1px solid #2f3b51;
  border-radius: 12px;
  color: #9da9bc;
  background: #111925;
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playback-modes button.active,
.playback-modes button[aria-pressed="true"] {
  border-color: #6479e1;
  color: #eef1ff;
  background: rgb(76 96 190 / 28%);
}

.player-status.info {
  border-color: #344666;
  color: #c5d0e2;
  background: rgb(28 43 68 / 54%);
}

.player-overlay.compact-player {
  top: auto;
  right: auto;
  bottom: calc(66px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 16;
  width: min(calc(100% - 16px), 420px);
  max-width: 420px;
  height: auto;
  max-height: calc(100dvh - 78px - env(safe-area-inset-bottom));
  padding: 8px;
  overflow: auto;
  transform: translateX(-50%);
  border: 1px solid #36445d;
  border-radius: 20px;
  background: rgb(8 12 20 / 97%);
  box-shadow: 0 22px 70px rgb(0 0 0 / 72%);
}

.compact-player .player-shell {
  max-width: none;
}

.compact-player .player-top {
  margin: 0 1px 7px;
}

.compact-player .player-kicker {
  display: none;
}

.compact-player .player-top .back-button {
  min-height: 37px;
  padding: 7px 10px;
  font-size: 11px;
}

.compact-player .video-wrap {
  min-width: 200px;
  min-height: 200px;
  border-radius: 14px;
  box-shadow: none;
}

.compact-player .now-details {
  margin: 9px 5px 7px;
}

.compact-player .now-details h2 {
  overflow: hidden;
  font-size: 15px;
  letter-spacing: -.25px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-player .now-details p {
  margin-top: 3px;
  font-size: 11px;
}

.compact-player .favorite-button.large {
  min-width: 38px;
  height: 38px;
  font-size: 24px;
}

.compact-player .timeline,
.compact-player .player-controls,
.compact-player .player-actions,
.compact-player .player-status {
  display: none !important;
}

.compact-player .playback-modes {
  margin: 0;
}

.compact-player .playback-modes button {
  min-height: 37px;
}

body.keyboard-open .bottom-nav {
  display: none;
}

body.keyboard-open #app {
  padding-bottom: 24px;
}

body.keyboard-open .player-overlay.compact-player {
  top: calc(var(--visual-offset-top, 0px) + 4px);
  bottom: auto;
  max-height: calc(100dvh - 8px);
}

body.has-compact-player .toast {
  top: calc(10px + env(safe-area-inset-top));
  bottom: auto;
}

.resume-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid #35435c;
  border-radius: 17px;
  color: var(--text);
  background: linear-gradient(135deg, #17223a, #141827 62%, #251c3d);
  text-align: left;
  box-shadow: 0 14px 34px rgb(0 0 0 / 22%);
}

.resume-card img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
}

.resume-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.resume-copy small {
  color: #91a2ff;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 1.1px;
}

.resume-copy strong,
.resume-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resume-copy strong {
  font-size: 14px;
}

.resume-copy span {
  color: var(--muted);
  font-size: 11px;
}

.resume-play {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #667be7;
  border-radius: 50%;
  color: #fff;
  background: #344a82;
  font-size: 13px;
}

.history-section {
  min-width: 0;
  margin-top: 20px;
}

.history-section h3 {
  margin: 0 0 11px;
  font-size: 14px;
}

.history-chips {
  display: flex;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 7px;
}

.history-chip {
  max-width: 100%;
  min-height: 37px;
  padding: 8px 12px;
  overflow: hidden;
  border: 1px solid #344159;
  border-radius: 999px;
  color: #d3daea;
  background: #121a27;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-list {
  display: grid;
  gap: 8px;
}

.modal-lead {
  margin: 0 0 12px;
  color: #dfe5f0;
  font-weight: 750;
}

.modal-label {
  margin: 17px 2px 9px;
  color: #929eb1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.modal-option-primary {
  border-color: #5b70dc;
  background: linear-gradient(120deg, #2a3e78, #432c6c);
}

.playlist-create-form {
  display: grid;
  gap: 11px;
}

.playlist-create-form input {
  width: 100%;
  min-height: 49px;
  padding: 11px 13px;
  border: 1px solid #3a4860;
  border-radius: 12px;
  background: #0e1520;
}

.danger-option {
  color: #f2b6c2 !important;
}

.danger-button {
  background: linear-gradient(120deg, #8e304b, #603044);
}

.queue-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  color: #99a5b8;
  font-size: 11px;
}

.text-button {
  padding: 5px;
  border: 0;
  color: #aebcff;
  background: transparent;
  font-size: 11px;
  font-weight: 750;
}

.queue-list,
.blocked-list {
  display: grid;
  gap: 8px;
}

.queue-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 6px;
  border: 1px solid #2d394d;
  border-radius: 13px;
  background: #111925;
}

.queue-row.current {
  border-color: #6579df;
  background: rgb(54 72 130 / 28%);
}

.queue-track {
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.queue-track img {
  width: 45px;
  height: 45px;
  border-radius: 9px;
  object-fit: cover;
}

.queue-track span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.queue-track strong,
.queue-track small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-track strong {
  font-size: 12px;
}

.queue-track small {
  color: var(--muted);
  font-size: 9px;
}

.queue-actions {
  display: flex;
  gap: 3px;
}

.queue-icon {
  width: 31px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #c8d1df;
  background: #202a3b;
}

.empty-modal {
  color: #aab5c6;
  line-height: 1.55;
}

.blocked-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #2f3b50;
  border-radius: 12px;
  background: #111925;
}

.blocked-row > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.blocked-row strong,
.blocked-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blocked-row strong {
  font-size: 12px;
}

.blocked-row small {
  color: var(--muted);
  font-size: 10px;
}

.compact-button {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 10px;
}

.settings-heading {
  margin: 18px 2px 8px;
  color: #9aa7bb;
  font-size: 9px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.settings-heading:first-child {
  margin-top: 0;
}

.setting-row {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  padding: 10px 12px;
  border: 1px solid #313e53;
  border-radius: 13px;
  color: var(--text);
  background: #141d2a;
  text-align: left;
}

.setting-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.setting-copy strong {
  font-size: 12px;
}

.setting-copy small {
  color: #97a3b5;
  font-size: 10px;
  line-height: 1.4;
}

.switch-control {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #303b4d;
  box-shadow: inset 0 0 0 1px #465268;
}

.switch-control::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d8deea;
  content: "";
  transition: transform .18s ease;
}

.switch-control.active {
  background: #6175dc;
}

.switch-control.active::after {
  transform: translateX(18px);
  background: #fff;
}

.setting-arrow {
  color: #9aa8bc;
  font-size: 24px;
}

.settings-note,
.version-label {
  color: #929fb2;
  font-size: 10px;
  line-height: 1.55;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

@media (max-width: 360px) {
  .player-overlay.compact-player {
    width: calc(100% - 10px);
    padding: 6px;
  }

  .compact-player .video-wrap {
    border-radius: 12px;
  }

  .playback-modes {
    gap: 5px;
  }

  .playback-modes button {
    padding-inline: 5px;
    font-size: 10px;
  }

  .queue-icon {
    width: 29px;
  }
}
