/* ==============================================================================
   PATTERNS — DESIGN SYSTEM (DARK-MODE QUANT PLAYBOOK MATRIX)
   ============================================================================== */

:root {
    --bg-base: #050811;
    --bg-elevated: #090f1e;
    --bg-card: #0d152a;
    --bg-card-hover: #121d38;
    --border-subtle: #1a2642;
    --border-active: #2b3d66;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-cyan: #38bdf8;
    --accent-blue: #2563eb;
    --accent-green: #22c55e;
    --accent-purple: #c084fc;
    --accent-glow: rgba(56, 189, 248, 0.15);
    
    --font-sans: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
}

/* BACKGROUND GRID & GLOW */
.bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    height: 1200px;
    background-image: 
        linear-gradient(to right, rgba(26, 38, 66, 0.3) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(26, 38, 66, 0.3) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(circle at 50% 30%, black 20%, transparent 80%);
    pointer-events: none;
    z-index: 0;
}

.bg-glow {
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: min(800px, 100vw);
    height: 600px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}

/* NAVBAR */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    max-width: 100vw;
    background: rgba(5, 8, 17, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    box-sizing: border-box;
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    user-select: none;
}

.brand-symbol {
    color: var(--accent-cyan);
    font-size: 20px;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.5));
}

.brand-name {
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 17px;
    letter-spacing: 1.5px;
    color: #f8fafc;
}

.brand-wordmark-svg {
    height: 32px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
    overflow: visible;
    transition: filter 0.2s ease;
}

.brand:hover .brand-wordmark-svg {
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.45));
}

.badge-beta {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: white;
}

/* BUTTONS */
.btn-primary {
    background: #0284c7;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #0369a1;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(13, 21, 42, 0.8);
    color: var(--text-primary);
    border: 1px solid var(--border-active);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-cyan);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 14px;
}

.btn-ghost:hover {
    color: white;
}

.btn-large {
    padding: 14px 28px;
    font-size: 15px;
}

.btn-glow {
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

/* HERO */
.hero {
    padding: 100px 0 80px 0;
    text-align: center;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
}

.hero-content {
    max-width: 820px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(13, 21, 42, 0.9);
    border: 1px solid var(--border-active);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 12px;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    margin-bottom: 24px;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-cyan);
    border-radius: 50%;
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

.hero-title {
    font-size: 56px;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 24px;
}

.gradient-text {
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta-group {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 60px;
}

/* CHALKBOARD PLAYBOOK AESTHETICS */
.hero {
    position: relative;
    overflow: hidden;
}

.playbook-bg-sketch {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    color: #38bdf8;
    opacity: 0.20;
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.2));
    user-select: none;
    transition: opacity 0.3s ease;
}

.playbook-bg-sketch.hero-quant-pos {
    top: 3%;
    left: 50%;
    transform: translateX(-50%);
    width: min(1040px, 96vw);
    max-width: 1080px;
}

.playbook-bg-sketch.section-bg-pos {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(920px, 95vw);
    max-width: 960px;
    opacity: 0.16;
}

/* COMPACT PLAYBOOK TAPE CYCLER (REPLACES BULKY METRIC CARDS) */
.hero-playbook-ticker {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 9999px;
    padding: 7px 18px;
    margin: 0 auto;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(56, 189, 248, 0.12);
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    max-width: 95vw;
}

.hero-playbook-ticker:hover {
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(30, 41, 59, 0.85);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.25);
    transform: translateY(-1px);
}

.ticker-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.14);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 3px 8px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.ticker-pulse {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
    display: inline-block;
    animation: pulseGlow 1.8s infinite;
}

.ticker-slide-box {
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s ease, transform 0.2s ease;
    overflow: hidden;
    white-space: nowrap;
}

.ticker-icon .pro-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.ticker-val {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 800;
}

.ticker-name {
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
}

.ticker-stat {
    font-size: 12px;
    color: #94a3b8;
}

.ticker-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-left: 6px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.ticker-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

.ticker-dot.active {
    width: 12px;
    border-radius: 4px;
    background: #38bdf8;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
}

/* SECTION HEADERS */
.section {
    padding: 100px 0;
}

.bg-elevated {
    background: var(--bg-elevated);
}

.section-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 60px auto;
}

.section-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-cyan);
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
}

.section-header h2 {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 14px;
}

.section-header p {
    font-size: 15px;
    color: var(--text-secondary);
}

