/* BASIS — базовый слой: каркас, сетка, таблица, компоненты.
   Визуальный характер задаётся темой в designs/<theme>/theme.css */

:root {
  --bg: #08080b;
  --bg-2: #0c0c11;
  --panel: rgba(18, 18, 26, .72);
  --panel-solid: #111117;
  --line: rgba(255, 255, 255, .075);
  --line-2: rgba(255, 255, 255, .14);
  --text: #eef0f6;
  --muted: rgba(238, 240, 246, .60);
  --dim: rgba(238, 240, 246, .36);
  --accent: #8b7bff;
  --accent-2: #57e6ff;
  --accent-3: #ff6ad5;
  --pos: #5eead4;
  --neg: #ff6b8b;
  --warn: #ffc46b;
  --radius: 18px;
  --radius-sm: 12px;
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', ui-monospace, monospace;
  --sidebar: 264px;
  --topbar-h: 63px;
  --seg1: #8b7bff;
  --seg2: #57e6ff;
  --seg3: #ff6ad5;
  --seg4: #ffc46b;
  --seg5: #5eead4;
  --seg6: rgba(255, 255, 255, .22);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: #08080b; }
button, input { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl, dd { margin: 0; }
code, b, strong { font-weight: inherit; }
code { font-family: var(--font-mono); }
:focus-visible { outline: 1px solid var(--accent-2); outline-offset: 3px; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .13); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- каркас ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 18px 18px;
  border-right: 1px solid var(--line);
  z-index: 40;
}
.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.view {
  flex: 1;
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 28px;
}
.view__inner { animation: viewIn .55s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- бренд ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 22px;
}
.brand__mark {
  position: relative;
  width: 36px;
  height: 36px;
  flex: none;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.brand__mark i {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 1px solid var(--accent-2);
  transform: rotate(45deg);
  opacity: .9;
}
.brand__mark i:nth-child(2) { width: 10px; height: 10px; border-color: var(--accent); }
.brand__mark i:nth-child(3) { width: 4px; height: 4px; background: var(--accent-2); border: 0; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__text b {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: .14em;
  font-weight: 700;
}
.brand__text small {
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
  margin-top: 4px;
}

/* ---------- навигация ---------- */
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__caption {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 16px 12px 8px;
}
.nav__item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 11px;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
  position: relative;
  transition: color .2s, background .2s;
}
.nav__item:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.nav__item.is-active { color: var(--text); }
.nav__ico { width: 18px; height: 18px; flex: none; display: grid; place-items: center; opacity: .9; }
.nav__ico svg { width: 17px; height: 17px; }
.nav__label { flex: 1; white-space: nowrap; }
.nav__badge {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  color: var(--muted);
}
.nav__badge--soon { border-color: var(--line); color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.sidebar__spacer { flex: 1; }

.learn {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, .02);
  margin-bottom: 12px;
}
.learn p { font-size: 11.5px; color: var(--muted); margin: 8px 0 10px; line-height: 1.5; }
.sidebar__status {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 6px 0;
  font-size: 10px;
  color: var(--dim);
  line-height: 1.35;
}
.sidebar__status b { color: var(--muted); font-weight: 500; }

.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: var(--dim); flex: none; }
.dot--live { background: var(--pos); box-shadow: 0 0 0 3px rgba(94, 234, 212, .12); animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* ---------- топбар ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: var(--topbar-h);
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
}
.chains { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.chain {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  transition: .2s;
}
.chain:hover { color: var(--text); border-color: var(--line); }
.chain.is-active { color: var(--text); border-color: var(--line-2); background: rgba(255, 255, 255, .05); }
.chain__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--dim)); }
.chain__all {
  width: 7px; height: 7px; border-radius: 2px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.topbar__right { display: flex; align-items: center; gap: 10px; }
.wallet-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 13px 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: .2s;
}
.wallet-chip:hover { border-color: var(--line-2); }
.wallet-chip__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pos); box-shadow: 0 0 10px var(--pos); }
.wallet-chip__text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.wallet-chip__text small { font-size: 9px; color: var(--dim); }
.wallet-chip__text b { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .02em; }
.icon-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  display: grid;
  place-items: center;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }

