:root {
    --bg-darker: #0d1117;
    --bg-dark: #161b22;
    --bg-card: #21262d;
    --bg-hover: #30363d;
    --border: #30363d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --green: #238636;
    --green-light: #2ea043;
    --red: #da3633;
    --blue: #2f81f7;
    --grey: #6e7681;
    --orange: #d29922;
    --font-sans: 'Inter', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
canvas { cursor: crosshair !important; }
body {
    background-color: var(--bg-darker);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 1s ease-in-out;
}
body.regime-green, body.regime-light-green { background-color: #0b1a11; } /* Subtle Green Tint */
body.regime-red, body.regime-orange { background-color: #1a0b0b; } /* Subtle Red Tint */
body.regime-grey { background-color: var(--bg-darker); }

.text-green { color: var(--green-light); }
.text-red { color: var(--red); }
.hidden { display: none !important; }
.mt-4 { margin-top: 1rem; }
.top-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.75rem 1.5rem; background-color: var(--bg-dark);
    border-bottom: 1px solid var(--border); height: 60px;
}
.logo { font-weight: 700; font-size: 1.25rem; display: flex; align-items: center; gap: 0.5rem; }
.logo-icon { color: var(--blue); }
.regime-badge {
    padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.85rem; font-weight: 600;
    display: flex; align-items: center; gap: 6px; background: rgba(110, 118, 129, 0.1); border: 1px solid var(--border);
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.regime-badge.green .dot { background: var(--green-light); box-shadow: 0 0 8px var(--green-light); }
.regime-badge.green { border-color: rgba(46, 160, 67, 0.4); color: var(--green-light); }
.regime-badge.red .dot { background: var(--red); box-shadow: 0 0 8px var(--red); }
.regime-badge.red { border-color: rgba(218, 54, 51, 0.4); color: var(--red); }
.regime-badge.grey .dot { background: var(--grey); }
.market-tickers { display: flex; gap: 1.5rem; }
.ticker { display: flex; align-items: baseline; gap: 0.4rem; font-size: 0.9rem; }
.ticker .label { color: var(--text-secondary); font-size: 0.8rem; }
.ticker .price { font-weight: 600; }
.ticker .change { font-size: 0.8rem; }
.clock-area { display: flex; align-items: center; gap: 0.75rem; font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.status-indicator { width: 10px; height: 10px; border-radius: 50%; }
.status-indicator.online { background-color: var(--green-light); }
.data-pulse {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(46, 160, 67, 0.1);
    padding: 2px 10px;
    border-radius: 12px;
    border: 1px solid rgba(46, 160, 67, 0.3);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
}
.data-pulse.stale {
    background: rgba(218, 54, 51, 0.1);
    border-color: rgba(218, 54, 51, 0.3);
}
.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: var(--green-light);
    border-radius: 50%;
    box-shadow: 0 0 0 rgba(46, 160, 67, 0.4);
    animation: pulse-green 2s infinite;
}
.data-pulse.stale .pulse-dot {
    background-color: var(--red);
    animation: pulse-red 2s infinite;
}
.pulse-text { 
    color: var(--green-light);
    white-space: nowrap;
}
.data-pulse.stale .pulse-text { color: var(--red); }

@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 160, 67, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(46, 160, 67, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 160, 67, 0); }
}
@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(218, 54, 51, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(218, 54, 51, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(218, 54, 51, 0); }
}
.metric-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; padding: 1rem 1.5rem; }
.metric-card { background-color: var(--bg-dark); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; }
.metric-title { font-size: 0.85rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.metric-value { font-size: 1.75rem; font-weight: 700; margin-top: 0.25rem; }
.dashboard-main { display: flex; flex: 1; gap: 1.5rem; padding: 0 1.5rem; min-height: 0; }
.signal-panel { flex: 0 0 60%; display: flex; flex-direction: column; background-color: var(--bg-dark); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.panel-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem; border-bottom: 1px solid var(--border); }
.panel-header h2 { font-size: 1.1rem; font-weight: 600; }
.filters { display: flex; gap: 0.5rem; }
.filter-btn { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); padding: 0.25rem 0.75rem; border-radius: 4px; cursor: pointer; font-size: 0.85rem; transition: all 0.2s; }
.table-container { flex: 1; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 0.75rem 1rem; font-size: 0.8rem; color: var(--text-secondary); text-transform: uppercase; position: sticky; top: 0; background: var(--bg-dark); border-bottom: 1px solid var(--border); }
td { padding: 0.75rem 1rem; font-size: 0.9rem; border-bottom: 1px solid var(--border); }
tr:hover { background-color: var(--bg-hover); cursor: pointer; }
.signal-badge { padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 700; }
.badge-BUY { background-color: rgba(46, 160, 67, 0.15); color: var(--green-light); border: 1px solid rgba(46,160,67,0.4); }
.badge-SELL { background-color: rgba(218, 54, 51, 0.15); color: var(--red); border: 1px solid rgba(218,54,51,0.4); }
.badge-HOLD { background-color: rgba(110, 118, 129, 0.15); color: var(--text-secondary); border: 1px solid var(--border); }
.strength-bar-container { width: 60px; height: 4px; background: var(--bg-darker); border-radius: 2px; overflow: hidden; }
.strength-bar { height: 100%; background: var(--blue); }
.detail-view { border-top: 1px solid var(--border); background: #1a2027; padding: 1.5rem; animation: slideDown 0.3s ease; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.detail-header { display: flex; justify-content: space-between; margin-bottom: 1rem; }
.icon-btn { background: transparent; border: none; color: var(--text-secondary); font-size: 1.5rem; cursor: pointer; }
.icon-btn:hover { color: var(--text-primary); }
.detail-content { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.detail-reason p { color: var(--text-secondary); font-size: 0.95rem; margin-top: 0.5rem; }
.indicator-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.5rem; }
.ind-box { background: var(--bg-darker); padding: 0.5rem; border-radius: 4px; font-size: 0.85rem; display: flex; justify-content: space-between; }
.ind-box span { color: var(--text-secondary); }
.risk-calculator { grid-column: span 2; background: var(--bg-darker); padding: 1rem; border-radius: 6px; }
.calc-grid { display: flex; gap: 2rem; align-items: center; margin-top: 0.5rem; }
.input-group label { display: block; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.25rem; }
.input-group input { background: var(--bg-dark); border: 1px solid var(--border); color: white; padding: 0.5rem; border-radius: 4px; width: 120px;}
.calc-results { display: flex; gap: 1.5rem; font-size: 0.9rem; }
.side-panel { flex: 1; display: flex; flex-direction: column; }
.panel-card { background-color: var(--bg-dark); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; }
.panel-card h3 { font-size: 1rem; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.sector-bar { display: flex; align-items: center; margin-bottom: 0.75rem; font-size: 0.85rem; }
.sector-name { width: 100px; color: var(--text-secondary); }
.sector-track { flex: 1; height: 6px; background: var(--bg-darker); border-radius: 3px; margin: 0 10px; overflow: hidden; }
.sector-fill { height: 100%; }
.sector-val { width: 30px; text-align: right; font-weight: 600; }
.primary-btn { background: var(--green); color: white; border: 1px solid var(--green-light); padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; font-weight: 500; width: 100%; margin-top: 0.5rem; }
.primary-btn:hover { background: var(--green-light); }
select { background: var(--bg-darker); border: 1px solid var(--border); color: white; padding: 0.5rem; border-radius: 4px; width: 100%; margin-bottom: 0.5rem;}
.bt-results { margin-top: 1rem; background: var(--bg-darker); padding: 0.75rem; border-radius: 4px; }
.bt-stat { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 0.25rem; }
.bt-stat span { color: var(--text-secondary); }
.chart-area { height: 250px; background-color: var(--bg-dark); border-top: 1px solid var(--border); margin-top: 1.5rem; padding: 0; display: flex; flex-direction: column; }
.chart-subtitle { font-size: 0.8rem; color: var(--text-secondary); font-weight: normal; margin-left: left; }
.chart-container { flex: 1; position: relative; width: 100%; padding: 0 1rem 1rem 1rem; min-height: 0; }

/* Modal Styles */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8); display: flex;
    align-items: center; justify-content: center; z-index: 1000;
}
.modal-content {
    background: var(--bg-dark); border: 1px solid var(--border);
    border-radius: 12px; width: 95%; max-width: 1100px;
    max-height: 90vh; display: flex; flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.25rem; font-weight: 600; }
