:root {
  --bg: #0C0C0E;
  --surface: #151518;
  --surface-2: #111114;
  --raised: #1E1E22;
  --line: #26262B;
  --line-2: #3A3A41;
  --text: #F2F2F0;
  --text-2: #C9C9D0;
  --muted: #9A9AA3;
  --faint: #8B8B94;
  --accent: #D4FF3A;
  --on-accent: #0C0C0E;
  --warn-bg: #23180F; --warn-line: #5A3A1E; --warn-text: #FFD2A8;
  --ok-bg: #171D0C; --ok-line: #3B4A1A; --ok-text: #E3F5B0;
  --display: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--display); }
body { min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--text); }
a:hover { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::placeholder { color: var(--faint); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1320px; width: 100%; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; padding-top: 16px; padding-bottom: 16px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark { width: 30px; height: 30px; flex: none; }
.logo-name { font-weight: 700; font-size: 20px; letter-spacing: 0.06em; color: var(--text); text-transform: uppercase; }
.nav { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 15px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
.user-area { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.counter { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.counter strong { color: var(--text); }
.badge { font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line-2); }
.badge-on { border-color: var(--accent); color: var(--accent); }

/* ---------- buttons & fields ---------- */
.btn { height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font-weight: 500; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--text-2); color: var(--text); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn-accent:hover { color: var(--on-accent); filter: brightness(1.06); }
.btn-small { height: 36px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #B4B4BC; min-width: 0; }
.field-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.input, .select { height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 15px; width: 100%; min-width: 0; }
.input[readonly] { background: #1A1A1E; color: var(--text-2); }

/* ---------- hero ---------- */
.hero .wrap { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-end; justify-content: space-between; padding-top: 56px; padding-bottom: 32px; }
.eyebrow { margin: 0 0 16px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.hero h1 { margin: 0; font-size: clamp(40px, 6vw, 76px); line-height: 0.95; font-weight: 700; letter-spacing: -0.025em; }
.lead { margin: 20px 0 0; font-size: 18px; line-height: 1.5; color: #B4B4BC; max-width: 560px; }
.stats { display: flex; flex-wrap: wrap; gap: 12px; }
.stat { padding: 16px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); min-width: 140px; }
.stat-n { font-family: var(--mono); font-size: 32px; font-weight: 600; }
.stat-l { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.search { flex: 1 1 260px; display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; height: 44px; color: var(--muted); }
.search input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: var(--text); font-size: 15px; height: 40px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font-weight: 500; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.pill[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pill .n { font-family: var(--mono); font-size: 12px; opacity: 0.75; }
.filters .field { flex: 0 0 auto; }
.filters .select { min-width: 130px; }
.resultbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 12px; }
.resultbar p { margin: 0; font-size: 14px; color: var(--muted); }
.resultbar strong { color: var(--text); }

/* ---------- track table ---------- */
.table-box { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.table { min-width: 1080px; }
.row { display: grid; grid-template-columns: 44px 44px minmax(220px, 1.5fr) minmax(200px, 1.6fr) 56px 56px 112px 76px 180px; align-items: center; gap: 16px; padding: 12px 16px; border-top: 1px solid #1E1E22; }
.row-head { border-top: none; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.row.is-current { background: #18181D; }
.play { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--raised); color: var(--text); display: flex; align-items: center; justify-content: center; padding: 0; }
.row.is-current .play { background: var(--accent); color: var(--on-accent); }
.cover { width: 44px; height: 44px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font: 600 13px var(--mono); }
.t-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.t-title span:first-child { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag-new { flex: none; font: 600 10px var(--mono); letter-spacing: 0.06em; padding: 3px 6px; border-radius: 4px; background: var(--accent); color: var(--on-accent); text-transform: uppercase; }
.t-sub { font-size: 13px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-sub b { font-weight: 400; color: var(--text-2); }
.wave { display: flex; align-items: center; gap: 2px; height: 36px; cursor: pointer; }
.wave span { flex: 1 1 0; background: #3A3A41; border-radius: 1px; min-height: 2px; }
.row.is-current .wave span { background: #6A6A73; }
.row.is-current .wave span.on { background: var(--accent); }
.keychip { font-family: var(--mono); font-size: 13px; padding: 4px 0; text-align: center; border-radius: 6px; background: var(--raised); color: #E4E4E8; }
.genre { font-size: 13px; color: #B4B4BC; }
.date { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.dls { display: flex; gap: 8px; justify-content: flex-end; }
.dl { height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font: 500 13px var(--mono); display: flex; align-items: center; gap: 6px; }
.dl.done { border-color: var(--accent); color: var(--accent); }
.dl[disabled] { opacity: 0.35; cursor: not-allowed; }
.empty { padding: 48px 16px; border-top: 1px solid #1E1E22; text-align: center; color: var(--muted); font-size: 15px; }
.more { display: flex; justify-content: center; margin-top: 20px; }
.note { margin: 16px 0 0; font-size: 13px; color: var(--faint); }
.banner { margin-bottom: 12px; padding: 14px 16px; border-radius: 12px; font-size: 14px; border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--warn-text); }
.banner-ok { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok-text); }

/* ---------- player ---------- */
.player { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); margin-top: auto; }
.player .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding-top: 14px; padding-bottom: 14px; }
.p-info { display: flex; align-items: center; gap: 12px; min-width: 220px; flex: 1 1 240px; }
.p-info .cover { width: 48px; height: 48px; font-size: 14px; }
.p-title { font-weight: 600; font-size: 15px; }
.p-sub { font-size: 13px; color: var(--muted); }
.p-toggle { width: 48px; height: 48px; border-radius: 50%; border: none; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; padding: 0; }
.p-bar { flex: 2 1 320px; display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.p-track { flex: 1; height: 4px; border-radius: 2px; background: #2E2E34; overflow: hidden; cursor: pointer; }
.p-fill { height: 4px; width: 0; background: var(--accent); }
.p-note { font-size: 12px; color: var(--faint); }

/* ---------- dialog ---------- */
dialog.modal { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); padding: 28px; width: min(440px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(0, 0, 0, 0.6); }
.modal h2 { margin: 0 0 8px; font-size: 22px; }
.modal p { margin: 0 0 16px; color: #B4B4BC; line-height: 1.5; font-size: 15px; }
.modal form { display: flex; flex-direction: column; gap: 14px; }
.modal-close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 10px; border: none; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 96px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: calc(100vw - 32px); }
.toast { padding: 12px 16px; border-radius: 10px; background: var(--raised); border: 1px solid var(--line-2); font-size: 14px; transition: opacity .3s, transform .3s; }
.toast-ok { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok-text); }
.toast-err { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-text); }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ---------- admin ---------- */
.page-title { margin: 0; font-size: clamp(32px, 4vw, 48px); font-weight: 700; letter-spacing: -0.02em; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 24px; }
.card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 20px; }
.drop { border: 1.5px dashed var(--line-2); border-radius: 16px; padding: 40px 24px; text-align: center; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.drop.over { border-color: var(--accent); background: #15180C; }
.drop h2 { margin: 0; font-size: 20px; }
.drop p { margin: 0; font-size: 14px; color: var(--muted); max-width: 480px; line-height: 1.5; }
.opts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 4px; font-size: 14px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.queue { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.item { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 16px; }
.item-head { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: baseline; }
.item-files { font-family: var(--mono); font-size: 12px; color: var(--muted); word-break: break-all; }
.item-status { font-size: 13px; color: var(--text-2); }
.item-status.ok { color: var(--accent); }
.item-status.err { color: var(--warn-text); }
.item-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.item-grid .wide { grid-column: span 2; }
.bar { height: 4px; border-radius: 2px; background: #2E2E34; overflow: hidden; margin-top: 12px; }
.bar > div { height: 4px; width: 0; background: var(--accent); transition: width .2s; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 20px; }
.list { display: flex; flex-direction: column; }
.list-row { display: grid; grid-template-columns: minmax(200px, 2fr) minmax(110px, 1fr) 110px minmax(150px, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid #1E1E22; font-size: 14px; }
.list-row:first-child { border-top: none; }
.list-row .muted { color: var(--muted); font-size: 13px; }
.list-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.status-chip { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 8px; border-radius: 6px; background: var(--raised); justify-self: start; }
.status-chip.published { color: var(--accent); }
.gate { padding: 80px 0; text-align: center; }
.gate p { color: var(--muted); }

@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .hero .wrap { padding-top: 36px; }
  .list-row { grid-template-columns: 1fr; gap: 6px; }
  .list-actions { justify-content: flex-start; }
  .item-grid .wide { grid-column: auto; }
  .toasts { bottom: 140px; }
}

/* etiquetas y especiales */
.tagchip { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font: 500 11px var(--mono); letter-spacing: 0.02em; cursor: pointer; vertical-align: 1px; }
.tagchip:hover, .tagchip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.specials { margin: 0 0 18px; }
.special-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 1px solid #FF7A1A; background: rgba(255, 122, 26, 0.10); color: #FF9A4D; font-weight: 600; font-size: 15px; }
.special-btn .n { font-family: var(--mono); font-size: 12px; opacity: 0.8; }
.special-btn:hover { background: rgba(255, 122, 26, 0.18); }
.special-btn[aria-pressed="true"] { background: #FF7A1A; color: #0C0C0E; }
