/* Tovades: soft pastels (lavender, mint, peach, butter) with deep plum ink. */

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f7f6fb;
  --surface: #ffffff;
  --surface-2: #f4f2fa;
  --surface-3: #ebe7f6;
  --border: #e8e4f2;
  --border-strong: #d4cee8;
  --text: #26233a;
  --text-2: #5d5873;
  --muted: #918ca6;
  --accent: #6f5ee8;
  --accent-ink: #ffffff;
  --accent-soft: #ece8ff;
  --pos: #1c8455;
  --pos-soft: #dcf4e8;
  --neg: #c4473c;
  --neg-soft: #fde5e0;
  --warn: #996000;
  --warn-soft: #fcefd0;
  --info: #3456b8;
  --info-soft: #e1e9ff;
  --series-buy: #5b7bd6;
  --series-sell: #e07052;
  --series-fc: #5d5873;
  --band: rgba(111, 94, 232, 0.12);
  --grid: #f0edf7;
  --header-bg: #efecfc;
  --header-border: #e2ddf6;
  --header-text: #26233a;
  --header-muted: #6f6a88;
  --header-field: #ffffff;
  --header-field-border: #d9d3f0;
  --shadow: 0 1px 2px rgba(60, 45, 120, 0.05), 0 2px 8px rgba(60, 45, 120, 0.04);
  --shadow-lg: 0 20px 44px -16px rgba(60, 45, 120, 0.28);
  --radius: 12px;
  --radius-sm: 8px;
  --font-body: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-num: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #17151f;
    --surface: #1f1c29;
    --surface-2: #262233;
    --surface-3: #302b40;
    --border: #2d2939;
    --border-strong: #403a55;
    --text: #f1eef9;
    --text-2: #bdb7d1;
    --muted: #857f9c;
    --accent: #b3a6ff;
    --accent-ink: #17151f;
    --accent-soft: rgba(179, 166, 255, 0.15);
    --pos: #7fdcaa;
    --pos-soft: rgba(127, 220, 170, 0.14);
    --neg: #ff9a8b;
    --neg-soft: rgba(255, 154, 139, 0.14);
    --warn: #f5cf7a;
    --warn-soft: rgba(245, 207, 122, 0.14);
    --info: #9cb8ff;
    --info-soft: rgba(156, 184, 255, 0.14);
    --series-buy: #6a86de;
    --series-sell: #d9705a;
    --series-fc: #cfc9e2;
    --band: rgba(179, 166, 255, 0.12);
    --grid: #24212f;
    --header-bg: #1f1c29;
    --header-border: #2d2939;
    --header-text: #f1eef9;
    --header-muted: #a29cba;
    --header-field: #262233;
    --header-field-border: #403a55;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, 0.7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17151f;
  --surface: #1f1c29;
  --surface-2: #262233;
  --surface-3: #302b40;
  --border: #2d2939;
  --border-strong: #403a55;
  --text: #f1eef9;
  --text-2: #bdb7d1;
  --muted: #857f9c;
  --accent: #b3a6ff;
  --accent-ink: #17151f;
  --accent-soft: rgba(179, 166, 255, 0.15);
  --pos: #7fdcaa;
  --pos-soft: rgba(127, 220, 170, 0.14);
  --neg: #ff9a8b;
  --neg-soft: rgba(255, 154, 139, 0.14);
  --warn: #f5cf7a;
  --warn-soft: rgba(245, 207, 122, 0.14);
  --info: #9cb8ff;
  --info-soft: rgba(156, 184, 255, 0.14);
  --series-buy: #6a86de;
  --series-sell: #d9705a;
  --series-fc: #cfc9e2;
  --band: rgba(179, 166, 255, 0.12);
  --grid: #24212f;
  --header-bg: #1f1c29;
  --header-border: #2d2939;
  --header-text: #f1eef9;
  --header-muted: #a29cba;
  --header-field: #262233;
  --header-field-border: #403a55;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, 0.7);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font-body); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img.icon { width: 28px; height: 28px; object-fit: contain; image-rendering: pixelated; flex: none; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.muted { color: var(--muted); }
