/* MonetaGO Swap — page styles.
   Design: "MonetaGO Swap" mockups (Claude Design, 12.2026): deep navy dark theme and a light theme, the swap
   form as the hero. The resolved theme is set on <html data-theme="light|dark"> by js/theme-init.js before
   the first paint. Mobile first; the form goes horizontal from 720 px, the page widens from 900 px. */

/* ---------- Fonts: Geologica + JetBrains Mono (local, CSP font-src 'self'; OFL) ---------- */
@font-face { font-family: "Geologica"; src: url("/static/fonts/geologica-cyrillic-wght-normal.woff2") format("woff2-variations"); font-weight: 100 800; font-style: normal; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Geologica"; src: url("/static/fonts/geologica-latin-wght-normal.woff2") format("woff2-variations"); font-weight: 100 800; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; src: url("/static/fonts/jetbrains-mono-cyrillic-wght-normal.woff2") format("woff2-variations"); font-weight: 100 800; font-style: normal; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; src: url("/static/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2-variations"); font-weight: 100 800; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Tokens: LIGHT ---------- */
:root {
  /* Geologica has no CJK glyphs: Chinese falls back per glyph to the system CJK font */
  --font-sans: "Geologica", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 12px;
  --field-radius: 16px;
  --card-radius: 24px;
  --control-height: 50px;
  --gutter: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --page: #F3F5F9;
  --surface: #FFFFFF;
  --surface-2: #F7F8FB;
  --field: #F2F4F8;
  --field-hover: #EAEEF5;
  --line: #E4E8EF;
  --line-2: #D3DAE6;
  --fg-1: #0A1330;
  --fg-2: #48526B;
  --fg-3: #687290;
  --brand: #2862EA;
  --brand-hover: #1F4FBE;
  --brand-text: #2058D6;
  --brand-soft: #E9EFFF;
  --pressed: #FFFFFF;
  --ok: #00875A;   --ok-soft: #E2F6EE;
  --warn: #A3640A; --warn-soft: #FFF4E0;
  --err: #CC2F35;  --err-soft: #FDECEC;
  --shadow-card: 0 24px 60px rgba(10, 19, 48, 0.10), 0 2px 6px rgba(10, 19, 48, 0.05);
  --shadow-soft: 0 6px 20px rgba(10, 19, 48, 0.06);
  --toggle-off: #CDD4E0;
  --deco: rgba(40, 98, 234, 0.08);
  --hero-glow:
    radial-gradient(1100px 600px at 50% -10%, rgba(40, 98, 234, 0.12), rgba(40, 98, 234, 0) 62%),
    radial-gradient(700px 500px at 94% 20%, rgba(90, 139, 255, 0.08), rgba(90, 139, 255, 0) 70%);
  --header-bg: rgba(243, 245, 249, 0.78);

  /* Names used by the picker, coin chips and skeletons */
  --app-background: var(--page);
  --foreground: var(--fg-1);
  --body-text: var(--fg-2);
  --muted-foreground: var(--fg-3);
  --placeholder: var(--fg-3);
  --card: var(--surface);
  --card-border: var(--line);
  --popover: var(--surface);
  --primary: var(--brand);
  --primary-hover: var(--brand-hover);
  --primary-foreground: #FFFFFF;
  --primary-text: var(--brand-text);
  --muted: var(--field);
  --hover: var(--field-hover);
  --selected: var(--brand-soft);
  --accent: var(--brand-soft);
  --accent-foreground: var(--brand-text);
  --border: var(--line);
  --input: var(--line-2);
  --input-background: var(--field);
  --chip-background: var(--surface);
  --chip-border: var(--line-2);
  --field-hover-border: color-mix(in srgb, var(--brand) 40%, transparent);
  --focus-border: var(--brand);
  --focus-glow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
  --focus-outline: var(--brand);
  --overlay: rgba(10, 19, 48, 0.40);
  --skeleton-a: #EDF0F5;
  --skeleton-b: #E2E7EF;
  --badge-ring: var(--surface);
  color-scheme: light;
}

/* ---------- Tokens: DARK ---------- */
html[data-theme="dark"] {
  --page: #060C22;
  --surface: #0D1636;
  --surface-2: #111C42;
  --field: #131F47;
  --field-hover: #18275A;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --fg-1: #FFFFFF;
  --fg-2: rgba(226, 233, 255, 0.74);
  --fg-3: rgba(226, 233, 255, 0.54);
  --brand: #286CF7;
  --brand-hover: #3B7BFF;
  --brand-text: #7FA8FF;
  --brand-soft: rgba(40, 108, 247, 0.16);
  --pressed: #24356A;
  --ok: #34D39E;   --ok-soft: rgba(0, 182, 121, 0.15);
  --warn: #FFBE55; --warn-soft: rgba(245, 165, 36, 0.13);
  --err: #FF7A7E;  --err-soft: rgba(229, 72, 77, 0.15);
  --shadow-card: 0 30px 80px rgba(0, 3, 18, 0.55), 0 2px 8px rgba(0, 3, 18, 0.3);
  --shadow-soft: 0 10px 30px rgba(0, 3, 18, 0.35);
  --toggle-off: rgba(255, 255, 255, 0.16);
  --deco: rgba(127, 168, 255, 0.10);
  --hero-glow:
    radial-gradient(1100px 620px at 50% -8%, rgba(40, 108, 247, 0.30), rgba(40, 108, 247, 0) 62%),
    radial-gradient(700px 520px at 92% 18%, rgba(90, 139, 255, 0.10), rgba(90, 139, 255, 0) 70%),
    radial-gradient(640px 520px at 4% 46%, rgba(40, 70, 200, 0.12), rgba(40, 70, 200, 0) 70%);
  --header-bg: rgba(6, 12, 34, 0.72);
  --overlay: rgba(2, 5, 18, 0.66);
  --skeleton-a: #131F47;
  --skeleton-b: #1B2A5C;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; background: var(--page); }
body {
  position: relative; margin: 0; min-height: 100vh; color: var(--fg-1);
  font-family: var(--font-sans); font-size: 15px; line-height: 1.5; font-weight: 400;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden;
}
html.modal-open, html.modal-open body { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; color: var(--fg-1); }
p { margin: 0; text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
code { font-family: var(--font-mono); }
svg { flex: none; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--fg-3); }
.small { font-size: 13px; }
.accent { color: var(--brand-text); font-weight: 700; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus-outline); outline-offset: 3px; border-radius: 10px; }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 60; padding: 10px 16px; border-radius: var(--radius);
  background: var(--brand); color: #fff; text-decoration: none; font-weight: 600; transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* Reveal after i18n is applied (fallback: reveal anyway after 3 s) */
.reveal { opacity: 0; animation: reveal-fallback 0.01s linear 3s forwards; }
html.is-ready .reveal { opacity: 1; animation: none; transition: opacity 0.3s var(--ease); }
@keyframes reveal-fallback { to { opacity: 1; } }

/* Glow behind the header and the first screen */
.page-glow { position: absolute; inset: 0 0 auto 0; height: 1100px; background: var(--hero-glow); pointer-events: none; z-index: 0; }
.site-header, main, .site-footer { position: relative; z-index: 1; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line);
  background: var(--header-bg); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
}
.header-inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.logo { display: flex; align-items: center; flex: none; border-radius: 8px; }
.logo img { height: 26px; width: auto; }
html[data-theme="dark"] .logo-light, html:not([data-theme="dark"]) .logo-dark { display: none !important; }

