/* ---------- Fonts ---------- */
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens (dark, 60-30-10) ----------
   60% dominant: near-black backgrounds with subtle red wash
   30% secondary: white / off-white text & surfaces
   10% accent:   crimson red                                  */
:root {
  --bg: #141012;             /* 60% dominant: warm near-black */
  --bg-tint: #141012;
  --bg-elev: #1d1719;        /* lifted surface */
  --bg-elev-2: #261f22;
  --line: #2a2226;
  --line-soft: #1f1a1c;
  --ink: #ffffff;            /* 30% secondary: white */
  --ink-dim: #d6cfd1;
  --ink-mute: #8e8588;
  --accent: #ea1c4a;         /* 10% accent: crimson */
  --accent-ink: #ffffff;
  --accent-soft: rgba(234, 28, 74, 0.14);
  --accent-deep: #c01540;
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  overflow-x: hidden;
}
html {
  font-size: clamp(14px, 0.85vw + 11px, 17px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 400;
  background: var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
  letter-spacing: -0.005em;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
button { -webkit-appearance: none; appearance: none; }

/* Accessible focus rings — visible only for keyboard users */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.leg-row input:focus-visible,
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.modal-search input:focus-visible {
  outline: none;
  background: var(--bg-elev-2);
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; margin: 0; }
p { margin: 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 28px); }

/* ---------- Typography utility ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-dim); font-weight: 600;
}
.eyebrow.muted { color: var(--ink-mute); }
.ink { color: var(--ink); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px;
  font-weight: 600; font-size: 14px; letter-spacing: -0.005em;
  border: 0; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.08s ease;
  white-space: nowrap;
  user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-ghost { background: var(--bg-elev); color: var(--ink); }
.btn-ghost:hover { background: var(--bg-elev-2); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-deep); }
.btn-accent:disabled { background: var(--bg-elev-2); color: var(--ink-mute); cursor: not-allowed; }
.btn-primary { background: var(--ink); color: var(--accent-ink); }
.btn-block { width: 100%; padding: 14px 18px; font-size: 15px; }
.btn-lg { padding: 14px 22px; font-size: 15px; }
.btn-sm { padding: 8px 12px; font-size: 13px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(20, 16, 18, 0.82);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
}
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 68px;
  gap: 24px;
}
.header-inner > .brand { justify-self: start; }
.header-inner > .nav { justify-self: center; }
.header-inner > .header-actions { justify-self: end; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
}
.brand-mark svg { display: block; }
.brand-mark.brand-mark-sm { width: 24px; height: 24px; font-size: 9px; }
.brand-name { font-weight: 600; letter-spacing: -0.02em; font-size: 17px; }
.brand-tld { color: var(--ink-mute); }
.brand-logo {
  display: block;
  height: 32px;
  width: 194px; /* preserves 1602.38:263.89 aspect at 32px tall */
  flex-shrink: 0;
}
.brand-logo-sm { height: 26px; width: 158px; }
.foot-brand .brand-logo { margin-bottom: 8px; }
.nav { display: flex; gap: 28px; }
.nav a {
  font-size: 14px; color: var(--ink-dim);
  transition: color 0.15s ease;
}
.nav a:hover { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 10px; }


/* ---------- Hero ---------- */
.hero { padding: 72px 0 48px; position: relative; }
.hero-grid {
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  gap: 56px; align-items: center;
}
.hero-grid.is-offers {
  grid-template-columns: 0.9fr 1.1fr;
  align-items: start;
}
.hero-grid.is-offers .hero-copy { display: none; }
.hero-grid.is-offers .swap-card { order: 1; align-self: start; }
.hero-grid.is-offers .offers-panel { display: flex; order: 2; }

.offers-panel { flex-direction: column; gap: 12px; }
.offers-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.offers-panel-head h3 {
  font-size: 16px; font-weight: 700; color: var(--ink); margin: 0;
}
.btn.btn-sm { padding: 6px 8px; font-size: 12px; }

/* Hide page sections while the inline offers panel is active — keep only
   the header, hero, and footer visible. */
body.is-quoting #how,
body.is-quoting #features,
body.is-quoting #partners,
body.is-quoting #faq,
body.is-quoting #contacts,
body.is-quoting .partners-strip { display: none; }

/* "Disabled" pill on rate seg buttons (used for Floating in reverse mode). */
.swap-card .rate-seg .seg-btn .seg-badge,
.offers-panel .rate-seg .seg-btn .seg-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-elev-2);
  color: var(--danger);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}
