/* wallet_site — тёмный интерфейс «как у Arkham».
   Только этот файл: inline-стилей нет (CSP style-src 'self'); динамика (ширины полос, цвета серий) — из JS через CSSOM.
   Палитра серий — app.js (dataviz, тёмная). Текст — только текстовыми токенами, не цветом серии. */

:root {
  color-scheme: dark;
  --bg: #0b0e14;
  --card: #11151d;          /* поверхность графиков: палитра проверена на ней */
  --card-2: #151a24;
  --card-3: #1b2130;
  --border: #1d2330;
  --border-2: #2a3242;
  --text: #e6e9ef;
  --text-2: #a9b1be;
  --muted: #7c8696;
  --accent: #4c8df6;
  --link: #6ea8ff;
  --pos: #34d399;
  --neg: #f87171;
  --warn: #f3c969;
  --crit: #d03b3b;
  --grid: #1c2230;
  --axis: #2c3444;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;
  --radius: 8px;
}

*, *::before, *::after { 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);
  min-height: 100vh;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
img { max-width: 100%; }
h1, h2 { margin: 0; }
.mono { font-family: var(--mono); font-size: 0.93em; }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.nowrap { white-space: nowrap; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.inp:focus-visible, .search-input:focus-visible { outline-offset: 0; }

/* ---------- шапка ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 14, 20, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}
.topbar-in {
  max-width: 1680px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px 20px;
  flex-wrap: wrap;
}
.brand {
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--accent); }
.search {
  position: relative;
  display: flex;
  gap: 8px;
  flex: 1 1 380px;
  max-width: 640px;
  min-width: 0;
}
.search-input {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--card-2);
  border: 1px solid var(--border-2);
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--text);
}
.search-input::placeholder { color: var(--muted); }
.search-err {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 51;
  background: #2a1216;
  border: 1px solid #6b2a30;
  color: #ffc9c9;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
}
.recent-pop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background: #0f131b;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  padding: 4px;
  max-height: 380px;
  overflow-y: auto;
}
.rp-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 6px 10px 4px;
}
.rp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.rp-item:hover, .rp-item.is-active { background: var(--card-3); }
.rp-addr { font-family: var(--mono); font-size: 12px; color: var(--text); white-space: nowrap; }
.rp-label { color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rp-foot { display: flex; justify-content: flex-end; padding: 4px 6px 2px; }
.hstats {
  display: flex;
  gap: 6px 14px;
  flex-wrap: wrap;
  margin-left: auto;
  font-size: 12px;
  color: var(--text-2);
}
.hstat { white-space: nowrap; }
.hstat b { color: var(--text); font-weight: 600; }
.hstat.is-warn b { color: var(--warn); }
.hstat.is-crit b { color: var(--neg); }
.hver { color: var(--muted); }

.banner { padding: 10px 16px; text-align: center; font-weight: 600; font-size: 13px; }
.banner-err { background: #3a1216; color: #ffd6d6; border-bottom: 1px solid var(--crit); }

/* ---------- кнопки, поля ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-2);
  background: var(--card-2);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--card-3); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn-primary { background: #1d4c9e; border-color: #2a62c2; }
.btn-primary:hover { background: #245bbb; }
.btn-sm { padding: 2px 8px; font-size: 12px; }
.btn-link { border: 0; background: none; color: var(--link); padding: 0; cursor: pointer; font-size: 12px; }
.btn-link:hover { text-decoration: underline; }
.inp {
  background: var(--card-2);
  border: 1px solid var(--border-2);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--text);
  font-size: 13px;
  min-width: 0;
}
.inp-num { width: 90px; }
select.inp { max-width: 180px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.check input { accent-color: var(--accent); margin: 0; }
.clip { position: fixed; top: -1000px; left: 0; opacity: 0; }

/* ---------- раскладка ---------- */
.page { max-width: 1680px; margin: 0 auto; padding: 16px; }
.cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}
.col { display: contents; }
#card-portfolio { order: 1; }
#card-history { order: 2; }
#card-exchanges { order: 3; }
#card-transfers { order: 4; }
#card-loans { order: 5; }
@media (min-width: 1200px) {
  .cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
  .card-wide { grid-column: 1 / -1; }
}