/* ---------- общее ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--dim);
}
.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 22px;
}
.panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.panel__head h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin-top: 6px;
}
.panel__head--tight { margin-bottom: 8px; }
.panel__note { font-size: 10.5px; color: var(--dim); margin-top: 10px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .04em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.tag--ghost { color: var(--dim); }
.tag--soon { border-color: var(--warn); color: var(--warn); }
.tag--chain i { width: 5px; height: 5px; border-radius: 50%; background: var(--c); display: inline-block; }
.link-btn {
  font-size: 11.5px;
  color: var(--accent-2);
  border-bottom: 1px solid transparent;
  transition: .2s;
  white-space: nowrap;
}
.link-btn:hover { border-bottom-color: currentColor; }
.rot { display: inline-block; transition: transform .4s; }
.link-btn:hover .rot { transform: rotate(180deg); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: .2s;
}
.btn--primary { background: linear-gradient(110deg, var(--accent), var(--accent-2)); color: #08080b; font-weight: 600; }
.btn--primary:hover { filter: brightness(1.08); box-shadow: 0 8px 30px -10px var(--accent); }
.btn--ghost { border: 1px solid var(--line-2); color: var(--muted); }
.btn--ghost:hover { color: var(--text); border-color: var(--accent); }
.notice {
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 10px;
  background: rgba(255, 255, 255, .025);
  padding: 13px 16px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 18px;
  line-height: 1.55;
}
.notice b { color: var(--text); }
.notice--warn { border-left-color: var(--warn); }
.empty { padding: 26px 16px; text-align: center; color: var(--dim); font-size: 12px; }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, .85fr);
  gap: 32px;
  align-items: stretch;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
}
.hero__copy { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 14px; max-width: 660px; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.04;
  letter-spacing: -.035em;
  font-weight: 600;
}
.hero h1 em { font-style: normal; }
.lead { color: var(--muted); font-size: 13.5px; max-width: 54ch; line-height: 1.6; }
.wallet-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(0, 0, 0, .25);
  margin-top: 4px;
  max-width: 560px;
  transition: border-color .2s, box-shadow .2s;
}
.wallet-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(139, 123, 255, .1); }
.wallet-form__icon { color: var(--dim); font-size: 15px; }
.wallet-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  padding: 10px 2px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.wallet-form input::placeholder { color: var(--dim); }
.wallet-form input.is-error { color: var(--neg); }
.hero__examples { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--dim); }
.chip--demo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  line-height: 1.2;
  transition: .2s;
}
.chip--demo:hover, .chip--demo.is-active { border-color: var(--accent); }
.chip--demo b { font-size: 11px; font-weight: 500; color: var(--text); }
.chip--demo small { font-size: 9px; color: var(--dim); }
.hero__card {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .01));
}
.hero__card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hero__total {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.2vw, 44px);
  letter-spacing: -.04em;
  line-height: 1;
  margin: 18px 0 8px;
  font-weight: 600;
}
.hero__meta { font-size: 11px; color: var(--dim); }
.hero__profit { display: flex; align-items: baseline; gap: 8px; margin-top: 14px; }
.hero__profit span { font-family: var(--font-mono); font-size: 17px; color: var(--pos); }
.hero__profit small { font-size: 10px; color: var(--dim); }
.hero__spark { height: 64px; margin: 10px -4px 0; }
.hero__foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--dim);
}
.spark { width: 100%; height: 100%; display: block; stroke: var(--accent-2); stroke-width: 1.5; }
.hero__profit, .hero__total { font-variant-numeric: tabular-nums; }

/* ---------- сетки ---------- */
.grid { display: grid; gap: 18px; }
.grid--dash {
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  grid-template-areas:
    "chart ai"
    "pos pos"
    "alloc alloc";
}
.panel--chart { grid-area: chart; }
.panel--ai { grid-area: ai; display: flex; flex-direction: column; gap: 16px; }
.panel--ai .insights { gap: 18px; justify-content: center; }
.panel--pos { grid-area: pos; }
.panel--alloc { grid-area: alloc; }
.panel--pos .mini-positions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
.panel--pos .mini-pos:nth-child(2) { border-top: 0; }
@media (max-width: 900px) { .panel--pos .mini-positions { grid-template-columns: 1fr; } .panel--pos .mini-pos:nth-child(2) { border-top: 1px solid var(--line); } }

