/* Self-hosted from Google Fonts (SIL Open Font License 1.1). */
/* JetBrains Mono — cyrillic */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-cyrillic-4Nq3b98.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* JetBrains Mono — latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-l4pIovd.woff2") format('woff2');
  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;
}
/* Onest — cyrillic */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/onest-cyrillic-omZrnh8.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* Onest — latin */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/onest-latin-OX8m3S5.woff2") format('woff2');
  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;
}

/* BigRates — homepage prototype.
   Tokens first; components below map 1:1 to future Twig components. */

:root {
  --font: "Onest", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Type scale (rem, ~1.2 ratio) */
  --t-xs: 0.75rem;
  --t-sm: 0.8125rem;
  --t-base: 0.9375rem;
  --t-md: 1rem;
  --t-lg: 1.125rem;
  --t-xl: 1.375rem;
  --t-2xl: 1.75rem;
  --t-3xl: 2.25rem;

  /* Spacing (4px base) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px; --s-24: 96px;

  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 180ms;

  --header-h: 64px;
}

/* Light */
:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f3f5;
  --bg-2: #e9ebee;
  --surface: #ffffff;
  --knob: #ffffff;
  --field: #f4f5f7;
  --field-hover: #eceef1;
  --line: #e0e3e7;
  --line-strong: #c9ced5;
  --ink: #0f1216;
  --ink-2: #353d47;
  --muted: #5b6470;
  --logo: #dd4a0b;
  --accent: #c8430b;
  --accent-hover: #ad3908;
  --accent-press: #963107;
  --accent-ink: #ffffff;
  --accent-text: #b33b08;
  --accent-soft: #fdede4;
  --ok: #0d7a44;
  --ok-soft: #e3f4ea;
  --err: #b42318;
  --err-soft: #fdecea;
  --err-ink: #ffffff;
  --warn-ink: #6e4400;
  --warn-soft: #fff4d6;
  --warn-line: #f0d48a;
  --skeleton: #e6e8ec;
  --skeleton-hi: #f3f4f6;
  --shadow-card: 0 0 0 1px rgba(15, 18, 22, 0.05), 0 1px 2px rgba(15, 18, 22, 0.05), 0 8px 24px -10px rgba(15, 18, 22, 0.16);
  --shadow-pop: 0 2px 6px rgba(15, 18, 22, 0.06), 0 12px 24px -8px rgba(15, 18, 22, 0.24);
  --shadow-btn: 0 1px 2px rgba(15, 18, 22, 0.08);
  --backdrop: rgba(15, 18, 22, 0.42);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111112;
  --bg-2: #151516;
  --surface: #1a1a1b;
  --knob: #f3f3f3;
  --field: #212122;
  --field-hover: #29292b;
  --line: #2e2e30;
  --line-strong: #414144;
  --ink: #f3f3f3;
  --ink-2: #cbcbcd;
  --muted: #9e9ea3;
  --logo: #ff6a2b;
  --accent: #ff7433;
  --accent-hover: #ff8a52;
  --accent-press: #f0621f;
  --accent-ink: #1a0a02;
  --accent-text: #ff8a52;
  --accent-soft: #3a1d10;
  --ok: #4ccf8a;
  --ok-soft: #12291d;
  --err: #ff7b6e;
  --err-soft: #34160f;
  --err-ink: #1f0603;
  --warn-ink: #ffd27a;
  --warn-soft: #2c2210;
  --warn-line: #5c4717;
  --skeleton: #262628;
  --skeleton-hi: #303032;
  --shadow-card: 0 0 0 1px #2e2e30, 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 10px 24px -10px rgba(0, 0, 0, 0.7);
  --shadow-pop: 0 0 0 1px #343437, 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 14px 24px -8px rgba(0, 0, 0, 0.8);
  --shadow-btn: 0 1px 2px rgba(0, 0, 0, 0.4);
  --backdrop: rgba(0, 0, 0, 0.62);
}