.header-nav { display: none; }
.nav-swap {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 22px; border-radius: 14px;
  background: var(--brand-soft); color: var(--brand-text); font-size: 16px; font-weight: 600; text-decoration: none;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.nav-swap:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 45%, transparent); }
.nav-swap[aria-current="page"] { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 35%, transparent); }

.header-tools, .ft-tools { display: flex; align-items: center; gap: 8px; }
.theme-seg { display: none; gap: 2px; padding: 3px; border-radius: 13px; background: var(--field); }
.theme-btn {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--fg-3);
  transition: background 0.15s, color 0.15s;
}
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn:hover { color: var(--fg-1); }
.theme-btn[aria-pressed="true"] { background: var(--pressed); color: var(--brand-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.tools-sep { display: none; width: 1px; height: 24px; background: var(--line-2); }
.theme-cycle { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--field); color: var(--fg-1); }
.theme-cycle svg { width: 18px; height: 18px; display: none; }
html[data-theme-mode="system"] .tc-system, html[data-theme-mode="light"] .tc-light, html[data-theme-mode="dark"] .tc-dark { display: block; }

.lang-dd { position: relative; }
.lang-toggle {
  display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 10px 0 12px; border-radius: 12px;
  border: 1px solid var(--line-2); color: var(--fg-1); font-size: 14px; font-weight: 600; transition: background 0.15s;
}
.lang-toggle:hover { background: var(--field); }
.lang-toggle svg { width: 17px; height: 17px; }
.lang-toggle .lang-chev { width: 16px; height: 16px; color: var(--fg-3); transition: transform 0.2s var(--ease); }
.lang-toggle[aria-expanded="true"] .lang-chev { transform: rotate(180deg); }
.lang-full { display: none; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 168px; padding: 6px;
  display: grid; gap: 2px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-card);
}
.lang-dd-up .lang-menu { top: auto; bottom: calc(100% + 8px); }
.lang-btn { text-align: left; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--fg-1); }
.lang-btn:hover { background: var(--field); }
.lang-btn[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }

/* Chinese: CJK needs more leading and no negative tracking */
html[lang="zh-CN"] h1, html[lang="zh-CN"] h2, html[lang="zh-CN"] h3 { letter-spacing: 0; line-height: 1.3; }
html[lang="zh-CN"] body { line-height: 1.65; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero-deco { position: absolute; top: -72px; left: 50%; transform: translateX(-50%); pointer-events: none; }
.hero-deco circle { fill: none; stroke: var(--deco); stroke-width: 1; }
.hero-deco .dot { fill: var(--deco); stroke: none; }
.hero-inner { position: relative; max-width: 1080px; padding-top: 28px; padding-bottom: 56px; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.hero-title { font-size: 27px; line-height: 34px; font-weight: 700; letter-spacing: -0.01em; }
.perks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 14px; color: var(--fg-2); }
.perks li { display: flex; align-items: center; gap: 8px; }
.perks svg { color: var(--brand); }
.swap-wrap { width: 100%; max-width: 1000px; text-align: left; display: grid; gap: 12px; }

.last-order {
  justify-self: center; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: var(--brand-soft); color: var(--fg-1); font-size: 14px; font-weight: 500; text-decoration: none;
}
.last-order code { font-weight: 600; color: var(--brand-text); }
.last-order svg { color: var(--brand-text); }
.last-order:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 40%, transparent); }

