:root {
  --bg: #07080c;
  --panel: #0d1018;
  --panel2: #12161f;
  --line: #1c2330;
  --text: #d7dde8;
  --muted: #7a8499;
  --pink: #ff3d9a;
  --pink2: #ff6bb5;
  --cyan: #3de0ff;
  --green: #3dff9a;
  --amber: #ffc14d;
  --red: #f87171;
  --flap: #a78bfa;
  --gang: #34d399;
  --four: #60a5fa;
  --font: "JetBrains Mono", "SF Mono", "Cascadia Code", ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; }
body {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255,61,154,.12), transparent),
    linear-gradient(180deg, #07080c 0%, #0a0c12 100%);
}
.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  background: rgba(10,12,18,.85); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 {
  margin: 0; font-size: 20px; letter-spacing: .12em; font-weight: 700;
  background: linear-gradient(90deg, var(--pink2), var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--pink);
  box-shadow: 0 0 10px var(--pink); animation: pulse 1.6s infinite;
}
@keyframes pulse { 50% { opacity: .35; } }
.badge {
  font-size: 13px; color: var(--green); border: 1px solid rgba(61,255,154,.35);
  padding: 3px 10px; border-radius: 999px; letter-spacing: .04em;
  background: rgba(61,255,154,.08);
}
.meta { display: flex; gap: 16px; font-size: 14px; color: var(--muted); margin-left: auto; }
.meta span::before { content: ""; }
.filters { display: flex; gap: 8px; }
.chip {
  background: var(--panel2); color: var(--muted); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer;
  letter-spacing: .06em;
}
.chip:hover { border-color: var(--pink); color: var(--text); }
.chip.on { background: rgba(255,61,154,.15); border-color: var(--pink); color: var(--pink2); }

.wallet {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel2); margin-left: 4px;
}
.wallet.on { border-color: rgba(61,255,154,.35); }
.wallet-label {
  font-size: 12px; color: var(--muted); letter-spacing: .06em;
}
.wallet-id {
  font-size: 14px; font-weight: 700; color: var(--green);
}
.wallet-addr {
  font-size: 13px; color: var(--cyan); cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.wallet-addr:hover { text-decoration: underline; }

.trade-bar {
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel2); min-width: min(720px, 100%);
}
.trade-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.trade-label {
  font-size: 12px; color: var(--muted); letter-spacing: .06em; white-space: nowrap;
  min-width: 2rem;
}
.trade-hint {
  font-size: 12px; color: var(--cyan); font-variant-numeric: tabular-nums; min-width: 3.2rem;
}
#buy-row .trade-hint { color: var(--green); }
#sell-row .trade-hint { color: var(--amber); }
.trade-sep {
  font-size: 12px; color: var(--cyan); opacity: .7; user-select: none;
}
.trade-sep.muted { color: var(--muted); opacity: 1; }
.trade-field {
  display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted);
}
.trade-field input {
  width: 8.5rem; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 8px; font: inherit; font-size: 13px;
}
#buy-amt { width: 5.8rem; }
#buy-pct { width: 5rem; }
.trade-field input:focus {
  outline: none; border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(61,224,255,.25);
}
.pay-chips, .amt-chips, .size-chips, .sell-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.pay-chip, .amt-chip, .size-chip, .sell-chip {
  appearance: none; cursor: pointer;
  background: var(--bg); color: var(--muted); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 9px; font: inherit; font-size: 12px;
}
.pay-chip:hover { border-color: var(--cyan); color: var(--text); }
.pay-chip.on {
  background: rgba(61,224,255,.14); border-color: var(--cyan); color: var(--cyan);
}
.amt-chip:hover { border-color: var(--green); color: var(--text); }
.amt-chip.on {
  background: rgba(61,255,154,.14); border-color: var(--green); color: var(--green);
}
.size-chip:hover { border-color: var(--muted); color: var(--text); }
.size-chip.on {
  background: rgba(61,255,154,.08); border-color: var(--green); color: var(--green);
}
.sell-chip:hover { border-color: var(--amber); color: var(--text); }
.sell-chip.on {
  background: rgba(255,193,77,.12); border-color: var(--amber); color: var(--amber);
}