/* Without JavaScript (the theme script sets data-theme) a dark system preference still gets the dark tokens. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #111112;
    --bg-2: #151516;
    --surface: #1a1a1b;
    --knob: #f3f3f3;
    --field: #212122;
    --field-hover: #29292b;
    --line: #2e2e30;
    --line-strong: #414144;
    --ink: #f3f3f3;
    --ink-2: #cbcbcd;
    --muted: #9e9ea3;
    --logo: #ff6a2b;
    --accent: #ff7433;
    --accent-hover: #ff8a52;
    --accent-press: #f0621f;
    --accent-ink: #1a0a02;
    --accent-text: #ff8a52;
    --accent-soft: #3a1d10;
    --ok: #4ccf8a;
    --ok-soft: #12291d;
    --err: #ff7b6e;
    --err-soft: #34160f;
    --err-ink: #1f0603;
    --warn-ink: #ffd27a;
    --warn-soft: #2c2210;
    --warn-line: #5c4717;
    --skeleton: #262628;
    --skeleton-hi: #303032;
    --shadow-card: 0 0 0 1px #2e2e30, 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 10px 24px -10px rgba(0, 0, 0, 0.7);
    --shadow-pop: 0 0 0 1px #343437, 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 14px 24px -8px rgba(0, 0, 0, 0.8);
    --shadow-btn: 0 1px 2px rgba(0, 0, 0, 0.4);
    --backdrop: rgba(0, 0, 0, 0.62);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  display: flex; flex-direction: column; min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  caret-color: var(--accent);
  scrollbar-color: var(--line-strong) var(--bg);
}
::selection { background: var(--accent-soft); color: var(--ink); }
.turbo-progress-bar { height: 2px; background: var(--accent-text); }
:root[data-theme="dark"] ::selection { background: var(--accent-soft); color: var(--ink); }
img, svg { display: block; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.mono { font-family: var(--mono); font-weight: 500; letter-spacing: 0; }
.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--s-4); }
@media (min-width: 640px) { .wrap { padding-inline: var(--s-8); } }

.skip {
  position: absolute; left: var(--s-4); top: -60px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: var(--s-2) var(--s-4);
  border-radius: var(--r-sm); text-decoration: none; font-weight: 600;
}
.skip:focus { top: var(--s-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: 40px; padding: 0 var(--s-4); border-radius: var(--r-md);
  font-size: var(--t-base); font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), transform 120ms var(--ease-out);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: var(--field); color: var(--ink); }
.btn-outline { border: 1px solid var(--line-strong); color: var(--ink); background: var(--surface); }
.btn-outline:hover { border-color: var(--ink-2); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-btn); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:active:not(:disabled) { background: var(--accent-press); }
.btn:disabled { cursor: not-allowed; }
.btn-primary:disabled { background: var(--field-hover); color: var(--muted); box-shadow: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-md);
  color: var(--ink-2); transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.icon-btn:hover { background: var(--field); color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }

.link-btn, .text-link {
  display: inline-flex; align-items: center; gap: 6px; color: var(--accent-text);
  font-weight: 600; font-size: var(--t-sm); text-decoration: none; border-radius: var(--r-xs);
}
.link-btn:hover, .text-link:hover { text-decoration: underline; }
.link-btn svg, .text-link svg { width: 16px; height: 16px; }
.text-link { font-size: var(--t-base); color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); }
.text-link:hover { text-decoration-color: var(--ink); }
.text-link svg { transition: transform var(--dur) var(--ease-out); }
.text-link:hover svg { transform: translateX(3px); }

/* Segmented control */
.seg {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-md);
  background: var(--field); border: 1px solid var(--line);
}
.seg button, .seg label, .seg a {
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 0 var(--s-3); border-radius: var(--r-sm);
  font-size: var(--t-sm); font-weight: 600; color: var(--muted); cursor: pointer;
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.seg button:hover, .seg label:hover, .seg a:hover { color: var(--ink); }
.seg button[aria-pressed="true"], .seg a[aria-current="true"], .seg label:has(input:checked) {
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-btn);
}
:root[data-theme="dark"] .seg button[aria-pressed="true"],
:root[data-theme="dark"] .seg a[aria-current="true"],
:root[data-theme="dark"] .seg label:has(input:checked) { background: var(--line-strong); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg svg { width: 16px; height: 16px; }
.seg-sm button, .seg-sm a { min-height: 30px; padding: 0 9px; }
.seg-full { display: flex; }
.seg-full label { min-height: 32px; }
.seg-full label { flex: 1; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease-out);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-row { display: flex; align-items: center; gap: var(--s-6); height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand-mark { width: 28px; height: 27px; color: var(--logo); }
.brand-word { font-weight: 700; font-size: 1.1875rem; letter-spacing: -0.02em; }

.main-nav { display: none; }
.main-nav ul { display: flex; gap: 2px; }
.main-nav a {
  display: block; padding: 8px 11px; border-radius: var(--r-sm); text-decoration: none;
  color: var(--ink-2); font-size: var(--t-base); font-weight: 500; white-space: nowrap;
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.main-nav a:hover { color: var(--ink); background: var(--field); }
.main-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

.header-tools { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }
.header-tools .theme-switch, .header-tools .lang-switch, .header-tools .auth { display: none; }

@media (min-width: 1180px) {
  .main-nav { display: block; }
  .header-tools .theme-switch, .header-tools .lang-switch, .header-tools .auth { display: inline-flex; }
  .menu-toggle { display: none; }
}

.mobile-menu { border-top: 1px solid var(--line); background: var(--bg); max-height: calc(100dvh - var(--header-h)); overflow-y: auto; }
.mobile-menu .wrap { padding-block: var(--s-3) var(--s-6); }
.mobile-menu nav a {
  display: block; padding: 12px 4px; font-size: var(--t-lg); font-weight: 500; text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.mobile-tools { display: grid; gap: var(--s-3); margin-top: var(--s-5); }
.mobile-tools .seg { display: flex; }
.mobile-tools .seg button, .mobile-tools .seg a { flex: 1; min-height: 40px; }
.mobile-auth { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.mobile-auth .btn { height: 44px; }
@media (min-width: 1180px) { .mobile-menu { display: none !important; } }

/* ---------- Exchange widget on top of the page ---------- */
/* No hero copy: the first screen is the widget itself, as wide as the page container. */
.hero { padding-block: var(--s-4) var(--s-8); }
@media (min-width: 960px) { .hero { padding-block: var(--s-8) var(--s-10); } }
.hero-title { margin-bottom: var(--s-4); font-size: var(--t-xl); font-weight: 700; line-height: 1.2; text-align: center; text-wrap: balance; }
@media (min-width: 960px) { .hero-title { margin-bottom: var(--s-5); font-size: var(--t-2xl); } }
.xcard-trust { margin: var(--s-4) auto 0; max-width: 56ch; text-align: center; text-wrap: balance; font-size: var(--t-base); color: var(--ink-2); }
.rate-type .seg label { min-height: 44px; }
.rate-type .seg label > span { display: grid; justify-items: center; gap: 1px; line-height: 1.2; }
.rate-type .seg small { font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- Exchange Card ---------- */
.xcard {
  background: var(--surface); border-radius: var(--r-xl);
  box-shadow: var(--shadow-card); padding: var(--s-4); width: 100%;
  display: flex; flex-direction: column;
}
@media (min-width: 480px) { .xcard { padding: var(--s-4) var(--s-5) var(--s-3); } }

.leg {
  background: var(--field); border: 1px solid transparent; border-radius: var(--r-lg);
  padding: 10px var(--s-4) 0;
  transition: border-color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
.leg:focus-within { border-color: var(--line-strong); }
/* the amount field has no outline of its own (it is borderless inside the leg): the leg carries its focus, like the search field */
.leg:has(.amount:focus-visible) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.leg.has-error { border-color: var(--err); }
.leg.has-error:has(.amount:focus-visible) { box-shadow: 0 0 0 3px var(--err-soft); }
.leg-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); }
.leg-label { font-size: var(--t-sm); font-weight: 600; color: var(--muted); }
.leg-limits { font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.leg-main { display: flex; align-items: center; gap: var(--s-3); padding: 2px 0 8px; min-height: 52px; }

.amount {
  flex: 1; min-width: 0; border: 0; background: transparent; padding: 0; outline: none;
  font-size: var(--t-2xl); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2;
  font-variant-numeric: tabular-nums; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
input.amount { align-self: stretch; } /* the typed field fills its row: a tap above or below the digits still lands in it */
.amount::placeholder { color: var(--muted); }
.amount-out { display: block; }
/* the amount you receive is never cut: it wraps (and narrows, below) instead of ending in "…" */
output.amount-out { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.field-error .field-fix { color: var(--accent-text); font-size: inherit; padding: 0; } /* "Use the minimum" after the reason */

.amount-out.is-approx::before { content: "≈ "; color: var(--muted); font-weight: 500; }
/* "≈" before a Floating amount to receive that the quote filled in; the gap of the row would set it too far from the digits */
.amount-approx { flex: none; color: var(--muted); font-weight: 500; margin-right: calc(0.25em - var(--s-3)); }
/* an amount the quote fills in, while the next quote is on its way */
.amount.is-pending { opacity: 0.45; transition: opacity var(--dur) var(--ease-out); }
.amount-out.is-empty { color: var(--muted); }

.asset-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 10px 0 6px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-btn);
  font-weight: 700; font-size: var(--t-md);
  transition: border-color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
.asset-btn:hover { border-color: var(--line-strong); }
:root[data-theme="dark"] .asset-btn { background: var(--field-hover); }
.asset-btn .chev { width: 18px; height: 18px; color: var(--muted); }

.net-row {
  display: flex; align-items: center; gap: 10px; width: calc(100% + 2 * var(--s-4)); margin-inline: calc(-1 * var(--s-4));
  padding: 8px var(--s-4); border-top: 1px solid var(--line); text-align: left;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  transition: background-color var(--dur) var(--ease-out);
}
.net-row:hover { background: var(--field-hover); }
.net-row:focus-visible { outline-offset: -2px; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.net-row .net-k { font-size: var(--t-sm); color: var(--muted); font-weight: 500; flex-shrink: 0; }
.net-row .net-v { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.net-row .net-name { font-weight: 600; font-size: var(--t-base); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net-row .net-meta { margin-left: auto; font-size: var(--t-xs); color: var(--muted); white-space: nowrap; }
.net-row .net-v:has(.flag) .net-meta { display: none; } /* the memo flag and the full network name matter more; the picker lists confirmations */
.net-row .flag { flex: none; }
.net-row .chev { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
@media (max-width: 400px) { .net-row .net-meta { display: none; } }
.net-row.is-missing .net-name { color: var(--accent-text); }
.net-row.is-missing { background: var(--accent-soft); }
.flag {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
  font-size: var(--t-xs); font-weight: 600; padding: 1px 7px; border-radius: var(--r-pill);
  color: var(--warn-ink); background: var(--warn-soft); border: 1px solid var(--warn-line);
}
.flag svg { width: 12px; height: 12px; }

.field-error {
  display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: baseline;
  color: var(--err); font-size: var(--t-sm); font-weight: 500;
  margin: 0 calc(-1 * var(--s-4)); padding: 8px var(--s-4) 10px; border-top: 1px solid var(--line);
}

.swap-wrap { position: relative; height: 14px; z-index: 1; }
.swap-btn {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-md);
  background: var(--surface); border: 4px solid var(--surface); color: var(--ink-2);
  box-shadow: 0 0 0 1px var(--line);
  transition: color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
.swap-btn:hover { color: var(--accent-text); background: var(--field); }
.swap-btn svg { width: 18px; height: 18px; transition: transform 320ms var(--ease-out); }
.swap-btn.spun svg { transform: rotate(180deg); }

/* Coin + network icons */
.coin {
  position: relative; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--field-hover); overflow: hidden;
}
.coin img { width: 100%; height: 100%; }
.coin .mono-fallback { font-size: var(--t-xs); font-weight: 700; color: var(--ink-2); letter-spacing: -0.02em; transform: scale(0.8); }
.coin-sm { width: 18px; height: 18px; }
.coin-sm .mono-fallback { transform: scale(0.5); }
.coin-lg { width: 36px; height: 36px; }

/* Rate type */
.rate-type { border: 0; margin: 10px 0 0; padding: 0; min-width: 0; }
.rate-hint { margin-top: 6px; padding-inline: var(--s-1); font-size: var(--t-xs); color: var(--muted); line-height: 1.45; }

/* Breakdown */
.breakdown { margin-top: var(--s-2); padding: 10px var(--s-1) var(--s-2); border-top: 1px solid var(--line); }
.quote-status { display: flex; align-items: center; flex-wrap: wrap; gap: 2px var(--s-5); min-height: 24px; margin-bottom: 4px; }
.quote-status .quote-eta { margin-left: auto; }
@media (max-width: 479px) { .breakdown .quote-status { min-height: 38px; align-content: flex-start; } }
.quote-rate { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.quote-status-text { font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 6px; }
.quote-status-text::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.quote-eta { font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.quote-eta b { color: var(--ink-2); font-weight: 600; }
.quote-status.is-expired .quote-status-text { color: var(--err); font-weight: 600; }
.quote-status.is-expired .quote-status-text::before { background: var(--err); }
.quote-status.is-loading .quote-status-text::before { background: var(--line-strong); }
.quote-status-text:empty::before { display: none; } /* no quote, no "live" dot */
.breakdown dl { margin: 0; display: grid; gap: 3px; }
.bd-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); font-size: var(--t-sm); }
.bd-row dt { color: var(--muted); }
.bd-row dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; color: var(--ink-2); }
.bd-total { margin-top: 3px; padding-top: 6px; border-top: 1px dashed var(--line-strong); }
.bd-total dt { color: var(--ink); font-weight: 600; font-size: var(--t-base); }
.bd-total dd { color: var(--ink); font-weight: 700; font-size: var(--t-base); }
.bd-eta dd small { color: var(--muted); font-weight: 400; font-size: var(--t-xs); margin-left: 4px; }
/* an expired quote stays readable (AA): muted and struck through, never faded below contrast */
.breakdown.is-stale dd { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--muted); }
.breakdown.is-stale .bd-eta dd { text-decoration: none; }

/* Value change: the signature interaction. Numbers settle in, never jump. */
.tick { animation: tick 260ms var(--ease-out); }
@keyframes tick {
  from { opacity: 0.25; transform: translateY(3px); filter: blur(1.5px); }
  to   { opacity: 1; transform: none; filter: none; }
}
dd.tick, .amount-out.tick { display: inline-block; }
.bd-row dd { display: inline-block; }

/* Skeleton */
.skel {
  display: inline-block; height: 0.9em; width: 7em; border-radius: var(--r-xs); vertical-align: middle;
  background: linear-gradient(90deg, var(--skeleton) 0%, var(--skeleton-hi) 50%, var(--skeleton) 100%);
  background-size: 200% 100%; animation: shimmer 1.1s linear infinite;
}
.amount-out .skel { height: 0.8em; width: 5.5em; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.btn-cta { width: 100%; height: 50px; margin-top: var(--s-1); border-radius: var(--r-lg); font-size: var(--t-lg); }
.btn-cta .spinner {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.cta-reason { margin-top: 6px; min-height: 1.4em; text-align: center; font-size: var(--t-sm); color: var(--muted); }
.cta-reason.is-blocking { color: var(--ink-2); font-weight: 500; }

/* From 960px the card is a wide panel: Send | swap | Receive in one row, the numbers as a strip, the choice of rate and the button last.
   Every rule is scoped to .xcard: the cabinet reuses .btn-cta, .cta-reason, .swap-btn and the like inside its own grids. */
@media (min-width: 960px) {
  .xcard {
    display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
    grid-template-areas: "send swap recv" "rate rate rate" "bd bd bd" "reason reason cta";
    row-gap: var(--s-5); padding: var(--s-6) var(--s-8) var(--s-6);
  }
  .xcard .leg-send { grid-area: send; }
  .xcard .leg-receive { grid-area: recv; }
  .xcard .swap-wrap { grid-area: swap; height: auto; align-self: center; display: grid; place-items: center; }
  .xcard .swap-wrap .swap-btn { position: static; translate: none; }
  .xcard .leg { padding-top: var(--s-3); }
  .xcard .leg-main { min-height: 64px; }
  .xcard .amount { font-size: var(--t-3xl); }
  .xcard .leg-limits, .xcard .quote-status-text, .xcard .quote-eta { font-size: var(--t-sm); }
  .xcard .rate-type { grid-area: rate; margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-3) var(--s-5); }
  .xcard .rate-type .seg { width: auto; min-width: 22rem; }
  .xcard .rate-type .rate-hint { margin: 0; padding: 0; flex: 1 1 18rem; font-size: var(--t-sm); }
  .xcard .breakdown { grid-area: bd; margin: 0; padding: var(--s-4) 0 0; }
  .xcard .breakdown dl { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4) var(--s-6); }
  .xcard .bd-row { flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 2px; }
  .xcard .bd-row dd { text-align: left; }
  .xcard .bd-total { margin: 0; padding: 0; border-top: 0; }
  .xcard .bd-total dd { font-size: var(--t-xl); letter-spacing: -0.02em; }
  .xcard .btn-cta { grid-area: cta; margin: 0; height: 56px; }
  .xcard .cta-reason { grid-area: reason; margin: 0; align-self: center; text-align: left; min-height: 0; }
}
@media (min-width: 1280px) { .xcard { grid-template-columns: minmax(0, 1fr) 80px minmax(0, 1fr); padding-inline: var(--s-10); } }

/* ---------- Sections ---------- */
.section { padding-block: var(--s-16); border-top: 1px solid var(--line); }
@media (min-width: 960px) { .section { padding-block: var(--s-16); } }
.section-head { display: grid; gap: var(--s-3); margin-bottom: var(--s-10); max-width: 640px; }
.section-head h2 { font-size: var(--t-2xl); line-height: 1.15; font-weight: 700; letter-spacing: -0.025em; text-wrap: balance; }
@media (min-width: 960px) { .section-head h2 { font-size: var(--t-3xl); } }
.section-head p { color: var(--ink-2); font-size: var(--t-md); max-width: 60ch; }
.section-head-row { max-width: none; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--s-4); }
.section-head-row > div { display: grid; gap: var(--s-3); max-width: 640px; }

/* How it works: a sequence, so numbers carry information */
.steps { display: grid; gap: var(--s-8); counter-reset: step; }
.steps li { position: relative; display: grid; grid-template-columns: 40px 1fr; column-gap: var(--s-4); row-gap: 4px; align-content: start; } /* a shorter step does not spread its rows, so all titles share one line */
.step-n {
  grid-row: span 2; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-variant-numeric: tabular-nums; background: var(--surface); border: 1px solid var(--line-strong);
  position: relative; z-index: 1;
}
.steps h3 { font-size: var(--t-lg); font-weight: 600; letter-spacing: -0.01em; padding-top: 8px; }
.steps p { color: var(--muted); max-width: 34ch; }
.steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 19.5px; top: 44px; bottom: calc(-1 * var(--s-8) + 4px); width: 1px; background: var(--line-strong);
}
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(4, 1fr); gap: var(--s-6); }
  .steps li { grid-template-columns: 1fr; row-gap: var(--s-2); }
  .step-n { grid-row: auto; margin-bottom: var(--s-2); }
  .steps h3 { padding-top: 0; }
  .steps li:not(:last-child)::after { left: 48px; right: calc(-1 * var(--s-6) + 8px); top: 20px; bottom: auto; width: auto; height: 1px; }
}

/* Network */
.net-grid { display: grid; gap: var(--s-10); align-items: center; }
.net-copy { display: grid; gap: var(--s-4); max-width: 520px; }
.net-copy h2 { font-size: var(--t-2xl); line-height: 1.15; font-weight: 700; letter-spacing: -0.025em; text-wrap: balance; }
@media (min-width: 960px) { .net-copy h2 { font-size: var(--t-3xl); } }
.net-copy p { color: var(--ink-2); max-width: 60ch; }
@media (min-width: 960px) { .net-grid { grid-template-columns: 1fr 1fr; gap: var(--s-16); } }

.net-demo {
  margin: 0; background: var(--surface); border-radius: var(--r-xl);
  box-shadow: var(--shadow-card); padding: var(--s-5); display: grid; gap: var(--s-5);
}
/* one coin, its real networks: a short list, the most used first */
.nl-head { display: flex; align-items: center; gap: var(--s-3); padding-bottom: var(--s-4); border-bottom: 1px solid var(--line); }
.nl-head b { font-size: var(--t-lg); }
.nl-count { margin-left: auto; font-size: var(--t-sm); color: var(--ink-2); }
.nl-list { list-style: none; margin: 0; padding: 0; display: grid; }
.nl-list li { display: flex; align-items: center; gap: var(--s-3); min-height: 44px; padding-block: 2px; border-bottom: 1px solid var(--line); }
.nl-list li:last-child { border-bottom: 0; }
.nl-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.nl-list .flag { margin-left: auto; }
.nl-more { font-size: var(--t-sm); color: var(--ink-2); }
.warn {
  display: grid; grid-template-columns: 22px 1fr; gap: var(--s-3); padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md); background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn-ink);
}
.warn svg { width: 20px; height: 20px; margin-top: 1px; }
.warn strong { display: block; font-weight: 700; }
.warn span { display: block; font-size: var(--t-sm); }

/* Popular pairs table */
.pairs-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pairs-table th {
  text-align: left; font-size: var(--t-xs); font-weight: 600; color: var(--muted);
  padding: 0 var(--s-4) var(--s-3); border-bottom: 1px solid var(--line-strong);
}
.pairs-table td { padding: var(--s-4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.pairs-table tbody tr { transition: background-color var(--dur) var(--ease-out); }
.pairs-table tbody tr:hover { background: var(--surface); }
.pairs-table .num { text-align: right; white-space: nowrap; }
.pairs-table td:last-child { text-align: right; width: 1%; white-space: nowrap; }
.pair { display: grid; grid-template-columns: minmax(0, 12rem) 16px minmax(0, 12rem); align-items: center; gap: var(--s-3); } /* both sides have a fixed width, so the second coin starts at the same place in every row */
a.pair { color: inherit; text-decoration: none; }
a.pair:hover .pair-side b { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.pair-side { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pair-side b { display: block; font-weight: 700; line-height: 1.2; }
.pair-side > span:last-child { min-width: 0; }
.pair-side small { display: block; font-size: var(--t-xs); color: var(--muted); font-weight: 500; white-space: nowrap; }
.pair-arrow { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.rate-cell { font-weight: 600; }
.pairs-table .btn { height: 36px; font-size: var(--t-sm); }

@media (max-width: 759px) {
  .pairs-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .pairs-table, .pairs-table tbody { display: block; }
  .pairs-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px var(--s-3); /* minmax: a long rate line wraps instead of widening the page at 320px */
    padding: var(--s-4) 0; border-bottom: 1px solid var(--line);
  }
  .pairs-table td { display: block; padding: 0; border: 0; }
  .pairs-table td:first-child { grid-column: 1 / -1; }
  .pairs-table td.num { text-align: left; font-size: var(--t-sm); color: var(--muted); white-space: normal; overflow-wrap: anywhere; }
  .pairs-table td.num[data-label]::before { content: attr(data-label) " · "; }
  .pairs-table td.rate-cell { color: var(--ink); font-size: var(--t-base); }
  .pairs-table td.rate-cell::before { content: none !important; }
  .pair { grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr); }
  .pair-side small { white-space: normal; }
  .pairs-table td:last-child { grid-column: 2; grid-row: 2 / span 3; align-self: center; }
  .pairs-table tbody tr:hover { background: transparent; }
}

/* FAQ */
.faq-grid { display: grid; gap: var(--s-8); }
@media (min-width: 960px) { .faq-grid { grid-template-columns: 5fr 7fr; gap: var(--s-16); align-items: start; } .faq-grid .section-head { position: sticky; top: calc(var(--header-h) + 32px); } }
.faq-list { border-top: 1px solid var(--line-strong); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--s-4);
  padding: var(--s-5) 0; font-weight: 600; font-size: var(--t-lg); letter-spacing: -0.01em;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: ""; flex-shrink: 0; width: 10px; height: 10px; margin-right: 6px;
  border-right: 1.75px solid var(--muted); border-bottom: 1.75px solid var(--muted);
  transform: rotate(45deg) translateY(-3px); transition: transform var(--dur) var(--ease-out);
}
.faq-list details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.faq-list summary:hover { color: var(--accent-text); }
.faq-list details p { padding-bottom: var(--s-5); color: var(--ink-2); max-width: 62ch; }

/* ---------- Footer ---------- */
.site-footer { margin-top: auto; background: var(--bg-2); border-top: 1px solid var(--line); padding-top: var(--s-16); }
.footer-grid { display: grid; gap: var(--s-8); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.footer-col a { overflow-wrap: break-word; }
.footer-brand { grid-column: 1 / -1; display: grid; gap: var(--s-3); align-content: start; }
.footer-brand p { color: var(--muted); max-width: 32ch; }
.footer-col h2 { font-size: var(--t-sm); font-weight: 600; color: var(--muted); margin-bottom: var(--s-3); }
.footer-col ul { display: grid; gap: var(--s-2); }
.footer-col a { text-decoration: none; color: var(--ink-2); }
.footer-col a:hover { color: var(--ink); text-decoration: underline; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 960px) { .footer-grid { grid-template-columns: 2fr repeat(4, minmax(0, 1fr)); } .footer-brand { grid-column: auto; } }
.footer-base {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2) var(--s-6);
  margin-top: var(--s-12); padding-block: var(--s-6); border-top: 1px solid var(--line);
  font-size: var(--t-sm); color: var(--muted);
}

/* ---------- Picker dialog ---------- */
.picker {
  width: min(440px, calc(100vw - 32px)); max-height: min(640px, calc(100dvh - 64px));
  padding: 0; border: 0; border-radius: var(--r-xl);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop);
  display: none; flex-direction: column; overflow: hidden;
}
.picker[open] { display: flex; animation: pop-in 220ms var(--ease-out); }
.picker::backdrop { background: var(--backdrop); animation: fade-in 220ms var(--ease-out); }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.picker-head { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-3) var(--s-2) var(--s-5); }
.picker-head h2 { font-size: var(--t-lg); font-weight: 700; flex: 1; }
#picker-back:not([hidden]) + h2 { margin-left: -8px; }
.picker-head:has(#picker-back:not([hidden])) { padding-left: var(--s-2); }
.picker-search { position: relative; margin: 0 var(--s-4) var(--s-2); }
.picker-search svg { position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.picker-search input {
  width: 100%; height: 46px; padding: 0 var(--s-4) 0 42px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--field); font-size: var(--t-md); outline: none;
}
.picker-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.picker-search input::placeholder { color: var(--muted); }
/* the browser's own clear button is blue in Chromium; this one is drawn in the muted ink */
.picker-search input::-webkit-search-cancel-button {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px; cursor: pointer; background: var(--muted);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* "Popular" / "All coins" above the rows of the coin pickers */
.picker-group { padding: var(--s-3) var(--s-3) var(--s-1); font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
.picker-group:first-child { padding-top: var(--s-1); }
.picker-hint {
  display: grid; grid-template-columns: 18px 1fr; gap: 8px; margin: 0 var(--s-4) var(--s-2);
  padding: var(--s-3); border-radius: var(--r-md); background: var(--warn-soft); border: 1px solid var(--warn-line);
  color: var(--warn-ink); font-size: var(--t-sm);
}
.picker-hint svg { width: 18px; height: 18px; }
.picker-list { overflow-y: auto; padding: var(--s-1) var(--s-2) var(--s-3); overscroll-behavior: contain; scrollbar-width: thin; }
.picker-empty { padding: var(--s-8) var(--s-5); text-align: center; color: var(--muted); }

.pick {
  width: 100%; display: flex; align-items: center; gap: var(--s-3); padding: 10px var(--s-3);
  border-radius: var(--r-md); text-align: left; transition: background-color var(--dur) var(--ease-out);
}
.pick:hover:not(:disabled) { background: var(--field); }
.pick:disabled { cursor: not-allowed; }
.pick:disabled .pick-main { opacity: 0.55; }
.pick[aria-current="true"] { background: var(--accent-soft); }
.pick-main { flex: 1; min-width: 0; }
.pick-title { display: flex; align-items: baseline; gap: 8px; }
.pick-title b { font-weight: 700; }
.pick-title span { color: var(--muted); font-size: var(--t-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-sub { display: block; font-size: var(--t-xs); color: var(--muted); margin-top: 2px; }
.pick-end { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pick-end .check { width: 18px; height: 18px; color: var(--accent-text); }
.pick-end .chev { width: 18px; height: 18px; color: var(--muted); transform: rotate(-90deg); }
.pick .state { font-size: var(--t-xs); font-weight: 600; color: var(--muted); border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 1px 7px; display: inline-flex; align-items: center; gap: 4px; }
.pick .state svg { width: 12px; height: 12px; }

@media (max-width: 639px) {
  .picker {
    width: 100vw; max-width: 100vw; max-height: calc(100dvh - 48px); height: calc(100dvh - 48px);
    margin: auto 0 0; border-radius: var(--r-xl) var(--r-xl) 0 0; border-bottom: 0;
  }
  .picker[open] { animation: sheet-in 260ms var(--ease-out); }
  @keyframes sheet-in { from { transform: translateY(24%); opacity: 0.4; } to { transform: none; opacity: 1; } }
  .pick { padding-block: 12px; }
}

/* ======================================================================
   Exchange flow (exchange-new.html, exchange.html)
   Same world as the homepage: neutral panels, one accent on the primary action.
   ====================================================================== */
.flow { padding-block: var(--s-6) var(--s-16); }
.site-footer-slim { padding-top: 0; }
.site-footer-slim .footer-base { margin-top: 0; border-top: 0; }

.btn-lg { height: 52px; padding: 0 var(--s-6); border-radius: var(--r-lg); font-size: var(--t-md); }
.btn-sm { height: 32px; padding: 0 var(--s-3); font-size: var(--t-sm); border-radius: var(--r-sm); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary .spinner {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 700ms linear infinite;
}

/* Stepper: numbers carry the sequence */
.steps-bar { margin-bottom: var(--s-6); }
.steps-bar ol { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); counter-reset: none; }
.steps-bar li, .steps-bar a {
  display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-sm); font-weight: 600; color: var(--muted); text-decoration: none;
}
.steps-bar a:hover { color: var(--ink); }
.sb-n {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--line-strong); font-size: var(--t-xs); font-variant-numeric: tabular-nums; background: var(--surface);
}
.sb-n svg { width: 14px; height: 14px; }
.steps-bar li.is-done .sb-n { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.steps-bar li.is-current { color: var(--ink); }
.steps-bar li.is-current .sb-n { background: var(--ink); border-color: var(--ink); color: var(--bg); }
/* phones: the four steps stay on one line; only the current one is named, the others keep their mark (and their
   name for screen readers) */
@media (max-width: 479px) {
  .steps-bar ol { gap: var(--s-3); }
  .steps-bar li:not(.is-current) .sb-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

.flow-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); align-items: start; }
@media (min-width: 960px) {
  .flow-grid { grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s-8); }
  .flow-side { position: sticky; top: calc(var(--header-h) + var(--s-4)); display: grid; gap: var(--s-5); }
}
@media (max-width: 959px) { .flow-side { display: grid; gap: var(--s-4); } }

.panel { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-card); padding: var(--s-5); }
@media (min-width: 640px) { .panel { padding: var(--s-8); } }
.flow-title { font-size: var(--t-2xl); line-height: 1.15; font-weight: 700; letter-spacing: -0.025em; text-wrap: balance; }
.flow-title:focus { outline: none; }
.is-announced:focus { outline: none; }
.flow-sub { margin-top: var(--s-2); color: var(--ink-2); max-width: 62ch; }

/* Fields */
.field { margin-top: var(--s-6); }
.field-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-3); margin-bottom: var(--s-2); }
.field-head label { font-weight: 600; font-size: var(--t-base); }
.optional { color: var(--muted); font-weight: 400; font-size: var(--t-sm); }
.input {
  width: 100%; height: 52px; padding: 0 var(--s-4); border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: var(--field); font-size: var(--t-base); color: var(--ink); outline: none;
  transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--muted); opacity: 1; }
.input[aria-invalid="true"] { border-color: var(--err); }
.input.mono { font-size: var(--t-sm); letter-spacing: 0; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 112px; }
.input-action { position: absolute; right: 6px; top: 50%; translate: 0 -50%; height: 40px; }
.field-msg { display: grid; grid-template-columns: 18px 1fr; gap: 6px 8px; margin-top: var(--s-2); font-size: var(--t-sm); color: var(--muted); min-height: 1.4em; }
.field-msg:empty { display: block; }
.field-msg > svg { width: 18px; height: 18px; margin-top: 1px; }
.field-msg.is-ok { color: var(--ok); }
.field-msg.is-error { color: var(--err); font-weight: 500; }
.field-note { grid-column: 1 / -1; display: grid; grid-template-columns: 18px 1fr; gap: 8px; color: var(--ink-2); font-weight: 400; }
.field-note svg { width: 18px; height: 18px; color: var(--muted); }

.flow-actions { margin-top: var(--s-8); display: grid; gap: var(--s-2); }
.flow-actions .btn-lg { width: 100%; }
@media (min-width: 640px) { .flow-actions .btn-lg { width: auto; justify-self: start; min-width: 260px; } }
.flow-actions .cta-reason { text-align: left; }
.flow-actions .cta-reason:empty { display: none; }
.fine { font-size: var(--t-xs); color: var(--muted); }

/* Asset + network chip */
.asset-chip { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.asset-chip > span:last-child { display: grid; line-height: 1.2; min-width: 0; }
.asset-chip b { font-weight: 700; }
.asset-chip small { display: inline-flex; align-items: center; gap: 5px; font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.net-pill { display: inline-flex; padding: 4px 10px 4px 6px; border-radius: var(--r-pill); background: var(--field); }
.net-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: var(--r-pill);
  background: var(--field); font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); white-space: nowrap;
}
.amount-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-3); }
.amount-line-main { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.amount-line-main b { font-weight: 700; font-variant-numeric: tabular-nums; }
.rev-leg .amount-line-main b { font-size: var(--t-xl); letter-spacing: -0.02em; }
.sum-line .amount-line-main b { font-size: var(--t-lg); }
.sum-line .amount-line-main .coin { width: 26px; height: 26px; }
.result .amount-line { justify-content: flex-end; }

/* Review */
.rev-group { margin-top: var(--s-6); padding-top: var(--s-5); border-top: 1px solid var(--line); }
.rev-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.rev-head h2 { font-size: var(--t-sm); font-weight: 600; color: var(--muted); }
.rev-head .text-link { font-size: var(--t-sm); }
button.text-link { font: inherit; font-size: var(--t-sm); }
/* a finger needs more than the text line: the target grows, the layout does not */
.rev-head .text-link, .summary > .text-link { padding-block: 12px; margin-block: -12px; }
.rev-leg { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); }
/* Review: two columns on wide screens, and the consent + button stay in view while the page scrolls */
.rev-cols { display: grid; gap: 0 var(--s-8); }
.rev-col > .rev-group:first-child { margin-top: var(--s-5); }
@media (min-width: 900px) {
  .rev-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rev-col > .rev-group { margin-top: var(--s-5); padding-top: var(--s-4); }
  .rev-col > .rev-group:first-child { border-top: 0; padding-top: 0; }
}
.flow-grid-review .flow-main { grid-column: 1 / -1; }
.rev-actions {
  position: sticky; bottom: 0; z-index: 2; margin-top: var(--s-5); padding: var(--s-4) 0 var(--s-2);
  background: var(--surface); border-top: 1px solid var(--line); gap: var(--s-3);
}
.rev-actions .consent { margin-bottom: 0; }
.rev-consent { display: grid; gap: var(--s-2); }
.rev-consent .field-msg { margin: 0; }
.rev-go { display: grid; gap: var(--s-2); }
.rev-consent .consent input[aria-invalid="true"] { outline: 2px solid var(--err); outline-offset: 2px; }
@media (min-width: 900px) {
  .rev-actions { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--s-8); }
  .rev-go { grid-auto-flow: column; align-items: center; column-gap: var(--s-4); }
  .rev-go .cta-reason { grid-column: 1 / -1; }
}
@media (max-width: 479px) {
  .rev-col .kv-row:has(> .kv-wrap), .rev-col .kv-row:has(.addr) { flex-direction: column; align-items: flex-start; gap: 2px; }
  .rev-col .kv-row:has(> .kv-wrap) dd, .rev-col .kv-row:has(.addr) dd { text-align: left; }
  .rev-col .kv .addr { text-align: left; }
}
@media (max-width: 639px) {
  .rev-actions { margin-left: calc(var(--s-5) * -1); margin-right: calc(var(--s-5) * -1); padding: var(--s-3) var(--s-5); margin-bottom: calc(var(--s-5) * -1); border-radius: 0 0 var(--r-xl) var(--r-xl); gap: var(--s-2); }
  /* the button and the quote timer share one row, so the bar stays short */
  .rev-go { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--s-3); }
  .rev-go .btn-lg { order: 1; }
  .rev-go .quote-status { order: 2; margin: 0; min-height: 0; max-width: 6.5rem; }
  .rev-go .quote-status-text { align-items: flex-start; line-height: 1.3; }
  .rev-go .quote-status-text::before { margin-top: 5px; flex: none; }
  .rev-go .cta-reason { order: 3; grid-column: 1 / -1; }
}
/* a focused field is never left under the pinned confirm bar */
html:has(.rev-actions) { scroll-padding-bottom: 13rem; }
/* a short window (a phone on its side, a large zoom) has no room for a pinned bar: it goes back into the flow */
@media (max-height: 520px) {
  .rev-actions { position: static; }
  html:has(.rev-actions) { scroll-padding-bottom: 0; }
}
.rev-amount { font-size: var(--t-xl); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.kv { margin: 0; display: grid; gap: 6px; }
.kv-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); font-size: var(--t-sm); }
/* the label never collapses under a long value (an address, a TXID): it keeps a readable minimum and the value wraps instead */
.kv-row dt { color: var(--muted); flex: 1 1 auto; min-width: min(7.5em, 38%); }
.kv-row dd { flex: 0 1 auto; max-width: 100%; margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; color: var(--ink-2); min-width: min-content; overflow-wrap: break-word; }
.kv-row dd:is(.kv-wrap, :has(.mono, .addr, .admin-break, a)) { min-width: 0; overflow-wrap: anywhere; }
.kv-row dd.kv-num { white-space: nowrap; }
.kv-row dd.kv-wrap { flex: 0 1 auto; overflow-wrap: anywhere; }
.net-tag-k { font-weight: 500; color: var(--muted); margin-right: -2px; }
.kv-total { margin-top: 3px; padding-top: 8px; border-top: 1px dashed var(--line-strong); }
.kv-total dt, .kv-total dd { color: var(--ink); font-weight: 700; font-size: var(--t-base); }
/* the figure an exchange was created with, under the accepted one it went ahead with: a quieter second line, never struck out */
.kv-was { display: block; margin-top: 2px; font-size: var(--t-xs); font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.kv-tight { gap: 8px; }
.kv .addr { word-break: break-all; text-align: right; }

.note { display: grid; grid-template-columns: 18px 1fr; gap: 8px; margin-top: var(--s-3); font-size: var(--t-sm); color: var(--ink-2); }
.note svg { width: 18px; height: 18px; color: var(--muted); margin-top: 1px; }
.note-warn { padding: var(--s-3); border-radius: var(--r-md); background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn-ink); }
.note-warn svg { color: currentColor; }

