/* coindealz Mini App. One stylesheet, no build step. Dark first, light follows Telegram. */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --violet: #7c5cff;
  --blue: #4f7dff;
  --mint: #1fd6a4;
  --brand: linear-gradient(135deg, var(--violet) 0%, var(--blue) 55%, var(--mint) 100%);

  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 12px;

  --safe-top: max(var(--tg-content-safe-area-inset-top, 0px), env(safe-area-inset-top, 0px));
  --safe-bottom: max(var(--tg-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0b0d14;
  --surface: #141824;
  --surface-2: #1b2030;
  --surface-3: #232a3d;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.12);
  --text: #f3f5fa;
  --text-2: #a4abbe;
  --text-3: #6d748a;
  --accent: #9d86ff;
  --accent-soft: rgba(124, 92, 255, 0.16);
  --ok: #2ee6a8;
  --ok-soft: rgba(46, 230, 168, 0.14);
  --info: #6c9bff;
  --info-soft: rgba(79, 125, 255, 0.16);
  --warn: #ffb547;
  --warn-soft: rgba(255, 181, 71, 0.14);
  --bad: #ff6b6f;
  --bad-soft: rgba(255, 107, 111, 0.14);
  --muted-soft: rgba(164, 171, 190, 0.12);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --glow: 0 12px 40px rgba(124, 92, 255, 0.35);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f3f4f8;
  --surface: #ffffff;
  --surface-2: #f4f5fa;
  --surface-3: #e9ebf3;
  --line: rgba(14, 18, 32, 0.07);
  --line-strong: rgba(14, 18, 32, 0.12);
  --text: #0e1220;
  --text-2: #586074;
  --text-3: #8a91a5;
  --accent: #5b3fe6;
  --accent-soft: rgba(124, 92, 255, 0.12);
  --ok: #0f9f74;
  --ok-soft: rgba(15, 159, 116, 0.12);
  --info: #2f62e0;
  --info-soft: rgba(47, 98, 224, 0.1);
  --warn: #b86e00;
  --warn-soft: rgba(255, 170, 40, 0.16);
  --bad: #d63a3f;
  --bad-soft: rgba(214, 58, 63, 0.1);
  --muted-soft: rgba(88, 96, 116, 0.1);
  --shadow: 0 8px 24px rgba(20, 24, 40, 0.08);
  --glow: 0 12px 32px rgba(91, 63, 230, 0.25);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: var(--tg-viewport-stable-height, 100dvh);
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Components set display: flex or grid, which would otherwise beat the hidden attribute. */
[hidden] {
  display: none !important;
}

.num {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: -0.01em;
  word-break: break-all;
}

/* ------------------------------------------------------------------ layout */

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 12px) 16px calc(var(--safe-bottom) + 112px);
}

.view {
  animation: view-in 0.36s var(--ease) both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.boot {
  display: grid;
  place-items: center;
  min-height: 70vh;
}

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.spinner.sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.stack > * + * {
  margin-top: 12px;
}

.section {
  margin-top: 26px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 4px 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ------------------------------------------------------------------ top bar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--brand);
  box-shadow: var(--glow);
  color: #fff;
}

.brand-mark svg {
  width: 18px;
  height: 18px;
}

.brand small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
  font-weight: 700;
  font-size: 14px;
  border: 1px solid var(--line);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--muted-soft);
  color: var(--text-2);
  white-space: nowrap;
}

.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.tone-accent {
  background: var(--accent-soft);
  color: var(--accent);
}
.tone-info {
  background: var(--info-soft);
  color: var(--info);
}
.tone-ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.tone-warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.tone-bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.tone-muted {
  background: var(--muted-soft);
  color: var(--text-2);
}

.pulse .dot {
  animation: pulse 1.6s ease-out infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 currentColor;
  }
  70% {
    box-shadow: 0 0 0 7px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative;
  overflow: hidden;
  padding: 22px 20px 20px;
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(124, 92, 255, 0.95) 0%, transparent 55%),
    radial-gradient(90% 120% at 100% 100%, rgba(31, 214, 164, 0.9) 0%, transparent 55%),
    linear-gradient(135deg, #3a2bb5 0%, #2553d6 60%, #138f8a 100%);
  box-shadow: var(--glow);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  pointer-events: none;
}

