/* ================================================================
   DJ PLAYLIST DOWNLOADER PRO — ULTRA-SOBER OLED BLACK STYLESHEET
   Mobile-First • High Contrast • Sleek Hardware Aesthetic
   ================================================================ */

:root {
    --bg-black: #000000;
    --bg-surface: #0a0a0c;
    --bg-card: #121215;
    --bg-card-hover: #18181c;
    --bg-input: #08080a;
    
    --border-subtle: #1e1e24;
    --border-focus: #3f3f46;
    --border-light: rgba(255, 255, 255, 0.12);

    --text-pure: #ffffff;
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --accent-white: #ffffff;
    --accent-black: #000000;
    --accent-primary: #ffffff;
    --accent-success: #ffffff;
    --accent-warning: #e5e5e5;
    --accent-danger: #d4d4d4;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --topbar-height: 64px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    background-color: var(--bg-black);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
}

/* App Container */
.app-layout {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.85rem 0.75rem calc(75px + env(safe-area-inset-bottom, 0px)) 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    min-height: calc(100dvh - var(--topbar-height, 64px));
}

@media (min-width: 768px) {
    :root {
        --topbar-height: 72px;
    }
    .app-layout {
        padding: 1.25rem 1.5rem calc(80px + env(safe-area-inset-bottom, 0px)) 1.5rem;
        gap: 1.25rem;
        min-height: calc(100dvh - var(--topbar-height, 72px));
    }
}

/* Main Tab Containers */
.tab-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
}

/* ================================================================
   1. APP TOPBAR (100% FLUSH TO TOP EDGE & STICKY)
   ================================================================ */
.app-topbar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    border-radius: 0;
    padding-top: max(0.45rem, env(safe-area-inset-top, 0px));
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.45rem 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .topbar-inner {
        padding: 0.65rem 1.5rem;
    }
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.nav-hub-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #141416;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.38rem 0.65rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 500;
    transition: all 0.15s ease;
    min-height: 34px;
}

.nav-hub-btn:hover {
    background: #202024;
    color: var(--text-pure);
    border-color: var(--border-focus);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-icon {
    font-size: 1.25rem;
    color: var(--text-pure);
    animation: spinSlow 15s linear infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.brand-text {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.brand-title {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-pure);
}

.topbar-hub-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #141418;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 32px;
}

.topbar-hub-btn:hover {
    background: #202026;
    color: var(--text-pure);
    border-color: var(--border-focus);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Indicador de Descargas Disponibles / Plan en Topbar */
.quota-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #101014;
    border: 1px solid var(--border-subtle);
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.quota-pill:hover {
    background: #18181e;
    border-color: var(--border-focus);
    transform: translateY(-1px);
}

.quota-icon {
    font-size: 0.8rem;
    color: var(--text-pure);
}

.quota-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
}

.quota-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.quota-value {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-pure);
    font-family: var(--font-mono);
}

.quota-arrow {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: 2px;
}

/* ================================================================
   PLANES MODAL (PANTALLA COMPLETA TOTALMENTE SIN SCROLL)
   ================================================================ */
.modal-fullscreen {
    padding: 0 !important;
    background: #000000 !important;
    z-index: 99999 !important;
}

.plans-modal-fullscreen-box {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    background: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    box-shadow: none !important;
}

.fullscreen-modal-topbar {
    width: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    border-radius: 0;
    padding-top: max(0.45rem, env(safe-area-inset-top, 0px));
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    box-sizing: border-box;
    margin: 0 !important;
    flex-shrink: 0;
}

.fullscreen-modal-topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.45rem 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .fullscreen-modal-topbar-inner {
        padding: 0.65rem 1.5rem;
    }
}

.fullscreen-modal-title {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-pure);
    margin: 0;
    display: flex;
    align-items: center;
}

.fullscreen-modal-topbar .modal-close {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: #141416;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    margin: 0;
}

.fullscreen-modal-topbar .modal-close:hover {
    background: #202024;
    color: var(--text-pure);
    border-color: var(--border-focus);
}

.fullscreen-modal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.85rem 0.75rem calc(1rem + env(safe-area-inset-bottom, 0px)) 0.75rem;
    box-sizing: border-box;
    overflow-y: auto;
    gap: 0;
}

@media (min-width: 768px) {
    .fullscreen-modal-content {
        padding: 1.25rem 1.5rem calc(1rem + env(safe-area-inset-bottom, 0px)) 1.5rem;
        justify-content: center;
    }
}

.plans-compact-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    width: 100%;
    max-width: 850px;
    margin: auto;
}

@media (min-width: 640px) {
    .plans-compact-cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

.plan-compact-card {
    background: #0d0d10;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1rem 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.45rem;
    transition: all 0.2s ease;
}

.plan-compact-card:hover {
    border-color: var(--border-focus);
    background: #141414;
}

.plan-compact-card.active-plan {
    border-color: var(--accent-white);
    background: #141414;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.08);
}

.plan-compact-card .plan-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    background: #27272a;
    color: #e4e4e7;
    padding: 0 8px;
    height: 20px;
    line-height: 20px;
    border-radius: var(--radius-full);
}

.plan-compact-card .plan-badge.featured {
    background: #ffffff;
    color: #000000;
}

.plan-compact-card .plan-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-pure);
}

.plan-compact-card .plan-limit strong {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-pure);
}

.plan-compact-card .plan-limit span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.plan-compact-card .plan-features {
    list-style: none;
    padding: 0;
    margin: 0.2rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.74rem;
    color: var(--text-secondary);
}

.plan-compact-card .plan-features li {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.plan-compact-card .plan-features i {
    color: var(--text-pure);
    font-size: 0.7rem;
}

/* ================================================================
   TOP CARD PROGRESS BOX (MODAL SUPERIOR DE PROGRESO)
   ================================================================ */
.top-card-progress-box {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    width: 100%;
}

.top-card-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    font-family: var(--font-mono);
}

