:root {
  --bg: #0a0e0f;
  --bg-2: #0f1517;
  --card: #121a1c;
  --card-2: #172124;
  --line: #1f2b2e;
  --line-2: #2a393c;
  --text: #e5eeee;
  --muted: #8da1a3;
  --faint: #5c6f71;
  --teal: #2dd4bf;
  --teal-2: #14b8a6;
  --teal-dim: rgba(45, 212, 191, 0.14);
  --side: #a78bfa;
  --warn: #fbbf24;
  --bad: #f87171;
  --good: #34d399;
  --radius: 14px;
  --font: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(1200px 500px at 50% -200px, rgba(45, 212, 191, 0.07), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.wrap { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 16px 48px; }
.admin-mode .wrap { max-width: 1180px; }

/* ------------------------------------------------------------ admin bar */
.admin-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 16px; background: rgba(10, 14, 15, 0.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted);
}
.admin-bar strong { color: var(--teal); font-weight: 600; letter-spacing: .04em; }

/* ------------------------------------------------------------ header */
.album-head { text-align: center; padding: 56px 0 28px; }
.album-head .artist { margin: 0; color: var(--teal); font-weight: 600; letter-spacing: .32em; text-transform: uppercase; font-size: 13px; }
.album-head h1 { margin: 6px 0 4px; font-size: clamp(40px, 9vw, 72px); font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.album-head .sub { margin: 10px 0 0; color: var(--faint); font-size: 13px; }

/* ------------------------------------------------------------ cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.player { padding: 20px; }
.now { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; min-height: 26px; }
.now-title { font-size: 18px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }

.eq-wrap { position: relative; }
canvas.eq { display: block; width: 100%; height: 220px; border-radius: 10px; background: var(--bg-2); }
@media (max-width: 560px) { canvas.eq { height: 170px; } }

.seek-row { display: flex; align-items: center; gap: 12px; margin: 16px 0 8px; font-size: 12px; color: var(--muted); }
.seek-row span { min-width: 38px; text-align: center; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0; --pct: 0%; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--teal) var(--pct), var(--line-2) var(--pct)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line-2); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--teal); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--text); margin-top: -5px; border: 0; }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 0; }
input[type=range]:focus-visible { outline: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--teal-dim); }

.controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.controls .transport { display: flex; align-items: center; gap: 10px; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); transition: color .15s, background .15s; }
.icon-btn:hover { color: var(--text); background: var(--card-2); }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
.play-btn { width: 54px; height: 54px; background: var(--teal); color: #032420; }
.play-btn:hover { background: #5eead4; color: #032420; }
.play-btn svg { width: 24px; height: 24px; }
.volume { display: flex; align-items: center; gap: 8px; width: 160px; color: var(--muted); }
.volume svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
@media (max-width: 480px) { .volume { width: 110px; } }

/* ------------------------------------------------------------ track list */
.tracklist { margin-top: 16px; padding: 6px; }
.tracklist ol { list-style: none; margin: 0; padding: 0; }
.track {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px;
  cursor: pointer; transition: background .12s;
}
.track:hover { background: var(--card-2); }
.track.active { background: var(--teal-dim); }
.track.active .t-name { color: var(--teal); }
.track .t-eq { width: 16px; height: 14px; display: flex; gap: 2px; align-items: flex-end; flex: none; }
.track .t-eq i { display: block; width: 3px; background: var(--teal); border-radius: 1px; height: 3px; }
.track.playing .t-eq i { animation: bounce 0.9s ease-in-out infinite; }
.track.playing .t-eq i:nth-child(2) { animation-delay: -.3s; }
.track.playing .t-eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes bounce { 0%, 100% { height: 3px; } 50% { height: 14px; } }
.track:not(.active) .t-eq i { background: transparent; }
.track .t-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track .t-dur { color: var(--faint); font-size: 12px; }
.track .t-dl { color: var(--faint); width: 32px; height: 32px; }
.track .t-dl svg { width: 17px; height: 17px; }
.empty { color: var(--faint); text-align: center; padding: 28px 12px; margin: 0; }

footer { text-align: center; padding: 8px 16px 32px; }
.link-btn { background: none; border: 0; color: var(--faint); font-size: 12px; padding: 6px 10px; border-radius: 6px; }
.link-btn:hover { color: var(--muted); }

/* ------------------------------------------------------------ forms & buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--card-2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #032420; font-weight: 600; }
.btn.primary:hover { background: #5eead4; }
.btn.danger { color: var(--bad); }
.btn.danger.confirm { background: var(--bad); color: #2a0606; border-color: var(--bad); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: default; }
.text-in { width: 100%; padding: 9px 11px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px; outline: none; }
.text-in:focus { border-color: var(--teal); }
label.field { display: block; font-size: 12px; color: var(--muted); }
label.field .text-in { margin-top: 5px; font-size: 14px; color: var(--text); }
.file-pick { position: relative; overflow: hidden; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 180px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 22px; background: var(--line-2); position: relative; transition: background .15s; margin: 0; cursor: pointer; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); transition: transform .15s; }
.switch input:checked { background: var(--teal); }
.switch input:checked::after { transform: translateX(16px); }

.progress { height: 4px; border-radius: 4px; background: var(--line-2); overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; width: 0; background: var(--teal); transition: width .15s; }

/* segmented control */
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; font-size: 12px; color: var(--muted); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--card-2); color: var(--teal); box-shadow: inset 0 0 0 1px var(--line-2); }