.swap-card .rate-seg .seg-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.hero h1 {
  font-size: clamp(40px, 5.4vw, 68px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin: 0 0 20px;
  max-width: 560px;
  color: var(--ink);
}
.lede {
  color: var(--ink-dim);
  font-size: clamp(15px, 1.15vw, 17px);
  max-width: 520px;
  line-height: 1.6;
}

/* ---------- Swap card ---------- */
.swap-card {
  position: relative;
  background: var(--bg-elev);
  border-radius: 18px;
  padding: 22px;
}
.seg {
  display: inline-flex; padding: 4px; gap: 4px;
  background: var(--bg); border-radius: 10px;
}
.seg-btn {
  border: 0; background: transparent; color: var(--ink-dim);
  padding: 7px 14px; border-radius: 7px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background 0.15s ease, color 0.15s ease;
}
.seg-btn.is-active { background: var(--bg-elev-2); color: var(--ink); }

.swap-leg {
  background: var(--bg);
  border-radius: 12px;
  padding: 14px 16px;
}
.leg-label {
  font-size: 12px; color: var(--ink-mute);
  text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600;
  margin-bottom: 6px;
}
.leg-row { display: flex; align-items: center; gap: 12px; }
.leg-row input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: 0;
  font-size: 28px; font-weight: 600; color: var(--ink);
  letter-spacing: -0.02em;
  padding: 2px 0;
}
.leg-row .leg-amount {
  flex: 1; min-width: 0;
  font-size: 28px; font-weight: 600; color: var(--ink);
  letter-spacing: -0.02em;
  padding: 2px 0;
}
.leg-row .leg-amount.is-muted { color: var(--ink-mute); }
.coin-select {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-elev-2);
  border-radius: 10px; padding: 6px 12px 6px 6px;
  cursor: pointer; transition: background 0.15s ease;
  font-weight: 600; color: var(--ink);
}
.coin-select:hover { background: var(--line); }
.coin-ico {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg);
  display: inline-grid; place-items: center;
  overflow: hidden;
}
.coin-ico img,
.coin-row-ico img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.coin-row-ico { overflow: hidden; background: var(--bg-elev-2); }
.coin-ico-letter {
  font-weight: 600; font-size: 12px;
  color: var(--ink-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.coin-row-ico .coin-ico-letter { font-size: 13px; }
.coin-tkr { font-size: 14px; letter-spacing: 0.01em; }

.flip-btn {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  margin: -10px auto;
  position: relative; z-index: 2;
  background: var(--bg-elev-2);
  color: var(--ink);
  border: 4px solid var(--bg-elev);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.flip-btn:hover { background: var(--line); }

.swap-foot {
  display: flex; justify-content: center; gap: 8px; align-items: center;
  margin-top: 12px;
  font-size: 12px; color: var(--ink-mute);
}
.swap-form { display: flex; flex-direction: column; gap: 12px; }
.swap-form .btn-block { margin-top: 4px; }

.leg-placeholder {
  flex: 1; min-width: 0;
  font-size: 14px;
  color: var(--ink-mute);
  padding: 6px 0;
  line-height: 1.4;
}

/* ---------- Partners strip ---------- */
.partners-strip {
  margin-top: 64px;
  padding-top: 32px;
  display: flex; align-items: center; gap: 28px;
}
.partners-strip-label {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-mute); font-weight: 600;
  white-space: nowrap;
}
.partners-marquee {
  flex: 1;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.partners-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: partners-scroll 35s linear infinite;
  will-change: transform;
}
.partners-track > .partners-logo {
  margin-right: 56px;
}
.partners-logo {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  width: 160px;
}
.partners-logo img {
  height: 40px;
  width: 140px;
  object-fit: contain;
  object-position: center;
  display: block;
  filter: grayscale(1) brightness(0.85);
  opacity: 0.55;
  transition: filter 280ms ease, opacity 280ms ease;
}
.partners-logo:hover img {
  filter: none;
  opacity: 1;
}
@keyframes partners-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .partners-track { animation: none; }
}

/* ---------- Mode tabs (Swap / Buy) ---------- */
.mode-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px; padding: 4px;
  background: var(--bg);
  border-radius: 12px;
  margin-bottom: 12px;
}
.mode-tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 12px;
  border: 0; background: transparent;
  border-radius: 8px;
  font-size: 13.5px; font-weight: 600;
  color: var(--ink-dim);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.mode-tab.is-active {
  background: var(--bg-elev-2);
  color: var(--ink);
}
.mode-tab.is-disabled { cursor: not-allowed; color: var(--ink-mute); }
.mode-badge {
  font-size: 10px; font-weight: 600;
  padding: 2px 6px; border-radius: 4px;
  background: var(--bg-elev-2);
  color: var(--ink-dim);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.mode-badge-off { color: var(--danger); }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section-head { margin-bottom: 36px; max-width: 720px; }
.section h2 {
  font-size: clamp(26px, 3vw, 36px);
  margin-top: 0;
  letter-spacing: -0.025em;
}

.dark-band {
  background: var(--bg-elev);
}

/* Hero copy gets a coral squiggle under the heading */
.hero h1 .ink-accent { color: var(--accent); }

/* ---------- Steps ---------- */
.steps {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.steps li {
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 26px;
  position: relative;
}
.dark-band .steps li { background: var(--bg); }
.step-num {
  display: inline-block;
  font-size: 12px; color: var(--accent); font-weight: 700;
  letter-spacing: 0.12em; margin-bottom: 22px;
  padding: 4px 8px; border-radius: 4px;
  background: var(--accent-soft);
}
.steps h3 { font-size: 20px; margin-bottom: 10px; }
.steps p { color: var(--ink-dim); font-size: 14.5px; line-height: 1.6; }

/* ---------- Features ---------- */
.feature-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
.feature h3 {
  font-size: 16px; margin-bottom: 8px;
  position: relative; padding-top: 14px;
}
.feature h3::before {
  content: ""; display: block;
  position: absolute; top: 0; left: 0;
  width: 28px; height: 3px; background: var(--accent);
  border-radius: 2px;
}
.feature p { color: var(--ink-dim); font-size: 14px; line-height: 1.6; }

/* ---------- Partners card ---------- */
.partners-card {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
  align-items: start;
  background: var(--bg-elev);
  border-radius: 18px;
  padding: 40px;
}
.partners-copy h2 { margin: 0 0 18px; font-size: clamp(26px, 3vw, 36px); }
.partners-copy p { color: var(--ink-dim); max-width: 460px; }

/* ---------- Partner form ---------- */
.partner-form {
  background: var(--bg-elev-2);
  border-radius: 14px;
  padding: 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field label {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-mute); font-weight: 600;
}
.field input,
.field select,
.field textarea {
  background: var(--bg);
  border: 0;
  color: var(--ink);
  font-size: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  outline: none;
  transition: background 0.15s ease;
  font-family: inherit;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-mute); }
.field input:focus,
.field select:focus,
.field textarea:focus { background: var(--bg-elev); }
.field textarea { resize: vertical; min-height: 70px; line-height: 1.5; }

/* ---------- FAQ ---------- */
.faq-wrap { max-width: 820px; }
.faq details {
  background: var(--bg-elev);
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 8px;
}
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-weight: 400; font-size: 22px; color: var(--ink-mute);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { content: "−"; }
.faq p {
  color: var(--ink-dim); font-size: 14.5px; margin-top: 12px;
  max-width: 680px; line-height: 1.65;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 64px 0 24px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px;
  margin-bottom: 48px;
}
.foot-brand { max-width: 320px; }
.foot-brand p {
  color: var(--ink-mute); font-size: 13.5px;
  margin-top: 14px; line-height: 1.6;
}
.foot-social {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px;
  margin-top: 18px;
  background: var(--bg-elev);
  border-radius: 8px;
  color: var(--ink-dim);
  transition: color 0.15s ease, background 0.15s ease;
}
.foot-social:hover {
  color: var(--ink);
  background: var(--bg-elev-2);
}
.footer-grid h4 {
  font-size: 12px; color: var(--ink-mute); text-transform: uppercase;
  letter-spacing: 0.1em; margin-bottom: 14px; font-weight: 600;
}
.footer-grid a {
  display: block; color: var(--ink-dim); font-size: 14px;
  padding: 5px 0; transition: color 0.15s ease;
}
.footer-grid a:hover { color: var(--ink); }
.foot-bar {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-top: 22px; font-size: 12.5px; color: var(--ink-mute);
}

/* ---------- Legal pages (terms / privacy) ---------- */
.legal-main { padding: 56px 0 96px; }
.legal-wrap { max-width: 720px; }
.legal-head { margin-bottom: 36px; }
.legal-head h1 {
  font-size: clamp(28px, 3.6vw, 40px);
  margin-top: 10px;
  letter-spacing: -0.025em;
}
.legal-meta {
  color: var(--ink-mute);
  font-size: 13px;
  margin-top: 12px;
}
.legal-body { color: var(--ink-dim); font-size: 15.5px; line-height: 1.7; }
.legal-body h2 {
  color: var(--ink);
  font-size: 18px;
  margin: 36px 0 10px;
  letter-spacing: -0.015em;
}
.legal-body p { margin: 0 0 14px; }
.legal-body ul {
  margin: 0 0 16px;
  padding-left: 20px;
  display: flex; flex-direction: column; gap: 6px;
}
.legal-body li::marker { color: var(--ink-mute); }
.legal-body a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
  transition: text-decoration-color 0.15s ease;
}
.legal-body a:hover { text-decoration-color: var(--accent); }