.addr { font-size: var(--t-sm); color: var(--muted); word-break: break-all; line-height: 1.6; }
.addr b { color: var(--ink); font-weight: 700; background: var(--line); border-radius: var(--r-xs); padding: 0 2px; white-space: nowrap; }

/* Summary */
.summary { display: grid; gap: var(--s-4); }
.summary-title { font-size: var(--t-lg); font-weight: 700; letter-spacing: -0.01em; }
.sum-leg { display: grid; gap: 4px; padding-bottom: var(--s-4); border-bottom: 1px solid var(--line); }
.sum-k { font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
.sum-row { display: block; }
.sum-amt { font-size: var(--t-lg); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Exchange page */
.ex-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--s-4); }
.ex-title { font-size: var(--t-2xl); font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.ex-pair { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-top: var(--s-3); }
.ex-pair .pair-arrow { width: 16px; height: 16px; color: var(--muted); }
.ex-head-side { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
.ex-head-side .badge { white-space: nowrap; }
.ex-keep { margin: var(--s-3) 0 var(--s-6); font-size: var(--t-sm); color: var(--muted); max-width: 70ch; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 var(--s-3); border-radius: var(--r-pill);
  font-size: var(--t-xs); font-weight: 700; background: var(--field); color: var(--ink-2); border: 1px solid var(--line);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-action, .badge-hold { background: var(--warn-soft); color: var(--warn-ink); border-color: var(--warn-line); }
.badge-done { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-closed { color: var(--muted); }

.stage-head { display: grid; grid-template-columns: auto 1fr; gap: var(--s-4); align-items: start; }
.stage-head:not(:has(.stage-icon)) { grid-template-columns: 1fr; }
.stage-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--field); color: var(--ink-2); }
.stage-icon svg { width: 22px; height: 22px; }
.tone-ok .stage-icon { background: var(--ok-soft); color: var(--ok); }
.tone-warn .stage-icon, .tone-hold .stage-icon { background: var(--warn-soft); color: var(--warn-ink); }
.stage-title { font-size: var(--t-xl); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.stage-desc { margin-top: 4px; color: var(--ink-2); max-width: 62ch; }
.stage-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }

/* Deposit */
.dep-grid { display: grid; gap: var(--s-6); margin-top: var(--s-6); }
@media (min-width: 720px) { .dep-grid { grid-template-columns: minmax(0, 1fr) 200px; align-items: start; } }
.dep-main { display: grid; gap: var(--s-4); min-width: 0; }
.dep-field { display: grid; gap: 6px; }
.dep-k { font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
.dep-v { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.dep-amount { font-size: var(--t-2xl); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.addr-box {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--field);
}
.addr-box .addr { flex: 1 1 220px; font-size: var(--t-base); color: var(--ink-2); }
.copy-btn { flex-shrink: 0; }
.copy-btn.is-done { border-color: var(--ok); color: var(--ok); }
.dep-qr { display: grid; gap: var(--s-2); justify-items: center; align-content: start; }
.dep-qr svg, .dep-qr img { width: 180px; height: 180px; padding: 10px; background: #fff; border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); }
.dep-qr-note { font-size: var(--t-xs); color: var(--muted); text-align: center; max-width: 24ch; }
@media (max-width: 719px) { .dep-qr { justify-items: start; } .dep-qr-note { text-align: left; max-width: none; } }
.dep-rate { margin-top: var(--s-6); padding-top: var(--s-5); border-top: 1px solid var(--line); display: grid; gap: var(--s-2); }
.lock-line { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lock-line svg { width: 18px; height: 18px; }
.dep-rate .note { margin-top: 0; }
.dep-get { margin-top: var(--s-2); }
.dep-get b { color: var(--ink); font-size: var(--t-base); font-variant-numeric: tabular-nums; }
.dep-get .addr { font-size: var(--t-sm); }

/* Confirmations */
.conf { margin-top: var(--s-6); display: grid; gap: var(--s-2); }
.conf-top { display: flex; justify-content: space-between; font-size: var(--t-sm); color: var(--muted); }
.conf-top b { color: var(--ink); font-variant-numeric: tabular-nums; }
.conf-bar { display: block; width: 100%; height: 8px; border: 0; border-radius: var(--r-pill); background: var(--field); overflow: hidden; appearance: none; -webkit-appearance: none; color: var(--ok); }
.conf-bar::-webkit-progress-bar { background: var(--field); border-radius: inherit; }
.conf-bar::-webkit-progress-value { background: var(--ok); border-radius: inherit; }
.conf-bar::-moz-progress-bar { background: var(--ok); border-radius: inherit; }

/* Transactions */
.tx-list { margin-top: var(--s-6); display: grid; }
.tx-row { display: grid; gap: 6px; padding-block: var(--s-3); border-top: 1px solid var(--line); }
.tx-top { display: flex; align-items: center; gap: var(--s-2); }
.tx-k { font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
.tx-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); }
.tx-hash { font-size: var(--t-sm); color: var(--ink-2); }
.tx-bottom .text-link { font-size: var(--t-sm); }

.result { margin-top: var(--s-6); }
.result .kv-row { align-items: center; }
.result dd { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--s-3); }
.result dd b { color: var(--ink); font-size: var(--t-base); }
/* in a result row the value is a flex line: the expected figure still takes a line of its own, right under it */
.result dd > .kv-was { flex-basis: 100%; margin-top: calc(2px - var(--s-3)); text-align: right; }
.save-prompt {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4);
  margin-top: var(--s-6); padding: var(--s-4) var(--s-5); border-radius: var(--r-lg); background: var(--field);
}
.save-prompt strong { display: block; }
.save-prompt span { display: block; font-size: var(--t-sm); color: var(--muted); }

/* Exceptions: what happened / funds / next (v2 §57) */
.x-list { margin: var(--s-6) 0 0; display: grid; gap: var(--s-4); }
.x-row { display: grid; gap: 4px; }
@media (min-width: 640px) { .x-row { grid-template-columns: 160px 1fr; gap: var(--s-4); } }
.x-row dt { font-weight: 600; font-size: var(--t-sm); color: var(--ink); }
.x-row dd { margin: 0; color: var(--ink-2); max-width: 62ch; }

/* Timeline */
.timeline { display: grid; margin-top: var(--s-4); }
.tl-item { position: relative; display: grid; grid-template-columns: 24px 1fr; gap: var(--s-3); padding-bottom: var(--s-4); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 11.5px; top: 26px; bottom: 2px; width: 1px; background: var(--line-strong); }
.tl-item.is-done:not(:last-child)::before { background: var(--ok); }
.tl-dot { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); }
.tl-dot svg { width: 14px; height: 14px; }
.is-done .tl-dot { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.is-current .tl-dot { border: 2px solid var(--ink); }
.is-current .tl-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.is-exception .tl-dot { border-color: transparent; background: var(--warn-soft); color: var(--warn-ink); }
.is-exception.tone-neutral .tl-dot { background: var(--field); color: var(--ink-2); }
.tl-text { display: grid; padding-top: 2px; min-width: 0; }
.tl-sub { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: grid; gap: var(--s-2); }
.tl-step { display: grid; grid-template-columns: 10px 1fr auto; align-items: baseline; gap: var(--s-2); font-size: var(--t-sm); color: var(--muted); }
.tl-sm { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--line-strong); align-self: center; }
.tl-step.is-done .tl-sm { background: var(--ok); border-color: var(--ok); }
.tl-step.is-current { color: var(--ink); font-weight: 600; }
.tl-step.is-current .tl-sm { background: var(--ink); border-color: var(--ink); }
.tl-step.is-exception { color: var(--warn-ink); font-weight: 600; }
.tl-step.is-exception .tl-sm { background: var(--warn-ink); border-color: var(--warn-ink); }
.tl-label { font-size: var(--t-sm); font-weight: 600; }
.tl-time { font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.is-todo .tl-label { color: var(--muted); font-weight: 500; }
.is-skipped .tl-label { color: var(--muted); }


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

/* Phones: first viewport must reach the Exchange button at 390x844. */
/* Narrow phones (320–420px): keep amounts and fee lines readable. */
@media (max-width: 420px) {
  .amount { font-size: var(--t-xl); }
  .leg { padding-inline: var(--s-3); }
  .net-row, .field-error { margin-inline: calc(-1 * var(--s-3)); width: calc(100% + 2 * var(--s-3)); padding-inline: var(--s-3); }
  .asset-btn { height: 40px; gap: 6px; padding: 0 6px 0 5px; }
  .asset-btn .coin { width: 26px; height: 26px; }
  .asset-btn .chev { width: 16px; height: 16px; }
  .bd-row { flex-wrap: wrap; row-gap: 0; column-gap: var(--s-2); }
  .xcard { padding-inline: var(--s-3); }
  .bd-row dt { white-space: nowrap; }
  .bd-row dd { margin-left: auto; }
  .quote-status { flex-wrap: wrap; row-gap: 2px; }
}
/* the amount stays the biggest thing on the leg; the asset pill gives up its chevron and size instead */
@media (max-width: 360px) {
  .amount { font-size: var(--t-lg); }
  .asset-btn .chev { display: none; }
  .asset-btn { padding-right: 10px; }
  .bd-row { flex-direction: column; align-items: flex-start; }
  .bd-row dt { white-space: normal; } /* "Наценка и запас фиксированного курса (0,50%)" must not widen the page */
  .bd-row dd { margin-left: 0; }
}

/* Account pages: sign-up, sign-in, TOTP. One centred card on the flow layout. */
.auth-card { max-width: 480px; margin-inline: auto; display: grid; gap: var(--s-4); }
.auth-card form { display: block; }
.auth-card .field:first-of-type { margin-top: var(--s-6); }
.auth-card .btn-cta, .auth-card form > .btn { margin-top: var(--s-6); }
.auth-card .note { margin-top: var(--s-4); }
.auth-alt { margin-top: var(--s-5); font-size: var(--t-sm); color: var(--ink-2); }
.auth-alt .text-link { font-size: inherit; }
.auth-card .auth-terms { margin-top: var(--s-5); margin-bottom: 0; }
.auth-card .auth-terms + .btn-cta { margin-top: var(--s-3); }
.auth-alt.auth-forgot { margin-top: var(--s-1); margin-bottom: var(--s-4); }
.auth-actions { margin-top: var(--s-6); display: flex; flex-wrap: wrap; gap: var(--s-2); }
.auth-flash { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--ok-soft); color: var(--ok); font-size: var(--t-base); font-weight: 500; }
.auth-flash svg { width: 18px; height: 18px; margin-top: 1px; }
.auth-facts { margin-top: var(--s-5); display: grid; gap: var(--s-3); }
.auth-facts > div { display: flex; justify-content: space-between; gap: var(--s-4); padding-bottom: var(--s-3); border-bottom: 1px solid var(--line); }
.auth-facts dt { color: var(--muted); }
.auth-facts dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.auth-h2 { margin-top: var(--s-6); display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2) var(--s-3); font-size: var(--t-lg); font-weight: 700; }
.auth-badge { padding: 2px 10px; border-radius: 999px; background: var(--field); color: var(--muted); font-size: var(--t-sm); font-weight: 600; }
.auth-badge.is-on { background: var(--ok-soft); color: var(--ok); }
.auth-qr { margin-top: var(--s-5); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-5); }
.auth-qr img { border-radius: var(--r-md); border: 1px solid var(--line); background: #fff; }
.auth-qr > div { flex: 1 1 200px; }
.auth-qr-label { color: var(--ink-2); font-size: var(--t-sm); }
.auth-secret { display: block; margin-top: var(--s-2); padding: var(--s-3); border-radius: var(--r-md); background: var(--field); font-family: var(--mono); font-size: var(--t-sm); overflow-wrap: anywhere; user-select: all; }
.field-msg > span:only-child { grid-column: 1 / -1; }
.auth-card .field-msg:empty { min-height: 0; margin-top: 0; }

/* =====================================================================
   Cabinet: Main, Orders, Settings, Account data
   ===================================================================== */
/* ---------- Shell ---------- */
body:has(.acc) { padding-bottom: 72px; } /* room for the phone tab bar */
.acc { display: grid; gap: var(--s-5); padding-block: var(--s-5) var(--s-12); align-items: start; }
.acc-main { min-width: 0; }

/* Navigation: tab bar on phones, sidebar from 960px */
.acc-nav {
  position: fixed; inset: auto 0 0 0; z-index: 25;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.acc-nav ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; }
.acc-nav a {
  display: grid; justify-items: center; align-content: center; gap: 2px;
  min-height: 56px; padding: 6px 2px; text-decoration: none;
  font-size: var(--t-xs); font-weight: 600; color: var(--muted); text-align: center; line-height: 1.2;
  transition: color var(--dur) var(--ease-out);
}
.acc-nav li { min-width: 0; }
.acc-nav a span { max-width: 100%; overflow-wrap: anywhere; hyphens: auto; }
.acc-nav a svg { width: 22px; height: 22px; }
/* keep the focused control clear of the fixed tab bar */
@media (max-width: 959px) { html:has(.acc) { scroll-padding-bottom: calc(72px + env(safe-area-inset-bottom)); } }
.acc-nav a:hover { color: var(--ink); }
.acc-nav a[aria-current="page"] { color: var(--ink); }
.acc-nav a[aria-current="page"] svg { color: var(--accent-text); }
.acc-who { display: none; }

@media (min-width: 960px) {
  body:has(.acc) { padding-bottom: 0; }
  .acc { grid-template-columns: 224px minmax(0, 1fr); gap: var(--s-8); padding-block: var(--s-8) var(--s-16); }
  .acc-nav {
    position: sticky; top: calc(var(--header-h) + var(--s-6)); inset-inline: auto; z-index: auto;
    background: none; backdrop-filter: none; border: 0; padding: 0;
    display: grid; gap: var(--s-6);
  }
  .acc-nav ul { display: grid; grid-template-columns: 1fr; grid-auto-flow: row; gap: 2px; }
  .acc-nav a {
    display: flex; justify-content: flex-start; align-items: center; gap: var(--s-3);
    min-height: 44px; padding: 0 var(--s-3); border-radius: var(--r-md);
    font-size: var(--t-base); text-align: left; color: var(--ink-2);
  }
  .acc-nav a:hover { background: var(--field); }
  .acc-nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-btn); }
  :root[data-theme="dark"] .acc-nav a[aria-current="page"] { background: var(--field-hover); }
  .acc-who { display: grid; gap: 2px; padding: var(--s-4) var(--s-3) 0; border-top: 1px solid var(--line); }
  .acc-mail { font-size: var(--t-sm); color: var(--muted); overflow-wrap: anywhere; }
  .acc-logout {
    display: inline-flex; align-items: center; gap: var(--s-2); width: fit-content;
    margin-top: var(--s-2); font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); text-decoration: none;
  }
  .acc-logout svg { width: 16px; height: 16px; }
  .acc-logout:hover { color: var(--ink); text-decoration: underline; }
}