/* ---------- Swap form ---------- */
.swap-card {
  margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; padding: 16px; scroll-margin-top: 80px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-card);
}
.swap-card:focus { outline: none; }
.sf-row { display: flex; flex-direction: column; }
.leg-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.leg {
  display: flex; flex-direction: column; gap: 6px; padding: 14px 12px 14px 16px; border-radius: 16px; background: var(--field);
  transition: box-shadow 0.15s;
}
.leg:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.leg:focus-within { box-shadow: inset 0 0 0 1.5px var(--brand); }
.leg.has-error, .leg.has-error:focus-within { box-shadow: inset 0 0 0 1.5px var(--err); }
.leg-label { font-size: 14px; font-weight: 500; color: var(--fg-2); }
.leg-body { display: flex; align-items: center; gap: 12px; }
.leg-meta { display: flex; justify-content: space-between; gap: 8px; min-height: 18px; padding: 0 6px; font-size: 13px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.min-line { text-align: right; }

.amount-input, .amount-out {
  flex: 1 1 auto; min-width: 0; width: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: var(--fg-1);
  font-family: var(--font-sans); font-size: 26px; line-height: 36px; font-weight: 600; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; text-overflow: ellipsis;
}
.amount-input::placeholder { color: var(--fg-3); opacity: 1; }
.amount-input:focus-visible { outline: none; }
.amount-out { display: block; overflow: hidden; white-space: nowrap; }
.amount-out.is-empty { color: var(--fg-3); }
.amount-out.is-stale, .amount-input.is-stale { opacity: 0.45; }
.amount-input.is-loading { color: transparent; }
.amount-out.is-loading { color: transparent; position: relative; }
.amount-out.is-loading::after {
  content: ""; position: absolute; left: 0; top: 50%; width: min(150px, 70%); height: 24px; transform: translateY(-50%);
  border-radius: 8px; background: linear-gradient(90deg, var(--skeleton-a), var(--skeleton-b), var(--skeleton-a));
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
}

.flip-wrap { position: relative; height: 12px; display: flex; justify-content: center; z-index: 2; }
.flip-btn {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center;
  border: 4px solid var(--surface); background: var(--field-hover); color: var(--fg-1);
  transition: background 0.15s, color 0.15s;
}
.flip-btn svg { transform: rotate(90deg); transition: transform 0.22s var(--ease); }
.flip-btn:hover:not(:disabled) { background: var(--brand); color: #fff; }
.flip-btn:hover:not(:disabled) svg { transform: rotate(270deg); }
.flip-btn:disabled { color: var(--fg-3); }

/* Rate type */
.rate-box { display: flex; flex-direction: column; gap: 10px; }
.rate-type-label { padding: 0 4px; font-size: 15px; font-weight: 600; }
.rate-ctl { display: flex; align-items: stretch; gap: 10px; }
.rate-seg {
  flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px;
  padding: 5px; border-radius: 18px; background: var(--field);
}
.rate-opt {
  display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 12px 12px; border-radius: 14px; color: var(--fg-1); text-align: left;
  transition: background 0.15s, box-shadow 0.15s;
}
.rate-opt:hover { background: color-mix(in srgb, var(--surface) 50%, transparent); }
.rate-opt[aria-checked="true"] { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--brand), var(--shadow-soft); }
.opt-head { display: flex; flex-direction: column; gap: 2px; font-size: 14px; font-weight: 600; }
.opt-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-pct { color: var(--fg-3); font-variant-numeric: tabular-nums; }
.rate-opt[aria-checked="true"] .opt-pct { color: var(--brand-text); }
.opt-desc { display: none; font-size: 13px; color: var(--fg-3); }
.help-btn { flex: none; width: 44px; border-radius: 16px; background: var(--field); color: var(--fg-2); font-size: 18px; font-weight: 700; }
.help-btn:hover { color: var(--fg-1); }
.help-btn[aria-expanded="true"] { background: var(--brand); color: #fff; }
@media (max-width: 719.98px) {
  /* Mobile: "?" moves up to the "Тип курса" row, the switch takes the full width. */
  .rate-box { position: relative; }
  .help-btn { position: absolute; top: -6px; right: 0; width: 32px; height: 32px; border-radius: 10px; font-size: 15px; }
}
.rate-help { padding: 0 4px; font-size: 13.5px; line-height: 1.55; color: var(--fg-2); }

.warn-box { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 14px; background: var(--warn-soft); color: var(--fg-1); }
.warn-box > svg { color: var(--warn); margin-top: 1px; }
.warn-box .accent { color: var(--warn); }
.warn-box a { color: var(--brand-text); font-weight: 600; text-underline-offset: 3px; }
.rate-note-title { font-size: 14px; font-weight: 500; }
.rate-note-text { margin-top: 2px; font-size: 13px; color: var(--fg-2); }

/* Rate line + refresh timer */
.rateline { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-height: 24px; padding: 0 4px; }
.quote-lines { margin: 0; display: grid; gap: 4px; font-size: 13px; }
.quote-lines.is-stale { opacity: 0.45; }
.q-row { display: flex; align-items: baseline; gap: 8px; }
.q-row dt { color: var(--fg-3); }
.q-row dd { margin: 0; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.q-rate dd { font-size: 15px; font-weight: 600; color: var(--fg-1); }
.refresh { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.refresh-ring { transform: rotate(-90deg); }
.refresh-ring circle { fill: none; stroke-width: 2.2; }
.ring-bg { stroke: var(--line-2); }
.ring-fg { stroke: var(--brand); stroke-linecap: round; stroke-dasharray: 40.84; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; }
.refresh.is-busy .refresh-ring { animation: spin 0.9s linear infinite; }
.refresh.is-busy .ring-fg { stroke-dashoffset: 28; transition: none; }

.form-alert {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 14px;
  background: var(--err-soft); color: var(--fg-1); font-size: 14px; line-height: 1.45;
}
.form-alert > svg { color: var(--err); margin-top: 1px; }
.form-alert .link-btn { margin-left: auto; }

/* Address */
.field { display: flex; flex-direction: column; gap: 8px; }
.field-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; padding: 0 4px; }
.field-label { font-size: 15px; font-weight: 600; }
.field-sub { font-size: 13px; color: var(--fg-3); }
.addr-wrap {
  display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 8px 8px 8px 16px; border-radius: 16px;
  background: var(--field); transition: box-shadow 0.15s;
}
.addr-wrap:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.addr-wrap:focus-within { box-shadow: inset 0 0 0 1.5px var(--brand); }
.addr-wrap.is-invalid, .addr-wrap.is-invalid:hover { box-shadow: inset 0 0 0 1.5px var(--err); }
.addr-wrap textarea {
  flex: 1 1 auto; min-width: 0; min-height: 24px; resize: none; overflow: hidden; padding: 4px 0; border: 0; background: transparent;
  color: var(--fg-1); font-family: var(--font-mono); font-size: 15px; line-height: 1.5; word-break: break-all;
}
.addr-wrap textarea::placeholder { font-family: var(--font-sans); color: var(--fg-3); opacity: 1; }
.addr-wrap textarea:placeholder-shown { word-break: normal; }
.addr-wrap textarea:focus-visible { outline: none; }
.paste-btn {
  flex: none; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; border-radius: 12px;
  background: var(--surface); color: var(--fg-1); font-size: 15px; font-weight: 600; transition: background 0.15s;
}
.paste-btn:hover { background: var(--field-hover); }

.field-msg { display: flex; align-items: flex-start; gap: 8px; padding: 0 4px; font-size: 13.5px; line-height: 1.45; color: var(--err); }
.field-msg svg { margin-top: 2px; }
.field-msg.is-ok { color: var(--fg-3); }
.field-msg.is-ok svg { color: var(--ok); }

/* Gas top-up */
.gas-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 8px 10px 14px; border: 1px solid var(--line); border-radius: 16px; }
.gas-ico { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.gas-text { flex: 1 1 auto; min-width: 0; font-size: 15px; }
.gas-title { font-weight: 600; }
.gas-hint { display: none; color: var(--fg-3); }
.switch { flex: none; position: relative; width: 46px; height: 26px; border-radius: 999px; background: var(--toggle-off); transition: background 0.2s var(--ease); }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); transition: transform 0.22s var(--ease); }
.switch[aria-checked="true"] { background: var(--brand); }
.switch[aria-checked="true"] .switch-knob { transform: translateX(20px); }

.btn-cta { width: 100%; height: 56px; border-radius: 16px; font-size: 17px; font-weight: 600; gap: 10px; }
.submit-hint { margin-top: -6px; min-height: 18px; text-align: center; font-size: 13px; color: var(--fg-3); }
.submit-hint:empty { display: none; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 0 4px; font-size: 13px; line-height: 1.5; color: var(--fg-3); }
.note > svg { margin-top: 2px; }
.note a { color: var(--brand-text); font-weight: 600; text-underline-offset: 3px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 20px;
  border-radius: 12px; font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
  transition: background 0.15s, box-shadow 0.2s, transform 0.15s var(--ease), color 0.15s, opacity 0.15s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.45; }
.btn-ghost { border: 1px solid var(--line-2); color: var(--fg-1); background: transparent; }
.btn-ghost:hover { background: var(--field); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; gap: 8px; }
.btn-spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: spin 0.8s linear infinite; }
.btn.is-busy .btn-spinner { display: inline-block; }
.btn.is-busy .btn-arrow { display: none; }

