/* MT5 Bridge — the interface layer.
   Two typefaces with one job each: General Sans carries the language, Geist Mono
   carries every figure, so columns line up and live numbers never jitter.
   Surfaces are quiet (hairlines, small radii, almost no shadow), colour is spent
   only on money and one blue for things you can press. The dark twin is a true
   black canvas with lifted grey cards, not a tinted copy of the light one. */

@font-face { font-family: "General Sans"; src: url("/static/fonts/general-sans-variable.woff2") format("woff2"); font-weight: 200 700; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/static/fonts/geist-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/static/fonts/geist-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #F5F5F8;
  --surface: #FFFFFF;
  --surface-2: #F1F1F5;
  --surface-3: #E8E8EE;
  --line: rgba(17, 17, 22, 0.08);
  --line-strong: rgba(17, 17, 22, 0.16);
  --text: #111116;
  --text-2: #5B5B66;
  --text-3: #8A8A96;
  --tint: #0B62F5;
  --tint-soft: rgba(11, 98, 245, 0.10);
  --tint-text: #0B4FC7;
  --primary: #111116;
  --primary-text: #FFFFFF;
  --accent: #0B62F5;
  --accent-soft: rgba(11, 98, 245, 0.10);
  --accent-text: #0B4FC7;
  --good: #0A7C55;
  --good-mark: #12A66F;
  --good-soft: rgba(18, 166, 111, 0.12);
  --bad: #C0392C;
  --bad-mark: #E24A3C;
  --bad-soft: rgba(226, 74, 60, 0.12);
  --warn: #9A6400;
  --warn-mark: #E9A23B;
  --warn-soft: rgba(233, 162, 59, 0.16);
  --info: #0B62F5;
  --info-soft: rgba(11, 98, 245, 0.10);
  --hero-bg: #131318;
  --hero-2: #1E1E25;
  --hero-text: #FFFFFF;
  --hero-muted: #9C9CA8;
  --hero-line: rgba(255, 255, 255, 0.12);
  --grid: rgba(17, 17, 22, 0.07);
  --axis: rgba(17, 17, 22, 0.18);
  --neutral-mid: #D3D3DC;
  --series-1: #0B62F5;
  --series-2: #E2662A;
  --series-3: #12A66F;
  --series-4: #8A5CF6;
  --shadow-sm: 0 1px 2px rgba(16, 16, 24, 0.05);
  --shadow-md: 0 2px 6px rgba(16, 16, 24, 0.06), 0 12px 28px -18px rgba(16, 16, 24, 0.30);
  --shadow-lg: 0 24px 60px -20px rgba(16, 16, 24, 0.35);
  --card-ring: 0 0 0 1px rgba(17, 17, 22, 0.05);
  --overlay: rgba(12, 12, 16, 0.34);
  --radius: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --font: "General Sans", ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Figures: Geist has true tabular figures, so columns and live numbers hold still. */
  --font-num: "Geist", ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --nav-h: 58px;
  --tabbar-h: 62px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #08080A; --surface: #141418; --surface-2: #1C1C22; --surface-3: #26262E;
    --line: rgba(255, 255, 255, 0.09); --line-strong: rgba(255, 255, 255, 0.18);
    --text: #F4F4F7; --text-2: #A4A4B0; --text-3: #7B7B87;
    --tint: #5B9BFF; --tint-soft: rgba(91, 155, 255, 0.16); --tint-text: #8FBAFF;
    --primary: #F4F4F7; --primary-text: #0B0B0E;
    --accent: #5B9BFF; --accent-soft: rgba(91, 155, 255, 0.16); --accent-text: #8FBAFF;
    --good: #3ED9A0; --good-mark: #2FC98F; --good-soft: rgba(47, 201, 143, 0.15);
    --bad: #FF7E70; --bad-mark: #F2634F; --bad-soft: rgba(242, 99, 79, 0.15);
    --warn: #F2B75C; --warn-mark: #E9A23B; --warn-soft: rgba(233, 162, 59, 0.16);
    --info: #5B9BFF; --info-soft: rgba(91, 155, 255, 0.16);
    --hero-bg: #101219; --hero-2: #1B2130; --hero-text: #FFFFFF; --hero-muted: #9EA3B2; --hero-line: rgba(255, 255, 255, 0.10);
    --grid: rgba(255, 255, 255, 0.07); --axis: rgba(255, 255, 255, 0.22); --neutral-mid: #3A3A45;
    --series-1: #5B9BFF; --series-2: #F0824A; --series-3: #2FC98F; --series-4: #A57BFF;
    --shadow-sm: none; --shadow-md: 0 18px 40px -24px rgba(0, 0, 0, 0.9); --shadow-lg: 0 30px 80px -24px rgba(0, 0, 0, 0.95);
    --card-ring: 0 0 0 1px rgba(255, 255, 255, 0.06);
    --overlay: rgba(0, 0, 0, 0.62);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08080A; --surface: #141418; --surface-2: #1C1C22; --surface-3: #26262E;
  --line: rgba(255, 255, 255, 0.09); --line-strong: rgba(255, 255, 255, 0.18);
  --text: #F4F4F7; --text-2: #A4A4B0; --text-3: #7B7B87;
  --tint: #5B9BFF; --tint-soft: rgba(91, 155, 255, 0.16); --tint-text: #8FBAFF;
  --primary: #F4F4F7; --primary-text: #0B0B0E;
  --accent: #5B9BFF; --accent-soft: rgba(91, 155, 255, 0.16); --accent-text: #8FBAFF;
  --good: #3ED9A0; --good-mark: #2FC98F; --good-soft: rgba(47, 201, 143, 0.15);
  --bad: #FF7E70; --bad-mark: #F2634F; --bad-soft: rgba(242, 99, 79, 0.15);
  --warn: #F2B75C; --warn-mark: #E9A23B; --warn-soft: rgba(233, 162, 59, 0.16);
  --info: #5B9BFF; --info-soft: rgba(91, 155, 255, 0.16);
  --hero-bg: #101219; --hero-2: #1B2130; --hero-text: #FFFFFF; --hero-muted: #9EA3B2; --hero-line: rgba(255, 255, 255, 0.10);
  --grid: rgba(255, 255, 255, 0.07); --axis: rgba(255, 255, 255, 0.22); --neutral-mid: #3A3A45;
  --series-1: #5B9BFF; --series-2: #F0824A; --series-3: #2FC98F; --series-4: #A57BFF;
  --shadow-sm: none; --shadow-md: 0 18px 40px -24px rgba(0, 0, 0, 0.9); --shadow-lg: 0 30px 80px -24px rgba(0, 0, 0, 0.95);
  --card-ring: 0 0 0 1px rgba(255, 255, 255, 0.06);
  --overlay: rgba(0, 0, 0, 0.62);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14.5px/1.5 var(--font); letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: inherit; text-decoration: none; }
