/**
 * J-ALGO Capital Management - Institutional Style System
 * 100% Pure CSS3, zero preprocessors, zero external libraries.
 */

:root {
    --bg-primary: #0d1520;
    --bg-secondary: #131f2e;
    --bg-card: rgba(15, 23, 33, 0.85);
    --bg-card-hover: rgba(20, 32, 45, 0.92);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    --border-glow: 0 0 15px rgba(45, 212, 191, 0.08);
    
    --accent-teal: #2dd4bf;
    --accent-teal-rgb: 45, 212, 191;
    --accent-emerald: #0d9488;
    --accent-dark-green: #115e59;
    --loss-red: #ff5274;
    --loss-red-rgb: 255, 82, 116;
    
    --text-primary: #f0f4f8;
    --text-secondary: rgba(230, 230, 230, 0.72);
    --text-muted: rgba(230, 230, 230, 0.45);
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
    
    --header-height: 72px;
    --ticker-height: 38px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
}


/* Reset & Global */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


html {
    scroll-behavior: smooth;
    color-scheme: dark;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 50% -5%, rgba(20, 145, 115, 0.28) 0%, transparent 65%),
        radial-gradient(circle at 100% 45%, rgba(20, 180, 140, 0.12) 0%, transparent 55%),
        radial-gradient(circle at 0% 75%, rgba(45, 212, 191, 0.09) 0%, transparent 45%),
        linear-gradient(180deg, rgba(16, 26, 38, 0.5) 0%, rgba(10, 16, 24, 0.85) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}


/* Background Canvas */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}


.site-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}


/* Typography Helpers */
.font-mono { font-family: var(--font-mono); }

.text-teal { color: var(--accent-teal); }

.text-emerald { color: var(--accent-emerald); }

.text-red { color: var(--loss-red); }

.text-muted { color: var(--text-muted); }

.text-sec { color: var(--text-secondary); }


/* Header & Nav */
.header-nav {
    position: sticky;
    top: 0;
    width: 100%;
    height: 64px;
    background: rgba(9, 14, 18, 0.22);
    backdrop-filter: blur(10px) saturate(130%);
    -webkit-backdrop-filter: blur(10px) saturate(130%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 100;
}


.header-nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}


/* TradingView Header Nav Integration */
.nav-tv-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-mono, monospace);
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    white-space: nowrap;
}


.nav-tv-btn.has-notice {
    border-color: rgba(45, 212, 191, 0.3);
    background: rgba(45, 212, 191, 0.04);
}


.nav-tv-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(45, 212, 191, 0.45);
    color: #5eead4;
}


.nav-tv-btn.icon-only {
    padding: 0.35rem 0.55rem;
}


.tv-icon-svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
    flex-shrink: 0;
    display: block;
}


.tv-announcement-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    max-width: 220px;
    opacity: 1;
    transform: translateX(0);
    overflow: hidden;
    vertical-align: middle;
    animation: tvBadgeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
    transition: max-width 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.4s ease,
                transform 0.4s ease,
                margin 0.4s ease;
}


.tv-announcement-badge.tv-hidden {
    max-width: 0 !important;
    opacity: 0 !important;
    transform: translateX(8px) !important;
    margin: 0 !important;
    pointer-events: none;
}


.tv-pulse-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #2dd4bf;
    flex-shrink: 0;
}


.tv-text {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: linear-gradient(90deg, #94a3b8 0%, #ffffff 35%, #2dd4bf 70%, #94a3b8 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: tvTextShimmer 3s ease-in-out infinite;
    white-space: nowrap;
}


@keyframes tvTextShimmer {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}


@keyframes tvBadgeIn {
    0% {
        opacity: 0;
        transform: translateX(10px) scale(0.94);
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }

}


/* Tooltip when icon-only mode is active */
.nav-tv-btn.icon-only:hover::after {
    content: "Jamallo22 on TradingView";
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(10, 16, 22, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 0.35rem 0.65rem;
    font-size: 0.72rem;
    font-family: var(--font-mono, monospace);
    color: #e2e8f0;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
    pointer-events: none;
    z-index: 1000;
    backdrop-filter: blur(8px);
    animation: tvTooltipFade 0.2s ease;
}


@keyframes tvTooltipFade {
    0% { opacity: 0; transform: translateY(-3px); }

    100% { opacity: 1; transform: translateY(0); }

}


.nav-concepts-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-mono, monospace);
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    transition: all 0.2s ease;
}