/* ---------- Page head ---------- */
.acc-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-5); }
.acc-head .btn-lg { height: 44px; padding: 0 var(--s-5); font-size: var(--t-base); }
.acc-head .btn-lg svg { width: 18px; height: 18px; }
/* When the account has no funds, the deposit becomes the one filled action. */
.is-empty .acc-head .btn-primary { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: none; }
.is-empty .acc-head .btn-primary:hover { border-color: var(--ink-2); background: var(--surface); }

/* ---------- Two-column body ---------- */
.acc-grid { display: grid; gap: var(--s-5); align-items: start; }
.acc-col { display: grid; gap: var(--s-5); min-width: 0; }
@media (min-width: 1100px) {
  .acc-grid { grid-template-columns: minmax(0, 1fr) 420px; }
  /* one filled control per view: while the wallet panel beside the list shows its own filled action, "New exchange" steps back to outline */
  .acc:has(.acc-side .btn-primary) .acc-head .btn-primary { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: none; }
  .acc:has(.acc-side .btn-primary) .acc-head .btn-primary:hover { border-color: var(--ink-2); background: var(--surface); }
  .acc-side { position: sticky; top: calc(var(--header-h) + var(--s-6)); }
  .back { display: none !important; }
}
/* Below 1100px the list and the wallet panel take turns, so a tap on Deposit lands on the address at once. */
@media (max-width: 1099px) {
  .acc[data-view="list"] .acc-side { display: none; }
  .acc[data-view="wallet"] [data-cabinet-target="list"] { display: none; }
  /* the page title stays for screen readers: it is the only h1 while the panel is shown */
  .acc[data-view="wallet"] .acc-head { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .acc[data-view="wallet"] .acc-head .btn { display: none; }
}

.panel-title { font-size: var(--t-lg); font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-2); }
.acc .panel { padding: var(--s-4); container: panel / inline-size; }
@media (min-width: 640px) { .acc .panel { padding: var(--s-5); } }