.link { color: var(--tint); font-weight: 550; cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.022em; line-height: 1.22; font-weight: 600; text-wrap: balance; }
p { margin: 0; }
code, .mono { font-family: var(--font-mono); font-size: 0.92em; letter-spacing: -0.01em; }
[hidden] { display: none !important; }
::selection { background: var(--tint-soft); }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; border-radius: 8px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
/* Every figure is set in Geist with tabular figures: columns align and a live
   number never shifts as its digits change. */
.num, .tnum, .kpi-value, .hero-figure, .big-num, .table .num, .figs .v, .kv .v, .strip .v, .metric .v, .hero-stats .v, .ticket-side .p {
  font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -0.015em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.up { color: var(--good); }
.down { color: var(--bad); }
.flat { color: var(--text-2); }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.sm { gap: 7px; } .stack.lg { gap: 12px; } .stack.xl { gap: 20px; }
.grow { flex: 1 1 auto; min-width: 0; }
.spacer { flex: 1; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.center { text-align: center; } .right { text-align: right; }
.small { font-size: 13px; } .xsmall { font-size: 12px; }
.strong { font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* One-line plain-English explanation. Used under figures, charts and sections. */
.note { font-size: 13px; line-height: 1.5; color: var(--text-2); }
.note b { color: var(--text); font-weight: 600; }
.note.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); }

/* ---------- boot ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 14px; color: var(--text-3); }
.boot-mark { width: 34px; height: 34px; border-radius: 11px; background: var(--text); animation: breathe 1.4s var(--ease) infinite; }
@keyframes breathe { 50% { transform: scale(0.84); opacity: 0.5; } }

/* ---------- desktop top bar ---------- */
.topnav { position: sticky; top: 0; z-index: 40; height: var(--nav-h); display: flex; align-items: center; gap: 20px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(20px); -webkit-backdrop-filter: saturate(1.6) blur(20px);
  border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; letter-spacing: -0.02em; white-space: nowrap; }
.brand-mark { width: 28px; height: 28px; border-radius: 9px; background: var(--text); color: var(--bg); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 17px; height: 17px; }
.navtabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.navtabs::-webkit-scrollbar { display: none; }
.navtabs a { height: 32px; padding: 0 12px; border-radius: 9px; display: flex; align-items: center; gap: 7px; font-weight: 500; font-size: 14px;
  color: var(--text-2); white-space: nowrap; transition: background 0.15s, color 0.15s; }
.navtabs a:hover { color: var(--text); background: var(--surface-2); }
.navtabs a.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--card-ring); }
.navtabs a .count { font-size: 11.5px; font-weight: 600; font-family: var(--font-mono); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 6px;
  background: var(--surface-3); color: var(--text-2); display: inline-grid; place-items: center; }
.navtabs a.active .count { background: var(--tint); color: #fff; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; display: grid; place-items: center; color: var(--text-2);
  cursor: pointer; position: relative; flex: none; transition: background 0.15s, color 0.15s; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn .pip { position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--bad-mark); box-shadow: 0 0 0 2px var(--bg); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--text); color: var(--bg); display: grid; place-items: center;
  font-weight: 600; font-size: 12px; letter-spacing: 0; flex: none; border: 0; cursor: pointer; }
.avatar.sm { width: 30px; height: 30px; font-size: 11.5px; }

/* ---------- mobile app bar + bottom tabs ---------- */
.appbar { display: none; position: sticky; top: 0; z-index: 40; padding: 10px 16px; gap: 10px; align-items: center;
  background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: saturate(1.6) blur(20px); -webkit-backdrop-filter: saturate(1.6) blur(20px); }