.oc-table-container {
    flex: 1; overflow-y: auto; padding: 0;
}
#oc-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
#oc-table th { 
    position: sticky; top: 0; z-index: 10; background: #1c2128; 
    padding: 0.75rem; border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    color: var(--text-secondary);
}
#oc-table td { 
    padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--border); 
    border-right: 1px solid var(--border);
    text-align: right;
}
#oc-table .text-center { text-align: center; }
#oc-tbody tr:hover { background-color: rgba(255,255,255,0.05); cursor: pointer; }
#oc-table th:last-child, #oc-table td:last-child { border-right: none; }

/* Strategy Checklist */
.strategy-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.checklist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.checklist-item:last-child {
    border-bottom: none;
}

.strat-val {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex: 1;
    text-align: center;
}

.badge-neutral { background: #4b5563; color: white; border: 1px solid #6b7280; }
.badge-buy { background: rgba(35, 134, 54, 0.2); color: #3fb950; border: 1px solid rgba(63, 185, 80, 0.4); }
.badge-sell { background: rgba(218, 54, 51, 0.2); color: #f85149; border: 1px solid rgba(248, 81, 73, 0.4); }

.strategy-execution {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.exec-strike { margin-bottom: 0.25rem; }
.text-green { color: var(--green-light) !important; }
.text-red { color: var(--red) !important; }
.mt-3 { margin-top: 0.75rem; }

/* ─── TAB NAVIGATION ─────────────────────────────── */
.tab-nav {
    display: flex;
    gap: 0;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
}
.tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
}

/* ─── PAGE CONTENT ───────────────────────────────── */
.page-content { display: none; flex: 1; flex-direction: column; min-height: 0; overflow: auto; }
.page-content.active { display: flex; }

/* ─── STRATEGIES HUB ─────────────────────────────── */
.strat-hub-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.strat-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--bg-dark);
    border-right: 1px solid var(--border);
    padding: 1.25rem;
    overflow-y: auto;
}
.strat-sidebar-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.strat-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
    transition: all 0.2s;
}
.strat-list-item:hover { background: var(--bg-hover); }
.strat-list-item.active {
    background: rgba(47, 129, 247, 0.1);
    border-color: rgba(47, 129, 247, 0.3);
}
.strat-list-icon { font-size: 1.25rem; }
.strat-list-name { font-size: 0.9rem; font-weight: 600; }
.strat-list-sub { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }

.strat-detail {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
    background: var(--bg-darker);
}

.strat-detail-panel { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.strat-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1.5rem;
}
.strat-detail-header h2 { font-size: 1.4rem; font-weight: 700; }
.strat-desc { color: var(--text-secondary); font-size: 0.9rem; margin-top: 0.4rem; max-width: 600px; }

.strat-final-verdict {
    text-align: center;
    background: var(--bg-dark);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    min-width: 140px;
}
.verdict-label { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.verdict-badge {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.35rem 1rem;
    border-radius: 8px;
    margin: 0.4rem 0;
}
.verdict-votes { font-size: 0.8rem; color: var(--text-secondary); }

/* Context Bar */
.strat-context-bar {
    display: flex;
    gap: 0;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.context-item {
    flex: 1;
    padding: 0.85rem 1rem;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.context-item:last-child { border-right: none; }
.ctx-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); }
.ctx-val { font-size: 1rem; font-weight: 600; color: var(--text-primary); }

/* Indicator Cards Grid */
.strat-indicators-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.indicator-card {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    transition: border-color 0.3s;
}
.indicator-card.voted-ce { border-color: rgba(63, 185, 80, 0.5); }
.indicator-card.voted-pe { border-color: rgba(248, 81, 73, 0.5); }

.ind-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.ind-num {
    width: 28px; height: 28px;
    background: rgba(47, 129, 247, 0.15);
    border: 1px solid rgba(47, 129, 247, 0.3);
    color: var(--blue);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
    flex-shrink: 0;
}
.ind-title { flex: 1; font-weight: 600; font-size: 0.9rem; }
.ind-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
}
.ind-explanation {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
    background: rgba(0,0,0,0.2);
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}
.ind-data-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    padding-top: 0.65rem;
}

/* Execution Section */
.strat-execution-section {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}
.strat-execution-section h3 { margin-bottom: 1rem; font-size: 1rem; }

.exec-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}
.exec-card {
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}
.exec-card-title { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); margin-bottom: 0.5rem; }
.exec-card-val { min-height: 2rem; display: flex; align-items: center; justify-content: center; margin-bottom: 0.35rem; }
.exec-card-note { font-size: 0.72rem; color: var(--text-secondary); }

.exec-rule-box {
    background: rgba(47, 129, 247, 0.05);
    border: 1px solid rgba(47, 129, 247, 0.2);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ─── CHART STUDIO ───────────────────────────────── */
#page-charts.active {
    display: flex;
}