.top-card-progress-name {
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.top-card-progress-num {
    color: var(--text-pure);
    font-weight: 700;
}

/* ================================================================
   CUENTAS EN LA NUBE & CARPETAS (MODALES DE ALMACENAMIENTO)
   ================================================================ */
.cloud-accounts-modal-box {
    max-width: 520px;
}

.cloud-accounts-list,
.local-folders-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0.5rem 0;
}

.cloud-account-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #111115;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    gap: 0.75rem;
}

.cloud-account-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    background: #1c1c22;
}

.cloud-account-icon.vps { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.15); color: #ffffff; }
.cloud-account-icon.gdrive { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.15); color: #ffffff; }
.cloud-account-icon.folder { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.15); color: #ffffff; }

.cloud-account-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cloud-account-info strong {
    font-size: 0.84rem;
    color: var(--text-pure);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cloud-account-info span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.cloud-add-account-box {
    margin-top: 0.5rem;
}

.plan-limit strong {
    font-size: 1.55rem;
    font-weight: 900;
    color: var(--text-pure);
    font-family: var(--font-mono);
    line-height: 1.1;
}

.plan-limit span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0.35rem 0 0.75rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    text-align: left;
    width: 100%;
    flex: 1;
}

.plan-features li {
    font-size: 0.74rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.plan-features li i {
    color: var(--text-pure);
    font-size: 0.68rem;
    flex-shrink: 0;
}

.plan-select-btn {
    margin-top: auto;
    width: 100%;
    min-height: 38px;
}

/* Exit Confirmation Modal */
.exit-modal-box {
    max-width: 420px;
}

/* Tab Progreso View Card */
.progress-view-card {
    min-height: auto;
}

/* ================================================================
   2. APP BOTTOM BAR (MOBILE-FIRST NAVIGATION DOCK)
   ================================================================ */
.app-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(4, 4, 6, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--border-subtle);
    padding-bottom: max(0.35rem, env(safe-area-inset-bottom, 0px));
    padding-top: 0.25rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.7);
}

.bottom-nav-container {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 0.25rem;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    padding: 0.35rem 0.25rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    flex: 1;
    min-width: 0;
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item i {
    font-size: 1.15rem;
    color: var(--text-muted);
    transition: transform 0.15s ease, color 0.15s ease;
}

.bottom-nav-item:hover {
    color: var(--text-secondary);
}

.bottom-nav-item:hover i {
    color: var(--text-secondary);
}

.bottom-nav-item.active {
    color: var(--text-pure);
}

.bottom-nav-item.active i {
    color: var(--text-pure);
    transform: translateY(-1px);
}

.item-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bottom-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background: #27272a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0 4px;
    border-radius: var(--radius-full);
    min-width: 14px;
    text-align: center;
    line-height: 14px;
}

/* Central Highlighted Button: Refrescar / Novedades */
.bottom-nav-center {
    flex: 1.15;
}

.center-btn-disc {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #141418;
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-pure);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: -6px;
}

.center-btn-disc i {
    font-size: 1.05rem;
    color: var(--text-pure);
}

.bottom-nav-center:hover .center-btn-disc,
.bottom-nav-center:active .center-btn-disc {
    background: #222228;
    border-color: #ffffff;
    transform: scale(1.08);
}

.center-btn-disc.spinning i {
    animation: spinSlow 1s linear infinite;
}

/* ================================================================
   4. CARDS & SECTIONS
   ================================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Modales Superiores (Exactamente el mismo alto y estructura compacta en todas las secciones) */
.section-top-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1.05rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 134px;
    min-height: 134px;
    max-height: 134px;
    box-sizing: border-box;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

@media (min-width: 640px) {
    .section-top-card {
        height: 130px;
        min-height: 130px;
        max-height: 130px;
        padding: 0.9rem 1.25rem;
    }
}

.section-top-card .card-header {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex-shrink: 0;
}

.section-top-card .card-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-pure);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    line-height: 1.25;
}

.section-top-card .card-subtitle {
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-header {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-pure);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Indicative Section Header (clean text, no card background/border) */
.section-indicative-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 1.25rem;
    margin-bottom: 0.65rem;
    padding: 0 0.15rem;
}

.section-indicative-header .header-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.section-indicative-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-pure);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.01em;
    margin: 0;
}

.section-indicative-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}

.badge-status-online {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-pure);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
}

.library-control-card .card-header {
    margin-bottom: 0.25rem;
}

.header-actions,
.library-top-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.header-actions .btn,
.library-top-actions .btn,
.header-title-row .btn {
    height: 32px;
    min-height: 32px;
    padding: 0 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.queue-indicative-actions,
.novedades-indicative-actions,
.explorer-top-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.header-title-row .btn.btn-compact {
    padding: 0 0.55rem;
    font-size: 0.75rem;
}

.library-tab-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.65rem;
    width: 100%;
}

.active-progress-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
}

.profile-field-card,
.profile-toggles-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: auto;
    padding: 1rem;
    gap: 0.75rem;
}

.progress-live-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: auto;
    padding: 1rem;
    gap: 0.75rem;
}

/* Progreso: Top Card Server Summary */
.progress-server-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    background: #09090c;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.85rem;
}