/* ---------- периоды и график ---------- */
.periods { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; margin: 18px 0 14px; }
.period {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .02);
  min-width: 0;
}
.period__label { font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); white-space: nowrap; }
.period__value { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.period__pct { font-family: var(--font-mono); font-size: 9px; color: var(--dim); white-space: nowrap; }
.period--hero { border-color: var(--accent); background: rgba(139, 123, 255, .09); }
.period--hero .period__value { color: var(--pos); }
.chart { position: relative; }
.chart__svg { display: block; width: 100%; height: 208px; overflow: visible; }
.chart__grid { stroke: var(--line); stroke-dasharray: 2 7; stroke-width: 1; }
.chart__line { stroke: var(--accent-2); stroke-width: 2; filter: drop-shadow(0 0 6px rgba(87, 230, 255, .35)); }
.chart__stop-a { stop-color: var(--accent); stop-opacity: .30; }
.chart__stop-b { stop-color: var(--accent); stop-opacity: 0; }
.chart__dot { fill: var(--accent-2); }
.chart__halo { fill: var(--accent-2); opacity: .14; }
.chart__labels { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 9px; color: var(--dim); margin-bottom: 6px; }
.chart__x { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 8.5px; color: var(--dim); opacity: .75; padding-top: 6px; }

/* ---------- AI ---------- */
.ai-head { display: flex; align-items: center; gap: 14px; }
.ai-head__text { flex: 1; }
.ai-head__text h2 { font-family: var(--font-display); font-size: 18px; margin-top: 5px; letter-spacing: -.01em; }
.orb { position: relative; width: 58px; height: 58px; flex: none; }
.orb__ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--line-2); border-top-color: var(--accent-2); animation: spin 7s linear infinite; }
.orb__ring--2 { inset: 9px; border-top-color: var(--accent); animation-duration: 4.5s; animation-direction: reverse; }
.orb__core {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #fff, var(--accent-2) 45%, var(--accent) 100%);
  box-shadow: 0 0 22px var(--accent), 0 0 50px rgba(139, 123, 255, .35);
}
@keyframes spin { to { transform: rotate(360deg); } }
.score { display: flex; align-items: baseline; gap: 2px; font-family: var(--font-mono); }
.score b { font-size: 24px; font-weight: 500; }
.score small { font-size: 9px; color: var(--dim); }
.score-bar { height: 3px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.score-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.insights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; flex: 1; }
.insight { display: flex; gap: 10px; }
.insight__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--pos); flex: none; margin-top: 7px; }
.insight--warn .insight__dot { background: var(--warn); }
.insight--risk .insight__dot { background: var(--neg); }
.insight--info .insight__dot { background: var(--accent-2); }
.insight b { display: block; font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.insight p { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.ai-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- мини-позиции ---------- */
.mini-positions { list-style: none; margin: 4px 0 0; padding: 0; }
.mini-pos { border-top: 1px solid var(--line); }
.mini-pos:first-child { border-top: 0; }
.mini-pos__btn {
  width: 100%;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto 92px;
  align-items: center;
  gap: 11px;
  padding: 10px 6px;
  text-align: left;
  border-radius: 9px;
  transition: background .2s;
}
.mini-pos__btn:hover { background: rgba(255, 255, 255, .035); }
.mini-pos__name b { display: block; font-size: 12.5px; font-weight: 500; }
.mini-pos__name small { font-size: 10px; color: var(--dim); }
.mini-pos__num { text-align: right; }
.mini-pos__num b { display: block; font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.mini-pos__num small { font-size: 9.5px; color: var(--pos); }
.mini-pos__spark { height: 26px; opacity: .8; }

/* ---------- аллокация ---------- */
.panel--alloc { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(260px, 1fr); align-items: center; gap: 24px 40px; }
.panel--alloc .panel__head { grid-column: 1 / -1; }
.alloc { display: flex; align-items: center; gap: 28px; }
.donut { width: 132px; height: 132px; border-radius: 50%; flex: none; position: relative; display: grid; place-items: center; }
.donut__inner {
  width: 92px; height: 92px; border-radius: 50%;
  background: var(--panel-solid);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; z-index: 1; text-align: center;
}
.donut__inner b { font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.donut__inner small { font-size: 8.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; flex: 1; }
.legend li { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }
.legend i { width: 6px; height: 6px; border-radius: 2px; background: var(--c); flex: none; }
.legend span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend b { font-family: var(--font-mono); font-size: 10px; font-weight: 400; color: var(--dim); }
.chain-bars { border-left: 1px solid var(--line); padding-left: 32px; }
.bar { display: grid; grid-template-columns: 82px minmax(0, 1fr) 36px; align-items: center; gap: 10px; font-size: 10.5px; margin-top: 9px; color: var(--muted); }
.bar__track { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.bar__track i { display: block; height: 100%; border-radius: 99px; background: var(--c); opacity: .85; }
.bar__val { font-family: var(--font-mono); font-size: 9.5px; color: var(--dim); text-align: right; }
.chain-bars .eyebrow { margin-bottom: 4px; }

/* ---------- page head / stats ---------- */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-head h1 {
  font-family: var(--font-display);
  font-size: clamp(27px, 2.7vw, 36px);
  letter-spacing: -.03em;
  font-weight: 600;
  margin: 7px 0 7px;
}
.page-head p { font-size: 12px; color: var(--dim); }
.page-head code { color: var(--muted); }
.page-head__actions { display: flex; gap: 9px; align-items: center; }
.quick-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--panel);
  min-width: 0;
}
.stat b { display: block; font-family: var(--font-mono); font-size: 20px; font-weight: 500; margin: 7px 0 2px; letter-spacing: -.02em; }
.stat small { font-size: 10px; color: var(--dim); }

/* ---------- таблица ---------- */
.table-panel { padding: 0; }
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.toolbar__left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar__title { font-family: var(--font-display); font-size: 15px; }
.toolbar__hint { font-size: 10px; color: var(--dim); }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(0, 0, 0, .22);
  min-width: 250px;
  color: var(--dim);
  font-size: 12px;
}
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 11.5px; color: var(--text); }
.search input::placeholder { color: var(--dim); }
.table-scroll { overflow-x: auto; }
.dtable { width: 100%; min-width: 1060px; border-collapse: collapse; font-size: 12px; }
.dtable th {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dim);
  text-align: right;
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  vertical-align: bottom;
}
.dtable th:hover { color: var(--muted); }
.dtable th.c-proto, .dtable th.c-asset { text-align: left; }
.th-in { display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end; }
.c-proto .th-in, .c-asset .th-in { justify-content: flex-start; }
.sort-arrow { font-size: 8px; opacity: .4; font-style: normal; }
th.is-sorted { color: var(--text); }
th.is-sorted .sort-arrow { opacity: 1; color: var(--accent-2); }
.dtable th.th-group { text-align: center; color: var(--muted); letter-spacing: .12em; cursor: default; }
.th-group { border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.thead-sub th { padding-top: 4px; padding-bottom: 11px; }
.dtable td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dtable tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.num--strong { font-weight: 500; color: var(--text); }
.c-proto { min-width: 218px; }
.c-asset { width: 88px; }
.c-caret { width: 34px; text-align: center; }
.proto { display: flex; align-items: center; gap: 10px; }
.proto__text { min-width: 0; }
.proto__text b { display: block; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.proto__text small { font-size: 9.5px; color: var(--dim); white-space: nowrap; }
.proto-logo {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  flex: none;
}
.proto-logo--lg { width: 42px; height: 42px; border-radius: 12px; font-size: 18px; }
.chain-inline i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--c); margin-right: 4px; }
.asset { font-family: var(--font-mono); font-size: 10px; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; color: var(--muted); letter-spacing: .03em; }
.dtable .row { cursor: pointer; transition: background .18s; }
.dtable .row:hover { background: rgba(255, 255, 255, .028); }
.dtable .row.is-open { background: rgba(255, 255, 255, .035); }
.profit span { display: block; font-size: 11.5px; color: var(--pos); }
.profit small { display: block; font-size: 9px; color: var(--dim); margin-top: 1px; }
.profit--main span { font-weight: 500; color: var(--text); }
.apy { color: var(--accent-2); }
.caret { display: inline-block; color: var(--dim); transition: transform .25s; font-size: 12px; }
.row.is-open .caret { transform: rotate(180deg); }
.row-detail { display: none; }
.row-detail.is-open { display: table-row; }
.row-detail > td { padding: 0; background: rgba(255, 255, 255, .022); border-bottom: 1px solid var(--line); }
.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(200px, .9fr) minmax(220px, 1fr);
  gap: 28px;
  padding: 20px 22px 22px;
}
.detail__about h3 { font-family: var(--font-display); font-size: 17px; margin: 6px 0 8px; font-weight: 600; }
.detail__about h3 span { color: var(--dim); font-family: var(--font-mono); font-size: 11px; }
.detail__about p { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin-bottom: 8px; }
.detail__how { color: var(--dim) !important; }
.detail__how b { color: var(--muted); }
.detail__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-content: start; }
.detail__stats small { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); }
.detail__stats b { font-family: var(--font-mono); font-size: 13px; font-weight: 500; }
.detail__bars { display: flex; flex-direction: column; gap: 7px; justify-content: center; }
.dbar { display: grid; grid-template-columns: 74px minmax(0, 1fr) 62px; align-items: center; gap: 8px; font-size: 9.5px; color: var(--dim); }
.dbar__track { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.dbar__track i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; }
.dbar b { font-family: var(--font-mono); font-weight: 400; color: var(--muted); text-align: right; font-size: 9.5px; }
.dtable tfoot td {
  padding: 12px 10px;
  border-top: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .035);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
}
.dtable tfoot td:first-child { text-align: left; font-size: 9.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.table-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  font-size: 9.5px;
  color: var(--dim);
}