/* ---------- карточки ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 0;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
  padding: 0 16px;
  min-height: 46px;
  border-bottom: 1px solid var(--border);
}
.card-title, .tab {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.card-title { color: var(--text); padding: 15px 0 13px; }
.head-note { font-size: 12px; color: var(--text-2); }
.head-tools { display: flex; align-items: center; gap: 12px; }
.card-body { padding: 14px 16px 16px; min-width: 0; transition: opacity 0.2s; }
.card-body-flush { padding: 0; }
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  min-height: 46px;
}
.is-busy { opacity: 0.55; }

.tabs {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
  max-width: 100%;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 15px 0 12px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover { color: var(--text-2); }
.tab.is-on { color: var(--text); border-bottom-color: var(--accent); }

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin: 7px 0;
}
.seg button {
  border: 0;
  background: none;
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.seg button:hover { color: var(--text-2); }
.seg button.is-on { background: var(--card-3); color: var(--text); }

/* ---------- скелеты, сообщения ---------- */
.skel {
  background: linear-gradient(90deg, #151a23 0%, #1c2230 50%, #151a23 100%);
  background-size: 200% 100%;
  animation: sk 1.3s ease-in-out infinite;
  border-radius: 4px;
}
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.sk-box { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.sk-line { height: 12px; }
.sk-w0 { width: 92%; } .sk-w1 { width: 74%; } .sk-w2 { width: 84%; } .sk-w3 { width: 58%; }
.sk-row { display: flex; gap: 14px; }
.sk-row .skel { height: 14px; flex: 1 1 0; }
.sk-row .skel:first-child { flex: 2 1 0; }
.sk-chart { width: 100%; border-radius: 6px; }
.sk-hero { height: 44px; width: 200px; }
.sk-avatar { width: 48px; height: 48px; border-radius: 50%; flex: none; }
.sk-flex { display: flex; gap: 16px; align-items: center; }
.sk-grow { flex: 1 1 auto; display: flex; flex-direction: column; gap: 10px; }
@media (prefers-reduced-motion: reduce) {
  .skel, .spin { animation: none; }
  .card-body { transition: none; }
}

.msgs { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.msg { font-size: 12px; padding: 6px 10px; border-radius: 6px; margin: 0; }
.msg.warn { background: rgba(243, 201, 105, 0.07); color: var(--warn); border: 1px solid rgba(243, 201, 105, 0.22); }
.msg.info { background: rgba(76, 141, 246, 0.08); color: #a9c8ff; border: 1px solid rgba(76, 141, 246, 0.25); }
.msg.err { background: rgba(208, 59, 59, 0.1); color: #ffb3b3; border: 1px solid rgba(208, 59, 59, 0.35); }
.stale { margin-bottom: 10px; }
.card-body-flush > .stale { margin: 10px 16px; }
.panel-err {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px;
  border-radius: 6px;
  background: rgba(208, 59, 59, 0.08);
  border: 1px solid rgba(208, 59, 59, 0.3);
  color: #ffc4c4;
  font-size: 13px;
}
.card-body-flush > .panel-err { margin: 14px 16px; }
.empty { padding: 26px 12px; text-align: center; color: var(--muted); font-size: 13px; }
.empty-sm { padding: 18px 8px; }
.empty b { color: var(--text-2); font-weight: 500; }
.note { font-size: 12px; margin-top: 10px; }
.spin {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 2px solid var(--border-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: rot 0.9s linear infinite;
  vertical-align: -1px;
  margin-right: 4px;
}
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- приветствие ---------- */
.welcome { max-width: 760px; margin: 48px auto; padding: 0 4px; }
.welcome-title { font-size: 26px; font-weight: 600; margin-bottom: 10px; }
.welcome .msg { margin: 14px 0; }
.recent-list { margin-top: 22px; display: flex; flex-direction: column; gap: 6px; }
.recent-list .rp-item { background: var(--card); border: 1px solid var(--border); }
.recent-list .rp-item:hover { background: var(--card-2); }

/* ---------- карточка адреса ---------- */
.addr-card .card-body { padding: 18px 20px; }
.addr-top { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex: none;
  background-color: var(--card-3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.addr-main { flex: 1 1 360px; min-width: 0; }
.addr-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 19px; font-weight: 600; line-height: 1.3; }
.addr-name { overflow-wrap: anywhere; }
.addr-line { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; margin-top: 4px; }
.addr-full { color: var(--text-2); overflow-wrap: anywhere; font-size: 13px; }
.src { font-size: 12px; color: var(--muted); white-space: nowrap; }
.ext { font-size: 12px; font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: var(--card-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.chip-entity { color: var(--text); border-color: #2d4f86; background: rgba(76, 141, 246, 0.12); }
.chip-label { color: var(--text); border-color: #3a4357; }
.chip-type { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); }
.chip-sub { color: var(--muted); font-weight: 400; }
.addr-total { margin-left: auto; text-align: right; min-width: 0; }
.hero { font-size: 48px; font-weight: 600; line-height: 1.05; letter-spacing: -0.01em; }
.delta { margin-top: 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.addr-total .sub { margin-top: 4px; font-size: 12px; }
.chain-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.chain-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 3px;
  border-radius: 999px;
  background: var(--card-2);
  border: 1px solid var(--border);
  font-size: 12px;
}
.cp-name { color: var(--text-2); }
.cp-usd { color: var(--text); }
@media (max-width: 720px) {
  .addr-total { margin-left: 0; text-align: left; width: 100%; }
  .hero { font-size: 36px; }
}

/* ---------- сеть-кружок, логотипы, контрагенты ---------- */
.cc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border-2);
  background: var(--card-2);
  color: var(--text);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
}
.ccs { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.cc-more { width: auto; min-width: 22px; padding: 0 4px; border-radius: 11px; color: var(--text-2); }
.tlogo {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex: none;
  object-fit: cover;
  background: var(--card-3);
  vertical-align: middle;
}
.tlogo.ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-2);
}
.party {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  max-width: 280px;
  min-width: 0;
  color: var(--text);
  white-space: nowrap;
}
a.party:hover { text-decoration: none; }
a.party:hover .party-name, a.party:hover .party-addr { text-decoration: underline; }
.party-name { overflow: hidden; text-overflow: ellipsis; font-weight: 500; min-width: 0; }
.party-pre { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.party-addr { color: var(--text-2); font-family: var(--mono); font-size: 12px; }
.party-self { color: var(--muted); }
.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--card-3);
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.6;
  white-space: nowrap;
  vertical-align: 1px;
}
.badge-spam { background: rgba(208, 59, 59, 0.16); color: #ffb3b3; }
.usd-doubt { color: var(--warn); cursor: help; }

/* ---------- таблицы ---------- */
.tbl-wrap { overflow-x: auto; min-width: 0; -webkit-overflow-scrolling: touch; }
.tbl-wrap.tall { max-height: 560px; overflow-y: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--card-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl th.num { text-align: right; }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.card-body-flush .tbl th:first-child, .card-body-flush .tbl td:first-child { padding-left: 16px; }
.card-body-flush .tbl th:last-child, .card-body-flush .tbl td:last-child { padding-right: 16px; }
.th-btn {
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.th-btn:hover { color: var(--text-2); }
.th-btn .arr { margin-left: 3px; color: var(--text-2); }
tr.is-spam td { opacity: 0.55; }

.asset { display: flex; align-items: center; gap: 10px; min-width: 0; }
.asset-t { min-width: 0; }
.asset-sym { font-weight: 600; }
.asset-name { font-size: 12px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.pane-sum { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: baseline; font-size: 12px; color: var(--text-2); margin-bottom: 10px; }
.pane-sum b { color: var(--text); font-size: 14px; font-weight: 600; }

/* переводы */
.c-time time { color: var(--text-2); cursor: default; }
.c-tx a, .c-tx span { font-size: 12px; }
.tok {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  color: var(--text);
  max-width: 160px;
}
.tok .sym { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tok:hover .sym { text-decoration: underline; }
.swap { display: inline-flex; align-items: baseline; gap: 4px; flex-wrap: nowrap; }
.swap-arrow { color: var(--muted); }
.sym { font-weight: 500; }
.filters {
  display: flex;
  align-items: center;
  gap: 8px 18px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.fld { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; }

/* полоска прогресса краулера */
.progress {
  display: flex;
  align-items: center;
  gap: 8px 14px;
  flex-wrap: wrap;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-2);
}
.pbar { width: 120px; height: 4px; border-radius: 2px; background: var(--card-3); overflow: hidden; flex: none; }
.pbar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 2px; }
/* флекс-элемент .progress: без min-width:0 его min-content = ширина таблицы (nowrap), и на 400px таблица
   вылезала за карточку, а .tbl-wrap не прокручивался; открытый — своей строкой во всю ширину */
.cov-det { font-size: 12px; min-width: 0; max-width: 100%; }
.cov-det[open] { flex: 1 1 100%; }
.cov-det summary { cursor: pointer; color: var(--muted); }
.cov-det .tbl { margin-top: 6px; font-size: 12px; }
.cov-det .tbl td, .cov-det .tbl th { padding: 4px 8px; }
.cov-note { font-size: 12px; margin-top: 12px; }

/* ---------- по сетям (аккордеон) ---------- */
.acc { border-bottom: 1px solid var(--border); }
.acc:last-child { border-bottom: 0; }
.acc summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  cursor: pointer;
  list-style: none;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::before { content: "▸"; color: var(--muted); width: 10px; flex: none; }
.acc[open] summary::before { content: "▾"; }
.acc-name { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-bar { flex: 1 1 60px; height: 4px; border-radius: 2px; background: var(--card-3); overflow: hidden; min-width: 40px; }
.acc-bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.acc-usd { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.acc-n { font-size: 12px; white-space: nowrap; }
.acc .tbl-wrap { padding: 0 0 10px 20px; }

/* ---------- графики ---------- */
.chart { position: relative; width: 100%; min-width: 0; outline-offset: 4px; }
.chart-svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.chart-empty { padding: 40px 10px; text-align: center; color: var(--muted); font-size: 13px; }
.chart .ax { fill: var(--muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .grid.base { stroke: var(--axis); }
.chart .xh { stroke: #5d6679; stroke-width: 1; pointer-events: none; shape-rendering: crispEdges; }
.chart .dot { stroke: var(--card); stroke-width: 2; pointer-events: none; }
.chart .hit { fill: transparent; pointer-events: all; cursor: crosshair; }
.chart .line, .chart .area, .chart .band, .chart .band-edge { pointer-events: none; }
.chart-sum { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; margin-bottom: 10px; font-size: 12px; color: var(--text-2); }
.chart-sum b { font-size: 18px; font-weight: 600; color: var(--text); }
.tip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  pointer-events: none;
  background: #0c1017;
  border: 1px solid var(--border-2);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  min-width: 110px;
  max-width: 300px;
}
.tip-h { color: var(--text-2); font-size: 11px; margin-bottom: 3px; white-space: nowrap; }
.tip-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.tip-key { width: 12px; height: 2px; border-radius: 1px; flex: none; }
.tip-key-none { background: none; }
.tip-v { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.tip-n { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.tip-total { border-top: 1px solid var(--border-2); margin-top: 3px; padding-top: 3px; }
.twin { margin-top: 10px; font-size: 12px; }
.twin summary { cursor: pointer; color: var(--muted); }
.twin .tbl-wrap { max-height: 260px; overflow-y: auto; margin-top: 6px; }

/* биржи */
.ex-halves {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 22px 24px;
}
.ex-half { min-width: 0; }
.ex-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.ex-title { font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-2); }
.ex-total { font-size: 18px; font-weight: 600; }
.ex-sub { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.ex-sub .tbl-wrap { flex: 1 1 170px; }
.donut-host { position: relative; width: 132px; height: 132px; flex: none; }
.donut { display: block; overflow: visible; }
.donut .seg { stroke: var(--card); stroke-width: 2; cursor: pointer; transition: opacity 0.15s; outline: none; }
.donut .seg:focus-visible { stroke: var(--text); }
.donut.has-on .seg:not(.on) { opacity: 0.35; }
.donut-track { stroke: var(--card-3); }
.donut .c1 { fill: var(--text); font-size: 14px; font-weight: 600; font-family: var(--font); }
.donut .c2 { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.lg-item { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.sw { width: 10px; height: 10px; border-radius: 2px; flex: none; display: inline-block; }
.ex-tbl tbody tr { cursor: default; }
.ex-tbl tbody tr.is-hl { background: var(--card-2); }
.ex-name { display: inline-flex; align-items: center; gap: 7px; max-width: 170px; min-width: 0; }
.ex-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------- DeFi, позиции, займы ---------- */
.proto { padding: 10px 0; border-bottom: 1px solid var(--border); }
.proto:last-child { border-bottom: 0; }
.proto-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.proto-name { font-weight: 600; }
.proto-net { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.proto-sub { font-size: 12px; color: var(--text-2); margin: 2px 0 6px 30px; }
.proto .tbl-wrap { padding-left: 30px; }
.kind { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.kind-borrow { color: var(--neg); }
.accts { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-top: 12px; }
.accts b { color: var(--text); font-weight: 600; }
.side { font-weight: 600; }

/* ---------- подвал ---------- */
.foot {
  max-width: 1680px;
  margin: 8px auto 24px;
  padding: 0 16px;
  display: flex;
  gap: 6px 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-2);
}

@media (max-width: 560px) {
  .page { padding: 12px 12px 16px; }
  .topbar-in { padding: 8px 12px; }
  .foot { padding: 0 12px; }
  .card-head { padding: 0 12px; }
  .card-body { padding: 12px; }
  .filters, .progress, .card-foot { padding-left: 12px; padding-right: 12px; }
  .card-body-flush .tbl th:first-child, .card-body-flush .tbl td:first-child { padding-left: 12px; }
  .card-body-flush .tbl th:last-child, .card-body-flush .tbl td:last-child { padding-right: 12px; }
  .hstats { margin-left: 0; }
  .tabs { gap: 14px; }
}

/* вход на публичный адрес (Tailscale Funnel) */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; box-sizing: border-box; }
.login-card { width: 100%; max-width: 340px; padding: 22px 20px 20px; display: grid; gap: 14px; box-sizing: border-box; }
.login-title { margin: 0; font-size: 18px; font-weight: 600; }
.login-fld { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.login-fld .inp { width: 100%; box-sizing: border-box; font-size: 15px; padding: 8px 10px; }
.logout { display: inline; margin: 0; }
