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

/* ============================================================================
   FIX BUG-012: Z-Index Hierarchy (Consistent Stacking Context)
   ============================================================================

   Problem: Inconsistent z-index values throughout codebase caused layering issues
   - tooltip-container: 99999 (TOO HIGH!)
   - premium-modal: 20000
   - news-slider: 10000
   - error-overlay: 9999
   - modal: 5000
   - etc...

   Solution: Establish clear z-index hierarchy using CSS custom properties

   Hierarchy (from bottom to top):
   0-99:     Base layer (normal content)
   100-199:  Sticky elements (headers, footers)
   200-499:  Fixed elements (floating buttons)
   500-999:  Dropdowns and popovers
   1000-1999: Modal backdrops
   2000-2999: Modals and dialogs
   3000-3999: Popovers over modals
   4000-4999: Tooltips
   5000-5999: Notifications and toasts
   9000-9999: Critical overlays (errors, alerts)

   Usage:
   .my-modal { z-index: var(--z-modal); }
   .my-tooltip { z-index: var(--z-tooltip); }
   ============================================================================ */

:root {
    /* Theme Colors - Dark (Default) */
    --bg-primary: #1c1916;
    --bg-secondary: #2a2a2a;
    --bg-header: var(--bg-primary);
    --bg-control: rgba(255, 255, 255, 0.08);
    --bg-control-hover: rgba(255, 255, 255, 0.12);
    --bg-control-active: rgba(255, 255, 255, 0.15);
    --bg-texture: none;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --border-color: #333333;
    --border-control: rgba(255, 255, 255, 0.15);
    --footer-bg: rgba(255, 255, 255, 0.04);
    --footer-border: rgba(255, 255, 255, 0.08);
    --footer-text: rgba(255, 255, 255, 0.72);
    --footer-link: rgba(255, 255, 255, 0.9);
    --footer-sep: rgba(255, 255, 255, 0.35);
    --accent-color: #fbbf24;
    --header-height: 80px;
    --news-slider-width: 420px;
    --news-slider-gap: 10px;
    --session-slider-width: min(1100px, 96vw);

    /* Base layer */
    --z-base: 0;
    --z-below: -1;

    /* Sticky elements */
    --z-sticky: 100;
    --z-sticky-high: 150;

    /* Fixed elements */
    --z-fixed: 200;
    --z-fixed-high: 250;

    /* Dropdowns and popovers */
    --z-dropdown: 500;
    --z-popover: 600;

    /* Modal system */
    --z-modal-backdrop: 1000;
    --z-modal: 2000;
    --z-modal-high: 2100;
    /* For nested modals */

    /* Popovers over modals */
    --z-modal-popover: 3000;

    /* Tooltips */
    --z-tooltip: 4000;

    /* Notifications */
    --z-notification: 5000;
    --z-toast: 5100;

    /* Critical overlays */
    --z-critical: 9000;
    --z-emergency: 9500;
}

[data-theme="light"] {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-header: var(--bg-primary);
    --bg-control: rgba(0, 0, 0, 0.05);
    --bg-control-hover: rgba(0, 0, 0, 0.08);
    --bg-control-active: rgba(0, 0, 0, 0.12);
    --bg-texture: none;
    --text-primary: #000000;
    --text-secondary: rgba(0, 0, 0, 0.85);
    --border-color: #e0e0e0;
    --border-control: rgba(0, 0, 0, 0.1);
    --footer-bg: rgba(0, 0, 0, 0.03);
    --footer-border: rgba(0, 0, 0, 0.08);
    --footer-text: rgba(0, 0, 0, 0.7);
    --footer-link: rgba(0, 0, 0, 0.85);
    --footer-sep: rgba(0, 0, 0, 0.35);
}

@keyframes pulsate-bullish {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(var(--color-positive-rgb), 0.7);
        background-color: rgba(var(--color-positive-rgb), 0.2);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(var(--color-positive-rgb), 0);
        background-color: rgba(var(--color-positive-rgb), 0.4);
    }
}

@keyframes pulsate-bearish {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(var(--color-negative-rgb), 0.7);
        background-color: rgba(var(--color-negative-rgb), 0.2);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(var(--color-negative-rgb), 0);
        background-color: rgba(var(--color-negative-rgb), 0.4);
    }
}

.news-btn.pulsate-bullish {
    animation: pulsate-bullish 1.5s ease-in-out infinite;
}

.news-btn.pulsate-bearish {
    animation: pulsate-bearish 1.5s ease-in-out infinite;
}

.progress-bar {
    position: fixed !important;
    top: calc(var(--header-height, 80px) - 4px) !important;
    left: 0 !important;
    width: 0%;
    height: 4px !important;
    max-height: 4px !important;
    min-height: 4px !important;
    line-height: 1 !important;
    font-size: 0 !important;
    background-color: transparent;
    z-index: 9999 !important;
    transition: width 0.5s linear;
    visibility: hidden;
    pointer-events: none;
    transform: translateZ(0) !important;
    bottom: auto !important;
    right: auto !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    box-shadow: none !important;
    background-image: none !important;
    will-change: width !important;
}

.progress-bar.loading {
    visibility: visible !important;
    display: block !important;
    opacity: 1 !important;
    background: var(--color-positive-muted) !important;
    box-shadow: 0 0 10px rgba(var(--color-positive-rgb), 0.5), 0 0 4px rgba(var(--color-positive-rgb), 0.8) !important;
    z-index: var(--z-fixed-high) !important;
}

.progress-bar.loading.green-bar {
    background: var(--color-positive-muted) !important;
    box-shadow: 0 0 10px rgba(var(--color-positive-rgb), 0.5), 0 0 4px rgba(var(--color-positive-rgb), 0.8) !important;
}

.progress-bar.loading.red-bar {
    background: var(--color-negative) !important;
    box-shadow: 0 0 10px rgba(var(--color-negative-rgb), 0.5), 0 0 4px rgba(var(--color-negative-rgb), 0.8) !important;
}

.progress-bar.complete {
    width: 100% !important;
    opacity: 1 !important;
}

/* Data Freshness Indicator */
.data-freshness-indicator {
    position: fixed;
    top: 78px;
    right: 20px;
    z-index: var(--z-sticky-high);
    /* FIX: Data freshness indicator uses sticky hierarchy */
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    font-size: 12px;
    color: #9ca3af;
    transition: all 0.3s ease;
}

.data-freshness-indicator.fresh {
    color: var(--color-positive-muted);
    border: 1px solid rgba(var(--color-positive-rgb), 0.3);
}

.data-freshness-indicator.stale {
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.data-freshness-indicator.error {
    color: var(--color-negative);
    border: 1px solid rgba(var(--color-negative-rgb), 0.3);
}

.data-freshness-indicator svg {
    flex-shrink: 0;
}

.data-freshness-indicator.fresh svg {
    stroke: var(--color-positive-muted);
}

.data-freshness-indicator.stale svg {
    stroke: #fbbf24;
    animation: pulse-warning 2s ease-in-out infinite;
}

.data-freshness-indicator.error svg {
    stroke: var(--color-negative);
    animation: pulse-error 1s ease-in-out infinite;
}

@keyframes pulse-warning {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes pulse-error {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* ACCESSIBILITY: Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ACCESSIBILITY: Keyboard navigation highlight */
.keyboard-selected {
    background: rgba(102, 126, 234, 0.3) !important;
    outline: 2px solid #667eea !important;
    outline-offset: -2px;
}

.currency-search-item {
    transition: background 0.2s ease;
}

.currency-search-item[role="option"] {
    cursor: pointer;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    background-image: var(--bg-texture);
    color: var(--text-primary);
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
    transition: background 0.35s ease;
}


.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    padding-top: max(15px, env(safe-area-inset-top));
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    background: var(--bg-header);
    backdrop-filter: blur(10px);
    border-bottom: none;
    z-index: var(--z-modal-backdrop);
    overflow: visible;
}

.header>.brand-timeframe {
    flex-shrink: 0;
}

.header>.search-container {
    flex: 1;
    margin-left: auto;
}

.header>.controls {
    flex-shrink: 0;
    margin-left: 0;
}

.header>.free-trial-badge {
    flex-shrink: 0;
    margin-left: 0;
}

.header-upgrade-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(135deg, #2563eb 0%, #a855f7 100%);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
    white-space: nowrap;
}

.header-upgrade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(168, 85, 247, 0.3);
}

.header-upgrade-btn:active {
    transform: translateY(0);
}

.brand-timeframe {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Logo-only control: bigger, clearly visible */
.brand {
    display: flex;
    align-items: center;
    height: 40px;
    padding: 0 8px;
    border: none;
    background: transparent;
    text-decoration: none;
}

.brand-crop,
.brand-banner {
    display: none;
}

.brand-text {
    color: var(--text-primary);
    font-weight: 900;
    font-size: 34px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}

.brand:hover .brand-text {
    color: var(--text-primary);
    opacity: 0.8;
}

.brand:focus-visible {
    text-decoration: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.18);
    outline: 2px solid rgba(0, 0, 0, 0.35);
}

.brand:hover,
.brand:active,
.brand:focus,
.brand:focus-visible {
    text-decoration: none !important;
    box-shadow: none;
    outline: none;
}

[data-theme="light"] .brand,
[data-theme="light"] .brand:hover,
[data-theme="light"] .brand:active,
[data-theme="light"] .brand:focus-visible {
    color: #000000;
    text-decoration: none;
}

[data-theme="light"] .brand-text {
    color: #000000;
}

[data-theme="dark"] .brand,
[data-theme="dark"] .brand:hover,
[data-theme="dark"] .brand:active,
[data-theme="dark"] .brand:focus-visible {
    color: var(--text-primary);
    text-decoration: none;
}

.brand-timeframe .timeframe-buttons {
    margin-left: 4px;
}

@media (max-width: 900px) {
    .brand {
        height: 40px;
    }

    .brand-text {
        font-size: 28px;
        letter-spacing: 0.06em;
    }
}

.timeframe-buttons {
    display: flex;
    gap: 10px;
}

.timeframe-btn {
    padding: 10px 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.08em;
    transition: color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.3s ease,
        filter 0.2s ease;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}


.timeframe-btn:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(76, 175, 80, 0.18) inset;
    filter: brightness(1.05);
}


.timeframe-btn.active {
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    border-color: #4CAF50;
    color: #ffffff;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(255, 255, 255, 0.2) inset, inset 0 -3px 0 #43A047, 0 0 20px rgba(76, 175, 80, 0.6);
}


.timeframe-btn:active {
    filter: brightness(0.98);
}

.timeframe-btn.loading {
    pointer-events: none;
}

.timeframe-btn.loading::before {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: inherit;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 70%);
    opacity: 0.35;
    animation: tfBtnPulse 1.2s ease-in-out infinite;
    pointer-events: none;
}

.controls {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    overflow: visible;
}

/* FIX: Consolidated header button styles - DRY principle */
.control-btn,
.logo-btn {
    width: 48px;
    height: 48px;
    background: var(--bg-control);
    border: 1px solid var(--border-control);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.control-btn svg,
.logo-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
    stroke: currentColor;
    fill: none;
    color: inherit;
    display: block;
}

.control-btn:hover,
.logo-btn:hover {
    background: var(--bg-control-hover);
    border-color: var(--border-control);
}

.control-btn:active,
.logo-btn:active {
    background: var(--bg-control-active);
    transform: scale(0.98);
}

/* FIX: Enhanced mobile touch feedback */
@media (hover: none) {

    .control-btn:active,
    .logo-btn:active {
        background: var(--bg-control-active);
        transform: scale(0.95);
        transition: transform 0.1s;
    }
}

/* FIX: Keyboard focus visibility for accessibility (WCAG 2.1 AA) */
.control-btn:focus-visible,
.logo-btn:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.2);
}

/* FIX: Loading state for async operations */
.control-btn.loading,
.logo-btn.loading {
    pointer-events: none;
    opacity: 0.6;
    cursor: not-allowed;
}

.control-btn.loading::after,
.logo-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: btnSpinLoader 0.6s linear infinite;
}

@keyframes btnSpinLoader {
    to {
        transform: rotate(360deg);
    }
}

/* FIX: Disabled state */
.control-btn:disabled,
.logo-btn:disabled,
.control-btn[disabled],
.logo-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.alert-count-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ef4444;
    color: #fff;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-header);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.buy-credits-header-btn {
    width: auto;
    padding: 0 15px;
    border-radius: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.buy-credits-header-btn:hover {
    background: linear-gradient(135deg, #7b8ff0 0%, #8a5bb8 100%);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
}

#bubbleCanvas {
    display: block;
    position: relative;
    width: 100%;
    height: 100vh;
    cursor: default;
    background-color: var(--bg-primary) !important;
    background-image: var(--bg-texture) !important;
    z-index: 1;
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

[data-theme="light"] #bubbleCanvas {
    background-color: var(--bg-primary) !important;
    background-image: var(--bg-texture) !important;
}

#bubbleCanvas:active {
    cursor: default;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 3px solid;
}

.bubble:hover {
    transform: scale(1.1);
    z-index: 100;
}

.bubble.positive {
    background: radial-gradient(circle at 30% 30%, rgba(var(--color-positive-rgb), 0.9), rgba(var(--color-positive-rgb), 0.95));
    border-color: rgba(var(--color-positive-rgb), 1);
    box-shadow: 0 0 30px rgba(var(--color-positive-rgb), 0.6), inset 0 0 20px rgba(255, 255, 255, 0.1);
    position: relative;
}

/* Accessibility: Add pattern overlay for colorblind users */
.bubble.positive::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(45deg,
            transparent,
            transparent 10px,
            rgba(255, 255, 255, 0.08) 10px,
            rgba(255, 255, 255, 0.08) 12px);
    border-radius: inherit;
    pointer-events: none;
}

/* Accessibility: Add upward arrow indicator */
.bubble.positive::after {
    content: '?';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.bubble.negative {
    background: radial-gradient(circle at 30% 30%, rgba(var(--color-negative-rgb), 0.9), rgba(var(--color-negative-rgb), 0.95));
    border-color: rgba(var(--color-negative-rgb), 1);
    box-shadow: 0 0 30px rgba(var(--color-negative-rgb), 0.6), inset 0 0 20px rgba(255, 255, 255, 0.1);
    position: relative;
}

/* Accessibility: Add dot pattern overlay for colorblind users */
.bubble.negative::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 8px 8px;
    border-radius: inherit;
    pointer-events: none;
}

/* Accessibility: Add downward arrow indicator */
.bubble.negative::after {
    content: '?';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.bubble.neutral {
    background: radial-gradient(circle at 30% 30%, rgba(158, 158, 158, 0.9), rgba(97, 97, 97, 0.95));
    border-color: rgba(158, 158, 158, 1);
    box-shadow: 0 0 30px rgba(158, 158, 158, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.bubble-symbol {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 5px;
}

.bubble-change {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.info-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid #444;
    border-radius: 12px;
    padding: 20px;
    min-width: 300px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: var(--z-popover);
    /* FIX: Use CSS custom property */
}

.info-panel.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.info-symbol {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #fff;
}

.info-price {
    font-size: 18px;
    margin-bottom: 8px;
    color: #aaa;
}

.info-change {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.info-change.positive {
    color: var(--color-positive);
}

.info-change.negative {
    color: var(--color-negative);
}

.info-volume {
    font-size: 14px;
    color: #888;
}

.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    z-index: var(--z-critical);
    /* FIX: Use CSS custom property instead of hardcoded 9999 */
    display: none;
    align-items: center;
    gap: 15px;
}

.loading.visible {
    display: flex;
}

.loading::before {
    content: "";
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Session Timer Slider - Positioned at bottom edge of header with slight overlap */
.session-slider {
    position: fixed;
    top: calc(var(--header-height, 80px) - 10px);
    left: 40%;
    /* Keep centered horizontally only; no vertical offset for slide animation */
    transform: translateX(calc(-50% + var(--session-dock-shift, 0px)));
    background: rgba(26, 26, 26, 0.96);
    border: 2px solid #444;
    border-radius: 12px;
    padding: 14px 6px 14px 18px;
    z-index: var(--z-modal) !important;
    /* FIX: Session slider is a modal; allow nested modals (AI/Compare) above it */
    /* Only fade opacity; no transform-based slide */
    transition: opacity 0.25s ease, transform 0.35s ease;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    min-width: 320px;
    /* FIX: Reduced from 760px to support all mobile screens */
    width: min(1000px, 90vw);
    /* FIX: Increased from 92vw for better edge spacing */
    max-width: calc(100vw - 400px);
    /* FIX: Prevent overlap with comparison panel */
    max-height: calc(100vh - var(--header-height, 80px) - 20px);
    overflow-y: auto;
    overflow-x: hidden;
    /* FIX: Prevent horizontal scroll */
    scrollbar-gutter: auto;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .session-slider {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.7) inset;
    color: #0f172a;
}

.session-slider.visible {
    /* Same base transform; vertical motion handled by keyframes */
    transform: translateX(calc(-50% + var(--session-dock-shift, 0px)));
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.session-slider.animating {
    /* Subtle entrance animation: small upward motion + fade */
    animation: sessionSliderFadeIn 0.25s ease-out;
    will-change: transform, opacity;
}

/* Minimal, non-bouncy session slider animation */
@keyframes sessionSliderFadeIn {
    from {
        opacity: 0;
        transform: translateX(calc(-50% + var(--session-dock-shift, 0px))) translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateX(calc(-50% + var(--session-dock-shift, 0px))) translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .session-slider.animating {
        animation: none;
    }
}

.session-slider-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
    scrollbar-gutter: stable;
}

@supports not (scrollbar-gutter: stable) {
    .session-slider-content {
        overflow-y: scroll !important;
    }
}

.session-slider .session-title {
    font-weight: 700;
    color: #ddd;
}

[data-theme="light"] .session-slider .session-title {
    color: #0f172a;
}

/* Disable panel-child entrance animation specifically inside the session slider */
.session-slider .panel-child-entrance {
    opacity: 1;
    transform: translateY(0);
    animation: none !important;
}

.session-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-right: 44px;
}

.session-header .session-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.countdown-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.countdown-label {
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

[data-theme="light"] .countdown-label {
    color: #64748b;
}

.info-cards-container {
    display: flex;
    gap: 12px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.session-selected {
    padding: 12px 16px;
    background: rgba(26, 26, 26, 0.9);
    border: 1px solid #333;
    border-radius: 10px;
    flex: 0 0 auto;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

[data-theme="light"] .session-selected {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.16);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.session-selected .sel-symbol,
.session-selected-info .sel-symbol {
    font-weight: 800;
    font-size: 20px;
    color: #fff;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

[data-theme="light"] .session-selected .sel-symbol,
[data-theme="light"] .session-selected-info .sel-symbol {
    color: #0f172a;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

.session-selected .sel-price,
.session-selected-info .sel-price {
    color: #cfcfcf;
    margin-bottom: 4px;
    font-size: 12px;
}

[data-theme="light"] .session-selected .sel-price,
[data-theme="light"] .session-selected-info .sel-price {
    color: #1f2937;
    font-weight: 600;
}

.session-selected .sel-change,
.session-selected-info .sel-change {
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 16px;
}

.session-selected .sel-change.positive,
.session-selected-info .sel-change.positive {
    color: var(--color-positive);
}

.session-selected .sel-change.positive::before {
    content: '\25B2 ';
    font-size: 14px;
}

.session-selected .sel-change.negative,
.session-selected-info .sel-change.negative {
    color: var(--color-negative);
}

.session-selected .sel-change.negative::before {
    content: '\25BC ';
    font-size: 14px;
}

.session-selected .sel-volume,
.session-selected-info .sel-volume {
    color: #9a9a9a;
    font-size: 11px;
}

[data-theme="light"] .session-selected .sel-volume,
[data-theme="light"] .session-selected-info .sel-volume {
    color: #64748b;
}

[data-theme="light"] .session-selected .sel-change.positive,
[data-theme="light"] .session-selected-info .sel-change.positive {
    color: #15803d;
}

[data-theme="light"] .session-selected .sel-change.negative,
[data-theme="light"] .session-selected-info .sel-change.negative {
    color: #b91c1c;
}

.session-timeline-card {
    flex: 1 1 500px;
    padding: 8px 10px;
    background: rgba(26, 26, 26, 0.9);
    border: 1px solid #333;
    border-radius: 10px;
    min-width: 450px;
}

[data-theme="light"] .session-timeline-card {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.session-timeline-compact {
    flex: 1 1 auto;
    margin: 0;
    padding: 0;
    position: relative;
    overflow: hidden;
    min-height: clamp(300px, 42vh, 560px);
    width: 100%;
    box-sizing: border-box;
}

.session-timeline-compact canvas {
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: clamp(300px, 42vh, 560px);
    display: block;
    border-radius: 0;
    box-sizing: border-box;
}

.session-slider .session-countdown {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: 18px;
    color: var(--color-positive);
    padding: 4px 8px;
    background: #101010;
    border-radius: 6px;
    border: 1px solid #333;
    min-width: 110px;
    text-align: center;
}

[data-theme="light"] .session-slider .session-countdown {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.12);
    color: var(--color-positive);
}

.session-close {
    position: absolute;
    top: 22px;
    right: 32px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: radial-gradient(120px 80px at 50% -30%, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0)), rgba(18, 18, 18, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #bdbdbd;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: transform 120ms ease, color 120ms ease, border-color 120ms ease, background 160ms ease;
    z-index: var(--z-modal-high);
    /* Session close button */
}

.session-close svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    opacity: 0.9;
}

.session-close:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px) scale(1.03);
}

[data-theme="light"] .session-close {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.16);
    color: #334155;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .session-close:hover {
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.22);
}

.session-close:active {
    transform: scale(0.97);
}

.session-close:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.35);
}

.session-chart {
    margin: 8px 0 16px;
    width: 100%;
    min-height: clamp(280px, 40vh, 540px);
    height: clamp(300px, 45vh, 560px);
    position: relative;
    clear: both;
    display: flex;
    flex-direction: column;
}

.session-chart #sessionChart {
    width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
    display: block;
    border-radius: 6px;
    background: #0f0f0f !important;
    overflow: visible;
}

[data-theme="light"] .session-chart #sessionChart {
    background: #fffdf7 !important;
    border: 1px solid rgba(217, 119, 6, 0.15);
    box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.05),
        0 10px 24px rgba(217, 119, 6, 0.08);
}

.session-chart #sessionChart table,
.session-chart #sessionChart tr,
.session-chart #sessionChart td {
    background: #0f0f0f !important;
}

[data-theme="light"] .session-chart #sessionChart table,
[data-theme="light"] .session-chart #sessionChart tr,
[data-theme="light"] .session-chart #sessionChart td {
    background: #fffdf7 !important;
}

.session-chart #sessionChart div,
.session-chart #sessionChart>div,
.session-chart #sessionChart td>div {
    background: #0f0f0f !important;
}

[data-theme="light"] .session-chart #sessionChart div,
[data-theme="light"] .session-chart #sessionChart>div,
[data-theme="light"] .session-chart #sessionChart td>div {
    background: #fffdf7 !important;
}

.session-chart canvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 6px;
}


/* Timeline */
.session-timeline {
    margin-top: 8px;
}

.session-timeline canvas {
    width: 100%;
    height: 200px;
    display: block;
    border-radius: 6px;
}

.timeline-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 4px;
}

.timeline-legend {
    color: #9a9a9a;
    font-size: 9px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-box {
    display: inline-block;
    width: 10px;
    height: 6px;
    background: var(--color-positive);
    border: 1px solid var(--color-positive-muted);
    border-radius: 2px;
}

/* Session progress bars */
.session-progress {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.session-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.session-row .label {
    width: 110px;
    font-weight: 800;
    color: #f2f2f2;
    letter-spacing: 0.02em;
}

.progress-track {
    flex: 1;
    height: 18px;
    background: rgba(20, 20, 20, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 999px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, rgba(46, 204, 113, 0.9), rgba(46, 204, 113, 0.35));
    border-radius: 999px;
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.45);
    transition: width 0.4s ease;
}

.progress-fill.closed {
    background: linear-gradient(90deg, rgba(160, 160, 160, 0.55), rgba(160, 160, 160, 0.15));
    box-shadow: none;
}

.session-row .timeleft {
    min-width: 120px;
    text-align: right;
    font-weight: 600;
    color: #d0d0d0;
    font-variant-numeric: tabular-nums;
}

.session-row .timeleft {
    min-width: 120px;
    text-align: right;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    color: #bbb;
}

.overlap-banner {
    margin-top: 6px;
    color: #4CAF50;
    font-weight: 700;
}

/* Weekend/holiday market closed banner */
.market-banner {
    margin: 6px 0;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #ffcc80;
    font-weight: 800;
    text-align: center;
}

.market-banner-overlay {
    position: absolute;
    top: 8px;
    left: 24px;
    right: auto;
    max-width: 260px;
    height: 26px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.55), transparent);
    border-radius: 999px;
    border: 1px solid rgba(245, 158, 11, 0.5);
    z-index: 2;
    font-size: 12px;
    padding: 4px 10px;
}

.market-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.75);
    line-height: 1;
    white-space: nowrap;
}

.market-status-pill::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.market-status-pill.open {
    color: var(--color-positive);
    background: rgba(var(--color-positive-rgb), 0.16);
    border-color: rgba(var(--color-positive-rgb), 0.4);
}

.market-status-pill.stale {
    color: #f97316;
    background: rgba(249, 115, 22, 0.16);
    border-color: rgba(249, 115, 22, 0.4);
}

.market-status-pill.closed {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.4);
}

[data-theme="light"] .market-status-pill {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.75);
}

[data-theme="light"] .market-status-pill.open {
    color: #166534;
    background: rgba(22, 101, 52, 0.12);
    border-color: rgba(22, 101, 52, 0.3);
}

[data-theme="light"] .market-status-pill.stale {
    color: #9a3412;
    background: rgba(154, 52, 18, 0.12);
    border-color: rgba(154, 52, 18, 0.3);
}

[data-theme="light"] .market-status-pill.closed {
    color: #92400e;
    background: rgba(146, 64, 14, 0.12);
    border-color: rgba(146, 64, 14, 0.3);
}

.brand-timeframe .market-status-pill {
    margin-left: 4px;
}

.controls .market-status-pill {
    margin-right: 6px;
}

@media (max-width: 900px) {
    .market-status-pill {
        padding: 4px 8px;
        font-size: 9px;
        letter-spacing: 0.08em;
    }
}

@media (max-width: 600px) {
    .market-status-pill {
        display: none !important;
    }
}

.market-closed-pill {
    margin-top: 8px;
    align-self: center;
    padding: 4px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000000;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: flex-start;
    justify-content: center;
    flex: 0 0 auto;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.25);
    max-width: 100%;
    min-width: 0;
    text-align: center;
    white-space: normal;
    line-height: 1.2;
}

/* Session chips (Sydney, Tokyo, London, New York ...) */
/* Session chips (Sydney, Tokyo, London, New York) - FIX: Responsive design */
.session-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
    margin-bottom: 4px;
    min-height: 36px;
    justify-content: center;
}

.session-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #121212;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 10px 14px;
    /* FIX: Reduced from 12px 16px for smaller screens */
    min-height: 44px;
    flex-shrink: 1;
    /* FIX: Allow chips to shrink on small screens */
    min-width: 0;
    /* FIX: Allow flex items to shrink below content size */
}

.session-chip.session-holiday {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fcd34d;
}

[data-theme="light"] .session-chip.session-holiday {
    background: rgba(146, 64, 14, 0.12);
    border-color: rgba(146, 64, 14, 0.3);
    color: #7c2d12;
}

.session-chip .name {
    font-weight: 900;
    color: #dcdcdc;
    font-size: 14px;
    /* FIX: Added explicit size for responsive scaling */
    white-space: nowrap;
    /* FIX: Prevent city names from wrapping */
}

.session-chip .tz {
    color: #888;
    font-size: 11px;
    white-space: nowrap;
    /* FIX: Keep timezone compact */
}

.session-chip .localat {
    color: var(--color-positive-muted);
    font-size: 12px;
    /* FIX: Reduced from 13px */
    font-weight: 600;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    padding: 2px 5px;
    /* FIX: Reduced from 2px 6px */
    background: #0f0f0f;
    border: 1px solid #333;
    border-radius: 6px;
    white-space: nowrap;
}

.session-chip .open-label {
    color: #888;
    font-size: 10px;
    /* FIX: Reduced from 11px */
    white-space: nowrap;
}

.session-chip .time {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    color: #f59e0b;
    font-weight: 600;
    padding: 2px 5px;
    /* FIX: Reduced from 2px 6px */
    background: #0f0f0f;
    border: 1px solid #333;
    border-radius: 6px;
    min-width: 70px;
    /* FIX: Reduced from 78px */
    text-align: center;
    font-size: 12px;
    /* FIX: Added explicit size */
    white-space: nowrap;
}

[data-theme="light"] .session-chip {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
    color: #0f172a;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .session-chip .name {
    color: #0f172a;
}

[data-theme="light"] .session-chip .tz {
    color: #64748b;
}

[data-theme="light"] .session-chip .open-label {
    color: #475569;
}

[data-theme="light"] .session-chip .time {
    background: #f1f5f9;
    border-color: rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

[data-theme="light"] .session-chip .localat {
    background: rgba(5, 150, 105, 0.1);
    border-color: rgba(5, 150, 105, 0.25);
    color: #047857;
}

[data-theme="light"] .session-chip.session-open {
    border-color: rgba(5, 150, 105, 0.3);
    background: rgba(5, 150, 105, 0.06);
}

.session-chip.session-open {
    border-color: var(--color-positive);
    background: rgba(var(--color-positive-rgb), 0.05);
}

.session-chip.session-open .name {
    color: var(--color-positive);
}

.session-chip.session-open .time {
    color: var(--color-positive);
    border-color: var(--color-positive);
    background: rgba(var(--color-positive-rgb), 0.1);
}

/* FIX: Session info container - responsive replacement for inline styles */
.session-info-container {
    display: flex;
    gap: 12px;
    margin-bottom: 6px;
    border-radius: 8px;
    padding: 0;
    align-items: stretch;
    min-height: 140px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .session-info-container {
        gap: 10px;
        min-height: 130px;
    }
}

@media (max-width: 600px) {
    .session-info-container {
        flex-direction: column;
        gap: 8px;
        min-height: auto;
    }
}

@media (max-width: 480px) {
    .session-info-container {
        gap: 6px;
    }
}

.session-selected-info {
    margin: 0;
    padding: 12px;
    min-width: 160px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: rgba(20, 20, 20, 0.9);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .session-selected-info {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

@media (max-width: 600px) {
    .session-selected-info {
        min-width: 0;
        width: 100%;
    }
}

.session-timeline-container {
    flex: 1;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(20, 20, 20, 0.9);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0;
    overflow: hidden;
    box-sizing: border-box;
}

[data-theme="light"] .session-timeline-container {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

@media (max-width: 600px) {
    .session-timeline-container {
        min-height: 200px;
    }
}

.chart-controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 8px 0;
    flex-wrap: wrap;
    width: 100%;
    row-gap: 8px;
    padding: 0 6px;
    overflow: visible;
}

.chart-timeframe-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.chart-action-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
    overflow: visible;
}

.chart-tf-btn {
    width: 46px;
    height: 46px;
    padding: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02) 55%, rgba(0, 0, 0, 0.22));
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    color: #d4d7db;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.35s ease,
        filter 0.2s ease;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.chart-tf-btn::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, 0.2));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}


.chart-tf-btn:hover {
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06) 55%, rgba(0, 0, 0, 0.25));
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(76, 175, 80, 0.18) inset;
    filter: brightness(1.04);
}

.chart-tf-btn:hover::before {
    opacity: 1;
}


.chart-tf-btn.active {
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    color: #ffffff;
    border-color: #4CAF50;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 0 20px rgba(76, 175, 80, 0.6);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
    animation: none;
}

.chart-tf-btn.active::before {
    opacity: 0.55;
}


.chart-tf-btn:active {
    filter: brightness(0.98);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28), inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

/* FIX: Loading state for timeframe buttons - renamed from .loading to avoid global conflict */
.chart-tf-btn.tf-loading {
    pointer-events: none;
    color: #f0fff6;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 0 14px rgba(76, 175, 80, 0.35);
}

.chart-tf-btn.tf-loading::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 10px;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 72%);
    opacity: 0.45;
    animation: none;
    pointer-events: none;
}

@keyframes tfBtnPulse {

    0%,
    100% {
        opacity: 0.25;
    }

    50% {
        opacity: 0.7;
    }
}

/* FIX: Error state for timeframe buttons */
.chart-tf-btn.error {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.9), rgba(255, 138, 128, 0.7));
    border-color: rgba(244, 67, 54, 0.75);
    color: #fff;
    animation: tfBtnErrorPulse 0.55s ease-out;
}

@keyframes tfBtnErrorPulse {
    0% {
        box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
        filter: brightness(1);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(244, 67, 54, 0.35), 0 0 18px rgba(244, 67, 54, 0.4);
        filter: brightness(1.08);
    }

    100% {
        box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
        filter: brightness(1);
    }
}

/* FIX: Better keyboard focus visibility */
.chart-tf-btn:focus-visible {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

.chart-tf-btn.keyboard-focus {
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.5);
}

/* FIX: Success pulse animation (optional) */
.chart-tf-btn.success {
    animation: tfBtnGlow 0.45s ease-out;
}