/* CATALOG CATEGORY SELECTOR */
.category-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.cat-btn {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 8px 18px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cat-btn:hover {
    color: var(--text-primary);
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(30, 41, 59, 0.8);
}

.cat-btn.active {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

/* PATTERNS GRID */
.patterns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 24px;
}

.pattern-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.pattern-card:hover {
    transform: translateY(-3px);
    border-color: rgba(56, 189, 248, 0.4);
}

.pattern-card.card-selected {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 24px rgba(56, 189, 248, 0.3) !important;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
    transform: translateY(-4px);
}

.card-action-footer {
    display: flex;
    justify-content: stretch;
    align-items: center;
    width: 100%;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

.btn-inspect-proof {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    font-weight: 700;
    font-size: 13px;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pattern-card:hover .btn-inspect-proof,
.pattern-card.card-selected .btn-inspect-proof {
    background: #38bdf8;
    color: #0f172a;
    border-color: #38bdf8;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
}

.btn-inspect-proof .btn-arrow {
    transition: transform 0.2s ease;
}

.pattern-card.card-selected .btn-inspect-proof .btn-arrow {
    transform: rotate(180deg);
}

/* ==============================================================================
   PATTERN CAROUSEL & ACTIVE STAGE (UNIFIED MASTER-DETAIL CARD DECK)
   ============================================================================== */

.pattern-carousel-container {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.carousel-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 8px;
}

.carousel-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.carousel-catalog-label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 800;
    color: #38bdf8;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.carousel-catalog-sub {
    font-size: 13px;
    color: #94a3b8;
}

.carousel-arrow-group {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    padding: 6px 16px;
    border-radius: 9999px;
}

.carousel-arrow-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s, transform 0.15s;
    padding: 0 4px;
}

.carousel-arrow-btn:hover {
    color: #38bdf8;
    transform: scale(1.2);
}

.carousel-counter {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: 0.5px;
}

/* CAROUSEL CARD STRIP */
.carousel-card-strip {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 8px 4px 16px 4px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, 0.3) transparent;
}

.carousel-card-strip::-webkit-scrollbar {
    height: 6px;
}

.carousel-card-strip::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 9999px;
}

.carousel-card-strip::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.3);
    border-radius: 9999px;
}

.carousel-card-strip::-webkit-scrollbar-thumb:hover {
    background: #38bdf8;
}

.strip-card {
    flex: 0 0 240px;
    scroll-snap-align: start;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    user-select: none;
}

.strip-card:hover {
    transform: translateY(-3px);
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(30, 41, 59, 0.7);
}

.strip-card.active {
    border-color: #38bdf8 !important;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%) !important;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.35) !important;
    transform: translateY(-4px);
}

.strip-card.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #38bdf8;
}

.strip-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    line-height: 1;
}

.strip-id-box {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    line-height: 1;
}

.strip-sport-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    line-height: 1;
    margin: 0;
}

.strip-id {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.5px;
    line-height: 1;
    display: inline-block;
    position: relative;
    top: 0.5px;
}

.strip-wr {
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.strip-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.card-tag {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 4px;
    line-height: 1.2;
}

.tag-reversion {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.28);
}

.tag-fade {
    background: rgba(168, 85, 247, 0.12);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.28);
}

.tag-asym {
    background: rgba(234, 179, 8, 0.12);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.28);
}

.tag-pace {
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.strip-name {
    font-size: 14px;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 12px;
    line-height: 1.3;
}

.strip-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.strip-roi {
    font-size: 13px;
    font-weight: 800;
    font-family: var(--font-mono);
}

.strip-cap {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}

/* THE ACTIVE MASTER PATTERN CARD (EXPANDED STAGE) */
.active-pattern-stage {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.88) 0%, rgba(10, 15, 30, 0.96) 100%);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 0 35px rgba(56, 189, 248, 0.15);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* VINTAGE ARCHIVAL SPORTS BACKDROP (Faded but visible header watermark) */
.stage-vintage-backdrop {
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    max-width: 680px;
    height: 330px;
    background-size: cover;
    background-position: center 25%;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 0;
    opacity: 0.18;
    filter: grayscale(100%) contrast(145%) brightness(95%);
    mix-blend-mode: screen;
    mask-image: radial-gradient(ellipse 90% 85% at 75% 25%, black 25%, transparent 85%);
    -webkit-mask-image: radial-gradient(ellipse 90% 85% at 75% 25%, black 25%, transparent 85%);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), background-image 0.5s ease;
}

