:root {
            /* Apple dark mode palette */
            --apple-bg: #000000;
            --apple-surface-1: #272729;
            --apple-surface-2: #262628;
            --apple-surface-3: #28282a;
            --apple-text-primary: #ffffff;
            --apple-text-secondary: rgba(255, 255, 255, 0.6);
            --apple-text-tertiary: rgba(255, 255, 255, 0.45);
            --apple-blue: #0071e3;
            --apple-blue-soft: rgba(0, 113, 227, 0.08);
            --apple-accent-warm: #ff9f0a;
            --apple-accent-teal: #5ac8fa;
            --apple-divider: rgba(255, 255, 255, 0.12);
            --apple-card-shadow: rgba(0, 0, 0, 0.22) 3px 5px 30px 0px;
            --apple-sticky-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
            /* Functional data colors */
            --data-bitget: #2997ff;
            --data-binance: #e8a43e;
            --data-positive: #30d158;
            --data-negative: #ff453a;
            --data-positive-alpha-08: rgba(48, 209, 88, 0.08);
            --data-positive-alpha-10: rgba(48, 209, 88, 0.10);
            --data-positive-alpha-12: rgba(48, 209, 88, 0.12);
            --data-positive-alpha-15: rgba(48, 209, 88, 0.15);
            --data-positive-alpha-18: rgba(48, 209, 88, 0.18);
            --data-positive-alpha-22: rgba(48, 209, 88, 0.22);
            --data-positive-alpha-25: rgba(48, 209, 88, 0.25);
            --data-positive-alpha-28: rgba(48, 209, 88, 0.28);
            --data-positive-alpha-30: rgba(48, 209, 88, 0.30);
            --data-positive-alpha-88: rgba(48, 209, 88, 0.88);
            --data-positive-alpha-95: rgba(48, 209, 88, 0.95);
            --data-negative-alpha-07: rgba(255, 69, 58, 0.07);
            --data-negative-alpha-10: rgba(255, 69, 58, 0.10);
            --data-negative-alpha-12: rgba(255, 69, 58, 0.12);
            --data-negative-alpha-14: rgba(255, 69, 58, 0.14);
            --data-negative-alpha-15: rgba(255, 69, 58, 0.15);
            --data-negative-alpha-18: rgba(255, 69, 58, 0.18);
            --data-negative-alpha-20: rgba(255, 69, 58, 0.20);
            --data-negative-alpha-30: rgba(255, 69, 58, 0.30);
            --data-positive-bright: #00d85a;
            --data-positive-bright-alpha-28: rgba(0, 255, 106, 0.28);
            --data-positive-bright-shadow: rgba(0, 255, 106, 0.14);
            --data-total: #5ac8fa;
            /* Structural overlay colors (dark default) */
            --apple-header-bg: rgba(0, 0, 0, 0.8);
            --apple-overlay-subtle: rgba(255, 255, 255, 0.03);
            --apple-overlay-light: rgba(255, 255, 255, 0.04);
            --apple-overlay: rgba(255, 255, 255, 0.06);
            --apple-overlay-medium: rgba(255, 255, 255, 0.08);
            --apple-overlay-strong: rgba(255, 255, 255, 0.12);
            --apple-hover-border: rgba(255, 255, 255, 0.24);
            /* Chart SVG colors (dark default) */
            --apple-chart-invested: rgba(255, 255, 255, 0.55);
            --apple-chart-guide: rgba(255, 255, 255, 0.18);
            --apple-tooltip-bg: rgba(24, 24, 26, 0.96);
            --apple-tooltip-border: rgba(255, 255, 255, 0.12);
            --apple-tooltip-text: #ffffff;
            /* Elevation shadows (theme-aware) */
            --apple-shadow-popover: 0 8px 32px rgba(0, 0, 0, 0.45);
            --apple-shadow-tooltip: 0 4px 16px rgba(0, 0, 0, 0.4);
            --apple-chart-grid: rgba(255, 255, 255, 0.10);
            --apple-chart-text: rgba(255, 255, 255, 0.75);
            --apple-chart-text-dim: rgba(255, 255, 255, 0.50);
            --apple-chart-crosshair: rgba(255, 255, 255, 0.32);
            --apple-chart-color: rgba(255, 255, 255, 0.80);
            /* Display serif — editorial figures for logo and large numbers.
               System faces only (no webfont): Georgia covers Latin/numerals on
               every platform; CJK serif fallbacks keep Chinese glyphs coherent
               without the weight or availability problems of a webfont in CN. */
            --font-display: Georgia, 'Times New Roman', 'Songti SC', SimSun, 'Noto Serif SC', 'Source Han Serif SC', serif;
            /* Type scale */
            --text-xs: 12px;
            --text-sm: 13px;
            --text-base: 14px;
            --text-lg: 16px;
            --text-xl: 22px;
            --text-2xl: 32px;
            /* Spacing scale */
            --space-xs: 4px;
            --space-sm: 8px;
            --space-md: 12px;
            --space-lg: 16px;
            --space-xl: 24px;
            --space-2xl: 32px;
            /* Transition tokens */
            --transition-fast: 0.15s ease;
            --transition-normal: 0.25s ease;
            --transition-slow: 0.4s ease;
            /* Border-radius scale */
            --radius-sm: 6px;
            --radius-md: 8px;
            --radius-lg: 12px;
            --radius-full: 999px;
        }
[data-theme="light"] {
            /* Apple light mode palette — bg gray, surfaces white */
            --apple-bg: #f2f2f7;
            --apple-surface-1: #ffffff;
            --apple-surface-2: #f5f5f7;
            --apple-surface-3: #fafafa;
            --apple-text-primary: #1d1d1f;
            --apple-text-secondary: rgba(0, 0, 0, 0.55);
            --apple-text-tertiary: rgba(0, 0, 0, 0.4);
            --apple-blue-soft: rgba(0, 113, 227, 0.06);
            --apple-divider: rgba(0, 0, 0, 0.10);
            --apple-card-shadow: rgba(0, 0, 0, 0.04) 0 1px 8px 0px;
            --apple-sticky-shadow: 2px 0 6px rgba(0, 0, 0, 0.08);
            /* Structural overlay colors (light) */
            --apple-header-bg: rgba(255, 255, 255, 0.72);
            --apple-overlay-subtle: rgba(0, 0, 0, 0.02);
            --apple-overlay-light: rgba(0, 0, 0, 0.03);
            --apple-overlay: rgba(0, 0, 0, 0.04);
            --apple-overlay-medium: rgba(0, 0, 0, 0.05);
            --apple-overlay-strong: rgba(0, 0, 0, 0.10);
            --apple-hover-border: rgba(0, 0, 0, 0.20);
            /* Chart SVG colors (light) */
            --apple-chart-invested: rgba(0, 0, 0, 0.50);
            --apple-chart-guide: rgba(0, 0, 0, 0.14);
            --apple-tooltip-bg: rgba(255, 255, 255, 0.96);
            --apple-tooltip-border: rgba(0, 0, 0, 0.10);
            --apple-tooltip-text: #1d1d1f;
            /* Elevation shadows (theme-aware) */
            --apple-shadow-popover: 0 8px 32px rgba(0, 0, 0, 0.12);
            --apple-shadow-tooltip: 0 4px 16px rgba(0, 0, 0, 0.10);
            --apple-chart-grid: rgba(0, 0, 0, 0.06);
            --apple-chart-text: rgba(0, 0, 0, 0.50);
            --apple-chart-text-dim: rgba(0, 0, 0, 0.28);
            --apple-chart-crosshair: rgba(0, 0, 0, 0.18);
            --apple-chart-color: rgba(0, 0, 0, 0.65);
        }
/* Red-up / green-down color scheme (A-share convention).
           Swaps the semantic meaning of --data-positive and --data-negative. */