/* ------------------------------------------------------------ admin */
.admin { margin-top: 28px; }
.tabs { display: flex; gap: 4px; box-shadow: inset 0 -1px 0 var(--line); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 10px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; flex: none; }
.tabs button.on { color: var(--text); border-bottom-color: var(--teal); }
.panel { padding: 18px; margin-bottom: 14px; }
.panel h3 { margin: 0 0 12px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.panel h3 small { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--faint); font-size: 12px; }
.hint { color: var(--faint); font-size: 12px; margin: 8px 0 0; }

.monitor-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 22px; }
/* long option names (references) must not widen the grid past the card */
.monitor-grid > * { min-width: 0; }
select.text-in { min-width: 0; max-width: 100%; text-overflow: ellipsis; }
.ctl-label { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }

.meters { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .meters { grid-template-columns: 1fr; } }
.meters .panel, .meters > .card.panel + .card.panel { margin: 0; } /* side by side: no stacking gap */

.lufs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.readout { background: var(--bg-2); border-radius: 10px; padding: 10px 12px; }
.readout .k { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.readout .v { font-family: var(--mono); font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.readout .v small { font-size: 11px; color: var(--faint); margin-left: 3px; }
.readout.big .v { font-size: 30px; color: var(--teal); }
.readout .v.warn { color: var(--warn); }
.readout .v.bad { color: var(--bad); }

canvas.meter { display: block; width: 100%; background: var(--bg-2); border-radius: 10px; }
canvas.scope { aspect-ratio: 1 / 1; max-width: 240px; margin: 0 auto; }

.bar-meter { margin-bottom: 12px; }
.bar-meter .top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.bar-meter .top b { font-family: var(--mono); font-weight: 500; color: var(--text); }
.bar-meter .track-bar { position: relative; height: 8px; border-radius: 8px; background: var(--bg-2); overflow: hidden; }
.bar-meter .ok-zone { position: absolute; top: 0; bottom: 0; background: rgba(52, 211, 153, 0.14); }
.bar-meter .centre { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--faint); left: 50%; }
.bar-meter .needle { position: absolute; top: -1px; bottom: -1px; width: 4px; margin-left: -2px; border-radius: 3px; background: var(--teal); transition: left .25s ease, background .25s; left: 50%; }
.bar-meter .scale { display: flex; justify-content: space-between; font-size: 10px; color: var(--faint); margin-top: 3px; font-family: var(--mono); }

/* analysis report */
.report-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 16px 0; }
.platforms { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.chip { font-size: 12px; padding: 4px 10px; border-radius: 20px; background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); }
.chip b { color: var(--text); font-family: var(--mono); font-weight: 500; }
.findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.findings li { display: grid; grid-template-columns: 10px 1fr; gap: 12px; padding: 11px 13px; background: var(--bg-2); border-radius: 10px; font-size: 14px; }
.findings li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: var(--muted); }
.findings li.bad::before { background: var(--bad); }
.findings li.warn::before { background: var(--warn); }
.findings li.good::before { background: var(--good); }
.findings li.info::before { background: var(--teal); }
.findings .tip { display: block; color: var(--faint); font-size: 12.5px; margin-top: 3px; }
.chart-box { position: relative; }
canvas.chart { display: block; width: 100%; height: 260px; background: var(--bg-2); border-radius: 10px; }
canvas.chart.tall { height: 300px; }
canvas.chart.short { height: 120px; margin-top: 8px; cursor: pointer; }
canvas.chart.spectro { cursor: pointer; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
table.res { width: 100%; border-collapse: collapse; font-size: 13px; }
table.res th { text-align: left; font-weight: 500; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.res td { padding: 8px; border-bottom: 1px solid var(--line); }
table.res td.mono { white-space: nowrap; }

/* admin track manager */
.manage-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.manage-list li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 10px; background: var(--bg-2); border-radius: 10px; }
.manage-list .num { color: var(--faint); font-family: var(--mono); text-align: right; }
.manage-list .meta { font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.manage-list .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .manage-list li { grid-template-columns: 24px 1fr; } .manage-list .acts { grid-column: 1 / -1; justify-content: flex-start; } }

/* login dialog */
dialog { background: var(--card); color: var(--text); border: 1px solid var(--line-2); border-radius: 16px; padding: 26px; width: min(340px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, .65); backdrop-filter: blur(3px); }
dialog h2 { margin: 0 0 14px; font-size: 18px; }
dialog .pin { font-family: var(--mono); font-size: 26px; letter-spacing: .4em; text-align: center; padding: 12px; }
dialog .err { color: var(--bad); font-size: 13px; min-height: 20px; margin: 8px 0; }
dialog .row { justify-content: flex-end; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--card-2); border: 1px solid var(--line-2); padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 50; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--bad); color: #fecaca; }