/* Switch (checkbox) */
.switch { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 32px; font-size: var(--t-sm); font-weight: 500; color: var(--ink-2); cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { position: relative; width: 34px; height: 20px; border-radius: var(--r-pill); background: var(--line-strong); transition: background var(--dur) var(--ease-out); flex-shrink: 0; }
.switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--knob); box-shadow: var(--shadow-btn); transition: transform var(--dur) var(--ease-out);
}
.switch input:checked + .switch-track { background: var(--ink); }
:root[data-theme="dark"] .switch input:checked + .switch-track { background: var(--ink-2); }
.switch input:checked + .switch-track::after { transform: translateX(14px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- In progress ---------- */
.op-list { margin-top: var(--s-2); }
.op {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: var(--s-1) var(--s-3);
  padding: var(--s-3) var(--s-2); margin-inline: calc(-1 * var(--s-2)); border-radius: var(--r-md); text-decoration: none;
  transition: background var(--dur) var(--ease-out);
}
.op + .op { border-top: 1px solid var(--line); border-radius: 0 0 var(--r-md) var(--r-md); }
.op:hover { background: var(--field); }
.op-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--field); color: var(--ink-2); }
.op:hover .op-ico { background: var(--surface); }
.op-ico svg { width: 20px; height: 20px; }
.op-main { display: grid; min-width: 0; }
.op-title { font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.op-meta { font-size: var(--t-xs); color: var(--muted); }
.op .badge { justify-self: end; }
@container panel (max-width: 519px) {
  .op { grid-template-columns: 40px minmax(0, 1fr); }
  .op .badge { grid-column: 2; justify-self: start; margin-top: 2px; }
}

/* ---------- Balances ---------- */
.bal-head, .bal-row { display: grid; grid-template-columns: minmax(150px, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; column-gap: var(--s-4); }
.bal-head { padding: var(--s-2) 0; border-bottom: 1px solid var(--line); font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
.bal-head > :nth-child(2), .bal-head > :nth-child(3) { text-align: right; }
.bal-row { padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
.bal-row:last-child { border-bottom: 0; }
.bal-row[hidden] { display: none; }
.bal-coin { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.bal-coin > span:last-child { display: grid; line-height: 1.25; min-width: 0; }
.bal-coin b { font-weight: 700; }
.bal-coin small { font-size: var(--t-xs); color: var(--muted); }
.bal-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.bal-num .bal-k { display: none; }
.bal-num.is-zero { color: var(--muted); font-weight: 500; }
.bal-acts { display: flex; gap: var(--s-1); }
.bal-acts .btn { gap: 6px; }
@media (pointer: fine) { .bal-row > .bal-acts .btn { height: 36px; } }
.bal-acts .btn:disabled { opacity: 1; color: var(--muted); cursor: not-allowed; background: none; border-color: transparent; }
.bal-acts .btn-outline:disabled { border-color: var(--line); }
.bal-row.is-current { background: var(--accent-soft); margin-inline: calc(-1 * var(--s-3)); padding-inline: var(--s-3); border-radius: var(--r-md); border-bottom-color: transparent; }
.foot-note { margin-top: var(--s-3); font-size: var(--t-sm); color: var(--muted); max-width: 62ch; }

@container panel (max-width: 639px) {
  /* the column heads stay for screen readers (the list is a role=table); only the eye loses them */
  .bal-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; padding: 0; }
  .bal-row {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "coin avail" "orders orders" "acts acts";
    row-gap: var(--s-1); padding: var(--s-4) 0;
  }
  .bal-row > :nth-child(1) { grid-area: coin; }
  .bal-row > :nth-child(2) { grid-area: avail; }
  .bal-row > :nth-child(3) { grid-area: orders; text-align: left; font-weight: 500; font-size: var(--t-sm); color: var(--ink-2); }
  .bal-row > :nth-child(3).is-zero { display: none; }
  .bal-row > :nth-child(4) { grid-area: acts; margin-top: var(--s-3); display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
  .bal-row > :nth-child(4) .btn { height: 44px; padding: 0 var(--s-2); }
  .bal-row > :nth-child(4) .btn-ghost { border: 1px solid var(--line); }
  .bal-num .bal-k { display: inline; color: var(--muted); font-weight: 500; }
  .bal-row > :nth-child(3) .bal-k { margin-right: var(--s-1); }
  .bal-row > :nth-child(2) .bal-k { display: none; }
  .bal-row.is-current { margin-inline: calc(-1 * var(--s-3)); padding-inline: var(--s-3); }
}
@container panel (max-width: 339px) {
  .bal-row > :nth-child(4) .btn { font-size: var(--t-xs); gap: 4px; }
  .bal-row > :nth-child(4) .btn svg { display: none; }
}

.bal-body:empty { display: none; }

/* ---------- Empty state ---------- */
.empty {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--s-4);
  padding: var(--s-5); margin-block: var(--s-3) var(--s-2); border-radius: var(--r-lg); background: var(--field);
}
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-btn); }
.empty-icon svg { width: 22px; height: 22px; }
.empty h3 { font-size: var(--t-md); font-weight: 700; margin: 0; }
.empty p { margin-top: 2px; color: var(--ink-2); font-size: var(--t-sm); max-width: 52ch; }
.empty .btn { grid-column: 1 / -1; justify-self: start; }
@container panel (min-width: 600px) { .empty { grid-template-columns: auto minmax(0, 1fr) auto; } .empty .btn { grid-column: auto; } }

/* ---------- Wallet panel ---------- */
.wallet { display: grid; gap: var(--s-5); }
.wallet:focus { outline: none; }
.back { display: inline-flex; align-items: center; gap: var(--s-2); width: fit-content; min-height: 32px; margin-bottom: calc(-1 * var(--s-2)); font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); border-radius: var(--r-sm); }
.back svg { width: 18px; height: 18px; }
.back:hover { color: var(--ink); }
#wallet-body { display: grid; gap: var(--s-5); min-width: 0; }

.fld { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; } /* minmax: a long picker button shortens its text instead of widening the panel */
.fld-k { font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
.fld-help { font-size: var(--t-xs); color: var(--muted); }

/* Form fields. The drop-down lists of the filters are the browser's own: one family, no italic group titles. */
select, option, optgroup { font-family: inherit; }
optgroup { font-style: normal; font-weight: 700; }
option { font-style: normal; font-weight: 500; }
.fld input[type="text"], .fld input[type="search"] {
  width: 100%; height: 52px; border-radius: var(--r-md); border: 1px solid transparent; background: var(--field);
  color: var(--ink); font: inherit; font-weight: 600; outline: none;
  transition: border-color var(--dur) var(--ease-out), background var(--dur) var(--ease-out);
}
.fld input[type="text"] { padding: 0 var(--s-4); font-weight: 500; }
.fld input::placeholder { color: var(--muted); font-weight: 400; }
.fld input[type="text"]:hover { background: var(--field-hover); }
.fld input[type="text"]:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--field); }
.fld.has-error input { border-color: var(--err); }