html[data-color-scheme="red_up"] {
            --data-positive: #ff453a;
            --data-positive-alpha-08: rgba(255, 69, 58, 0.08);
            --data-positive-alpha-10: rgba(255, 69, 58, 0.10);
            --data-positive-alpha-12: rgba(255, 69, 58, 0.12);
            --data-positive-alpha-15: rgba(255, 69, 58, 0.15);
            --data-positive-alpha-18: rgba(255, 69, 58, 0.18);
            --data-positive-alpha-22: rgba(255, 69, 58, 0.22);
            --data-positive-alpha-25: rgba(255, 69, 58, 0.25);
            --data-positive-alpha-28: rgba(255, 69, 58, 0.28);
            --data-positive-alpha-30: rgba(255, 69, 58, 0.30);
            --data-positive-alpha-88: rgba(255, 69, 58, 0.88);
            --data-positive-alpha-95: rgba(255, 69, 58, 0.95);
            --data-negative: #30d158;
            --data-negative-alpha-07: rgba(48, 209, 88, 0.07);
            --data-negative-alpha-10: rgba(48, 209, 88, 0.10);
            --data-negative-alpha-12: rgba(48, 209, 88, 0.12);
            --data-negative-alpha-14: rgba(48, 209, 88, 0.14);
            --data-negative-alpha-15: rgba(48, 209, 88, 0.15);
            --data-negative-alpha-18: rgba(48, 209, 88, 0.18);
            --data-negative-alpha-20: rgba(48, 209, 88, 0.20);
            --data-negative-alpha-30: rgba(48, 209, 88, 0.30);
            --data-positive-bright: #ff453a;
            --data-positive-bright-alpha-28: rgba(255, 69, 58, 0.28);
            --data-positive-bright-shadow: rgba(255, 69, 58, 0.14);
        }
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
            font-family: -apple-system, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', Helvetica, Arial, sans-serif;
            background: var(--apple-bg);
            color: var(--apple-text-primary);
            letter-spacing: -0.01em;
            min-height: 100vh;
            font-size: var(--text-sm);
            line-height: 1.5;
        }

/* Route-specific server-rendered heading and trust metadata. */
.seo-page-intro {
            max-width: 1080px;
            margin: 0 0 20px;
            padding: 18px 20px;
            border: 1px solid var(--apple-divider);
            border-radius: var(--radius-lg);
            background: linear-gradient(135deg, var(--apple-blue-soft), var(--apple-surface-1));
        }
.seo-page-intro h1 {
            margin: 0;
            color: var(--apple-text-primary);
            font-size: clamp(24px, 3vw, 36px);
            line-height: 1.22;
            letter-spacing: -0.025em;
        }
.seo-page-summary {
            max-width: 900px;
            margin-top: 9px;
            color: var(--apple-text-secondary);
            font-size: var(--text-base);
            line-height: 1.75;
        }
@media (max-width: 640px) {
    .seo-page-intro { padding: 15px 16px; }
    .seo-page-intro h1 { font-size: 24px; }
}
.tab-bar h1.tab-btn {
    margin-top: 0;
    margin-bottom: -1px;
}
/* Header — compact brand area */
.header {
            position: relative;
            z-index: 10;
            min-height: 64px;
            padding: 14px 24px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 24px;
            background:
                radial-gradient(circle at 18% 0%, var(--vix-header-glow-a, rgba(0, 113, 227, 0.24)), transparent 34%),
                radial-gradient(circle at 82% 18%, var(--vix-header-glow-b, rgba(90, 200, 250, 0.16)), transparent 32%),
                linear-gradient(180deg, var(--vix-header-tint, var(--apple-surface-1)), var(--apple-bg));
            border-bottom: 1px solid var(--apple-divider);
            transition: background var(--transition-slow);
        }
.header.vix-bg-extreme-low {
            --vix-header-glow-a: rgba(255, 69, 58, 0.16);
            --vix-header-glow-b: rgba(255, 159, 10, 0.08);
            --vix-header-tint: rgba(255, 69, 58, 0.045);
        }
.header.vix-bg-low {
            --vix-header-glow-a: rgba(255, 69, 58, 0.10);
            --vix-header-glow-b: rgba(255, 159, 10, 0.055);
            --vix-header-tint: rgba(255, 69, 58, 0.03);
        }
.header.vix-bg-normal {
            --vix-header-glow-a: rgba(0, 113, 227, 0.06);
            --vix-header-glow-b: rgba(90, 200, 250, 0.04);
            --vix-header-tint: var(--apple-surface-1);
        }
.header.vix-bg-elevated {
            --vix-header-glow-a: rgba(48, 209, 88, 0.16);
            --vix-header-glow-b: rgba(48, 209, 88, 0.10);
            --vix-header-tint: rgba(48, 209, 88, 0.055);
        }
.header.vix-bg-high {
            --vix-header-glow-a: rgba(48, 209, 88, 0.22);
            --vix-header-glow-b: rgba(48, 209, 88, 0.14);
            --vix-header-tint: rgba(48, 209, 88, 0.075);
        }
.header.vix-bg-extreme {
            --vix-header-glow-a: rgba(0, 255, 106, 0.40);
            --vix-header-glow-b: rgba(48, 209, 88, 0.28);
            --vix-header-tint: rgba(0, 255, 106, 0.14);
        }
.logo { display: flex; align-items: center; gap: 12px; }
/* Header background trend: faint QQQ area chart behind the title text.
   Layered above the header's gradient background but below the text/buttons.
   overflow:hidden lives here (not on .header) so the settings dropdown can
   still spill outside the header. */
.header-trend {
            position: absolute;
            inset: 0;
            z-index: 0;
            overflow: hidden;
            pointer-events: none;
        }