@keyframes tfBtnGlow {
    0% {
        box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    50% {
        box-shadow: 0 0 22px rgba(76, 175, 80, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    }

    100% {
        box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }
}

@keyframes tfActiveGlow {

    0%,
    100% {
        box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    }

    50% {
        box-shadow: 0 0 28px rgba(76, 175, 80, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
    }
}

.news-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(33, 150, 243, 0.08);
    border: 1px solid rgba(33, 150, 243, 0.6);
    border-radius: 8px;
    color: #64b5f6;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.18s ease, border-color 0.18s ease,
        color 0.18s ease, box-shadow 0.18s ease,
        transform 0.18s ease;
    position: relative;
    flex: 0 0 auto;
}

.news-btn:hover {
    background: rgba(33, 150, 243, 0.22);
    border-color: rgba(129, 212, 250, 0.9);
    color: #e3f2fd;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.45);
}

.news-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(13, 71, 161, 0.35);
}

.news-btn:focus-visible {
    outline: 2px solid rgba(129, 212, 250, 0.9);
    outline-offset: 2px;
}

.news-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    background: #ef4444;
    border: 2px solid #1a1a1a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.news-badge.visible {
    opacity: 1;
    transform: scale(1);
}

.ai-analysis-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #f6fbff;
    margin-left: 0;
    position: relative;
    overflow: hidden;
    background: transparent;
    box-shadow: none;
    transition: max-width 0.35s ease, padding 0.35s ease, margin 0.35s ease,
        transform 0.3s ease, box-shadow 0.3s ease, color 0.3s ease, opacity 0.2s ease;
    z-index: 0;
    flex: 0 0 0;
    min-width: 0;
    width: 0;
    max-width: 0;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
}

.ai-analysis-btn.is-visible {
    opacity: 1;
    pointer-events: auto;
    flex: 0 0 auto;
    width: auto;
    max-width: 220px;
    padding: 10px 26px;
    box-shadow: 0 8px 30px rgba(60, 235, 255, 0.15);
}

.ai-analysis-btn::before,
.ai-analysis-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.ai-analysis-btn::before {
    background: linear-gradient(120deg, #33e6ff, #7d7bff 40%, #ff5dc1 80%);
    opacity: 0.95;
    z-index: -2;
    filter: drop-shadow(0 0 20px rgba(122, 255, 255, 0.45));
}

.ai-analysis-btn::after {
    inset: 2px;
    background: radial-gradient(circle at 30% 30%, rgba(77, 249, 255, 0.2), rgba(7, 13, 32, 0.95) 60%);
    z-index: -1;
    border-radius: calc(16px - 2px);
}

.ai-analysis-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(103, 213, 255, 0.35);
}

.ai-analysis-btn:hover::before {
    opacity: 1;
    filter: drop-shadow(0 0 30px rgba(130, 222, 255, 0.55));
}

.ai-analysis-btn:hover::after {
    transform: scale(0.99);
}

.ai-analysis-btn:active {
    transform: translateY(0);
    box-shadow: 0 6px 18px rgba(66, 204, 255, 0.35);
}

.ai-analysis-btn svg {
    flex-shrink: 0;
    filter: drop-shadow(0 0 6px rgba(120, 219, 255, 0.8));
}

.ai-analysis-btn .pro-chip {
    margin-left: 6px;
    padding: 2px 8px;
    font-size: 10px;
    letter-spacing: 0.15em;
    border-radius: 999px;
    color: #1a1204;
    background: linear-gradient(120deg, #ffe38f, #ffb347 45%, #ffce73 90%);
    text-transform: uppercase;
    box-shadow: 0 0 12px rgba(255, 211, 98, 0.65);
    animation: pulse-glow 2.5s ease-in-out infinite;
}

.ai-analysis-btn .credit-cost-badge {
    margin-left: 4px;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}

@keyframes pulse-glow {

    0%,
    100% {
        filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.8));
        transform: scale(1);
    }

    50% {
        filter: drop-shadow(0 0 12px rgba(251, 191, 36, 1));
        transform: scale(1.05);
    }
}

.news-slider {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: var(--news-slider-width);
    max-width: 100vw;
    height: 100vh;
    background: linear-gradient(145deg, #1a1a1a 0%, #0f0f0f 100%);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.8);
    z-index: var(--z-modal) !important;
    /* Keep drawers below nested modals (AI/Compare) */
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), width 0.35s ease;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    overflow-y: auto;
    pointer-events: none;
    display: block;
}

.news-slider.visible {
    transform: translateX(0);
    pointer-events: auto;
}

@media (min-width: 1100px) {
    body.news-open .session-slider.animating {
        animation: sessionSliderFadeInDocked 0.25s ease-out;
    }
}

@keyframes sessionSliderFadeInDocked {
    from {
        opacity: 0;
        transform: translateX(calc(-50% + var(--session-dock-shift, 0px))) translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateX(calc(-50% + var(--session-dock-shift, 0px))) translateY(0);
    }
}

.news-slider-header {
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, #1a1a1a 0%, rgba(26, 26, 26, 0.95) 100%);
    backdrop-filter: blur(20px);
    padding: 24px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.news-title {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.85) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.news-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: scale(1.05);
}

.news-close:active {
    transform: scale(0.95);
}

.news-close svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.news-content {
    padding: 24px 28px;
    position: relative;
    min-height: 400px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.news-content::-webkit-scrollbar {
    width: 8px;
}

.news-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.news-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.news-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

.news-loading {
    text-align: center;
    padding: 80px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
}

.news-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.news-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(33, 150, 243, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.news-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.news-item:hover::before {
    opacity: 1;
}

.news-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 12px;
}

.news-source {
    font-size: 11px;
    font-weight: 700;
    color: #42a5f5;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 10px;
    background: rgba(33, 150, 243, 0.12);
    border-radius: 6px;
    border: 1px solid rgba(33, 150, 243, 0.2);
}

.news-sentiment {
    font-size: 10px;
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    line-height: 1;
}

.news-sentiment.bullish {
    background: rgba(var(--color-positive-rgb), 0.15);
    color: var(--color-positive);
    border-color: rgba(var(--color-positive-rgb), 0.3);
}

/* Accessibility: Add upward arrow for bullish sentiment */
.news-sentiment.bullish::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 6px solid var(--color-positive);
    margin-right: 0;
    transform: translateY(-1px);
}

.news-sentiment.bearish {
    background: rgba(var(--color-negative-rgb), 0.15);
    color: var(--color-negative);
    border-color: rgba(var(--color-negative-rgb), 0.3);
}

/* Accessibility: Add downward arrow for bearish sentiment */
.news-sentiment.bearish::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid #ef5350;
    margin-right: 0;
    transform: translateY(1px);
}

.news-sentiment.neutral {
    background: rgba(158, 158, 158, 0.12);
    color: rgba(255, 255, 255, 0.6);
    border-color: rgba(158, 158, 158, 0.2);
}

.news-item-title {
    font-size: 19px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.5;
    margin-bottom: 14px;
    letter-spacing: -0.2px;
}

.news-item-summary {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    margin-bottom: 18px;
}

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

.news-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}

.news-read-more {
    font-size: 13px;
    font-weight: 600;
    color: #42a5f5;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(33, 150, 243, 0.1);
    border: 1px solid rgba(33, 150, 243, 0.2);
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-read-more:hover {
    background: rgba(33, 150, 243, 0.15);
    border-color: rgba(33, 150, 243, 0.4);
    color: #64b5f6;
    gap: 8px;
    transform: translateX(2px);
}

.news-read-more:active {
    transform: translateX(2px) scale(0.98);
}

.news-empty {
    text-align: center;
    padding: 80px 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 16px;
}

/* High impact events layout */
.news-impact-intro {
    margin-bottom: 18px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
}

.news-impact-section {
    margin-bottom: 20px;
}

.news-impact-section-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.6);
}

.news-impact-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-impact-item {
    padding: 14px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.news-impact-item.is-complete {
    border-color: rgba(var(--color-positive-rgb), 0.3);
    background: linear-gradient(135deg, rgba(var(--color-positive-rgb), 0.12) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.news-impact-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.news-impact-currency {
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.18);
    border: 1px solid rgba(251, 191, 36, 0.35);
    color: #fbbf24;
}

.news-impact-status {
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(96, 165, 250, 0.18);
    border: 1px solid rgba(96, 165, 250, 0.35);
    color: #93c5fd;
}

.news-impact-status.is-complete {
    background: rgba(var(--color-positive-rgb), 0.16);
    border-color: rgba(var(--color-positive-rgb), 0.35);
    color: #6ee7b7;
}

.news-impact-status.is-upcoming {
    background: rgba(148, 163, 184, 0.16);
    border-color: rgba(148, 163, 184, 0.35);
    color: rgba(255, 255, 255, 0.7);
}

.news-impact-time {
    margin-left: auto;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
}

.news-impact-title {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.4;
    margin-bottom: 6px;
}

.news-impact-details {
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.65);
}

.news-impact-empty {
    padding: 16px;
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.news-item-locked {
    filter: blur(4px);
    opacity: 0.4;
    pointer-events: none;
    user-select: none;
}

.news-login-overlay {
    position: sticky;
    top: 0;
    margin: 20px 0;
    z-index: 10;
}

.news-login-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    backdrop-filter: blur(10px);
}

.news-login-card svg {
    color: #64b5f6;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 12px rgba(100, 181, 246, 0.4));
}

.news-login-card h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.news-login-card p {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
    line-height: 1.6;
}

.news-login-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.news-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.news-login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

/* FIX: Removed duplicate .logo-btn base styles - now consolidated above with .control-btn */

/* Logo-btn specific styles (differences from control-btn) */
.logo-btn.logged-in {
    background: var(--bg-control);
    border-color: var(--border-control);
    color: var(--text-primary);
}

.logo-btn.logged-in:hover {
    background: var(--bg-control-hover);
    border-color: var(--border-control);
}

.account-btn-wrapper {
    position: relative;
}

.account-badge-inner {
    position: absolute;
    bottom: 10px;
    left: 50%;
    right: auto;
    top: auto;
    transform: translateX(-50%);
    font-size: 14px;
    font-weight: 900;
    min-width: 34px;
    min-height: 22px;
    padding: 5px 7px;
    border-radius: 6px;
    letter-spacing: 0;
    text-transform: uppercase;
    background: rgba(15, 15, 15, 0.85);
    color: #111;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
    white-space: nowrap;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    line-height: 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    background-clip: padding-box;
    pointer-events: none;
}

.account-badge-inner[style*="display: none"] {
    display: none !important;
}

.account-badge-inner:not(.pro) {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.96) 0%, rgba(17, 24, 39, 0.98) 100%);
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.22);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.account-badge-inner:not(.pro):hover {
    box-shadow: 0 0 10px rgba(148, 163, 184, 0.5);
    filter: brightness(1.1);
}

[data-theme="light"] .account-badge-inner:not(.pro),
.light-theme .account-badge-inner:not(.pro) {
    background: linear-gradient(135deg, #d9dde5 0%, #c5cbd6 100%);
    color: #111827;
    border-color: rgba(15, 23, 42, 0.18);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.15);
    text-shadow: none;
}

/* Auth banner (verification message) */
.auth-banner {
    display: none;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.28);
    color: #2563eb;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.auth-banner.success {
    background: rgba(var(--color-positive-rgb), 0.12);
    border-color: rgba(var(--color-positive-rgb), 0.28);
    color: #15803d;
}

.auth-banner.error {
    background: rgba(var(--color-negative-rgb), 0.12);
    border-color: rgba(var(--color-negative-rgb), 0.32);
    color: #b91c1c;
}

/* Toasts */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: var(--z-tooltip);
    /* FIX: Use CSS custom property */
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    min-width: 260px;
    max-width: 360px;
    padding: 10px 14px;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    opacity: 0.95;
}

.toast.info {
    background: #1976d2;
}

.toast.success {
    background: #2e7d32;
}

.toast.error {
    background: #c62828;
}

.toast.warn {
    background: #ef6c00;
}

.auth-slider {
    position: fixed;
    top: 0;
    right: 0;
    /* FIX: Changed from right: -420px for better performance */
    width: 420px;
    height: 100vh;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.2);
    border: none;
    transform: translateX(100%);
    /* FIX: GPU-accelerated animation instead of right property */
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    /* FIX: Hint to browser for optimization */
    z-index: var(--z-modal);
    /* FIX: Use CSS custom property */
    overflow-y: auto;
    color: #ffffff;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Desktop: keep content snug to the right edge */
    padding-right: 0;
}

.auth-slider::-webkit-scrollbar {
    display: none;
}

.auth-slider.active {
    transform: translateX(0);
    /* FIX: Animate transform instead of right */
}

.auth-edge-cover {
    display: none;
}

.auth-slider-content {
    min-height: 100%;
    padding: 32px 20px 32px 28px;
    display: flex;
    justify-content: flex-start;
}

.auth-surface {
    position: relative;
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.auth-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.9);
    color: rgba(0, 0, 0, 0.65);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.auth-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.8);
    transform: translateY(-1px);
}

/* Dark theme: ensure the close button stays visible */
[data-theme="dark"] .auth-close {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.88);
}

[data-theme="dark"] .auth-close:hover {
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.95);
}

.auth-close svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.auth-tabs {
    display: flex;
    gap: 12px;
    margin: 0 0 24px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-tab {
    flex: 0 0 auto;
    padding: 0;
    background: none;
    border: none;
    font-size: 18px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: color 0.2s ease;
    position: relative;
    line-height: 1.4;
}

.auth-tab:hover {
    color: rgba(255, 255, 255, 0.8);
}

.auth-tab.active {
    color: #ffffff;
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 100%;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-mfa-header {
    text-align: center;
    margin-bottom: 20px;
}

.auth-mfa-header h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.auth-mfa-icon {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: #fbbf24;
}

.auth-mfa-icon svg {
    width: 26px;
    height: 26px;
    stroke: currentColor;
}

.auth-mfa-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.mfa-code-field input {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 4px;
}

.mfa-timer {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.form-row label {
    margin: 0;
}

.form-link {
    background: none;
    border: none;
    color: #fbbf24;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.form-link:hover {
    text-decoration: underline;
}

.input-field {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid var(--border-control);
    background: var(--bg-control);
    transition: all 0.3s ease;
    box-shadow: none;
    width: 100%;
}

.input-field:focus-within {
    border-color: var(--accent-color);
    background: var(--bg-control-hover);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2), 0 4px 20px rgba(251, 191, 36, 0.4), 0 0 40px rgba(251, 191, 36, 0.3);
}

.input-field:focus-within .input-icon {
    color: #fbbf24;
}

.input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.input-icon svg {
    width: 20px;
    height: 20px;
}

.input-field input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    color: var(--text-primary) !important;
    outline: none;
    padding: 0;
    width: 100%;
    -webkit-text-fill-color: var(--text-primary);
}

.input-field input:-webkit-autofill,
.input-field input:-webkit-autofill:hover,
.input-field input:-webkit-autofill:focus,
.input-field input:-webkit-autofill:active {
    -webkit-background-clip: text;
    -webkit-text-fill-color: var(--text-primary) !important;
    transition: background-color 5000s ease-in-out 0s;
    box-shadow: inset 0 0 20px 20px var(--bg-control);
    background-color: var(--bg-control) !important;
    caret-color: var(--text-primary);
}

.input-field input::placeholder {
    color: var(--text-secondary);
    -webkit-text-fill-color: var(--text-secondary);
}

.password-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.password-toggle:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

.password-toggle:active {
    transform: scale(0.95);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

/* Form Validation Styles */
.validation-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    display: none;
}

.validation-icon::after {
    font-size: 16px;
}

.input-field.valid .validation-icon {
    display: block;
    color: #4CAF50;
}

.input-field.valid .validation-icon::after {
    content: '?';
}

.input-field.invalid .validation-icon {
    display: block;
    color: #f44336;
}

.input-field.invalid .validation-icon::after {
    content: '?';
}

.input-field.valid {
    border-color: #4CAF50;
}

.input-field.invalid {
    border-color: #f44336;
}

.input-error {
    display: none;
    color: #f44336;
    font-size: 12px;
    margin-top: 6px;
    padding-left: 4px;
}

.input-error.visible {
    display: block;
}

.input-success {
    display: none;
    color: #4CAF50;
    font-size: 12px;
    margin-top: 6px;
    padding-left: 4px;
}

.input-success.visible {
    display: block;
}

/* Password Strength Meter */
.password-strength {
    margin-top: 8px;
}

.password-strength-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 2px;
}

.password-strength-fill.weak {
    width: 25%;
    background: #f44336;
}

.password-strength-fill.fair {
    width: 50%;
    background: #ff9800;
}

.password-strength-fill.good {
    width: 75%;
    background: #fbbf24;
}

.password-strength-fill.strong {
    width: 100%;
    background: #4CAF50;
}

.password-strength-text {
    display: block;
    font-size: 11px;
    margin-top: 4px;
    font-weight: 600;
}

.password-strength-text.weak {
    color: #f44336;
}

.password-strength-text.fair {
    color: #ff9800;
}

.password-strength-text.good {
    color: #fbbf24;
}

.password-strength-text.strong {
    color: #4CAF50;
}

/* Password Requirements */
.password-requirements {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
    font-size: 12px;
}

.password-requirements li {
    padding: 4px 0 4px 24px;
    position: relative;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.password-requirements li::before {
    content: '?';
    position: absolute;
    left: 4px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.password-requirements li.met {
    color: #4CAF50;
}

.password-requirements li.met::before {
    content: '?';
    color: #4CAF50;
}

.auth-submit-btn {
    width: 100%;
    padding: 16px;
    margin-top: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #000000;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(251, 191, 36, 0.4);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.auth-submit-btn.is-loading {
    opacity: 0.85;
}

.auth-secondary-btn {
    margin-top: 12px;
    width: 100%;
    padding: 16px;
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.auth-secondary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(251, 191, 36, 0.4);
}

#signoutBtn {
    display: none !important;
}

.auth-danger-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    margin-top: 24px;
    box-shadow: 0 12px 24px rgba(239, 68, 68, 0.2);
}

.auth-danger-btn:hover {
    box-shadow: 0 16px 32px rgba(239, 68, 68, 0.28);
}

/* FIX: Auth form error container styling */
.auth-error {
    display: none;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #ef4444;
    font-size: 14px;
    line-height: 1.5;
}

.auth-error.visible {
    display: block;
}

.google-btn {
    width: 100%;
    margin-bottom: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0 16px 0;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.auth-divider span {
    padding: 0 18px;
}

.captcha-container {
    margin-bottom: 0;
    display: flex;
    justify-content: center;
    min-height: 0;
}

.reset-hint {
    margin-top: 10px;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
}

.g-recaptcha {
    transform: scale(0.95);
    transform-origin: center;
}

@media (max-width: 500px) {
    .auth-slider {
        width: 100%;
        right: 0;
        /* FIX: Already at right edge */
        transform: translateX(100%);
        /* FIX: Consistent with desktop */
    }

    .g-recaptcha {
        transform: scale(0.85);
    }
}

@media (max-width: 620px) {
    .auth-slider-content {
        padding: 40px 24px;
    }

    .auth-surface {
        padding: 32px 24px 28px;
        border-radius: 18px;
    }
}

.account-slider {
    position: fixed;
    top: 0;
    right: -420px;
    width: 420px;
    height: 100vh;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.6);
    border: none;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: var(--z-modal);
    /* FIX: Use CSS custom property */
    overflow-y: auto;
    color: #ffffff;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Ensure account slider is fully hidden until explicitly activated */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.account-slider::-webkit-scrollbar {
    display: none;
}

.account-slider.active {
    right: 0;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.account-slider-content {
    min-height: 100%;
    padding: 40px 32px;
}

.account-header {
    text-align: center;
    padding: 24px 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.account-avatar {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.1));
    border: 2px solid rgba(251, 191, 36, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.account-name {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: #ffffff;
}

.account-email {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

.account-section {
    margin-bottom: 16px;
}

.account-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 8px 0;
    padding-left: 4px;
}

.account-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 8px;
}

.account-menu-item:last-child {
    margin-bottom: 0;
}

.account-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(251, 191, 36, 0.5);
    transform: translateX(2px);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.2);
}

.premium-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border: 1px solid #f59e0b;
    border-radius: 8px;
    color: #000000;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.account-subscription-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
}

.subscription-plan-display {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.plan-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(245, 158, 11, 0.2) 100%);
    border-radius: 12px;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.plan-details {
    flex: 1;
}

.plan-name {
    font-size: 16px;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 4px;
}

.plan-description {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.upgrade-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border: none;
    border-radius: 8px;
    color: #000000;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(251, 191, 36, 0.4);
}

.upgrade-btn svg {
    fill: currentColor;
}

.account-subscription-card.pro {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    border-color: rgba(251, 191, 36, 0.3);
}

.account-subscription-card.pro .plan-name {
    color: #fbbf24;
}

.account-subscription-card.pro .upgrade-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.account-subscription-card.pro .upgrade-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.account-logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #ef4444;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: 24px;
}

.account-logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    border-color: #f87171;
}

.account-logout-btn:active {
    transform: scale(0.98);
}

.account-section-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 20px 0;
}

.account-credits-section {
    padding: 16px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.account-section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
}

.credits-balance-display {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.credits-icon-large {
    font-size: 40px;
    line-height: 1;
}

.credits-info {
    flex: 1;
}

.credits-amount-large {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 4px;
}

.credits-tier-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.buy-credits-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.buy-credits-btn:hover {
    background: linear-gradient(135deg, #7b8ff0 0%, #8a5bb8 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
}

.buy-credits-btn:active {
    transform: translateY(0);
}

@media (max-width: 620px) {
    .account-slider {
        width: 100%;
        right: -100%;
    }

    .account-slider-content {
        padding: 40px 24px;
    }
}

.edit-profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal-popover);
    /* FIX: Use CSS custom property */
    display: none;
    align-items: center;
    justify-content: center;
}

.edit-profile-modal.active {
    display: flex;
}

.edit-profile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.edit-profile-content {
    position: relative;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.98) 0%, rgba(20, 20, 20, 0.98) 100%);
    border-radius: 20px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(20px);
}

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

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.edit-profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.edit-profile-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.edit-profile-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.2s ease;
}

.edit-profile-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: rotate(90deg);
}

.edit-profile-form {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group:last-of-type {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    font-size: 14px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.form-group input:readonly {
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.08);
}

.edit-profile-actions {
    display: flex;
    gap: 12px;
    padding-top: 8px;
}

.edit-profile-actions button {
    flex: 1;
    padding: 13px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-save {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-save:hover {
    background: linear-gradient(135deg, #7c8ef0 0%, #8659b0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-save:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

@media (max-width: 620px) {
    .edit-profile-content {
        width: 95%;
        max-height: 85vh;
    }

    .edit-profile-header {
        padding: 20px 20px 16px;
    }

    .edit-profile-form {
        padding: 20px;
    }
}

/* FIX: Mobile-specific responsive breakpoints for session slider */
@media (max-width: 768px) {
    .session-slider {
        width: 98vw;
        padding: 10px 12px;
    }

    .session-chip {
        padding: 8px 12px;
        gap: 5px;
    }

    .session-chip .name {
        font-size: 13px;
    }

    .session-chip .time {
        min-width: 65px;
        font-size: 11px;
    }

    .session-chip .localat {
        font-size: 11px;
        padding: 2px 4px;
    }
}

@media (max-width: 600px) {
    .session-slider {
        width: 98vw;
        padding: 8px 10px;
    }

    .session-chips {
        gap: 6px;
    }

    .session-chip {
        padding: 6px 10px;
        gap: 4px;
        font-size: 12px;
    }

    .session-chip .name {
        font-size: 12px;
    }

    .session-chip .tz {
        font-size: 10px;
    }

    .session-chip .time {
        min-width: 60px;
        font-size: 11px;
        padding: 2px 4px;
    }

    .session-chip .localat {
        font-size: 10px;
        padding: 1px 3px;
    }

    .session-chip .open-label {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .session-slider {
        width: 100vw;
        padding: 6px 8px;
        border-radius: 8px;
    }

    .session-chips {
        gap: 5px;
    }

    .session-chip {
        padding: 5px 8px;
        gap: 3px;
        min-height: 38px;
    }

    .session-chip .name {
        font-size: 11px;
    }

    .session-chip .tz {
        display: none;
        /* Hide timezone on very small screens */
    }

    .session-chip .time {
        min-width: 55px;
        font-size: 10px;
        padding: 1px 3px;
    }

    .session-chip .localat {
        font-size: 9px;
        padding: 1px 2px;
    }

    .session-chip .open-label {
        font-size: 8px;
    }
}

@media (max-width: 375px) {
    .session-slider {
        width: 100vw;
        padding: 6px;
        margin: 0;
    }

    .session-chips {
        gap: 4px;
    }

    .session-chip {
        padding: 4px 6px;
        gap: 2px;
        min-height: 36px;
        font-size: 11px;
    }

    .session-chip .name {
        font-size: 10px;
    }

    .session-chip .time {
        min-width: 50px;
        font-size: 9px;
    }

    .session-chip .localat {
        font-size: 9px;
    }
}

/* Portrait / short viewport safety: keep slider fully visible and readable
   - Applies when screen is tall (portrait) OR not very tall (short landscape)
   - Slider width becomes fluid, cards stack vertically, inner content scrolls */
@media (max-aspect-ratio: 3/4),
(max-height: 820px) {
    .session-slider {
        /* Keep consistent offset from header even in portrait */
        top: calc(var(--header-height, 80px) - 10px);
        /* Allow slider to shrink on narrow viewports */
        min-width: 0;
        /* FIX: Override min-width completely */
        width: min(1000px, 98vw);
        /* FIX: Increased from 96vw */
        max-height: calc(100vh - var(--header-height, 80px) - 12px);
        overflow: hidden;
        padding: 12px 14px;
        /* FIX: Reduced padding for more space */
    }

    .session-slider .session-slider-content {
        max-height: calc(100vh - var(--header-height, 80px) - 24px);
        overflow-y: auto;
        padding-right: 0;
    }

    /* Stack info cards for better use of vertical space */
    .session-slider .info-cards-container {
        flex-direction: column;
    }

    .session-slider .session-timeline-card {
        min-width: 0;
        width: 100%;
    }

    /* Scale chart/timeline heights with viewport so both fit nicely
     on portrait and short landscape screens */
    .session-slider .session-timeline-compact {
        min-height: clamp(180px, 32vh, 320px);
        /* FIX: Reduced from 220px min */
        height: clamp(200px, 36vh, 340px);
        /* FIX: Reduced from 240px min */
        padding: 12px 12px 16px;
    }

    .session-slider .session-timeline-compact canvas {
        min-height: clamp(180px, 32vh, 320px);
        /* FIX: Reduced from 220px min */
    }

    .session-slider .session-chart {
        min-height: clamp(200px, 36vh, 320px);
        /* FIX: Reduced from 240px min */
        height: clamp(220px, 40vh, 360px);
        /* FIX: Reduced from 260px min */
    }
}

.premium-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal-high);
    animation: modalFadeIn 0.2s ease-out;
}

.premium-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.premium-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    animation: overlayFadeIn 0.3s ease-out;
}

.premium-modal-content {
    position: relative;
    background: linear-gradient(145deg, #1e1e1e 0%, #161616 100%);
    border-radius: 24px;
    padding: 48px 40px 40px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 8px 32px rgba(76, 175, 80, 0.15);
    text-align: center;
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: center;
}

.premium-modal-icon {
    margin: 0 auto 24px;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.12) 0%, rgba(76, 175, 80, 0.04) 100%);
    border-radius: 50%;
    animation: iconPulse 0.6s ease-out;
    box-shadow: 0 0 0 8px rgba(76, 175, 80, 0.08),
        0 0 32px rgba(76, 175, 80, 0.2);
}

.premium-modal-icon svg {
    filter: drop-shadow(0 2px 8px rgba(76, 175, 80, 0.3));
}

.premium-modal-title {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 16px 0;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 12px rgba(255, 255, 255, 0.1);
}

.premium-modal-message {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
    margin: 0 0 32px 0;
    white-space: pre-line;
}

.premium-modal-btn {
    width: 100%;
    padding: 16px 32px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    letter-spacing: 0.5px;
}

.premium-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    background: linear-gradient(135deg, #52b556 0%, #4aad4e 100%);
}

.premium-modal-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes iconPulse {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 480px) {
    .premium-modal-content {
        padding: 40px 28px 32px;
        border-radius: 20px;
    }

    .premium-modal-title {
        font-size: 24px;
    }

    .premium-modal-message {
        font-size: 15px;
    }
}

.session-timeout-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal-high);
    animation: modalFadeIn 0.2s ease-out;
}

.session-timeout-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.session-timeout-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.session-timeout-modal-content {
    position: relative;
    background: linear-gradient(145deg, #1e1e1e 0%, #161616 100%);
    border-radius: 24px;
    padding: 48px 40px 40px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 165, 0, 0.15),
        0 8px 32px rgba(255, 165, 0, 0.1);
    text-align: center;
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.session-timeout-modal-icon {
    margin: 0 auto 24px;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.12) 0%, rgba(255, 165, 0, 0.04) 100%);
    border-radius: 50%;
    animation: iconPulse 0.6s ease-out;
}

.session-timeout-modal-title {
    font-size: 28px;
    font-weight: 700;
    color: #FFA500;
    margin: 0 0 16px 0;
}

.session-timeout-modal-message {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
    margin: 0 0 24px 0;
}

.session-timeout-countdown {
    font-size: 24px;
    font-weight: 600;
    color: #ff4444;
    margin: 0 0 32px 0;
    padding: 16px;
    background: rgba(255, 68, 68, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 68, 68, 0.2);
}

.session-timeout-countdown span {
    font-family: monospace;
    font-size: 28px;
}

.session-timeout-modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.session-timeout-btn-primary {
    width: 100%;
    padding: 16px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.session-timeout-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.5);
}

