/* LOX FUND Dashboard v2 - Resume Grade (Streamlined) */

:root {
    --bg-page: #f8f9fa;
    --bg-container: #ffffff;
    --bg-muted: #f5f5f5;
    --border: #e5e5e5;
    --accent: #0066ff;
    --accent-light: rgba(0, 102, 255, 0.08);
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-muted: #999999;
    --green: #00a86b;
    --green-bg: rgba(0, 168, 107, 0.08);
    --red: #e63946;
    --red-bg: rgba(230, 57, 70, 0.08);
    --yellow: #f5a623;
    --hero-bg: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
}

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

/* Base */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
}

/* ============================================
   HEADER
   ============================================ */
.header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-bottom: 32px;
    position: relative;
}

.header-compact::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-group {
    display: flex;
    align-items: baseline;
    gap: 6px;
    text-decoration: none;
    color: inherit;
}

.logo-text {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--text-primary);
}

.logo-fund {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 600;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.live-dot--stale {
    background: #f59e0b;
    animation: none;
}

.stale-label {
    color: #f59e0b !important;
}

.btn-my-account {
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    background: none;
    border: 1px solid var(--accent);
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.btn-my-account:hover {
    background: var(--accent);
    color: white;
}

.logout-form {
    margin: 0;
    padding: 0;
}

.btn-logout {
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.btn-logout:hover {
    color: var(--red);
    border-color: var(--red);
}

.header-timestamp {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   REGIME ALERT
   ============================================ */
.regime-alert {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
    margin-bottom: 24px;
    background: var(--hero-bg);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.alert-dismiss {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.alert-dismiss:hover {
    background: rgba(255,255,255,0.3);
}

/* ============================================
   HERO ZONE - Fund Return + AUM
   ============================================ */
.hero-zone {
    background: var(--hero-bg);
    border-radius: 12px;
    padding: 28px 28px 24px;
    text-align: center;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.hero-zone::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0.6;
}

.hero-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.hero-value {
    font-size: 48px;
    font-weight: 700;
    color: white;
    letter-spacing: -2px;
    line-height: 1;
    margin-bottom: 8px;
}

.hero-value.positive { color: #4ade80; }
.hero-value.negative { color: #f87171; }

.hero-benchmark {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
    margin-bottom: 8px;
}

.hero-benchmark .bench-item {
    white-space: nowrap;
}

.hero-benchmark .bench-sep {
    margin: 0 8px;
    opacity: 0.4;
}

/* AUM Badge */
.hero-aum {
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    margin-bottom: 6px;
}

.aum-badge {
    display: inline-block;
    background: rgba(255,255,255,0.08);
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 12px;
    color: rgba(255,255,255,0.75);
}

.aum-value {
    font-weight: 700;
    color: rgba(255,255,255,0.9);
}

.hero-context {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
}

/* ============================================
   METRICS ROW
   ============================================ */
.metrics-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-container);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 28px;
    margin-bottom: 16px;
}

.metric-item {
    flex: 1;
    text-align: center;
}

.metric-divider {
    width: 1px;
    height: 40px;
    background: var(--border);
}

.metric-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.info-tip {
    font-size: 10px;
    color: var(--accent);
    cursor: help;
    opacity: 0.6;
}

.info-tip:hover { opacity: 1; }

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-value.positive { color: var(--green); }
.metric-value.negative { color: var(--red); }

/* ============================================
   ACCORDION
   ============================================ */
.accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 48px;
}

.accordion-section {
    background: var(--bg-container);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.accordion-section:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-color: #d0d0d0;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    cursor: pointer;
    list-style: none;
    transition: background 0.15s;
    min-height: 60px;
}

.accordion-header:hover {
    background: var(--bg-muted);
}

.accordion-header::marker,
.accordion-header::-webkit-details-marker {
    display: none;
}

.accordion-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.accordion-title::before {
    content: "▸";
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    width: 12px;
}

.accordion-section[open] .accordion-title::before {
    content: "▾";
}

.accordion-badges {
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pnl {
    font-size: 13px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
}

.badge-pnl.positive { 
    color: var(--green); 
    background: var(--green-bg);
}

.badge-pnl.negative { 
    color: var(--red); 
    background: var(--red-bg);
}

.badge-pnl.muted {
    color: var(--text-muted);
    background: rgba(0,0,0,0.04);
    font-weight: 600;
}

.regime-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.regime-badge.risk-on {
    background: var(--green-bg);
    color: var(--green);
}

.regime-badge.cautious {
    background: rgba(245, 166, 35, 0.15);
    color: var(--yellow);
}

.regime-badge.risk-off {
    background: var(--red-bg);
    color: var(--red);
}

.accordion-content {
    padding: 0 20px 20px;
    border-top: 1px solid var(--border);
}

.accordion-section[open] .accordion-content {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   POSITION CARDS (with Thesis)
   ============================================ */
.positions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
}

/* ── Positions Table ── */
.pos-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.pos-table thead th {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 8px 10px;
    border-bottom: 2px solid var(--border);
    text-align: right;
    white-space: nowrap;
}

.pos-table thead th.pos-th-ticker {
    text-align: left;
}

.pos-table tbody .pos-row {
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}

.pos-row--expandable {
    cursor: pointer;
}

.pos-row--expandable:hover {
    background: var(--bg-muted);
}

.pos-row--open {
    background: var(--bg-muted);
}

.pos-table tbody td {
    padding: 10px 10px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pos-td-ticker {
    text-align: left !important;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.pos-ticker {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
}

.pos-type {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.pos-td-expiry {
    font-size: 11px;
    color: var(--text-muted);
}

.pos-td-qty {
    font-weight: 600;
}

.pos-td-cost,
.pos-td-mv {
    color: var(--text-secondary);
}

.pos-td-pnl {
    font-weight: 700;
}

.pos-td-pnl.positive,
.pos-td-pct.positive { color: var(--green); }
.pos-td-pnl.negative,
.pos-td-pct.negative { color: var(--red); }

.pos-td-pct {
    font-weight: 600;
    font-size: 12px;
}

/* ── Expandable detail row ── */
.pos-detail-row td {
    padding: 0 !important;
    border-bottom: 1px solid var(--border);
}

.pos-detail-content {
    padding: 12px 16px 14px;
    background: var(--bg-muted);
    border-top: 1px dashed var(--border);
}

.pos-detail-thesis {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 10px;
}

.pos-detail-indicators {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.pos-detail-indicators th {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 4px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.pos-detail-indicators td {
    padding: 4px 8px;
    text-align: left;
    color: var(--text-secondary);
    white-space: nowrap;
}

.ind-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.ind-dot--bullish, .ind-dot--on_track { background: var(--green); }
.ind-dot--bearish, .ind-dot--invalidated { background: var(--red); }
.ind-dot--neutral, .ind-dot--watching { background: #f59e0b; }


/* ============================================
   REGIME METRICS STRIP
   ============================================ */
.regime-metrics {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    background: var(--bg-muted);
    border-radius: 10px;
    padding: 16px 12px;
    margin-top: 16px;
    margin-bottom: 12px;
}

.regime-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.regime-metric-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.regime-metric-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.regime-metric-value.green { color: var(--green); }
.regime-metric-value.yellow { color: var(--yellow); }
.regime-metric-value.red { color: var(--red); }

.regime-metric-context {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================
   REGIME SUMMARY GRID (main dashboard)
   ============================================ */
.regime-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.rg-grid-card {
    display: block;
    text-decoration: none;
    background: var(--bg-muted);
    border-radius: 8px;
    padding: 12px 14px;
    transition: background 0.15s, transform 0.12s;
    cursor: pointer;
}
.rg-grid-card:hover {
    background: rgba(100,116,139,0.12);
    transform: translateY(-1px);
}
.rg-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.rg-grid-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.rg-grid-score {
    font-family: var(--mono-font);
    font-size: 14px;
    font-weight: 800;
    color: var(--text-muted);
}
.rg-grid-score--low { color: #22c55e; }
.rg-grid-score--elevated { color: #f59e0b; }
.rg-grid-score--high { color: #e05555; }
.rg-grid-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 900px) {
    .regime-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
    .regime-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ============================================
   SAMPLE DISCLOSURE BANNER
   ============================================ */
.sample-disclosure {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-top: 16px;
    margin-bottom: 12px;
    background: rgba(245, 166, 35, 0.1);
    border: 1px solid rgba(245, 166, 35, 0.3);
    border-radius: 8px;
    font-size: 12px;
}

.disclosure-icon {
    font-size: 14px;
}

.disclosure-text {
    color: var(--yellow);
    font-weight: 500;
}

.disclosure-range {
    color: var(--text-muted);
    margin-left: auto;
}

/* ============================================
   PERFORMANCE METRICS PANEL (Institutional Grade)
   ============================================ */
.performance-metrics {
    margin-top: 16px;
    margin-bottom: 8px;
}

.perf-header {
    display: flex;
    gap: 20px;
    align-items: stretch;
    margin-bottom: 16px;
}

.perf-grade-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--hero-bg);
    border-radius: 12px;
    padding: 20px 28px;
    min-width: 110px;
}

.perf-grade-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.perf-grade {
    font-size: 42px;
    font-weight: 800;
    color: white;
    line-height: 1;
}

.perf-grade-box.grade-a { background: linear-gradient(145deg, #059669 0%, #10b981 100%); }
.perf-grade-box.grade-b { background: linear-gradient(145deg, #0284c7 0%, #0ea5e9 100%); }
.perf-grade-box.grade-c { background: linear-gradient(145deg, #d97706 0%, #f59e0b 100%); }
.perf-grade-box.grade-d { background: linear-gradient(145deg, #dc2626 0%, #ef4444 100%); }
.perf-grade-box.grade-f { background: linear-gradient(145deg, #7f1d1d 0%, #991b1b 100%); }

.perf-core-stats {
    display: flex;
    flex: 1;
    gap: 8px;
    background: var(--bg-muted);
    border-radius: 12px;
    padding: 16px;
}

.perf-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 8px;
    border-right: 1px solid var(--border);
}

.perf-stat:last-child {
    border-right: none;
}

.perf-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 4px;
}

.perf-stat-value.positive { color: var(--green); }
.perf-stat-value.negative { color: var(--red); }
.perf-stat-value.excellent { color: #059669; }

.perf-stat-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.perf-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.perf-card {
    background: var(--bg-muted);
    border-radius: 10px;
    padding: 14px;
}

.perf-card-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.perf-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.perf-row-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.perf-row-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.perf-row-value.positive { color: var(--green); }
.perf-row-value.negative { color: var(--red); }

/* Secondary metrics row */
.perf-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 16px;
    margin-top: 12px;
    background: var(--bg-muted);
    border-radius: 8px;
    font-size: 12px;
}

.perf-secondary-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.perf-secondary-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Metric tooltips */
.perf-stat[data-tooltip] {
    position: relative;
    cursor: help;
}

.perf-stat[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 8px;
}

/* ============================================
   TRADES TABLE
   ============================================ */
.trades-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.trades-table th {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.trades-table th:nth-child(n+2) {
    text-align: right;
}

.trades-table td {
    font-size: 13px;
    padding: 12px;
    border-bottom: 1px solid var(--bg-muted);
    color: var(--text-secondary);
}

.trades-table td:nth-child(n+2) {
    text-align: right;
}

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

.trades-table tbody tr:hover {
    background: var(--bg-muted);
}

.trade-symbol {
    font-weight: 600;
    color: var(--text-primary);
}

.trade-status {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

.trade-status.closed {
    background: var(--bg-muted);
    color: var(--text-muted);
}

.trade-status.partial {
    background: rgba(245, 166, 35, 0.15);
    color: var(--yellow);
}

.pnl-cell {
    font-weight: 600;
}

.pnl-cell.positive { color: var(--green); }
.pnl-cell.negative { color: var(--red); }

.pnl-percent {
    display: block;
    font-size: 11px;
    font-weight: 500;
    opacity: 0.8;
}

.loading {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 24px !important;
}

/* ============================================
   EDGE SUMMARY CARD (Feature 5)
   ============================================ */
.edge-card {
    background: var(--hero-bg);
    border-radius: 12px;
    padding: 20px;
    margin-top: 16px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.edge-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--green), transparent);
}

.edge-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.edge-card-icon {
    color: var(--accent);
    font-size: 14px;
}

.edge-card-title {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.edge-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.edge-stat {
    text-align: center;
}

.edge-stat-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
    margin-bottom: 4px;
}

.edge-stat-value.positive { color: #4ade80; }
.edge-stat-value.negative { color: #f87171; }
.edge-stat-value.risk-on { color: #4ade80; }
.edge-stat-value.cautious { color: #fbbf24; }
.edge-stat-value.risk-off { color: #f87171; }

.edge-stat-label {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ============================================
   SECTION LABELS (shared)
   ============================================ */
.section-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 20px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* ============================================
   REGIME EQUITY CHART (Feature 2)
   ============================================ */
.regime-chart-section {
    margin-top: 4px;
}

.regime-chart-wrap {
    background: var(--bg-muted);
    border-radius: 10px;
    padding: 16px 12px;
    height: 240px;
}

.regime-chart-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 8px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.chart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* ============================================
   PERFORMANCE BY REGIME TABLE (Feature 1)
   ============================================ */
.regime-perf-section {
    margin-top: 4px;
}

.regime-perf-table {
    width: 100%;
    border-collapse: collapse;
}

.regime-perf-table th {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    padding: 10px 10px;
    border-bottom: 1px solid var(--border);
}

.regime-perf-table th:nth-child(n+2) {
    text-align: right;
}

.regime-perf-table td {
    font-size: 13px;
    padding: 12px 10px;
    border-bottom: 1px solid var(--bg-muted);
    color: var(--text-secondary);
}

.regime-perf-table td:nth-child(n+2) {
    text-align: right;
}

.regime-perf-table td:first-child {
    padding-right: 8px;
}

.regime-perf-table td.positive { color: var(--green); font-weight: 600; }
.regime-perf-table td.negative { color: var(--red); font-weight: 600; }

.regime-perf-table tbody tr:last-child td {
    border-bottom: none;
}

.regime-perf-table tbody tr:hover {
    background: var(--bg-muted);
}


/* ============================================
   FOOTER
   ============================================ */
.footer {
    text-align: center;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
}

.footer-brand {
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.footer-dot {
    margin: 0 8px;
    opacity: 0.5;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
    .container {
        padding: 16px;
    }
    
    .hero-zone {
        padding: 22px 18px 18px;
    }
    
    .hero-value {
        font-size: 40px;
    }
    
    .hero-benchmark {
        font-size: 13px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero-benchmark .alpha {
        margin-left: 0;
        margin-top: 6px;
    }
    
    .metrics-row {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }
    
    .metric-divider {
        width: 100%;
        height: 1px;
    }
    
    .metric-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    
    .metric-label {
        margin-bottom: 0;
    }
    
    .accordion-header {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .accordion-badges {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .badge-pnl,
    .regime-badge {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .pos-table {
        font-size: 12px;
    }

    .pos-ticker {
        font-size: 13px;
    }
    
    .regime-metrics {
        grid-template-columns: repeat(3, 1fr);
        padding: 12px 8px;
        gap: 12px;
    }
    
    .regime-metric-value {
        font-size: 14px;
    }
    
    .regime-metric-label {
        font-size: 9px;
    }
    
    .regime-metric-context {
        font-size: 8px;
    }
    
    .accordion-content {
        overflow-x: auto;
        padding: 0 16px 16px;
    }
    
    .trades-table {
        min-width: 400px;
    }
    
    /* Performance metrics mobile */
    .perf-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .perf-grade-box {
        flex-direction: row;
        justify-content: flex-start;
        gap: 16px;
        padding: 16px 20px;
    }
    
    .perf-grade-label {
        margin-bottom: 0;
    }
    
    .perf-grade {
        font-size: 32px;
    }
    
    .perf-core-stats {
        flex-wrap: wrap;
        gap: 0;
        padding: 12px 8px;
    }
    
    .perf-stat {
        width: 50%;
        flex: none;
        padding: 8px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .perf-stat:nth-child(odd) {
        border-right: 1px solid var(--border);
    }
    
    .perf-stat:nth-child(n+3) {
        border-bottom: none;
    }
    
    .perf-stat-value {
        font-size: 18px;
    }
    
    .perf-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .perf-card {
        padding: 12px;
    }
    
    /* Regime resume builder mobile */
    .edge-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .edge-stat-value {
        font-size: 18px;
    }
    
    .regime-perf-table {
        min-width: 500px;
    }
    
    .regime-perf-section {
        overflow-x: auto;
    }
}


/* Extra small screens */
@media (max-width: 380px) {
    .hero-value {
        font-size: 34px;
    }
    
    .metric-value {
        font-size: 20px;
    }
    
    .logo-text {
        font-size: 24px;
    }
    
    .header-timestamp {
        display: none;
    }
    
    .pos-table thead th.pos-th-cost,
    .pos-table tbody td.pos-td-cost {
        display: none;
    }
}

/* ============================================
   HAMBURGER MENU + SLIDE-OUT NAV
   ============================================ */

.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    padding: 4px;
    border: none;
    background: none;
    cursor: pointer;
    z-index: 1001;
    flex-shrink: 0;
}

.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

/* Hamburger → X animation when nav-open */
body.nav-open .hamburger-btn span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
body.nav-open .hamburger-btn span:nth-child(2) {
    opacity: 0;
}
body.nav-open .hamburger-btn span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Nav Scrim (overlay) */
.nav-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

body.nav-open .nav-scrim {
    opacity: 1;
    pointer-events: auto;
}

/* Nav Panel */
.nav-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: #0d1117;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

body.nav-open .nav-panel {
    transform: translateX(0);
}

.nav-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #1f2937;
}

.nav-brand {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #e5e7eb;
    text-transform: uppercase;
}

.nav-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.15s;
}

.nav-close:hover {
    color: #e5e7eb;
}

.nav-links {
    padding: 16px 0;
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: #d1d5db;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f3f4f6;
}

.nav-item.active {
    color: #60a5fa;
    border-left-color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .nav-panel {
        width: 100%;
    }
}

/* ============================================
   LIVED INFLATION INDEX PAGE
   ============================================ */

.lii-page {
    max-width: 960px;
}

.lii-page-title {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 24px;
}

.lii-page-title h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.lii-data-through {
    font-size: 13px;
    color: var(--text-muted);
}

/* Explainer */
.lii-explainer {
    background: var(--bg-container);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    margin-bottom: 24px;
    overflow: hidden;
}

.lii-explainer-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    list-style: none;
    user-select: none;
}

.lii-explainer-toggle::-webkit-details-marker {
    display: none;
}

.lii-explainer-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--text-muted);
    transition: transform 0.2s ease;
}

.lii-explainer[open] .lii-explainer-arrow {
    transform: rotate(180deg);
}

.lii-explainer-body {
    padding: 0 20px 20px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.lii-explainer-body p {
    margin-bottom: 12px;
}

.lii-explainer-body p:last-child {
    margin-bottom: 0;
}

.lii-explainer-callout {
    background: var(--bg-muted);
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
}

/* Hero Metrics Row */
.lii-hero-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.lii-hero-card {
    background: var(--hero-bg);
    border-radius: 10px;
    padding: 18px 20px;
    color: white;
    text-align: center;
}

.lii-hero-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 6px;
}

.lii-hero-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.lii-hero-delta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 4px;
    min-height: 16px;
}

/* Spread card color states */
.lii-hero-spread.lii-spread-green .lii-hero-value { color: #4ade80; }
.lii-hero-spread.lii-spread-amber .lii-hero-value { color: #60a5fa; }
.lii-hero-spread.lii-spread-red .lii-hero-value   { color: #f87171; }

/* ── Hero Section (two-row layout) ───────────────────────────────── */
.lii-hero-section {
    margin-bottom: 24px;
}

.lii-hero-row-primary {
    margin-bottom: 0;
}

.lii-hero-row-primary .lii-hero-card {
    position: relative;
    overflow: hidden;
}

.lii-hero-value-lg {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -1px;
}

.lii-hero-subtext {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 6px;
    min-height: 18px;
    line-height: 1.4;
}

/* Purchasing power card — accent style */
.lii-hero-purchasing-power {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.lii-hero-purchasing-power .lii-hero-value {
    color: #f87171;
}

/* Essentials card */
.lii-hero-essentials {
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Wage gap card */
.lii-hero-wage-gap {
    border: 1px solid rgba(251, 191, 36, 0.2);
}

/* Value color states for story metrics */
.lii-value-negative {
    color: #f87171 !important;
}
.lii-value-positive {
    color: #4ade80 !important;
}

/* "What $100 buys now" callout */
.lii-dollar-callout {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 8px;
    padding: 14px 20px;
    margin-top: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

.lii-dollar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    background: rgba(59, 130, 246, 0.12);
    border-radius: 50%;
    font-size: 18px;
    font-weight: 700;
    color: #3b82f6;
}

.lii-dollar-text strong {
    color: var(--text-primary);
}

/* Hero detail row (collapsible) */
.lii-hero-details {
    margin-top: 0;
}

.lii-hero-details-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.lii-hero-details-toggle::-webkit-details-marker {
    display: none;
}

.lii-hero-details-toggle .lii-explainer-arrow {
    margin-left: 4px;
}

.lii-hero-row-detail {
    margin-bottom: 0;
}

.lii-hero-row-detail .lii-hero-card {
    padding: 16px;
}

.lii-hero-row-detail .lii-hero-value {
    font-size: 26px;
}

/* Discretionary card in detail row */
.lii-hero-disc {
    border: 1px solid rgba(148, 163, 184, 0.15);
}

/* Scenario Profiles */
.lii-profiles {
    margin-bottom: 24px;
}

.lii-profiles-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}

.lii-profile-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lii-profile-btn {
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-container);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.lii-profile-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.lii-profile-btn.active {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    font-weight: 600;
}

.lii-profile-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding: 8px 14px;
    background: var(--accent-light);
    border: 1px solid rgba(0, 102, 255, 0.2);
    border-radius: 6px;
    font-size: 13px;
    color: var(--accent);
}

.lii-profile-reset {
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border: 1px solid rgba(0, 102, 255, 0.4);
    border-radius: 4px;
    background: none;
    color: var(--accent);
    cursor: pointer;
    margin-left: auto;
    white-space: nowrap;
}

.lii-profile-reset:hover {
    background: rgba(0, 102, 255, 0.1);
}

/* Chart Sections */
.lii-chart-section {
    background: var(--bg-container);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
}

.lii-chart-section h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.lii-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.lii-chart-header h2 {
    margin-bottom: 0;
}

.lii-chart-toggle {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.lii-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.lii-toggle input[type="checkbox"] {
    accent-color: var(--accent);
}

.lii-chart-wrap {
    position: relative;
    height: 320px;
}

.lii-chart-wrap.lii-chart-tall {
    height: 500px;
}

/* Category Table */
.lii-table-section {
    background: var(--bg-container);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
}

.lii-table-section h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.lii-table-wrap {
    overflow-x: auto;
}

.lii-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.lii-table th {
    text-align: left;
    padding: 10px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.lii-table th:hover {
    color: var(--text-primary);
}

.lii-table th.num {
    text-align: right;
}

.lii-table th.sort-asc::after { content: ' \u25B2'; font-size: 9px; }
.lii-table th.sort-desc::after { content: ' \u25BC'; font-size: 9px; }

.lii-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--bg-muted);
    color: var(--text-primary);
}

.lii-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.lii-table td.lii-freq {
    color: var(--text-muted);
    font-size: 12px;
}

.lii-table td.lii-delta-up { color: var(--red); }
.lii-table td.lii-delta-down { color: var(--green); }

.lii-table td.lii-val-pos { color: var(--red); }
.lii-table td.lii-val-neg { color: var(--green); }

.lii-table .lii-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 24px;
}

/* Weight callout */
.lii-weight-callout {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--bg-muted);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.lii-weight-callout:empty {
    display: none;
}

/* ── Shelter Model Selector ───────────────────────────────── */
.lii-shelter-selector {
    margin-bottom: 16px;
    padding: 14px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.lii-shelter-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.lii-shelter-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    white-space: nowrap;
}

.lii-shelter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.lii-shelter-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.lii-shelter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.lii-shelter-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.lii-shelter-desc {
    margin-top: 8px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}

.lii-shelter-callout {
    margin-top: 10px;
    padding: 12px 16px;
    background: #eff6ff;
    border-left: 4px solid var(--accent);
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    color: #1e293b;
}

.lii-shelter-callout strong {
    color: var(--accent);
}

/* ── Debt Overlay ─────────────────────────────────────────── */
.lii-debt-overlay {
    margin-bottom: 20px;
    padding: 16px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.lii-debt-master {
    display: flex;
    align-items: center;
}

.lii-debt-toggle-label {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
}

.lii-debt-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lii-debt-text strong {
    font-size: 14px;
    color: #1e293b;
}

.lii-debt-subtitle {
    font-size: 12px;
    color: #64748b;
}

/* Toggle switch */
.lii-debt-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.lii-debt-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.lii-debt-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 24px;
    transition: background 0.2s;
    cursor: pointer;
}

.lii-debt-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.lii-debt-switch input:checked + .lii-debt-slider {
    background: #f97316;
}

.lii-debt-switch input:checked + .lii-debt-slider::after {
    transform: translateX(20px);
}

/* Sub-toggles */
.lii-debt-subs {
    display: flex;
    gap: 20px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.lii-debt-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
}

.lii-debt-sub input[type="checkbox"] {
    accent-color: #f97316;
    width: 15px;
    height: 15px;
}

/* Callout card */
.lii-debt-callout {
    margin-top: 14px;
    padding: 14px 18px;
    background: #fff7ed;
    border-left: 4px solid #f97316;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    color: #1e293b;
}

.lii-debt-callout strong {
    color: #c2410c;
}

/* Footnote */
.lii-debt-footnote {
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
    text-align: center;
    padding: 0 16px 8px;
    margin-top: -8px;
}

/* Hero debt card */
.lii-hero-debt {
    border-top: 3px solid #f97316;
}

.lii-hero-debt .lii-hero-value {
    color: #f97316;
}

.lii-hero-debt .lii-hero-delta {
    color: #c2410c;
    font-size: 12px;
}

/* NON-CPI badge */
.lii-noncpi-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 3px;
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    margin-left: 6px;
    vertical-align: middle;
}

/* Debt row highlight in table */
.lii-debt-row {
    background: #fffbf5;
}

.lii-debt-row td {
    border-bottom-color: #fed7aa;
}

/* Responsive */
@media (max-width: 700px) {
    .lii-hero-row {
        grid-template-columns: 1fr;
    }
    
    .lii-hero-value {
        font-size: 28px;
    }
    
    .lii-hero-value-lg {
        font-size: 30px;
    }

    .lii-hero-row-detail .lii-hero-value {
        font-size: 22px;
    }
    
    .lii-dollar-callout {
        flex-direction: column;
        text-align: center;
        padding: 12px;
        font-size: 13px;
    }

    .lii-chart-wrap {
        height: 260px;
    }

    .lii-chart-wrap.lii-chart-tall {
        height: 380px;
    }

    .lii-profile-buttons {
        gap: 6px;
    }
    
    .lii-profile-btn {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .lii-page-title {
        flex-direction: column;
        gap: 4px;
    }
}


/* ============================================================
   NAV: Collapsible Regimes Sub-Nav
   ============================================================ */

.nav-group {
    display: flex;
    flex-direction: column;
}

.nav-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.nav-chevron {
    width: 16px;
    height: 16px;
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.nav-toggle.expanded .nav-chevron {
    transform: rotate(180deg);
}

.nav-sub-items {
    display: none;
    flex-direction: column;
    padding-left: 32px;
    overflow: hidden;
}

.nav-sub-items.expanded {
    display: flex;
}

.nav-sub-item {
    display: block;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-secondary, #666);
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-sub-item:hover {
    background: var(--accent-light, rgba(0, 102, 255, 0.08));
    color: var(--accent, #0066ff);
}

.nav-sub-item.active {
    color: var(--accent, #0066ff);
    font-weight: 600;
    background: var(--accent-light, rgba(0, 102, 255, 0.08));
}


/* ============================================================
   REGIME PAGE v1 — Visual Upgrade
   ============================================================ */

.regime-page {
    max-width: 1100px;
    --score-green: #22c55e;
    --score-yellow: #eab308;
    --score-orange: #f59e0b;
    --score-red: #ef4444;
    --mono-font: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* Loading / Error ─────────────────────────────────────── */
.regime-loading {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.regime-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--bg-muted);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: rg-spin 0.8s linear infinite;
}

@keyframes rg-spin { to { transform: rotate(360deg); } }

.regime-error {
    text-align: center;
    padding: 60px 20px;
    color: var(--red);
}

/* ── 1. DARK HERO ZONE ──────────────────────────────────── */
.rg-hero {
    background: linear-gradient(160deg, #0c1220 0%, #131d30 40%, #1a2740 100%);
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    --hero-accent: #3b82f6;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow:
        0 1px 3px rgba(0,0,0,0.3),
        0 8px 24px rgba(0,0,0,0.25),
        inset 0 1px 0 rgba(255,255,255,0.04);
}

.rg-hero-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.rg-hero-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px 28px 20px;
    position: relative;
    z-index: 1;
}

/* ── Hero top: score block + meta ────────────────────── */
.rg-hero-top {
    display: flex;
    align-items: center;
    gap: 24px;
}

.rg-hero-score-block {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(6px);
    --score-accent: #94a3b8;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.03),
        0 2px 8px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.06);
    transition: border-color 0.3s ease;
}

.rg-hero-score-num {
    font-family: var(--mono-font);
    font-size: 28px;
    font-weight: 800;
    color: #f1f5f9;
    line-height: 1;
    letter-spacing: -1px;
}

.rg-hero-score-label {
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    margin-top: 2px;
}

/* ── Meta section (right of score) ───────────────────── */
.rg-hero-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rg-hero-meta-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.rg-hero-meta-bottom {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rg-hero-title {
    font-family: var(--mono-font);
    font-size: 20px;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
    line-height: 1;
    letter-spacing: -0.3px;
}

.rg-hero-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.6px;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.55) !important;
    background: rgba(255,255,255,0.04) !important;
    white-space: nowrap;
    transition: all 0.3s ease;
}

#rg-score-delta {
    font-family: var(--mono-font);
    font-size: 12px;
    font-weight: 700;
}

/* ── Regime Spectrum Bar ─────────────────────────────── */
.rg-spectrum-wrap {
    position: relative;
    margin: 0;
    padding-bottom: 4px;
}

.rg-spectrum {
    display: flex;
    height: 30px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.15);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.25);
}

.rg-spectrum-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.25s ease;
}

.rg-spectrum-zone:not(:last-child) {
    border-right: 1px solid rgba(255,255,255,0.04);
}

.rg-spectrum-zone-label {
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
    transition: color 0.25s ease;
}

.rg-spectrum-zone--active {
    background-blend-mode: screen;
}

.rg-spectrum-zone--active .rg-spectrum-zone-label {
    color: rgba(255,255,255,0.9);
    font-weight: 700;
}

/* Marker: floating score + clean line */
.rg-spectrum-marker {
    position: absolute;
    top: -22px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 3;
    pointer-events: none;
}

.rg-spectrum-marker-head {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.3px;
    margin-bottom: 2px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.rg-spectrum-marker-needle {
    width: 2px;
    height: 34px;
    background: #ffffff;
    border-radius: 1px;
    box-shadow: 0 0 8px rgba(255,255,255,0.5);
}

.rg-spectrum-tick {
    position: absolute;
    top: 0;
    width: 1px;
    height: 30px;
    background: rgba(255,255,255,0.08);
    z-index: 1;
    pointer-events: none;
}

/* ── Hero meta bottom ────────────────────────────────── */
.rg-hero-asof {
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    font-family: var(--mono-font);
}

.rg-hero-refresh {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.4);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rg-hero-refresh:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.85);
    border-color: rgba(255,255,255,0.15);
}

.rg-hero-refresh--loading {
    opacity: 0.5;
    cursor: wait;
}

.rg-hero-refresh--loading svg {
    animation: rg-spin 0.8s linear infinite;
}

/* ── Hero blurb ────────────────────────────────────────── */
.rg-hero-blurb {
    font-size: 13px;
    line-height: 1.55;
    color: rgba(255,255,255,0.45);
    margin: 0;
    max-width: 380px;
}

/* ── 2. METRICS TABLE ──────────────────────────────────── */
.rg-section {
    margin-bottom: 24px;
}

.rg-section-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.rg-section-subtitle {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 0 0 8px;
}

.rg-metrics-table-wrap {
    background: var(--bg-container);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.rg-metrics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.rg-metrics-table thead th {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 12px 16px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    background: rgba(0,0,0,0.02);
}

.rg-th-name  { width: 22%; }
.rg-th-value { width: 12%; text-align: right; }
.rg-th-range { width: 48%; }
.rg-th-signal { width: 10%; text-align: center; }
.rg-metrics-table .rg-th-weight { width: 0; text-align: center; overflow: hidden; padding: 0 !important; font-size: 0 !important; border: none; }
.rg-show-weights .rg-th-name  { width: 20%; }
.rg-show-weights .rg-th-range { width: 40%; }
.rg-show-weights .rg-th-signal { width: 8%; }
.rg-show-weights .rg-th-weight { width: 10%; padding: 12px 16px !important; font-size: 10px !important; border-bottom: 1px solid var(--border); }

.rg-metrics-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.1s ease;
}

.rg-metrics-table tbody tr:last-child {
    border-bottom: none;
}

.rg-metrics-table tbody tr:hover {
    background: rgba(0,0,0,0.015);
}

.rg-td-name {
    padding: 14px 16px;
    color: var(--text-primary);
    white-space: nowrap;
}

.rg-metric-name {
    display: block;
    font-weight: 600;
    font-size: 13px;
}

.rg-metric-desc {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 1px;
}

.rg-td-val {
    padding: 14px 16px;
    font-family: var(--mono-font);
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    text-align: right;
    white-space: nowrap;
}

.rg-td-val--na {
    color: var(--text-muted);
    font-weight: 400;
}

.rg-td-range {
    padding: 14px 16px;
}

/* ── Signal column (replaces %ile) ──────────────────────────────── */
.rg-td-signal {
    padding: 10px 8px;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
}
.rg-signal {
    display: inline-block;
    font-family: var(--mono-font);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 3px;
    line-height: 1;
    text-transform: uppercase;
}
.rg-sig--healthy  { color: #22c55e; background: rgba(34,197,94,0.10); }
.rg-sig--normal   { color: #64748b; background: rgba(100,116,139,0.08); }
.rg-sig--watch    { color: #eab308; background: rgba(234,179,8,0.10); }
.rg-sig--elevated { color: #f59e0b; background: rgba(245,158,11,0.12); }
.rg-sig--stress   { color: #e05555; background: rgba(224,85,85,0.12); }
.rg-sig--extreme  { color: #fff; background: rgba(180,30,30,0.85); }

/* Directional arrow (shown below the signal badge when delta exists) */
.rg-sig-arrow {
    display: block;
    font-family: var(--mono-font);
    font-size: 10px;
    font-weight: 700;
    margin-top: 3px;
    line-height: 1;
}
.rg-arrow--worse  { color: #e05555; }
.rg-arrow--better { color: #22c55e; }

.rg-td-weight {
    padding: 0;
    font-family: var(--mono-font);
    font-weight: 600;
    font-size: 0;
    color: var(--text-muted);
    text-align: center;
    overflow: hidden;
    width: 0;
}
.rg-show-weights .rg-td-weight {
    padding: 14px 16px;
    font-size: 12px;
    width: auto;
}

.rg-row--na {
    opacity: 0.5;
}

/* Stressed metric rows — minimal: just a left accent */
.rg-row--stressed {
    border-left: 2px solid #e05555;
}
.rg-row--stressed .rg-td-name {
    color: #e05555;
}

/* Section header with toggle */
.rg-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 0;
}
.rg-section-header .rg-section-title {
    margin-bottom: 12px;
}
.rg-weights-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}
.rg-weights-toggle:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* (Old gauge-meta/proximity styles removed — replaced by spectrum bar) */

/* Scale bar — gradient track (healthy → stressed) */
.rg-scale {
    margin: 0;
    position: relative;
}

/* Non-inverted (higher value = worse): green(left) → red(right) */
.rg-scale-bar {
    position: relative;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right,
        rgba(34,197,94,0.35),
        rgba(250,204,21,0.30) 50%,
        rgba(239,68,68,0.40));
    margin-bottom: 5px;
}

/* Inverted (higher value = better): red(left) → green(right) */
.rg-scale--inverted .rg-scale-bar {
    background: linear-gradient(to right,
        rgba(239,68,68,0.40),
        rgba(250,204,21,0.30) 50%,
        rgba(34,197,94,0.35));
}

/* Midpoint tick */
.rg-scale-bar::after {
    content: "";
    position: absolute;
    left: 50%;
    top: -3px;
    width: 1px;
    height: 9px;
    background: rgba(148,163,184,0.25);
    transform: translateX(-50%);
}

.rg-scale-bar--empty {
    background: rgba(148,163,184,0.10);
}

.rg-scale-dot {
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.9);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.06);
    transform: translate(-50%, -50%);
    transition: left 0.4s ease;
    z-index: 2;
}

.rg-scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    font-weight: 500;
    font-family: var(--mono-font);
    letter-spacing: 0;
    color: rgba(148,163,184,0.55);
}

.rg-metrics-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ── 5. PILLAR CHART ───────────────────────────────────── */
.rg-pillar-chart-wrap {
    background: var(--bg-container);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    height: 280px;
    position: relative;
}

.rg-key-drivers {
    background: var(--bg-container);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    margin-top: 12px;
}

.rg-key-drivers ol {
    margin: 0;
    padding-left: 18px;
}

.rg-key-drivers li {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.rg-kd-score {
    font-family: var(--mono-font);
    font-weight: 700;
    font-size: 13px;
}

.rg-kd-contrib {
    font-size: 12px;
    color: var(--text-muted);
}


/* ── Shared button styles ──────────────────────────────── */
.regime-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid var(--border);
    background: var(--bg-container);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.regime-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ============================================================
   REGIME PAGE: Responsive
   ============================================================ */

@media (max-width: 768px) {
    .rg-hero-body {
        padding: 18px 16px 14px;
        gap: 12px;
    }

    .rg-hero-top {
        gap: 16px;
    }

    .rg-hero-score-block {
        width: 60px;
        height: 60px;
        border-radius: 12px;
    }

    .rg-hero-score-num {
        font-size: 22px;
    }

    .rg-hero-title {
        font-size: 16px;
    }

    .rg-hero-meta-top {
        flex-wrap: wrap;
        gap: 6px;
    }

    .rg-spectrum-zone-label {
        font-size: 7px;
        letter-spacing: 0;
    }

    .rg-spectrum {
        height: 26px;
    }

    .rg-spectrum-marker-needle {
        height: 28px;
    }

    .rg-spectrum-marker-head {
        font-size: 9px;
    }
}

@media (max-width: 768px) {
    .rg-metrics-table-wrap {
        overflow-x: auto;
    }

    .rg-metrics-table {
        min-width: 600px;
    }

    .rg-pillar-chart-wrap {
        height: 240px;
    }
}

@media (max-width: 480px) {
    .rg-hero-title {
        font-size: 24px;
    }

    .rg-gauge {
        width: 110px;
        height: 110px;
    }

    .rg-gauge-score {
        font-size: 28px;
    }
}

