:root {
  --bg: #040404;
  --frame: transparent;
  --panel: rgba(var(--ink), .032);
  --panel-2: rgba(var(--ink), .05);
  --head: rgba(14, 14, 14, .82);
  --row-alt: rgba(var(--ink), .018);
  --line: rgba(var(--ink), .075);
  --line-2: rgba(var(--ink), .13);
  --text: #ededed;
  --text-2: #a8a8a8;
  --text-3: #6f6f6f;
  --green: #4cc76a;
  --green-2: #2e9c4c;
  --green-3: #b9e8c2;
  --green-bg: rgba(76, 199, 106, .14);
  --red: #e5484d;
  --red-bg: rgba(229, 72, 77, .16);
  --blue: #bfbfbf;
  --amber: #e8e27a;
  --hover: rgba(var(--ink), .05);
  --glass-blur: blur(22px) saturate(140%);
  --glass-edge: inset 0 1px 0 rgba(var(--ink), .07), inset 0 0 0 1px rgba(var(--ink), .015);
  --glass-drop: 0 18px 40px -18px rgba(0, 0, 0, .8);
  --r-lg: 10px;
  --r-md: 7px;
  --r-sm: 5px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ink: 255, 255, 255;
  --well: 0, 0, 0;
  --deep: 16, 16, 16;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 13px/1.35 var(--sans);
  font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.muted { color: var(--text-3); }
.warn { color: var(--amber); }

/* ------------------------------------------------------------ shell */
.app {
  display: grid;
  grid-template-columns: 60px minmax(520px, 1fr) 470px;
  grid-template-rows: 64px 1fr;
  grid-template-areas: "top top top" "nav center right";
  padding-bottom: 10px !important;
  gap: 10px;
  height: 100vh;
  padding: 0 10px;
  background: var(--frame);
}
.top { grid-area: top; display: flex; align-items: center; gap: 10px; min-width: 0; }
.nav {
  grid-area: nav; display: flex; flex-direction: column; padding: 8px 0 12px; min-height: 0;
  /* icon rail; slides open over the content when the pointer reaches it */
  position: relative; z-index: 30; width: 60px; overflow: hidden; white-space: nowrap;
  background: var(--frame); border-radius: var(--r-lg);
  transition: width .2s ease, box-shadow .2s ease, background .2s ease;
}
.nav:hover { width: 220px; background: var(--panel); box-shadow: 0 0 0 1px var(--line), 12px 0 40px rgba(0,0,0,.55); }
.nav a span, .nav .card, .nav .user span { opacity: 0; transition: opacity .12s ease; }
.nav:hover a span, .nav:hover .card, .nav:hover .user span { opacity: 1; transition-delay: .08s; }
.nav .card { width: 196px; }
.col-strat { grid-area: strat; min-height: 0; }
.col-center { grid-area: center; display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; }
.col-right { grid-area: right; min-height: 0; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.panel-scroll { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 10px;
  font-weight: 600; font-size: 14.5px;
}
.panel-head .grow { flex: 1; }
.panel-head .icon { width: 15px; height: 15px; color: var(--text-2); }
.panel-pad { padding: 0 16px 14px; }

/* ------------------------------------------------------------ top bar */
.logo { display: flex; align-items: baseline; gap: 5px; padding-left: 12px; margin-right: 14px; flex: none; white-space: nowrap; }
/* wordmark: Order3 Terminal, all in Calibri (Carlito is the metric-compatible fallback) */
.logo-name { font-family: Calibri, Carlito, "Segoe UI", sans-serif; font-size: 21px; font-weight: 700; color: var(--text); letter-spacing: .2px; }
.logo-term { font-family: Calibri, Carlito, "Segoe UI", sans-serif; font-size: 21px; font-weight: 400; color: var(--text-2); letter-spacing: .2px; }
.preset { color: var(--text-3); white-space: nowrap; }
.preset b { color: var(--text); font-weight: 600; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 5px 8px 5px 10px; white-space: nowrap; font-weight: 600; border-radius: var(--r-md);
}
.chip .tag { background: rgba(var(--ink), .09); color: var(--text-2); font-weight: 500; padding: 1px 7px; font-size: 12px; border-radius: var(--r-sm); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); }
.chip .dot.stale { background: var(--red); box-shadow: 0 0 6px var(--red); }
.chip .dot.demo { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.chip .dot.bt { background: #7dd3fc; box-shadow: 0 0 6px #7dd3fc; }
.chips { display: flex; gap: 8px; overflow: hidden; min-width: 0; flex: 1; }
.btn-light {
  background: #f4f4f6; color: #0b0b11; font-weight: 600; padding: 8px 14px;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; border-radius: var(--r-md);
}
.btn-light:hover { background: #fff; }
.btn-outline {
  border: 1px solid var(--line-2); padding: 6px 12px; font-weight: 600; background: var(--panel); border-radius: var(--r-md);
}
.btn-outline:hover { border-color: var(--text-3); }

/* segmented tabs, like "AGO ATK PMS" */
.seg { display: inline-flex; background: var(--panel-2); padding: 3px; gap: 2px; border-radius: var(--r-md); }
.seg button { padding: 5px 12px; color: var(--text-3); font-weight: 500; border-radius: var(--r-sm); white-space: nowrap; }
.pf-seg { flex-wrap: wrap; max-width: 100%; }
.seg button:hover { color: var(--text-2); }
.seg button.on { background: rgba(var(--ink), .08); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line-2); }
.seg.sm button { padding: 3px 9px; font-size: 12px; }

.dropdown { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; position: relative; }
.dropdown select {
  appearance: none; background: transparent; border: 0; color: var(--text); font: inherit; font-weight: 600;
  padding-right: 14px; cursor: pointer;
}
.dropdown select option { background: var(--panel-2); }
.dropdown::after {
  content: ""; position: absolute; right: 0; top: 50%; margin-top: -2px; pointer-events: none;
  border: 4px solid transparent; border-top-color: var(--text); border-bottom: 0;
}

/* ------------------------------------------------------------ nav */
.nav a {
  display: flex; align-items: center; gap: 14px; padding: 11px 19px; margin: 1px 6px; border-radius: var(--r-md); color: var(--text-3);
  text-decoration: none; font-size: 14px; border-left: 3px solid transparent;
}
.nav a svg { width: 16px; height: 16px; flex: none; }
.nav a:hover { color: var(--text-2); background: rgba(var(--ink), .04); }
.nav a.on { color: var(--text); background: rgba(var(--ink), .08); border-left-color: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.nav .spacer { flex: 1; }
.card { background: var(--panel-2); border: 1px solid var(--line); padding: 12px; margin: 0 12px 10px; border-radius: var(--r-md); }
.card h4 { margin: 0 0 8px; font-size: 13.5px; display: flex; justify-content: space-between; }
.card .kv { display: flex; justify-content: space-between; color: var(--text-2); font-size: 12px; padding: 2px 0; }
.card .bar { height: 3px; background: var(--line-2); margin: 8px 0 10px; border-radius: 2px; overflow: hidden; }
.card .bar i { display: block; height: 100%; background: var(--text); }
.user { display: flex; align-items: center; gap: 12px; padding: 6px 13px; font-weight: 600; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: linear-gradient(135deg, #6a6a6a, #1c1c1c); color: #fff; border-radius: 50%; flex: none; }

/* ------------------------------------------------------------ strategy tables */
.pf-title { display: flex; align-items: baseline; justify-content: space-between; margin: 16px 0 8px; font-weight: 600; font-size: 14.5px; }
.pf-title .sw { display: inline-block; width: 8px; height: 8px; margin-right: 8px; }
.pf-title .tot { font-size: 12.5px; font-weight: 600; }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
table.grid th {
  text-align: left; font-size: 10.5px; font-weight: 500; color: var(--text-3); letter-spacing: .4px;
  padding: 7px 9px; background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.grid td { padding: 6px 8px; white-space: nowrap; border-top: 1px solid rgba(var(--ink), .045); }
table.grid tr.row { cursor: pointer; }
table.grid tr.row:hover td { background: var(--hover); }
table.grid tr.row.sel td { background: rgba(var(--ink), .085); }
table.grid td.r, table.grid th.r { text-align: right; }
.caret { display: inline-block; width: 0; height: 0; margin-left: 6px; border: 4px solid transparent; vertical-align: 1px; }
.caret.up { border-bottom: 5px solid var(--green); border-top: 0; }
.caret.dn { border-top: 5px solid var(--red); border-bottom: 0; }
.open-badge { font-size: 10px; color: var(--amber); margin-left: 4px; }

.tooltip {
  position: fixed; z-index: 50; pointer-events: none; background: rgba(var(--deep), .78); border: 1px solid var(--line-2);
  padding: 8px 10px; font-size: 12px; line-height: 1.5; border-radius: var(--r-md); box-shadow: 0 6px 24px rgba(0,0,0,.5); max-width: 280px; display: none;
}
.tooltip .t { font-weight: 600; font-size: 13px; }
.tooltip .s { color: var(--text-2); }

/* ------------------------------------------------------------ blotter */
.blotter { flex: 0 0 auto; }
.blotter-body { max-height: 330px; overflow-y: auto; margin: 0 16px 14px; border: 1px solid var(--line); border-radius: var(--r-md); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.blotter-body table.grid { border: 0; border-radius: 0; overflow: visible; }
.blotter-body thead th { position: sticky; top: 0; z-index: 1; }
tr.day td { background: rgba(var(--ink), .035); color: var(--text-3); font-size: 10.5px; letter-spacing: .5px; padding: 7px 9px; }
tr.trade td:first-child { border-left: 3px solid transparent; }
tr.trade.w td:first-child { border-left-color: var(--green); }
tr.trade.l td:first-child { border-left-color: var(--red); }
tr.trade:hover td { background: var(--hover); }
.side { font-size: 10px; font-weight: 600; padding: 2px 5px; letter-spacing: .3px; border-radius: 3px; }
.side.BUY { background: var(--green-2); color: #04130a; }
.side.SELL { background: #d13a3f; color: #fff; }
.new { background: var(--green); color: #04130a; font-size: 10px; font-weight: 700; padding: 2px 5px; border-radius: 3px; }

/* ------------------------------------------------------------ charts */
.chart-wrap { position: relative; margin: 0 16px; flex: 1; min-height: 240px; border: 1px solid var(--line); background: rgba(var(--well), .26); border-radius: var(--r-md); overflow: hidden; }
.chart-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 16px 12px; font-size: 11px; color: var(--text-3); letter-spacing: .3px; }
.legend button { display: inline-flex; align-items: center; gap: 6px; text-transform: uppercase; }
.legend button i { width: 7px; height: 7px; display: inline-block; }
.legend button.off { opacity: .35; }
.axis text { fill: var(--text-3); font-size: 10.5px; font-family: var(--sans); }
.gridline { stroke: rgba(var(--ink), .06); }
.crosshair { stroke: #5c5c5c; stroke-dasharray: 3 3; }
.end-tag text { font-size: 10.5px; font-weight: 600; fill: #0b0b11; }

.perf { flex: 1 1 auto; min-height: 380px; }
.collapsible .panel-head { cursor: pointer; }
.collapsible .chev { transition: transform .15s; }
.collapsible.open .chev { transform: rotate(90deg); }
.collapsible .body { display: none; }
.collapsible.open .body { display: block; }

/* ------------------------------------------------------------ stats */
.section-title { font-weight: 600; font-size: 14.5px; margin: 18px 0 10px; display: flex; justify-content: space-between; align-items: center; }
.section-title small { font-weight: 500; color: var(--text-3); font-size: 11px; }
.stat-box { border: 1px solid var(--line); background: rgba(var(--well), .26); position: relative; border-radius: var(--r-md); overflow: hidden; }
.stat-box svg { display: block; width: 100%; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.kpi { background: rgba(var(--well), .26); padding: 9px 11px; }
.kpi .k { color: var(--text-3); font-size: 10.5px; letter-spacing: .4px; text-transform: uppercase; }
.kpi .v { font-size: 17px; font-weight: 600; margin-top: 3px; }
.mini-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 10.5px; color: var(--text-3); padding: 8px 12px 10px; }
.mini-legend span { white-space: nowrap; }
.mini-legend i { width: 7px; height: 7px; display: inline-block; margin-right: 5px; }


.banner { background: rgba(232, 226, 122, .12); color: var(--amber); border: 1px solid rgba(232, 226, 122, .35); padding: 4px 10px; border-radius: var(--r-md); font-weight: 600; font-size: 12px; white-space: nowrap; }
.err { margin: 16px; color: var(--red); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1500px) {
  .app { grid-template-columns: 60px minmax(480px, 1fr) 420px; }
}
@media (max-width: 1180px) {
  .app { height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "top" "center" "right"; padding: 0 16px; }
  .nav { display: none; }
  .top { flex-wrap: wrap; padding: 10px 0; }
  .chips { flex-basis: 100%; order: 3; flex-wrap: wrap; }
  .col-strat .panel-scroll, .col-right .panel-scroll { overflow: visible; }
  .perf { min-height: 420px; }
}
@media (max-width: 560px) {
  .blotter-body { overflow-x: auto; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}

/* ------------------------------------------------------------ statistics view */
.stats-view { display: none; grid-column: 2 / 5; grid-row: 2; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; padding-right: 2px; }
body.view-stats .col-strat, body.view-stats .col-center, body.view-stats .col-right,
body.view-strats .col-strat, body.view-strats .col-center, body.view-strats .col-right,
body.view-perf .col-strat, body.view-perf .col-center, body.view-perf .col-right,
body.view-positions .col-strat, body.view-positions .col-center, body.view-positions .col-right,
body.view-data .col-strat, body.view-data .col-center, body.view-data .col-right { display: none; }
body.view-feed .col-center, body.view-feed .col-right { display: none; }
body.view-feed #feedView { display: block; }
body.view-stats #statsView, body.view-strats #stratBook, body.view-perf #perfView2,
body.view-positions #positionsView, body.view-data #dataView { display: block; }
.sv-head { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 18px 20px; margin-bottom: 10px; flex-wrap: wrap; }
.sv-kicker { color: var(--text-3); font-size: 11px; letter-spacing: .8px; text-transform: uppercase; font-weight: 600; }
.sv-title h1 { margin: 4px 0 4px; font-size: 22px; font-weight: 600; letter-spacing: -.3px; }
.sv-sub { color: var(--text-2); font-size: 12.5px; }
.sv-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sv-select { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 6px 12px; }
.sv-select select { max-width: 300px; padding-right: 18px; }
.sv-select::after { right: 12px; }
.sv-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; }
.sv-card { min-width: 0; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.sv-card-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px 10px; font-weight: 600; font-size: 14px; flex-wrap: wrap; }
.sv-card-head small { color: var(--text-3); font-weight: 500; font-size: 11px; margin-left: auto; }
.sv-card-head .grow { flex: 1; }
.sv-card-head .grow ~ small { margin-left: 0; }
.sv-body { margin: 0 16px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(var(--well), .26); overflow: hidden; position: relative; }
.sv-body svg { display: block; width: 100%; }
.sv-kpi { padding: 14px 16px 10px; }
.sv-kpi-title { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.sv-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0; border-top: 1px solid rgba(var(--ink), .05); }
.sv-row span { color: var(--text-2); font-size: 12.5px; }
.sv-row span i { display: block; font-style: normal; color: var(--text-3); font-size: 10.5px; margin-top: 1px; }
.sv-row b { font-size: 14px; font-weight: 600; white-space: nowrap; }
.sv-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 8px 12px 0; font-size: 11.5px; color: var(--text-3); }
.sv-facts b { margin-left: 4px; }
.sv-cal { overflow-x: auto; padding: 10px; }
.sv-cal table { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 11px; }
.sv-cal th { color: var(--text-3); font-weight: 500; padding: 2px 4px; text-align: center; }
.sv-cal tbody th { text-align: right; color: var(--text-2); padding-right: 8px; }
.sv-cal td { text-align: center; padding: 7px 2px; border-radius: 4px; font-variant-numeric: tabular-nums; color: #f1f1f5; min-width: 34px; }
.sv-cal td.none { background: rgba(var(--ink), .02); }
.sv-cal td.tot { background: rgba(var(--ink), .05); font-weight: 600; }
.sv-method { color: var(--text-3); font-size: 11px; line-height: 1.6; margin: 12px 4px 6px; max-width: 1100px; }
@media (max-width: 1500px) { .span-3 { grid-column: span 6; } }
@media (max-width: 1180px) {
  .stats-view { grid-column: 1; grid-row: auto; overflow: visible; }
  .span-3, .span-4, .span-5, .span-7, .span-8 { grid-column: span 12; }
}

/* ------------------------------------------------------------ strategy book */
.sb-search { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r-md); color: var(--text); font: inherit; padding: 7px 12px; width: 240px; outline: none; }
.sb-search:focus { border-color: var(--text-3); }
.sb-search::placeholder { color: var(--text-3); }
.sb-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.sb-tile { padding: 13px 16px; }
.sb-tile .k { color: var(--text-3); font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; font-weight: 600; }
.sb-tile .v { font-size: 21px; font-weight: 600; margin: 5px 0 3px; }
.sb-tile .s { color: var(--text-3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-table { overflow: hidden; }
.sb-row {
  display: grid; align-items: center; gap: 16px; padding: 7px 16px 7px 18px; position: relative;
  grid-template-columns: minmax(280px, 3fr) 130px 104px 96px 88px 78px 120px 140px 12px;
  border-top: 1px solid rgba(var(--ink), .05); cursor: pointer;
}
.sb-row::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--pf); }
.sb-row:hover, .sb-row.expanded { background: rgba(var(--ink), .04); }
.sb-headrow { cursor: default; padding-top: 8px; padding-bottom: 8px; border-top: 0; background: var(--panel-2); color: var(--text-3); font-size: 10px; letter-spacing: .5px; text-transform: uppercase; font-weight: 600; position: sticky; top: 0; z-index: 2; }
.sb-headrow::before { display: none; }
.sb-headrow:hover { background: var(--panel-2); }
.sb-headrow .sortable { cursor: pointer; }
.sb-headrow .sortable:hover, .sb-headrow .on { color: var(--text); }
.sb-group { display: grid; grid-template-columns: 1fr auto auto; gap: 18px; align-items: center; padding: 11px 18px 5px; font-weight: 600; font-size: 12.5px; border-top: 1px solid var(--line); }
.sb-group:first-child { border-top: 0; }
.sb-group i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--pf); margin-right: 9px; }
.sb-group .muted { font-weight: 500; font-size: 12px; }
.sb-id { min-width: 0; }
.sb-l1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sb-code { font-size: 10.5px; font-weight: 700; letter-spacing: .5px; padding: 2px 6px; border-radius: 4px; color: #0b0b11; background: var(--pf); flex: none; }
.sb-name { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-sym { font-size: 10px; color: var(--text-2); background: rgba(var(--ink), .08); padding: 0 6px; border-radius: 4px; flex: none; }
.sb-logic { color: var(--text-2); font-size: 11.5px; margin-top: 2px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.sb-meta { color: var(--text-3); font-size: 10px; margin-top: 1px; }
.sb-spark svg { display: block; }
.sb-num b { display: block; font-size: 12.5px; font-weight: 600; }
.sb-num i, .sb-status i { display: block; font-style: normal; color: var(--text-3); font-size: 10px; margin-top: 1px; }
.sb-num i.pos { color: var(--green); } .sb-num i.neg { color: var(--red); }
.sb-headrow > div:nth-child(n+3):nth-child(-n+6) { text-align: left; }
.sb-vs { height: 3px; background: rgba(var(--ink), .08); border-radius: 2px; margin-top: 4px; overflow: hidden; }
.sb-vs span { display: block; height: 100%; border-radius: 2px; }
.sb-vs .live { background: #f4f4f6; } .sb-vs .bt { background: #5c5c5c; }
.sb-wr { height: 3px; background: rgba(229,72,77,.45); border-radius: 2px; margin-top: 5px; overflow: hidden; }
.sb-wr span { display: block; height: 100%; background: var(--green); }
.sb-l20 { display: flex; align-items: center; gap: 2px; height: 22px; }
.sb-l20 i { flex: 1; max-width: 5px; border-radius: 1.5px; }
.sb-l20 i.w { background: var(--green); align-self: flex-end; margin-bottom: 11px; max-height: 11px; }
.sb-l20 i.l { background: var(--red); align-self: flex-start; margin-top: 11px; max-height: 11px; }
.sb-status { display: flex; align-items: flex-start; gap: 8px; font-size: 11.5px; }
.sb-status b { font-weight: 600; }
.sb-dot { width: 7px; height: 7px; border-radius: 50%; background: #3d3d3d; margin-top: 4px; flex: none; }
.sb-dot.open { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.sb-dot.active { background: var(--green); }
.sb-dot.idle { background: #5c5c5c; }
.sb-chev { color: var(--text-3); transition: transform .15s; }
.sb-row.expanded .sb-chev { transform: rotate(90deg); color: var(--text); }
.sb-detail { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px 28px; padding: 6px 20px 20px 20px; background: rgba(var(--ink), .04); border-top: 1px dashed rgba(var(--ink), .09); }
.sb-d-h { color: var(--text-3); font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; font-weight: 600; margin: 12px 0 4px; }
.sb-d-text p { margin: 0; color: var(--text); font-size: 13px; line-height: 1.5; max-width: 640px; }
.sb-d-meta { color: var(--text-3); font-size: 11.5px; margin-top: 12px; }
.sb-d-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.sb-d-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; align-self: start; margin-top: 12px; }
.sb-kv { background: rgba(var(--well), .22); padding: 10px 12px; }
.sb-kv span { display: block; color: var(--text-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; }
.sb-kv b { display: block; margin-top: 3px; font-size: 14px; font-weight: 600; }
.sb-kv b i { font-style: normal; font-weight: 400; color: var(--text-3); font-size: 11px; }
.sb-d-open { grid-column: 1 / -1; }
.sb-op { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); padding: 4px 0; }
.sb-op b { margin-left: auto; }
@media (max-width: 1700px) {
  .sb-row { grid-template-columns: minmax(260px, 3fr) 120px 100px 92px 84px 74px 132px 12px; }
  .sb-last { display: none !important; }
  .sb-spark svg { width: 120px; }
  .sb-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .sb-row { grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
  .sb-id { grid-column: 1 / -1; } .sb-chev, .sb-spark { display: none; }
  .sb-headrow { display: none; }
  .sb-detail { grid-template-columns: 1fr; }
  .sb-search { width: 100%; }
}

/* ------------------------------------------------------------ trade blotter view */
.bl-filters { flex-basis: 100%; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 14px; margin-top: 2px; border-top: 1px solid rgba(var(--ink), .05); }
.bl-clear { color: var(--text-3); font-size: 12px; padding: 4px 8px; border-radius: var(--r-sm); }
.bl-clear:hover { color: var(--text); background: rgba(var(--ink), .05); }
.bl-wrbar { display: inline-block; width: 46px; height: 4px; border-radius: 2px; background: rgba(229,72,77,.5); overflow: hidden; vertical-align: middle; margin-right: 5px; }
.bl-wrbar span { display: block; height: 100%; background: var(--green); }
.bl-open { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 10px; padding: 0 16px 16px; }
.bl-oc { position: relative; background: rgba(var(--ink), .025); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px 11px 16px; overflow: hidden; }
.bl-oc::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--pf); }
.bl-oc-top { display: flex; align-items: center; gap: 7px; }
.bl-oc-sym { font-weight: 600; }
.bl-oc-age { margin-left: auto; font-size: 11px; }
.bl-oc-name { color: var(--text-3); font-size: 11.5px; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bl-oc-pnl { font-size: 21px; font-weight: 600; margin: 6px 0 4px; }
.bl-oc-pnl small { font-size: 11px; color: var(--text-3); font-weight: 500; }
.bl-oc-px { display: flex; gap: 6px; font-size: 12px; color: var(--text-2); }
.bl-oc-px span:last-child { margin-left: auto; }
.bl-oc-foot { font-size: 11px; margin-top: 6px; }
.bl-panel { padding-bottom: 4px; }
.bl-table { width: calc(100% - 32px); margin: 0 16px; border-collapse: separate; border-spacing: 0; }
.bl-table th { position: sticky; top: 0; z-index: 2; background: var(--panel-2); color: var(--text-3); font-size: 10.5px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; text-align: left; padding: 10px 10px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.bl-table th:first-child { border-top-left-radius: var(--r-md); padding-left: 16px; }
.bl-table th:last-child { border-top-right-radius: var(--r-md); }
.bl-table th.sortable { cursor: pointer; } .bl-table th.sortable:hover, .bl-table th.on { color: var(--text); }
.bl-table th.r, .bl-table td.r { text-align: right; }
.bl-table td { padding: 9px 10px; border-top: 1px solid rgba(var(--ink), .05); white-space: nowrap; vertical-align: middle; }
.bl-table td i { display: block; font-style: normal; font-size: 11px; color: var(--text-3); margin-top: 2px; }
.bl-table td i.pos { color: var(--green); } .bl-table td i.neg { color: var(--red); }
.bl-tr { cursor: pointer; }
.bl-tr td:first-child { padding-left: 16px; position: relative; }
.bl-tr td:first-child::before { content: ""; position: absolute; left: 4px; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; }
.bl-tr.w td:first-child::before { background: var(--green); } .bl-tr.l td:first-child::before { background: var(--red); }
.bl-tr:hover td, .bl-tr.expanded td { background: rgba(var(--ink), .045); }
.bl-tr b { font-weight: 600; }
.bl-strat { display: flex; align-items: center; gap: 8px; max-width: 230px; }
.bl-sn { overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.bl-hold { height: 3px; width: 70px; background: rgba(var(--ink), .08); border-radius: 2px; margin-top: 4px; overflow: hidden; }
.bl-hold span { display: block; height: 100%; background: #7dd3fc; opacity: .7; }
.bl-res { position: relative; width: 110px; height: 14px; }
.bl-res::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: rgba(var(--ink), .16); }
.bl-res span { position: absolute; top: 3px; height: 8px; border-radius: 2px; }
.bl-res span.w { background: var(--green); } .bl-res span.l { background: var(--red); }
.bl-dayrow td { padding: 0; border-top: 0; }
.bl-dayhead { display: flex; align-items: center; gap: 18px; padding: 16px 12px 8px 6px; font-size: 12.5px; }
.bl-dname { color: var(--text-2); } .bl-dname b { color: var(--text); font-weight: 600; margin-left: 3px; }
.bl-tag { font-size: 10px; font-weight: 700; letter-spacing: .5px; background: var(--green); color: #04130a; padding: 2px 6px; border-radius: 4px; margin-left: 8px; }
.bl-tag.dim { background: rgba(var(--ink), .09); color: var(--text-2); }
.bl-dwin { color: var(--text-3); font-size: 12px; }
.bl-dnet { margin-left: auto; font-weight: 600; font-size: 13.5px; }
.bl-det td { padding: 0; border-top: 0; background: rgba(var(--ink), .045); }
.bl-detail { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px 28px; padding: 4px 18px 18px; white-space: normal; border-top: 1px dashed rgba(var(--ink), .09); }
.bl-tl { display: flex; align-items: stretch; gap: 0; margin: 6px 0 4px; }
.bl-tl-pt { display: flex; flex-direction: column; gap: 2px; position: relative; padding-left: 16px; min-width: 190px; }
.bl-tl-pt i { position: absolute; left: 0; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: #f4f4f6; }
.bl-tl-pt.end.w i { background: var(--green); } .bl-tl-pt.end.l i { background: var(--red); }
.bl-tl-pt span { color: var(--text-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; }
.bl-tl-pt b { font-size: 12.5px; font-weight: 600; }
.bl-tl-pt em { font-style: normal; color: var(--text-2); font-size: 12px; }
.bl-tl-mid { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 0 12px; min-width: 120px; position: relative; }
.bl-tl-mid::before { content: ""; position: absolute; left: 0; right: 12px; top: 8px; height: 1px; background: repeating-linear-gradient(90deg, rgba(var(--ink), .22) 0 4px, transparent 4px 8px); }
.bl-tl-mid span { position: relative; background: rgba(var(--ink), .045); padding: 0 8px; color: var(--text-2); font-size: 11.5px; }
.bl-rule { margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.5; max-width: 620px; }
.bl-rule b { color: var(--text); }
.bl-foldrow td { padding: 4px 0 6px; border-top: 0; }
.bl-fold { display: inline-flex; align-items: center; gap: 7px; margin-left: 14px; padding: 5px 11px; font-size: 11.5px; font-weight: 600; color: var(--text-2);
  border-radius: 999px; background: rgba(var(--ink), .04); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(var(--ink), .05); transition: background .15s, color .15s; }
.bl-fold:hover { color: var(--text); background: rgba(var(--ink), .08); }
.bl-fold svg { transition: transform .15s; }
.bl-fold.on svg { transform: rotate(180deg); }
.bl-more { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 12px; font-size: 12px; }
@media (max-width: 1500px) { .bl-table .bl-res, .bl-table th:nth-child(10) { display: none; } .bl-table td:nth-child(10) { display: none; } }
@media (max-width: 1180px) { .bl-table { display: block; overflow-x: auto; } .bl-detail { grid-template-columns: 1fr; } }
.bl-wd { padding: 2px 12px 12px; }
.bl-wd-r { display: grid; grid-template-columns: 34px 1fr 56px 34px; align-items: center; gap: 8px; font-size: 11.5px; padding: 2px 0; }
.bl-wd-r span { color: var(--text-3); font-size: 10.5px; }
.bl-wd-r em { font-style: normal; color: var(--text-3); font-size: 10.5px; text-align: right; }
.bl-wd-r b { text-align: right; font-weight: 600; }
.bl-wd-bar { position: relative; height: 8px; }
.bl-wd-bar::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: rgba(var(--ink), .16); }
.bl-wd-bar i { position: absolute; top: 0; height: 100%; border-radius: 2px; }
.bl-wd-bar i.w { background: var(--green); } .bl-wd-bar i.l { background: var(--red); }

/* ------------------------------------------------------------ performance & portfolio view */
.pa-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.pa-table th { text-align: left; color: var(--text-3); font-size: 10.5px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; padding: 9px 10px; background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.pa-table td { padding: 8px 10px; border-top: 1px solid rgba(var(--ink), .05); white-space: nowrap; }
.pa-table th.r, .pa-table td.r { text-align: right; }
.pa-table tr:hover td { background: rgba(var(--ink), .04); }
.pa-mk { display: inline-block; width: 16px; vertical-align: -2px; margin-right: 6px; }
.pa-best { background: rgba(232,226,122,.1); color: var(--amber) !important; font-weight: 600; }
.pa-weights { padding: 0 12px 12px; }
.pa-wrow { display: grid; grid-template-columns: 118px 1fr; align-items: center; gap: 10px; padding: 3px 0; font-size: 11.5px; color: var(--text-2); }
.pa-wbar { display: flex; height: 13px; border-radius: 3px; overflow: hidden; background: rgba(var(--ink), .04); }
.pa-wbar i { display: block; height: 100%; border-right: 1px solid rgba(0,0,0,.26); }
.pa-wbar i:hover { filter: brightness(1.3); }
.pa-vt td { padding: 9px 10px; }
.pa-forest { position: relative; width: 210px; height: 18px; }
.pa-forest .z { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(var(--ink), .22); }
.pa-forest .ci { position: absolute; top: 8px; height: 2px; background: #707070; border-radius: 1px; }
.pa-forest .pt { position: absolute; top: 4px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; border: 2px solid rgba(0,0,0,.26); }
.pa-forest .pt.w { background: var(--green); } .pa-forest .pt.l { background: var(--red); }
.pa-forest .bt { position: absolute; top: 4px; width: 8px; height: 8px; margin-left: -4px; transform: rotate(45deg); border: 1.5px solid #e8e27a; }
.pa-forest b { position: absolute; right: -44px; top: 1px; font-weight: 600; width: 38px; text-align: right; }
.pa-vt td:nth-child(4) { padding-right: 56px; }
.pa-verdict { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; padding: 2px 8px; border-radius: 10px; margin-right: 4px; }
.pa-verdict.core { background: rgba(76,199,106,.18); color: #6ee7a0; }
.pa-verdict.viable { background: rgba(125,211,252,.15); color: #7dd3fc; }
.pa-verdict.watch { background: rgba(232,226,122,.14); color: var(--amber); }
.pa-verdict.weak { background: rgba(229,72,77,.16); color: #ff8a8d; }
.pa-verdict.red { background: rgba(251,146,60,.14); color: #fb923c; }
.pa-verdict.na { background: rgba(var(--ink), .08); color: var(--text-3); }

/* ------------------------------------------------------------ open positions view */
.op-split { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 10px; align-items: start; margin-bottom: 10px; }
.op-split .op-chart-panel { position: sticky; top: 0; }
.op-sn { color: var(--text-2) !important; }
.op-table-panel { min-width: 0; }
.op-table-wrap { overflow-x: auto; padding: 0 16px 14px; }
.op-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.op-table th { position: sticky; top: 0; background: var(--panel-2); color: var(--text-3); font-size: 10.5px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; text-align: left; padding: 10px 12px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.op-table th:first-child { border-top-left-radius: var(--r-md); padding-left: 18px; } .op-table th:last-child { border-top-right-radius: var(--r-md); }
.op-table th.r, .op-table td.r { text-align: right; }
.op-table td { padding: 11px 10px; border-top: 1px solid rgba(var(--ink), .05); white-space: nowrap; vertical-align: middle; }
.op-table td b { font-weight: 600; }
.op-table td i { display: block; font-style: normal; color: var(--text-3); font-size: 11px; margin-top: 3px; }
.op-table td i.pos { color: var(--green); } .op-table td i.neg { color: var(--red); }
.op-tr { cursor: pointer; }
.op-tr td:first-child { position: relative; padding-left: 18px; }
.op-tr td:first-child::before { content: ""; position: absolute; left: 5px; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: var(--pf); }
.op-tr:hover td { background: rgba(var(--ink), .04); }
.op-tr.sel td { background: rgba(var(--ink), .075); }
.op-tr.sel td:first-child { box-shadow: inset 2px 0 0 #cfcfcf; }
.op-pos { display: flex; align-items: center; gap: 7px; }
.op-pos b { font-size: 14px; }
.op-big { font-size: 16px; }
.op-sl b { color: #ff8a8d; font-size: 15px; } .op-tp b { color: #6ee7a0; font-size: 15px; }
.op-table th.op-sl, .op-table td.op-sl { padding-right: 6px; } .op-table th.op-tp, .op-table td.op-tp { padding-left: 6px; }
.op-outh { min-width: 150px; text-align: center !important; } .op-outh span { display: inline-block; }
.op-outh span:nth-child(1) { color: #ff8a8d; } .op-outh span:nth-child(2) { margin: 0 10px; } .op-outh span:nth-child(3) { color: #6ee7a0; }
.op-out { position: relative; height: 22px; min-width: 150px; }
.op-out .z { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: rgba(var(--ink), .22); }
.op-out i { position: absolute; top: 8px; height: 6px; }
.op-out i.sl { background: linear-gradient(90deg, #e5484d, rgba(229,72,77,.35)); border-radius: 3px 0 0 3px; }
.op-out i.tp { background: linear-gradient(90deg, rgba(76,199,106,.35), #4cc76a); border-radius: 0 3px 3px 0; }
.op-out b { position: absolute; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; border: 2.5px solid rgba(0,0,0,.26); box-shadow: 0 0 0 1px #f4f4f6; }
.op-out b.w { background: var(--green); } .op-out b.l { background: var(--red); }
.op-out em { position: absolute; top: 4px; font-style: normal; font-size: 10px; color: var(--text-3); }
.op-out em.l { left: 4px; } .op-out em.r { right: 4px; }
.op-stake span { display: block; font-size: 12px; font-weight: 600; } .op-stake span + span { margin-top: 3px; }
.op-table tfoot td { border-top: 1px solid var(--line-2); padding-top: 10px; padding-bottom: 4px; font-size: 12px; }
.op-table tfoot b { font-size: 14px; }
.op-chart-panel { min-width: 0; }
.op-chart-head { display: grid; grid-template-columns: 1fr auto; gap: 10px 20px; align-items: end; padding: 16px 18px 12px; }
.op-h-sym { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 22px; font-weight: 600; letter-spacing: -.3px; }
.op-h-name { font-size: 13px; color: var(--text-2); font-weight: 500; }
.op-h-feed { display: flex; align-items: center; gap: 7px; margin-top: 6px; color: var(--text-3); font-size: 10.5px; letter-spacing: .5px; font-weight: 600; }
.op-h-feed .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); animation: pulse 1.6s ease-in-out infinite; }
.op-h-feed .dot.demo { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
@keyframes pulse { 50% { opacity: .35; } }
.op-h-r { text-align: right; }
.op-h-px { font-size: 24px; font-weight: 600; }
.op-h-px small { display: block; font-size: 12px; font-weight: 600; margin-top: 2px; }
.op-h-q { color: var(--text-3); font-size: 11px; margin-top: 3px; }
.op-h-ctl { grid-column: 1 / -1; display: flex; gap: 8px; }
.op-chart { margin: 0 18px; }
.op-loading { height: 520px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text-3); }
.op-loading span { width: 14px; height: 14px; border: 2px solid rgba(var(--ink), .16); border-top-color: var(--text); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.op-detail { padding: 14px 18px 18px; }
.op-d-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.op-d-grid .sb-kv em { display: block; font-style: normal; color: var(--text-3); font-size: 10.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-prog { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin-top: 12px; font-size: 11.5px; color: var(--text-3); }
.op-prog-bar { height: 6px; border-radius: 3px; background: rgba(var(--ink), .08); overflow: hidden; }
.op-prog-bar i { display: block; height: 100%; background: linear-gradient(90deg, #2e9c4c, #6ee7a0); border-radius: 3px; }
.op-d-rule { margin-top: 12px; font-size: 12.5px; color: var(--text-2); line-height: 1.6; }
.op-d-rule b { color: var(--text); }
.op-d-act { display: inline-flex; gap: 8px; margin-left: 10px; vertical-align: middle; }
@media (max-width: 1500px) { .op-split { grid-template-columns: 1fr; } .op-split .op-chart-panel { position: static; } }

/* names instead of strategy tickers */
.pf-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; margin-right: 2px; vertical-align: 0; }
.op-h-name .pf-dot { margin-right: 7px; }
.st-nm { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.sb-tname { font-size: 15px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-h2 { font-size: 19px !important; }
.col-right .pf-seg button, .col-center .pf-seg button { padding: 4px 9px; font-size: 12px; }
.st-sym { display: block; color: var(--text-3); font-size: 10.5px; margin-top: 1px; }
.op-split.empty { grid-template-columns: 1fr; } .op-split.empty .op-chart-panel { display: none; }
.op-empty { padding: 28px 18px !important; color: var(--text-2); white-space: normal !important; line-height: 1.6; }
.op-empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
/* dashboard strategy tables: fixed columns so long names and five-digit P&L never push %CHG out */
.col-strat table.grid { table-layout: fixed; }
.col-strat table.grid th:nth-child(2), .col-strat table.grid td:nth-child(2) { width: 80px; padding-left: 2px; padding-right: 4px; }
.col-strat table.grid th:nth-child(3), .col-strat table.grid td:nth-child(3) { width: 64px; padding-left: 2px; }
.col-strat table.grid td:first-child { overflow: hidden; }
.col-strat .st-nm { max-width: calc(100% - 22px); }

/* ------------------------------------------------------------ data view (locked editor) */
.dv-lockchip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--amber); background: rgba(232,226,122,.1); border: 1px solid rgba(232,226,122,.3); padding: 5px 10px; border-radius: 12px; }
.dv-ide { position: relative; display: grid; grid-template-columns: 220px minmax(0, 1fr); height: calc(100vh - 190px); min-height: 520px; overflow: hidden; background: rgba(var(--well), .42); }
.dv-tree { border-right: 1px solid var(--line); padding: 10px 0; overflow: auto; font-size: 12.5px; background: rgba(var(--well), .3); }
.dv-tree-h { color: var(--text-3); font-size: 10.5px; letter-spacing: .6px; font-weight: 600; padding: 4px 16px 10px; }
.dv-dir { color: var(--text-2); padding: 4px 14px; font-weight: 600; }
.dv-file { display: flex; align-items: center; gap: 8px; color: var(--text-3); padding: 4px 14px 4px 30px; }
.dv-file.on { color: var(--text); background: rgba(var(--ink), .08); }
.dv-file i { width: 8px; height: 8px; border-radius: 2px; background: #cfcfcf; }
.dv-file i.json { background: var(--amber); } .dv-file i.csv, .dv-file i.map { background: var(--green); }
.dv-main { display: grid; grid-template-rows: 36px minmax(0, 1fr) 132px 26px; min-width: 0; }
.dv-tabs { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); background: rgba(var(--well), .3); font-size: 12.5px; }
.dv-tab { display: flex; align-items: center; padding: 0 16px; color: var(--text-3); border-right: 1px solid var(--line); }
.dv-tab.on { color: var(--text); background: rgba(var(--well), .42); box-shadow: inset 0 2px 0 #cfcfcf; }
.dv-tabs .grow { flex: 1; }
.dv-run { display: flex; align-items: center; padding: 0 16px; color: var(--green); font-weight: 600; }
.dv-editor { display: flex; overflow: auto; font: 12.5px/1.6 var(--mono); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.dv-gutter { margin: 0; padding: 12px 14px 12px 18px; color: #4d4d4d; text-align: right; user-select: none; position: sticky; left: 0; background: rgba(var(--deep), .92); border-right: 1px solid rgba(var(--ink), .05); }
.dv-code { margin: 0; padding: 12px 18px; color: #d4d4dc; white-space: pre; }
.dv-code .k { color: #c792ea; } .dv-code .t { color: #7dd3fc; } .dv-code .s { color: #e8c87a; }
.dv-code .n { color: #6ee7a0; } .dv-code .c { color: #5c6370; font-style: italic; } .dv-code .f { color: #82aaff; }
.dv-output { border-top: 1px solid var(--line); background: rgba(var(--well), .3); font-size: 12px; overflow: hidden; }
.dv-out-h { display: flex; gap: 18px; padding: 8px 16px; font-size: 10.5px; letter-spacing: .5px; font-weight: 600; color: var(--text-3); }
.dv-out-h .on { color: var(--text); }
.dv-output pre { margin: 0; padding: 0 16px; font: 12px/1.7 var(--mono); color: var(--text-2); }
.dv-output .c { color: #5c6370; } .dv-output .n { color: var(--green); }
.dv-status { display: flex; gap: 18px; align-items: center; padding: 0 14px; font-size: 11px; color: #bdbdbd; background: rgba(var(--ink), .07); }
.dv-status .grow { flex: 1; }
/* the lock: blur everything behind the modal; unlocking removes the veil */
.dv-ide .dv-tree, .dv-ide .dv-main { filter: blur(7px) saturate(.85); user-select: none; pointer-events: none; transition: filter .35s ease; }
.dv-veil { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(var(--deep), .35); z-index: 5; }
#dataView.dv-open .dv-ide .dv-tree, #dataView.dv-open .dv-ide .dv-main { filter: none; user-select: text; pointer-events: auto; }
#dataView.dv-open .dv-veil { display: none; }
.dv-modal { width: 360px; background: rgba(var(--ink), .045); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 26px 26px 22px; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.6); }
.dv-lock { width: 48px; height: 48px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; background: rgba(var(--ink), .08); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.dv-modal h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.dv-modal p { margin: 0 0 16px; color: var(--text-3); font-size: 12.5px; line-height: 1.5; }
.dv-modal input { width: 100%; background: rgba(var(--well), .26); border: 1px solid var(--line-2); border-radius: var(--r-md); color: var(--text); font: inherit; padding: 10px 12px; outline: none; margin-bottom: 10px; }
.dv-modal input:focus { border-color: #cfcfcf; box-shadow: 0 0 0 3px rgba(var(--ink), .08); }
.dv-modal .btn-light { width: 100%; justify-content: center; padding: 10px; }
.dv-err { min-height: 18px; margin-top: 10px; color: #ff8a8d; font-size: 12px; }
.dv-modal.shake { animation: dvshake .35s; }
@keyframes dvshake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@media (max-width: 1180px) { .dv-ide { grid-template-columns: 1fr; height: 640px; } .dv-tree { display: none; } }

/* aligned blocks: every chart box fills its card, so the boxes in a row share their top and bottom edges;
   charts sit centred in any extra height, tables and lists start at the top */
.sv-grid { align-items: stretch; }
.sv-grid > .sv-card { display: flex; flex-direction: column; }
.sv-grid > .sv-card > .sv-body { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; }
.sv-grid > .sv-card > .sv-body > svg { flex: none; }
#paAlloc, #paViab, #paRC, #svCal, #paCal { justify-content: flex-start !important; }
.sv-grid > .sv-card.sv-kpi { justify-content: flex-start; }
/* trading calendar: heatmap with the weekday averages beside it on wide cards */
.blc { display: flex; flex-wrap: wrap; align-items: flex-start; }
.blc-l { flex: 0 1 auto; min-width: 0; }
.blc-r { flex: 1 1 340px; padding-top: 8px; }
.op-cal { margin-bottom: 10px; }

/* ------------------------------------------------------------ glass */
/* black stage with soft grey light so the frosted panels have something to refract */
body {
  background:
    radial-gradient(1100px 680px at 8% -12%, rgba(var(--ink), .085), transparent 62%),
    radial-gradient(900px 620px at 104% 108%, rgba(var(--ink), .06), transparent 60%),
    radial-gradient(760px 520px at 58% 46%, rgba(150,150,150,.035), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
body::before, body::after {
  content: ""; position: fixed; z-index: -1; pointer-events: none; border-radius: 50%; filter: blur(90px);
}
body::before { width: 520px; height: 520px; left: 30%; top: -180px; background: rgba(200,200,200,.07); }
body::after { width: 640px; height: 420px; right: -120px; bottom: 8%; background: rgba(120,120,120,.09); }
body::-webkit-scrollbar, *::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(var(--ink), .1); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

.panel {
  background: linear-gradient(180deg, rgba(var(--ink), .055), rgba(var(--ink), .018) 38%, rgba(var(--ink), .012));
  border-color: rgba(var(--ink), .085);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-edge), var(--glass-drop);
  position: relative;
}
/* thin light catching the top edge */
.panel::before {
  content: ""; position: absolute; left: 14px; right: 14px; top: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(var(--ink), .28), transparent);
}
.nav:hover {
  background: rgba(var(--deep), .72); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 0 0 1px var(--line), var(--glass-edge), 12px 0 40px rgba(0,0,0,.6);
}
.nav a.on, .seg button.on {
  background: linear-gradient(180deg, rgba(var(--ink), .13), rgba(var(--ink), .06));
  box-shadow: inset 0 0 0 1px rgba(var(--ink), .12), inset 0 1px 0 rgba(var(--ink), .12);
}
.seg, .chip, .card, .sv-select, .sb-search {
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(var(--ink), .05);
}
.btn-light { background: linear-gradient(180deg, #f4f4f4, #cfcfcf); box-shadow: 0 0 0 1px rgba(var(--ink), .2), 0 6px 18px -6px rgba(var(--ink), .25); }
.btn-light:hover { background: #fff; }

/* sticky heads stay legible over scrolling rows */
.sb-headrow, .bl-table th, .op-table th, table.grid th, .pa-table th {
  background: var(--head); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.sb-headrow:hover { background: var(--head); }
.dropdown select option { background: #141414; }

/* inset wells (charts, KPI cells, stat boxes) read as darker glass */
.chart-wrap, .stat-box, .sv-body { box-shadow: inset 0 1px 12px rgba(0,0,0,.35); }

.tooltip { -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 12px 30px rgba(0,0,0,.6), inset 0 1px 0 rgba(var(--ink), .08); }
.dv-modal {
  background: rgba(var(--deep), .62); -webkit-backdrop-filter: blur(26px) saturate(150%); backdrop-filter: blur(26px) saturate(150%);
  border-color: rgba(var(--ink), .12); box-shadow: 0 30px 80px rgba(0,0,0,.7), inset 0 1px 0 rgba(var(--ink), .1);
}
.dv-modal input { background: rgba(var(--well), .35); }
.dv-veil { background: rgba(var(--well), .3); }

/* ------------------------------------------------------------ market feed */
.mf-tags { flex-wrap: wrap; }
.mf-mine { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--text-2);
  border-radius: var(--r-md); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.mf-mine i { width: 26px; height: 14px; border-radius: 7px; background: rgba(var(--ink), .12); position: relative; transition: background .15s; }
.mf-mine i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: #9a9a9a; transition: transform .15s, background .15s; }
.mf-mine.on { color: var(--text); }
.mf-mine.on i { background: rgba(76,199,106,.45); }
.mf-mine.on i::after { transform: translateX(12px); background: #fff; }
.mf-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mf-next .v { display: flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; }
.mf-next #mfCount.soon { color: var(--amber); }
.mf-u { font-size: 12px; font-weight: 600; }
.mf-grid { align-items: stretch; }
.mf-card { height: calc(100vh - 330px); min-height: 520px; }
.mf-card .sv-card-head .seg { margin-left: 4px; }
.mf-scroll { flex: 1; min-height: 0; overflow-y: auto; margin: 0 16px 14px; border-radius: var(--r-md); background: rgba(var(--well), .22);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 12px rgba(0,0,0,.35); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.mf-empty { padding: 30px 18px; color: var(--text-3); }
.mf-live { display: inline-flex; align-items: center; gap: 8px; }
.mf-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red); animation: pulse 1.6s ease-in-out infinite; }

.mf-day, .mf-dayrow td { position: sticky; top: 0; z-index: 2; background: var(--head); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  color: var(--text-3); font-size: 11.5px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.mf-day b, .mf-dayrow b { color: var(--text-2); font-weight: 600; }
.mf-item { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 12px; padding: 12px 14px; color: inherit; text-decoration: none;
  border-bottom: 1px solid rgba(var(--ink), .045); position: relative; transition: background .12s; }
.mf-item:hover { background: rgba(var(--ink), .045); }
.mf-item.new { background: linear-gradient(90deg, rgba(76,199,106,.09), transparent 45%); }
.mf-item.new::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: var(--green); }
.mf-time { display: flex; flex-direction: column; gap: 2px; font-variant-numeric: tabular-nums; }
.mf-time b { font-size: 13px; font-weight: 600; }
.mf-time span { color: var(--text-3); font-size: 11px; }
.mf-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-bottom: 4px; font-size: 10.5px; }
.mf-src { color: var(--text-2); font-weight: 600; }
.mf-sect { color: var(--text-3); }
.mf-sect::before { content: "·"; margin-right: 5px; }
.mf-flag { font-weight: 700; letter-spacing: .5px; padding: 1px 6px; border-radius: 4px; background: rgba(229,72,77,.18); color: #ff8a8d; }
.mf-item.new .mf-flag { background: rgba(76,199,106,.2); color: #6ee7a0; }
.mf-tag { padding: 1px 6px; border-radius: 4px; background: rgba(var(--ink), .06); color: var(--text-3); font-weight: 600; }
.mf-tag.book { background: rgba(var(--ink), .13); color: var(--text); box-shadow: inset 0 0 0 1px rgba(var(--ink), .15); }
.mf-title { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.mf-item:hover .mf-title { text-decoration: underline; text-decoration-color: rgba(var(--ink), .3); text-underline-offset: 3px; }
.mf-sum { color: var(--text-2); font-size: 12px; line-height: 1.45; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.mf-week { padding: 0 16px 8px; }
.mf-week svg text { fill: var(--text-3); font-size: 10px; font-family: var(--sans); }
.mf-week svg text.on { fill: var(--text); font-weight: 600; }
.mf-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mf-table th { position: sticky; top: 0; z-index: 3; background: var(--head); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  color: var(--text-3); font-size: 10px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); }
.mf-table .r { text-align: right; }
.mf-dayrow td { top: 30px; padding: 9px 10px 7px; }
.mf-dayrow td span { color: var(--text-2); }
.mf-dayrow td small { float: right; color: var(--text-3); }
.mf-dayrow.today td span b { color: var(--text); }
.mf-ev td { padding: 8px 8px; border-bottom: 1px solid rgba(var(--ink), .04); vertical-align: top; white-space: nowrap; }
.mf-ev td.mf-ev-t { white-space: normal; color: var(--text); }
.mf-ev.hi td.mf-ev-t { font-weight: 600; }
.mf-ev:hover td { background: rgba(var(--ink), .035); }
.mf-ev.past td { opacity: .42; }
.mf-ev.next td { background: rgba(var(--ink), .075); }
.mf-ev.next td:first-child { box-shadow: inset 2px 0 0 #f4f4f6; }
.mf-t { font-variant-numeric: tabular-nums; color: var(--text-2); width: 64px; }
.mf-in { font-size: 10px; color: var(--amber); font-weight: 600; margin-top: 2px; }
.mf-ccy { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .4px; padding: 2px 6px; border-radius: 4px; background: rgba(var(--ink), .07); color: var(--text-2); }
.mf-ccy.book { background: rgba(var(--ink), .15); color: var(--text); box-shadow: inset 0 0 0 1px rgba(var(--ink), .18); }
.mf-next .mf-ccy { font-size: 12px; padding: 3px 8px; }
.mf-imp { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; margin-top: 2px; }
.mf-imp i { width: 3px; border-radius: 1px; background: rgba(var(--ink), .14); }
.mf-imp i:nth-child(1) { height: 5px; } .mf-imp i:nth-child(2) { height: 8px; } .mf-imp i:nth-child(3) { height: 12px; }
.mf-imp.md i:nth-child(-n+2) { background: #f0a33a; }
.mf-imp.hi i { background: #e5484d; box-shadow: 0 0 6px rgba(229,72,77,.5); }
.mf-src-note { padding: 12px 12px 14px; color: var(--text-3); font-size: 11px; }
@media (max-width: 1280px) {
  .mf-grid > .span-7, .mf-grid > .span-5 { grid-column: span 12; }
  .mf-card { height: 640px; }
  .mf-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------ light theme */
/* <html data-theme="light"> (settings button, bottom left). Tokens first, then the few
   rules that hard-code dark glass, then the chart colours the JS writes into SVG. */
:root[data-theme="light"] {
  --bg: #e7e8ea;
  --panel: rgba(255, 255, 255, .5);
  --panel-2: rgba(255, 255, 255, .66);
  --head: rgba(247, 247, 248, .9);
  --row-alt: rgba(0, 0, 0, .022);
  --line: rgba(0, 0, 0, .08);
  --line-2: rgba(0, 0, 0, .14);
  --text: #151517;
  --text-2: #4f4f53;
  --text-3: #86868b;
  --green: #1f9e4a;
  --green-2: #1f9e4a;
  --green-3: #157a37;
  --green-bg: rgba(31, 158, 74, .12);
  --red: #d6343a;
  --red-bg: rgba(214, 52, 58, .12);
  --blue: #55555a;
  --amber: #a58c00;
  --hover: rgba(0, 0, 0, .04);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 0 0 1px rgba(255, 255, 255, .35);
  --glass-drop: 0 18px 40px -22px rgba(30, 30, 40, .22);
  --ink: 0, 0, 0;
  --well: 255, 255, 255;
  --deep: 250, 250, 251;
  color-scheme: light;
}
[data-theme="light"] body {
  background:
    radial-gradient(1100px 680px at 8% -12%, rgba(255,255,255,.95), transparent 62%),
    radial-gradient(900px 620px at 104% 108%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(760px 520px at 58% 46%, rgba(190,192,198,.25), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
[data-theme="light"] body::before { background: rgba(255,255,255,.9); }
[data-theme="light"] body::after { background: rgba(170,172,182,.35); }
[data-theme="light"] .panel {
  background: linear-gradient(180deg, rgba(255,255,255,.82), rgba(255,255,255,.55) 38%, rgba(255,255,255,.46));
  border-color: rgba(0,0,0,.07);
}
[data-theme="light"] .panel::before { background: linear-gradient(90deg, transparent, #fff, transparent); }
[data-theme="light"] .nav:hover { box-shadow: inset 0 0 0 1px var(--line), var(--glass-edge), 12px 0 40px rgba(30,30,40,.14); }
[data-theme="light"] .nav a.on, [data-theme="light"] .seg button.on {
  background: linear-gradient(180deg, #fff, rgba(255,255,255,.75));
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.09), 0 1px 3px rgba(0,0,0,.08);
}
[data-theme="light"] .btn-light { background: linear-gradient(180deg, #2b2b2e, #111113); color: #f4f4f6; box-shadow: 0 6px 18px -8px rgba(0,0,0,.45); }
[data-theme="light"] .btn-light:hover { background: #000; }
[data-theme="light"] .dropdown select option { background: #fff; }
[data-theme="light"] .chart-wrap, [data-theme="light"] .stat-box, [data-theme="light"] .sv-body { box-shadow: inset 0 1px 8px rgba(0,0,0,.05); }
[data-theme="light"] .mf-scroll { box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 8px rgba(0,0,0,.05); }
[data-theme="light"] .tooltip { box-shadow: 0 12px 30px rgba(30,30,40,.18), inset 0 1px 0 #fff; }
[data-theme="light"] .dv-modal { box-shadow: 0 30px 80px rgba(30,30,40,.25), inset 0 1px 0 #fff; }
[data-theme="light"] .dv-veil { background: rgba(230,231,234,.4); }
[data-theme="light"] .sv-cal td { color: var(--text); }
[data-theme="light"] .crosshair { stroke: #9a9a9e; }
[data-theme="light"] .sb-dot { background: #c6c6c8; }
[data-theme="light"] .sb-vs .live, [data-theme="light"] .bl-tl-pt i { background: #1b1b1d; }
[data-theme="light"] .sb-vs .bt { background: #a9a9ab; }
[data-theme="light"] .bl-hold span, [data-theme="light"] .chip .dot.bt { background: #1f86c2; box-shadow: none; }
[data-theme="light"] .mf-ev.next td:first-child { box-shadow: inset 2px 0 0 #1b1b1d; }
[data-theme="light"] .op-out b { box-shadow: 0 0 0 1px #1b1b1d; }
[data-theme="light"] .op-tr.sel td:first-child { box-shadow: inset 2px 0 0 #333; }
[data-theme="light"] .dv-tab.on { box-shadow: inset 0 2px 0 #333; }
[data-theme="light"] .dv-file i { background: #555; }
[data-theme="light"] .pa-forest .bt { border-color: #b39b00; }
[data-theme="light"] .pa-verdict.core, [data-theme="light"] .op-tp b, [data-theme="light"] .op-outh span:nth-child(3),
[data-theme="light"] .mf-item.new .mf-flag { color: #157a37; }
[data-theme="light"] .pa-verdict.viable { color: #1f6f9e; }
[data-theme="light"] .pa-verdict.weak, [data-theme="light"] .op-sl b, [data-theme="light"] .op-outh span:nth-child(1),
[data-theme="light"] .mf-flag, [data-theme="light"] .dv-err { color: #c22c32; }
[data-theme="light"] .pa-verdict.red { color: #c2600f; }
[data-theme="light"] .dv-code { color: #2b2b33; }
[data-theme="light"] .dv-code .k { color: #8a3fc4; } [data-theme="light"] .dv-code .t { color: #1f6f9e; }
[data-theme="light"] .dv-code .s { color: #946200; } [data-theme="light"] .dv-code .n { color: #157a37; }
[data-theme="light"] .dv-code .c, [data-theme="light"] .dv-output .c { color: #8a9099; } [data-theme="light"] .dv-code .f { color: #2f5fd0; }
[data-theme="light"] .dv-gutter { color: #a6a6aa; }
[data-theme="light"] .dv-status { color: var(--text-2); }
[data-theme="light"] .avatar { background: linear-gradient(135deg, #9a9a9e, #3a3a3e); }
[data-theme="light"] [fill="#f4f4f6"], [data-theme="light"] [style*="fill:#f4f4f6;"] { fill: #1b1b1d !important; }
[data-theme="light"] [stroke="#f4f4f6"], [data-theme="light"] [style*="stroke:#f4f4f6;"] { stroke: #1b1b1d !important; }
[data-theme="light"] [style*="background:#f4f4f6"] { background: #1b1b1d !important; }
[data-theme="light"] [fill="#ececec"], [data-theme="light"] [style*="fill:#ececec;"] { fill: #1b1b1d !important; }
[data-theme="light"] [stroke="#ececec"], [data-theme="light"] [style*="stroke:#ececec;"] { stroke: #1b1b1d !important; }
[data-theme="light"] [style*="background:#ececec"] { background: #1b1b1d !important; }
[data-theme="light"] [fill="#fff"], [data-theme="light"] [style*="fill:#fff;"] { fill: #1b1b1d !important; }
[data-theme="light"] [stroke="#fff"], [data-theme="light"] [style*="stroke:#fff;"] { stroke: #1b1b1d !important; }
[data-theme="light"] [style*="background:#fff"] { background: #1b1b1d !important; }
[data-theme="light"] [fill="#ffffff"], [data-theme="light"] [style*="fill:#ffffff;"] { fill: #1b1b1d !important; }
[data-theme="light"] [stroke="#ffffff"], [data-theme="light"] [style*="stroke:#ffffff;"] { stroke: #1b1b1d !important; }
[data-theme="light"] [style*="background:#ffffff"] { background: #1b1b1d !important; }
[data-theme="light"] [fill="#cccccc"], [data-theme="light"] [style*="fill:#cccccc;"] { fill: #3a3a3a !important; }
[data-theme="light"] [stroke="#cccccc"], [data-theme="light"] [style*="stroke:#cccccc;"] { stroke: #3a3a3a !important; }
[data-theme="light"] [style*="background:#cccccc"] { background: #3a3a3a !important; }
[data-theme="light"] [fill="#3d3d3d"], [data-theme="light"] [style*="fill:#3d3d3d;"] { fill: #c6c6c8 !important; }
[data-theme="light"] [stroke="#3d3d3d"], [data-theme="light"] [style*="stroke:#3d3d3d;"] { stroke: #c6c6c8 !important; }
[data-theme="light"] [style*="background:#3d3d3d"] { background: #c6c6c8 !important; }
[data-theme="light"] [fill="#363636"], [data-theme="light"] [style*="fill:#363636;"] { fill: #cfcfd1 !important; }
[data-theme="light"] [stroke="#363636"], [data-theme="light"] [style*="stroke:#363636;"] { stroke: #cfcfd1 !important; }
[data-theme="light"] [style*="background:#363636"] { background: #cfcfd1 !important; }
[data-theme="light"] [fill="#2c2c2c"], [data-theme="light"] [style*="fill:#2c2c2c;"] { fill: #d6d6d8 !important; }
[data-theme="light"] [stroke="#2c2c2c"], [data-theme="light"] [style*="stroke:#2c2c2c;"] { stroke: #d6d6d8 !important; }
[data-theme="light"] [style*="background:#2c2c2c"] { background: #d6d6d8 !important; }
[data-theme="light"] [fill="#5c5c5c"], [data-theme="light"] [style*="fill:#5c5c5c;"] { fill: #a9a9ab !important; }
[data-theme="light"] [stroke="#5c5c5c"], [data-theme="light"] [style*="stroke:#5c5c5c;"] { stroke: #a9a9ab !important; }
[data-theme="light"] [style*="background:#5c5c5c"] { background: #a9a9ab !important; }
[data-theme="light"] [fill="#0c0c12"], [data-theme="light"] [style*="fill:#0c0c12;"] { fill: #ffffff !important; }
[data-theme="light"] [stroke="#0c0c12"], [data-theme="light"] [style*="stroke:#0c0c12;"] { stroke: #ffffff !important; }
[data-theme="light"] [style*="background:#0c0c12"] { background: #ffffff !important; }
[data-theme="light"] [fill="#e8e27a"], [data-theme="light"] [style*="fill:#e8e27a;"] { fill: #b39b00 !important; }
[data-theme="light"] [stroke="#e8e27a"], [data-theme="light"] [style*="stroke:#e8e27a;"] { stroke: #b39b00 !important; }
[data-theme="light"] [style*="background:#e8e27a"] { background: #b39b00 !important; }
[data-theme="light"] [fill="#7dd3fc"], [data-theme="light"] [style*="fill:#7dd3fc;"] { fill: #1f86c2 !important; }
[data-theme="light"] [stroke="#7dd3fc"], [data-theme="light"] [style*="stroke:#7dd3fc;"] { stroke: #1f86c2 !important; }
[data-theme="light"] [style*="background:#7dd3fc"] { background: #1f86c2 !important; }
[data-theme="light"] [fill="#999999"], [data-theme="light"] [style*="fill:#999999;"] { fill: #6f6f6f !important; }
[data-theme="light"] [stroke="#999999"], [data-theme="light"] [style*="stroke:#999999;"] { stroke: #6f6f6f !important; }
[data-theme="light"] [style*="background:#999999"] { background: #6f6f6f !important; }
[data-theme="light"] [fill="rgba(255,255,255,.06)"], [data-theme="light"] [style*="fill:rgba(255,255,255,.06);"] { fill: rgba(0,0,0,.07) !important; }
[data-theme="light"] [stroke="rgba(255,255,255,.06)"], [data-theme="light"] [style*="stroke:rgba(255,255,255,.06);"] { stroke: rgba(0,0,0,.07) !important; }
[data-theme="light"] [fill="rgba(255,255,255,.05)"], [data-theme="light"] [style*="fill:rgba(255,255,255,.05);"] { fill: rgba(0,0,0,.06) !important; }
[data-theme="light"] [stroke="rgba(255,255,255,.05)"], [data-theme="light"] [style*="stroke:rgba(255,255,255,.05);"] { stroke: rgba(0,0,0,.06) !important; }
[data-theme="light"] [fill="rgba(255,255,255,.02)"], [data-theme="light"] [style*="fill:rgba(255,255,255,.02);"] { fill: rgba(0,0,0,.03) !important; }
[data-theme="light"] [stroke="rgba(255,255,255,.02)"], [data-theme="light"] [style*="stroke:rgba(255,255,255,.02);"] { stroke: rgba(0,0,0,.03) !important; }
[data-theme="light"] [fill="rgba(255,255,255,.018)"], [data-theme="light"] [style*="fill:rgba(255,255,255,.018);"] { fill: rgba(0,0,0,.025) !important; }
[data-theme="light"] [stroke="rgba(255,255,255,.018)"], [data-theme="light"] [style*="stroke:rgba(255,255,255,.018);"] { stroke: rgba(0,0,0,.025) !important; }
[data-theme="light"] [fill="rgba(255,255,255,.045)"], [data-theme="light"] [style*="fill:rgba(255,255,255,.045);"] { fill: rgba(0,0,0,.05) !important; }
[data-theme="light"] [stroke="rgba(255,255,255,.045)"], [data-theme="light"] [style*="stroke:rgba(255,255,255,.045);"] { stroke: rgba(0,0,0,.05) !important; }
[data-theme="light"] [fill="rgba(255,255,255,.04)"], [data-theme="light"] [style*="fill:rgba(255,255,255,.04);"] { fill: rgba(0,0,0,.045) !important; }
[data-theme="light"] [stroke="rgba(255,255,255,.04)"], [data-theme="light"] [style*="stroke:rgba(255,255,255,.04);"] { stroke: rgba(0,0,0,.045) !important; }
[data-theme="light"] [fill="rgba(255,255,255,.07)"], [data-theme="light"] [style*="fill:rgba(255,255,255,.07);"] { fill: rgba(0,0,0,.07) !important; }
[data-theme="light"] [stroke="rgba(255,255,255,.07)"], [data-theme="light"] [style*="stroke:rgba(255,255,255,.07);"] { stroke: rgba(0,0,0,.07) !important; }
[data-theme="light"] [fill="rgba(255,255,255,.16)"], [data-theme="light"] [style*="fill:rgba(255,255,255,.16);"], [data-theme="light"]  { fill: rgba(0,0,0,.2) !important; }
[data-theme="light"] [stroke="rgba(255,255,255,.16)"], [data-theme="light"] [style*="stroke:rgba(255,255,255,.16);"] { stroke: rgba(0,0,0,.2) !important; }
[data-theme="light"] [style^="fill:#f4f4f6"], [data-theme="light"] [style*=";fill:#f4f4f6"] { fill: #1b1b1d !important; }
[data-theme="light"] [style^="fill:#ececec"], [data-theme="light"] [style*=";fill:#ececec"] { fill: #1b1b1d !important; }
[data-theme="light"] [style^="fill:#fff"], [data-theme="light"] [style*=";fill:#fff"] { fill: #1b1b1d !important; }
[data-theme="light"] [style^="fill:#ffffff"], [data-theme="light"] [style*=";fill:#ffffff"] { fill: #1b1b1d !important; }
[data-theme="light"] [style^="fill:#cccccc"], [data-theme="light"] [style*=";fill:#cccccc"] { fill: #3a3a3a !important; }
[data-theme="light"] [style^="fill:#3d3d3d"], [data-theme="light"] [style*=";fill:#3d3d3d"] { fill: #c6c6c8 !important; }
[data-theme="light"] [style^="fill:#363636"], [data-theme="light"] [style*=";fill:#363636"] { fill: #cfcfd1 !important; }
[data-theme="light"] [style^="fill:#2c2c2c"], [data-theme="light"] [style*=";fill:#2c2c2c"] { fill: #d6d6d8 !important; }
[data-theme="light"] [style^="fill:#5c5c5c"], [data-theme="light"] [style*=";fill:#5c5c5c"] { fill: #a9a9ab !important; }
[data-theme="light"] [style^="fill:#0c0c12"], [data-theme="light"] [style*=";fill:#0c0c12"] { fill: #ffffff !important; }
[data-theme="light"] [style^="fill:#e8e27a"], [data-theme="light"] [style*=";fill:#e8e27a"] { fill: #b39b00 !important; }
[data-theme="light"] [style^="fill:#7dd3fc"], [data-theme="light"] [style*=";fill:#7dd3fc"] { fill: #1f86c2 !important; }
[data-theme="light"] [style^="fill:#999999"], [data-theme="light"] [style*=";fill:#999999"] { fill: #6f6f6f !important; }

/* ------------------------------------------------------------ settings */
.nav .nav-btn {
  display: flex; align-items: center; gap: 14px; padding: 11px 19px; margin: 1px 6px 6px; border-radius: var(--r-md); color: var(--text-3);
  font-size: 14px; border-left: 3px solid transparent; text-align: left; white-space: nowrap;
}
.nav .nav-btn svg { width: 16px; height: 16px; flex: none; transition: transform .3s ease; }
.nav .nav-btn span { opacity: 0; transition: opacity .12s ease; }
.nav:hover .nav-btn span { opacity: 1; transition-delay: .08s; }
.nav .nav-btn:hover, .nav .nav-btn.on { color: var(--text); background: rgba(var(--ink), .06); }
.nav .nav-btn.on svg { transform: rotate(60deg); }
.set-pop {
  position: fixed; left: 80px; bottom: 18px; z-index: 60; width: 300px; padding: 14px 14px 12px; display: none;
  background: rgba(var(--deep), .78); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  -webkit-backdrop-filter: blur(26px) saturate(150%); backdrop-filter: blur(26px) saturate(150%);
  box-shadow: var(--glass-edge), 0 24px 60px -12px rgba(0,0,0,.45);
}
[data-theme="light"] .set-pop { box-shadow: var(--glass-edge), 0 24px 60px -12px rgba(30,30,40,.25); }
.set-pop.open { display: block; animation: set-in .16s ease; }
@keyframes set-in { from { opacity: 0; transform: translateY(6px); } }
.set-pop h5 { margin: 0 0 12px; font-size: 13.5px; display: flex; justify-content: space-between; align-items: center; }
.set-pop h5 button { color: var(--text-3); font-size: 16px; line-height: 1; padding: 2px 4px; }
.set-pop h5 button:hover { color: var(--text); }
.set-lbl { font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.set-themes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.set-theme { border-radius: var(--r-md); padding: 6px; border: 1px solid var(--line); text-align: left; transition: border-color .15s, background .15s; }
.set-theme:hover { background: var(--hover); }
.set-theme.on { border-color: var(--text-2); box-shadow: inset 0 0 0 1px var(--text-2); }
.set-theme .pv { height: 58px; border-radius: 5px; position: relative; overflow: hidden; display: grid; grid-template-columns: 12px 1fr; gap: 4px; padding: 5px; }
.set-theme .pv i { border-radius: 3px; display: block; }
.set-theme .pv b { display: grid; grid-template-rows: 1fr 1.6fr; gap: 4px; }
.set-theme.dark .pv { background: radial-gradient(80px 50px at 20% 0%, #2a2a2a, transparent), #050505; }
.set-theme.dark .pv i, .set-theme.dark .pv b i { background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.set-theme.light .pv { background: radial-gradient(80px 50px at 20% 0%, #fff, transparent), #dedfe2; }
.set-theme.light .pv i, .set-theme.light .pv b i { background: rgba(255,255,255,.75); box-shadow: inset 0 0 0 1px rgba(0,0,0,.07); }
.set-theme span { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 12.5px; padding: 8px 2px 2px; }
.set-theme span::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--text-3); box-sizing: border-box; }
.set-theme.on span::before { border: 4px solid var(--text); }
.set-note { margin-top: 10px; font-size: 11.5px; color: var(--text-3); }
[data-theme="light"] .end-tag rect[fill="#f4f4f6"] + text, [data-theme="light"] .end-tag rect[fill="#ffffff"] + text { fill: #fff !important; }

/* performance auto-slide: a 3 s progress line under the active portfolio */
.pf-seg.auto button.on { position: relative; overflow: hidden; }
.pf-seg.auto button.on::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--text-2); transform-origin: left; animation: pf-slide 3s linear forwards; }
@keyframes pf-slide { from { transform: scaleX(0); } }

/* ------------------------------------------------------------ dashboard right column: trading calendar + news impact */
.dash-right { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.dash-right > .panel { flex: none; }
.dash-right > .dash-news { flex: 1 1 0; min-height: 260px; }
.dc-nav { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.dc-nav b { min-width: 92px; text-align: center; font-weight: 600; }
.dc-nav button { width: 26px; height: 26px; border-radius: var(--r-sm); font-size: 18px; line-height: 1; color: var(--text-2); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.dc-nav button:hover:not(:disabled) { color: var(--text); background: var(--hover); }
.dc-nav button:disabled { opacity: .3; cursor: default; }
.dc-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-bottom: 10px; }
.dc-sum > div { background: rgba(var(--well), .26); padding: 7px 10px; }
.dc-sum span { display: block; font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--text-3); }
.dc-sum b { font-size: 14.5px; font-weight: 600; }
.dc-sum em { font-style: normal; }
.dc-grid { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; margin: -3px; width: calc(100% + 6px); }
.dc-grid th { font-size: 10.5px; font-weight: 500; color: var(--text-3); text-align: left; padding: 0 6px 2px; }
.dc-grid th:last-child { text-align: right; }
.dc-d, .dc-w { height: 40px; vertical-align: top; padding: 4px 6px; border-radius: 5px; position: relative; font-variant-numeric: tabular-nums; }
.dc-d { background: rgba(var(--ink), .025); box-shadow: inset 0 0 0 1px rgba(var(--ink), .04); }
.dc-d span { font-size: 10.5px; color: var(--text-3); }
.dc-d b { position: absolute; left: 6px; bottom: 4px; font-size: 11.5px; font-weight: 600; }
.dc-d i { position: absolute; right: 5px; top: 4px; font-style: normal; font-size: 9.5px; color: var(--text-3); }
.dc-d.we { background: transparent; box-shadow: none; }
.dc-d.out { opacity: .3; background: transparent; box-shadow: none; }
.dc-d.has { cursor: default; }
.dc-d.has span { color: var(--text-2); }
.dc-d.today { box-shadow: inset 0 0 0 1.5px var(--text-2); }
.dc-w { text-align: right; border-left: 1px solid var(--line); border-radius: 0; }
.dc-w b { display: block; font-size: 11.5px; font-weight: 600; margin-top: 4px; }
.dc-w i { font-style: normal; font-size: 9.5px; color: var(--text-3); }
.dash-news .mf-scroll { margin-top: 2px; }
.dn-top { padding: 0 16px 10px; }
.dn-tiles { display: grid; grid-template-columns: 1fr 1.25fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.dn-tiles > div { background: rgba(var(--well), .26); padding: 8px 10px; min-width: 0; }
.dn-tiles span { display: block; font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--text-3); }
.dn-tiles b { display: block; font-size: 16px; font-weight: 600; margin: 2px 0 1px; white-space: nowrap; }
.dn-tiles b em { font-style: normal; font-size: 12px; font-weight: 600; }
.dn-tiles b .mf-ccy { vertical-align: 2px; }
.dn-tiles b #dnCount { font-size: 16px; font-variant-numeric: tabular-nums; }
.dn-tiles small { display: block; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dn-book { margin-top: 8px; font-size: 11.5px; color: var(--text-3); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.dash-news .mf-ev td { padding: 7px 6px; }
.dc-chart { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.dc-chart-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; font-size: 12.5px; font-weight: 600; }
.dc-chart-h small { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; color: var(--text-3); }
.dc-chart-h small b { margin-left: 4px; font-size: 12px; }
.dc-chart-h i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-left: 6px; }
.dc-chart-h i.w { background: var(--green); } .dc-chart-h i.c { height: 2px; background: var(--text); }
.dc-chart svg { display: block; width: 100%; overflow: visible; }
.dc-bar.w { fill: var(--green); opacity: .55; } .dc-bar.l { fill: var(--red); opacity: .55; }
.dc-bar.hl { opacity: 1; }
.dc-area.w { fill: var(--green); opacity: .08; } .dc-area.l { fill: var(--red); opacity: .08; }
.dc-cum { fill: none; stroke: var(--text); stroke-width: 1.6; stroke-linejoin: round; }
.dc-end { fill: var(--text); }
.dc-hit { fill: transparent; }
.dc-hit.hl { fill: rgba(var(--ink), .06); }
.dc-d.hl { box-shadow: inset 0 0 0 1.5px var(--text); }

/* ------------------------------------------------------------ password gate */
.gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; overflow: auto;
  background: rgba(var(--deep), .9); -webkit-backdrop-filter: blur(30px) saturate(140%); backdrop-filter: blur(30px) saturate(140%); }
.unlocked .gate { display: none; }
html:not(.unlocked) body { overflow: hidden; }
.gate-box { width: min(980px, 100%); text-align: center; padding: 22px 24px 20px; border-radius: var(--r-lg); border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(var(--ink), .045), rgba(var(--ink), .015)); box-shadow: var(--glass-edge), var(--glass-drop); }
.gate-stage { position: relative; aspect-ratio: 1334 / 550; margin: 0 auto 14px; display: grid; place-items: center; border-radius: var(--r-md); overflow: hidden;
  transition: background .25s ease; }
.gate-art { margin: 0; font-family: var(--mono); font-size: calc(min(932px, 100vw - 82px) / 172); line-height: 1.29; /* the video's row pitch, so the swap does not jump */ letter-spacing: 0;
  color: var(--text); text-align: left; width: max-content; max-width: 100%; overflow: hidden; user-select: none; transition: opacity .25s ease; }
.gate-vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .25s ease; pointer-events: none; }
.gate-name { font-size: 24px; margin-bottom: 4px; }
.gate-name .logo-name, .gate-name .logo-term { font-size: 24px; }
.gate p { margin: 0 0 14px; color: var(--text-3); font-size: 13px; }
.gate-row { display: flex; gap: 8px; max-width: 360px; margin: 0 auto; }
.gate-row input { flex: 1; min-width: 0; background: rgba(var(--well), .3); border: 1px solid var(--line-2); border-radius: var(--r-md); color: var(--text);
  font: inherit; padding: 10px 12px; outline: none; }
.gate-row input:focus { border-color: var(--text-3); box-shadow: 0 0 0 3px rgba(var(--ink), .08); }
.gate-row .btn-light { padding: 10px 18px; }
.gate-box.shake { animation: dvshake .35s; }

/* unlock sequence: .go (password accepted) -> .playing (art crossfades into the animation, the screen goes to the
   video's own black) -> .out (quick fade to the dashboard) */
.gate, .gate-box, .gate-name, .gate p, .gate-row, .gate .dv-err { transition: background .3s ease, border-color .3s ease, box-shadow .3s ease, opacity .25s ease; }
.gate.go .gate-name, .gate.go p, .gate.go .gate-row, .gate.go .dv-err { opacity: 0; }
/* the video's first frame is the resting image (it is the frame the ASCII text was taken from): once it has loaded it
   replaces the text, and the unlock just starts it. Black on white in light mode (gate.mp4, multiplied so the white
   melts into the glass), white on black in dark mode (gate-dark.mp4, screened so the black does) */
.gate-stage.ready .gate-art { opacity: 0; }
.gate-stage.ready .gate-vid { opacity: 1; }
.gate-vid { mix-blend-mode: screen; }
[data-theme="light"] .gate-vid { mix-blend-mode: multiply; }
.gate.playing .gate-art { opacity: 0; }
.gate.playing .gate-vid { opacity: 1; }
.gate.out { opacity: 0; transition: opacity .45s ease; }
.gate.go ~ .app { transform: scale(.985); }
.gate.out ~ .app { transform: none; transition: transform .45s ease; }

/* portfolio page: frontier + allocation share one card; viability sits beside it */
.pa-subhead { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 14px; }
/* the viability card runs to the bottom of the frontier + allocation card; height 0 + min-height 100% keeps it from
   growing the row when expanded, so its list scrolls inside instead */
.pa-viab-card, .pa-rc-card { height: 0; min-height: 100%; }
.pa-rc-card .sv-body { flex: 1 1 0; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.pa-rc-fold { margin: 2px 0 2px 12px; white-space: nowrap; width: max-content; display: flex; }
.sv-body .pa-rc-fold svg { width: 10px; display: inline; } /* not the full-width chart rule for .sv-body svg */
.pa-viab-card .sv-body { flex: 1 1 0; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.pa-viab-card .sv-body > div { overflow: visible !important; }
.pa-viab-card .pa-table th { position: sticky; top: 0; z-index: 2; }
.pa-viab-card .pa-table td { padding: 8px 8px; }
.pa-viab-card .pa-table th { padding: 9px 8px; }
.pa-viab-card .pa-vt td:nth-child(4) { padding-right: 8px; }
.pa-viab-card .pa-vt td:nth-child(2) { padding-right: 52px; width: 100%; }
.pa-viab-card .pa-forest { width: auto; min-width: 110px; }
.pa-viab-card .bl-sn { display: inline-block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.pa-vr { cursor: default; }
.nav #logoutBtn:hover { color: var(--red); }

/* dashboard blotter: LONG / SHORT as clear glass pills in black and white; LONG has a filled dot, SHORT a hollow one */
.col-center .side { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 58px; padding: 3px 8px 3px 7px;
  font-size: 10px; font-weight: 700; letter-spacing: .6px; border-radius: 999px; color: var(--text);
  background: linear-gradient(180deg, rgba(var(--ink), .07), rgba(var(--ink), .02));
  box-shadow: inset 0 0 0 1px rgba(var(--ink), .16), inset 0 1px 0 rgba(255,255,255,.12);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.col-center .side::before { content: ""; width: 5px; height: 5px; border-radius: 50%; box-sizing: border-box; }
.col-center .side.BUY::before { background: var(--text); }
.col-center .side.SELL { color: var(--text-2); background: transparent; }
.col-center .side.SELL::before { border: 1.2px solid var(--text-2); }
[data-theme="light"] .col-center .side { box-shadow: inset 0 0 0 1px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.9); }

/* positions page: calendar + P&L timeline side by side */
.op-top { margin-bottom: 10px; }
.op-top .op-cal { margin-bottom: 0; }
.op-top .op-cal > .sv-body { justify-content: flex-start; }
#opCal rect.cal { cursor: pointer; }
.tl-chart svg { touch-action: pan-y; user-select: none; } /* vertical swipes still scroll the page; sideways drags select */
.tl-up { fill: var(--green); opacity: .75; } .tl-dn { fill: var(--red); opacity: .75; }
.tl-area { fill: rgba(var(--ink), .05); } .tl-line { fill: none; stroke: var(--text); stroke-width: 1.5; stroke-linejoin: round; }
.tl-sel { fill: rgba(var(--ink), .08); stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.tl-drag { fill: rgba(var(--ink), .1); pointer-events: none; }
.tl-break { margin: 0 16px 14px; }
.tl-sum { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 2px 2px 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.tl-sum span { display: block; font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--text-3); }
.tl-sum b { font-size: 13.5px; font-weight: 600; }
.tl-sum em { font-style: normal; font-weight: 500; font-size: 11.5px; }
.tl-sum .bl-fold { margin-left: -10px; }
.tl-cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; }
.tl-st { display: grid; grid-template-columns: minmax(0, 1.3fr) 1fr 74px 30px; align-items: center; gap: 8px; font-size: 12px; padding: 3px 0; }
.tl-st span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-st .pf-dot { margin-right: 6px; }
.tl-st b { text-align: right; font-weight: 600; } .tl-st em { font-style: normal; color: var(--text-3); font-size: 10.5px; text-align: right; }
.tl-st.more span { color: var(--text-3); }
.tl-tr { display: grid; grid-template-columns: 66px minmax(0, 1fr) auto 72px; align-items: center; gap: 8px; font-size: 12px; padding: 4px 0; border-top: 1px solid rgba(var(--ink), .05); }
.tl-tr:first-of-type { border-top: 0; }
.tl-tr .tl-tn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .tl-tr .tl-tn i { font-style: normal; color: var(--text-3); margin-left: 4px; }
.tl-tr .muted { font-size: 11px; white-space: nowrap; } .tl-tr b { text-align: right; font-weight: 600; }
.tl-none { font-size: 12px; padding: 4px 0; }
#positionsView .tl-break .side { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 58px; padding: 3px 8px 3px 7px; font-size: 10px; font-weight: 700;
  letter-spacing: .6px; border-radius: 999px; color: var(--text); background: linear-gradient(180deg, rgba(var(--ink), .07), rgba(var(--ink), .02)); box-shadow: inset 0 0 0 1px rgba(var(--ink), .16); }
#positionsView .tl-break .side::before { content: ""; width: 5px; height: 5px; border-radius: 50%; box-sizing: border-box; }
#positionsView .tl-break .side.BUY::before { background: var(--text); }
#positionsView .tl-break .side.SELL { color: var(--text-2); background: transparent; }
#positionsView .tl-break .side.SELL::before { border: 1.2px solid var(--text-2); }

/* ------------------------------------------------------------ phone */
.set-mobile { display: none; }
@media (max-width: 1180px) {  .app { padding: 0 10px 84px !important; gap: 10px; }
  /* the side rail becomes a bottom tab bar: icon + short label; Data and Log out move into the More sheet */
  .nav, .nav:hover { display: flex !important; position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; height: auto; z-index: 40; flex-direction: row;
    justify-content: space-around; align-items: stretch; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-radius: 0; overflow: visible;
    background: rgba(var(--deep), .82); -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
    box-shadow: 0 -1px 0 var(--line), 0 -10px 30px -12px rgba(0,0,0,.25); }
  .nav a, .nav .nav-btn { flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; gap: 3px; margin: 0 1px; padding: 6px 0 4px; border: 0; border-radius: 10px; }
  .nav a::after, .nav .nav-btn::after { content: attr(data-short); font-size: 9.5px; font-weight: 600; letter-spacing: .1px; white-space: nowrap; }
  .nav a span, .nav .nav-btn span, .nav .spacer, .nav .card, .nav .user, #logoutBtn, .nav a[data-view="data"] { display: none !important; }
  .nav a svg, .nav .nav-btn svg { width: 18px; height: 18px; }
  .nav a.on { box-shadow: none; }
  .set-mobile { display: grid; gap: 6px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
  .set-link { display: block; padding: 10px 12px; border-radius: var(--r-md); background: rgba(var(--ink), .04); color: var(--text); text-decoration: none; font-weight: 600; text-align: left; }
  #logoutBtn2 { color: var(--red); }
  .set-pop { left: 10px; right: 10px; width: auto; bottom: calc(76px + env(safe-area-inset-bottom)); }

}
@media (max-width: 760px) {
  /* top bar: logo + range on one line, the account chips as one swipeable row */
  .top { gap: 8px; padding: 10px 0 2px; }
  .logo { padding-left: 2px; margin-right: auto; }
  .logo-name, .logo-term { font-size: 19px !important; }
  .top > .preset { display: none; }
  .chips { order: 3; flex: 1 1 100%; flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }

  /* rows of tabs scroll sideways instead of wrapping or overflowing */
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
  .seg::-webkit-scrollbar { display: none; }
  .pf-seg { flex-wrap: nowrap !important; }
  .panel-head { flex-wrap: wrap; row-gap: 8px; padding: 12px 12px 8px; }
  .panel-pad { padding: 0 12px 12px; flex-wrap: wrap; gap: 6px; }
  .sv-card-head { padding: 12px 12px 8px; }
  .sv-card-head small { margin-left: 0; flex-basis: 100%; }
  .sv-body, .mf-scroll, .blotter-body, .chart-wrap { margin-left: 10px; margin-right: 10px; }
  .tl-break { margin: 0 10px 12px; }
  .sv-head { padding: 14px 14px; gap: 12px; }
  .sv-title h1 { font-size: 20px; }
  .sv-controls { width: 100%; }
  .sv-controls > * { max-width: 100%; }
  .sb-search { width: 100% !important; }
  .stats-view { min-width: 0; }

  /* dashboard */
  .perf { min-height: 360px; }
  .chart-wrap { min-height: 260px; }
  .dash-right > .dash-news { min-height: 420px; flex: none; }
  .dash-news .mf-scroll { max-height: 420px; }
  .dc-d b { font-size: 10px; } .dc-d i { display: none; } .dc-d, .dc-w { height: 38px; padding: 3px 4px; }
  .dc-sum { grid-template-columns: repeat(2, 1fr); }
  .dn-tiles { grid-template-columns: 1fr; }

  /* tiles two per row; wide tables scroll inside their card */
  .sb-tiles, .mf-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .sb-row { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .pa-table, .mf-table, .op-table, table.grid { min-width: 100%; }
  .sv-body > div[style*="overflow-x"], .op-table-wrap { overflow-x: auto; }
  .mf-scroll { overflow-x: auto; }
  .mf-table { min-width: 520px; }
  .dash-news .mf-table { min-width: 460px; }
  .mf-card { height: 560px; }
  .tl-cols { grid-template-columns: 1fr; gap: 14px; }
  .tl-sum { gap: 14px; }
  .pa-viab-card, .pa-rc-card { height: auto; min-height: 0; }
  .pa-viab-card .sv-body, .pa-rc-card .sv-body { flex: none; max-height: 560px; }
  .blc-r { flex-basis: 100%; }

  /* password screen */
  .gate-box { padding: 16px 12px 14px; }
  .gate-art { font-size: calc((100vw - 58px) / 172); }
  .gate-row { max-width: none; }
}
