:root {
  --void: #0A0D12;
  --panel: #12161F;
  --panelRaised: #161B26;
  --border: #232A38;
  --borderSoft: #1A2029;
  --text: #E7E9EE;
  --textMuted: #8A93A6;
  --textFaint: #5B6479;
  --amber: #D4A73C;
  --amberSoft: rgba(212,167,60,0.14);
  --green: #34D399;
  --greenSoft: rgba(52,211,153,0.12);
  --red: #FB7185;
  --redSoft: rgba(251,113,133,0.12);
  --blue: #5B9DF9;
}
* { box-sizing: border-box; }
body { background: var(--void); color: var(--text); font-family: 'Inter', sans-serif; margin: 0; min-height: 100vh; }
a { color: inherit; text-decoration: none; }

.topHeader { display:flex; align-items:center; justify-content:space-between; padding: 16px 24px; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 12px; }
.brand { display:flex; align-items:center; gap: 10px; }
.brand.center { justify-content: center; margin-bottom: 24px; }
.brandGlyph { width:34px; height:34px; border-radius:8px; background: linear-gradient(135deg, var(--amber), #8a6a1f); display:flex; align-items:center; justify-content:center; font-family:'Space Grotesk'; font-weight:700; color:var(--void); font-size:13px; box-shadow: 0 0 18px rgba(212,167,60,0.35); }
.brandName { font-family:'Space Grotesk'; font-weight:600; font-size:16px; letter-spacing:-0.2px; }
.brandAccent { color: var(--amber); }
.brandSub { font-size:10px; color: var(--textFaint); letter-spacing: 0.08em; text-transform: uppercase; margin-top: -2px; }
.tabNav { display:flex; gap:4px; flex-wrap: wrap; }
.tabBtn { display:inline-flex; align-items:center; gap:6px; background:transparent; border:1px solid transparent; color: var(--textMuted); padding:7px 12px; border-radius:7px; font-size:12.5px; cursor:pointer; font-family:'Inter'; }
.tabBtn:hover { color: var(--text); background: var(--panel); }
.tabActive { background: var(--amberSoft); color: var(--amber); border-color: rgba(212,167,60,0.3); }
.userMenu { display:flex; align-items:center; gap:12px; }

.topBar { display:flex; align-items:center; gap:10px; padding: 12px 24px; border-bottom:1px solid var(--border); flex-wrap:wrap; background: var(--panel); position: relative; z-index: 20; }
.symbolPicker { position:relative; }
.topBarBtn { display:flex; align-items:center; gap:8px; background: var(--panelRaised); border:1px solid var(--border); color: var(--text); padding:8px 12px; border-radius:8px; cursor:pointer; font-size:13px; }
.tickerMono { font-family:'IBM Plex Mono'; font-weight:600; letter-spacing: 0.02em; }
.topBarSelect { background: var(--panelRaised); border:1px solid var(--border); color: var(--text); padding:8px 10px; border-radius:8px; font-size:12.5px; font-family:'IBM Plex Mono'; }
.runBtn { display:inline-flex; align-items:center; gap:7px; background: linear-gradient(135deg, var(--amber), #b98d2c); color: var(--void); border:none; padding:9px 18px; border-radius:8px; font-weight:600; font-size:13px; cursor:pointer; margin-left:auto; box-shadow: 0 0 20px rgba(212,167,60,0.25); }
.runBtn.full { width: 100%; justify-content: center; margin-left: 0; }
.runBtn:disabled { opacity:0.6; cursor: not-allowed; }

.symbolMenu { position:absolute; top:44px; left:0; width:320px; max-height:420px; overflow-y:auto; background: var(--panelRaised); border:1px solid var(--border); border-radius:10px; padding:10px; box-shadow: 0 12px 30px rgba(0,0,0,0.5); }
.searchBox { display:flex; align-items:center; gap:8px; background: var(--panel); border:1px solid var(--border); border-radius:7px; padding:7px 10px; margin-bottom:8px; }
.searchBox input { background:transparent; border:none; outline:none; color: var(--text); font-size:12.5px; width:100%; }
.symbolList { max-height:340px; overflow-y:auto; }
.symbolRow { padding:7px 8px; border-radius:6px; cursor:pointer; font-size:12.5px; }
.symbolRow:hover { background: var(--panel); }

.progressBar { padding: 8px 24px; }
.progressLabel { font-size:11px; color: var(--textMuted); font-family:'IBM Plex Mono'; margin-bottom:5px; }
.progressTrack { height:5px; background: var(--panel); border-radius:4px; overflow:hidden; }
.progressFill { height:100%; background: linear-gradient(90deg, var(--amber), #f0d17a); transition: width .2s; }
.errorBanner { margin: 12px 24px 0; display:flex; align-items:center; gap:8px; background: var(--redSoft); color: var(--red); border:1px solid rgba(251,113,133,0.3); padding:10px 14px; border-radius:8px; font-size:12.5px; }
.warningBanner { display:flex; flex-direction:column; gap:6px; background: rgba(212,167,60,0.08); color: var(--amber); border:1px solid rgba(212,167,60,0.25); padding:10px 14px; border-radius:8px; font-size:12px; margin: 4px 0 16px; }
.demoBanner { display:flex; align-items:center; gap:8px; background: var(--redSoft); color: var(--red); border:1px dashed rgba(251,113,133,0.4); padding:9px 14px; border-radius:8px; font-size:12px; margin-bottom:16px; }

.mainGrid { padding: 20px 24px; display:flex; flex-direction:column; gap:18px; max-width:1400px; margin:0 auto; }
.settingsRow { display:grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap:14px; }
.card { background: var(--panel); border:1px solid var(--border); border-radius:12px; padding:18px; }
.cardHead { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; flex-wrap: wrap; gap: 8px; }
.cardTitle { font-family:'Space Grotesk'; font-weight:600; font-size:14px; color: var(--text); }
.cardActions { display:flex; gap:6px; flex-wrap:wrap; }

.field { display:flex; flex-direction:column; gap:5px; margin-bottom:12px; }
.fieldLabel { font-size:11px; color: var(--textMuted); }
.fieldHint { font-size:10.5px; color: var(--textFaint); }
.input { background: var(--panelRaised); border:1px solid var(--border); color: var(--text); padding:8px 10px; border-radius:7px; font-size:13px; font-family:'IBM Plex Mono'; width:100%; }
.checkboxRow { display:flex; align-items:center; gap:8px; font-size:12.5px; color: var(--textMuted); margin: 10px 0; }
.strategyDesc { font-size:12px; color: var(--textMuted); line-height:1.5; margin-bottom:10px; }
.ghostBtn { display:inline-flex; align-items:center; gap:6px; background: var(--panelRaised); border:1px solid var(--border); color: var(--text); padding:7px 12px; border-radius:7px; font-size:12px; cursor:pointer; }
.ghostBtn:hover { border-color: var(--amber); color: var(--amber); }
.ghostBtn.danger:hover { border-color: var(--red); color: var(--red); }
.ghostBtn.full { width:100%; justify-content:center; margin-top: 6px; text-align: center; }
.ghostBtn:disabled { opacity:0.5; cursor:not-allowed; }

.metricsGrid { display:grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap:10px; margin-bottom: 14px; }
.metricCard { background: var(--panelRaised); border:1px solid var(--borderSoft); border-radius:9px; padding:12px; }
.metricLabel { font-size:10.5px; color: var(--textFaint); margin-bottom:5px; text-transform:uppercase; letter-spacing:0.04em; }
.metricValue { font-family:'IBM Plex Mono'; font-size:16px; font-weight:600; }
.posVal { color: var(--green); }
.negVal { color: var(--red); }
.bhCompare { display:flex; gap:32px; padding-top:10px; border-top:1px solid var(--borderSoft); }
.bhBig { font-family:'IBM Plex Mono'; font-size:22px; font-weight:600; margin-top:4px; }

canvas { max-width: 100%; background: var(--void); border-radius: 8px; border: 1px solid var(--borderSoft); }
.rangeSlider { width:100%; margin-top:10px; accent-color: var(--amber); }
.rangeControls { display:flex; align-items:center; justify-content:space-between; margin-top:6px; }
.tradePopover { margin-top:12px; background: var(--panelRaised); border:1px solid var(--amber); border-radius:10px; padding:12px; max-width:340px; }
.tradePopoverGrid { display:grid; grid-template-columns: 1fr 1fr; gap:6px 10px; font-size:12px; }

.heatmapGrid { display:grid; grid-template-columns: repeat(auto-fill, minmax(110px,1fr)); gap:8px; }
.heatCell { border-radius:8px; padding:10px; border:1px solid var(--borderSoft); }
.heatMonth { font-size:10px; color: var(--textFaint); font-family:'IBM Plex Mono'; }
.heatVal { font-family:'IBM Plex Mono'; font-size:13px; font-weight:600; margin-top:4px; }
.heatPct { font-size:10.5px; color: var(--textMuted); }

.tableToolbar { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; flex-wrap:wrap; gap:10px; }
.segmented { display:flex; gap:4px; background: var(--panelRaised); border:1px solid var(--border); border-radius:8px; padding:3px; }
.segBtn { background:none; border:none; color: var(--textMuted); padding:6px 12px; border-radius:6px; font-size:11.5px; cursor:pointer; text-transform:capitalize; }
.segActive { background: var(--amberSoft); color: var(--amber); }
.tableScroll { overflow-x:auto; }
.tradeTable { width:100%; border-collapse:collapse; font-size:12px; }
.tradeTable th { text-align:left; padding:9px 10px; color: var(--textFaint); font-weight:500; border-bottom:1px solid var(--border); white-space:nowrap; font-size:11px; text-transform:uppercase; letter-spacing:0.03em; cursor: pointer; }
.tradeTable td { padding:9px 10px; border-bottom:1px solid var(--borderSoft); white-space:nowrap; font-family:'IBM Plex Mono'; }
.tradeTable tbody tr:hover { background: var(--panelRaised); }
.pagination { display:flex; align-items:center; justify-content:center; gap:14px; margin-top:12px; }
.emptyState { color: var(--textFaint); font-size:13px; padding: 24px 0; text-align:center; }

.condBuilder { border:1px solid var(--borderSoft); border-radius:9px; padding:12px; margin-bottom:14px; }
.condBuilderHead { display:flex; align-items:center; justify-content:space-between; font-size:12.5px; color: var(--textMuted); margin-bottom:10px; font-weight:600; }
.condRow { display:flex; align-items:center; gap:6px; margin-bottom:8px; flex-wrap:wrap; }
.miniSelect { background: var(--panelRaised); border:1px solid var(--border); color: var(--text); padding:6px 8px; border-radius:6px; font-size:11.5px; }
.miniNum { background: var(--panelRaised); border:1px solid var(--border); color: var(--text); padding:6px 8px; border-radius:6px; font-size:11.5px; width:64px; font-family:'IBM Plex Mono'; }
.iconBtn { background:none; border:1px solid var(--border); color: var(--textFaint); cursor:pointer; border-radius: 6px; padding: 5px 8px; }
.iconBtn:hover { color: var(--red); border-color: var(--red); }
.indicatorLegend { display:flex; flex-wrap:wrap; gap:8px; }
.pill { background: var(--panelRaised); border:1px solid var(--border); padding:6px 10px; border-radius:20px; font-size:11.5px; color: var(--textMuted); }

.listStack { display:flex; flex-direction:column; gap:8px; }
.listRow { display:flex; align-items:center; justify-content:space-between; background: var(--panelRaised); border:1px solid var(--borderSoft); border-radius:9px; padding:12px 14px; flex-wrap: wrap; gap: 10px; }
.listRowTitle { font-size:13px; font-weight:600; }

.disclaimer { max-width:1400px; margin: 20px auto 0; padding: 14px 24px 28px; color: var(--textFaint); font-size:11px; line-height:1.6; border-top:1px solid var(--borderSoft); }
.hidden { display: none !important; }

.authBody { display:flex; align-items:center; justify-content:center; min-height:100vh; padding: 20px; }
.authCard { background: var(--panel); border:1px solid var(--border); border-radius:14px; padding: 32px; width: 100%; max-width: 380px; }
.authTitle { font-family:'Space Grotesk'; font-size: 18px; margin: 0 0 16px; text-align: center; }
.authForm { display:flex; flex-direction:column; gap: 4px; }
.authSwitch { text-align:center; margin-top: 16px; font-size:12.5px; color: var(--textMuted); }
.authSwitch a { color: var(--amber); }

@media (max-width: 720px) {
  .topHeader, .topBar { padding: 12px 14px; }
  .mainGrid { padding: 16px 14px; }
  .runBtn { margin-left:0; width:100%; justify-content:center; }
}