/* ---------- Blog ---------- */
.blog-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.blog-card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 24px;
  background: var(--bg-elev);
  border-radius: var(--radius);
  color: inherit;
  transition: background 0.15s ease;
}
.blog-card:hover { background: var(--bg-elev-2); }

/* ---------- Contacts ---------- */
.contacts-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.contact-card {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px;
  background: var(--bg-elev);
  border-radius: var(--radius);
  color: inherit;
  transition: background 0.15s ease;
}
.contact-card:hover { background: var(--bg-elev-2); }
.contact-ico {
  width: 36px; height: 36px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  flex: 0 0 auto;
}
.contact-card h3 {
  font-size: 12px; color: var(--ink-mute);
  text-transform: uppercase; letter-spacing: 0.1em;
  font-weight: 600; margin-bottom: 4px;
}
.contact-card p {
  font-size: 14px; font-weight: 600; color: var(--ink);
  word-break: break-all;
}

/* ---------- Modals ---------- */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: 24px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(23, 19, 20, 0.55);
  opacity: 0; transition: opacity 0.16s ease;
}
.modal.is-open .modal-backdrop { opacity: 1; }
.modal-card {
  position: relative;
  width: 100%; max-width: 460px;
  max-height: 80vh;
  background: var(--bg-elev);
  border-radius: 16px;
  display: flex; flex-direction: column;
  opacity: 0;
  transition: opacity 0.16s ease;
}
.modal.is-open .modal-card { opacity: 1; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 12px;
}
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-close {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  background: var(--bg-elev-2); border: 0;
  border-radius: 8px; color: var(--ink-dim); cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.modal-close:hover { background: var(--line); color: var(--ink); }
.modal-search {
  position: relative;
  margin: 0 20px 12px;
}
.modal-search svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--ink-mute);
}
.modal-search input {
  width: 100%;
  padding: 11px 12px 11px 36px;
  background: var(--bg);
  border: 0;
  border-radius: 10px;
  color: var(--ink); font-size: 14px;
  outline: none; transition: background 0.15s ease;
}
.modal-search input:focus { background: var(--bg-elev-2); }
.coin-list {
  list-style: none; padding: 4px 12px 14px; margin: 0;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}