.session-timeout-btn-secondary {
    width: 100%;
    padding: 14px 32px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.session-timeout-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.session-timeout-btn-tertiary {
    width: 100%;
    padding: 12px 32px;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    border: none;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.session-timeout-btn-tertiary:hover {
    color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 480px) {
    .session-timeout-modal-content {
        padding: 40px 28px 32px;
    }

    .session-timeout-modal-title {
        font-size: 24px;
    }
}

/* Stripe payment modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 24px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal-backdrop);
}

.modal-overlay.active {
    display: flex !important;
}

.modal-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 48px);
    background: linear-gradient(145deg, #1a1a1f 0%, #121217 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    color: #ffffff;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

.modal-close:active {
    transform: translateY(0);
}

#stripePaymentModal .modal-container {
    max-width: 540px;
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.06), rgba(16, 16, 20, 0.98) 45%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

#stripePaymentModal {
    z-index: var(--z-modal-high);
    pointer-events: auto;
}

#stripePaymentModal .modal-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
}

#stripePaymentModal .modal-body {
    background: radial-gradient(circle at 20% 0%, rgba(123, 97, 255, 0.08), transparent 55%);
}

#stripePaymentModal .stripe-summary-card {
    position: relative;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(59, 69, 138, 0.95), rgba(90, 53, 138, 0.92));
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

#stripePaymentModal .stripe-summary-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.4), transparent 55%);
    opacity: 0.55;
    pointer-events: none;
}

#stripePaymentModal .stripe-summary-label {
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 8px;
}

#stripePaymentModal .stripe-summary-name {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
}

#stripePaymentModal .stripe-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

#stripePaymentModal .stripe-summary-price {
    font-size: 30px;
    font-weight: 700;
    color: #ffffff;
}

#stripePaymentModal .stripe-summary-credits {
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(6px);
}

#stripePaymentModal #stripe-payment-element {
    position: relative;
    min-height: 210px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(10, 12, 20, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

#stripePaymentModal #stripe-payment-element.is-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#stripePaymentModal #stripe-payment-element.is-loading::before {
    content: 'Loading secure payment form...';
}

#stripePaymentModal .stripe-payment-fallback {
    padding: 18px;
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    line-height: 1.5;
}

#stripePaymentModal #stripePayBtn {
    background: linear-gradient(135deg, #f5d27d 0%, #d8a550 100%);
    color: #1b1405;
    border: none;
    border-radius: 12px;
    box-shadow: 0 14px 28px rgba(216, 165, 80, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

#stripePaymentModal #stripePayBtn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    box-shadow: none;
}

[data-theme="light"] #stripePaymentModal .modal-container {
    background: linear-gradient(145deg, #ffffff 0%, #f3f4f6 100%);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04) inset;
    color: #1a1a1a !important;
}

[data-theme="light"] #stripePaymentModal .modal-header {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0));
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] #stripePaymentModal .modal-header h3 {
    color: #1a1a1a !important;
}

[data-theme="light"] #stripePaymentModal .modal-close {
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.05);
    color: #1a1a1a !important;
}

[data-theme="light"] #stripePaymentModal .modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] #stripePaymentModal .modal-body {
    background: radial-gradient(circle at 20% 0%, rgba(123, 97, 255, 0.05), transparent 55%);
}

[data-theme="light"] #stripePaymentModal .stripe-summary-card {
    background: linear-gradient(135deg, rgba(79, 70, 158, 0.9), rgba(110, 63, 158, 0.85));
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 12px 28px rgba(90, 60, 140, 0.25);
}

[data-theme="light"] #stripePaymentModal .stripe-summary-label,
[data-theme="light"] #stripePaymentModal .stripe-summary-name,
[data-theme="light"] #stripePaymentModal .stripe-summary-price,
[data-theme="light"] #stripePaymentModal .stripe-summary-credits {
    color: #ffffff !important;
}

[data-theme="light"] #stripePaymentModal #stripe-payment-element {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] #stripePaymentModal #stripe-payment-element.is-loading {
    color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] #stripePaymentModal .stripe-payment-fallback {
    color: rgba(0, 0, 0, 0.6);
}

.settings-slider {
    position: fixed;
    top: 0;
    right: -480px;
    width: 480px;
    height: 100%;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.6);
    z-index: var(--z-modal);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, visibility 0.4s ease;
    overflow-y: auto;
    color: #ffffff;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.settings-slider.visible {
    right: 0;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.settings-slider-content {
    padding: 20px 24px;
    height: 100%;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.settings-close {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.settings-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.settings-close svg {
    stroke: currentColor;
}

.settings-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.settings-tab {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    margin-bottom: -2px;
    white-space: nowrap;
}

.settings-tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.settings-tab.active {
    color: #fbbf24;
    border-bottom-color: #fbbf24;
}

.settings-content {
    min-height: 400px;
}

.settings-tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

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

.settings-section {
    margin-bottom: 32px;
}

.settings-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fbbf24;
    margin-bottom: 16px;
}

.settings-item {
    margin-bottom: 16px;
}

.settings-item label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.settings-item label:hover {
    background: rgba(255, 255, 255, 0.08);
}

.settings-item label span {
    font-size: 14px;
    color: #ffffff;
}

.settings-item input[type="checkbox"] {
    width: 44px;
    height: 24px;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.settings-item input[type="checkbox"]:checked {
    background: #fbbf24;
}

.settings-item input[type="checkbox"]::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    top: 3px;
    left: 3px;
    transition: left 0.3s;
}

.settings-item input[type="checkbox"]:checked::before {
    left: 23px;
}

.settings-item select,
.settings-item input[type="number"] {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    min-width: 150px;
}

.settings-item select:focus,
.settings-item input[type="number"]:focus {
    outline: none;
    border-color: #fbbf24;
    background: rgba(255, 255, 255, 0.08);
}

.subscription-status-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 2px solid rgba(251, 191, 36, 0.3);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin-bottom: 32px;
}

.subscription-icon {
    margin-bottom: 16px;
}

.subscription-status-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 8px;
}

.subscription-status-card p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-bottom: 16px;
}

.subscription-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #ffffff;
}

.feature-item.disabled {
    opacity: 0.5;
}

.feature-item svg {
    flex-shrink: 0;
}

.subscription-plans h3 {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
}

.trial-banner {
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 12px;
}

.trial-banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.trial-banner-text {
    flex: 1;
}

.trial-banner-text h4 {
    font-size: 15px;
    font-weight: 700;
    color: #22c55e;
    margin: 0 0 2px 0;
}

.trial-banner-text span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.trial-banner .trial-activate-btn {
    width: auto;
    flex-shrink: 0;
    padding: 10px 24px;
    margin-top: 0;
}

.upgrade-options {
    display: flex;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 22px;
}

.upgrade-option-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upgrade-option-card h4 {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px 0;
}

.upgrade-option-card p {
    margin: 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
}

.upgrade-option-meta {
    margin-top: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.upgrade-option-divider {
    align-self: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 0 4px;
}

.trial-activate-btn,
.trial-purchase-btn {
    width: 100%;
    margin-top: auto;
    padding: 10px 14px;
    border-radius: 10px;
    border: none;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.trial-activate-btn {
    background: linear-gradient(135deg, #22c55e 0%, #10b981 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
    border-radius: 10px;
    letter-spacing: 0.02em;
}

.trial-activate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.trial-activate-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.45);
}

.trial-purchase-btn {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
    color: #1a1200 !important;
    box-shadow: 0 4px 14px rgba(251, 191, 36, 0.35);
    border-radius: 10px;
    letter-spacing: 0.02em;
}

.trial-purchase-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(245, 158, 11, 0.35);
}

@media (max-width: 900px) {
    .upgrade-options {
        flex-direction: column;
    }

    .upgrade-option-divider {
        text-align: center;
    }

    .trial-activate-btn,
    .trial-purchase-btn {
        width: 100%;
    }

    .header-upgrade-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

.plan-cards {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
}

.plan-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.plan-card:hover {
    border-color: rgba(251, 191, 36, 0.5);
    transform: translateY(-4px);
}

.plan-card.featured {
    border-color: #fbbf24;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(251, 191, 36, 0.05) 100%);
}

.plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #fbbf24;
    color: #000000;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.plan-header h4 {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin-bottom: 8px;
}

.plan-price .currency {
    font-size: 20px;
    color: #fbbf24;
}

.plan-price .amount {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 4px;
}

.plan-price .period {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.plan-compare {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    text-decoration: line-through;
    margin-bottom: 6px;
}

.plan-savings {
    font-size: 12px;
    color: var(--color-positive);
    font-weight: 600;
    margin-bottom: 16px;
}

.plan-description {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
    text-align: center;
    margin-bottom: 16px;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 16px 0;
    flex-grow: 1;
}

.plan-features li {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.plan-features li:last-child {
    border-bottom: none;
}

.plan-btn {
    width: 100%;
    padding: 12px;
    background: rgba(251, 191, 36, 0.2);
    border: 2px solid #fbbf24;
    border-radius: 8px;
    color: #fbbf24;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.plan-btn:hover {
    background: #fbbf24;
    color: #000000;
}

.plan-btn.featured {
    background: #fbbf24;
    color: #000000;
}

.plan-btn.featured:hover {
    background: #f59e0b;
}

.payment-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
}

.payment-section h3 {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stripe-element {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    transition: all 0.3s;
}

.stripe-element:focus-within {
    border-color: #fbbf24;
    background: rgba(255, 255, 255, 0.08);
}

#billingName {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
}

#billingName:focus {
    outline: none;
    border-color: #fbbf24;
    background: rgba(255, 255, 255, 0.08);
}

.payment-summary {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin: 24px 0;
}

.google-pay-button {
    margin: 18px 0;
    display: flex;
    justify-content: center;
}

.gp-loading {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.payment-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 18px 0;
    font-size: 12px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.payment-divider::before,
.payment-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.summary-row.total {
    border-top: 2px solid rgba(251, 191, 36, 0.3);
    margin-top: 8px;
    padding-top: 16px;
    font-size: 18px;
    font-weight: 700;
    color: #fbbf24;
}

.payment-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border: none;
    border-radius: 8px;
    color: #000000;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    margin-bottom: 12px;
}

.payment-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(251, 191, 36, 0.4);
}

.payment-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.payment-cancel-btn {
    width: 100%;
    padding: 12px;
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-cancel-btn:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

.manage-subscription {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
}

.manage-subscription h3 {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 24px;
}

.subscription-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-row:last-child {
    border-bottom: none;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.status-badge.active {
    background: rgba(var(--color-positive-rgb), 0.2);
    color: var(--color-positive);
}

.subscription-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.billing-security-note {
    margin-top: 12px;
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.65);
}

.action-btn {
    width: 100%;
    padding: 12px;
    background: rgba(251, 191, 36, 0.1);
    border: 2px solid #fbbf24;
    border-radius: 8px;
    color: #fbbf24;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn:hover {
    background: #fbbf24;
    color: #000000;
}

.action-btn.danger {
    border-color: #f44336;
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.action-btn.danger:hover {
    background: #f44336;
    color: #ffffff;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    .settings-slider {
        width: 100%;
        right: -100%;
    }

    .plan-cards {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

.ai-analysis-modal {
    --ai-accent: #f38020;
    --ai-accent-rgb: 243, 128, 32;
    --ai-accent-strong: #ff8a1a;
    --ai-accent-soft: rgba(243, 128, 32, 0.12);
    --ai-accent-soft-strong: rgba(243, 128, 32, 0.22);
    --ai-accent-border: rgba(243, 128, 32, 0.35);
    --ai-accent-glow: rgba(243, 128, 32, 0.45);
    --ai-accent-text: #ffd1a6;
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal-high);
    /* FIX: AI analysis modal uses high modal level */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ai-analysis-modal.visible {
    display: block;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.ai-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.ai-modal-container {
    position: fixed;
    top: calc(var(--header-height, 80px) - 10px);
    left: 50%;
    transform: translateX(calc(-50% + var(--ai-dock-shift, 0px)));
    width: min(1000px, 90vw);
    min-width: 320px;
    max-width: calc(100vw - 400px);
    height: calc(100vh - var(--header-height, 80px) - 20px);
    max-height: calc(100vh - var(--header-height, 80px) - 20px);
    display: flex;
    gap: 0;
    animation: aiSliderFadeIn 0.25s ease-out;
    min-height: 0;
}

@keyframes aiSliderFadeIn {
    from {
        transform: translateX(calc(-50% + var(--ai-dock-shift, 0px))) translateY(12px);
        opacity: 0;
    }

    to {
        transform: translateX(calc(-50% + var(--ai-dock-shift, 0px))) translateY(0);
        opacity: 1;
    }
}

.ai-sidebar {
    width: 0;
    background: linear-gradient(180deg, #1b140b 0%, #120c07 100%);
    border: 1px solid var(--ai-accent-border);
    border-right: none;
    border-radius: 20px 0 0 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, width 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    transform: translateX(-100%);
}

.ai-sidebar.visible {
    width: 280px;
    opacity: 1;
    transform: translateX(0);
}

.ai-sidebar-header {
    padding: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    background: var(--ai-accent-soft);
}

.ai-sidebar-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ai-accent);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-sidebar-toggle {
    background: var(--ai-accent-soft);
    border: 1px solid var(--ai-accent-border);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--ai-accent);
}

.ai-sidebar-toggle:hover {
    background: var(--ai-accent-soft-strong);
    border-color: var(--ai-accent-glow);
}

.ai-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.ai-history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 12px;
    color: #6b7280;
}

.ai-history-empty svg {
    opacity: 0.4;
}

.ai-history-empty p {
    font-size: 13px;
    margin: 0;
}

.ai-history-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-history-item:hover {
    background: rgba(243, 128, 32, 0.08);
    border-color: var(--ai-accent-border);
    transform: translateX(2px);
}

.ai-history-item.active {
    background: rgba(243, 128, 32, 0.12);
    border-color: var(--ai-accent-glow);
}

.ai-history-symbol {
    font-weight: 600;
    color: #e0e0e0;
    font-size: 14px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ai-history-time {
    font-size: 11px;
    color: #9ca3af;
}

.ai-history-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 8px;
    margin-top: 0;
    width: 100%;
    padding: 10px;
    border-radius: 14px;
    background: rgba(12, 8, 4, 0.45);
    border: 1px solid rgba(243, 128, 32, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02),
        0 8px 16px rgba(0, 0, 0, 0.25);
}

.ai-history-stats .stat-badge {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    color: #d7e0f2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
}

.ai-history-stats .stat-badge.hit {
    border-color: rgba(var(--color-positive-rgb), 0.6);
    color: #6ee7b7;
    background: linear-gradient(135deg, rgba(var(--color-positive-rgb), 0.28), rgba(var(--color-positive-rgb), 0.08));
    box-shadow: 0 8px 14px rgba(var(--color-positive-rgb), 0.18);
}

.ai-history-stats .stat-badge.miss {
    border-color: rgba(var(--color-negative-rgb), 0.55);
    color: #fca5a5;
    background: linear-gradient(135deg, rgba(var(--color-negative-rgb), 0.26), rgba(var(--color-negative-rgb), 0.08));
    box-shadow: 0 8px 14px rgba(var(--color-negative-rgb), 0.16);
}

.ai-history-stats .stat-badge.pending {
    border-color: rgba(234, 179, 8, 0.55);
    color: #fde68a;
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.26), rgba(234, 179, 8, 0.08));
    box-shadow: 0 8px 14px rgba(234, 179, 8, 0.16);
}

.ai-history-stats .stat-badge.untracked {
    border-color: rgba(148, 163, 184, 0.55);
    color: #e2e8f0;
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.24), rgba(148, 163, 184, 0.08));
    box-shadow: 0 8px 14px rgba(148, 163, 184, 0.16);
}

.ai-history-stats .stat-badge.accuracy {
    grid-column: 1 / -1;
    padding: 10px 12px;
    font-weight: 600;
    background: linear-gradient(120deg, rgba(243, 128, 32, 0.28), rgba(255, 200, 160, 0.08));
    border-color: rgba(243, 128, 32, 0.4);
    color: #f6cfad;
    text-align: center;
}

.ai-history-stats .ai-stage-legend {
    grid-column: 1 / -1;
}

.ai-history-badge {
    display: inline-flex;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    background: rgba(148, 163, 184, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: #cbd5f5;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.ai-history-badge-hit {
    background: rgba(var(--color-positive-rgb), 0.2);
    border-color: rgba(var(--color-positive-rgb), 0.6);
    color: #34d399;
    box-shadow: 0 0 12px rgba(var(--color-positive-rgb), 0.45);
}

.ai-history-badge-pending {
    background: rgba(234, 179, 8, 0.18);
    border-color: rgba(234, 179, 8, 0.6);
    color: #facc15;
    box-shadow: 0 0 12px rgba(234, 179, 8, 0.4);
}

.ai-history-badge-miss {
    background: rgba(var(--color-negative-rgb), 0.2);
    border-color: rgba(var(--color-negative-rgb), 0.6);
    color: #f87171;
    box-shadow: 0 0 12px rgba(var(--color-negative-rgb), 0.4);
}

.ai-stage-legend {
    display: flex;
    gap: 12px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(203, 213, 225, 0.8);
    margin-top: 6px;
    flex-wrap: wrap;
}

.stage-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

.stage-primary {
    background: #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
}

.stage-revalidation {
    background: #facc15;
    box-shadow: 0 0 8px rgba(250, 204, 21, 0.6);
}

.stage-expired {
    background: #f87171;
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.6);
}

.ai-modal-content {
    flex: 1;
    background: linear-gradient(145deg, #1a1a1a 0%, #0f0f0f 100%);
    border: 1px solid var(--ai-accent-border);
    border-radius: 0 20px 20px 0;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(243, 128, 32, 0.12) inset;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.ai-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--ai-accent-glow), transparent);
}

.ai-cache-notice {
    display: none;
    align-items: center;
    gap: 6px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(125, 211, 252, 0.5);
    color: #bae6fd;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.ai-cache-notice::before {
    content: 'i';
    font-size: 12px;
}

.ai-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, var(--ai-accent-soft) 0%, transparent 100%);
}

.ai-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ai-history-toggle svg,
.ai-icon-wrapper svg,
.ai-modal-close svg,
.ai-sidebar-title svg,
.ai-sidebar-toggle svg,
.ai-history-empty svg,
.ai-export-btn svg,
.ai-refresh-btn svg {
    stroke: currentColor;
    fill: none;
    display: block;
    opacity: 1;
    visibility: visible;
    stroke-width: 2;
}

.ai-history-toggle svg *,
.ai-icon-wrapper svg *,
.ai-modal-close svg * {
    stroke: currentColor;
    fill: none;
    opacity: 1;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ai-history-toggle,
.ai-icon-wrapper,
.ai-modal-close {
    position: relative;
}

.ai-history-toggle svg,
.ai-icon-wrapper svg,
.ai-modal-close svg {
    display: none;
}

.ai-history-toggle::before,
.ai-icon-wrapper::before,
.ai-modal-close::before {
    content: '';
    display: block;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
}

.ai-history-toggle::before {
    width: 18px;
    height: 18px;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%3E%3Cpath%20d%3D%27M3%206h18M3%2012h18M3%2018h18%27/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%3E%3Cpath%20d%3D%27M3%206h18M3%2012h18M3%2018h18%27/%3E%3C/svg%3E");
}

.ai-icon-wrapper::before {
    width: 22px;
    height: 22px;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linejoin%3D%27round%27%20stroke-linecap%3D%27round%27%3E%3Cpath%20d%3D%27M12%202L2%207l10%205%2010-5-10-5z%27/%3E%3Cpath%20d%3D%27M2%2017l10%205%2010-5%27/%3E%3Cpath%20d%3D%27M2%2012l10%205%2010-5%27/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linejoin%3D%27round%27%20stroke-linecap%3D%27round%27%3E%3Cpath%20d%3D%27M12%202L2%207l10%205%2010-5-10-5z%27/%3E%3Cpath%20d%3D%27M2%2017l10%205%2010-5%27/%3E%3Cpath%20d%3D%27M2%2012l10%205%2010-5%27/%3E%3C/svg%3E");
}

.ai-modal-close::before {
    width: 16px;
    height: 16px;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%3E%3Cpath%20d%3D%27M6%206l12%2012M18%206L6%2018%27/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%3E%3Cpath%20d%3D%27M6%206l12%2012M18%206L6%2018%27/%3E%3C/svg%3E");
}

.ai-history-toggle {
    background: var(--ai-accent-soft);
    border: 1px solid var(--ai-accent-border);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--ai-accent-text);
}

.ai-history-toggle:hover {
    background: var(--ai-accent-soft-strong);
    border-color: var(--ai-accent-glow);
    color: var(--ai-accent-text);
}

.ai-icon-wrapper {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(243, 128, 32, 0.2), rgba(255, 138, 26, 0.1));
    border: 1px solid var(--ai-accent-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ai-accent-text);
}

.ai-header-info h2 {
    margin: 0 0 6px 0;
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--ai-accent-text) 0%, var(--ai-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-symbol-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-analysis-meta {
    margin-top: 10px;
    display: flex;
    align-items: flex-start;
}

.ai-analysis-meta .ai-confidence-card {
    margin: 0;
    padding: 6px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.45);
    min-width: 200px;
}

.ai-analysis-meta .ai-confidence-header {
    gap: 8px;
}

.ai-analysis-meta .ai-confidence-title {
    font-size: 11px;
}

.ai-analysis-meta .ai-confidence-subtitle,
.ai-analysis-meta .ai-confidence-evidence,
.ai-analysis-meta .ai-confidence-empty,
.ai-analysis-meta .ai-confidence-note {
    display: none;
}

.ai-analysis-meta .ai-confidence-score {
    font-size: 16px;
}

.ai-analysis-meta .ai-confidence-meter {
    height: 4px;
    margin-top: 6px;
}

.ai-analysis-meta .ai-confidence-meter span {
    height: 100%;
}

.ai-symbol-badge span:first-child {
    font-size: 14px;
    color: #9ca3af;
    font-weight: 500;
}

.ai-pro-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: linear-gradient(135deg, #ffd1a6 0%, #ff9f45 60%, #f38020 100%);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-modal-close {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--ai-accent-text);
}

.ai-modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.ai-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
    color: #d1d4dc;
    line-height: 1.7;
}

.ai-modal-body::-webkit-scrollbar {
    width: 8px;
}

.ai-modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.ai-modal-body::-webkit-scrollbar-thumb {
    background: rgba(243, 128, 32, 0.3);
    border-radius: 4px;
}

.ai-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(243, 128, 32, 0.5);
}

.ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 20px;
}

.ai-loading-spinner {
    position: relative;
    width: 60px;
    height: 60px;
}

.ai-loading .spinner {
    animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    stroke-dasharray: 90, 150;
    stroke-dashoffset: 0;
    stroke-linecap: round;
    color: var(--ai-accent);
}

.ai-loading p {
    color: #e0e0e0;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.ai-loading-subtext {
    color: #6b7280;
    font-size: 13px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dashoffset: -90;
    }

    100% {
        transform: rotate(360deg);
        stroke-dashoffset: -180;
    }
}

.ai-confidence-card {
    margin-bottom: 28px;
    padding: 18px 20px;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--ai-accent-soft), rgba(15, 10, 20, 0.85));
    border: 1px solid var(--ai-accent-border);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.ai-confidence-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ai-confidence-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--ai-accent-text);
}

.ai-confidence-subtitle {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

.ai-confidence-score {
    font-size: 28px;
    font-weight: 700;
    color: var(--ai-accent-strong);
}

.ai-confidence-card.is-pending .ai-confidence-score {
    color: #94a3b8;
}

.ai-confidence-meter {
    margin-top: 12px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.ai-confidence-meter span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #f38020 0%, #ff9f45 60%, #ffd1a6 100%);
    box-shadow: 0 0 12px rgba(243, 128, 32, 0.4);
}

.ai-confidence-card.is-pending .ai-confidence-meter span {
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.4), rgba(148, 163, 184, 0.15));
    box-shadow: none;
}

.ai-confidence-evidence {
    margin: 12px 0 0 0;
    padding-left: 20px;
}

.ai-confidence-evidence li {
    color: #cbd5f5;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 6px;
}

.ai-confidence-empty {
    margin-top: 12px;
    font-size: 12px;
    color: #94a3b8;
}

.ai-confidence-note {
    margin-top: 8px;
    font-size: 11px;
    color: #6b7280;
}

.ai-confidence-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 12px;
    background: linear-gradient(135deg, #ffd1a6 0%, #ff9f45 55%, #f38020 100%);
    color: #1a1a1a;
    box-shadow: 0 4px 12px rgba(243, 128, 32, 0.35);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 4px 12px rgba(243, 128, 32, 0.35);
    }

    50% {
        box-shadow: 0 4px 20px rgba(243, 128, 32, 0.5), 0 0 30px rgba(243, 128, 32, 0.25);
    }
}

.ai-analysis-section {
    margin-bottom: 28px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.2s;
}

.ai-analysis-section:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--ai-accent-border);
}

.ai-analysis-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ai-accent-text);
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ai-accent-border);
}

.ai-analysis-section h3::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, #ff9f45 0%, #f38020 100%);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(243, 128, 32, 0.5);
}

.ai-analysis-section p {
    color: #d1d4dc;
    font-size: 14px;
    line-height: 1.8;
    margin: 0 0 10px 0;
}

.ai-analysis-section strong {
    color: var(--ai-accent-text);
    font-weight: 600;
}

.ai-analysis-section ul {
    margin: 12px 0;
    padding-left: 24px;
}

.ai-analysis-section li {
    color: #d1d4dc;
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 8px;
    position: relative;
}

.ai-analysis-section li::marker {
    color: var(--ai-accent);
}

.ai-modal-footer {
    padding: 20px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.3) 0%, transparent 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-powered-by {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}

.ai-powered-by svg {
    color: var(--ai-accent-strong);
}

.ai-footer-actions {
    display: flex;
    gap: 10px;
}

.ai-export-btn,
.ai-refresh-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid;
}

.ai-export-btn {
    background: rgba(243, 128, 32, 0.12);
    border-color: var(--ai-accent-border);
    color: var(--ai-accent);
}

.ai-export-btn:hover {
    background: rgba(243, 128, 32, 0.22);
    border-color: var(--ai-accent-glow);
    color: var(--ai-accent-text);
    box-shadow: 0 0 20px rgba(243, 128, 32, 0.25);
}

.ai-refresh-btn {
    background: linear-gradient(135deg, rgba(243, 128, 32, 0.2), rgba(255, 138, 26, 0.12));
    border-color: var(--ai-accent-border);
    color: var(--ai-accent-text);
}

.ai-refresh-btn:hover {
    background: linear-gradient(135deg, rgba(243, 128, 32, 0.3), rgba(255, 138, 26, 0.18));
    border-color: var(--ai-accent-glow);
    color: #fff1e5;
    box-shadow: 0 0 25px rgba(243, 128, 32, 0.3);
}

.ai-refresh-btn:disabled,
.ai-export-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

@media (max-width: 1200px) {
    .ai-modal-container {
        max-width: 95vw;
    }

    .ai-sidebar {
        width: 240px;
    }
}

@media (max-width: 768px) {
    .ai-modal-container {
        flex-direction: column;
        height: calc(100vh - var(--header-height, 80px) - 20px);
        max-height: calc(100vh - var(--header-height, 80px) - 20px);
    }

    .ai-sidebar {
        width: 100%;
        max-height: 150px;
        border-radius: 20px 20px 0 0;
        border-right: 1px solid var(--ai-accent-border);
        border-bottom: none;
    }

    .ai-modal-content {
        border-radius: 0 0 20px 20px;
    }
}

.light-theme .ai-analysis-modal {
    --ai-accent: #d96a10;
    --ai-accent-rgb: 217, 106, 16;
    --ai-accent-soft: rgba(217, 106, 16, 0.08);
    --ai-accent-soft-strong: rgba(217, 106, 16, 0.15);
    --ai-accent-border: rgba(217, 106, 16, 0.25);
    --ai-accent-glow: rgba(217, 106, 16, 0.35);
    --ai-accent-text: #9a4a00;
}

.light-theme .ai-modal-overlay {
    background: rgba(0, 0, 0, 0.4);
}

.light-theme .ai-modal-content {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%) !important;
    border-color: rgba(217, 106, 16, 0.2) !important;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(217, 106, 16, 0.08) inset !important;
}

.light-theme .ai-modal-content::before {
    background: linear-gradient(90deg, transparent, rgba(217, 106, 16, 0.3), transparent) !important;
}

.light-theme .ai-modal-header {
    border-bottom-color: rgba(0, 0, 0, 0.08) !important;
    background: linear-gradient(180deg, rgba(217, 106, 16, 0.06) 0%, transparent 100%) !important;
}

.light-theme .ai-header-title {
    color: #1a1a1a !important;
}

.light-theme .ai-header-subtitle {
    color: #666666 !important;
}

.light-theme .ai-modal-close {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #333333 !important;
}

.light-theme .ai-modal-close:hover {
    background: rgba(217, 106, 16, 0.1) !important;
    color: #d96a10 !important;
}

.light-theme .ai-modal-close svg {
    stroke: #333333 !important;
}

.light-theme .ai-modal-close:hover svg {
    stroke: #d96a10 !important;
}

.light-theme .ai-modal-body {
    background: #ffffff !important;
    color: #1a1a1a !important;
}

.light-theme .ai-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
}

.light-theme .ai-modal-body::-webkit-scrollbar-thumb {
    background: rgba(217, 106, 16, 0.3) !important;
}

.light-theme .ai-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(217, 106, 16, 0.5) !important;
}

.light-theme .ai-modal-footer {
    background: linear-gradient(180deg, transparent, rgba(248, 249, 250, 0.95)) !important;
    border-top-color: rgba(0, 0, 0, 0.08) !important;
}

/* Sidebar - Light Theme */
.light-theme .ai-sidebar {
    background: linear-gradient(180deg, #f8f4f0 0%, #f0ebe5 100%) !important;
    border-color: rgba(217, 106, 16, 0.15) !important;
}

.light-theme .ai-sidebar-header {
    border-bottom-color: rgba(0, 0, 0, 0.08) !important;
    background: rgba(217, 106, 16, 0.05) !important;
}

.light-theme .ai-sidebar-title {
    color: #d96a10 !important;
}

.light-theme .ai-history-item {
    background: rgba(0, 0, 0, 0.02) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

.light-theme .ai-history-item:hover {
    background: rgba(217, 106, 16, 0.06) !important;
}

.light-theme .ai-history-item.active {
    background: rgba(217, 106, 16, 0.1) !important;
    border-color: rgba(217, 106, 16, 0.3) !important;
}

.light-theme .ai-history-symbol {
    color: #1a1a1a !important;
}

.light-theme .ai-history-time {
    color: #666666 !important;
}

.light-theme .ai-history-empty {
    color: #888888 !important;
}

.light-theme .ai-history-stats {
    background: rgba(255, 255, 255, 0.6) !important;
    border-color: rgba(217, 106, 16, 0.15) !important;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02),
        0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.light-theme .ai-history-stats .stat-badge {
    border-color: rgba(0, 0, 0, 0.1) !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 249, 250, 0.8)) !important;
    color: #333333 !important;
}

.light-theme .ai-cache-notice {
    background: rgba(56, 189, 248, 0.1) !important;
    border-color: rgba(56, 189, 248, 0.4) !important;
    color: #0284c7 !important;
}

/* AI Header Buttons - Light Theme */
.light-theme .ai-header-btn {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    color: #333333 !important;
}

.light-theme .ai-header-btn:hover {
    background: rgba(217, 106, 16, 0.1) !important;
    border-color: rgba(217, 106, 16, 0.3) !important;
    color: #d96a10 !important;
}

.light-theme .ai-header-btn.active {
    background: rgba(217, 106, 16, 0.15) !important;
    border-color: rgba(217, 106, 16, 0.4) !important;
    color: #d96a10 !important;
}

.light-theme .ai-header-btn svg {
    stroke: #555555 !important;
}

.light-theme .ai-header-btn:hover svg,
.light-theme .ai-header-btn.active svg {
    stroke: #d96a10 !important;
}

/* PRO Badge - Light Theme */
.light-theme .ai-badge-pro {
    background: linear-gradient(135deg, #d96a10, #f59e0b) !important;
    color: white !important;
}

/* Error/Empty States - Light Theme */
.light-theme .ai-error-message,
.light-theme .ai-empty-state {
    color: #666666 !important;
}

/* Footer Buttons - Light Theme */
.light-theme .ai-footer-btn {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    color: #333333 !important;
}

.light-theme .ai-footer-btn:hover {
    background: rgba(217, 106, 16, 0.1) !important;
    color: #d96a10 !important;
}

.light-theme .ai-footer-powered {
    color: #888888 !important;
}

/* ===== LIGHT THEME: AI Thinking Section (Override inline styles from JS) ===== */
.light-theme .ai-thinking-section {
    background: linear-gradient(140deg, rgba(240, 249, 255, 0.98), rgba(224, 242, 254, 0.96)) !important;
    border-color: rgba(8, 145, 178, 0.3) !important;
    box-shadow: 0 0 12px rgba(8, 145, 178, 0.15),
        0 0 28px rgba(14, 116, 144, 0.1),
        inset 0 0 20px rgba(8, 145, 178, 0.03) !important;
}

.light-theme .ai-thinking-section::before {
    border-color: rgba(8, 145, 178, 0.35) !important;
    box-shadow: 0 0 16px rgba(8, 145, 178, 0.25),
        0 0 36px rgba(14, 116, 144, 0.15) !important;
}

.light-theme .ai-thinking-section::after {
    background: linear-gradient(135deg, rgba(240, 249, 255, 0.98), rgba(224, 242, 254, 0.96)) !important;
    border-color: rgba(8, 145, 178, 0.35) !important;
    box-shadow: 0 0 12px rgba(8, 145, 178, 0.25) !important;
}

.light-theme .thinking-header svg {
    color: #0e7490 !important;
    filter: drop-shadow(0 0 4px rgba(8, 145, 178, 0.3)) !important;
}

.light-theme .thinking-title {
    color: #0e7490 !important;
    text-shadow: none !important;
}

.light-theme .thinking-content {
    color: #334155 !important;
}

.light-theme .thinking-content li {
    color: #475569 !important;
}

.light-theme .thinking-content strong {
    color: #1e293b !important;
}

.light-theme .thinking-summary {
    color: #0891b2 !important;
}

.light-theme .thinking-visual {
    background: radial-gradient(circle at 20% 20%, rgba(8, 145, 178, 0.12), rgba(240, 249, 255, 0.85)) !important;
    border-color: rgba(8, 145, 178, 0.2) !important;
    box-shadow: inset 0 0 22px rgba(8, 145, 178, 0.05),
        0 0 18px rgba(14, 116, 144, 0.1) !important;
}

.light-theme .thinking-bar {
    background: linear-gradient(180deg, rgba(8, 145, 178, 0.75), rgba(14, 116, 144, 0.25)) !important;
    box-shadow: 0 0 12px rgba(8, 145, 178, 0.2) !important;
}

.light-theme .thinking-bar::after {
    background: rgba(255, 255, 255, 0.5) !important;
}

.light-theme .thinking-spark {
    background: radial-gradient(circle, rgba(8, 145, 178, 0.35) 0%, rgba(8, 145, 178, 0) 70%) !important;
}

.light-theme .thinking-pulse {
    background: rgba(8, 145, 178, 0.6) !important;
}

.light-theme .thinking-progress span {
    color: #0891b2 !important;
}

.light-theme .thinking-progress-meter {
    background: rgba(8, 145, 178, 0.15) !important;
}

.light-theme .thinking-progress-meter span {
    background: linear-gradient(90deg, #0891b2, #0e7490, #06b6d4) !important;
}

/* ===== LIGHT THEME: AI Analysis Sections (Content) ===== */
.light-theme .ai-analysis-section,
[data-theme="light"] .ai-analysis-section {
    background: rgba(15, 23, 42, 0.02) !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

.light-theme .ai-analysis-section:hover,
[data-theme="light"] .ai-analysis-section:hover {
    background: rgba(15, 23, 42, 0.04) !important;
    border-color: rgba(217, 106, 16, 0.2) !important;
}

.light-theme .ai-analysis-section h3,
[data-theme="light"] .ai-analysis-section h3 {
    color: #0f172a !important;
    border-bottom-color: rgba(217, 106, 16, 0.2) !important;
}

.light-theme .ai-analysis-section p,
[data-theme="light"] .ai-analysis-section p {
    color: #334155 !important;
}

.light-theme .ai-analysis-section strong,
[data-theme="light"] .ai-analysis-section strong {
    color: #0f172a !important;
}

.light-theme .ai-analysis-section li,
[data-theme="light"] .ai-analysis-section li {
    color: #334155 !important;
}

/* AI Confidence Card - Light Theme */
.light-theme .ai-confidence-card,
[data-theme="light"] .ai-confidence-card {
    background: rgba(15, 23, 42, 0.02) !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

.light-theme .ai-confidence-title,
[data-theme="light"] .ai-confidence-title {
    color: #0f172a !important;
}

.light-theme .ai-confidence-subtitle,
[data-theme="light"] .ai-confidence-subtitle {
    color: #64748b !important;
}

.light-theme .ai-confidence-score,
[data-theme="light"] .ai-confidence-score {
    color: #0f172a !important;
}

.light-theme .ai-confidence-meter,
[data-theme="light"] .ai-confidence-meter {
    background: rgba(15, 23, 42, 0.08) !important;
}

.light-theme .ai-confidence-evidence,
[data-theme="light"] .ai-confidence-evidence {
    color: #334155 !important;
}

.light-theme .ai-confidence-evidence li,
[data-theme="light"] .ai-confidence-evidence li {
    color: #334155 !important;
}

.light-theme .ai-confidence-note,
[data-theme="light"] .ai-confidence-note {
    color: #64748b !important;
}

.light-theme .ai-confidence-empty,
[data-theme="light"] .ai-confidence-empty {
    color: #64748b !important;
}

/* AI Thinking Section - Light Theme */
.light-theme .ai-thinking-section,
[data-theme="light"] .ai-thinking-section {
    background: rgba(15, 23, 42, 0.02) !important;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(15, 23, 42, 0.06) !important;
}

.light-theme .thinking-header span,
[data-theme="light"] .thinking-header span {
    color: #475569 !important;
}

.light-theme .thinking-content,
[data-theme="light"] .thinking-content {
    color: #334155 !important;
}

.light-theme .thinking-summary,
[data-theme="light"] .thinking-summary {
    color: #64748b !important;
}

.light-theme .thinking-visual,
[data-theme="light"] .thinking-visual {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.03), rgba(217, 106, 16, 0.05)) !important;
}

.light-theme .thinking-bar,
[data-theme="light"] .thinking-bar {
    background: linear-gradient(180deg, rgba(217, 106, 16, 0.6), rgba(217, 106, 16, 0.3)) !important;
}

.light-theme .thinking-progress span,
[data-theme="light"] .thinking-progress span {
    color: #64748b !important;
}

.light-theme .thinking-progress-meter,
[data-theme="light"] .thinking-progress-meter {
    background: rgba(15, 23, 42, 0.1) !important;
}

/* AI Modal Content Container - Light Theme */
.light-theme #aiAnalysisContent,
[data-theme="light"] #aiAnalysisContent {
    color: #0f172a !important;
}

.light-theme #aiAnalysisContent p,
[data-theme="light"] #aiAnalysisContent p {
    color: #334155 !important;
}