/* ---------- проекты ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.pcard {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  position: relative;
  overflow: hidden;
  transition: border-color .25s, transform .25s;
}
.pcard:hover { border-color: var(--line-2); transform: translateY(-2px); }
.pcard__top { display: flex; align-items: center; gap: 12px; }
.pcard__id { min-width: 0; }
.pcard__id h3 { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.pcard__id span { font-size: 9.5px; color: var(--dim); }
.risk-wrap { margin-left: auto; }
.risk { display: flex; gap: 3px; align-items: flex-end; }
.risk i { width: 4px; height: 11px; border-radius: 1px; background: rgba(255, 255, 255, .1); }
.risk i.on { background: var(--warn); }
.pcard__about { font-size: 11.5px; line-height: 1.6; color: var(--muted); flex: 1; }
.pcard__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.pcard__stats dt { font-size: 8.5px; text-transform: uppercase; letter-spacing: .11em; color: var(--dim); }
.pcard__stats dd { font-family: var(--font-mono); font-size: 11.5px; margin-top: 3px; }
.pcard__chains { display: flex; flex-wrap: wrap; gap: 5px; }
.btn--monitor {
  border: 1px solid var(--line-2);
  border-radius: 9px;
  padding: 9px;
  font-size: 11.5px;
  color: var(--muted);
  justify-content: center;
}
.btn--monitor:hover { color: var(--text); border-color: var(--accent); }
.btn--monitor.is-on { color: var(--accent-2); border-color: var(--accent-2); background: rgba(87, 230, 255, .06); }

/* ---------- сложные протоколы ---------- */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 20px; }
.ccard {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow: hidden;
}
.ccard h3 { font-family: var(--font-display); font-size: 16px; font-weight: 600; margin-top: 4px; }
.ccard p { font-size: 11.5px; color: var(--dim); line-height: 1.55; flex: 1; }
.ccard__lock { position: absolute; top: 14px; right: 16px; font-size: 11px; opacity: .5; }
.ccard__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 9.5px; color: var(--dim); }
.roadmap { margin-top: 4px; }
.steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.steps li { background: var(--panel-solid); padding: 14px; display: flex; flex-direction: column; gap: 5px; }
.steps b { font-family: var(--font-mono); font-size: 9px; color: var(--dim); }
.steps span { font-size: 11.5px; }
.steps small { font-size: 9px; color: var(--dim); }
.steps .is-done { background: rgba(139, 123, 255, .09); }
.steps .is-done b, .steps .is-done small { color: var(--accent-2); }

/* ---------- подсказки / тост / футер ---------- */
.hint {
  display: inline-grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  font-size: 8px;
  color: var(--dim);
  margin-left: 4px;
  cursor: help;
  font-family: var(--font-mono);
  vertical-align: middle;
}
.hint:hover { color: var(--text); border-color: var(--accent-2); }
.tip {
  position: fixed;
  z-index: 200;
  max-width: 250px;
  padding: 9px 11px;
  border-radius: 9px;
  background: #191923;
  border: 1px solid var(--line-2);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 10.5px;
  line-height: 1.5;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.tip.is-visible { opacity: 1; transform: none; }
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 300;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 11px;
  background: #15151d;
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 11.5px;
  line-height: 1.5;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .55);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: .25s;
}
.toast.is-visible { opacity: 1; transform: none; }
.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 20px 28px 26px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 9.5px;
  line-height: 1.6;
}