.coin-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.coin-row:hover { background: var(--bg-elev-2); }
.coin-row.is-disabled { cursor: not-allowed; opacity: 0.45; }
.coin-row.is-disabled:hover { background: transparent; }
.coin-row.is-current { background: var(--bg); }
.coin-row-ico {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.coin-row-name {
  display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0;
}
.coin-row-name strong {
  font-size: 14px; font-weight: 600; color: var(--ink);
}
.coin-row-name em {
  font-style: normal; font-size: 12.5px; color: var(--ink-mute);
}
.coin-row-net {
  display: inline-block; margin-left: 6px;
  padding: 1px 6px; border-radius: 4px;
  background: var(--bg);
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink-dim);
}
.coin-row-tag {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-dim);
}
.coin-row-tag.muted { color: var(--ink-mute); }
.coin-empty { padding: 24px; text-align: center; color: var(--ink-mute); font-size: 14px; }

.modal-card-sm { max-width: 400px; }
.modal-body { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-desc { font-size: 13.5px; color: var(--ink-dim); }
.modal-fineprint {
  font-size: 12px; color: var(--ink-mute);
  text-align: center; line-height: 1.5;
}
.label-hint {
  font-weight: 400; text-transform: none; letter-spacing: 0;
  color: var(--ink-mute); margin-left: 6px; font-size: 11px;
}
.addr-summary {
  padding: 14px; background: var(--bg);
  border-radius: 12px;
}
.addr-summary-row {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center;
}
.addr-summary-label {
  display: block; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--ink-mute);
  font-weight: 600; margin-bottom: 4px;
}
.addr-summary strong { font-size: 14px; color: var(--ink); }
.addr-summary-arrow { color: var(--ink-mute); font-weight: 600; font-size: 18px; }

/* ---------- Offers page ---------- */
.offers-main {
  padding: 48px 0 96px;
  min-height: calc(100vh - 220px);
}
.offers-shell { max-width: 560px; margin: 0 auto; }
.offers-page-head { margin-bottom: 22px; }
.offers-page-head h1 {
  font-size: clamp(24px, 3vw, 30px);
  margin-top: 8px;
}
.offers-page-head .muted { color: var(--ink-dim); font-weight: 500; }

/* The offers page reuses the .swap-card / .swap-leg styles above.
   The rate seg lives inside the card. */
.swap-card .rate-seg {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px; padding: 4px;
  background: var(--bg);
  border-radius: 12px;
}
.swap-card .rate-seg .seg-btn {
  width: 100%; padding: 9px 12px;
  border-radius: 8px; background: transparent;
}
.swap-card .rate-seg .seg-btn.is-active {
  background: var(--bg-elev-2); color: var(--ink);
}
.rate-explain {
  font-size: 12.5px; color: var(--ink-dim); line-height: 1.5;
  padding: 2px 4px;
}

.offers-state {
  text-align: center;
  padding: 32px 20px;
  background: var(--bg);
  border-radius: 12px;
  color: var(--ink-dim);
}
.offers-state h3 { font-size: 16px; color: var(--ink); margin-bottom: 6px; }
.offers-state p { font-size: 13.5px; max-width: 380px; margin: 0 auto 12px; line-height: 1.55; }
.offers-state .spinner { margin: 0 auto 12px; }

.offers-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 10px 4px 4px;
}
.offers-section-head span {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-mute); font-weight: 700;
}
.offers-section-head .pill-count {
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: var(--bg-elev); color: var(--ink-dim);
  letter-spacing: 0.06em;
}

/* Inline address step (replaces the modal) */
.address-step {
  margin-top: 6px;
  padding: 16px;
  background: var(--bg);
  border-radius: 12px;
  display: flex; flex-direction: column; gap: 14px;
}
.address-step[hidden] { display: none; }
.address-step .address-step-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.address-step .address-step-head h3 {
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-dim);
}
.address-step .field-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) {
  .address-step .field-row { grid-template-columns: 1fr 1fr; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translate(-50%, 20px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 460px);
  background: var(--bg-elev-2);
  color: var(--ink);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  white-space: normal;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 100;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error {
  background: var(--accent);
  color: #ffffff;
}
.toast.is-error::before {
  content: "!";
  flex: 0 0 18px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}

/* ---------- Language switcher ---------- */
.lang-switch { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 10px;
  background: var(--bg-elev); color: var(--ink);
  border: 0; border-radius: 10px;
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}
.lang-btn:hover { background: var(--bg-elev-2); }
.lang-btn .lang-flag { font-size: 15px; line-height: 1; }
.lang-btn .lang-caret { opacity: 0.6; }
.lang-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--bg-elev-2);
  border-radius: 12px; padding: 4px; min-width: 160px;
  display: none; z-index: 120;
}
.lang-switch.is-open .lang-menu { display: block; }
.lang-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; background: transparent; border: 0;
  color: var(--ink); font-size: 13.5px; font-weight: 500;
  text-align: left; cursor: pointer; border-radius: 6px;
  font-family: inherit;
}
.lang-item:hover { background: var(--bg); }
.lang-item.is-active { background: var(--accent-soft); color: var(--accent-ink); }
.lang-item .lang-flag { font-size: 16px; line-height: 1; }