.num, td, .price, .profit, .kpi-value, .stat .v, .fc .v, .tooltip b, .ledger b, .mini-ledger b { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
td:first-child, td .pill, td .conf, td .btn { font-family: var(--font-body); letter-spacing: normal; }
.display { font-family: var(--font-body); font-stretch: 87.5%; font-weight: 750; letter-spacing: -0.015em; line-height: 1.05; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ---------- header (always black) ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--header-bg); color: var(--header-text); border-bottom: 1px solid var(--header-border); }
.topbar .wrap { display: flex; align-items: center; gap: 16px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; white-space: nowrap; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.brand b { font-stretch: 87.5%; font-weight: 750; font-size: 19px; letter-spacing: -0.01em; }
.brand small { color: var(--header-muted); font-size: 12.5px; border-left: 1px solid var(--header-field-border); padding-left: 10px; margin-left: 2px; font-weight: 600; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 10px; border: 1px solid var(--header-field-border); border-radius: var(--radius); color: var(--header-muted); font-size: 12px; white-space: nowrap; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.live-dot.on { background: var(--pos); }
.live-dot.err { background: var(--neg); }
.spacer { flex: 1; }
.search { position: relative; }
.search input { width: 260px; height: 34px; padding: 0 12px 0 34px; border: 1px solid var(--header-field-border); border-radius: var(--radius); background: var(--header-field); color: var(--header-text); outline: none; }
.search input::placeholder { color: var(--header-muted); }
.search input:focus { border-color: var(--accent); }
.search svg { position: absolute; left: 11px; top: 10px; color: var(--header-muted); pointer-events: none; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 4px; max-height: 360px; overflow-y: auto; }
.search-results button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; background: none; border-radius: var(--radius-sm); text-align: left; }
.search-results button:hover, .search-results button.active { background: var(--surface-2); }
.search-results img { width: 22px; height: 22px; }
.search-empty { padding: 10px; color: var(--muted); }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text-2); }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.topbar .icon-btn { background: var(--header-field); border-color: var(--header-field-border); color: var(--header-muted); }
.topbar .icon-btn:hover { color: var(--header-text); }

/* ---------- toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 14px 16px; padding: 28px 0 18px; }
.page-title h1 { margin: 0; font-size: 40px; }
.page-title p { margin: 8px 0 0; color: var(--text-2); }
.controls { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-left: auto; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.field input { width: 120px; height: 36px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); outline: none; }
.field input:focus { border-color: var(--accent); }
.segmented { display: inline-flex; height: 36px; padding: 3px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.segmented button { border: 0; background: none; padding: 0 12px; border-radius: 8px; color: var(--text-2); font-weight: 600; font-size: 13px; }
.segmented button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); font-weight: 600; font-size: 13px; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { color: var(--text); border-color: var(--border-strong); }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); margin-bottom: 30px; }
.kpi { padding: 14px 16px; min-width: 0; }
.kpi + .kpi { border-left: 1px solid var(--border); }
.kpi-label { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.kpi-value { font-size: 22px; font-weight: 600; margin-top: 4px; }
.kpi-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- sections ---------- */
section { margin-bottom: 34px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0 0 12px; }
.section-head h2 { margin: 0; font-size: 24px; white-space: nowrap; }
.section-head p { margin: 0; color: var(--muted); font-size: 13px; }
.section-head .actions { margin-left: auto; display: flex; gap: 6px; }