.header-trend svg { display: block; width: 100%; height: 100%; }
.header-trend .ht-area   { fill: url(#htGrad); }
.header-trend .ht-stroke {
            fill: none;
            stroke: var(--header-trend-color, rgba(0, 113, 227, 0.10));
            stroke-width: 1.5;
            vector-effect: non-scaling-stroke;
            stroke-linejoin: round;
            stroke-linecap: round;
        }
/* ─── Header settings dropdown (shared by all app pages) ─── */
/* Anchor the menu from the left on small screens since the button moves to
   the left side of the header (flex-start). */
@media (max-width: 768px) {
    .header-settings-menu {
        right: auto;
        left: 0;
        max-width: calc(100vw - 32px);
    }
}
.header-settings-wrap { position: relative; }
.header-settings-btn {
            width: 28px; height: 28px;
            border-radius: var(--radius-md);
            border: none;
            background: transparent;
            color: var(--apple-text-tertiary);
            cursor: pointer;
            display: inline-flex; align-items: center; justify-content: center;
            flex-shrink: 0;
            transition: color var(--transition-fast);
        }
.header-settings-btn:hover { color: var(--apple-text-primary); }
.header-settings-btn svg { width: 18px; height: 18px; }
/* Hint animation: pulse + rotate + glow to reveal hidden content. Triggered via JS after 10s. */
.header-settings-btn.hint {
            animation: settings-hint 2s ease-in-out 3;
            color: var(--apple-blue);
            position: relative;
        }
.header-settings-btn.hint::after {
            content: '';
            position: absolute;
            inset: -4px;
            border-radius: var(--radius-lg);
            background: transparent;
            box-shadow: 0 0 0 0 rgba(0,113,227,0.5);
            animation: settings-ring 2s ease-out 3;
            pointer-events: none;
        }
@keyframes settings-hint {
            0%   { transform: scale(1) rotate(0deg); }
            15%  { transform: scale(1.25) rotate(25deg); }
            30%  { transform: scale(0.9) rotate(-10deg); }
            45%  { transform: scale(1.15) rotate(12deg); }
            60%  { transform: scale(0.95) rotate(0deg); }
            75%  { transform: scale(1.08) rotate(0deg); }
            100% { transform: scale(1) rotate(0deg); color: var(--apple-text-tertiary); }
        }
@keyframes settings-ring {
            0%   { box-shadow: 0 0 0 0 rgba(0,113,227,0.5); }
            50%  { box-shadow: 0 0 0 8px rgba(0,113,227,0); }
            100% { box-shadow: 0 0 0 0 rgba(0,113,227,0); }
        }
/* Breathing highlight for the new-feature link when menu is open */
.header-settings-menu a.highlight-link {
            animation: link-breathe 2.4s ease-in-out infinite;
        }
@keyframes link-breathe {
            0%, 100% { background: transparent; }
            50% { background: rgba(0,113,227,0.12); }
        }
.header-settings-menu {
            position: absolute; top: calc(100% + 8px); right: 0;
            min-width: 210px;
            background: var(--apple-surface-1);
            border: 1px solid var(--apple-divider);
            border-radius: var(--radius-lg);
            box-shadow: var(--apple-shadow-popover);
            padding: 6px;
            z-index: 100;
        }
.header-settings-menu a {
            display: flex; align-items: center; gap: 8px;
            padding: 8px 12px;
            border-radius: var(--radius-md);
            font-size: 13px;
            color: var(--apple-text-primary);
            text-decoration: none;
            transition: background 0.12s;
        }
.header-settings-menu a:hover { background: var(--apple-overlay); }
.header-settings-sep {
            height: 1px; background: var(--apple-divider);
            margin: 6px 10px;
        }
.header-settings-info {
            padding: 7px 12px;
            font-size: 12px;
            color: var(--apple-text-secondary);
            display: flex; align-items: center; gap: 6px;
            user-select: none;
        }
.header-settings-theme-row {
            cursor: pointer;
            border-radius: var(--radius-md);
            transition: background 0.12s;
        }
.header-settings-theme-row:hover { background: var(--apple-overlay); }
.header-settings-theme-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 15px;
            line-height: 1;
            flex-shrink: 0;
        }
.header-settings-theme-icon svg { width: 15px; height: 15px; display: block; }
.header-settings-link-icon {
            width: 16px; height: 16px;
            flex-shrink: 0;
        }
/* Theme icon: sun visible in dark (suggests switching to light), moon in light. */
#settingsThemeIcon .icon-sun { display: block; }
#settingsThemeIcon .icon-moon { display: none; }
[data-theme="light"] #settingsThemeIcon .icon-sun { display: none; }
[data-theme="light"] #settingsThemeIcon .icon-moon { display: block; }
/* Color-scheme icon: color auto-flips with --data-positive; arrow flips down in red-up. */
#settingsColorSchemeIcon { color: var(--data-positive); }
#settingsColorSchemeIcon .cs-arrow { transition: transform 0.25s ease; }
[data-color-scheme="red_up"] #settingsColorSchemeIcon .cs-arrow { transform: rotate(180deg); }
/* Language selector: click row to expand a pick list, chevron flips open. */
#settingsLangRow[aria-expanded="true"] .settings-lang-chevron { transform: rotate(180deg); }
.settings-lang-chevron {
            width: 13px; height: 13px; margin-left: auto;
            color: var(--apple-text-secondary);
            transition: transform 0.15s;
        }
.settings-lang-menu {
            display: flex; flex-direction: column;
            padding: 2px 6px 6px;
        }
.settings-lang-option {
            display: flex; align-items: center;
            padding: 7px 12px;
            border: none; background: none;
            border-radius: var(--radius-md);
            font-size: 13px;
            color: var(--apple-text-primary);
            text-align: left; cursor: pointer;
            transition: background 0.12s;
        }
.settings-lang-option:hover { background: var(--apple-overlay); }
.settings-lang-option[aria-selected="true"] { color: var(--apple-blue); font-weight: 600; }

/* Lift header content above the trend layer. */
.header-left, .status { position: relative; z-index: 1; }
.header-left {
            display: flex;
            align-items: center;
            align-self: center;
            gap: 16px;
            min-width: 0;
        }
.nav-links a.active { color: var(--apple-blue); }
.logo-text h1,
.logo-text .site-brand-name {
            font-family: var(--font-display);
            font-size: 22px;
            font-weight: 700;
            color: var(--apple-text-primary);
            letter-spacing: -0.5px;
            line-height: 1.15;
        }
.logo-text h1 a,
.logo-text .site-brand-name a {
            display: block;
            width: fit-content;
            margin-top: 4px;
            font-size: var(--text-xs);
            font-weight: 500;
            letter-spacing: -0.01em;
            color: var(--apple-blue) !important;
            opacity: 0.9;
        }
.logo-text p {
            font-size: var(--text-xs);
            color: var(--apple-text-secondary);
            margin-top: 4px;
        }
.logo-text p a {
            color: var(--apple-blue);
            text-decoration: none;
            transition: opacity var(--transition-fast);
        }
.logo-text p a:hover { opacity: 0.8; text-decoration: underline; }
.header-quick-links {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 6px;
            font-size: 12px;
            color: var(--apple-text-tertiary);
        }
.header-quick-label {
            color: var(--apple-text-tertiary);
        }
.header-quick-link {
            display: inline-flex;
            align-items: center;
            padding: 0;
            border: 0;
            background: transparent;
            color: var(--apple-text-tertiary);
            font-size: 12px;
            font-weight: 500;
            line-height: 1.4;
            text-decoration: none;
            transition: color var(--transition-fast), opacity var(--transition-fast);
        }
.header-quick-link:hover {
            color: var(--apple-blue);
            opacity: 0.9;
        }
.header-quick-sep {
            color: var(--apple-text-tertiary);
            opacity: 0.65;
        }
/* Status — simplified, no pill */
.status {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 8px;
            padding: 0;
            margin-top: 2px;
        }
.status-row {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 14px;
            flex-wrap: wrap;
        }
.site-url {
            color: #30d158;
            font-size: 13px;
            font-weight: 600;
            text-decoration: none;
            letter-spacing: -0.01em;
        }
.site-url:hover {
            color: #30d158;
            text-decoration: none;
            opacity: 0.82;
        }
.status-dot {
            width: 7px; height: 7px;
            flex-shrink: 0;
            background: var(--apple-text-tertiary);
            border-radius: 50%;
            transition: background var(--transition-normal);
        }
.status-dot.connected {
            background: #30d158; /* Apple green — allowed functional color */
        }
@keyframes spin {
    to { transform: rotate(360deg); }
}
/* Branded loading spinner: a gradient arc (Apple blue) rendered as a ring via
   mask. drop-shadow respects the masked pixels, giving the arc a soft glow.
   Gentle ease reads as a polished winding motion rather than a stock ring. */
.spinner {
            width: 20px; height: 20px;
            border-radius: 50%;
            flex-shrink: 0;
            background: conic-gradient(from 90deg, transparent 0deg, var(--apple-blue) 280deg, var(--apple-blue) 360deg);
            -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
            filter: drop-shadow(0 0 5px rgba(0, 113, 227, 0.35));
            animation: spin 0.9s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
            margin: 0 auto 10px;
        }
/* Loading text: soft breathing fade, subordinate to the spinner. */
.pc-loading span,
.loading-cell span,
.hd-loading span {
            animation: loading-text 1.8s ease-in-out infinite;
        }
@keyframes loading-text {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.55; }
        }
@media (prefers-reduced-motion: reduce) {
            .spinner {
                animation: none;
                background: var(--apple-divider);
                box-shadow: none;
            }
            .pc-loading span,
            .loading-cell span,
            .hd-loading span { animation: none; }
        }
.main {
            padding: 32px 24px;
            max-width: 1200px;
            margin: 0 auto;
        }
/* Controls — no card chrome, sit directly on black */
.controls-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 32px;
            padding: 0;
            background: transparent;
            border: none;
            border-radius: 0;
            flex-wrap: wrap;
            gap: 12px;
        }
.control-group {
            display: flex;
            align-items: center;
            gap: 12px;
        }
.control-label {
            font-size: 12px;
            color: var(--apple-text-tertiary);
        }
/* Custom date range */
/* Exchange grid — 1:1 horizontal */
/* Info chips in controls bar */
#dataPoints,  #lastUpdate {
            color: var(--apple-text-primary);
            font-weight: 600;
        }
/* Hero: Total Assets card */
/* Stat cards — no borders, no hover chrome */
/* Change chips row */
/* Charts section */
/* Transfer Records Section */
.transfer-tabs {
            display: flex;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
            /* Wrap content by default so the bar hugs its tabs (like .vix-view-tabs).
               Mobile media query forces full width for touch scrolling. */
            width: fit-content;
            max-width: 100%;
            background: var(--apple-surface-2);
            border-radius: var(--radius-md);
            padding: 3px;
            gap: 3px;
            flex-shrink: 0;
        }
.transfer-tabs::-webkit-scrollbar { display: none; }
.transfer-tab {
            padding: 6px 14px;
            border: none;
            background: transparent;
            color: var(--apple-text-secondary);
            font-size: 12px;
            font-weight: 500;
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all var(--transition-fast);
            white-space: nowrap;
            flex-shrink: 0;
            text-decoration: none;
        }
.transfer-tab:hover { color: var(--apple-text-primary); }
.transfer-tab.active { background: var(--apple-blue); color: #fff; }
.transfer-tabs h1.transfer-tab {
            margin: 0;
            font-family: inherit;
            line-height: inherit;
        }
#tab-knowledge .pc-monthly-header {
            align-items: flex-start;
            flex-wrap: wrap;
            gap: 10px;
        }
#tab-knowledge .pc-chart-title { flex: 0 0 100%; }
#tab-knowledge #kbSubTabs {
            width: 100%;
            margin-left: 0 !important;
        }
.transfer-table-wrap {
            overflow-x: auto;
            padding: 0 24px 16px;
        }
.transfer-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
        }
