@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* =========================================================
   Jere.com.ar · estilo vidrio sobre fondo de colores
   ========================================================= */
:root {
  /* Fondo base y manchas de color (se cambian con data-bg) */
  --base: #E8F5FD;
  --b1: #7DD3FC; --b2: #38BDF8; --b3: #67E8F9; --b4: #BAE6FD;
  --blob-opacity: .75;

  /* Vidrio */
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-soft: rgba(255, 255, 255, .38);
  --glass-solid: rgba(255, 255, 255, .92);
  --glass-hover: rgba(255, 255, 255, .72);
  --glass-border: rgba(255, 255, 255, .75);
  --glass-line: rgba(15, 35, 75, .08);
  --blur: saturate(170%) blur(18px);
  --shadow: 0 8px 32px rgba(15, 45, 100, .10);
  --shadow-lg: 0 24px 64px rgba(15, 45, 100, .22);

  /* Texto */
  --text: #0D1B36;
  --text-2: #33435F;
  --text-3: #4D5D7A;

  /* Marca */
  --primary: #0369A1;
  --grad: linear-gradient(135deg, #0369A1 0%, #0284C7 55%, #0891B2 100%);
  --glow: rgba(2, 132, 199, .35);
  --on-primary: #FFFFFF;
  --primary-soft: rgba(2, 132, 199, .13);
  --accent: #EA580C;
  --danger: #B91C1C;
  --ring: #0284C7;

  --radius: 16px;
  --radius-sm: 10px;
  --sidebar: 252px;
  --topbar: 68px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --t: 180ms ease;
  color-scheme: light;
}

[data-theme="dark"] {
  --base: #0D0B1C;
  --blob-opacity: .5;
  --glass: rgba(16, 30, 58, .52);
  --glass-strong: rgba(16, 30, 58, .86);
  --glass-soft: rgba(255, 255, 255, .06);
  --glass-solid: rgba(14, 26, 50, .95);
  --glass-hover: rgba(30, 52, 94, .62);
  --glass-border: rgba(255, 255, 255, .12);
  --glass-line: rgba(255, 255, 255, .08);
  --shadow: 0 8px 32px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .55);
  --text: #EEF5FF;
  --text-2: #C3D3EC;
  --text-3: #9FB2D1;
  --primary: #7DD3FC;
  --grad: linear-gradient(135deg, #0369A1 0%, #0284C7 55%, #0891B2 100%);
  --glow: rgba(14, 165, 233, .35);
  --primary-soft: rgba(125, 211, 252, .16);
  --accent: #FDBA74;
  --danger: #FCA5A5;
  --ring: #7DD3FC;
  color-scheme: dark;
}

/* Paletas de fondo (Cielo es la de :root) */
[data-bg="oceano"]    { --base: #E3F2F8; --b1: #0EA5E9; --b2: #2DD4BF; --b3: #22D3EE; --b4: #A7F3D0; }
[data-bg="atardecer"] { --base: #FDF0E8; --b1: #FB923C; --b2: #FDBA74; --b3: #FDE047; --b4: #7DD3FC; }
[data-bg="bosque"]    { --base: #E6F4EA; --b1: #34D399; --b2: #A3E635; --b3: #2DD4BF; --b4: #FCD34D; }
/* En oscuro: tonos profundos (los amarillos se ven barrosos sobre negro) */
[data-theme="dark"]                      { --base: #04121E; --b1: #0369A1; --b2: #0284C7; --b3: #0891B2; --b4: #075985; }
[data-theme="dark"][data-bg="oceano"]    { --base: #031417; --b1: #0E7490; --b2: #0D9488; --b3: #0369A1; --b4: #115E59; }
[data-theme="dark"][data-bg="atardecer"] { --base: #160C06; --b1: #C2410C; --b2: #EA580C; --b3: #B45309; --b4: #0369A1; }
[data-theme="dark"][data-bg="bosque"]    { --base: #06140D; --b1: #059669; --b2: #0D9488; --b3: #15803D; --b4: #0369A1; }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  background: var(--base);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background-color 400ms ease;
}

/* Fondo animado: cuatro manchas de luz difuminadas */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop i {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: var(--blob-opacity);
  transition: background 500ms ease, opacity 500ms ease;
  animation: drift 26s ease-in-out infinite alternate;
}
.backdrop i:nth-child(1) { width: 52vmax; height: 52vmax; left: -14vmax; top: -16vmax; background: var(--b1); }
.backdrop i:nth-child(2) { width: 46vmax; height: 46vmax; right: -12vmax; top: -6vmax; background: var(--b2); animation-delay: -7s; animation-duration: 30s; }
.backdrop i:nth-child(3) { width: 44vmax; height: 44vmax; left: 18vmax; bottom: -22vmax; background: var(--b3); animation-delay: -13s; animation-duration: 34s; }
.backdrop i:nth-child(4) { width: 30vmax; height: 30vmax; right: 8vmax; bottom: -6vmax; background: var(--b4); animation-delay: -4s; }
.backdrop::after {
  /* textura sutil para que el vidrio no se vea "plano" */
  content: ""; position: absolute; inset: 0; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(6vmax, 4vmax) scale(1.08); }
  100% { transform: translate(-4vmax, 7vmax) scale(.95); }
}

[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 8px; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Superficie de vidrio reutilizable */
.glass, .topbar, .sidebar, .card, .tile, .empty, dialog, .menu-panel, .login-card, .search input, .btn {
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--glass-border);
  background: var(--glass); color: var(--text);
  font-weight: 600; font-size: 14px; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
  transition: background var(--t), border-color var(--t), color var(--t), transform var(--t), box-shadow var(--t);
}
.btn:hover { background: var(--glass-hover); }
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--grad); border-color: transparent; color: #fff;
  box-shadow: 0 6px 18px var(--glow), inset 0 1px 0 rgba(255,255,255,.3);
}
.btn-primary:hover { background: var(--grad); filter: brightness(1.08); box-shadow: 0 8px 24px var(--glow), inset 0 1px 0 rgba(255,255,255,.3); }
.btn-danger { background: #B91C1C; border-color: transparent; color: #fff; }
.btn-danger:hover { background: #991B1B; }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.btn-ghost:hover { background: var(--glass-soft); }
.btn-icon { width: 40px; padding: 0; justify-content: center; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: default; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(420px, 100%); background: var(--glass);
  border: 1px solid var(--glass-border); border-radius: 28px;
  padding: 44px 32px 32px; text-align: center; box-shadow: var(--shadow-lg);
}
.login-card h1 { font-size: 30px; letter-spacing: -0.03em; margin: 20px 0 6px; }
.login-card p { color: var(--text-2); margin: 0 0 28px; }
.login-mark {
  width: 64px; height: 64px; border-radius: 20px; margin: 0 auto; display: grid; place-items: center;
  background: var(--grad); color: #fff; box-shadow: 0 12px 30px var(--glow);
  transform: rotate(-6deg);
}
.login-mark .icon { width: 30px; height: 30px; }
#google-btn { display: flex; justify-content: center; min-height: 44px; }
.login-note { font-size: 13px; color: var(--text-3); margin-top: 22px !important; margin-bottom: 0 !important; }
.form-error { color: var(--danger); font-size: 14px; font-weight: 500; margin-top: 14px; }

/* ---------- Estructura ---------- */
.app { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) 1fr; grid-template-rows: var(--topbar) 1fr; }
.topbar {
  grid-column: 1 / -1; position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: var(--glass-soft);
  border-bottom: 1px solid var(--glass-border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -0.01em; width: calc(var(--sidebar) - 20px); text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 12px var(--glow); }
.brand-mark .icon { width: 17px; height: 17px; }
.search { flex: 1; max-width: 560px; position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 14px; color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%; height: 42px; padding: 0 44px 0 42px; border-radius: 999px;
  border: 1px solid var(--glass-border); background: var(--glass);
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { outline: none; background: var(--glass-strong); border-color: var(--ring); box-shadow: 0 0 0 4px var(--primary-soft); }
.search kbd {
  position: absolute; right: 12px; font-family: inherit; font-size: 12px; color: var(--text-3);
  border: 1px solid var(--glass-line); background: var(--glass-soft); border-radius: 6px; padding: 0 7px; line-height: 20px;
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.avatar-btn {
  width: 40px; height: 40px; border-radius: 50%; padding: 0; overflow: hidden;
  border: 2px solid transparent; background: var(--grad) border-box; color: #fff; font-weight: 700;
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }

.menu { position: relative; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 260px; z-index: 40;
  background: var(--glass-solid); border: 1px solid var(--glass-border); border-radius: 16px; padding: 6px;
  box-shadow: var(--shadow-lg);
}
.menu-panel .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--glass-line); margin-bottom: 6px; }
.menu-panel .who strong { display: block; font-size: 14px; }
.menu-panel .who span { font-size: 13px; color: var(--text-3); word-break: break-all; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 10px; border: 0; background: none; border-radius: 10px; font-size: 14px;
}
.menu-item:hover { background: var(--primary-soft); }
.menu-item.danger { color: var(--danger); }
.menu-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 6px 10px 8px; }

/* Selector de fondo */
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 2px 8px 8px; }
.swatch {
  aspect-ratio: 1; border-radius: 12px; border: 2px solid transparent; padding: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
  transition: transform var(--t), border-color var(--t);
}
.swatch:hover { transform: scale(1.07); }
.swatch[aria-pressed="true"] { border-color: var(--text); }
.swatch[data-bg="cielo"]     { background: conic-gradient(from 210deg, #7DD3FC, #38BDF8, #67E8F9, #BAE6FD, #7DD3FC); }
.swatch[data-bg="oceano"]    { background: conic-gradient(from 210deg, #0EA5E9, #2DD4BF, #A7F3D0, #22D3EE, #0EA5E9); }
.swatch[data-bg="atardecer"] { background: conic-gradient(from 210deg, #FB923C, #FDBA74, #FDE047, #7DD3FC, #FB923C); }
.swatch[data-bg="bosque"]    { background: conic-gradient(from 210deg, #34D399, #A3E635, #FCD34D, #2DD4BF, #34D399); }
.swatch-labels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 0 8px 6px; font-size: 11px; text-align: center; color: var(--text-3); }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar));
  overflow-y: auto; padding: 18px 12px 24px;
  background: var(--glass-soft); border-right: 1px solid var(--glass-border);
}
.nav-label { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 18px 10px 6px; }
.nav-label button { border: 0; background: none; color: var(--text-3); padding: 4px; border-radius: 8px; display: grid; }
.nav-label button:hover { color: var(--primary); background: var(--glass); }
.nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: 12px; border: 1px solid transparent; background: none;
  font-size: 14px; font-weight: 500; color: var(--text-2); text-align: left;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.nav-item:hover { background: var(--glass); color: var(--text); }
.nav-item[aria-current="true"] {
  background: var(--glass-strong); border-color: var(--glass-border); color: var(--text); font-weight: 700;
  box-shadow: var(--shadow);
}
.nav-item[aria-current="true"] > .icon { color: var(--primary); }
.nav-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .count {
  font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums;
  min-width: 24px; text-align: center; padding: 0 6px; border-radius: 999px;
}
.nav-item[aria-current="true"] .count { background: var(--grad); color: #fff; font-weight: 700; }
.nav-row { position: relative; }
.nav-row .edit-cat {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: var(--glass-strong); color: var(--text-2); border-radius: 8px; padding: 4px; display: none;
}
.nav-row:hover .edit-cat, .nav-row:focus-within .edit-cat { display: grid; }
.nav-row:hover .count, .nav-row:focus-within .count { visibility: hidden; }
.cat-dot {
  width: 10px; height: 10px; border-radius: 50%; flex: none; margin: 0 4px;
  background: var(--c, #94A3B8); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, #94A3B8) 25%, transparent);
}

/* ---------- Contenido ---------- */
.main { padding: 30px 32px 64px; min-width: 0; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.view-head h2 {
  margin: 0; font-size: 30px; letter-spacing: -0.03em; line-height: 1.15; font-weight: 800;
}
.view-head p { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }
.sort { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.sort select, .field select, .field input, .field textarea {
  height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--glass-border);
  background: var(--glass); padding: 0 10px;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.sort select { height: 34px; border-radius: 999px; padding: 0 12px; }
select option { background: var(--base); color: var(--text); }

.section { margin-bottom: 34px; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.section-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.section-head .count {
  font-size: 12px; font-weight: 700; color: var(--text-2);
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 999px; padding: 1px 9px;
}
.section-head .cat-dot { margin: 0 2px 0 4px; }
.section-head .link-more { margin-left: auto; font-size: 13px; color: var(--primary); font-weight: 700; background: none; border: 0; padding: 4px 8px; border-radius: 8px; }
.section-head .link-more:hover { background: var(--glass); }

/* Mosaico de más usados */
.top-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 12px; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 20px 10px 14px; border-radius: 20px; text-decoration: none; overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--c, var(--primary)) 30%, transparent), transparent 70%),
    var(--glass);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.tile:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--c, var(--primary)) 60%, transparent);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--c, var(--primary)) 35%, transparent);
}
.tile .fav-icon { width: 48px; height: 48px; border-radius: 15px; background: var(--glass-strong); }
.tile .fav-icon img { width: 28px; height: 28px; }
.tile .t { font-size: 13px; font-weight: 700; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .v { font-size: 11px; font-weight: 600; color: var(--text-2); }
.tile .rank {
  position: absolute; top: 8px; left: 10px; font-size: 11px; font-weight: 800; color: var(--text-3);
}

/* Tarjetas */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.card {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--radius);
  background: var(--glass); border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t), background var(--t);
}
.card::before {
  /* reflejo de luz en el borde superior */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.35), transparent 40%);
  opacity: .6;
}
[data-theme="dark"] .card::before { opacity: .12; }
.card:hover {
  transform: translateY(-2px); background: var(--glass-hover);
  border-color: color-mix(in srgb, var(--c, var(--primary)) 55%, transparent);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--c, var(--primary)) 28%, transparent);
}
.card a.main-link { position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.card a.main-link:focus-visible { outline-offset: -2px; }
.fav-icon {
  position: relative; width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; overflow: hidden;
  background: color-mix(in srgb, var(--c, var(--primary)) 22%, var(--glass-strong));
  border: 1px solid color-mix(in srgb, var(--c, var(--primary)) 35%, transparent);
  font-weight: 800; font-size: 16px;
  color: color-mix(in srgb, var(--c, var(--primary)) 70%, var(--text));
}
.fav-icon img { width: 22px; height: 22px; display: block; }
.card-text { position: relative; min-width: 0; flex: 1; }
.card-title { font-weight: 600; font-size: 14px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sub { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sub .dot { margin: 0 5px; }
.card-actions {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); z-index: 2;
  display: flex; gap: 2px; padding: 3px; opacity: 0; pointer-events: none;
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: 12px;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  transition: opacity var(--t);
}
.card:hover .card-actions, .card:focus-within .card-actions { opacity: 1; pointer-events: auto; }
.card-actions button {
  width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 9px;
  background: none; color: var(--text-2);
}
.card-actions button:hover { background: var(--primary-soft); color: var(--text); }
.card-actions .star.on { color: var(--accent); }
.card-actions .star.on .icon, .fav-badge .icon { fill: currentColor; }
.fav-badge { color: var(--accent); display: inline-grid; vertical-align: -2px; margin-right: 4px; }
.fav-badge .icon { width: 13px; height: 13px; }
mark { background: color-mix(in srgb, #38BDF8 40%, transparent); color: inherit; border-radius: 4px; padding: 0 2px; }

/* Estado vacío */
.empty {
  border: 1px solid var(--glass-border); border-radius: 26px; padding: 48px 24px; text-align: center;
  background: var(--glass); box-shadow: var(--shadow);
}
.empty h3 { margin: 16px 0 6px; font-size: 22px; letter-spacing: -0.02em; }
.empty p { color: var(--text-2); margin: 0 auto 22px; max-width: 460px; }
.empty .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.empty-ico {
  width: 60px; height: 60px; border-radius: 18px; margin: 0 auto; display: grid; place-items: center;
  background: var(--grad); color: #fff; box-shadow: 0 10px 26px var(--glow);
}
.empty-ico .icon { width: 26px; height: 26px; }
.empty.small { padding: 28px 20px; }
.empty.small p { margin-bottom: 0; }

/* ---------- Diálogos ---------- */
dialog {
  border: 1px solid var(--glass-border); border-radius: 24px; padding: 0; width: min(520px, calc(100% - 32px));
  background: var(--glass-strong); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog[open] { animation: pop 200ms ease; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
dialog::backdrop { background: rgba(8, 22, 45, .25); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 6px; }
.dlg-head h2 { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
.dlg-body { padding: 10px 22px 4px; display: grid; gap: 14px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px 22px; flex-wrap: wrap; }
.dlg-foot .left { margin-right: auto; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field input, .field select { width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; background: var(--glass); }
.field input:focus, .field select:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 4px var(--primary-soft); }
.field .hint { font-size: 12.5px; color: var(--text-3); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dlg-foot .btn:not(.btn-primary):not(.btn-danger):not(.btn-ghost) { background: var(--glass); }

.drop {
  border: 2px dashed color-mix(in srgb, var(--primary) 40%, transparent); border-radius: 18px; padding: 30px 18px; text-align: center;
  background: var(--glass); transition: border-color var(--t), background var(--t); cursor: pointer;
}
.drop.over { border-color: var(--primary); background: var(--primary-soft); }
.drop strong { display: block; margin-top: 10px; }
.drop span { font-size: 13px; color: var(--text-3); }
.drop .icon { width: 30px; height: 30px; color: var(--primary); }
.howto { font-size: 13px; color: var(--text-2); background: var(--glass); border: 1px solid var(--glass-border); border-radius: 14px; padding: 12px 14px; }
.howto summary { cursor: pointer; font-weight: 600; }
.howto ul { margin: 8px 0 0; padding-left: 18px; }
.howto li { margin: 3px 0; }
.import-summary { background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); color: var(--text); border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.import-summary strong { color: var(--primary); }
.folder-list { max-height: 170px; overflow: auto; border: 1px solid var(--glass-border); background: var(--glass); border-radius: 14px; padding: 6px 4px; font-size: 13.5px; }
.folder-list div { display: flex; justify-content: space-between; padding: 4px 10px; }
.folder-list div span:last-child { color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ---------- Avisos ---------- */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; }
.toast {
  background: rgba(13, 27, 54, .82); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,.15);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  animation: toast-in 220ms ease;
}
.toast.err { background: rgba(185, 28, 28, .9); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.demo-banner {
  position: relative; z-index: 21; background: var(--grad); color: #fff; font-size: 13px; font-weight: 500;
  text-align: center; padding: 7px 12px;
}

/* ---------- Búsqueda en Google (arriba de los enlaces) ---------- */
.main-col { min-width: 0; }
.gs-row { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 22px 32px 0; position: relative; z-index: 5; }
.gs-label {
  font-size: 13.5px; font-weight: 600; color: var(--text-2); padding: 6px 14px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  transition: opacity 160ms ease; cursor: pointer;
}
.gs-row.open .gs-label { opacity: 0; pointer-events: none; }
.gsearch { position: relative; width: 64px; height: 64px; flex: none; }
.gsearch input {
  position: absolute; right: 0; top: 0; height: 64px; width: 64px; padding: 0 76px 0 24px; font-size: 17px;
  border-radius: 999px; border: 1px solid var(--glass-border); background: var(--glass-solid);
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; z-index: 1;
  transition: width 280ms cubic-bezier(.2,.8,.2,1), opacity 160ms ease, box-shadow var(--t), border-color var(--t);
}
.gsearch input::-webkit-search-cancel-button { display: none; }
.gsearch input::placeholder { color: var(--text-3); }
.gsearch.open input { width: min(640px, calc(100vw - var(--sidebar) - 64px)); opacity: 1; pointer-events: auto; }
.gsearch.open input:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 4px var(--primary-soft), var(--shadow-lg); }
.gsearch-btn {
  position: absolute; right: 0; top: 0; z-index: 2; width: 64px; height: 64px; border-radius: 50%;
  border: 0; background: var(--grad); padding: 0; display: grid; place-items: center;
  box-shadow: 0 10px 26px var(--glow), inset 0 1px 0 rgba(255,255,255,.3);
  transition: transform var(--t), box-shadow var(--t);
}
.gsearch-btn:hover { transform: scale(1.07); box-shadow: 0 14px 32px var(--glow), inset 0 1px 0 rgba(255,255,255,.3); }
.gsearch-btn span { font: 800 30px/1 var(--font); color: #fff; }
.gsearch:not(.open) .gsearch-btn::after {
  /* pulso suave para que se note */
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--primary);
  opacity: 0; animation: gs-pulse 2.8s ease-out infinite;
}
@keyframes gs-pulse { 0% { opacity: .55; transform: scale(.92); } 70%, 100% { opacity: 0; transform: scale(1.25); } }
.main { padding-top: 8px; }

/* ---------- Favoritos por categoría ---------- */
.fav-section .section-head .fav-badge .icon { width: 16px; height: 16px; }
.fav-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px 12px; align-items: start; }
.fav-groups .subsection .grid { grid-template-columns: 1fr; gap: 8px; }
.subsection { min-width: 0; }
.sub-head { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-2); margin: 0 0 8px 2px; }
.sub-head .count { font-size: 11.5px; font-weight: 600; color: var(--text-3); }

/* ---------- Arrastrar y soltar ---------- */
.grid[data-dnd] .card, .pitem, #nav-cats [data-cat-id], #nav-panels [data-panel-id] { cursor: grab; }
.grid[data-dnd]:empty { min-height: 66px; border: 2px dashed var(--glass-border); border-radius: var(--radius); display: grid; place-items: center; }
.grid[data-dnd]:empty::before { content: "Arrastra enlaces aquí"; font-size: 13px; color: var(--text-3); }
.dnd-ghost { opacity: .35; }
.dnd-chosen { box-shadow: 0 0 0 2px var(--ring), var(--shadow-lg) !important; }
.dnd-drag { transform: rotate(1.5deg); }
body.is-dragging { cursor: grabbing; user-select: none; }
body.is-dragging .grid[data-dnd] { outline: 2px dashed color-mix(in srgb, var(--primary) 35%, transparent); outline-offset: 6px; border-radius: var(--radius); min-height: 66px; }
.nav-hint { font-size: 12.5px; color: var(--text-3); padding: 2px 10px 6px; }

/* ---------- Paneles ---------- */
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.panel-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); gap: 16px; align-items: start; }
.grp {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 20px; box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); padding: 12px; display: grid; gap: 8px;
  /* columna interna de ancho fijo: los nombres largos se cortan con … en vez de estirar el grupo */
  grid-template-columns: minmax(0, 1fr); min-width: 0;
}
.grp-head { display: flex; align-items: center; gap: 6px; padding: 2px 2px 4px; min-width: 0; }
.grp-head .count, .grp-actions { flex: none; }
.grp-head h3 { margin: 0; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-head .count { font-size: 12px; font-weight: 700; color: var(--text-2); background: var(--glass-strong); border-radius: 999px; padding: 0 8px; }
.grp-handle { display: grid; place-items: center; width: 24px; height: 28px; border-radius: 8px; color: var(--text-3); cursor: grab; touch-action: none; }
.grp-handle:hover { background: var(--glass-strong); color: var(--text); }
.grp-handle .icon { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.grp-actions { display: flex; gap: 2px; opacity: .55; transition: opacity var(--t); }
.grp:hover .grp-actions, .grp:focus-within .grp-actions { opacity: 1; }
.grp-actions button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--text-2); }
.grp-actions button:hover { background: var(--primary-soft); color: var(--text); }
.grp-actions button[disabled] { opacity: .35; cursor: default; background: none; }
.grp-actions button[data-gact="open"] { color: var(--primary); }
.grp-actions .icon { width: 15px; height: 15px; }
.pitems { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-height: 48px; border-radius: 14px; min-width: 0; }
.pitems:empty { border: 2px dashed var(--glass-border); display: grid; place-items: center; }
.pitems:empty::before { content: "Arrastra enlaces aquí o usa +"; font-size: 12.5px; color: var(--text-3); }
.pitem { position: relative; display: flex; align-items: center; min-width: 0; border-radius: 14px; background: var(--glass-strong); border: 1px solid var(--glass-border); transition: border-color var(--t), box-shadow var(--t); }
.pitem:hover { border-color: color-mix(in srgb, var(--c, var(--primary)) 55%, transparent); box-shadow: 0 6px 18px color-mix(in srgb, var(--c, var(--primary)) 22%, transparent); }
.pitem a { display: flex; align-items: center; gap: 10px; padding: 8px 36px 8px 8px; text-decoration: none; min-width: 0; flex: 1; }
.pitem .fav-icon { width: 34px; height: 34px; border-radius: 10px; }
.pitem .fav-icon img { width: 20px; height: 20px; }
.pitem-text { min-width: 0; display: grid; }
.pitem-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pitem-sub { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pitem-x { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border: 0; border-radius: 8px; background: none; color: var(--text-3); display: grid; place-items: center; opacity: 0; transition: opacity var(--t); }
.pitem:hover .pitem-x, .pitem:focus-within .pitem-x { opacity: 1; }
.pitem-x:hover { background: var(--danger); color: #fff; }
.pitem-x .icon { width: 14px; height: 14px; }
.grp-add { display: flex; align-items: center; justify-content: center; gap: 6px; height: 36px; border-radius: 12px; border: 1px dashed var(--glass-border); background: none; color: var(--primary); font-size: 13px; font-weight: 600; }
.grp-add:hover { background: var(--primary-soft); border-style: solid; }
.grp-add .icon { width: 15px; height: 15px; }
.panel-tip { font-size: 12.5px; color: var(--text-3); margin-top: 16px; }
dialog.dlg-wide { width: min(620px, calc(100% - 32px)); }
.pick-list { max-height: min(420px, 55vh); overflow-y: auto; display: grid; gap: 2px; margin: 0 -6px; padding: 0 6px; }
.pick-cat { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 10px 4px 4px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; cursor: pointer; }
.pick-row:hover { background: var(--primary-soft); }
.pick-row input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.pick-row .fav-icon { width: 30px; height: 30px; border-radius: 9px; }
.pick-row .fav-icon img { width: 18px; height: 18px; }
.pick-row.is-in { opacity: .6; cursor: default; }
@media (hover: none) { .pitem-x, .grp-actions { opacity: 1; } }

/* ---------- Estadísticas ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi {
  padding: 16px 18px; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.kpi .k-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.kpi .k-value { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.kpi.main { background: var(--grad); border-color: transparent; color: #fff; }
.kpi.main .k-label, .kpi.main .k-sub { color: rgba(255,255,255,.88); }
.panel {
  padding: 18px 20px; border-radius: 20px; background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); margin-bottom: 18px; min-width: 0;
}
.panel-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h3 { margin: 0; font-size: 16px; }
.panel-head p { margin: 0; font-size: 13px; color: var(--text-3); }
.panels-2 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; }
.panels-2 > .panel { margin-bottom: 18px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--glass-soft); border: 1px solid var(--glass-border); margin-left: auto; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.seg button[aria-pressed="true"] { background: var(--glass-strong); color: var(--text); box-shadow: var(--shadow); }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 230px; overflow: visible; }
.chart .grid-line { stroke: var(--glass-line); stroke-width: 1; }
.chart .axis-text { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .bar { fill: var(--primary); pointer-events: none; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar, .chart .bar.hl { fill: color-mix(in srgb, var(--primary) 70%, var(--text)); }
.chart-tip {
  position: absolute; pointer-events: none; transform: translate(-50%, -100%); white-space: nowrap;
  background: var(--glass-solid); border: 1px solid var(--glass-border); box-shadow: var(--shadow-lg);
  border-radius: 10px; padding: 6px 10px; font-size: 12.5px; color: var(--text);
}
.chart-tip b { font-variant-numeric: tabular-nums; }
.chart-table { margin-top: 10px; font-size: 13px; color: var(--text-2); }
.chart-table summary { cursor: pointer; font-weight: 600; }
.hbar-list { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 13.5px; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hbar .val { color: var(--text-2); font-variant-numeric: tabular-nums; }
.hbar .track { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--glass-soft); overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 4px; background: var(--primary); }
.tbl-wrap { overflow-x: auto; margin: 0 -6px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; padding: 8px 6px; border-bottom: 1px solid var(--glass-line); white-space: nowrap; }
.tbl td { padding: 10px 6px; border-bottom: 1px solid var(--glass-line); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .who { display: flex; align-items: center; gap: 10px; }
.tbl .who b { display: block; font-weight: 600; }
.tbl .who > div > span { font-size: 12px; color: var(--text-3); }
.tbl .av { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 700; font-size: 13px; overflow: hidden; }
.tbl .av img { width: 100%; height: 100%; object-fit: cover; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }
.loading { color: var(--text-3); padding: 40px 0; text-align: center; }
@media (max-width: 1100px) { .panels-2 { grid-template-columns: 1fr; } }

/* ---------- Reproductor flotante ---------- */
.player { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 10px; }
.player-fab {
  position: relative; width: 54px; height: 54px; border-radius: 50%; border: 0;
  display: grid; place-items: center; color: #fff; background: var(--grad);
  box-shadow: 0 10px 28px var(--glow), inset 0 1px 0 rgba(255,255,255,.3);
  transition: transform var(--t), box-shadow var(--t);
}
.player-fab:hover { transform: scale(1.06); }
.player-fab .icon { width: 22px; height: 22px; }
.player-fab .eq { display: none; position: absolute; right: 6px; bottom: 7px; gap: 2px; align-items: flex-end; height: 12px; }
.player-fab .eq i { width: 3px; background: #fff; border-radius: 2px; animation: eq 900ms ease-in-out infinite alternate; }
.player-fab .eq i:nth-child(2) { animation-delay: -300ms; }
.player-fab .eq i:nth-child(3) { animation-delay: -600ms; }
@keyframes eq { from { height: 3px; } to { height: 12px; } }
.player.has-music.is-min .player-fab .eq { display: flex; }
.player.has-music.is-min .player-fab .icon { transform: translate(-3px, -2px); }

.player-panel {
  width: 360px; max-width: calc(100vw - 28px);
  background: var(--glass-solid); border: 1px solid var(--glass-border); border-radius: 22px;
  box-shadow: var(--shadow-lg); overflow: hidden;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  animation: pop 200ms ease;
}
.player.is-min .player-panel {
  /* Minimizado: se oculta sin descargar el reproductor, así la música sigue */
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden;
  right: 0; bottom: 0; animation: none;
}
.player-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; cursor: grab; user-select: none; touch-action: none; }
.player-head:active { cursor: grabbing; }
.player-head > .icon { color: var(--primary); }
.player-head strong { font-size: 14px; }
.player-actions { margin-left: auto; display: flex; gap: 2px; }
.player-actions button { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 9px; background: none; color: var(--text-2); }
.player-actions button:hover { background: var(--primary-soft); color: var(--text); }
.player-actions .icon { width: 16px; height: 16px; }
.player-frame { padding: 0 10px 10px; }
.player-frame:empty { display: none; }
.player-frame iframe { display: block; width: 100%; border: 0; border-radius: 14px; height: 352px; transition: height var(--t); }
.player.is-compact .player-frame iframe { height: 152px; }
.player-setup { display: grid; gap: 8px; padding: 0 14px 14px; }
.player-setup label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.player-setup input {
  height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--glass);
}
.player-setup input:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 4px var(--primary-soft); }
.player-hint { margin: 0; font-size: 12.5px; color: var(--text-3); }
.player-setup .form-error { margin-top: 0; }
.player-hint code { font-size: 11.5px; background: var(--primary-soft); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
.player-setup-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
/* Reproductor completo */
.np { display: grid; gap: 10px; padding: 4px 14px 14px; }
.np-top { display: flex; align-items: center; gap: 12px; }
.np-cover { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; box-shadow: var(--shadow); }
.np-info { min-width: 0; flex: 1; }
.np-title { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-artist { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-where { font-size: 11.5px; color: var(--primary); font-weight: 600; margin-top: 2px; }
.np-bar { display: grid; grid-template-columns: 36px 1fr 36px; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.np-bar span:last-child { text-align: right; }
.np input[type=range] { -webkit-appearance: none; appearance: none; height: 6px; border-radius: 999px; cursor: pointer; width: 100%;
  background: linear-gradient(90deg, var(--primary) var(--p, 0%), var(--glass-border) var(--p, 0%)); }
.np input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.np input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.np-ctrls { display: flex; align-items: center; justify-content: center; gap: 6px; }
.np-ctrls button { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--text-2); }
.np-ctrls button:hover { background: var(--primary-soft); color: var(--text); }
.np-ctrls button.on { color: var(--primary); }
.np-ctrls .np-play { width: 48px; height: 48px; background: var(--grad); color: #fff; box-shadow: 0 6px 16px var(--glow); }
.np-ctrls .np-play:hover { background: var(--grad); color: #fff; filter: brightness(1.08); }
.np-ctrls .np-play .icon { width: 22px; height: 22px; }
.np-vol { display: flex; align-items: center; gap: 6px; margin-left: 8px; color: var(--text-3); }
.np-vol input { width: 70px; --p: 70%; }
.np-note { margin: 0 14px 10px; font-size: 12.5px; line-height: 1.45; color: var(--text-2); background: var(--primary-soft); border-radius: 12px; padding: 8px 10px; }
.player.is-playing .player-fab .eq { display: flex; }
.player.is-playing .player-fab .icon { transform: translate(-3px, -2px); }

.link-btn { border: 0; background: none; padding: 2px 4px; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--primary); }
.link-btn:hover { text-decoration: underline; }
.sp-connect-wrap { display: grid; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--glass-line); margin-bottom: 4px; }
.sp-connect { justify-content: center; height: 42px; }
.player-lists { display: grid; gap: 8px; padding: 0 12px 12px; }
.pl-account { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); }
.pl-account span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-account b { color: var(--text); font-weight: 600; }
#pl-filter { height: 38px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--glass); }
#pl-filter:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 4px var(--primary-soft); }
.pl-list { max-height: 320px; overflow-y: auto; display: grid; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.pl-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 6px; border: 0; border-radius: 12px; background: none;
  transition: background var(--t);
}
.pl-item:hover, .pl-item:focus-visible { background: var(--primary-soft); }
.pl-item[aria-current="true"] { background: var(--glass-strong); box-shadow: inset 0 0 0 1px var(--glass-border); }
.pl-cover { width: 44px; height: 44px; border-radius: 8px; flex: none; object-fit: cover; background: var(--grad); display: grid; place-items: center; color: #fff; }
.pl-cover .icon { width: 18px; height: 18px; }
.pl-text { min-width: 0; flex: 1; }
.pl-name, .pl-meta { display: block; }
.pl-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-meta { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-cover.liked { background: linear-gradient(135deg, #0369A1, #22D3EE); }
.pl-cover.liked .icon { fill: #fff; stroke: #fff; width: 20px; height: 20px; }
.pl-cover.back { background: var(--glass-strong); color: var(--text-2); font-size: 20px; font-weight: 700; box-shadow: inset 0 0 0 1px var(--glass-border); }
.sp-off { font-size: 12.5px; line-height: 1.45; color: var(--text-2); background: var(--primary-soft); border-radius: 12px; padding: 10px 12px; }
.sp-off code { font-size: 11.5px; background: var(--glass-strong); padding: 1px 5px; border-radius: 5px; }
.pl-empty { font-size: 13px; color: var(--text-3); padding: 14px 4px; text-align: center; }
.pl-paste { justify-self: start; }
@media (max-width: 880px) {
  .pl-list { max-height: 240px; }
  .player { right: 14px; bottom: 14px; }
  .player-panel { width: calc(100vw - 28px); }
  .player-frame iframe { height: 232px; }
}

/* Navegadores sin backdrop-filter: más opacidad para mantener la legibilidad */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: rgba(255,255,255,.88); --glass-soft: rgba(255,255,255,.75); }
  [data-theme="dark"] { --glass: rgba(16,30,58,.92); --glass-soft: rgba(16,30,58,.85); }
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
  .brand { width: auto; }
  .topbar-actions { gap: 4px; }
  .gs-row { padding: 14px 14px 0; }
  .gsearch.open input { width: calc(100vw - 28px); }
  .kpi .k-value { font-size: 26px; }
  .topbar .btn-icon, .topbar .btn:not(.btn-icon), .avatar-btn { width: 38px; height: 38px; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .search kbd { display: none; }
  .btn-label { display: none; }
  .topbar .btn:not(.btn-icon) { width: 40px; padding: 0; justify-content: center; }
  .sidebar {
    position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--glass-border);
    padding: 8px 12px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  }
  .sidebar .nav { display: flex; gap: 6px; }
  .sidebar .nav-label { display: none; }
  .nav-item { white-space: nowrap; border: 1px solid var(--glass-border); border-radius: 999px; padding: 6px 12px; background: var(--glass); }
  .nav-row .edit-cat { display: none !important; }
  .nav-row:hover .count { visibility: visible; }
  .main { padding: 22px 14px 56px; }
  .view-head h2 { font-size: 26px; }
  .card-actions { opacity: 1; pointer-events: auto; position: relative; right: auto; top: auto; transform: none; background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .row-2 { grid-template-columns: 1fr; }
  .backdrop i { filter: blur(60px); }
}
@media (hover: none) {
  .card-actions { opacity: 1; pointer-events: auto; position: relative; right: auto; top: auto; transform: none; background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