.light-theme #aiAnalysisContent strong,
[data-theme="light"] #aiAnalysisContent strong {
    color: #0f172a !important;
}

.light-theme #aiAnalysisContent ul,
[data-theme="light"] #aiAnalysisContent ul {
    color: #334155 !important;
}

.light-theme #aiAnalysisContent li,
[data-theme="light"] #aiAnalysisContent li {
    color: #334155 !important;
}


[data-theme="light"] .ai-analysis-modal {
    --ai-accent: #d96a10;
    --ai-accent-rgb: 217, 106, 16;
    --ai-accent-soft: rgba(217, 106, 16, 0.08);
    --ai-accent-soft-strong: rgba(217, 106, 16, 0.15);
    --ai-accent-border: rgba(217, 106, 16, 0.25);
    --ai-accent-glow: rgba(217, 106, 16, 0.35);
    --ai-accent-text: #9a4a00;
}

[data-theme="light"] .ai-modal-overlay {
    background: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .ai-modal-content {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%) !important;
    border-color: rgba(217, 106, 16, 0.2) !important;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(217, 106, 16, 0.08) inset !important;
}

[data-theme="light"] .ai-modal-content::before {
    background: linear-gradient(90deg, transparent, rgba(217, 106, 16, 0.3), transparent) !important;
}

[data-theme="light"] .ai-modal-header {
    border-bottom-color: rgba(0, 0, 0, 0.08) !important;
    background: linear-gradient(180deg, rgba(217, 106, 16, 0.06) 0%, transparent 100%) !important;
}

[data-theme="light"] .ai-header-info h2 {
    -webkit-text-fill-color: #9a4a00;
    color: #9a4a00 !important;
}

[data-theme="light"] .ai-modal-close {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #333333 !important;
}

[data-theme="light"] .ai-modal-close:hover {
    background: rgba(217, 106, 16, 0.1) !important;
    color: #d96a10 !important;
}

[data-theme="light"] .ai-modal-body {
    background: #ffffff !important;
    color: #1a1a1a !important;
}

[data-theme="light"] .ai-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
}

[data-theme="light"] .ai-modal-body::-webkit-scrollbar-thumb {
    background: rgba(217, 106, 16, 0.3) !important;
}

[data-theme="light"] .ai-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(217, 106, 16, 0.5) !important;
}