.appbar .who { line-height: 1.2; min-width: 0; }
.appbar .who small { display: block; font-size: 12px; color: var(--text-3); }
.appbar .who b { font-size: 15.5px; font-weight: 600; letter-spacing: -0.02em; }
.tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 7px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(22px); -webkit-backdrop-filter: saturate(1.6) blur(22px); border-top: 1px solid var(--line);
  grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; }
.tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 46px;
  color: var(--text-3); font-size: 10.5px; font-weight: 500; border: 0; background: none; cursor: pointer; }
.tabbar a.active, .tabbar button.active { color: var(--tint); }
.tabbar .fab span:first-child { width: 34px; height: 34px; border-radius: 11px; background: var(--tint); color: #fff; display: grid; place-items: center; }
.tabbar .fab { color: var(--text-3); }
.tabbar .fab.active span:first-child { box-shadow: 0 0 0 4px var(--tint-soft); }

/* ---------- page ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: 16px 24px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { font-size: 23px; font-weight: 600; letter-spacing: -0.03em; }
.page-head .lede { margin-top: 6px; }
.lede { color: var(--text-2); font-size: 14.5px; line-height: 1.55; max-width: 74ch; }
.lede b { color: var(--text); font-weight: 600; }
.hello { font-size: 24px; font-weight: 600; letter-spacing: -0.03em; }
.crumb { font-size: 13px; color: var(--text-3); margin-bottom: 8px; display: flex; gap: 5px; align-items: center; }
.crumb a:hover { color: var(--text); }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 16px; font-weight: 600; }
.section-head .sub { color: var(--text-3); font-size: 13px; }

/* ---------- grids ---------- */
.grid { display: grid; gap: 12px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
.g-main-r { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); align-items: start; }
.span-2 { grid-column: span 2; }

/* ---------- cards ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--card-ring), var(--shadow-sm); min-width: 0; }
.card.pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 13px 18px 0; flex-wrap: wrap; }
.card-head > .grow ~ * { margin-left: auto; }
.card-head > .grow ~ * ~ * { margin-left: 0; }
.card-head h2, .card-head h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; }
.card-head .sub { color: var(--text-3); font-size: 12.5px; margin-top: 2px; line-height: 1.45; }
.card-body { padding: 12px 18px 14px; }
.card-body.flush { padding: 4px 0 2px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.card.clickable { cursor: pointer; transition: box-shadow 0.18s var(--ease), transform 0.18s var(--ease); }
.card.clickable:hover { box-shadow: var(--card-ring), var(--shadow-md); transform: translateY(-1px); }
.card.ink { background: linear-gradient(168deg, var(--hero-2), var(--hero-bg) 62%); color: var(--hero-text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 18px 40px -26px rgba(0, 0, 0, 0.6); }
.card.ink .faint, .card.ink .muted, .card.ink .note { color: var(--hero-muted); }
.card.ink .up { color: #4BE0A4; }
.card.ink .down { color: #FF8B7E; }
.card.ink .flat { color: var(--hero-text); }

/* ---------- KPI ---------- */
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.kpi-label { font-size: 12.5px; font-weight: 500; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.kpi-value { font-size: 22px; font-weight: 550; line-height: 1.2; white-space: nowrap; }
.kpi-sub { font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.kpi-spark { position: absolute; right: 16px; top: 16px; }
.hero-figure { font-size: clamp(28px, 7vw, 34px); font-weight: 550; letter-spacing: -0.035em; line-height: 1.05; white-space: nowrap; }
.hero-figure .cents { opacity: 0.5; font-size: 0.62em; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: var(--radius-md);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-weight: 550; font-size: 14px; cursor: pointer;
  white-space: nowrap; user-select: none; transition: background 0.15s, border-color 0.15s, transform 0.08s, opacity 0.15s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--tint); border-color: var(--tint); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.accent { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn.soft { background: var(--surface-2); border-color: transparent; }
.btn.soft:hover { background: var(--surface-3); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--bad); border-color: var(--line-strong); }
.btn.danger:hover { background: var(--bad-soft); border-color: transparent; }
.btn.buy { background: var(--good-mark); border-color: var(--good-mark); color: #fff; }
.btn.sell { background: var(--bad-mark); border-color: var(--bad-mark); color: #fff; }
.btn.buy:hover, .btn.sell:hover { filter: brightness(1.05); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15.5px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn.icon { width: 38px; padding: 0; }
.btn.icon.sm { width: 32px; }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- segmented, tabs, chips ---------- */
.seg { display: inline-flex; align-self: flex-start; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 11px; overflow-x: auto;
  max-width: 100%; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text-2);
  cursor: pointer; white-space: nowrap; min-height: 30px; transition: background 0.15s, color 0.15s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm), var(--card-ring); }
.seg.soft { background: var(--surface-2); }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; padding: 3px; background: var(--surface-2);
  border-radius: 12px; align-self: flex-start; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: transparent; padding: 0 13px; height: 34px; border-radius: 9px; font-weight: 500; font-size: 13.5px;
  color: var(--text-2); cursor: pointer; white-space: nowrap; display: flex; gap: 7px; align-items: center; }
.tabs button:hover { color: var(--text); }
.tabs button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm), var(--card-ring); }
.tabs .count { font-size: 11.5px; font-weight: 600; font-family: var(--font-mono); color: var(--text-3); }
.tabs button.on .count { color: var(--tint); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--text); }
.chip:hover { background: var(--surface-2); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip:disabled { opacity: 0.4; cursor: not-allowed; }
.chip .n { font-family: var(--font-mono); font-size: 12px; opacity: 0.6; }

/* ---------- badges, grades, dots ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 550;
  white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.muted { background: var(--surface-2); color: var(--text-3); }
.badge.outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text-2); }
.badge.side-buy { background: var(--good-soft); color: var(--good); font-family: var(--font-mono); font-size: 11px; }
.badge.side-sell { background: var(--bad-soft); color: var(--bad); font-family: var(--font-mono); font-size: 11px; }
.grade { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 600; font-size: 14px; flex: none; }
.grade.lg { width: 46px; height: 46px; border-radius: 13px; font-size: 21px; }
.grade.sm { width: 24px; height: 24px; border-radius: 7px; font-size: 12px; }
.grade.good { background: var(--good-soft); color: var(--good); }
.grade.warn { background: var(--warn-soft); color: var(--warn); }
.grade.bad { background: var(--bad-soft); color: var(--bad); }
.grade.muted { background: var(--surface-2); color: var(--text-3); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; display: inline-block; }
.dot.good { background: var(--good-mark); } .dot.bad { background: var(--bad-mark); } .dot.warn { background: var(--warn-mark); } .dot.info { background: var(--info); }
.dot.pulse { position: relative; }
.dot.pulse::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; background: inherit; opacity: 0.3; animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0% { transform: scale(0.6); opacity: 0.45; } 80%, 100% { transform: scale(1.9); opacity: 0; } }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13.5px; font-weight: 550; color: var(--text); }
.field .hint { font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.field .error { font-size: 12.5px; color: var(--bad); font-weight: 500; }
.input, .select, .textarea { width: 100%; height: 42px; padding: 0 12px; border-radius: var(--radius-md); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); outline: none; font-size: 14.5px; transition: border-color 0.15s, box-shadow 0.15s; }
.textarea { height: auto; padding: 10px 12px; min-height: 84px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--tint); box-shadow: 0 0 0 3px var(--tint-soft); }
.input::placeholder { color: var(--text-3); }
.input.mono { font-family: var(--font-mono); font-size: 13.5px; }
.input[type="number"] { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A8A96' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .suffix { position: absolute; right: 12px; color: var(--text-3); font-size: 13px; pointer-events: none; }
.input-wrap .input { padding-right: 40px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; gap: 9px; align-items: center; cursor: pointer; font-size: 14px; min-height: 40px; }
.check input { accent-color: var(--tint); width: 17px; height: 17px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; min-height: 32px; font-weight: 500; font-size: 13.5px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 42px; height: 25px; border-radius: 999px; background: var(--surface-3); position: relative; transition: background 0.22s var(--ease); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28); transition: transform 0.22s var(--ease); }
.switch input:checked + .track { background: var(--good-mark); }
.switch input:checked + .track::after { transform: translateX(17px); }
.switch input:focus-visible + .track { outline: 2px solid var(--tint); outline-offset: 2px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.choice { border: 1px solid var(--line-strong); border-radius: 13px; padding: 14px; cursor: pointer; background: var(--surface); text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s; display: flex; flex-direction: column; gap: 5px; }
.choice:hover { border-color: var(--text-3); }
.choice.on { border-color: var(--tint); box-shadow: 0 0 0 1px var(--tint); }
.choice .t { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.choice .d { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.choice .ex { font-size: 12px; color: var(--text-3); }

/* ---------- insights ---------- */
.insight { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.insight:first-child { border-top: 0; }
.insight-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.insight-icon.good { background: var(--good-soft); color: var(--good); }
.insight-icon.bad { background: var(--bad-soft); color: var(--bad); }
.insight-icon.warn { background: var(--warn-soft); color: var(--warn); }
.insight-icon.info { background: var(--info-soft); color: var(--info); }
.insight-icon.muted { background: var(--surface-2); color: var(--text-2); }
.insight-kind { font-size: 10.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; }
.insight-kind.good { color: var(--good); } .insight-kind.bad { color: var(--bad); } .insight-kind.warn { color: var(--warn); }
.insight-kind.info { color: var(--info); } .insight-kind.muted { color: var(--text-3); }
.insight-title { font-weight: 600; font-size: 14.5px; line-height: 1.4; margin-top: 2px; }
.insight-body { font-size: 13.5px; line-height: 1.55; color: var(--text-2); margin-top: 4px; }
.insight-cta { margin-top: 7px; font-size: 13px; }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal-h { font-size: 11px; font-weight: 500; color: var(--text-3); text-align: center; padding-bottom: 2px; }
.cal-cell { aspect-ratio: 1.2; border-radius: 8px; background: var(--surface-2); display: flex; flex-direction: column; justify-content: space-between;
  padding: 4px 6px; font-size: 11px; font-weight: 500; color: var(--text-2); position: relative; min-width: 0; }
.cal-cell .v { font-size: 10px; font-family: var(--font-mono); align-self: flex-end; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cal-cell.weekend { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--text-3); }
.cal-cell.empty { background: transparent; }
.cal-cell.today { box-shadow: 0 0 0 2px var(--tint); }
.cal-cell.future { opacity: 0.5; }
.cal-legend { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); }
.cal-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* ---------- bars ---------- */
.bars { display: flex; flex-direction: column; gap: 13px; }
.bar-row .top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.bar-row .top b { font-weight: 550; }
.bar-row .sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.bar-track { height: 8px; border-radius: 999px; background: var(--surface-2); position: relative; margin-top: 6px; overflow: hidden; }
.bar-track > span { position: absolute; top: 0; bottom: 0; border-radius: 999px; }
.bar-track.center::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--axis); }
.progress { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--good-mark); transition: width 0.4s var(--ease); }
.progress.warn > span { background: var(--warn-mark); }
.progress.bad > span { background: var(--bad-mark); }
.progress.ink > span { background: var(--tint); }