.icon-btn {
  width: 32px; height: 32px; border-radius: 10px; display: inline-grid; place-items: center; flex: none;
  color: var(--fg-2); background: transparent; transition: color 0.15s, background 0.15s;
}
.icon-btn:hover { color: var(--fg-1); background: var(--field); }
.icon-btn-lg { width: 44px; height: 44px; border-radius: 12px; background: var(--field); }
.icon-btn .ic-done, .copy-btn .ic-done, .copy-btn .lbl-done { display: none; }
.is-copied .ic-copy, .copy-btn.is-copied .lbl-copy { display: none; }
.is-copied .ic-done, .copy-btn.is-copied .lbl-done { display: inline; }
.icon-btn.is-copied { color: #fff; background: var(--brand); }

.link-btn { font-size: 13px; font-weight: 600; color: var(--brand-text); text-decoration: underline; text-underline-offset: 3px; border-radius: 6px; }

.soft-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 12px;
  background: var(--brand-soft); color: var(--brand-text); font-size: 15px; font-weight: 600; text-decoration: none;
}
.soft-btn:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 40%, transparent); }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-title { font-size: 24px; line-height: 30px; font-weight: 700; }
.section-sub { margin-top: 8px; font-size: 15px; color: var(--fg-2); }

.how-list { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 14px; }
.how-item { display: flex; gap: 18px; padding: 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.how-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.how-num { display: block; font-size: 13px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.how-item h3 { margin: 4px 0 8px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.how-item p { font-size: 15px; color: var(--fg-2); }

.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
html[data-theme="dark"] .stats { background: var(--surface); }
.stats-grid { margin: 0 auto; padding-top: 40px; padding-bottom: 40px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; column-gap: 16px; }
.stat { display: flex; flex-direction: column-reverse; gap: 6px; }
.stat dt { font-size: 14px; color: var(--fg-2); }
.stat dd { margin: 0; font-size: 34px; line-height: 40px; font-weight: 700; letter-spacing: -0.02em; color: var(--brand); font-variant-numeric: tabular-nums; }
html[data-theme="dark"] .stat dd { color: var(--brand-hover); }

.faq-inner { display: grid; gap: 24px; }
.faq-intro .soft-btn { margin-top: 20px; }
.faq-list { display: grid; gap: 12px; }
.faq-item { border-radius: 16px; background: var(--surface); border: 1px solid var(--line); transition: border-color 0.15s; scroll-margin-top: 88px; }
.faq-item:hover { border-color: var(--line-2); }
.faq-item summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px; font-size: 16px; font-weight: 600; border-radius: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary svg { color: var(--fg-3); transition: transform 0.2s var(--ease); }
.faq-item[open] summary svg { transform: rotate(180deg); color: var(--fg-1); }
.faq-item p { padding: 0 18px 18px; font-size: 15px; line-height: 1.65; color: var(--fg-2); max-width: 72ch; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 28px; }
.ft-top { display: flex; flex-direction: column; gap: 28px; }
.ft-brand { max-width: 380px; }
.footer-logo { display: inline-flex; border-radius: 8px; }
.footer-logo img { height: 26px; width: auto; }
.ft-brand p { margin-top: 16px; font-size: 15px; color: var(--fg-2); }
.ft-cols { display: flex; flex-wrap: wrap; gap: 28px 64px; }
.ft-col { display: flex; flex-direction: column; gap: 12px; }
.ft-h { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-3); }
.ft-col a { font-size: 16px; color: var(--fg-1); text-decoration: none; border-radius: 6px; }
.ft-col a:hover { color: var(--brand-text); }
.tg-card { align-self: flex-start; display: flex; align-items: center; gap: 12px; padding: 12px 20px 12px 12px; border-radius: 16px; background: var(--brand-soft); text-decoration: none; color: var(--fg-1); }
.tg-card:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 40%, transparent); }
.tg-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand); color: #fff; }
.tg-text { display: flex; flex-direction: column; line-height: 1.3; }
.tg-text strong { font-size: 16px; font-weight: 600; }
.tg-text span { font-size: 13px; color: var(--fg-2); }
.ft-bottom { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.copyright { font-size: 14px; color: var(--fg-3); }
.ft-tools .theme-seg { display: flex; }
.ft-tools .tools-sep { display: block; }
.ft-tools .lang-full { display: inline; }

.coin-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px;
  min-height: 46px; max-width: 58%;
  padding: 5px 10px 5px 6px; border-radius: var(--radius);
  background: var(--chip-background); border: 1px solid var(--chip-border); color: var(--foreground);
  transition: background 0.15s, border-color 0.15s, transform 0.15s var(--ease);
}
.coin-btn:hover { background: var(--hover); border-color: var(--field-hover-border); }
.coin-btn:active { transform: scale(0.98); }
.coin-btn.is-empty { padding: 6px 14px; background: var(--primary); border-color: transparent; color: var(--primary-foreground); font-weight: 600; }
.coin-btn.is-empty:hover { background: var(--primary-hover); }
.coin-btn > svg { flex: 0 0 auto; color: var(--muted-foreground); }
.coin-btn.is-empty > svg { color: var(--primary-foreground); }
.coin-btn:disabled:not(.is-loading) { opacity: 0.45; }
.coin-btn.is-loading { pointer-events: none; padding-right: 14px; }
.coin-btn.is-loading .sk-c { width: 34px; height: 34px; border-radius: 50%; }
.coin-btn.is-loading .sk-t { width: 56px; height: 12px; border-radius: 6px; }
.coin-txt { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; line-height: 1.15; text-align: left; }
.coin-sym { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.coin-net { font-size: 11.5px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.coin-ico { position: relative; flex: 0 0 auto; width: 34px; height: 34px; }
.coin-ico .coin-logo, .coin-ico .coin-fallback { width: 34px; height: 34px; border-radius: 50%; }
.coin-logo { object-fit: cover; background: var(--muted); }
.coin-fallback {
  display: grid; place-items: center; background: var(--accent); color: var(--accent-foreground);
  font-weight: 700; font-size: 14px; text-transform: uppercase;
}
html[data-theme="dark"] .coin-fallback { background: var(--selected); color: #fff; }
.chain-badge {
  position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--badge-ring); background: var(--badge-ring); object-fit: cover;
}
.chain-badge.coin-fallback { font-size: 8px; display: grid; }


/* ---------- Picker dialog ---------- */
.picker {
  padding: 0; border: 0; margin: auto auto 0; width: 100%; max-width: 100%; max-height: 92vh; height: 92vh;
  border-radius: var(--card-radius) var(--card-radius) 0 0; color: var(--foreground);
  background: var(--popover); border-top: 1px solid var(--card-border);
  -webkit-backdrop-filter: blur(14px) saturate(130%); backdrop-filter: blur(14px) saturate(130%);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.25);
}
.picker::backdrop { background: var(--overlay); }
.picker[open] { animation: sheet-in 0.28s var(--ease); }
.picker-inner { height: 100%; display: flex; flex-direction: column; padding: 18px 16px 0; }
.picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.picker-title { font-size: 20px; }
.picker-search {
  display: flex; align-items: center; gap: 10px; padding: 0 14px; height: var(--control-height); flex: 0 0 auto;
  border-radius: var(--field-radius); background: var(--input-background); border: 1px solid var(--input);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.picker-search:hover { border-color: var(--field-hover-border); }
.picker-search:focus-within { border-color: var(--focus-border); box-shadow: var(--focus-glow); }
.picker-search svg { color: var(--muted-foreground); flex: 0 0 auto; }
.picker-search input { flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; font-size: 16px; color: var(--foreground); }
.picker-search input:focus-visible { outline: none; }
.picker-search input::placeholder { color: var(--placeholder); }
html[data-theme="dark"] .picker-search input::-webkit-search-cancel-button { filter: invert(1); opacity: 0.6; }

/* Two columns from 900 px (networks | coins). Below that the columns dissolve into one flow:
   coin search, a horizontal strip of networks, the note, the list. */
.picker-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.picker-chains, .picker-coins { display: contents; }
.picker-coins > .picker-search { order: 1; }
.chain-list { order: 2; }
.picker-note { order: 3; }
.picker-list-wrap { order: 4; }
.chain-search, .chain-empty { display: none; }
.chain-list {
  display: flex; gap: 8px; overflow-x: auto; padding: 14px 16px 4px; margin: 0 -16px;
  scrollbar-width: none; flex: 0 0 auto;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 40px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 40px), transparent 100%);
}
.chain-list::-webkit-scrollbar { display: none; }
.chain-list::after { content: ""; flex: 0 0 24px; }
.chain-item {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 8px;
  border-radius: var(--radius); background: var(--chip-background); border: 1px solid var(--chip-border);
  font-size: 13px; font-weight: 500; color: var(--foreground); white-space: nowrap; text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.chain-item:hover { background: var(--hover); }
.chain-item[aria-pressed="true"] { background: var(--primary); border-color: transparent; color: var(--primary-foreground); }
.chain-item img, .chain-item .coin-fallback { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; font-size: 10px; }
.chain-item-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chain-all-ico {
  flex: 0 0 auto; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px;
  background: linear-gradient(135deg, #6DA8FF, #286CF7); color: #fff; font-size: 7.5px; font-weight: 700; letter-spacing: 0.02em;
}
.chain-empty { font-size: 13px; color: var(--muted-foreground); padding: 12px 10px; }
.picker-note { font-size: 12px; color: var(--muted-foreground); margin: 8px 4px 0; }
.picker-list-wrap { flex: 1 1 auto; overflow-y: auto; margin: 10px -16px 0; padding: 0 8px 24px; overscroll-behavior: contain; }
.picker-list-title { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-foreground); padding: 8px 10px 6px; }
.coin-list { list-style: none; margin: 0; padding: 0; }
.coin-row {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--radius); text-align: left;
  color: var(--foreground); transition: background 0.12s;
}
.coin-row:hover, .coin-row:focus-visible { background: var(--hover); }
.coin-row:focus-visible { outline-offset: -2px; }
.coin-row[aria-current="true"] { background: var(--selected); }
.coin-row .coin-ico, .coin-row .coin-ico .coin-logo, .coin-row .coin-ico .coin-fallback { width: 38px; height: 38px; }
.coin-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.coin-row-sym { font-weight: 600; font-size: 15px; }
.coin-row-name { margin-top: 2px; font-size: 13px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coin-row-check { flex: 0 0 auto; width: 18px; height: 18px; }
.picker-state { padding: 32px 16px; text-align: center; color: var(--muted-foreground); display: grid; gap: 14px; justify-items: center; }
.sk-row { display: flex; align-items: center; gap: 12px; padding: 10px; }
.sk-row .sk-c { width: 38px; height: 38px; border-radius: 50%; }
.sk-row .sk-t { height: 12px; border-radius: 6px; }


@media (min-width: 600px) {
  .picker {
    margin: auto; width: min(520px, calc(100% - 48px)); height: min(720px, calc(100vh - 64px)); max-height: none;
    border-radius: var(--card-radius); border: 1px solid var(--card-border);
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.35);
  }
  html[data-theme="dark"] .picker { background: var(--surface); }
  .picker[open] { animation: pop-in 0.22s var(--ease); }
  .picker-inner { padding: 22px 20px 0; }
  .chain-list { margin: 0 -20px; padding-left: 20px; padding-right: 20px; }
  .picker-list-wrap { margin: 10px -20px 0; padding: 0 12px 20px; }
}