/* The issued address: the reason this screen exists */
.addr-card { display: grid; gap: var(--s-4); }
.addr-card .warn { margin: 0; }
.addr-body { display: grid; gap: var(--s-4); padding: var(--s-4); border-radius: var(--r-lg); background: var(--field); }
.addr-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); justify-items: center; }
.addr-qr { display: grid; gap: var(--s-2); justify-items: center; }
.addr-qr img { width: 160px; height: 160px; padding: 10px; background: #fff; border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); }
.addr-qr p { font-size: var(--t-xs); color: var(--muted); text-align: center; max-width: 28ch; }
.addr-who { display: grid; gap: var(--s-2); width: 100%; min-width: 0; }
.addr-k { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
.addr-k .asset-chip { color: var(--ink); }
.addr-val {
  padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--surface); box-shadow: 0 0 0 1px var(--line);
  font-size: var(--t-base); line-height: 1.6; color: var(--ink-2); overflow-wrap: anywhere; user-select: all;
}
.addr-val b { color: var(--ink); font-weight: 700; }
.addr-val.memo { font-size: var(--t-lg); letter-spacing: 0.02em; }
.addr-copy { width: 100%; height: 44px; }
.addr-copy.is-done { border-color: var(--ok); color: var(--ok); }
.addr-copy svg { width: 18px; height: 18px; }
.memo-warn { display: flex; gap: var(--s-2); align-items: flex-start; font-size: var(--t-sm); color: var(--warn-ink); padding: var(--s-3); border-radius: var(--r-md); background: var(--warn-soft); }
.memo-warn svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
@media (min-width: 520px) and (max-width: 1099px) {
  .addr-top { grid-template-columns: minmax(0, 1fr) 180px; align-items: start; justify-items: stretch; }
}
.addr-facts { margin: 0; }

/* Loading + error inside the card */
.skel-line { display: block; border-radius: var(--r-sm); background: linear-gradient(90deg, var(--skeleton) 25%, var(--skeleton-hi) 50%, var(--skeleton) 75%); background-size: 200% 100%; animation: acc-shimmer 1.2s linear infinite; }
@keyframes acc-shimmer { to { background-position: -200% 0; } }
.addr-skel .skel-qr { width: 160px; height: 160px; border-radius: var(--r-lg); }
.addr-skel .skel-line { height: 16px; }
.addr-status { display: grid; gap: var(--s-3); justify-items: start; padding: var(--s-5); border-radius: var(--r-lg); background: var(--field); }
.addr-status :is(h2, h3) { font-size: var(--t-md); font-weight: 700; margin: 0; }
.addr-status p { font-size: var(--t-sm); color: var(--ink-2); max-width: 46ch; }
.addr-status.is-error { background: var(--err-soft); }
.addr-status.is-error h3 { color: var(--err); }
.addr-status.is-error .btn-outline { background: var(--surface); }

/* Fresh address settles in (state change, not decoration) */
.addr-body.is-new { animation: acc-settle 260ms var(--ease-out); }
@keyframes acc-settle { from { opacity: 0; transform: translateY(3px); filter: blur(2px); } }

/* ---------- Withdraw ---------- */
.wd-form { display: grid; gap: var(--s-4); }
.amount-row { position: relative; }
.amount-row input { padding-right: 116px !important; font-size: var(--t-lg) !important; font-weight: 600 !important; font-variant-numeric: tabular-nums; }
.amount-row .btn { position: absolute; right: 8px; top: 8px; height: 36px; }
.field-err { display: none; align-items: center; gap: 6px; font-size: var(--t-sm); color: var(--err); }
.field-err svg { width: 16px; height: 16px; }
.has-error .field-err { display: flex; }
.cta-note { font-size: var(--t-sm); color: var(--muted); }
.cta-note:empty { display: none; }
.wd-form .btn-cta { margin-top: var(--s-1); }
.wd-form .btn-cta:disabled { cursor: not-allowed; }

@media (max-width: 420px) {
  .addr-qr img { width: 160px; height: 160px; }
  .acc-head { flex-wrap: wrap; }
}

/* =====================================================================
   Orders, Settings, Account data
   ===================================================================== */
/* Every cabinet page shares one width. Pages that are a single form keep their fields at a readable measure inside it. */
.acc-form .panel > :not(dialog) { max-width: 560px; }
.acc-list .inline-form { max-width: 560px; }
.acc-stack { display: grid; gap: var(--s-5); }
.acc-head .flow-title { margin: 0; }

/* Inputs: every text-like type shares the field look */
.fld input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%; height: 48px; padding: 0 var(--s-4); border-radius: var(--r-md); border: 1px solid transparent; background: var(--field);
  color: var(--ink); font: inherit; font-weight: 500; outline: none;
  transition: border-color var(--dur) var(--ease-out), background var(--dur) var(--ease-out);
}
.fld input:not([type="checkbox"]):not([type="radio"]):hover { background: var(--field-hover); }
.fld input:not([type="checkbox"]):not([type="radio"]):focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--field); }
.fld.has-error input:not([type="checkbox"]):not([type="radio"]) { border-color: var(--err); }
.fld input.mono { font-family: var(--mono); letter-spacing: 0.04em; }
.pw-row { position: relative; }
.pw-row input { padding-right: 76px !important; }
.pw-toggle { position: absolute; right: 6px; top: 6px; height: 36px; padding: 0 var(--s-3); border-radius: var(--r-sm); font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.pw-toggle:hover { background: var(--field-hover); color: var(--ink); }

/* Orders: filters */
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s-4); margin-bottom: var(--s-4); }
.filters .fld { min-width: 0; }
.filters .seg { flex-wrap: wrap; }
.filters .seg label { flex: 1 1 auto; justify-content: center; text-align: center; min-height: 36px; }
.sel { position: relative; min-width: 200px; }
.sel select {
  appearance: none; width: 100%; height: 44px; padding: 0 40px 0 var(--s-4); border-radius: var(--r-md); border: 1px solid transparent;
  background: var(--field); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; outline: none;
}
.sel select:hover { background: var(--field-hover); }
.sel select:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sel svg { position: absolute; right: 12px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
@media (max-width: 519px) { .filters .fld, .sel { width: 100%; } }

/* Orders: list */
.ord-list { display: grid; }
.ord {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 104px 176px minmax(150px, 190px); align-items: center; gap: var(--s-1) var(--s-4);
  padding: var(--s-4) var(--s-2); margin-inline: calc(-1 * var(--s-2)); border-radius: var(--r-md); text-decoration: none;
  transition: background var(--dur) var(--ease-out);
}
.ord-list li + li .ord { border-top: 1px solid var(--line); border-radius: 0 0 var(--r-md) var(--r-md); }
.ord:hover { background: var(--field); }
.ord:hover .op-ico { background: var(--surface); }
.ord-id { font-size: var(--t-xs); color: var(--muted); }
.ord .badge { justify-self: start; }
.ord-fx { display: grid; gap: 2px; justify-items: end; text-align: right; }
.fx { display: grid; justify-items: end; font-variant-numeric: tabular-nums; }
.fx b { font-weight: 700; white-space: nowrap; }
.fx small { font-size: var(--t-xs); color: var(--muted); }
.fx-out b { color: var(--ink-2); font-weight: 500; }
.fx-in b { color: var(--ok); }
.ord-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.ord-count { font-size: var(--t-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
@container panel (max-width: 719px) {
  .ord { grid-template-columns: 40px minmax(0, 1fr); align-items: start; }
  .ord .op-main { grid-column: 2; }
  .ord-fx { grid-column: 2; justify-items: start; text-align: left; margin-top: var(--s-1); }
  .fx { justify-items: start; }
  .ord .badge { grid-column: 2; margin-top: var(--s-1); }
  .ord-id { grid-column: 2; }
  .ord-fx { order: 1; } .ord .badge { order: 2; } .ord-id { order: 3; }
}
.badge-closed::before { background: var(--muted); }

/* Settings and Account data: rows */
.set-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: 32px; }
.set-sub { margin-top: var(--s-1); font-size: var(--t-sm); color: var(--ink-2); max-width: 62ch; }
.set-list { display: grid; margin-top: var(--s-2); }
.set-list > * + * { border-top: 1px solid var(--line); }
.set-block { display: grid; }
.set-block > .set-row + * { margin-top: 0; }
.set-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-6); padding-block: var(--s-4); }
.set-list > .set-row:first-child, .set-list > .set-block:first-child > .set-row:first-child { padding-top: var(--s-3); }
.set-text { display: grid; gap: 2px; min-width: 0; flex: 1 1 260px; }
.set-text b, .set-title { font-weight: 600; cursor: default; }
.set-title { cursor: pointer; }
.set-text > span { font-size: var(--t-sm); color: var(--muted); max-width: 56ch; }
.set-text > .set-value { font-size: var(--t-md); color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.set-ctl, .set-ctl-inline { display: flex; align-items: center; gap: var(--s-2); flex-shrink: 0; flex-wrap: wrap; }
.set-ctl .seg { max-width: 100%; }
.saved { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-sm); font-weight: 600; color: var(--ok); min-height: 1em; }
.saved svg { width: 16px; height: 16px; }
.switch-lg { min-height: 44px; min-width: 44px; justify-content: flex-end; }
.switch-lg .switch-track { width: 44px; height: 26px; }
.switch-lg .switch-track::after { top: 3px; left: 3px; width: 20px; height: 20px; }
.switch-lg input:checked + .switch-track::after { transform: translateX(18px); }