/* ---------- tables (cards on phones) ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 500; font-size: 11.5px; color: var(--text-3); padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover, .table th.sorted { color: var(--text); }
.table td { padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.clickable { cursor: pointer; }
.table .num, .table th.num { text-align: right; white-space: nowrap; }
.table td.strong { font-weight: 600; }
.table .sub { display: block; font-size: 12px; color: var(--text-3); font-weight: 400; font-family: var(--font); letter-spacing: -0.006em; }
.table tr.expanded > td { background: var(--surface-2); }
.table.compact td, .table.compact th { padding: 8px 12px; }
.table .col-name { min-width: 190px; }
.table tfoot td { border-top: 1px solid var(--line-strong); font-weight: 600; padding: 11px 14px; }
.table td.wrap { white-space: normal; word-break: break-word; }
.table.sticky-first th:first-child, .table.sticky-first td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.table.sticky-first td:first-child { box-shadow: 1px 0 0 var(--line); }
.table.sticky-first tbody tr:hover td:first-child { background: var(--surface-2); }
.table.sticky-first tfoot td:first-child { background: var(--surface); }
.table .nowrap { white-space: nowrap; }
.best { box-shadow: inset 0 0 0 1.5px var(--good-mark); border-radius: 6px; padding: 2px 6px; margin: -2px -6px; }
.rank { width: 24px; height: 24px; border-radius: 7px; display: inline-grid; place-items: center; font-weight: 600; font-size: 12px;
  font-family: var(--font-mono); background: var(--surface-2); color: var(--text-2); }
.rank.r1 { background: #F5D485; color: #5A3E00; } .rank.r2 { background: #DCDCE4; color: #3A3A44; } .rank.r3 { background: #E9C6A6; color: #5B3612; }

/* ---------- lists ---------- */
.list-row { display: flex; align-items: center; gap: 12px; padding: 9px 18px; border-top: 1px solid var(--line); min-height: 50px; }
.list-row:first-child { border-top: 0; }
a.list-row:hover, .list-row.clickable:hover { background: var(--surface-2); }
.list-row .t { font-weight: 550; font-size: 14px; }
.list-row .s { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.feed-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.feed-icon.good { background: var(--good-soft); color: var(--good); }
.feed-icon.bad { background: var(--bad-soft); color: var(--bad); }
.feed-icon.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- strategy cards ---------- */
.strat-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.strat-card .name { font-weight: 600; font-size: 15px; letter-spacing: -0.015em; }
.strat-card .meta { color: var(--text-3); font-size: 12.5px; margin-top: 1px; }
.strat-card .figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.strat-card .figs .k { font-size: 11.5px; color: var(--text-3); }
.strat-card .figs .v { font-size: 15px; font-weight: 550; }

/* ---------- metric grid ---------- */
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.metric { padding: 13px 18px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.metric .k { font-size: 12.5px; color: var(--text-3); display: flex; gap: 5px; align-items: center; }
.metric .v { font-size: 16.5px; font-weight: 550; margin-top: 3px; }
.metric .d { font-size: 11.5px; color: var(--text-3); margin-top: 3px; line-height: 1.4; }

/* ---------- key / value ---------- */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px 18px; }
.kv .k { font-size: 12px; color: var(--text-3); }
.kv .v { font-size: 14px; font-weight: 550; margin-top: 1px; min-width: 0; }
.kv .full { grid-column: 1 / -1; }
.kv > div, .figs > div { min-width: 0; }
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 12px 16px; }
.figs .k { font-size: 12px; color: var(--text-3); }
.figs .v { font-size: 17px; font-weight: 550; margin-top: 2px; white-space: nowrap; }
.figs .s { font-size: 12px; color: var(--text-3); margin-top: 1px; line-height: 1.4; }
.big-num { font-size: 28px; font-weight: 550; letter-spacing: -0.035em; line-height: 1.05; white-space: nowrap; }
.title-row { display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.swatch { width: 12px; height: 3px; border-radius: 2px; display: inline-block; flex: none; }

/* ---------- hero ---------- */
.hero { padding: 20px 22px 18px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.hero-top { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.hero-label { font-size: 12.5px; color: var(--hero-muted); display: flex; gap: 7px; align-items: center; }
.hero-sub { color: var(--hero-muted); font-size: 13.5px; margin-top: 6px; }
.hero-sub b { color: var(--hero-text); font-weight: 550; white-space: nowrap; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; border-top: 1px solid var(--hero-line); padding-top: 14px; }
.hero-stats .k { font-size: 12px; color: var(--hero-muted); }
.hero-stats .v { font-size: 17px; font-weight: 550; margin-top: 2px; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 27px; padding: 0 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.10);
  color: var(--hero-text); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.card.ink .btn.ghost { color: var(--hero-muted); }
.card.ink .btn.ghost:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

/* ---------- health ---------- */
.health { display: flex; gap: 18px; align-items: center; }
.health-parts { display: flex; flex-direction: column; gap: 9px; }
.hpart { display: grid; grid-template-columns: minmax(0, 1fr) minmax(64px, 100px) 28px; gap: 10px; align-items: center; font-size: 13px; color: var(--text-2); }
.hpart .progress { height: 6px; }
.hpart b { text-align: right; font-family: var(--font-mono); font-size: 12.5px; color: var(--text); font-weight: 550; }

/* ---------- stat strip ---------- */
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.strip > div { padding: 12px 16px; border-left: 1px solid var(--line); min-width: 0; }
.strip > div:first-child { border-left: 0; }
.strip .k { font-size: 12.5px; color: var(--text-3); display: flex; gap: 5px; align-items: center; }
.strip .v { font-size: 20px; font-weight: 550; margin-top: 3px; white-space: nowrap; }
.strip .s { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ---------- podium ---------- */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.podium .card { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.podium .big { font-size: 24px; font-weight: 550; font-family: var(--font-mono); letter-spacing: -0.03em; white-space: nowrap; }
.podium .who { font-weight: 600; font-size: 15px; }

/* ---------- callouts, steps, empty ---------- */
.callout { display: flex; gap: 10px; padding: 13px 15px; border-radius: 13px; background: var(--surface-2); font-size: 13.5px; color: var(--text-2); line-height: 1.55; }
.callout > svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.callout b, .callout strong { color: var(--text); font-weight: 600; }
.callout.info { background: var(--info-soft); } .callout.info > svg { color: var(--info); }
.callout.warn { background: var(--warn-soft); } .callout.warn > svg { color: var(--warn); }
.callout.bad { background: var(--bad-soft); } .callout.bad > svg { color: var(--bad); }
.callout.good { background: var(--good-soft); } .callout.good > svg { color: var(--good); }
.steps { counter-reset: step; display: flex; flex-direction: column; gap: 18px; }
.step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; }
.step::before { counter-increment: step; content: counter(step); width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  font-weight: 600; font-size: 12.5px; font-family: var(--font-mono); background: var(--surface-2); color: var(--text-2); }
.step .t { font-weight: 600; margin: 2px 0 3px; font-size: 14.5px; }
.step .d { color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.checklist .check-item { display: flex; gap: 12px; padding: 13px 20px; align-items: center; border-top: 1px solid var(--line); }
.checklist .check-item:first-child { border-top: 0; }
.check-item .ring { width: 22px; height: 22px; border-radius: 50%; border: 1.5px dashed var(--line-strong); display: grid; place-items: center; flex: none; color: #fff; }
.check-item.done .ring { background: var(--good-mark); border: 0; }
.check-item.done .t { color: var(--text-3); }
.check-item .t { font-weight: 550; font-size: 14px; } .check-item .d { color: var(--text-2); font-size: 13px; }
.empty { text-align: center; padding: 36px 22px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .icon { width: 44px; height: 44px; border-radius: 13px; background: var(--surface-2); display: grid; place-items: center; color: var(--text-2); margin-bottom: 4px; }
.empty h3 { font-size: 16px; font-weight: 600; }
.empty p { color: var(--text-2); max-width: 46ch; line-height: 1.55; font-size: 13.5px; }
.empty .btn-group { margin-top: 8px; justify-content: center; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- copy / code ---------- */
.copy { display: flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--radius-md); overflow: hidden; background: var(--surface-2); }
.copy pre, .copy .val { margin: 0; flex: 1; min-width: 0; padding: 11px 13px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6;
  overflow-x: auto; white-space: pre; color: var(--text); }
.copy button { border: 0; border-left: 1px solid var(--line-strong); background: var(--surface); padding: 0 14px; cursor: pointer; font-weight: 550;
  font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; min-width: 92px; justify-content: center; }
.copy button:hover { color: var(--text); background: var(--surface-2); }
.copy button.done { color: var(--good); }
.copy button svg { width: 15px; height: 15px; }
.codeblock { font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; white-space: pre-wrap;
  word-break: break-all; margin: 0; max-height: 300px; overflow: auto; }

/* ---------- sheet ---------- */
.overlay { position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(3px); z-index: 80; display: flex; align-items: center;
  justify-content: center; padding: 20px; animation: fade 0.15s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg), var(--card-ring); width: min(560px, 100%);
  max-height: min(90vh, 900px); display: flex; flex-direction: column; animation: rise 0.24s var(--ease); }
.sheet.wide { width: min(760px, 100%); }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(0.99); } }
.sheet-grip { display: none; width: 38px; height: 4px; border-radius: 999px; background: var(--line-strong); margin: 9px auto 0; }
.sheet-head { padding: 20px 22px 4px; display: flex; gap: 10px; align-items: flex-start; }
.sheet-head h2 { font-size: 18px; font-weight: 600; }
.sheet-head p { color: var(--text-2); margin-top: 5px; font-size: 13.5px; line-height: 1.55; }
.sheet-body { padding: 14px 22px 18px; overflow-y: auto; }
.sheet-foot { padding: 12px 22px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

/* ---------- menus ---------- */
.menu-anchor { position: relative; }
.menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 270px; max-width: min(92vw, 350px); background: var(--surface);
  border-radius: 14px; box-shadow: var(--shadow-lg), var(--card-ring); padding: 6px; z-index: 60; animation: pop 0.14s var(--ease); }
.menu.right { left: auto; right: 0; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 10px; border-radius: 9px; border: 0;
  background: none; cursor: pointer; text-align: left; font-size: 14px; font-weight: 500; color: var(--text); }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); }
.menu-item small { display: block; color: var(--text-3); font-size: 12px; font-weight: 400; }
.menu-sep { height: 1px; background: var(--line); margin: 5px 6px; }
.menu-label { font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 7px 10px 3px; letter-spacing: 0.03em; text-transform: uppercase; }
/* the master trading switch, loud only when trading is stopped */
.switcher-btn.danger-pill { border-color: var(--bad-mark); color: var(--bad); background: var(--bad-soft); font-weight: 600; }
.switcher-btn.danger-pill:hover { background: var(--bad-soft); border-color: var(--bad); }
.switcher-btn[disabled] { opacity: 0.55; cursor: default; }
.only-mobile-inline { display: none; }
.switcher-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 500; font-size: 13.5px; max-width: 300px; min-width: 0; }
.switcher-btn .meta { color: var(--text-3); font-size: 12.5px; font-family: var(--font-mono); }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border-radius: 13px; box-shadow: var(--shadow-lg), var(--card-ring);
  padding: 12px 14px; font-size: 13.5px; animation: rise 0.2s var(--ease); }
