:root {
    --bg-dark: #080A0F;                 /* Negro Obsidiana profundo */
    --bg-card: rgba(13, 17, 28, 0.7);   /* Panel de cristal con tono ahumado */
    --glass-bg: rgba(15, 22, 36, 0.6);  /* Cristal translúcido con tinte azulado */
    --glass-border: rgba(255, 255, 255, 0.08); /* Borde sub-píxel extrafino */
    
    /* Acentos premium */
    --accent-orange: #FF9900;           /* Naranja puro Bitcoin */
    --accent-orange-glow: rgba(255, 153, 0, 0.15);
    --accent-purple: #7C3AED;           /* Púrpura Royal MSTR */
    --accent-purple-glow: rgba(124, 58, 237, 0.15);
    
    --accent-green: #0ecb81;            /* Verde de crecimiento */
    --accent-red: #f6465d;              /* Rojo de corrección */
    --glow-color: rgba(255, 153, 0, 0.12); /* Color de halo base */
    
    --text-main: #FFFFFF;
    --text-muted: #94A3B8;              /* Slate-400 */
    --text-inactive: #8093AD;           /* Slate-400-ish for WCAG AA contrast compliance */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-y: auto;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background animated glow orbs */
.background-gradients {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(247,147,26,0.15) 0%, rgba(10,14,23,0) 70%);
}

.orb-2 {
    bottom: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(14,203,129,0.1) 0%, rgba(10,14,23,0) 70%);
    animation-delay: -5s;
}

.orb-3 {
    top: 40%;
    left: 60%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(41,98,255,0.1) 0%, rgba(10,14,23,0) 70%);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Base Layout */
.dashboard-container {
    flex-grow: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Header Sections */
/* Header Sections */
.dashboard-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fila 1: Marca y Precio (Alineados a los extremos) */
.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-brand-block {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    text-align: left;
}

.btc-icon {
    width: 48px;
    height: 48px;
    background: rgba(247, 147, 26, 0.08);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(247, 147, 26, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(247, 147, 26, 0.05);
}

.btc-icon:hover {
    background: rgba(247, 147, 26, 0.15);
    border-color: rgba(247, 147, 26, 0.5);
    box-shadow: 0 0 20px rgba(247, 147, 26, 0.25);
}

.btc-logo-img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s ease;
}

.btc-icon:hover .btc-logo-img {
    transform: rotate(15deg) scale(1.12);
    filter: drop-shadow(0 0 8px rgba(247, 147, 26, 0.6));
}

.brand-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    align-items: flex-start;
}

.brand-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
}

.brand-title-row h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 0;
    color: var(--text-main);
}

.brand-subtitle-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-start;
}

.brand-subtitle-row .symbol {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header-price-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    flex-shrink: 0;
    gap: 0.1rem;
    text-align: right;
}

.current-price {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 0;
    letter-spacing: -0.75px;
    background: linear-gradient(to right, #ffffff, #e5e7eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all 0.2s ease;
}

.current-price.flash-up {
    color: var(--accent-green) !important;
    -webkit-text-fill-color: var(--accent-green) !important;
}

.current-price.flash-down {
    color: var(--accent-red) !important;
    -webkit-text-fill-color: var(--accent-red) !important;
}

.price-change {
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    justify-content: flex-end;
}

.positive { color: var(--accent-green); }
.negative { color: var(--accent-red); }

/* Fila 2: Selector de Timeframes en Ancho Completo */
.header-timeframe-row {
    width: 100%;
}

.timeframes-wrapper {
    width: 100%;
}

.timeframes {
    display: flex;
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: space-between;
    gap: 4px;
    scrollbar-width: none; /* Ocultar scrollbar en Firefox */
}

.timeframes::-webkit-scrollbar {
    display: none; /* Ocultar scrollbar en Chrome/Safari */
}

.tf-btn {
    flex-grow: 1;
    text-align: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tf-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tf-btn.active {
    background: var(--glass-border);
    color: var(--text-main);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Fila 3: Ticker Glassmorphic Central de Estadísticas */
.header-stats-row {
    width: 100%;
}

.header-stats-ticker {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 5px;
    gap: 8px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    width: 100%;
    max-width: none;
    justify-content: space-between;
}

.header-stats-ticker .ticker-item {
    flex-grow: 1;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.02);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.header-stats-ticker .ticker-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.04);
}

.header-stats-ticker .ticker-item.prev-close-price {
    color: var(--text-muted);
}

.header-stats-ticker .ticker-item.sec-change {
    color: var(--text-muted);
}

.header-stats-ticker .ticker-item.sec-change.positive .sec-val {
    color: var(--accent-green);
}

.header-stats-ticker .ticker-item.sec-change.negative .sec-val {
    color: var(--accent-red);
}

.header-stats-ticker .ticker-item .sec-label {
    color: var(--text-muted);
}

/* Columna Derecha / Selector de Timeframes Legacy */
.header-right-col {
    display: none;
}

.timeframes-wrapper-legacy {
    display: none;
}

.change-selector {
    margin-bottom: 0.5rem;
}

.glass-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.glass-select:hover, .glass-select:focus {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.2);
}

.glass-select option {
    background-color: var(--bg-dark);
    color: var(--text-main);
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
}

/* Chart Area */
.multi-chart-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.secondary-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .secondary-charts-row {
        grid-template-columns: 1fr;
    }
}

.chart-box {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 250px;
    min-width: 0; /* CRITICAL: allows container to shrink below default canvas size */
}

.main-chart-box {
    min-height: 450px;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.chart-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
}

.main-chart-box .chart-header h2 {
    font-size: 1.3rem;
    color: var(--text-main);
}

.tvchart {
    width: 100%;
    flex-grow: 1;
    min-height: 200px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    min-width: 0; /* CRITICAL: prevents forcing grid element expansion */
}

.main-chart-box .tvchart {
    min-height: 380px;
}

/* Timeframes Buttons */
.timeframes {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.tf-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tf-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.current-price.flash-down {
    color: var(--accent-red) !important;
    -webkit-text-fill-color: var(--accent-red) !important;
}

.price-change {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    gap: 8px;
}

.positive { color: var(--accent-green); }
.negative { color: var(--accent-red); }

.secondary-changes {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.sec-change {
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    gap: 6px;
    align-items: center;
}

.sec-label {
    color: var(--text-muted);
}

.sec-change.positive .sec-val { color: var(--accent-green); }
.sec-change.negative .sec-val { color: var(--accent-red); }

.change-selector {
    margin-bottom: 0.5rem;
}

.glass-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.glass-select:hover, .glass-select:focus {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.2);
}

.glass-select option {
    background-color: var(--bg-dark);
    color: var(--text-main);
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
}

/* Chart Area */
.multi-chart-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.secondary-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .secondary-charts-row {
        grid-template-columns: 1fr;
    }
}

.chart-box {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 250px;
    min-width: 0; /* CRITICAL: allows container to shrink below default canvas size */
}

.main-chart-box {
    min-height: 450px;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.chart-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
}

.main-chart-box .chart-header h2 {
    font-size: 1.3rem;
    color: var(--text-main);
}

.tvchart {
    width: 100%;
    flex-grow: 1;
    min-height: 200px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    min-width: 0; /* CRITICAL: prevents forcing grid element expansion */
}

.main-chart-box .tvchart {
    min-height: 380px;
}

