:root,
[data-theme="light"] {
    color-scheme: light;
    --bg: #f4f6fb;
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-input: #eef2f7;
    --border: rgba(15, 23, 42, 0.09);
    --border-strong: rgba(15, 23, 42, 0.18);
    --text: #0f172a;
    --text-muted: #475569;
    --text-dim: #64748b;
    --accent: #d20c28;
    --accent-end: #9e0126;
    --accent-soft: rgba(210, 12, 40, 0.11);
    --accent-border: rgba(210, 12, 40, 0.25);
    --accent-glow: rgba(210, 12, 40, 0.28);
    --accent-radial: rgba(210, 12, 40, 0.06);
    --cyan: #0284c7;
    --cyan-soft: rgba(2, 132, 199, 0.12);
    --success: #22c55e;
    --dock-bg: rgba(255, 255, 255, 0.92);
    --shadow-lg: 0 18px 45px rgba(15, 23, 42, 0.14);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --sidebar-w: 268px;
    --dock-h: 92px;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0a0d14;
    --bg-elevated: #121722;
    --bg-card: #161d2b;
    --bg-card-hover: #1d2638;
    --bg-input: #0f141e;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #f3f6fc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --accent: #f02d36;
    --accent-end: #c91532;
    --accent-soft: rgba(240, 45, 54, 0.16);
    --accent-border: rgba(240, 45, 54, 0.28);
    --accent-glow: rgba(240, 45, 54, 0.34);
    --accent-radial: rgba(240, 45, 54, 0.08);
    --cyan: #38bdf8;
    --cyan-soft: rgba(56, 189, 248, 0.15);
    --dock-bg: rgba(13, 18, 28, 0.9);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

body {
    overflow-x: clip;
    background-image:
        radial-gradient(circle at 12% 8%, var(--accent-radial), transparent 34%),
        radial-gradient(circle at 88% 12%, rgba(56, 189, 248, 0.08), transparent 32%);
}

button,
input,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr) 336px;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    grid-column: 1;
    width: var(--sidebar-w);
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: sticky;
    top: 0;
    height: calc(100vh - var(--dock-h));
    overflow-y: auto;
    scrollbar-width: thin;
    z-index: 30;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    min-width: 0;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    text-decoration: none;
}

.brand-mark-img {
    background: transparent;
    box-shadow: none;
}

.brand-mark-img img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.18;
    min-width: 0;
}

.brand-name-link {
    font-size: 0.96rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}

.brand-name-link:hover {
    color: var(--accent);
}

.brand-text small {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 11px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    transition: background 0.16s, color 0.16s, border-color 0.16s;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text);
}

.nav-item.is-active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent-border);
}

.nav-badge {
    margin-left: auto;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.73rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg-input);
    color: var(--text-muted);
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-label {
    margin: 0;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    font-weight: 700;
    padding-left: 4px;
}

.chip-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.quick-chip {
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-muted);
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.15s ease;
}

.quick-chip:hover,
.quick-chip.is-selected {
    border-color: var(--cyan);
    background: var(--cyan-soft);
    color: var(--cyan);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
}

.theme-toggle svg {
    width: 17px;
    height: 17px;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

[data-theme="light"] .theme-toggle .icon-sun {
    display: none;
}

.shortcuts-hint {
    margin: 0;
    font-size: 0.73rem;
    color: var(--text-dim);
    line-height: 1.45;
}

kbd {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid var(--border-strong);
    background: var(--bg-input);
}

/* Main area */
.main-content {
    grid-column: 2;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 16px 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.topbar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-dim);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    height: 44px;
    padding: 0 40px 0 42px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    font-size: 0.94rem;
    outline: none;
    transition: border-color 0.16s, box-shadow 0.16s;
}

.search-box input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px var(--cyan-soft);
}

.clear-input-btn {
    position: absolute;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    display: grid;
    place-items: center;
}

.clear-input-btn svg {
    width: 15px;
    height: 15px;
}

.btn-secondary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    border-radius: 11px;
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.16s, border-color 0.16s, transform 0.12s;
}

.btn-secondary {
    border: 1px solid var(--border-strong);
    background: var(--bg-elevated);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--cyan);
}

.btn-secondary svg {
    width: 16px;
    height: 16px;
}

.btn-ghost {
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background: var(--bg-card-hover);
    color: var(--text);
}