.stage-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.stage-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.stage-code-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--accent-cyan);
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    padding: 3px 8px;
    border-radius: 5px;
}

.stage-scenario-pill {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 3px 8px;
    border-radius: 5px;
    text-transform: uppercase;
}

.stage-strat-pill {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.8px;
    padding: 3px 8px;
    border-radius: 5px;
    text-transform: uppercase;
}

.stage-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.stage-refined-title {
    font-size: 19px; /* Toned down & non-dominant */
    font-weight: 750;
    color: #f8fafc;
    letter-spacing: -0.2px;
    margin: 0;
    line-height: 1.3;
}

.stage-sport-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    flex-shrink: 0;
}

.stage-sport-badge .pro-icon {
    width: 17px;
    height: 17px;
}

/* ELEVATED QUANTITATIVE THESIS BLOCK (HERO OF THE CARD) */
.stage-thesis-card {
    background: rgba(10, 16, 30, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-left: 4px solid var(--accent-cyan);
    border-radius: 10px;
    padding: 16px 20px;
    margin-top: 6px;
    max-width: 820px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(56, 189, 248, 0.08);
    position: relative;
    z-index: 2;
}

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

.thesis-kicker {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--accent-cyan);
    text-transform: uppercase;
}

.thesis-badge {
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.8px;
}

.stage-thesis-text {
    font-size: 16px; /* Primary, prominent, and highly legible */
    line-height: 1.65;
    color: #f8fafc; /* Crisp, high-contrast white */
    font-weight: 450;
    margin: 0;
    letter-spacing: -0.1px;
}

/* COMPACT LIVE RESULTS HUD */
.stage-live-hud {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.hud-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
}

.hud-card.primary-hud {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, rgba(15, 23, 42, 0.8) 100%);
    border-color: rgba(34, 197, 94, 0.35);
}

.hud-lbl {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.hud-val {
    font-size: 22px;
    font-weight: 800;
    font-family: var(--font-mono);
    line-height: 1.2;
}

.hud-foot {
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
    font-weight: 500;
}

/* STREAMLINED TUNER BOX */
.streamlined-tuner {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tuner-slider-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tuner-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tuner-label {
    font-size: 11px;
    font-weight: 800;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tuner-badge {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 800;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    padding: 2px 10px;
    border-radius: 6px;
}

.tuner-pills-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: center;
}

.tuner-pill-col {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.tuner-pill-col .tuner-label {
    flex-shrink: 0;
}

.segmented-pills {
    display: flex;
    background: rgba(10, 15, 30, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.pill-btn {
    flex: 1 1 auto;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    text-align: center;
    transition: all 0.15s ease;
}

.pill-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.pill-btn.active {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.4);
    font-weight: 700;
}

.stage-cta-box {
    margin-top: 36px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12) 0%, rgba(129, 140, 248, 0.12) 100%);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 14px;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.15);
}

.cta-left h4 {
    font-size: 20px;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 4px;
}

.cta-left p {
    font-size: 14px;
    color: #94a3b8;
}

.cta-tier-pills {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.tier-pill {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 9999px;
}

.tier-pill.featured {
    border-color: #38bdf8;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
}

.cta-right .btn-primary {
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 800;
    border-radius: 10px;
    cursor: pointer;
}

.pattern-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-active);
}

.highlight-card {
    border-color: rgba(56, 189, 248, 0.5);
    background: linear-gradient(180deg, rgba(13, 21, 42, 1) 0%, rgba(18, 29, 56, 1) 100%);
}

.hot-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: #e11d48;
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    font-family: var(--font-mono);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.pattern-id {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
}

.capacity-tag {
    background: rgba(5, 8, 17, 0.8);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 4px 8px;
    position: relative;
    overflow: hidden;
}

.cap-fill-bar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: rgba(56, 189, 248, 0.2);
    z-index: 0;
}

.cap-text {
    position: relative;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent-cyan);
    font-weight: 700;
    z-index: 1;
}

.pattern-name {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 10px;
}

.pattern-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    text-align: center;
}

.stat-box {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-size: 16px;
    font-weight: 800;
    font-family: var(--font-mono);
}

.color-green {
    color: var(--accent-green);
}

.stat-sub {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-subtle);
    padding-top: 16px;
}