/* Timeframes Buttons */
.timeframes {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.tf-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tf-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tf-btn.active {
    background: var(--glass-border);
    color: var(--text-main);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .price-container {
        align-items: flex-start;
        text-align: left;
    }
    .current-price {
        font-size: 2.5rem;
    }
    .chart-container {
        min-height: 400px;
    }
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .switch-container {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    .sensitivity-slider-box {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }
}
/* Stacked Floating Notifications Overlay Container */
.notification-stack-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100000; /* Extremely high z-index to float above all elements in overlay */
    width: 380px;
    max-width: calc(100% - 60px);
    height: 180px; /* Anchored height to keep position stable */
    pointer-events: none; /* Let click-throughs occur on empty area */
}

/* Individual Stacked Notification Card */
.toast-notification {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    background: rgba(15, 20, 32, 0.95); /* Deep sleek premium dark background */
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 1.15rem 1.3rem;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
    pointer-events: auto; /* Active pointer events for user dismiss */
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom center;
    font-family: 'Outfit', sans-serif;
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 3D Stack Overlapping and Scale Layering */
.toast-notification[data-index="0"] {
    z-index: 100;
    transform: translateY(0) scale(1);
    opacity: 1;
}

.toast-notification[data-index="1"] {
    z-index: 90;
    transform: translateY(-14px) scale(0.96);
    opacity: 0.85;
}

.toast-notification[data-index="2"] {
    z-index: 80;
    transform: translateY(-28px) scale(0.92);
    opacity: 0.65;
}

.toast-notification[data-index="3"] {
    z-index: 70;
    transform: translateY(-42px) scale(0.88);
    opacity: 0;
    pointer-events: none;
}

/* Slide-out dismissal transition */
.toast-notification.fade-out {
    opacity: 0;
    transform: translateY(60px) scale(0.9) rotate(3deg);
    pointer-events: none;
}

.toast-notification:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(18, 24, 38, 0.98);
}

/* Typography */
.toast-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #ffffff;
    margin-right: 24px;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.toast-body {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Close Button (X) */
.toast-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.toast-close-btn:hover {
    background: rgba(239, 68, 68, 0.8);
    color: #ffffff;
    transform: scale(1.05);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 576px) {
    .notification-stack-container {
        bottom: 20px;
        right: 20px;
        width: calc(100% - 40px);
        max-width: none;
    }
}

/* Premium Chart Header Real-time Prices */
.chart-header-price {
    font-size: 0.95rem;
    font-weight: 800;
    margin-left: 12px;
    padding: 3px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    display: inline-block;
    vertical-align: middle;
    letter-spacing: -0.2px;
    font-family: 'Outfit', sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.chart-header-price.text-green {
    color: var(--accent-green) !important;
    background: rgba(14, 203, 129, 0.08) !important;
    border-color: rgba(14, 203, 129, 0.15) !important;
}

.chart-header-price.text-red {
    color: var(--accent-red) !important;
    background: rgba(246, 70, 93, 0.08) !important;
    border-color: rgba(246, 70, 93, 0.15) !important;
}

/* Premium Custom Toggle Switch */
.switch-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    user-select: none;
    flex-wrap: wrap;
}

.switch-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

input:checked + .slider {
    background-color: var(--accent-orange);
    border-color: var(--accent-orange);
    box-shadow: 0 0 12px var(--accent-orange-glow);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 22px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Sensitivity slider premium styles */
.sensitivity-slider-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.25);
    padding: 6px 12px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    margin-left: 12px;
}

.slider-val-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    user-select: none;
}

#sensitivity-value {
    color: var(--accent-orange);
    font-weight: 800;
}

.premium-range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 90px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    transition: background 0.3s ease;
    cursor: pointer;
}

.premium-range-slider:hover {
    background: rgba(255, 255, 255, 0.2);
}

.premium-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-orange);
    box-shadow: 0 0 8px rgba(255, 153, 0, 0.8);
    transition: transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.premium-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

.premium-range-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-orange);
    box-shadow: 0 0 8px rgba(255, 153, 0, 0.8);
    border: none;
    transition: transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.premium-range-slider::-moz-range-thumb:hover {
    transform: scale(1.3);
}

/* Floating Chart Controls Dock */
.chart-controls-dock {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 10;
    display: flex;
    gap: 6px;
    padding: 6px;
    border-radius: 12px;
    background: rgba(22, 28, 45, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0.65;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.chart-controls-dock:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.chart-control-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    user-select: none;
}

.chart-control-btn:hover {
    background: rgba(124, 58, 237, 0.25);
    border-color: rgba(124, 58, 237, 0.5);
    color: #ffffff;
    transform: scale(1.08);
}

.chart-control-btn:active {
    transform: scale(0.92);
}

/* ==========================================================================
   PREMIUM ALERTS SIDEBAR & LAYOUT
   ========================================================================== */

/* Layout Wrapper */
.app-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
    padding-right: 50px; /* Space for fixed right dock */
    transition: padding-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.app-layout.sidebar-open {
    padding-right: 400px; /* 350px sidebar + 50px dock */
}

/* Sidebar open state on notification stack */
.notification-stack-container {
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.sidebar-open .notification-stack-container {
    right: 430px !important; /* 350px sidebar + 50px dock + 30px padding */
}

/* Right vertical toolbar (Dock) */
.sidebar-dock {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    width: 50px;
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-left: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2rem;
    gap: 8px;
    z-index: 999;
}

/* Thin horizontal divider in dock */
.dock-divider {
    width: 24px;
    height: 1px;
    background: rgba(255,255,255,0.07);
    border-radius: 1px;
    flex-shrink: 0;
}

.dock-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    outline: none;
}

.dock-btn:hover, .dock-btn.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--glass-border);
    transform: scale(1.05);
}

.dock-btn:active {
    transform: scale(0.95);
}

.dock-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--accent-red);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 10px;
    box-shadow: 0 0 8px rgba(246, 70, 93, 0.8);
    pointer-events: none;
    line-height: 1;
}

/* Alerts Sidebar Panel */
.alerts-sidebar {
    position: fixed;
    right: -360px; /* Hidden by default */
    top: 0;
    height: 100vh;
    width: 350px;
    z-index: 998;
    border-left: 1px solid var(--glass-border);
    background: rgba(13, 17, 28, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
}

.alerts-sidebar.open {
    right: 50px; /* Positioned next to the dock */
}

/* Sidebar structure */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 600; /* Reducida la negrita Outfit excesiva para mejor equilibrio visual */
    color: #ffffff;
    letter-spacing: -0.2px;
}

.sidebar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

#clear-all-alerts {
    background: rgba(246, 70, 93, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(246, 70, 93, 0.25);
    padding: 4px 10px;
    font-size: 0.72rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

#clear-all-alerts:hover {
    background: rgba(246, 70, 93, 0.25);
    border-color: rgba(246, 70, 93, 0.45);
    transform: translateY(-1px);
}

#clear-all-alerts:active {
    transform: translateY(0);
}

.close-sidebar-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transition: all 0.2s ease;
    outline: none;
}

.close-sidebar-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.25rem;
    padding-bottom: 75px; /* Espacio libre para la máscara de difuminado */
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    scroll-behavior: smooth;
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    gap: 0.75rem;
    opacity: 0.8;
}

.empty-icon {
    font-size: 3.5rem;
    opacity: 0.2;
    animation: pulseIcon 2s infinite ease-in-out;
}

@keyframes pulseIcon {
    0% { transform: scale(1); opacity: 0.2; }
    50% { transform: scale(1.08); opacity: 0.35; }
    100% { transform: scale(1); opacity: 0.2; }
}

.empty-state p {
    font-size: 0.85rem;
    font-weight: 500;
    max-width: 200px;
    line-height: 1.4;
}

/* Alert Item Card in History */
.sidebar-alert-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    padding: 0.9rem 1.1rem;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: slideAlertIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideAlertIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.sidebar-alert-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.alert-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-right: 20px; /* space for delete button */
}

.alert-item-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.1px;
}

.alert-item-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.alert-item-desc {
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.alert-item-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 300;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    outline: none;
}

.alert-item-delete:hover {
    color: var(--accent-red);
    background: rgba(246, 70, 93, 0.15);
}

/* ==========================================================================
   PLAN DE INVERSIÓN DYNAMIC CHECKLIST & SIDEBAR
   ========================================================================== */

/* Add Button in Sidebar Header */
.plan-header-btn {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: #2ecc71;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    margin-right: 8px;
}

.plan-header-btn:hover {
    background: rgba(46, 204, 113, 0.25);
    border-color: #2ecc71;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

.plan-header-btn:active {
    transform: scale(0.95);
}

/* Plan Card Wrapper */
.plan-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.1rem;
    margin-bottom: 1rem;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.plan-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.plan-card-badge {
    align-self: flex-start;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(124, 58, 237, 0.25);
    margin-bottom: 6px;
    display: inline-block;
}

/* Card Header Layout */
.plan-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.plan-card-title {
    font-size: 1.15rem; /* Incrementado para una excelente jerarquía visual */
    font-weight: 600;   /* Reducida la negrita agresiva para mayor elegancia */
    color: #ffffff;
    letter-spacing: -0.2px;
    line-height: 1.4;
    padding-right: 10px;
}

/* Reordering and Action Controls */
.plan-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.plan-action-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    transition: all 0.2s ease;
    outline: none;
}

.plan-action-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.plan-action-btn.reorder-up:hover {
    color: var(--accent-green);
    background: rgba(0, 192, 115, 0.15);
}

.plan-action-btn.reorder-down:hover {
    color: var(--accent-green);
    background: rgba(0, 192, 115, 0.15);
}

.plan-action-btn.delete-card:hover {
    color: var(--accent-red);
    background: rgba(246, 70, 93, 0.15);
}

/* Checklist Items */
.plan-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* Mayor espaciado vertical para evitar congestión visual */
}

.plan-item {
    display: flex;
    align-items: flex-start;
    gap: 12px; /* Mayor espacio horizontal entre checkbox y texto */
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.plan-item-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px; /* Aumentado a 18px para cumplir con pautas de accesibilidad táctil */
    height: 18px;
    border: 1.5px solid rgba(255, 255, 255, 0.25); /* Mayor contraste */
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    outline: none;
}