/* ---------- pick cards (compact) ---------- */
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; transition: opacity .2s; }
.loading .picks, .loading .table-card { opacity: .55; }
.pick { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; transition: border-color .12s, box-shadow .12s; overflow: hidden; }
.pick:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.pick-head { display: flex; align-items: center; gap: 9px; padding: 10px 12px; }
.pick-rank { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-family: var(--font-num); font-size: 11px; font-weight: 700; flex: none; }
.pick-head img.icon { width: 24px; height: 24px; }
.pick-name { font-weight: 700; line-height: 1.2; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-name small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; }
.prices { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.price-cell { padding: 7px 12px; min-width: 0; }
.price-cell + .price-cell { border-left: 1px solid var(--border); }
.price-label { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.price-label i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: inline-block; }
.price { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 600; border: 0; background: none; padding: 0; }
.price .copy { opacity: 0; color: var(--muted); transition: opacity .12s; }
.price:hover .copy, .price:focus-visible .copy { opacity: 1; }
.price-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.age.stale { color: var(--warn); font-weight: 600; }
.pick-body { padding: 9px 12px 10px; display: grid; gap: 7px; }
.profit-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.profit { font-size: 20px; font-weight: 700; color: var(--pos); }
.profit-row .roi { font-size: 12px; color: var(--text-2); font-family: var(--font-num); }
.guide-row { display: flex; align-items: baseline; gap: 8px; padding: 6px 12px; background: var(--accent-soft); font-size: 12px; color: var(--text-2); border-bottom: 1px solid var(--border); }
.guide-row b { font-family: var(--font-num); font-weight: 600; color: var(--text); letter-spacing: -0.02em; }
.guide-row em { margin-left: auto; font-style: normal; color: var(--muted); font-family: var(--font-num); font-size: 11.5px; }
.mini-ledger { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--surface-2); border-radius: var(--radius-sm); }
.mini-ledger div { padding: 5px 8px; min-width: 0; }
.mini-ledger div + div { border-left: 1px solid var(--border); }
.mini-ledger span { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.mini-ledger b { font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12px; color: var(--text-2); }
.meta b { font-family: var(--font-num); font-weight: 500; color: var(--text); }
.pick-foot { margin-top: auto; padding: 6px 8px 6px 12px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.pick-foot > span:nth-child(2) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 30px 20px; text-align: center; color: var(--text-2); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }

/* ---------- tags ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; flex: none; }
.pill.Flip { background: var(--info-soft); color: var(--info); }
.pill.Hold { background: var(--pos-soft); color: var(--pos); }
.pill.Risky { background: var(--warn-soft); color: var(--warn); }
.pill.Avoid { background: var(--neg-soft); color: var(--neg); }
.pill.Open { background: var(--surface-3); color: var(--text-2); }
.pill.Ready { background: var(--pos-soft); color: var(--pos); }
.pill.Under { background: var(--neg-soft); color: var(--neg); }
.pill.Sold { background: var(--accent-soft); color: var(--accent); }
.conf { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); }
.conf-bars { display: inline-flex; gap: 2px; }
.conf-bars i { width: 3px; height: 10px; border-radius: 2px; background: var(--surface-3); }
.conf-bars i.f { background: var(--accent); }

/* ---------- tables ---------- */
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: opacity .2s; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 12px; text-align: right; white-space: nowrap; }
th { background: var(--surface-2); color: var(--muted); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--border); cursor: pointer; user-select: none; }
th:hover { color: var(--text); }
th .arrow { display: inline-block; width: 10px; color: var(--text); }
th:first-child, td:first-child, th:nth-child(2), td:nth-child(2) { text-align: left; }
tbody tr { border-bottom: 1px solid var(--border); cursor: pointer; }
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
.cell-item { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.cell-item img { width: 22px; height: 22px; }
.row-actions { display: inline-flex; gap: 2px; }
.trades-table th, .trades-table td { padding: 8px 10px; }
.trades-table td.when { font-family: var(--font-body); letter-spacing: normal; }
.trades-table .btn.sm.ghost { width: 28px; padding: 0; }

/* ---------- my trades ---------- */
.trade-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: var(--surface); }
.trade-kpis + .table-card { border-radius: 0 0 var(--radius) var(--radius); }
.trades-empty { display: block; padding: 14px 16px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--text-2); font-size: 13px; }