.nav-concepts-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(45, 212, 191, 0.4);
    color: #5eead4;
    box-shadow: 0 0 12px rgba(45, 212, 191, 0.12);
}

.nav-ssrn-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-mono, monospace);
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-ssrn-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(45, 212, 191, 0.45);
    color: #5eead4;
    box-shadow: 0 0 12px rgba(45, 212, 191, 0.12);
}

.ssrn-icon-svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
    flex-shrink: 0;
    display: block;
}

.nav-btn-text-mobile {
    display: none;
}

.ssrn-btn-text-mobile {
    display: none;
}

.tv-text-short {
    display: none;
}

.marker-text-short {
    display: none;
}


.brand-box {
    display: flex;
    align-items: center;
    text-decoration: none;
}


.brand-logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
    border-radius: 12px;
    filter: none;
    box-shadow: none;
    transition: transform 0.3s ease;
}


.brand-box:hover .brand-logo-img {
    transform: scale(1.02);
}


.brand-text {
    display: flex;
    flex-direction: column;
}


.brand-title {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--accent-teal);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


.brand-subtitle {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}


.nav-links {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    list-style: none;
}


.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
    padding: 0.3rem 0;
}


.nav-link:hover {
    color: var(--accent-teal);
}


.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}


.telemetry-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    background: rgba(18, 211, 157, 0.08);
    border: 1px solid rgba(18, 211, 157, 0.2);
    border-radius: 9999px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-secondary);
}


.status-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-teal);
    box-shadow: 0 0 8px var(--accent-teal);
    animation: pulse 1.8s infinite;
}


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

    50% { opacity: 0.4; transform: scale(0.85); }

}


.btn-primary {
    background: linear-gradient(135deg, var(--accent-teal), var(--accent-emerald));
    color: #060e0a;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    padding: 0.55rem 1.25rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 2px 12px rgba(18, 211, 157, 0.25);
}


.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(18, 211, 157, 0.45);
}


.btn-outline {
    background: transparent;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.82rem;
    padding: 0.55rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s ease;
}


.btn-outline:hover {
    border-color: var(--accent-teal);
    color: var(--accent-teal);
    background: rgba(18, 211, 157, 0.05);
}


/* Market Ticker Tape */
.ticker-bar {
    width: 100%;
    height: var(--ticker-height);
    background: rgba(11, 17, 22, 0.9);
    border-bottom: 1px solid var(--border-subtle);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}


.ticker-track {
    display: flex;
    gap: 2rem;
    white-space: nowrap;
    animation: ticker-slide 42s linear infinite;
    padding-left: 1rem;
}


.ticker-track:hover {
    animation-play-state: paused;
}


@keyframes ticker-slide {
    0% { transform: translateX(0); }

    100% { transform: translateX(-50%); }

}


.ticker-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.15rem 0.6rem;
}


.ticker-sym {
    color: var(--text-primary);
    font-weight: 600;
}


.ticker-price {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}


.ticker-price.flash-up {
    color: #48ffc7;
    text-shadow: 0 0 6px rgba(72, 255, 199, 0.6);
}


.ticker-price.flash-down {
    color: #ff5274;
    text-shadow: 0 0 6px rgba(255, 82, 116, 0.6);
}


.ticker-change.pos { color: var(--accent-teal); }

.ticker-change.neg { color: var(--loss-red); }


/* Main Container */
.main-container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    width: 100%;
    flex: 1;
}


/* Hero Section */
.hero-section {
    text-align: center;
    padding: 3rem 1rem 4rem;
    position: relative;
}


.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 1rem;
    background: rgba(18, 211, 157, 0.08);
    border: 1px solid rgba(18, 211, 157, 0.25);
    border-radius: 9999px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-teal);
    margin-bottom: 1.5rem;
}