.plan-item-checkbox:checked {
    animation: checkboxBounce 0.35s cubic-bezier(0.25, 0.8, 0.25, 1.4);
    background: var(--accent-orange); /* Naranja Bitcoin coherente con Opción A */
    border-color: var(--accent-orange);
    box-shadow: 0 0 10px rgba(255, 153, 0, 0.4);
}

.plan-item-checkbox:checked::after {
    content: "✓";
    font-size: 0.78rem;
    color: #080A0F; /* Contraste oscuro accesible sobre fondo naranja */
    font-weight: 900;
}

.plan-item-checkbox:hover {
    border-color: var(--accent-orange);
    background: rgba(255, 153, 0, 0.08);
}

.plan-item-checkbox:focus-visible {
    box-shadow: 0 0 0 2px #080A0F, 0 0 0 4px var(--accent-orange);
}

.plan-item-text {
    font-size: 0.98rem; /* Aumentado sustancialmente para cumplir con accesibilidad visual y evitar fatiga */
    font-weight: 400;   /* Letra limpia y regular de Outfit para máxima legibilidad */
    color: #F1F5F9;     /* Slate-100 para alto contraste accesible sobre fondo oscuro (WCAG AAA) */
    line-height: 1.6;   /* Altura de línea descansada y amplia */
    transition: all 0.2s ease;
    user-select: none;
}

/* Checked Strikethrough style */
.plan-item.completed .plan-item-text {
    text-decoration: line-through;
    text-decoration-color: rgba(255, 153, 0, 0.4) !important; /* Tachado en naranja Bitcoin sutil */
    color: var(--text-muted);
    opacity: 0.55; /* Nitidez y suavidad equilibradas */
}

/* Glassmorphic Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 5, 8, 0.88); /* Aislamiento cinematográfico profundo para mejorar accesibilidad */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.25s ease-out;
}

/* Modal Content Container */
.modal-container {
    width: 95%;
    max-width: 480px;
    background: rgba(13, 17, 28, 0.98); /* Obsidian dark panel satinado */
    border: 1px solid rgba(255, 153, 0, 0.22); /* Sub-píxel en naranja Bitcoin neón */
    border-radius: 20px;
    padding: 2.2rem;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.85), 0 0 30px rgba(255, 153, 0, 0.05);
    transform: translateY(0);
    animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header h3 {
    font-size: 1.35rem;
    font-weight: 600; /* Semi-bold elegante */
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #FF9900 0%, #FFD700 100%); /* Baño de oro metálico premium */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Form Styling inside modal */
.form-group {
    margin-bottom: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600; /* Peso balanceado */
    color: #94A3B8; /* Slate-400 - Contraste accesible óptimo */
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input[type="text"], 
.form-group textarea {
    background: rgba(5, 7, 12, 0.7); /* Profundidad obsidian */
    border: 1px solid rgba(255, 255, 255, 0.15); /* Borde definido para pasar accesibilidad visual */
    border-radius: 10px;
    color: #ffffff;
    font-size: 1rem; /* Mayor a 16px para evitar auto-zoom y fatiga ocular */
    padding: 0.8rem;
    outline: none;
    transition: all 0.25s ease;
    font-family: 'Outfit', sans-serif;
}

.form-group input[type="text"]::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.35); /* Placeholder accesible y visible */
}

.form-group input[type="text"]:focus, 
.form-group textarea:focus {
    border-color: var(--accent-orange); /* Foco en naranja Bitcoin coherente */
    box-shadow: 0 0 12px rgba(255, 153, 0, 0.25);
    background: rgba(5, 7, 12, 0.85);
}

.form-group textarea {
    resize: vertical;
    line-height: 1.55;
}

/* Footer Buttons */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 1.8rem;
}

.modal-btn {
    padding: 0.7rem 1.4rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
}

.modal-btn:active {
    transform: scale(0.96);
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent-orange) 0%, #E27602 100%);
    border: none;
    color: #080A0F; /* Contraste oscuro excepcional (WCAG AAA) sobre fondo brillante */
    font-weight: 800; /* Muy marcado para accesibilidad */
    box-shadow: 0 4px 14px rgba(255, 153, 0, 0.25);
}

.primary-btn:hover {
    background: linear-gradient(135deg, #FFB033 0%, #F58200 100%);
    box-shadow: 0 6px 20px rgba(255, 153, 0, 0.45);
    transform: translateY(-1px);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.15); /* Borde con más contraste */
    color: #CBD5E1; /* Slate-300 de alta legibilidad */
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    transform: translateY(-1px);
}

/* Animation declarations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Notion-style Tag Autocomplete */
.tag-suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(18, 18, 26, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-top: 5px;
    max-height: 190px;
    overflow-y: auto;
    z-index: 2000;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    padding: 6px;
    animation: fadeIn 0.15s ease-out;
}

.tag-suggestions-dropdown::-webkit-scrollbar {
    width: 6px;
}
.tag-suggestions-dropdown::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}
.tag-suggestions-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
.tag-suggestions-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tag-suggestion-header {
    padding: 4px 10px;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 4px;
}

.tag-suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tag-suggestion-item:hover, 
.tag-suggestion-item.active {
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
}

.tag-suggestion-item.active {
    border-left: 2px solid var(--accent-purple);
    padding-left: 10px;
}

.tag-suggestion-badge {
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(124, 58, 237, 0.25);
}

.tag-suggestion-item:hover .tag-suggestion-badge,
.tag-suggestion-item.active .tag-suggestion-badge {
    background: rgba(124, 58, 237, 0.25);
    border-color: rgba(124, 58, 237, 0.40);
    box-shadow: 0 0 8px rgba(124, 58, 237, 0.2);
}

.tag-suggestion-item-new {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 4px;
    font-style: italic;
    color: #00d680;
}
.tag-suggestion-item-new:hover {
    background: rgba(0, 214, 128, 0.12);
    color: #00d680;
}

/* Premium Sleek Scrollbar Styles */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    border: 1px solid transparent;
    background-clip: padding-box;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 153, 0, 0.35);
}

/* Hide sidebar scrollbars completely */
.sidebar-content::-webkit-scrollbar {
    display: none !important;
}

.sidebar-content {
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE/Edge */
}

/* Elegant glassmorphic bottom fade gradient overlay for sidebars */
.alerts-sidebar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(to top, #080A0F 0%, rgba(8, 10, 15, 0) 100%);
    pointer-events: none; /* Permite scroll y clicks a través de la máscara */
    z-index: 100;
}

/* ==========================================================================
   BITPULSE 3.0 - NEW DESIGN SYSTEM CLASS & GLOW STYLING (OPTION A)
   ========================================================================= */

/* Material Icons Global Alignment */
.material-icons-round {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    font-size: 1.2rem;
    line-height: 1;
    user-select: none;
}

/* Product Top Header Styling */
.product-top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    margin-bottom: 0.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.product-top-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 153, 0, 0.04) 0%, rgba(124, 58, 237, 0.04) 100%);
    pointer-events: none;
    z-index: 0;
}

.brand-logo-container {
    display: flex;
    align-items: center;
    gap: 0.95rem;
    z-index: 1;
}

.brand-logo-icon-wrapper {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    position: relative;
    overflow: hidden;
}

.brand-logo-icon-wrapper:hover {
    transform: scale(1.03);
    box-shadow: none;
}

.brand-logo-icon-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.12) 30%,
        rgba(255, 255, 255, 0.16) 50%,
        rgba(255, 255, 255, 0.12) 70%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-20deg);
    pointer-events: none;
    animation: shineSweep 15s ease-in-out infinite;
}

.brand-logo-icon {
    font-size: 1.65rem;
    background: linear-gradient(135deg, var(--accent-orange) 0%, #FFD700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 4px rgba(255, 153, 0, 0.35));
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.brand-logo-text {
    display: flex;
    flex-direction: column;
}

.brand-logo-text h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.8px;
    background: linear-gradient(to right, #FFFFFF 40%, #D1D5DB 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    line-height: 1.1;
}

.brand-logo-text .brand-tagline {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 2px;
}

.product-badge-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 1;
}

.product-version-badge {
    background: rgba(255, 153, 0, 0.06);
    border: 1px solid rgba(255, 153, 0, 0.2);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--accent-orange);
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.05);
}

/* Sidebar Dock and Navigation Styling with Material Icons */
.dock-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.dock-btn .dock-icon .material-icons-round {
    font-size: 1.45rem;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dock-btn:hover .dock-icon .material-icons-round {
    transform: scale(1.15);
    color: var(--accent-orange);
    text-shadow: 0 0 10px rgba(255, 153, 0, 0.4);
}

.dock-btn#toggle-plan-btn:hover .dock-icon .material-icons-round {
    color: var(--accent-purple);
    text-shadow: 0 0 10px rgba(124, 58, 237, 0.4);
}