.toast {
  position: fixed; top: 72px; right: 16px; z-index: 20;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 14px; border-radius: 8px; font-size: 13px;
  background: var(--panel2); border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0,0,0,.45); color: var(--text);
}
.toast.ok { border-color: rgba(61,255,154,.45); color: var(--green); }
.toast.err { border-color: rgba(248,113,113,.45); color: var(--red); }
.toast.pending { border-color: rgba(61,224,255,.35); color: var(--cyan); }

.board-tools {
  margin: 0 16px 8px;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.bt-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.bt-label {
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  color: var(--muted); text-transform: uppercase; white-space: nowrap;
}
.quote-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.quote-chip {
  appearance: none; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); color: var(--muted);
}
.quote-chip:hover { border-color: rgba(96,165,250,.5); color: var(--text); }
.quote-chip.on {
  color: #0b1220; background: linear-gradient(135deg, #60a5fa, #a78bfa);
  border-color: transparent; box-shadow: 0 0 10px rgba(96,165,250,.28);
}
.bt-search {
  display: flex; align-items: center; gap: 6px; margin-left: auto;
}
.bt-search input {
  width: min(220px, 42vw); font: inherit; font-size: 13px;
  padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.bt-search input:focus {
  outline: none; border-color: rgba(255,61,154,.55);
  box-shadow: 0 0 0 2px rgba(255,61,154,.15);
}
.bt-search input::placeholder { color: var(--muted); }

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  min-height: 0;
  overflow: hidden;
}
@media (max-width: 1280px) {
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: auto; }
}
@media (max-width: 720px) {
  .board { grid-template-columns: 1fr; overflow: auto; }
}
.col {
  display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--line); background: var(--panel);
}
.col:last-child { border-right: none; }
.col-h {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  background: var(--panel2); position: sticky; top: 0;
}
.col-h h2 { margin: 0; font-size: 17px; letter-spacing: .08em; }
.col[data-col="new"] .col-h h2 { color: var(--cyan); }
.col[data-col="near"] .col-h h2 { color: var(--amber); }
.col[data-col="graduated"] .col-h h2 { color: var(--green); }
.col[data-col="graduated"] .col-h {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.col-sort-wrap { margin-left: auto; display: flex; align-items: center; }
.col-sort {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 28px 3px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 12px) 55%, calc(100% - 7px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.col-sort:hover { border-color: rgba(52,211,153,.55); color: var(--green); }
.col-sort:focus { outline: none; border-color: var(--green); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.count {
  font-size: 14px; color: var(--muted);
  background: var(--bg); padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line);
}
.list {
  overflow: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px;
  flex: 1; min-height: 0;
}

.card {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 10px 12px;
  padding: 12px; border-radius: 10px; border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255,255,255,.03), transparent 40%), var(--panel2);
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: rgba(255,61,154,.45); transform: translateY(-1px); }
.card.hidden { display: none; }
.logo {
  width: 44px; height: 44px; border-radius: 8px; background: #1a2030;
  object-fit: cover; border: 1px solid var(--line);
}
.logo.ph {
  display: grid; place-items: center; font-size: 14px; color: var(--muted); font-weight: 700;
}
.info { min-width: 0; }
.row1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.name { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.sym { font-size: 14px; color: var(--muted); }
.hc {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.tag {
  font-size: 12px; padding: 2px 7px; border-radius: 4px; letter-spacing: .04em;
  border: 1px solid var(--line); color: var(--muted);
}
.tag.flap { color: var(--flap); border-color: rgba(167,139,250,.4); }
.tag.gang { color: var(--gang); border-color: rgba(52,211,153,.4); }
.tag.four { color: var(--four); border-color: rgba(96,165,250,.4); }
.tag.agent { color: var(--pink2); border-color: rgba(255,61,154,.35); }
.stats { display: flex; gap: 10px; font-size: 13px; color: var(--muted); margin-top: 5px; flex-wrap: wrap; }
.stats b { color: var(--text); font-weight: 600; }
.bar {
  grid-column: 1 / -1; height: 5px; background: #1a2030; border-radius: 2px; overflow: hidden;
}
.bar > i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--pink), var(--cyan));
  box-shadow: 0 0 8px rgba(255,61,154,.5);
  transition: width .4s ease;
}
.side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.actions { display: flex; gap: 6px; }
.btn-buy, .btn-sell {
  appearance: none; border: none; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 700;
  padding: 7px 11px; border-radius: 6px; letter-spacing: .04em;
  min-width: 2.6rem;
}
.btn-buy {
  background: linear-gradient(135deg, #12b76a, #3dff9a);
  color: #062016;
  box-shadow: 0 0 10px rgba(61,255,154,.28);
}
.btn-buy:hover:not(:disabled) { filter: brightness(1.08); }
.btn-buy:disabled {
  opacity: .4; cursor: not-allowed; filter: grayscale(.3);
  box-shadow: none;
}
.btn-sell {
  background: rgba(248,113,113,.12);
  color: var(--red);
  border: 1px solid rgba(248,113,113,.4);
}
.btn-sell:hover:not(:disabled) {
  background: rgba(248,113,113,.22);
  border-color: var(--red);
}
.btn-sell:disabled { opacity: .45; cursor: not-allowed; }
.trade-status {
  grid-column: 1 / -1;
  font-size: 12px; color: var(--muted);
  padding: 2px 0 0; word-break: break-all;
}
.trade-status.ok { color: var(--green); }
.trade-status.err { color: var(--red); }
.trade-status.pending { color: var(--cyan); }

.tax {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.12);
  white-space: nowrap;
  cursor: help;
}
.tax.taxed {
  color: #ffb020;
  border-color: rgba(255,176,32,.4);
  background: rgba(255,176,32,.08);
}
.tax.none {
  color: var(--muted);
  border-color: rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}