.transfer-table th {
            text-align: left;
            padding: 10px 12px;
            color: var(--apple-text-secondary);
            font-size: 12px;
            font-weight: 600;
            border-bottom: 1px solid var(--apple-overlay-medium);
            white-space: nowrap;
        }
.transfer-table td {
            padding: 10px 12px;
            color: var(--apple-text-primary);
            border-bottom: 1px solid var(--apple-overlay-light);
            white-space: nowrap;
        }
.transfer-table tbody tr:hover {
            background: var(--apple-overlay-subtle);
        }
.transfer-table .amount {
            text-align: right;
        }
/* Exchange badges — unified, no brand colors */
.transfer-table .exchange-badge {
            display: inline-block;
            padding: 2px 8px;
            border-radius: var(--radius-sm);
            font-size: var(--text-xs);
            font-weight: 600;
        }
/* ─── Unified loading states ─── */
/* Block loader: spinner + text row (shown by JS via inline display:flex). */
.pc-loading {
            display: none;
            align-items: center;
            gap: 8px;
            color: var(--apple-text-secondary);
            font-size: 13px;
            padding: 8px 0;
        }
.pc-loading .spinner { margin: 0; }
/* Table-cell loader: centered spinner + text inside a <td colspan>. */
.loading-cell {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 24px;
            color: var(--apple-text-secondary);
            font-size: 13px;
        }
.loading-cell .spinner { margin: 0; }
/* Responsive breakpoints */
@media (max-width: 768px) {
    .header,  .main { padding: 14px; }
    .header {
                min-height: 0;
                align-items: flex-start;
                flex-direction: column;
                gap: 14px;
            }
    .header-left { width: 100%; flex-direction: column; align-items: flex-start; gap: 8px; }
    .status {
                width: 100%;
                align-items: flex-start;
                gap: 8px;
            }
    .status-row {
                justify-content: flex-start;
                gap: 10px;
            }
    .site-url { align-self: flex-start; }
    .controls-bar { flex-direction: column; align-items: stretch; }
    .control-group { justify-content: space-between; }
    #pcYearlyParamsPanel .control-group {
                width: 100%;
                justify-content: flex-start;
                flex-wrap: wrap;
            }
    /* Transfer section responsive */
    .transfer-tabs { width: 100%; }
    .transfer-table-wrap { padding: 0 16px 16px; }
    /* Info chips stack on mobile */
}
@media (max-width: 480px) {
    .logo-text h1,
    .logo-text .site-brand-name { font-size: 18px; }
    .logo-text p { display: none; }
}
/* ─── VIX Fear Index ─── */
/* Header secondary line for VIX badge */
.vix-header-line {
            color: var(--apple-text-secondary);
            margin-top: 0;
            margin-bottom: 0;
            line-height: 1;
        }
/* Header badge */
.vix-header-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 2px 10px;
            border-radius: var(--radius-full);
            font-size: 12px;
            font-weight: 600;
            white-space: nowrap;
            vertical-align: middle;
            cursor: help;
            text-decoration: none;
        }
.vix-header-badge.has-tip {
            text-decoration-line: underline;
            text-decoration-style: dashed;
            text-decoration-thickness: 1px;
            text-underline-offset: 3px;
        }
.vix-header-badge.zone-loading {
            background: var(--apple-overlay);
            color: var(--apple-text-secondary);
        }
.vix-header-badge.zone-error {
            background: var(--data-negative-alpha-14);
            color: var(--data-negative);
        }
.vix-header-badge.zone-extreme-low {
            background: var(--data-negative-alpha-14);
            color: var(--data-negative);
        }
.vix-header-badge.zone-low {
            background: var(--data-negative-alpha-10);
            color: var(--data-negative);
        }
.vix-header-badge.zone-normal {
            background: var(--apple-overlay);
            color: var(--apple-text-primary);
        }
.vix-header-badge.zone-elevated {
            background: var(--data-positive-alpha-22);
            color: var(--data-positive);
        }
.vix-header-badge.zone-high {
            background: var(--data-positive-alpha-30);
            color: var(--data-positive);
        }
.vix-header-badge.zone-extreme {
            background: var(--data-positive-bright-alpha-28);
            color: var(--data-positive-bright);
            box-shadow: 0 0 0 1px var(--data-positive-bright-shadow) inset;
        }
/* VIX advice card */
.vix-advice-card {
            margin-bottom: 16px;
            padding: 14px 18px;
            background: var(--apple-surface-2);
            border-radius: var(--radius-md);
            border: 1px solid var(--apple-divider);
        }
.vix-advice-grid {
            display: flex;
            gap: 20px;
            align-items: center;
            flex-wrap: wrap;
        }