.inline-form { display: grid; gap: var(--s-4); padding: var(--s-4); margin-bottom: var(--s-4); border-radius: var(--r-lg); background: var(--field); }
.inline-form .fld input:not([type="checkbox"]):not([type="radio"]) { background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.inline-form .fld input:not([type="checkbox"]):not([type="radio"]):focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }
.inline-form .set-sub { margin: 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); padding-top: var(--s-2); }
.set-block > .form-actions { padding: 0 0 var(--s-4); }

.note-ok, .note-warn { padding: var(--s-3) var(--s-4); margin: 0 0 var(--s-4); border-radius: var(--r-md); }
.note-ok { background: var(--ok-soft); color: var(--ok); }
.note-ok span { color: var(--ink); }
.note-warn { background: var(--warn-soft); color: var(--warn-ink); }
.note svg { width: 18px; height: 18px; }

/* 2FA setup */
.totp { display: grid; gap: var(--s-4); justify-items: start; }
.totp-qr img { width: 168px; height: 168px; padding: 10px; background: #fff; border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); }
.totp-side { display: grid; gap: var(--s-2); min-width: 0; max-width: 100%; }
.totp-side .addr-val { font-size: var(--t-base); letter-spacing: 0.06em; }
.totp-side .btn { width: fit-content; }
@media (min-width: 520px) { .totp { grid-template-columns: auto minmax(0, 1fr); align-items: center; } }

/* Sessions */
.sess-list { display: grid; margin-bottom: var(--s-2); }
.sess { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); padding-block: var(--s-3); }
.sess + .sess { border-top: 1px solid var(--line); }

/* Delete account: outlined in the error colour, never a second filled action */
.panel-danger { box-shadow: var(--shadow-card), inset 0 0 0 1px color-mix(in srgb, var(--err) 30%, transparent); }
.btn-danger { border: 1px solid var(--err); color: var(--err); background: transparent; }
.btn-danger:hover:not(:disabled) { background: var(--err-soft); }
.btn-danger:disabled { border-color: var(--line-strong); color: var(--muted); cursor: not-allowed; }
.block-list { display: grid; gap: var(--s-2); margin: var(--s-4) 0 0; }
.block-list li { display: flex; align-items: flex-start; gap: var(--s-2); font-size: var(--t-sm); color: var(--ink-2); }
.block-list svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: var(--warn-ink); }
.panel-danger .form-actions { margin-top: var(--s-4); }

@media (max-width: 519px) {
  .set-text { flex-basis: 180px; }
  .set-ctl-inline { width: 100%; justify-content: space-between; }
  .set-ctl:has(.seg) { width: 100%; }
  .set-ctl .seg { width: 100%; }
  .set-ctl .seg button { flex: 1; min-width: 0; padding-inline: var(--s-2); }
  .form-actions .btn { flex: 1 1 auto; }
}
@media (max-width: 419px) {
  .set-ctl .seg svg { display: none; } /* three theme names fit a 320px phone only without their icons */
}

.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 var(--s-2); border-radius: var(--r-pill); font-size: var(--t-xs); font-weight: 600; border: 1px solid var(--line-strong); color: var(--ink-2); white-space: nowrap; }
:root[data-theme="dark"] .switch input:checked + .switch-track::after { background: var(--bg); }

/* Server-rendered cabinet additions */
.seg-full a { flex: 1; justify-content: center; min-height: 32px; }
.wallet-form { display: grid; gap: var(--s-5); min-width: 0; }
.addr-status.is-hold { background: var(--warn-soft); }
.addr-status.is-hold h3 { color: var(--warn-ink); }
.addr-status.is-hold p { color: var(--warn-ink); }
.acc-flash { margin-bottom: var(--s-4); }
.acc-list .set-head { min-height: 32px; }
.set-list > form.form-actions { padding: var(--s-2) 0 var(--s-4); }
.inline-form .field { margin: 0; }

/* Top-up request inside the wallet panel */
.dep-form { margin-top: var(--s-5); }
.dep-form .btn-cta { margin-top: var(--s-4); }
.dep-req { display: grid; gap: var(--s-4); margin-top: var(--s-5); }
.dep-req-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-3); }
.dep-req-title { font-size: var(--t-xl); line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
.dep-req-net { display: flex; align-items: center; gap: var(--s-2); color: var(--ink-2); font-size: var(--t-sm); }
.dep-req-net .coin { flex: none; }
.dep-req-send { font-size: var(--t-md); }
.dep-req-acts { display: grid; gap: var(--s-2); }
.dep-req-acts form { display: block; }
.dep-req-acts .btn-ghost { width: 100%; }
.dep-req .quote-status { justify-self: start; }

/* Balance history */
.hist-wrap { overflow-x: auto; }
.hist { width: 100%; min-width: 520px; border-collapse: collapse; font-size: var(--t-sm); }
.hist th, .hist td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.hist th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.hist .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hist-in { color: var(--ok); }
.hist-out { color: var(--ink); }

/* Confirmation dialog (exchange between the coins of the balance) */
.modal { border: 0; border-radius: var(--r-xl); padding: 0; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); }
.modal::backdrop { background: var(--backdrop); }
.modal-body { padding: var(--s-6); display: grid; gap: var(--s-4); }
.modal-body > h2:focus { outline: none; }
@media (max-width: 419px) { .modal-acts .btn { flex: 1 1 0; } }
.modal-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-2); }
/* The result is the point of the page: big, with rate, fee and age of the rate as small print under it. */
.xch-form { max-width: 36rem; }
.acc-form .xch-form > :not(dialog) { max-width: none; }
/* each side of the exchange is one card: the coin, then the amount */
.xch-legs { display: grid; gap: var(--s-2); }
.xch-leg { display: grid; gap: var(--s-2); padding: var(--s-3) var(--s-4) var(--s-4); border-radius: var(--r-lg); background: var(--field); }
.xch-leg-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 var(--s-3); }
.xch-bal { min-width: 0; font-size: var(--t-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.xch-leg .pick-field { min-height: 48px; padding-block: 6px; background: var(--surface); border-color: var(--line); }
.xch-leg .input { height: 46px; font-size: 1rem; background: var(--surface); } /* 16px: a phone does not zoom into the field when it is focused */
.xch-leg .field-msg:empty { display: none; }
.xch-form > .note { margin: 0; }
.xch-leg .pick-field:hover { border-color: var(--line-strong); }
.xch-leg .coin-pick { display: contents; }
.xch-leg .field-msg { margin: 0; }
/* the focus of the fields is a real outline, not only a pale ring */
.xch-leg .input:focus-visible, .xch-leg .pick-field:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.xch-legs .xch-swap { margin-block: calc(-1 * var(--s-4)); }
.xch-swap .swap-btn[aria-disabled="true"] { cursor: not-allowed; color: var(--muted); opacity: 0.55; }
/* the field worked out from the other one: the same field, a step quieter, so it is clear which one is typed in */
.xch-leg .input.is-calc { background: transparent; border-color: var(--line); }
.xch-leg .input::placeholder { color: var(--ink-2); opacity: 0.8; }
/* a short link in running text still gets a finger-sized target */
.xch-leg .text-link { position: relative; }
.xch-leg .text-link::after { content: ""; position: absolute; inset: -12px -6px; }
/* an error here is the reason the button is off: it gets a place of its own, not a footnote */
.xch-leg .field-msg.is-error { padding: var(--s-2) var(--s-3); border-radius: var(--r-md); background: var(--err-soft); }
.xch-form .fld-k { font-size: var(--t-sm); }
.xch-swap { display: flex; justify-content: center; margin-block: calc(-1 * var(--s-3)); position: relative; z-index: 1; }
.xch-swap .swap-btn { position: relative; inset: auto; translate: none; } /* relative, not static: it anchors the touch area below */
/* The summary is the point of the page: it is always there (dashes until the numbers come), the labels are plain, the values are what is read. */
.xch-quote { display: grid; gap: var(--s-2); padding: var(--s-3) var(--s-4); border-radius: var(--r-lg); border: 1px solid var(--line); }
.xch-quote[aria-busy="true"] .xch-meta dd { opacity: 0.45; }
.xch-meta { display: grid; gap: var(--s-2); margin: 0; font-size: var(--t-base); color: var(--ink); }
.xch-meta div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px var(--s-4); }
.xch-meta dt { color: var(--ink-2); font-size: var(--t-sm); }
.xch-meta dd { min-width: 0; overflow-wrap: anywhere; margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; transition: opacity var(--dur) var(--ease-out); }
/* the same lines as the home card: the total under a dashed rule, what is left of the coin a step quieter */
.xch-meta .xch-total { padding-top: var(--s-2); border-top: 1px dashed var(--line-strong); }
.xch-meta .xch-total dt { color: var(--ink); font-weight: 700; font-size: var(--t-base); }
.xch-meta .xch-total dd { font-weight: 700; font-size: var(--t-md); }
.xch-meta .xch-after dt, .xch-meta .xch-after dd { color: var(--muted); font-weight: 500; font-size: var(--t-sm); }
.xch-age { margin: 0; font-size: var(--t-sm); color: var(--ink-2); }
.xch-age:empty { display: none; }
.picker-foot { margin: 0; padding: var(--s-3) var(--s-5) var(--s-4); border-top: 1px solid var(--line); font-size: var(--t-sm); color: var(--muted); }

/* ---------- Cabinet: fixes from the UI review ---------- */
.acc-grid > *, .acc-col > * { min-width: 0; }
.wallet, .dep-form, .dep-req, .wallet-form { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.wallet > *, .dep-form > *, .dep-req > * { min-width: 0; }
.seg-full { max-width: 100%; }
.seg-full a, .seg-full label { min-width: 0; text-align: center; }
.seg.seg-wrap { display: flex; flex-wrap: wrap; width: 100%; }
.xch-form { display: grid; gap: var(--s-3); }
.dep-form { display: grid; gap: var(--s-4); }
.panel.dep-req { margin-top: 0; }
.dep-req-net { flex-wrap: wrap; row-gap: 2px; }
.dep-req-id { white-space: nowrap; }
.dep-req-id::before { content: "·"; margin-right: var(--s-2); }
.note-info { padding: var(--s-3) var(--s-4); margin: 0; border-radius: var(--r-md); background: var(--field); color: var(--ink-2); }
/* the deposit was not the quoted amount and was accepted: the one note on the page that changes what the client gets */
.note-accepted { margin-top: var(--s-3); }
.note-accepted strong { color: var(--ink); font-weight: 600; }
.note-ok { margin: 0; }
.amount-row { position: relative; }
.amount-row .input { padding-right: 72px; }
.amount-row .btn { position: absolute; right: 6px; top: 50%; translate: 0 -50%; }
.kv dd.is-err { color: var(--err); }
.bal-more { width: 100%; margin-top: var(--s-3); }
.hist .hist-ref { font-family: var(--mono); font-size: var(--t-xs); font-weight: 500; margin-left: 4px; }
@container panel (max-width: 559px) {
  .hist-wrap { overflow: visible; }
  .hist { min-width: 0; }
  .hist thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .hist, .hist tbody { display: block; }
  .hist tbody tr {
    display: grid; grid-template-columns: minmax(7.25rem, 1fr) minmax(0, auto); grid-template-areas: "what amt" "when after";
    gap: 2px var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--line);
  }
  .hist td { padding: 0; border: 0; }
  .hist .h-what { grid-area: what; font-size: var(--t-base); display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
  .hist .hist-dot { display: none; }
  .hist .hist-ref { margin-left: 0; }
  .hist .h-amt { grid-area: amt; }
  .hist .h-when { grid-area: when; color: var(--muted); font-size: var(--t-xs); white-space: nowrap; }
  .hist .h-after { grid-area: after; color: var(--muted); font-size: var(--t-xs); text-align: right; overflow-wrap: anywhere; white-space: normal; }
  .hist .h-amt { white-space: normal; overflow-wrap: anywhere; }
  .hist .h-after::before { content: attr(data-label) " "; font-family: var(--font); }
}
.dep-form .field-msg:empty { min-height: 0; margin-top: 0; }

/* Legal documents (terms, AML/KYC/KYT, privacy, contacts) */
.legal { padding-block: var(--s-8) var(--s-16); }
.legal-wrap { max-width: 860px; }
.legal-nav { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); margin-bottom: var(--s-6); font-size: var(--t-sm); }
.legal-nav a { color: var(--muted); text-decoration: none; padding-block: 4px; border-bottom: 2px solid transparent; }
.legal-nav a:hover { color: var(--ink); }
.legal-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.legal-body h2 { margin-top: var(--s-8); margin-bottom: var(--s-2); font-size: var(--t-lg); font-weight: 650; letter-spacing: -0.01em; }
.legal-body p, .legal-body li { font-size: var(--t-base); line-height: 1.6; color: var(--ink-2); }
.legal-body p { margin-top: var(--s-3); max-width: 64ch; }
.legal-body ul, .legal-body ol { margin: var(--s-3) 0 0; padding-left: 1.25rem; max-width: 64ch; }
.legal-body ol { list-style: decimal; padding-left: 1.5rem; }
.legal-body ul { list-style: disc; }
.legal-body li::marker { color: var(--muted); }
.legal-body li + li { margin-top: var(--s-2); }
.legal-body a { color: var(--accent-text); }
.legal-body .fine { margin-top: var(--s-2); }
.legal-body .kv { margin-top: var(--s-4); gap: var(--s-2); max-width: 70ch; }
.legal-body .kv-row { font-size: var(--t-base); justify-content: flex-start; }
.legal-body .kv-row dt { flex: 0 0 9rem; }
.legal-body .kv-row dd { flex: 1 1 auto; text-align: left; }
@media (max-width: 479px) { .legal-body .kv-row { flex-direction: column; gap: 2px; } .legal-body .kv-row dt { flex: none; } }
.bc-badge { display: inline-block; margin-top: var(--s-3); line-height: 0; }
.bc-badge img { display: block; }

/* Consent to the rules and the AML/KYC/KYT policy on the review step */
.consent { display: grid; grid-template-columns: 20px 1fr; gap: var(--s-3); align-items: start; margin-bottom: var(--s-4); font-size: var(--t-sm); color: var(--ink-2); line-height: 1.5; cursor: pointer; }
.consent input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); }
.consent a { color: var(--accent-text); }