/* ---------- адаптив ---------- */
@media (max-width: 1320px) {
  :root { --sidebar: 236px; }
  .view { padding: 22px; }
  .detail { grid-template-columns: minmax(0, 1.4fr) minmax(180px, .9fr) minmax(190px, 1fr); gap: 20px; }
}
@media (max-width: 1180px) {
  .grid--dash {
    grid-template-columns: 1fr;
    grid-template-areas: "chart" "pos" "ai" "alloc";
  }
  .panel--alloc { grid-template-columns: 1fr; }
  .chain-bars { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 16px; }
  .quick-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .topbar { min-width: 0; }
  .sidebar { min-width: 0;
    position: sticky;
    top: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    overflow-x: auto;
  }
  .brand { padding: 0 14px 0 0; }
  .brand__text { display: none; }
  .nav { flex-direction: row; gap: 4px; min-width: 0; }
  .nav__caption, .sidebar__spacer, .learn, .sidebar__status { display: none; }
  .nav__item { padding: 8px 10px; }
  .nav__label { font-size: 11px; }
  .topbar { top: 56px; }
  .chains { flex-wrap: nowrap; overflow-x: auto; }
  .hero { grid-template-columns: 1fr; padding: 24px; gap: 22px; }
  .hero__card { max-width: 420px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .view { padding: 16px; }
  .topbar { padding: 10px 16px; }
  .chains { padding-bottom: 2px; }
  .topbar__right { display: none; }
  .nav__badge { display: none; }
  .nav__ico { display: none; }
  .sidebar { padding: 9px 12px; }
  .brand { padding-right: 6px; }
  .nav__item { padding: 8px 9px; }
  .nav__label { font-size: 10.5px; }
  .wallet-form__icon { display: none; }
  .wallet-form input { padding-left: 8px; }
  .hero { padding: 20px 18px; }
  .hero h1 { font-size: 27px; }
  .wallet-form { border-radius: 14px; flex-wrap: wrap; padding: 8px; }
  .wallet-form input { flex: 1 0 100%; padding: 8px 6px; }
  .wallet-form .btn { width: 100%; }
  .periods { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail { grid-template-columns: 1fr; }
  .quick-stats { grid-template-columns: 1fr 1fr; }
  .alloc { flex-direction: column; align-items: flex-start; }
  .legend { grid-template-columns: 1fr 1fr; }
  .page-head__actions { width: 100%; }
  .pcard__stats { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; }
  .stat b { font-size: 17px; }
  .footer { padding: 16px; }
  .toast { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}

/* ---------- рекомендации AI ---------- */
.ai-actions { border-top: 1px solid var(--line); padding-top: 13px; display: flex; flex-direction: column; gap: 7px; }
.ai-actions ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ai-actions li { display: flex; gap: 8px; font-size: 11px; line-height: 1.5; color: var(--muted); }
.ai-actions li span { color: var(--accent-2); font-family: var(--font-mono); font-size: 10px; margin-top: 1px; }

/* ---------- объяснялки под таблицей ---------- */
.learn-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
}
.learn-grid article { background: var(--panel-solid); padding: 18px 20px; }
.learn-grid h3 { font-family: var(--font-display); font-size: 13.5px; font-weight: 600; margin: 9px 0 6px; }
.learn-grid p { font-size: 11px; color: var(--muted); line-height: 1.6; }
.learn-grid .eyebrow { color: var(--accent-2); }
@media (max-width: 900px) { .learn-grid { grid-template-columns: 1fr; } }

.dtable th:focus-visible,
.dtable tr.row:focus-visible {
  outline: 1px solid var(--accent-2);
  outline-offset: -2px;
}

/* ================= новые разделы: активы, стейкинг, рынок ================= */

.pos { color: var(--pos); }
.neg { color: var(--neg); }
.dim { color: var(--dim); }
.is-neg { color: var(--neg); }

/* --- полоса классов активов --- */
.asset-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.astat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
  min-width: 0;
}
.astat b { font-family: var(--font-mono); font-size: 19px; font-weight: 500; letter-spacing: -.03em; margin-top: 4px; }
.astat small { font-size: 9.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.astat__bar { display: block; height: 3px; border-radius: 99px; background: rgba(255, 255, 255, .06); overflow: hidden; margin-top: 9px; }
.astat__bar i { display: block; height: 100%; border-radius: 99px; opacity: .85; }
.astat--stable { border-color: rgba(87, 230, 255, .22); }
.astat--eth { border-color: rgba(139, 123, 255, .24); }
.astat--stake { border-color: rgba(94, 234, 212, .2); }
.astat--cash { border-color: rgba(255, 196, 107, .18); }

/* --- управление --- */
.panel__tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel__sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 15px;
  font-size: 10.5px;
  color: var(--dim);
}
.panel__sub b { color: var(--muted); font-weight: 500; }
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, .18);
}
.segmented button {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 10px;
  color: var(--dim);
  white-space: nowrap;
  transition: .2s;
}
.segmented button:hover { color: var(--text); }
.segmented button.is-active { background: rgba(255, 255, 255, .08); color: var(--text); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  transition: .2s;
}
.fchip span { font-family: var(--font-mono); font-size: 8.5px; color: var(--dim); }
.fchip:hover { border-color: var(--line-2); color: var(--text); }
.fchip.is-active { border-color: var(--accent); color: var(--text); background: rgba(139, 123, 255, .1); }
.fchip.is-active span { color: var(--accent-2); }

/* --- вспомогательные подписи --- */
.hero__price-line {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--pos);
}
.hero__price-line small { font-family: var(--font-body); font-size: 9px; color: var(--dim); }
.asset-qty { display: block; font-family: var(--font-mono); font-size: 9px; color: var(--dim); margin-top: 3px; }
.cell-sub { display: block; font-family: var(--font-mono); font-size: 8.5px; font-weight: 400; margin-top: 2px; }
.profit.is-neg span { color: var(--neg); }
.profit.is-neg small { color: rgba(255, 112, 150, .65); }
.profit.is-neg .cell-sub { color: var(--neg); }
.period__value.is-neg { color: var(--neg); }
.mtable .chg { display: inline-block; }