/* ---------- Picker: two columns (networks | coins) ---------- */
@media (min-width: 900px) {
  .picker { width: min(1040px, calc(100% - 48px)); height: min(760px, calc(100vh - 64px)); }
  .picker-inner { padding: 0; }
  .picker-head { margin: 0; padding: 20px 20px 18px 28px; border-bottom: 1px solid var(--border); }
  .picker-title { font-size: 24px; }
  .picker-body { display: grid; grid-template-columns: 300px minmax(0, 1fr); }
  .picker-chains, .picker-coins { display: flex; flex-direction: column; min-height: 0; }
  .picker-chains { padding: 18px 14px 0; border-right: 1px solid var(--border); }
  .picker-coins { padding: 18px 20px 0; }
  .chain-search { display: flex; margin: 0 4px 10px; }
  .chain-empty { display: block; }
  .chain-list {
    flex: 1 1 auto; flex-direction: column; gap: 2px; overflow-x: hidden; overflow-y: auto;
    margin: 0 -6px; padding: 0 6px 18px; overscroll-behavior: contain;
    -webkit-mask-image: none; mask-image: none; scrollbar-width: thin;
  }
  .chain-list::after { display: none; }
  .chain-item {
    width: 100%; height: 48px; gap: 12px; padding: 0 12px; border: 0; background: transparent;
    font-size: 15px; font-weight: 500;
  }
  .chain-item img, .chain-item .coin-fallback, .chain-item .chain-all-ico { width: 28px; height: 28px; }
  .chain-item .chain-all-ico { border-radius: 8px; font-size: 9px; }
  .chain-item[aria-pressed="true"] {
    background: var(--selected); color: var(--foreground); box-shadow: inset 3px 0 0 var(--primary);
  }
  .picker-list-wrap { margin: 10px -20px 0; padding: 0 12px 20px; }
  .coin-row { padding: 12px; gap: 14px; }
  .coin-row .coin-ico, .coin-row .coin-ico .coin-logo, .coin-row .coin-ico .coin-fallback { width: 44px; height: 44px; }
  .coin-row-sym { font-size: 16px; }
  .coin-row-name { font-size: 14px; }
}