[data-theme="light"] .ai-modal-footer {
    background: linear-gradient(180deg, transparent, rgba(248, 249, 250, 0.95)) !important;
    border-top-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .ai-sidebar {
    background: linear-gradient(180deg, #f8f4f0 0%, #f0ebe5 100%) !important;
    border-color: rgba(217, 106, 16, 0.15) !important;
}

[data-theme="light"] .ai-sidebar-header {
    border-bottom-color: rgba(0, 0, 0, 0.08) !important;
    background: rgba(217, 106, 16, 0.05) !important;
}

[data-theme="light"] .ai-sidebar-title {
    color: #d96a10 !important;
}

[data-theme="light"] .ai-history-item {
    background: rgba(0, 0, 0, 0.02) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .ai-history-item:hover {
    background: rgba(217, 106, 16, 0.06) !important;
}

[data-theme="light"] .ai-history-item.active {
    background: rgba(217, 106, 16, 0.1) !important;
    border-color: rgba(217, 106, 16, 0.3) !important;
}

[data-theme="light"] .ai-history-symbol {
    color: #1a1a1a !important;
}

[data-theme="light"] .ai-history-time {
    color: #666666 !important;
}

[data-theme="light"] .ai-history-empty {
    color: #888888 !important;
}

[data-theme="light"] .ai-history-stats {
    background: rgba(255, 255, 255, 0.6) !important;
    border-color: rgba(217, 106, 16, 0.15) !important;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02),
        0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .ai-history-stats .stat-badge {
    border-color: rgba(0, 0, 0, 0.1) !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 249, 250, 0.8)) !important;
    color: #333333 !important;
}

[data-theme="light"] .ai-cache-notice {
    background: rgba(56, 189, 248, 0.1) !important;
    border-color: rgba(56, 189, 248, 0.4) !important;
    color: #0284c7 !important;
}

[data-theme="light"] .ai-header-btn {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    color: #333333 !important;
}

[data-theme="light"] .ai-header-btn:hover {
    background: rgba(217, 106, 16, 0.1) !important;
    border-color: rgba(217, 106, 16, 0.3) !important;
    color: #d96a10 !important;
}

[data-theme="light"] .ai-header-btn.active {
    background: rgba(217, 106, 16, 0.15) !important;
    border-color: rgba(217, 106, 16, 0.4) !important;
    color: #d96a10 !important;
}

[data-theme="light"] .ai-badge-pro {
    background: linear-gradient(135deg, #d96a10, #f59e0b) !important;
    color: white !important;
}

[data-theme="light"] .ai-footer-btn {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    color: #333333 !important;
}

[data-theme="light"] .ai-footer-btn:hover {
    background: rgba(217, 106, 16, 0.1) !important;
    color: #d96a10 !important;
}

[data-theme="light"] .ai-powered-by {
    color: #888888 !important;
}

[data-theme="light"] .ai-loading p,
[data-theme="light"] .ai-loading-text {
    color: #666666 !important;
}

[data-theme="light"] .ai-symbol-badge span:first-child {
    color: #666666 !important;
}

[data-theme="light"] .ai-error-message,
[data-theme="light"] .ai-empty-state {
    color: #666666 !important;
}

/* Credit Packages in Settings */
.credits-purchase-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.credits-packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.credits-package-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.credits-package-card:hover {
    border-color: #667eea;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.credits-package-card .package-name {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.credits-package-card .package-credits-amount {
    font-size: 48px;
    font-weight: 700;
    color: #667eea;
    line-height: 1;
    margin-bottom: 4px;
}

.credits-package-card .package-credits-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 16px;
}

.credits-package-card .package-price-display {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.credits-package-card .package-value-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 16px;
}

.credits-package-card .package-buy-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.credits-package-card .package-buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.credits-packages-grid.is-processing {
    pointer-events: none;
    opacity: 0.7;
}

.credits-package-card.is-processing {
    border-color: rgba(102, 126, 234, 0.6);
}

.credits-package-card .package-buy-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.credits-locked-card {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.credits-locked-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.credits-locked-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 18px;
}

.credits-locked-btn {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.credits-locked-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(102, 126, 234, 0.35);
}

.credits-locked-btn:active {
    transform: translateY(0);
}

[data-theme="light"] .credits-locked-card {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .credits-locked-title {
    color: #111111;
}

[data-theme="light"] .credits-locked-text {
    color: rgba(0, 0, 0, 0.65);
}

.loading-spinner {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.5);
}

.account-credits-item {
    padding: 12px 16px !important;
    flex-direction: column !important;
    align-items: stretch !important;
}

.credits-item-content {
    width: 100%;
}

.credits-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.credits-title {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.credits-balance {
    font-size: 16px;
    font-weight: 700;
    color: #667eea;
}

.credits-balance-with-left {
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
}

.credits-balance-with-left span {
    font-weight: 700;
    color: #fff;
}

.credits-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.credits-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.credits-reset-text {
    display: flex;
    align-items: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.credit-history-modal {
    background: rgba(8, 10, 14, 0.7);
    backdrop-filter: blur(10px);
}

.credit-history-container {
    max-width: 760px;
    background: linear-gradient(160deg, rgba(24, 26, 33, 0.96), rgba(12, 13, 18, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.credit-history-header h3 {
    margin: 0;
}

.credit-history-subtitle {
    margin: 4px 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.credit-purchase-modal {
    background: rgba(8, 10, 14, 0.7);
    backdrop-filter: blur(10px);
}

.credit-purchase-container {
    max-width: 860px;
    background: linear-gradient(160deg, rgba(24, 26, 33, 0.96), rgba(12, 13, 18, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.credit-purchase-subtitle {
    margin: 4px 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.credit-purchase-grid {
    margin-top: 0;
}

.credit-purchase-empty,
.credit-purchase-error,
.credit-purchase-loading {
    padding: 18px;
    text-align: center;
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
}

.credit-history-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.credit-history-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.credit-history-summary-item {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
}

.credit-history-summary-item strong {
    font-size: 16px;
    color: #ffffff;
    font-weight: 700;
}

.credit-history-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.credit-history-buy-btn {
    border: none;
    border-radius: 14px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    color: #2a1b05;
    background: linear-gradient(135deg, #f6d27a 0%, #f3b24a 55%, #f1a42a 100%);
    box-shadow: 0 8px 18px rgba(245, 158, 11, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.credit-history-buy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.4);
}

.credit-history-buy-btn:active {
    transform: translateY(0);
}

.credit-history-table {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 12, 18, 0.7);
    overflow-x: auto;
}

.credit-history-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.credit-history-page-btn {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.credit-history-page-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.credit-history-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.credit-history-page-info {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.credit-history-row {
    display: grid;
    grid-template-columns: 1.1fr 1.2fr 0.7fr 0.6fr;
    gap: 12px;
    padding: 12px 16px;
    align-items: center;
    min-width: 520px;
}

.credit-history-row+.credit-history-row {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.credit-history-row--header {
    background: rgba(255, 255, 255, 0.04);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.credit-history-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
}

.credit-history-type {
    font-weight: 600;
    color: #f5f7ff;
}

.credit-history-detail {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
}

.credit-history-pair {
    font-weight: 600;
    color: #f5d27d;
}

.credit-history-amount {
    font-weight: 700;
    text-align: right;
    font-size: 14px;
}

.credit-history-amount.is-negative {
    color: #f87171;
}

.credit-history-amount.is-positive {
    color: #34d399;
}

.credit-history-empty,
.credit-history-error,
.credit-history-loading {
    padding: 16px;
    text-align: center;
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
}

@media (max-width: 640px) {
    .credit-history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .credit-history-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .credit-history-row {
        min-width: 460px;
    }

    .credit-history-actions {
        justify-content: stretch;
    }

    .credit-history-buy-btn {
        width: auto;
    }

    .credit-history-pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .credit-history-page-info {
        text-align: center;
    }
}

.account-subscription-item {
    padding: 0 !important;
    background: linear-gradient(135deg, rgba(20, 20, 25, 0.95) 0%, rgba(30, 30, 35, 0.95) 100%) !important;
    border: 1.5px solid rgba(102, 126, 234, 0.3) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    position: relative !important;
}

.account-subscription-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.account-subscription-item:hover::before {
    opacity: 1;
}

.account-subscription-item:hover {
    border-color: rgba(102, 126, 234, 0.6) !important;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15) !important;
    transform: translateY(-1px) !important;
}

.account-subscription-item.pro-tier {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.12) 0%, rgba(255, 140, 0, 0.1) 50%, rgba(184, 134, 11, 0.12) 100%) !important;
    border: 2px solid rgba(255, 215, 0, 0.5) !important;
    box-shadow: 0 0 24px rgba(255, 215, 0, 0.15), inset 0 0 40px rgba(255, 215, 0, 0.05) !important;
}

.account-subscription-item.pro-tier::before {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 140, 0, 0.06) 100%);
    opacity: 1;
}

.account-subscription-item.pro-tier:hover {
    border-color: rgba(255, 215, 0, 0.8) !important;
    box-shadow: 0 6px 32px rgba(255, 215, 0, 0.3), inset 0 0 40px rgba(255, 215, 0, 0.08) !important;
}

.subscription-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 18px;
    gap: 16px;
}

.subscription-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.premium-loading {
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

.premium-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #FFD700;
    border-radius: 50%;
    animation: premium-spin 0.8s linear infinite;
}

.account-subscription-item.is-loading .premium-loading {
    display: flex;
}

.account-subscription-item.is-loading .subscription-left>div {
    opacity: 0.6;
}

.account-subscription-item.is-loading .upgrade-to-pro-btn {
    opacity: 0.6;
    pointer-events: none;
}

@keyframes premium-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.upgrade-to-pro-btn {
    background: linear-gradient(135deg, #FFA500 0%, #FF8C00 50%, #FFD700 100%);
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(255, 165, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.upgrade-to-pro-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.upgrade-to-pro-btn:hover::before {
    left: 100%;
}

.upgrade-to-pro-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 165, 0, 0.5);
}

.credits-dropdown-wrapper {
    width: 100%;
}

.credits-dropdown {
    width: 100%;
    background: rgba(30, 30, 35, 0.9);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.credits-dropdown:hover {
    border-color: #667eea;
}

.credits-dropdown:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.subscription-upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.credits-dropdown-container {
    max-width: 400px;
    margin: 0 auto;
}

.credits-dropdown-settings {
    width: 100%;
    background: rgba(30, 30, 35, 0.9);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    padding: 14px 16px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.credits-dropdown-settings:hover {
    border-color: #667eea;
    background-color: rgba(40, 40, 45, 0.9);
}

.credits-dropdown-settings:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.credits-dropdown-settings option {
    background: #1a1a1f;
    color: #fff;
    padding: 12px;
}

.credits-dropdown-in-plan {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    margin-bottom: 16px;
}

.credits-dropdown-in-plan:hover {
    border-color: #667eea;
    background-color: rgba(255, 255, 255, 0.08);
}

.credits-dropdown-in-plan:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.credits-dropdown-in-plan option {
    background: #1a1a1f;
    color: #fff;
    padding: 12px;
}

.credits-addon-badge {
    color: #FFD700;
    font-weight: 700;
    font-size: 16px;
    margin-left: 6px;
}

.account-name-with-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 4px;
}

.account-tier-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
    border: 1.5px solid rgba(156, 163, 175, 0.4);
}

.account-tier-badge.pro {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(245, 158, 11, 0.2) 100%);
    color: #fbbf24;
    border-color: #fbbf24;
}

.settings-tabs {
    display: flex;
    gap: 8px;
    padding: 16px 24px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(20, 20, 25, 0.95);
}

.settings-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.settings-tab svg {
    opacity: 0.6;
    transition: opacity 0.2s;
}

.settings-tab:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
}

.settings-tab:hover svg {
    opacity: 0.9;
}

.settings-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.settings-tab.active svg {
    opacity: 1;
    stroke: #667eea;
}

.settings-tab-content {
    display: none;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-section {
    background: rgba(30, 30, 35, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.profile-avatar svg {
    stroke: #fff;
}

.change-avatar-btn {
    padding: 8px 16px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    color: #667eea;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.change-avatar-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.profile-card {
    padding: 24px;
}

.profile-avatar-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-avatar-box .profile-avatar {
    width: 90px;
    height: 90px;
}

.profile-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-field label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.7);
}

.profile-field .settings-input,
.profile-field .settings-select {
    padding: 12px 14px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.profile-field .field-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.mfa-field .mfa-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.mfa-field .mfa-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

@media (max-width: 400px) {
    .profile-card {
        padding: 16px;
    }
    .profile-fields {
        gap: 16px;
    }
    .profile-options-row {
        grid-template-columns: 1fr;
    }
}

.settings-input,
.settings-select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s;
}

.settings-select {
    color-scheme: dark;
}

.settings-select option,
.settings-select optgroup {
    background-color: #12141a;
    color: #f5f5f5;
}

[data-theme="light"] .settings-select {
    color-scheme: light;
}

[data-theme="light"] .settings-select option,
[data-theme="light"] .settings-select optgroup {
    background-color: #ffffff;
    color: #111111;
}

.settings-input:focus,
.settings-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.settings-input[readonly] {
    background: rgba(255, 255, 255, 0.02);
    cursor: not-allowed;
    opacity: 0.6;
}

.input-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: rgba(255, 255, 255, 0.06);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label span {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.save-settings-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 20px;
}

.save-settings-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* MFA Toggle Styles */
.toggle-switch-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.mfa-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mfa-toggle-label {
    margin: 0;
    flex: 1;
    min-width: 0;
}

.mfa-toggle-row .toggle-switch-container {
    margin-bottom: 0;
    flex-shrink: 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(24px);
}

[data-theme="light"] .toggle-slider {
    background-color: rgba(0, 0, 0, 0.2);
}

.toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.section-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 16px;
}

.saved-cards-list .empty-state {
    text-align: center;
    padding: 40px 20px;
}

.saved-cards-list .empty-state svg {
    stroke: rgba(255, 255, 255, 0.2);
    margin-bottom: 16px;
}

.saved-cards-list .empty-state p {
    font-size: 16px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.saved-cards-list .empty-state span {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

.credits-packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.credits-package-card {
    background: rgba(30, 30, 35, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.credits-package-card:hover {
    border-color: #667eea;
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.3);
}

.package-name {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 8px;
}

.package-credits-amount {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.package-credits-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
}

.package-price-display {
    font-size: 18px;
    font-weight: 600;
    color: #4CAF50;
    margin-bottom: 8px;
}

.package-value-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 16px;
}

.package-buy-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.package-buy-btn:hover {
    transform: scale(1.05);
}

.loading-spinner {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* Global Error Overlay */
.error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal-high);
    /* FIX: Use CSS custom property */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.error-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.error-container {
    background: linear-gradient(135deg, #1f1f1f 0%, #2a2a2a 100%);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 16px;
    padding: 40px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(244, 67, 54, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.error-overlay.visible .error-container {
    transform: scale(1);
}

.error-icon {
    margin: 0 auto 20px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 50%;
}

.error-icon svg {
    color: #f44336;
}

.error-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px 0;
}

.error-message {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin: 0 0 30px 0;
}

.error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.error-retry-btn,
.error-dismiss-btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-retry-btn {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    border: none;
    color: #fff;
}

.error-retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(244, 67, 54, 0.4);
}

.error-retry-btn:active {
    transform: translateY(0);
}

.error-dismiss-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.error-dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 500px) {
    .error-container {
        padding: 30px 20px;
    }

    .error-title {
        font-size: 20px;
    }

    .error-message {
        font-size: 14px;
    }

    .error-actions {
        flex-direction: column;
    }

    .error-retry-btn,
    .error-dismiss-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Loading States */

/* Chart Loading Skeleton */
.chart-loading-skeleton {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 26, 0.95);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    border-radius: 12px;
    z-index: 10;
    animation: fadeIn 0.3s ease;
}

.chart-loading-skeleton.hidden {
    display: none;
}

.skeleton-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    width: 100%;
    height: 80%;
    gap: 8px;
}

.skeleton-bar {
    flex: 1;
    background: linear-gradient(90deg, #2a2a2a 25%, #333 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    border-radius: 4px 4px 0 0;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Bubble Loading Overlay */
.bubble-loading-overlay {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    height: calc(100% - 70px);
    background: rgba(15, 15, 15, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.bubble-loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.bubble-loading-content {
    text-align: center;
}

.bubble-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #42a5f5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.bubble-loading-text {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    margin: 0;
}

/* Button Loading State */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Loading skeleton for session slider */
@media (max-width: 768px) {
    .bubble-loading-overlay {
        top: 60px;
        height: calc(100% - 60px);
    }

    .bubble-spinner {
        width: 50px;
        height: 50px;
    }

    .bubble-loading-text {
        font-size: 14px;
    }
}

/* Safe Area Insets for Modern Mobile Devices */
/* Supports iPhone notch, Dynamic Island, home indicator */

/* Body and canvas - ensure full coverage */
body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

#bubbleCanvas {
    padding-bottom: env(safe-area-inset-bottom);
}

/* News Slider */
.news-slider {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-right: max(20px, env(safe-area-inset-right));
}

/* Auth Slider */
.auth-slider {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-right: max(20px, env(safe-area-inset-right));
}

/* Account Slider */
.account-slider {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-right: max(20px, env(safe-area-inset-right));
}

/* Settings Slider */
.settings-slider {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-right: max(20px, env(safe-area-inset-right));
}

/* Subscription Slider */
.subscription-slider {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-right: max(20px, env(safe-area-inset-right));
}

/* Session Slider - special handling for centered positioning */
.session-slider {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
}

/* Modals and Overlays */
.error-overlay {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
}

.ai-modal-overlay {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.premium-modal-overlay {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.edit-profile-overlay {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Bubble Loading Overlay */
.bubble-loading-overlay {
    padding-top: max(70px, calc(70px + env(safe-area-inset-top)));
    padding-bottom: env(safe-area-inset-bottom);
}

/* Fixed bottom elements */
.session-progress {
    padding-bottom: env(safe-area-inset-bottom);
}

/* Ensure buttons and interactive elements are accessible */
@supports (padding: max(0px)) {

    /* Additional bottom padding for buttons in sliders */
    .auth-slider .auth-footer,
    .account-slider .account-logout-btn,
    .settings-slider .settings-content {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }

    /* Session chips */
    .session-chips {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Navigation Improvements (P1-2) */

/* Breadcrumb Navigation */
.breadcrumb {
    display: none;
    /* Hidden by default, shown when slider opens */
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    font-size: 13px;
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.breadcrumb-item:hover {
    color: rgba(255, 255, 255, 0.9);
}

.breadcrumb-item.active {
    color: #fbbf24;
    font-weight: 600;
}

.breadcrumb-separator {
    color: rgba(255, 255, 255, 0.3);
    user-select: none;
}

/* Contextual Close/Back Buttons */
.close-label {
    display: none;
    margin-left: 6px;
    font-size: 13px;
    font-weight: 600;
}

/* Show "Back" text on mobile for better context */
@media (max-width: 768px) {

    .session-close .close-label,
    .news-close .close-label,
    .auth-close .close-label {
        display: inline-block;
    }

    .session-close,
    .news-close,
    .auth-close {
        width: auto;
        padding: 0 16px 0 12px;
        gap: 4px;
    }

    .session-close .close-icon,
    .news-close .close-icon,
    .auth-close .close-icon {
        width: 14px;
        height: 14px;
    }
}

/* Breadcrumb mobile optimization */
@media (max-width: 500px) {
    .breadcrumb {
        font-size: 12px;
        padding: 6px 10px;
        margin-bottom: 12px;
    }

    .breadcrumb-item {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ============================================
   ONBOARDING TUTORIAL (P1-1)
   First-time user experience
   ============================================ */

/* Overlay */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: var(--z-modal-high);
    /* FIX: Use CSS custom property */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.onboarding-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Container */
.onboarding-container {
    position: relative;
    max-width: 600px;
    width: 90%;
    background: linear-gradient(135deg, rgba(30, 30, 40, 0.98), rgba(20, 20, 30, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: onboardingSlideUp 0.4s ease-out;
}

@keyframes onboardingSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Skip Button */
.onboarding-skip {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.onboarding-skip:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
}

/* Step Content */
.onboarding-step {
    display: none;
    text-align: center;
    animation: stepFadeIn 0.3s ease;
}

.onboarding-step:not(.hidden) {
    display: block;
}

@keyframes stepFadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Icon */
.onboarding-icon {
    margin-bottom: 24px;
    color: #fbbf24;
}

.onboarding-icon svg {
    filter: drop-shadow(0 4px 12px rgba(251, 191, 36, 0.3));
}

/* Title */
.onboarding-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

/* Description */
.onboarding-description {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 32px;
}

/* Demo Bubbles (Step 1) */
.onboarding-illustration {
    margin-top: 32px;
    margin-bottom: 16px;
}

.demo-bubbles {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.demo-bubble {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: demoBubbleFloat 3s ease-in-out infinite;
}

.demo-bubble-positive {
    background: var(--color-positive-muted);
}

.demo-bubble-negative {
    background: var(--color-negative);
}

.demo-bubble-symbol {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.demo-bubble-change {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
}

@keyframes demoBubbleFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.demo-bubble-positive {
    animation-delay: 0s;
}

.demo-bubble-negative {
    animation-delay: 0.5s;
}

/* Features List (Steps 2 & 3) */
.onboarding-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 32px;
    text-align: left;
}

.onboarding-feature {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.onboarding-feature:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(251, 191, 36, 0.3);
    transform: translateX(4px);
}

.feature-icon {
    font-size: 32px;
    flex-shrink: 0;
    line-height: 1;
}

.feature-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.feature-text strong {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.feature-text span {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

/* Navigation */
.onboarding-navigation {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* Dots */
.onboarding-dots {
    display: flex;
    gap: 10px;
}

.onboarding-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.onboarding-dot.active {
    background: #fbbf24;
    width: 32px;
    border-radius: 5px;
}

.onboarding-dot:hover:not(.active) {
    background: rgba(255, 255, 255, 0.4);
}

/* Buttons */
.onboarding-buttons {
    display: flex;
    gap: 12px;
}

.onboarding-back,
.onboarding-next {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 120px;
    justify-content: center;
}

.onboarding-back {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.onboarding-back:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.onboarding-next {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.onboarding-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(251, 191, 36, 0.4);
}

.onboarding-next:active {
    transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .onboarding-container {
        padding: 32px 24px;
        border-radius: 16px;
    }

    .onboarding-title {
        font-size: 24px;
    }

    .onboarding-description {
        font-size: 14px;
    }

    .demo-bubble {
        width: 100px;
        height: 100px;
    }

    .demo-bubble-symbol {
        font-size: 12px;
    }

    .demo-bubble-change {
        font-size: 11px;
    }

    .onboarding-feature {
        padding: 12px;
    }

    .feature-icon {
        font-size: 28px;
    }

    .feature-text strong {
        font-size: 14px;
    }

    .feature-text span {
        font-size: 12px;
    }

    .onboarding-buttons {
        flex-direction: column;
        width: 100%;
    }

    .onboarding-back,
    .onboarding-next {
        width: 100%;
    }
}

/* ============================================
   PHASE 2: MEDIUM PRIORITY UI/UX
   ============================================ */

/* P2-1: Search/Filter for Currency Pairs */

.search-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 320px;
    width: 320px;
    max-width: 320px;
    margin: 0;
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    z-index: 1;
}

.pair-search-input {
    width: 100%;
    padding: 10px 40px 10px 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.pair-search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.pair-search-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
}

.pair-search-input:focus~.search-icon {
    color: #fbbf24;
}

.search-clear-btn {
    position: absolute;
    right: 8px;
    padding: 6px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.search-clear-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.search-results-info {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    padding: 0 12px;
    animation: fadeIn 0.2s ease;
}

.free-trial-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid transparent;
}

.free-trial-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #7c8ff0 0%, #8a5cb0 100%);
}

.free-trial-badge svg {
    flex-shrink: 0;
    color: #ffd700;
}

.free-trial-badge span {
    letter-spacing: 0.3px;
}

[data-theme="light"] .free-trial-badge,
.light-theme .free-trial-badge {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    color: #fff;
    box-shadow: 0 2px 10px rgba(90, 103, 216, 0.35);
    border: 1px solid rgba(90, 103, 216, 0.2);
}

[data-theme="light"] .free-trial-badge:hover,
.light-theme .free-trial-badge:hover {
    background: linear-gradient(135deg, #667eea 0%, #7c3aed 100%);
    box-shadow: 0 4px 14px rgba(90, 103, 216, 0.45);
    transform: translateY(-1px);
}

[data-theme="light"] .free-trial-badge svg,
.light-theme .free-trial-badge svg {
    color: #fbbf24;
}

@media (max-width: 768px) {
    .free-trial-badge {
        padding: 5px 10px;
        font-size: 11px;
        margin-left: 6px;
    }

    .free-trial-badge svg {
        width: 12px;
        height: 12px;
    }
}

@media (max-width: 480px) {
    .free-trial-badge {
        display: none;
    }
}

/* Search dropdown - Clean Design Matching Sample */
.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background: rgba(20, 20, 20, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: var(--z-modal-backdrop);
    /* FIX: Use CSS custom property */
    display: none;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    /* Width will be set by JavaScript to match input exactly */
}

.search-dropdown::-webkit-scrollbar {
    width: 6px;
}

.search-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.search-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.search-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-symbol {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
}

.dropdown-change {
    font-size: 13px;
    font-weight: 500;
}

.dropdown-change.positive {
    color: var(--color-positive-muted);
}

.dropdown-change.negative {
    color: var(--color-negative);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bubble filtering states */
.bubble-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* No results message */
.no-results-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    z-index: 5;
    animation: fadeIn 0.3s ease;
}

.no-results-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-results-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
}

.no-results-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

/* Mobile responsive */
@media (max-width: 900px) {
    .search-container {
        max-width: 240px;
        margin: 0;
    }

    .pair-search-input {
        font-size: 13px;
        padding: 8px 36px 8px 36px;
    }

    .search-icon {
        width: 16px;
        height: 16px;
        left: 10px;
    }
}

@media (max-width: 600px) {
    .search-container {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
        margin: 0;
        order: 3;
        grid-column: 1 / -1;
    }

    .header {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 12px;
    }

    .brand-timeframe {
        grid-column: 1;
    }

    .controls {
        grid-column: 2;
    }

    .search-container {
        grid-column: 1 / -1;
        margin-top: 4px;
    }
}

/* P2-2: Responsive News Panel Improvements */

/* Enhanced news slider for mobile */
@media (max-width: 768px) {
    .news-slider {
        width: 100vw;
        max-width: 100vw;
    }
}

/* News header improvements */
.news-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 16px;
}

.news-slider-header {
    flex-direction: column;
    align-items: stretch;
}

/* News filters */
.news-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    padding-bottom: 4px;
}

.news-filters::-webkit-scrollbar {
    height: 4px;
}

.news-filters::-webkit-scrollbar-track {
    background: transparent;
}

.news-filters::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.news-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.news-filter-btn[data-filter="bullish"],
.news-filter-btn[data-filter="bearish"],
.news-filter-btn[data-filter="neutral"] {
    display: none;
}

.news-filter-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.news-filter-btn.active {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-color: #fbbf24;
    color: #000;
    font-weight: 600;
}

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.news-filter-btn.active .filter-count {
    background: rgba(0, 0, 0, 0.2);
}

.news-sentiment-summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    margin-left: auto;
}

.news-sentiment-summary .label {
    opacity: 0.8;
}

.news-sentiment-summary .value {
    font-weight: 600;
}

.news-sentiment-summary .value--bullish {
    color: var(--color-positive-muted);
}

.news-sentiment-summary .value--bearish {
    color: var(--color-negative);
}

.news-sentiment-summary .value--neutral {
    color: #9ca3af;
}

/* Enhanced loading state */
.news-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.news-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #fbbf24;
    border-radius: 50%;
    animation: newsSpinnerRotate 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes newsSpinnerRotate {
    to {
        transform: rotate(360deg);
    }
}

.news-loading p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin: 0;
}

/* Empty state */
.news-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.news-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.news-empty-title {
    font-size: 20px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 8px 0;
}

.news-empty-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

/* News card improvements */
.news-item {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.2s ease;
    cursor: pointer;
}

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

.news-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.news-item-source {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-item-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
}

.news-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    line-height: 1.5;
    margin: 0 0 8px 0;
}

.news-item-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin: 0 0 12px 0;
}

.news-item-footer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.news-sentiment-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.news-sentiment-badge.bullish {
    background: rgba(var(--color-positive-rgb), 0.15);
    color: var(--color-positive-muted);
    border: 1px solid rgba(var(--color-positive-rgb), 0.3);
}

.news-sentiment-badge.bearish {
    background: rgba(var(--color-negative-rgb), 0.15);
    color: var(--color-negative);
    border: 1px solid rgba(var(--color-negative-rgb), 0.3);
}

.news-sentiment-badge.neutral {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.news-item-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.news-tag {
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

/* Mobile optimizations */
@media (max-width: 600px) {
    .news-slider-header {
        padding: 16px;
    }

    .news-title {
        font-size: 22px;
    }

    .news-close {
        width: 36px;
        height: 36px;
    }

    .news-filters {
        gap: 6px;
    }

    .news-filter-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .news-sentiment-summary {
        padding: 6px 10px;
        font-size: 12px;
    }

    .news-item {
        padding: 16px;
    }

    .news-item-title {
        font-size: 15px;
    }

    .news-item-description {
        font-size: 13px;
    }
}

/* P2-3: Chart Export Functionality */

.chart-export-buttons {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
}

.chart-export-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.chart-export-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(251, 191, 36, 0.5);
    color: #fbbf24;
    transform: translateY(-1px);
}

.chart-export-btn:active {
    transform: translateY(0);
}

.chart-export-btn svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.chart-export-btn.exporting {
    opacity: 0.6;
    pointer-events: none;
}

.chart-export-btn.exporting::after {
    content: '...';
    animation: exportDots 1.5s infinite;
}

@keyframes exportDots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60%,
    100% {
        content: '...';
    }
}

/* Export success notification */
.export-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 20px;
    background: var(--color-positive-muted);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(var(--color-positive-rgb), 0.3);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    z-index: var(--z-modal-high);
    animation: toastSlideIn 0.3s ease, toastFadeOut 0.3s ease 2.7s forwards;
    display: flex;
    align-items: center;
    gap: 10px;
}

.export-toast.error {
    background: var(--color-negative);
    box-shadow: 0 8px 24px rgba(var(--color-negative-rgb), 0.3);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastFadeOut {
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

.export-toast-icon {
    font-size: 20px;
}

/* Mobile responsive */
@media (max-width: 900px) {
    .chart-export-buttons {
        gap: 6px;
    }

    .chart-export-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .chart-export-btn svg {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 600px) {
    .chart-controls-row {
        flex-wrap: wrap;
    }

    .chart-export-buttons {
        order: 3;
        width: 100%;
        margin-left: 0;
        margin-top: 8px;
    }

    .chart-export-btn {
        flex: 1;
    }

    .export-toast {
        right: 16px;
        bottom: 16px;
        left: 16px;
        text-align: center;
        justify-content: center;
    }
}

/* P2-4: Visual Session Timeline Improvements */

.session-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px 12px 0 0;
}

.timeline-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    letter-spacing: 0.3px;
}

.timeline-legend {
    display: flex;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.active {
    background: var(--color-positive-muted);
    box-shadow: 0 0 8px rgba(var(--color-positive-rgb), 0.6);
    animation: legendPulse 2s ease-in-out infinite;
}

.legend-dot.upcoming {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

@keyframes legendPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.legend-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

/* Session labels below timeline */
.session-labels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
    padding: 0 12px;
}

.session-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.session-label:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(251, 191, 36, 0.3);
    transform: translateY(-2px);
}

.session-label.active {
    background: linear-gradient(135deg, rgba(var(--color-positive-rgb), 0.15), rgba(var(--color-positive-rgb), 0.05));
    border-color: rgba(var(--color-positive-rgb), 0.4);
}

.session-label.active .session-name {
    color: var(--color-positive-muted);
    font-weight: 600;
}

.session-name {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.session-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

.session-label.active .session-time {
    color: rgba(var(--color-positive-rgb), 0.9);
    font-weight: 600;
}

/* Enhance existing session timeline card */
.session-timeline-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    /* Allow full timeline (including New York row and axis)
       to render without being clipped at the bottom. */
    overflow: visible;
}

/* Add glow effect to canvas */
#sessionTimeline {
    filter: drop-shadow(0 2px 8px rgba(251, 191, 36, 0.1));
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

/* Session progress enhancements */
.session-progress {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    margin: 12px 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .timeline-legend,
[data-theme="light"] .legend-label {
    color: #64748b;
}

[data-theme="light"] .session-progress {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .session-row .label {
    color: #0f172a;
}

[data-theme="light"] .progress-track {
    background: #e2e8f0;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .session-row .timeleft {
    color: #475569;
}

[data-theme="light"] .overlap-banner {
    color: #15803d;
}

[data-theme="light"] .market-banner {
    background: rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.5);
    color: #92400e;
}

[data-theme="light"] .session-label {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .session-label:hover {
    background: #f8fafc;
    border-color: rgba(59, 130, 246, 0.35);
}

[data-theme="light"] .session-name {
    color: #0f172a;
}

[data-theme="light"] .session-time {
    color: #64748b;
}

[data-theme="light"] .session-label.active {
    background: rgba(var(--color-positive-rgb), 0.12);
    border-color: rgba(var(--color-positive-rgb), 0.35);
}

[data-theme="light"] .session-label.active .session-time {
    color: #047857;
}

[data-theme="light"] .session-timeline-card {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] #sessionTimeline {
    filter: drop-shadow(0 2px 6px rgba(15, 23, 42, 0.08));
}

/* Mobile responsive */
@media (max-width: 768px) {
    .session-timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .timeline-legend {
        width: 100%;
        justify-content: space-around;
    }

    .session-labels {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .session-label {
        flex-direction: row;
        justify-content: space-between;
        padding: 10px 14px;
    }

    .session-name {
        margin-bottom: 0;
    }
}

@media (max-width: 600px) {
    .timeline-title {
        font-size: 13px;
    }

    .legend-item {
        gap: 4px;
    }

    .legend-label {
        font-size: 10px;
    }

    .session-name {
        font-size: 12px;
    }

    .session-time {
        font-size: 10px;
    }
}

/* P2-6: Keyboard Shortcuts for Power Users */

.shortcuts-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: var(--z-modal-high);
    /* FIX: Use CSS custom property */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.shortcuts-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.shortcuts-modal {
    max-width: 720px;
    width: 90%;
    max-height: 85vh;
    background: linear-gradient(145deg, rgba(30, 30, 40, 0.98), rgba(20, 20, 30, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: shortcutsSlideIn 0.3s ease-out;
}

@keyframes shortcutsSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.shortcuts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.shortcuts-title {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.shortcuts-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
}

.shortcuts-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: rotate(90deg);
}

.shortcuts-content {
    padding: 28px;
    max-height: calc(85vh - 140px);
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.shortcuts-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.shortcuts-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #fbbf24;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.shortcut-keys {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom-width: 3px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.shortcut-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

.shortcuts-footer {
    padding: 16px 28px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
}

.shortcuts-hint {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.shortcuts-hint kbd {
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    font-size: 11px;
    margin: 0 4px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .shortcuts-modal {
        width: 95%;
        max-height: 90vh;
    }

    .shortcuts-content {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 24px;
    }

    .shortcuts-header {
        padding: 20px;
    }

    .shortcuts-title {
        font-size: 20px;
    }
}

@media (max-width: 600px) {
    .shortcut-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .shortcut-keys {
        flex-wrap: wrap;
    }

    kbd {
        min-width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* P2-7: Empty States and Zero-Data Handling */

.empty-state-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #1a1a1a 0%, #0f0f0f 100%);
    z-index: 3;
    animation: fadeIn 0.3s ease;
}

.empty-state-content {
    max-width: 480px;
    text-align: center;
    padding: 48px 32px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
}

.empty-state-icon {
    font-size: 72px;
    margin-bottom: 24px;
    opacity: 0.7;
    animation: emptyIconFloat 3s ease-in-out infinite;
}

@keyframes emptyIconFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.empty-state-title {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 16px 0;
    line-height: 1.3;
}

.empty-state-description {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 32px 0;
}

.empty-state-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.empty-state-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.empty-state-btn.primary {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.empty-state-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(251, 191, 36, 0.4);
}

.empty-state-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.empty-state-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Empty state variations for specific components */

/* Chart empty state */
.chart-empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 40px 20px;
    text-align: center;
}

.chart-empty-state.visible {
    display: flex;
}

.chart-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.chart-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 8px 0;
}

.chart-empty-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

/* Account credits empty state */
.credits-empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 32px 20px;
    text-align: center;
    background: rgba(var(--color-negative-rgb), 0.05);
    border: 1px solid rgba(var(--color-negative-rgb), 0.2);
    border-radius: 12px;
    margin: 16px 0;
}

.credits-empty-state.visible {
    display: flex;
}

.credits-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.credits-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-negative);
    margin: 0 0 8px 0;
}

.credits-empty-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 16px 0;
}

.credits-empty-btn {
    padding: 10px 20px;
    background: var(--color-positive-muted);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.credits-empty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--color-positive-rgb), 0.3);
}

/* Mobile responsive */
@media (max-width: 600px) {
    .empty-state-content {
        padding: 32px 24px;
    }

    .empty-state-icon {
        font-size: 56px;
    }

    .empty-state-title {
        font-size: 20px;
    }

    .empty-state-description {
        font-size: 14px;
    }

    .empty-state-actions {
        flex-direction: column;
        width: 100%;
    }

    .empty-state-btn {
        width: 100%;
        justify-content: center;
    }
}

/* P2-8: Improved Loading Skeleton Variety */

/* Base skeleton styles with shimmer */
.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.03) 0%,
            rgba(255, 255, 255, 0.08) 50%,
            rgba(255, 255, 255, 0.03) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Enhanced chart skeleton */
.chart-loading-skeleton {
    position: relative;
    overflow: hidden;
}

.skeleton-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 100%;
    gap: 4px;
    padding: 0 8px;
}

.skeleton-bar {
    flex: 1;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.12) 50%,
            rgba(255, 255, 255, 0.05) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px 4px 0 0;
    min-width: 8px;
}

.skeleton-bar:nth-child(1) {
    animation-delay: 0s;
}

.skeleton-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.skeleton-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.skeleton-bar:nth-child(4) {
    animation-delay: 0.3s;
}

.skeleton-bar:nth-child(5) {
    animation-delay: 0.4s;
}

.skeleton-bar:nth-child(6) {
    animation-delay: 0.5s;
}

.skeleton-bar:nth-child(7) {
    animation-delay: 0.6s;
}

/* News item skeleton */
.news-item-skeleton {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.news-skeleton-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.news-skeleton-source {
    width: 80px;
    height: 14px;
}

.news-skeleton-time {
    width: 60px;
    height: 14px;
}

.news-skeleton-title {
    width: 85%;
    height: 18px;
    margin-bottom: 8px;
}

.news-skeleton-description {
    width: 100%;
    height: 14px;
    margin-bottom: 6px;
}

.news-skeleton-description:last-of-type {
    width: 70%;
}

.news-skeleton-footer {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.news-skeleton-badge {
    width: 70px;
    height: 24px;
    border-radius: 6px;
}

/* Account item skeleton */
.account-skeleton-item {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.account-skeleton-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.account-skeleton-label {
    width: 100px;
    height: 16px;
}

.account-skeleton-value {
    width: 80px;
    height: 20px;
}

.account-skeleton-bar {
    width: 100%;
    height: 8px;
    border-radius: 4px;
}

/* Settings skeleton */
.settings-skeleton-section {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-skeleton-title {
    width: 150px;
    height: 20px;
    margin-bottom: 16px;
}

.settings-skeleton-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.settings-skeleton-label {
    width: 120px;
    height: 16px;
}

.settings-skeleton-control {
    width: 60px;
    height: 32px;
    border-radius: 16px;
}

/* Pulse animation variant */
.skeleton-pulse {
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

@keyframes skeletonPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Card skeleton */
.card-skeleton {
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    margin-bottom: 16px;
}

.card-skeleton-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.card-skeleton-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.card-skeleton-text {
    flex: 1;
}

.card-skeleton-title {
    width: 60%;
    height: 18px;
    margin-bottom: 8px;
}

.card-skeleton-subtitle {
    width: 40%;
    height: 14px;
}

.card-skeleton-body {
    width: 100%;
    height: 60px;
    margin-bottom: 12px;
}

.card-skeleton-footer {
    display: flex;
    gap: 8px;
}

.card-skeleton-button {
    flex: 1;
    height: 40px;
    border-radius: 10px;
}

/* Table skeleton */
.table-skeleton-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.table-skeleton-cell {
    height: 16px;
}

.table-skeleton-cell:first-child {
    width: 80%;
}

/* List skeleton */
.list-skeleton-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
}

.list-skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.list-skeleton-content {
    flex: 1;
}

.list-skeleton-line {
    height: 14px;
    margin-bottom: 8px;
}

.list-skeleton-line:last-child {
    width: 70%;
    margin-bottom: 0;
}

/* Mobile optimizations */
@media (max-width: 600px) {
    .table-skeleton-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .table-skeleton-cell:first-child {
        width: 100%;
    }
}

/* =================================================================
   P3-1: Dark/Light Theme System
   ================================================================= */

:root {
    /* Dark theme (default) */
    --bg-primary: #1c1916;
    --bg-secondary: #242424;
    --bg-tertiary: #2a2a2a;
    --bg-elevated: #333333;
    --bg-header: var(--bg-primary);
    --bg-texture: none;

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.5);

    --border-color: rgba(255, 255, 255, 0.1);
    --border-color-hover: rgba(255, 255, 255, 0.2);

    --overlay-bg: rgba(0, 0, 0, 0.8);
    --shadow-color: rgba(0, 0, 0, 0.3);

    --accent-primary: #fbbf24;
    --accent-hover: #f59e0b;

    --success-color: var(--color-positive-muted);
    --error-color: var(--color-negative);
    --warning-color: #f59e0b;
    --info-color: #3b82f6;

    --bubble-positive: var(--color-positive-muted);
    --bubble-negative: var(--color-negative);

    /* Glass effect */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* Light theme */
[data-theme="light"] {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f3f5;
    --bg-elevated: #ffffff;
    --bg-header: var(--bg-primary);
    --bg-texture: none;

    --text-primary: #000000;
    --text-secondary: rgba(0, 0, 0, 0.85);
    --text-tertiary: rgba(0, 0, 0, 0.7);

    --border-color: rgba(0, 0, 0, 0.1);
    --border-color-hover: rgba(0, 0, 0, 0.2);

    --overlay-bg: rgba(255, 255, 255, 0.95);
    --shadow-color: rgba(0, 0, 0, 0.1);

    --accent-primary: #f59e0b;
    --accent-hover: #d97706;

    --success-color: var(--color-positive-muted);
    --error-color: var(--color-negative);
    --warning-color: #d97706;
    --info-color: #2563eb;

    --bubble-positive: var(--color-positive-muted);
    --bubble-negative: var(--color-negative);

    /* Glass effect */
    --glass-bg: rgba(0, 0, 0, 0.02);
    --glass-border: rgba(0, 0, 0, 0.08);
}

/* Smooth theme transitions */
body,
.header,
.controls,
.control-btn,
.news-slider,
.auth-slider,
.settings-slider,
.account-slider,
.modal-overlay,
.empty-state-overlay,
.shortcuts-overlay,
canvas {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Theme toggle button styling */
#themeToggleBtn {
    position: relative;
    overflow: hidden;
}

.theme-icon-sun,
.theme-icon-moon {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

[data-theme="light"] .theme-icon-sun {
    display: none !important;
}

[data-theme="light"] .theme-icon-moon {
    display: block !important;
}

[data-theme="dark"] .theme-icon-sun {
    display: block !important;
}

[data-theme="dark"] .theme-icon-moon {
    display: none !important;
}

/* Theme toggle animation */
#themeToggleBtn.theme-transitioning {
    animation: themeToggleRotate 0.3s ease;
}

@keyframes themeToggleRotate {
    0% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(180deg) scale(0.8);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Update body and main elements for light theme */
body {
    background-color: var(--bg-primary);
    background-image: var(--bg-texture);
    color: var(--text-primary);
}

[data-theme="light"] body {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

main {
    background-color: var(--bg-primary);
    background-image: var(--bg-texture);
    position: relative;
    margin-top: 80px;
    display: block;
    min-height: calc(100vh - 80px);
    height: calc(100vh - 80px);
    overflow: hidden;
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    z-index: auto;
}

[data-theme="light"] main {
    background: var(--bg-primary) !important;
}

[data-theme="light"] .header {
    background: var(--bg-secondary) !important;
    border-bottom: none !important;
}

/* Update canvas background for light theme */
[data-theme="light"] #bubbleCanvas {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Update modals and overlays for light theme */
[data-theme="light"] .modal-overlay,
[data-theme="light"] .shortcuts-overlay,
[data-theme="light"] .empty-state-overlay,
[data-theme="light"] .onboarding-overlay {
    background: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .modal-container,
[data-theme="light"] .shortcuts-modal,
[data-theme="light"] .empty-state-content,
[data-theme="light"] .onboarding-content {
    background: var(--bg-secondary);
    color: #000000 !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

/* Update sliders for light theme */
[data-theme="light"] .news-slider,
[data-theme="light"] .auth-slider,
[data-theme="light"] .settings-slider,
[data-theme="light"] .account-slider {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    /* Tame the heavy dark shadow that shows as a black strip on the right edge */
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.08);
    color: #000000 !important;
}

/* Update buttons for light theme */
[data-theme="light"] .control-btn,
[data-theme="light"] .chart-export-btn,
[data-theme="light"] .chart-tf-btn,
[data-theme="light"] .timeframe-btn {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.01));
    border-color: rgba(0, 0, 0, 0.12);
    color: #111111 !important;
}

[data-theme="light"] .control-btn:hover,
[data-theme="light"] .chart-export-btn:hover,
[data-theme="light"] .chart-tf-btn:hover,
[data-theme="light"] .timeframe-btn:hover {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.02));
    border-color: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .chart-tf-btn.active,
[data-theme="light"] .timeframe-btn.active {
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    border-color: #4CAF50;
    color: #ffffff;
    text-shadow: none;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.6) inset, 0 0 20px rgba(76, 175, 80, 0.4);
}


/* Update inputs for light theme */
[data-theme="light"] .pair-search-input,
[data-theme="light"] .settings-search-input,
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="tel"],
[data-theme="light"] textarea {
    background: #ffffff !important;
    border-color: var(--border-color) !important;
    color: #000000 !important;
}

[data-theme="light"] .pair-search-input::placeholder,
[data-theme="light"] .settings-search-input::placeholder,
[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
    color: rgba(0, 0, 0, 0.6) !important;
}

/* Light theme dropdown */
[data-theme="light"] .search-dropdown {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .dropdown-item {
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .dropdown-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .dropdown-symbol {
    color: #000;
}

[data-theme="light"] .search-dropdown::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .search-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Light theme form overrides */
[data-theme="light"] .input-field {
    border-color: var(--border-color);
    background: #ffffff;
}

[data-theme="light"] .input-field:focus-within {
    border-color: var(--accent-color);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15), 0 4px 20px rgba(245, 158, 11, 0.2);
}

[data-theme="light"] .input-field input {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
}

[data-theme="light"] .input-field input::placeholder {
    color: rgba(0, 0, 0, 0.6) !important;
    -webkit-text-fill-color: rgba(0, 0, 0, 0.6) !important;
}

[data-theme="light"] .input-field input:-webkit-autofill,
[data-theme="light"] .input-field input:-webkit-autofill:hover,
[data-theme="light"] .input-field input:-webkit-autofill:focus,
[data-theme="light"] .input-field input:-webkit-autofill:active {
    -webkit-text-fill-color: #000000 !important;
    box-shadow: inset 0 0 20px 20px #ffffff !important;
    background-color: #ffffff !important;
    caret-color: #000000 !important;
}

[data-theme="light"] .input-icon {
    color: rgba(0, 0, 0, 0.7) !important;
}

[data-theme="light"] .input-field:focus-within .input-icon {
    color: #7c3aed !important;
    /* Premium violet - better contrast on light theme */
}

[data-theme="light"] .password-toggle {
    color: rgba(0, 0, 0, 0.7) !important;
}

[data-theme="light"] .password-toggle:hover {
    color: #7c3aed !important;
    /* Premium violet - matches input icon */
}

[data-theme="light"] .password-requirements li {
    color: rgba(0, 0, 0, 0.8) !important;
}

[data-theme="light"] .password-requirements li::before {
    color: rgba(0, 0, 0, 0.7) !important;
}

[data-theme="light"] .form-group label {
    color: #000000 !important;
    font-weight: 600;
}

/* Ensure all text in modals and forms uses proper colors */
[data-theme="light"] .modal-container,
[data-theme="light"] .modal-container *,
[data-theme="light"] .auth-form,
[data-theme="light"] .auth-form *,
[data-theme="light"] .settings-slider,
[data-theme="light"] .settings-slider *,
[data-theme="light"] .account-slider,
[data-theme="light"] .account-slider * {
    color: inherit;
}

[data-theme="light"] .edit-profile-header h2 {
    text-shadow: none;
}

[data-theme="light"] .news-login-card h3,
[data-theme="light"] .settings-header h2,
[data-theme="light"] .edit-profile-header h2 {
    color: #000000 !important;
}

/* Force dark text in light theme for all text elements */
[data-theme="light"] p,
[data-theme="light"] span,
[data-theme="light"] div,
[data-theme="light"] label,
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5,
[data-theme="light"] h6 {
    color: inherit;
}

[data-theme="light"] .modal-container,
[data-theme="light"] .auth-slider,
[data-theme="light"] .settings-slider,
[data-theme="light"] .account-slider {
    color: #000000 !important;
}

[data-theme="light"] .modal-container p,
[data-theme="light"] .modal-container span,
[data-theme="light"] .modal-container div:not(.input-field):not(.control-btn),
[data-theme="light"] .auth-slider p,
[data-theme="light"] .auth-slider span,
[data-theme="light"] .auth-slider div:not(.input-field):not(.control-btn) {
    color: #000000 !important;
}

/* Global text color fix for light theme - ensure maximum readability */
[data-theme="light"] .auth-slider,
[data-theme="light"] .settings-slider,
[data-theme="light"] .account-slider,
[data-theme="light"] .news-slider {
    color: #000000 !important;
}

[data-theme="light"] .auth-slider *,
[data-theme="light"] .settings-slider *,
[data-theme="light"] .account-slider *,
[data-theme="light"] .news-slider *,
[data-theme="light"] .modal-container * {
    color: inherit;
}

/* Override any white text that might be inherited */
[data-theme="light"] .auth-slider p,
[data-theme="light"] .auth-slider span:not(.input-icon):not(.password-toggle),
[data-theme="light"] .auth-slider label,
[data-theme="light"] .auth-slider h1,
[data-theme="light"] .auth-slider h2,
[data-theme="light"] .auth-slider h3,
[data-theme="light"] .auth-slider h4,
[data-theme="light"] .auth-slider h5,
[data-theme="light"] .auth-slider h6,
[data-theme="light"] .modal-container p,
[data-theme="light"] .modal-container span:not(.input-icon):not(.password-toggle),
[data-theme="light"] .modal-container label,
[data-theme="light"] .modal-container h1,
[data-theme="light"] .modal-container h2,
[data-theme="light"] .modal-container h3,
[data-theme="light"] .modal-container h4,
[data-theme="light"] .modal-container h5,
[data-theme="light"] .modal-container h6 {
    color: #000000 !important;
}

/* Light theme news header polish */
[data-theme="light"] .news-slider-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.95) 100%);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .news-title {
    background: none;
    -webkit-text-fill-color: #111111;
    color: #111111;
}

[data-theme="light"] .news-close {
    background: rgba(0, 0, 0, 0.04);
    color: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .news-close:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #111111;
}

[data-theme="light"] .news-filters {
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

[data-theme="light"] .news-filters::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .news-filter-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.7);
}

[data-theme="light"] .news-filter-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.2);
    color: #111111;
}

[data-theme="light"] .news-filter-btn .filter-count {
    background: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.8);
}

[data-theme="light"] .news-filter-btn.active .filter-count {
    background: rgba(0, 0, 0, 0.18);
}

[data-theme="light"] .news-sentiment-summary {
    background: rgba(0, 0, 0, 0.04);
    color: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Light theme high impact events */
[data-theme="light"] .news-impact-intro {
    background: #f5f6f8;
    border-color: rgba(15, 23, 42, 0.1);
    color: rgba(15, 23, 42, 0.75);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .news-impact-section-title {
    color: rgba(15, 23, 42, 0.6);
}

[data-theme="light"] .news-impact-item {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .news-impact-item.is-complete {
    border-color: rgba(var(--color-positive-rgb), 0.3);
    background: linear-gradient(135deg, rgba(var(--color-positive-rgb), 0.12) 0%, rgba(255, 255, 255, 0.9) 100%);
}

[data-theme="light"] .news-impact-meta {
    color: rgba(15, 23, 42, 0.6);
}

[data-theme="light"] .news-impact-currency {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.25);
    color: #1d4ed8;
}

[data-theme="light"] .news-impact-status {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.25);
    color: #1d4ed8;
}

[data-theme="light"] .news-impact-status.is-complete {
    background: rgba(var(--color-positive-rgb), 0.12);
    border-color: rgba(var(--color-positive-rgb), 0.3);
    color: #047857;
}

[data-theme="light"] .news-impact-status.is-upcoming {
    background: rgba(148, 163, 184, 0.2);
    border-color: rgba(148, 163, 184, 0.35);
    color: #475569;
}

[data-theme="light"] .news-impact-time {
    color: rgba(15, 23, 42, 0.6);
}

[data-theme="light"] .news-impact-title {
    color: #0f172a;
}

[data-theme="light"] .news-impact-details {
    color: rgba(15, 23, 42, 0.7);
}

[data-theme="light"] .news-impact-empty {
    background: #f8f9fb;
    border-color: rgba(15, 23, 42, 0.1);
    color: rgba(15, 23, 42, 0.6);
}

/* Light theme premium modal */
[data-theme="light"] .premium-modal-overlay {
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(6px);
}

[data-theme="light"] .premium-modal-content {
    background: linear-gradient(145deg, #ffffff 0%, #f3f4f6 100%);
    color: #111111;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12),
        0 0 0 1px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .premium-modal-title {
    color: #111111;
    text-shadow: none;
}

[data-theme="light"] .premium-modal-message {
    color: rgba(0, 0, 0, 0.72);
}

[data-theme="light"] .premium-modal-icon {
    background: rgba(76, 175, 80, 0.12);
    border: 1px solid rgba(76, 175, 80, 0.2);
    box-shadow: 0 0 0 6px rgba(76, 175, 80, 0.08),
        0 0 18px rgba(76, 175, 80, 0.12);
}

[data-theme="light"] .premium-modal-icon svg {
    filter: drop-shadow(0 1px 4px rgba(76, 175, 80, 0.25));
}

/* Light theme AI analysis button */
[data-theme="light"] .ai-analysis-btn {
    color: #ffffff;
}

[data-theme="light"] .ai-analysis-btn::before {
    background: linear-gradient(135deg, #ff7a5c 0%, #ff5da9 45%, #7b61ff 100%);
    opacity: 1;
    filter: drop-shadow(0 6px 16px rgba(123, 97, 255, 0.35));
}

[data-theme="light"] .ai-analysis-btn::after {
    background: radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.15) 45%, rgba(255, 255, 255, 0) 70%);
}

[data-theme="light"] .ai-analysis-btn.is-visible {
    box-shadow: 0 12px 24px rgba(123, 97, 255, 0.25),
        0 8px 20px rgba(255, 122, 92, 0.2);
}

[data-theme="light"] .ai-analysis-btn:hover {
    box-shadow: 0 16px 28px rgba(123, 97, 255, 0.32),
        0 10px 22px rgba(255, 122, 92, 0.28);
}

[data-theme="light"] .ai-analysis-btn svg {
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.65));
}

[data-theme="light"] .ai-analysis-btn .credit-cost-badge {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

/* =================================================================
   P3-2: Advanced Chart Interactions
   ================================================================= */

.chart-interaction-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
    flex-wrap: wrap;
}

.chart-interaction-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.chart-interaction-btn svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* Floating placement over chart */
.chart-interaction-floating {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(12, 12, 12, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    z-index: var(--z-modal-popover);
    margin-left: 0;
}

.chart-interaction-floating .chart-interaction-btn {
    background: rgba(255, 255, 255, 0.06);
}

.chart-interaction-floating .chart-interaction-btn.active {
    background: rgba(251, 191, 36, 0.18);
}

.chart-interaction-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

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

.chart-interaction-btn.active {
    background: rgba(251, 191, 36, 0.15);
    border-color: #fbbf24;
    color: #fbbf24;
}

.chart-interaction-btn.active:hover {
    background: rgba(251, 191, 36, 0.2);
}

/* Chart interaction toast */
.chart-interaction-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    z-index: var(--z-modal-high);
    /* FIX: Use CSS custom property */
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-interaction-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.chart-interaction-toast.success {
    border-color: rgba(var(--color-positive-rgb), 0.5);
}

.chart-interaction-toast.error {
    border-color: rgba(var(--color-negative-rgb), 0.5);
}

.chart-interaction-toast.info {
    border-color: rgba(59, 130, 246, 0.5);
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 16px;
}

.chart-interaction-toast.success .toast-icon {
    color: var(--color-positive-muted);
}

.chart-interaction-toast.error .toast-icon {
    color: var(--color-negative);
}

.chart-interaction-toast.info .toast-icon {
    color: #3b82f6;
}

/* Crosshair cursor when in drawing mode */
#sessionChart {
    transition: cursor 0.2s ease;
}

/* Light theme overrides */
[data-theme="light"] .chart-interaction-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.8);
}

[data-theme="light"] .chart-interaction-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.2);
    color: #000;
}

[data-theme="light"] .chart-interaction-btn.active {
    background: rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
    color: #d97706;
}

[data-theme="light"] .chart-interaction-toast {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .chart-interaction-controls {
        gap: 6px;
    }

    .chart-interaction-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .chart-interaction-btn svg {
        width: 14px;
        height: 14px;
    }

    /* Hide text labels on mobile, show only icons */
    .chart-interaction-btn {
        font-size: 0;
    }

    .chart-interaction-btn svg {
        margin: 0;
    }
}

/* =================================================================
   P3-3: Customizable Dashboard Layouts
   ================================================================= */

.layout-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.layout-control-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.layout-control-btn svg {
    flex-shrink: 0;
}

.layout-control-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

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

.layout-control-btn.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #3b82f6;
}

.layout-control-btn.active:hover {
    background: rgba(59, 130, 246, 0.2);
}

/* View modes */
#sessionSlider.view-focus .info-cards-container {
    display: none !important;
}

#sessionSlider.view-focus .session-chart {
    height: calc(100vh - 200px) !important;
    min-height: 600px;
}

#sessionSlider.view-compact .info-cards-container {
    gap: 12px;
}

#sessionSlider.view-compact .session-selected,
#sessionSlider.view-compact .session-timeline-card {
    padding: 12px;
}

/* Layout toast notifications */
.layout-toast {
    position: fixed;
    bottom: 80px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateX(100px);
    z-index: var(--z-modal-high);
    /* FIX: Use CSS custom property */
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.layout-toast.visible {
    opacity: 1;
    transform: translateX(0);
}

.layout-toast.success {
    border-color: rgba(var(--color-positive-rgb), 0.5);
}

.layout-toast.error {
    border-color: rgba(var(--color-negative-rgb), 0.5);
}

.layout-toast.info {
    border-color: rgba(59, 130, 246, 0.5);
}

.layout-toast .toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 16px;
}

.layout-toast.success .toast-icon {
    color: var(--color-positive-muted);
}

.layout-toast.error .toast-icon {
    color: var(--color-negative);
}

.layout-toast.info .toast-icon {
    color: #3b82f6;
}

/* Light theme overrides */
[data-theme="light"] .layout-controls {
    border-left-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .layout-control-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.8);
}

[data-theme="light"] .layout-control-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.2);
    color: #000;
}

[data-theme="light"] .layout-control-btn.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #2563eb;
}

[data-theme="light"] .layout-toast {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .layout-controls {
        gap: 6px;
        margin-left: 8px;
        padding-left: 8px;
    }

    .layout-control-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .layout-control-btn svg {
        width: 14px;
        height: 14px;
    }

    /* Hide text labels on mobile, show only icons */
    .layout-control-btn .btn-label {
        display: none;
    }

    #sessionSlider.view-focus .session-chart {
        height: calc(100vh - 150px) !important;
        min-height: 400px;
    }
}

/* =================================================================
   P3-4: Watchlist/Favorites System
   ================================================================= */

/* Watchlist controls in header */
.watchlist-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: 16px;
}

.watchlist-control-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
}

.watchlist-control-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.watchlist-control-btn.active {
    background: rgba(251, 191, 36, 0.15);
    border-color: #fbbf24;
    color: #fbbf24;
}

.watchlist-control-btn.active svg {
    fill: #fbbf24;
}

.watchlist-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    background: #fbbf24;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Favorite button in breadcrumb */
.favorite-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
}

.favorite-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: scale(1.05);
}

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

.favorite-btn.favorited {
    background: rgba(251, 191, 36, 0.15);
    border-color: #fbbf24;
    color: #fbbf24;
}

.favorite-btn.favorited:hover {
    background: rgba(251, 191, 36, 0.25);
}

.favorite-btn svg {
    transition: transform 0.2s ease;
}

.favorite-btn:hover svg {
    transform: scale(1.1);
}

/* Watchlist panel */
.watchlist-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    z-index: var(--z-modal-high);
    /* FIX: Use CSS custom property */
    transition: opacity 0.3s ease;
}

.watchlist-panel.visible {
    opacity: 1;
    pointer-events: all;
}

.watchlist-panel-content {
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    background: #242424;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.watchlist-panel.visible .watchlist-panel-content {
    transform: scale(1);
}

.watchlist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.watchlist-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.watchlist-title svg {
    color: #fbbf24;
}

