/* AlgoCheck Custom Styles */

/* Prevent horizontal overflow on mobile */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* ============================================================
   ECOSYSTEM TOKEN BRIDGE (Phase 1 CI alignment)
   Maps legacy AlgoCheck brand + surface utilities onto the
   stein-ecosystem design tokens so that data-platform="algocheck"
   + data-theme="dark|light" take effect without a full CSS rewrite.
   Full component-level adoption happens in Phase 2+3.
   ============================================================ */
html[data-platform="algocheck"],
html[data-platform="algocheck"] body {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-sans);
}

/* Light-mode body bg (warm linen, consistent with REVDEN light) */
html[data-theme="light"],
html[data-theme="light"] body { background: var(--bg-deep); color: var(--text-primary); }

/* Surface utilities (Tailwind classes AlgoCheck uses) re-routed to tokens.
   Covers opacity variants /50 /60 /80 that Tailwind generates as separate rules. */
html[data-platform="algocheck"] .bg-surface-base,
html[data-platform="algocheck"] .bg-surface-base\/80 { background-color: var(--bg-deep) !important; }

html[data-platform="algocheck"] .bg-surface-card,
html[data-platform="algocheck"] .bg-surface-card\/50,
html[data-platform="algocheck"] .bg-surface-card\/60,
html[data-platform="algocheck"] .bg-surface-card\/80 { background-color: var(--bg-elevated) !important; }

html[data-platform="algocheck"] .bg-surface-hover,
html[data-platform="algocheck"] .bg-surface-hover\/50,
html[data-platform="algocheck"] .bg-surface-hover\/60 { background-color: var(--bg-elevated-hover) !important; }

html[data-platform="algocheck"] .bg-surface-elevated { background-color: var(--bg-elevated) !important; }

html[data-platform="algocheck"] .border-surface-border,
html[data-platform="algocheck"] .border-surface-border\/50 { border-color: var(--border-subtle) !important; }

/* Sticky header + footer backdrop-blur need semi-transparent token values to preserve the glass look.
   Instead of forcing opaque --bg-elevated, layer the token deep-bg over a subtle tint. */
html[data-platform="algocheck"] #header {
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.9) 0%, rgba(10, 10, 15, 0.8) 100%) !important;
    border-color: var(--border-subtle) !important;
}
html[data-theme="light"][data-platform="algocheck"] #header {
    background: linear-gradient(180deg, rgba(244, 241, 234, 0.92) 0%, rgba(244, 241, 234, 0.82) 100%) !important;
}
/* Kill legacy blue accent line above header - ticker band carries platform signature instead */
html[data-platform="algocheck"] #header::before {
    content: none !important;
    display: none !important;
    background: none !important;
    height: 0 !important;
}
html[data-platform="algocheck"] #footer {
    /* Use bg-deep (near-black) instead of bg-surface - the token-default #0D1020
       has a slate-blue tint which breaks the AlgoCheck amber-on-black aesthetic. */
    background: var(--bg-deep) !important;
    border-top: 1px solid var(--border-subtle) !important;
}
/* Nested surface-card/50 used inside footer leaks the slate tint - also neutralize */
html[data-platform="algocheck"] #footer .bg-surface-card,
html[data-platform="algocheck"] #footer .bg-surface-card\/50,
html[data-platform="algocheck"] #footer .bg-surface-card\/60,
html[data-platform="algocheck"] #footer .bg-surface-card\/80 {
    background: transparent !important;
}

/* Card-elevated (used heavily by current homepage / rankings) inherits shadow in light mode */
html[data-platform="algocheck"] .card-elevated {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
    border-radius: var(--radius-xl);
    transition: box-shadow var(--duration-base) var(--ease-out),
                border-color var(--duration-base) var(--ease-out),
                transform var(--duration-base) var(--ease-out);
}
html[data-platform="algocheck"] .card-elevated:hover {
    box-shadow: var(--shadow-card-hover);
    border-color: var(--sig-border-soft);
}

/* Brand signature: replace AlgoCheck's brand-500 (blue) with platform Amber on
   high-salience accents (CTAs, focus rings, active pills, accent links). */