/* ---------- Offers list ---------- */
.offers { display: flex; flex-direction: column; gap: 8px; }
.offers-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.offer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px; align-items: center;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.offer:hover { background: var(--bg-elev-2); }
.offer.is-selected { background: var(--accent-soft); }
.offer-name {
  font-size: 14.5px; font-weight: 600; color: var(--ink);
  display: inline-flex; align-items: center; gap: 6px;
}
.offer-tags { display: inline-flex; gap: 4px; }
.offer-tag {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 2px 6px; border-radius: 4px;
}
.offer-tag.tag-best  { background: var(--accent); color: var(--accent-ink); }
.offer-tag.tag-fast  { background: var(--success-soft); color: var(--success); }
.offer-meta {
  font-size: 12px; color: var(--ink-mute); margin-top: 3px;
  display: inline-flex; gap: 8px; align-items: center;
}
.offer-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-mute); }
.offer-eta {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--ink-dim); font-weight: 500;
}
.offer-out  { font-size: 15.5px; font-weight: 700; color: var(--ink); white-space: nowrap; text-align: right; letter-spacing: -0.01em; }
.offer-out span { color: var(--ink-mute); font-weight: 500; margin-left: 4px; font-size: 12.5px; }
.offer-diff { font-size: 11.5px; color: var(--ink-mute); margin-top: 3px; text-align: right; font-weight: 600; }
.offer.is-selected .offer-diff { color: var(--accent-deep); }
.offer-radio {
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
  flex: 0 0 auto;
  background: var(--bg-elev-2);
  transition: background 0.15s ease;
}
.offer.is-selected .offer-radio { background: var(--accent); }
.offer.is-selected .offer-radio::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-ink);
}
.offers-empty {
  text-align: center; color: var(--ink-mute); font-size: 13.5px;
  padding: 22px 8px;
}

/* ---------- Order page ---------- */
.order-main { padding: 48px 0 96px; min-height: calc(100vh - 200px); }
.order-main [hidden] { display: none !important; }
.order-loading {
  text-align: center; padding: 96px 0;
  color: var(--ink-mute); font-size: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.spinner {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.order-error {
  text-align: center; padding: 80px 0;
  max-width: 480px; margin: 0 auto;
}
.order-error h1 { font-size: 28px; margin-bottom: 12px; }
.order-error p { color: var(--ink-dim); }
.order-error a { color: var(--ink); text-decoration: underline; }

.order-card {
  max-width: 720px; margin: 0 auto;
  background: var(--bg-elev);
  border-radius: 16px;
  overflow: hidden;
}
.order-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
  padding: 28px 32px 22px;
}
.order-head-right {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end;
}
.order-head .eyebrow {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  word-break: break-all;
  font-weight: 600;
}
.order-head .eyebrow .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: none; letter-spacing: 0;
  color: var(--ink-dim); font-weight: 500;
}
.order-head h1 {
  font-size: 24px; margin: 10px 0 0;
  letter-spacing: -0.025em; line-height: 1.2;
  color: var(--ink); font-weight: 600;
}
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 600;
  padding: 6px 11px; border-radius: 999px;
  background: var(--bg); color: var(--ink-dim);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.status-pill::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.status-pill[data-s="waiting"]    { color: var(--warn); background: var(--warn-soft); }
.status-pill[data-s="waiting"]::before { animation: pulse-dot 1.6s ease-in-out infinite; }
.status-pill[data-s="confirming"],
.status-pill[data-s="exchanging"],
.status-pill[data-s="sending"]    { color: var(--accent); background: var(--accent-soft); }
.status-pill[data-s="confirming"]::before,
.status-pill[data-s="exchanging"]::before,
.status-pill[data-s="sending"]::before { animation: pulse-dot 1.6s ease-in-out infinite; }
.status-pill[data-s="finished"],
.status-pill[data-s="refunded"]   { color: var(--success); background: var(--success-soft); }
.status-pill[data-s="failed"],
.status-pill[data-s="expired"]    { color: var(--danger); background: var(--danger-soft); }
@keyframes pulse-dot {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50%      { opacity: 1;   transform: scale(1.1); }
}