/* --- стейкинг --- */
.grid--stake { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); margin-bottom: 18px; }
.price-big {
  font-family: var(--font-mono);
  font-size: clamp(30px, 3vw, 40px);
  letter-spacing: -.04em;
  margin: 18px 0 2px;
  font-weight: 500;
}
.price-changes { display: flex; gap: 26px; flex-wrap: wrap; margin: 12px 0 6px; }
.price-changes small { display: block; font-size: 8.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); }
.price-changes b { font-family: var(--font-mono); font-size: 11.5px; font-weight: 400; }
.chart--eth .chart__svg { height: 165px; }
.periods--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.reward-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding-top: 15px;
  margin-top: 12px;
}
.reward-split b { display: block; font-family: var(--font-mono); font-size: 20px; font-weight: 500; margin: 6px 0 2px; }
.reward-split small { font-size: 9.5px; color: var(--dim); line-height: 1.4; }
.stake-list { display: flex; flex-direction: column; margin-top: 6px; }
.stake-row { border-top: 1px solid var(--line); padding: 15px 0; }
.stake-row:first-child { border-top: 0; padding-top: 4px; }
.stake-row__head { display: flex; align-items: center; gap: 12px; }
.stake-row__id { flex: 1; min-width: 0; }
.stake-row__id b { display: block; font-size: 13px; font-weight: 500; }
.stake-row__id small { font-size: 9.5px; color: var(--dim); }
.stake-row__value { font-family: var(--font-mono); font-size: 13px; font-weight: 500; }
.apy-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--pos);
  border: 1px solid rgba(94, 234, 212, .3);
  border-radius: 6px;
  padding: 3px 7px;
}
.stake-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
  margin-top: 12px;
  padding-left: 42px;
}
.stake-grid small { display: block; font-size: 8.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin-bottom: 3px; }
.stake-grid b { font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.stake-grid .link-btn { align-self: center; }
.mtable--providers { min-width: 560px; }
.mtable--providers th:first-child { text-align: left; }
.risk-name { font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.risk-name--1, .risk-name--2 { color: var(--pos); }
.risk-name--3 { color: var(--warn); }
.risk-name--4, .risk-name--5 { color: var(--neg); }

/* --- рыночные таблицы --- */
.market-panel { padding: 0; }
.market-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.market-tabs { display: flex; gap: 4px; }
.mtab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--muted);
}
.mtab span { font-family: var(--font-mono); font-size: 8.5px; color: var(--dim); }
.mtab:hover { color: var(--text); }
.mtab.is-active { background: rgba(255, 255, 255, .06); color: var(--text); }
.market-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.source {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--dim);
}
.refresh-ico { display: inline-block; margin-right: 7px; font-size: 12px; }
.refresh-ico.is-spin { animation: spin 1s linear infinite; }
.mtable { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 12px; }
.mtable th {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
  text-align: right;
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.mtable th.rank, .mtable th.mname { text-align: left; }
.mtable th:hover { color: var(--muted); }
.mtable th.is-sorted { color: var(--text); }
.mtable th.is-sorted .sort-arrow { color: var(--accent-2); opacity: 1; }
.mtable td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.mtable tbody tr:last-child td { border-bottom: 0; }
.mtable .mrow { cursor: pointer; transition: background .18s; }
.mtable .mrow:hover { background: rgba(255, 255, 255, .03); }
.mtable .rank { width: 36px; padding-left: 16px; font-family: var(--font-mono); font-size: 9px; color: var(--dim); text-align: left; }
.mtable .mname { min-width: 220px; }
.mtable .mname__text { display: inline-flex; flex-direction: column; vertical-align: middle; margin-left: 9px; line-height: 1.25; }
.mtable .mname__text b { font-size: 12.5px; font-weight: 500; }
.mtable .mname__text small { font-size: 8.5px; color: var(--dim); }
.mtable th.mchains { text-align: left; }
.mtable .mchains { white-space: nowrap; }
.mtable .mchains small { font-family: var(--font-mono); font-size: 8px; color: var(--dim); margin-left: 3px; }
.mtable .mleader { font-size: 10.5px; color: var(--muted); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c, #9AA0A6); margin-right: 3px; vertical-align: middle; }
.mlogo {
  position: relative;
  width: 28px;
  height: 28px;
  flex: none;
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
  overflow: hidden;
}
.mlogo__fallback { font-family: var(--font-display); font-size: 11px; font-weight: 600; color: var(--muted); }
.mlogo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.mlogo--xl { width: 48px; height: 48px; border-radius: 13px; }
.mlogo--xl .mlogo__fallback { font-size: 19px; }
.chain-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--c);
  color: var(--c);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, .03);
  vertical-align: middle;
}
.chain-mark--lg { width: 48px; height: 48px; font-size: 18px; }
.chg { font-family: var(--font-mono); font-size: 9.5px; padding: 2px 6px; border-radius: 5px; white-space: nowrap; }
.chg--up { color: var(--pos); background: rgba(94, 234, 212, .08); }
.chg--down { color: var(--neg); background: rgba(255, 112, 150, .08); }
.chg--flat { color: var(--dim); }
.market-more { display: flex; justify-content: center; padding: 16px; }
.mtable .c-caret { width: 30px; color: var(--dim); text-align: center; }

/* --- детальная страница --- */
.page-head.detail-head { align-items: flex-start; margin-bottom: 20px; }
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  flex: none;
  margin-top: 4px;
}
.back-btn svg { width: 12px; height: 12px; }
.back-btn:hover { color: var(--text); border-color: var(--line-2); }
.detail-title { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 260px; }
.detail-title h1 { font-family: var(--font-display); font-size: clamp(26px, 3vw, 38px); letter-spacing: -.03em; font-weight: 600; margin: 5px 0 5px; }
.detail-title p { font-size: 10.5px; color: var(--dim); }
.grid--detail { grid-template-columns: minmax(0, 1.4fr) minmax(0, .9fr); gap: 18px; }
.detail-text { font-size: 12.5px; line-height: 1.7; color: var(--muted); margin: 15px 0 18px; max-width: 62ch; }
.detail-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.detail-meta b { display: block; font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; margin-top: 5px; }
.breakdown { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.break-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.1fr) minmax(70px, 1.3fr) 74px;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 3px 0;
  font-size: 11px;
  color: var(--muted);
  text-align: left;
  transition: color .2s;
}
.break-row:hover { color: var(--text); }
.break-row__name { display: flex; align-items: center; gap: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.break-row__name .mlogo { width: 21px; height: 21px; border-radius: 5px; }
.break-row__track { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.break-row__track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.break-row b { font-family: var(--font-mono); font-size: 9.5px; font-weight: 400; color: var(--text); text-align: right; }
.detail-aside h2 { font-family: var(--font-display); font-size: 18px; margin: 6px 0 4px; }
.rel-list { display: flex; flex-direction: column; margin-top: 12px; }
.rel-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 0; border-bottom: 1px solid var(--line); text-align: left; }
.rel-item > span { flex: 1; min-width: 0; }
.rel-item b { display: block; font-size: 11.5px; font-weight: 500; }
.rel-item small { font-size: 9px; color: var(--dim); }
.rel-item .caret { color: var(--dim); }
.rel-item:hover b { color: var(--accent-2); }
.facts-list { list-style: none; margin: 14px 0 0; padding: 0; }
.facts-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 10.5px; color: var(--muted); }
.facts-list b { font-family: var(--font-mono); font-size: 10.5px; font-weight: 400; color: var(--text); text-align: right; }
.empty-state { margin-top: 14px; padding: 26px; border: 1px dashed var(--line-2); border-radius: 12px; text-align: center; color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.empty-state .btn { margin-top: 12px; }

.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.learn-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* --- адаптив новых блоков --- */
@media (max-width: 1180px) {
  .grid--stake, .grid--detail { grid-template-columns: 1fr; }
  .asset-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learn-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .detail-head { align-items: flex-start; }
  .detail-title { order: -1; flex-basis: 100%; }
  .stake-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-left: 0; }
  .stake-grid .link-btn { justify-self: start; }
  .market-head { align-items: flex-start; flex-direction: column; }
  .market-tools { width: 100%; }
  .market-tools .search { flex: 1; min-width: 180px; }
}
@media (max-width: 680px) {
  .asset-strip { gap: 8px; }
  .astat { padding: 12px 13px 10px; }
  .astat b { font-size: 16px; }
  .segmented button { padding: 5px 8px; font-size: 9px; }
  .reward-split { grid-template-columns: 1fr; }
  .periods--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learn-grid--4 { grid-template-columns: 1fr; }
  .stake-row__value { font-size: 11px; }
  .stake-row__head { gap: 8px; }
  .price-changes { gap: 16px; }
  .detail-title h1 { font-size: 24px; }
  .break-row { grid-template-columns: minmax(90px, 1fr) minmax(50px, 1fr) 64px; }
}