.filters-bar {
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr)) auto;
    gap: 10px;
    align-items: end;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.filter-field span {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-field select {
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    font-size: 0.84rem;
    text-overflow: ellipsis;
    outline: none;
}

.filter-field select:focus {
    border-color: var(--cyan);
}

/* Content section */
.content-area {
    padding: 24px 28px calc(var(--dock-h) + 28px);
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Fixed Right Editorial Column */
.editorial-sidebar {
    grid-column: 3;
    width: 336px;
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 0;
    height: calc(100vh - var(--dock-h));
    overflow-y: auto;
    scrollbar-width: thin;
    z-index: 25;
}

.editorial-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
}

.editorial-card h2 {
    margin: 0 0 10px;
    font-size: 1.04rem;
    font-weight: 800;
    letter-spacing: -0.015em;
}

.editorial-intro {
    margin: 0 0 12px;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text-muted);
}

.guide-steps {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.guide-steps strong {
    color: var(--text);
}

.guide-steps code {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.76rem;
    padding: 1px 5px;
    border-radius: 5px;
    background: var(--bg-input);
    border: 1px solid var(--border);
}

.editorial-shortcuts {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.6;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-input);
    padding: 9px 11px;
}

.faq-item summary {
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.4;
    list-style: none;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    font-family: "JetBrains Mono", monospace;
    color: var(--accent);
    font-weight: 700;
    flex-shrink: 0;
}

.faq-item[open] summary::after {
    content: "−";
}

.faq-item p {
    margin: 8px 0 2px;
    font-size: 0.82rem;
    line-height: 1.52;
    color: var(--text-muted);
}

.page-intro {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.page-h1 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.page-lead {
    margin: 0;
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Responsive AdSense Slots (afiliacion_horizontal.php 2-div grid lock for zero CLS) */
.ad-slot-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    flex-shrink: 0;
}

.ad-slot-label {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    height: 12px;
    line-height: 12px;
    text-align: center;
}

.ad-slot-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 280px !important;
    align-items: center;
    width: 100%;
    max-width: 100%;
    max-height: 280px !important;
    background: var(--bg-input);
    border-radius: 10px;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    flex-shrink: 0;
}

.ad-slot-inner {
    display: block !important;
    text-align: center;
    width: 100%;
    max-width: 100%;
    max-height: 280px !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    /* AdSense reescribirá este div (height: auto), pero la fila de .ad-slot-grid bloquea el CLS */
}

.ad-slot-inner > ins {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: 280px !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    background: transparent;
}

.ad-slot-infeed {
    grid-column: 1 / -1;
    order: 5;
}

.view-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.view-header .section-heading {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.015em;
}

/* Station Detail Hero (/emisora/...) */
.station-hero {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--cyan);
}

.station-hero-main {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.station-hero-logo {
    width: 96px;
    height: 96px;
    border-radius: 18px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    overflow: hidden;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    position: relative;
}

.station-hero-logo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--bg-input);
    opacity: 0;
    transition: opacity 0.16s ease;
}

.station-hero-logo img.is-loaded {
    opacity: 1;
}

.detail-monogram {
    font-size: 1.6rem;
}

.station-hero-body {
    flex: 1;
    min-width: 0;
}

.station-hero-body h1 {
    margin: 6px 0 6px;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.station-hero-sub {
    margin: 0 0 12px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.station-hero-sub a {
    color: var(--cyan);
    text-decoration: none;
}

.station-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.station-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    border-radius: 11px;
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-end));
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    box-shadow: 0 8px 20px var(--accent-glow);
    transition: transform 0.14s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
}

.btn-primary svg {
    width: 16px;
    height: 16px;
}

.view-header p {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.view-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-pill {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.78rem;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.active-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.active-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--cyan-soft);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: var(--cyan);
    font-size: 0.78rem;
    font-weight: 600;
}

.active-chip button,
.active-chip a {
    border: none;
    background: none;
    padding: 0;
    color: inherit;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
}

/* Station Cards Grid */
.stations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr));
    gap: 16px;
}

.stations-grid > .station-card {
    order: 10;
}

.stations-grid > .station-card:nth-of-type(1) {
    order: 1;
}

.stations-grid > .station-card:nth-of-type(2) {
    order: 3;
}

.stations-grid > .station-card:nth-of-type(3) {
    order: 4;
}

.station-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
    position: relative;
}

