:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text: #0f1419;
  --muted: #536471;
  --blue: #1d9bf0;
  --line: #e6ecf0;
  --surface: #fff;
  --soft: #f7f9f9;
  --green: #008f63;
  --red: #d51d2a;
  background: #fff;
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: #fff; }
main { max-width: 1320px; margin: 0 auto; padding: 30px 24px 64px; }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.masthead { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 0 0 24px; }
.brand { display: flex; align-items: center; gap: 17px; }
.brand-mark { display: grid; place-items: center; width: 61px; height: 61px; border: 1px solid #bddff4; border-radius: 18px; color: var(--blue); background: #eff8ff; }
.brand-mark .icon { width: 37px; height: 37px; stroke-width: 1.45; }
h1 { margin: 0 0 6px; font-size: 34px; line-height: 1.2; font-weight: 760; letter-spacing: -.035em; }
h1 span { margin-left: 7px; color: #304451; font-size: 25px; font-weight: 560; letter-spacing: 0; }
h2 { margin: 0; font-size: 17px; font-weight: 700; }
.subhead, .muted, .fineprint, footer { color: var(--muted); }
.subhead { margin: 0; font-size: 14px; }
.status-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; font-size: 12px; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid #cce9da; border-radius: 100px; color: #087c57; background: #f1faf5; font-weight: 700; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.pill.offline { border-color: #f3c9cf; color: var(--red); background: #fff2f3; }
.pill.offline::before { background: var(--red); }
.notice { margin-bottom: 18px; padding: 12px 16px; border: 1px solid #cfe7f7; border-radius: 12px; color: #1c6f9f; background: #f0f8fd; font-size: 13px; }
.notice.error { border-color: #f1c9ce; color: #b82532; background: #fff3f4; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 14px; }
.metric, .panel { min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 4px 18px #0f141908; }
.metric { display: flex; flex-direction: column; min-height: 112px; padding: 20px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-top .icon { width: 20px; height: 20px; color: var(--blue); }
.metric span { color: var(--muted); font-size: 12px; }
.metric strong { margin-top: 9px; overflow-wrap: anywhere; font-size: 26px; line-height: 1.15; font-variant-numeric: tabular-nums; font-weight: 700; }
.metric small { margin-top: 7px; color: var(--muted); line-height: 1.3; }
.risk-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 22px; margin: -2px 0 14px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--soft); font-size: 12px; }
.risk-strip span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--blue); font-weight: 700; }
.risk-strip .icon { width: 15px; height: 15px; }
.risk-strip strong { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 700; }
.grid { display: grid; gap: 12px; margin-bottom: 12px; }
.grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.dashboard-columns { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(420px, 1fr); align-items: start; gap: 12px; margin-bottom: 12px; }
.dashboard-column { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel { margin-bottom: 12px; padding: 20px; }
.grid .panel { margin-bottom: 0; }
.dashboard-column .panel { margin-bottom: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head .muted { font-size: 11px; }
.manual-head { margin-top: 24px; margin-bottom: 6px; }
.manual-head h3 { margin: 0; font-size: 14px; }
.panel-head > div > .muted { display: block; margin-top: 5px; }
.section-title { display: inline-flex; align-items: center; gap: 9px; }
.section-title .icon { width: 18px; height: 18px; color: var(--blue); }
.chart-head { align-items: flex-start; }
.chart-head .muted { display: block; margin-top: 5px; }
.range-tabs { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.range-tabs button { padding: 6px 9px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-family: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.range-tabs button:hover, .range-tabs button:focus-visible { color: var(--blue); outline: 1px solid var(--blue); }
.range-tabs button.active { color: #fff; background: var(--blue); }
.chart-summary { display: flex; align-items: flex-end; gap: 26px; margin-bottom: 8px; }
.chart-summary div { display: flex; flex-direction: column; gap: 3px; }
.chart-summary span { color: var(--muted); font-size: 11px; }
.chart-summary strong { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-summary > span { margin-left: auto; white-space: nowrap; }
.chart-frame { position: relative; height: 250px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fbfdff; }
.chart-frame svg { display: block; width: 100%; height: 100%; }
.chart-gridlines { fill: none; stroke: #dce7ed; stroke-width: 1; stroke-dasharray: 4 7; }
.chart-area { fill: url(#equity-fill); }
.chart-line { fill: none; stroke: var(--blue); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.chart-endpoint { fill: var(--blue); stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-cursor { stroke: #438ebc; stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.chart-marker { fill: var(--blue); stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-y { position: absolute; left: 12px; z-index: 1; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; pointer-events: none; }
.chart-y.top { top: 10px; }.chart-y.bottom { bottom: 10px; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; color: var(--muted); font-size: 13px; text-align: center; }
.chart-tooltip { position: absolute; top: 14px; right: 14px; z-index: 2; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: #ffffffed; font-size: 12px; font-variant-numeric: tabular-nums; pointer-events: none; box-shadow: 0 8px 18px #0f14191a; }
.chart-times { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 11px; }
.pnl-chart { display: grid; align-content: start; gap: 16px; }
.pnl-chart.empty { min-height: 80px; display: grid; place-items: center; }
.pnl-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.pnl-summary span { color: var(--muted); font-size: 11px; }
.pnl-summary strong { font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pnl-axis { display: grid; grid-template-columns: 1fr auto 1fr; color: var(--muted); font-size: 10px; }
.pnl-axis span:last-child { justify-self: end; }
.pnl-item { display: grid; gap: 7px; }
.pnl-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.pnl-label strong { font-weight: 700; }
.pnl-label span { font-variant-numeric: tabular-nums; }
.pnl-track { position: relative; height: 13px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #f5f8fa; }
.pnl-track::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: #a7b5be; }
.pnl-bar { position: absolute; height: 100%; min-width: 2px; border-radius: 6px; }
.pnl-bar.positive { background: #00ad77; }.pnl-bar.negative { background: #ed5360; }
.market-list { display: grid; gap: 12px; }
.market { display: grid; grid-template-columns: minmax(125px, 1fr) minmax(110px, 160px) auto; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.market-name { font-size: 15px; font-weight: 700; }
.market-sub { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.market-spark { display: block; width: 100%; height: 46px; }
.market-spark path { fill: none; stroke: #00ad77; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.market-spark.down path { stroke: #ed5360; }
.market-price { text-align: right; font-size: 22px; font-variant-numeric: tabular-nums; font-weight: 700; }
.market-price small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 500; }
.decision { min-height: 86px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.decision strong { display: block; margin-bottom: 7px; font-size: 19px; }
.decision p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.setup-diagnostics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.setup-caption { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.setup-card { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.setup-card-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.setup-symbol { font-size: 12px; letter-spacing: .01em; }
.setup-watch-badge { flex: none; padding: 2px 6px; border-radius: 5px; color: var(--muted); background: var(--soft); font-size: 10px; }
.setup-watch-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.setup-legs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.setup-leg { min-width: 0; padding: 7px; border-radius: 7px; color: var(--muted); background: var(--soft); font-size: 12px; line-height: 1.35; }
.setup-leg-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 5px; margin-bottom: 3px; }
.setup-leg-head strong { color: var(--text); font-size: 11px; white-space: nowrap; }
.setup-leg-head small { color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.setup-leg span { display: block; overflow-wrap: anywhere; }
.setup-leg.eligible { background: #eaf8f1; }
.setup-leg.eligible strong, .setup-leg.eligible small, .setup-leg.eligible span { color: #087c57; }
.exit-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.exit-card { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; }
.exit-head { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.exit-head > strong { font-size: 14px; }
.exit-action, .exit-owner { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.exit-action.long { color: #087c57; background: #e9f7f0; }
.exit-action.short { color: #b82532; background: #fff0f2; }
.exit-owner { margin-left: auto; color: var(--muted); background: #edf1f4; }
.exit-position, .exit-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.exit-position { margin: 13px 0 9px; font-size: 12px; }
.exit-position strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.exit-lines { display: grid; gap: 6px; }
.exit-line { padding-top: 7px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.exit-line strong { color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; }
.exit-empty, .exit-target { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.exit-target { color: #1c6f9f; }
.fineprint { margin: 12px 0 0; font-size: 12px; line-height: 1.5; }
.text-button { flex: none; padding: 7px 10px; border: 1px solid #cfe7f7; border-radius: 8px; color: #1479b7; background: #f4faff; font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.text-button:hover, .text-button:focus-visible { border-color: var(--blue); outline: 1px solid var(--blue); }
.table-wrap { max-width: 100%; overflow-x: auto; scrollbar-color: #c6d2da #fff; }
.scroll-hint { display: block; margin: -4px 0 6px; color: #1479b7; font-size: 11px; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: 12px; }
th { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); color: var(--muted); text-align: left; font-weight: 600; }
td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fafb; }
.positive { color: var(--green); }.negative { color: var(--red); }.empty { color: var(--muted); }
footer { margin-top: 18px; font-size: 11px; }
@media (min-width: 941px) and (max-width: 1190px) {
  .setup-diagnostics { grid-template-columns: 1fr; }
}
@media (max-width: 940px) {
  .dashboard-columns { display: flex; flex-direction: column; }
  .dashboard-column { display: contents; }
  .dashboard-columns .panel { width: 100%; }
  .equity-panel { order: 1; }
  .pnl-panel { order: 2; }
  .market-panel { order: 3; }
  .strategy-panel { order: 4; }
  .exit-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  main { padding: 24px 14px 40px; }
  .masthead { align-items: flex-start; flex-direction: column; }
  .status-wrap { align-items: flex-start; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two { grid-template-columns: 1fr; }
  .setup-diagnostics { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .brand { gap: 11px; min-width: 0; }
  .brand-mark { width: 49px; height: 49px; border-radius: 14px; }
  .brand-mark .icon { width: 29px; height: 29px; }
  h1 { font-size: 28px; }
  h1 span { font-size: 19px; }
  .metric { min-height: 114px; }
  .metric small { font-size: 10px; }
  .chart-summary { gap: 14px; flex-wrap: wrap; }
  .chart-summary > span { width: 100%; margin-left: 0; }
  .chart-head { align-items: flex-start; flex-direction: column; }
  .chart-frame { height: 215px; }
  .market { grid-template-columns: 1fr auto; }
  .market-spark { grid-column: 1 / -1; grid-row: 2; height: 40px; }
  .exit-plans { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .metrics { gap: 8px; }
  .metric { min-height: 113px; padding: 13px; }
  .metric strong { font-size: 21px; }
  .metric-top .icon { width: 16px; height: 16px; }
  .metric small { overflow-wrap: anywhere; }
  .panel { padding: 16px; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .range-tabs { align-self: flex-start; }
  .exit-owner { margin-left: auto; }
}
