:root {
  color-scheme: light;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --border: #e6e8ec;
  --text: #101828;
  --text-2: #4b5563;
  --muted: #6b7280;
  --grid: #eef0f3;
  --accent: #2a78d6;
  --accent-soft: #e8f1fc;
  --hold: #eb6834;
  --net: #6b7280;
  --up: #12805c;
  --up-soft: #e3f5ec;
  --down: #c9302c;
  --down-soft: #fde8e7;
  --warn-soft: #fff4dc;
  --warn: #8a5a00;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1116; --surface: #161b22; --surface-2: #1c222b; --border: #262d37;
    --text: #f0f3f6; --text-2: #c2c9d2; --muted: #8b949e; --grid: #222831;
    --accent: #3987e5; --accent-soft: #15253a; --hold: #d95926; --net: #8b949e;
    --up: #3fb97f; --up-soft: #12301f; --down: #f2645f; --down-soft: #3a1716;
    --warn-soft: #3a2c0b; --warn: #f0c060; --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1116; --surface: #161b22; --surface-2: #1c222b; --border: #262d37;
  --text: #f0f3f6; --text-2: #c2c9d2; --muted: #8b949e; --grid: #222831;
  --accent: #3987e5; --accent-soft: #15253a; --hold: #d95926; --net: #8b949e;
  --up: #3fb97f; --up-soft: #12301f; --down: #f2645f; --down-soft: #3a1716;
  --warn-soft: #3a2c0b; --warn: #f0c060; --shadow: none;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
h2 { font-size: 17px; margin: 0 0 4px; font-weight: 600; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.tiny { font-size: 12px; margin: 8px 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Top bar & tabs */
.topbar, .tabs, main { max-width: 1040px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding-top: 20px; gap: 12px; }
.brand { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.link { color: var(--muted); text-decoration: none; font-size: 14px; }
.link:hover { color: var(--text); }
.tabs { display: flex; gap: 6px; margin-top: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button {
  font: inherit; font-size: 14px; font-weight: 500; border: 0; background: transparent; color: var(--muted);
  padding: 8px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.tabs button[aria-selected="true"] { background: var(--text); color: var(--bg); }
main { padding-top: 16px; padding-bottom: 48px; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px; margin-bottom: 14px; box-shadow: var(--shadow); min-width: 0;
}
.pots, .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pots > .card, .cols > .card { margin-bottom: 14px; }
@media (max-width: 760px) { .pots, .cols { grid-template-columns: 1fr; gap: 0; } }

/* Pills */
.pill {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.pill-practice { background: var(--warn-soft); color: var(--warn); }
.pill-buy { background: var(--up-soft); color: var(--up); }
.pill-sell { background: var(--down-soft); color: var(--down); }
.pill-good { background: var(--up-soft); color: var(--up); }
.pill-bad { background: var(--down-soft); color: var(--down); }

/* Hero */
.hero-label { color: var(--muted); font-weight: 500; }
.hero-value { font-size: 44px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.hero-change, .change { font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.hero-sentence { font-size: 16px; color: var(--text-2); margin-top: 10px; max-width: 640px; }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--muted); }

/* Pots */
.pot-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.pot-title { font-weight: 600; font-size: 16px; }
.pot-value { font-size: 30px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.mix { margin-top: 14px; }
.mix-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--surface); }
.mix-bar span { display: block; height: 100%; }
.mix-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13px; color: var(--text-2); }
.mix-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

/* Safety net bar */
.net { margin-top: 14px; }
.net-bar { position: relative; height: 10px; background: var(--surface-2); border-radius: 999px; margin-bottom: 8px; }
.net-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--up); }
.net-line { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--down); border-radius: 2px; }

/* Versus */
.versus-row { display: flex; align-items: center; gap: 24px; margin: 12px 0; flex-wrap: wrap; }
.versus-num { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.versus-vs { color: var(--muted); font-weight: 600; }
.verdict { padding: 10px 14px; border-radius: 12px; background: var(--surface-2); margin: 0; }

/* Charts */
.chart { position: relative; height: 280px; margin-top: 8px; }
@media (max-width: 760px) { .chart { height: 220px; } .hero-value { font-size: 36px; } }

/* Feed */
.feed { list-style: none; padding: 0; margin: 0; max-height: 440px; overflow: auto; }
.feed li { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--grid); align-items: start; }
.feed li:first-child { border-top: 0; }
.feed .what { font-weight: 600; }
.feed .why { grid-column: 2 / 4; color: var(--text-2); font-size: 13.5px; }
.feed .amt { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.feed .when { color: var(--muted); font-size: 12px; grid-column: 2 / 4; }

/* Holdings */
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 9px 4px; border-bottom: 1px solid var(--grid); }
th { color: var(--muted); font-weight: 500; font-size: 12.5px; }
td.num, th.num { text-align: right; }
tr.group td { font-weight: 600; padding-top: 16px; border-bottom: 0; }
.asset-sub { color: var(--muted); font-size: 12px; }

/* FAQ */
.faq details { border-top: 1px solid var(--grid); padding: 12px 0; }
.faq details:first-child { border-top: 0; padding-top: 0; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { color: var(--text-2); margin-top: 8px; }

.empty { text-align: center; padding: 36px 20px; }

/* Login */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card {
  width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow); text-align: center;
}
.login-card h1 { font-size: 22px; margin: 8px 0 4px; }
.login-card .logo { font-size: 36px; }
.login-card input {
  width: 100%; font: inherit; padding: 12px 14px; margin-top: 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}
.login-card input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.login-card button {
  width: 100%; font: inherit; font-weight: 600; margin-top: 12px; padding: 12px; border: 0; border-radius: 12px;
  background: var(--text); color: var(--bg); cursor: pointer;
}
.login-card .error { color: var(--down); font-size: 14px; margin: 10px 0 0; }