.hero::before {
  width: 260px;
  height: 260px;
  right: -90px;
  top: -120px;
}

.hero::after {
  width: 180px;
  height: 180px;
  right: -40px;
  top: -70px;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  backdrop-filter: blur(6px);
}

.hero h1 {
  margin: 16px 0 4px;
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.hero-foot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}

.hero-meta {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.78);
}

.hero-meta strong {
  display: block;
  font-size: 15px;
  color: #fff;
}

.hero .btn-light {
  flex: none;
}

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  font-weight: 650;
  font-size: 15.5px;
  text-decoration: none;
  transition:
    transform 0.12s var(--ease),
    opacity 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  width: 100%;
  color: #fff;
  background: var(--brand);
  box-shadow: var(--glow);
}

.btn-light {
  min-height: 44px;
  padding: 0 18px;
  color: #1c1f4a;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.btn-soft {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
}

.btn-ghost {
  min-height: 40px;
  padding: 0 12px;
  background: transparent;
  color: var(--accent);
}

.btn-row {
  display: flex;
  gap: 10px;
}

.btn-row > * {
  flex: 1;
}

.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 12px 16px calc(var(--safe-bottom) + 14px);
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}

.bottom-bar .btn {
  display: flex;
  max-width: 488px;
  margin: 0 auto;
}

/* ------------------------------------------------------------------ cards & rows */

.card {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.card.flush {
  padding: 6px;
}

.card h2 {
  margin: 0 0 4px;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.card > p {
  margin: 0;
  color: var(--text-2);
}

.list {
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
  color: inherit;
  text-decoration: none;
}

button.row:active,
a.row:active {
  background: var(--surface-2);
}

.row + .row {
  position: relative;
}

.row + .row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 62px;
  right: 10px;
  height: 1px;
  background: var(--line);
}

.row-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text-2);
}

.row-icon svg {
  width: 20px;
  height: 20px;
}

.row-body {
  flex: 1;
  min-width: 0;
}

.row-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-sub {
  margin-top: 1px;
  font-size: 13px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-end {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  font-size: 13px;
}

.row-end svg {
  width: 18px;
  height: 18px;
}

.row-value {
  text-align: right;
  font-weight: 600;
  color: var(--text);
}

.check-done {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
}

.check-done svg {
  width: 14px;
  height: 14px;
}

.step-num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 28px 16px;
  text-align: center;
  color: var(--text-2);
}

.empty svg {
  width: 36px;
  height: 36px;
  color: var(--text-3);
}

.note {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13.5px;
}

.note svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--text-3);
}

.note.tone-warn,
.note.tone-bad,
.note.tone-info,
.note.tone-ok {
  color: var(--text);
}

.note.tone-warn svg {
  color: var(--warn);
}
.note.tone-bad svg {
  color: var(--bad);
}
.note.tone-info svg {
  color: var(--info);
}
.note.tone-ok svg {
  color: var(--ok);
}

.foot {
  margin: 28px 8px 0;
  font-size: 12.5px;
  color: var(--text-3);
  text-align: center;
}

/* ------------------------------------------------------------------ headings */

.page-head {
  margin: 4px 4px 20px;
}

.page-head h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.page-head p {
  margin: 6px 0 0;
  color: var(--text-2);
}

/* ------------------------------------------------------------------ forms */

.field {
  display: block;
}

.field-label {
  display: block;
  margin: 0 4px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.textarea {
  display: block;
  width: 100%;
  min-height: 96px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 1.5;
  resize: none;
  word-break: break-all;
  transition: border-color 0.2s;
}

.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.textarea.invalid {
  border-color: var(--bad);
  box-shadow: 0 0 0 4px var(--bad-soft);
}

.field-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.chip svg {
  width: 16px;
  height: 16px;
  color: var(--text-2);
}

.chip:active {
  transform: scale(0.97);
}

.chip.selected {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
}

.error-text {
  display: flex;
  gap: 6px;
  margin: 10px 4px 0;
  font-size: 13.5px;
  color: var(--bad);
}

.error-text svg {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

/* ------------------------------------------------------------------ amount entry */

.amount-entry {
  padding: 26px 16px 20px;
  text-align: center;
}

.amount-entry label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.amount-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.amount-input {
  width: 1.3ch;
  min-width: 1.3ch;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: 54px;
  font-weight: 750;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  caret-color: var(--accent);
}

.amount-input:focus {
  outline: none;
}

.amount-input::placeholder {
  color: var(--text-3);
}

.amount-unit {
  flex: none;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-3);
}

.amount-limits {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-3);
}