html[data-platform="algocheck"] .bg-brand-500           { background-color: var(--sig-deep) !important; }
html[data-platform="algocheck"] .bg-brand-600           { background-color: var(--sig-bright) !important; filter: brightness(0.95); }
html[data-platform="algocheck"] .hover\:bg-brand-500:hover { background-color: var(--sig-deep) !important; }
html[data-platform="algocheck"] .hover\:bg-brand-600:hover { background-color: var(--sig-bright) !important; }
html[data-platform="algocheck"] .text-brand-400         { color: var(--sig-bright) !important; }
html[data-platform="algocheck"] .text-brand-500         { color: var(--sig-deep)   !important; }
html[data-platform="algocheck"] .border-brand-500       { border-color: var(--sig-deep) !important; }
html[data-platform="algocheck"] .border-brand-500\/20   { border-color: var(--sig-border-soft) !important; }
html[data-platform="algocheck"] .border-brand-500\/30   { border-color: var(--sig-border-soft) !important; }
html[data-platform="algocheck"] .ring-brand-500         { --tw-ring-color: var(--sig-deep) !important; }

/* Dark ink on bright CTA fills - WCAG-compliant high-contrast, avoids "glare" from white-on-amber/white-on-emerald.
   Scoped via combined selectors so only buttons with a vivid fill flip the text color. */
html[data-platform="algocheck"] .bg-brand-500.text-white,
html[data-platform="algocheck"] .bg-brand-600.text-white,
html[data-platform="algocheck"] .bg-emerald-500.text-white,
html[data-platform="algocheck"] .bg-emerald-600.text-white {
    color: var(--bg-deep) !important;
}
/* SVG icons inside those CTAs follow the same ink */
html[data-platform="algocheck"] .bg-brand-500.text-white svg,
html[data-platform="algocheck"] .bg-brand-600.text-white svg,
html[data-platform="algocheck"] .bg-emerald-500.text-white svg,
html[data-platform="algocheck"] .bg-emerald-600.text-white svg {
    stroke: var(--bg-deep) !important;
}

/* Amber focus-visible ring on all interactive elements (a11y consistency) */
html[data-platform="algocheck"] a:focus-visible,
html[data-platform="algocheck"] button:focus-visible,
html[data-platform="algocheck"] input:focus-visible {
    outline: 2px solid var(--sig-deep);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Movers ticker re-uses platform signature instead of hardcoded brand-blue */
html[data-platform="algocheck"] .ticker-item:hover,
html[data-platform="algocheck"] .ticker-item:focus-visible {
    border-color: var(--sig-deep);
    box-shadow: 0 0 0 1px var(--sig-deep), 0 4px 14px var(--sig-glow-strong);
}
html[data-platform="algocheck"] .ticker-cta-link { color: var(--sig-bright); }
html[data-platform="algocheck"] .mover-focus-target.mover-focus-highlight {
    box-shadow: 0 0 0 2px var(--sig-deep), 0 4px 24px var(--sig-glow-strong);
    animation: mover-focus-pulse-amber 1.2s ease-out 0s 2;
}
@keyframes mover-focus-pulse-amber {
    0%   { box-shadow: 0 0 0 2px var(--sig-deep), 0 0 0 0 var(--sig-glow-strong); }
    70%  { box-shadow: 0 0 0 2px var(--sig-deep), 0 0 0 14px transparent; }
    100% { box-shadow: 0 0 0 2px var(--sig-deep), 0 0 0 0 transparent; }
}


/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Inter:wght@400;500;600&display=swap');

/* Paywall blur */
.blur-content {
    filter: blur(6px);
    user-select: none;
    pointer-events: none;
}

/* Grade badge typography */
.grade-badge {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-weight: 800;
    box-shadow: inset 0 -3px 6px rgba(0,0,0,0.3), 0 2px 10px rgba(0,0,0,0.35);
    text-shadow: 0 1px 3px rgba(0,0,0,0.35);
}

/* Card hover animation */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Progress bar animation */
.progress-bar {
    transition: width 0.6s ease-out;
}

/* Scrollbar (Dark Mode) */
.dark ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.dark ::-webkit-scrollbar-track {
    background: #0F172A;
}
.dark ::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}
.dark ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Scrollbar (Light Mode) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #F8FAFC;
}
::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* OTP Input */
.otp-digit {
    width: 2.75rem;
    height: 2.75rem;
    text-align: center;
    font-size: 1.25rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    border-radius: 0.5rem;
    border: 2px solid #334155;
    background: #0F172A;
    color: #F1F5F9;
    outline: none;
    transition: border-color 0.15s ease;
}
.otp-digit:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Light mode OTP */
html:not(.dark) .otp-digit {
    border-color: #E2E8F0;
    background: #FFFFFF;
    color: #0F172A;
}
html:not(.dark) .otp-digit:focus {
    border-color: #3B82F6;
}

