/* music: a record deck on top with a spinning vinyl and a tonearm that creeps in as the song plays, the controls as
   hardware under it, then the library as rows with cover art. car mode swaps it all for huge keys, and a mini player
   follows you to every other screen. the deck is always dark hardware, whichever theme is on */
#view-music { --mu-ink: #e9eef7; --mu-dim: #98a3ba; --mu-line: rgba(205, 220, 255, 0.2); --mu-glow: var(--glow, #4de8ff); }
.mu-layout { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .mu-layout { grid-template-columns: minmax(340px, 0.9fr) minmax(0, 1.1fr); gap: 24px; } .mu-deck-col { position: sticky; top: 12px; } }
.mu-deck-col { display: flex; flex-direction: column; gap: 12px; padding: 14px; color: var(--mu-ink); background: linear-gradient(170deg, #161b27, #0b0e15 70%); box-shadow: inset 0 0 0 1px var(--mu-line), inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 18px 40px -22px rgba(0, 0, 0, 0.8); }
.mu-deck { position: relative; padding: 8px 0 2px; }
.mu-stage { position: relative; width: min(100%, 420px); aspect-ratio: 1; margin: 0 auto; }
.mu-rpm { position: absolute; left: 3%; top: 4%; z-index: 2; font: 10px var(--font-label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--mu-dim); }
.mu-rpm b { color: var(--mu-glow); font-weight: 400; }
.mu-mat { position: absolute; inset: 4%; border-radius: 50%; background: radial-gradient(circle, #232938 0 60%, #161a24 61% 100%); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.06), 0 14px 30px rgba(0, 0, 0, 0.6); }
.mu-disc {
  position: absolute; inset: 7%; border-radius: 50%; animation: mu-spin 2.4s linear infinite; animation-play-state: paused; will-change: transform;
  background: repeating-radial-gradient(circle at 50% 50%, #0a0b0f 0 1.2px, #14161d 1.2px 2.6px); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.mu-disc::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 20deg, transparent 0 8%, rgba(255, 255, 255, 0.14) 12%, transparent 18% 50%, rgba(255, 255, 255, 0.1) 62%, transparent 68%); mix-blend-mode: screen; pointer-events: none; }
.mu-disc.on { animation-play-state: running; }
.mu-label {
  position: absolute; inset: 33%; border-radius: 50%; background: var(--art, linear-gradient(135deg, #1b2a6b, #4de8ff)); display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 0 0 3px #0a0b0f, 0 0 0 4px rgba(255, 255, 255, 0.12); font: 700 clamp(18px, 7vw, 34px) var(--font-display); color: rgba(255, 255, 255, 0.85);
}
.mu-label::after { content: ""; position: absolute; width: 7%; aspect-ratio: 1; border-radius: 50%; background: #0b0e15; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3); }
.mu-arm { position: absolute; right: 2%; top: 3%; width: 14%; aspect-ratio: 1; --a: -22deg; }
.mu-pivot { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #d4dae6, #6c7487 60%, #2b3040); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6); }
.mu-bar { position: absolute; left: 50%; top: 50%; width: 5px; height: 330%; margin-left: -2.5px; transform-origin: 50% 0; transform: rotate(var(--a)); transition: transform 0.9s cubic-bezier(0.3, 0.9, 0.3, 1); background: linear-gradient(90deg, #aeb6c6, #eef1f7 45%, #7a8296); border-radius: 3px; box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.5); }
.mu-bar::after { content: ""; position: absolute; left: -7px; bottom: -4px; width: 19px; height: 34px; background: linear-gradient(#2b3040, #12151d); border-radius: 3px; transform: rotate(8deg); }
.mu-led { position: absolute; left: 6%; bottom: 6%; width: 10px; height: 10px; border-radius: 50%; background: #35432f; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4); }
.mu-led.on { background: #5bff9a; box-shadow: 0 0 10px #5bff9a; }
.mu-readout { display: grid; gap: 2px; padding: 10px 12px; background: #03120f; box-shadow: inset 0 0 0 1px #0f3a30, inset 0 0 18px rgba(77, 255, 200, 0.08); }
.mu-r-title { font: 600 20px/1.15 var(--font-display); letter-spacing: 0.06em; color: #8dffe0; text-shadow: 0 0 8px rgba(77, 255, 200, 0.5); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-r-artist { font: 12px var(--font-label); letter-spacing: 0.1em; color: #52b7a0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 1.3em; }
.mu-seek { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; font: 12px var(--font-label); color: var(--mu-dim); }
.mu-seek span:last-child { text-align: right; }
.mu-seek input, .mu-vol input { width: 100%; min-height: 44px; accent-color: var(--mu-glow); }
.mu-keys { display: flex; align-items: center; justify-content: center; gap: 10px; }
.mu-key { position: relative; width: 52px; height: 52px; padding: 0; border: 1px solid var(--mu-line); border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--mu-ink); background: linear-gradient(#1c2230, #10141d); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 3px 8px rgba(0, 0, 0, 0.5); transition: transform 70ms; }
.mu-key:active { transform: translateY(1px); }
.mu-key svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.mu-key.main { width: 72px; height: 72px; color: #021418; border-color: #0b6b80; background: radial-gradient(circle at 35% 30%, #5ef2ff, #19a9c4 70%, #0c6d82); }
.mu-key.main svg { width: 30px; height: 30px; fill: currentColor; stroke: none; }
.mu-key[aria-pressed="true"] { color: var(--mu-glow); border-color: var(--mu-glow); }
.mu-key b { display: none; position: absolute; right: 8px; bottom: 6px; font: 700 10px var(--font-label); }
.mu-key[data-mode="one"] b { display: block; }
.mu-vol { display: flex; align-items: center; gap: 8px; justify-content: center; font: 11px var(--font-label); letter-spacing: 0.1em; text-transform: uppercase; color: var(--mu-dim); }
.mu-vol input { width: min(220px, 60%); }
.mu-key:focus-visible, .mu-seek input:focus-visible, .mu-vol input:focus-visible, .mu-play-row:focus-visible, .mu-more:focus-visible, .mu-tabs button:focus-visible, .mini-key:focus-visible, .mini-open:focus-visible, .mu-car button:focus-visible { outline: 2px solid var(--mu-glow); outline-offset: 2px; }

/* the library */
.mu-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.mu-tabs [role="tab"] { min-height: 44px; padding: 0 16px; border: 0; cursor: pointer; background: color-mix(in srgb, var(--ink, #fff) 6%, transparent); color: var(--ink-3, #98a3ba); font: 600 11px var(--font-label); letter-spacing: 0.12em; text-transform: uppercase; }
.mu-tabs [aria-selected="true"] { color: var(--glow, var(--chi)); box-shadow: inset 0 -2px 0 var(--glow, var(--chi)); background: color-mix(in srgb, var(--glow, var(--chi)) 12%, transparent); }
.mu-add { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--panel-solid, #0e121b); box-shadow: inset 0 0 0 1px var(--line-2, rgba(205, 220, 255, 0.2)); }
.mu-add input[type="url"] { min-height: 44px; padding: 0 12px; }
.mu-warn { color: var(--amber, #ffb347); }
.mu-search input { width: 100%; min-height: 44px; padding: 0 12px; }
.mu-jobs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mu-job { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px; font-size: 13px; background: color-mix(in srgb, var(--ink, #fff) 5%, transparent); box-shadow: inset 0 0 0 1px var(--line-2, rgba(205, 220, 255, 0.2)); }
.mu-job i { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--glow, var(--chi)); border-right-color: transparent; animation: mu-spin 0.9s linear infinite; }
.mu-job.failed { color: var(--red, #ff6b6b); }
.mu-list-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mu-pl-title { flex: 1 1 140px; min-width: 0; display: grid; }
.mu-pl-title b { font: 600 18px var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-pl-title small { color: var(--ink-3, #98a3ba); font: 11px var(--font-label); letter-spacing: 0.1em; }
.mu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mu-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; min-height: 60px; background: color-mix(in srgb, var(--ink, #fff) 4%, transparent); }
.mu-row.mu-list-row { grid-template-columns: minmax(0, 1fr); }
.mu-row[aria-current="true"] { background: color-mix(in srgb, var(--glow, var(--chi)) 12%, transparent); box-shadow: inset 3px 0 0 var(--glow, var(--chi)); }
.mu-play-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 60px; width: 100%; padding: 4px; border: 0; background: none; color: inherit; cursor: pointer; text-align: left; }
.mu-text { display: grid; min-width: 0; }
.mu-text b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-text small { color: var(--ink-3, #98a3ba); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-play-row time { font: 12px var(--font-label); color: var(--ink-3, #98a3ba); }
.mu-more { width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--ink-3, #98a3ba); cursor: pointer; display: grid; place-items: center; }
.mu-cover { display: grid; place-items: center; width: 52px; height: 52px; background: var(--art, #333); font: 700 18px var(--font-display); color: rgba(255, 255, 255, 0.85); overflow: hidden; }
.mu-cover.big { width: 96px; height: 96px; font-size: 32px; }
.mu-collage { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 1px; }
.mu-collage i { display: block; background: var(--art, #333); }
.mu-edit-top { display: flex; align-items: center; gap: 12px; }
.mu-checks { display: grid; gap: 4px; }
.mu-check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.mu-check input { width: 22px; height: 22px; accent-color: var(--chi); }
#mu-edit-source[hidden] { display: none; }

/* car mode: nothing smaller than a thumb, and nothing to read twice */
.mu-car { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; gap: 14px; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: #05070b; color: #e9eef7; }
.mu-car[hidden] { display: none; }
.mu-car-top { display: flex; align-items: center; justify-content: space-between; }
.mu-car-tag { font: 12px var(--font-label); letter-spacing: 0.16em; text-transform: uppercase; color: #98a3ba; }
.mu-car-x { min-height: 56px; padding: 0 22px; border: 1px solid rgba(205, 220, 255, 0.3); background: #131925; color: inherit; font: 600 14px var(--font-label); letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; }
.mu-car-now { display: grid; gap: 4px; }
.mu-car-now b { font: 700 clamp(28px, 7vw, 48px)/1.1 var(--font-display); letter-spacing: 0.03em; overflow-wrap: anywhere; }
.mu-car-now span { font: 16px var(--font-label); letter-spacing: 0.08em; color: #98a3ba; min-height: 1.3em; }
.mu-car-bar { display: block; height: 6px; margin-top: 8px; background: rgba(255, 255, 255, 0.12); position: relative; }
.mu-car-bar::before { content: ""; position: absolute; inset: 0; width: calc(var(--at, 0) * 100%); background: #4de8ff; }
.mu-car-keys { display: grid; grid-template-columns: 1fr 1.5fr 1fr; gap: 12px; flex: 1; min-height: 150px; }
.mu-car-keys button { display: grid; place-items: center; border: 1px solid rgba(205, 220, 255, 0.3); background: #131925; color: inherit; cursor: pointer; }
.mu-car-keys button.go { background: #4de8ff; color: #021418; border-color: #4de8ff; }
.mu-car-keys svg { width: clamp(48px, 14vw, 84px); height: clamp(48px, 14vw, 84px); fill: currentColor; }
.mu-car-starts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; overflow-y: auto; max-height: 34vh; }
.mu-car-starts button { min-height: 68px; padding: 0 12px; border: 1px solid rgba(205, 220, 255, 0.3); background: #131925; color: inherit; font: 600 18px/1.15 var(--font-display); letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mu-car-starts button:disabled { opacity: 0.35; }
body.car-open { overflow: hidden; }
@media (orientation: landscape) and (max-height: 520px) { .mu-car { flex-direction: row; flex-wrap: wrap; align-content: flex-start; } .mu-car-keys { flex: 1 1 60%; min-height: 110px; } .mu-car-now { flex: 1 1 100%; } .mu-car-starts { flex: 1 1 100%; max-height: 28vh; } }

/* the mini player: on every screen but this one while a song is loaded, tucked above the radio dock on phones */
.mini-player {
  position: fixed; z-index: 29; display: flex; align-items: center; gap: 4px; padding: 4px; color: #e9eef7;
  left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); max-width: 620px; margin: 0 auto;
  bottom: calc(max(12px, env(safe-area-inset-bottom)) + 94px); background: #0c0f16; box-shadow: inset 0 0 0 1px rgba(205, 220, 255, 0.25), 0 14px 30px -12px rgba(0, 0, 0, 0.8);
}
.mini-player[hidden] { display: none; }
html[data-dock="top"] .mini-player { bottom: max(12px, env(safe-area-inset-bottom)); }
.mini-open { flex: 1; min-width: 0; min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 6px; border: 0; background: none; color: inherit; cursor: pointer; text-align: left; }
.mini-disc { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--art, #333); box-shadow: 0 0 0 3px #0a0b0f, 0 0 0 4px rgba(255, 255, 255, 0.15); animation: mu-spin 3s linear infinite; animation-play-state: paused; }
.mini-disc.on { animation-play-state: running; }
.mini-text { display: grid; min-width: 0; }
.mini-text b { font: 600 14px var(--font-display); letter-spacing: 0.04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-text small { font: 11px var(--font-label); color: #98a3ba; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-key { flex: none; width: 48px; height: 48px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; display: grid; place-items: center; }
.mini-key svg { width: 22px; height: 22px; fill: currentColor; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
@media (min-width: 900px) {
  .mini-player { left: auto; right: 18px; bottom: 18px; width: 360px; margin: 0; }
  html[data-dock="top"] .mini-player { bottom: 18px; }
}
@keyframes mu-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mu-disc, .mini-disc { animation-duration: 14s; } .mu-bar { transition: none; } }