.profit--empty span { color: var(--dim) !important; font-weight: 400; }

.toolbar__right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero__price-line.is-neg { color: var(--neg); }

.rel-item > span:not(.mlogo) { flex: 1; min-width: 0; }
.rel-item .mlogo { flex: none; }
.detail-guide { margin-top: 18px; border-radius: 12px; }
.detail-guide article { padding: 18px 20px; }

.detail-how { font-size: 12px; line-height: 1.7; color: var(--dim); margin: -6px 0 16px; max-width: 62ch; }
.detail-how b { color: var(--muted); }

@media (max-width: 900px) {
  .market-tools { width: 100%; flex-direction: column; align-items: stretch; }
  .market-tools .search { width: 100%; min-width: 0; }
}
@media (max-width: 680px) {
  body .nav__item[data-view="complex"] { display: none; }
  .sidebar { padding: 8px 10px; }
  .brand { padding-right: 2px; }
  .nav__item { padding: 8px 7px; }
  .nav__label { font-size: 10px; }
}

/* фиксированная сетка таблицы активов: цифры не расползаются */
.dtable { table-layout: fixed; min-width: 1120px; }
.dtable th, .dtable td { padding-left: 8px; padding-right: 8px; }
.dtable .c-proto { min-width: 0; overflow: hidden; }
.dtable .proto__text { overflow: hidden; }
.dtable .proto__text b, .dtable .proto__text small { overflow: hidden; text-overflow: ellipsis; }
.dtable .profit span, .dtable .profit small { white-space: nowrap; }
.dtable .num { padding-right: 10px; }

@media (max-width: 900px) {
  .page-head.detail-head { flex-direction: column; align-items: stretch; gap: 14px; }
  .back-btn { order: -2; align-self: flex-start; margin-top: 0; }
  .detail-title { order: -1; flex-basis: auto; min-width: 0; }
  .page-head.detail-head .page-head__actions { order: 0; }
}

/* блок ETH в раскрытой строке */
.detail--eth { grid-template-rows: auto auto; }
.detail__eth {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .022);
}
.detail__eth small { display: block; font-size: 8.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--dim); }
.detail__eth b { display: block; font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; margin-top: 3px; }
@media (max-width: 900px) { .detail__eth { grid-template-columns: 1fr 1fr; } }

/* ================= оптимизация ================= */

.opt-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 18px;
  margin-bottom: 18px;
  border: 1px solid rgba(139, 123, 255, .3);
  border-radius: 14px;
  background: linear-gradient(100deg, rgba(139, 123, 255, .13), rgba(87, 230, 255, .03));
}
.opt-callout__main { display: flex; flex-direction: column; gap: 5px; }
.opt-callout__line { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.opt-callout__line b { font-family: var(--font-mono); font-size: 19px; font-weight: 500; letter-spacing: -.02em; }
.opt-callout__line span { font-size: 10.5px; color: var(--dim); }

.scenario-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.scenario {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  text-align: left;
  transition: .22s;
}
.scenario:hover { transform: translateY(-2px); border-color: var(--line-2); }
.scenario.is-active { border-color: var(--accent); }
.scenario__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.scenario__name { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.scenario__badge {
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent-2);
  border: 1px solid rgba(87, 230, 255, .3);
  border-radius: 99px;
  padding: 2px 7px;
}
.scenario__desc { font-size: 10.5px; line-height: 1.55; color: var(--dim); margin: 0; flex: 1; min-height: 32px; }
.scenario__delta { font-family: var(--font-mono); font-size: 23px; font-weight: 500; letter-spacing: -.03em; color: var(--pos); }
.scenario__delta small { font-family: var(--font-body); font-size: 9px; color: var(--dim); letter-spacing: 0; }
.scenario__delta.is-neg { color: var(--neg); }
.scenario__stats { display: flex; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 8.5px; color: var(--dim); }

.plan-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--line);
}
.plan-summary > div { background: var(--panel-solid); padding: 16px 18px; min-width: 0; }
.plan-summary b { display: block; font-family: var(--font-mono); font-size: 21px; font-weight: 500; letter-spacing: -.03em; margin: 7px 0 2px; white-space: nowrap; }
.plan-summary b small { font-size: 9px; color: var(--dim); letter-spacing: 0; }
.plan-summary > div > small { font-size: 9px; color: var(--dim); line-height: 1.4; display: block; }
.plan-summary .arrow { font-size: 12px; color: var(--dim); margin: 0 4px; }

.grid--opt { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); margin-bottom: 18px; }