.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
    background: linear-gradient(180deg, #ffffff 30%, rgba(240, 244, 248, 0.75) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}


.hero-title .gradient-span {
    background: linear-gradient(135deg, var(--accent-teal) 0%, #20e4b0 60%, var(--accent-emerald) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}


.hero-subtitle {
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    color: var(--text-secondary);
    max-width: 820px;
    margin: 0 auto 2rem;
    font-weight: 300;
    line-height: 1.6;
}


.hero-cta-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3.5rem;
}


/* KPI Overview Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}


.kpi-card {
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.15rem;
    transition: all 0.25s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
}


.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-teal), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}


.kpi-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(18, 211, 157, 0.12);
}


.kpi-card:hover::before {
    opacity: 1;
}


.kpi-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: rgba(18, 211, 157, 0.1);
    border: 1px solid rgba(18, 211, 157, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-teal);
    flex-shrink: 0;
}


.kpi-content {
    flex: 1;
}


.kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}


.kpi-value {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent-teal);
    line-height: 1.1;
    margin-bottom: 0.25rem;
}


.kpi-sub {
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}


.kpi-sub.highlight {
    color: var(--accent-teal);
}


/* Secondary Institutional Ratios Bar */
.ratios-bar {
    background: rgba(14, 23, 29, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 3.5rem;
}


.ratio-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 110px;
}


.ratio-name {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}


.ratio-val {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}


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


/* Section Header */
.section-header {
    margin-bottom: 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}


.section-title {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.65rem;
}


.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.2em;
    background: var(--accent-teal);
    border-radius: 2px;
}


.section-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}


/* Analytics Chart Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}


.chart-card {
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    transition: border-color 0.25s ease;
}


.chart-card:hover {
    border-color: var(--border-hover);
}


.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.15rem 1.4rem;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(18, 211, 157, 0.02);
}


.chart-title-wrap {
    display: flex;
    flex-direction: column;
}


.chart-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-teal);
}


.chart-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
}


.btn-group {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 2px;
    gap: 2px;
}


.btn-tab {
    background: transparent;
    border: none;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 0.28rem 0.65rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}


.btn-tab:hover {
    color: var(--text-primary);
}


.btn-tab.active {
    background: rgba(18, 211, 157, 0.2);
    color: var(--accent-teal);
    font-weight: 600;
}


.chart-body {
    padding: 1.25rem 1.25rem 1rem;
    position: relative;
    flex: 1;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}


.chart-canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}


/* Donut & Exposure Cards */
.sub-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 3.5rem;
}


.gauge-legend {
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 1.25rem 1.25rem;
    border-top: 1px solid var(--border-subtle);
}


.gauge-col {
    display: flex;
    flex-direction: column;
    align-items: center;
}


.gauge-col-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}


.gauge-col-val {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent-teal);
}


.gauge-col-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
}


/* Live Terminal Feed Section */
.terminal-card {
    background: rgba(9, 14, 18, 0.95);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 4rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}


.terminal-header {
    background: rgba(14, 21, 26, 0.9);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.85rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}


.terminal-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}


.terminal-dots {
    display: flex;
    gap: 6px;
}


.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-red { background: #ff5f56; }

.dot-yellow { background: #ffbd2e; }

.dot-green { background: #27c93f; }


.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 600;
}


.terminal-body {
    padding: 0.75rem 1.25rem;
    max-height: 240px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(18, 211, 157, 0.2) transparent;
}


.exec-row {
    display: grid;
    grid-template-columns: 95px 85px 80px 105px 120px 85px 75px 1fr 65px;
    gap: 0.75rem;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
}


.exec-time { color: var(--text-muted); font-size: 0.7rem; }

.exec-strat { color: #8bb5ff; font-weight: 600; }

.exec-asset { color: var(--text-primary); font-weight: 700; }

.exec-price { color: var(--text-muted); }

.exec-size { color: #d0dbe5; }

.exec-alpha { color: var(--accent-teal); font-weight: 700; }

.exec-route { color: var(--text-muted); font-size: 0.68rem; }

.exec-status { color: #27c93f; font-weight: 700; font-size: 0.68rem; text-align: right; }


.exec-action {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 3px;
    font-size: 0.68rem;
    font-weight: 700;
    text-align: center;
}

.tag-buy { background: rgba(18, 211, 157, 0.15); color: var(--accent-teal); }

.tag-sell { background: rgba(255, 82, 116, 0.15); color: var(--loss-red); }

.tag-hedge { background: rgba(255, 189, 46, 0.15); color: #ffbd2e; }

.tag-neutral { background: rgba(139, 181, 255, 0.15); color: #8bb5ff; }


/* Quantitative Architecture Pillars */
.arch-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 4rem;
}


.arch-card {
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.75rem 1.4rem;
    transition: all 0.25s ease;
}


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


.arch-num {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--accent-teal);
    margin-bottom: 0.85rem;
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: rgba(18, 211, 157, 0.1);
    border-radius: 4px;
}


.arch-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.65rem;
}


.arch-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
}


/* Strategy Directory Table */
.strategy-table-card {
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 4rem;
}


.strat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}


.strat-table th {
    background: rgba(18, 211, 157, 0.04);
    padding: 1rem 1.25rem;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
}


.strat-table td {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
}


.strat-table tr:hover td {
    background: rgba(18, 211, 157, 0.02);
}


.strat-id-cell {
    font-family: var(--font-mono);
    color: var(--accent-teal);
    font-weight: 700;
}


.strat-name-cell {
    color: var(--text-primary);
    font-weight: 600;
}


.strat-alpha-cell {
    font-family: var(--font-mono);
    color: var(--accent-teal);
    font-weight: 700;
}


.badge-active {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    background: rgba(18, 211, 157, 0.12);
    border: 1px solid rgba(18, 211, 157, 0.25);
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-teal);
}


/* Institutional Contact CTA Box */
.institutional-cta {
    background: linear-gradient(135deg, rgba(10, 117, 87, 0.3) 0%, rgba(14, 21, 26, 0.9) 100%);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 8px 32px rgba(10, 117, 87, 0.15);
}


.cta-info h3 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}


