:root {
  color-scheme: dark;
  background: #0c1118;
  color: #eef2f8;
  font: 16px/1.45 Geist, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --muted: #a0acbd;
  --border: #263140;
  --surface: #111923;
  --positive: #54e5ad;
  --negative: #ff898f;
  --warning: #f1c486;
  font-variant-numeric: tabular-nums;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; }
.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.topbar { height: 79px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 680; letter-spacing: -0.03em; }
.brand-mark { width: 11px; height: 11px; background: var(--positive); transform: rotate(45deg); border-radius: 3px; margin-inline: 2px 4px; }
.brand-divider { height: 19px; width: 1px; background: var(--border); margin-inline: 2px; }
.brand-page { color: var(--muted); font-weight: 480; letter-spacing: 0; }
.connection { display: inline-flex; gap: 8px; align-items: center; font-size: .875rem; color: var(--muted); }
.connection span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.connection.live { color: var(--positive); }
.connection.warning { color: var(--warning); }

.overview { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 38px 0 24px; }
h1 { margin: 0 0 6px; font-size: 1rem; color: var(--muted); font-weight: 520; }
.balance { font-size: clamp(2.9rem, 7vw, 4.8rem); font-weight: 650; letter-spacing: -.065em; line-height: 1.04; }
.account-change { display: flex; align-items: baseline; flex-wrap: wrap; gap: 9px; color: var(--muted); font-size: .875rem; margin-top: 10px; }
.account-change strong { font-size: 1rem; color: #d7dfeb; }
.cash-card { min-width: 205px; display: grid; gap: 4px; margin-bottom: 1px; padding: 13px 17px 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.cash-card span { color: var(--muted); font-size: .875rem; }
.cash-card strong { font-size: 1.55rem; line-height: 1.2; font-weight: 620; letter-spacing: -.04em; }
.cash-card small { font-size: .8125rem; color: var(--muted); }

.panel { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 21px; }
h2 { margin: 0; font-size: 1.08rem; font-weight: 640; letter-spacing: -.025em; }
.panel-header p { margin: 4px 0 0; color: var(--muted); font-size: .875rem; }
.range { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: #0d141d; }
.range button { background: transparent; color: var(--muted); border: 0; border-radius: 5px; min-width: 42px; padding: 5px 8px; font-size: .875rem; cursor: pointer; }
.range button[aria-pressed="true"] { background: #29394a; color: #f0f4fa; }
.range button:hover { color: #fff; }
button:focus-visible, .table-scroll:focus-visible { outline: 2px solid var(--positive); outline-offset: 3px; }
.chart { position: relative; height: 246px; margin: 0 16px 11px; }
.chart canvas { display: block; width: 100%; height: 100%; }
#chart-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); margin: 0; pointer-events: none; }
#chart-placeholder[hidden] { display: none; }
#chart-tooltip { position: absolute; z-index: 1; border: 1px solid var(--border); background: #0d141d; border-radius: 7px; padding: 5px 9px; font-size: .8125rem; color: #eef2f8; pointer-events: none; white-space: nowrap; }

.holdings-panel { margin-top: 18px; }
.holdings-header { border-bottom: 1px solid var(--border); }
.holdings-header span { color: var(--muted); font-size: .875rem; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 715px; }
th, td { padding: 12px 14px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 21px; text-align: left; }
th:last-child, td:last-child { padding-right: 21px; }
th { color: var(--muted); font-size: .875rem; font-weight: 500; background: #101720; }
td { border-top: 1px solid var(--border); font-size: .9375rem; font-weight: 560; }
.market-title { display: block; max-width: 365px; overflow: hidden; text-overflow: ellipsis; font-weight: 620; }
.outcome { display: inline-block; margin-top: 4px; padding: 1px 7px; border-radius: 4px; font-size: .8125rem; font-weight: 580; background: #243246; color: #c9d5e8; }
.outcome.up { color: #79eabb; background: #18372f; }
.outcome.down { color: #ff9ba1; background: #40272f; }
.cell-detail { display: block; margin-top: 2px; font-size: .8125rem; font-weight: 480; color: var(--muted); }
.payout { color: var(--warning); }
.positive { color: var(--positive) !important; }
.negative { color: var(--negative) !important; }
.holdings-placeholder { margin: 0; padding: 17px 21px; border-top: 1px solid var(--border); color: var(--muted); font-size: .875rem; }
footer { color: var(--muted); padding: 15px 2px 24px; font-size: .8125rem; }

@media (max-width: 640px) {
  .shell { width: calc(100% - 32px); }
  .topbar { height: 62px; }
  .brand { gap: 8px; }
  .overview { flex-wrap: wrap; align-items: start; gap: 14px; margin-top: 24px; }
  .cash-card { width: 100%; grid-template-columns: 1fr auto; align-items: center; }
  .cash-card small { grid-column: 1 / -1; }
  .panel-header { padding-inline: 14px; }
  .chart { height: 220px; margin-inline: 8px; }
  .range button { min-width: 35px; }
  table { min-width: 660px; }
  .market-title { max-width: 215px; }
}