.act-list { display: flex; flex-direction: column; gap: 1px; margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line); }
.act { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 15px 16px; background: var(--panel-solid); }
.act__num { font-family: var(--font-mono); font-size: 9px; color: var(--dim); padding-top: 3px; }
.act__flow { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 12.5px; }
.act__flow b { font-weight: 500; }
.act__chain { font-family: var(--font-mono); font-size: 7.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; }
.act__arrow { color: var(--accent-2); }
.act__token { font-family: var(--font-mono); font-size: 8px; color: var(--accent-2); border: 1px solid rgba(87, 230, 255, .25); border-radius: 4px; padding: 1px 5px; }
.act__why { font-size: 10.5px; line-height: 1.55; color: var(--dim); margin: 5px 0 7px; max-width: 72ch; }
.act__meta { display: flex; gap: 12px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 8.5px; color: var(--dim); }
.act__meta .gain { color: var(--pos); }
.act__meta .gain.is-neg { color: var(--neg); }
.act__amount { font-family: var(--font-mono); font-size: 13px; font-weight: 500; text-align: right; white-space: nowrap; }
.act__amount small { display: block; margin-top: 3px; font-size: 8px; font-weight: 400; color: var(--dim); }
.act--stake { background: rgba(99, 245, 207, .025); }
.act--stake .act__amount { color: var(--pos); }

.keep-note { display: flex; gap: 12px; align-items: baseline; padding: 12px 14px; margin-top: 12px; border: 1px solid var(--line); border-left: 2px solid var(--warn); border-radius: 8px; background: rgba(255, 196, 107, .03); font-size: 10.5px; color: var(--dim); line-height: 1.55; }
.keep-note b { font-family: var(--font-mono); font-size: 14px; color: var(--warn); white-space: nowrap; }
.opt-warn { display: flex; gap: 10px; padding: 10px 12px; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .02); font-size: 10.5px; line-height: 1.5; }
.opt-warn > span { font-family: var(--font-mono); font-size: 10px; color: var(--warn); margin-top: 1px; }
.opt-warn b { display: block; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.opt-warn p { margin: 0; color: var(--dim); }
.opt-warn--risk { border-color: rgba(255, 112, 150, .25); }
.opt-warn--risk > span { color: var(--neg); }
.opt-warn--info > span { color: var(--accent-2); }

.opt-aside h2 { margin: 6px 0 4px; }
.opt-aside__desc { font-size: 11px; line-height: 1.55; color: var(--dim); margin: 0 0 12px; }

.opt-table { width: 100%; min-width: 420px; border-collapse: collapse; font-size: 11px; }
.opt-table th { font-family: var(--font-mono); font-size: 7.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
.opt-table th.num { text-align: right; }
.opt-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.opt-table tbody tr:last-child td { border-bottom: 0; }
.opt-table td b { display: block; font-size: 11.5px; font-weight: 500; }
.opt-table td small { font-size: 8.5px; color: var(--dim); }
.opt-table td.num { text-align: right; font-family: var(--font-mono); font-size: 10px; }

.eth-compare { margin-top: 14px; }
.eth-compare__row { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.eth-compare__row > span { width: 42px; flex: none; }
.eth-compare__row--after { margin-top: 14px; }
.eth-bar { flex: 1; height: 8px; display: flex; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, .06); }
.eth-bar i { display: block; height: 100%; }
.eth-bar .native { background: linear-gradient(90deg, #8b6bff, #4fe3ff); }
.eth-bar .stake { background: linear-gradient(90deg, #4fe3ff, #63f5cf); }
.eth-compare__legend { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 5px 0 0 52px; font-size: 9px; color: var(--dim); }
.eth-compare__legend i { display: inline-block; width: 6px; height: 6px; border-radius: 2px; margin-right: 5px; }
.eth-compare__legend i.native { background: #8b6bff; }
.eth-compare__legend i.stake { background: #63f5cf; }
.stake-mini-list { margin-top: 14px; border-top: 1px solid var(--line); }
.stake-mini { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 10.5px; }
.stake-mini b { display: block; font-weight: 500; }
.stake-mini small { font-size: 8.5px; color: var(--dim); }
.stake-mini .num { font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); white-space: nowrap; }

.logic-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line); }
.logic-grid article { background: var(--panel-solid); padding: 15px 16px; }
.logic-grid b { font-family: var(--font-mono); font-size: 8.5px; color: var(--accent-2); }
.logic-grid h3 { font-family: var(--font-display); font-size: 13px; font-weight: 600; margin: 8px 0 5px; }
.logic-grid p { font-size: 10px; line-height: 1.55; color: var(--dim); margin: 0; }
.opt-details { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.opt-details summary { cursor: pointer; font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.opt-formulas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin-top: 12px; }
.opt-formulas p { margin: 0; font-size: 10px; line-height: 1.6; color: var(--dim); }
.opt-formulas b { color: var(--muted); }

@media (max-width: 1180px) {
  .scenario-grid { grid-template-columns: 1fr 1fr; }
  .plan-summary { grid-template-columns: 1fr 1fr; }
  .grid--opt { grid-template-columns: 1fr; }
  .logic-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .scenario-grid { grid-template-columns: 1fr; }
  .plan-summary { grid-template-columns: 1fr 1fr; }
  .plan-summary > div { padding: 13px 14px; }
  .plan-summary b { font-size: 17px; }
  .act { grid-template-columns: 18px minmax(0, 1fr); }
  .act__amount { grid-column: 2; text-align: left; font-size: 12px; }
  .act__why { font-size: 10px; }
  .logic-grid, .opt-formulas { grid-template-columns: 1fr; }
  .eth-compare__legend { margin-left: 0; }
  .opt-callout { padding: 13px 14px; }
}

.plan-summary b.pos, .plan-summary b.neg { color: inherit; }
.plan-summary b.pos { color: var(--pos); }
.plan-summary b.neg { color: var(--neg); }

.scenario { cursor: pointer; }
