.visualization-container {
        padding: 32px;
        max-width: 1800px;
        margin: 0 auto;
        animation: fadeIn 0.5s ease-in;
    }

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

    @media (prefers-reduced-motion: reduce) {
        .visualization-container,
        .viz-mode-card,
        .plot-type-btn,
        .preset-item,
        .attribute-item,
        .chart-toolbar-btn,
        .loading-spinner,
        .empty-state-icon {
            animation: none !important;
            transition: none !important;
        }
    }

    .page-header {
        margin-bottom: 24px;
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    }

    .page-header--viz {
        margin-bottom: 16px;
    }

    .page-header--viz .page-title {
        color: var(--text-primary, rgba(255, 255, 255, 0.98));
        font-size: clamp(1.5rem, 3vw, 2rem);
        font-weight: 700;
        margin: 0;
        letter-spacing: -0.02em;
    }

    .page-header--viz .page-subtitle {
        color: var(--text-secondary, rgba(255, 255, 255, 0.65));
        font-size: 0.95rem;
        margin-top: 6px;
        max-width: 52ch;
    }

    .viz-header-actions {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 10px;
    }

    @media (min-width: 640px) {
        .viz-header-actions {
            flex-direction: row;
            flex-wrap: wrap;
            align-items: center;
            justify-content: flex-end;
        }
    }

    .viz-tabs-nav {
        max-width: 100%;
    }

    .viz-tabs-nav .viz-mode-card {
        flex: 1 1 140px;
        min-width: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        padding: 10px 14px;
        text-align: left;
        font: inherit;
    }

    .viz-tabs-nav .viz-mode-card .analysis-tab-icon {
        display: none;
    }

    @media (min-width: 720px) {
        .viz-tabs-nav .viz-mode-card {
            flex-direction: row;
            align-items: center;
            gap: 8px;
        }
        .viz-tabs-nav .viz-mode-card .analysis-tab-icon {
            display: inline-block;
            font-size: 0.85rem;
            opacity: 0.85;
        }
    }

    /* Tab buttons: title only — detail lives in subtitle / tooltips */
    .viz-tabs-nav .viz-mode-desc {
        display: none;
    }

    .viz-section-label {
        margin-bottom: 12px;
        justify-content: center;
        text-align: center;
    }

    .viz-section-label::before {
        display: none;
    }

    .visualization-container .section-header {
        justify-content: center;
        text-align: center;
    }

    .visualization-container .section-header::before {
        display: none;
    }

    .viz-shared-stock-panel {
        margin-top: 12px;
        margin-bottom: 16px;
        padding: 16px;
        background: rgba(15, 23, 42, 0.45);
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .viz-stock-search {
        max-width: min(520px, 100%);
    }

    .viz-shared-multi-hint {
        margin: 8px 0 0;
        font-size: 0.8rem;
        color: rgba(255, 255, 255, 0.45);
    }

    .viz-action-buttons {
        margin-top: 0;
    }

    .viz-chart-empty-title {
        font-size: 1rem;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.8);
        margin-bottom: 10px;
    }

    .viz-chart-empty-hint {
        font-size: 0.875rem;
        color: rgba(255, 255, 255, 0.5);
        max-width: min(380px, 100%);
        line-height: 1.6;
    }

    .viz-chart-empty-steps {
        display: flex;
        gap: 24px;
        margin-top: 22px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .viz-chart-empty-step {
        text-align: center;
    }

    .viz-chart-empty-step-num {
        font-size: 1rem;
        margin-bottom: 4px;
        font-weight: 700;
        width: 2rem;
        height: 2rem;
        margin-left: auto;
        margin-right: auto;
        border-radius: 50%;
        border: 2px solid rgba(255, 255, 255, 0.35);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .viz-chart-empty-step-label {
        font-size: 0.78rem;
        color: rgba(255, 255, 255, 0.45);
    }

    .viz-chart-empty-arrow {
        color: rgba(255, 255, 255, 0.2);
        align-self: center;
        font-size: 1.2rem;
    }

    .page-header h1 {
        color: rgba(255, 255, 255, 0.98);
        font-size: 2.5rem;
        font-weight: 700;
        margin: 0;
        background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        letter-spacing: -0.02em;
    }

    .page-header p {
        color: rgba(255, 255, 255, 0.7);
        font-size: 1rem;
        margin-top: 8px;
    }

    .controls-panel {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
        backdrop-filter: blur(30px) saturate(180%);
        -webkit-backdrop-filter: blur(30px) saturate(180%);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 16px;
        padding: 32px;
        margin-bottom: 32px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 
                    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
                    0 1px 0 rgba(255, 255, 255, 0.1) inset;
        transition: all 0.3s ease;
    }

    .controls-panel:hover {
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 
                    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
                    0 1px 0 rgba(255, 255, 255, 0.15) inset;
    }

    .controls-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
        margin-bottom: 20px;
    }

    .control-group {
        display: flex;
        flex-direction: column;
        position: relative;
    }

    .control-group label {
        color: rgba(255, 255, 255, 0.95);
        font-size: 0.875rem;
        font-weight: 600;
        margin-bottom: 10px;
        display: flex;
        align-items: center;
        gap: 6px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-size: 0.75rem;
    }

    .control-group select,
    .control-group input {
        padding: 12px 16px;
        background-color: rgb(15, 23, 42);
        border: 1.5px solid rgba(148, 163, 184, 0.22);
        border-radius: 10px;
        color: rgba(255, 255, 255, 0.95);
        font-size: 0.9rem;
        font-weight: 500;
        transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .control-group select:hover,
    .control-group input:hover {
        border-color: rgba(59, 130, 246, 0.5);
        background-color: rgb(20, 28, 46);
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    }

    .control-group select:focus,
    .control-group input:focus {
        outline: none;
        border-color: #3b82f6;
        background-color: rgb(20, 28, 46);
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15),
                    0 4px 16px rgba(59, 130, 246, 0.2);
    }

    .control-group select option {
        background-color: rgb(15, 23, 42);
        color: rgba(255, 255, 255, 0.95);
        padding: 8px;
    }

    .control-hint--brief {
        margin: 6px 0 0;
        font-size: 0.82rem;
        line-height: 1.4;
        color: rgba(203, 213, 225, 0.85);
    }

    .viz-hint-more {
        margin: 6px 0 0;
        font-size: 0.82rem;
        color: rgba(203, 213, 225, 0.9);
    }

    .viz-hint-more > summary {
        cursor: pointer;
        font-weight: 600;
        color: rgba(147, 197, 253, 0.9);
        list-style: none;
        user-select: none;
    }

    .viz-hint-more > summary::-webkit-details-marker {
        display: none;
    }

    .viz-hint-more > summary::before {
        content: "▸ ";
        display: inline-block;
        transition: transform 0.15s ease;
    }

    .viz-hint-more[open] > summary::before {
        transform: rotate(90deg);
    }

    .viz-hint-more__body {
        margin: 8px 0 0;
        padding: 10px 12px;
        border-radius: 8px;
        background: rgba(15, 23, 42, 0.45);
        border: 1px solid rgba(148, 163, 184, 0.14);
        font-size: 0.82rem;
        line-height: 1.5;
        color: rgba(203, 213, 225, 0.92);
        max-width: 65ch;
    }

    .viz-hint-more__body p {
        margin: 0 0 8px;
    }

    .viz-hint-more__body p:last-child {
        margin-bottom: 0;
    }

    .xy-independence-hint {
        margin: 0 0 12px;
        padding: 8px 12px;
        border-radius: 6px;
        font-size: 0.82rem;
        line-height: 1.4;
    }
    .xy-independence-ok { background: rgba(16, 185, 129, 0.12); border-left: 3px solid #10b981; color: rgba(255,255,255,0.85); }
    .xy-independence-warn { background: rgba(245, 158, 11, 0.12); border-left: 3px solid #f59e0b; color: rgba(255,255,255,0.9); }
    .xy-independence-block { background: rgba(239, 68, 68, 0.12); border-left: 3px solid #ef4444; color: rgba(255,255,255,0.95); }

    .plot-type-selector {
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
        margin-top: 20px;
        padding: 20px;
        background: rgba(15, 23, 42, 0.4);
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .plot-type-btn {
        padding: 12px 24px;
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.25) 100%);
        border: 1.5px solid rgba(59, 130, 246, 0.3);
        border-radius: 10px;
        color: rgba(255, 255, 255, 0.9);
        font-size: 0.875rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .plot-type-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
        transition: left 0.5s;
    }

    .plot-type-btn:hover::before {
        left: 100%;
    }

    .plot-type-btn:hover {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(59, 130, 246, 0.4) 100%);
        border-color: rgba(59, 130, 246, 0.7);
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
    }

    .plot-type-btn.active {
        background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
        border-color: #3b82f6;
        color: white;
        box-shadow: 0 4px 16px rgba(59, 130, 246, 0.5),
                    0 0 0 2px rgba(59, 130, 246, 0.2) inset;
        transform: translateY(-1px);
    }

    .action-buttons {
        display: flex;
        gap: 12px;
        margin-top: 24px;
        flex-wrap: wrap;
    }

    .btn {
        padding: 14px 28px;
        border-radius: 10px;
        font-size: 0.9rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border: none;
        position: relative;
        overflow: hidden;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .btn::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        transform: translate(-50%, -50%);
        transition: width 0.6s, height 0.6s;
    }

    .btn:hover::before {
        width: 300px;
        height: 300px;
    }

    .btn span {
        position: relative;
        z-index: 1;
    }

    .btn-primary {
        background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
        color: white;
        box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    }

    .btn-primary:hover {
        background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
        box-shadow: 0 6px 24px rgba(59, 130, 246, 0.5);
        transform: translateY(-2px);
    }

    .btn-primary:active {
        transform: translateY(0);
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    }

    .btn-secondary {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.12) 100%);
        color: rgba(255, 255, 255, 0.95);
        border: 1.5px solid rgba(255, 255, 255, 0.15);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .btn-secondary:hover {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.18) 100%);
        border-color: rgba(255, 255, 255, 0.25);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .chart-container {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
        backdrop-filter: blur(30px) saturate(180%);
        -webkit-backdrop-filter: blur(30px) saturate(180%);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 16px;
        padding: 24px;
        margin-bottom: 32px;
        min-height: 520px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
        position: relative;
        overflow: visible;
    }

    .chart-container--active {
        min-height: max(620px, calc(100vh - 260px));
    }
    
    #chart-container {
        position: relative;
        width: 100%;
        min-height: 560px;
        height: auto;
    }

    #chart-container .js-plotly-plot,
    #chart-container .plot-container,
    #chart-container .svg-container {
        width: 100% !important;
    }

    .viz-sector-breakdown {
        margin-top: 24px;
        padding: 20px 24px 28px;
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.92) 0%, rgba(15, 23, 42, 0.96) 100%);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 14px;
    }

    .viz-sector-filters-panel {
        margin: 12px 0 16px;
        padding: 14px 16px;
        background: rgba(15, 23, 42, 0.45);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 10px;
    }

    .viz-sector-filters-hint {
        margin: 0 0 12px;
        text-align: center;
    }

    .viz-sector-filters-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .viz-sector-filter-match {
        margin: 10px 0 0;
        text-align: center;
        font-size: 0.8rem;
        color: rgba(148, 163, 184, 0.95);
    }

    .viz-sector-breakdown__title {
        margin: 0 0 8px;
        font-size: 1.05rem;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.95);
        text-align: center;
    }

    .viz-sector-breakdown__header .control-hint {
        margin: 0;
        line-height: 1.5;
        text-align: center;
        max-width: 52ch;
        margin-left: auto;
        margin-right: auto;
    }

    .viz-sector-breakdown__methodology {
        margin: 16px 0;
    }

    .viz-sector-breakdown__methodology-body p {
        margin: 0 0 8px;
    }

    .viz-sector-search-wrap {
        margin-bottom: 16px;
    }

    .viz-sector-search {
        width: 100%;
        max-width: 420px;
        padding: 10px 14px;
        background: rgb(15, 23, 42);
        border: 1.5px solid rgba(148, 163, 184, 0.22);
        border-radius: 10px;
        color: rgba(255, 255, 255, 0.95);
        font-size: 0.9rem;
    }

    .viz-sector-breakdown-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .viz-sector-breakdown-sector {
        background: rgba(15, 23, 42, 0.45);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 10px;
        padding: 4px 12px 10px;
    }

    .viz-sector-breakdown-sector summary {
        cursor: pointer;
        padding: 10px 4px;
        list-style: none;
        display: flex;
        flex-wrap: wrap;
        gap: 8px 16px;
        align-items: baseline;
    }

    .viz-sector-breakdown-sector summary::-webkit-details-marker {
        display: none;
    }

    .viz-sector-breakdown-sector__name {
        font-weight: 600;
        color: rgba(255, 255, 255, 0.95);
    }

    .viz-sector-breakdown-sector__meta {
        font-size: 0.82rem;
        color: rgba(148, 163, 184, 0.95);
    }

    .viz-sector-breakdown-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.84rem;
        margin-top: 4px;
    }

    .viz-sector-breakdown-table th,
    .viz-sector-breakdown-table td {
        padding: 8px 10px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        text-align: left;
    }

    .viz-sector-breakdown-table th.num,
    .viz-sector-breakdown-table td.num {
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

    .viz-sector-breakdown-table thead th {
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: rgba(148, 163, 184, 0.95);
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    }
    
    /* Enable Plotly hover tooltips */
    .chart-container .hoverlayer {
        display: block !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
    
    /* Show all Plotly hover tooltips */
    div[class*="hovertext"],
    .hovertext,
    .js-plotly-plot .hoverlayer {
        display: block !important;
        visibility: visible !important;
        pointer-events: auto !important;
        opacity: 1 !important;
    }
    
    /* Fix hover tooltip text styling */
    .hovertext {
        padding: 8px 12px !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        overflow: hidden !important;
        max-width: min(280px, 80vw) !important;
        width: auto !important;
        line-height: 1.4 !important;
        word-break: break-word !important;
        transition: none !important;
        animation: none !important;
    }
    
    /* Prevent Plotly hover animations but allow positioning */
    .js-plotly-plot .hoverlayer,
    .hoverlayer {
        transition: none !important;
        animation: none !important;
    }
    
    .hovertext .nums {
        padding: 4px 0 !important;
        display: block !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        word-break: break-word !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .hovertext .nums > * {
        display: inline-block !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    /* Ensure text elements inside tooltip wrap properly */
    .hovertext pathname,
    .hovertext .pathname,
    .hovertext b,
    .hovertext strong {
        display: inline !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    /* Avoid CSS containment here — it breaks Plotly sizing in some browsers. */

    .chart-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, 
            transparent 0%, 
            rgba(59, 130, 246, 0.5) 50%, 
            transparent 100%);
        animation: shimmer 3s infinite;
    }

    @keyframes shimmer {
        0%, 100% { transform: translateX(-100%); }
        50% { transform: translateX(100%); }
    }

    .chart-placeholder {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 650px;
        color: rgba(255, 255, 255, 0.6);
        font-size: 1.1rem;
        gap: 16px;
    }

    .chart-placeholder i {
        font-size: 3rem;
        opacity: 0.5;
    }

    .error-message {
        background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.25) 100%);
        border: 1.5px solid rgba(239, 68, 68, 0.5);
        border-left: 4px solid #ef4444;
        border-radius: 10px;
        padding: 16px 20px;
        color: #fca5a5;
        margin-bottom: 20px;
        display: flex;
        align-items: center;
        gap: 12px;
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
        animation: slideIn 0.3s ease-out;
    }

    .error-message::before {
        content: '\f071';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        font-size: 1.2rem;
        color: #ef4444;
    }

    .info-message {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.25) 100%);
        border: 1.5px solid rgba(59, 130, 246, 0.5);
        border-left: 4px solid #3b82f6;
        border-radius: 10px;
        padding: 16px 20px;
        color: #93c5fd;
        margin-bottom: 20px;
        display: flex;
        align-items: center;
        gap: 12px;
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
        animation: slideIn 0.3s ease-out;
    }

    .info-message::before {
        content: '\f05a';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        font-size: 1.2rem;
        color: #3b82f6;
    }

    @keyframes slideIn {
        from {
            opacity: 0;
            transform: translateX(-20px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .loading {
        display: inline-block;
        width: 16px;
        height: 16px;
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-top-color: white;
        border-radius: 50%;
        animation: spin 0.6s linear infinite;
        margin-left: 8px;
    }

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

    /* Stock search wrapper — dropdown styles are injected by stock-search.js */
    .stock-search-wrapper {
        position: relative;
    }
    .stock-search-wrapper input[type="text"] {
        width: 100%;
    }

    /* Search functionality */
    .search-box {
        position: relative;
    }

    .search-box input {
        padding-left: 36px;
    }

    .search-icon {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: rgba(255, 255, 255, 0.5);
        pointer-events: none;
        font-size: 0.9rem;
        z-index: 1;
    }

    /* Tooltips */
    .tooltip-icon {
        display: inline-block;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: rgba(59, 130, 246, 0.3);
        color: #3b82f6;
        text-align: center;
        line-height: 16px;
        font-size: 11px;
        cursor: help;
        margin-left: 6px;
        vertical-align: middle;
    }

    .tooltip {
        position: relative;
        display: inline-block;
    }

    .tooltip .tooltiptext {
        visibility: hidden;
        width: min(250px, 80vw);
        background-color: rgba(15, 23, 42, 0.95);
        color: rgba(255, 255, 255, 0.9);
        text-align: left;
        border-radius: 6px;
        padding: 8px 12px;
        position: absolute;
        z-index: 1000;
        bottom: 125%;
        left: 50%;
        margin-left: -125px;
        opacity: 0;
        transition: opacity 0.3s;
        font-size: 0.8rem;
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .tooltip:hover .tooltiptext {
        visibility: visible;
        opacity: 1;
    }

    /* Date presets */
    .date-presets {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
        margin-top: 8px;
    }

    .date-preset-btn {
        padding: 6px 14px;
        font-size: 0.75rem;
        font-weight: 600;
        background: rgba(255, 255, 255, 0.05);
        border: 1.5px solid rgba(255, 255, 255, 0.1);
        border-radius: 6px;
        color: rgba(255, 255, 255, 0.75);
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .date-preset-btn:hover {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(59, 130, 246, 0.35) 100%);
        border-color: rgba(59, 130, 246, 0.5);
        color: rgba(255, 255, 255, 0.95);
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
    }

    .date-preset-btn.active {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.35) 0%, rgba(59, 130, 246, 0.5) 100%);
        border-color: rgba(96, 165, 250, 0.75);
        color: #fff;
        box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.35);
    }

    .viz-date-range {
        margin-top: 12px;
        padding: 12px 14px;
        background: rgba(15, 23, 42, 0.35);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 10px;
    }

    .viz-date-range-label {
        display: block;
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        color: rgba(255, 255, 255, 0.55);
        margin-bottom: 8px;
    }

    .viz-date-custom {
        margin-top: 10px;
    }

    .viz-date-custom-grid {
        margin-top: 10px;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .viz-date-range--compact {
        padding: 0;
        background: transparent;
        border: none;
        margin-top: 6px;
    }

    .viz-date-range--compact .date-presets {
        margin-bottom: 8px;
    }

    .viz-sector-axes-panel {
        margin-top: 12px;
        padding: 12px 14px;
        background: rgba(15, 23, 42, 0.35);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 10px;
    }

    .sector-preset-btn.active {
        background: rgba(59, 130, 246, 0.35);
        border-color: rgba(96, 165, 250, 0.75);
        color: #fff;
        box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.35);
    }

    .regression-model-hint {
        line-height: 1.45;
    }

    #regression-model-select option {
        max-width: 420px;
    }

    /* Action buttons enhanced */
    .btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .btn-group {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

    .btn-small {
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    /* Loading overlay */
    .loading-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.8);
        backdrop-filter: blur(4px);
        display: none;
        align-items: center;
        justify-content: center;
        z-index: 1000;
        border-radius: 12px;
    }

    .loading-overlay.active {
        display: flex;
    }

    .loading-spinner {
        width: 50px;
        height: 50px;
        border: 4px solid rgba(59, 130, 246, 0.3);
        border-top-color: #3b82f6;
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }

    .loading-text {
        margin-top: 16px;
        color: rgba(255, 255, 255, 0.9);
        font-size: 0.9rem;
    }

    /* Empty states */
    .empty-state {
        text-align: center;
        padding: 60px 20px;
        color: rgba(255, 255, 255, 0.5);
    }

    .empty-state-icon {
        font-size: 3rem;
        margin-bottom: 16px;
        opacity: 0.5;
    }

    /* Export buttons */
    .export-buttons {
        display: flex;
        gap: 4px;
        margin-top: 0;
        align-items: center;
    }
    
    #chart-actions {
        position: absolute;
        top: 8px;
        left: 8px;
        z-index: 1000;
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: none !important;
        background: rgba(15, 23, 42, 0.8);
        backdrop-filter: blur(10px);
        border-radius: 8px;
        padding: 4px 8px;
    }
    
    #chart-actions .btn {
        min-height: 44px !important;
        height: auto !important;
        max-height: none !important;
        line-height: 1 !important;
        padding: 8px 14px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        vertical-align: top !important;
        margin: 0 !important;
        border-width: 1.5px !important;
    }
    
    #chart-actions .btn-small {
        min-height: 44px !important;
        height: auto !important;
        max-height: none !important;
        padding: 8px 14px !important;
        line-height: 1 !important;
    }

    .btn-success {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        color: white;
        box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
    }

    .btn-success:hover {
        background: linear-gradient(135deg, #059669 0%, #047857 100%);
        box-shadow: 0 6px 24px rgba(16, 185, 129, 0.5);
        transform: translateY(-2px);
    }

    /* Badge for selected count */
    .badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 4px 10px;
        border-radius: 12px;
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(59, 130, 246, 0.4) 100%);
        color: #93c5fd;
        font-size: 0.75rem;
        font-weight: 700;
        margin-left: 8px;
        border: 1px solid rgba(59, 130, 246, 0.4);
        min-width: 24px;
        box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
        animation: pulse 2s infinite;
    }

    @keyframes pulse {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.05); }
    }

    /* Responsive improvements */
    @media (max-width: 768px) {
        .visualization-container {
            padding: 16px;
        }

        .viz-header-actions {
            align-items: flex-start;
            width: 100%;
        }

        .viz-tabs-sticky {
            top: 0;
        }

        .viz-tabs-nav .viz-mode-card {
            flex: 1 1 calc(50% - 4px);
            padding: 8px 10px;
        }

        .viz-mode-desc {
            display: none;
        }

        .controls-grid {
            grid-template-columns: 1fr;
        }
        
        .plot-type-selector {
            flex-direction: column;
        }
        
        .action-buttons {
            flex-direction: column;
        }
    }

    .viz-workflow-step {
        display: flex;
        gap: 16px;
        margin-bottom: 24px;
        padding-bottom: 24px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    .viz-workflow-step:last-of-type {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
    .viz-step-badge {
        flex-shrink: 0;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: linear-gradient(135deg, #3b82f6, #2563eb);
        color: #fff;
        font-size: 0.8rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: 2px;
    }
    .viz-step-body { flex: 1; min-width: 0; }
    .viz-step-body {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    .viz-step-body > *,
    .viz-step-body .viz-shared-stock-panel,
    .viz-step-body [id$="-controls"],
    .viz-step-body .presets-panel,
    .viz-step-body .viz-optional-block,
    .viz-step-body .viz-chart-type-bar,
    .viz-step-body .viz-sector-axes-panel {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .viz-inset-panel {
        margin-top: 16px;
        padding: 14px 16px;
        background: rgba(15, 23, 42, 0.4);
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, 0.08);
    }
    .viz-regression-wrap {
        margin-top: 12px;
        max-width: 520px;
    }
    .viz-controls-footer {
        margin-left: 44px;
        max-width: calc(100% - 44px);
        box-sizing: border-box;
    }
    @media (max-width: 640px) {
        .viz-controls-footer {
            margin-left: 0;
            max-width: 100%;
        }
    }
    .viz-mode-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 10px;
    }
    .viz-mode-grid .viz-mode-card {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 12px 14px;
        background: rgba(15, 23, 42, 0.6);
        border: 1.5px solid rgba(255, 255, 255, 0.12);
        border-radius: 10px;
        cursor: pointer;
        text-align: left;
        transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    }
    .viz-mode-grid .viz-mode-card:hover {
        border-color: rgba(59, 130, 246, 0.45);
        background: rgba(30, 41, 59, 0.8);
    }
    .viz-mode-grid .viz-mode-card.active {
        border-color: #3b82f6;
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.15));
        box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
    }
    .viz-mode-title {
        font-size: 0.9rem;
        font-weight: 700;
        color: rgba(255, 255, 255, 0.95);
    }
    .viz-mode-desc {
        font-size: 0.72rem;
        color: rgba(255, 255, 255, 0.5);
        line-height: 1.3;
    }
    .viz-mode-hint {
        margin: 10px 0 0;
        font-size: 0.85rem;
        color: rgba(147, 197, 253, 0.9);
        line-height: 1.45;
    }
    .viz-chip-row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .viz-chip-row .plot-type-btn {
        padding: 10px 14px;
        font-size: 0.78rem;
        letter-spacing: 0.03em;
        text-transform: none;
    }

    .viz-field-label {
        font-size: 0.72rem;
        color: rgba(148, 163, 184, 0.95);
        margin: 0 0 8px;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        text-align: center;
        display: block;
        width: 100%;
    }
    .viz-optional-block,
    .viz-advanced-block {
        margin-top: 12px;
        padding: 10px 12px;
        background: rgba(15, 23, 42, 0.35);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 8px;
    }
    .viz-optional-block summary,
    .viz-advanced-block summary {
        cursor: pointer;
        font-size: 0.82rem;
        color: rgba(255, 255, 255, 0.65);
        user-select: none;
    }
    .viz-optional-block summary:hover,
    .viz-advanced-block summary:hover {
        color: rgba(255, 255, 255, 0.9);
    }
    .presets-panel-sub {
        font-weight: 400;
        opacity: 0.55;
        font-size: 0.78rem;
    }
    .viz-chart-type-bar {
        margin-top: 16px;
        padding: 14px 16px;
        background: rgba(15, 23, 42, 0.4);
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    .viz-correlation-method-panel {
        margin: 16px 0;
        padding: 14px 16px;
        background: rgba(59, 130, 246, 0.08);
        border: 1px solid rgba(59, 130, 246, 0.25);
        border-radius: 10px;
    }

    /* Section headers */
    .section-header {
        color: rgba(255, 255, 255, 0.95);
        font-size: 1rem;
        font-weight: 700;
        margin-bottom: 16px;
        text-transform: uppercase;
        letter-spacing: 1px;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .section-header::before {
        content: '';
        width: 4px;
        height: 20px;
        background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
        border-radius: 2px;
    }

    /* Info boxes */
    .info-box {
        margin-top: 16px;
        padding: 16px 20px;
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.2) 100%);
        border-radius: 10px;
        border: 1.5px solid rgba(16, 185, 129, 0.3);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
    }

    .info-box strong {
        color: rgba(255, 255, 255, 0.95);
        display: block;
        margin-bottom: 6px;
    }

    .info-box small {
        color: rgba(255, 255, 255, 0.8);
        font-size: 0.85rem;
        line-height: 1.6;
    }

    /* Selected stocks list */
    #selected-stocks-list {
        background: linear-gradient(135deg, rgba(15, 23, 42, 0.5) 0%, rgba(30, 41, 59, 0.4) 100%);
        border: 1.5px solid rgba(255, 255, 255, 0.1);
        border-radius: 10px;
        padding: 12px;
    }

    /* Tooltip improvements */
    .tooltip-icon {
        width: 18px;
        height: 18px;
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(59, 130, 246, 0.4) 100%);
        border: 1px solid rgba(59, 130, 246, 0.5);
    }

    /* Loading spinner improvements */
    .loading-spinner {
        width: 60px;
        height: 60px;
        border: 4px solid rgba(59, 130, 246, 0.2);
        border-top-color: #3b82f6;
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    }

    /* Helper text */
    .helper-text {
        font-size: 0.75rem;
        color: rgba(255, 255, 255, 0.6);
        margin-top: 6px;
        line-height: 1.4;
        font-style: italic;
    }

    .helper-text i {
        margin-right: 4px;
        color: rgba(59, 130, 246, 0.7);
    }

    /* Quick start guide */
    .quick-start-guide {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.2) 100%);
        border: 1.5px solid rgba(59, 130, 246, 0.3);
        border-radius: 12px;
        padding: 20px;
        margin-bottom: 24px;
        border-left: 4px solid #3b82f6;
    }

    .quick-start-guide h3 {
        color: rgba(255, 255, 255, 0.95);
        font-size: 1rem;
        font-weight: 700;
        margin-bottom: 12px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .quick-start-guide ol {
        margin: 0;
        padding-left: 20px;
        color: rgba(255, 255, 255, 0.85);
        line-height: 1.8;
    }

    .quick-start-guide li {
        margin-bottom: 8px;
    }

    .quick-start-guide strong {
        color: rgba(255, 255, 255, 0.95);
    }

    /* Mode description */
    .mode-description {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.5) 100%);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 10px;
        padding: 16px;
        margin-top: 16px;
        margin-bottom: 20px;
        color: rgba(255, 255, 255, 0.8);
        font-size: 0.85rem;
        line-height: 1.6;
    }

    .mode-description strong {
        color: rgba(255, 255, 255, 0.95);
        display: block;
        margin-bottom: 6px;
        font-weight: 600;
    }

    /* Step indicator */
    .step-indicator {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
        border-radius: 50%;
        color: white;
        font-size: 0.75rem;
        font-weight: 700;
        margin-right: 8px;
        flex-shrink: 0;
    }

    /* Common use cases */
    .use-cases {
        background: rgba(16, 185, 129, 0.1);
        border: 1px solid rgba(16, 185, 129, 0.3);
        border-radius: 10px;
        padding: 14px;
        margin-top: 12px;
        font-size: 0.8rem;
    }

    .use-cases strong {
        color: #10b981;
        display: block;
        margin-bottom: 6px;
    }

    .use-cases ul {
        margin: 0;
        padding-left: 20px;
        color: rgba(255, 255, 255, 0.75);
        line-height: 1.6;
    }

    .use-cases li {
        margin-bottom: 4px;
    }

    /* Better empty states */
    .empty-state-help {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.15) 100%);
        border: 1px dashed rgba(59, 130, 246, 0.4);
        border-radius: 10px;
        padding: 20px;
        margin-top: 16px;
        text-align: center;
    }

    .empty-state-help h4 {
        color: rgba(255, 255, 255, 0.9);
        font-size: 0.9rem;
        font-weight: 600;
        margin-bottom: 10px;
    }

    .empty-state-help p {
        color: rgba(255, 255, 255, 0.7);
        font-size: 0.8rem;
        margin: 6px 0;
        line-height: 1.6;
    }

    /* ── Preset chips ── */
    .presets-panel {
        margin-top: 18px;
        padding: 14px 16px;
        background: rgba(59, 130, 246, 0.06);
        border: 1px solid rgba(59, 130, 246, 0.2);
        border-radius: 10px;
    }
    .presets-panel-header {
        font-size: 0.72rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.6px;
        color: rgba(255,255,255,0.5);
        margin-bottom: 10px;
    }
    .presets-list {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .preset-item {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 5px 12px;
        background: rgba(59, 130, 246, 0.15);
        border: 1px solid rgba(59, 130, 246, 0.35);
        border-radius: 20px;
        font-size: 0.8rem;
        color: rgba(255,255,255,0.9);
        cursor: pointer;
        transition: all 0.18s ease;
        user-select: none;
    }
    .preset-item:hover {
        background: rgba(59, 130, 246, 0.35);
        border-color: rgba(59, 130, 246, 0.7);
        color: #fff;
        transform: translateY(-1px);
    }
    .preset-item.active {
        background: rgba(59, 130, 246, 0.45);
        border-color: rgba(96, 165, 250, 0.85);
        box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.35);
    }
    .preset-item:focus-visible {
        outline: 2px solid rgba(96, 165, 250, 0.85);
        outline-offset: 2px;
    }
    .preset-item i { font-size: 0.72rem; opacity: 0.8; }

    /* ── Attribute chip list (shown after stock loads) ── */
    #attribute-selection {
        margin-top: 16px;
        padding: 14px 16px 12px;
        background: rgba(15, 23, 42, 0.45);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 10px;
        display: none;
    }
    #attribute-selection .attr-section-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 12px;
    }
    #attribute-selection .attr-section-title {
        font-size: 0.72rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.6px;
        color: rgba(255,255,255,0.5);
        display: flex;
        align-items: center;
        gap: 6px;
    }
    #attribute-selection .attr-xy-legend {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 0.7rem;
        color: rgba(255,255,255,0.4);
    }
    #attribute-selection .attr-xy-legend .legend-x,
    #attribute-selection .attr-xy-legend .legend-y {
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }
    #attribute-selection .attr-xy-legend .badge-x {
        display: inline-flex; align-items: center; justify-content: center;
        width: 16px; height: 16px; border-radius: 50%;
        background: #3b82f6; color: #fff; font-size: 0.6rem; font-weight: 700;
    }
    #attribute-selection .attr-xy-legend .badge-y {
        display: inline-flex; align-items: center; justify-content: center;
        width: 16px; height: 16px; border-radius: 50%;
        background: #10b981; color: #fff; font-size: 0.6rem; font-weight: 700;
    }
    #attributes-list {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        max-height: 200px;
        overflow-y: auto;
    }
    #attributes-list::-webkit-scrollbar { width: 4px; }
    #attributes-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
    .attribute-item {
        padding: 4px 10px;
        background: rgba(255,255,255,0.06);
        border: 1px solid rgba(255,255,255,0.12);
        border-radius: 14px;
        font-size: 0.78rem;
        color: rgba(255,255,255,0.7);
        cursor: pointer;
        transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
        user-select: none;
        display: inline-flex;
        align-items: center;
        gap: 5px;
    }
    .attribute-item:hover {
        background: rgba(59,130,246,0.15);
        border-color: rgba(59,130,246,0.4);
        color: rgba(255,255,255,0.9);
    }
    /* X variable chip */
    .attribute-item.is-x {
        background: rgba(59,130,246,0.3);
        border-color: rgba(59,130,246,0.7);
        color: #fff;
        font-weight: 600;
    }
    .attribute-item.is-x::after {
        content: 'X';
        display: inline-flex; align-items: center; justify-content: center;
        width: 15px; height: 15px; border-radius: 50%;
        background: #3b82f6; color: #fff;
        font-size: 0.6rem; font-weight: 700; flex-shrink: 0;
    }
    /* Y variable chip */
    .attribute-item.is-y {
        background: rgba(16,185,129,0.2);
        border-color: rgba(16,185,129,0.6);
        color: #fff;
        font-weight: 600;
    }
    .attribute-item.is-y::after {
        content: 'Y';
        display: inline-flex; align-items: center; justify-content: center;
        width: 15px; height: 15px; border-radius: 50%;
        background: #10b981; color: #fff;
        font-size: 0.6rem; font-weight: 700; flex-shrink: 0;
    }
    .attribute-item.incompatible {
        opacity: 0.38;
        color: rgba(255, 255, 255, 0.35);
        background: rgba(255, 255, 255, 0.03);
        border-color: rgba(255, 255, 255, 0.06);
        cursor: not-allowed;
    }
    .attribute-item.incompatible:hover {
        background: rgba(255, 255, 255, 0.03);
        border-color: rgba(255, 255, 255, 0.06);
        color: rgba(255, 255, 255, 0.35);
    }
    .attribute-item.incompatible.is-x,
    .attribute-item.incompatible.is-y {
        opacity: 1;
        cursor: pointer;
    }
    .attr-category-label {
        width: 100%;
        font-size: 0.65rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: rgba(255,255,255,0.28);
        padding: 8px 2px 2px;
        margin-top: 2px;
    }
    .attr-category-label:first-child { padding-top: 0; }

    /* ── Action buttons bar ── */
    .action-buttons {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        align-items: center;
    }
    .action-buttons .btn { min-width: min(140px, 100%); }

    /* ── Stats panel improvements ── */
    .stats-panel {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: 12px;
        margin-top: 20px;
        padding: 16px;
        background: rgba(15, 23, 42, 0.4);
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 10px;
    }
    .stat-card {
        text-align: center;
        padding: 10px 8px;
        background: rgba(255,255,255,0.04);
        border-radius: 8px;
        border: 1px solid rgba(255,255,255,0.06);
    }
    .stat-label {
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: rgba(255,255,255,0.4);
        margin-bottom: 6px;
    }
    .stat-value {
        font-size: 1rem;
        font-weight: 700;
        color: rgba(255,255,255,0.95);
    }

    /* ── Chart toolbar ── */
    .chart-toolbar {
        position: absolute;
        top: 8px;
        right: 8px;
        display: flex;
        gap: 6px;
        z-index: 10;
    }
    .chart-toolbar-btn {
        width: 32px;
        height: 32px;
        border-radius: 6px;
        border: 1px solid rgba(255,255,255,0.15);
        background: rgba(15,23,42,0.85);
        color: rgba(255,255,255,0.7);
        font-size: 0.85rem;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.15s;
    }
    .chart-toolbar-btn:hover { background: rgba(59,130,246,0.25); color: #fff; border-color: rgba(59,130,246,0.5); }

    /* Transitions on interactive controls only (avoids sluggish Plotly redraws) */
    .viz-mode-card, .plot-type-btn, .preset-item, .attribute-item, .btn, .chart-toolbar-btn,
    .sector-preset-btn, .viz-step-badge {
        transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease,
                    transform 0.2s ease, box-shadow 0.2s ease;
    }
    @media (prefers-reduced-motion: reduce) {
        .visualization-container,
        .viz-mode-card,
        .plot-type-btn,
        .preset-item,
        .attribute-item,
        .chart-toolbar-btn,
        .loading-spinner,
        .empty-state-icon,
        .badge {
            animation: none !important;
            transition: none !important;
        }
        .btn-success:hover,
        .viz-mode-card:hover {
            transform: none !important;
        }
    }

    /* Bauhaus readability floor — no text below 14px on this page */
    .visualization-container .control-hint,
    .visualization-container .viz-mode-desc,
    .visualization-container .presets-panel-sub,
    .visualization-container summary,
    .visualization-container .section-header,
    .visualization-container label {
        font-size: 0.875rem;
    }