.summary-col {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.summary-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.summary-val {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Novedades: Pills row inside top card */
.monitored-pills-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #09090c;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.35rem 0.65rem;
    min-height: 38px;
    overflow: hidden;
}

.monitored-pills-row .mini-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.monitored-pills-scroll {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    overflow-x: auto;
    white-space: nowrap;
    flex: 1;
    scrollbar-width: none;
}

.monitored-pills-scroll::-webkit-scrollbar {
    display: none;
}

/* ================================================================
   5. SEARCH & URL INPUT CARD (DESCARGAS - EXACTAMENTE IGUAL A NOVEDADES)
   ================================================================ */
.search-input-group {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
}

.search-input-group .input-wrapper {
    flex: 1;
}

.search-input-group .btn {
    height: 44px;
    min-height: 44px;
    padding: 0 1.15rem;
    flex-shrink: 0;
}

.input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    z-index: 2;
}

.input-wrapper input {
    width: 100%;
    height: 44px;
    min-height: 44px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0 2.4rem 0 2.75rem;
    color: var(--text-pure);
    font-size: 16px; /* Prevents auto-zoom on mobile */
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.input-wrapper input:focus {
    border-color: var(--border-focus);
    background: #0d0d10;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.clear-btn {
    position: absolute;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.action-buttons .btn {
    height: 44px;
    min-height: 44px;
}

@media (max-width: 639px) {
    .section-top-card .input-wrapper input {
        height: 40px;
        min-height: 40px;
    }
    .action-buttons {
        width: 100%;
    }
    .action-buttons .btn {
        height: 38px;
        min-height: 38px;
    }
    .action-buttons #pasteBtn {
        flex: 0.38;
    }
    .action-buttons #searchBtn {
        flex: 0.62;
    }
}

.quick-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.option-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: #18181c;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0 0.85rem;
    height: 34px;
    min-height: 34px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

.option-pill:hover {
    border-color: var(--border-focus);
    color: var(--text-pure);
}

.option-pill.active {
    background: #27272a;
    color: var(--text-pure);
    border-color: var(--border-light);
}

/* ================================================================
   6. PROGRESS CARD (Barra Flotante de Progreso sobre Barra Inferior)
   ================================================================ */
.progress-card {
    position: fixed;
    bottom: calc(65px + max(0.35rem, env(safe-area-inset-bottom, 0px)));
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 1.5rem);
    max-width: 680px;
    z-index: 1056;
    background: rgba(12, 12, 12, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.95rem;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 255, 255, 0.05);
    animation: slideUpSyncBanner 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    box-sizing: border-box;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-pure);
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.live-dot.pulse {
    animation: pulseAnim 1.5s infinite;
}

@keyframes pulseAnim {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.badge-stats {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--text-pure);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.progress-track-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #ffffff;
    border-radius: var(--radius-full);
    transition: width 0.25s ease-out;
}

/* ================================================================
   7. CONTENT GRID (RESPONSIVE)
   ================================================================ */
.content-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 880px) {
    .content-grid {
        display: grid;
        grid-template-columns: 1.15fr 0.85fr;
        gap: 1.25rem;
    }
}

.grid-column {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-height: auto;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.column-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-pure);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.badge-count {
    background: #27272a;
    color: var(--text-pure);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

/* Channel Card */
.channel-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: #151518;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    min-height: 64px;
}

.channel-thumb {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-light);
}

.channel-details h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-pure);
}

.channel-details p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Results & Queue List */
.results-list, .queue-list, .library-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: var(--bg-surface);
}
::-webkit-scrollbar-thumb {
    background: #27272a;
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: #3f3f46;
}

/* Item Card (Casilla de Pista / Playlist Estándar) */
.item-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background: #131317;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    min-height: 64px;
    gap: 0.75rem;
    width: 100%;
    transition: all 0.15s ease;
}

.item-card:hover {
    background: #18181f;
    border-color: var(--border-focus);
}

.item-card-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.item-icon-box {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: #1e1e24;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-pure);
    font-size: 1.15rem;
    flex-shrink: 0;
}

.item-info {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}

.item-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-pure);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.item-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    line-height: 1.2;
}

.item-card-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: 0.4rem;
}

.item-card-right .btn {
    height: 36px;
    min-height: 36px;
    padding: 0 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

/* Empty State (Casilla de Estado Vacío Equilibrada y Centrada) */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.25rem;
    min-height: 220px;
    flex: 1;
    margin: auto 0;
    color: var(--text-muted);
    gap: 0.5rem;
    width: 100%;
}

.empty-icon {
    font-size: 2.5rem;
    color: #27272a;
    margin-bottom: 0.25rem;
    transition: transform 0.2s ease;
}

.empty-state p {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
    max-width: 440px;
    line-height: 1.45;
}

.empty-state .hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    max-width: 400px;
    line-height: 1.45;
}

/* En modales, el empty-state no debe forzar expansión de altura */
.modal-box .empty-state {
    flex: initial;
    margin: 0;
    min-height: 140px;
    padding: 1.5rem 1rem;
}

/* Queue Actions */
.queue-footer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

/* ================================================================
   8. LIBRARY TAB (DOWNLOADS READY)
   ================================================================ */
.library-card {
    min-height: auto;
}

.library-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.library-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background: #131317;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    min-height: 64px;
    gap: 0.75rem;
    width: 100%;
    transition: all 0.15s ease;
}

.library-item:hover {
    border-color: var(--border-focus);
    background: #18181f;
}

.library-item-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.library-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: #1e1e24;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: var(--text-pure);
    flex-shrink: 0;
}

.library-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-pure);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.library-badge {
    font-size: 0.72rem;
    color: var(--text-pure);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 1px 7px;
    border-radius: var(--radius-full);
    display: inline-flex;
    margin-top: 2px;
    font-weight: 600;
    width: fit-content;
}

.library-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: 0.4rem;
}