/* Inline headers */
.header-icon-inline {
    font-size: 1.15rem;
    margin-right: 6px;
    color: var(--accent-orange);
    vertical-align: text-bottom;
    filter: drop-shadow(0 0 4px rgba(255, 153, 0, 0.4));
}

/* Premium checklist and cards glow */
.plan-card {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: rgba(15, 20, 32, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
}

.plan-card:hover {
    border-color: rgba(255, 153, 0, 0.25) !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 15px rgba(255, 153, 0, 0.05) !important;
    transform: translateY(-2px);
}

.plan-card-badge {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.12) 0%, rgba(255, 153, 0, 0.12) 100%) !important;
    color: #FFFFFF !important;
    border: 1px solid rgba(255, 153, 0, 0.22) !important;
    font-size: 0.76rem !important; /* Más legible y accesible */
    font-weight: 600 !important;   /* Menos grueso, más elegante */
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 9px !important;
    border-radius: 6px !important;
}

/* Reorder and Plan Item Action Buttons */
.plan-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.plan-action-btn:hover {
    background: rgba(255, 153, 0, 0.12);
    border-color: rgba(255, 153, 0, 0.3);
    color: #ffffff;
    transform: scale(1.08);
}

.plan-action-btn.reorder-up:hover, .plan-action-btn.reorder-down:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.plan-action-btn.delete-card:hover {
    background: rgba(246, 70, 93, 0.15);
    border-color: rgba(246, 70, 93, 0.4);
    color: var(--accent-red);
}

.plan-action-btn .material-icons-round {
    font-size: 0.95rem;
}

/* Add plan button styling */
.plan-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, var(--accent-orange) 0%, #E27602 100%) !important;
    border: none !important;
    color: #080A0F !important; /* Premium dark contrast (identical to Save button) for extreme readability */
    font-weight: 800 !important;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem !important; /* Expanded to match the Save button text scale perfectly */
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.3) !important;
    transition: all 0.2s ease;
}

.plan-header-btn:hover {
    box-shadow: 0 6px 18px rgba(255, 153, 0, 0.45) !important;
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.plan-header-btn .material-icons-round {
    font-size: 0.95rem;
}

/* Close sidebars and modals alignment */
.close-sidebar-btn, .close-modal-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--text-muted) !important;
    background: transparent !important; /* Desactiva caja de fondo nativa del botón */
    border: none !important;             /* Quita bordes nativos */
    outline: none !important;
    cursor: pointer !important;
    padding: 0 !important;               /* Quita padding nativo */
    box-shadow: none !important;         /* Quita sombras nativas */
    transition: all 0.2s ease !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    -webkit-appearance: none !important; /* Elimina cualquier resto de motor de renderizado de Safari */
    appearance: none !important;
}

.close-sidebar-btn:hover, .close-modal-btn:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08) !important;
    transform: scale(1.1) !important;
}

.close-sidebar-btn .material-icons-round, .close-modal-btn .material-icons-round {
    font-size: 1.25rem;
}

/* Checklist checkbox customization override */
.plan-item {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.plan-item-checkbox {
    /* Mantenemos nuestro checkbox personalizado de 18px estilizado arriba */
}

.plan-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.plan-item.completed {
    opacity: 0.65;
}

.plan-item.completed .plan-item-text {
    text-decoration: line-through;
    text-decoration-color: rgba(124, 58, 237, 0.6) !important;
}

/* Sidebar structure refinement */
.alerts-sidebar {
    background: rgba(8, 10, 15, 0.95) !important;
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.7) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

/* Scrollbars updates */
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 153, 0, 0.3) !important;
}

/* Dynamic Alert Items alignment */
.sidebar-alert-item {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.25s ease;
}

.sidebar-alert-item:hover {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.alert-item-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.alert-item-delete:hover {
    background: rgba(246, 70, 93, 0.15);
    color: var(--accent-red);
}

/* Custom empty states size styling */
.empty-state .empty-icon .material-icons-round {
    font-size: 2.5rem;
    background: linear-gradient(135deg, rgba(255, 153, 0, 0.3) 0%, rgba(124, 58, 237, 0.3) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

/* Slow Spin Rotation Keyframe */
@keyframes rotateSlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Premium Specular Shine Sweep Animation */
@keyframes shineSweep {
    0% {
        left: -150%;
    }
    15% {
        left: 150%;
    }
    100% {
        left: 150%;
    }
}

/* Tactile Elastic Bounce Animation for Checkboxes */
@keyframes checkboxBounce {
    0% { transform: scale(1); }
    30% { transform: scale(0.82); }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Card Level Progress Track & Bar */
.plan-card-progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    margin-top: -0.25rem;
    margin-bottom: 0.85rem;
    overflow: hidden;
    position: relative;
}

.plan-card-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-purple) 0%, var(--accent-orange) 100%);
    border-radius: 2px;
    transition: width 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 0 8px rgba(255, 153, 0, 0.4);
}

/* Premium SVG Logo Styles */
.brand-logo-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.brand-logo-circle {
    transform-box: fill-box;
    transform-origin: center;
    transform: scale(0);
    animation: circleLiquidPop 1.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.brand-logo-b {
    stroke: #ffffff;
    stroke-width: 1px;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    fill: rgba(255, 255, 255, 0);
    animation: drawBAndFill 3.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: 0.4s;
    transform-box: fill-box;
    transform-origin: center;
}

@keyframes circleLiquidPop {
    0% {
        transform: scale(0);
        filter: blur(6px);
    }
    60% {
        transform: scale(1.12);
        filter: blur(2px);
    }
    100% {
        transform: scale(1);
        filter: blur(0);
    }
}

@keyframes drawBAndFill {
    0% {
        stroke-dashoffset: 600;
        fill: rgba(255, 255, 255, 0);
    }
    70% {
        stroke-dashoffset: 0;
        fill: rgba(255, 255, 255, 0);
    }
    100% {
        stroke-dashoffset: 0;
        fill: rgba(255, 255, 255, 1);
        stroke-width: 0px;
    }
}

/* Levitating Animation for Brand Logo */
@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

/* ═══════════════════════════════════════════════
   ASSET SWAP BUTTON & TRANSITIONS
   ═══════════════════════════════════════════════ */
.asset-swap-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--accent-orange);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 0 rgba(255, 153, 0, 0);
    outline: none;
}

.asset-swap-btn .material-icons-round {
    font-size: 1.25rem;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: block;
}

.asset-swap-btn:hover {
    background: rgba(255, 153, 0, 0.08);
    border-color: rgba(255, 153, 0, 0.3);
    box-shadow: 0 0 14px rgba(255, 153, 0, 0.25);
    transform: scale(1.08);
}

.asset-swap-btn:hover .material-icons-round {
    transform: rotate(180deg);
}

.asset-swap-btn:active {
    transform: scale(0.9);
}

/* Morphing transition classes triggered by JS */
.swap-pop-anim {
    animation: swapPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.swap-text-anim {
    animation: swapText 0.4s ease forwards;
}

@keyframes swapPop {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(0.7) rotate(-90deg); filter: brightness(1.8) blur(1px); }
    100% { transform: scale(1) rotate(-360deg); }
}

@keyframes swapText {
    0% { opacity: 1; transform: translateY(0); }
    50% { opacity: 0.3; transform: translateY(3px); filter: blur(0.5px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════
   MARKET STATUS BADGE
   ═══════════════════════════════════════════════ */
.market-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2.5px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    transition: all 0.4s ease;
    animation: badgeFadeIn 0.5s ease forwards;
    margin-top: 8px;
}
.prev-close-price {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    opacity: 0.85;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    align-self: center;
}
@keyframes badgeFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.market-status-badge.market-open {
    background: rgba(14, 203, 129, 0.1);
    border: 1px solid rgba(14, 203, 129, 0.25);
    color: #0ecb81;
}
.market-status-badge.market-open .market-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #0ecb81;
    box-shadow: 0 0 6px #0ecb81;
    animation: dotPulse 2s ease-in-out infinite;
}
.market-status-badge.market-closed {
    background: rgba(246, 70, 93, 0.1);
    border: 1px solid rgba(246, 70, 93, 0.2);
    color: #f6465d;
}
.market-status-badge.market-closed .market-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #f6465d;
    box-shadow: 0 0 4px rgba(246, 70, 93, 0.5);
}
@keyframes dotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* ═══════════════════════════════════════════════
   THEME: MSTR (Purple / Cyan)
   Applied via body.theme-mstr class
   ═══════════════════════════════════════════════ */
