/* Slipmat — felt, vinyl and a speed-reactive accent.
   The accent hue follows playback speed: gold at 1×, cooler when slowed,
   warmer when sped up (set from JS as --speed-hue). */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url('/fonts/archivo-latin.woff2') format('woff2-variations'), url('/fonts/archivo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url('/fonts/archivo-latin-ext.woff2') format('woff2-variations'), url('/fonts/archivo-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --felt: #24203a;
  --felt-2: #2c2746;
  --felt-3: #393259;
  --felt-4: #463e6b;
  --groove: #4a4270;
  --vinyl: #141220;
  --label: #f3f0ff;
  --label-2: #bdb7dc;
  --label-3: #9a94bd;
  --ink: #1b1829;
  --danger: #ff8f8f;
  --ok: #8fe3b0;
  --speed-hue: 85;
  --accent: #f2c14e;
  --accent-soft: rgba(242, 193, 78, 0.16);
  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans JP', 'Noto Sans KR', 'Noto Sans SC', sans-serif;
  --r-chip: 999px;
  --r-input: 10px;
  --r-cover: 6px;
  --r-sheet: 18px;
  --dock-h: 78px;
  --tabs-h: 0px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
@supports (color: oklch(0 0 0)) {
  :root {
    --accent: oklch(0.83 0.145 var(--speed-hue));
    --accent-soft: oklch(0.83 0.145 var(--speed-hue) / 0.16);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--felt);
  color: var(--label);
  font: 400 15px/1.5 var(--font);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; opacity: 0.45; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.i { width: 22px; height: 22px; flex: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { margin: 0; font-weight: 750; letter-spacing: -0.005em; }
h1 { font-size: 30px; line-height: 1.1; font-stretch: 118%; }
h2 { font-size: 20px; line-height: 1.2; font-stretch: 112%; font-weight: 700; }
h3 { font-size: 16px; line-height: 1.3; font-stretch: 106%; font-weight: 650; }
p { margin: 0; }
.muted { color: var(--label-2); }
.faint { color: var(--label-3); }
.small { font-size: 13px; }
.tnum { font-variant-numeric: tabular-nums; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- app shell ---------- */
.app {
  height: 100dvh;
  display: grid;
  grid-template: 'side main' 1fr 'dock dock' auto / 232px minmax(0, 1fr);
}
.side {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 14px 14px;
  background: var(--felt-2);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; }
.brand-word { font-size: 21px; font-weight: 820; font-stretch: 125%; letter-spacing: -0.01em; }
.side-nav { display: grid; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px;
  color: var(--label-2); text-decoration: none; font-weight: 560;
}
.nav-link:hover { color: var(--label); background: rgba(255, 255, 255, 0.04); }
.nav-link[aria-current='page'] { color: var(--label); background: var(--felt-3); }
.nav-link[aria-current='page'] .i { color: var(--accent); }
.badge {
  margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: var(--ink);
  font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums;
}
.side-section { display: grid; gap: 4px; min-height: 0; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 0 10px; color: var(--label-3); font-size: 13px; font-weight: 600; }
.side-list { display: grid; gap: 1px; }
.side-list a { padding: 6px 10px; border-radius: 8px; color: var(--label-2); text-decoration: none; font-size: 14px; }
.side-list a:hover { color: var(--label); background: rgba(255, 255, 255, 0.04); }
.side-list a[aria-current='page'] { color: var(--label); background: var(--felt-3); }
.side-foot { margin-top: auto; display: grid; gap: 2px; }

.main { grid-area: main; overflow-y: auto; overflow-x: hidden; scroll-behavior: auto; }
.view { padding: 28px 36px 48px; max-width: 1180px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin-top: 6px; }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.tabs { display: none; }

/* ---------- buttons & form controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 18px; border-radius: var(--r-chip);
  background: var(--felt-3); color: var(--label); font-weight: 620; white-space: nowrap; text-decoration: none;
  transition: background 0.15s;
}
.btn:hover:not(:disabled) { background: var(--felt-4); }
.btn .i { width: 20px; height: 20px; }
.btn-accent { background: var(--accent); color: var(--ink); }
.btn-accent:hover:not(:disabled) { background: var(--accent); filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--label-2); }
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.05); color: var(--label); }
.btn-danger { background: #5b2d3d; color: #ffd6d6; }
.btn-danger:hover:not(:disabled) { background: #6e3349; }
.btn-small { min-height: 32px; padding: 0 13px; font-size: 14px; }
.btn-big { min-height: 48px; padding: 0 24px; font-size: 16px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--label-2); flex: none;
}
.icon-btn:hover:not(:disabled) { color: var(--label); background: rgba(255, 255, 255, 0.06); }
.icon-btn.on { color: var(--accent); }
.icon-btn.small { width: 34px; height: 34px; }
.icon-btn.small .i { width: 19px; height: 19px; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--label-2); }
.field small { color: var(--label-3); font-size: 13px; }
input[type='text'], input[type='password'], input[type='search'], input[type='url'], input[type='number'], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 13px; border-radius: var(--r-input);
  background: var(--vinyl); border: 1px solid var(--groove); color: var(--label); font-size: 16px; outline: none;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
::placeholder { color: var(--label-3); opacity: 1; }
.stack { display: grid; gap: 14px; }
.form-error { color: var(--danger); font-size: 14px; min-height: 1em; }

.search {
  position: relative; display: flex; align-items: center;
}
.search .i { position: absolute; left: 12px; color: var(--label-3); width: 19px; height: 19px; pointer-events: none; }
.search input { padding-left: 38px; border-radius: var(--r-chip); background: var(--felt-2); border-color: transparent; }
.search input:focus { background: var(--vinyl); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; color: var(--label-2); }
.switch input { appearance: none; -webkit-appearance: none; width: 40px; height: 24px; margin: 0; border-radius: 999px; background: var(--felt-4); position: relative; transition: background 0.15s; flex: none; cursor: pointer; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--label); transition: transform 0.15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); background: var(--ink); }

input[type='range'] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0; background: transparent; cursor: pointer;
  --fill: 0%;
}
input[type='range']::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px;
  background: linear-gradient(to right, var(--felt-4) var(--from, 0%), var(--accent) var(--from, 0%) var(--fill), var(--felt-4) var(--fill));
}
input[type='range']::-moz-range-track { height: 4px; border-radius: 4px; background: var(--felt-4); }
input[type='range']::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
input[type='range'][data-bipolar]::-moz-range-progress { background: transparent; }
input[type='range'][data-bipolar]::-moz-range-track { background: linear-gradient(to right, var(--felt-4) var(--from, 0%), var(--accent) var(--from, 0%) var(--fill), var(--felt-4) var(--fill)); }
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--label); border: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
input[type='range']::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--label); border: 0; }
input[type='range']:focus-visible { outline: none; }
input[type='range']:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-soft); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px; border-radius: var(--r-chip);
  background: var(--felt-3); color: var(--label-2); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.chip:hover { color: var(--label); }
.chip[aria-pressed='true'] { background: var(--accent); color: var(--ink); }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--felt-2); gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; min-height: 32px; padding: 0 14px; border-radius: 999px; color: var(--label-2); font-size: 14px; font-weight: 600; white-space: nowrap; }
.seg button[aria-pressed='true'] { background: var(--felt-4); color: var(--label); }

/* ---------- covers ---------- */
.cover { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-cover); background: var(--felt-3); }
.cover-gen {
  display: grid; place-items: center; color: rgba(255, 255, 255, 0.88); font-weight: 800; font-stretch: 120%;
  background: hsl(var(--h) 34% 38%);
  container-type: inline-size;
}
@supports (color: oklch(0 0 0)) {
  .cover-gen { background: oklch(0.47 0.085 var(--h)); }
}
.cover-gen span { font-size: clamp(11px, 26cqi, 44px); letter-spacing: 0.02em; }

/* ---------- song rows ---------- */
.rows { display: grid; }
.row {
  display: grid; align-items: center; gap: 14px; min-height: 58px; padding: 6px 10px; border-radius: 10px;
  grid-template-columns: 44px minmax(0, 1fr) minmax(0, 0.55fr) 54px 22px 52px 36px;
}
.row:hover { background: rgba(255, 255, 255, 0.035); }
.row.selected { background: var(--accent-soft); }
.row-cover { position: relative; width: 44px; height: 44px; }
.row-cover .cover { width: 44px; height: 44px; }
.row-cover .play-hint {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: var(--r-cover);
  background: rgba(20, 18, 32, 0.6); color: var(--label); opacity: 0;
}
.row:hover .row-cover .play-hint, .row-cover:focus-visible .play-hint { opacity: 1; }
.row-main { min-width: 0; text-align: left; display: grid; }
.row-title { font-weight: 580; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 13px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-album { font-size: 13px; color: var(--label-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-bpm, .row-time { font-size: 13px; color: var(--label-3); text-align: right; font-variant-numeric: tabular-nums; }
.row-flag { color: var(--accent); display: grid; place-items: center; }
.row-flag .i { width: 17px; height: 17px; }
.row.is-playing .row-title { color: var(--accent); }
.row .kind { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; background: var(--felt-3); color: var(--label-2); font-size: 11px; font-weight: 650; line-height: 18px; vertical-align: 1px; }
.row-check { display: none; }
.selecting .row { grid-template-columns: 26px 44px minmax(0, 1fr) minmax(0, 0.55fr) 54px 22px 52px 36px; }
.selecting .row-check { display: grid; place-items: center; }
.row-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.row-grip { color: var(--label-3); cursor: grab; touch-action: none; }
.rows-sentinel { height: 40px; }
.rows-head {
  display: grid; gap: 14px; padding: 0 10px 8px; font-size: 13px; color: var(--label-3);
  grid-template-columns: 44px minmax(0, 1fr) minmax(0, 0.55fr) 54px 22px 52px 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06); margin-bottom: 6px;
}
.rows-head span:nth-child(4), .rows-head span:nth-child(6) { text-align: right; }
.selecting .rows-head { grid-template-columns: 26px 44px minmax(0, 1fr) minmax(0, 0.55fr) 54px 22px 52px 36px; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { flex: 1 1 260px; max-width: 420px; }
.toolbar select { width: auto; min-height: 40px; border-radius: 999px; background: var(--felt-2); border-color: transparent; font-size: 14px; padding: 0 34px 0 14px; }

.select-bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 -10px 12px; padding: 10px; border-radius: 12px; background: var(--felt-3);
}
.select-bar strong { margin-right: auto; font-weight: 650; }

.empty { display: grid; gap: 14px; justify-items: start; padding: 36px 0; max-width: 520px; }
.empty h2 { font-size: 22px; }

/* ---------- home ---------- */
.home-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 30px; }
.section { margin-bottom: 34px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head a { color: var(--label-2); font-size: 14px; text-decoration: none; }
.section-head a:hover { color: var(--label); }
.shelf {
  display: grid; grid-auto-flow: column; grid-auto-columns: 148px; gap: 16px; overflow-x: auto;
  scroll-snap-type: x proximity; padding-bottom: 8px; margin: 0 -4px; padding-left: 4px; scrollbar-width: thin;
}
.tile { display: grid; gap: 8px; text-align: left; scroll-snap-align: start; text-decoration: none; min-width: 0; }
.tile-art { position: relative; }
.tile-art .cover { box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.7); }
.tile-play {
  position: absolute; right: 8px; bottom: 8px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--ink); opacity: 0; transform: translateY(4px); transition: opacity 0.15s, transform 0.15s;
}
.tile:hover .tile-play, .tile:focus-within .tile-play { opacity: 1; transform: none; }
.tile-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-sub { font-size: 13px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: -6px; }
.mosaic { display: grid; grid-template-columns: 1fr 1fr; aspect-ratio: 1; border-radius: var(--r-cover); overflow: hidden; background: var(--felt-3); }
.mosaic .cover { border-radius: 0; }
.mosaic.one { grid-template-columns: 1fr; }

.liked-art { display: grid; place-items: center; aspect-ratio: 1; border-radius: var(--r-cover); background: var(--felt-3); color: var(--accent); }
.liked-art .i { width: 42%; height: 42%; }

/* ---------- playlist header ---------- */
.pl-head { display: flex; gap: 24px; align-items: flex-end; margin-bottom: 24px; flex-wrap: wrap; }
.pl-art { width: 180px; flex: none; }
.pl-info { display: grid; gap: 10px; min-width: 0; flex: 1 1 280px; }
.pl-info h1 { font-size: 38px; overflow-wrap: anywhere; }

/* ---------- dock (mini player) ---------- */
.dock {
  grid-area: dock; position: relative; z-index: 20;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr); align-items: center; gap: 16px;
  height: var(--dock-h); padding: 0 18px; background: var(--felt-2); border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.dock.empty-dock { color: var(--label-3); }
.dock-now { display: flex; align-items: center; gap: 12px; min-width: 0; text-align: left; border-radius: 12px; padding: 4px; margin-left: -4px; }
.dock-now:hover { background: rgba(255, 255, 255, 0.04); }
.mini-disc {
  position: relative; width: 52px; height: 52px; border-radius: 50%; flex: none; overflow: hidden;
  background: repeating-radial-gradient(circle, #17141f 0 1px, #1f1b2b 1px 2px);
}
.mini-disc .disc { inset: 0; box-shadow: none; }
.mini-disc .rim { display: none; }
.mini-disc .label { position: absolute; inset: 27%; border-radius: 50%; overflow: hidden; }
.mini-disc .label .cover { width: 100%; height: 100%; border-radius: 50%; }
.mini-disc .label .cover-gen span { display: none; }
.mini-disc::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: var(--felt); }
.dock-meta { display: grid; min-width: 0; }
.dock-title { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-artist { font-size: 13px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-center { display: grid; gap: 2px; justify-items: center; }
.transport { display: flex; align-items: center; gap: 8px; }
.play-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--label); color: var(--ink); display: grid; place-items: center; }
.play-btn:hover { background: #fff; }
.play-btn .i { width: 22px; height: 22px; }
.seekline { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; width: 100%; max-width: 560px; font-size: 12px; color: var(--label-3); font-variant-numeric: tabular-nums; }
.seekline span:last-child { text-align: right; }
.dock-right { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.speed-chip {
  min-height: 32px; padding: 0 12px; border-radius: 999px; background: var(--felt-3); color: var(--label-2);
  font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 6px;
}
.speed-chip:hover { color: var(--label); }
.speed-chip.active { background: var(--accent-soft); color: var(--accent); }
.vol { display: flex; align-items: center; gap: 4px; width: 150px; }
.dock-progress { display: none; }

/* ---------- now playing ---------- */
.np {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
  background: radial-gradient(120% 70% at 50% -10%, var(--accent-soft), transparent 60%), var(--felt);
  transform: translateY(100%); transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding-top: var(--safe-t);
}
.np.open { transform: none; }
.np-top { display: flex; align-items: center; gap: 8px; padding: 10px 14px; }
.np-from { flex: 1; text-align: center; font-size: 13px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-body {
  flex: 1; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px;
  padding: 8px 48px 40px; max-width: 1180px; width: 100%; margin: 0 auto; align-items: start;
}
.np-deck { display: grid; justify-items: center; gap: 22px; position: sticky; top: 0; }
.np-meta { display: grid; gap: 4px; width: 100%; max-width: 440px; }
.np-meta-row { display: flex; align-items: center; gap: 12px; }
.np-title { font-size: 26px; font-stretch: 112%; overflow-wrap: anywhere; flex: 1; min-width: 0; }
.np-artist { color: var(--label-2); font-size: 16px; text-align: left; }
.np-artist:hover { color: var(--label); text-decoration: underline; }
.np-seek { width: 100%; max-width: 440px; }
.np-seek .times { display: flex; justify-content: space-between; font-size: 12px; color: var(--label-3); font-variant-numeric: tabular-nums; margin-top: -2px; }
.np-transport { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 380px; }
.np-transport .play-btn { width: 64px; height: 64px; background: var(--accent); }
.np-transport .play-btn .i { width: 28px; height: 28px; }
.np-transport .icon-btn.big { width: 52px; height: 52px; }
.np-transport .icon-btn.big .i { width: 28px; height: 28px; }
.np-tracklist { width: 100%; max-width: 440px; font-size: 14px; color: var(--label-2); display: grid; gap: 4px; }
.np-tracklist button { display: flex; gap: 10px; text-align: left; padding: 4px 0; }
.np-tracklist button.on { color: var(--accent); }
.np-tracklist .tnum { color: var(--label-3); width: 46px; flex: none; }

/* The platter: grooves spin at 33⅓ rpm × speed; the strobe dots on the rim
   stand still at exactly 1× and drift when the speed is changed. */
.platter { position: relative; width: min(74vw, 420px, 46vh); aspect-ratio: 1; }
.platter-base { position: absolute; inset: 0; border-radius: 50%; background: #2a2540; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
.rim {
  position: absolute; inset: 0; border-radius: 50%;
  background: repeating-conic-gradient(var(--accent) 0 1.5deg, transparent 1.5deg 6deg);
  -webkit-mask: radial-gradient(circle closest-side, transparent calc(100% - 10px), #000 calc(100% - 10px) calc(100% - 4px), transparent calc(100% - 4px));
  mask: radial-gradient(circle closest-side, transparent calc(100% - 10px), #000 calc(100% - 10px) calc(100% - 4px), transparent calc(100% - 4px));
}
.disc {
  position: absolute; inset: 5.5%; border-radius: 50%;
  background:
    radial-gradient(circle closest-side, transparent 0 49%, rgba(255, 255, 255, 0.06) 49.4% 49.9%, transparent 50.4%),
    radial-gradient(circle closest-side, transparent 0 66%, rgba(255, 255, 255, 0.045) 66.3% 66.7%, transparent 67.1%),
    radial-gradient(circle closest-side, transparent 0 83%, rgba(255, 255, 255, 0.045) 83.3% 83.7%, transparent 84.1%),
    repeating-radial-gradient(circle closest-side, #15121f 0 1.2px, #1d1a2a 1.2px 2.4px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 6px 18px rgba(0, 0, 0, 0.45);
}
.disc-label { position: absolute; inset: 31%; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35); }
.disc-label .cover { width: 100%; height: 100%; border-radius: 50%; }
.disc-label .cover-gen span { font-size: clamp(14px, 22cqi, 40px); }
.spindle { position: absolute; left: 50%; top: 50%; width: 3.2%; height: 3.2%; transform: translate(-50%, -50%); border-radius: 50%; background: #d9d4ee; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.sheen {
  position: absolute; inset: 5.5%; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 210deg, transparent 0 8%, rgba(255, 255, 255, 0.07) 13%, transparent 20% 58%, rgba(255, 255, 255, 0.05) 63%, transparent 70%);
}

.np-sound { display: grid; gap: 22px; padding-top: 6px; }
.speed-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.speed-readout { display: grid; }
.speed-readout small { font-size: 13px; color: var(--label-2); font-weight: 600; }
.speed-num {
  font-size: 68px; line-height: 0.95; font-weight: 820; font-variant-numeric: tabular-nums; color: var(--accent);
  letter-spacing: -0.02em; transition: font-stretch 0.2s, color 0.2s;
}
.fader-wrap { position: relative; padding: 6px 0 22px; }
/* The speed control looks like a turntable pitch fader: a long slot with a
   centre detent at 1× and a cap with an indicator line. */
input[type='range'].fader { height: 44px; }
input[type='range'].fader::-webkit-slider-runnable-track {
  height: 10px; border-radius: 6px;
  background:
    linear-gradient(to right, transparent calc(50% - 1px), rgba(255, 255, 255, 0.5) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    var(--vinyl);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
}
input[type='range'].fader::-moz-range-track { height: 10px; border-radius: 6px; background: var(--vinyl); }
input[type='range'].fader::-moz-range-progress { background: transparent; }
input[type='range'].fader::-webkit-slider-thumb {
  width: 22px; height: 40px; margin-top: -15px; border-radius: 5px;
  background: linear-gradient(to bottom, #e9e5fa 0 45%, var(--accent) 45% 55%, #e9e5fa 55%);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
}
input[type='range'].fader::-moz-range-thumb { width: 22px; height: 40px; border-radius: 5px; border: 0; background: linear-gradient(to bottom, #e9e5fa 0 45%, var(--accent) 45% 55%, #e9e5fa 55%); }
input[type='range'].fader:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-soft), 0 3px 8px rgba(0, 0, 0, 0.5); }
.fader-scale { position: absolute; left: 11px; right: 11px; bottom: 0; height: 18px; font-size: 12px; color: var(--label-3); font-variant-numeric: tabular-nums; }
.fader-scale span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.fader-scale span::before { content: ''; position: absolute; left: 50%; top: -9px; width: 1px; height: 6px; background: var(--groove); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.fx-grid { display: grid; gap: 16px; padding: 18px; border-radius: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.05); }
.fx-row { display: grid; grid-template-columns: 92px 1fr 54px; align-items: center; gap: 12px; }
.fx-row label { font-size: 14px; font-weight: 600; color: var(--label-2); }
.fx-row output { text-align: right; font-size: 13px; color: var(--label-3); font-variant-numeric: tabular-nums; }
.fx-toggles { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.sound-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--felt-2); color: var(--label-2); font-size: 14px; }
.note .i { color: var(--accent); width: 20px; height: 20px; margin-top: 1px; }

/* ---------- sheets, menus, dialogs ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(12, 10, 22, 0.62); opacity: 0; transition: opacity 0.2s; }
.sheet {
  position: relative; width: min(520px, calc(100vw - 32px)); max-height: min(86vh, 760px); overflow: auto; outline: none;
  background: var(--felt-2); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  opacity: 0; transform: translateY(10px) scale(0.98); transition: opacity 0.2s, transform 0.2s;
}
.sheet-wrap.in .sheet-backdrop { opacity: 1; }
.sheet-wrap.in .sheet { opacity: 1; transform: none; }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 12px 8px 22px; background: var(--felt-2); }
.sheet-body { padding: 8px 22px 22px; }
.sheet-wrap.wide .sheet { width: min(760px, calc(100vw - 32px)); }
.menu-pop { align-items: flex-start; justify-content: flex-start; }
.menu-pop .sheet-backdrop { background: transparent; }
.menu-pop .sheet { position: absolute; border-radius: 12px; padding: 6px; transform: none; }
.menu-pop .sheet-body { padding: 0; }
.menu-list { display: grid; }
.menu-item { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 8px; text-align: left; font-size: 15px; }
.menu-item:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); }
.menu-item .i { width: 20px; height: 20px; color: var(--label-2); }
.menu-item small { margin-left: auto; color: var(--label-3); font-size: 12px; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger .i { color: var(--danger); }
.menu-divider { height: 1px; margin: 5px 8px; background: rgba(255, 255, 255, 0.07); }
.dialog-text { color: var(--label-2); margin-bottom: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

.toasts, #toasts {
  position: fixed; left: 50%; bottom: calc(var(--dock-h) + var(--tabs-h) + var(--safe-b) + 14px); transform: translateX(-50%);
  z-index: 80; display: grid; gap: 8px; width: min(460px, calc(100vw - 24px)); pointer-events: none;
}
.toast {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 12px;
  background: #4a4270; color: var(--label); box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.6); font-size: 14px;
  opacity: 0; transform: translateY(8px); transition: opacity 0.2s, transform 0.2s; pointer-events: auto;
}
.toast.in { opacity: 1; transform: none; }
.toast button { color: var(--accent); font-weight: 700; white-space: nowrap; }
.toast-error { background: #5b2d3d; }

/* ---------- add music ---------- */
.add-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.paste textarea { min-height: 200px; font-size: 15px; }
.paste .examples { font-size: 13px; color: var(--label-3); }
.drop {
  display: grid; gap: 10px; justify-items: start; padding: 20px; border-radius: 14px; border: 1.5px dashed var(--groove);
}
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.side-card { display: grid; gap: 12px; padding: 18px 0; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.side-card:first-child { border-top: 0; padding-top: 0; }
.jobs { display: grid; gap: 12px; margin-top: 34px; }
.job { padding: 16px 18px; border-radius: 14px; background: var(--felt-2); display: grid; gap: 10px; }
.job-head { display: flex; align-items: center; gap: 12px; }
.job-head h3 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-counts { font-size: 13px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 6px; background: var(--felt-4); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width 0.4s; }
.job-items { display: grid; gap: 2px; max-height: 340px; overflow-y: auto; margin: 0 -6px; }
.job-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 5px 6px; border-radius: 8px; font-size: 14px; }
.job-item .st { display: grid; place-items: center; color: var(--label-3); }
.job-item .st .i { width: 17px; height: 17px; }
.job-item.done .st { color: var(--ok); }
.job-item.error .st { color: var(--danger); }
.job-item.running .st { color: var(--accent); }
.job-item .msg { font-size: 12px; color: var(--label-3); }
.job-item.error .msg { color: var(--danger); }
.job-item .pct { font-size: 12px; color: var(--label-3); font-variant-numeric: tabular-nums; }
.job-item.group { font-weight: 650; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.legal { font-size: 13px; color: var(--label-3); max-width: 64ch; }

/* ---------- settings ---------- */
.settings { display: grid; gap: 30px; max-width: 760px; }
.set-card { display: grid; gap: 16px; padding: 22px; border-radius: 16px; background: var(--felt-2); }
.set-card h2 { font-size: 18px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.set-row > div { min-width: 0; flex: 1 1 260px; }
.set-row p { font-size: 14px; color: var(--label-2); }
.people { display: grid; gap: 2px; }
.person { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.person:first-child { border-top: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: hsl(var(--h) 35% 38%); flex: none; }
.person > div { flex: 1; min-width: 0; }
.qr-box { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.qr { width: 148px; height: 148px; border-radius: 12px; background: #fff; padding: 6px; flex: none; }
.link-box { display: flex; gap: 8px; align-items: center; min-width: 0; flex: 1 1 260px; }
.link-box code { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; background: var(--vinyl); font-size: 13px; overflow-wrap: anywhere; font-family: inherit; }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(420px, 100%); display: grid; gap: 22px; }
.auth-card .brand { padding: 0; }
.auth-card h1 { font-size: 28px; }
.auth-disc { width: 120px; height: 120px; }

/* ---------- mixer ---------- */
.mixer { display: grid; gap: 18px; }
.decks { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.deck { display: grid; gap: 14px; padding: 18px; border-radius: 16px; background: var(--felt-2); align-content: start; }
.deck-head { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.deck-head .cover { width: 56px; height: 56px; }
.deck-letter { font-size: 13px; font-weight: 800; color: var(--accent); font-stretch: 125%; }
.deck-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-sub { font-size: 13px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-bpm { text-align: right; font-variant-numeric: tabular-nums; }
.deck-bpm strong { display: block; font-size: 24px; font-weight: 800; line-height: 1; font-stretch: 90%; }
.deck-bpm small { font-size: 12px; color: var(--label-3); }
.wave { position: relative; height: 86px; border-radius: 10px; background: var(--vinyl); overflow: hidden; cursor: pointer; touch-action: none; }
.wave canvas { width: 100%; height: 100%; display: block; }
.wave .wave-empty { position: absolute; inset: 0; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--label-2); }
.wave .wave-empty:hover { color: var(--label); background: rgba(255, 255, 255, 0.03); }
.beats { display: flex; gap: 5px; align-items: center; }
.beat { width: 9px; height: 9px; border-radius: 2px; background: var(--felt-4); }
.beat.on { background: var(--accent); }
.deck-time { display: flex; justify-content: space-between; font-size: 12px; color: var(--label-3); font-variant-numeric: tabular-nums; margin-top: -8px; }
.deck-transport { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.deck-transport .play-btn { background: var(--accent); }
.deck-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.knob { display: grid; gap: 2px; }
.knob label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--label-2); }
.knob label.switch { justify-content: flex-start; font-size: 14px; }
.knob label output { color: var(--label-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.knob.full { grid-column: 1 / -1; }
.xfader { display: grid; gap: 10px; padding: 18px; border-radius: 16px; background: var(--felt-2); }
.xfader-row { display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; gap: 10px; font-weight: 800; color: var(--label-3); font-stretch: 125%; text-align: center; }
.xfader-row .fader { height: 44px; }
.mixer-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.rec-on { background: #b8304f !important; color: #fff !important; }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- picker ---------- */
.picker-list { display: grid; gap: 2px; max-height: 52vh; overflow-y: auto; margin: 10px -10px 0; }
.pick { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 6px 10px; border-radius: 10px; text-align: left; }
.pick:hover { background: rgba(255, 255, 255, 0.05); }
.pick .cover { width: 40px; height: 40px; }

/* ---------- phones ---------- */
@media (max-width: 819px) {
  :root { --dock-h: 64px; --tabs-h: 58px; }
  .app { grid-template: 'main' 1fr 'dock' auto 'tabs' auto / minmax(0, 1fr); }
  .side { display: none; }
  .view { padding: calc(18px + var(--safe-t)) 16px 32px; }
  h1 { font-size: 26px; }
  .page-head { margin-bottom: 16px; }
  .tabs {
    grid-area: tabs; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: var(--felt-2); border-top: 1px solid rgba(255, 255, 255, 0.04); z-index: 20;
  }
  .tab { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; color: var(--label-3); font-size: 11px; font-weight: 600; text-decoration: none; }
  .tab .i { width: 23px; height: 23px; }
  .tab[aria-current='page'] { color: var(--label); }
  .tab[aria-current='page'] .i { color: var(--accent); }
  .tab .badge { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; min-width: 18px; line-height: 17px; font-size: 11px; padding: 0 5px; }
  .dock { grid-template-columns: minmax(0, 1fr) auto; padding: 0 8px 0 10px; gap: 4px; border-top: 0; background: var(--felt-3); }
  .dock-center .seekline, .dock-right .vol, .dock .hide-phone, .dock .prev-btn { display: none; }
  .dock-center { order: 2; }
  .dock-right { display: none; }
  .mini-disc { width: 44px; height: 44px; }
  .play-btn { width: 40px; height: 40px; }
  .dock-progress { display: block; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: rgba(255, 255, 255, 0.08); }
  .dock-progress i { display: block; height: 100%; background: var(--accent); width: 0; }
  .row { grid-template-columns: 44px minmax(0, 1fr) 22px 36px; gap: 12px; padding: 6px 4px; }
  .row-album, .row-bpm, .row-time { display: none; }
  .selecting .row { grid-template-columns: 26px 44px minmax(0, 1fr) 22px 36px; }
  .rows-head { display: none; }
  .shelf { grid-auto-columns: 132px; gap: 12px; }
  .pl-art { width: 128px; }
  .pl-info h1 { font-size: 28px; }
  .np-body { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 0 20px calc(32px + var(--safe-b)); }
  .np-deck { position: static; }
  .speed-num { font-size: 56px; }
  .fx-row { grid-template-columns: 76px 1fr 48px; }
  .add-grid { grid-template-columns: minmax(0, 1fr); }
  .decks { grid-template-columns: minmax(0, 1fr); }
  .sheet-wrap:not(.menu-pop) { align-items: flex-end; }
  .sheet-wrap:not(.menu-pop) .sheet { width: 100%; max-height: 90dvh; border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding-bottom: var(--safe-b); transform: translateY(40px); }
  .sheet-wrap.in:not(.menu-pop) .sheet { transform: none; }
  .select-bar { margin: 0 -4px 12px; }
  .toolbar .search { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- getting the app ---------- */
.i.inline { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.22em; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; white-space: nowrap;
}
.pill .i { width: 16px; height: 16px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 12px; }
.steps li { position: relative; min-height: 24px; padding-left: 38px; color: var(--label-2); counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--felt-3); color: var(--label); font-size: 13px; font-weight: 700;
}
.steps strong { color: var(--label); font-weight: 650; }
.steps .btn { vertical-align: middle; }
.install-banner {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  margin-bottom: 22px; padding: 14px 8px 14px 14px; border-radius: 14px; background: var(--felt-2); border: 1px solid rgba(255, 255, 255, 0.06);
}
.install-banner img { border-radius: 10px; }
.install-banner-text { display: grid; gap: 2px; }
.install-banner-text p { font-size: 13px; color: var(--label-2); }
.install-banner-text strong { font-weight: 650; }
.install-banner-action { margin-top: 8px; }
.install-banner .icon-btn { margin-top: -6px; }
.set-sub { border-top: 1px solid rgba(255, 255, 255, 0.07); padding-top: 16px; }