.watchlist-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
}

.watchlist-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.watchlist-items {
    padding: 16px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

.watchlist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.watchlist-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

.watchlist-item:last-child {
    margin-bottom: 0;
}

.watchlist-item-symbol {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.watchlist-item-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s ease;
}

.watchlist-item-remove:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    transform: scale(1.1);
}

.watchlist-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

.watchlist-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.watchlist-empty p {
    margin: 8px 0;
    font-size: 16px;
}

.watchlist-empty-hint {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
}

/* Watchlist toast notifications */
.watchlist-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    z-index: var(--z-modal-high);
    /* FIX: Use CSS custom property */
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.watchlist-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.watchlist-toast.success {
    border-color: rgba(16, 185, 129, 0.5);
}

.watchlist-toast.error {
    border-color: rgba(var(--color-negative-rgb), 0.5);
}

.watchlist-toast.info {
    border-color: rgba(59, 130, 246, 0.5);
}

.watchlist-toast .toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 16px;
}

.watchlist-toast.success .toast-icon {
    color: var(--color-positive-muted);
}

.watchlist-toast.error .toast-icon {
    color: var(--color-negative);
}

.watchlist-toast.info .toast-icon {
    color: #3b82f6;
}

/* Light theme overrides */
[data-theme="light"] .watchlist-control-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.8);
}

[data-theme="light"] .watchlist-control-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.2);
    color: #000;
}

[data-theme="light"] .favorite-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .watchlist-panel-content {
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .watchlist-item {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .watchlist-item:hover {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .watchlist-toast {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .watchlist-controls {
        margin-left: 12px;
        gap: 6px;
    }

    .watchlist-control-btn {
        padding: 8px;
    }

    .watchlist-panel-content {
        width: 95%;
        max-height: 90vh;
    }

    .favorite-btn {
        width: 32px;
        height: 32px;
        margin-left: 8px;
    }
}

/* =================================================================
   P3-5: Price Alerts & Notifications
   ================================================================= */

/* Alert control button */
.alert-control-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: visible;
    /* FIX: Prevent badge from being cropped */
}

.alert-control-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.alert-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    background: #ef4444;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    border: 2px solid var(--bg-header, #1a1a2e);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.alert-count--pending {
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

/* Set alert button */
.set-alert-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
}

.set-alert-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #3b82f6;
    transform: scale(1.05);
}

/* Alert dialog */
.alert-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    z-index: var(--z-modal-high);
    /* FIX: Use CSS custom property */
    transition: opacity 0.3s ease;
}

.alert-dialog-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.alert-dialog {
    width: 90%;
    max-width: 450px;
    background: #242424;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.alert-dialog-overlay.visible .alert-dialog {
    transform: scale(1);
}

.alert-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.alert-dialog-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.alert-dialog-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
}

.alert-dialog-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.alert-dialog-content {
    padding: 24px;
}

.alert-symbol-info {
    text-align: center;
    margin-bottom: 24px;
}

.alert-symbol {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.alert-current-price {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.alert-form-group {
    margin-bottom: 20px;
}

.alert-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.alert-type-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.alert-type-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alert-type-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.alert-type-btn.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #3b82f6;
}

.alert-price-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    transition: all 0.2s ease;
}

.alert-price-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.alert-form-group label input[type="checkbox"] {
    margin-right: 8px;
}

.alert-dialog-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.alert-btn-cancel,
.alert-btn-create {
    flex: 1;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alert-btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.alert-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.08);
}

.alert-btn-create {
    background: #3b82f6;
    border: 1px solid #3b82f6;
    color: #fff;
}

.alert-btn-create:hover {
    background: #2563eb;
}

/* Alerts panel */
.alerts-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    background: transparent;
    backdrop-filter: none;
    display: block;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    z-index: var(--z-modal-high);
    /* FIX: Use CSS custom property */
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.alerts-panel.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.alerts-panel-content {
    width: 420px;
    max-width: 88vw;
    max-height: 70vh;
    /* Premium glassmorphism styling */
    background: linear-gradient(145deg, rgba(20, 24, 36, 0.98), rgba(12, 14, 22, 0.95));
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 16px;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.6),
        0 8px 24px rgba(59, 130, 246, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.alerts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.08), transparent);
}

.alerts-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.alerts-title svg {
    color: #60a5fa;
    filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.5));
}

.alerts-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.alerts-export {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alerts-export:hover {
    background: rgba(14, 165, 233, 0.2);
    border-color: rgba(14, 165, 233, 0.5);
    color: #38bdf8;
}

.alerts-export svg {
    flex-shrink: 0;
}

.alerts-clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fecaca;
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.58), rgba(185, 28, 28, 0.34));
    border: 1px solid rgba(248, 113, 113, 0.5);
    border-radius: 8px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 4px 14px rgba(220, 38, 38, 0.22);
    cursor: pointer;
    transition: all 0.2s ease;
}

.alerts-clear:hover {
    background: linear-gradient(135deg, rgba(185, 28, 28, 0.8), rgba(220, 38, 38, 0.55));
    border-color: rgba(252, 165, 165, 0.65);
    color: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 8px 20px rgba(220, 38, 38, 0.32);
}

.alerts-clear:disabled {
    cursor: wait;
    opacity: 0.85;
}

.alerts-clear-icon {
    flex-shrink: 0;
}

.alerts-clear.is-loading {
    pointer-events: none;
}

.alerts-clear-spinner {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.28);
    border-top-color: rgba(255, 255, 255, 0.95);
    animation: alerts-clear-spin 0.8s linear infinite;
}

@keyframes alerts-clear-spin {
    to {
        transform: rotate(360deg);
    }
}

.alerts-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
}

.alerts-close:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.alerts-items {
    padding: 16px;
    overflow-y: auto;
    max-height: calc(70vh - 72px);
}

.alert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    margin-bottom: 12px;
    /* Premium card styling */
    background: linear-gradient(135deg, rgba(30, 35, 50, 0.8), rgba(20, 24, 35, 0.9));
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 12px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.alert-item:hover {
    background: linear-gradient(135deg, rgba(40, 50, 70, 0.9), rgba(30, 35, 50, 0.95));
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15), 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.alert-item:last-child {
    margin-bottom: 0;
}

.alert-item-info {
    flex: 1;
}

.alert-item-symbol {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.alert-item-details {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.alerts-section {
    margin-bottom: 16px;
}

.alerts-section:last-child {
    margin-bottom: 0;
}

.alerts-section-title {
    margin: 4px 4px 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

.alert-item-direction {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
}

.alert-item-direction.long {
    background: var(--color-positive-muted);
}

.alert-item-direction.short {
    background: var(--color-negative);
}

.alert-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.alert-item-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.alert-item-title .alert-item-symbol {
    margin-bottom: 0;
}

.alert-item-header-tags {
    display: flex;
    align-items: center;
    gap: 6px;
}

.alert-item-badge {
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ff6b35, #ff5722);
    color: #fff;
    border-radius: 4px;
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.alert-item-summary {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 4px;
    line-height: 1.4;
}

/* Price change color styling - green for positive, red for negative */
.alert-price-change {
    font-weight: 600;
}

.alert-price-change.positive {
    color: var(--color-positive-muted);
}

.alert-price-change.negative {
    color: var(--color-negative);
}

.alert-item-type {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.alert-item-type.above {
    background: rgba(var(--color-positive-muted-rgb), 0.15);
    color: var(--color-positive-muted);
}

.alert-item-type.below {
    background: rgba(var(--color-negative-rgb), 0.15);
    color: var(--color-negative);
}

.alert-item-type.tier {
    background: rgba(59, 130, 246, 0.18);
    color: #60a5fa;
}

.alert-item-type.tier-s {
    background: rgba(var(--color-positive-muted-rgb), 0.18);
    color: var(--color-positive-muted);
}

.alert-item-type.tier-a {
    background: rgba(59, 130, 246, 0.18);
    color: #60a5fa;
}

.alert-item-type.tier-b {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.alert-item-type.tier-c {
    background: rgba(var(--color-negative-rgb), 0.2);
    color: var(--color-negative);
}

.alert-item-type.abnormal {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.2), rgba(251, 191, 36, 0.15));
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.mi-notification-item {
    border-left: 3px solid #8b5cf6;
}

.mi-notification-item .alert-item-message {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 4px;
    line-height: 1.4;
}

.mi-type-strategy_signal {
    background: rgba(var(--color-positive-muted-rgb), 0.18);
    color: var(--color-positive-muted);
}

.mi-type-tier_alert {
    background: rgba(59, 130, 246, 0.18);
    color: #60a5fa;
}

.mi-type-regime_change {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.mi-type-csi_divergence {
    background: rgba(139, 92, 246, 0.18);
    color: #a78bfa;
}

.mi-type-attractive_pair {
    background: rgba(var(--color-positive-muted-rgb), 0.18);
    color: var(--color-positive-muted);
}

.mi-type-volatility_spike {
    background: rgba(var(--color-negative-rgb), 0.2);
    color: var(--color-negative);
}

.mi-type-market_condition {
    background: rgba(59, 130, 246, 0.18);
    color: #60a5fa;
}

.mi-notifications-section .alerts-section-title {
    color: #a78bfa;
}

.alert-item-price {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.alert-item-created {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.alert-item-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(var(--color-negative-rgb), 0.1);
    border: 1px solid rgba(var(--color-negative-rgb), 0.3);
    border-radius: 8px;
    color: var(--color-negative);
    cursor: pointer;
    transition: all 0.2s ease;
}

.alert-item-delete:hover {
    background: rgba(var(--color-negative-rgb), 0.2);
    border-color: var(--color-negative);
    transform: scale(1.1);
}

.alerts-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

.alerts-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.alerts-empty-icon .premium-icon {
    width: 56px;
    height: 56px;
    color: rgba(245, 210, 125, 0.65);
}

.alert-notification-icon .premium-icon {
    width: 24px;
    height: 24px;
    color: #f5d27d;
}

.alerts-empty p {
    margin: 8px 0;
    font-size: 16px;
}

.alerts-empty-hint {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
}

/* Premium filter tabs for alerts panel */
.alerts-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 12px 0;
    margin-bottom: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.alerts-tabs::-webkit-scrollbar {
    height: 4px;
}

.alerts-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.alerts-tabs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.alerts-tabs::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.alerts-tab {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.alerts-tab:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: rgba(255, 255, 255, 0.85);
}

.alerts-tab.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.15));
    border-color: rgba(59, 130, 246, 0.5);
    color: #60a5fa;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.alerts-empty-mini {
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

/* Alert notification */
.alert-notification {
    position: fixed;
    right: 20px;
    width: 350px;
    background: #242424;
    border: 2px solid #3b82f6;
    border-radius: 12px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateX(400px);
    z-index: var(--z-modal-high);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.alert-notification.visible {
    opacity: 1;
    transform: translateX(0);
}

.alert-notification-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
}

.alert-notification-icon {
    font-size: 32px;
    line-height: 1;
}

.alert-notification-info {
    flex: 1;
}

.alert-notification-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.alert-notification-details {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.alert-notification-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
}

.alert-notification-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.alert-toast-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    z-index: var(--z-modal-high);
    pointer-events: none;
}

.alert-toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.alert-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.alert-toast.success {
    border-color: rgba(16, 185, 129, 0.5);
}

.alert-toast.error {
    border-color: rgba(var(--color-negative-rgb), 0.5);
}

.alert-toast.info {
    border-color: rgba(59, 130, 246, 0.5);
}

.alert-toast .toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 16px;
}

.alert-toast.success .toast-icon {
    color: var(--color-positive-muted);
}

.alert-toast.error .toast-icon {
    color: var(--color-negative);
}

.alert-toast.info .toast-icon {
    color: #3b82f6;
}

/* Light theme overrides - Premium light styling */
[data-theme="light"] .alert-dialog,
[data-theme="light"] .alert-notification {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .alerts-empty-icon .premium-icon {
    color: #d97706;
}

[data-theme="light"] .alert-notification-icon .premium-icon {
    color: #b45309;
}

[data-theme="light"] .alert-control-btn,
[data-theme="light"] .set-alert-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.8);
}

[data-theme="light"] .alert-toast {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

[data-theme="light"] .alerts-panel-content {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(217, 119, 6, 0.2);
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.1),
        0 8px 24px rgba(217, 119, 6, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .alerts-header {
    border-bottom: 1px solid rgba(217, 119, 6, 0.15);
    background: linear-gradient(180deg, rgba(217, 119, 6, 0.06), transparent);
}

[data-theme="light"] .alerts-title {
    color: #1e293b;
}

[data-theme="light"] .alerts-title svg {
    color: #d97706;
    filter: drop-shadow(0 0 6px rgba(217, 119, 6, 0.3));
}

[data-theme="light"] .alerts-export {
    color: #0369a1;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.25);
}

[data-theme="light"] .alerts-export:hover {
    background: rgba(14, 165, 233, 0.18);
    border-color: rgba(14, 165, 233, 0.4);
    color: #0284c7;
}

[data-theme="light"] .alerts-clear {
    color: #7f1d1d;
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.95), rgba(254, 202, 202, 0.8));
    border: 1px solid rgba(248, 113, 113, 0.5);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 4px 12px rgba(239, 68, 68, 0.15);
}

[data-theme="light"] .alerts-clear:hover {
    background: linear-gradient(135deg, rgba(254, 202, 202, 0.98), rgba(252, 165, 165, 0.88));
    border-color: rgba(239, 68, 68, 0.55);
    color: #7f1d1d;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 6px 16px rgba(239, 68, 68, 0.22);
}

[data-theme="light"] .alerts-close {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #64748b;
}

[data-theme="light"] .alerts-close:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.15);
    color: #1e293b;
}

[data-theme="light"] .alerts-section-title {
    color: #64748b;
}

[data-theme="light"] .alerts-tabs {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 10px;
    padding: 4px;
}

[data-theme="light"] .alerts-tab {
    background: transparent;
    border: 1px solid transparent;
    color: #64748b;
}

[data-theme="light"] .alerts-tab:hover {
    background: rgba(217, 119, 6, 0.08);
    color: #b45309;
}

[data-theme="light"] .alerts-tab.active {
    background: linear-gradient(135deg, #fff, #fffbeb);
    border-color: rgba(217, 119, 6, 0.25);
    color: #b45309;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.12);
}

[data-theme="light"] .alert-item {
    background: linear-gradient(135deg, #ffffff, #fafafa);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .alert-item:hover {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-color: rgba(217, 119, 6, 0.25);
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.1);
    transform: translateY(-1px);
}

[data-theme="light"] .alert-item-symbol {
    color: #1e293b;
}

[data-theme="light"] .alert-item-price {
    color: #334155;
}

[data-theme="light"] .alert-item-summary {
    color: #475569;
}

[data-theme="light"] .alert-item-created {
    color: #94a3b8;
}

[data-theme="light"] .alert-item-type.abnormal {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border: 1px solid rgba(217, 119, 6, 0.3);
}

[data-theme="light"] .alert-item-delete {
    background: rgba(220, 38, 38, 0.06);
    border: 1px solid rgba(220, 38, 38, 0.15);
    color: #dc2626;
}

[data-theme="light"] .alert-item-delete:hover {
    background: rgba(220, 38, 38, 0.12);
    border-color: rgba(220, 38, 38, 0.3);
}

[data-theme="light"] .alerts-empty,
[data-theme="light"] .alerts-empty-mini {
    color: #94a3b8;
}

[data-theme="light"] .alerts-empty-hint {
    color: #cbd5e1;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .alert-notification {
        width: calc(100% - 40px);
        right: 20px;
    }

    .alert-dialog,
    .alerts-panel-content {
        width: calc(100vw - 24px);
        max-width: 480px;
    }

    .set-alert-btn {
        width: 32px;
        height: 32px;
        margin-left: 6px;
    }
}

/* =================================================================
   P2-5: Settings Search
   ================================================================= */

.settings-search-container {
    display: flex;
    align-items: center;
    position: relative;
    margin-bottom: 36px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    z-index: 1;
}

.settings-search-input {
    flex: 1;
    padding: 12px 44px 12px 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    transition: all 0.2s ease;
    min-width: 0;
}

.settings-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.settings-search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
}

.settings-search-clear {
    position: absolute;
    right: 12px;
    top: 0;
    bottom: 0;
    margin: auto;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(100, 100, 100, 0.5);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
    z-index: 10;
    transform: none;
}

.settings-search-clear:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* Settings section filtering */
.settings-section.filtered-out {
    display: none;
}

.settings-section.filtered-match {
    animation: highlightMatch 0.3s ease;
}

@keyframes highlightMatch {
    0% {
        background: rgba(251, 191, 36, 0.1);
    }

    100% {
        background: transparent;
    }
}

.settings-tab-content.filtered-out {
    display: none !important;
}

/* No results message for settings */
.settings-no-results {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.settings-no-results-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.settings-no-results-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
}

.settings-no-results-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

/* Tab highlighting when search matches */
.settings-tabs button.has-match {
    position: relative;
}

.settings-tabs button.has-match::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    background: #fbbf24;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

@media (max-width: 600px) {
    .settings-search-container {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .settings-search-input {
        padding: 10px 40px;
        font-size: 16px;
    }
}

/* =================================================================
   P3-6: Chart Comparison Mode
   ================================================================= */

/* Comparison control button */
.comparison-control-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: visible;
}

.comparison-control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.comparison-control-btn.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.comparison-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3b82f6;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    padding: 0 5px;
    z-index: 1;
}

/* Comparison overlay */
.comparison-overlay {
    position: fixed;
    inset: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: var(--z-modal-high);
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 0;
}

.comparison-overlay.visible {
    opacity: 1;
    pointer-events: none;
}

.comparison-overlay.closing {
    opacity: 0;
    pointer-events: none;
}

.comparison-overlay.docked {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: none;
    padding: 0;
}

.comparison-overlay.docked .comparison-panel {
    pointer-events: auto;
}

body.comparison-open:not(.comparison-docked) .session-slider {
    z-index: var(--z-modal-backdrop) !important;
}

/* Comparison panel */
.comparison-panel {
    position: fixed;
    top: calc(var(--header-height, 80px) + 4px);
    right: 16px;
    width: 340px;
    max-width: 340px;
    max-height: calc(100vh - var(--header-height, 80px) - 4px);
    background: #1a1a1a;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.comparison-overlay.closing .comparison-panel {
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.comparison-overlay.visible .comparison-panel {
    transform: translateX(0);
}

/* Comparison header */
.comparison-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comparison-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.comparison-title svg {
    color: #3b82f6;
}

.comparison-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
}