.cta-info p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    max-width: 600px;
}


.cta-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}


/* Footer */
.site-footer {
    background: rgba(7, 10, 14, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.85rem 1.5rem;
    min-height: 42px;
    color: #64748b;
    font-size: 0.72rem;
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    color: #64748b;
    letter-spacing: 0.02em;
    text-align: center;
}

.footer-disclaimer {
    margin: 0;
}

.footer-divider {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.65rem;
    user-select: none;
}

.footer-contact {
    color: #64748b;
}

.footer-contact-link {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-contact-link:hover {
    color: #2dd4bf;
    text-decoration: underline;
    text-underline-offset: 3px;
}


.footer-inner {
    max-width: 1360px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.2fr;
    gap: 3rem;
    margin-bottom: 3rem;
}


.footer-brand-wrap {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}


.footer-logo-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}


.footer-app-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}


.footer-brand-text {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-teal);
}


.footer-desc {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.6;
    max-width: 380px;
}


.social-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}


.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}


.social-btn img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}


.social-btn:hover {
    border-color: var(--accent-teal);
    color: var(--accent-teal);
    background: rgba(18, 211, 157, 0.08);
}


.footer-col-title {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    margin-bottom: 1rem;
}


.footer-address {
    font-style: normal;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}


.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}


.btn-copy-email {
    background: transparent;
    border: none;
    color: var(--accent-teal);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: underline;
    transition: color 0.2s ease;
}


.btn-copy-email:hover {
    color: #48ffc7;
}


.btn-copy-email.copied {
    color: #27c93f;
}


.footer-legal {
    max-width: 1360px;
    margin: 0 auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}


/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 7, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 1.5rem;
}


.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}


.modal-box {
    background: #0c1419;
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 520px;
    padding: 2rem;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
    position: relative;
}


.modal-close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
}


.modal-close-btn:hover {
    color: var(--text-primary);
}


.form-group {
    margin-bottom: 1.15rem;
}


.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}


.form-input, .form-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    transition: border-color 0.2s ease;
}


.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent-teal);
    background: rgba(18, 211, 157, 0.03);
}


/* Responsive Media Queries */
@media (max-width: 1100px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .arch-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }

}


@media (max-width: 860px) {
    .header-nav {
        padding: 0 1rem;
    }

    .nav-links {
        display: none;
    }

    .analytics-grid, .sub-charts-grid {
        grid-template-columns: 1fr;
    }

    .institutional-cta {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1.5rem;
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }

    .exec-row {
        grid-template-columns: 80px 70px 70px 90px 100px 70px 1fr;
    }

    .exec-route, .exec-status {
        display: none;
    }

}


@media (max-width: 580px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .arch-grid {
        grid-template-columns: 1fr;
    }

    .ratios-bar {
        justify-content: center;
    }

    .ratio-item {
        min-width: 45%;
    }

    .main-container {
        padding: 1.5rem 1rem 4rem;
    }

}

/* ==========================================================================
   Progress Bar & Edge Calibration Section
   ========================================================================== */