/* ---------- how it works ---------- */
.how { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2px 18px; }
.how summary { cursor: pointer; padding: 13px 0; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.how summary::-webkit-details-marker { display: none; }
.how summary svg { transition: transform .2s; color: var(--muted); }
.how[open] summary svg { transform: rotate(90deg); }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 28px; padding-bottom: 16px; }
.how-grid h3 { font-size: 13px; margin: 10px 0 4px; }
.how-grid p { margin: 0; color: var(--text-2); font-size: 13px; }
footer { color: var(--muted); font-size: 12px; padding: 8px 0 40px; }
footer a { color: var(--text-2); }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(38, 35, 58, 0.35); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(780px, 100%); background: var(--bg); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .22s cubic-bezier(.2,.8,.2,1); overflow-y: auto; overscroll-behavior: contain; }
.drawer.open { transform: none; }
.drawer-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 14px 22px; background: var(--header-bg); color: var(--header-text); }
.drawer-head img { width: 34px; height: 34px; }
.drawer-head h2 { margin: 0; font-size: 24px; }
.drawer-head p { margin: 2px 0 0; color: var(--header-muted); font-size: 12.5px; }
.drawer-head .icon-btn { background: var(--header-field); border-color: var(--header-field-border); color: var(--header-muted); }
.drawer-body { padding: 18px 22px 40px; display: grid; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-pad { padding: 14px 16px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-title h3, .drawer-head h2 { font-stretch: 87.5%; font-weight: 750; letter-spacing: -0.01em; }
.card-title h3 { margin: 0; font-size: 18px; }
.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat { padding: 12px 16px; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat .k { font-size: 10.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.stat .v { font-size: 19px; font-weight: 600; margin-top: 3px; }
.stat .s { font-size: 12px; color: var(--text-2); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 9px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; font-weight: 800; font-family: var(--font-num); }
.steps li.warn::before { content: "!"; background: var(--warn-soft); color: var(--warn); }
.note { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }
.ledger { display: grid; gap: 3px; padding: 9px 12px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 13px; }
.ledger div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ledger span { color: var(--text-2); }
.ledger small { color: var(--muted); font-size: 11.5px; margin-left: 4px; font-family: var(--font-num); }
.ledger b { font-weight: 500; }
.ledger .total { border-top: 1px solid var(--border-strong); margin-top: 4px; padding-top: 6px; }
.ledger .total span { color: var(--text); font-weight: 700; }
.ledger .total b { font-weight: 700; }

/* ---------- charts ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font-num); }
.chart .gridline { stroke: var(--grid); }
.chart .baseline { stroke: var(--border-strong); }
.chart .endlabel { font-size: 11px; font-weight: 600; fill: var(--text-2); font-family: var(--font-num); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 14px; height: 2px; background: var(--c); }
.legend i.dash { background: repeating-linear-gradient(90deg, var(--c) 0 4px, transparent 4px 7px); }
.legend i.box { width: 10px; height: 10px; }
.tooltip { position: absolute; pointer-events: none; z-index: 3; min-width: 150px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 8px 10px; font-size: 12px; opacity: 0; transition: opacity .1s; }
.tooltip.show { opacity: 1; }
.tooltip .t { color: var(--muted); margin-bottom: 4px; }
.tooltip .r { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tooltip .r span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.tooltip .r i { width: 10px; height: 2px; background: var(--c); }
.tooltip .r b { color: var(--text); font-weight: 500; }
.fc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fc { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.fc .k { font-size: 10.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.fc .v { font-size: 22px; font-weight: 700; }
.fc .s { font-size: 12px; color: var(--text-2); }
.mini-table { width: 100%; font-size: 13px; }
.mini-table th { background: none; cursor: default; padding: 6px 8px; }
.mini-table td { padding: 8px; border-top: 1px solid var(--border); }
.weight { display: inline-block; width: 60px; height: 6px; background: var(--surface-3); vertical-align: middle; margin-right: 8px; overflow: hidden; }
.weight i { display: block; height: 100%; background: var(--accent); border-radius: var(--radius-sm); }

/* ---------- dialog ---------- */
dialog.sheet { width: min(440px, calc(100% - 32px)); padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.sheet::backdrop { background: rgba(0, 0, 0, 0.55); }
.dlg-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--header-bg); color: var(--header-text); }
.dlg-head img { width: 30px; height: 30px; image-rendering: pixelated; }
.dlg-head h3 { margin: 0; font-size: 22px; }
.dlg-head p { margin: 2px 0 0; font-size: 12px; color: var(--header-muted); }
.dlg-body { padding: 16px 18px; display: grid; gap: 12px; }
.dlg-body .field input { width: 100%; }
.dlg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dlg-preview { font-size: 12.5px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 9px 14px; border-radius: var(--radius); font-size: 13px; font-weight: 600; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .kpis, .trade-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .search input { width: 180px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--border); }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .brand small { display: none; }
  .topbar .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 10px 12px; }
  .search { order: 10; width: 100%; }
  .search input { width: 100%; }
  .controls { margin-left: 0; width: 100%; }
  .field { flex: 1 1 120px; }
  .field input { width: 100%; }
  .page-title h1 { font-size: 32px; }
  .kpi { padding: 12px 14px; }
  .kpi-value { font-size: 18px; }
  .stat .v, .stat .v .price { font-size: 16px !important; }
  .drawer-body { padding: 14px; }
  .drawer-head { padding: 12px 14px; }
  .fc-grid { grid-template-columns: 1fr; }
  .section-head .actions { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