/* Score breakdown bar */
.score-bar {
    height: 0.5rem;
    border-radius: 9999px;
    overflow: hidden;
    background: #1E293B;
}
html:not(.dark) .score-bar {
    background: #E2E8F0;
}
.score-bar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.8s ease-out;
}

/* Saved money banner glow */
.saved-banner {
    animation: subtle-glow 3s ease-in-out infinite alternate;
}
@keyframes subtle-glow {
    from { box-shadow: 0 0 10px rgba(16, 185, 129, 0.05); }
    to   { box-shadow: 0 0 20px rgba(16, 185, 129, 0.1); }
}

/* Nav dropdown light mode */
html:not(.dark) .group:hover .card-elevated {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
}
html:not(.dark) .group .hover\:bg-surface-hover:hover {
    background-color: #F1F5F9 !important;
}

/* === DESIGN UPGRADE v2 === */

/* Body dot-pattern texture */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, rgba(59,130,246,0.025) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: 0;
}
body > * { position: relative; z-index: 1; }

/* Header accent line */
#header {
    /* Sticky + high z-index so the dropdown menu paints OVER the live ticker.
       Without this, body > * { z-index: 1 } would tie header and ticker into
       the same stacking layer, causing the rankings dropdown to render BEHIND
       ticker items (issue: 2026-05-04 live ticker bleeding through panel). */
    position: sticky;
    top: 0;
    z-index: 50;
}
#header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #1E3A5F 20%, #3B82F6 50%, #1E3A5F 80%, transparent);
    z-index: 60;
}

/* Hero glow */
.hero-glow {
    position: relative;
    overflow: visible;
}
.hero-glow::before {
    content: '';
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 500px;
    background: radial-gradient(ellipse at center, rgba(30,58,95,0.4) 0%, rgba(59,130,246,0.08) 40%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Card depth system */
.card-elevated {
    background: #1E293B;
    border: 1px solid rgba(255,255,255,0.04);
    box-shadow: 0 1px 2px rgba(0,0,0,0.25), 0 4px 16px rgba(0,0,0,0.12);
    transition: all 0.25s ease;
}
.card-elevated:hover {
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3), 0 8px 28px rgba(0,0,0,0.18);
    transform: translateY(-2px);
}

/* A-grade glow animation */
.grade-glow-a {
    animation: gradeGlowA 3s ease-in-out infinite;
}
@keyframes gradeGlowA {
    0%, 100% { box-shadow: inset 0 -3px 6px rgba(0,0,0,0.3), 0 2px 10px rgba(0,0,0,0.35), 0 0 0 0 rgba(16,185,129,0); }
    50% { box-shadow: inset 0 -3px 6px rgba(0,0,0,0.3), 0 2px 10px rgba(0,0,0,0.35), 0 0 16px 3px rgba(16,185,129,0.15); }
}

/* Button glow hover effects */
.btn-glow {
    transition: all 0.2s ease;
}
.btn-glow:hover {
    box-shadow: 0 0 24px rgba(59,130,246,0.35);
    transform: translateY(-1px);
}
.btn-glow-emerald {
    transition: all 0.2s ease;
}
.btn-glow-emerald:hover {
    box-shadow: 0 0 24px rgba(16,185,129,0.3);
    transform: translateY(-1px);
}

/* Card entrance animation */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.card-enter {
    animation: fadeSlideUp 0.4s ease-out both;
}

/* Variant-B ranking-card: grade-driven hover glow (A=green, B=blue, C=amber, D=orange, F=red).
   Applied via ::before so it does not eat pointer events. Glow fades in on hover only. */
.rank-card-glow-a::before,
.rank-card-glow-b::before,
.rank-card-glow-c::before,
.rank-card-glow-d::before,
.rank-card-glow-f::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity 250ms cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 0;
}
.rank-card-glow-a::before { background: radial-gradient(ellipse at top, rgba(16,185,129,0.14), transparent 60%); }
.rank-card-glow-b::before { background: radial-gradient(ellipse at top, rgba(96,165,250,0.12), transparent 60%); }
.rank-card-glow-c::before { background: radial-gradient(ellipse at top, rgba(251,191,36,0.12), transparent 60%); }
.rank-card-glow-d::before { background: radial-gradient(ellipse at top, rgba(251,146,60,0.12), transparent 60%); }
.rank-card-glow-f::before { background: radial-gradient(ellipse at top, rgba(239,68,68,0.12), transparent 60%); }
.rank-card-glow-a:hover::before,
.rank-card-glow-b:hover::before,
.rank-card-glow-c:hover::before,
.rank-card-glow-d:hover::before,
.rank-card-glow-f:hover::before { opacity: 1; }
.rank-card-glow-a > *,
.rank-card-glow-b > *,
.rank-card-glow-c > *,
.rank-card-glow-d > *,
.rank-card-glow-f > * { position: relative; z-index: 1; }