.library-actions .btn {
    height: 36px;
    min-height: 36px;
    padding: 0 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

/* ================================================================
   9. TERMINAL TAB
   ================================================================ */
.terminal-card {
    background: #050505;
    border: 1px solid var(--border-subtle);
    padding: 0;
    overflow: hidden;
}

.terminal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0d0d0f;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.6rem 1rem;
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.terminal-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #333333;
    border: 1px solid #444444;
}
.dot.red { background: #262626; border-color: #404040; }
.dot.yellow { background: #525252; border-color: #737373; }
.dot.green { background: #a3a3a3; border-color: #d4d4d4; }

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.terminal-actions {
    display: flex;
    gap: 0.4rem;
}

.btn-terminal {
    background: #18181b;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    cursor: pointer;
}

.btn-terminal:hover {
    background: #27272a;
    color: var(--text-pure);
}

.terminal-screen {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.6;
    padding: 1rem;
    height: 380px;
    overflow-y: auto;
    color: #e4e4e7;
    background: #000000;
}

.terminal-welcome {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.5rem;
}

.term-dim {
    color: var(--text-muted);
}

.term-line {
    word-break: break-all;
    white-space: pre-wrap;
    padding: 1px 0;
}

.term-line.system { color: #ffffff; }
.term-line.success { color: #e5e5e5; }
.term-line.error { color: #d4d4d4; font-weight: 600; }
.term-line.warn { color: #a3a3a3; }

/* ================================================================
   10. BUTTONS & CONTROLS
   ================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.15rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.15s ease;
    min-height: 44px;
}

.btn:disabled,
.btn[disabled] {
    background: #1f1f24 !important;
    color: #71717a !important;
    border-color: #2e2e38 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 0.7 !important;
}

.btn-primary {
    background: var(--accent-white);
    color: var(--accent-black);
    border-color: var(--accent-white);
}

.btn-primary:hover:not(:disabled) {
    background: #e4e4e7;
    border-color: #e4e4e7;
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: #18181b;
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: #27272a;
    border-color: var(--border-focus);
    color: var(--text-pure);
}

.btn-success {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.btn-success:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

.btn-dark {
    background: transparent;
    border-color: var(--border-subtle);
    color: var(--text-muted);
}

.btn-dark:hover:not(:disabled) {
    background: #121214;
    color: var(--text-primary);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 0.85rem 1.4rem;
    font-size: 0.95rem;
    min-height: 48px;
}

.btn-sm {
    padding: 0.45rem 0.8rem;
    font-size: 0.8rem;
    min-height: 38px;
}

/* ================================================================
   11. MODALS & OVERLAYS
   ================================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-pure);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header .success-text {
    color: var(--text-pure);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-pure);
}

.modal-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.modal-footer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Form controls */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input, .form-select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.9rem;
    color: var(--text-pure);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
}

.form-input:focus, .form-select:focus {
    border-color: var(--border-focus);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--accent-white);
    width: 18px;
    height: 18px;
}

.strategy-options {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.strategy-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #18181c;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.strategy-option:hover {
    border-color: var(--border-focus);
}

.strategy-option input[type="radio"] {
    margin-top: 3px;
    accent-color: var(--accent-white);
}

.option-details {
    display: flex;
    flex-direction: column;
}

.option-details strong {
    font-size: 0.85rem;
    color: var(--text-pure);
}

.option-details span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.summary-results-container {
    max-height: 220px;
    overflow-y: auto;
    background: #09090b;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.naming-preview-tag {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ================================================================
   12. COMPACT SEARCH, NOVEDADES & DEVICE STORAGE STYLES
   ================================================================ */
.compact-card {
    padding: 1.15rem;
    gap: 0.85rem;
}

.compact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compact-header h2 {
    font-size: 1rem;
    font-weight: 700;
}

.compact-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-subtle);
}

.compact-video-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: #18181c;
    border: 1px solid var(--border-subtle);
    padding: 0 0.85rem;
    height: 34px;
    min-height: 34px;
    border-radius: var(--radius-full);
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

.compact-video-toggle:hover {
    border-color: var(--border-focus);
    color: var(--text-pure);
}

.compact-video-toggle input[type="checkbox"] {
    accent-color: var(--accent-white);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* Novedades Section */
.novedades-card {
    gap: 1.15rem;
}

.header-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.add-monitor-box {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
}

.add-monitor-box .input-wrapper {
    flex: 1;
}

.add-monitor-box .btn {
    height: 44px;
    min-height: 44px;
    padding: 0 1.15rem;
    flex-shrink: 0;
}

.monitored-playlists-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    background: #0d0d10;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
}

.section-mini-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.monitored-pills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.monitored-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #16161b;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 0 0.75rem;
    height: 32px;
    min-height: 32px;
    font-size: 0.78rem;
    color: var(--text-pure);
    max-width: 100%;
    transition: all 0.15s ease;
}

.monitored-pill:hover {
    border-color: var(--border-focus);
}

.monitored-pill-text {
    max-width: clamp(140px, 45vw, 320px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.monitored-pill-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    line-height: 1;
    transition: all 0.15s ease;
}

.monitored-pill-remove:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
}

.novedades-results-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.library-subnav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #0c0c0e;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 4px;
    height: 42px;
    min-height: 42px;
}

.library-quick-status {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.73rem;
    color: var(--text-muted);
    padding: 0 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.library-quick-status i {
    color: var(--text-pure);
}

.subtab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0 0.75rem;
    height: 100%;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.subtab-btn:hover {
    color: var(--text-pure);
}

.subtab-btn.active {
    background: #222227;
    color: var(--text-pure);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.library-local-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.local-folder-card {
    background: #131317;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.local-folder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-pure);
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 32px;
}

.local-folder-header .folder-count {
    font-size: 0.72rem;
    color: var(--text-pure);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.local-track-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #18181d;
    padding: 0 0.75rem;
    height: 36px;
    min-height: 36px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.15s ease;
}

.local-track-item:hover {
    color: var(--text-pure);
    background: #202026;
    border-color: rgba(255, 255, 255, 0.08);
}

.local-track-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    padding-right: 0.5rem;
}

/* ================================================================
   13. PERFIL DJ & AJUSTES (PESTAÑA STANDARD)
   ================================================================ */
#tab-profile {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 145px);
    height: 100%;
}

.profile-card.unified-settings-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 150px);
    height: auto;
    max-height: none;
    padding: 1rem 1.1rem;
    gap: 1rem;
    box-sizing: border-box;
    overflow: visible;
}