.edge-calibration-section {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.edge-card-inner {
    background: rgba(10, 15, 20, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(14px);
}

.edge-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.edge-card-header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
}

.model-disclaimer-sub {
    margin: 0;
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    font-weight: 500;
    color: #94a3b8;
    letter-spacing: 0.02em;
}

.badge-quant-tag {
    font-family: var(--font-mono, monospace);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    display: inline-block;
}

.order-execution-note {
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    font-weight: 500;
    color: #94a3b8;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
}

.edge-stats-pills {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.edge-stat-pill {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 0.45rem 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.edge-stat-pill.active-edge {
    border-color: rgba(45, 212, 191, 0.3);
    background: rgba(45, 212, 191, 0.04);
}

.stat-pill-label {
    font-size: 0.6rem;
    font-family: var(--font-mono, monospace);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 0.15rem;
}

.stat-pill-value {
    font-size: 1.05rem;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    color: #e2e8f0;
}

.edge-stat-pill.active-edge .stat-pill-value {
    color: #2dd4bf;
}

.stat-pill-value.stat-pos {
    color: #34d399;
}

/* Progression Bar Track - Muted & Subdued */
.progress-bar-wrapper {
    position: relative;
    padding-top: 2.6rem;
    margin-bottom: 1.5rem;
}

.progress-bar-track {
    width: 100%;
    height: 30px;
    background: #06090d;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 7px;
    display: flex;
    overflow: visible;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.progress-segment {
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    font-weight: 600;
    box-sizing: border-box;
}

.progress-segment:first-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.progress-segment:last-child {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

/* 0-50%: Maroonish (Muted Dark Wine) */
.seg-maroon {
    background: #2b0b12;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    color: #9f717b;
}

/* 51%: Yellow (Muted Amber Ochre) */
.seg-yellow {
    background: #52370c;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    color: #d99b26;
    min-width: 14px;
}

/* 52-60%: Greenish (Muted Spruce/Teal) */
.seg-green {
    background: #0d382e;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    color: #5eead4;
}

/* 61%-100%: Slight Grey (Dark Charcoal) */
.seg-grey {
    background: #111827;
    color: #64748b;
}

.seg-inner-label {
    letter-spacing: 0.04em;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Marker Needle at 52.6% - Clean Static Indicator (No Pulse, No Harsh Glow) */
.progress-marker-needle {
    position: absolute;
    top: -2.35rem;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}

.marker-flag {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: #090e13;
    border: 1px solid rgba(45, 212, 191, 0.35);
    border-radius: 6px;
    padding: 0.22rem 0.6rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7);
    white-space: nowrap;
}

.marker-static-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #2dd4bf;
    flex-shrink: 0;
}

.marker-text {
    font-family: var(--font-mono, monospace);
    font-size: 0.74rem;
    font-weight: 600;
    color: #cbd5e1;
}

.marker-stem {
    width: 1.5px;
    height: 10px;
    background: rgba(45, 212, 191, 0.5);
}

.marker-point {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(45, 212, 191, 0.5);
}

/* Edge Labels Grid Cards - Muted Dark Institutional */
.edge-labels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.edge-label-box {
    background: rgba(10, 15, 20, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 0.7rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: border-color 0.2s ease;
}

.edge-label-box:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.edge-label-box.box-current {
    background: rgba(45, 212, 191, 0.03);
    border-color: rgba(45, 212, 191, 0.25);
}

.label-color-indicator {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.dot-maroon { background: #7f1d1d; }
.dot-yellow { background: #a16207; }
.dot-current { background: #2dd4bf; border-radius: 50%; }
.dot-green { background: #047857; }
.dot-grey { background: #475569; }

.label-details {
    display: flex;
    flex-direction: column;
}

.label-range {
    font-family: var(--font-mono, monospace);
    font-size: 0.8rem;
    font-weight: 700;
    color: #e2e8f0;
}

.edge-label-box.box-current .label-range {
    color: #2dd4bf;
}

.label-title {
    font-size: 0.72rem;
    color: #64748b;
    text-transform: lowercase;
}

/* ==========================================================================
   Performance Section (Chart, Totals, and Fixed Trade Ledger)
   ========================================================================== */
.trades-ledger-section {
    margin-bottom: 3.5rem;
}

.ledger-header-strip {
    margin-bottom: 1rem;
}

.ledger-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
    letter-spacing: -0.01em;
}

/* Performance Chart Card */
.performance-chart-card {
    background: rgba(10, 15, 22, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(14px);
}

.chart-header-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.chart-metric-chip {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.chip-label {
    font-family: var(--font-mono, monospace);
    font-size: 0.62rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.chip-val {
    font-family: var(--font-mono, monospace);
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
}

.chip-val.pos { color: #34d399; }
.chip-val.neg { color: #f43f5e; }
.chip-val.highlight { color: #2dd4bf; }

.chart-canvas-wrap {
    width: 100%;
    position: relative;
}

.chart-hover-pill {
    position: absolute;
    top: 8px;
    transform: translateX(-50%);
    background: rgba(10, 16, 22, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 0.3rem 0.65rem;
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    color: #cbd5e1;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
    z-index: 20;
}

.chart-hover-pill .pos { color: #34d399; font-weight: 700; }
.chart-hover-pill .neg { color: #f43f5e; font-weight: 700; }

/* Totals Row */
.performance-totals-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.total-kpi-card {
    background: rgba(10, 16, 22, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.total-kpi-label {
    font-family: var(--font-mono, monospace);
    font-size: 0.58rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.total-kpi-val {
    font-family: var(--font-mono, monospace);
    font-size: 0.95rem;
    font-weight: 700;
    color: #e2e8f0;
}

.total-kpi-val.pos { color: #34d399; }
.total-kpi-val.neg { color: #f43f5e; }
.total-kpi-val.highlight { color: #2dd4bf; }

/* Table Sub-Header Strip with Counter */
.table-sub-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
    padding: 0 0.25rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.table-sub-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.table-sub-heading {
    font-family: var(--font-mono, monospace);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #64748b;
    text-transform: uppercase;
}

.trades-counter {
    font-family: var(--font-mono, monospace);
    font-size: 0.82rem;
    color: #94a3b8;
    font-weight: 600;
}

/* Fixed Table Container */
.trades-fixed-container {
    height: 520px;
    max-height: 65vh;
    overflow-y: auto;
    overflow-x: auto;
    background: rgba(10, 16, 22, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(14px);
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.trades-fixed-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.trades-fixed-container::-webkit-scrollbar-track {
    background: transparent;
}

.trades-fixed-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.trades-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: left;
}

.trades-data-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #090e13;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.trades-data-table th {
    padding: 0.85rem 0.95rem;
    font-family: var(--font-mono, monospace);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.trades-data-table td {
    padding: 0.7rem 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: #e2e8f0;
    white-space: nowrap;
    vertical-align: middle;
}

.trades-data-table tr:hover td {
    background: rgba(255, 255, 255, 0.035);
}

.td-id {
    font-family: var(--font-mono, monospace);
    color: #64748b;
    font-size: 0.75rem;
}

.td-time {
    font-family: var(--font-mono, monospace);
    color: #94a3b8;
    font-size: 0.75rem;
}

.td-mono {
    font-family: var(--font-mono, monospace);
    font-size: 0.78rem;
}

.td-cum {
    color: #cbd5e1;
}

.font-bold {
    font-weight: 700;
}

.pnl-pos {
    color: #34d399;
}

.pnl-neg {
    color: #f43f5e;
}

.pnl-neutral {
    color: #94a3b8;
}

/* Badges */
.badge-session {
    font-family: var(--font-mono, monospace);
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}

.session-rth {
    border-color: rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.06);
}

.session-europe {
    border-color: rgba(168, 85, 247, 0.3);
    color: #c084fc;
    background: rgba(168, 85, 247, 0.06);
}

.session-asia {
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.06);
}

.badge-side {
    font-family: var(--font-mono, monospace);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.badge-side-long {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: #34d399;
}

.badge-side-short {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #f43f5e;
}

.badge-res {
    font-family: var(--font-mono, monospace);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.18rem 0.55rem;
    border-radius: 4px;
}

.badge-res-tp {
    background: rgba(45, 212, 191, 0.12);
    border: 1px solid rgba(45, 212, 191, 0.35);
    color: #2dd4bf;
}

.badge-res-sl {
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.35);
    color: #fb7185;
}

.badge-res-cancel {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}

/* Table Footer / Load More */
.table-container-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: #090e13;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    bottom: 0;
    z-index: 5;
}

.btn-load-more {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f1f5f9;
    font-family: var(--font-mono, monospace);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-load-more:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(45, 212, 191, 0.4);
    color: #5eead4;
    box-shadow: 0 0 12px rgba(45, 212, 191, 0.12);
}

.btn-load-more:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.trades-loading-spin {
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    color: #2dd4bf;
}

/* ==========================================================================
   Comprehensive Mobile & Tablet Responsive Engine
   ========================================================================== */

@media (max-width: 860px) {
    .header-nav {
        padding: 0 1.25rem;
    }

    .edge-card-inner {
        padding: 1.25rem 1.25rem;
    }

    .performance-totals-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.55rem;
    }

    .trades-fixed-container {
        height: 420px;
    }
}

@media (max-width: 640px) {
    /* Safe Mobile Top Header */
    .header-nav {
        height: 58px;
        padding: 0 0.85rem;
    }

    .brand-logo-img {
        height: 30px;
    }

    .header-nav-right {
        gap: 0.4rem;
    }

    .nav-tv-btn {
        padding: 0.35rem 0.55rem;
        font-size: 0.74rem;
    }

    .tv-text-full {
        display: none !important;
    }

    .tv-text-short {
        display: inline !important;
    }

    .nav-concepts-btn {
        font-size: 0.76rem;
        padding: 0.35rem 0.6rem;
    }

    .nav-ssrn-btn {
        font-size: 0.76rem;
        padding: 0.35rem 0.6rem;
    }

    .ssrn-btn-text {
        display: none !important;
    }

    .ssrn-btn-text-mobile {
        display: inline !important;
    }

    .nav-btn-text {
        display: none !important;
    }

    .nav-btn-text-mobile {
        display: inline !important;
    }

    /* Main Container Padding */
    .main-container {
        padding: 0.85rem 0.85rem 3rem;
    }

    /* Edge Calibration Card */
    .edge-calibration-section {
        margin-top: 0.75rem;
        margin-bottom: 1.25rem;
    }

    .edge-card-inner {
        padding: 1rem 0.85rem;
        border-radius: 10px;
    }

    .edge-card-top {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .edge-card-header-left {
        align-items: center;
        text-align: center;
        width: 100%;
    }

    .model-disclaimer-sub {
        font-size: 0.68rem;
        text-align: center;
    }

    .badge-quant-tag {
        width: 100%;
        text-align: center;
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
        box-sizing: border-box;
    }

    .order-execution-note {
        font-size: 0.68rem;
    }

    .edge-stats-pills {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
        width: 100%;
    }

    .edge-stat-pill {
        padding: 0.45rem 0.3rem;
        align-items: center;
        text-align: center;
        min-width: 0;
        border-radius: 6px;
    }

    .stat-pill-label {
        font-size: 0.52rem;
        letter-spacing: 0.02em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .stat-pill-value {
        font-size: 0.88rem;
        white-space: nowrap;
    }

    /* Progress Track: Clean & unclipped on small screens */
    .progress-bar-wrapper {
        padding-top: 2rem;
        margin-bottom: 1.15rem;
    }

    .progress-bar-track {
        height: 24px;
        border-radius: 6px;
    }

    /* Hide inner segment labels that overflow thin segments (e.g. 8.5% segment) */
    .seg-inner-label {
        display: none !important;
    }

    .marker-text-full {
        display: none !important;
    }

    .marker-text-short {
        display: inline !important;
    }

    .marker-flag {
        padding: 0.18rem 0.42rem;
        border-radius: 5px;
    }

    .marker-flag .marker-text {
        font-size: 0.68rem;
    }

    /* Color-Coded Labels Grid: 2-column balanced */
    .edge-labels-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.45rem;
        margin-top: 1rem;
    }

    .edge-labels-grid .box-grey {
        grid-column: span 2;
    }

    .edge-label-box {
        padding: 0.5rem 0.6rem;
        gap: 0.5rem;
        border-radius: 7px;
    }

    .label-range {
        font-size: 0.74rem;
    }

    .label-title {
        font-size: 0.65rem;
    }

    /* Performance Section */
    .trades-ledger-section {
        margin-bottom: 2.5rem;
    }

    .ledger-title {
        font-size: 1.25rem;
    }

    .performance-chart-card {
        padding: 0.95rem 0.8rem;
        border-radius: 10px;
        margin-bottom: 1.1rem;
    }

    .chart-header-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.65rem 0.45rem;
        padding-bottom: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .chip-label {
        font-size: 0.54rem;
    }

    .chip-val {
        font-size: 0.88rem;
    }

    .chart-canvas-wrap svg {
        height: 190px !important;
    }

    .chart-hover-pill {
        font-size: 0.66rem;
        padding: 0.22rem 0.5rem;
        top: 4px;
    }

    /* KPI Totals: 2 Clean Columns + 9th KPI Centered */
    .performance-totals-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.45rem;
        margin-bottom: 1rem;
    }

    .performance-totals-row .total-kpi-card:last-child {
        grid-column: span 2;
        align-items: center;
        text-align: center;
    }

    .total-kpi-card {
        padding: 0.55rem 0.65rem;
        border-radius: 7px;
    }

    .total-kpi-label {
        font-size: 0.54rem;
    }

    .total-kpi-val {
        font-size: 0.88rem;
    }

    /* Table Sub-Strip */
    .table-sub-strip {
        margin-bottom: 0.5rem;
        padding: 0 0.15rem;
    }

    .table-sub-heading {
        font-size: 0.62rem;
    }

    .trades-counter {
        font-size: 0.75rem;
    }

    /* Trades Table Fixed Container */
    .trades-fixed-container {
        height: 380px;
        max-height: 55vh;
        border-radius: 10px;
        -webkit-overflow-scrolling: touch;
    }

    .trades-data-table th {
        padding: 0.65rem 0.65rem;
        font-size: 0.64rem;
    }

    .trades-data-table td {
        padding: 0.55rem 0.65rem;
        font-size: 0.74rem;
    }

    .badge-session, .badge-side, .badge-res {
        font-size: 0.6rem;
        padding: 0.12rem 0.4rem;
    }

    .table-container-footer {
        padding: 0.85rem;
    }

    .btn-load-more {
        width: 100%;
        max-width: 280px;
        min-height: 42px;
        font-size: 0.74rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .header-nav {
        padding: 0 0.65rem;
        height: 54px;
    }

    .brand-logo-img {
        height: 28px;
    }

    /* On very small devices, keep TV icon visible & uncluttered */
    .tv-announcement-badge {
        display: none !important;
    }

    .nav-tv-btn {
        padding: 0.35rem 0.55rem;
        min-width: 36px;
        justify-content: center;
    }

    .nav-concepts-btn {
        padding: 0.35rem 0.55rem;
        font-size: 0.74rem;
    }

    .nav-ssrn-btn {
        padding: 0.35rem 0.55rem;
        font-size: 0.74rem;
    }

    .main-container {
        padding: 0.65rem 0.6rem 2.5rem;
    }

    .edge-card-inner {
        padding: 0.85rem 0.7rem;
    }

    .chart-header-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-header-row .chart-metric-chip:last-child {
        grid-column: span 2;
        align-items: center;
        text-align: center;
    }

    .trades-fixed-container {
        height: 340px;
    }
}

/* iOS Safe Area Inset Support */
@supports (padding-top: env(safe-area-inset-top)) {
    .header-nav {
        padding-left: max(0.85rem, env(safe-area-inset-left));
        padding-right: max(0.85rem, env(safe-area-inset-right));
    }

    .main-container {
        padding-left: max(0.85rem, env(safe-area-inset-left));
        padding-right: max(0.85rem, env(safe-area-inset-right));
        padding-bottom: max(3rem, env(safe-area-inset-bottom));
    }
}

/* ==========================================================================
   Mobile Performance & Touch Optimization Layer
   ========================================================================== */

/* Dynamic viewport height: avoids the mobile-Safari 100vh toolbar bug */
body {
    min-height: 100dvh;
}

.site-wrap {
    min-height: 100dvh;
}

/* Remove gray flash on tap (iOS/Android) & double-tap zoom delay on controls */
body {
    -webkit-tap-highlight-color: transparent;
}

button, a, select, input, .filter-tag-pill, .btn-section-tab {
    touch-action: manipulation;
}

@media (max-width: 860px) {
    /* backdrop-filter blur is GPU-expensive on low-end phones — halve it */
    .header-nav,
    .edge-card-inner,
    .performance-chart-card,
    .trades-fixed-container,
    .total-kpi-card,
    .edge-stat-pill,
    .edge-label-box {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    /* Scroll-edge shadows: hint that the trades table scrolls horizontally.
       'scroll' layers stay fixed to the container edges; 'local' covers ride
       with the content and occlude the shadow when at that edge. */
    .trades-fixed-container {
        background-color: rgba(10, 16, 22, 0.88);
        background-image:
            linear-gradient(to right, #0c1319, #0c1319),
            linear-gradient(to right, #0c1319, #0c1319),
            linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)),
            linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
        background-position: 0 0, 100% 0, 0 0, 100% 0;
        background-repeat: no-repeat;
        background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
        background-attachment: local, local, scroll, scroll;
    }
}

@media (max-width: 480px) {
    /* iOS Safari auto-zooms inputs focused below 16px font-size */
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* Reduced motion: honor OS accessibility setting */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    #particles {
        display: none;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