/* ============================================================ v2 additions */
/* cover */
.album-head .cover { display: block; width: min(240px, 60vw); aspect-ratio: 1; object-fit: cover; margin: 0 auto 22px; border-radius: 12px; box-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 0 0 1px var(--line); }
.cover-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* waveform seek */
.wave-wrap { position: relative; flex: 1; height: 40px; }
.wave-wrap canvas.wave { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.wave-wrap input[type=range] { position: absolute; inset: 0; height: 100%; opacity: 0; cursor: pointer; }
.wave-wrap:has(input:focus-visible) { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }

/* lyrics */
.btn.ghost { background: transparent; }
.btn.ghost.on { color: var(--teal); border-color: var(--teal); }
.lyrics { white-space: pre-wrap; margin-top: 16px; padding: 16px 18px; background: var(--bg-2); border-radius: 10px; color: var(--muted); font-size: 14px; line-height: 1.7; max-height: 340px; overflow-y: auto; }
.lyrics-edit { margin-top: 8px; font-size: 13px; resize: vertical; }
@media (max-width: 480px) { .controls { flex-wrap: wrap; } }

/* help */
.h-right { display: inline-flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; }
.help-btn { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1; padding: 0; display: inline-grid; place-items: center; vertical-align: middle; }
.help-btn:hover { color: var(--teal); border-color: var(--teal); }
.help-btn.on-eq { position: absolute; top: 8px; left: 8px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--card); border-left: 1px solid var(--line-2); box-shadow: -20px 0 60px rgba(0, 0, 0, .5); transform: translateX(105%); transition: transform .22s ease; z-index: 60; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 17px; }
.drawer-body { padding: 6px 20px 30px; overflow-y: auto; font-size: 14px; color: var(--muted); }
.drawer-body h4, .help-page h2 { color: var(--text); margin: 18px 0 6px; }
.help-page h2 { font-size: 16px; margin-top: 6px; }
.drawer-body b, .help-page b { color: var(--text); font-weight: 600; }
.drawer-body ul, .help-page ol { padding-left: 18px; }
.drawer-body li, .help-page li { margin: 5px 0; }
.drawer-body .note { font-size: 12.5px; color: var(--faint); border-left: 2px solid var(--line-2); padding-left: 10px; }
.help-page { color: var(--muted); font-size: 14px; }
.help-page .workflow li { margin: 8px 0; }
.glossary { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.glossary dt { color: var(--text); font-weight: 600; }
.glossary dd { margin: 0; }
.help-links { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 560px) { .glossary { grid-template-columns: 1fr; } .glossary dd { margin-bottom: 8px; } }

/* drop zones */
.drop-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .drop-pair { grid-template-columns: 1fr; } }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 110px; padding: 16px; border: 1.5px dashed var(--line-2); border-radius: 12px; background: var(--bg-2); color: var(--muted); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop b { font-size: 22px; color: var(--teal); }
.drop em { font-style: normal; font-family: var(--mono); font-size: 12px; color: var(--text); word-break: break-all; }
.drop.over { border-color: var(--teal); background: var(--teal-dim); }
.drop.has { border-style: solid; border-color: var(--line-2); }
.drop.wide { min-height: 90px; }