.station-card:hover {
    transform: translateY(-2px);
    background: var(--bg-card-hover);
    border-color: var(--border-strong);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

.station-card.is-playing {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-border), 0 14px 30px var(--accent-soft);
}

.station-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.station-logo-wrap {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    overflow: hidden;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    position: relative;
}

.station-logo-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--bg-input);
    opacity: 0;
    transition: opacity 0.16s ease;
}

.station-logo-wrap img.is-loaded {
    opacity: 1;
}

.station-monogram {
    font-weight: 800;
    font-size: 1rem;
    color: var(--cyan);
    letter-spacing: 0.02em;
}

.station-title-col {
    flex: 1;
    min-width: 0;
}

.station-name {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.28;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.station-name-link {
    color: inherit;
    text-decoration: none;
}

.station-name-link:hover {
    color: var(--cyan);
}

.station-origin {
    margin-top: 4px;
    font-size: 0.79rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.station-actions-top {
    display: flex;
    align-items: center;
    gap: 4px;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    display: inline-grid;
    place-items: center;
    position: relative;
    transition: background 0.15s, color 0.15s;
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

.icon-btn:hover:not(:disabled) {
    background: var(--bg-input);
    color: var(--text);
}

.icon-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.fav-btn.is-fav {
    color: var(--accent);
}

.fav-btn.is-fav svg {
    fill: currentColor;
}

.station-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 24px;
}

.tag-pill {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-muted);
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    display: inline-block;
}

a.tag-pill:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.station-bottom {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.codec-badge {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hls-tag {
    padding: 2px 6px;
    border-radius: 5px;
    background: var(--cyan-soft);
    color: var(--cyan);
    font-weight: 600;
}

.card-play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 34px;
    min-width: 98px;
    padding: 0 13px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--bg-input);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.card-play-btn svg {
    width: 14px;
    height: 14px;
}

.card-play-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.station-card.is-playing .card-play-btn {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Equalizer bars inside playing card */
.eq-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}

.eq-bars span {
    width: 2.5px;
    background: currentColor;
    border-radius: 2px;
    animation: eqPulse 0.8s ease-in-out infinite alternate;
}

.eq-bars span:nth-child(2) {
    animation-delay: 0.2s;
}

.eq-bars span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes eqPulse {
    from {
        height: 3px;
    }
    to {
        height: 12px;
    }
}

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
    animation: loadingDotPulse 0.9s ease-in-out infinite alternate;
}

@keyframes loadingDotPulse {
    from {
        opacity: 0.35;
        transform: scale(0.75);
    }
    to {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Skeleton loading cards */
.skeleton-card {
    height: 178px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: linear-gradient(
        110deg,
        var(--bg-card) 25%,
        var(--bg-card-hover) 37%,
        var(--bg-card) 63%
    );
    background-size: 200% 100%;
    animation: shimmer 1.25s infinite linear;
}

@keyframes shimmer {
    to {
        background-position-x: -200%;
    }
}

.empty-state {
    text-align: center;
    padding: 56px 20px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
}

.empty-icon svg {
    width: 28px;
    height: 28px;
}

.empty-state h2 {
    margin: 4px 0 0;
    font-size: 1.15rem;
}

.empty-state p {
    margin: 0 0 8px;
    color: var(--text-muted);
    max-width: 420px;
}

.load-more-wrap {
    display: flex;
    justify-content: center;
    padding-top: 6px;
}

/* Persistent Bottom Player Dock */
.player-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    min-height: var(--dock-h);
    background: var(--dock-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-strong);
    padding: 8px 24px;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) auto minmax(220px, 1fr);
    align-items: center;
    gap: 20px;
    z-index: 40;
}

.player-station-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.player-artwork-btn {
    width: 58px;
    height: 58px;
    border-radius: 12px;
    border: 1px solid var(--border-strong);
    background: var(--bg-input);
    padding: 0;
    overflow: hidden;
    flex-shrink: 0;
    display: grid;
    place-items: center;
}

.player-artwork-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.artwork-fallback {
    color: var(--text-dim);
    display: grid;
    place-items: center;
}

.artwork-fallback svg {
    width: 26px;
    height: 26px;
}

.player-text {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.player-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.player-title-row strong {
    font-size: 0.94rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--bg-input);
    color: var(--text-dim);
    flex-shrink: 0;
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.player-dock.is-playing .live-badge {
    background: var(--accent-soft);
    color: var(--accent);
}

.player-dock.is-playing .live-dot {
    animation: liveBlink 1.3s ease-in-out infinite;
}

@keyframes liveBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

.player-track {
    font-size: 0.83rem;
    color: var(--cyan);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-meta {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Transport Controls */
.player-controls-center {
    display: flex;
    align-items: center;
    gap: 18px;
}

.transport-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.play-main-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-end));
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 8px 22px var(--accent-glow);
    transition: transform 0.14s ease, opacity 0.14s ease;
}

.play-main-btn:hover:not(:disabled) {
    transform: scale(1.06);
}

.play-main-btn:disabled {
    opacity: 0.4;
    box-shadow: none;
    cursor: not-allowed;
}

.play-main-btn svg {
    width: 20px;
    height: 20px;
}

.play-main-btn .icon-pause,
.play-main-btn .btn-spinner {
    display: none;
}

.player-dock.is-playing .play-main-btn .icon-play {
    display: none;
}

.player-dock.is-playing .play-main-btn .icon-pause {
    display: block;
}

.player-dock.is-loading .play-main-btn .icon-play,
.player-dock.is-loading .play-main-btn .icon-pause {
    display: none;
}

.player-dock.is-loading .play-main-btn .btn-spinner {
    display: block;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.secondary-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sleep-control {
    position: relative;
}

.sleep-countdown {
    position: absolute;
    bottom: -4px;
    right: -4px;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.62rem;
    padding: 1px 4px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
}

.sleep-menu {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 170px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sleep-menu p {
    margin: 2px 6px 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
}

.sleep-menu button {
    border: none;
    background: transparent;
    text-align: left;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 0.84rem;
}

.sleep-menu button:hover {
    background: var(--bg-card-hover);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.volume-control .icon-mute {
    display: none;
}

.volume-control.is-muted .icon-vol {
    display: none;
}

.volume-control.is-muted .icon-mute {
    display: block;
    color: var(--accent);
}

#volumeSlider {
    width: 86px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* Visualizer */
.player-visualizer-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

#visualizerCanvas {
    width: 260px;
    height: 44px;
    border-radius: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    cursor: pointer;
}

.viz-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.viz-mode-btn {
    border: none;
    background: none;
    padding: 0;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.68rem;
    color: var(--text-dim);
}

.viz-mode-btn.is-active {
    color: var(--cyan);
}

.viz-mode-btn:hover {
    color: var(--cyan);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 15, 0.72);
    backdrop-filter: blur(8px);
    display: grid;
    place-items: center;
    padding: 20px;
    z-index: 60;
}

.modal-card {
    width: min(640px, 100%);
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
}

.modal-body {
    display: flex;
    gap: 22px;
    align-items: flex-start;
}

.modal-art-wrap {
    width: 170px;
    height: 170px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-input);
    border: 1px solid var(--border);
    flex-shrink: 0;
    display: grid;
    place-items: center;
}

.modal-art-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-art-fallback {
    font-weight: 800;
    color: var(--text-dim);
    letter-spacing: 0.1em;
}

.modal-info {
    flex: 1;
    min-width: 0;
}

.modal-eyebrow {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    color: var(--accent);
    font-weight: 700;
}

.modal-info h2 {
    margin: 6px 0;
    font-size: 1.35rem;
}

.modal-track {
    margin: 0 0 14px;
    color: var(--cyan);
    font-weight: 600;
}

.modal-specs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
    margin: 0 0 14px;
    font-size: 0.83rem;
}