.comparison-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Comparison description */
.comparison-description {
    padding: 12px 20px;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(59, 130, 246, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.comparison-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* Comparison search */
.comparison-search-container {
    position: relative;
    padding: 16px 20px 0;
}

.comparison-search-icon {
    position: absolute;
    left: 34px;
    top: 28px;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

.comparison-search-input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    transition: all 0.2s ease;
}

.comparison-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.comparison-search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Comparison search results */
.comparison-search-results {
    margin: 10px 20px 0;
    max-height: 180px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px;
}

.comparison-search-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.comparison-search-result:hover:not(.added) {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.comparison-search-result.added {
    opacity: 0.5;
    cursor: not-allowed;
}

.result-symbol {
    font-weight: 500;
}

.result-added-badge {
    padding: 4px 8px;
    background: rgba(var(--color-positive-muted-rgb), 0.15);
    border-radius: 6px;
    color: var(--color-positive-muted);
    font-size: 11px;
    font-weight: 600;
}

.comparison-no-results {
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

/* Comparison pairs list */
.comparison-pairs-list {
    flex: 1;
    padding: 16px 20px;
    overflow-y: auto;
    min-height: 180px;
}

.comparison-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
    text-align: center;
}

.comparison-empty-state svg {
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 16px;
}

.comparison-empty-state p {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
}

.empty-state-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

/* Comparison pair item */
.comparison-pair-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.comparison-pair-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.comparison-pair-color {
    width: 4px;
    height: 32px;
    border-radius: 2px;
}

.comparison-pair-symbol {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.comparison-pair-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s ease;
}

.comparison-pair-remove:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Comparison actions */
.comparison-actions {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.comparison-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.comparison-action-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.comparison-action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.comparison-action-btn.primary {
    background: #3b82f6;
    border: 1px solid #3b82f6;
    color: #fff;
}

.comparison-action-btn.primary:hover {
    background: #2563eb;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Comparison legend on chart */
.comparison-legend {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.comparison-legend-title {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comparison-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-color {
    width: 3px;
    height: 16px;
    border-radius: 2px;
}

.legend-symbol {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.comparison-legend-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: 8px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s ease;
}

.comparison-legend-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Comparison toast notifications */
.comparison-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: var(--z-modal-high);
    /* FIX: Use CSS custom property */
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.comparison-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.comparison-toast.success {
    border-color: rgba(16, 185, 129, 0.3);
}

.comparison-toast.error {
    border-color: rgba(var(--color-negative-rgb), 0.3);
}

.comparison-toast.info {
    border-color: rgba(59, 130, 246, 0.3);
}

.comparison-toast .toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

.comparison-toast.success .toast-icon {
    background: rgba(var(--color-positive-muted-rgb), 0.2);
    color: var(--color-positive-muted);
}

.comparison-toast.error .toast-icon {
    background: rgba(var(--color-negative-rgb), 0.2);
    color: var(--color-negative);
}

.comparison-toast.info .toast-icon {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

/* Light theme adjustments */
[data-theme="light"] .comparison-control-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

[data-theme="light"] .comparison-control-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .comparison-panel {
    background: #ffffff;
}

[data-theme="light"] .comparison-header {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .comparison-title {
    color: #1a1a1a;
}

[data-theme="light"] .comparison-close {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .comparison-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

[data-theme="light"] .comparison-description {
    color: rgba(0, 0, 0, 0.7);
    background: rgba(59, 130, 246, 0.05);
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .comparison-hint {
    color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .comparison-search-icon {
    color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .comparison-search-input {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

[data-theme="light"] .comparison-search-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .comparison-search-input:focus {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .comparison-search-results {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .comparison-search-result {
    color: #1a1a1a;
}

[data-theme="light"] .comparison-search-result:hover:not(.added) {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .comparison-no-results {
    color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .comparison-empty-state svg {
    color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .comparison-empty-state p {
    color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .empty-state-hint {
    color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .comparison-pair-item {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .comparison-pair-item:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .comparison-pair-symbol {
    color: #1a1a1a;
}

[data-theme="light"] .comparison-actions {
    border-top-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .comparison-action-btn.secondary {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.7);
}

[data-theme="light"] .comparison-action-btn.secondary:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

[data-theme="light"] .comparison-legend {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .comparison-legend-title {
    color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .legend-symbol {
    color: #1a1a1a;
}

[data-theme="light"] .comparison-toast {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .comparison-panel {
        width: 95%;
        max-height: 90vh;
    }

    .comparison-header {
        padding: 16px 20px;
    }

    .comparison-title {
        font-size: 16px;
    }

    .comparison-description {
        padding: 14px 20px;
        font-size: 13px;
    }

    .comparison-search-container {
        padding: 16px 20px 0;
    }

    .comparison-pairs-list {
        padding: 16px 20px;
    }

    .comparison-actions {
        padding: 16px 20px;
        flex-direction: column;
    }

    .comparison-legend {
        flex-wrap: wrap;
        gap: 8px;
        max-width: calc(100% - 32px);
    }

    .comparison-toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        font-size: 13px;
    }
}

/* =================================================================
   P3-7: Preferences Manager (Export/Import)
   ================================================================= */

/* Preferences action buttons in settings */
.preferences-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.preferences-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preferences-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.preferences-action-btn svg {
    flex-shrink: 0;
}

/* Preferences overlay */
.preferences-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal-high);
    /* FIX: Use CSS custom property */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.preferences-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

/* Preferences panel */
.preferences-panel {
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    background: #1a1a1a;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.preferences-overlay.visible .preferences-panel {
    transform: scale(1);
}

/* Preferences header */
.preferences-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.preferences-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.preferences-title svg {
    color: #3b82f6;
}

.preferences-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
}

.preferences-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Preferences content */
.preferences-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* Preferences info */
.preferences-info {
    text-align: center;
    padding: 20px;
    margin-bottom: 24px;
}

.preferences-info svg {
    color: rgba(59, 130, 246, 0.5);
    margin-bottom: 16px;
}

.preferences-info h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.preferences-info p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.6);
}

/* Preferences summary */
.preferences-summary {
    margin-bottom: 24px;
}

.preferences-summary h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preferences-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.summary-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.summary-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.summary-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.summary-value {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

/* Preferences action cards */
.preferences-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.preferences-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.preferences-action-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.preferences-action-card.export:hover {
    border-color: rgba(16, 185, 129, 0.4);
}

.preferences-action-card.import:hover {
    border-color: rgba(59, 130, 246, 0.4);
}

.action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

.preferences-action-card.export .action-icon {
    background: rgba(var(--color-positive-muted-rgb), 0.1);
    color: var(--color-positive-muted);
}

.preferences-action-card.import .action-icon {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.preferences-action-card:hover .action-icon {
    transform: scale(1.1);
}

.action-content h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.action-content p {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

/* Preferences warning */
.preferences-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
    color: rgba(245, 158, 11, 0.9);
}

.preferences-warning svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #f59e0b;
}

/* Import success dialog */
.import-success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: var(--z-modal-high);
    /* FIX: Use CSS custom property */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.import-success-overlay.visible {
    opacity: 1;
}

.import-success-dialog {
    width: 90%;
    max-width: 400px;
    padding: 40px 32px;
    background: #1a1a1a;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.import-success-overlay.visible .import-success-dialog {
    transform: scale(1);
}

.import-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    width: 96px;
    height: 96px;
    background: rgba(var(--color-positive-muted-rgb), 0.1);
    border-radius: 50%;
    color: var(--color-positive-muted);
}

.import-success-dialog h3 {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.import-success-dialog p {
    margin: 0 0 24px 0;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.6);
}

.import-success-btn {
    width: 100%;
    padding: 14px 24px;
    background: #10b981;
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.import-success-btn:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Preferences toast */
.preferences-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: var(--z-modal-high);
    /* FIX: Use CSS custom property */
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.preferences-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.preferences-toast.success {
    border-color: rgba(16, 185, 129, 0.3);
}

.preferences-toast.error {
    border-color: rgba(var(--color-negative-rgb), 0.3);
}

.preferences-toast.info {
    border-color: rgba(59, 130, 246, 0.3);
}

.preferences-toast .toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

.preferences-toast.success .toast-icon {
    background: rgba(var(--color-positive-muted-rgb), 0.2);
    color: var(--color-positive-muted);
}

.preferences-toast.error .toast-icon {
    background: rgba(var(--color-negative-rgb), 0.2);
    color: var(--color-negative);
}

.preferences-toast.info .toast-icon {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

/* Light theme adjustments */
[data-theme="light"] .preferences-action-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

[data-theme="light"] .preferences-action-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .preferences-panel {
    background: #ffffff;
}

[data-theme="light"] .preferences-header {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .preferences-title {
    color: #1a1a1a;
}

[data-theme="light"] .preferences-close {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .preferences-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

[data-theme="light"] .preferences-info h4 {
    color: #1a1a1a;
}

[data-theme="light"] .preferences-info p {
    color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .preferences-summary h5 {
    color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .summary-item {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .summary-label {
    color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .summary-value {
    color: #1a1a1a;
}

[data-theme="light"] .preferences-action-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .preferences-action-card:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .action-icon {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.7);
}

[data-theme="light"] .action-content h4 {
    color: #1a1a1a;
}

[data-theme="light"] .action-content p {
    color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .import-success-dialog {
    background: #ffffff;
}

[data-theme="light"] .import-success-dialog h3 {
    color: #1a1a1a;
}

[data-theme="light"] .import-success-dialog p {
    color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .preferences-toast {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .preferences-actions {
        flex-direction: column;
    }

    .preferences-panel {
        width: 95%;
        max-height: 90vh;
    }

    .preferences-header {
        padding: 20px;
    }

    .preferences-title {
        font-size: 18px;
    }

    .preferences-content {
        padding: 20px;
    }

    .preferences-summary-grid {
        grid-template-columns: 1fr;
    }

    .preferences-actions-grid {
        grid-template-columns: 1fr;
    }

    .import-success-dialog {
        padding: 32px 24px;
    }

    .preferences-toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        font-size: 13px;
    }
}

/* =================================================================
   P3-8: Enhanced Tooltips
   ================================================================= */

/* Tooltip container */
.enhanced-tooltip-container {
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-tooltip);
    /* FIX BUG-012: 100000 ? 4000 (tooltip layer) */
    pointer-events: none;
}

/* Enhanced tooltip */
.enhanced-tooltip {
    position: absolute;
    min-width: 120px;
    max-width: 280px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 1px rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    /* FIX: Add word-wrap for long content */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.enhanced-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.enhanced-tooltip.below {
    transform: translateY(4px);
}

.enhanced-tooltip.below.visible {
    transform: translateY(0);
}

/* Tooltip icon */
.tooltip-icon {
    font-size: 20px;
    margin-bottom: 8px;
    text-align: center;
}

/* Tooltip title */
.tooltip-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    line-height: 1.3;
}

/* Tooltip description */
.tooltip-description {
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

/* Tooltip only has title (no description) */
/* FIX: Replaced :not(:has()) with class-based approach for better browser compatibility */
.enhanced-tooltip.no-description .tooltip-title {
    margin-bottom: 0;
}

/* Tooltip footer */
.tooltip-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Tooltip shortcut */
.tooltip-shortcut {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
}

.tooltip-shortcut kbd {
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    font-size: 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', monospace;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Tooltip badge */
.tooltip-badge {
    padding: 3px 8px;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    color: #3b82f6;
    white-space: nowrap;
}

/* Tooltip arrow (optional, for future enhancement) */
.enhanced-tooltip::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(0, 0, 0, 0.95);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.enhanced-tooltip.below::before {
    bottom: auto;
    top: -6px;
    border-top: none;
    border-bottom: 6px solid rgba(0, 0, 0, 0.95);
}

/* Hide native tooltips */
[data-tooltip],
[data-original-title] {
    position: relative;
}

/* Light theme adjustments */
[data-theme="light"] .enhanced-tooltip {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .tooltip-title {
    color: #1a1a1a;
}

[data-theme="light"] .tooltip-description {
    color: rgba(0, 0, 0, 0.7);
}

[data-theme="light"] .tooltip-footer {
    border-top-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .tooltip-shortcut kbd {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.9);
}

[data-theme="light"] .enhanced-tooltip::before {
    border-top-color: rgba(255, 255, 255, 0.98);
}

[data-theme="light"] .enhanced-tooltip.below::before {
    border-bottom-color: rgba(255, 255, 255, 0.98);
}

/* Accessibility: Reduce motion */
@media (prefers-reduced-motion: reduce) {
    .enhanced-tooltip {
        transition: opacity 0.1s ease;
        transform: none !important;
    }
}

/* Mobile: Disable tooltips on touch devices */
@media (hover: none) and (pointer: coarse) {
    .enhanced-tooltip-container {
        display: none;
    }
}

/* Special tooltip variants */

/* Success tooltip */
.enhanced-tooltip.success .tooltip-title {
    color: var(--color-positive-muted);
}

.enhanced-tooltip.success {
    border-color: rgba(var(--color-positive-muted-rgb), 0.3);
}

/* Warning tooltip */
.enhanced-tooltip.warning .tooltip-title {
    color: #f59e0b;
}

.enhanced-tooltip.warning {
    border-color: rgba(245, 158, 11, 0.3);
}

/* Error tooltip */
.enhanced-tooltip.error .tooltip-title {
    color: var(--color-negative);
}

.enhanced-tooltip.error {
    border-color: rgba(var(--color-negative-rgb), 0.3);
}

/* Info tooltip (default - blue accent) */
.enhanced-tooltip.info .tooltip-title {
    color: #3b82f6;
}

.enhanced-tooltip.info {
    border-color: rgba(59, 130, 246, 0.3);
}

/* Tooltip with icon alignment */
/* FIX: Replaced :has() with class-based approach for better browser compatibility */
.enhanced-tooltip.has-icon {
    text-align: center;
}

.enhanced-tooltip.has-icon .tooltip-title,
.enhanced-tooltip.has-icon .tooltip-description {
    text-align: left;
}

/* Compact tooltip (title only) */
/* FIX: Replaced :not(:has()) with class-based approach */
.enhanced-tooltip.compact {
    padding: 8px 12px;
}

/* Animation variants */
@keyframes tooltip-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

.enhanced-tooltip.pulse {
    animation: tooltip-pulse 2s ease-in-out infinite;
}

/* Z-index management for stacked tooltips */
.enhanced-tooltip {
    z-index: var(--z-tooltip);
    /* FIX: Use CSS custom property instead of hardcoded 100000 */
}

/* Ensure tooltips are above all other elements */
.enhanced-tooltip-container {
    z-index: var(--z-tooltip);
    /* FIX: Use CSS custom property instead of hardcoded 100000 */
}

/* Prevent tooltip from blocking pointer events */
.enhanced-tooltip,
.enhanced-tooltip * {
    pointer-events: none;
}

/* =================================================================
   P3-9: Micro-interactions Polish
   ================================================================= */

/* Ripple effect */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    transform: scale(0);
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    to {
        transform: scale(2);
        opacity: 0;
    }
}

/* Button press animation */
.button-pressed {
    transform: scale(0.96);
    transition: transform 0.1s ease;
}

button,
.btn {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:active,
.btn:active {
    transform: scale(0.97);
}

/* Keyboard focus enhancement */
.keyboard-focus {
    outline: 2px solid #fbbf24 !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.2) !important;
}

/* Avoid confusing golden outline on timeframe buttons.
   Their active state already has a strong visual style. */
.timeframe-btn.keyboard-focus,
.chart-tf-btn.keyboard-focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Success pulse animation */
.success-pulse {
    animation: success-pulse 0.6s ease;
}

@keyframes success-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
    }
}

/* Success checkmark */
.success-checkmark {
    position: fixed;
    z-index: var(--z-notification);
    /* FIX: Use CSS custom property instead of hardcoded 100001 */
    width: 80px;
    height: 80px;
    margin-left: -40px;
    margin-top: -40px;
    pointer-events: none;
    animation: success-checkmark-fade 1.2s ease;
}

.success-checkmark-svg {
    width: 80px;
    height: 80px;
}

.success-checkmark-circle {
    stroke: var(--color-positive-muted);
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: success-checkmark-circle 0.6s ease forwards;
}

.success-checkmark-check {
    stroke: var(--color-positive-muted);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: success-checkmark-check 0.4s 0.4s ease forwards;
}

@keyframes success-checkmark-circle {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes success-checkmark-check {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes success-checkmark-fade {

    0%,
    80% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

/* Shake animation */
.shake-animation {
    animation: shake 0.5s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-8px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(8px);
    }
}

/* Bounce animation */
.bounce-animation {
    animation: bounce 0.6s ease;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    25% {
        transform: translateY(-12px);
    }

    50% {
        transform: translateY(-6px);
    }

    75% {
        transform: translateY(-3px);
    }
}

/* Stagger list animations */
.stagger-item {
    opacity: 0;
    transform: translateY(10px);
}

.stagger-item.stagger-animate {
    animation: stagger-item-in 0.4s ease forwards;
}

@keyframes stagger-item-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Panel entrance animations */
.panel-entrance {
    animation: panel-slide-in 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes panel-slide-in {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

.panel-child-entrance {
    opacity: 0;
    transform: translateY(20px);
    animation: panel-child-in 0.5s ease forwards;
}

@keyframes panel-child-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Particle system */
.particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: var(--z-notification);
    /* FIX: Use CSS custom property instead of hardcoded 100001 */
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: particle-burst 1s ease-out forwards;
}

@keyframes particle-burst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }

    100% {
        opacity: 0;
        transform:
            translate(calc(cos(var(--angle)) * var(--velocity)),
                calc(sin(var(--angle)) * var(--velocity))) scale(0);
    }
}

/* Enhanced hover states */
button:hover,
.btn:hover,
.control-btn:hover,
.chart-export-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover:active,
.btn:hover:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Prevent vertical "jump" on timeframe controls */
.timeframe-btn,
.chart-tf-btn {
    transform: none;
}

.timeframe-btn:hover,
.timeframe-btn:active,
.timeframe-btn:focus,
.chart-tf-btn:hover,
.chart-tf-btn:active,
.chart-tf-btn:focus,
button.timeframe-btn:hover:active,
button.chart-tf-btn:hover:active,
.timeframe-btn.button-pressed,
.chart-tf-btn.button-pressed {
    transform: none !important;
}

/* Prevent press jump on chart action buttons */
button.news-btn:hover:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(13, 71, 161, 0.35);
}

button.comparison-control-btn:hover:active {
    transform: translateY(-1px);
    box-shadow: none;
}

/* Smooth transitions for all interactive elements */
a,
button,
input,
select,
textarea,
.btn,
.control-btn,
.card {
    transition: all 0.2s ease;
}

/* Loading spinner enhancement */
@keyframes spin-smooth {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.loading-spinner,
.spinner {
    animation: spin-smooth 1s linear infinite;
}

/* Pulse animation for live indicators */
@keyframes pulse-glow {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 8px currentColor;
    }

    50% {
        opacity: 0.7;
        box-shadow: 0 0 16px currentColor;
    }
}

.live-indicator,
.active-indicator {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Smooth gradient animations */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.gradient-animated {
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

/* Card hover lift effect */
.card,
.info-card,
.news-card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover,
.info-card:hover,
.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

/* Elastic scale animation */
@keyframes elastic-scale {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.1);
    }

    75% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
    }
}

.elastic-appear {
    animation: elastic-scale 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Fade in animations */
@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fade-in 0.3s ease;
}

/* Slide in from bottom */
@keyframes slide-in-bottom {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-bottom {
    animation: slide-in-bottom 0.4s ease;
}

/* Rotate in animation */
@keyframes rotate-in {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }

    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

.rotate-in {
    animation: rotate-in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Number counting animation */
.number-counting {
    display: inline-block;
    transition: transform 0.3s ease;
}

.number-counting.updating {
    animation: number-update 0.3s ease;
}

@keyframes number-update {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
        color: #fbbf24;
    }
}

/* Progress bar animation */
@keyframes progress-fill {
    from {
        width: 0%;
    }
}

.progress-bar-animated {
    animation: progress-fill 1s ease;
}

/* Shimmer effect for loading states */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.15) 50%,
            rgba(255, 255, 255, 0.05) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s linear infinite;
}

/* Breathing animation for attention */
@keyframes breathe {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
    }
}

.breathe {
    animation: breathe 3s ease-in-out infinite;
}

/* Light theme adjustments */
[data-theme="light"] .ripple-effect {
    background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .keyboard-focus {
    outline-color: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2) !important;
}

[data-theme="light"] .shimmer {
    background: linear-gradient(90deg,
            rgba(0, 0, 0, 0.02) 0%,
            rgba(0, 0, 0, 0.08) 50%,
            rgba(0, 0, 0, 0.02) 100%);
    background-size: 1000px 100%;
}

/* Accessibility: Reduce motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .ripple-effect,
    .particle,
    .success-checkmark {
        display: none !important;
    }
}

/* Performance optimization: Use will-change sparingly */
button:hover,
.btn:hover,
.card:hover {
    will-change: transform, box-shadow;
}

button:not(:hover),
.btn:not(:hover),
.card:not(:hover) {
    will-change: auto;
}

/* =================================================================
   P3-10: Advanced Accessibility
   ================================================================= */

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Screen reader only but visible on focus */
.sr-only-focusable {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only-focusable:focus {
    position: fixed;
    width: auto;
    height: auto;
    padding: 12px 20px;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: #fbbf24;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: var(--z-tooltip);
    /* FIX: Use CSS custom property */
    top: 10px;
    left: 10px;
}

/* Skip links */
.skip-links {
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-emergency);
    /* FIX: Skip links should be highest priority for accessibility */
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 10px;
    padding: 12px 20px;
    background: #fbbf24;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 10px;
}

/* Keyboard hint */
.keyboard-hint {
    padding: 8px 12px;
    background: rgba(251, 191, 36, 0.9);
    color: #1a1a1a;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
}

/* Enhanced focus indicators for keyboard navigation */
:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.2);
}

/* Remove outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {

    button,
    .btn,
    .control-btn {
        border: 2px solid currentColor;
    }

    .card,
    .info-card {
        border: 2px solid rgba(255, 255, 255, 0.3);
    }

    a {
        text-decoration: underline;
    }
}

/* Light theme skip links */
[data-theme="light"] .skip-link {
    background: #f59e0b;
    color: #fff;
}

[data-theme="light"] .sr-only-focusable:focus {
    background: #f59e0b;
    color: #fff;
}

[data-theme="light"] :focus-visible {
    outline-color: #f59e0b;
}

[data-theme="light"] button:focus-visible,
[data-theme="light"] a:focus-visible,
[data-theme="light"] input:focus-visible,
[data-theme="light"] select:focus-visible,
[data-theme="light"] textarea:focus-visible {
    outline-color: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}

/* Improved link accessibility */
a:not(.btn):not(.control-btn) {
    color: #fbbf24;
    text-decoration: none;
    position: relative;
}

a:not(.btn):not(.control-btn):hover {
    text-decoration: underline;
}

a:not(.btn):not(.control-btn):focus-visible {
    text-decoration: underline;
}

[data-theme="light"] a:not(.btn):not(.control-btn) {
    color: #f59e0b;
}

/* Form field focus states */
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.15);
}

[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus {
    outline-color: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}

/* Edit Profile Modal - Light Mode */
[data-theme="light"] .form-group input {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    color: #0f172a !important;
}

[data-theme="light"] .form-group input:focus {
    background: #ffffff !important;
    border-color: #7c3aed !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1) !important;
}

[data-theme="light"] .form-group input:readonly {
    background: #f1f5f9 !important;
    color: #64748b !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .btn-cancel {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    color: #0f172a !important;
}

[data-theme="light"] .btn-cancel:hover {
    background: #f8fafc !important;
    border-color: rgba(0, 0, 0, 0.25) !important;
    color: #0f172a !important;
}

[data-theme="light"] .btn-save {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3) !important;
}

[data-theme="light"] .btn-save:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4) !important;
}

/* Settings Modal - Light Mode */
[data-theme="light"] .settings-tabs {
    border-bottom-color: rgba(0, 0, 0, 0.12) !important;
}

[data-theme="light"] .settings-tab {
    color: #64748b !important;
}

[data-theme="light"] .settings-tab:hover {
    color: #0f172a !important;
    background: rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .settings-tab.active {
    color: #f59e0b !important;
    border-bottom-color: #f59e0b !important;
}

[data-theme="light"] .settings-section h3 {
    color: #0f172a !important;
}

[data-theme="light"] .settings-item label {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 8px;
}

[data-theme="light"] .settings-item label:hover {
    background: #f8fafc !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
}

[data-theme="light"] .settings-item label span {
    color: #0f172a !important;
}

[data-theme="light"] .settings-item input[type="checkbox"] {
    background: rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .settings-item input[type="checkbox"]:checked {
    background: #f59e0b !important;
}

[data-theme="light"] .settings-item select,
[data-theme="light"] .settings-item input[type="number"] {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    color: #0f172a !important;
}

/* Credit Usage Modal - Light Mode */
[data-theme="light"] .credit-history-table {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .credit-history-row--header {
    background: #f1f5f9 !important;
    color: #64748b !important;
}

[data-theme="light"] .credit-history-row {
    color: #0f172a !important;
}

[data-theme="light"] .credit-history-row+.credit-history-row {
    border-top-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .credit-history-type {
    color: #0f172a !important;
}

[data-theme="light"] .credit-history-detail {
    color: #64748b !important;
}

[data-theme="light"] .credit-history-pair {
    color: #d97706 !important;
}

[data-theme="light"] .credit-history-empty,
[data-theme="light"] .credit-history-error,
[data-theme="light"] .credit-history-loading {
    color: #64748b !important;
}

[data-theme="light"] .credit-history-page-btn {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    color: #0f172a !important;
}

[data-theme="light"] .credit-history-page-btn:hover:not(:disabled) {
    background: #f8fafc !important;
    border-color: rgba(0, 0, 0, 0.2) !important;
}

[data-theme="light"] .credit-history-page-info {
    color: #64748b !important;
}

/* Error states accessibility */
.input-error,
[aria-invalid="true"] {
    border-color: #ef4444 !important;
}

.input-error:focus,
[aria-invalid="true"]:focus {
    outline-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
}

/* Success states */
.input-success,
[aria-invalid="false"] {
    border-color: #10b981 !important;
}

/* Required field indicator */
[required]::after,
[aria-required="true"]::after {
    content: " *";
    color: #ef4444;
}

/* Disabled state clarity */
button:disabled,
input:disabled,
select:disabled,
textarea:disabled,
[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading state announcement */
[aria-busy="true"] {
    position: relative;
}

[aria-busy="true"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

/* Modal focus trap indicator */
[aria-modal="true"] {
    position: relative;
}

/* Improved button sizing for touch targets (44x44px minimum) */
button,
.btn,
.control-btn,
a[role="button"] {
    min-height: 44px;
    min-width: 44px;
}

/* Icon-only buttons need larger touch targets */
button:not(:has(span:not(.sr-only))),
.control-btn:not(:has(span:not(.sr-only))) {
    padding: 12px;
}

/* Text sizing and line height for readability */
body {
    font-size: 16px;
    line-height: 1.5;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.3;
}

p {
    margin-bottom: 1em;
    line-height: 1.6;
}

/* Increase click/tap target size for small buttons */
@media (hover: none) and (pointer: coarse) {

    button,
    .btn,
    .control-btn {
        min-height: 48px;
        min-width: 48px;
        padding: 12px 16px;
    }
}

/* Focus management for modals */
.modal-open {
    overflow: hidden;
}

.modal-open [aria-hidden="true"]:not(svg) {
    visibility: hidden;
}

/* Improve table accessibility */
table {
    border-collapse: collapse;
    width: 100%;
}

th {
    text-align: left;
    font-weight: 600;
}

/* Status indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* Live region styling (mostly hidden) */
#a11y-live-region,
#a11y-alert-region {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Ensure sufficient spacing for readability */
*+h2,
*+h3,
*+h4 {
    margin-top: 1.5em;
}

/* Hover and focus should have similar styles */
button:hover,
button:focus-visible {
    /* Styles already defined above, ensuring consistency */
}

/* Print accessibility */
@media print {

    .skip-links,
    .keyboard-hint,
    button,
    .control-btn {
        display: none;
    }

    a {
        text-decoration: underline;
        color: #000;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.9em;
        color: #666;
    }
}

/* CREDIT CONFIRMATION DIALOG */
.credit-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 12, 16, 0.7);
    backdrop-filter: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal-high);
    /* FIX: Use CSS custom property */
    animation: fadeIn 0.2s ease;
}

.credit-confirm-modal {
    background: #1b1f26;
    border: 1px solid #2b313b;
    border-radius: 14px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    animation: slideUp 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.credit-confirm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px;
    border-bottom: 1px solid #2b313b;
}

.credit-confirm-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.credit-confirm-close {
    background: #222834;
    border: 1px solid #2b313b;
    color: #a0a7b4;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.credit-confirm-close:hover {
    background: #2b323f;
    color: #e2e8f0;
}

.credit-confirm-body {
    padding: 24px;
}

.credit-balance-display {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #222834;
    border: 1px solid #2e3644;
    border-radius: 12px;
    margin-bottom: 20px;
}

.credit-balance-display svg {
    flex-shrink: 0;
    stroke: #7aa2ff;
    background: #1d222c;
    border: 1px solid #2d3442;
    border-radius: 12px;
    padding: 8px;
}

.credit-balance-info {
    flex: 1;
}

.credit-label {
    font-size: 12px;
    color: #9aa4b2;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.credit-amount {
    font-size: 28px;
    font-weight: 700;
    color: #8ab4ff;
}

.credit-transaction-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #202530;
    border: 1px solid #2b313b;
    border-radius: 10px;
    margin-bottom: 16px;
}

.credit-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.credit-row span:first-child {
    color: #9aa4b2;
}

.credit-cost {
    color: #f6c85f;
    font-weight: 600;
}

.credit-after {
    color: var(--color-positive);
    font-weight: 600;
}

.credit-note {
    font-size: 13px;
    color: #9aa4b2;
    line-height: 1.6;
    margin: 0;
}

.credit-note strong {
    color: #e2e8f0;
}

.credit-insufficient-warning {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #2b2618;
    border: 1px solid #4b3a15;
    border-radius: 10px;
    margin-top: 16px;
    font-size: 13px;
    color: #f6c85f;
}

.credit-insufficient-warning svg {
    flex-shrink: 0;
}

.credit-confirm-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px 24px;
}

.credit-btn {
    flex: 1;
    padding: 12px 24px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.credit-btn-cancel {
    background: #2a303b;
    border-color: #3a4252;
    color: #cbd5e1;
}

.credit-btn-cancel:hover {
    background: #323a48;
    color: #f8fafc;
}

.credit-btn-confirm {
    background: #4f6bdc;
    border-color: #4f6bdc;
    color: #fff;
}

.credit-btn-confirm:hover {
    background: #5b7cf0;
    border-color: #5b7cf0;
}

.credit-btn-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.credit-btn:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.8);
    outline-offset: 2px;
}

.credit-btn-purchase {
    background: #f6c85f;
    border-color: #f6c85f;
    color: #1b1f26;
}

.credit-btn-purchase:hover {
    background: #ffd27a;
    border-color: #ffd27a;
}

/* ACCESSIBILITY FIX (WCAG 2.4.1): Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #667eea;
    color: #ffffff;
    padding: 8px 16px;
    text-decoration: none;
    font-weight: 600;
    z-index: var(--z-modal-high);
    /* FIX: Use CSS custom property */
    border-radius: 0 0 4px 0;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #fbbf24;
    outline-offset: 2px;
}

/* ============================================================================
   RESPONSIVE DESIGN ENHANCEMENTS - 2025
   Comprehensive mobile-first responsive design for all screen sizes
   ============================================================================ */

/* Extra Small Mobile Devices (320px - 374px) - iPhone SE, older Android phones */
@media (max-width: 374px) {

    /* Typography adjustments for very small screens */
    body {
        font-size: 14px;
    }

    .header {
        padding: 12px 15px;
        padding-top: max(12px, env(safe-area-inset-top));
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }

    .brand-text {
        font-size: 24px !important;
        letter-spacing: 0.04em !important;
    }

    .timeframe-btn {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 44px;
        min-height: 44px;
    }

    .control-btn {
        width: 44px;
        height: 44px;
        font-size: 14px;
    }

    /* Slider adjustments */
    .news-slider,
    .account-slider,
    .settings-slider {
        width: 95% !important;
        max-width: 320px;
    }

    .settings-content {
        padding: 15px;
    }

    .settings-section h3 {
        font-size: 16px;
    }

    .setting-row label {
        font-size: 13px;
    }
}

/* Small Mobile Devices (375px - 424px) - iPhone 12/13/14/15, Galaxy S20/S21/S22 */
@media (min-width: 375px) and (max-width: 424px) {
    body {
        font-size: 15px;
    }

    .brand-text {
        font-size: 26px !important;
        letter-spacing: 0.05em !important;
    }

    .timeframe-btn {
        padding: 9px 14px;
        font-size: 13px;
        min-width: 44px;
        min-height: 44px;
    }

    .control-btn {
        width: 46px;
        height: 46px;
        font-size: 16px;
    }

    .news-slider,
    .account-slider,
    .settings-slider {
        width: 92% !important;
        max-width: 375px;
    }

    .chart-container {
        height: calc(100vh - 140px);
    }
}

/* Medium Mobile Devices (425px - 767px) - Large phones, small tablets */
@media (min-width: 425px) and (max-width: 767px) {
    body {
        font-size: 16px;
    }

    .brand-text {
        font-size: 28px !important;
        letter-spacing: 0.06em !important;
    }

    .timeframe-btn {
        padding: 10px 16px;
        font-size: 14px;
        min-width: 48px;
        min-height: 48px;
    }

    .control-btn {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .news-slider {
        width: 90% !important;
        max-width: 450px;
    }

    .account-slider {
        width: 88% !important;
        max-width: 420px;
    }

    .settings-slider {
        width: 90% !important;
        max-width: 500px;
    }

    .chart-container {
        height: calc(100vh - 150px);
    }
}

/* Tablet Portrait (768px - 1023px) - iPad, Android tablets */
@media (min-width: 768px) and (max-width: 1023px) {
    .news-slider {
        width: 85%;
        max-width: 600px;
    }

    .account-slider {
        width: 80%;
        max-width: 500px;
    }

    .settings-slider {
        width: 85%;
        max-width: 650px;
    }

    .control-btn {
        width: 50px;
        height: 50px;
    }

    .chart-container {
        height: calc(100vh - 160px);
    }
}

/* Tablet Landscape & Small Desktop (1024px - 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
    .news-slider {
        max-width: 700px;
    }

    .account-slider {
        max-width: 550px;
    }

    .settings-slider {
        max-width: 750px;
    }
}

/* Large Desktop (1440px+) - Full HD and beyond */
@media (min-width: 1440px) {
    .news-slider {
        max-width: 800px;
    }

    .settings-slider {
        max-width: 850px;
    }

    .chart-container {
        height: calc(100vh - 170px);
    }
}

/* Landscape Orientation Support - Critical for mobile usability */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 8px 15px;
        padding-top: max(8px, env(safe-area-inset-top));
    }

    .brand-text {
        font-size: 22px !important;
    }

    .timeframe-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .chart-container {
        height: calc(100vh - 100px);
    }

    .news-slider,
    .account-slider,
    .settings-slider {
        max-height: 80vh;
        overflow-y: auto;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {

    /* Ensure all interactive elements meet 44x44px touch target minimum */
    .timeframe-btn,
    .control-btn,
    button,
    a {
        min-width: 44px;
        min-height: 44px;
    }

    /* Larger tap targets for mobile */
    .setting-toggle {
        transform: scale(1.2);
    }

    /* Remove hover states on touch devices */
    .timeframe-btn:hover,
    .control-btn:hover {
        transform: none;
    }
}

/* High DPI / Retina Display Support */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    /* Sharper text rendering on high-DPI displays */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Reduced Motion Support - Accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark Mode Support - respects system preference */
@media (prefers-color-scheme: dark) {

    /* Already dark by default, ensure consistency */
    body {
        background: #1a1a1a;
        color: #fff;
    }
}

/* Light Mode Support - for users who prefer light theme */
@media (prefers-color-scheme: light) {
    /* Optional: could add light theme support here if desired */
}

/* Accessibility: Screen reader only content */
.visually-hidden,
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Allow focus for keyboard navigation */
.visually-hidden-focusable:focus,
.sr-only-focusable:focus {
    position: static !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
}

.session-chart button,
#sessionChart button,
div[id="sessionChart"] button {
    display: none !important;
}

/* Account Modal - Light Mode (Cream Theme) */
[data-theme="light"] .account-slider {
    background: #fffbf0 !important;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .account-avatar {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(217, 119, 6, 0.08)) !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
}

[data-theme="light"] .account-name {
    color: #0f172a !important;
}

[data-theme="light"] .account-email {
    color: #64748b !important;
}

[data-theme="light"] .account-section-title {
    color: #64748b !important;
}

[data-theme="light"] .account-menu-item {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    color: #0f172a !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .account-menu-item:hover {
    background: #fef9e7 !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15) !important;
}

[data-theme="light"] .account-section-divider {
    background: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .account-credits-section {
    background: #fef3c7 !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
}

[data-theme="light"] .credits-amount-large {
    color: #0f172a !important;
}

[data-theme="light"] .credits-tier-label {
    color: #64748b !important;
}

[data-theme="light"] .account-subscription-card {
    background: #fffbf0 !important;
    border-color: rgba(245, 158, 11, 0.2) !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1) !important;
}

[data-theme="light"] .account-subscription-item {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08) !important;
}

[data-theme="light"] .account-subscription-item::before {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(236, 72, 153, 0.05)) !important;
}

[data-theme="light"] .account-subscription-item:hover {
    border-color: rgba(99, 102, 241, 0.35) !important;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.16) !important;
}

[data-theme="light"] .account-subscription-item.pro-tier {
    background: linear-gradient(135deg, #ffffff 0%, #f3f6ff 60%, #fdf4ff 100%) !important;
    border-color: rgba(99, 102, 241, 0.35) !important;
    box-shadow: 0 12px 22px rgba(99, 102, 241, 0.18) !important;
}

[data-theme="light"] .account-subscription-item.pro-tier::before {
    opacity: 0.6 !important;
}

[data-theme="light"] .account-subscription-item .subscription-left>div>div:first-child {
    color: #0f172a !important;
    text-shadow: none !important;
}

[data-theme="light"] .account-subscription-item .subscription-left>div>div:last-child {
    color: #64748b !important;
}

[data-theme="light"] .account-subscription-item.pro-tier .upgrade-to-pro-btn {
    background: linear-gradient(135deg, #ff6f61 0%, #7c5cff 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 18px rgba(124, 92, 255, 0.28) !important;
}

[data-theme="light"] .account-subscription-item.pro-tier .upgrade-to-pro-btn:hover {
    box-shadow: 0 14px 24px rgba(124, 92, 255, 0.36) !important;
}

[data-theme="light"] .premium-loading {
    color: rgba(15, 23, 42, 0.6);
}

[data-theme="light"] .premium-spinner {
    border-color: rgba(15, 23, 42, 0.2);
    border-top-color: #ff9f1c;
}

[data-theme="light"] .premium-status {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
    color: #78350f !important;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.25) !important;
}

[data-theme="light"] .manage-subscription {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .manage-subscription h3 {
    color: #0f172a !important;
}

[data-theme="light"] .subscription-info {
    background: #fef9e7 !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 8px;
}

[data-theme="light"] .info-row {
    color: #0f172a !important;
    border-bottom-color: rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .account-logout-btn {
    background: rgba(239, 68, 68, 0.08) !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
    color: #dc2626 !important;
}

[data-theme="light"] .account-logout-btn:hover {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    color: #b91c1c !important;
}

[data-theme="light"] .buy-credits-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3) !important;
}

[data-theme="light"] .buy-credits-btn:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4) !important;
}

/* Edit Profile Modal - Light Mode */
[data-theme="light"] .edit-profile-overlay {
    background: rgba(0, 0, 0, 0.3) !important;
}

[data-theme="light"] .edit-profile-content {
    background: #ffffff !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.1) inset !important;
}

[data-theme="light"] .edit-profile-header {
    border-bottom-color: rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .edit-profile-header h2 {
    color: #0f172a !important;
    text-shadow: none !important;
}

[data-theme="light"] .edit-profile-close {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    color: #64748b !important;
}

[data-theme="light"] .edit-profile-close:hover {
    background: rgba(0, 0, 0, 0.08) !important;
    border-color: rgba(0, 0, 0, 0.2) !important;
    color: #0f172a !important;
}

/* Settings Modal - Light Mode */
[data-theme="light"] .settings-slider {
    background: #ffffff !important;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.15) !important;
    color: #0f172a !important;
}

[data-theme="light"] .settings-header {
    border-bottom-color: rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .settings-header h2 {
    color: #0f172a !important;
}

[data-theme="light"] .settings-close {
    color: #64748b !important;
}

[data-theme="light"] .settings-close:hover {
    background: rgba(0, 0, 0, 0.08) !important;
    color: #0f172a !important;
}

[data-theme="light"] .settings-tabs {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    border-bottom-color: rgba(15, 23, 42, 0.12) !important;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .settings-tab {
    color: #475569 !important;
}

[data-theme="light"] .settings-tab:hover {
    color: #0f172a !important;
    background: rgba(15, 23, 42, 0.04) !important;
}

[data-theme="light"] .settings-tab svg {
    opacity: 0.8;
}

[data-theme="light"] .settings-tab.active {
    color: #f59e0b !important;
    border-bottom-color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.12) !important;
}

[data-theme="light"] .settings-tab.active svg {
    stroke: #f59e0b !important;
    opacity: 1;
}

[data-theme="light"] .settings-section {
    background: #f8fafc !important;
    border-color: rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .settings-input,
[data-theme="light"] .settings-select {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    color: #0f172a !important;
}

[data-theme="light"] .settings-input[readonly] {
    background: #f1f5f9 !important;
    color: #64748b !important;
}

[data-theme="light"] .input-hint {
    color: rgba(15, 23, 42, 0.6) !important;
}

[data-theme="light"] .change-avatar-btn {
    background: rgba(245, 158, 11, 0.12) !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
    color: #b45309 !important;
}

[data-theme="light"] .change-avatar-btn:hover {
    background: rgba(245, 158, 11, 0.2) !important;
    border-color: #f59e0b !important;
    color: #92400e !important;
}

[data-theme="light"] .pair-search-input {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.22) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .pair-search-input:focus {
    background: #ffffff !important;
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15),
        0 2px 8px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .search-icon {
    color: rgba(15, 23, 42, 0.55);
}

[data-theme="light"] .search-clear-btn {
    color: rgba(15, 23, 42, 0.55);
}

[data-theme="light"] .search-clear-btn:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
}

.light-theme .pair-search-input {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.22) !important;
    color: #0f172a !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.light-theme .pair-search-input::placeholder {
    color: rgba(15, 23, 42, 0.6) !important;
}

.light-theme .pair-search-input:focus {
    background: #ffffff !important;
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15),
        0 2px 8px rgba(15, 23, 42, 0.08);
}

.light-theme .search-icon {
    color: rgba(15, 23, 42, 0.55);
}

.light-theme .search-clear-btn {
    color: rgba(15, 23, 42, 0.55);
}

.light-theme .search-clear-btn:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
}

[data-theme="light"] .credits-purchase-section {
    border-top-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .credits-package-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .credits-package-card:hover {
    border-color: rgba(245, 158, 11, 0.65);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .credits-package-card .package-name {
    color: #b45309;
}

[data-theme="light"] .credits-package-card .package-credits-amount {
    color: #0f172a;
}

[data-theme="light"] .credits-package-card .package-credits-label {
    color: #64748b;
}

[data-theme="light"] .credits-package-card .package-price-display {
    color: var(--color-positive);
}

[data-theme="light"] .credits-package-card .package-value-text {
    color: #64748b;
}

[data-theme="light"] .credits-package-card .package-buy-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

[data-theme="light"] .credits-package-card .package-buy-btn:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
}

[data-theme="light"] .loading-spinner {
    color: #64748b;
}

.light-theme .credits-purchase-section {
    border-top-color: rgba(15, 23, 42, 0.12);
}

.light-theme .credits-package-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.light-theme .credits-package-card:hover {
    border-color: rgba(245, 158, 11, 0.65);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.light-theme .credits-package-card .package-name {
    color: #b45309;
}

.light-theme .credits-package-card .package-credits-amount {
    color: #0f172a;
}

.light-theme .credits-package-card .package-credits-label {
    color: #64748b;
}

.light-theme .credits-package-card .package-price-display {
    color: var(--color-positive);
}

.light-theme .credits-package-card .package-value-text {
    color: #64748b;
}

.light-theme .credits-package-card .package-buy-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.light-theme .credits-package-card .package-buy-btn:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
}

.light-theme .loading-spinner {
    color: #64748b;
}

/* ============================================================================
   REFERRAL TAB - PREMIUM STYLING (DARK / LIGHT MODE)
   ============================================================================ */

/* CSS Variables for Referral Theme */
:root {
    --referral-accent: #f5d27d;
    --referral-accent-light: #fde68a;
    --referral-accent-dark: #d4a853;
    --referral-success: var(--color-positive-muted);
    --referral-pending: #f59e0b;
    --referral-card-bg: rgba(20, 23, 34, 0.9);
    --referral-card-border: rgba(245, 210, 125, 0.2);
    --referral-text-primary: #f5f7ff;
    --referral-text-secondary: rgba(255, 255, 255, 0.7);
    --referral-text-muted: rgba(255, 255, 255, 0.5);
    --referral-glow: rgba(245, 210, 125, 0.15);
    --referral-gradient: linear-gradient(135deg, rgba(245, 210, 125, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
}

/* Hero Card */
.referral-hero-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: var(--referral-gradient);
    border: 1px solid var(--referral-card-border);
    border-radius: 16px;
    margin-bottom: 24px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 24px var(--referral-glow);
}

.referral-hero-icon {
    flex-shrink: 0;
    padding: 16px;
    background: rgba(245, 210, 125, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(245, 210, 125, 0.2);
}

.referral-hero-text h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--referral-accent);
}

.referral-hero-text p {
    margin: 0;
    font-size: 14px;
    color: var(--referral-text-secondary);
    line-height: 1.6;
}

.referral-hero-text strong {
    color: var(--referral-accent);
    font-weight: 600;
}

/* Premium Referral Card */
.referral-card-premium {
    background: var(--referral-card-bg);
    border: 1px solid var(--referral-card-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.referral-card-premium h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--referral-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Referral Link Input Group */
.referral-link-group {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.referral-link-input {
    flex: 1;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--referral-text-primary);
    font-size: 14px;
    font-family: 'Monaco', 'Consolas', monospace;
}

.referral-link-input:focus {
    outline: none;
    border-color: var(--referral-accent);
    box-shadow: 0 0 0 3px var(--referral-glow);
}

.referral-copy-btn {
    padding: 8px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 6px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.referral-copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
}

.referral-copy-btn:active {
    transform: translateY(0);
}

/* Stats Grid */
.referral-stats-premium {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.referral-stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.referral-stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.referral-stat-value.success {
    color: var(--referral-success);
}

.referral-stat-value.pending {
    color: var(--referral-pending);
}

.referral-stat-value.credits {
    color: var(--referral-accent);
}

.referral-stat-label {
    font-size: 12px;
    color: var(--referral-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* How It Works */
.referral-how-it-works {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
}

.referral-how-it-works h4 {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--referral-text-primary);
}

.referral-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.referral-step {
    display: flex;
    align-items: center;
    gap: 16px;
}

.referral-step-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--referral-accent) 0%, var(--referral-accent-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    flex-shrink: 0;
}

.referral-step-text {
    font-size: 14px;
    color: var(--referral-text-secondary);
}

/* Loading State */
.referral-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px;
    color: var(--referral-text-muted);
}

.referral-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--referral-card-border);
    border-top-color: var(--referral-accent);
    border-radius: 50%;
    animation: referral-spin 1s linear infinite;
}

@keyframes referral-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Code Badge */
.referral-code-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(245, 210, 125, 0.1);
    border: 1px solid rgba(245, 210, 125, 0.3);
    border-radius: 8px;
    margin-top: 12px;
}

.referral-code-badge span {
    font-size: 13px;
    color: var(--referral-text-secondary);
}

.referral-code-badge code {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--referral-accent);
}

/* ============================================================================
   LIGHT THEME - REFERRAL OVERRIDES (Amber/Gold to match app theme)
   ============================================================================ */

.light-theme,
[data-theme="light"] {
    --referral-accent: #b45309;
    --referral-accent-light: #d97706;
    --referral-accent-dark: #92400e;
    --referral-card-bg: #ffffff;
    --referral-card-border: rgba(180, 83, 9, 0.15);
    --referral-text-primary: #0f172a;
    --referral-text-secondary: #475569;
    --referral-text-muted: #94a3b8;
    --referral-glow: rgba(180, 83, 9, 0.08);
    --referral-gradient: linear-gradient(135deg, rgba(180, 83, 9, 0.04) 0%, rgba(217, 119, 6, 0.03) 100%);
}

.light-theme .referral-hero-icon {
    background: rgba(180, 83, 9, 0.08);
    border-color: rgba(180, 83, 9, 0.15);
}

.light-theme .referral-hero-icon svg {
    stroke: #b45309;
}

.light-theme .referral-card-premium {
    background: #ffffff;
    border-color: rgba(180, 83, 9, 0.12);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.light-theme .referral-link-input {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

.light-theme .referral-link-input:focus {
    border-color: #b45309;
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.1);
}

.light-theme .referral-copy-btn {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(180, 83, 9, 0.2);
}

.light-theme .referral-copy-btn:hover {
    box-shadow: 0 6px 20px rgba(180, 83, 9, 0.3);
}

.light-theme .referral-stat-card {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.08);
}

.light-theme .referral-stat-value {
    color: #0f172a;
}

.light-theme .referral-stat-value.success {
    color: #059669;
}

.light-theme .referral-stat-value.pending {
    color: #d97706;
}

.light-theme .referral-stat-value.credits {
    color: #b45309;
}

.light-theme .referral-how-it-works {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.06);
}

.light-theme .referral-step-number {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: white;
}

.light-theme .referral-spinner {
    border-color: rgba(15, 23, 42, 0.1);
    border-top-color: #b45309;
}

.light-theme .referral-code-badge {
    background: rgba(180, 83, 9, 0.06);
    border-color: rgba(180, 83, 9, 0.12);
}

.light-theme .referral-code-badge code {
    color: #b45309;
}

/* ============================================================================
   BENTO GRID LAYOUT FOR REFERRALS TAB
   ============================================================================ */

.referral-bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 4px 0;
}

/* Base Bento Card Style */
.referral-bento-card {
    background: rgba(20, 23, 34, 0.9);
    border: 1px solid rgba(245, 210, 125, 0.2);
    border-radius: 10px;
    padding: 12px;
    transition: all 0.2s ease;
}

/* Force light theme on all bento cards */
body[data-theme="light"] .referral-bento-card {
    background: #ffffff !important;
    border-color: rgba(180, 83, 9, 0.1) !important;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05) !important;
}

.referral-bento-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(245, 210, 125, 0.15);
}

body[data-theme="light"] .referral-bento-card:hover {
    box-shadow: 0 8px 24px rgba(180, 83, 9, 0.1) !important;
}

/* Hero Card - Spans 2 columns */
.referral-bento-hero {
    grid-column: span 2;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--referral-gradient);
    border: 1px solid var(--referral-card-border);
    box-shadow: 0 2px 12px var(--referral-glow);
}

.referral-bento-hero .referral-hero-icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 55%),
        linear-gradient(140deg, rgba(12, 12, 12, 0.9) 0%, rgba(20, 23, 34, 0.95) 55%, rgba(8, 8, 8, 0.95) 100%);
    border: 1px solid rgba(245, 210, 125, 0.45);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35), 0 0 16px rgba(245, 210, 125, 0.2);
    color: var(--referral-accent);
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
}

.referral-bento-hero .referral-hero-icon::after {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    pointer-events: none;
}

.referral-bento-hero .referral-hero-icon svg {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.referral-bento-hero .referral-hero-text h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--referral-accent);
}

.referral-bento-hero .referral-hero-text p {
    margin: 0;
    font-size: 12px;
    color: var(--referral-text-secondary);
    line-height: 1.4;
}

.referral-bento-hero .referral-hero-text strong {
    color: var(--referral-accent);
}

/* Link Card - Spans 2 columns */
.referral-bento-link {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    padding: 10px;
    overflow: hidden;
}

/* Stat Cards */
.referral-bento-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 70px;
    padding: 10px 8px;
    background: rgba(20, 23, 34, 0.9);
}

/* Force light theme on stat cards */
body[data-theme="light"] .referral-bento-stat {
    background: #f8fafc !important;
    border-color: rgba(180, 83, 9, 0.08) !important;
}

.bento-stat-icon {
    font-size: 18px;
    margin-bottom: 4px;
}

.bento-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--referral-text-primary);
    line-height: 1.2;
}

.bento-stat-label {
    font-size: 10px;
    color: var(--referral-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
}

/* Stat Card Color Variants */
.referral-bento-stat.success .bento-stat-value {
    color: var(--color-positive-muted);
}

.referral-bento-stat.pending .bento-stat-value {
    color: #f59e0b;
}

.referral-bento-stat.credits .bento-stat-value {
    color: #f5d27d;
}

body[data-theme="light"] .referral-bento-stat.credits .bento-stat-value {
    color: #b45309 !important;
}

/* Steps Card - Full width */
.referral-bento-steps {
    grid-column: span 4;
    padding: 14px;
}

.referral-bento-steps h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: #f8fafc;
    text-align: center;
}

body[data-theme="light"] .referral-bento-steps h4 {
    color: #0f172a !important;
}

.referral-steps-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.referral-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}