body.theme-mstr {
    --accent-orange: #8B5CF6;
    --accent-orange-glow: rgba(139, 92, 246, 0.18);
    --accent-purple: #00F2FE;
    --accent-purple-glow: rgba(0, 242, 254, 0.15);
    --glow-color: rgba(139, 92, 246, 0.12);
}
body.theme-mstr .product-top-header::before {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.06) 0%, rgba(0, 242, 254, 0.04) 100%);
}
body.theme-mstr .brand-logo-icon-wrapper {
    box-shadow: none;
}
body.theme-mstr .brand-logo-icon-wrapper:hover {
    box-shadow: none;
}
body.theme-mstr .brand-logo-circle {
    fill: #8B5CF6;
}
body.theme-mstr .brand-logo-icon {
    background: linear-gradient(135deg, #8B5CF6 0%, #00F2FE 100%);
    -webkit-background-clip: text;
}
body.theme-mstr .product-version-badge {
    background: rgba(139, 92, 246, 0.06);
    border-color: rgba(139, 92, 246, 0.2);
    color: #8B5CF6;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.05);
}
body.theme-mstr .tf-btn.active {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
    color: #c4b5fd;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.15);
}
body.theme-mstr .premium-range-slider::-webkit-slider-thumb {
    background: #8B5CF6;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}
body.theme-mstr .premium-range-slider::-moz-range-thumb {
    background: #8B5CF6;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
    border: none;
}
body.theme-mstr .glow-orb.orb-1 {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
}
body.theme-mstr .glow-orb.orb-2 {
    background: radial-gradient(circle, rgba(0, 242, 254, 0.06) 0%, transparent 70%);
}
body.theme-mstr .switch input:checked + .slider {
    background: rgba(139, 92, 246, 0.5);
    border-color: rgba(139, 92, 246, 0.6);
}

/* Smooth transition for theme morphing */
.brand-logo-circle,
.product-version-badge,
.glow-orb,
.tf-btn,
.product-top-header::before {
    transition: all 0.5s ease;
}

/* Skip Link Styling for Keyboard Accessibility */
.skip-link {
    position: absolute;
    top: -100px;
    left: 20px;
    background: var(--accent-orange);
    color: #000;
    font-weight: 800;
    padding: 10px 20px;
    border-radius: 8px;
    z-index: 100001;
    transition: top 0.2s ease;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    font-size: 0.9rem;
}
.skip-link:focus {
    top: 20px;
    outline: 2px solid #fff;
}
body.theme-mstr .skip-link {
    background: var(--accent-purple);
}

/* Beautiful and compliant focus indicator for accessibility (passing WCAG AA) */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
.tf-btn:focus-visible {
    outline: 2px solid var(--accent-orange) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 4px rgba(255, 153, 0, 0.25) !important;
}

body.theme-mstr button:focus-visible,
body.theme-mstr input:focus-visible,
body.theme-mstr select:focus-visible,
body.theme-mstr textarea:focus-visible,
body.theme-mstr .tf-btn:focus-visible {
    outline-color: var(--accent-purple) !important;
    box-shadow: 0 0 0 4px rgba(0, 242, 254, 0.25) !important;
}

/* ═══════════════════════════════════════════════════════════════
   CORRELATION SIDEBAR PANEL — BTC vs MSTR 5Y
   ═══════════════════════════════════════════════════════════════ */
.correlation-sidebar {
    position: fixed;
    right: -62vw;
    top: 0;
    height: 100vh;
    width: calc(60vw + 2px);
    z-index: 997;
    border-left: 1px solid rgba(255, 153, 0, 0.12);
    background: rgba(8, 10, 15, 0.97);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    display: flex;
    flex-direction: column;
    transition: right 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -16px 0 60px rgba(0, 0, 0, 0.7), -1px 0 0 rgba(255, 153, 0, 0.06);
}

.correlation-sidebar.open {
    right: 50px;
}

.app-layout.corr-open {
    padding-right: calc(60vw + 52px);
}

/* Correlation Panel Title Row */
.corr-title-btc {
    color: #FF9900;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.corr-title-sep {
    color: rgba(255,255,255,0.3);
    font-weight: 400;
    margin: 0 0.15rem;
}
.corr-title-mstr {
    color: #8B5CF6;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.corr-title-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 0.4rem;
    letter-spacing: 0.2px;
}

/* Legend Pills */
.corr-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 0.75rem;
}
.corr-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px currentColor;
}
.corr-legend-dot.btc { background: #FF9900; box-shadow: 0 0 8px rgba(255,153,0,0.7); }
.corr-legend-dot.mstr { background: #8B5CF6; box-shadow: 0 0 8px rgba(139,92,246,0.7); }
.corr-legend-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Stats Bar below header */
.corr-stats-bar {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(255,255,255,0.015);
    flex-shrink: 0;
}
.corr-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 0 1.5rem;
    border-right: 1px solid rgba(255,255,255,0.06);
    flex: 1;
}
.corr-stat:first-child { padding-left: 0; }
.corr-stat:last-child { border-right: none; }
.corr-stat-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}
.corr-stat-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
    transition: color 0.3s ease;
}
.corr-stat-value.positive { color: var(--accent-green); }
.corr-stat-value.negative { color: var(--accent-red); }
.corr-stat-value.neutral  { color: var(--text-muted); }

/* Chart wrapper & container */
.corr-chart-wrapper {
    flex: 1;
    position: relative;
    padding: 1rem 1.5rem 1.5rem;
    overflow: hidden;
}
.corr-chart-container {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
}

/* Loading overlay */
.corr-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: rgba(8,10,15,0.8);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    z-index: 10;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    transition: opacity 0.3s ease;
}
.corr-loading.hidden {
    opacity: 0;
    pointer-events: none;
}
.corr-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,153,0,0.15);
    border-top-color: #FF9900;
    border-radius: 50%;
    animation: corrSpin 0.8s linear infinite;
}
@keyframes corrSpin {
    to { transform: rotate(360deg); }
}

/* Dock correlation button — uses orange glow by default */
.dock-btn-correlation.active {
    color: var(--accent-orange) !important;
    background: rgba(255, 153, 0, 0.08) !important;
    border-color: rgba(255, 153, 0, 0.2) !important;
    box-shadow: 0 0 14px rgba(255, 153, 0, 0.2) !important;
}

/* Notification stack adjustment when corr panel open */
.corr-open .notification-stack-container {
    right: calc(60vw + 82px) !important;
}

/* ═══════════════════════════════════════════════════════════════
   PREDICTION SIDEBAR PANEL — CRYSTAL BALL BTC 5Y
   ═══════════════════════════════════════════════════════════════ */
.prediction-sidebar {
    position: fixed;
    right: -62vw;
    top: 0;
    height: 100vh;
    width: calc(60vw + 2px);
    z-index: 997;
    border-left: 1px solid rgba(0, 242, 254, 0.12);
    background: rgba(8, 10, 15, 0.97);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    display: flex;
    flex-direction: column;
    transition: right 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -16px 0 60px rgba(0, 0, 0, 0.7), -1px 0 0 rgba(0, 242, 254, 0.06);
}

.prediction-sidebar.open {
    right: 50px;
}

.app-layout.pred-open {
    padding-right: calc(60vw + 52px);
}

.pred-title-glow {
    color: #00F2FE;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-shadow: 0 0 10px rgba(0, 242, 254, 0.4);
}

.pred-title-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 0.4rem;
    letter-spacing: 0.2px;
}

.pred-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 0.75rem;
}

.pred-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px currentColor;
}
.pred-legend-dot.btc { background: #FF9900; box-shadow: 0 0 8px rgba(255,153,0,0.7); }
.pred-legend-dot.projection { background: #00F2FE; box-shadow: 0 0 8px rgba(0,242,254,0.7); }
.pred-legend-dot.bands { background: rgba(0, 242, 254, 0.15); border: 1px dashed #00F2FE; box-shadow: 0 0 4px rgba(0,242,254,0.2); }
.pred-legend-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.pred-stats-bar {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(255,255,255,0.015);
    flex-shrink: 0;
}

.pred-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 0 1.5rem;
    border-right: 1px solid rgba(255,255,255,0.06);
    flex: 1;
}
.pred-stat:first-child { padding-left: 0; }
.pred-stat:last-child { border-right: none; }
.pred-stat-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}
.pred-stat-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}

.pred-chart-wrapper {
    position: relative;
    padding: 0.75rem 1.5rem 0.2rem;
    height: 50vh; /* Occupies exactly half of the vertical space by default */
    min-height: 280px;
    max-height: 75vh;
    overflow: hidden;
    flex-shrink: 0;
}

/* Custom Centered Drag-to-Resize Divider */
.pred-resizer {
    width: 100%;
    height: 12px;
    cursor: ns-resize;
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent; /* Completely transparent background by default */
    flex-shrink: 0;
}

