/* ============================================================
   Nacle Crypto — estilos
   ============================================================ */

:root {
  color-scheme: dark;
  --bg:        #0b0c0d;
  --surface:   #131416;
  --surface-2: #1a1b1e;
  --surface-3: #222327;
  --border:    rgba(255,255,255,0.07);
  --border-2:  rgba(255,255,255,0.12);
  --ink:       #ecebe7;
  --ink-2:     #b4b3ad;
  --ink-3:     #7d7c77;
  --grid:      #212225;
  --axis:      #34353a;
  --pos:       #2fb36b;
  --pos-ink:   #4cc685;
  --neg:       #e5534b;
  --neg-ink:   #f0716a;
  --warn:      #e0a13a;
  --focus:     #8ab4f8;
  --overlay:   rgba(4,5,6,0.72);
  --shadow:    0 24px 64px rgba(0,0,0,0.5);
  --s1:#3987e5; --s2:#d95926; --s3:#199e70; --s4:#c98500;
  --s5:#d55181; --s6:#0ca30c; --s7:#9085e9; --s8:#e66767; --s0:#5f5f5c;
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg:        #f6f6f4;
  --surface:   #ffffff;
  --surface-2: #f3f3f1;
  --surface-3: #ebebe8;
  --border:    rgba(11,11,11,0.08);
  --border-2:  rgba(11,11,11,0.14);
  --ink:       #111111;
  --ink-2:     #52514e;
  --ink-3:     #85847f;
  --grid:      #ecebe6;
  --axis:      #d3d2cb;
  --pos:       #128a4a;
  --pos-ink:   #0d7a40;
  --neg:       #cf3a33;
  --neg-ink:   #c0322b;
  --warn:      #b37814;
  --focus:     #2a78d6;
  --overlay:   rgba(20,20,20,0.35);
  --shadow:    0 24px 64px rgba(0,0,0,0.16);
  --s1:#2a78d6; --s2:#eb6834; --s3:#1baf7a; --s4:#eda100;
  --s5:#e87ba4; --s6:#008300; --s7:#6250d6; --s8:#e34948; --s0:#a3a29c;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.5 var(--font);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.num, td.num, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.pos { color: var(--pos-ink); }
.neg { color: var(--neg-ink); }
[hidden] { display: none !important; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; height: 60px;
  padding: 0 24px; display: flex; align-items: center; gap: 32px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; letter-spacing: -0.01em; }
.brand-mark { width: 22px; height: 22px; }
.brand-name { font-size: 15px; }
.brand-sub { font-size: 15px; color: var(--ink-3); font-weight: 500; }
.nav { display: flex; gap: 4px; }
.nav a {
  padding: 6px 12px; border-radius: 8px; color: var(--ink-3);
  font-weight: 500; font-size: 13.5px; transition: color .15s, background .15s;
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); background: var(--surface-2); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center;
  border: 1px solid transparent; background: transparent; border-radius: 8px;
  color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.spin svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.status {
  display: inline-flex; align-items: center; gap: 8px; height: 30px;
  padding: 0 10px; border-radius: 999px; border: 1px solid var(--border);
  background: transparent; color: var(--ink-3); font-size: 12px; cursor: pointer;
  white-space: nowrap;
}
.status:hover { color: var(--ink-2); border-color: var(--border-2); }
.status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.status.ok .dot { background: var(--pos); }
.status.warn .dot { background: var(--warn); }
.status.loading .dot { background: var(--ink-2); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- Layout ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 32px 24px 64px; outline: none; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.view-head h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.view-head p { margin: 2px 0 0; color: var(--ink-3); font-size: 13px; }
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.panel + .panel, .stack > * + * { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-title { font-size: 13px; font-weight: 500; color: var(--ink-2); margin: 0; }
.eyebrow { font-size: 12.5px; color: var(--ink-3); font-weight: 500; letter-spacing: 0.01em; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 2fr); gap: 32px;
  align-items: end; padding: 4px 0 28px;
}
.hero-value {
  font-size: 44px; font-weight: 500; letter-spacing: -0.035em; line-height: 1.1;
  margin: 6px 0 8px; white-space: nowrap;
}
.hero-value .cur { color: var(--ink-3); font-weight: 400; margin-right: 4px; font-size: 0.62em; vertical-align: 0.32em; letter-spacing: -0.01em; }
.delta { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; }
.delta .tag { color: var(--ink-3); font-weight: 400; }
.delta svg { width: 10px; height: 10px; }
.hero-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.hero-stats > div { padding: 16px 18px; min-width: 0; }
.hero-stats > div + div { border-left: 1px solid var(--border); }
.hero-stats dt { font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }
.hero-stats dd { margin: 0; font-size: 18px; font-weight: 500; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-stats small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Segmented ---------- */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button {
  border: 0; background: transparent; color: var(--ink-3); font-size: 12.5px; font-weight: 500;
  padding: 5px 10px; border-radius: 6px; cursor: pointer; font-variant-numeric: tabular-nums;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); box-shadow: 0 1px 0 rgba(0,0,0,.15); }

/* ---------- Chart ---------- */
.chart-meta { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.chart-meta .result { font-size: 13.5px; font-weight: 500; }
.legend-inline { display: flex; gap: 16px; font-size: 12px; color: var(--ink-3); }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.legend-inline i { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--ink-2); }
.legend-inline i.dash { border-top: 1.5px dashed var(--ink-3); }
.chart-box { position: relative; height: 300px; margin: 0 -4px; }
.chart-box svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-box .axis-label { fill: var(--ink-3); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-empty {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  color: var(--ink-3); font-size: 13px; padding: 24px;
}
.chart-note { margin-top: 10px; font-size: 12px; color: var(--ink-3); }
.chart-tip {
  position: fixed; z-index: 60; pointer-events: none;
  background: var(--surface-3); border: 1px solid var(--border-2); border-radius: 10px;
  padding: 10px 12px; font-size: 12px; min-width: 180px; box-shadow: var(--shadow);
}
.chart-tip .t-date { color: var(--ink-3); margin-bottom: 6px; }
.chart-tip .t-row { display: flex; justify-content: space-between; gap: 16px; font-variant-numeric: tabular-nums; }
.chart-tip .t-row span:first-child { color: var(--ink-2); }
.chart-tip .t-row strong { font-weight: 500; }

/* ---------- Movers ---------- */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.grid-2 > .panel { margin: 0; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.rows li:first-child { border-top: 0; padding-top: 0; }
.rows li:last-child { padding-bottom: 0; }
.rows .grow { flex: 1; min-width: 0; }
.rows .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rows .r small { display: block; color: var(--ink-3); font-size: 12px; }
.bar-track { height: 4px; background: var(--surface-3); border-radius: 4px; margin-top: 6px; overflow: hidden; }
.bar-track > i { display: block; height: 100%; border-radius: 4px; }

/* ---------- Asset identity ---------- */
.coin { display: flex; align-items: center; gap: 12px; min-width: 0; }
.coin-badge {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--surface-2); font-size: 10px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--ink-2); position: relative; overflow: hidden;
  box-shadow: inset 0 0 0 1.5px var(--c, var(--s0));
}
.coin-badge img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .2s; }
.coin-badge.has-img { background: transparent; box-shadow: none; }
.coin-badge.has-img img { opacity: 1; }
.coin-badge.has-img .mono { visibility: hidden; }
.coin-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coin-sym { color: var(--ink-3); font-size: 12px; font-family: var(--mono); letter-spacing: 0.02em; }
.coin-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px -20px; }
table.assets { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.assets th {
  text-align: right; font-weight: 500; font-size: 12px; color: var(--ink-3);
  padding: 0 20px 12px; white-space: nowrap; border-bottom: 1px solid var(--border);
}
table.assets th:first-child, table.assets td:first-child { text-align: left; }
table.assets td {
  text-align: right; padding: 14px 20px; border-bottom: 1px solid var(--border);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
table.assets tbody tr { cursor: pointer; transition: background .12s; }
table.assets tbody tr:hover { background: var(--surface-2); }
table.assets tbody tr:last-child td { border-bottom: 0; }
table.assets td small { display: block; font-size: 12px; color: var(--ink-3); }
table.assets tfoot td { border-top: 1px solid var(--border-2); border-bottom: 0; font-weight: 500; padding-top: 14px; padding-bottom: 16px; }
tr.closed td { color: var(--ink-3); }
.src-tag { font-size: 10.5px; color: var(--ink-3); border: 1px solid var(--border-2); border-radius: 4px; padding: 0 4px; margin-left: 6px; vertical-align: 1px; }

.cards { display: none; list-style: none; margin: 0; padding: 0; }
.cards li { padding: 14px 0; border-top: 1px solid var(--border); cursor: pointer; }
.cards li:first-child { border-top: 0; padding-top: 0; }
.cards li:last-child { padding-bottom: 0; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-top .r { text-align: right; font-variant-numeric: tabular-nums; }
.card-top .r strong { display: block; font-weight: 500; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; padding-left: 42px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.card-grid span { display: block; color: var(--ink-3); font-size: 11.5px; }

/* ---------- Live market ---------- */
.panel.live { margin-top: 16px; }
.panel-sub { margin: 2px 0 0; font-size: 12px; color: var(--ink-3); }
.live-status { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.live-status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: pulse 1s ease-in-out infinite; }
.live-status.ok .dot { background: var(--pos); animation: pulse 2s ease-in-out infinite; }
.live-status.ok { color: var(--ink-2); }
.live-status.warn .dot { background: var(--warn); animation: none; }
.live-table td { padding-top: 11px; padding-bottom: 11px; }
.live-table tbody tr { cursor: default; }
.live-table .coin-badge { width: 26px; height: 26px; }
.lv-p { display: inline-block; border-radius: 4px; transition: color .6s ease; }
.lv-age { color: var(--ink-3); font-size: 12px; }
.tick-up { animation: tickUp .9s ease; }
.tick-down { animation: tickDown .9s ease; }
@keyframes tickUp { 0%, 35% { color: var(--pos-ink); } }
@keyframes tickDown { 0%, 35% { color: var(--neg-ink); } }
.sm-only, table.assets td small.sm-only { display: none; }
#hero-delta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
.live-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pos); animation: pulse 2s ease-in-out infinite; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px;
  padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface-2);
  color: var(--ink); font-weight: 500; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: var(--surface-3); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { opacity: .9; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { color: var(--neg-ink); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Notice ---------- */
.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 16px;
  border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--surface);
  font-size: 13px; color: var(--ink-2);
}
.notice svg { color: var(--warn); margin-top: 2px; }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 72px 24px; }
.empty h2 { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; margin: 0 0 6px; }
.empty p { color: var(--ink-3); margin: 0 auto 24px; max-width: 420px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 6px;
  border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface);
  cursor: pointer; font-size: 13px; font-weight: 500;
}
.chip:hover { background: var(--surface-2); }
.chip .coin-badge { width: 22px; height: 22px; font-size: 8px; }