.amount-limits.bad {
  color: var(--bad);
}

.quick {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.convert {
  position: relative;
}

.convert-arrow {
  position: absolute;
  left: 50%;
  top: -22px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: -18px;
  border-radius: 12px;
  background: var(--surface-3);
  border: 4px solid var(--bg);
  color: var(--text-2);
}

.convert-arrow svg {
  width: 16px;
  height: 16px;
}

.receive {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 4px 12px;
}

.receive-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.receive-value {
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: var(--brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ------------------------------------------------------------------ key-value details */

.kv {
  display: flex;
  flex-direction: column;
}

.kv-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 4px;
  font-size: 14.5px;
}

.kv-row + .kv-row {
  border-top: 1px solid var(--line);
}

.kv-key {
  flex: none;
  color: var(--text-2);
}

.kv-val {
  min-width: 0;
  text-align: right;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.kv-val.mono {
  font-weight: 500;
}

.kv-val .ok {
  color: var(--ok);
}

/* ------------------------------------------------------------------ review */

.review-amounts {
  padding: 22px 18px;
  text-align: center;
}

.review-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.review-big {
  margin-top: 4px;
  font-size: 40px;
  font-weight: 780;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.review-divider {
  display: grid;
  place-items: center;
  margin: 14px auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
}

.review-divider svg {
  width: 18px;
  height: 18px;
}

/* ------------------------------------------------------------------ payment screen */

.pay-head {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 8px 0 4px;
  text-align: center;
}

.pay-head h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.015em;
}

.pay-head p {
  margin: -6px 0 0;
  color: var(--text-2);
  max-width: 340px;
}

.ring {
  position: relative;
  width: 196px;
  height: 196px;
  margin: 6px auto 2px;
}

.ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: var(--surface-3);
  stroke-width: 10;
}

.ring-bar {
  fill: none;
  stroke: url(#ring-gradient);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s linear;
}

.ring.warn .ring-bar {
  stroke: var(--warn);
}

.ring.ok .ring-bar {
  stroke: var(--ok);
}

.ring-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.ring-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
}

.ring-value {
  margin-top: 2px;
  font-size: 34px;
  font-weight: 760;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.ring-sub {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--text-2);
}

.ring.spin svg {
  animation: spin 1.6s linear infinite;
}

.send-exact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.send-exact-amount {
  font-size: 30px;
  font-weight: 780;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.send-exact-amount small {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-3);
}

.copy-field {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.copy-field + .copy-field {
  margin-top: 10px;
}

.copy-field-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.copy-field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}

.copy-field-hint {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-3);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
  flex: none;
}

.copy-btn svg {
  width: 15px;
  height: 15px;
}

.copy-btn.done {
  background: var(--ok-soft);
  color: var(--ok);
}

details.more {
  margin-top: 10px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

details.more summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  list-style: none;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}

details.more summary::-webkit-details-marker {
  display: none;
}

details.more summary svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

details.more[open] summary svg {
  transform: rotate(90deg);
}

details.more .copy-field {
  padding-top: 0;
  background: transparent;
}

/* ------------------------------------------------------------------ stepper */

.steps {
  position: relative;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.step {
  position: relative;
  display: flex;
  gap: 14px;
  padding-bottom: 18px;
}

.step:last-child {
  padding-bottom: 2px;
}

.step::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 30px;
  bottom: 2px;
  width: 2px;
  border-radius: 2px;
  background: var(--line-strong);
}

.step:last-child::before {
  display: none;
}

.step.done::before {
  background: var(--ok);
  opacity: 0.55;
}

.step-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--line-strong);
  color: var(--text-3);
}

.step-dot svg {
  width: 14px;
  height: 14px;
}

.step.done .step-dot {
  border-color: transparent;
  background: var(--ok);
  color: #06291e;
}

.step.active .step-dot {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.step.active .step-dot::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: ripple 1.8s ease-out infinite;
}