/* Subtle dividing line in the middle */
.pred-resizer::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    right: 1.5rem;
    top: 50%;
    height: 1px;
    background: rgba(255, 255, 255, 0.05); /* Faint static separator */
    transform: translateY(-50%);
    pointer-events: none;
}

/* Clean Horizontal Capsule Pill Handle in the center */
.pred-resizer-handle {
    width: 36px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.3); /* Balanced, visible pill background */
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none; /* Let drag event trigger on resizer container */
    box-shadow: none;
    z-index: 2;
}

/* Only the capsule handle glows and lights up in neon cian on hover! No vertical bloated scaling! */
.pred-resizer:hover .pred-resizer-handle {
    background: #00F2FE;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.8), 0 0 20px rgba(0, 242, 254, 0.4);
    width: 44px; /* Elegant horizontal expansion instead of vertical circle bloating! */
}

.pred-scrollable-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.pred-scrollable-content::-webkit-scrollbar {
    width: 6px;
}
.pred-scrollable-content::-webkit-scrollbar-track {
    background: transparent;
}
.pred-scrollable-content::-webkit-scrollbar-thumb {
    background: rgba(0, 242, 254, 0.15);
    border-radius: 10px;
    border: 1px solid transparent;
    background-clip: padding-box;
    transition: background 0.3s ease;
}
.pred-scrollable-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 242, 254, 0.35) !important;
}

.pred-chart-container {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.pred-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: rgba(8,10,15,0.8);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    z-index: 10;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    transition: opacity 0.3s ease;
}
.pred-loading.hidden {
    opacity: 0;
    pointer-events: none;
}
.pred-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(0,242,254,0.15);
    border-top-color: #00F2FE;
    border-radius: 50%;
    animation: predSpin 0.8s linear infinite;
}
@keyframes predSpin {
    to { transform: rotate(360deg); }
}

.dock-btn-prediction.active {
    color: #00F2FE !important;
    background: rgba(0, 242, 254, 0.08) !important;
    border-color: rgba(0, 242, 254, 0.2) !important;
    box-shadow: 0 0 14px rgba(0, 242, 254, 0.2) !important;
}

.pred-open .notification-stack-container {
    right: calc(60vw + 82px) !important;
}

/* Collapsible Methodology Accordion */
.pred-methodology-accordion {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.005);
    flex: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.pred-methodology-accordion[open] {
    background: rgba(255, 255, 255, 0.018);
}
.pred-methodology-summary {
    padding: 0.95rem 1.5rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    list-style: none; /* Hide default arrow */
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}
.pred-methodology-summary::-webkit-details-marker {
    display: none; /* Hide default arrow in Safari/Chrome */
}
.pred-methodology-summary::after {
    content: 'expand_more';
    font-family: 'Material Icons Round';
    margin-left: auto;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.4);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease;
}
.pred-methodology-accordion[open] .pred-methodology-summary::after {
    transform: rotate(180deg);
    color: #00F2FE;
}
.pred-methodology-summary:hover {
    color: #00F2FE;
}
.pred-methodology-summary:hover::after {
    color: #00F2FE;
}
.pred-methodology-accordion[open] .pred-methodology-summary {
    color: #00F2FE;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.pred-methodology-content {
    padding: 1.1rem 1.5rem 1.5rem;
    font-size: 0.8rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.65);
}
.pred-methodology-content p {
    margin: 0 0 0.6rem 0;
}
.pred-methodology-content ul {
    margin: 0;
    padding-left: 1.2rem;
}
.pred-methodology-content li {
    margin-bottom: 0.5rem;
}
.pred-methodology-content li strong {
    color: #fff;
}

/* ─── Premium Correction Risk Meter & Milestones Table ─── */
.pred-risk-meter-container {
    padding: 0.6rem 1.5rem;
    background: rgba(255, 255, 255, 0.01);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}
.pred-risk-meter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pred-risk-meter-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}
.pred-risk-badge {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    text-shadow: 0 0 6px currentColor;
    transition: all 0.3s ease;
}
.pred-risk-badge.low {
    color: #00F2FE;
    background: rgba(0, 242, 254, 0.08);
    border: 1px solid rgba(0, 242, 254, 0.2);
}
.pred-risk-badge.medium {
    color: var(--accent-orange);
    background: rgba(255, 153, 0, 0.08);
    border: 1px solid rgba(255, 153, 0, 0.2);
}
.pred-risk-badge.high {
    color: var(--accent-red);
    background: rgba(246, 70, 93, 0.08);
    border: 1px solid rgba(246, 70, 93, 0.2);
    box-shadow: 0 0 8px rgba(246, 70, 93, 0.15);
}
.pred-risk-bar-outer {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.pred-risk-bar-inner {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00F2FE 0%, var(--accent-orange) 50%, var(--accent-red) 100%);
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 0 8px currentColor;
}
.pred-risk-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.45;
    margin-top: 2px;
}
.pred-risk-desc strong {
    color: #fff;
}

.pred-milestones-container {
    padding: 0.6rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.005);
    flex-shrink: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.pred-milestones-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.pred-milestones-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    text-align: left;
}
.pred-milestones-table th {
    color: var(--text-muted);
    font-weight: 600;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.015);
}
.pred-milestones-table td {
    padding: 9px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.85);
}
.pred-milestones-table tr:hover td {
    background: rgba(255, 255, 255, 0.025);
    color: #fff;
}
.cycle-badge {
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.76rem;
}
.peak-tag {
    color: var(--accent-green);
    font-weight: 700;
}
.bottom-tag {
    color: #f6465d;
    font-weight: 700;
}
.corr-val-tag {
    font-weight: 700;
    background: rgba(246, 70, 93, 0.12);
    color: #f6465d;
    padding: 1px 4px;
    border-radius: 4px;
}

/* ─── Quantitative Regime Dashboard Styles ─── */
.pred-regime-container {
    padding: 0.6rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.005);
    flex-shrink: 0;
}
.pred-regime-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pred-regime-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.regime-card {
    background: rgba(255, 255, 255, 0.018);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.regime-card:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(0, 242, 254, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.regime-card-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.regime-card-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
}
.regime-card-status {
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.9;
}

/* Dynamic statuses */
.regime-card-status.bull {
    color: #00F2FE;
    text-shadow: 0 0 4px rgba(0, 242, 254, 0.2);
}
.regime-card-status.bear {
    color: #f6465d;
    text-shadow: 0 0 4px rgba(246, 70, 93, 0.2);
}
.regime-card-status.neutral {
    color: var(--text-muted);
}

/* Special Capitulation Card */
.regime-card.capitulation-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.03);
}
.regime-card.capitulation-card.active {
    background: rgba(246, 70, 93, 0.08) !important;
    border-color: rgba(246, 70, 93, 0.3) !important;
    box-shadow: 0 0 10px rgba(246, 70, 93, 0.15) !important;
    animation: pulse-capitulation 2s infinite ease-in-out;
}
.regime-card.capitulation-card.active .regime-card-value {
    color: #f6465d !important;
    text-shadow: 0 0 6px rgba(246, 70, 93, 0.5) !important;
}
.regime-card.capitulation-card.active .regime-card-status {
    color: #f6465d !important;
    font-weight: 800 !important;
}

@keyframes pulse-capitulation {
    0% { border-color: rgba(246, 70, 93, 0.3); box-shadow: 0 0 8px rgba(246, 70, 93, 0.1); }
    50% { border-color: rgba(246, 70, 93, 0.6); box-shadow: 0 0 16px rgba(246, 70, 93, 0.25); }
    100% { border-color: rgba(246, 70, 93, 0.3); box-shadow: 0 0 8px rgba(246, 70, 93, 0.1); }
}

/* ═══════════════════════════════════════════════════════════════
   SISTEMA DE DISEÑO RESPONSIVO & BREAKPOINTS PREMIUM
   ═══════════════════════════════════════════════════════════════ */

/* Tablets Grandes y Pantallas Medianas (max-width: 1024px) */
@media (max-width: 1024px) {
    .prediction-sidebar,
    .correlation-sidebar {
        width: calc(100vw - 50px) !important;
        right: -100vw;
    }
    
    .app-layout.pred-open {
        padding-right: 50px !important;
    }
    
    .app-layout.corr-open {
        padding-right: 50px !important;
    }
}