/* ---------- Distribution ---------- */
.dist { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 40px; align-items: center; }
.donut-wrap { position: relative; width: 280px; height: 280px; margin: 0 auto; }
.donut-wrap svg { width: 100%; height: 100%; display: block; }
.donut-wrap path { transition: opacity .15s; cursor: pointer; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; padding: 0 56px; }
.donut-center .k { font-size: 12px; color: var(--ink-3); }
.donut-center .v { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.donut-center .p { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.legend { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.legend th { font-size: 12px; font-weight: 500; color: var(--ink-3); text-align: right; padding: 0 0 10px 12px; border-bottom: 1px solid var(--border); }
.legend th:first-child { text-align: left; padding-left: 0; }
.legend td { padding: 11px 0 11px 12px; text-align: right; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; white-space: nowrap; }
.legend td:first-child { text-align: left; padding-left: 0; }
.legend tr:last-child td { border-bottom: 0; }
.legend tbody tr { transition: opacity .15s; cursor: default; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 10px; vertical-align: -1px; }
.legend .share { display: inline-flex; align-items: center; gap: 10px; justify-content: flex-end; }
.legend .share .bar-track { width: 72px; margin: 0; }
.dim { opacity: .35; }

/* ---------- Settings ---------- */
.settings { max-width: 720px; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 16px 0; border-top: 1px solid var(--border); }
.set-row:first-child { border-top: 0; padding-top: 0; }
.set-row:last-child { padding-bottom: 0; }
.set-row h3 { font-size: 13.5px; font-weight: 500; margin: 0; }
.set-row p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-3); max-width: 420px; }
.set-row .ctrl { flex: none; }
.section-label { font-size: 12px; color: var(--ink-3); font-weight: 500; margin: 28px 0 10px; letter-spacing: 0.02em; text-transform: uppercase; }
.section-label:first-child { margin-top: 0; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .lbl { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--ink-3); }
.input, select.input {
  height: 38px; width: 100%; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--border-2); background: var(--surface-2); color: var(--ink);
  font-variant-numeric: tabular-nums; outline: none; transition: border-color .15s;
}
.input:focus { border-color: var(--focus); }
.input.err { border-color: var(--neg); }
select.input { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
.input-affix { position: relative; }
.input-affix .affix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 13px; pointer-events: none; }
.input-affix .input { padding-left: 42px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-error { color: var(--neg-ink); font-size: 12.5px; min-height: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { margin: 2px 0 0; accent-color: var(--ink); }
.calc { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- Modal ---------- */
.modal-root { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: var(--overlay); animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.modal {
  width: 100%; max-width: 520px; max-height: calc(100vh - 48px); overflow: auto;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 16px;
  box-shadow: var(--shadow); animation: rise .18s ease;
}
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.modal-head h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; margin: 0; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 20px; }
.modal-foot .left { margin-right: auto; }

.search-list { list-style: none; margin: 12px 0 0; padding: 0; max-height: 320px; overflow: auto; }
.search-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.search-list li:hover, .search-list li.kb { background: var(--surface-2); }
.search-list .meta { font-size: 12px; color: var(--ink-3); }
.search-group { font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; padding: 12px 10px 4px; }

.detail-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 16px; }
.detail-stats > div { padding: 12px 14px; min-width: 0; }
.detail-stats > div:nth-child(n+4) { border-top: 1px solid var(--border); }
.detail-stats > div:not(:nth-child(3n+1)) { border-left: 1px solid var(--border); }
.detail-stats span { display: block; font-size: 12px; color: var(--ink-3); }
.detail-stats strong { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.price-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); margin-bottom: 20px; flex-wrap: wrap; }
.price-line .v { font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.price-line small { display: block; font-size: 12px; color: var(--ink-3); }
.lots { width: 100%; border-collapse: collapse; font-size: 13px; }
.lots th { text-align: right; font-size: 12px; font-weight: 500; color: var(--ink-3); padding: 0 8px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.lots td { text-align: right; padding: 10px 8px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lots th:first-child, .lots td:first-child { text-align: left; padding-left: 0; }
.lots td:last-child { padding-right: 0; width: 1%; }
.lots tr:last-child td { border-bottom: 0; }
.type-tag { font-size: 11px; font-weight: 500; padding: 1px 6px; border-radius: 4px; background: var(--surface-3); color: var(--ink-2); margin-left: 6px; }
.lot-actions { display: inline-flex; gap: 2px; }
.lot-actions .icon-btn { width: 28px; height: 28px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 70;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Tabbar (mobile) ---------- */
.tabbar { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 20px; }
  .dist { grid-template-columns: 1fr; gap: 28px; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar-inner { padding: 0 16px; gap: 12px; height: 54px; }
  .nav { display: none; }
  .status .lbl-long { display: none; }
  .container { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  .hero { padding-bottom: 20px; }
  .hero-value { font-size: 34px; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hero-stats > div:nth-child(3) { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--border); }
  .hero-stats > div { padding: 14px; }
  .hero-stats dd { font-size: 16px; }
  .panel { padding: 16px; }
  .panel-head { margin-bottom: 12px; }
  .chart-box { height: 230px; }
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 6px 0; }
  .table-wrap { display: none; }
  .table-wrap.live-wrap { display: block; margin: 0 -16px -16px; }
  .live-table .col-md { display: none; }
  .live-table th, .live-table td { padding-left: 16px; padding-right: 16px; }
  .live-table td:nth-child(2), .live-table th:nth-child(2) { padding-right: 8px; }
  table.assets.live-table td small.sm-only { display: block; }
  .live .panel-head { flex-wrap: nowrap; align-items: flex-start; }
  .cards { display: block; }
  .view-head { align-items: center; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-root { padding: 0; place-items: end center; }
  .modal { max-width: none; border-radius: 16px 16px 0 0; max-height: 92vh; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
  .detail-stats { grid-template-columns: 1fr 1fr; }
  .detail-stats > div { border-left: 0 !important; border-top: 1px solid var(--border); }
  .detail-stats > div:nth-child(-n+2) { border-top: 0; }
  .detail-stats > div:nth-child(2n) { border-left: 1px solid var(--border) !important; }
  .lots .hide-sm { display: none; }
  .lots th, .lots td { padding-left: 4px; padding-right: 4px; }
  .lots .type-tag { display: table; margin: 3px 0 0; }
  .lot-actions .icon-btn { width: 26px; }
  .detail-stats strong { white-space: normal; }
  .modal-body, .modal-head { padding-left: 16px; padding-right: 16px; }
  .set-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .donut-wrap { width: 240px; height: 240px; }
  .legend .share .bar-track { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 500; color: var(--ink-3); padding: 4px 0; }
  .tabbar a svg { width: 20px; height: 20px; }
  .tabbar a.active { color: var(--ink); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .bar-track > i, .legend .sw { forced-color-adjust: none; }
}