.price-info {
    display: flex;
    align-items: baseline;
}

.price-val {
    font-size: 22px;
    font-weight: 800;
    font-family: var(--font-mono);
}

.price-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 2px;
}

.btn-card {
    background: #0284c7;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-card:hover {
    background: #0369a1;
}

/* STEPS */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 32px 24px;
}

.step-num {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 800;
    color: var(--border-active);
    margin-bottom: 16px;
}

.step-card h4 {
    font-size: 18px;
    margin-bottom: 10px;
}

.step-card p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* PRICING */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
    max-width: 1060px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 36px 28px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.featured-pricing {
    border-color: var(--accent-cyan);
    background: linear-gradient(180deg, rgba(13, 21, 42, 1) 0%, rgba(18, 32, 64, 1) 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.tier-popular {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #0284c7;
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 12px;
    border-radius: 12px;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
}

.tier-name {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.tier-price {
    font-size: 44px;
    font-weight: 800;
    font-family: var(--font-mono);
    margin-bottom: 8px;
}

.tier-price span {
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 500;
}

.tier-points-pill {
    display: inline-block;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--accent-green);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.tier-points-pill small {
    color: var(--text-secondary);
    font-weight: 500;
    margin-left: 4px;
}

.tier-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 28px;
    min-height: 40px;
}

.tier-features {
    list-style: none;
    margin-bottom: 32px;
    flex-grow: 1;
}

.tier-features li {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-tier {
    width: 100%;
    background: #1e293b;
    color: white;
    border: 1px solid var(--border-active);
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-tier:hover {
    background: #0284c7;
    border-color: #0284c7;
}

/* ON-DEMAND TOP-UP PACKS */
.topup-container {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 36px 32px;
    max-width: 1060px;
    margin: 48px auto 0 auto;
}

.topup-header {
    text-align: center;
    margin-bottom: 28px;
}

.topup-header h3 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
}

.topup-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.topup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.topup-card {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: all 0.2s;
}

.topup-card:hover {
    border-color: var(--border-active);
    transform: translateY(-2px);
}

.featured-topup {
    border-color: rgba(56, 189, 248, 0.4);
    background: linear-gradient(180deg, rgba(13, 21, 42, 0.6) 0%, rgba(18, 32, 64, 0.6) 100%);
}

.topup-badge {
    position: absolute;
    top: -10px;
    background: #0284c7;
    color: white;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
}

.topup-name {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.topup-pts {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 800;
    color: var(--accent-cyan);
    margin-bottom: 4px;
}

.topup-price {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
}

.topup-price small {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.btn-topup {
    width: 100%;
    background: #1e293b;
    color: white;
    border: 1px solid var(--border-active);
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-topup:hover {
    background: #0284c7;
    border-color: #38bdf8;
}

/* FOOTER */
.footer {
    border-top: 1px solid var(--border-subtle);
    padding: 60px 0;
    background: var(--bg-base);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 32px;
}

.footer-brand {
    max-width: 500px;
}

.footer-disclaimer {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 14px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
}

.footer-links a:hover {
    color: white;
}

/* MODAL */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 20px;
}

.modal-backdrop.hidden {
    display: none;
}

.modal-box {
    background: #0d152a;
    border: 1px solid var(--border-active);
    border-radius: 14px;
    width: 100%;
    max-width: 400px;
    padding: 32px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
}

.modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.modal-symbol {
    color: var(--accent-cyan);
    font-size: 24px;
    display: block;
    margin-bottom: 6px;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 800;
}

.modal-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 10px 12px;
    color: white;
    font-size: 14px;
}

.input-group input:focus {
    border-color: var(--accent-cyan);
    outline: none;
}

.btn-block {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    font-weight: 700;
}

.modal-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.modal-footer a {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
}

.pro-icon {
    width: 18px;
    height: 18px;
    display: block;
    stroke: currentColor;
    color: #38bdf8;
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.4));
    margin: 0;
    flex-shrink: 0;
}

.teaser-icon .pro-icon {
    width: 22px;
    height: 22px;
}

/* RESPONSIVE & MOBILE-FIRST POLISH */
@media (max-width: 768px) {
    .hero-title {
        font-size: 34px;
        line-height: 1.15;
    }
    .hero-subtitle {
        font-size: 14px;
        margin-bottom: 28px;
    }
    .hero-cta-group {
        display: flex;
        justify-content: center;
        align-items: center;
        margin-bottom: 32px;
        width: 100%;
    }
    .hero-cta-group .btn-large {
        width: auto;
        min-width: 210px;
        max-width: 260px;
        padding: 13px 26px;
        font-size: 14px;
        text-align: center;
        margin: 0 auto;
        display: inline-flex;
        justify-content: center;
        align-items: center;
    }
    .hero-playbook-ticker {
        padding: 5px 10px;
        gap: 6px;
        margin: 0 auto 24px auto;
        width: auto;
        max-width: calc(100vw - 28px);
        box-sizing: border-box;
    }
    .ticker-badge {
        padding: 2px 6px;
        font-size: 9px;
    }
    .ticker-name {
        font-size: 12px;
        font-weight: 700;
        white-space: nowrap;
    }
    .ticker-val {
        font-size: 12px;
        font-weight: 800;
        white-space: nowrap;
    }
    .ticker-stat {
        display: none;
    }
    .ticker-dots {
        gap: 3px;
        padding-left: 4px;
    }
    .playbook-bg-sketch {
        opacity: 0.22 !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 120vw !important;
        max-width: none !important;
    }
    .playbook-bg-sketch.section-bg-pos {
        transform: translate(-50%, -50%) !important;
        width: 120vw !important;
        opacity: 0.18 !important;
    }
    .nav-links a {
        display: none;
    }

    /* CAROUSEL MOBILE POLISH */
    .carousel-nav-bar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }
    .carousel-title-group {
        gap: 2px;
    }
    .carousel-catalog-label {
        font-size: 10px;
    }
    .carousel-catalog-sub {
        font-size: 11px;
    }
    .carousel-arrow-group {
        padding: 4px 12px;
        flex-shrink: 0;
    }

    /* CARD STRIP SNAP ON MOBILE */
    .carousel-card-strip {
        padding: 4px 0 16px 0;
        gap: 12px;
    }
    .strip-card {
        flex: 0 0 78vw;
        max-width: 280px;
        scroll-snap-align: center;
    }

    /* MASTER STAGE MOBILE POLISH */
    .container {
        padding: 0 16px;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }
    .section {
        padding: 60px 0;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    .pattern-carousel-container {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .active-pattern-stage {
        padding: 20px 14px;
        border-radius: 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .stage-header {
        flex-direction: column;
        gap: 10px;
    }
    .stage-title-box h3 {
        font-size: 20px;
    }
    .stage-title-box p {
        font-size: 13px;
    }
    /* 1. HERO HUD: Clean 2x2 grid */
    .stage-live-hud {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .hud-card {
        padding: 10px 12px !important;
        min-width: 0 !important;
    }
    .hud-val {
        font-size: 18px !important;
    }
    .hud-lbl {
        font-size: 10px !important;
    }
    .hud-foot {
        font-size: 9px !important;
    }

    /* 2. TUNER ROWS: Stack Horizon & Velocity cleanly */
    .streamlined-tuner {
        padding: 12px 14px !important;
        gap: 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .tuner-pills-row {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .tuner-pill-col {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .tuner-pill-col .tuner-label {
        font-size: 11px !important;
    }

    .segmented-pills {
        width: 100% !important;
        display: flex !important;
        box-sizing: border-box !important;
    }

    .pill-btn {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        padding: 7px 4px !important;
        font-size: 11px !important;
        text-align: center !important;
    }

    .stake-ticks-bar {
        font-size: 10px !important;
        width: calc(100% - 22px) !important;
        box-sizing: border-box !important;
    }

    .stake-tick {
        font-size: 10px !important;
    }

    /* TABLES MOBILE POLISH */
    .table-responsive {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        display: block;
        box-sizing: border-box;
    }
    .audit-table-card {
        padding: 14px 10px;
        margin-top: 20px !important;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    .audit-table th, .audit-table td {
        padding: 8px 6px;
        font-size: 11px;
        white-space: nowrap;
    }

    /* CTA BOX MOBILE POLISH */
    .stage-cta-box {
        flex-direction: column;
        align-items: stretch;
        padding: 20px 16px;
        gap: 16px;
        text-align: center;
    }
    .cta-tier-pills {
        justify-content: center;
    }
    .cta-right .btn-primary {
        width: 100%;
    }
}

/* COLLAPSIBLE MATCH LOG */
.log-toggle-header {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, border-color 0.2s;
    padding: 16px 20px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.log-toggle-header:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(56, 189, 248, 0.4);
}

.log-toggle-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.log-chevron-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #38bdf8;
    flex-shrink: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.chevron-svg {
    width: 14px;
    height: 14px;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.log-toggle-header:hover .log-chevron-btn {
    background: rgba(56, 189, 248, 0.18);
    border-color: rgba(56, 189, 248, 0.45);
    transform: scale(1.05);
}

.log-toggle-header.expanded .log-chevron-btn {
    background: rgba(56, 189, 248, 0.22);
    border-color: #38bdf8;
}

.log-toggle-header.expanded .chevron-svg {
    transform: rotate(90deg);
}

.matches-log-body {
    display: none;
    margin-top: 16px;
}

.matches-log-body.expanded {
    display: block;
}

/* ==============================================================================
   QUANT AUDIT & BACKTEST EXPLORER STYLING
   ============================================================================== */

.audit-callout {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border-active);
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 36px;
    gap: 32px;
}

.callout-col {
    flex: 1;
}

.callout-divider {
    width: 1px;
    background: var(--border-subtle);
}

.callout-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.callout-badge.verified {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.callout-badge.backtested {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.callout-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.callout-text b {
    color: white;
}

/* SIMULATOR PANEL */
.sim-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-active);
    border-radius: 14px;
    padding: 32px 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.sim-controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 24px;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .sim-controls-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.sim-control-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sim-control-item label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stake-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stake-display-val {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 800;
    color: var(--accent-cyan);
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 2px 10px;
    border-radius: 6px;
}

#stake-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: #1e293b;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

#stake-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: #38bdf8;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
    border: 2px solid white;
}

.stake-ticks-bar {
    position: relative;
    width: calc(100% - 22px);
    margin: 8px auto 0 auto;
    height: 18px;
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.stake-tick {
    position: absolute;
    top: 0;
    white-space: nowrap;
    user-select: none;
    font-size: 11px;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.15s ease;
}

.stake-tick:hover {
    color: #38bdf8;
}

.stake-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: -4px;
}

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

.tab-btn, .year-btn, .mode-btn {
    background: var(--bg-base);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-sans);
}

.tab-btn:hover, .year-btn:hover, .mode-btn:hover {
    color: white;
    border-color: var(--border-active);
}

.tab-btn.active, .year-btn.active, .mode-btn.active {
    background: #0284c7;
    color: white;
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.knob-param-spec {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 6px 10px;
    margin-top: 8px;
    line-height: 1.4;
}

.knob-param-spec b {
    color: var(--accent-cyan);
}

@keyframes numberPulse {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.08); filter: brightness(1.7); color: #38bdf8; }
    100% { transform: scale(1); filter: brightness(1); }
}

.pulse-update {
    display: inline-block;
    animation: numberPulse 0.35s ease-out;
}

/* SIMULATOR METRIC CARDS */
.sim-results-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 900px) {
    .sim-results-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.result-card {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.primary-result {
    border-color: rgba(34, 197, 94, 0.4);
    background: linear-gradient(180deg, rgba(5, 8, 17, 1) 0%, rgba(13, 30, 24, 0.6) 100%);
}

.res-sub {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.res-big {
    font-size: 28px;
    font-weight: 800;
    font-family: var(--font-mono);
    line-height: 1.1;
    margin-bottom: 8px;
}

.res-sub-foot {
    font-size: 12px;
    color: var(--text-secondary);
}

.color-cyan {
    color: var(--accent-cyan);
}

.color-red {
    color: #ef4444;
}

/* TABLES */
.audit-table-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 24px;
    overflow: hidden;
}

.table-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 14px;
    margin-bottom: 16px;
}

.table-card-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: #f8fafc;
}

.table-sub-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 3px 10px;
    border-radius: 6px;
}

.table-responsive {
    overflow-x: auto;
}

.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.audit-table th {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.audit-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    white-space: nowrap;
}

.audit-table tr:last-child td {
    border-bottom: none;
}

.audit-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.table-tag {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    white-space: nowrap !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    font-family: var(--font-mono) !important;
    line-height: 1.2 !important;
    flex-shrink: 0 !important;
}

.table-tag.win {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(34, 197, 94, 0.3);
    white-space: nowrap !important;
}

.table-tag.loss {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    white-space: nowrap !important;
}