/* Coin chip in the form, per the mockup */
.leg .coin-btn { min-height: 46px; gap: 7px; padding: 0 8px 0 6px; border-radius: 14px; background: var(--surface); border-color: var(--line-2); }
.leg .coin-btn:hover { background: var(--surface); border-color: var(--field-hover-border); }
.leg .coin-btn.is-empty { background: var(--brand); border-color: transparent; padding: 0 14px; }
.leg .coin-sym { font-size: 16px; font-weight: 700; }
.leg .coin-net { font-size: 12px; color: var(--fg-3); }

/* ---------- Skeleton ---------- */
.sk, .sk-c, .sk-t {
  background: linear-gradient(90deg, var(--skeleton-a), var(--skeleton-b), var(--skeleton-a));
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
}

/* ---------- Order view ---------- */
.order-view { padding: 20px 0 56px; }
.order-wrap { max-width: 1008px; display: flex; flex-direction: column; gap: 16px; }
.order-wrap:focus { outline: none; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow-soft); }

.order-head { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.order-head-main { min-width: 0; }
.order-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.order-title { font-size: 24px; line-height: 1.2; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; background: var(--brand-soft); color: var(--brand-text); white-space: nowrap;
}
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill[data-tone="active"] .pill-dot { animation: blink 1.6s ease-in-out infinite; }
.status-pill[data-tone="done"] { background: var(--ok-soft); color: var(--ok); }
.status-pill[data-tone="refund"] { background: var(--warn-soft); color: var(--warn); }
.status-pill[data-tone="bad"] { background: var(--err-soft); color: var(--err); }
.order-id { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.order-id-label { font-size: 15px; color: var(--fg-3); }
.order-id code { font-size: 16px; font-weight: 600; padding: 7px 14px; border-radius: 10px; background: var(--field); color: var(--fg-1); }

.timer-card { width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-radius: 16px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.timer-ring { transform: rotate(-90deg); }
.timer-ring circle { fill: none; stroke-width: 3; }
.timer-ring .ring-fg { stroke-dasharray: 106.8; transition: stroke-dashoffset 1s linear; }
.timer-card[data-tone="active"] .timer-ring { animation: spin 1.4s linear infinite; }
.timer-card[data-tone="active"] .ring-fg { stroke-dashoffset: 75; transition: none; }
.timer-card[data-tone="done"] .ring-fg { stroke: var(--ok); }
.timer-card[data-tone="refund"] .ring-fg { stroke: var(--warn); }
.timer-card[data-tone="bad"] .ring-fg { stroke: var(--err); }
.timer-label { font-size: 13px; color: var(--fg-3); }
.timer-value { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }

.order-skeleton .sk-card { display: grid; gap: 18px; }
.sk-qr { width: 200px; height: 200px; border-radius: 20px; margin: 0 auto; }
.sk-col { display: grid; gap: 12px; }
.sk-line { height: 14px; border-radius: 7px; }
.sk-line.w60 { width: 60%; } .sk-line.w90 { width: 90%; } .sk-line.w40 { width: 40%; }
.sk-block { height: 64px; border-radius: 16px; }
.conn-lost { font-size: 13px; color: var(--fg-3); text-align: center; }

.order-empty { padding: 40px 20px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.empty-ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--err-soft); color: var(--err); }
.order-empty h2 { font-size: 22px; }
.order-empty .btn { margin-top: 10px; }

.order-body { display: flex; flex-direction: column; gap: 16px; }
.pay-grid { display: flex; flex-direction: column; gap: 24px; }
.pay-qr { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.qr-tile { width: 232px; height: 232px; padding: 16px; border-radius: 20px; background: #fff; display: grid; place-items: center; position: relative; }
.qr-tile > img, .qr-tile > canvas { width: 200px !important; height: 200px !important; image-rendering: pixelated; }
.qr-logo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 12px; background: #fff; display: grid; place-items: center; }
.qr-logo img { width: 34px; height: 34px; border-radius: 9px; display: block; }
.qr-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 13px; background: var(--field); width: 216px; }
.qr-btn { min-height: 38px; padding: 0 10px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--fg-2); white-space: nowrap; }
.qr-btn:hover { color: var(--fg-1); }
.qr-btn[aria-checked="true"] { background: var(--pressed); color: var(--fg-1); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16); }
.qr-hint { width: 240px; font-size: 13px; line-height: 1.45; text-align: center; color: var(--fg-3); }

.pay-info { min-width: 0; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-3); }
.eyebrow-gap { margin-top: 24px; }
.pay-amount-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.pay-amount { font-size: 32px; line-height: 40px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pay-net {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 5px 14px 5px 5px; border-radius: 999px;
  background: var(--field); font-size: 14px; font-weight: 600;
}
.pay-net:not(:has(img, .coin-fallback)) { padding-left: 14px; }
.pay-net img, .pay-net .coin-fallback { width: 24px; height: 24px; border-radius: 50%; font-size: 10px; }
.deposit-box { margin-top: 10px; display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 16px; background: var(--field); }
.deposit-addr { font-size: 15px; line-height: 1.5; word-break: break-all; user-select: all; color: var(--fg-1); }
.copy-btn { min-height: 48px; padding: 0 20px; }
.auto-refresh { margin-top: 18px; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--fg-2); }
.live-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent); animation: blink 1.6s ease-in-out infinite; }