.order-steps {
  list-style: none; padding: 26px 32px 28px; margin: 0;
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 0;
  background: rgba(255, 255, 255, 0.015);
  position: relative;
  counter-reset: step;
}
.order-steps li {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 12px; color: var(--ink-mute);
  position: relative;
  text-align: center;
  counter-increment: step;
  transition: color 0.25s ease;
}
.order-steps li::before {
  content: ""; position: absolute;
  top: 13px; left: calc(50% + 14px); right: calc(-50% + 14px);
  height: 2px; background: var(--bg-elev-2);
  z-index: 0;
  transition: background 0.3s ease;
}
.order-steps li:last-child::before { display: none; }
.order-steps li .dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-elev-2);
  flex: 0 0 auto;
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: var(--ink-mute);
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.order-steps li .dot::before { content: counter(step); }
.order-steps li.is-active { color: var(--ink); font-weight: 600; }
.order-steps li.is-active .dot {
  color: var(--accent-ink); background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.order-steps li.is-done { color: var(--ink-dim); }
.order-steps li.is-done .dot {
  background: var(--accent); color: var(--accent-ink);
}
.order-steps li.is-done .dot::before { content: "✓"; font-size: 12px; }
.order-steps li.is-done::before { background: var(--accent); }

.order-section { padding: 28px 32px; }
.order-section + .order-section { padding-top: 8px; }
.order-section > h2 { font-size: 14px; font-weight: 600; margin: 0 0 16px; color: var(--ink-dim); letter-spacing: -0.005em; }
.order-section > h2 strong { color: var(--ink); font-weight: 600; }
.payin-grid {
  display: grid; grid-template-columns: 172px 1fr; gap: 22px; align-items: start;
}
.payin-qr-wrap { position: relative; width: 172px; height: 172px; }
.payin-qr {
  width: 172px; height: 172px;
  background: #fff; border-radius: 12px;
  padding: 12px; display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
}
.payin-qr svg { width: 100%; height: 100%; display: block; }
.qr-pulse {
  position: absolute; inset: 0;
  border-radius: 12px;
  box-shadow: 0 0 0 0 rgba(234, 28, 74, 0.35);
  animation: qr-pulse 2.2s ease-out infinite;
  pointer-events: none;
}
@keyframes qr-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(234, 28, 74, 0.4); }
  70%  { box-shadow: 0 0 0 12px rgba(234, 28, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(234, 28, 74, 0); }
}
.payin-right { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.addr-block {
  display: flex; gap: 12px; align-items: center;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 10px;
}
.addr-block code {
  flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; color: var(--ink); word-break: break-all;
  line-height: 1.5; letter-spacing: -0.01em;
}
.addr-meta {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: 10px;
}
.addr-meta-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--warn); font-weight: 700;
  white-space: nowrap;
}
.addr-meta code {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; color: var(--ink);
  word-break: break-all;
}
.order-note {
  font-size: 12.5px; color: var(--ink-mute);
  margin: 4px 0 0; line-height: 1.55;
}
.order-note strong { color: var(--ink-dim); font-weight: 600; }

.order-summary {
  margin-top: 0;
  padding-top: 24px;
  position: relative;
}
.order-summary::before {
  content: ""; display: block;
  height: 1px; background: var(--line-soft);
  margin: 0 0 24px;
}
.order-summary dl {
  margin: 0;
  display: grid; gap: 18px 32px;
  grid-template-columns: 1fr 1fr;
}
.order-summary dl > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.order-summary dt {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-mute); font-weight: 600;
}
.order-summary dd {
  margin: 0; font-size: 14px; color: var(--ink); font-weight: 600;
  word-break: break-all;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  line-height: 1.4;
}
.order-summary dd.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; font-weight: 500; color: var(--ink-dim);
  letter-spacing: -0.01em;
}
.order-summary dd .provider-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600;
  text-decoration: none;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--ink-dim); background: var(--bg);
  transition: background 0.15s ease, color 0.15s ease;
  word-break: keep-all; white-space: nowrap;
}
.order-summary dd .provider-link:hover { background: var(--accent-soft); color: var(--accent); }

/* ---------- State stage ---------- */
.state-stage { padding-top: 12px; padding-bottom: 8px; }
.state-panel { animation: state-fade 0.35s ease; }
@keyframes state-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.state-panel-centered {
  text-align: center;
  padding: 28px 0 12px;
  display: flex; flex-direction: column; align-items: center;
}
.state-h2 {
  font-size: 22px; font-weight: 600;
  color: var(--ink); margin: 0 0 10px;
  letter-spacing: -0.02em; line-height: 1.3;
}
.state-h2 strong { color: var(--accent); font-weight: 600; }
.state-desc {
  color: var(--ink-mute); font-size: 13.5px;
  margin: 0 auto; max-width: 460px; line-height: 1.55;
}
.state-desc .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; color: var(--ink-dim);
  background: var(--bg); padding: 2px 7px; border-radius: 6px;
  margin: 0 2px;
}
.state-desc strong { color: var(--ink); font-weight: 600; }

/* Reusable coin chip rendered by JS */
.coin-chip {
  width: var(--size, 56px); height: var(--size, 56px);
  border-radius: 50%;
  background: var(--bg);
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
}
.coin-chip img {
  width: 62%; height: 62%; object-fit: contain;
  display: block;
  border-radius: 50%;
}
.coin-chip-letter {
  font-size: calc(var(--size, 56px) * 0.22);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
}