.chart-studio-layout {
    display: flex;
    flex: 1;
    height: 100%;
    background: var(--bg-darker);
    overflow: hidden;
}

.chart-sidebar {
    width: 280px;
    background: var(--bg-dark);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.tf-btn-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.tf-btn {
    background: var(--bg-darker);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.4rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.tf-btn:hover { border-color: var(--grey); }
.tf-btn.active {
    background: var(--blue);
    border-color: var(--blue);
    color: white;
}

.check-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-primary);
    padding: 0.25rem 0;
}

.chart-legend {
    margin-top: auto;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}

.leg-main { font-family: 'JetBrains Mono', monospace; font-size: 1rem; color: var(--blue); margin-bottom: 0.5rem; }
.leg-sub { font-size: 0.8rem; color: var(--text-secondary); }

.chart-main {
    flex: 1;
    position: relative;
    padding: 0;
    overflow: hidden;
}

.tv-chart-container {
    width: 100%;
    height: calc(100vh - 180px);
    min-height: 400px;
}
@media (max-width: 600px) {
    .tv-chart-container { height: calc(100vh - 280px); min-height: 300px; }
    .chart-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 0.75rem; gap: 0.75rem; }
    .chart-studio-layout { flex-direction: column; overflow: auto; }
    .chart-main { min-height: 300px; }
}

/* ─── TOAST NOTIFICATIONS ───────────────────────── */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast-item {
    background: #1c2128;
    color: var(--text-primary);
    padding: 0.85rem 1.25rem;
    border-radius: 8px;
    border-left: 4px solid var(--blue);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    font-size: 0.9rem;
    font-weight: 500;
    animation: toastIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    min-width: 250px;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(50px) scale(0.9); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

.icon-btn-small:hover {
    color: var(--blue) !important;
    transform: scale(1.2);
    transition: transform 0.2s;
}

/* ─── GLOBAL STRATEGY PULSE ──────────────────────── */
.global-pulse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    background: rgba(46, 160, 67, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(46, 160, 67, 0.2);
}

.market-pulse-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 2.5rem;
}

.pulse-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: default;
}