.pay-warn { margin-top: 24px; padding: 16px; border-radius: 16px; }
.notice-strong { font-size: 15px; font-weight: 600; line-height: 1.45; }
.notice-sub { margin-top: 4px; font-size: 14px; line-height: 1.5; color: var(--fg-2); }

.status-box { display: flex; gap: 18px; align-items: flex-start; }
.status-icon { flex: none; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.status-icon .spin { width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--brand) 30%, transparent); border-top-color: var(--brand); animation: spin 0.9s linear infinite; }
.status-box[data-tone="done"] .status-icon { background: var(--ok-soft); color: var(--ok); }
.status-box[data-tone="refund"] .status-icon { background: var(--warn-soft); color: var(--warn); }
.status-box[data-tone="bad"] .status-icon { background: var(--err-soft); color: var(--err); }
.status-text { min-width: 0; }
.status-title { font-size: 20px; font-weight: 700; line-height: 1.3; }
.status-desc { margin-top: 6px; font-size: 15px; line-height: 1.55; color: var(--fg-2); }
.status-links { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; }
.status-links a { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; background: var(--field); color: var(--fg-1); font-size: 15px; font-weight: 600; text-decoration: none; }
.status-links a:hover { background: var(--field-hover); }
.status-actions { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }

.order-lower { display: grid; gap: 16px; align-items: start; }
.card-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 18px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; }
.step { position: relative; display: flex; gap: 16px; padding-bottom: 22px; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ""; position: absolute; left: 19px; top: 46px; bottom: 4px; width: 2px; border-radius: 2px; background: var(--line-2); }
.step:last-child::before { display: none; }
.step[data-state="done"]::before { background: var(--brand); }
.step-dot {
  position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--field); font-weight: 600; font-size: 15px; color: var(--fg-3);
}
.step-dot::after { content: attr(data-n); }
.step[data-state="done"] .step-dot { background: var(--brand); color: #fff; }
.step[data-state="active"] .step-dot { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand), 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.step[data-state="active"] .step-dot::after {
  content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--brand) 30%, transparent);
  border-top-color: var(--brand-text); animation: spin 0.9s linear infinite;
}
.step[data-state="failed"] .step-dot { background: var(--err-soft); color: var(--err); }
.step[data-state="done"] .step-dot::after, .step[data-state="failed"] .step-dot::after { content: none; }
.step-body { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; min-width: 0; }
.step-title { font-size: 16px; font-weight: 600; }
.step[data-state="pending"] .step-title { color: var(--fg-2); }
.step-state { font-size: 14px; color: var(--fg-3); }
.step[data-state="active"] .step-state { color: var(--brand-text); font-weight: 500; }
.step[data-state="failed"] .step-state { color: var(--err); }
.step-links { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.step-links:empty { display: none; }
.step-links a { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--brand-text); text-decoration: none; border-radius: 6px; }
.step-links a:hover { text-decoration: underline; }
.tx-hash { font-size: 13px; white-space: nowrap; }