/* Generic anim canvas */
.state-anim {
  margin: 4px auto 22px;
  display: flex; align-items: center; justify-content: center;
}

/* CONFIRMING: coin with spinning ring */
.anim-confirming { position: relative; width: 108px; height: 108px; }
.anim-confirming .coin-chip {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.anim-confirming .anim-ring {
  position: absolute; inset: 0;
  width: 108px; height: 108px;
  animation: spin 1.6s linear infinite;
}
.anim-confirming .anim-ring circle {
  fill: none; stroke: var(--accent);
  stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 80 280;
}

/* EXCHANGING: two coins with arrows */
.anim-exchanging { gap: 16px; height: 80px; }
.anim-exchanging .anim-coin-a { animation: nudge-left 1.8s ease-in-out infinite; }
.anim-exchanging .anim-coin-b { animation: nudge-right 1.8s ease-in-out infinite; }
.anim-exchanging .anim-arrows {
  color: var(--accent); width: 44px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  animation: pulse-arrows 1.8s ease-in-out infinite;
}
.anim-exchanging .anim-arrows svg { width: 100%; height: 100%; }
@keyframes nudge-left  { 0%,100%{transform:translateX(0)} 50%{transform:translateX(-5px)} }
@keyframes nudge-right { 0%,100%{transform:translateX(0)} 50%{transform:translateX(5px)} }
@keyframes pulse-arrows { 0%,100%{opacity:0.5} 50%{opacity:1} }

/* SENDING: coin flying toward wallet */
.anim-sending { gap: 0; height: 80px; position: relative; }
.anim-sending .anim-fly {
  position: relative; z-index: 2;
  animation: fly-right 2.2s ease-in-out infinite;
}
.anim-sending .anim-trail {
  color: var(--accent); width: 96px; height: 20px; margin: 0 -8px;
  display: inline-flex; align-items: center;
}
.anim-sending .anim-trail svg { width: 100%; height: 100%; }
.anim-sending .anim-wallet {
  width: 52px; height: 52px;
  color: var(--ink-dim);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg); border-radius: 12px;
}
.anim-sending .anim-wallet svg { width: 26px; height: 26px; }
@keyframes fly-right {
  0%   { transform: translateX(-8px); opacity: 1; }
  55%  { transform: translateX(56px); opacity: 0; }
  56%  { transform: translateX(-8px); opacity: 0; }
  70%  { opacity: 1; }
  100% { transform: translateX(-8px); opacity: 1; }
}

/* FINISHED: drawn tick */
.anim-finished { width: 88px; height: 88px; color: var(--success); }
.finished-tick { width: 88px; height: 88px; display: block; }
.finished-circle {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: draw-circle 0.6s ease-out forwards;
}
.finished-check {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: draw-check 0.4s 0.5s ease-out forwards;
}
@keyframes draw-circle { to { stroke-dashoffset: 0; } }
@keyframes draw-check  { to { stroke-dashoffset: 0; } }

/* TERMINAL */
.anim-terminal {
  width: 68px; height: 68px; border-radius: 50%;
  background: var(--danger-soft); color: var(--danger);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 600; margin-bottom: 18px;
}
[data-terminal="refunded"] .anim-terminal { background: var(--warn-soft); color: var(--warn); }
[data-terminal="expired"]  .anim-terminal { background: var(--bg); color: var(--ink-dim); }

/* tx pills */
.state-tx {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 14px; background: var(--bg); border-radius: 10px;
  margin-top: 20px;
}
.state-tx-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-mute); font-weight: 700;
}
.state-tx code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; color: var(--ink);
}
.state-tx-link {
  font-size: 11.5px; font-weight: 600;
  color: var(--accent); text-decoration: none;
}
.state-tx-link:hover { text-decoration: underline; }
.state-tx-grid {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
  margin-top: 20px;
}
.state-tx-grid .state-tx { margin-top: 0; }

/* Finished CTA */
.state-finished { padding-bottom: 16px; }
.state-finished .state-h2 { font-size: 24px; }
.finished-cta {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 22px; background: var(--bg); border-radius: 12px;
  max-width: 460px; margin: 24px auto 0;
}
.finished-ask { margin: 0; font-size: 13px; color: var(--ink-mute); line-height: 1.5; }
.finished-cta .btn { display: inline-flex; align-items: center; gap: 8px; }

