:root {
  color-scheme:dark;
  --bg:#0b0f14;
  --surface:#121820;
  --panel:#121820;
  --panel-2:#19222d;
  --line:#293442;
  --line-soft:#25303c;
  --text:#f2f5f7;
  --muted:#a5b0bf;
  --muted-2:#a5b0bf;
  --green:#4ed6a0;
  --red:#ff7886;
  --amber:#ebc477;
  --cyan:#63d8c5;
  --blue:#94b9ff;
}
* {
  box-sizing:border-box;
}
html {
  scroll-behavior:smooth;
}
body {
  margin:0;
  background:var(--bg);
  color:var(--text);
  font:14px/1.55 Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
button,input,select {
  font:inherit;
}
button,summary,select {
  cursor:pointer;
}
button,input,select {
  color:inherit;
}
button {
  transition:background .16s,color .16s,border-color .16s;
}
button:focus-visible,a:focus-visible,summary:focus-visible,select:focus-visible,input:focus-visible,canvas:focus-visible {
  outline:2px solid var(--cyan);
  outline-offset:4px;
}
a {
  color:var(--cyan);
}
[hidden] {
  display:none!important;
}
.skip-link {
  position:fixed;
  top:-80px;
  left:16px;
  z-index:100;
  background:var(--panel);
  padding:12px;
}
.skip-link:focus {
  top:12px;
}
.app {
  max-width:1440px;
  margin:auto;
  padding:0 32px 40px 248px;
  min-height:100vh;
}
main:focus {
  outline:none;
}
.topbar {
  min-height:88px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  border-bottom:1px solid var(--line-soft);
}
.brand {
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.mark {
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  color:var(--cyan);
  border:1px solid #31534e;
  border-radius:11px;
  background:#152c29;
  flex-shrink:0;
}
.mark svg {
  width:27px;
  height:27px;
}
.brand h1 {
  font-size:18px;
  font-weight:650;
  margin:0;
  letter-spacing:-.6px;
}
.brand-period {
  color:var(--cyan);
}
.brand small {
  display:block;
  font-size:12px;
  color:var(--muted);
  overflow-wrap:anywhere;
}
.chips {
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.chip,.pill {
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:5px 10px;
  min-height:29px;
  border:1px solid var(--line);
  border-radius:99px;
  background:#19222d;
  font-size:12px;
  font-weight:550;
}
.chip.live {
  color:var(--green);
  background:#152c25;
  border-color:#27483b;
}
.chip.warn {
  color:var(--amber);
  background:#30281c;
  border-color:#53442a;
}
.dot {
  width:6px;
  height:6px;
  background:var(--amber);
  border-radius:50%;
}
.dot.live {
  background:var(--green);
}
.page-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding:30px 0 24px;
}
.eyebrow {
  font-size:12px;
  color:var(--muted);
  font-weight:500;
  margin:0 0 6px;
}
.page-heading h2 {
  font-size:32px;
  line-height:1.2;
  letter-spacing:-1.2px;
  font-weight:600;
  margin:0 0 8px;
}
.page-heading p:last-child {
  margin:0;
  color:var(--muted);
}
.sync-status {
  font-size:12px;
  color:var(--muted);
  text-align:right;
}
.sync-status.stale {
  color:var(--amber);
}
#health-banner {
  padding:14px 18px;
  margin-bottom:18px;
  border:1px solid #65532f;
  background:#282219;
  color:var(--amber);
  border-radius:12px;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
.history-filter {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  margin-bottom:18px;
  color:var(--muted);
  font-size:12px;
}
select,input {
  min-height:44px;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:10px;
  padding:9px 12px;
  max-width:100%;
  min-width:0;
}
.history-filter select {
  max-width:340px;
  font-size:12px;
}
.hero {
  background:radial-gradient(ellipse at 100% 0,rgba(99,216,197,.065),transparent 55%),var(--panel);
  border:1px solid var(--line);
  border-radius:18px;
  padding:26px;
  overflow:hidden;
}
.hero-head {
  display:flex;
  justify-content:space-between;
  gap:18px;
  align-items:flex-start;
}
.equity {
  font-size:46px;
  font-weight:600;
  letter-spacing:-1.8px;
  line-height:1.2;
  font-variant-numeric:tabular-nums;
  overflow-wrap:anywhere;
}
.money-secondary {
  display:block;
  font-size:12px;
  font-weight:400;
  color:var(--muted);
  letter-spacing:0;
  line-height:1.5;
  margin-top:3px;
}
.equity .money-secondary {
  font-size:14px;
  margin-top:7px;
}
.subline {
  color:var(--muted);
  font-size:12px;
  margin-top:12px;
}
.subline .money-secondary {
  display:inline;
  margin-left:5px;
}
.status-stack {
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:8px;
}
.chart-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-top:28px;
}
.chart-heading h3 {
  font-size:14px;
  font-weight:550;
  margin:0;
}
.chart-heading p {
  font-size:12px;
  color:var(--muted);
  margin:3px 0;
}
.chart-key {
  font-size:12px;
  color:var(--cyan);
  white-space:nowrap;
}
.chart-key:before {
  content:'';
  display:inline-block;
  width:14px;
  height:2px;
  background:var(--cyan);
  vertical-align:middle;
  margin-right:7px;
}
.mini-chart {
  height:260px;
  margin-top:12px;
}
canvas {
  display:block;
  width:100%;
  height:100%;
  touch-action:pan-y;
}
.chart-footer {
  display:flex;
  justify-content:space-between;
  gap:12px;
  color:var(--muted);
  font-size:12px;
  min-height:38px;
  padding-top:5px;
}
.kpis {
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  border-top:1px solid var(--line);
  margin-top:16px;
  padding-top:20px;
  gap:18px;
}
.kpis .stat {
  padding:0;
  border:0;
  background:none;
  min-height:0;
}
.stat span {
  display:block;
  font-size:12px;
  color:var(--muted);
}
.stat strong {
  display:block;
  font-size:20px;
  line-height:1.3;
  font-weight:550;
  margin-top:6px;
  font-variant-numeric:tabular-nums;
  overflow-wrap:anywhere;
}
.stat strong .money-secondary {
  font-size:12px;
  font-weight:400;
  margin-top:3px;
}
.section {
  margin-top:28px;
}
.section-title {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin:0 0 12px;
}
.section-title h2 {
  font-size:17px;
  font-weight:550;
  letter-spacing:-.3px;
  margin:0;
}
.section-title small {
  font-size:12px;
  color:var(--muted);
}
.card {
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
}
.card-pad {
  padding:20px;
}
.desktop-grid {
  display:grid;
  grid-template-columns:minmax(0,1.4fr) minmax(280px,1fr);
  gap:24px;
  align-items:start;
}
.grid-2,.grid-3 {
  display:grid;
  gap:12px;
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.grid-3 {
  grid-template-columns:repeat(3,minmax(0,1fr));
}
.stat {
  padding:16px;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:12px;
  min-width:0;
}
.pos {
  padding:20px;
  border-bottom:1px solid var(--line-soft);
}
.pos:last-child {
  border:0;
}
.row {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
}
.symbol {
  font-size:16px;
  font-weight:600;
  letter-spacing:-.3px;
}
.symbol-line {
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.position-pnl {
  text-align:right;
  font-size:20px;
  font-weight:550;
  font-variant-numeric:tabular-nums;
}
.position-pnl small {
  display:block;
  font-size:12px;
  font-weight:400;
  color:var(--muted);
}
.muted {
  color:var(--muted);
}
.green,.money-green {
  color:var(--green);
}
.red,.money-red {
  color:var(--red);
}
.amber {
  color:var(--amber);
}
.meta-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  margin-top:18px;
}
.meta {
  min-width:0;
}
.meta span {
  display:block;
  font-size:12px;
  color:var(--muted);
}
.meta strong {
  font-size:13px;
  font-weight:500;
  display:block;
  margin-top:5px;
  font-variant-numeric:tabular-nums;
  overflow-wrap:anywhere;
}
.position-details {
  margin-top:14px;
}
.position-details summary {
  color:var(--muted);
  font-size:12px;
  min-height:44px;
  display:flex;
  align-items:center;
  gap:8px;
}
.position-details summary:before {
  content:'+';
  font-size:16px;
  color:var(--cyan);
}
.position-details[open] summary:before {
  content:'−';
}
.strategy-head {
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  margin-bottom:18px;
}
.strategy-name {
  font-size:17px;
  font-weight:550;
}
.strategy-head .muted {
  font-size:12px;
  margin-top:4px;
}
.rules {
  display:grid;
  gap:4px;
}
.rule {
  display:flex;
  justify-content:space-between;
  gap:18px;
  padding:12px 0;
  border-top:1px solid var(--line-soft);
  font-size:12px;
}
.rule span {
  color:var(--muted);
}
.rule strong {
  text-align:right;
  font-weight:500;
  overflow-wrap:anywhere;
}
.event {
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:start;
  gap:12px;
  padding:17px 20px;
  border-bottom:1px solid var(--line-soft);
}
.event:last-child {
  border:0;
}
.event-dot {
  height:7px;
  width:7px;
  margin-top:7px;
  border-radius:50%;
  background:var(--amber);
}
.event-dot.green {
  background:var(--green);
}
.event-dot.red {
  background:var(--red);
}
.event-dot.blue {
  background:var(--blue);
}
.event-main strong {
  display:block;
  font-weight:550;
  overflow-wrap:anywhere;
}
.event-main span {
  display:block;
  font-size:12px;
  color:var(--muted);
  margin-top:4px;
  overflow-wrap:anywhere;
}
.event-r {
  font-weight:550;
  font-variant-numeric:tabular-nums;
  text-align:right;
}
.empty {
  color:var(--muted);
  text-align:center;
  padding:40px 20px;
  font-size:14px;
}
.empty:before {
  content:'—';
  display:block;
  color:var(--cyan);
  font-size:28px;
  margin-bottom:8px;
}
.range-filter {
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-top:18px;
}
.range-btn {
  min-width:54px;
  min-height:44px;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:9px;
  color:var(--muted);
  padding:8px 16px;
}
.range-btn.active {
  background:#19332f;
  border-color:#386158;
  color:var(--cyan);
}
.range-btn:hover,.nav-btn:hover {
  background:var(--panel-2);
  color:var(--text);
}
.trade-summary {
  padding:26px;
  border:1px solid #30433f;
  background:linear-gradient(110deg,#172924,var(--panel) 65%);
  border-radius:16px;
}
.trade-summary .value {
  font-size:36px;
  letter-spacing:-1px;
  line-height:1.25;
  font-weight:550;
  font-variant-numeric:tabular-nums;
}
.trade-day {
  margin-top:24px;
}
.trade-day-title {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  font-size:12px;
  color:var(--muted);
  margin-bottom:10px;
}
.trade-filters {
  display:flex;
  gap:14px;
  margin-top:20px;
}
.trade-filters label {
  display:grid;
  gap:6px;
  color:var(--muted);
  font-size:12px;
  flex:1;
}
.trade-table {
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}
.trade-table th {
  text-align:left;
  font-size:12px;
  font-weight:500;
  color:var(--muted);
  padding:14px 18px;
  border-bottom:1px solid var(--line);
}
.trade-table td {
  padding:16px 18px;
  border-bottom:1px solid var(--line-soft);
}
.trade-table tr:last-child td {
  border-bottom:0;
}
.trade-table .numeric {
  text-align:right;
  font-variant-numeric:tabular-nums;
}
.trade-table td small {
  display:block;
  color:var(--muted);
  font-size:12px;
}
.trade-mobile {
  display:none;
}
.panel {
  display:none;
}
.panel.active {
  display:block;
}
.bottom-nav {
  position:fixed;
  left:max(0px,calc((100vw - 1440px)/2));
  top:0;
  bottom:0;
  width:208px;
  border-right:1px solid var(--line);
  padding:30px 16px;
  display:flex;
  flex-direction:column;
  gap:8px;
  background:#0e131a;
  z-index:30;
}
.nav-brand {
  font-size:17px;
  font-weight:600;
  letter-spacing:-.6px;
  padding:0 8px 40px;
  display:flex;
  align-items:center;
}
.nav-monogram {
  color:var(--cyan);
  font-size:25px;
  padding-right:8px;
}
.nav-btn {
  display:flex;
  align-items:center;
  gap:12px;
  min-height:46px;
  padding:12px 14px;
  border:1px solid transparent;
  border-radius:10px;
  background:transparent;
  color:var(--muted);
  font-size:13px;
  text-align:left;
  font-weight:500;
}
.nav-btn.active {
  color:var(--cyan);
  background:#172b29;
  border-color:#29443e;
}
.nav-icon,.nav-icon svg {
  width:20px;
  height:20px;
  display:block;
  flex-shrink:0;
}
.nav-icon svg {
  fill:none;
  stroke:currentColor;
  stroke-width:1.6;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.nav-footer {
  margin-top:auto;
  padding:20px 8px 0;
  display:grid;
  gap:4px;
  font-size:12px;
  color:var(--muted);
}
.nav-footer .eyebrow {
  color:var(--text);
}
.nav-readonly {
  margin-top:12px;
  font-size:11px;
}
.log-disclosure {
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--panel);
}
.log-disclosure summary {
  padding:18px;
  font-size:16px;
}
.log-disclosure summary span {
  font-size:12px;
  color:var(--muted);
  margin-left:12px;
}
.logs {
  height:300px;
  overflow:auto;
  padding:18px;
  background:#080d12;
  color:var(--muted);
  font:12px/1.6 Consolas,monospace;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  border-radius:0 0 14px 14px;
}
#risk-grid,#health-grid {
  grid-template-columns:repeat(3,minmax(0,1fr));
}
.preview-notice {
  background:#19332f;
  color:var(--cyan);
  padding:10px 16px;
  font-size:12px;
  text-align:center;
}
@media(min-width:1100px) {
  .topbar .brand h1 {
    font-size:15px;
  }
  .topbar .mark {
    display:none;
  }
  .history-filter {
    margin-top:-4px;
  }
}
@media(max-width:1099px) {
  .app {
    padding:0 24px calc(100px + env(safe-area-inset-bottom));
    max-width:1000px;
  }
  .bottom-nav {
    left:50%;
    transform:translateX(-50%);
    top:auto;
    bottom:0;
    width:100%;
    max-width:1000px;
    flex-direction:row;
    justify-content:space-around;
    padding:8px 16px calc(8px + env(safe-area-inset-bottom));
    border:0;
    border-top:1px solid var(--line);
    background:rgba(14,19,26,.97);
    backdrop-filter:blur(16px);
  }
  .nav-brand,.nav-footer {
    display:none;
  }
  .nav-btn {
    flex:1;
    flex-direction:column;
    gap:4px;
    justify-content:center;
    padding:8px 4px;
    font-size:12px;
  }
  .desktop-grid {
    grid-template-columns:minmax(0,1.3fr) minmax(260px,1fr);
    gap:18px;
  }
  .kpis {
    grid-template-columns:repeat(3,minmax(0,1fr));
    row-gap:20px;
  }
  .equity {
    font-size:42px;
  }
}
@media(max-width:699px) {
  .app {
    padding-left:16px;
    padding-right:16px;
  }
  .topbar {
    min-height:84px;
    gap:10px;
  }
  .brand h1 {
    font-size:17px;
  }
  .brand small {
    max-width:190px;
  }
  .chips {
    gap:5px;
  }
  .chip {
    font-size:11px;
    padding:4px 8px;
  }
  .mark {
    display:none;
  }
  .page-heading {
    padding:24px 0 18px;
    align-items:flex-start;
    gap:12px;
  }
  .page-heading h2 {
    font-size:28px;
  }
  .page-heading p:last-child {
    font-size:12px;
    max-width:250px;
  }
  .page-heading .eyebrow {
    display:none;
  }
  .sync-status {
    max-width:95px;
    font-size:11px;
  }
  .history-filter {
    justify-content:space-between;
    gap:8px;
  }
  .history-filter label {
    white-space:nowrap;
  }
  .history-filter select {
    width:225px;
  }
  .hero {
    padding:20px 16px;
    border-radius:16px;
  }
  .hero-head {
    gap:10px;
  }
  .equity {
    font-size:34px;
    letter-spacing:-1.2px;
  }
  .status-stack {
    max-width:115px;
    gap:6px;
  }
  .pill {
    font-size:11px;
    padding:4px 8px;
    white-space:normal;
  }
  .chart-heading {
    margin-top:24px;
  }
  .chart-heading p {
    font-size:11px;
    max-width:230px;
  }
  .chart-key {
    display:none;
  }
  .mini-chart {
    height:180px;
  }
  .chart-footer {
    flex-direction:column;
    gap:4px;
    font-size:11px;
    min-height:48px;
  }
  .kpis {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:18px;
  }
  .stat strong {
    font-size:19px;
  }
  .desktop-grid {
    display:block;
  }
  .section {
    margin-top:24px;
  }
  .section-title h2 {
    font-size:16px;
  }
  .pos {
    padding:16px;
  }
  .meta-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .position-pnl {
    font-size:18px;
  }
  .row {
    gap:10px;
  }
  .event {
    padding:16px;
    gap:10px;
  }
  .event-r {
    font-size:13px;
  }
  .range-filter {
    display:grid;
    grid-template-columns:repeat(6,minmax(0,1fr));
    gap:5px;
  }
  .range-btn {
    min-width:0;
    padding:8px 0;
    font-size:12px;
  }
  .trade-summary {
    padding:22px;
  }
  .trade-summary .value {
    font-size:32px;
  }
  .trade-table {
    display:none;
  }
  .trade-mobile {
    display:block;
  }
  .bottom-nav {
    gap:2px;
    padding-left:8px;
    padding-right:8px;
  }
  .nav-btn {
    font-size:11px;
    min-height:56px;
  }
  .nav-icon,.nav-icon svg {
    width:19px;
    height:19px;
  }
  #risk-grid,#health-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .log-disclosure summary span {
    display:block;
    margin:5px 0 0;
  }
  .trade-filters {
    gap:10px;
  }
  .trade-filters input,.trade-filters select {
    width:100%;
  }
  .trade-day-title {
    align-items:flex-start;
  }
}
@media(prefers-reduced-motion:reduce) {
  html {
    scroll-behavior:auto;
  }
  *,*:before,*:after {
    transition:none!important;
    animation:none!important;
  }
}
.unit {
  font-size:.6em;
  font-weight:450;
  letter-spacing:0;
  color:var(--muted);
}
.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
.kpis {
  grid-template-columns:repeat(4,minmax(0,1fr));
}
.stat strong .unit {
  display:inline;
  font-size:.65em;
}
@media(max-width:699px) {
  .hero-head {
    display:block;
  }
  .status-stack {
    flex-direction:row;
    max-width:none;
    align-items:center;
    margin-top:14px;
  }
  .status-stack .pill {
    white-space:nowrap;
  }
  .kpis {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .hero .subline {
    display:none;
  }
  .hero .chart-heading {
    margin-top:18px;
  }
}
.row>div {
  min-width:0;
}
.symbol {
  overflow-wrap:anywhere;
}
.position-pnl {
  max-width:55%;
  overflow-wrap:anywhere;
}
.trade-table {
  table-layout:fixed;
}
.trade-table td {
  overflow-wrap:anywhere;
}
#account-chip {
  max-width:160px;
  overflow-wrap:anywhere;
}
.nav-brand .brand-period {
  margin-left:0;
}