.summary { margin: 0; display: grid; }
.sum-row { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; border-top: 1px solid var(--line); }
.sum-row dt { font-size: 15px; color: var(--fg-2); white-space: nowrap; }
.sum-row dd { margin: 0; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.sum-addr { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.sum-addr code { font-size: 14px; font-weight: 500; word-break: break-all; }
.sum-addr .link-btn { text-decoration: none; font-size: 14px; }

.order-actions { display: flex; flex-direction: column-reverse; align-items: stretch; gap: 16px; padding-top: 4px; }
.btn-new { min-height: 50px; padding: 0 24px; border-radius: 14px; font-size: 16px; }
.btn-new.is-primary { background: var(--brand); border-color: transparent; color: #fff; }
.btn-new.is-primary:hover { background: var(--brand-hover); }
.help-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; color: var(--fg-2); }
.help-line > svg { color: var(--brand-text); }
.help-link { color: var(--brand-text); font-weight: 600; text-decoration: none; }
.help-link:hover { text-decoration: underline; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 100;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px;
  background: var(--fg-1); color: var(--page); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  font-size: 14px; font-weight: 500; text-align: center; transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
html[data-theme="dark"] .toast { background: var(--surface-2); color: #fff; border: 1px solid var(--line-2); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.noscript { padding: 24px; text-align: center; }

/* ---------- Animations ---------- */
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0.45; } }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop-in { from { transform: translateY(12px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
html.is-ready .hero-inner > * { animation: rise 0.5s var(--ease) both; }
html.is-ready .hero-inner > :nth-child(2) { animation-delay: 0.04s; }
html.is-ready .hero-inner > :nth-child(3) { animation-delay: 0.08s; }

/* ---------- From 600 px ---------- */
@media (min-width: 600px) {
  :root { --gutter: 24px; }
  .hero-title { font-size: 36px; line-height: 44px; }
  .perks { font-size: 16px; gap: 8px 24px; }
  .hero-inner { padding-top: 48px; padding-bottom: 80px; gap: 24px; }
  .card { padding: 24px; border-radius: 24px; }
  .order-head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .timer-card { width: auto; }
  .order-title { font-size: 32px; }
  .pay-grid { flex-direction: row; align-items: center; }
  .deposit-box { flex-direction: row; align-items: center; padding: 10px 10px 10px 20px; }
  .deposit-addr { flex: 1 1 auto; min-width: 0; font-size: 16px; }
  .pay-amount { font-size: 40px; line-height: 48px; }
  .order-actions { flex-direction: row; align-items: center; justify-content: space-between; }
  .sum-row { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 20px; }
  .sum-row dd { text-align: right; }
  .sum-addr { align-items: flex-end; }
  .ft-bottom { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ---------- Header, form and sections from 720 px ---------- */
@media (min-width: 720px) {
  .header-inner { height: 72px; padding-left: 32px; padding-right: 32px; }
  .logo img { height: 30px; }
  .header-nav { display: block; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
  .header-tools { gap: 12px; }
  .theme-seg, .tools-sep { display: flex; }
  .tools-sep { display: block; }
  .theme-cycle, .lang-short { display: none !important; }
  .lang-full { display: inline; }
  .lang-toggle { padding: 0 12px 0 14px; gap: 8px; border-radius: 13px; }

  .swap-card { padding: 28px; border-radius: 20px; gap: 20px; }
  .sf-row { flex-direction: row; align-items: stretch; gap: 12px; }
  .flip-wrap { width: 12px; height: auto; }
  .flip-btn { top: 46px; transform: translateX(-50%); }
  .flip-btn svg { transform: none; }
  .flip-btn:hover:not(:disabled) svg { transform: rotate(180deg); }
  .leg { padding: 18px 16px 18px 22px; }
  .amount-input, .amount-out { font-size: 34px; line-height: 44px; }
  .leg .coin-btn { min-height: 54px; gap: 10px; padding: 0 12px 0 9px; }
  .rate-opt { padding: 14px 18px; }
  .opt-head { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 16px; }
  .opt-desc { display: block; }
  .help-btn { width: 48px; }
  .rateline { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
  .addr-wrap { padding-left: 20px; }
  .addr-wrap textarea { font-size: 16px; }
  .gas-hint { display: inline; }
  .btn-cta { height: 60px; font-size: 18px; }
}

/* ---------- From 900 px ---------- */
@media (min-width: 900px) {
  .hero-title { font-size: 46px; line-height: 54px; }
  .hero-inner { padding-top: 64px; padding-bottom: 104px; }
  .section { padding: 96px 0; }
  .section .container, .stats-grid { padding-left: 40px; padding-right: 40px; }
  .section-title { font-size: 34px; line-height: 40px; }
  .section-sub { font-size: 16px; }
  .how-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 40px; }
  .how-item { flex-direction: column; gap: 24px; padding: 28px; }
  .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); padding-top: 56px; padding-bottom: 56px; }
  .stat { padding-left: 28px; border-left: 1px solid var(--line-2); }
  .stat:first-child { padding-left: 0; border-left: 0; }
  .stat dd { font-size: 44px; line-height: 52px; }
  .stat dt { font-size: 15px; }
  .faq-inner { grid-template-columns: 340px minmax(0, 1fr); gap: 64px; align-items: start; }
  .faq-item summary { padding: 20px 22px; font-size: 17px; }
  .faq-item p { padding: 0 22px 22px; }
  .site-footer { padding: 56px 0 32px; }
  .site-footer .container { padding-left: 32px; padding-right: 32px; }
  .ft-top { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 40px; }
  .ft-bottom { margin-top: 48px; }
}

/* ---------- Order page from 1000 px ---------- */
@media (min-width: 1000px) {
  .order-view { padding: 48px 0 72px; }
  .order-wrap { gap: 20px; }
  .order-body { gap: 20px; }
  .card { padding: 28px; }
  .order-title { font-size: 36px; }
  .pay-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; align-items: start; }
  .pay-amount { font-size: 44px; line-height: 52px; }
  .pay-warn { margin-top: 28px; padding: 16px 20px; }
  .status-icon { width: 56px; height: 56px; }
  .status-title { font-size: 24px; }
  .order-lower { grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr); gap: 20px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal { animation: reveal-fallback 0.01s linear 3s forwards !important; }
}