.toast .bar { width: 3px; align-self: stretch; border-radius: 3px; background: var(--info); flex: none; }
.toast.good .bar { background: var(--good-mark); } .toast.bad .bar { background: var(--bad-mark); } .toast.warn .bar { background: var(--warn-mark); }
.toast button { margin-left: auto; border: 0; background: none; color: var(--text-3); cursor: pointer; font-size: 17px; line-height: 1; }

/* ---------- charts ---------- */
.chart { width: 100%; }
.is-loading { opacity: 0.5; transition: opacity 0.2s; pointer-events: none; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.legend i.box { width: 10px; height: 10px; border-radius: 3px; }
.spark { display: block; overflow: visible; }
/* a labelled percentage with its bar underneath */
.rate-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 14px; align-items: baseline; font-size: 13.5px; color: var(--text-2); }
.rate-row .progress { grid-column: 1 / -1; }
.rate-row b { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 550; color: var(--text); }
.acct-icon { width: 38px; height: 38px; border-radius: 11px; background: var(--surface-2); color: var(--text-2); display: grid; place-items: center;
  font-weight: 600; font-size: 13px; flex: none; }
.logline { font-family: var(--font-mono); font-size: 12px; line-height: 1.5; }

/* form ribbon — the last N trades as win/loss ticks */
.ribbon { display: flex; gap: 3px; align-items: flex-end; height: 34px; }
.ribbon i { flex: 1 1 4px; min-width: 3px; border-radius: 2px; background: var(--neutral-mid); }
.ribbon i.w { background: var(--good-mark); } .ribbon i.l { background: var(--bad-mark); }
.ribbon i.sm { opacity: 0.55; }

