        /* ─── Analyst Sidebar Layout ─────────────────────────────────── */
        .analyst-topbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 10px 0 18px;
            flex-wrap: wrap;
        }
        .analyst-topbar-left {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }
        .analyst-topbar-left .mode-button,
        .analyst-topbar-left .export-button,
        .analyst-topbar-left .refresh-button {
            font-size: 0.78rem;
            padding: 7px 14px;
        }
        .analyst-search-wrap {
            position: relative;
            width: 36px;
            height: 36px;
            cursor: pointer;
            transition: width 0.25s ease;
            overflow: hidden;
            border-radius: 10px;
            border: 1px solid var(--line);
            background: rgba(255, 255, 255, 0.04);
        }
        .analyst-search-wrap.expanded {
            width: 220px;
        }
        .analyst-search-wrap input {
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            padding: 0 12px 0 34px;
            border-radius: 10px;
            border: none;
            background: transparent;
            color: var(--text);
            font-size: 0.82rem;
            font-family: inherit;
            outline: none;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s ease;
        }
        .analyst-search-wrap.expanded input {
            opacity: 1;
            pointer-events: auto;
        }
        .analyst-search-wrap input:focus { border-color: var(--accent); }
        .analyst-search-wrap svg {
            position: absolute;
            left: 10px;
            top: 50%;
            transform: translateY(-50%);
            width: 16px;
            height: 16px;
            color: var(--muted-soft);
        }

        .analyst-shell {
            display: flex;
            gap: 0;
            min-height: 80vh;
        }
        /* Page-level sidebar (ChatGPT-style) */
        .page-sidebar {
            position: fixed;
            top: 0;
            bottom: 0;
            left: 0;
            width: 20%;
            min-width: 220px;
            max-width: 280px;
            height: 100dvh;
            max-height: 100dvh;
            background: var(--apple-bg-primary);
            border-right: 0.5px solid var(--apple-separator);
            border-radius: 0;
            display: flex;
            flex-direction: column;
            z-index: 500;
            overflow: hidden;
            transform: translateX(-100%);
            transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        }
        body.sidebar-open .page-sidebar {
            transform: translateX(0);
        }
        .page-sidebar-nav {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            gap: 2px;
            min-height: 0;
            padding: 10px 0;
            overflow-y: auto;
        }
        .page-sidebar-tab {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 16px;
            border: none;
            background: none;
            color: var(--apple-label-secondary);
            font-family: var(--apple-font);
            font-size: 15px;
            font-weight: 400;
            cursor: pointer;
            border-radius: 8px;
            margin: 0 8px;
            text-align: left;
            transition: background 0.15s, color 0.15s;
            white-space: nowrap;
        }
        .page-sidebar-tab:hover { background: rgba(255,255,255,0.06); color: var(--apple-label); }
        .page-sidebar-tab.active {
            background: rgba(255,255,255,0.1);
            color: var(--apple-label);
            font-weight: 600;
        }
        .page-sidebar-tab svg {
            width: 20px;
            height: 20px;
            flex-shrink: 0;
        }

        /* ── Drag-to-reorder handle ──────────────────────────────────── */
        .tab-drag-handle {
            margin-left: auto;
            padding: 2px 4px;
            opacity: 0;
            cursor: grab;
            flex-shrink: 0;
            line-height: 0;
            color: currentColor;
            transition: opacity 0.15s;
        }
        .tab-drag-handle:active { cursor: grabbing; }
        .page-sidebar-tab:hover .tab-drag-handle,
        .page-sidebar-tab.active .tab-drag-handle { opacity: 0.4; }

        /* Dragging state — tab goes translucent while ghost follows finger */
        .tab-dragging { opacity: 0.15; }

        .page-sidebar-footer {
            padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
            border-top: 0.5px solid var(--apple-separator);
            margin-top: auto;
            flex-shrink: 0;
        }
        .sidebar-profile {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 16px;
            margin: 4px 8px 0;
            border-radius: 8px;
            cursor: pointer;
            position: relative;
            transition: background 0.15s;
        }
        .sidebar-profile:hover { background: rgba(255,255,255,0.06); }
        .sidebar-profile-photo {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            object-fit: cover;
        }
        .sidebar-profile-name {
            font-size: 13px;
            font-weight: 500;
            color: var(--apple-label-secondary);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .sidebar-profile .profile-menu {
            bottom: 100%;
            top: auto;
            left: 8px;
            margin-bottom: 8px;
        }
        body {
            transition: padding-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        }
        body.sidebar-open {
            padding-left: calc(clamp(220px, 20%, 280px) + 24px);
        }
        .analyst-content {
            flex: 1;
            min-width: 0;
            padding: 0 40px 0 32px;
        }
        @keyframes tabEnter {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .analyst-tab-panel { display: none; }
        .analyst-tab-panel.active {
            display: block;
            animation: tabEnter 0.22s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .summary-corridor-heading {
            font-family: var(--apple-font);
            font-size: 20px;
            font-weight: 700;
            color: var(--apple-label);
            margin-bottom: 16px;
            line-height: 1.2;
        }
        .summary-section-heading {
            font-family: var(--apple-font);
            font-size: 20px;
            font-weight: 700;
            color: var(--apple-label);
            margin: 28px 0 12px;
            line-height: 1.2;
            letter-spacing: -0.02em;
        }
        .summary-section-heading:first-child {
            margin-top: 0;
        }
        .summary-best-steps {
            margin-top: 16px;
            margin-bottom: 16px;
            background: var(--apple-bg-primary);
            border-radius: 12px;
            overflow: hidden;
        }
        .summary-best-steps .summary-steps-label {
            font-family: var(--apple-font);
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            color: var(--apple-label-tertiary);
            padding: 12px 16px 0;
            margin-bottom: 0;
        }
        .summary-best-steps {
            counter-reset: step-counter;
        }
        .summary-best-steps .step {
            position: relative;
            padding: 10px 16px 10px 48px;
            font-size: 15px;
            color: var(--apple-label);
            border-bottom: 0.5px solid var(--apple-separator);
            line-height: 1.47;
            counter-increment: step-counter;
        }
        .summary-best-steps .step::before {
            content: counter(step-counter);
            position: absolute;
            left: 16px;
            top: 12px;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background: rgba(48, 209, 88, 0.15);
            color: var(--apple-green);
            font-family: var(--apple-mono);
            font-size: 11px;
            font-weight: 700;
            line-height: 22px;
            text-align: center;
        }
        .summary-best-steps .step:last-child { border-bottom: none; }

        .adv-paths-section {
            margin-top: 20px;
            padding: 16px;
            border-radius: 12px;
            background: var(--apple-bg-primary);
        }
        .adv-paths-divider { display: none; }
        .adv-paths-tag {
            display: inline-block;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--apple-label-tertiary);
            margin-bottom: 4px;
        }
        .adv-paths-title {
            font-family: var(--apple-font);
            font-size: 17px;
            font-weight: 600;
            color: var(--apple-label);
            margin-bottom: 4px;
        }
        .adv-paths-desc {
            color: var(--apple-label-secondary);
            font-size: 13px;
            line-height: 1.4;
            margin: 0 0 8px;
        }
        .adv-paths-begin {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            margin-top: 4px;
            padding: 10px 16px;
            border-radius: 10px;
            border: none;
            background: var(--apple-blue);
            color: #fff;
            font-family: var(--apple-font);
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
        }
        .adv-paths-begin:hover { opacity: 0.85; }
        .adv-paths-discovering {
            padding: 28px 0;
            text-align: center;
        }
        .adv-paths-dots {
            font-size: 1rem;
            color: var(--muted);
            letter-spacing: 0.04em;
        }
        .adv-paths-dots::after {
            content: '';
            animation: adv-dots 1.5s steps(4, end) infinite;
        }
        @keyframes adv-dots {
            0%   { content: ''; }
            25%  { content: '.'; }
            50%  { content: '..'; }
            75%  { content: '...'; }
            100% { content: ''; }
        }

        .download-range-grid {
            display: grid;
            grid-template-columns: 1fr auto 1fr;
            gap: 12px;
            align-items: end;
            margin-bottom: 16px;
        }
        .download-range-grid label {
            font-size: 0.75rem;
            color: var(--muted);
            display: block;
            margin-bottom: 4px;
        }
        .download-range-grid input[type="datetime-local"] {
            width: 100%;
            padding: 7px 10px;
            border-radius: 8px;
            border: 1px solid var(--line);
            background: var(--panel-soft);
            color: var(--text);
            font-family: inherit;
            font-size: 0.8rem;
        }
        .download-range-grid .range-arrow {
            color: var(--muted-soft);
            font-size: 1.1rem;
            padding-bottom: 6px;
        }

        @media (max-width: 768px) {
            .page-sidebar {
                width: 200px;
                min-width: 200px;
            }
            body.sidebar-open {
                padding-left: 212px;
            }
            body.sidebar-open .results-topbar {
                left: 212px;
            }
            .analyst-content { padding: 16px 0 0; }
        }
        /* Sidebar mobile-only quick actions */
        .sidebar-mobile-actions {
            display: none;
            flex-direction: column;
            gap: 2px;
            padding: 0 0 8px;
            flex-shrink: 0;
        }

        /* Search row inside sidebar (mobile only) */
        .sidebar-search-row {
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 0 8px 4px;
            padding: 8px 12px;
            border-radius: 8px;
            border: none;
            background: var(--apple-bg-tertiary);
        }
        .sidebar-search-row svg {
            width: 16px;
            height: 16px;
            color: var(--muted);
            flex-shrink: 0;
        }
        .sidebar-search-row input {
            flex: 1;
            background: none;
            border: none;
            outline: none;
            color: var(--text);
            font-family: inherit;
            font-size: 0.85rem;
            min-width: 0;
        }
        .sidebar-search-row input::placeholder {
            color: var(--muted-soft);
        }
        .sidebar-mobile-divider {
            height: 1px;
            background: var(--line);
            margin: 8px 12px 10px;
        }
        .sidebar-mobile-action-btn {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px 16px;
            border: none;
            background: none;
            color: var(--muted);
            font-family: inherit;
            font-size: 0.85rem;
            font-weight: 500;
            cursor: pointer;
            border-radius: 10px;
            margin: 0 8px;
            text-align: left;
            white-space: nowrap;
            transition: background 0.15s, color 0.15s;
        }
        .sidebar-mobile-action-btn:hover,
        .sidebar-mobile-action-btn:active {
            background: var(--panel-soft);
            color: var(--text);
        }
        .sidebar-mobile-action-btn svg {
            width: 18px;
            height: 18px;
            flex-shrink: 0;
        }
        .live-rates-btn-wrap {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 2px;
        }
        .last-updated-text {
            font-size: 0.68rem;
            color: var(--muted-soft);
            padding-left: 18px;
            opacity: 0;
            transition: opacity 0.3s;
        }
        .last-updated-text.visible {
            opacity: 1;
        }

        /* ── Sidebar backdrop (mobile only) ── */
        .sidebar-backdrop {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 499;
            background: rgba(0, 0, 0, 0.45);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.25s ease;
        }
        .sidebar-backdrop.visible {
            opacity: 1;
            pointer-events: auto;
        }

        /* Hamburger toggle — visible after results load */
        .sidebar-toggle-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            border: none;
            border-radius: 10px;
            background: transparent;
            color: var(--muted);
            cursor: pointer;
            flex-shrink: 0;
            transition: background 0.15s, color 0.15s;
            -webkit-tap-highlight-color: transparent;
        }
        .sidebar-toggle-btn:hover,
        .sidebar-toggle-btn:active {
            background: rgba(255,255,255,0.08);
            color: var(--text);
        }
        .sidebar-toggle-btn svg {
            width: 20px;
            height: 20px;
        }

        /* Hide hamburger during loading (before results-ready class is added) */
        body:not(.results-ready) .sidebar-toggle-btn {
            display: none !important;
        }

        /* ── ChatGPT-style mobile sidebar ── */
        @media (max-width: 520px) {
            /* Sidebar becomes a slide-over overlay */
            .page-sidebar {
                top: 0;
                bottom: 0;
                left: 0;
                width: min(82vw, 300px) !important;
                min-width: 0;
                max-width: 300px;
                height: 100dvh;
                max-height: 100dvh;
                border-radius: 0 18px 18px 0;
                transform: translateX(-100%);
                transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
                box-shadow: none;
                overflow: hidden;
            }
            .page-sidebar.sidebar-touch-open {
                transform: translateX(0);
                box-shadow: 6px 0 32px rgba(0,0,0,0.6);
            }
            /* Remove hover/focus expand — only JS controls it */
            .page-sidebar:hover,
            .page-sidebar:focus-within {
                width: min(82vw, 300px);
                transform: translateX(-100%);
                overflow: hidden;
                box-shadow: none;
            }
            .page-sidebar.sidebar-touch-open:hover,
            .page-sidebar.sidebar-touch-open:focus-within {
                transform: translateX(0);
                box-shadow: 6px 0 32px rgba(0,0,0,0.6);
            }
            /* Backdrop shown on mobile */
            .sidebar-backdrop {
                display: block;
            }
            /* Body does NOT shift — sidebar overlays content, restore natural padding */
            body.sidebar-open {
                padding-left: env(safe-area-inset-left);
            }
            body.sidebar-open .results-topbar {
                left: 0;
            }
            /* Absolute guard: sidebar NEVER shows on mobile unless sidebar-touch-open is set */
            .page-sidebar:not(.sidebar-touch-open) {
                transform: translateX(-100%) !important;
                pointer-events: none !important;
            }
            /* Lock scroll when sidebar open (position:fixed needed for iOS Safari) */
            body.sidebar-mobile-open,
            body.scroll-locked {
                overflow: hidden;
                position: fixed;
                width: 100%;
                overscroll-behavior: none;
            }
            /* Depth blur: dim & blur results content behind open sidebar */
            #resultsArea, #analystTopbar, .results-topbar {
                transition: filter 0.28s ease;
            }
            body.sidebar-mobile-open #resultsArea,
            body.sidebar-mobile-open #analystTopbar,
            body.sidebar-mobile-open .results-topbar {
                filter: blur(3px) brightness(0.7);
                pointer-events: none;
            }
            /* Show sidebar mobile actions as a horizontal icon row */
            .sidebar-mobile-actions {
                display: flex !important;
                flex-direction: row;
                justify-content: center;
                align-items: center;
                gap: 8px;
                padding: 8px 12px 10px;
            }
            .sidebar-mobile-divider {
                display: none;
            }
            /* Icon-only square buttons */
            .sidebar-mobile-action-btn {
                width: 44px;
                height: 44px;
                padding: 0;
                margin: 0;
                justify-content: center;
                border: 1px solid var(--line);
                border-radius: 12px;
            }
            .sidebar-mobile-action-btn .lr-btn-text,
            .sidebar-mobile-action-btn span:not(.lr-btn-fill) {
                display: none;
            }
            /* Search: icon-only, expands on focus */
            .sidebar-search-row {
                width: 44px;
                height: 44px;
                padding: 0;
                margin: 0;
                justify-content: center;
                border-radius: 12px;
                overflow: hidden;
                transition: width 0.25s ease, padding 0.25s ease;
                flex-shrink: 0;
            }
            .sidebar-search-row svg {
                flex-shrink: 0;
            }
            .sidebar-search-row input {
                width: 0;
                padding: 0;
                transition: width 0.25s ease;
            }
            .sidebar-search-row:focus-within {
                width: 160px;
                padding: 0 12px;
            }
            .sidebar-search-row:focus-within input {
                width: auto;
            }
            /* Larger touch targets for nav items */
            .page-sidebar-tab {
                padding: 13px 18px;
                margin: 0 6px;
                font-size: 0.9rem;
            }
            .page-sidebar-tab svg {
                width: 20px;
                height: 20px;
            }
            .analyst-content {
                padding: 16px 0 0;
            }
            /* Hamburger button */
            .sidebar-toggle-btn {
                display: flex;
                align-items: center;
                justify-content: center;
                width: 40px;
                height: 40px;
                border: none;
                border-radius: 10px;
                background: transparent;
                color: var(--muted);
                cursor: pointer;
                flex-shrink: 0;
                transition: background 0.15s, color 0.15s;
                -webkit-tap-highlight-color: transparent;
            }
            .sidebar-toggle-btn:hover,
            .sidebar-toggle-btn:active {
                background: rgba(255,255,255,0.08);
                color: var(--text);
            }
            .sidebar-toggle-btn svg {
                width: 22px;
                height: 22px;
            }
        }
