:root {
  --bg: #0f1115;
  --card: #171a21;
  --border: #2a2f3a;
  --text: #e6e8ee;
  --muted: #8b93a7;
  --primary: #3b82f6;
  --in: #10b981;
  --out: #ef4444;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
  font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; padding: 0 24px 48px; background: var(--bg); color: var(--text); }
header { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 12px; }
h2 small { color: var(--muted); font-weight: normal; }
section { margin-bottom: 20px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.actions { display: flex; gap: 8px; align-items: center; }
button {
  background: #232835; color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 12px; cursor: pointer;
}
button:hover { border-color: var(--primary); }
button.primary { background: var(--primary); border-color: var(--primary); }
button.ghost { background: transparent; }
button.small { padding: 2px 8px; font-size: 12px; }
button.danger { color: #fca5a5; }
input, select, textarea {
  background: #0f1115; color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 8px; font: inherit;
}
label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
label.inline { flex-direction: row; align-items: center; font-weight: normal; }
label.toolbar-select { flex-direction: row; align-items: center; gap: 8px; }
label.toolbar-select select { min-width: 180px; }
.input-action { display: flex; gap: 8px; }
.input-action input { flex: 1; min-width: 0; }
.input-action button { white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.grid > p { grid-column: 1 / -1; margin: 0; }
.account .head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.account .platform { text-transform: uppercase; font-size: 11px; padding: 2px 6px; border-radius: 4px; }
.platform.binance { background: #f0b90b33; color: #f0b90b; }
.platform.okx { background: #ffffff22; color: #fff; }
.platform.coinbase { background: #0052ff33; color: #6f9bff; }
.platform.wallet, .platform.other { background: #8b93a733; color: var(--muted); }
.account ul { list-style: none; padding: 0; margin: 8px 0 0; }
.account li { display: flex; justify-content: space-between; padding: 2px 0; font-variant-numeric: tabular-nums; }
.account.archived { opacity: .5; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: #232835; border-radius: 6px; padding: 6px 10px; font-variant-numeric: tabular-nums; }
.chip b { margin-right: 6px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: top; }
th { color: var(--muted); font-weight: normal; font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.wrap { white-space: normal; max-width: 280px; word-break: break-all; }
.dir-IN { color: var(--in); }
.dir-OUT { color: var(--out); }
.muted { color: var(--muted); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: flex-end; margin-top: 12px; }
dialog { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 10px; width: 420px; }
dialog::backdrop { background: #0008; }
dialog form { display: flex; flex-direction: column; gap: 10px; }
dialog h3 { margin: 0 0 4px; }
menu { display: flex; justify-content: flex-end; gap: 8px; padding: 0; margin: 8px 0 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button {
  background: transparent; border: none; border-bottom: 2px solid transparent; border-radius: 0;
  padding: 10px 16px; color: var(--muted); font-size: 15px; display: flex; align-items: center; gap: 6px;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--primary); }
.tabs button .count { font-size: 11px; background: #232835; border-radius: 10px; padding: 0 6px; }
.tabs.sub { margin-top: 8px; }
.tabs.sub button { font-size: 14px; padding: 8px 14px; }
.hint { margin: 0 0 12px; font-size: 12px; }
.filters .hint { margin: 0; align-self: center; }
#toast {
  position: fixed; right: 24px; bottom: 24px; padding: 10px 14px; border-radius: 8px;
  background: #232835; border: 1px solid var(--border); max-width: 420px;
}
#toast.error { border-color: var(--out); }
#login { max-width: 360px; margin: 80px auto; }
#login form { display: flex; flex-direction: column; gap: 12px; }