.row1 .tax { margin-left: 4px; }

.ca { font-size: 12px; color: var(--muted); cursor: pointer; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ca:hover { color: var(--cyan); }
.stats .ca {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  user-select: none;
}
.stats .ca:hover { border-color: rgba(0, 212, 255, .35); background: rgba(0, 212, 255, .08); }

.foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted);
}
.err { color: #f87171; }
.empty {
  padding: 28px 14px; text-align: center; color: var(--muted); font-size: 14px;
  border: 1px dashed var(--line); border-radius: 8px;
}

.tag.soft { color: #fbbf24; border-color: rgba(251,191,36,.4); }
.tag.v2 { color: #34d399; border-color: rgba(52,211,153,.35); }
.tag.blocked { color: #f87171; border-color: rgba(248,113,113,.45); }
.tag.hold {
  margin-left: auto;
  color: var(--cyan);
  border-color: rgba(34,211,238,.45);
  font-weight: 700;
  letter-spacing: .02em;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag.dev {
  color: #fbbf24;
  border-color: rgba(251,191,36,.45);
  font-weight: 700;
  letter-spacing: .06em;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tags:not(:has(.tag.hold)) .tag.dev { margin-left: auto; }
.tags { align-items: center; }
.card.untradeable { opacity: .72; }
.card.untradeable:hover { border-color: rgba(248,113,113,.35); }
.card.untradeable .btn-buy,
.card.untradeable .btn-sell { opacity: .55; cursor: not-allowed; }

/* ---- holdings strip ---- */
.holdings {
  margin: 0 16px 10px;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.holdings-h {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.holdings-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--pink2, #ff7ab8);
  text-transform: uppercase;
}
.holdings-meta {
  font-size: 11px;
  color: #6b7280;
}
.holdings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hold-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0 2px;
  border-top: 1px solid rgba(255,255,255,.04);
}
.hold-group:first-child { border-top: none; padding-top: 0; }
.hold-group-h {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}
.hold-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.hold-group-label.quote { color: #fbbf24; }
.hold-group-label.gang { color: #34d399; }
.hold-group-label.flap { color: #a78bfa; }
.hold-group-label.four { color: #60a5fa; }
.hold-group-label.other { color: #9ca3af; }
.hold-group-count {
  font-size: 10px;
  color: #6b7280;
  background: rgba(255,255,255,.04);
  border-radius: 999px;
  padding: 0 6px;
}
.hold-group-sum {
  font-size: 11px;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
}
.hold-group-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.hold-chip .h-plat.other, .hold-chip .h-plat.\? {
  color: #9ca3af;
  border-color: rgba(156,163,175,.35);
}
.hold-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--panel2);
  border: 1px solid var(--line);
  font-size: 12px;
  cursor: default;
  max-width: 100%;
}
.hold-chip .h-pad { font-size: 10px; opacity: 0.85; padding: 0 4px; border-radius: 4px; background: #3a2a12; color: #f0c060; margin-right: 2px; }
.tag.pad { background: #3a2a12; color: #f0c060; }
.h-name { color: var(--text); font-weight: 700; max-width: 7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-sym { font-weight: 700; color: #e5e7eb; }
.hold-chip .h-amt { color: #a7f3d0; font-variant-numeric: tabular-nums; }
.hold-chip .h-usd { color: #9ca3af; font-size: 11px; font-variant-numeric: tabular-nums; }
.hold-chip .h-usd.unk { color: #6b7280; font-style: italic; }
.hold-chip .h-cost { color: #93c5fd; font-size: 11px; font-variant-numeric: tabular-nums; }
.hold-chip .h-cost.unk { color: #6b7280; font-style: italic; }
.hold-chip .h-pnl {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.hold-chip .h-pnl.up { color: #34d399; }
.hold-chip .h-pnl.down { color: #f87171; }
.hold-chip .h-pnl.unk { color: #6b7280; font-weight: 500; font-style: italic; }
.hold-chip .h-plat {
  font-size: 10px;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--line);
}
.hold-chip .h-plat.flap { color: #a78bfa; border-color: rgba(167,139,250,.4); }
.hold-chip .h-plat.gang { color: #34d399; border-color: rgba(52,211,153,.4); }
.hold-chip .h-plat.four { color: #60a5fa; border-color: rgba(96,165,250,.4); }
.hold-chip .h-plat.quote, .hold-chip .h-plat.native { color: #fbbf24; border-color: rgba(251,191,36,.35); }
.hold-chip.blocked { opacity: .75; border-color: rgba(248,113,113,.35); }
.hold-chip .h-ca {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  color: #6b7280;
  cursor: pointer;
}
.hold-chip .h-sell {
  margin-left: 2px;
  padding: 2px 6px;
  font-size: 11px;
  border-radius: 5px;
  border: 1px solid rgba(248,113,113,.45);
  background: transparent;
  color: #f87171;
  cursor: pointer;
}
.hold-chip .h-sell:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.hold-chip .h-sell:hover:not(:disabled) { background: rgba(248,113,113,.12); }
.holdings-empty { font-size: 12px; color: #6b7280; }

.col-h .col-sub {
  font-size: 11px;
  font-weight: 500;
  color: #9ca3af;
  margin-left: 6px;
}

/* —— Token detail drawer —— */
/* [hidden] must beat author display:flex/grid (closeDetail / kline empty) */
.detail-drawer[hidden],
.detail-backdrop[hidden],
.kline-empty[hidden],
.toast[hidden] {
  display: none !important;
}

.card { cursor: pointer; }
.hold-chip { cursor: pointer; }
.detail-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0,0,0,.55); backdrop-filter: blur(2px);
}
.detail-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  width: min(420px, 100vw);
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px rgba(0,0,0,.45);
  display: flex; flex-direction: column; gap: 0;
  overflow: auto;
  animation: drawer-in .18s ease-out;
}
@keyframes drawer-in {
  from { transform: translateX(24px); opacity: .6; }
  to { transform: translateX(0); opacity: 1; }
}
.detail-h {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 14px 14px 10px; border-bottom: 1px solid var(--line);
  background: var(--panel2); position: sticky; top: 0; z-index: 2;
}
.detail-title { display: flex; gap: 10px; min-width: 0; flex: 1; }
.detail-logo {
  width: 44px; height: 44px; border-radius: 8px; background: #1a2030;
  border: 1px solid var(--line); flex-shrink: 0;
  display: grid; place-items: center; overflow: hidden;
}
.detail-logo img { width: 100%; height: 100%; object-fit: cover; }
.detail-logo .ph {
  font-size: 14px; font-weight: 700; color: var(--muted);
}
.detail-names { min-width: 0; flex: 1; }
.detail-name-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.detail-name { font-size: 17px; font-weight: 700; }
.detail-sym { font-size: 14px; color: var(--muted); }
.detail-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.detail-ca {
  appearance: none; background: transparent; border: none; padding: 4px 0 0;
  font: inherit; font-size: 12px; color: var(--cyan); cursor: pointer;
  word-break: break-all; text-align: left;
}
.detail-ca:hover { text-decoration: underline; }
.detail-close {
  appearance: none; width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer;
  flex-shrink: 0;
}
.detail-close:hover { color: var(--text); border-color: var(--pink); }
.detail-sec-h {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; letter-spacing: .06em; color: var(--muted);
  margin-bottom: 8px;
}
.detail-hold, .detail-chart, .detail-trade, .detail-holders {
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.detail-hold-body {
  display: flex; flex-wrap: wrap; gap: 8px 14px;
  font-size: 13px; color: var(--text);
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px;
}
.detail-hold-body .dh-item { display: flex; flex-direction: column; gap: 2px; min-width: 5.5rem; }
.detail-hold-body .dh-k { font-size: 11px; color: var(--muted); }
.detail-hold-body .dh-v { font-variant-numeric: tabular-nums; font-weight: 600; }
.detail-hold-body .dh-v.up { color: var(--green); }
.detail-hold-body .dh-v.down { color: var(--red); }
.detail-hold-body.empty { color: var(--muted); font-style: italic; }
.detail-chart { position: relative; }
#kline-canvas {
  width: 100%; height: 220px; display: block;
  background: #0a0d14; border: 1px solid var(--line); border-radius: 8px;
}
.kline-empty {
  position: absolute; left: 14px; right: 14px; top: 48px; bottom: 14px;
  display: grid; place-items: center; color: var(--muted); font-size: 13px;
  pointer-events: none;
}
.kline-res { display: flex; gap: 4px; }
.kres {
  appearance: none; font: inherit; font-size: 11px; padding: 3px 7px;
  border-radius: 4px; border: 1px solid var(--line); background: var(--panel2);
  color: var(--muted); cursor: pointer;
}
.kres.on { color: var(--cyan); border-color: rgba(61,224,255,.45); background: rgba(61,224,255,.08); }
.kline-meta { margin-left: auto; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.detail-trade-actions { display: flex; gap: 10px; }
.detail-trade-actions .btn-buy,
.detail-trade-actions .btn-sell {
  flex: 1; padding: 10px 12px; font-size: 14px;
}
.detail-trade-hint { font-size: 11px; color: var(--muted); font-weight: 400; letter-spacing: 0; margin-left: 6px; }
#detail-trade-status { margin-top: 8px; }

.holders-meta { margin-left: auto; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 400; letter-spacing: 0; }
.detail-holders-body {
  max-height: 240px; overflow: auto;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 8px; padding: 4px 0;
  font-size: 12px; color: var(--text);
}
.detail-holders-body.empty,
.detail-holders-body.err,
.detail-holders-body.loading {
  padding: 12px; color: var(--muted); font-style: italic;
}
.detail-holders-body.err { color: var(--red); font-style: normal; }
.holders-err-msg { margin-bottom: 8px; }
.holders-retry {
  display: inline-block; margin-top: 2px;
  padding: 4px 10px; font-size: 12px; cursor: pointer;
  color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px;
}
.holders-retry:hover { border-color: var(--cyan); color: var(--cyan); }
.holder-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; cursor: pointer;
  border-bottom: 1px solid rgba(28,35,48,.6);
}
.holder-row:last-child { border-bottom: none; }
.holder-row:hover { background: rgba(61,224,255,.06); }
.holder-row.me {
  background: rgba(61,255,154,.08);
  outline: 1px solid rgba(61,255,154,.28);
  outline-offset: -1px;
}
.holder-rank {
  flex: 0 0 1.6rem; text-align: right;
  color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11px;
}
.holder-addr {
  flex: 1 1 auto; min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text);
}
.holder-row.me .holder-addr { color: var(--green); font-weight: 600; }
.holder-pct {
  flex: 0 0 4.2rem; text-align: right;
  font-variant-numeric: tabular-nums; color: var(--cyan); font-weight: 600;
}
.holder-tags { display: flex; gap: 3px; flex-wrap: wrap; flex: 0 0 auto; }
.holder-tag {
  font-size: 10px; padding: 1px 5px; border-radius: 3px;
  border: 1px solid var(--line); color: var(--muted); background: rgba(0,0,0,.25);
  letter-spacing: .02em; text-transform: lowercase;
}
.holder-tag.dev { color: #fbbf24; border-color: rgba(251,191,36,.35); }
.holder-tag.kol { color: #c084fc; border-color: rgba(192,132,252,.35); }
.holder-tag.smart { color: var(--cyan); border-color: rgba(61,224,255,.35); }
.holder-tag.pool { color: #94a3b8; border-color: rgba(148,163,184,.35); }
@media (max-width: 520px) {
  .detail-drawer { width: 100vw; }
}

/* --- 转主钱包 (cyan outline, distinct from buy/sell) --- */
.xfer-dest {
  font-size: 11px; color: var(--cyan); opacity: .85;
  letter-spacing: .02em; margin-left: 4px;
  border-left: 1px solid var(--line); padding-left: 8px;
  white-space: nowrap;
}
.xfer-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  margin-top: 2px; justify-content: flex-end;
  max-width: 220px;
}
.xfer-chips { display: flex; gap: 3px; }
.xfer-chip {
  appearance: none; font: inherit; font-size: 10px; font-weight: 600;
  padding: 2px 5px; border-radius: 4px; cursor: pointer;
  border: 1px solid rgba(61,224,255,.3);
  background: transparent; color: var(--muted);
  letter-spacing: .02em;
}
.xfer-chip:hover { color: var(--cyan); border-color: rgba(61,224,255,.55); }
.xfer-chip.on {
  color: var(--cyan);
  border-color: rgba(61,224,255,.65);
  background: rgba(61,224,255,.1);
}
.xfer-amt-wrap { display: inline-flex; }
.xfer-amt {
  width: 4.2rem; font: inherit; font-size: 11px;
  padding: 2px 5px; border-radius: 4px;
  border: 1px solid var(--line); background: var(--panel2);
  color: var(--text); min-width: 0;
}
.xfer-amt:focus { outline: none; border-color: rgba(61,224,255,.55); }
.btn-xfer {
  appearance: none; border: 1px solid rgba(61,224,255,.5);
  background: rgba(61,224,255,.08); color: var(--cyan);
  font: inherit; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 5px; cursor: pointer;
  letter-spacing: .04em; white-space: nowrap;
}
.btn-xfer:hover:not(:disabled) {
  background: rgba(61,224,255,.16);
  border-color: var(--cyan);
}
.btn-xfer:disabled { opacity: .45; cursor: not-allowed; }

.detail-xfer {
  margin-top: 10px; max-width: none; justify-content: flex-start;
}
.detail-xfer .btn-xfer { padding: 6px 12px; font-size: 13px; }
.detail-xfer .xfer-chip { font-size: 12px; padding: 4px 8px; }
.detail-xfer .xfer-amt { width: 5.5rem; font-size: 12px; padding: 4px 6px; }

.hold-chip .h-xfer {
  margin-left: 2px;
  padding: 2px 6px;
  font-size: 11px;
  border-radius: 5px;
  border: 1px solid rgba(61,224,255,.45);
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
}
.hold-chip .h-xfer:hover:not(:disabled) { background: rgba(61,224,255,.12); }
.hold-chip .h-xfer:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 720px) {
  .xfer-row { max-width: 100%; justify-content: flex-start; }
  .xfer-dest { display: none; } /* keep header compact on narrow */
}


/* ---- holdings column (4th board col) ---- */
.col[data-col="hold"] .col-h h2 { color: #f0abfc; }
.col[data-col="hold"] .col-h {
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.hold-col-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  width: 100%;
  margin-top: 2px;
}
.hold-tool {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--muted);
}
.hold-tool .col-sort {
  max-width: 6.8rem;
  padding-right: 22px;
  font-size: 11px;
}
.col[data-col="hold"] .col-sort:hover { border-color: rgba(240,171,252,.55); color: #f0abfc; }
.col[data-col="hold"] .col-sort:focus { border-color: #f0abfc; }
.hold-col-group {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  font-size: 12px;
  color: var(--muted);
}
/* Compact holdings cards: logo | name+stats | actions — fills full width, no empty hole */
.card.hold-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 6px 10px;
  padding: 10px 12px;
  align-items: start;
  cursor: pointer;
}
.card.hold-card > .logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  font-size: 14px;
  align-self: center;
  flex-shrink: 0;
}
.card.hold-card > .info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.card.hold-card > .side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  max-width: 168px;
}
.card.hold-card .row1 {
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}
.card.hold-card .name {
  font-size: 16px;
  font-weight: 700;
  max-width: 11rem;
}
.card.hold-card .sym {
  font-size: 14px;
  color: var(--muted);
}
.card.hold-card .tag {
  font-size: 11px;
  padding: 2px 6px;
}
.card.hold-card .hold-stats,
.card.hold-card .stats.hold-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 0;
  margin-top: 0;
  font-size: 13px;
  width: 100%;
  color: var(--muted);
}
.card.hold-card .hold-stats .hold-metric {
  margin-right: 2px;
}
.card.hold-card .hold-stats .hold-sep {
  margin: 0 6px;
  opacity: .45;
  user-select: none;
}
.card.hold-card .hold-stats b {
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.card.hold-card .hold-pnl-stat {
  margin-left: 8px;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.card.hold-card .hold-pnl-stat.up { color: #34d399; font-weight: 600; }
.card.hold-card .hold-pnl-stat.down { color: #f87171; font-weight: 600; }
.card.hold-card .hold-pnl-stat.unk,
.card.hold-card .hold-stats b.unk { color: #6b7280; font-style: italic; font-weight: 500; }
.card.hold-card .hold-cost-stat { color: #93c5fd; }
.card.hold-card .stats .ca {
  margin-left: auto;
  font-size: 12px;
  padding: 0 5px;
}
.card.hold-card .actions {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
}
.card.hold-card .btn-sell,
.card.hold-card .h-sell {
  padding: 4px 8px;
  font-size: 13px;
  min-width: 0;
}
.card.hold-card .btn-xfer,
.card.hold-card .h-xfer {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 5px;
  border: 1px solid rgba(61,224,255,.45);
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
  min-width: 0;
}
.card.hold-card .btn-xfer:hover:not(:disabled),
.card.hold-card .h-xfer:hover:not(:disabled) { background: rgba(61,224,255,.12); }
.card.hold-card .xfer-row {
  max-width: 160px;
  justify-content: flex-end;
}
.card.hold-card .trade-status {
  grid-column: 1 / -1;
  font-size: 11px;
  padding-top: 0;
}
.holdings-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