.modal-specs dt {
    color: var(--text-dim);
    font-size: 0.74rem;
}

.modal-specs dd {
    margin: 0;
    font-weight: 600;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.modal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Toasts */
.toast-container {
    position: fixed;
    right: 20px;
    bottom: calc(var(--dock-h) + 16px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 70;
}

.toast {
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    font-size: 0.84rem;
    font-weight: 600;
    max-width: 340px;
}

.toast.is-error {
    border-color: var(--accent);
    color: var(--accent);
}

.mobile-only {
    display: none;
}

.sidebar-backdrop {
    display: none;
}

@media (max-width: 1260px) {
    .app-shell {
        grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    }
    .sidebar {
        grid-row: 1 / 3;
    }
    .main-content {
        grid-column: 2;
        grid-row: 1;
    }
    .content-area {
        padding: 24px 28px 28px;
    }
    .editorial-sidebar {
        grid-column: 2;
        grid-row: 2;
        width: 100%;
        position: static;
        height: auto;
        overflow-y: visible;
        border-left: none;
        border-top: 1px solid var(--border);
        padding: 20px 28px calc(var(--dock-h) + 28px);
    }
}

@media (max-width: 1120px) {
    .filters-bar {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .player-dock {
        grid-template-columns: minmax(0, 1fr) auto;
    }
    .player-visualizer-wrap {
        display: none;
    }
}

@media (max-width: 860px) {
    .app-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .mobile-only {
        display: inline-grid;
    }

    .sidebar {
        grid-row: auto;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-backdrop.is-open {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 25;
    }

    .main-content {
        grid-column: 1;
        grid-row: 1;
    }

    .topbar {
        padding: 8px 12px;
        gap: 8px;
    }

    .topbar-row {
        gap: 8px;
    }

    .search-icon {
        left: 11px;
        width: 16px;
        height: 16px;
    }

    .search-box input {
        height: 38px;
        padding: 0 32px 0 34px;
        font-size: 0.88rem;
        border-radius: 10px;
    }

    .btn-secondary.mobile-only {
        display: inline-flex;
    }

    .filter-toggle-btn {
        height: 38px;
        padding: 0 10px;
        gap: 6px;
        border-radius: 10px;
        flex-shrink: 0;
    }

    .filter-toggle-btn.is-active {
        border-color: var(--cyan);
        background: var(--cyan-soft);
        color: var(--cyan);
    }

    .filter-count-dot {
        font-family: "JetBrains Mono", monospace;
        font-size: 0.68rem;
        font-weight: 700;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 999px;
        background: var(--accent);
        color: #fff;
        display: inline-grid;
        place-items: center;
    }

    #surpriseBtn {
        height: 38px;
        padding: 0 10px;
        border-radius: 10px;
        flex-shrink: 0;
    }

    .content-area {
        padding: 14px 14px 20px;
    }

    .editorial-sidebar {
        grid-column: 1;
        grid-row: 2;
        padding: 18px 14px 144px;
    }

    .filters-bar {
        display: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .filters-bar.is-mobile-open {
        display: grid;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-elevated);
        border-bottom: 1px solid var(--border-strong);
        box-shadow: var(--shadow-lg);
        padding: 10px 12px 14px;
        z-index: 25;
    }

    .filter-field span {
        font-size: 0.65rem;
    }

    .filter-field select {
        height: 34px;
        padding: 0 8px;
        font-size: 0.8rem;
        border-radius: 8px;
    }

    #resetFiltersBtn {
        height: 34px;
        font-size: 0.8rem;
        justify-content: center;
        border: 1px solid var(--border);
        background: var(--bg-elevated);
        border-radius: 8px;
    }

    .player-dock {
        height: auto;
        min-height: var(--dock-h);
        padding: 10px 12px;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .player-artwork-btn {
        width: 46px;
        height: 46px;
        border-radius: 10px;
    }

    .player-controls-center {
        width: 100%;
        min-width: 0;
        justify-content: space-between;
        gap: 8px;
        flex-wrap: wrap;
    }

    .transport-buttons {
        gap: 6px;
    }

    .play-main-btn {
        width: 42px;
        height: 42px;
    }

    .secondary-controls {
        gap: 4px;
        min-width: 0;
    }

    .sleep-menu {
        left: auto;
        right: 0;
        transform: none;
    }

    #volumeSlider {
        width: 56px;
        min-width: 42px;
    }

    .modal-body {
        flex-direction: column;
    }

    .modal-art-wrap {
        width: 120px;
        height: 120px;
    }

    .station-hero-main {
        flex-direction: column;
    }
}

@media (max-width: 767px) {
    .stations-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .ad-slot-infeed {
        order: 2;
    }

    .station-card {
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr) auto auto;
        align-items: center;
        gap: 10px;
        padding: 8px 10px;
        border-radius: 12px;
    }

    .station-card:hover {
        transform: none;
        box-shadow: none;
    }

    .station-card.is-playing {
        box-shadow: 0 0 0 1px var(--accent-border), 0 6px 16px var(--accent-soft);
    }

    .station-top,
    .station-bottom {
        display: contents;
    }

    .station-logo-wrap {
        grid-column: 1;
        width: 42px;
        height: 42px;
        border-radius: 10px;
    }

    .station-monogram {
        font-size: 0.85rem;
    }

    .station-title-col {
        grid-column: 2;
        min-width: 0;
    }

    .station-name {
        font-size: 0.88rem;
        line-height: 1.22;
        -webkit-line-clamp: 1;
    }

    .station-origin {
        margin-top: 2px;
        font-size: 0.72rem;
    }

    .station-actions-top {
        grid-column: 3;
    }

    .station-actions-top .icon-btn {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    .station-actions-top .icon-btn svg {
        width: 16px;
        height: 16px;
    }

    .station-tags,
    .codec-badge {
        display: none;
    }

    .card-play-btn {
        grid-column: 4;
        width: 34px;
        height: 34px;
        min-width: 34px;
        padding: 0;
        border-radius: 50%;
        gap: 0;
    }

    .card-play-btn > span:not(.eq-bars):not(.loading-dot) {
        display: none;
    }

    .skeleton-card {
        height: 60px;
        border-radius: 12px;
    }
}

@media (max-width: 560px) {
    #surpriseBtn {
        width: 38px;
        padding: 0;
        justify-content: center;
    }

    #surpriseBtn span {
        display: none;
    }
}