/* Fallback line-clamp-2 for browsers (supported everywhere modern, but keep explicit) */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Gauge-track (SVG background ring) - theme-aware so both modes show the unfilled portion */
.gauge-track { stroke: rgba(255, 255, 255, 0.08); }
html[data-theme="light"] .gauge-track,
html:not(.dark) .gauge-track { stroke: rgba(10, 10, 15, 0.10); }

/* Page content fade-in */
.page-enter {
    animation: fadeSlideUp 0.3s ease-out;
}

/* Gradient divider */
.divider-gradient {
    height: 1px;
    background: linear-gradient(90deg, transparent, #334155 30%, #334155 70%, transparent);
}

/* Metric tabular numbers */
.metric-value {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum';
}

/* Grade accent bar classes */
.grade-accent-a { border-left: 3px solid #10B981; }
.grade-accent-b { border-left: 3px solid #3B82F6; }
.grade-accent-c { border-left: 3px solid #F59E0B; }
.grade-accent-d { border-left: 3px solid #F87171; }
.grade-accent-f { border-left: 3px solid #EF4444; }

/* Rank styling for top 3 */
.rank-gold { color: #F59E0B; text-shadow: 0 0 12px rgba(245,158,11,0.3); background: transparent; padding: 0; }
.rank-silver { color: #94A3B8; text-shadow: 0 0 8px rgba(148,163,184,0.2); background: transparent; padding: 0; }
.rank-bronze { color: #D97706; text-shadow: 0 0 8px rgba(217,119,6,0.2); background: transparent; padding: 0; }
.rank-default { color: #9CA3AF; background: transparent; padding: 0; }

/* Light mode overrides for new classes */
html:not(.dark) .card-elevated {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
}
html:not(.dark) .card-elevated:hover {
    border-color: #CBD5E1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1), 0 8px 28px rgba(0,0,0,0.08);
}
html:not(.dark) .divider-gradient {
    background: linear-gradient(90deg, transparent, #E2E8F0 30%, #E2E8F0 70%, transparent);
}
html:not(.dark) body::after {
    background-image: radial-gradient(circle, rgba(30,58,95,0.03) 1px, transparent 1px);
}
/* Light mode: hero glow softer */
html:not(.dark) .hero-glow::before {
    background: radial-gradient(ellipse at center, rgba(59,130,246,0.08) 0%, rgba(59,130,246,0.03) 40%, transparent 70%);
}
/* Light mode: gradient text readable */
html:not(.dark) .bg-clip-text.text-transparent {
    -webkit-text-fill-color: transparent;
    background-image: linear-gradient(to right, #1E293B, #1D4ED8, #3B82F6) !important;
}
/* Light mode: medal-style rank badges */
html:not(.dark) .rank-gold { color: #fff; background: linear-gradient(145deg, #F59E0B, #D97706); border-radius: 12px; padding: 4px 0; text-shadow: 0 1px 2px rgba(0,0,0,0.2); box-shadow: 0 2px 6px rgba(217,119,6,0.35); }
html:not(.dark) .rank-silver { color: #fff; background: linear-gradient(145deg, #94A3B8, #64748B); border-radius: 12px; padding: 4px 0; text-shadow: 0 1px 2px rgba(0,0,0,0.2); box-shadow: 0 2px 6px rgba(100,116,139,0.35); }
html:not(.dark) .rank-bronze { color: #fff; background: linear-gradient(145deg, #D97706, #92400E); border-radius: 12px; padding: 4px 0; text-shadow: 0 1px 2px rgba(0,0,0,0.2); box-shadow: 0 2px 6px rgba(146,64,14,0.35); }
html:not(.dark) .rank-default { color: #64748B; background: #F1F5F9; border-radius: 12px; padding: 4px 0; }
/* Light mode: grade badge keep white text */
html:not(.dark) .grade-badge { color: #FFFFFF !important; }
/* Light mode: step numbers visible */
html:not(.dark) .text-white\/\[0\.04\] { color: rgba(0,0,0,0.04) !important; }
/* Light mode: "How It Works" band */
html:not(.dark) .bg-surface-card\/50 { background-color: rgba(241,245,249,0.7) !important; }
/* Light mode: trust badge pills */
html:not(.dark) .bg-surface-card\/60 { background-color: rgba(255,255,255,0.8) !important; }
/* Light mode: overline labels keep brand color */
html:not(.dark) .text-brand-400 { color: #2563EB !important; }
/* Light mode: btn-glow softer */
html:not(.dark) .btn-glow:hover { box-shadow: 0 0 20px rgba(59,130,246,0.2); }
html:not(.dark) .btn-glow-emerald:hover { box-shadow: 0 0 20px rgba(16,185,129,0.2); }
/* Light mode: header accent line subtler */
html:not(.dark) #header::before {
    background: linear-gradient(90deg, transparent, #93C5FD 20%, #3B82F6 50%, #93C5FD 80%, transparent);
}
/* Monthly Pass card: dark/light mode backgrounds */
.monthly-pass-card { background: linear-gradient(135deg, rgba(30,58,95,0.25) 0%, rgba(16,185,129,0.08) 100%); }
html:not(.dark) .monthly-pass-card { background: linear-gradient(135deg, rgba(16,185,129,0.06) 0%, rgba(30,58,95,0.04) 100%); box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04); }
/* Light mode: mover/advisor badges need visible background */
html:not(.dark) .bg-surface-base\/80 { background-color: #E2E8F0 !important; }
html:not(.dark) [class*="bg-surface-base/80"] { background-color: #E2E8F0 !important; }

/* Light mode: ranking card badges - stronger backgrounds + darker text */
html:not(.dark) .bg-blue-500\/15 { background-color: rgba(59,130,246,0.12) !important; }
html:not(.dark) .bg-indigo-500\/15 { background-color: rgba(99,102,241,0.12) !important; }
html:not(.dark) .bg-purple-500\/15 { background-color: rgba(168,85,247,0.12) !important; }
html:not(.dark) .bg-teal-500\/15 { background-color: rgba(20,184,166,0.12) !important; }
html:not(.dark) .bg-cyan-500\/15 { background-color: rgba(6,182,212,0.12) !important; }
html:not(.dark) .bg-amber-500\/15 { background-color: rgba(245,158,11,0.12) !important; }
html:not(.dark) .bg-emerald-500\/15 { background-color: rgba(16,185,129,0.12) !important; }
html:not(.dark) .bg-slate-500\/15 { background-color: rgba(100,116,139,0.12) !important; }
html:not(.dark) .bg-red-500\/20 { background-color: rgba(239,68,68,0.12) !important; }

html:not(.dark) .text-blue-400 { color: #2563EB !important; }
html:not(.dark) .text-indigo-400 { color: #4F46E5 !important; }
html:not(.dark) .text-purple-400 { color: #7C3AED !important; }
html:not(.dark) .text-teal-400 { color: #0D9488 !important; }
html:not(.dark) .text-cyan-400 { color: #0891B2 !important; }
html:not(.dark) .text-amber-400 { color: #B45309 !important; }
html:not(.dark) .text-red-400 { color: #DC2626 !important; }
html:not(.dark) .text-slate-400 { color: #475569 !important; }

/* ============================================================
   TOP MOVERS LIVE-TICKER
   Sticky band below header, ecosystem-visible across all routes.
   ============================================================ */
.movers-ticker-band {
    /* Subtle platform-signature tint over deep-bg creates the "schicke Unterbrechung"
       (Daniel 2026-04-23) without breaking the homogeneous dark palette. */
    background:
        linear-gradient(180deg, var(--sig-tint-wash) 0%, transparent 100%),
        var(--bg-deep);
    border-top: 1px solid var(--sig-border-soft);
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
}
.movers-ticker-band.hidden { display: none; }

.ticker-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.ticker-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--text-primary);
    white-space: nowrap;
    padding-right: 16px;
    border-right: 1px solid var(--border-subtle);
    flex-shrink: 0;
}
.ticker-label .pulse-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    animation: ticker-pulse 1.4s ease-in-out infinite;
}
@keyframes ticker-pulse {
    0%, 100% { opacity: 0.35; transform: scale(0.85); }
    50%      { opacity: 1;    transform: scale(1.1); }
}

.ticker-viewport {
    flex: 1;
    overflow-x: hidden;
    overflow-y: visible;
    padding: 4px 0;
    mask-image: linear-gradient(90deg, transparent 0%, #000 5%, #000 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 5%, #000 95%, transparent 100%);
}

.ticker-track {
    display: flex;
    gap: 12px;
    animation: ticker-scroll 90s linear infinite;
    width: max-content;
    will-change: transform;
}
.ticker-track:hover, .ticker-track:focus-within { animation-play-state: paused; }
@keyframes ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 7px 12px 7px 10px;
    min-width: 280px;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    text-decoration: none;
    color: inherit;
    font-family: 'Inter', system-ui, sans-serif;
    font-variant-numeric: tabular-nums;
}

.ticker-item:hover, .ticker-item:focus-visible {
    background: #2D3F55;
    border-color: #3B82F6;
    box-shadow: 0 0 0 1px #3B82F6, 0 4px 12px rgba(59, 130, 246, 0.15);
    outline: none;
}
html:not(.dark) .ticker-item:hover, html:not(.dark) .ticker-item:focus-visible {
    background: #F1F5F9;
}

.ticker-cat-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 7px;
    font-family: 'Inter', system-ui, sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
.ticker-cat-pill.cat-forex   { background: rgba(148,163,184,0.12); color: #cbd5e1; }
.ticker-cat-pill.cat-gold    { background: rgba(245,158,11,0.15);  color: #F59E0B; }
.ticker-cat-pill.cat-indices { background: rgba(59,130,246,0.15);  color: #3B82F6; }
.ticker-cat-pill.cat-crypto  { background: rgba(167,139,250,0.15); color: #A78BFA; }
.ticker-cat-pill.cat-multi   { background: rgba(148,163,184,0.12); color: #cbd5e1; }
html:not(.dark) .ticker-cat-pill.cat-forex { color: #475569; }

.ticker-grade {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-weight: 800;
    font-size: 13px;
    width: 26px; height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.25);
}
.ticker-grade.grade-a { background: #10B981; }
.ticker-grade.grade-b { background: #3B82F6; }
.ticker-grade.grade-c { background: #F59E0B; }
.ticker-grade.grade-d { background: #F87171; color: #1f2937; }
.ticker-grade.grade-f { background: #EF4444; }

.ticker-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}
.ticker-type {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    text-transform: uppercase;
}
.ticker-summary {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticker-delta {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 7px;
    border-radius: 5px;
    font-family: 'Inter', system-ui, sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
    white-space: nowrap;
}
.ticker-delta.delta-pos     { background: rgba(16,185,129,0.12); color: #10B981; }
.ticker-delta.delta-neg     { background: rgba(248,113,113,0.12); color: #F87171; }
.ticker-delta.delta-neutral { background: rgba(148,163,184,0.12); color: #94A3B8; }

.ticker-cta-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--sig-bright);
    text-decoration: none;
    padding-left: 16px;
    border-left: 1px solid var(--border-subtle);
    flex-shrink: 0;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: color var(--duration-fast) var(--ease-out);
}
.ticker-cta-link:hover { color: var(--text-primary); }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    .ticker-track { animation: none; }
}

/* Mobile collapse: hide label + cta-link, show only scrolling items */
@media (max-width: 640px) {
    .ticker-label, .ticker-cta-link { display: none; }
    .ticker-row { padding: 6px 12px; }
    .ticker-item { min-width: 240px; }
}

/* ============================================================
   MOVER FOCUS HIGHLIGHT
   Applied when /movers?focus=N arrives from the ticker.
   Pulses a brand-colored ring to anchor the user's attention.
   ============================================================ */
.mover-focus-target {
    scroll-margin-top: 80px;
    border-radius: 12px;
    transition: box-shadow 0.3s ease;
}
.mover-focus-target.mover-focus-highlight {
    animation: mover-focus-pulse 1.2s ease-out 0s 2;
    box-shadow: 0 0 0 2px #3B82F6, 0 4px 24px rgba(59, 130, 246, 0.25);
}
@keyframes mover-focus-pulse {
    0%   { box-shadow: 0 0 0 2px #3B82F6, 0 0 0 0 rgba(59, 130, 246, 0.55); }
    70%  { box-shadow: 0 0 0 2px #3B82F6, 0 0 0 14px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 2px #3B82F6, 0 0 0 0 rgba(59, 130, 246, 0); }
}