.order-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 32px; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid var(--line-soft);
}
.order-foot .updated { color: var(--ink-mute); font-size: 12.5px; }
.order-foot .updated::before {
  content: ""; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success); margin-right: 8px;
  vertical-align: middle;
  animation: pulse-dot 1.8s ease-in-out infinite;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero { padding-top: 48px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-grid.is-offers { grid-template-columns: 1fr; gap: 16px; }
  .section { padding: 64px 0; }
  .steps { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .partners-card { grid-template-columns: 1fr; padding: 28px; gap: 28px; }
  .field-row { grid-template-columns: 1fr; }
  .partners-strip { gap: 16px; flex-wrap: wrap; }
  .partners-track > .partners-logo { margin-right: 36px; }
  .partners-track { animation-duration: 28s; }
  .partners-logo { height: 34px; width: 120px; }
  .partners-logo img { height: 30px; width: 100px; }
  .blog-grid { grid-template-columns: 1fr; }
  .contacts-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
}
@media (max-width: 720px) {
  .order-summary dl { grid-template-columns: 1fr; gap: 16px; }
  .order-steps { grid-template-columns: repeat(5, 1fr); padding: 22px 18px; font-size: 10.5px; }
  .order-steps li { gap: 8px; }
  .order-head, .order-section, .order-foot { padding-left: 22px; padding-right: 22px; }
  .payin-grid { grid-template-columns: 1fr; justify-items: center; }
  .payin-qr-wrap, .payin-qr { width: 200px; height: 200px; }
  .payin-right { width: 100%; }
  .order-head { flex-direction: column; align-items: flex-start; }
  .order-head-right { align-self: stretch; justify-content: flex-end; }
  .addr-summary-row { grid-template-columns: 1fr; gap: 10px; }
  .addr-summary-arrow { display: none; }
  .offer { grid-template-columns: 1fr auto; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .header-actions .btn:not(.btn-accent) { display: none; }
  .header-inner { gap: 12px; height: 60px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .contacts-grid { grid-template-columns: 1fr; }
  .leg-row input, .leg-row .leg-amount { font-size: 22px; }
  .hero { padding: 36px 0 24px; }
  .section { padding: 48px 0; }
  .section-head { margin-bottom: 24px; }
  .swap-card { padding: 16px; border-radius: 14px; }
  .partners-card { padding: 22px; gap: 22px; }
  .partner-form { padding: 18px; }
  .modal { padding: 12px; }
  .modal-card { max-height: 88vh; max-height: 88dvh; border-radius: 12px; }
  .order-head, .order-section, .order-foot { padding-left: 18px; padding-right: 18px; }
  .order-head { flex-wrap: wrap; }
  .order-head h1 { font-size: 20px; }
  .order-summary dl { gap: 14px; }
  .blog-grid { gap: 16px; }
  .offers-page-head h1 { font-size: 22px; }
  .feature-grid { gap: 18px; }
}

/* ---------- Tablet midrange (between 720 and 960) ---------- */
@media (max-width: 860px) and (min-width: 721px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .blog-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

/* ---------- Very small phones (e.g. 320px width) ---------- */
@media (max-width: 380px) {
  .wrap { padding: 0 14px; }
  .header-inner { gap: 8px; height: 56px; }
  .brand-name { font-size: 15px; }
  .brand-logo { height: 26px; width: 158px; }
  .btn { padding: 10px 14px; font-size: 13px; }
  .btn-block { padding: 13px 16px; font-size: 14px; }
  .swap-card { padding: 14px; }
  .swap-leg { padding: 12px 14px; }
  .leg-row { gap: 8px; }
  .leg-row input, .leg-row .leg-amount { font-size: 20px; }
  .coin-select { padding: 5px 10px 5px 5px; }
  .coin-ico { width: 22px; height: 22px; }
  .coin-tkr { font-size: 13px; }
  .mode-tab { padding: 9px 8px; font-size: 12.5px; }
  .hero h1 { font-size: clamp(28px, 9vw, 38px); }
  .order-steps { grid-template-columns: 1fr; gap: 4px; padding: 20px 18px; }
  .order-steps li::before { display: none; }
  .order-steps li { flex-direction: row; gap: 12px; justify-content: flex-start; text-align: left; }
  .toast { left: 12px; right: 12px; transform: translateY(20px); max-width: none; bottom: 16px; }
  .toast.is-visible { transform: translateY(0); }
  .lang-btn { padding: 0 8px; height: 34px; font-size: 13px; }
  .lang-btn .lang-label { display: none; }
}

/* ---------- Landscape phones (short screens) ---------- */
@media (max-height: 480px) and (orientation: landscape) {
  .hero { padding: 28px 0 20px; }
  .section { padding: 40px 0; }
  .modal-card { max-height: 92vh; max-height: 92dvh; }
}

/* ---------- Ultrawide / large desktops ---------- */
@media (min-width: 1440px) {
  .wrap { max-width: 1280px; }
}
@media (min-width: 1920px) {
  html { font-size: 18px; }
  .wrap { max-width: 1440px; }
}

/* ---------- Touch + safe-area niceties ---------- */
@media (hover: none) and (pointer: coarse) {
  .btn, .seg-btn, .mode-tab, .coin-select, .flip-btn, .lang-btn, .modal-close { min-height: 44px; }
  .nav a { padding: 6px 0; }
}
@supports (padding: max(0px)) {
  .wrap { padding-left: max(clamp(16px, 3vw, 28px), env(safe-area-inset-left));
          padding-right: max(clamp(16px, 3vw, 28px), env(safe-area-inset-right)); }
  .site-footer { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
}
@media print {
  .site-header, .site-footer, .toast, .modal { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .status-pill[data-s]::before { animation: none !important; }
}

/* ---------- Defensive: nothing can break horizontal width ---------- */
img, svg, video, canvas, iframe { max-width: 100%; height: auto; }
pre, code { overflow-x: auto; max-width: 100%; }
.modal-card    { max-width: min(460px, calc(100vw - 24px)); }
.modal-card-sm { max-width: min(400px, calc(100vw - 24px)); }