@media (max-width: 420px) {
    .content-area,
    body.hydra-app .content-area {
        padding: 10px 10px 16px;
    }

    .station-card {
        grid-template-columns: 38px minmax(0, 1fr) auto auto;
        gap: 8px;
        padding: 7px 9px;
    }

    .station-logo-wrap {
        width: 38px;
        height: 38px;
        border-radius: 9px;
    }

    .card-play-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .skeleton-card {
        height: 54px;
    }

    .filter-toggle-label {
        display: none;
    }

    .player-dock .icon-btn {
        width: 30px;
        height: 30px;
    }

    .play-main-btn {
        width: 38px;
        height: 38px;
    }

    #volumeSlider {
        width: 46px;
    }
}

/* ── Modo Hydra / WebView App (?hydra=050509) ─────────────────────── */
body.hydra-app {
    margin: 0;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    display: flex;
    flex-direction: column;
}

body.hydra-app .app-shell {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

body.hydra-app .sidebar {
    height: 100%;
}

body.hydra-app .brand-mark-img img {
    border-radius: 10px;
}

body.hydra-app .hydra-app-menu {
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

body.hydra-app .hydra-menu-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

body.hydra-app .nav-item.nav-item-compact {
    padding: 8px 10px;
    font-size: 0.85rem;
    gap: 10px;
    border-radius: 9px;
}

body.hydra-app .nav-item.nav-item-compact svg {
    width: 16px;
    height: 16px;
}

body.hydra-app .shortcuts-hint {
    display: none;
}

body.hydra-app .main-content {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.hydra-app .content-area {
    padding: 18px 22px 24px;
}

body.hydra-app .player-dock {
    position: static;
    height: auto;
    min-height: var(--dock-h);
    flex-shrink: 0;
    z-index: 35;
}

.hydra-bottom-ad-slot {
    width: 100%;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    padding: 6px 10px 8px;
    flex-shrink: 0;
    clear: both;
    overflow: hidden;
}

.hydra-bottom-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(50px, auto);
    width: 100%;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
}

.hydra-bottom-wrap {
    display: block !important;
    text-align: center;
    width: 100%;
    /* AdSense reescribirá este div (height: auto), pero la fila de .hydra-bottom-grid bloquea el CLS */
}

.hydra-bottom-wrap > ins {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
}

@media (max-width: 860px) {
    body.hydra-app .app-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    body.hydra-app .sidebar {
        height: 100dvh;
        z-index: 45;
    }

    body.hydra-app .content-area {
        padding: 14px 14px 20px;
    }
}

@media (max-width: 420px) {
    body.hydra-app .content-area {
        padding: 10px 10px 16px;
    }
}

@media (orientation: landscape) and (max-height: 560px) {
    body.hydra-app {
        height: auto;
        min-height: 100dvh;
        overflow-y: auto;
    }

    body.hydra-app .app-shell,
    body.hydra-app .main-content {
        height: auto;
        overflow: visible;
    }

    body.hydra-app .hydra-bottom-ad-slot {
        padding: 4px 8px 6px;
    }

    body.hydra-app .hydra-bottom-grid {
        grid-template-rows: minmax(50px, auto);
    }
}