/* ---------- trade ticket ---------- */
.ticket-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ticket-side { border: 1px solid var(--line-strong); border-radius: 13px; padding: 12px 14px; cursor: pointer; background: var(--surface); text-align: left; min-height: 70px; }
.ticket-side .p { font-size: 19px; font-weight: 550; font-family: var(--font-mono); letter-spacing: -0.02em; margin-top: 2px; }
.ticket-side .l { font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; }
.ticket-side.buy .l { color: var(--good); } .ticket-side.sell .l { color: var(--bad); }
.ticket-side.on.buy { border-color: var(--good-mark); box-shadow: 0 0 0 1px var(--good-mark); background: var(--good-soft); }
.ticket-side.on.sell { border-color: var(--bad-mark); box-shadow: 0 0 0 1px var(--bad-mark); background: var(--bad-soft); }
.suggest { position: absolute; top: calc(100% + 5px); left: 0; right: 0; background: var(--surface); border-radius: 13px;
  box-shadow: var(--shadow-lg), var(--card-ring); z-index: 50; max-height: 270px; overflow: auto; padding: 5px; }
.suggest button { width: 100%; display: flex; justify-content: space-between; gap: 12px; min-height: 40px; padding: 7px 11px; border: 0; background: none;
  border-radius: 9px; cursor: pointer; text-align: left; font-size: 13.5px; }
