/* ============================================================
   AgentMint — design system v2
   Psychology-first, modelled on top crypto products
   (Coinbase / MetaMask / Aave / Ledger).

   Colour psychology:
   • deep navy ground  → stability, calm, "institutional" feel
   • cobalt blue CTAs  → trust, security, banking (never orange/gold
     which reads "degen / casino" and raises scam suspicion)
   • green             → money, gains, "safe action" (primary CTA)
   • violet accent     → AI / technology signal, used sparingly
   • white text on dark→ high contrast = competence & legibility

   Trust mechanics in UI:
   • every claim links to on-chain verification (transparency)
   • fees and timelines stated up-front (reduces uncertainty)
   • live payout feed + counters (social proof)
   • risk disclaimer visible, not hidden (honesty signal)
   • one primary action per screen, low-contrast secondaries
     (prevents choice paralysis and "too many buttons = scam" feel)
   ============================================================ */

:root {
  --bg: #070b14;
  --bg2: #0b1120;
  --panel: #101a2e;
  --panel2: #152238;
  --border: #1e2c47;
  --border2: #2a3c5e;
  --text: #eef3fb;
  --muted: #93a3bd;
  --blue: #3b82f6;
  --blue2: #2563eb;
  --green: #16c784;
  --green2: #0fa06a;
  --violet: #8b5cf6;
  --danger: #f0616d;
  --amber: #f5b04c;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --grad-blue: linear-gradient(180deg, #4f8ff7, #2563eb);
  --grad-green: linear-gradient(180deg, #22d68f, #0ea368);
  --shadow-btn: 0 8px 24px -8px rgba(37, 99, 235, .55);
  --shadow-btn-green: 0 8px 24px -8px rgba(16, 163, 104, .55);
  --shadow-card: 0 1px 0 rgba(255,255,255,.04) inset, 0 20px 48px -28px rgba(0,0,0,.8);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text);
  font-family: Inter, -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(59,130,246,.35); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px;
  background: rgba(7, 11, 20, .78);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.logo { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.logo span { color: var(--blue); }
.topbar .pill {
  font-size: 12px; font-weight: 500; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 11px; background: rgba(255,255,255,.02);
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.topbar .pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 3px rgba(22,199,132,.15);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(22,199,132,.05); } }
.spacer { flex: 1; }
/* переключатель экранов в шапке: деплой ↔ мой агент */
.viewtabs {
  display: inline-flex; gap: 3px; padding: 3px;
  border: 1px solid var(--border); border-radius: 999px;
  background: rgba(255,255,255,.02);
}
.topbar .vtab {
  font-size: 12px; font-weight: 600; color: var(--muted);
  text-decoration: none; padding: 5px 12px; border-radius: 999px;
  white-space: nowrap; max-width: 34ch; overflow: hidden; text-overflow: ellipsis;
}
.topbar .vtab:hover { color: var(--text); }
.topbar .vtab.active { background: rgba(59,130,246,.16); color: #9dc0ff; }
.wallet-chip { font-family: var(--mono); font-size: 12px; color: var(--green); }

/* ---------- buttons ----------
   Green = "money action" (deposit / deploy / withdraw): the only
   high-contrast element on screen, so the eye always finds it.
   Blue = secondary trust action. Ghost = no-pressure exploration. */
button { font: inherit; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--grad-blue); color: #fff; border: 0;
  border-radius: 12px; padding: 12px 22px;
  font-weight: 600; font-size: 15px; letter-spacing: .01em;
  cursor: pointer; text-decoration: none !important;
  box-shadow: var(--shadow-btn);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 12px 28px -8px rgba(37,99,235,.65); }
.btn:active { transform: translateY(0); filter: brightness(.95); }
.btn.green { background: var(--grad-green); box-shadow: var(--shadow-btn-green); }
.btn.green:hover { box-shadow: 0 12px 28px -8px rgba(16,163,104,.65); }
.btn.ghost {
  background: rgba(255,255,255,.03); color: var(--text);
  border: 1px solid var(--border2); box-shadow: none;
}
.btn.ghost:hover { border-color: var(--blue); background: rgba(59,130,246,.08); }
.btn.danger-ghost {
  background: transparent; color: var(--danger);
  border: 1px solid rgba(240,97,109,.35); box-shadow: none;
}
.btn.danger-ghost:hover { background: rgba(240,97,109,.08); border-color: var(--danger); }
.btn.sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn.lg { padding: 15px 30px; font-size: 16px; border-radius: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- hero ---------- */
.hero {
  position: relative; max-width: 1040px; margin: 0 auto;
  padding: 88px 24px 48px; text-align: center;
}
.hero::before {
  content: ""; position: absolute; inset: -140px 0 0; z-index: -1;
  background:
    radial-gradient(560px 340px at 50% 0%, rgba(59,130,246,.16), transparent 70%),
    radial-gradient(420px 300px at 82% 12%, rgba(139,92,246,.10), transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: 0 0 -48px; z-index: -1;
  background-image:
    linear-gradient(rgba(147,163,189,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(147,163,189,.05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(620px 420px at 50% 10%, #000 25%, transparent 75%);
  mask-image: radial-gradient(620px 420px at 50% 10%, #000 25%, transparent 75%);
  pointer-events: none;
}
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .04em;
  color: #9fc0ff; background: rgba(59,130,246,.10);
  border: 1px solid rgba(59,130,246,.30); border-radius: 999px;
  padding: 7px 14px; margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(34px, 5.4vw, 56px); line-height: 1.1;
  font-weight: 800; letter-spacing: -.025em; margin-bottom: 18px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(92deg, #5aa2ff 10%, #8b5cf6 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.sub {
  color: var(--muted); font-size: 17.5px; line-height: 1.65;
  max-width: 660px; margin: 0 auto 30px;
}
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta-note {
  display: flex; gap: 18px; justify-content: center; flex-wrap: wrap;
  color: var(--muted); font-size: 13px; margin-top: 16px;
}
.cta-note span { display: inline-flex; align-items: center; gap: 6px; }
.cta-note svg { width: 14px; height: 14px; stroke: var(--green); }

/* ---------- stats (social proof) ---------- */
.stats {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 10px; margin: 40px auto 0; max-width: 780px;
}
.stats > div {
  flex: 1 1 200px; background: rgba(255,255,255,.02);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; text-align: center;
  color: var(--muted); font-size: 13px;
}
.stats b {
  color: var(--text); font-size: 26px; font-weight: 800;
  letter-spacing: -.02em; display: block; margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

/* ---------- trust bar ---------- */
.trustbar {
  max-width: 1040px; margin: 44px auto 0; padding: 0 24px;
  text-align: center;
}
.trustbar .lbl {
  font-size: 11px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 16px;
}
.trustbar .logos {
  display: flex; justify-content: center; align-items: center;
  gap: 28px; flex-wrap: wrap;
  color: #7f90ab; font-weight: 700; font-size: 15px; letter-spacing: .01em;
}
.trustbar .logos span { opacity: .8; transition: opacity .2s, color .2s; }
.trustbar .logos span:hover { opacity: 1; color: #b9c7dd; }

/* ---------- section headings ---------- */
.section { max-width: 1040px; margin: 72px auto 0; padding: 0 24px; }
.section-head { text-align: center; margin-bottom: 30px; }
.section-head h2 {
  font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; letter-spacing: -.02em;
}
.section-head p { color: var(--muted); font-size: 15.5px; max-width: 560px; margin: 10px auto 0; }

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step {
  position: relative; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 22px; box-shadow: var(--shadow-card);
  transition: transform .2s ease, border-color .2s ease;
}
.step:hover { transform: translateY(-3px); border-color: var(--border2); }
.step .num {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.35);
  color: #7fb0ff; font-weight: 800; font-size: 15px; margin-bottom: 14px;
}
.step h3 { font-size: 16.5px; font-weight: 700; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 14px; line-height: 1.6; }

/* ---------- trust cards ---------- */
.trustgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tcard {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-card);
  transition: transform .2s ease, border-color .2s ease;
}
.tcard:hover { transform: translateY(-3px); border-color: var(--border2); }
.tcard .ic {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; margin-bottom: 14px;
  background: rgba(22,199,132,.10); border: 1px solid rgba(22,199,132,.30);
}
.tcard .ic svg { width: 19px; height: 19px; stroke: var(--green); }
.tcard h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.tcard p { color: var(--muted); font-size: 13.5px; line-height: 1.6; }

/* ---------- proof strip (live payouts) ---------- */
.proof { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.proof .feed, .proof .solvency {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-card);
}
.proof h3 {
  font-size: 14px; font-weight: 700; margin-bottom: 14px;
  display: flex; align-items: center; gap: 9px;
}
.proof h3 .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 3px rgba(22,199,132,.15);
  animation: pulse 2.2s ease-in-out infinite;
}
.feed ul { list-style: none; }
.feed li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--border);
  font-size: 13.5px; color: var(--muted);
}
.feed li:last-child { border-bottom: 0; }
.feed li b { color: var(--text); font-family: var(--mono); font-size: 12.5px; }
.feed li .amt { color: var(--green); font-weight: 600; white-space: nowrap; }
.note { color: var(--muted); font-size: 12.5px; line-height: 1.65; }
/* Строка «экран открыт без кошелька» — заметная, но не кричащая. */
.note.warnline { color: var(--amber); }
.note.warnline a { color: var(--amber); text-decoration: underline; }
.solvency p { font-size: 13.5px; color: var(--muted); line-height: 1.7; }
.solvency b { color: var(--text); }

/* ---------- FAQ ---------- */
.faq { max-width: 780px; margin: 0 auto; padding: 0 24px; }
.faq details {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 20px; margin-bottom: 10px;
  transition: border-color .2s ease;
}
.faq details[open] { border-color: var(--border2); }
.faq summary {
  font-weight: 600; font-size: 15px; cursor: pointer;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; width: 9px; height: 9px; flex: none;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px); transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.faq p { color: var(--muted); font-size: 14px; margin-top: 10px; line-height: 1.65; }

/* ---------- final CTA ---------- */
.cta-band {
  max-width: 1040px; margin: 80px auto 0; padding: 0 24px;
}
.cta-band .inner {
  position: relative; overflow: hidden; text-align: center;
  background: linear-gradient(180deg, #12233f, #0d1830);
  border: 1px solid var(--border2); border-radius: 20px;
  padding: 56px 28px; box-shadow: var(--shadow-card);
}
.cta-band .inner::before {
  content: ""; position: absolute; inset: -60% -20% auto;
  background: radial-gradient(420px 240px at 50% 0%, rgba(59,130,246,.22), transparent 70%);
  pointer-events: none;
}
.cta-band h2 { font-size: clamp(22px, 3.2vw, 32px); font-weight: 800; letter-spacing: -.02em; }
.cta-band p { color: var(--muted); margin: 12px auto 26px; max-width: 480px; }

/* ---------- footer ---------- */
footer {
  margin-top: 80px; border-top: 1px solid var(--border);
  background: var(--bg2); padding: 40px 24px 30px;
}
.foot-inner { max-width: 1040px; margin: 0 auto; }
.foot-cols { display: flex; gap: 40px; flex-wrap: wrap; justify-content: space-between; }
.foot-brand { max-width: 320px; }
.foot-brand .logo { margin-bottom: 10px; }
.foot-brand p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.foot-links { display: flex; gap: 48px; flex-wrap: wrap; }
.foot-links h5 {
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 12px;
}
.foot-links a { display: block; color: #b6c4da; font-size: 13.5px; margin-bottom: 8px; }
.foot-links a:hover { color: var(--text); text-decoration: none; }
.risk {
  margin-top: 30px; padding: 14px 16px;
  background: rgba(245,176,76,.06); border: 1px solid rgba(245,176,76,.22);
  border-radius: 10px; color: #b7a98e; font-size: 12px; line-height: 1.65;
}
.foot-legal {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-top: 18px; color: var(--muted); font-size: 12px;
}

/* ---------- fake IDE (app) ---------- */
.ide { display: grid; grid-template-columns: 300px 1fr 340px; height: calc(100vh - 53px); }
.col { border-right: 1px solid var(--border); overflow-y: auto; }
.col.filetree { background: var(--bg2); padding: 12px; }
.filetree .fname {
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  padding: 7px 9px; border-radius: 8px; cursor: pointer; user-select: none;
}
.filetree .fname:hover { color: var(--text); background: var(--panel); }
.filetree .fname:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.filetree .fname.active { color: var(--text); background: var(--panel); }
.col.editor { display: flex; flex-direction: column; background: var(--bg); }
.editor-head {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-bottom: 1px solid var(--border); background: var(--bg2);
}
.editor-head .pill {
  font-size: 11.5px; color: var(--green);
  border: 1px solid rgba(22,199,132,.35); background: rgba(22,199,132,.08);
  border-radius: 999px; padding: 4px 10px; white-space: nowrap;
}
.codetitle { font-family: var(--mono); font-size: 13px; }
/* Просмотр «файлов» проекта. Это не textarea, а <pre><code>: в textarea
   раскраску токенов не сделать. */
.code {
  flex: 1; min-height: 0; margin: 0; overflow: auto; background: #0a0f1c;
  padding: 16px; tab-size: 4; outline: none;
}
.code code {
  display: block; white-space: pre; color: #d7e1ef;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.65;
}
/* Токены подсветки. Цвета приглушённые: кода много, он не должен рябить. */
.t-cmt { color: #5f6d86; font-style: italic; }
.t-str { color: #86d9a8; }
.t-num { color: #e3b268; }
.t-kw  { color: #7aa2f7; }
.t-typ { color: #4fc3d4; }
.t-fn  { color: #cfdcf1; }
.t-key { color: #d38ce8; }
.t-h   { color: #7aa2f7; font-weight: 700; }
.col.side { background: var(--bg2); padding: 14px; }
.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
}
.panel h4 {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); margin-bottom: 10px;
}
.console {
  font-family: var(--mono); font-size: 12px; line-height: 1.7; color: var(--muted);
  min-height: 160px; max-height: 240px; overflow-y: auto;
  background: #0a0f1c; border-top: 1px solid var(--border); padding: 12px 16px;
}
.console .ok { color: var(--green); }
.console .warn { color: var(--amber); }
.console .tx { color: #7fb3ff; word-break: break-all; }

/* ---------- dashboard ---------- */
.dash { display: none; max-width: 1040px; margin: 0 auto; padding: 30px 24px; }
.dash .cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
/* «Top up» и «Withdraw» рядом: одинаковая ширина и высота. Кнопки прижаты к
   нижней границе панели (margin-top:auto), поэтому стоят на одной линии, даже
   когда текста в панелях разное количество. Поля — через .field, как в
   редакторе: подпись сверху, одинаковая высота поля и кнопки. */
.dash .panels2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.dash .panels2 .panel { display: flex; flex-direction: column; margin-bottom: 0; }
.dash .panels2 .field { margin: 12px 0 0; }
.dash .panels2 .field input { padding: 11px 13px; font-size: 14px; }
.dash #depositAddr { letter-spacing: .02em; }
.dash .row.actions { margin-top: auto; padding-top: 14px; }
.dash .row.actions .btn { height: 44px; padding: 0 20px; white-space: nowrap; }
.dash .toggle.prio { margin-top: 12px; align-items: flex-start; line-height: 1.5; }
.dash .toggle.prio input { margin-top: 2px; flex: 0 0 auto; }
.dash .ops-list li { padding: 9px 0; }
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-card);
}
.card .label {
  color: var(--muted); font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px;
}
.card .value { font-size: 27px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.card .value.green { color: var(--green); }
/* Плитка Status в боёвом режиме: без денег на агенте он не Active. */
.card .value.amber { color: var(--amber); }
.card .small { color: var(--muted); font-size: 12px; margin-top: 6px; }
/* Живой баланс: сумма в ленте активности и число на плитке меняются
   одновременно, подсветка короткая — глаз успевает за переводом и не
   мигает всю съёмку. tabular-nums выше не даёт числу «прыгать» по ширине. */
.card .value.flash-up { animation: valUp 1.5s ease-out; }
.card .value.flash-down { animation: valDown 1.5s ease-out; }
@keyframes valUp {
  0%, 55% { color: var(--green); text-shadow: 0 0 26px rgba(22, 199, 132, .5); }
  100% { text-shadow: none; }
}
@keyframes valDown {
  0%, 55% { color: var(--danger); text-shadow: 0 0 26px rgba(240, 97, 109, .45); }
  100% { text-shadow: none; }
}
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
/* input без атрибута type не попадает под селектор input[type=text], поэтому
   поля без type оставались совсем без оформления — в HTML type прописан. */
input[type=number], input[type=text], input[type=email], input[type=password] {
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 11px 13px; font-size: 14px; box-sizing: border-box;
}
input[type=number] { width: 170px; }
.row input { flex: 1 1 150px; min-width: 130px; }
/* Поля настроек агента в левой колонке. Раньше они были завёрнуты в
   .editor-head — это класс верхней панели редактора (свой фон и нижняя
   рамка), поэтому выглядели они чужеродно. */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.field input {
  width: 100%; font-family: var(--mono); font-size: 13px;
  border-radius: 8px; padding: 9px 11px;
}
input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
input::placeholder { color: #66748c; }
.toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; cursor: pointer; }
.toggle input { accent-color: var(--blue); width: 15px; height: 15px; }
.ops-list { list-style: none; }
.ops-list li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--muted);
}
.ops-list li:last-child { border-bottom: 0; }
.ops-list li b { color: var(--text); font-weight: 600; font-family: var(--mono); font-size: 12px; }
.addr { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(4, 7, 13, .72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  /* JS включает окно как display:flex, поэтому центрирование — через
     align-items/justify-content: place-items работает только в grid и
     оставлял окошко прилепленным к левому краю. */
  display: none; align-items: center; justify-content: center;
  padding: 24px; box-sizing: border-box; overflow-y: auto; z-index: 100;
}
.modal .box {
  background: var(--panel2); border: 1px solid var(--border2);
  border-radius: 18px; padding: 30px; max-width: 440px; width: calc(100% - 40px);
  text-align: center; box-shadow: 0 40px 90px -30px rgba(0,0,0,.9);
  max-height: calc(100vh - 48px); overflow-y: auto;
}
/* Крестик в углу окна. Пустой класс .closable на .modal включает и крестик,
   и закрытие по клику на тёмный фон, и Esc — JS решает, когда окно закрыемо. */
.modal .box { position: relative; }
.modal-x {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; border: 1px solid transparent; background: transparent;
  color: var(--muted); font-size: 15px; line-height: 1;
  text-decoration: none !important; cursor: pointer;
}
.modal-x:hover { color: var(--text); background: rgba(255,255,255,.05); border-color: var(--border2); }
.modal:not(.closable) .modal-x { display: none; }
/* Кликабельная ссылка внутри текста окна (например «Connect the wallet»). */
.modal p a { text-decoration: underline; font-weight: 600; }
/* Длинный текст ошибки (хэш, адрес контракта) не должен растягивать окно. */
.modal p, .modal p code { overflow-wrap: anywhere; word-break: break-word; }
.modal h3 { margin-bottom: 10px; font-size: 19px; letter-spacing: -.01em; }
.modal p { color: var(--muted); font-size: 14px; margin-bottom: 14px; line-height: 1.6; }
.modal p a { color: var(--blue); }
.progress {
  height: 7px; background: var(--border); border-radius: 4px;
  overflow: hidden; margin: 16px 0;
}
.progress i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  border-radius: 4px; transition: width .8s linear;
}

/* ---------- misc ---------- */
.solvency-band {
  max-width: 1040px; margin: 26px auto; padding: 0 24px;
}
.solvency-band .solvency { box-shadow: var(--shadow-card); }

@media (max-width: 980px) {
  .ide { grid-template-columns: 1fr; height: auto; }
  .col { border-right: 0; border-bottom: 1px solid var(--border); }
  .code { min-height: 340px; }
  .steps, .dash .cards, .trustgrid { grid-template-columns: 1fr 1fr; }
  .proof { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  /* в шапке на узком экране и так тесно — уводим переключатель на вторую строку */
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar .spacer { display: none; }
  .viewtabs { order: 5; width: 100%; }
  .topbar .vtab { flex: 1; text-align: center; max-width: none; }
  /* две панели рядом на планшете уже не помещаются аккуратно */
  .dash .panels2 { grid-template-columns: 1fr; }
  .dash .row.actions .btn { flex: 1 1 auto; }
}
@media (max-width: 640px) {
  .steps, .dash .cards, .trustgrid { grid-template-columns: 1fr; }
  .hero { padding-top: 56px; }
  .stats > div { flex-basis: 100%; }
  .btn.lg { width: 100%; }
  .cta-row { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