.profile-settings-body {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    flex: 1;
}

.profile-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    width: 100%;
}

.profile-settings-grid .form-group {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-settings-grid .form-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.profile-settings-grid .form-select {
    height: 40px;
    min-height: 40px;
    padding: 0 0.65rem;
    font-size: 0.8rem;
}

.profile-naming-wrapper {
    flex: 1;
    min-width: 0;
}

.profile-naming-wrapper input {
    height: 42px;
    min-height: 42px;
    font-size: 0.82rem;
}

.profile-save-btn {
    height: 42px;
    min-height: 42px;
    padding: 0 1.1rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    font-weight: 700;
}

.profile-toggles-inline-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    background: #0d0d10;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
}

.compact-toggle {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.76rem;
    color: var(--text-secondary);
    cursor: pointer;
    margin: 0;
    user-select: none;
}

.compact-toggle span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 480px) {
    .profile-toggles-inline-row {
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }
}

.settings-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-pure);
    padding-bottom: 0.35rem;
    margin-top: 0.6rem;
    border-bottom: 1px solid var(--border-subtle);
}

.settings-group-header:first-of-type {
    margin-top: 0;
}

.settings-group-header i {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.header-sub-action {
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 0.2rem 0.5rem;
    font-size: 0.68rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all var(--transition-fast);
}

.header-sub-action:hover {
    color: var(--text-pure);
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.05);
}

.naming-presets-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
}

.naming-preset-pill {
    background: #0a0a0c;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: 9999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.68rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.naming-preset-pill:hover,
.naming-preset-pill.active {
    background: var(--surface-card);
    border-color: var(--border-strong);
    color: var(--text-pure);
}

.naming-chips-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.2rem;
}

.naming-chips-label {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.naming-var-chip {
    background: transparent;
    border: 1px dashed var(--border-subtle);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 0.15rem 0.45rem;
    font-size: 0.68rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.naming-var-chip:hover {
    border-color: var(--border-strong);
    color: var(--text-pure);
    background: rgba(255, 255, 255, 0.05);
}

/* Modal Guía Armónica */
.harmonic-guide-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.harmonic-item-card {
    background: #0a0a0c;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.65rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
}

.harmonic-camelot {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-pure);
}

.harmonic-musical {
    color: var(--text-secondary);
}

.harmonic-notes-badge {
    font-size: 0.62rem;
    color: var(--text-muted);
}

/* ================================================================
   14. MODAL INTERACTIVO DE OPCIONES DE DESCARGA
   ================================================================ */
.download-modal-box {
    max-width: 460px;
}

.download-target-card {
    background: #141418;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.download-target-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: #1e1e24;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: var(--text-pure);
    flex-shrink: 0;
}

.download-target-info {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.download-target-info h4 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-pure);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-quality-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-quality-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #121216;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

.modal-quality-pill:hover {
    background: #18181f;
    border-color: var(--border-focus);
}

.modal-quality-pill.active {
    background: #191922;
    border-color: var(--accent-white);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.08);
}

.modal-quality-pill i {
    font-size: 1.1rem;
    color: var(--text-muted);
    width: 24px;
    text-align: center;
    transition: color 0.15s ease;
}

.modal-quality-pill.active i {
    color: var(--text-pure);
}

.quality-info {
    display: flex;
    flex-direction: column;
}

.quality-info strong {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-pure);
}

.quality-info span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.download-video-box {
    background: #121216;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.85rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

.download-video-box:hover {
    border-color: var(--border-focus);
    background: #16161c;
}

.download-video-box input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--accent-white);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.video-label-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.video-label-info strong {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-pure);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.video-label-info span {
    font-size: 0.72rem;
    color: var(--text-muted);
}


/* ================================================================
   15. CLOUD STORAGE DASHBOARD & MUSIC EXPLORER
   ================================================================ */
.cloud-storage-progress-box {
    margin-top: 0.2rem;
}

.storage-unified-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 0.35rem;
    padding: 0.1rem 0;
}

.storage-unified-row::-webkit-scrollbar {
    display: none;
}

.storage-unified-row .stat-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.storage-unified-row #storageProgressTitle {
    color: var(--text-pure);
    font-weight: 600;
}

.storage-unified-row .stat-percent {
    font-weight: 700;
    color: var(--text-pure);
}

.storage-unified-row .stat-sep {
    color: var(--border-subtle);
    opacity: 0.5;
    flex-shrink: 0;
}

/* Explorer Styles */
.explorer-folder-card {
    background: #121216;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.explorer-folder-card:hover {
    background: #17171e;
    border-color: var(--border-focus);
    transform: translateY(-1px);
}

.explorer-folder-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.explorer-folder-icon {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-pure);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.explorer-folder-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.explorer-folder-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-pure);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.explorer-folder-meta {
    font-size: 0.74rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.explorer-track-card {
    background: #111115;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    transition: all 0.15s ease;
}

.explorer-track-card:hover {
    background: #16161c;
    border-color: var(--border-focus);
}

.explorer-track-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1;
}

.explorer-track-art {
    width: 38px;
    height: 38px;
    background: #1b1b22;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    overflow: hidden;
    flex-shrink: 0;
}