.suggest button:hover, .suggest button.hl { background: var(--surface-2); }
.suggest small { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-buy > td:first-child { box-shadow: inset 2px 0 0 var(--good-mark); }
.pos-sell > td:first-child { box-shadow: inset 2px 0 0 var(--bad-mark); }

/* ---------- tooltips ---------- */
.tip-btn { border: 0; background: none; padding: 3px; margin: -3px 0; color: var(--text-3); cursor: help; display: inline-flex; border-radius: 6px;
  vertical-align: middle; font: inherit; }
.tip-btn:hover, .tip-btn[aria-expanded="true"] { color: var(--text); }
.tip-bubble { position: fixed; z-index: 120; background: var(--text); color: var(--bg); font-size: 12.5px; font-weight: 400; line-height: 1.5;
  padding: 9px 11px; border-radius: 10px; box-shadow: var(--shadow-md); text-align: left; letter-spacing: -0.004em; white-space: normal;
  text-transform: none; cursor: auto; font-family: var(--font); animation: pop 0.12s var(--ease); }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--bg); }
.auth-art { background: linear-gradient(165deg, #1E1E25, #101014 60%); color: #fff; padding: 40px 44px; display: flex; flex-direction: column;
  justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::after { content: ""; position: absolute; right: -140px; bottom: -160px; width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 155, 255, 0.22), transparent 66%); }