@keyframes ripple {
  0% {
    transform: scale(0.7);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.25);
    opacity: 0;
  }
}

.step.hold .step-dot {
  border-color: var(--warn);
  background: var(--warn-soft);
  color: var(--warn);
}

.step-body {
  padding-top: 3px;
  min-width: 0;
}

.step-title {
  font-weight: 600;
}

.step:not(.done):not(.active):not(.hold) .step-title {
  color: var(--text-3);
}

.step-sub {
  margin-top: 1px;
  font-size: 13px;
  color: var(--text-2);
}

.progress {
  height: 6px;
  margin-top: 8px;
  border-radius: 6px;
  background: var(--surface-3);
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 0.6s var(--ease);
}

/* ------------------------------------------------------------------ result screens */

.result {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 18px 8px 8px;
  text-align: center;
}

.result h1 {
  margin: 8px 0 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.result p {
  margin: 0;
  max-width: 340px;
  color: var(--text-2);
}

.result-amount {
  font-size: 40px;
  font-weight: 780;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.badge-icon {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
}

.badge-icon svg {
  width: 38px;
  height: 38px;
}

.success-mark {
  position: relative;
  width: 104px;
  height: 104px;
}

.success-mark::before {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(46, 230, 168, 0.35), transparent);
  animation: glow 2.4s ease-in-out infinite;
}

@keyframes glow {
  50% {
    transform: scale(1.12);
    opacity: 0.6;
  }
}

.success-mark svg {
  position: relative;
  width: 100%;
  height: 100%;
}

.success-mark circle {
  fill: var(--ok);
  transform-origin: center;
  animation: pop 0.5s var(--ease) both;
}

.success-mark path {
  fill: none;
  stroke: #06291e;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: draw 0.45s 0.35s var(--ease) forwards;
}

@keyframes pop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ------------------------------------------------------------------ gate & misc */

.gate {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 12vh 12px 0;
  text-align: center;
}

.gate .brand-mark {
  width: 76px;
  height: 76px;
  border-radius: 24px;
}

.gate .brand-mark svg {
  width: 40px;
  height: 40px;
}

.gate h1 {
  margin: 10px 0 0;
  font-size: 30px;
  letter-spacing: -0.025em;
}

.gate p {
  margin: 0;
  max-width: 330px;
  color: var(--text-2);
}

.gate .btn-row {
  flex-direction: column;
  width: 100%;
  max-width: 340px;
  margin-top: 14px;
}

.demo-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: -4px 0 14px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12.5px;
  font-weight: 600;
}

.demo-banner a {
  color: inherit;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 92px);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border-radius: 14px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  animation: toast-in 0.25s var(--ease) both;
}

.toast svg {
  width: 16px;
  height: 16px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}

.skeleton {
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    var(--surface-2) 0%,
    var(--surface-3) 40%,
    var(--surface-2) 80%
  );
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.skeleton.line {
  height: 14px;
  margin: 8px 0;
}

.skeleton.block {
  height: 150px;
  border-radius: var(--radius-lg);
}

.conn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-3);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}


/* ------------------------------------------------------------------ late overrides */

.page-head .icon-btn {
  margin-bottom: 14px;
}

.demo-banner svg {
  width: 16px;
  height: 16px;
}

.send-exact + .copy-field {
  margin-top: 14px;
}

.hero-label svg {
  width: 14px;
  height: 14px;
}

.conn svg {
  width: 14px;
  height: 14px;
}

.gate .foot {
  margin-top: 18px;
  max-width: 320px;
}

.empty strong {
  color: var(--text);
}

.review-big .skeleton {
  vertical-align: middle;
}

/* Tones last, so they win over the neutral surfaces declared above. */
.row-icon.tone-accent,
.badge-icon.tone-accent {
  background: var(--accent-soft);
  color: var(--accent);
}
.row-icon.tone-info,
.badge-icon.tone-info {
  background: var(--info-soft);
  color: var(--info);
}
.row-icon.tone-ok,
.badge-icon.tone-ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.row-icon.tone-warn,
.badge-icon.tone-warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.row-icon.tone-bad,
.badge-icon.tone-bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.row-icon.tone-muted,
.badge-icon.tone-muted {
  background: var(--muted-soft);
  color: var(--text-2);
}