.pulse-card:hover { 
    transform: translateY(-8px); 
    border-color: var(--blue);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.pulse-symbol { font-weight: 800; font-size: 1.2rem; color: var(--text-secondary); margin-bottom: 0.5rem; letter-spacing: 1px; }
.pulse-score { font-size: 3rem; font-weight: 900; margin: 1rem 0; letter-spacing: -3px; line-height: 1; }
.pulse-sentiment { font-weight: 800; text-transform: uppercase; font-size: 0.8rem; padding: 6px 16px; border-radius: 100px; display: inline-block; letter-spacing: 1px; }

.sentiment-strong-bullish { color: #00ff88; background: rgba(0, 255, 136, 0.1); border: 1px solid rgba(0, 255, 136, 0.2); }
.sentiment-bullish { color: var(--green-light); background: rgba(46, 160, 67, 0.1); border: 1px solid rgba(46, 160, 67, 0.2); }
.sentiment-bearish { color: var(--red); background: rgba(248, 81, 73, 0.1); border: 1px solid rgba(248, 81, 73, 0.2); }
.sentiment-strong-bearish { color: #ff3344; background: rgba(255, 51, 68, 0.1); border: 1px solid rgba(255, 51, 68, 0.2); }
.sentiment-neutral { color: var(--text-secondary); background: rgba(139, 148, 158, 0.1); border: 1px solid rgba(139, 148, 158, 0.2); }

/* Analysis Modal Stats */
.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 1.5rem;
}

.analysis-stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: background 0.2s;
}

.analysis-stat-card:hover { background: rgba(255, 255, 255, 0.05); }
.analysis-val { font-size: 2rem; font-weight: 800; margin-top: 8px; color: white; }
.analysis-label { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1.5px; }

.pulse-dot {
    width: 10px;
    height: 10px;
    background: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff88;
    animation: pulseGlow 2s infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 12px;
    margin-top: -3px;
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(0, 255, 136, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

/* ─── ALPHA SIMULATOR STYLES ─────────────────────── */
.simulator-layout { display: flex; flex: 1; min-height: 0; }
.sim-sidebar { width: 300px; background: var(--bg-dark); border-right: 1px solid var(--border); padding: 1.25rem; overflow-y: auto; }
.profile-container { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
.profile-card { background: var(--bg-darker); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
.profile-card:hover { border-color: var(--blue); transform: translateX(5px); }
.profile-card.active { border-color: var(--blue); background: rgba(47, 129, 247, 0.1); }
.prof-name { font-weight: 700; font-size: 1.1rem; color: #fff; margin-bottom: 0.25rem; }
.prof-margin { font-family: 'JetBrains Mono', monospace; color: var(--green-light); font-size: 1.1rem; }
.prof-segment { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; margin-top: 0.5rem; }

.sim-main { flex: 1; padding: 1.5rem 2rem; background: var(--bg-darker); overflow-y: auto; }
.sim-stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

.sim-stat-card { 
    background: linear-gradient(145deg, #161b22, #11151c); 
    border: 1px solid var(--border); 
    border-radius: 16px; 
    padding: 1.75rem; 
    text-align: left;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}
.sim-stat-card::after {
    content: ''; position: absolute; top: 0; right: 0; width: 60px; height: 60px;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
}

.sim-stat-card .label { font-size: 0.7rem; text-transform: uppercase; color: var(--text-secondary); letter-spacing: 1.5px; font-weight: 600; }
.sim-stat-card .value { font-size: 1.8rem; font-weight: 800; display: block; margin-top: 0.75rem; font-family: 'JetBrains Mono', monospace; letter-spacing: -1px; }

.sim-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.sim-table th { background: transparent; padding: 0.75rem 1rem; font-size: 0.75rem; text-align: left; }
.sim-table td { background: var(--bg-dark); padding: 1.25rem 1rem; font-size: 0.95rem; border-top: 1px solid rgba(255,255,255,0.03); }
.sim-table td:first-child { border-radius: 10px 0 0 10px; }
.sim-table td:last-child { border-radius: 0 10px 10px 0; }

.ledger-table td { background: rgba(0,0,0,0.2); border-bottom: 1px solid rgba(255,255,255,0.02); }

.empty-state { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-secondary); text-align: center; }

.primary-btn-small { background: #30363d; color: #f85149; border: 1px solid rgba(248, 81, 73, 0.4); padding: 6px 16px; border-radius: 6px; cursor: pointer; font-size: 0.85rem; font-weight: 600; transition: all 0.2s; }
.primary-btn-small:hover { background: #f85149; color: white; }

.form-grid { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.8rem; color: var(--text-secondary); }
.form-group input, .form-group select { background: var(--bg-dark); border: 1px solid var(--border); color: #fff; padding: 0.75rem; border-radius: 6px; }

.mt-5 { margin-top: 3rem; }

.performance-chart {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.performance-chart .chart-container {
    margin-top: 1rem;
    padding: 10px;
}

#trade-est-turnover, #trade-est-charges {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
}


/* ─── Chart Studio Controls ────────────────────────── */
.chart-controls {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
    align-items: center;
    flex-wrap: wrap;
}

.timeframe-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.timeframe-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.timeframe-btn.active {
    background: var(--blue-glow);
    color: white;
    border-color: var(--blue-glow);
    box-shadow: 0 0 10px rgba(0, 112, 243, 0.4);
}


.search-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
}

.sync-dot.active {
    background: var(--green-light);
    box-shadow: 0 0 8px var(--green-light);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE LAYER — Z Fold 7 unfolded (~960px) + mobile (~390px)
   ═══════════════════════════════════════════════════════════════ */

/* ── TABLET / Z FOLD UNFOLDED (≤1024px) ─────────────────────── */
@media (max-width: 1024px) {
    .top-bar {
        flex-wrap: wrap;
        height: auto;
        padding: 0.5rem 1rem;
        gap: 0.5rem;
    }
    .market-tickers { gap: 1rem; }
    .ticker { font-size: 0.8rem; }
    .regime-badge { font-size: 0.75rem; padding: 0.2rem 0.5rem; }
    .metric-row { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; padding: 0.75rem 1rem; }
    .dashboard-main { flex-direction: column; padding: 0 1rem; gap: 1rem; }
    .signal-panel { flex: none; width: 100%; }
    .side-panel { width: 100%; }
    .strat-hub-layout { flex-direction: column; }
    .strat-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 1rem; }
    .strat-list-item { display: inline-flex; margin-right: 0.5rem; margin-bottom: 0.5rem; }
    .strat-detail { padding: 1rem; }
    .strat-indicators-grid { grid-template-columns: 1fr 1fr; }
    .strat-context-bar { flex-wrap: wrap; }
    .context-item { min-width: 45%; }
    .detail-content { grid-template-columns: 1fr; }
    .risk-calculator { grid-column: span 1; }
}

/* ── MOBILE (≤600px) ─────────────────────────────────────────── */
@media (max-width: 600px) {
    /* Top bar: stack into 2 rows */
    .top-bar {
        padding: 0.5rem 0.75rem;
        gap: 0.4rem;
    }
    .logo { font-size: 1rem; }
    .kite-badge { display: none; }
    .regime-badge { order: 3; width: 100%; justify-content: center; font-size: 0.72rem; }
    .market-tickers { order: 2; gap: 0.75rem; }
    .clock-area { order: 4; gap: 0.4rem; font-size: 0.8rem; }
    .pulse-text { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* Hide desktop tab text, show icons only */
    .tab-nav { padding: 0; position: fixed; bottom: 0; left: 0; right: 0; z-index: 500;
        background: var(--bg-dark); border-top: 1px solid var(--border); border-bottom: none;
        justify-content: space-around; height: 56px; }
    .tab-btn { padding: 0.5rem 0.25rem; font-size: 0.65rem; flex: 1;
        display: flex; flex-direction: column; align-items: center; gap: 2px;
        border-bottom: none; border-top: 2px solid transparent; margin-bottom: 0; }
    .tab-btn.active { border-top-color: var(--blue); border-bottom-color: transparent; }

    /* Add bottom padding so content doesn't hide behind fixed nav */
    body { padding-bottom: 56px; }
    .page-content { padding-bottom: 0.5rem; }

    /* Metric row: 2 cols on mobile */
    .metric-row { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; padding: 0.5rem 0.75rem; }
    .metric-value { font-size: 1.4rem; }
    .metric-title { font-size: 0.75rem; }

    /* Dashboard main: single column */
    .dashboard-main { flex-direction: column; padding: 0 0.75rem; gap: 0.75rem; }
    .signal-panel { flex: none; width: 100%; }
    .side-panel { width: 100%; }

    /* Signals table: hide less critical columns */
    th:nth-child(4), td:nth-child(4),   /* TARGET */
    th:nth-child(5), td:nth-child(5),   /* STOP LOSS */
    th:nth-child(6), td:nth-child(6) {  /* RR */
        display: none;
    }
    td, th { padding: 0.5rem 0.6rem; font-size: 0.8rem; }

    /* Strategy Hub: full width sidebar as horizontal scroll */
    .strat-hub-layout { flex-direction: column; overflow: visible; }
    .strat-sidebar { width: 100%; padding: 0.75rem; overflow-x: auto; white-space: nowrap;
        display: flex; flex-direction: row; align-items: flex-start; gap: 0.5rem;
        border-right: none; border-bottom: 1px solid var(--border); }
    .strat-sidebar-title { display: none; }
    .strat-list-item { display: inline-flex; flex-direction: column; min-width: 100px;
        white-space: normal; margin-bottom: 0; flex-shrink: 0; }
    .strat-detail { padding: 0.75rem; }
    .strat-indicators-grid { grid-template-columns: 1fr; }
    .strat-context-bar { flex-direction: column; border-radius: 8px; }
    .context-item { border-right: none; border-bottom: 1px solid var(--border); }
    .context-item:last-child { border-bottom: none; }
    .strat-detail-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .strat-final-verdict { width: 100%; }

    /* Modals: full screen on mobile */
    .modal-content { width: 100%; max-width: 100%; height: 100%; max-height: 100%;
        border-radius: 0; margin: 0; }

    /* Chart studio */
    .chart-area { height: 200px; }

    /* OI table: horizontal scroll */
    .oc-table-container { overflow-x: auto; }
    #oc-table { min-width: 700px; }

    /* Simulator */
    .calc-grid { flex-direction: column; gap: 1rem; align-items: flex-start; }
    .calc-results { flex-direction: column; gap: 0.5rem; }
    .input-group input { width: 100%; }

    /* Clock area: hide on very small */
    #system-clock { display: none; }
    #server-status-badge { font-size: 0.65rem; padding: 1px 5px; }
}

/* ── VERY SMALL / FOLDED Z FOLD (≤400px) ────────────────────── */
@media (max-width: 400px) {
    .market-tickers { gap: 0.5rem; }
    .ticker .label { display: none; }
    .ticker { font-size: 0.75rem; }
    .metric-row { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; padding: 0.4rem 0.5rem; }
    .metric-value { font-size: 1.2rem; }
    td, th { padding: 0.4rem 0.5rem; font-size: 0.75rem; }
}