.vix-advice-item {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
.vix-advice-full {
            flex: 1 1 200px;
        }
.vix-advice-label {
            font-size: var(--text-xs);
            color: var(--apple-text-tertiary);
        }
.vix-advice-label.has-tip, 
        .pc-bt-summary-label.has-tip, 
        .etf-th-sort .has-tip, 
        .etf-ds-label.has-tip {
            cursor: help;
            text-decoration-line: underline;
            text-decoration-style: dashed;
            text-decoration-thickness: 1px;
            text-underline-offset: 3px;
        }
/* ── Custom instant tooltip (replaces slow native title tooltip) ── */
.custom-tip {
    position: fixed;
    z-index: 9999;
    max-width: 360px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: var(--apple-tooltip-bg);
    border: 1px solid var(--apple-tooltip-border);
    color: var(--apple-tooltip-text);
    font-size: var(--text-xs);
    line-height: 1.5;
    box-shadow: var(--apple-shadow-tooltip);
    pointer-events: none;
    word-break: break-word;
    white-space: pre-line;
}
.vix-advice-value {
            font-family: var(--font-display);
            font-size: 24px;
            font-weight: 700;
            font-variant-numeric: tabular-nums;
            color: var(--apple-text-primary);
        }
.vix-advice-stat {
            font-family: var(--font-display);
            font-size: 16px;
            font-weight: 700;
            font-variant-numeric: tabular-nums;
            color: var(--apple-text-primary);
        }
.vix-advice-zone {
            font-size: 14px;
            font-weight: 600;
            padding: 2px 10px;
            border-radius: var(--radius-full);
            display: inline-block;
            width: fit-content;
        }
.vix-advice-zone.zone-extreme-low {
            background: var(--data-negative-alpha-14);
            color: var(--data-negative);
        }
.vix-advice-zone.zone-low {
            background: var(--data-negative-alpha-10);
            color: var(--data-negative);
        }
.vix-advice-zone.zone-normal {
            background: var(--apple-overlay);
            color: var(--apple-text-primary);
        }
.vix-advice-zone.zone-elevated {
            background: var(--data-positive-alpha-22);
            color: var(--data-positive);
        }
.vix-advice-zone.zone-high {
            background: var(--data-positive-alpha-30);
            color: var(--data-positive);
        }
.vix-advice-zone.zone-extreme {
            background: var(--data-positive-bright-alpha-28);
            color: var(--data-positive-bright);
            box-shadow: 0 0 0 1px var(--data-positive-bright-shadow) inset;
        }
.vix-advice-tip {
            font-size: 13px;
            color: var(--apple-text-secondary);
            line-height: 1.4;
        }
.vix-view-tabs {
            width: fit-content;
            max-width: 100%;
            margin-bottom: 16px;
        }
.vix-threshold-controls {
            display: grid;
            grid-template-columns: repeat(4, minmax(135px, 1fr)) auto;
            gap: 10px;
            align-items: end;
            margin-bottom: 12px;
        }
.vix-threshold-field {
            display: flex;
            min-width: 0;
            flex-direction: column;
            gap: 6px;
        }
.vix-threshold-field .pc-bt-input {
            box-sizing: border-box;
            width: 100%;
            min-height: 34px;
        }
.vix-threshold-run {
            min-height: 34px;
            white-space: nowrap;
        }
.vix-threshold-note {
            margin: 0 0 14px;
            padding: 10px 12px;
            border: 1px solid var(--apple-divider);
            border-radius: var(--radius-md);
            background: var(--apple-surface-2);
            color: var(--apple-text-secondary);
            font-size: 12px;
            line-height: 1.6;
        }
.vix-threshold-table-wrap {
            max-height: 680px;
            overflow: auto;
            border: 1px solid var(--apple-divider);
            border-radius: var(--radius-md);
        }
.vix-threshold-table {
            width: 100%;
            min-width: 1160px;
            border-collapse: separate;
            border-spacing: 0;
            font-size: 12px;
        }
.vix-threshold-table th,
.vix-threshold-table td {
            padding: 9px 10px;
            border-right: 1px solid var(--apple-divider);
            border-bottom: 1px solid var(--apple-divider);
            text-align: right;
            white-space: nowrap;
            font-variant-numeric: tabular-nums;
        }
.vix-threshold-table th {
            position: sticky;
            top: 0;
            z-index: 2;
            background: var(--apple-surface-2);
            color: var(--apple-text-secondary);
            font-size: 11px;
            font-weight: 600;
        }
.vix-threshold-table th:first-child,
.vix-threshold-table td:first-child {
            position: sticky;
            left: 0;
            z-index: 1;
            background: var(--apple-surface-1);
            text-align: left;
        }
.vix-threshold-table th:first-child {
            z-index: 3;
            background: var(--apple-surface-2);
        }
.vix-threshold-table th:last-child,
.vix-threshold-table td:last-child { border-right: 0; }
.vix-threshold-table tr:last-child td { border-bottom: 0; }
.vix-forward-price {
            color: var(--apple-text-primary);
            font-weight: 600;
        }
.vix-forward-return {
            margin-left: 5px;
            font-weight: 600;
        }
.vix-forward-return.positive { color: var(--data-positive); }
.vix-forward-return.negative { color: var(--data-negative); }
.vix-threshold-empty {
            padding: 28px 16px;
            color: var(--apple-text-tertiary);
            text-align: center;
        }
@media (max-width: 900px) {
    .vix-threshold-controls {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
    .vix-threshold-run { width: 100%; }
}
@media (max-width: 480px) {
    .vix-threshold-controls { grid-template-columns: 1fr; }
}
/* ─── Exchange Rate Loss (汇率损失) ─── */
.fx-chart-options {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 8px 16px;
            margin: 2px 0 12px;
            padding: 8px 10px;
            border: 1px solid var(--apple-divider);
            border-radius: var(--radius-md);
            background: var(--apple-surface-2);
        }
.fx-chart-range { margin-left: 10px; color: var(--apple-text-tertiary); font-size: 12px; font-variant-numeric: tabular-nums; }
.fx-zoom-group { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.fx-zoom-hint { color: var(--apple-text-tertiary); font-size: 11px; white-space: nowrap; }
.fx-empty {
            text-align: center;
            padding: 48px 16px;
            color: var(--apple-text-tertiary);
            font-size: 13px;
        }
/* pan-y lets the page scroll vertically when touched over the chart; pinch-zoom
   keeps whole-page zoom on mobile. Horizontal drag is left to JS for panning. */
#fxSvg { user-select: none; touch-action: pan-y pinch-zoom; }
.fx-calc-card {
            margin-top: 18px;
            padding: 14px;
            border: 1px solid var(--apple-divider);
            border-radius: var(--radius-md);
            background: var(--apple-surface-1);
        }
.fx-calc-title { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.fx-calc-controls {
            display: grid;
            grid-template-columns: repeat(7, minmax(100px, 1fr));
            gap: 10px;
            align-items: end;
            margin-bottom: 12px;
        }
.fx-load-btn {
            min-height: 34px;
            white-space: nowrap;
            font-weight: 600;
        }
.fx-calc-note {
            margin: 0 0 12px;
            padding: 10px 12px;
            border: 1px solid var(--apple-divider);
            border-radius: var(--radius-md);
            background: var(--apple-surface-2);
            color: var(--apple-text-secondary);
            font-size: 12px;
            line-height: 1.6;
        }
.fx-calc-note.fx-calc-note-error { color: var(--data-negative); border-color: var(--data-negative); }
/* The exchange-loss detail table has 5 columns, not the 8 of the VIX threshold
   table it shares markup with — a smaller min-width avoids needless horizontal
   scrolling on phones. */
.fx-detail-table { min-width: 480px; }
/* ─── FX Calculator sub-view (mirrors DevTools exchange-tool visuals) ─── */
.fx-sub-tabs { margin-bottom: 14px; }
.fxcalc { display: flex; flex-direction: column; gap: 12px; }
.fxcalc-input-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.fxcalc-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fxcalc-label { color: var(--apple-text-secondary); font-size: 12px; font-weight: 600; }
.fxcalc-amount { width: 150px; min-height: 38px; }
.fxcalc-refresh { margin-left: auto; }
.fxcalc-status { min-height: 20px; padding: 4px 2px; color: var(--apple-text-secondary); font-size: 12px; line-height: 1.5; }
.fxcalc-status.is-ok { color: var(--data-positive); }
.fxcalc-status.is-warning { color: #ff9f0a; }
.fxcalc-status.is-error { color: var(--data-negative); }
.fxcalc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 8px; }
.fxcalc-head-title { margin: 0; color: var(--apple-text-primary); font-size: 14px; font-weight: 600; }
.fxcalc-table-wrap { overflow-x: auto; }
.fxcalc-table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            border: 1px solid var(--apple-divider);
            border-radius: var(--radius-md);
            overflow: hidden;
            font-size: 13px;
        }
.fxcalc-table th,
.fxcalc-table td {
            padding: 10px 14px;
            border-bottom: 1px solid var(--apple-divider);
            text-align: left;
            vertical-align: middle;
        }
.fxcalc-table tr:last-child td { border-bottom: 0; }
.fxcalc-table th { background: var(--apple-surface-2); color: var(--apple-text-secondary); font-size: 11px; font-weight: 600; }
.fxcalc-table td:nth-child(1) { width: 30%; }
.fxcalc-table td:nth-child(2) { width: 28%; }
.fxcalc-table td:nth-child(3) { width: auto; }
.fxcalc-table td:last-child { width: 1%; white-space: nowrap; }
.fxcalc-cell-currency .fxc-picker-trigger { border-color: transparent; background: transparent; }
.fxcalc-cell-currency .fxc-picker-trigger:hover,
.fxcalc-cell-currency .fxc-picker.is-open .fxc-picker-trigger { border-color: var(--apple-divider); background: var(--apple-surface-2); }
.fxcalc-cell-rate { color: var(--apple-text-secondary); font-size: 12px; font-variant-numeric: tabular-nums; }
.fxcalc-cell-rate > span { display: block; white-space: nowrap; }
.fxcalc-rate-reverse { color: var(--apple-text-tertiary); }
.fxcalc-cell-value { text-align: right; }
.fxcalc-cell-value strong { display: inline-block; color: var(--apple-text-primary); font-size: 14px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fxcalc-cell-value span { margin-left: 6px; color: var(--apple-text-tertiary); font-size: 11px; }
.fxcalc-cell-actions { text-align: right; white-space: nowrap; }
.fxcalc-cell-actions .pc-btn + .pc-btn { margin-left: 6px; }
.fxcalc-waiting { color: var(--apple-text-tertiary); }
.fxcalc-note { margin: 0; color: var(--apple-text-tertiary); font-size: 12px; line-height: 1.6; }
/* currency picker */
.fxc-picker { position: relative; width: 100%; }
.fxc-picker-trigger {
            width: 100%;
            min-height: 38px;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 5px 9px;
            border: 1px solid var(--apple-divider);
            border-radius: var(--radius-md);
            background: var(--apple-surface-1);
            color: var(--apple-text-primary);
            cursor: pointer;
            text-align: left;
        }
.fxc-picker-trigger:hover,
.fxc-picker.is-open .fxc-picker-trigger { border-color: var(--apple-accent, #2997ff); }
.fxc-picker-trigger:disabled { opacity: .45; cursor: default; }
.fxc-picker-mark { min-width: 22px; font-size: 15px; text-align: center; }
.fxc-picker-code { font-family: "SF Mono", "Cascadia Code", monospace; font-size: 12px; font-weight: 700; }
.fxc-picker-name { min-width: 0; flex: 1; overflow: hidden; color: var(--apple-text-secondary); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.fxc-picker-chevron { margin-left: auto; color: var(--apple-text-tertiary); font-size: 10px; }
.fxc-picker-add { white-space: nowrap; font-size: 12px; }
.fxc-picker.is-add { width: auto; }
.fxc-picker.is-add .fxc-picker-trigger { min-height: 32px; padding: 4px 10px; }
.fxc-popover {
            position: fixed;
            z-index: 50;
            width: min(340px, calc(100vw - 16px));
            padding: 6px;
            background: var(--apple-surface-1);
            border: 1px solid var(--apple-divider);
            border-radius: var(--radius-md);
            box-shadow: 0 8px 28px rgba(0, 0, 0, 0.20);
        }
.fxc-popover-search {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 0 8px;
            border: 1px solid var(--apple-divider);
            border-radius: var(--radius-md);
            background: var(--apple-surface-2);
            color: var(--apple-text-tertiary);
        }
.fxc-popover-search input {
            width: 100%;
            height: 36px;
            border: 0;
            outline: 0;
            background: transparent;
            color: var(--apple-text-primary);
            font-size: 13px;
        }
.fxc-popover-search input::placeholder { color: var(--apple-text-tertiary); }
.fxc-popover-list { max-height: 280px; margin-top: 4px; overflow-y: auto; overscroll-behavior: contain; }
.fxc-group-label { position: sticky; top: 0; z-index: 1; padding: 7px 8px 4px; background: var(--apple-surface-1); color: var(--apple-text-tertiary); font-size: 11px; font-weight: 700; }
.fxc-option {
            width: 100%;
            min-height: 38px;
            display: grid;
            grid-template-columns: 24px 46px minmax(0, 1fr) auto;
            align-items: center;
            gap: 6px;
            padding: 5px 7px;
            border: 0;
            border-radius: var(--radius-md);
            background: transparent;
            color: var(--apple-text-primary);
            cursor: pointer;
            text-align: left;
        }
.fxc-option:hover,
.fxc-option.is-selected { background: var(--apple-surface-2); }
.fxc-option.is-selected strong { color: var(--apple-accent, #2997ff); }
.fxc-option-mark { overflow: hidden; font-size: 14px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.fxc-option strong { font-family: "SF Mono", "Cascadia Code", monospace; font-size: 12px; font-weight: 700; }
.fxc-option > span:nth-child(3) { min-width: 0; overflow: hidden; color: var(--apple-text-secondary); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.fxc-option small { color: var(--apple-text-tertiary); font-size: 11px; }
.fxc-popover-empty { padding: 24px 12px; color: var(--apple-text-tertiary); font-size: 12px; text-align: center; }
/* history chips */
.fxcalc-history { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 2px; }
.fxcalc-history-label { color: var(--apple-text-tertiary); font-size: 12px; }
.history-chip {
            padding: 4px 10px;
            font-size: 12px;
            border: 1px solid var(--apple-divider);
            border-radius: var(--radius-full);
            background: var(--apple-surface-2);
            color: var(--apple-text-secondary);
            cursor: pointer;
        }
.history-chip:hover { border-color: var(--apple-text-tertiary); }
@media (max-width: 768px) {
    .fxcalc-input-row { flex-direction: column; align-items: stretch; }
    .fxcalc-amount { width: 100%; min-height: 44px; }
    .fxc-picker-trigger { min-height: 44px; }
    .fxc-picker.is-add .fxc-picker-trigger { min-height: 40px; }
    .fxcalc-refresh { margin-left: 0; width: 100%; }
    .fxcalc-table thead { display: none; }
    .fxcalc-table,
    .fxcalc-table tbody,
    .fxcalc-table tr,
    .fxcalc-table td { display: block; width: 100% !important; }
    .fxcalc-table tr { padding: 10px 12px; border-bottom: 1px solid var(--apple-divider); }
    .fxcalc-table td { padding: 4px 0; border-bottom: 0; }
    .fxcalc-cell-value,
    .fxcalc-cell-actions { text-align: left; }
}
@media (max-width: 900px) {
    .fx-calc-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .fx-calc-controls { grid-template-columns: 1fr; }
}
/* ─── Heatmap (treemap) ─── */
.market-pulse {
            margin-bottom: 14px;
            padding: 14px;
            border: 1px solid var(--apple-divider);
            border-radius: 16px;
            background: var(--apple-surface-1);
            box-shadow: var(--apple-card-shadow);
            transition: padding var(--transition-normal), border-radius var(--transition-normal), margin var(--transition-normal);
        }
.market-pulse.market-pulse-collapsed {
            margin-bottom: 10px;
            padding: 7px 11px;
            border-radius: 11px;
            box-shadow: none;
        }
.market-pulse-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            width: 100%;
            margin-bottom: 10px;
            padding: 0;
            border: 0;
            background: transparent;
            color: inherit;
            font: inherit;
            text-align: left;
            cursor: pointer;
        }
.market-pulse-title {
            color: var(--apple-text-primary);
            font-size: 14px;
            font-weight: 700;
            letter-spacing: 0.1px;
        }
.market-pulse-subtitle {
            color: var(--apple-text-tertiary);
            font-size: 10px;
            line-height: 1.5;
        }
.market-pulse-arrow {
            flex: none;
            color: var(--apple-text-tertiary);
            font-size: 15px;
            line-height: 1;
            transition: transform var(--transition-normal), color var(--transition-fast);
        }
.market-pulse-head:hover .market-pulse-arrow { color: var(--apple-text-secondary); }
.market-pulse-head[aria-expanded="false"] {
            margin-bottom: 0;
            min-height: 22px;
        }
.market-pulse-head[aria-expanded="false"] .market-pulse-subtitle { display: none; }
.market-pulse-head[aria-expanded="false"] .market-pulse-title {
            font-size: 12px;
            font-weight: 600;
            color: var(--apple-text-secondary);
        }
.market-pulse-head[aria-expanded="false"] .market-pulse-arrow {
            transform: rotate(180deg);
        }
.market-pulse-grid {
            display: grid;
            grid-template-columns: repeat(5, minmax(0, 1fr));
            gap: 8px;
        }
.market-pulse-grid[hidden] { display: none; }
.market-pulse-card {
            position: relative;
            min-width: 0;
            min-height: 92px;
            padding: 10px 11px;
            border: 1px solid var(--apple-divider);
            border-radius: 12px;
            background: var(--apple-overlay-subtle);
            color: var(--apple-text-primary);
            overflow: hidden;
            transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
        }
.market-pulse-card-colored {
            border-color: rgba(255, 255, 255, 0.10);
            background:
                linear-gradient(180deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.03) 42%, rgba(0,0,0,0.12) 100%),
                var(--pulse-bg);
            color: #fff;
            text-shadow: 0 0.6px 1.4px rgba(0, 0, 0, 0.35);
        }
button.market-pulse-card {
            width: 100%;
            text-align: left;
            font: inherit;
            cursor: pointer;
        }
button.market-pulse-card:hover {
            transform: translateY(-1px);
            border-color: var(--apple-border-strong);
        }
.market-pulse-card-top {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 6px;
            position: relative;
            z-index: 1;
        }
.market-pulse-name {
            min-width: 0;
            color: var(--apple-text-secondary);
            font-size: 11px;
            font-weight: 600;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
.market-pulse-card-colored .market-pulse-name { color: rgba(255, 255, 255, 0.88); }
.market-pulse-market {
            flex: none;
            padding: 1px 5px;
            border-radius: 999px;
            color: var(--apple-text-tertiary);
            background: var(--apple-overlay-light);
            font-size: 8px;
            font-weight: 700;
        }
.market-pulse-card-colored .market-pulse-market {
            color: rgba(255, 255, 255, 0.70);
            background: transparent;
        }
.market-pulse-price {
            display: block;
            margin-top: 9px;
            font-family: var(--font-display);
            font-size: 17px;
            font-weight: 720;
            font-variant-numeric: tabular-nums;
            letter-spacing: -0.3px;
            white-space: nowrap;
            position: relative;
            z-index: 1;
        }
.market-pulse-card-colored .market-pulse-price { color: #fff; }
.market-pulse-foot {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            gap: 5px;
            margin-top: 5px;
            position: relative;
            z-index: 1;
        }
.market-pulse-change {
            font-size: 12px;
            font-weight: 700;
            font-variant-numeric: tabular-nums;
        }
.market-pulse-change.pulse-up { color: var(--data-positive); }
.market-pulse-change.pulse-down { color: var(--data-negative); }
.market-pulse-card-colored .market-pulse-change {
            color: #fff;
        }
.market-pulse-date {
            color: var(--apple-text-tertiary);
            font-size: 8px;
            white-space: nowrap;
        }
.market-pulse-card-colored .market-pulse-date { color: rgba(255, 255, 255, 0.64); }
.market-pulse-error {
            margin-top: 18px;
            color: var(--apple-text-tertiary);
            font-size: 11px;
        }
.pulse-skeleton::after {
            content: "";
            position: absolute;
            inset: 0;
            background: linear-gradient(100deg, transparent 20%, var(--apple-overlay-light) 45%, transparent 70%);
            transform: translateX(-100%);
            animation: pulseSkeleton 1.2s ease-in-out infinite;
        }
@keyframes pulseSkeleton { to { transform: translateX(100%); } }
.hm-filter-toggle {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 10px;
            margin-bottom: 8px;
            border-radius: var(--radius-md);
            cursor: pointer;
            user-select: none;
            font-size: 12px;
            color: var(--apple-text-tertiary);
            background: var(--apple-overlay-subtle);
            border: 1px solid var(--apple-divider);
            width: fit-content;
            transition: color var(--transition-fast), background var(--transition-fast);
        }
.hm-filter-toggle:hover {
            color: var(--apple-text-secondary);
            background: var(--apple-overlay-light);
        }
.hm-filter-icon {
            font-size: 13px;
        }
.hm-filter-arrow {
            font-size: 10px;
            transition: transform 0.2s ease;
        }
.hm-filter-panel {
            margin-bottom: 12px;
        }
.hm-treemap-wrap {
            width: 100%;
            margin-top: 8px;
            border-radius: 14px;
            overflow: hidden;
            box-shadow: var(--apple-card-shadow);
        }
@keyframes hmWrapEnter {
            0% { opacity: 0; transform: scale(0.965); }
            60% { opacity: 1; }
            100% { opacity: 1; transform: scale(1); }
        }
.hm-treemap-wrap.hm-entering {
            animation: hmWrapEnter 0.5s cubic-bezier(0.2, 0.8, 0.3, 1);
            transform-origin: center top;
        }
.hm-treemap-svg {
            display: block;
            width: 100%;
            height: auto;
            max-height: 90vh;
        }
.hm-treemap-svg-inner {
            width: 100%;
            height: 100%;
        }
@keyframes hmCellPop {
            0% { opacity: 0; }
            70% { opacity: 1; }
            100% { opacity: 1; }
        }
@keyframes hmLabelFade {
            from { opacity: 0; }
            to { opacity: 1; }
        }
.hm-treemap-svg g.hm-cell {
            cursor: pointer;
            transform-box: fill-box;
            transform-origin: center;
            animation: hmCellPop 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
            transition: filter 0.18s ease;
        }
.hm-treemap-svg g.hm-cell:hover {
            filter: brightness(1.16) saturate(1.06);
        }
/* Breathing effect: return-ranked pulse after load */
.hm-treemap-svg g.hm-cell.hm-breathing {
            animation: hmBreathing 0.8s cubic-bezier(0.4, 0, 0.2, 1);
        }
@keyframes hmBreathing {
            0%, 100% {
                filter: brightness(1);
            }
            50% {
                filter: brightness(1.4) saturate(1.25);
            }
        }
.hm-treemap-svg text.hm-label {
            pointer-events: none;
            user-select: none;
            font-family: -apple-system, 'SF Pro Text', 'Helvetica Neue', sans-serif;
            letter-spacing: 0.2px;
            animation: hmLabelFade 0.35s ease-out backwards;
        }
/* ── HTML tooltip overlay ── */
.hm-tooltip {
            position: fixed;
            z-index: 9999;
            pointer-events: none;
            min-width: 168px;
            padding: 10px 14px;
            border-radius: 10px;
            background: var(--apple-tooltip-bg);
            border: 1px solid var(--apple-tooltip-border);
            color: var(--apple-tooltip-text);
            font-size: 12px;
            line-height: 1.5;
            box-shadow: var(--apple-shadow-popover);
            -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
        }
.hm-tooltip .hm-tt-sym {
            font-size: 14px;
            font-weight: 700;
            margin-bottom: 6px;
            color: var(--apple-text-primary);
        }
.hm-tooltip .hm-tt-name {
            font-size: 11px;
            font-weight: 500;
            color: var(--apple-text-tertiary);
        }
.hm-tooltip .hm-tt-row {
            display: flex;
            justify-content: space-between;
            gap: 18px;
            margin-top: 3px;
        }
.hm-tooltip .hm-tt-label { color: var(--apple-text-tertiary); }
.hm-tooltip .hm-tt-val {
            font-variant-numeric: tabular-nums;
            font-weight: 600;
            color: var(--apple-text-primary);
        }
.hm-tooltip .hm-tt-up { color: var(--data-positive); }
.hm-tooltip .hm-tt-down { color: var(--data-negative); }
.hm-legend {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-top: 14px;
            font-size: 11px;
            color: var(--apple-text-tertiary);
            flex-wrap: wrap;
        }
.hm-legend-seg { white-space: nowrap; }
.hm-legend-sep { color: var(--apple-text-tertiary); opacity: 0.5; }
.hm-legend-cell {
            width: 18px;
            height: 18px;
            border-radius: 4px;
            flex-shrink: 0;
            border: 1px solid rgba(0,0,0,0.12);
            box-shadow: 0 1px 2px rgba(0,0,0,0.08);
        }
.hm-legend-label {
            font-variant-numeric: tabular-nums;
            font-size: 10px;
            color: var(--apple-text-secondary);
            white-space: nowrap;
        }
/* ── Overview Stats ── */
.hm-stats {
            display: flex;
            gap: 10px;
            margin-top: 10px;
            margin-bottom: 8px;
            flex-wrap: wrap;
        }
.hm-stat-card {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            background: var(--apple-surface-1);
            border: 1px solid var(--apple-divider);
            border-radius: var(--radius-md);
            font-size: 11px;
            color: var(--apple-text-secondary);
            box-shadow: 0 1px 2px rgba(0,0,0,0.04);
            /* Entrance animation: fade + slide up */
            animation: hmStatEnter 0.4s cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
        }
@keyframes hmStatEnter {
            from {
                opacity: 0;
                transform: translateY(8px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
.hm-stat-card:nth-child(1) { animation-delay: 0ms; }
.hm-stat-card:nth-child(2) { animation-delay: 60ms; }
.hm-stat-card:nth-child(3) { animation-delay: 120ms; }
.hm-stat-card:nth-child(4) { animation-delay: 180ms; }
.hm-stat-icon {
            font-size: 16px;
            font-weight: 700;
        }
.hm-stat-label {
            font-size: 11px;
            color: var(--apple-text-tertiary);
        }
.hm-stat-val {
            font-family: var(--font-display);
            font-variant-numeric: tabular-nums;
            font-weight: 700;
            font-size: 14px;
        }
.hm-stat-up { color: var(--data-positive); }
.hm-stat-down { color: var(--data-negative); }
@media (max-width: 768px) {
            .market-pulse { padding: 12px; margin-bottom: 12px; }
            .market-pulse-head { align-items: flex-start; }
            .market-pulse-grid {
                display: flex;
                overflow-x: auto;
                scroll-snap-type: x proximity;
                padding-bottom: 3px;
                scrollbar-width: none;
            }
            .market-pulse-grid::-webkit-scrollbar { display: none; }
            .market-pulse-card {
                flex: 0 0 136px;
                scroll-snap-align: start;
            }
            #hmFilterPanel .control-group {
                justify-content: flex-start;
                flex-wrap: wrap;
            }
            .hm-treemap-svg { max-height: none; }
            .hm-legend { gap: 6px; font-size: 10px; }
            .hm-legend-cell { width: 14px; height: 14px; }
            .hm-legend-label { font-size: 9px; }
            .hm-stats {
                gap: 8px;
                margin-top: 12px;
                /* 2×2 grid on mobile for compactness */
                display: grid;
                grid-template-columns: 1fr 1fr;
            }
            .hm-stat-card {
                padding: 8px 10px;
                font-size: 11px;
                flex-direction: column;
                align-items: flex-start;
                gap: 3px;
            }
            .hm-stat-icon { font-size: 14px; }
            .hm-stat-val { font-size: 13px; }
            .hm-stat-label { font-size: 10px; }
        }

/* Recent-queries history (detail / backtest / crash / download) */
.gah-history {
    margin: 4px 0 14px;
    padding: 8px 12px;
    background: var(--apple-surface-1);
    border: 1px solid var(--apple-divider);
    border-radius: var(--radius-md);
}
.gah-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.gah-history-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--apple-text-secondary);
}
.gah-history-clear {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    color: var(--apple-text-tertiary);
}
.gah-history-clear:hover { color: var(--apple-text-primary); }
.gah-history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.gah-history-item {
    margin: 0;
    padding: 4px 10px;
    border: 1px solid var(--apple-divider);
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    color: var(--apple-text-primary);
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}
.gah-history-item:hover { background: var(--apple-blue-soft); border-color: var(--apple-hover-border); }
.gah-history-symbol { font-weight: 600; }
.gah-history-name { color: var(--apple-text-secondary); font-size: 12px; }

/* ─── Shared UI components: buttons & data tables ───
   Single source of truth for app-wide components. Previously inlined in
   price-change.html; moved here so every page (incl. the standalone
   /etf-market) shares them and theme/radius edits apply in one place. */
/* Buttons */
.pc-btn {
            padding: 7px 14px;
            border: 1px solid var(--apple-divider);
            background: var(--apple-surface-1);
            color: var(--apple-text-primary);
            font-size: 13px;
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all var(--transition-fast);
            white-space: nowrap;
        }
.pc-btn:hover { border-color: var(--apple-blue); color: var(--apple-text-primary); }
.pc-btn.primary { background: var(--apple-blue); border-color: var(--apple-blue); color: #fff; }
.pc-btn.primary:hover { opacity: 0.85; }
.pc-btn.danger { border-color: var(--data-negative); color: var(--data-negative); }
.pc-btn.danger:hover { background: var(--data-negative); color: #fff; }
.pc-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pc-btn-sm { padding: var(--space-xs) 10px; font-size: var(--text-xs); border-radius: var(--radius-md); }

/* Data tables */
.pc-table-wrap {
            overflow-x: auto;
            border-radius: var(--radius-lg);
            background: var(--apple-surface-1);
            box-shadow: var(--apple-card-shadow);
        }
.pc-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
        }
.pc-table th {
            position: sticky;
            top: 0;
            z-index: 10;
            background: var(--apple-surface-1);
            padding: 12px 16px;
            font-weight: 600;
            font-size: 12px;
            color: var(--apple-text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.3px;
            text-align: center;
            border-bottom: 1px solid var(--apple-divider);
            white-space: nowrap;
        }
.pc-table th:first-child {
            min-width: 70px;
        }
.pc-table td {
            padding: 10px 16px;
            text-align: right;
            border-bottom: 1px solid var(--apple-divider);
            font-variant-numeric: tabular-nums;
            transition: background-color var(--transition-fast);
            white-space: nowrap;
        }
.pc-table td:first-child {
            text-align: left;
            color: var(--apple-text-secondary);
            font-weight: 500;
            background: var(--apple-surface-1);
            position: sticky;
            left: 0;
            z-index: 5;
            box-shadow: var(--apple-sticky-shadow);
        }
.pc-table tr:last-child td { border-bottom: none; }
.pc-return-stack {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 3px;
            line-height: 1.15;
            white-space: nowrap;
        }
.pc-cell-return {
            display: block;
            font-weight: 600;
            font-variant-numeric: tabular-nums;
        }
.pc-cell-drawdown {
            display: block;
            font-size: 10px;
            font-weight: 500;
            font-variant-numeric: tabular-nums;
        }
.pc-drawdown-neutral {
            color: var(--apple-text-tertiary);
        }
.pc-drawdown-mild {
            color: color-mix(in srgb, var(--data-negative) 45%, var(--apple-text-tertiary));
        }
.pc-drawdown-moderate {
            color: color-mix(in srgb, var(--data-negative) 65%, var(--apple-text-secondary));
        }
.pc-drawdown-severe {
            color: color-mix(in srgb, var(--data-negative) 82%, var(--apple-text-primary));
            font-weight: 600;
        }
.pc-drawdown-extreme {
            color: var(--data-negative);
            font-weight: 700;
        }
.pc-month-block .pc-return-stack {
            align-items: center;
        }
.pc-month-block .pc-cell-return {
            font-size: 14px;
        }
.pc-chart-actions {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 10px;
        }
.pc-chart-scale-toggle {
            display: inline-flex;
            padding: 2px;
            border: 1px solid var(--apple-divider);
            border-radius: var(--radius-md);
            background: var(--apple-surface-2);
        }
.pc-chart-scale-btn {
            padding: 5px 9px;
            border: 0;
            border-radius: calc(var(--radius-md) - 2px);
            background: transparent;
            color: var(--apple-text-tertiary);
            cursor: pointer;
            font: inherit;
            font-size: 11px;
            white-space: nowrap;
        }
.pc-chart-scale-btn.active {
            background: var(--apple-surface-1);
            color: var(--apple-text-primary);
            box-shadow: var(--apple-card-shadow);
        }
.pc-chart-scale-note {
            min-height: 16px;
            margin: -8px 0 6px;
            color: var(--apple-text-tertiary);
            font-size: 11px;
        }
.pc-chart-plot {
            position: relative;
            overflow-x: auto;
            overflow-y: hidden;
            -webkit-overflow-scrolling: touch;
        }
#pcChartSvg svg { min-width: 100%; }
.pc-chart-point {
            cursor: crosshair;
            outline: none;
        }
.pc-chart-point:focus {
            filter: drop-shadow(0 0 3px var(--apple-blue));
        }
.pc-chart-tooltip {
            position: absolute;
            z-index: 20;
            width: max-content;
            max-width: 250px;
            padding: 9px 11px;
            border: 1px solid var(--apple-divider);
            border-radius: var(--radius-md);
            background: var(--apple-surface-1);
            color: var(--apple-text-primary);
            box-shadow: var(--apple-sticky-shadow);
            font-size: 11px;
            line-height: 1.55;
            pointer-events: none;
        }
.pc-chart-tooltip[hidden] { display: none; }
.pc-chart-tooltip-title {
            margin-bottom: 3px;
            font-weight: 700;
        }
.pc-chart-tooltip-row {
            display: flex;
            justify-content: space-between;
            gap: 16px;
        }
.pc-chart-tooltip-label { color: var(--apple-text-tertiary); }
.pc-chart-tooltip-value { font-variant-numeric: tabular-nums; }
.pc-chart-tooltip-range {
            margin-top: 3px;
            color: var(--apple-text-secondary);
        }
.pc-chart-legend {
            display: flex;
            flex-wrap: wrap;
            gap: 7px;
            margin-top: 8px;
        }
.pc-chart-legend-btn,
.pc-chart-show-all {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            min-height: 28px;
            padding: 4px 9px;
            border: 1px solid var(--apple-divider);
            border-radius: var(--radius-full);
            background: var(--apple-surface-1);
            color: var(--apple-text-secondary);
            cursor: pointer;
            font: inherit;
            font-size: 11px;
            white-space: nowrap;
        }
.pc-chart-legend-btn:hover,
.pc-chart-show-all:hover,
.pc-chart-legend-btn.is-focused {
            border-color: var(--apple-blue);
            color: var(--apple-text-primary);
        }
.pc-chart-legend-btn.is-hidden {
            opacity: 0.38;
            text-decoration: line-through;
        }
.pc-chart-legend-swatch {
            width: 12px;
            height: 3px;
            border-radius: 999px;
            flex: 0 0 auto;
        }
.pc-chart-legend-hint {
            margin-top: 7px;
            color: var(--apple-text-tertiary);
            font-size: 10px;
        }
@media (max-width: 768px) {
            #pcChartWrap .pc-monthly-header {
                align-items: flex-start;
                flex-wrap: wrap;
                gap: 10px;
            }
            #pcChartWrap .pc-chart-title { flex: 1 0 100%; }
            .pc-chart-actions {
                width: 100%;
                justify-content: space-between;
            }
            #pcChartSvg { min-width: 620px; }
            .pc-chart-legend {
                flex-wrap: nowrap;
                overflow-x: auto;
                padding-bottom: 4px;
                scrollbar-width: none;
            }
            .pc-chart-legend::-webkit-scrollbar { display: none; }
            .pc-chart-legend-btn,
            .pc-chart-show-all { flex: 0 0 auto; }
        }
.pc-table tbody tr:hover td {
            background: var(--apple-overlay);
        }
.pc-table tbody tr:hover td:first-child {
            background: var(--apple-overlay);
        }
.pc-table tbody tr:nth-child(even) td {
            background: var(--apple-overlay-subtle);
        }
.pc-table tbody tr:nth-child(even) td:first-child {
            background: var(--apple-overlay-subtle);
        }
.pc-table tbody tr:nth-child(even):hover td {
            background: var(--apple-overlay);
        }
.pc-table tbody tr:nth-child(even):hover td:first-child {
            background: var(--apple-overlay);
        }
.pc-empty {
            text-align: center;
            padding: 60px 20px;
            color: var(--apple-text-tertiary);
            font-size: 14px;
        }
.pc-empty-hint { font-size: 12px; margin-top: 6px; opacity: 0.6; }