/* Tablets Medianas y Móviles Grandes (max-width: 768px) { */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 1rem !important;
        gap: 1rem !important;
    }
    
    .product-top-header {
        padding: 1rem !important;
    }
    
    .brand-logo-text h1 {
        font-size: 1.2rem !important;
    }
    
    .brand-tagline {
        font-size: 0.65rem !important;
    }
    
    .alerts-sidebar {
        width: calc(100vw - 50px) !important;
        right: -100vw;
    }
    
    .app-layout.sidebar-open {
        padding-right: 50px !important;
    }
    
    .sidebar-open .notification-stack-container {
        right: 80px !important;
    }
    
    .pred-regime-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .pred-stats-bar,
    .corr-stats-bar {
        grid-template-columns: repeat(2, 1fr) !important;
        height: auto !important;
        padding: 12px !important;
        gap: 12px !important;
    }
    
    .pred-stat,
    .corr-stat {
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        padding-bottom: 8px !important;
    }
    
    .pred-stat:nth-child(even),
    .corr-stat:nth-child(even) {
        border-left: 1px solid rgba(255, 255, 255, 0.05) !important;
        padding-left: 12px !important;
    }
    
    .pred-stat:nth-last-child(-n+2),
    .corr-stat:nth-last-child(-n+2) {
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }
}

/* Móviles Pequeños (max-width: 480px) */
@media (max-width: 480px) {
    .app-layout {
        padding-right: 0px !important;
    }
    
    /* El dock vertical lateral pasa a ser una barra de navegación inferior horizontal */
    .sidebar-dock {
        width: 100vw !important;
        height: 60px !important;
        bottom: 0 !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        flex-direction: row !important;
        justify-content: space-around !important;
        padding: 0 !important;
        align-items: center !important;
        border-left: none !important;
        border-top: 1px solid var(--glass-border) !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5) !important;
    }
    
    .sidebar-dock .dock-btn {
        margin: 0 !important;
        width: 44px !important;
        height: 44px !important;
    }
    
    .dock-divider {
        width: 1px !important;
        height: 24px !important;
        margin: 0 !important;
    }
    
    .dashboard-container {
        padding: 1rem 0.5rem 80px 0.5rem !important; /* Margen inferior para que no tape la barra */
    }
    
    .alerts-sidebar,
    .prediction-sidebar,
    .correlation-sidebar {
        width: 100vw !important;
        height: calc(100vh - 60px) !important;
        right: -100vw !important;
    }
    
    .alerts-sidebar.open,
    .prediction-sidebar.open,
    .correlation-sidebar.open {
        right: 0px !important;
    }
    
    .app-layout.sidebar-open,
    .app-layout.pred-open,
    .app-layout.corr-open {
        padding-right: 0px !important;
    }
    
    .pred-regime-grid {
        grid-template-columns: 1fr !important;
    }
    
    .tf-btn {
        padding: 4px 6px !important;
        font-size: 0.72rem !important;
    }
    
    .brand-logo-text {
        display: none !important; /* En móviles muy pequeños, ocultamos tagline/texto secundario para ahorrar espacio */
    }
    
    .product-top-header {
        justify-content: center !important;
        gap: 12px;
    }
}

/* ==========================================================================
   Sidebar Open Layout Wrapping & Stacking Overrides
   ========================================================================== */

/* 1. CHART CONTROLS STACKING: Active whenever ANY sidebar panel is open, regardless of screen width */
.sidebar-open .chart-header,
.pred-open .chart-header,
.corr-open .chart-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
}
.sidebar-open .switch-container,
.pred-open .switch-container,
.corr-open .switch-container {
    width: 100% !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 0.75rem !important;
}
.sidebar-open .sensitivity-slider-box,
.pred-open .sensitivity-slider-box,
.corr-open .sensitivity-slider-box {
    margin-left: 0 !important;
    width: 100% !important;
    justify-content: space-between !important;
}

/* ==========================================================================
   Sidebar Open Layout Wrapping & Stacking Overrides
   ========================================================================== */

/* 2. DASHBOARD HEADER REORGANIZATION: Active when sidebar panels are open */
.sidebar-open .dashboard-header,
.pred-open .dashboard-header,
.corr-open .dashboard-header {
    gap: 0.85rem !important;
    padding: 1rem 1.25rem !important;
}

/* 3. RESPONSIVE DASHBOARD HEADER OVERRIDES: Active on screen widths <= 1024px */
@media (max-width: 1024px) {
    .dashboard-header {
        gap: 0.85rem !important;
        padding: 1rem 1.25rem !important;
    }
}

/* 4. MOBILE LAYOUT STACKING & CENTERING: Active on screen widths <= 768px */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        text-align: left !important;
        padding: 0.85rem 1rem !important;
        gap: 0.75rem !important;
    }

    .header-top-row {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }

    .header-brand-block {
        flex-direction: row !important;
        align-items: center !important;
        text-align: left !important;
        gap: 0.75rem !important;
    }

    .brand-meta {
        align-items: flex-start !important;
    }

    .brand-title-row {
        justify-content: flex-start !important;
    }

    .brand-title-row h1 {
        font-size: 1.3rem !important;
    }

    .btc-icon {
        width: 38px !important;
        height: 38px !important;
    }

    .btc-logo-img {
        width: 20px !important;
        height: 20px !important;
    }

    .brand-subtitle-row {
        justify-content: flex-start !important;
    }

    .header-price-block {
        align-items: flex-end !important;
        text-align: right !important;
    }

    .current-price {
        font-size: 1.6rem !important;
    }

    .price-change {
        justify-content: flex-end !important;
        font-size: 0.85rem !important;
    }

    .header-timeframe-row {
        width: 100% !important;
    }

    .timeframes {
        padding: 4px !important;
        border-radius: 10px !important;
        justify-content: space-between !important;
    }

    .tf-btn {
        flex-grow: 1 !important;
        padding: 6px 6px !important;
        font-size: 0.75rem !important;
        border-radius: 6px !important;
    }

    .header-stats-row {
        width: 100% !important;
    }

    .header-stats-ticker {
        padding: 4px !important;
        border-radius: 10px !important;
        justify-content: space-between !important;
        gap: 4px !important;
    }

    .header-stats-ticker .ticker-item {
        flex-grow: 1 !important;
        justify-content: center !important;
        font-size: 0.75rem !important;
        padding: 6px 8px !important;
        border-radius: 6px !important;
    }

    /* Unconditional vertical chart header controls stacking on tablet/mobile screens */
    .chart-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
    }
    .switch-container {
        width: 100% !important;
        justify-content: space-between !important;
        flex-wrap: wrap !important;
        gap: 0.75rem !important;
    }
    .sensitivity-slider-box {
        margin-left: 0 !important;
        width: 100% !important;
        justify-content: space-between !important;
    }

    /* Extra Narrow Mobile Overrides (width <= 576px) */
    @media (max-width: 576px) {
        .header-top-row {
            flex-direction: column !important;
            align-items: flex-start !important;
            gap: 0.5rem !important;
            width: 100% !important;
        }
        .header-price-block {
            align-items: flex-start !important;
            text-align: left !important;
            margin-top: 4px !important;
        }
        .price-change {
            justify-content: flex-start !important;
        }
        .timeframes {
            justify-content: flex-start !important;
            overflow-x: auto !important;
            flex-wrap: nowrap !important;
            -webkit-overflow-scrolling: touch !important;
        }
        .tf-btn {
            flex-grow: 1 !important;
            flex-shrink: 0 !important;
            min-width: 44px !important;
            text-align: center !important;
            padding: 6px 4px !important;
        }
    }

    /* Small Phone Overrides (width <= 480px) */
    @media (max-width: 480px) {
        .header-stats-ticker {
            flex-wrap: wrap !important;
            justify-content: center !important;
            gap: 6px !important;
        }
        .header-stats-ticker .ticker-item {
            flex-grow: 1 !important;
            flex-shrink: 0 !important;
            min-width: calc(50% - 6px) !important;
            font-size: 0.72rem !important;
        }
        .main-chart-box {
            min-height: 350px !important;
        }
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   5. DEVELOPER HUD HUD / CONSOLE STYLING
   ───────────────────────────────────────────────────────────────────────────── */
.dev-bar {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    background: rgba(10, 14, 23, 0.88);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(124, 58, 237, 0.05);
    z-index: 9999;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.dev-bar.collapsed {
    transform: translateY(40px) scale(0.85);
    opacity: 0;
    pointer-events: none;
}

.dev-bar-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dev-bar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-main);
    text-transform: uppercase;
}

.dev-bar-icon {
    font-size: 1.1rem;
    color: var(--accent-purple);
    filter: drop-shadow(0 0 4px rgba(124, 58, 237, 0.4));
}

.dev-bar-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.dev-bar-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.dev-bar-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dev-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.dev-label {
    color: var(--text-muted);
}

.dev-value-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dev-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    transition: all 0.3s ease;
}

.dev-status-dot.online {
    background-color: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
    animation: dev-pulse-green 2s infinite alternate;
}

.dev-status-dot.offline {
    background-color: var(--accent-red);
    box-shadow: 0 0 8px var(--accent-red);
}

.dev-status-text {
    font-weight: 500;
}