.step-number {
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, var(--referral-accent) 0%, var(--referral-accent-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
}

.step-text {
    font-size: 11px;
    color: var(--referral-text-secondary);
    max-width: 100px;
}

.step-arrow {
    font-size: 14px;
    color: var(--referral-text-muted);
}

/* Light Theme Bento Overrides - using data-theme attribute */
[data-theme="light"] .referral-bento-card {
    background: #ffffff !important;
    border-color: rgba(180, 83, 9, 0.1) !important;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05) !important;
}

[data-theme="light"] .referral-bento-card:hover {
    box-shadow: 0 8px 24px rgba(180, 83, 9, 0.1) !important;
}

[data-theme="light"] .referral-bento-hero {
    background: linear-gradient(135deg, rgba(180, 83, 9, 0.05) 0%, rgba(217, 119, 6, 0.04) 100%) !important;
    border-color: rgba(180, 83, 9, 0.12) !important;
}

[data-theme="light"] .referral-bento-hero .referral-hero-icon {
    background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 55%),
        linear-gradient(140deg, #ffffff 0%, #f8fafc 55%, #e2e8f0 100%) !important;
    color: #b45309 !important;
    border: 1px solid rgba(180, 83, 9, 0.25) !important;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12), 0 0 12px rgba(180, 83, 9, 0.18);
}

[data-theme="light"] .referral-bento-hero .referral-hero-icon::after {
    border-color: rgba(180, 83, 9, 0.12);
}

[data-theme="light"] .referral-bento-hero .referral-hero-icon svg {
    stroke: #b45309 !important;
    filter: drop-shadow(0 4px 8px rgba(180, 83, 9, 0.25));
}

[data-theme="light"] .referral-bento-hero .referral-hero-text h4 {
    color: #92400e !important;
}

[data-theme="light"] .referral-bento-hero .referral-hero-text p {
    color: #475569 !important;
}

[data-theme="light"] .referral-bento-hero .referral-hero-text strong {
    color: #b45309 !important;
}

/* Link Card - Light Theme */
[data-theme="light"] .referral-bento-link {
    background: #ffffff !important;
    border-color: rgba(180, 83, 9, 0.1) !important;
}

[data-theme="light"] .referral-bento-link h4 {
    color: #0f172a !important;
}

[data-theme="light"] .referral-bento-link svg {
    stroke: #b45309 !important;
}

/* Stat Cards - Light Theme */
[data-theme="light"] .referral-bento-stat {
    background: #f8fafc !important;
    border-color: rgba(180, 83, 9, 0.06) !important;
}

[data-theme="light"] .bento-stat-value {
    color: #0f172a !important;
}

[data-theme="light"] .bento-stat-label {
    color: #64748b !important;
}

[data-theme="light"] .referral-bento-stat.success .bento-stat-value {
    color: #059669 !important;
}

[data-theme="light"] .referral-bento-stat.pending .bento-stat-value {
    color: #d97706 !important;
}

[data-theme="light"] .referral-bento-stat.credits .bento-stat-value {
    color: #b45309 !important;
}

/* Steps Card - Light Theme */
[data-theme="light"] .referral-bento-steps {
    background: #f8fafc !important;
    border-color: rgba(15, 23, 42, 0.08) !important;
}

[data-theme="light"] .referral-bento-steps h4 {
    color: #0f172a !important;
}

[data-theme="light"] .step-number {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    color: white !important;
}

[data-theme="light"] .step-text {
    color: #475569 !important;
}

[data-theme="light"] .step-arrow {
    color: #94a3b8 !important;
}

/* Responsive: Stack on smaller screens */
@media (max-width: 600px) {
    .referral-bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .referral-bento-hero,
    .referral-bento-link,
    .referral-bento-steps {
        grid-column: span 2;
    }

    .referral-bento-hero {
        flex-direction: column;
        text-align: center;
    }

    .referral-steps-row {
        flex-direction: column;
        gap: 12px;
    }

    .step-arrow {
        transform: rotate(90deg);
    }
}

/* Account Menu Button (for Referrals quick access) */
.account-menu-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--referral-text-secondary, rgba(255, 255, 255, 0.8));
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.account-menu-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(251, 191, 36, 0.5);
    color: #ffffff;
    transform: translateX(2px);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.2);
}

.account-menu-btn svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.account-menu-btn:hover svg {
    opacity: 1;
    stroke: currentColor;
}

.account-menu-arrow {
    margin-left: auto;
    opacity: 0.5;
    transition: transform 0.2s ease;
}

.account-menu-btn:hover .account-menu-arrow {
    transform: translateX(4px);
    opacity: 1;
}

/* Light theme - Clean Blue-Purple styling */
.light-theme .account-menu-btn,
[data-theme="light"] .account-menu-btn {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.1);
    color: #475569;
}

.light-theme .account-menu-btn:hover,
[data-theme="light"] .account-menu-btn:hover {
    background: #fef9e7;
    border-color: rgba(245, 158, 11, 0.4);
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}

.light-theme .account-menu-btn:hover svg,
[data-theme="light"] .account-menu-btn:hover svg {
    stroke: currentColor;
}

/* Additional Light Theme Fixes for Referral Card */
.light-theme .referral-card-premium,
[data-theme="light"] .referral-card-premium {
    background: #ffffff !important;
    border: 1px solid rgba(180, 83, 9, 0.1) !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06) !important;
}

.light-theme .referral-card-premium h4,
[data-theme="light"] .referral-card-premium h4 {
    color: #0f172a !important;
}

.light-theme .referral-link-input,
[data-theme="light"] .referral-link-input {
    background: #f8fafc !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    color: #0f172a !important;
}

.light-theme .referral-code-badge,
[data-theme="light"] .referral-code-badge {
    background: rgba(180, 83, 9, 0.05) !important;
    border-color: rgba(180, 83, 9, 0.12) !important;
}

.light-theme .referral-code-badge span,
[data-theme="light"] .referral-code-badge span {
    color: #475569 !important;
}

.light-theme .referral-code-badge code,
[data-theme="light"] .referral-code-badge code {
    color: #b45309 !important;
}

/* ===== LIGHT THEME: Subscription Slider ===== */
.light-theme .subscription-slider,
[data-theme="light"] .subscription-slider {
    background: #ffffff !important;
    color: #0f172a !important;
}

.light-theme .subscription-slider h2,
.light-theme .subscription-slider h3,
.light-theme .subscription-slider h4,
[data-theme="light"] .subscription-slider h2,
[data-theme="light"] .subscription-slider h3,
[data-theme="light"] .subscription-slider h4 {
    color: #0f172a !important;
}

.light-theme .plan-card,
[data-theme="light"] .plan-card {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08) !important;
}

.light-theme .plan-card.featured,
[data-theme="light"] .plan-card.featured {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(251, 191, 36, 0.05) 100%) !important;
    border-color: #fbbf24 !important;
}

.light-theme .plan-header h4,
[data-theme="light"] .plan-header h4 {
    color: #0f172a !important;
}

.light-theme .plan-price .amount,
[data-theme="light"] .plan-price .amount {
    color: #0f172a !important;
}

.light-theme .plan-price .period,
[data-theme="light"] .plan-price .period {
    color: #64748b !important;
}

.light-theme .plan-compare,
[data-theme="light"] .plan-compare {
    color: #94a3b8 !important;
}

.light-theme .plan-features li,
[data-theme="light"] .plan-features li {
    color: #475569 !important;
}

/* Credits Select Dropdown - light theme */
.light-theme .plan-card select,
.light-theme .credits-select,
.light-theme .subscription-slider select,
[data-theme="light"] .plan-card select,
[data-theme="light"] .credits-select,
[data-theme="light"] .subscription-slider select {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid rgba(15, 23, 42, 0.15) !important;
}

.light-theme .plan-card select option,
.light-theme .credits-select option,
.light-theme .subscription-slider select option,
[data-theme="light"] .plan-card select option,
[data-theme="light"] .credits-select option,
[data-theme="light"] .subscription-slider select option {
    background: #ffffff !important;
    color: #0f172a !important;
}

.light-theme .plan-savings,
[data-theme="light"] .plan-savings {
    color: var(--color-positive) !important;
}

[data-theme="light"] .upgrade-option-card {
    background: #f8fafc !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
}

[data-theme="light"] .upgrade-option-card h4 {
    color: #0f172a !important;
}

[data-theme="light"] .upgrade-option-card p {
    color: #475569 !important;
}

[data-theme="light"] .upgrade-option-meta {
    color: #0f172a !important;
}

[data-theme="light"] .upgrade-option-divider {
    color: #94a3b8 !important;
}

[data-theme="light"] .subscription-plans h3 {
    color: #0f172a !important;
}

[data-theme="light"] .trial-banner {
    background: rgba(22, 163, 74, 0.06) !important;
    border-color: rgba(22, 163, 74, 0.2) !important;
}

[data-theme="light"] .trial-banner-text h4 {
    color: #16a34a !important;
}

[data-theme="light"] .trial-banner-text span {
    color: #475569 !important;
}

/* ===== LIGHT THEME: Referral Tab ===== */
.light-theme #referralsTab,
[data-theme="light"] #referralsTab {
    color: #0f172a !important;
}

.light-theme #referralsTab h2,
.light-theme #referralsTab h3,
.light-theme #referralsTab h4,
[data-theme="light"] #referralsTab h2,
[data-theme="light"] #referralsTab h3,
[data-theme="light"] #referralsTab h4 {
    color: #0f172a !important;
}

.light-theme #referralsTab p,
.light-theme #referralsTab span,
[data-theme="light"] #referralsTab p,
[data-theme="light"] #referralsTab span {
    color: #475569 !important;
}

/* Referral card premium */
.light-theme .referral-card-premium,
[data-theme="light"] .referral-card-premium {
    background: #ffffff !important;
    border: 1px solid rgba(180, 83, 9, 0.1) !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06) !important;
}

.light-theme .referral-card-premium h4,
[data-theme="light"] .referral-card-premium h4 {
    color: #0f172a !important;
}

/* Referral stats grid */
.light-theme .referral-stats-grid,
[data-theme="light"] .referral-stats-grid {
    background: transparent !important;
}

.light-theme .referral-stat-card,
[data-theme="light"] .referral-stat-card {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}

.light-theme .referral-stat-value,
[data-theme="light"] .referral-stat-value {
    color: #0f172a !important;
}

.light-theme .referral-stat-label,
[data-theme="light"] .referral-stat-label {
    color: #64748b !important;
}

/* How it works section */
.light-theme .referral-how-it-works,
[data-theme="light"] .referral-how-it-works {
    background: #f8fafc !important;
    border: 1px solid rgba(15, 23, 42, 0.06) !important;
}

.light-theme .referral-how-it-works h4,
[data-theme="light"] .referral-how-it-works h4 {
    color: #0f172a !important;
}

.light-theme .referral-step-text,
[data-theme="light"] .referral-step-text {
    color: #475569 !important;
}

/* Referral hero section */
.light-theme .referral-hero,
[data-theme="light"] .referral-hero {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
    border: 1px solid rgba(251, 191, 36, 0.3) !important;
}

.light-theme .referral-hero h3,
[data-theme="light"] .referral-hero h3 {
    color: #78350f !important;
}

.light-theme .referral-hero p,
[data-theme="light"] .referral-hero p {
    color: #92400e !important;
}

/* ===== LIGHT THEME: AI Analysis Credit Confirm Modal ===== */
.light-theme .credit-confirm-overlay,
[data-theme="light"] .credit-confirm-overlay {
    background: rgba(15, 23, 42, 0.3) !important;
}

.light-theme .credit-confirm-modal,
[data-theme="light"] .credit-confirm-modal {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15) !important;
}

.light-theme .credit-confirm-header,
[data-theme="light"] .credit-confirm-header {
    border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
}

.light-theme .credit-confirm-header h3,
[data-theme="light"] .credit-confirm-header h3 {
    color: #0f172a !important;
}

.light-theme .credit-confirm-close,
[data-theme="light"] .credit-confirm-close {
    background: #f1f5f9 !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    color: #475569 !important;
}

.light-theme .credit-confirm-close:hover,
[data-theme="light"] .credit-confirm-close:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

.light-theme .credit-balance-display,
[data-theme="light"] .credit-balance-display {
    background: #f8fafc !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

.light-theme .credit-balance-display svg,
[data-theme="light"] .credit-balance-display svg {
    stroke: #b45309 !important;
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

.light-theme .credit-label,
[data-theme="light"] .credit-label {
    color: #64748b !important;
}

.light-theme .credit-amount,
[data-theme="light"] .credit-amount {
    color: #0f172a !important;
}

.light-theme .credit-cost-row,
[data-theme="light"] .credit-cost-row {
    background: #f8fafc !important;
    border-color: rgba(15, 23, 42, 0.06) !important;
}

.light-theme .credit-cost-row span,
[data-theme="light"] .credit-cost-row span {
    color: #475569 !important;
}

.light-theme .credit-cost-row strong,
[data-theme="light"] .credit-cost-row strong {
    color: #0f172a !important;
}

.light-theme .credit-confirm-body p,
[data-theme="light"] .credit-confirm-body p {
    color: #475569 !important;
}

.light-theme .credit-confirm-body strong,
[data-theme="light"] .credit-confirm-body strong {
    color: #0f172a !important;
}

.light-theme .credit-btn-cancel,
[data-theme="light"] .credit-btn-cancel {
    background: #f1f5f9 !important;
    border-color: rgba(15, 23, 42, 0.1) !important;
    color: #475569 !important;
}

.light-theme .credit-btn-cancel:hover,
[data-theme="light"] .credit-btn-cancel:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

/* Credit Transaction Details - Light Theme (cost breakdown area) */
.light-theme .credit-transaction-details,
[data-theme="light"] .credit-transaction-details {
    background: #f8fafc !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

.light-theme .credit-row span,
[data-theme="light"] .credit-row span {
    color: #475569 !important;
}

.light-theme .credit-cost,
[data-theme="light"] .credit-cost {
    color: #d97706 !important;
}

.light-theme .credit-after,
[data-theme="light"] .credit-after {
    color: var(--color-positive) !important;
}

.light-theme .credit-note,
[data-theme="light"] .credit-note {
    color: #64748b !important;
}

.light-theme .credit-note strong,
[data-theme="light"] .credit-note strong {
    color: #0f172a !important;
}

/* Light theme - Settings Search Clear Button */
[data-theme="light"] .settings-search-clear {
    background: rgba(180, 83, 9, 0.12) !important;
    color: #b45309 !important;
    border: 1px solid rgba(180, 83, 9, 0.2) !important;
}

[data-theme="light"] .settings-search-clear:hover {
    background: rgba(180, 83, 9, 0.2) !important;
    color: #92400e !important;
}

[data-theme="light"] .settings-search-clear svg {
    stroke: #b45309 !important;
}

.loading-spinner,
.credit-purchase-loading,
.credit-history-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: none;
}

.loading-spinner::before,
.credit-purchase-loading::before,
.credit-history-loading::before {
    content: "";
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

[data-theme="light"] .loading-spinner::before,
[data-theme="light"] .credit-purchase-loading::before,
[data-theme="light"] .credit-history-loading::before,
.light-theme .loading-spinner::before,
.light-theme .credit-purchase-loading::before,
.light-theme .credit-history-loading::before {
    border-color: rgba(15, 23, 42, 0.2);
    border-top-color: #0f172a;
}

.credits-package-card.is-processing .package-buy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.credits-package-card.is-processing .package-buy-btn::before {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================================================
   SETTINGS SLIDER UX REFRESH
   ============================================================================ */

#settingsSlider {
    width: min(480px, 95vw);
    right: calc(-1 * min(480px, 95vw));
    background: radial-gradient(circle at 10% -10%, rgba(251, 191, 36, 0.1), transparent 45%),
        linear-gradient(160deg, #090b12 0%, #0f1320 60%, #121729 100%);
    box-shadow: -20px 0 48px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s ease;
}

#settingsSlider.visible {
    right: 0;
    display: block;
}

#settingsSlider.visible.wide {
    width: min(820px, 95vw);
}

#subscriptionSlider {
    width: min(560px, 95vw);
    right: calc(-1 * min(560px, 95vw));
}

#subscriptionSlider.visible {
    right: 0;
    display: block;
}

#settingsSlider .settings-slider-content {
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

#settingsSlider .settings-header {
    margin: 0;
    padding: max(20px, env(safe-area-inset-top)) 24px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, rgba(9, 11, 18, 0.96), rgba(9, 11, 18, 0.9));
    backdrop-filter: blur(8px);
}

#settingsSlider .settings-header h2 {
    font-size: clamp(23px, 3vw, 30px);
    letter-spacing: -0.02em;
}

#settingsSlider .settings-close {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
}

#settingsSlider .settings-search-container {
    margin: 0;
    padding: 14px 24px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#settingsSlider .settings-search-icon {
    left: 38px;
}

#settingsSlider .settings-search-input {
    height: 46px;
    border-radius: 14px;
}

#settingsSlider .settings-tabs {
    margin: 0;
    padding: 14px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

#settingsSlider .settings-tab {
    margin: 0;
    min-height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 11px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    justify-content: center;
    text-align: center;
    color: rgba(255, 255, 255, 0.74);
    background: rgba(255, 255, 255, 0.02);
}

#settingsSlider .settings-tab:hover {
    color: #f8fafc;
    border-color: rgba(251, 191, 36, 0.5);
    background: rgba(251, 191, 36, 0.1);
}

#settingsSlider .settings-tab.active {
    color: #0f172a;
    border-color: rgba(251, 191, 36, 0.75);
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

#settingsSlider .settings-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 24px max(24px, env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(10, 12, 20, 0.7), rgba(10, 12, 20, 0.45));
}

#settingsSlider .settings-tab-content {
    padding: 0;
    animation: settingsFadeUp 0.24s ease;
}

#settingsSlider .settings-tab-content h3 {
    margin: 0 0 14px;
    font-size: 22px;
    color: #f8fafc;
}

#settingsSlider .settings-section {
    margin-bottom: 18px;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 18, 29, 0.76);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

#settingsSlider .save-settings-btn {
    width: 100%;
    min-height: 46px;
}

@keyframes settingsFadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Referral tab layout */
#referralsTab .settings-tab-intro-referrals {
    margin-bottom: 18px;
}

#referralsTab .settings-tab-intro-referrals h3 {
    margin-bottom: 8px;
}

#referralsTab .settings-tab-intro-referrals p {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.5;
    font-size: 14px;
}

#referralsTab .referral-bento-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
    padding: 0;
}

#referralsTab .referral-bento-card {
    border-radius: 16px;
    padding: 18px;
    border: 1px solid rgba(245, 210, 125, 0.2);
    background: rgba(18, 23, 36, 0.9);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}

#referralsTab .referral-bento-hero {
    grid-column: span 7;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: linear-gradient(135deg, rgba(245, 210, 125, 0.16), rgba(70, 75, 155, 0.16));
}

#referralsTab .referral-hero-badge {
    align-self: flex-start;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fef3c7;
    background: rgba(245, 210, 125, 0.2);
    border: 1px solid rgba(245, 210, 125, 0.4);
}

#referralsTab .referral-hero-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

#referralsTab .referral-hero-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    display: grid;
    place-items: center;
}

#referralsTab .referral-hero-text h4 {
    margin: 0 0 6px;
    font-size: 20px;
    color: #fff9e6;
}

#referralsTab .referral-hero-text p {
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.84);
}

#referralsTab .referral-reward-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#referralsTab .referral-reward-pill {
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #fef3c7;
    border: 1px solid rgba(251, 191, 36, 0.45);
    background: rgba(251, 191, 36, 0.12);
}

#referralsTab .referral-bento-link {
    grid-column: span 5;
    display: flex;
    min-height: 216px;
}

#referralsTab .referral-link-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#referralsTab .referral-link-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.8);
}

#referralsTab .referral-link-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    padding: 10px 12px;
}

#referralsTab .referral-link-input-wrap svg {
    color: rgba(255, 255, 255, 0.75);
    flex-shrink: 0;
}

#referralsTab .referral-link-field {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: #f8fafc;
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

#referralsTab .referral-link-actions {
    display: flex;
    gap: 10px;
}

#referralsTab .referral-copy-btn,
#referralsTab .referral-share-btn {
    min-height: 40px;
    padding: 10px 14px;
    border-radius: 10px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

#referralsTab .referral-copy-btn {
    flex: 1;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #f8fafc;
}

#referralsTab .referral-copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.3);
}

#referralsTab .referral-share-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.9);
}

#referralsTab .referral-share-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}

#referralsTab .referral-link-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

#referralsTab .referral-link-note code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    color: #fde68a;
}

#referralsTab .referral-bento-stat {
    grid-column: span 3;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    gap: 7px;
}

#referralsTab .bento-stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(245, 210, 125, 0.35);
    background: rgba(245, 210, 125, 0.14);
    display: grid;
    place-items: center;
    color: #f5d27d;
}

#referralsTab .bento-stat-icon svg {
    width: 16px;
    height: 16px;
}

#referralsTab .bento-stat-value {
    font-size: 32px;
    line-height: 1;
    letter-spacing: -0.02em;
}

#referralsTab .bento-stat-label {
    font-size: 11px;
    line-height: 1.35;
    letter-spacing: 0.06em;
}

#referralsTab .referral-bento-steps {
    grid-column: 1 / -1;
    padding: 16px;
}

#referralsTab .referral-bento-steps h4 {
    margin: 0 0 12px;
    text-align: left;
}

#referralsTab .referral-steps-row {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

#referralsTab .referral-step-item {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.02);
    padding: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
}

#referralsTab .step-number {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

#referralsTab .step-text {
    max-width: none;
    font-size: 13px;
    line-height: 1.45;
}

#referralsTab .step-arrow {
    display: none;
}

/* Light theme overrides */
[data-theme="light"] #settingsSlider {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
    box-shadow: -20px 0 46px rgba(15, 23, 42, 0.18) !important;
    color: #0f172a !important;
}

[data-theme="light"] #settingsSlider .settings-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.95));
    border-bottom-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] #settingsSlider .settings-close {
    border-color: rgba(15, 23, 42, 0.14);
    background: rgba(15, 23, 42, 0.04);
    color: #475569 !important;
}

[data-theme="light"] #settingsSlider .settings-search-container {
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] #settingsSlider .settings-search-input {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.14);
    color: #0f172a;
}

[data-theme="light"] #settingsSlider .settings-search-input::placeholder {
    color: #94a3b8;
}

[data-theme="light"] #settingsSlider .settings-tabs {
    border-bottom-color: rgba(15, 23, 42, 0.09) !important;
}

[data-theme="light"] #settingsSlider .settings-tab {
    color: #475569 !important;
    border-color: rgba(15, 23, 42, 0.14);
    background: #ffffff;
}

[data-theme="light"] #settingsSlider .settings-tab.active {
    color: #78350f !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
    background: linear-gradient(180deg, #fef3c7, #fde68a) !important;
}

[data-theme="light"] #settingsSlider .settings-content {
    background: transparent;
}

[data-theme="light"] #settingsSlider .settings-tab-content h3 {
    color: #0f172a;
}

[data-theme="light"] #settingsSlider .settings-section,
[data-theme="light"] #referralsTab .referral-bento-card {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.09) !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] #referralsTab .settings-tab-intro-referrals p {
    color: #475569;
}

[data-theme="light"] #referralsTab .referral-bento-hero {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(217, 119, 6, 0.1));
}

[data-theme="light"] #referralsTab .referral-hero-badge {
    color: #92400e;
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.35);
}

[data-theme="light"] #referralsTab .referral-hero-text h4 {
    color: #78350f;
}

[data-theme="light"] #referralsTab .referral-hero-text p {
    color: #475569;
}

[data-theme="light"] #referralsTab .referral-reward-pill {
    color: #92400e;
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.15);
}

[data-theme="light"] #referralsTab .referral-link-title {
    color: #475569;
}

[data-theme="light"] #referralsTab .referral-link-input-wrap {
    border-color: rgba(15, 23, 42, 0.14);
    background: #f8fafc;
}

[data-theme="light"] #referralsTab .referral-link-input-wrap svg {
    color: #64748b;
}

[data-theme="light"] #referralsTab .referral-link-field {
    color: #0f172a;
}

[data-theme="light"] #referralsTab .referral-share-btn {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.14);
    color: #334155;
}

[data-theme="light"] #referralsTab .referral-link-note {
    color: #64748b;
    border-top-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] #referralsTab .referral-link-note code {
    color: #92400e;
}

[data-theme="light"] #referralsTab .bento-stat-icon {
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.32);
    background: rgba(245, 158, 11, 0.14);
}

[data-theme="light"] #referralsTab .bento-stat-label {
    color: #64748b;
}

[data-theme="light"] #referralsTab .referral-bento-stat.success .bento-stat-value {
    color: #059669;
}

[data-theme="light"] #referralsTab .referral-bento-stat.pending .bento-stat-value {
    color: #d97706;
}

[data-theme="light"] #referralsTab .referral-bento-stat.credits .bento-stat-value {
    color: #b45309;
}

[data-theme="light"] #referralsTab .referral-step-item {
    border-color: rgba(15, 23, 42, 0.12);
    background: #f8fafc;
}

[data-theme="light"] #referralsTab .step-text {
    color: #334155;
}

@media (max-width: 980px) {
    #settingsSlider {
        width: min(680px, 100vw);
        right: calc(-1 * min(680px, 100vw));
    }

    #referralsTab .referral-bento-hero,
    #referralsTab .referral-bento-link {
        grid-column: 1 / -1;
    }

    #referralsTab .referral-bento-stat {
        grid-column: span 6;
    }
}

@media (max-width: 640px) {
    #settingsSlider {
        width: 100vw;
        right: -100vw;
        max-width: none;
    }

    #settingsSlider .settings-header,
    #settingsSlider .settings-search-container,
    #settingsSlider .settings-tabs,
    #settingsSlider .settings-content {
        padding-left: 16px;
        padding-right: 16px;
    }

    #settingsSlider .settings-tabs {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 12px;
    }

    #settingsSlider .settings-tab {
        flex: 0 0 auto;
        min-width: 120px;
    }

    #referralsTab .referral-bento-grid {
        gap: 10px;
    }

    #referralsTab .referral-bento-hero,
    #referralsTab .referral-bento-link,
    #referralsTab .referral-bento-stat,
    #referralsTab .referral-bento-steps {
        grid-column: 1 / -1;
    }

    #referralsTab .referral-hero-main {
        flex-direction: column;
        align-items: flex-start;
    }

    #referralsTab .referral-link-actions {
        flex-direction: column;
    }

    #referralsTab .referral-copy-btn,
    #referralsTab .referral-share-btn {
        width: 100%;
    }

    #referralsTab .referral-steps-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 8px 10px;
        gap: 6px;
    }

    .brand-timeframe {
        gap: 6px;
        flex-shrink: 1;
        min-width: 0;
        overflow: hidden;
    }

    .brand-text {
        font-size: 20px;
        letter-spacing: 0.04em;
    }

    .timeframe-buttons {
        gap: 4px;
    }

    .timeframe-btn {
        padding: 6px 10px;
        font-size: 12px;
        border-radius: 8px;
        min-width: 28px;
    }

    .controls {
        gap: 2px;
    }

    .control-btn {
        padding: 6px;
        min-width: 32px;
        min-height: 32px;
    }

    .control-btn svg {
        width: 18px;
        height: 18px;
    }

    .search-container {
        order: 3;
        grid-column: 1 / -1;
    }

    .pair-search-input {
        font-size: 13px;
        padding: 6px 32px;
    }

    .header-upgrade-btn {
        padding: 4px 8px;
        font-size: 10px;
    }

    .free-trial-badge {
        padding: 2px 6px;
        font-size: 9px;
    }

    #blogBtn {
        display: none;
    }

    #fullscreenBtn {
        display: none;
    }
}

@media (max-width: 380px) {
    .brand-text {
        font-size: 18px;
    }

    .timeframe-btn {
        padding: 5px 8px;
        font-size: 11px;
    }

    .timeframe-buttons {
        gap: 3px;
    }
}