.auth-art h2 { font-size: 32px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.18; max-width: 17ch; position: relative; z-index: 1; }
.auth-art p { color: #A9A9B6; font-size: 15px; line-height: 1.6; max-width: 44ch; margin-top: 14px; position: relative; z-index: 1; }
.auth-form { display: grid; place-items: center; padding: 36px 22px; }
.auth-card { width: min(400px, 100%); }
.auth-card h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; margin: 20px 0 6px; }

/* ---------- responsive ---------- */
.only-mobile { display: none !important; }
@media (max-width: 1180px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g-main-r, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .podium { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .topnav { display: none; }
  .appbar { display: flex; }
  .tabbar { display: grid; }
  .page { padding: 4px 16px calc(var(--tabbar-h) + 30px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 16px; }
  .g-2 { grid-template-columns: minmax(0, 1fr); }
  .only-mobile { display: block !important; }
  .only-mobile-inline { display: inline !important; }
  .only-desktop { display: none !important; }
  .toasts { left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + 12px); width: auto; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
}
@media (max-width: 640px) {
  .grid { gap: 10px; }
  .stack.lg { gap: 10px; }
  .hide-sm { display: none !important; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 21px; }
  .card { border-radius: 14px; }
  .card-head { padding: 12px 14px 0; }
  .card-body { padding: 10px 14px 12px; }
  .card.pad { padding: 15px 16px; }
  .kpi { padding: 13px 14px; }
  .kpi-value { font-size: 19px; }
  .kpi-spark { display: none; }
  .list-row { padding: 9px 14px; }
  .table { font-size: 12.5px; }
  .table td, .table th { padding: 8px 10px; }
  .table.compact td, .table.compact th { padding: 7px 9px; }
  .table .col-name { min-width: 140px; }
  .table.sticky-first td:first-child { max-width: 150px; }
  .strip .v { font-size: 17px; }
  .checklist .check-item { padding: 12px 16px; flex-wrap: wrap; }
  .checklist .check-item .btn { flex: 1 1 100%; }
  .hero { padding: 17px 16px 15px; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip > div { border-left: 0; border-top: 1px solid var(--line); padding: 12px 14px; }
  .strip > div:nth-child(-n + 2) { border-top: 0; }
  .strip > div:nth-child(even) { border-left: 1px solid var(--line); }
  .strip .v { font-size: 17px; }
  .big-num { font-size: 24px; }
  .metric { padding: 11px 14px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overlay:not(.center) { align-items: flex-end; padding: 0; }
  .sheet { border-radius: 20px 20px 0 0; width: 100%; max-height: 92vh; animation: up 0.26s var(--ease); padding-bottom: env(safe-area-inset-bottom); }
  .sheet-grip { display: block; }
  @keyframes up { from { transform: translateY(36px); opacity: 0.5; } }
  .sheet-foot .btn { flex: 1; }
  /* tables become stacked cards */
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr { padding: 11px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 5px 12px; }
  .rtable tbody tr:hover { background: transparent; }
  .rtable td { border: 0; padding: 0; text-align: left !important; min-width: 0; }
  .rtable td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--text-3); font-family: var(--font); margin-bottom: 1px; }
  .rtable td.cell-main { grid-column: 1 / -1; order: -1; }
  .rtable td.cell-actions { grid-column: 1 / -1; display: flex; gap: 8px; order: 99; }
  .rtable td.cell-actions .btn { flex: 1; }
  .rtable td.hide-sm { display: none; }
  .rtable tfoot { display: none; }
  .rtable tr > td:first-child { box-shadow: none; }
  .rtable tr.pos-buy { box-shadow: inset 3px 0 0 var(--good-mark); }
  .rtable tr.pos-sell { box-shadow: inset 3px 0 0 var(--bad-mark); }
  .rtable tr.detail { display: block; padding: 2px 16px 12px; }
  .page-head .head-actions { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
