/* ───────────── Tokens ───────────── */
:root {
  --bg: #0a0a0c; --side: #000; --surface: #121216; --surface-2: #1a1a20; --surface-3: #24242c; --hover: #ffffff0f;
  --line: #ffffff14; --line-2: #ffffff24;
  --text: #f4f4f6; --muted: #a3a3ad; --faint: #6b6b76;
  --accent: #1ed760; --accent-2: #3be477; --accent-ink: #04130a;
  --warn: #f5c451; --bad: #ff6b6b; --good-bg: #1ed76018;
  --radius: 12px; --radius-sm: 8px;
  --pbh: 88px; --sidew: 232px;
  --font: "Figtree", system-ui, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--surface-3); padding: 2px 7px; border-radius: 6px; font-size: 12.5px; }
small, .hint, .muted { color: var(--muted); }
.hint { font-size: 12.5px; margin: 6px 0; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
::selection { background: var(--accent); color: var(--accent-ink); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: #ffffff26; border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #ffffff40; }

/* ───────────── Controles base ───────────── */
button { font: inherit; color: var(--text); background: var(--surface-3); border: 1px solid transparent; border-radius: 999px; padding: 8px 16px; cursor: pointer; font-weight: 600; transition: transform .08s, background .15s, border-color .15s; }
button:hover { background: #2e2e38; }
button:active { transform: scale(.97); }
button.primary { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
button.primary:hover { background: var(--accent-2); transform: scale(1.03); }
button.ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
button.ghost:hover { border-color: var(--text); background: transparent; }
button.danger { background: transparent; border-color: #ff6b6b55; color: var(--bad); }
button.danger:hover { border-color: var(--bad); background: #ff6b6b12; }
button.big { padding: 12px 28px; font-size: 15px; }
button.mini { padding: 4px 11px; font-size: 12px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 11px; outline: none; transition: border-color .15s, background .15s; }
input:hover, select:hover, textarea:hover { border-color: var(--line-2); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: var(--surface-3); }
input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; border: 0; padding: 0; height: 18px; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: #ffffff30; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--text); margin-top: -4.5px; box-shadow: 0 2px 6px #0008; }
input[type=range]:hover::-webkit-slider-thumb { background: var(--accent); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: #ffffff30; }
input[type=range]::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: var(--text); }
input[type=range]:disabled { opacity: .35; cursor: default; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
body.busy .needs-idle { opacity: .45; pointer-events: none; }

/* ───────────── Layout ───────────── */
.app { display: grid; grid-template-columns: var(--sidew) minmax(0, 1fr); gap: 8px; height: calc(100vh - var(--pbh)); padding: 8px 8px 0; }
.side { background: var(--surface); border-radius: var(--radius); display: flex; flex-direction: column; padding: 18px 12px 12px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; padding: 0 8px 18px; }
.brand .logo { font-size: 26px; }
.brand small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button, .nav-settings { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border-radius: var(--radius-sm); padding: 10px 12px; color: var(--muted); font-weight: 700; font-size: 14.5px; }
.nav button:hover, .nav-settings:hover { color: var(--text); background: var(--hover); transform: none; }
.nav button.active, .nav-settings.active { color: var(--text); background: var(--surface-3); }
.nav .ic, .nav-settings .ic { width: 20px; text-align: center; font-size: 16px; }
.nav button.active .ic { color: var(--accent); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 16px; }
#status { display: flex; flex-direction: column; gap: 4px; padding: 0 12px; font-size: 12px; color: var(--muted); }
.dot { display: flex; align-items: center; gap: 8px; }
.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok::before { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.dot.no::before { background: var(--bad); }
.view { background: var(--surface); border-radius: var(--radius) var(--radius) 0 0; overflow-y: auto; position: relative; padding-bottom: 60px; }
.tab { display: none; }
.tab.active { display: block; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

@media (max-width: 860px) {
  :root { --sidew: 0px; }
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; padding: 0; gap: 0; }
  .side { flex-direction: row; align-items: center; border-radius: 0; padding: 8px; overflow-x: auto; gap: 4px; }
  .brand { padding: 0 8px 0 4px; font-size: 0; } .brand .logo { font-size: 22px; } .brand small { display: none; }
  .nav { flex-direction: row; } .nav button, .nav-settings { padding: 8px 10px; font-size: 13px; white-space: nowrap; }
  .side-foot { margin: 0 0 0 auto; padding: 0; flex-direction: row; } #status { display: none; }
  .view { border-radius: 0; }
}

/* ───────────── Encabezados (hero) ───────────── */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 56px 28px 24px; border-radius: var(--radius) var(--radius) 0 0; }
.hero h1 { font-size: clamp(34px, 5vw, 64px); font-weight: 800; line-height: 1; letter-spacing: -0.03em; margin: 2px 0 10px; }
.hero .eyebrow { margin: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #ffffffcc; }
.hero .sub { margin: 0; color: #ffffffb3; max-width: 560px; }
.hero-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hero-green { background: linear-gradient(180deg, #1f6b3f 0%, #17402a 55%, var(--surface) 100%); }
.hero-violet { background: linear-gradient(180deg, #5b3aa8 0%, #33245e 55%, var(--surface) 100%); }
.hero-blue { background: linear-gradient(180deg, #24548f 0%, #1a3354 55%, var(--surface) 100%); }
.hero-amber { background: linear-gradient(180deg, #8f5a1d 0%, #4d3417 55%, var(--surface) 100%); }
.hero-gray { background: linear-gradient(180deg, #3d3d48 0%, #24242b 55%, var(--surface) 100%); }
.tab > :not(.hero) { margin-left: 28px; margin-right: 28px; }
@media (max-width: 640px) { .hero { padding: 32px 16px 18px; } .tab > :not(.hero) { margin-left: 16px; margin-right: 16px; } }

/* ───────────── Tarjetas ───────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h3 { font-size: 16px; font-weight: 700; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.badge { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--good-bg); color: var(--accent); }
.badge.no { background: #ff6b6b18; color: var(--bad); }
.sec-title { font-size: 20px; font-weight: 800; margin-top: 30px !important; margin-bottom: 12px !important; }
.sec-title small { display: block; font-size: 13px; font-weight: 500; margin-top: 2px; }
.steps { padding-left: 20px; margin: 8px 0; font-size: 13px; }
.steps li { margin-bottom: 6px; }
.howto summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600; margin: 4px 0; }
.inline { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.inline input { flex: 1; min-width: 160px; }
.check { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.warn { background: #3a2f1288; border: 1px solid var(--warn); color: var(--warn); padding: 10px 14px; border-radius: var(--radius-sm); margin-top: 8px; }
.privacy { background: var(--good-bg); border: 1px solid #1ed76033; border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12.5px; color: #c9f5d9; }

/* Fuentes */
.src-card { display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, opacity .15s; }
.src-card.off { opacity: .78; }
.src-card > .badge { align-self: flex-start; }
.src-card.off:hover { opacity: 1; }
.src-card.on { border-color: #1ed76040; }
.src-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.src-top h3 a { color: var(--text); }
.src-kind { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.src-kind.comercial { color: var(--warn); }
.src-desc { font-size: 13px; color: var(--muted); margin: 0; }
.caps { display: flex; flex-wrap: wrap; gap: 5px; }
.cap { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: #d6d6dd; }
.src-weight { display: grid; grid-template-columns: auto 1fr 36px; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #ffffff30; border-radius: 999px; cursor: pointer; transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .18s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }

/* Bienvenida / vacío */
.welcome { background: linear-gradient(135deg, #1ed76022, #5b3aa822); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.welcome h2 { font-size: 22px; margin-bottom: 6px; }
.welcome > p { color: var(--muted); }
.qs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 14px 0 10px; }
.qs-opt { background: #0006; border: 1px solid var(--line-2); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.qs-opt b { font-size: 15px; }
.qs-opt p { margin: 0; font-size: 13px; color: var(--muted); }
.qs-opt .inline { display: flex; gap: 6px; }
.qs-opt .inline input { flex: 1; min-width: 0; }
.qs-opt > button { align-self: flex-start; }
.qs-warn { color: #f5c26b !important; }
.qs-req summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.qs-req .inline { margin-top: 6px; }
.qs-keys { display: grid; gap: 10px; margin: 14px 0 16px; }
.qs-key { background: #0006; border: 1px solid var(--line-2); border-left: 3px solid #f5c26b; border-radius: 12px; padding: 12px 14px; }
.qs-key.ok { border-left-color: var(--accent, #1ed760); }
.qs-key b small { color: var(--muted); font-weight: 500; }
.qs-key .steps { margin: 8px 0; padding-left: 20px; font-size: 13px; color: var(--muted); }
.qs-key .steps li { margin: 3px 0; }
.qs-key .steps code { color: var(--text); background: var(--surface-3); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
.qs-key .inline { display: flex; gap: 6px; flex-wrap: wrap; }
.qs-key .inline input { flex: 1; min-width: 220px; }
.qs-key details summary { cursor: pointer; margin-top: 6px; color: var(--muted); font-weight: 600; font-size: 13px; }
.qs-need { color: #f5c26b !important; }
.site-incl { color: var(--accent, #1ed760); font-size: 13px; margin: 4px 0; }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty-ic { font-size: 46px; opacity: .4; margin-bottom: 6px; }

/* ───────────── Generar ───────────── */
.gen { display: block; }
/* Barra de modo: Simple | Avanzado (se ve uno solo) */
.mode-bar { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; flex-wrap: wrap; }
.mode-btn { background: var(--surface-2); border: 1px solid var(--line-2); color: var(--muted); padding: 8px 18px; }
.mode-btn:hover { color: var(--text); background: var(--surface-3); transform: none; }
.mode-btn.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.mode-hint { color: var(--muted); font-size: 12.5px; margin-left: 6px; }
/* Avanzado: a todo el ancho, una sección a la vez */
.adv-card { margin-bottom: 18px !important; padding: 16px 18px; }
.adv-top { display: flex; flex-direction: column; gap: 10px; }
.adv-top .algo-summary { margin-bottom: 0; }
.presetbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.presetbar select { width: auto; min-width: 200px; max-width: 320px; flex: 0 1 auto; }
.sec-tabs { display: flex; gap: 4px; margin: 14px 0 12px; padding: 4px; background: var(--surface); border-radius: 999px; overflow-x: auto; scrollbar-width: none; }
.sec-tabs::-webkit-scrollbar { display: none; }
.sec-tabs button { flex: 1 0 auto; background: transparent; color: var(--muted); padding: 7px 14px; font-size: 13px; white-space: nowrap; }
.sec-tabs button:hover { color: var(--text); background: transparent; transform: none; }
.sec-tabs button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 4px #0006; }
.sec-desc { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.tune-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; align-items: start; }
.gen-actions { margin-bottom: 18px !important; padding: 16px 18px; }
.gen-actions .genres { margin-top: 0; padding-top: 0; border-top: 0; }
.seg { display: flex; background: var(--surface); border-radius: 999px; padding: 3px; margin: 4px 0 6px; gap: 2px; }
.seg label { flex: 1; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 6px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); transition: background .15s, color .15s; }
.seg label:hover span { color: var(--text); }
.seg input:checked + span { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 4px #0006; }
.slider { display: grid; grid-template-columns: 1fr 120px 42px; align-items: center; gap: 8px; margin: 7px 0; font-size: 13px; }
.slider.bip { grid-template-columns: 64px 1fr 72px 38px; font-size: 12px; color: var(--muted); }
.slider.bip span:last-of-type { text-align: right; }
.slider input { width: 100%; }
output { font-variant-numeric: tabular-nums; color: var(--accent); font-size: 12px; font-weight: 600; text-align: right; }
.block { display: block; margin-top: 10px; font-size: 13px; }
.block input, .block select { width: 100%; margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 13px; }
.grid2 input[type=number] { width: 100%; margin-top: 4px; }
#featTable { width: 100%; border-collapse: collapse; font-size: 12px; }
#featTable th { text-align: left; color: var(--faint); font-weight: 600; padding: 2px 3px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
#featTable td { padding: 4px 3px; vertical-align: middle; border-top: 1px solid var(--line); }
#featTable input[type=range] { width: 64px; }
#featTable input[type=number] { width: 46px; padding: 3px 4px; font-size: 11.5px; }
#featTable output { display: inline-block; min-width: 46px; }
#featTable .tgt.auto output { color: var(--faint); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { background: var(--surface-3); border-radius: 999px; padding: 3px 4px 3px 11px; font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; }
.chip button { background: none; padding: 0 6px; color: var(--muted); font-weight: 400; }
.seedsearch { position: relative; }
.seedsearch input { width: 100%; }
#seedSugg { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface-3); border: 1px solid var(--line-2); border-radius: var(--radius-sm); max-height: 260px; overflow-y: auto; box-shadow: 0 10px 30px #000a; }
#seedSugg:empty { display: none; }
#seedSugg div { padding: 8px 12px; cursor: pointer; font-size: 13px; }
#seedSugg div:hover { background: var(--hover); }

#saveBar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 4px 0 16px; }
#saveBar[hidden] { display: none; }
#plName { flex: 1; min-width: 200px; background: transparent; border-color: transparent; font-size: 22px; font-weight: 800; padding: 6px 8px; }
#plName:hover { border-color: var(--line-2); }
#plName:focus { background: var(--surface-2); }
.play-all { width: 52px; height: 52px; border-radius: 50%; padding: 0; background: var(--accent); color: var(--accent-ink); font-size: 20px; display: grid; place-items: center; box-shadow: 0 8px 20px #0007; }
.play-all:hover { background: var(--accent-2); transform: scale(1.05); }
#saveMsg { font-size: 13px; }

/* ───────────── Listas de canciones ───────────── */
.list-head, .row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 54px 56px auto; gap: 14px; align-items: center; padding: 6px 12px; }
.list-head { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); margin-bottom: 6px; padding-bottom: 8px; }
.list-head span:nth-child(4) { text-align: right; }
.list-head[hidden], .welcome[hidden], .warn[hidden] { display: none; }
.row { border-radius: var(--radius-sm); cursor: pointer; transition: background .12s; }
.row:hover { background: var(--hover); }
.num { color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; position: relative; }
.row:hover .num span { visibility: hidden; }
.row:hover .num::after { content: "▶"; position: absolute; inset: 0; color: var(--text); font-size: 12px; display: grid; place-items: center; }
.row.playing .num span { visibility: hidden; }
.row.playing .num::after { content: "♫"; position: absolute; inset: 0; color: var(--accent); display: grid; place-items: center; }
.track-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cover { position: relative; width: 44px; height: 44px; flex: none; padding: 0; border: 0; border-radius: 5px; overflow: hidden; background: var(--surface-3); }
.cover:hover { background: var(--surface-3); transform: none; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.meta { min-width: 0; }
.meta .title { color: var(--text); font-weight: 600; font-size: 14.5px; }
.row.playing .meta .title { color: var(--accent); }
.meta .ext { margin-left: 6px; font-size: 12px; color: var(--faint); opacity: 0; transition: opacity .12s; }
.row:hover .meta .ext { opacity: 1; }
.meta .ext:hover { color: var(--accent); text-decoration: none; }
.sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.why { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; align-items: center; }
.part { font-size: 10.5px; font-weight: 600; background: var(--good-bg); color: #8ef0b4; border-radius: 4px; padding: 1px 6px; }
.part.neg { background: #ff6b6b18; color: #ffa3a3; }
.part.nodata { background: var(--surface-3); color: var(--faint); }
.via { font-size: 11px; color: var(--faint); }
.fbars { display: flex; gap: 3px; align-items: flex-end; height: 30px; }
.fbars i { display: block; width: 7px; background: var(--accent); border-radius: 2px; opacity: .85; }
.fbars i:nth-child(2) { background: #f5c451; } .fbars i:nth-child(3) { background: #7aa7ff; } .fbars i:nth-child(4) { background: #d38cff; }
.score { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; color: var(--muted); }
.acts { display: flex; gap: 0; opacity: .35; transition: opacity .12s; }
.row:hover .acts, .row.playing .acts { opacity: 1; }
.acts button { padding: 5px 7px; background: none; font-weight: 400; border-radius: 6px; }
.acts button:hover { background: var(--surface-3); transform: none; }
@media (max-width: 700px) {
  .list-head { display: none; }
  .row { grid-template-columns: 26px minmax(0, 1fr); }
  .row .fbars, .row .score { display: none; }
  .acts { grid-column: 2; opacity: 1; }
}

/* ───────────── IA ───────────── */
.ia-wrap { max-width: 860px; }
.prompt-card { padding: 14px; }
#aiPrompt { width: 100%; resize: vertical; font-size: 15px; padding: 12px 14px; margin-bottom: 4px; }
#aiExamples button, .aiFollowups button, .turn-ai .chips button { border-radius: 999px; font-size: 12.5px; padding: 5px 12px; background: var(--surface-3); font-weight: 600; }
#aiExamples button:hover, .aiFollowups button:hover { background: #33333d; }
#aiGuide { margin: 8px 0; }
#aiGuide summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600; }
.guide { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 10px; font-size: 13px; }
.guide label input, .guide label select { width: 100%; margin-top: 4px; }
.guide .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .guide { grid-template-columns: 1fr; } }
.seg-3 { margin: 12px 0 4px; }
.lbl { font-size: 13px; color: var(--muted); font-weight: 600; }
button.tog { font-size: 12.5px; padding: 5px 12px; font-weight: 600; }
button.tog.on { background: var(--accent); color: var(--accent-ink); }
#aiChat { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
#aiChat:empty { display: none; }
.turn-user { align-self: flex-end; max-width: 80%; background: var(--surface-3); border-radius: 16px 16px 4px 16px; padding: 9px 14px; font-size: 14px; white-space: pre-wrap; }
.turn-user small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.turn-ai { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: 12px 14px; font-size: 14px; max-width: 92%; }
.turn-ai::before { content: "✦ IA"; display: block; font-size: 11px; font-weight: 700; color: #b9a0ff; margin-bottom: 4px; letter-spacing: .05em; }
.turn-ai ul { margin: 6px 0; padding-left: 20px; font-size: 13px; }
.turn-ai details { font-size: 13px; margin-top: 6px; }
.turn-ai summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.turn-ai .why { color: var(--faint); display: inline; }
.refine { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.refine[hidden] { display: none; }
.refine .aiRefineInput { flex: 1; min-width: 200px; }
.gen-refine { background: linear-gradient(135deg, #5b3aa822, transparent); border: 1px solid #5b3aa855; border-radius: var(--radius); padding: 10px 12px; margin: 0 0 14px; }
.gen-refine .lbl { color: #b9a0ff; }
.ia-wrap .privacy { margin-top: 18px; }

/* ───────────── Perfil ───────────── */
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; min-width: 140px; color: var(--muted); font-size: 13px; }
.stat b { display: block; font-size: 26px; font-weight: 800; color: var(--text); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.pgrid h3 { margin-bottom: 10px; }
.pgrid h3 small { display: block; font-weight: 500; font-size: 12px; }
.bars .b { display: grid; grid-template-columns: 110px 1fr 66px; gap: 10px; align-items: center; margin: 7px 0; font-size: 13px; }
.bars .b span:last-child { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.track { position: relative; height: 6px; background: var(--surface-3); border-radius: 6px; }
.track .fill { position: absolute; top: 0; bottom: 0; left: 0; background: var(--accent); border-radius: 6px; }
.track .band { position: absolute; top: -4px; bottom: -4px; border: 1px solid #ffffff40; border-radius: 4px; }
.tagcloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tagcloud button { padding: 5px 12px; font-size: 12.5px; }
/* Elegidos bien visibles: verde = favorecer al generar · rojo = evitar */
.tagcloud button.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; opacity: 1; }
.tagcloud button.on:hover { background: var(--accent-2); }
.tagcloud button.off { background: #ff6b6b26; color: #ff9b9b; border: 1px solid #ff6b6b55; opacity: 1; }
/* Buscador de estilos: escribir filtra, clic agrega */
.style-picker { margin-top: 6px; }
.style-picker .sp-in { width: 100%; }
.sp-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; max-height: 170px; overflow-y: auto; align-items: center; }
.sp-list .hint { width: 100%; margin: 0; }
.sp-opt { padding: 4px 11px; font-size: 12.5px; font-weight: 600; background: var(--surface); border: 1px dashed var(--line-2); color: var(--text); }
.sp-opt:hover { background: #ff6b6b26; border: 1px solid #ff6b6b88; color: #ffb3b3; transform: none; }
.sp-opt:hover::before { content: '⊘ '; }
.chip.chip-bad { background: #ff6b6b26; color: #ffb3b3; }
#advBlockTags { margin-bottom: 4px; }
/* Mi perfil: peso de cada artista */
.aw-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.aw-head h3 { margin: 0 !important; display: flex; align-items: center; gap: 6px; }
.aw-simple { columns: 2; column-gap: 24px; margin: 0; padding-left: 22px; font-size: 13.5px; color: #d6d6dd; }
.aw-simple li { padding: 2px 0; break-inside: avoid; }
.aw-simple li.up { color: var(--accent, #1ed760); font-weight: 600; }
.aw-simple li.down { opacity: .6; }
.aw-x { font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 99px; background: var(--surface-3); color: inherit; }
.aw-card:has(.aw-add) { grid-column: 1 / -1; }
.aw-add { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.aw-add input { flex: 1; min-width: 200px; }
.aw-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 4px 18px; }
.aw-list li { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto auto; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; font-size: 13px; }
.aw-list li:hover { background: var(--surface-3); }
.aw-list li.up .aw-name { color: var(--accent, #1ed760); font-weight: 600; }
.aw-list li.down .aw-name { opacity: .65; }
.aw-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aw-tag { font-size: 10.5px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 99px; padding: 0 6px; }
.aw-bar { height: 6px; background: #ffffff14; border-radius: 6px; overflow: hidden; }
.aw-bar i { display: block; height: 100%; background: var(--accent, #1ed760); opacity: .75; border-radius: 6px; }
.aw-list select { padding: 3px 6px; font-size: 12px; }
.aw-del { padding: 2px 8px !important; }
@media (max-width: 600px) { .aw-list { grid-template-columns: 1fr; } .aw-list li { grid-template-columns: minmax(0, 1fr) 50px auto auto; } }
.artists { columns: 2; font-size: 13px; padding-left: 20px; margin: 0; color: #d6d6dd; }

.libbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
#libSearch { flex: 1; min-width: 220px; }

/* ───────────── Tarea en curso ───────────── */
#runBar { position: fixed; left: calc(var(--sidew) + 24px); bottom: calc(var(--pbh) + 10px); z-index: 16; max-width: min(760px, calc(100vw - var(--sidew) - 260px));
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 9px 12px; box-shadow: 0 12px 40px #000c; animation: fade .18s ease-out; }
@media (max-width: 860px) { #runBar { left: 12px; right: 12px; max-width: none; bottom: calc(var(--pbh) + 52px); } }
.run-main { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1 1 220px; font-size: 13px; font-weight: 600; }
#runText { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spin { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid #ffffff30; border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#runServices { display: flex; flex-wrap: wrap; gap: 5px; }
#runServices:empty { display: none; }
.svc { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--muted); }
.svc i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.svc.busy i { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.svc.failing { border-color: #f5c45188; color: var(--warn); }
.svc.failing i { background: var(--warn); }
.svc b { font-weight: 400; opacity: .5; }
button.svc:hover { border-color: var(--text); color: var(--text); background: var(--surface-2); transform: none; }
button.svc:hover b { opacity: 1; }
.svc.skipped { text-decoration: line-through; opacity: .55; }

/* ───────────── Actividad ───────────── */
#activity { position: fixed; right: 16px; bottom: calc(var(--pbh) + 10px); width: min(520px, calc(100vw - 32px)); background: var(--surface-3); border: 1px solid var(--line-2); border-radius: var(--radius); z-index: 15; box-shadow: 0 12px 40px #000c; }
#activity:not([open]) { width: auto; max-width: min(520px, calc(100vw - 32px)); }
#activity summary { padding: 8px 14px; cursor: pointer; font-weight: 700; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#progress { font-weight: 500; color: var(--accent); margin-left: 8px; }
#log { max-height: 200px; overflow-y: auto; padding: 0 14px 12px; font: 11.5px/1.55 ui-monospace, Consolas, monospace; color: var(--muted); }

/* ───────────── Reproductor ───────────── */
#pbar { position: fixed; left: 0; right: 0; bottom: 0; height: var(--pbh); z-index: 20; background: var(--side);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: 16px; padding: 0 16px; }
.pb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pb-img { width: 56px; height: 56px; flex: none; border-radius: 6px; background: var(--surface-3); overflow: hidden; box-shadow: 0 4px 12px #0008; }
.pb-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pb-img img:not([src]), .pb-img img[src=""] { visibility: hidden; }
.pb-meta { min-width: 0; }
#pbTitle { display: block; color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pbArtist { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-center { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.pb-ctrls { display: flex; align-items: center; gap: 16px; }
.pb-ctrls button { background: none; color: var(--muted); font-size: 16px; padding: 4px 6px; font-weight: 400; }
.pb-ctrls button:hover { color: var(--text); background: none; }
.pb-ctrls .pb-play { width: 34px; height: 34px; border-radius: 50%; background: var(--text); color: #000; font-size: 14px; display: grid; place-items: center; padding: 0; }
.pb-ctrls .pb-play:hover { transform: scale(1.06); background: var(--text); color: #000; }
.pb-prog { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 600px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pb-prog input { flex: 1; }
#embedWrap { width: 100%; max-width: 560px; height: 80px; }
#embedWrap[hidden] { display: none; }
#embedWrap iframe { border-radius: 10px; }
body.pb-embed { --pbh: 128px; }
body.pb-embed .pb-prog, body.pb-embed .pb-play { display: none; }
.pb-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; font-size: 12px; color: var(--muted); }
#pbMode { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-vol { display: flex; align-items: center; gap: 6px; }
.pb-vol input { width: 96px; }
@media (max-width: 760px) {
  #pbar { grid-template-columns: minmax(0, 1fr) auto; }
  .pb-right, .pb-prog { display: none; }
}

/* ───────────── Explorar ───────────── */
.hero-teal { background: linear-gradient(180deg, #146b6b 0%, #143f42 55%, var(--surface) 100%); }
.ex-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.ex-engine { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ex-engine .seg { min-width: 360px; }
.subtabs { display: flex; gap: 6px; margin: 16px 0 14px !important; flex-wrap: wrap; }
.subtabs button { background: var(--surface-2); color: var(--muted); }
.subtabs button.active { background: var(--text); color: #000; }
.ex-pane { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px !important; }
.ex-pane .slider { max-width: 560px; }
.ex-pane > button { margin-top: 10px; }
.ex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 8px; }
@media (max-width: 760px) { .ex-grid { grid-template-columns: 1fr; } .ex-engine .seg { min-width: 0; width: 100%; } }
.picker { position: relative; display: flex; flex-direction: column; gap: 6px; }
.picker input { width: 100%; }
.pick-chosen:empty { display: none; }
.pick-chosen .one { display: flex; align-items: center; gap: 8px; background: var(--surface-3); border-radius: var(--radius-sm); padding: 6px 10px; font-size: 13px; }
.pick-chosen .one button { margin-left: auto; background: none; padding: 0 4px; color: var(--muted); font-weight: 400; }
.picker[data-picker=sub] .chip { background: #ff6b6b22; }
.picker[data-picker=add] .chip { background: var(--good-bg); }
.pick-sugg { position: absolute; z-index: 6; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: var(--radius-sm); max-height: 240px; overflow-y: auto; box-shadow: 0 10px 30px #000a; }
.pick-sugg:empty { display: none; }
.pick-sugg div { padding: 8px 12px; cursor: pointer; font-size: 13px; }
.pick-sugg div:hover { background: var(--hover); }
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-top: 14px; }
.group { border-radius: var(--radius); padding: 14px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--gc, var(--accent)); display: flex; flex-direction: column; gap: 6px; }
.group h4 { margin: 0; font-size: 15px; }
.group .gsub { font-size: 12px; color: var(--muted); }
.group .gsample { font-size: 12.5px; color: #cfcfd6; margin: 4px 0; }
.group .inline { margin-top: auto; }
.map-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; }
.map-wrap { position: relative; }
#mapCanvas { width: 100%; height: 520px; display: block; background: radial-gradient(circle at 50% 50%, #1b1b22, #101014); border-radius: var(--radius); cursor: crosshair; }
#mapTip { position: absolute; pointer-events: none; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; box-shadow: 0 8px 20px #000a; max-width: 260px; }
#mapLegend { margin-top: 10px; }
#mapLegend span { font-size: 12px; display: inline-flex; align-items: center; gap: 6px; background: var(--surface-3); padding: 3px 10px; border-radius: 999px; }
#mapLegend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
#exOut { margin-top: 6px !important; }
.ex-savebar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
#exName { flex: 1; min-width: 200px; background: transparent; border-color: transparent; font-size: 20px; font-weight: 800; }
#exName:hover { border-color: var(--line-2); }
.recency { margin-bottom: 14px !important; }
.recency select { max-width: 520px; }

/* ───────────── Exportar / Mis playlists ───────────── */
.hero-pink { background: linear-gradient(180deg, #8f2a6b 0%, #4d1d3f 55%, var(--surface) 100%); }
.hero-red { background: linear-gradient(180deg, #9b2c2c 0%, #4f1d1d 55%, var(--surface) 100%); }
.export { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ghost-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 14px; list-style: none; user-select: none; }
.ghost-btn::-webkit-details-marker { display: none; }
.ghost-btn:hover { border-color: var(--text); }
.ghost-btn.mini { padding: 4px 11px; font-size: 12px; }
details.menu { position: relative; }
details.menu > div { position: absolute; z-index: 12; top: calc(100% + 6px); right: 0; min-width: 210px; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 6px; box-shadow: 0 14px 40px #000c; display: flex; flex-direction: column; }
details.menu > div button { background: none; text-align: left; border-radius: 6px; font-weight: 500; padding: 8px 10px; }
details.menu > div button:hover { background: var(--hover); transform: none; }
details.menu small label { font-weight: 400; color: var(--muted); }
.file-btn { font-size: 13px; padding: 6px 14px; }
.block textarea { width: 100%; margin-top: 4px; resize: vertical; font-size: 13px; }
#libSourcesCard .block { margin-top: 12px; }
#myPlaylists { display: flex; flex-direction: column; gap: 10px; }
.pl-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.pl-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pl-meta { flex: 1; min-width: 200px; display: flex; flex-direction: column; }
.pl-meta b { font-size: 16px; }
.pl-meta small { color: var(--muted); font-size: 12.5px; }
.mini-play { width: 40px; height: 40px; font-size: 15px; }
.pl-list { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 6px; }
.pl-how { background: var(--surface); border-radius: var(--radius-sm); padding: 8px 12px; margin: 4px 0 10px; font-size: 13px; color: #d6d6dd; }
.pl-how p { margin: 3px 0; }
.pl-how b { color: var(--text); }
.pl-old { margin: 4px 0 8px; }

/* Mini reproductor de YouTube (debe quedar visible: mínimo 200×200 según YouTube) */
#ytMini { position: fixed; right: 16px; bottom: calc(var(--pbh) + 56px); width: 356px; height: 200px; z-index: 18; background: #000; border-radius: 12px; overflow: hidden; box-shadow: 0 14px 40px #000c; border: 1px solid var(--line-2); }
#ytMiniHost, #ytMiniHost iframe { width: 100%; height: 100%; display: block; border: 0; }
#ytMiniClose { position: absolute; top: 6px; right: 6px; padding: 2px 8px; font-size: 12px; background: #000a; }
@media (max-width: 760px) { #ytMini { left: 12px; right: 12px; width: auto; } }

/* ───────────── Modo TV ───────────── */
.tv-legal { margin-bottom: 16px !important; font-size: 13px; }
.tv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.tv-grid h3 { margin-bottom: 8px; }
.slot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.slot input[type=time] { width: 104px; padding: 5px 7px; }
.slot select { flex: 1; min-width: 140px; padding: 5px 7px; font-size: 13px; }
#tvAddSlot { margin-top: 10px; }
#tvStage { position: fixed; inset: 0; z-index: 300; background: #000; color: #fff; cursor: none; }
#tvStage.show-ui { cursor: default; }
#tvVideo, #tvVideo iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tv-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: 3vh 3vw; font-size: clamp(16px, 2.2vw, 34px); font-weight: 800; text-shadow: 0 2px 12px #000; pointer-events: none; background: linear-gradient(#0009, transparent); }
#tvClock { font-variant-numeric: tabular-nums; font-weight: 600; opacity: .9; }
.tv-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 6vh 3vw 4vh; background: linear-gradient(transparent, #000c); pointer-events: none; }
#tvNow { font-size: clamp(18px, 2.6vw, 40px); text-shadow: 0 2px 12px #000; }
#tvNow span { display: block; font-weight: 500; opacity: .85; font-size: .75em; }
#tvNext { margin-top: 1vh; opacity: .7; font-size: clamp(12px, 1.3vw, 20px); }
#tvMsg { position: absolute; top: 45%; left: 50%; transform: translateX(-50%); background: #000b; padding: 12px 20px; border-radius: 10px; font-size: 18px; max-width: 80vw; text-align: center; }
.tv-ui { position: absolute; top: 12vh; right: 3vw; display: flex; align-items: center; gap: 8px; background: #000c; border: 1px solid #ffffff30; border-radius: 999px; padding: 8px 12px; opacity: 0; transition: opacity .25s; }
#tvStage.show-ui .tv-ui { opacity: 1; }
.tv-ui button { background: #ffffff1a; padding: 6px 12px; }
.tv-ui #tvSource { font-size: 12px; opacity: .8; margin-right: 6px; }
.tv-ui input { width: 90px; }

/* ───────────── Evitar y filtros ───────────── */
.hero-slate { background: linear-gradient(180deg, #44505f 0%, #262c35 55%, var(--surface) 100%); }
.avoid-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.avoid-grid .card { display: flex; flex-direction: column; gap: 8px; transition: opacity .15s; }
.avoid-grid .card.ignored { opacity: .6; border-style: dashed; }
.avoid-grid .picker { position: relative; }
.av-filter { width: 100%; }
.av-list { max-height: 300px; overflow-y: auto; align-content: flex-start; }
.av-list .chip { background: #ff6b6b1a; }
.av-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 8px; font-size: 13px; }
#avTagIn { width: 100%; }
.check.apply { font-size: 12px; color: var(--muted); margin-top: 4px; }
#filterBar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
#filterBar .lbl { margin-right: 4px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 4px 3px 11px; font-size: 12.5px; }
.fchip b { font-weight: 600; color: #d6d6dd; }
.fchip small { color: var(--warn); font-size: 11.5px; }
.fchip button { padding: 3px 10px; font-size: 11.5px; background: var(--surface-3); }
.fchip.off { opacity: .55; text-decoration: line-through; }
.fchip.off button { text-decoration: none; background: var(--accent); color: var(--accent-ink); }

/* ───────────── Descubrir (pantalla simple) ───────────── */
.nav-group { display: block; margin: 14px 12px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); }
.nav .nav-main { font-size: 15.5px; }
@media (max-width: 860px) { .nav-group { display: none; } }
.simple-card { margin-bottom: 18px !important; padding: 18px 20px; background: linear-gradient(135deg, #1ed76014, var(--surface-2)); }
.knobs { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px 24px; }
.knob .lbl { display: flex; justify-content: space-between; margin-bottom: 4px; }
.knob .slider.bip { grid-template-columns: 70px 1fr 90px; margin: 0; }
.knob-row { display: flex; gap: 14px; }
.knob-row label { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.knob-row select { width: 100%; }
.simple-ai { margin-top: 14px; }
.simple-ai input { width: 100%; font-size: 14.5px; padding: 10px 14px; }
.simple-go { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.adv-note { margin-top: 8px; }
.sub .styles { color: var(--accent); opacity: .85; }
.app-version { display: block; color: var(--muted); font-size: 11px; opacity: .6; padding: 6px 12px 0; cursor: default; }
/* Géneros para la playlist */
.genres { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.genres-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.genres-head .lbl small { color: var(--muted); font-weight: 500; }
.genres-head .seg { min-width: 420px; margin: 0; }
.genres-head .seg.dim { opacity: .5; }
.genre-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 8px; }
.genre-box:focus-within { border-color: var(--accent); }
.genre-box input { flex: 1; min-width: 200px; border: 0; background: transparent; padding: 4px; }
.genre-box input:focus { background: transparent; }
#genreChips { display: contents; }
.gchip { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); color: var(--text); }
button.gchip:hover { border-color: var(--accent); background: var(--surface-3); transform: none; }
.gchip.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; padding-right: 4px; }
.gchip .x { background: #0002; color: inherit; padding: 0 6px; border-radius: 999px; font-size: 13px; line-height: 18px; }
.gchip .x:hover { background: #0004; transform: none; }
.genre-sugg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.genre-sugg .gmore { width: 100%; }
.genre-sugg .gmore summary { cursor: pointer; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.genre-sugg .gmore div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
@media (max-width: 600px) { .genres-head .seg { min-width: 0; width: 100%; } }
#freshBar { margin: 0 0 10px; font-size: 14px; color: #c9f5d9; background: var(--good-bg); border: 1px solid #1ed76033; border-radius: var(--radius-sm); padding: 8px 12px; }
#freshBar b { color: var(--accent); }

/* ───────────── Afinadores explicados ───────────── */
.algo-summary { background: var(--good-bg); border: 1px solid #1ed76033; border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px; }
.algo-summary .card-head { margin-bottom: 4px; font-size: 13px; }
#algoSummary { margin: 0; font-size: 13px; line-height: 1.55; color: #d9f7e6; }
#algoSummary b { color: var(--accent); }
.tune-tip { margin: 2px 4px 6px; }
.tuner { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; min-width: 0; }
.tune-head { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 2px; }
/* Mini botón ⓘ: al pasar el mouse (o tocarlo) explica qué hace */
.tip { display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; border-radius: 50%; font: 700 11px/1 var(--font);
  background: var(--surface-3); color: var(--muted); border: 1px solid var(--line-2); cursor: help; flex: none; vertical-align: middle; transition: background .12s, color .12s; }
.tip:hover, .tip:focus-visible { background: var(--accent); color: var(--accent-ink); border-color: transparent; transform: none; }
summary .tip { margin-left: 4px; }
.tipbox { position: fixed; z-index: 1000; max-width: 300px; background: #1c1c22; color: #e8e8ee; border: 1px solid var(--line-2); border-radius: 10px;
  padding: 9px 12px; font-size: 12.5px; line-height: 1.45; box-shadow: 0 8px 28px #000a; pointer-events: none; }
.tipbox b { color: #fff; }
.tipbox p { margin: 4px 0 0; color: #c9c9d2; }
.tipbox .tip-up, .tipbox .tip-down { font-size: 12px; }
.tipbox .tip-now { margin-top: 7px; padding-top: 6px; border-top: 1px solid var(--line-2); color: #cfe9ff; }
.tuner .slider { grid-template-columns: 70px 1fr 74px; margin: 4px 0; }
.tuner .slider.bip { grid-template-columns: 70px 1fr 64px 52px; }
.tuner .slider > span:first-child { font-size: 12px; color: var(--muted); }
.tuner select, .tuner input[type=text] { width: 100%; }
.feat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.feat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; background: var(--surface); border-radius: var(--radius-sm); padding: 8px 10px; }
.feat-row .fr-name { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.feat-row label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); }
.feat-row select { width: 100%; padding: 5px 8px; font-size: 13px; }
.strict { margin-top: 10px; }
#featRanges { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 6px; }
#featRanges th { text-align: left; color: var(--faint); font-weight: 600; font-size: 11px; text-transform: uppercase; }
#featRanges td { padding: 3px; border-top: 1px solid var(--line); }
#featRanges input { width: 64px; padding: 3px 6px; }

/* ───────────── Cuenta ───────────── */
.user-chip { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; }
.user-chip:hover { background: var(--surface-3); transform: none; }
.avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), #2e77d0); text-transform: uppercase; }
.user-info { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.user-info b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 860px) { .user-chip { width: auto; padding: 4px; background: none; } .user-info { display: none; } }

#auth { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; overflow-y: auto;
  background: radial-gradient(circle at 20% 10%, #1f6b3f 0%, transparent 45%), radial-gradient(circle at 85% 90%, #5b3aa8 0%, transparent 45%), var(--bg); }
#auth[hidden] { display: none; }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; padding: 28px; box-shadow: 0 30px 80px #000c; }
.auth-brand { justify-content: center; padding-bottom: 20px; font-size: 24px; }
.auth-brand .logo { font-size: 34px; }
.auth-seg { margin-bottom: 8px; }
#authForm .block { margin-top: 12px; }
#authForm .terms { margin-top: 14px; font-size: 13px; align-items: flex-start; }
#authForm .terms input { margin-top: 3px; }
#authForm button[type=submit], #authRecovery button { width: 100%; margin-top: 18px; }
#auth:not(.signup) .signup-only { display: none; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
button.linkish { background: none; padding: 0; color: var(--muted); font-weight: 600; font-size: 13px; }
button.linkish:hover { color: var(--text); background: none; text-decoration: underline; transform: none; }
.auth-msg { min-height: 1.5em; font-size: 13.5px; margin: 14px 0 0; }
.auth-msg.bad { color: var(--bad); }
.auth-msg.good { color: var(--accent); }
.auth-foot { margin-top: 16px; text-align: center; }
.auth-buttons { display: flex; gap: 10px; justify-content: center; }
#authRecovery h3 { margin-bottom: 4px; }

/* ───────────── Toast ───────────── */
#toast { position: fixed; left: 50%; bottom: calc(var(--pbh) + 20px); transform: translate(-50%, 10px); background: #2e77d0; color: #fff; padding: 10px 18px; border-radius: var(--radius-sm); font-weight: 600; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 30; box-shadow: 0 8px 24px #0009; max-width: min(600px, 90vw); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: #c0392b; }