.dev-badge {
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.persistence-local {
    background: rgba(255, 153, 0, 0.1);
    color: var(--accent-orange);
    border: 1px solid rgba(255, 153, 0, 0.2);
}

.persistence-server {
    background: rgba(124, 58, 237, 0.1);
    color: var(--accent-purple);
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.persistence-warning {
    background: rgba(246, 70, 93, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(246, 70, 93, 0.2);
}

/* Custom switch toggle styles */
.dev-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
}

.dev-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.dev-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.08);
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.dev-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-muted);
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
}

.dev-switch input:checked + .dev-slider {
    background-color: rgba(124, 58, 237, 0.15);
    border-color: rgba(124, 58, 237, 0.3);
}

.dev-switch input:checked + .dev-slider:before {
    transform: translateX(20px);
    background-color: var(--accent-purple);
    box-shadow: 0 0 8px var(--accent-purple);
}

.dev-footer-actions {
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dev-ping-text {
    font-size: 0.75rem;
    color: var(--text-inactive);
}

.dev-action-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    font-size: 0.78rem;
    transition: all 0.2s ease;
}

.dev-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-main);
}

.dev-action-btn span.material-icons-round {
    font-size: 0.95rem;
}

/* ─── Collapsed HUD Floating Bubble ─── */
.dev-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(13, 17, 28, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9998;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 10px rgba(124, 58, 237, 0.03);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform: scale(1);
    opacity: 1;
}

.dev-bubble.hidden {
    transform: scale(0.6) rotate(-45deg);
    opacity: 0;
    pointer-events: none;
}

.dev-bubble:hover {
    transform: scale(1.1);
    border-color: var(--accent-purple);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.2);
}

.dev-bubble-icon {
    color: var(--text-muted);
    font-size: 1.3rem;
    transition: color 0.2s ease;
}

.dev-bubble:hover .dev-bubble-icon {
    color: var(--text-main);
    animation: dev-spin 4s linear infinite;
}

@keyframes dev-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Glassmorphic Hover Tooltip for Collapsed HUD Bubble */
.dev-bubble-tooltip {
    position: absolute;
    bottom: 56px;
    right: 0;
    width: 250px;
    background: rgba(10, 14, 23, 0.94);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(124, 58, 237, 0.08);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(0.95);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    text-align: left;
}

.dev-bubble:hover .dev-bubble-tooltip {
    opacity: 1;
    pointer-events: none; /* Let clicks pass through so clicking the bubble works directly */
    transform: translateY(0) scale(1);
}

.dev-tooltip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dev-tooltip-icon {
    font-size: 1rem;
    color: var(--accent-purple);
    filter: drop-shadow(0 0 4px rgba(124, 58, 237, 0.4));
}

.dev-tooltip-title {
    font-size: 0.8rem;
}

.dev-tooltip-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 8px 0;
}

.dev-tooltip-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dev-tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
}

.dev-tooltip-label {
    color: var(--text-muted);
}

.dev-tooltip-value {
    font-weight: 500;
    transition: color 0.3s ease;
}

.dev-tooltip-value.online {
    color: var(--accent-green);
    text-shadow: 0 0 4px rgba(0, 226, 136, 0.2);
}

.dev-tooltip-value.offline {
    color: var(--accent-red);
    text-shadow: 0 0 4px rgba(246, 70, 93, 0.2);
}

.dev-tooltip-value.local {
    color: var(--accent-orange);
    text-shadow: 0 0 4px rgba(255, 153, 0, 0.2);
}

.dev-tooltip-value.server {
    color: var(--accent-purple);
    text-shadow: 0 0 4px rgba(124, 58, 237, 0.2);
}

.dev-tooltip-value.warning {
    color: var(--accent-red);
    text-shadow: 0 0 4px rgba(246, 70, 93, 0.2);
}

.dev-tooltip-footer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.7rem;
    color: var(--text-inactive);
    text-align: center;
    font-style: italic;
    letter-spacing: 0.2px;
}

.dev-bubble-status {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--bg-dark);
    transition: background-color 0.3s ease;
}

.dev-bubble-status.online {
    background-color: var(--accent-green);
    box-shadow: 0 0 6px var(--accent-green);
}

.dev-bubble-status.offline {
    background-color: var(--accent-red);
    box-shadow: 0 0 6px var(--accent-red);
}

@keyframes dev-pulse-green {
    0% { opacity: 0.6; box-shadow: 0 0 4px var(--accent-green); }
    100% { opacity: 1; box-shadow: 0 0 12px var(--accent-green); }
}

/* Ensure HUD fits beautifully on mobile screens */
@media (max-width: 480px) {
    .dev-bar {
        bottom: 10px;
        right: 10px;
        width: calc(100% - 20px);
    }
    .dev-bubble {
        bottom: 10px;
        right: 10px;
    }
}

/* ==========================================================================
   BITPULSE OVERLAYS, LOGOS AND CUSTOM LEGAL MODALS
   ========================================================================== */

/* EKG Pulse Brand Logo Styles */
.brand-logo-circle {
    fill: url(#pulse-gradient);
    transition: fill 0.4s ease;
}

.brand-logo-pulse-path {
    opacity: 1;
}

.brand-logo-pulse-dot {
    opacity: 0;
    transform: scale(0);
    transform-origin: 100.478px 52px;
    animation: pulseDotOnce 2.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.brand-logo-pulse-clip-rect {
    transform-origin: left;
    transform: scaleX(0);
    animation: drawPulseClipOnce 2.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes drawPulseClipOnce {
    0% {
        transform: scaleX(0);
    }
    100% {
        transform: scaleX(1);
    }
}

@keyframes pulseDotOnce {
    0%, 70% {
        opacity: 0;
        transform: scale(0);
    }
    80% {
        opacity: 1;
        transform: scale(1.4);
    }
    88% {
        opacity: 1;
        transform: scale(0.9);
    }
    94% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Dynamic theme variables for the pulse logo */
:root {
    --pulse-gradient-start: #FF9900;
    --pulse-gradient-end: #FF5E00;
    --pulse-shadow: rgba(255, 153, 0, 0.4);
}

.theme-mstr {
    --pulse-gradient-start: #7C3AED;
    --pulse-gradient-end: #C084FC;
    --pulse-shadow: rgba(124, 58, 237, 0.4);
}

.pulse-stop-start {
    stop-color: var(--pulse-gradient-start);
    transition: stop-color 0.4s ease;
}

.pulse-stop-end {
    stop-color: var(--pulse-gradient-end);
    transition: stop-color 0.4s ease;
}

/* Footer Section */
.dashboard-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.footer-link:hover {
    color: var(--text-main);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-inactive);
    letter-spacing: 0.2px;
}

/* Tabbed Glassmorphic Legal Modal */
.legal-modal-container {
    width: 90%;
    max-width: 950px;
    height: 80vh;
    max-height: 750px;
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 40px rgba(124, 58, 237, 0.05);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalScaleIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.legal-modal-body-split {
    display: grid;
    grid-template-columns: 240px 1fr;
    flex-grow: 1;
    overflow: hidden;
    height: calc(100% - 64px);
}

@media (max-width: 768px) {
    .legal-modal-body-split {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    .legal-modal-container {
        height: 90vh;
        max-height: none;
    }
}

.legal-modal-sidebar {
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .legal-modal-sidebar {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        flex-direction: row;
        overflow-x: auto;
        padding: 0.8rem;
        gap: 0.5rem;
    }
}

.legal-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 10px 16px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.legal-tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.legal-tab-btn.active {
    color: #ffffff;
    background: rgba(124, 58, 237, 0.15);
    border-color: rgba(124, 58, 237, 0.35);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
    text-shadow: 0 0 8px rgba(124, 58, 237, 0.4);
}

.legal-tab-btn .material-icons-round {
    font-size: 1.15rem;
}

.legal-modal-content-area {
    padding: 2rem;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.08);
}

.legal-content-tab {
    display: none;
    animation: fadeInTab 0.3s ease;
}

.legal-content-tab.active {
    display: block;
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes modalScaleIn {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.legal-content-tab h4 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
    color: #ffffff;
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
    letter-spacing: -0.2px;
}

.legal-content-tab h5 {
    font-size: 1rem;
    font-weight: 600;
    color: #a855f7;
    margin-top: 1.5rem;
    margin-bottom: 0.6rem;
}

.legal-content-tab p {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.legal-content-tab ul {
    margin-left: 1.25rem;
    margin-bottom: 1rem;
}

.legal-content-tab li {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.legal-accent-block {
    background: rgba(246, 70, 93, 0.06);
    border-left: 3px solid var(--accent-red);
    padding: 1rem;
    border-radius: 0 12px 12px 0;
    margin-bottom: 1rem;
}

.legal-accent-block p {
    margin-bottom: 0;
    color: #fca5a5;
    font-weight: 500;
}