.explorer-track-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.explorer-track-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.explorer-track-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-pure);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.explorer-track-tags {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.explorer-badge-bpm {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-pure);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.68rem;
}

.explorer-folder-right,
.explorer-track-right {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

/* Barra Flotante de Acción: Mover Aquí (Encima de la Barra Inferior, Estilo Samsung Mis Archivos) */
.move-clipboard-bar {
    position: fixed;
    bottom: calc(65px + max(0.35rem, env(safe-area-inset-bottom, 0px)));
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 1.5rem);
    max-width: 680px;
    z-index: 1050;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(14, 14, 14, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.9rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 255, 255, 0.05);
    animation: slideUpMove 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpMove {
    from { opacity: 0; transform: translate(-50%, 15px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.move-clipboard-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-pure);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.move-icon-pulse {
    color: #ffffff;
    animation: pulseMove 1.5s infinite;
}

@keyframes pulseMove {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

.move-clipboard-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

/* Efecto Drag & Drop para ordenar */
.explorer-folder-card.dragging,
.explorer-track-card.dragging {
    opacity: 0.4;
    transform: scale(0.98);
    border-style: dashed;
    border-color: #ffffff;
}

.explorer-folder-card.drag-over,
.explorer-track-card.drag-over {
    border-color: #ffffff;
    background: #1c1c1c;
}

/* Barra Flotante Emergente de Guardar Ajustes (Encima de la Barra Inferior) */
.floating-save-bar {
    position: fixed;
    bottom: calc(65px + max(0.35rem, env(safe-area-inset-bottom, 0px)));
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 1.5rem);
    max-width: 680px;
    z-index: 1050;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(14, 14, 14, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.9rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 255, 255, 0.05);
    animation: slideUpSave 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpSave {
    from { opacity: 0; transform: translate(-50%, 15px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.floating-save-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-pure);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.floating-save-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

/* ================================================================
   15. MENÚ CONTEXTUAL COMPACTO (ESTILO SAMSUNG / APPLE ARCHIVOS)
   ================================================================ */
.compact-popover-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 2000;
}

.compact-popover-menu {
    position: fixed;
    width: 200px;
    background: rgba(18, 18, 18, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 0.35rem;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8), 0 2px 8px rgba(0, 0, 0, 0.5);
    z-index: 2001;
    animation: popoverFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popoverFadeIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.compact-popover-header {
    padding: 0.4rem 0.6rem 0.3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 0.25rem;
}

.popover-title-text {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-popover-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.popover-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.52rem 0.65rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-pure);
    font-size: 0.83rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s ease, color 0.12s ease;
}

.popover-item:hover,
.popover-item:active {
    background: rgba(255, 255, 255, 0.09);
}

.popover-icon {
    font-size: 0.88rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.popover-icon.dl { color: #ffffff; }
.popover-icon.move { color: #ffffff; }
.popover-icon.rename { color: #ffffff; }
.popover-icon.del { color: #ffffff; }
.popover-icon.sort { color: #ffffff; }
.popover-icon.bpm { color: #ffffff; }
.popover-icon.date { color: #ffffff; }

.popover-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 3px 4px;
}

.popover-item-danger {
    color: #ffffff;
}

.popover-item-danger:hover,
.popover-item-danger:active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.context-menu-trigger-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    touch-action: manipulation;
}

.context-menu-trigger-btn:hover,
.context-menu-trigger-btn:active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-pure);
}

.explorer-folder-card,
.explorer-track-card {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

/* ================================================================
   16. MODAL DE SELECCIÓN Y COLA DE DESCARGAS
   ================================================================ */
.scan-selection-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: #15151c;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    user-select: none;
}

.scan-selection-item:hover {
    background: #1c1c26;
    border-color: var(--border-focus);
}

.scan-selection-item.selected {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.08);
}

.scan-item-checkbox {
    accent-color: #ffffff;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.download-queue-card {
    background: #121216;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.download-queue-card.active {
    border-color: #ffffff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.download-queue-card.completed {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.04);
}

.queue-progress-fill {
    transition: width 0.25s ease;
}

.btn-remove-queue-item:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

/* Barra Flotante Emergente de Novedades y Cola (Encima de la Barra Inferior) */
.sync-banner {
    position: fixed;
    bottom: calc(65px + max(0.35rem, env(safe-area-inset-bottom, 0px)));
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 1.5rem);
    max-width: 680px;
    z-index: 1055;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.95rem;
    background: rgba(14, 14, 14, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.8), 0 0 16px rgba(255, 255, 255, 0.05);
    animation: slideUpSyncBanner 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--text-pure);
    box-sizing: border-box;
    transition: bottom 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

body.has-active-progress-panel .sync-banner {
    bottom: calc(65px + 82px + max(0.35rem, env(safe-area-inset-bottom, 0px)));
}

@keyframes slideUpSyncBanner {
    from {
        opacity: 0;
        transform: translate(-50%, 25px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.sync-banner.warning {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(14, 14, 14, 0.96);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.8), 0 0 16px rgba(255, 255, 255, 0.05);
}

.sync-banner.success {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(16, 16, 16, 0.96);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.8), 0 0 16px rgba(255, 255, 255, 0.08);
}

.sync-banner.error {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(20, 20, 20, 0.96);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.8), 0 0 16px rgba(255, 255, 255, 0.08);
}

.sync-banner-spinner {
    font-size: 1.15rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sync-banner.warning .sync-banner-spinner {
    color: #ffffff;
}

.sync-banner.success .sync-banner-spinner {
    color: #ffffff;
}

.sync-banner.error .sync-banner-spinner {
    color: #ffffff;
}

.sync-banner-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}

.sync-banner-info strong {
    font-size: 0.85rem;
    color: var(--text-pure);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sync-banner-info span {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sync-banner-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.sync-banner-actions .btn {
    white-space: nowrap;
    font-size: 0.78rem;
    padding: 0.4rem 0.75rem;
}

/* Card Download Progress Inside Monitored Playlists (Disabled for clean design) */
.card-download-progress-box {
    display: none !important;
}

.card-download-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.73rem;
}

.card-download-progress-meta .dl-status-text {
    color: var(--text-pure);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.card-download-progress-meta .dl-percent {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--text-pure);
}

.card-progress-bar-track {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.card-progress-bar-fill {
    height: 100%;
    background: #ffffff;
    border-radius: 999px;
    transition: width 0.25s ease;
}

.card-sync-scanning {
    color: var(--text-pure);
    font-size: 0.73rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Subfolder Tag in Explorer */
.subfolder-tag {
    font-size: 0.62rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--text-pure);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Match badges for Queue items */
.queue-match-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}

.queue-match-badge.match-yes {
    background: #ffffff;
    color: #000000;
    border: 1px solid #ffffff;
}

.queue-match-badge.match-no {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* ================================================================
   16. CENTRAL AI CHAT TAB & VULTR H100 TRAINING STYLES
   ================================================================ */

/* Central Tab Pill Button (Navbar) */
.tab-pill-ai-center {
    position: relative;
}

.tab-pill-ai-center .item-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(99, 102, 241, 0.22));
    border: 1px solid rgba(168, 85, 247, 0.38);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-pill-ai-center .item-icon-wrap i {
    color: #c084fc !important;
    font-size: 1.05rem !important;
    transition: transform 0.2s ease, color 0.2s ease;
}

.tab-pill-ai-center .ai-live-dot {
    position: absolute;
    top: 3px;
    right: calc(50% - 15px);
    width: 6px;
    height: 6px;
    background: #a855f7;
    border-radius: 50%;
    box-shadow: 0 0 8px #c084fc;
}

.tab-pill-ai-center.active .item-icon-wrap {
    background: linear-gradient(135deg, #a855f7, #6366f1);
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.55);
    border-color: #e9d5ff;
    transform: scale(1.08);
}

.tab-pill-ai-center.active .item-icon-wrap i {
    color: #ffffff !important;
}

.tab-pill-ai-center.active .ai-tab-label {
    color: #f3e8ff !important;
    font-weight: 700;
}

/* Chat Main Layout */
#tab-ai-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 140px);
    height: 100%;
}

.chat-header-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.chat-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.chat-branding {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-ai-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.1rem;
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.35);
}

.chat-title-group {
    display: flex;
    flex-direction: column;
}

.chat-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-pure);
}

.chat-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.chat-model-selector-wrap {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chat-select-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #c084fc;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.chat-model-select {
    background: #121217;
    color: #ffffff;
    border: 1px solid rgba(168, 85, 247, 0.5);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    outline: none;
    cursor: pointer;
    min-width: 260px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.chat-model-select:focus {
    border-color: #c084fc;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.45);
}

.chat-model-select option,
.chat-model-select optgroup {
    background-color: #18181f !important;
    color: #ffffff !important;
    font-size: 0.85rem;
    padding: 0.4rem;
}

/* Active Model Bar & Direct Action */
.chat-active-model-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(99, 102, 241, 0.08));
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: var(--radius-md);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.active-model-meta-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 240px;
}

.active-model-texts {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.active-model-headline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.active-label {
    font-size: 0.74rem;
    color: var(--text-muted);
    font-weight: 600;
}

.active-model-headline strong {
    font-size: 0.9rem;
    color: #ffffff;
    font-weight: 700;
}

.active-model-sub {
    font-size: 0.75rem;
    color: #a1a1aa;
    line-height: 1.3;
}

.btn-quick-gen {
    background: linear-gradient(135deg, #a855f7, #6366f1);
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    border: none;
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-quick-gen:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.6);
}

/* How to Guide Strip */
.chat-how-to-guide {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: #d4d4d8;
    line-height: 1.4;
}

.guide-icon {
    color: #38bdf8;
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* Quick Chips High Contrast & Wrap */
.chat-quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding: 0.2rem 0;
}

.quick-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #181822;
    border: 1px solid rgba(168, 85, 247, 0.45);
    color: #ffffff !important;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.quick-chip i {
    font-size: 0.85rem;
}

.quick-chip:hover {
    background: rgba(168, 85, 247, 0.28);
    border-color: #c084fc;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
}

.quick-chip:active {
    transform: translateY(0);
}

/* Messages Scroll */
.chat-messages-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0 160px 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 0;
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    max-width: 92%;
    animation: fadeIn 0.2s ease;
}

.chat-msg-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-msg-user .msg-bubble {
    background: #27272a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-radius: var(--radius-lg) var(--radius-lg) 2px var(--radius-lg);
}

.chat-msg-bot {
    align-self: flex-start;
}

.chat-msg-bot .msg-bubble {
    background: #141418;
    border: 1px solid rgba(168, 85, 247, 0.25);
    color: var(--text-primary);
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 2px;
}

.msg-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: #1f1f24;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #a855f7;
    margin-top: 2px;
}

.msg-bubble {
    padding: 0.85rem 1rem;
    font-size: 0.86rem;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Music Player Card inside Chat */
.music-player-card {
    margin-top: 0.75rem;
    background: #09090b;
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.music-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.music-title-wrap strong {
    font-size: 0.88rem;
    color: #ffffff;
    display: block;
}

.music-badges {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 3px;
}

.music-badge {
    font-size: 0.68rem;
    padding: 1px 7px;
    border-radius: var(--radius-full);
    font-weight: 700;
}

.badge-bpm { background: rgba(59, 130, 246, 0.18); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-camelot { background: rgba(168, 85, 247, 0.18); color: #d8b4fe; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-key { background: rgba(34, 197, 94, 0.18); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.3); }

.music-player-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #141418;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
}

.music-play-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: #ffffff;
    color: #000000;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.music-play-btn:active {
    transform: scale(0.92);
}

.music-play-btn.pulse-ready {
    background: #c084fc !important;
    color: #09090b !important;
    box-shadow: 0 0 16px rgba(192, 132, 252, 0.8);
    animation: musicPulseReady 1.6s infinite ease-in-out;
}

@keyframes musicPulseReady {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(192, 132, 252, 0.8); }
    50% { transform: scale(1.08); box-shadow: 0 0 20px 6px rgba(192, 132, 252, 0.95); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(192, 132, 252, 0); }
}

.music-play-btn.playing {
    background: #22c55e !important;
    color: #000000 !important;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
}

.music-waveform-mock {
    flex: 1;
    height: 26px;
    display: flex;
    align-items: center;
    gap: 2px;
    cursor: pointer;
}

.wave-bar {
    flex: 1;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1px;
    transition: height 0.1s ease, background 0.1s ease;
}

.wave-bar.played {
    background: #c084fc;
}

.music-time-display {
    font-size: 0.72rem;
    font-weight: 600;
    color: #a1a1aa;
    font-family: monospace;
    white-space: nowrap;
    min-width: 70px;
    text-align: right;
}

.badge-model {
    background: rgba(245, 158, 11, 0.18);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.music-lyrics-accordion {
    margin-top: 0.35rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.75rem;
    font-size: 0.78rem;
}

.music-lyrics-accordion summary {
    cursor: pointer;
    font-weight: 700;
    color: #c084fc;
    outline: none;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    user-select: none;
}

.lyrics-content {
    margin-top: 0.5rem;
    color: #f4f4f5;
    line-height: 1.55;
    font-size: 0.78rem;
    padding: 0.6rem 0.75rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--radius-sm);
    border-left: 2px solid #a855f7;
    font-style: italic;
}

.music-card-actions {
    display: flex;
    gap: 0.5rem;
}

.music-action-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: all 0.15s ease;
}

.music-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Chat Input Bar Fixed */
.chat-input-bar {
    position: fixed;
    bottom: 58px;
    left: 0;
    right: 0;
    background: rgba(8, 8, 11, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(168, 85, 247, 0.3);
    padding: 0.75rem 1rem;
    z-index: 995;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
}

.chat-input-wrapper {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    gap: 0.65rem;
    align-items: center;
}

.chat-input-wrapper input {
    flex: 1;
    background: #14141c;
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: var(--radius-full);
    padding: 0.75rem 1.25rem;
    color: #ffffff;
    font-size: 0.88rem;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

.chat-input-wrapper input:focus {
    border-color: #a855f7;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.35);
}

.chat-send-btn {
    height: 44px;
    padding: 0 1.25rem;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    border: none;
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.45);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.chat-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.65);
}

.chat-send-btn:active {
    transform: translateY(0);
}

/* AI Training Modal Styles */
.ai-training-modal-box {
    max-width: 520px;
    background: #0c0c0f;
    border: 1px solid rgba(168, 85, 247, 0.35);
}

.train-folder-summary {
    background: #141418;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.train-folder-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.train-arch-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-top: 0.4rem;
}

.train-arch-card {
    background: #141418;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.train-arch-card:hover {
    border-color: rgba(168, 85, 247, 0.5);
}

.train-arch-card.active {
    background: #191624;
    border-color: #a855f7;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
}

.arch-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.arch-badge {
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-gold { color: #fde047; }
.badge-silver { color: #e2e8f0; }

.arch-time {
    font-size: 0.68rem;
    color: #4ade80;
    font-weight: 700;
}

.arch-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.vultr-cost-pill {
    background: #09090b;
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.9rem;
    margin-top: 0.85rem;
}

.vultr-pill-left {
    display: flex;
    gap: 0.65rem;
    font-size: 0.78rem;
    color: #f4f4f5;
}

.vultr-cost-est {
    font-size: 0.72rem;
    color: #a1a1aa;
    margin-top: 2px;
}

.train-log-box {
    margin-top: 0.75rem;
    background: #000000;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
}

.train-log-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #c084fc;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.spinner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #a855f7;
    animation: pulse 1s infinite;
}

.train-log-code {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #a1a1aa;
    max-height: 120px;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* ================================================================
   HUB ZERO-TRUST ACCESS GATE — OLED B&W MONOCHROME AESTHETIC
   ================================================================ */
.hub-gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999999;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    box-sizing: border-box;
}

.hub-gate-card {
    background: #0a0a0c;
    border: 1px solid #222226;
    border-radius: 18px;
    max-width: 440px;
    width: 100%;
    padding: 2.2rem 1.8rem;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hub-gate-shield {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #141418;
    border: 1px solid #2a2a30;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #ffffff;
    margin-bottom: 1.25rem;
}

.hub-gate-tag {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #a1a1aa;
    background: #16161a;
    border: 1px solid #27272a;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    margin-bottom: 1rem;
}

.hub-gate-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin-bottom: 0.85rem;
    line-height: 1.25;
}

.hub-gate-desc {
    font-size: 0.88rem;
    color: #a1a1aa;
    line-height: 1.6;
    margin-bottom: 1.75rem;
}

.hub-gate-desc strong {
    color: #ffffff;
}

.hub-gate-actions {
    width: 100%;
    margin-bottom: 1.25rem;
}

.hub-gate-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: #ffffff;
    color: #000000;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.9rem 1.2rem;
    border-radius: 12px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.hub-gate-btn:hover {
    background: #e4e4e7;
    transform: translateY(-1px);
}

.hub-gate-footer {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #71717a;
}
