/* AlgoGrowMore console look: fixed left sidebar, sticky top bar, MTM cards, one ledger per account. Dark only. */
[hidden] { display: none !important; }
:root {
  color-scheme: dark;
  --bg: #070d1a; --side: #0a1222; --card: #0e1729; --card2: #111c31; --line: #1e2a42; --line2: #26344f;
  --ink: #e8eef8; --muted: #8392ab; --dim: #5d6a83;
  --blue: #3b82f6; --blue-soft: #13284d; --green: #22c55e; --green-soft: #0f2e1d;
  --red: #f0506e; --red-soft: #3a1524; --amber: #f5a524; --amber-soft: #3a2a0c; --brand: #7ed321; --blue-light: #4f8dff;
  --font: "Outfit", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 14px/1.45 var(--font); font-variant-numeric: tabular-nums; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
a { color: #7fb0ff; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100%; }

/* sidebar */
aside { background: var(--side); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px 14px; }
.logo { padding: 4px 10px 16px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.logo b { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; display: block; line-height: 1; }
.logo b span { color: var(--brand); }
.logo small { font-size: 8.5px; letter-spacing: .2em; white-space: nowrap; color: var(--muted); display: block; margin-top: 4px; }
.logo .brandimg { display: block; height: 36px; max-width: 100%; width: auto; object-fit: contain; }
.navs { overflow: auto; flex: 1; display: grid; align-content: start; gap: 2px; }
.navs h6 { margin: 14px 10px 4px; font-size: 11px; letter-spacing: .14em; color: var(--muted); font-weight: 600; }
.navs a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; color: #c6d0e0; text-decoration: none; font-weight: 600; font-size: 15px; border: 1px solid transparent; }
.navs a svg { width: 19px; height: 19px; flex: none; }
.navs a:hover { background: #0f1a2e; }
.navs a[aria-current="page"] { background: var(--blue-soft); border-color: #23406f; color: #fff; box-shadow: inset 3px 0 0 var(--blue); }
.navs a.soon { color: var(--dim); }
.navs a.soon em { margin-left: auto; font-style: normal; font-size: 9.5px; letter-spacing: .12em; border: 1px solid var(--line2); border-radius: 99px; padding: 1px 7px; }
.feed { margin-top: 10px; border: 1px solid var(--line2); border-radius: 99px; padding: 6px 12px; font-size: 11.5px; letter-spacing: .1em; font-weight: 700; color: var(--green); display: flex; align-items: center; gap: 8px; }
.feed.off { color: var(--muted); }
svg.i { stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 10px 28px; min-height: 66px; }
.ticks { display: flex; overflow-x: auto; min-width: 0; }
.tk { padding: 0 18px; border-right: 1px solid var(--line2); white-space: nowrap; }
.tk:first-child { padding-left: 0; }
.tk .n { font-size: 10.5px; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.tk .v { font-weight: 600; font-size: 15px; }
.top .sp { flex: 1; }
.tmtm { text-align: right; white-space: nowrap; }
.tmtm .n { font-size: 10.5px; letter-spacing: .14em; color: var(--muted); font-weight: 600; }
.tmtm .v { font-size: 13px; letter-spacing: .08em; font-weight: 600; }
.avatar { width: 44px; height: 44px; border-radius: 10px; background: var(--blue); display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; border: 0; }
.menu { position: relative; }
.menu .pop { position: absolute; right: 0; top: 52px; background: var(--card); border: 1px solid var(--line2); border-radius: 10px; padding: 6px; min-width: 190px; box-shadow: 0 14px 40px rgb(0 0 0 / .5); }
.menu .pop div { padding: 8px 10px; color: var(--muted); font-size: 13px; }
.menu .pop button { width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 7px; font-weight: 600; }
.menu .pop button:hover { background: #0f1a2e; }
.pill { font-size: 11px; font-weight: 700; letter-spacing: .08em; border-radius: 99px; padding: 4px 10px; white-space: nowrap; }
.pill.paper { color: var(--amber); background: var(--amber-soft); }
.pill.live { color: #fff; background: var(--red); }
.pill.halt { color: #1a1200; background: var(--amber); }

/* page */
main { padding: 26px 32px 48px; display: grid; gap: 22px; min-width: 0; align-content: start; }
.head { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.head h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
.head p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.head .sp { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 10px; padding: 4px; gap: 2px; background: var(--card); flex-wrap: wrap; }
.seg button { border: 1px solid transparent; background: none; border-radius: 7px; padding: 7px 14px; font-weight: 600; font-size: 13.5px; color: #c6d0e0; }
.seg button[aria-pressed="true"] { background: var(--blue-soft); border-color: #2b4f88; color: #7fb0ff; }
.btn { border: 1px solid var(--line2); background: var(--card); border-radius: 10px; padding: 10px 16px; font-weight: 700; display: inline-flex; gap: 8px; align-items: center; text-decoration: none; color: var(--ink); }
.btn svg { width: 17px; height: 17px; }
.btn.red { color: var(--red); border-color: #6b2336; background: #170b14; }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.green { color: var(--green); border-color: #1f5a37; background: var(--green-soft); }
.btn.amber { color: var(--amber); border-color: #6a4a12; }
.btn.amber.on { background: var(--amber); color: #1a1200; }
.btn.sm { padding: 6px 12px; border-radius: 8px; font-size: 13px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.mc { background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line2); border-radius: 14px; padding: 26px 28px; box-shadow: inset 3px 0 0 #2b4f88; display: grid; gap: 26px; }
.mc .t { display: flex; align-items: center; gap: 22px; font-size: 13px; letter-spacing: .14em; color: #aab6ca; font-weight: 600; }
.mc .t svg { width: 56px; height: 56px; color: #9fb0c8; stroke-width: 2.4; flex: none; }
.mc .v { font-size: 34px; font-weight: 700; letter-spacing: -0.01em; }
.pos { color: var(--green); } .neg { color: var(--red); }
.ledger { background: var(--card); border: 1px solid var(--line2); border-radius: 14px; overflow: hidden; }
.lh { display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line2); flex-wrap: wrap; }
.crown { width: 44px; height: 44px; border-radius: 10px; background: var(--blue-soft); border: 1px solid #23406f; display: grid; place-items: center; flex: none; color: #8db7ff; }
.crown svg { width: 22px; height: 22px; }
.lh h3 { margin: 0; font-size: 19px; font-weight: 700; }
.lh .k, .k { font-size: 11px; letter-spacing: .12em; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.lh .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.lh .r { margin-left: auto; text-align: right; }
.lh .r .v { font-size: 22px; font-weight: 700; }
.lh .r .s { font-size: 12px; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; border-radius: 99px; padding: 3px 10px; border: 1px solid var(--line2); color: var(--muted); white-space: nowrap; text-transform: uppercase; }
.chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.g { color: var(--green); border-color: #1f5a37; background: var(--green-soft); }
.chip.r { color: var(--red); border-color: #6b2336; background: var(--red-soft); }
.chip.a { color: var(--amber); border-color: #6a4a12; background: var(--amber-soft); }
.chip.b { color: #8db7ff; border-color: #23406f; background: var(--blue-soft); }
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; letter-spacing: .12em; color: #9aa8bf; font-weight: 600; padding: 16px 18px; border-bottom: 1px solid var(--line2); white-space: nowrap; background: #0c1426; text-transform: uppercase; }
td { padding: 16px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 14.5px; }
tr:last-child td { border-bottom: 0; }
td .sym, .sym { font-weight: 700; }
td .sub { font-size: 12px; color: var(--blue); }
td.b { font-weight: 700; }
.x { border: 1px solid #6b2336; color: var(--red); background: #170b14; border-radius: 8px; padding: 8px 14px; font-weight: 700; }
.none { padding: 50px 16px; text-align: center; color: var(--muted); }
.mini { font-size: 12.5px; color: var(--muted); }
.wrap { white-space: normal; min-width: 220px; }
.ob, .panel { background: var(--card); border: 1px solid var(--line2); border-radius: 14px; padding: 18px 22px; }
.ob { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.panel { display: grid; gap: 14px; }
.panel h2 { margin: 0; font-size: 17px; }
label.f { display: grid; gap: 4px; font-size: 11px; letter-spacing: .12em; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.ob input, .ob select, .panel input, .panel select, .cell input, .cell select { background: var(--bg); border: 1px solid var(--line2); border-radius: 8px; padding: 9px 11px; min-width: 0; }
.ob input.n { width: 96px; }
.ob input.w { width: 250px; }
.cell input { width: 84px; padding: 6px 8px; }
.cell input.ip { width: 140px; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; align-items: end; }
.toast { min-height: 20px; color: var(--muted); font-size: 13.5px; flex-basis: 100%; }
.toast.err { color: var(--red); }
.note { color: var(--muted); font-size: 13.5px; max-width: 80ch; margin: 0; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: #c6d0e0; max-width: 85ch; }
code { background: var(--bg); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
canvas { width: 100%; height: 200px; display: block; }
@media (prefers-reduced-motion: no-preference) { tr.flash td { animation: fl 1.4s ease-out; } }
@keyframes fl { from { background: #16305a; } to { background: transparent; } }

/* confirm dialog */
dialog { background: var(--card); color: var(--ink); border: 1px solid var(--line2); border-radius: 14px; padding: 22px; max-width: min(460px, calc(100vw - 32px)); }
dialog::backdrop { background: rgb(2 6 15 / .7); }
dialog p { margin: 0 0 18px; line-height: 1.55; }
dialog .row { display: flex; gap: 10px; justify-content: flex-end; }

/* login */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login .box { width: min(400px, 100%); background: var(--card); border: 1px solid var(--line2); border-radius: 16px; padding: 30px 28px; display: grid; gap: 14px; }
.login form { display: grid; gap: 12px; }
.login input { background: var(--bg); border: 1px solid var(--line2); border-radius: 9px; padding: 11px 12px; }
.login .btn { justify-content: center; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  aside { position: static; height: auto; padding: 12px 16px; }
  .navs { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .navs h6, .navs a.soon, .feed { display: none; }
  .logo { border: 0; margin: 0; padding-bottom: 8px; }
  .top { padding: 10px 16px; flex-wrap: wrap; }
  main { padding: 20px 16px 40px; }
  .mc { padding: 18px; gap: 14px; } .mc .v { font-size: 26px; } .mc .t svg { width: 36px; height: 36px; }
  .ob input.w { width: 100%; }
}
.signout { margin-top: 8px; display: flex; align-items: center; gap: 10px; background: none; border: 0; color: #c6d0e0; padding: 10px 12px; font-weight: 600; font-size: 15px; border-radius: 9px; }
.signout svg { width: 19px; height: 19px; }
.signout:hover { background: #0f1a2e; }
.mc .mini { margin-top: 4px; font-size: 14px; }
@media (max-width: 900px) { .signout { display: none; } }
.sw { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line2); border-radius: 99px; padding: 4px 10px 4px 4px; background: var(--bg); font-weight: 700; font-size: 12px; color: var(--muted); }
.sw i { width: 30px; height: 18px; border-radius: 99px; background: var(--line2); position: relative; }
.sw i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #c6d0e0; transition: left .15s; }
.sw[aria-checked="true"] { color: var(--green); }
.sw[aria-checked="true"] i { background: var(--green); }
.sw[aria-checked="true"] i::after { left: 15px; background: #fff; }
.pw { display: flex; gap: 6px; min-width: 0; } .pw input { flex: 1; min-width: 0; width: 100%; } .pw .btn { flex: none; }
label.f { min-width: 0; }
.ipgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 16px; }
.ipcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; padding: 18px 22px; }
.ipv { margin-top: 10px; font-size: 18px; font-weight: 700; }
.strat { border-top: 2px solid var(--blue); display: flex; flex-direction: column; }
.strat .tag { font-size: 11px; letter-spacing: .12em; color: #7fb0ff; font-weight: 700; text-transform: uppercase; }
.sgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line2); }
.sgrid > div { padding: 14px 16px; border-right: 1px solid var(--line2); min-width: 0; } .sgrid > div:last-child { border-right: 0; }
.sgrid .mini { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv { font-size: 20px; font-weight: 700; margin-top: 4px; }
.pgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 16px 20px 0; background: var(--card2); border: 1px solid var(--line2); border-radius: 12px; }
.pgrid > div { padding: 14px 16px; border-right: 1px solid var(--line2); min-width: 0; } .pgrid > div:last-child { border-right: 0; }
.act { margin: 14px 20px 0; border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.act svg { width: 22px; height: 22px; color: var(--muted); flex: none; }
.mapbox { margin: 14px 20px 0; border: 1px solid #23406f; background: var(--blue-soft); border-radius: 12px; padding: 12px 14px; display: grid; gap: 10px; }
.mapl { display: flex; flex-wrap: wrap; gap: 8px 16px; } .mapl label { display: flex; gap: 6px; align-items: center; font-weight: 600; }
.sfoot { display: flex; gap: 8px; flex-wrap: wrap; padding: 16px 20px; margin-top: auto; border-top: 1px solid var(--line2); margin-top: 16px; }
@media (max-width: 560px) { .sgrid, .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 22px; }
.gbar .seg { flex-wrap: wrap; }
textarea { font: inherit; color: var(--ink); background: var(--bg); text-transform: none; letter-spacing: normal; font-weight: 400; font-size: 14px; border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; resize: vertical; width: 100%; box-sizing: border-box; }
.ocstat { display: flex; gap: 22px; align-items: center; }
.ocstat b { font-size: 18px; }
table.oc { text-align: center; }
table.oc th, table.oc td { text-align: center; white-space: nowrap; }
table.oc th.ce { color: var(--green); letter-spacing: .14em; } table.oc th.pe { color: var(--red); letter-spacing: .14em; }
table.oc td.strike, table.oc th.strike { background: var(--card2); font-size: 15px; min-width: 90px; }
table.oc tr.atm td.strike { background: var(--blue-soft); color: #9cc3ff; }
table.oc table.half { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.oc table.half td { border: 0; width: 20%; }
table.oc table.half.itm { background: rgba(245, 165, 36, .06); }
table.oc td.oi { position: relative; }
table.oc td.oi span, table.oc td.oi .mini { position: relative; }
.oibar { position: absolute; top: 8px; bottom: 8px; opacity: .22; border-radius: 4px; }
.oibar.ce { right: 4px; background: var(--green); } .oibar.pe { left: 4px; background: var(--red); }
table.oc td.trade { display: flex; gap: 4px; justify-content: center; align-items: center; }

/* strategy card menu, backtest window and report */
.strat .lh .menu .pop { top: 40px; z-index: 6; }
.pop button svg { width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px; }
.pop button:disabled { opacity: .45; cursor: default; }
.modal { position: fixed; inset: 0; background: rgb(2 6 15 / .72); display: grid; place-items: center; z-index: 50; padding: 16px; overflow: auto; }
.modal .box { background: var(--card); border: 1px solid var(--line2); border-radius: 16px; padding: 22px; width: min(860px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.tiles > div { padding: 14px 16px; border-right: 1px solid var(--line2); border-bottom: 1px solid var(--line2); min-width: 0; }
.tiles .sv { font-size: 18px; overflow-wrap: anywhere; }
.logs { max-height: 280px; overflow: auto; font-size: 13px; display: grid; gap: 4px; margin: 8px 0; }
.logs .mini { margin-right: 6px; white-space: nowrap; }
.act.bt.error b { color: var(--red); }
#dlgMsg{white-space:pre-line}