.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; margin-right: 6px; vertical-align: middle; }
.findings .tip { display: block; color: var(--faint); font-size: 12.5px; margin-top: 4px; }

/* comparisons */
.changes { margin-top: 18px; }
.changes .platforms { margin-top: 6px; }
.chip.chg b, td.chg { color: var(--warn); }
.chip.better b { color: var(--good); }
.chip.worse b { color: var(--bad); }
.warn-txt { color: var(--warn); }
table.res tr.dim td { color: var(--faint); }
.table-scroll { overflow-x: auto; }
table.album td, table.album th { white-space: nowrap; }
details.report-details > summary { cursor: pointer; font-weight: 600; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
details.report-details[open] > summary { margin-bottom: 12px; }
.card.panel + .card.panel, #cmp-result > .card { margin-top: 14px; }

/* v3: bounce numbers, report source, compare sources */
.track .t-bounce { flex: none; font-size: 11px; padding: 2px 7px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); color: var(--faint); }
.track.active .t-bounce { color: var(--teal); border-color: var(--teal-dim); }
.bounce-field { flex: none; width: 84px; }
.manage-list .title-row { display: flex; gap: 8px; align-items: center; }
.manage-list .title-row .text-in:first-child { flex: 1; min-width: 0; }
.manage-list .bounce-field { display: flex; align-items: center; gap: 6px; width: auto; font-size: 11.5px; color: var(--faint); }
.manage-list .bounce-in { width: 64px; padding: 6px 8px; text-align: center; }
.cmp-slot { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cmp-src { font-size: 13px; padding: 7px 8px; }
.report-actions .seg button:disabled { opacity: .4; cursor: not-allowed; }
@media (max-width: 640px) { .manage-list .title-row { flex-wrap: wrap; } }

/* v4: bulk upload, album chart picker */
.card.over { border-color: var(--teal); background: var(--teal-dim); }
.bulk-list { list-style: none; margin: 14px 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bulk-list li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.bulk-list li.dim { opacity: .5; }
.bulk-file { font-size: 11.5px; color: var(--faint); margin-bottom: 6px; word-break: break-all; }
.bulk-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bulk-row > .text-in { flex: 1; min-width: 160px; }
.bulk-row > select.text-in { flex: 0 1 220px; min-width: 150px; padding: 7px 8px; font-size: 13px; }
.bulk-row .bounce-field, .bulk-list .bounce-field { display: flex; align-items: center; gap: 6px; width: auto; font-size: 11.5px; color: var(--faint); }
.bulk-list .bounce-in { width: 58px; padding: 6px 8px; text-align: center; }
.bulk-list .meta { display: block; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.album-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; align-items: center; }
.album-pick .chip { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; user-select: none; }
.album-pick .chip.off { opacity: .4; }
.album-pick .chip.off .swatch { background: transparent !important; outline: 1.5px solid var(--line-2); }

/* ---- admin: docked mini player */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(15, 21, 23, 0.94); backdrop-filter: blur(8px); border-top: 1px solid var(--line-2); transform: translateY(100%); transition: transform .2s ease; }
.dock.show { transform: translateY(0); }
.dock-in { max-width: 1180px; margin: 0 auto; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 14px; }
.dock .transport { display: flex; align-items: center; gap: 4px; flex: none; }
.dock .icon-btn { width: 34px; height: 34px; }
.dock .play-btn { width: 40px; height: 40px; }
.dock-now { min-width: 0; width: 240px; flex: none; }
.dock-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-time { font-size: 11px; color: var(--muted); }
.dock input[type=range] { flex: 1; min-width: 80px; }
body.docked { padding-bottom: 64px; }
body.docked .toast { bottom: 80px; }
.dock .dock-vol { width: 130px; flex: none; }
.dock .dock-vol input[type=range] { flex: 1; min-width: 0; }
@media (max-width: 640px) { .dock-now { width: auto; flex: 1; } #dock-seek, #dock-top, .dock .dock-vol { display: none; } }

/* ---- Settings: plugin how-to */
details.guide { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
details.guide summary { cursor: pointer; font-weight: 600; color: var(--teal); font-size: 14px; }
details.guide h4 { margin: 16px 0 6px; font-size: 13px; color: var(--text); }
details.guide p, details.guide li { font-size: 13px; color: var(--muted); line-height: 1.55; }
details.guide p { margin: 6px 0; }
details.guide ol, details.guide ul { margin: 6px 0; padding-left: 20px; }
details.guide li { margin-bottom: 4px; }
details.guide b { color: var(--text); font-weight: 500; }
details.guide code { font-family: var(--mono); font-size: 12px; background: var(--bg-2); padding: 1px 5px; border-radius: 5px; }

/* accounts: login / signup / forgot dialog, account bar */
dialog .field { display: block; margin-bottom: 12px; }
dialog .field .text-in { width: 100%; box-sizing: border-box; margin-top: 4px; }
dialog [hidden] { display: none !important; }
.login-links { display: grid; gap: 6px; justify-items: start; margin: 14px 0 0; }
.login-links .link-btn { font-size: 13px; }
.admin-bar .bar-btns { display: flex; gap: 6px; flex-shrink: 0; }
.beta-code { font-family: var(--mono); letter-spacing: .03em; }
.badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--bg-2); color: var(--faint); margin-left: 6px; }
.badge.open { color: var(--teal); }

/* project switcher in the account bar */
.bar-select { width: auto; max-width: 220px; padding: 5px 8px; font-size: 13px; }
@media (max-width: 640px) { .admin-bar { flex-wrap: wrap; } .bar-select { max-width: 150px; } }

/* storage meter in the account bar */
.storage-meter { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; margin-right: 10px; font-family: var(--mono); font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.storage-meter i { display: block; width: 70px; height: 5px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.storage-meter i b { display: block; height: 100%; width: 0; background: var(--teal); }
.storage-meter.full i b { background: var(--warn, #f59e0b); }
@media (max-width: 640px) { .storage-meter i { display: none; } }

/* ------------------------------------------------------------ sites & landing (site.js) */
body[data-view="landing"] .album-head, body[data-view="landing"] .player, body[data-view="landing"] .tracklist,
body[data-view="pending"] .album-head, body[data-view="pending"] .player, body[data-view="pending"] .tracklist,
body[data-view="projects"] .album-head, body[data-view="projects"] .player, body[data-view="projects"] .tracklist { display: none; }
.landing { text-align: center; padding: 64px 0 36px; }
.landing .artist { margin: 0; color: var(--teal); font-weight: 600; letter-spacing: .32em; text-transform: uppercase; font-size: 13px; }
.landing h1 { font-size: clamp(36px, 7vw, 64px); margin: 10px 0 14px; letter-spacing: -.02em; }
.landing .lead { max-width: 620px; margin: 0 auto 24px; color: var(--muted); line-height: 1.6; }
.landing-btns { justify-content: center; gap: 10px; }
.explore { margin: 18px 0 40px; }
.explore-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.explore-head h2 { font-size: 18px; margin: 0; }
body[data-view="projects"] .explore { margin-top: 48px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.project-card { display: block; color: inherit; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; transition: border-color .15s; }
.project-card:hover { border-color: var(--teal); }
.project-card .art { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--bg-2); margin-bottom: 10px; }
.project-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-card .cover-ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 42px; font-weight: 700; color: var(--teal); opacity: .5; }
.pc-title { font-weight: 600; }
.pc-meta { font-size: 12px; color: var(--faint); margin-top: 3px; }
.back-link { margin: 18px 0 0; font-size: 13px; }
.back-link a, .explore-head a { color: var(--teal); }
footer #footer-app { text-decoration: none; }

/* mix.jambi.co.uk header for visitors */
.site-nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: rgba(10, 14, 15, 0.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-nav .brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.site-nav .brand svg { width: 20px; height: 20px; color: var(--teal); }
.site-nav .brand small { color: var(--teal); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; font-weight: 600; }
.site-nav nav { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.site-nav nav a { color: var(--muted); text-decoration: none; }
.site-nav nav a:hover, .site-nav nav a.on { color: var(--teal); }
.admin-bar #bar-published { text-decoration: none; }
body[data-site="album"] #bar-published { display: none; }
@media (max-width: 480px) { .site-nav .brand small { display: none; } .site-nav nav { gap: 10px; } }

/* collapsible track list (owners) */
.tl-toggle { display: block; width: 100%; margin-top: 4px; padding: 7px; border: 0; border-top: 1px solid var(--line); background: none;
  color: var(--faint); font: inherit; font-size: 12px; cursor: pointer; border-radius: 0 0 var(--radius) var(--radius); }
.tl-toggle:hover { color: var(--teal); }
.tl-toggle::after { content: ' \25BE'; }
.tracklist:not(.collapsed) .tl-toggle::after { content: ' \25B4'; }
/* collapsed: only the playing track (or the first, before anything has played) */
.tracklist.collapsed ol:has(li.active) li.track:not(.active),
.tracklist.collapsed ol:not(:has(li.active)) li.track:not(:first-child) { display: none; }

/* Admin tab: server storage + users */
.server-meter { display: flex; align-items: center; gap: 12px; }
.server-meter i { flex: 1; height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.server-meter b { display: block; height: 100%; width: 0; background: var(--teal); }
.server-meter.warn b { background: var(--warn); }
.server-meter span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.user-storage { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 11.5px; color: var(--faint); }
.user-storage i { width: 120px; height: 5px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.user-storage b { display: block; height: 100%; background: var(--teal); }
.user-storage.full b { background: var(--warn); }
.user-extra { display: grid; gap: 8px; margin-top: 10px; }
.user-extra .text-in { width: 180px; padding: 6px 8px; }
.badge.danger-badge { color: var(--bad); }
.manage-list li.dim { opacity: .6; }

/* legal links + signup agreement */
footer .legal-links { display: inline-flex; gap: 14px; margin-right: 14px; font-size: 12px; }
footer .legal-links a { color: var(--faint); text-decoration: none; }
footer .legal-links a:hover { color: var(--teal); }
dialog .agree { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin: 4px 0 8px; }
dialog .agree a { color: var(--teal); }
dialog a { color: var(--teal); }