/* Partner page of the cabinet */
.pt-url { word-break: break-all; }
.pt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s-3); margin: var(--s-4) 0 0; }
.pt-stat { background: var(--field); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); }
.pt-stat dt { font-size: var(--t-xs); color: var(--muted); }
.pt-stat dd { margin: 4px 0 0; font-size: var(--t-lg); font-weight: 650; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.pt-stat-key { background: var(--accent-soft); border-color: transparent; }
.pt-form { margin-top: var(--s-6); padding-top: var(--s-5); border-top: 1px solid var(--line); }
.pt-sub { margin: 0; font-size: var(--t-md); font-weight: 650; }
.pt-fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
@media (max-width: 560px) { .pt-fields { grid-template-columns: 1fr; } }
.pt-table-wrap { overflow-x: auto; margin-top: var(--s-3); }
.pt-table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.pt-table th { text-align: left; font-weight: 600; color: var(--muted); padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pt-table td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.pt-addr { display: inline-block; max-width: 28ch; overflow-wrap: anywhere; }

/* FAQ page */
.faq-lead { color: var(--ink-2); max-width: 62ch; margin: var(--s-2) 0 var(--s-8); }
.faq-group { margin-bottom: var(--s-8); }
.faq-group h2 { font-size: var(--t-xl); font-weight: 700; letter-spacing: -0.015em; margin-bottom: var(--s-3); }
.faq-more { margin-top: var(--s-8); color: var(--ink-2); }

/* Error pages: a code, a plain sentence, the ways out */
.err-card { text-align: left; }
.err-code { font-size: var(--t-2xl); font-weight: 700; letter-spacing: -0.02em; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: var(--s-2); }
.err-en { margin-top: var(--s-6); font-size: var(--t-lg); font-weight: 650; }
.err-acts { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }

/* Small text links get a 24px+ touch target without changing how the text sits: the hit area is a pseudo-element */
.footer-col a, .hist .hist-ref, .auth-forgot .text-link, .section-head > .text-link, .auth-alt .text-link, .steps-bar li.is-done a { position: relative; }
.footer-col a::after, .hist .hist-ref::after, .auth-forgot .text-link::after, .section-head > .text-link::after, .auth-alt .text-link::after { content: ""; position: absolute; inset: -10px -4px; }
.steps-bar li.is-done a::after { content: ""; position: absolute; inset: -10px; }
.auth-alt.auth-forgot { margin-top: var(--s-2); }

/* Coin picker fields of the cabinet: a button that looks like the field it replaces and opens the exchange card's dialog. */
.pick-field {
  display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; min-height: 52px; padding: 8px 14px 8px 12px; text-align: left;
  border: 1px solid transparent; border-radius: var(--r-md); background: var(--field); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer;
  transition: border-color var(--dur) var(--ease-out), background var(--dur) var(--ease-out);
}
.pick-field:hover { background: var(--field-hover); }
.pick-field:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pick-field b { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-field .chev { flex: none; width: 18px; height: 18px; color: var(--muted); }
.pick-field small { flex: none; font-size: var(--t-xs); font-weight: 500; color: var(--muted); }
.pick-net { min-height: 44px; }
.pick-net b { font-size: var(--t-base); white-space: normal; overflow-wrap: break-word; line-height: 1.3; } /* the network is read in full, on two lines if it must */
.pick-field .flag { flex: none; }
.pick-net:has(.flag) small { display: none; } /* as on the home card: the memo flag and the network name matter more; the picker and the address card give the confirmations */
.coin-pick { display: contents; }
[aria-invalid="true"].pick-field { border-color: var(--err); }

/* Touch screens: every control is at least 44px to the finger (DESIGN.md: 36px with a fine pointer, 44px on touch).
   min-height, so taller controls (the 50px card button) keep their size; the swap button keeps its look and gets a
   larger invisible area. */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .icon-btn { min-width: 44px; min-height: 44px; }
  .asset-btn { min-height: 44px; }
  .swap-btn::after { content: ""; position: absolute; inset: -8px; }
  .legal-nav a { position: relative; }
  .legal-nav a::after { content: ""; position: absolute; inset: -8px -4px; }
  .net-row { min-height: 44px; }
  .back, .seg-full a, .set-ctl .seg button { min-height: 44px; }
}

.dep-req-send-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); }
.dep-req-send-row .dep-req-send { margin: 0; }
/* Withdrawal review: what leaves, where it goes, what to verify */
.wd-hint { color: var(--ink-2); font-size: var(--t-sm); }
.wd-hero { display: grid; gap: var(--s-1); padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-md); }
.wd-hero-k { font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
.wd-hero-v { display: flex; align-items: center; gap: var(--s-3); font-size: var(--t-xl); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.wd-hero-s { font-size: var(--t-sm); color: var(--ink-2); }
.wd-block { display: grid; gap: var(--s-3); }
.wd-block-h { font-size: var(--t-sm); font-weight: 600; color: var(--muted); }
.op[aria-current] { background: var(--field); }
.op[aria-current] .op-ico { background: var(--surface); color: var(--accent); }

/* Dark system theme without JavaScript: the tokens switch in the prefers-color-scheme block at the top; these are the
   few component rules written for [data-theme="dark"] that need the same switch (selected segment, asset pill, switch, current tab). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) ::selection { background: var(--accent-soft); color: var(--ink); }
  :root:not([data-theme]) .seg button[aria-pressed="true"],
  :root:not([data-theme]) .seg a[aria-current="true"],
  :root:not([data-theme]) .seg label:has(input:checked) { background: var(--line-strong); }
  :root:not([data-theme]) .asset-btn { background: var(--field-hover); }
  :root:not([data-theme]) .switch input:checked + .switch-track { background: var(--ink-2); }
  :root:not([data-theme]) .switch input:checked + .switch-track::after { background: var(--bg); }
}
@media (prefers-color-scheme: dark) and (min-width: 960px) {
  :root:not([data-theme]) .acc-nav a[aria-current="page"] { background: var(--field-hover); }
}

/* ---------- Emergency notice (spec v2 §56): what is paused, above every public and cabinet page ---------- */
.emg-notice { background: var(--warn-soft); color: var(--warn-ink); border-bottom: 1px solid var(--warn-line); font-size: var(--t-sm); line-height: 1.5; }
.emg-notice .wrap { display: flex; gap: var(--s-3); align-items: flex-start; padding-block: var(--s-3); }
.emg-notice svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.emg-notice p { margin: 0; font-weight: 600; }
.emg-notice a { color: inherit; font-weight: 700; text-underline-offset: 3px; }
.emg-notice details { margin-top: var(--s-1); }
.emg-notice summary { cursor: pointer; width: fit-content; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.emg-notice summary:focus-visible, .emg-notice a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: var(--r-xs); }
.emg-notice details p { margin-top: var(--s-2); font-weight: 500; }

/* ---------- Pair page (/swap/…) ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-6); font-size: var(--t-sm); color: var(--muted); }
.crumbs a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-strong); }
.pair-info .section-head { max-width: 52rem; margin-bottom: var(--s-8); }
.pair-grid { display: grid; gap: var(--s-8); align-items: start; }
@media (min-width: 960px) { .pair-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s-16); } }
/* one panel of rows, label left and value right, like the card's breakdown: equal-weight cards would only repeat each other */
.pair-facts { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.pair-facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-6); padding: var(--s-4) var(--s-5); }
.pair-facts > div + div { border-top: 1px solid var(--line); }
.pair-facts dt { color: var(--muted); font-size: var(--t-base); }
.pair-facts dd { flex-shrink: 0; margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; } /* the label wraps, the figure never splits */
.pair-footnote { margin-top: var(--s-3); font-size: var(--t-sm); color: var(--muted); max-width: 60ch; }
.pair-note { margin-bottom: var(--s-6); padding: var(--s-4); background: var(--accent-soft); border-radius: var(--r-md); color: var(--ink); max-width: 52rem; }
.pair-memos { display: grid; gap: var(--s-2); margin: var(--s-4) 0 0; padding: 0; list-style: none; color: var(--ink-2); font-size: var(--t-base); }
.pair-faq { margin: 0; }
.pair-links { display: grid; gap: var(--s-8) var(--s-16); margin-top: var(--s-16); padding-top: var(--s-8); border-top: 1px solid var(--line); }
@media (min-width: 760px) { .pair-links { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
.pair-links h3 { margin-bottom: var(--s-4); font-size: var(--t-lg); font-weight: 600; letter-spacing: -0.01em; }
.pair-links ul { display: grid; gap: var(--s-3); margin: 0; padding: 0; list-style: none; }
.pair-links a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.pair-links a:hover { text-decoration-color: var(--ink); }

/* ---------- Guides (/guide/…) ---------- */
.guide-table { margin-top: var(--s-4); }
/* Network status page: one block per coin, paused networks in a small table, status as a dot plus a word (never colour or weight alone) */
.net-search { display: grid; gap: var(--s-2); margin-top: var(--s-6); max-width: 28rem; }
.net-search label { font-size: var(--t-sm); font-weight: 600; color: var(--muted); }
.net-search input { height: 44px; padding: 0 var(--s-4); border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--field); color: var(--ink); font: inherit; }
.net-count { font-size: var(--t-xs); color: var(--muted); }
.net-coin { margin-top: var(--s-8); }
.net-coin[hidden], .net-dead li[hidden] { display: none; }
.legal-body .net-coin h3 { font-size: var(--t-base); font-weight: 700; }
.net-coin h3 small { margin-left: var(--s-2); font-size: var(--t-sm); font-weight: 500; color: var(--muted); }
.legal-body .net-open { margin-top: var(--s-1); font-size: var(--t-sm); color: var(--muted); }
.net-table { table-layout: fixed; }
.net-table th, .net-table td { text-align: left; }
.net-table tbody th { padding: var(--s-4); border-bottom: 1px solid var(--line); font-size: var(--t-base); font-weight: 600; color: var(--ink); vertical-align: middle; }
.net-table td { white-space: normal; }
@media (min-width: 760px) { .net-table th:nth-child(2), .net-table th:nth-child(3) { width: 22%; } }
.net-st { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-sm); font-weight: 500; color: var(--muted); }
.net-st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.net-st.is-paused { padding: 2px 10px 2px 8px; border-radius: var(--r-pill); background: var(--warn-soft); color: var(--warn-ink); font-weight: 600; }
.net-st.is-paused::before { background: var(--warn-ink); }
@media (max-width: 759px) {
  .net-table tbody tr { grid-template-columns: 1fr 1fr; }
  .net-table tbody th { grid-column: 1 / -1; padding: 0; border: 0; }
  .net-table td:last-child { grid-column: auto; grid-row: auto; align-self: auto; }
  .net-table td::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: var(--t-xs); color: var(--muted); }
}
.net-more { margin-top: var(--s-6); min-height: 44px; padding: 0 var(--s-4); border: 1px solid var(--line-strong); border-radius: var(--r-md); background: transparent; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.net-more[hidden], .net-empty[hidden] { display: none; }
.net-facts { list-style: none; padding-left: 0; }
.net-facts li::before { content: ""; }
.net-rest { margin-top: var(--s-1); }
.net-rest summary { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--t-sm); color: var(--accent-text); cursor: pointer; }
.legal-body .net-rest p { margin-top: 0; font-size: var(--t-sm); color: var(--muted); }
.net-feed summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.net-other { margin-top: var(--s-8); }
.net-other summary { min-height: 44px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
.net-dead { list-style: none; padding-left: 0; }
.guide-table td:last-child { text-align: left; width: auto; white-space: normal; }
.guide-directions { margin-top: var(--s-3); }
