@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&display=swap');

:root {
  --ink: #0a0b0d;
  --card: #14161a;
  --line: #262a31;
  --white: #f5f7fa;
  --grey: #8a8f98;
  --lime: #c6ff00;
  --pink: #ff2d6f;
  --r-card: 22px;
  --r-icon: 13px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--white);
  font-family: Manrope, -apple-system, system-ui, sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.5;
  padding: 0 16px 96px;
  max-width: 720px;
  margin: 0 auto;
}

a { color: var(--lime); text-decoration: none; }

/* ---------- шапка ---------- */

header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 0 14px;
  position: sticky;
  top: 0;
  background: linear-gradient(to bottom, var(--ink) 75%, transparent);
  z-index: 5;
}

.mark {
  width: 34px; height: 34px;
  border-radius: var(--r-icon);
  background: var(--lime);
  color: #000;
  display: grid; place-items: center;
  font-weight: 800; font-size: 18px;
}

.brand { font-weight: 800; letter-spacing: -0.02em; font-size: 16px; }
.brand span { display: block; font-size: 10px; font-weight: 600; letter-spacing: 0.16em; color: var(--grey); text-transform: uppercase; }

.wallet-chip {
  margin-left: auto;
  font-size: 12px; font-weight: 600;
  color: var(--grey);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--card);
}
.wallet-chip.on { color: var(--white); }

/* ---------- типографика ---------- */

h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin: 6px 0 4px; }
h2 { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; margin: 26px 0 12px; }
.lead { color: var(--grey); margin: 0 0 18px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--grey); margin: 22px 0 10px; }

/* ---------- капсулы выбора сети ---------- */

.pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }

.pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--grey);
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit; font-weight: 700; font-size: 13px;
  cursor: pointer;
}
.pill[aria-selected='true'] { color: var(--white); border-color: var(--white); }

/* ---------- карточки ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 16px;
  margin-bottom: 10px;
}

.card-row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.card-title { font-weight: 800; letter-spacing: -0.01em; }
.card-desc { color: var(--grey); font-size: 13px; margin-top: 2px; }
.card-icon {
  width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: var(--r-icon);
  background: rgba(245, 247, 250, 0.06);
  display: grid; place-items: center;
  font-size: 18px;
}
.chev { margin-left: auto; color: var(--grey); font-size: 20px; }

/* ---------- формы ---------- */

label { display: block; font-size: 12px; font-weight: 600; color: var(--grey); margin: 14px 0 6px; }

input[type='text'], input[type='number'], textarea, select {
  width: 100%;
  background: #0f1114;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--white);
  font: inherit;
  padding: 13px 14px;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--grey); }

.switch { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.switch input { width: 18px; height: 18px; accent-color: var(--lime); }
.switch span { font-size: 14px; color: var(--white); }

.hint { font-size: 12px; color: var(--grey); margin-top: 6px; }

/* ---------- кнопки ---------- */

button.btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 15px 20px;
  font: inherit; font-weight: 800; font-size: 15px;
  cursor: pointer;
  margin-top: 18px;
}
.btn-primary { background: var(--lime); color: #000; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--white); border: 1px solid var(--line) !important; }

.back {
  background: none; border: none; color: var(--grey);
  font: inherit; font-weight: 600; font-size: 13px;
  padding: 10px 0; cursor: pointer;
}

/* ---------- статусы ---------- */

.alert { border-radius: 14px; padding: 12px 14px; font-size: 13px; margin-top: 14px; }
.alert-err { background: rgba(255, 45, 111, 0.12); border: 1px solid rgba(255, 45, 111, 0.4); color: #ffb3cb; }
.alert-info { background: rgba(245, 247, 250, 0.05); border: 1px solid var(--line); color: var(--grey); }

.result-addr {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  word-break: break-all;
  background: #0f1114;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  margin-top: 10px;
}

.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: #000;
  border-radius: 50%;
  display: inline-block;
  vertical-align: -2px;
  margin-right: 8px;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* ---------- таб-бар ---------- */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center; gap: 8px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(10, 11, 13, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  z-index: 10;
}
.tabbar button {
  flex: 1; max-width: 200px;
  background: none; border: none;
  color: var(--grey);
  font: inherit; font-weight: 700; font-size: 13px;
  padding: 8px; cursor: pointer;
}
.tabbar button[aria-selected='true'] { color: var(--lime); }

/* ---------- история ---------- */

.hist-item { display: flex; align-items: center; gap: 12px; }
.hist-meta { font-size: 12px; color: var(--grey); margin-top: 2px; }
.tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; color: var(--grey);
}

/* ---------- окно выбора кошелька ---------- */

.head-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.quota-chip {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--lime);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--card);
  white-space: nowrap;
}
.quota-chip.out { color: var(--pink); }

.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.66); backdrop-filter: blur(4px); }

.sheet-body {
  position: relative;
  width: 100%; max-width: 720px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card) var(--r-card) 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  animation: sheet-up 0.18s ease-out;
}
@keyframes sheet-up { from { transform: translateY(14px); opacity: 0; } }

.sheet-title { font-weight: 800; font-size: 17px; letter-spacing: -0.02em; margin-bottom: 12px; }

.wallet-opt {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  background: #0f1114;
  border: 1px solid var(--line);
  border-radius: var(--r-icon);
  color: var(--white);
  font: inherit;
  padding: 13px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  text-align: left;
}
.wallet-opt:disabled { opacity: 0.45; cursor: not-allowed; }
.wallet-opt .card-icon { width: 34px; height: 34px; flex: 0 0 34px; font-size: 15px; }
.wallet-opt b { display: block; font-weight: 800; letter-spacing: -0.01em; }
