/* ==========================================================================
   Swapdesk — app.css
   Drop-in replacement. Every class name and data-attribute hook from the
   previous stylesheet is kept. New classes are marked "NEW" for the
   templates that will use them next (swap form, order page, markets).

   Fonts expected in /static/fonts/ (self-hosted, no CSP change needed):
     inter-regular.woff2   (weight 400)
     inter-semibold.woff2  (weight 600)
   Until they exist, the system font stack is used automatically.
   ========================================================================== */

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

/* ---------- Tokens ---------- */
:root {
  /* surfaces */
  --bg: #090c12;
  --panel: #11161f;
  --panel-2: #171e2a;
  --panel-3: #1e2736;
  --line: #232d3c;
  --line-strong: #33425a;

  /* text */
  --text: #eaf0f7;
  --text-soft: #c4ccd8;
  --muted: #8f9cb0;
  --faint: #6b788c;

  /* brand + semantic */
  --accent: #2dd4bf;
  --accent-2: #5eead4;
  --accent-ink: #03171a;       /* text on accent surfaces */
  --accent-soft: rgba(45, 212, 191, 0.14);
  --ok: #4ade80;
  --warn: #e3b341;
  --info: #58a6ff;
  --violet: #d2a8ff;
  --bad: #ff9a9a;

  /* shape */
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 9px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset,
            0 28px 60px -34px rgba(0, 0, 0, 0.75);

  /* type */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* layout */
  --w-narrow: 760px;
  --w-wide: 1080px;
  --gutter: 20px;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  background: var(--bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 380px at 50% -140px, rgba(45, 212, 191, 0.09), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent-soft); color: var(--text); }

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

button { font: inherit; color: inherit; }

img { max-width: 100%; }

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.skip-link:focus { top: 12px; text-decoration: none; }

/* ---------- Layout ----------
   .wrap only sets inline padding, so main's block padding is no longer
   overridden (fixes the old main/.wrap padding clash).
   Pages opt into a wider container with:
     {% block body_class %}wide{% endblock %}
   which widens header, main and footer together so they stay aligned. */
.wrap {
  width: 100%;
  max-width: var(--w-narrow);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
body.wide .wrap { max-width: var(--w-wide); }

main { flex: 1 0 auto; padding-block: 52px 80px; }

@media (max-width: 560px) {
  main { padding-block: 32px 56px; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 12, 18, 0.82);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex: 0 0 auto; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 15px;
}
.brand-mark img { display: block; width: 100%; height: 100%; }
.brand-logo { display: block; width: 28px; height: 28px; border-radius: 8px; }
.brand-text { font-weight: 600; letter-spacing: -0.02em; font-size: 17px; }

.nav {
  display: flex;
  gap: 4px;
  font-size: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.15s, background-color 0.15s;
}
.nav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); background: var(--panel-2); }

@media (max-width: 480px) {
  .nav { gap: 0; font-size: 13.5px; }
  .nav a { padding: 7px 8px; }
}

/* ---------- Hero ---------- */
.hero { margin-bottom: 32px; }
.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 6vw, 50px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.lede {
  margin: 0;
  max-width: 56ch;
  color: var(--muted);
  font-size: clamp(16px, 2.2vw, 18px);
  line-height: 1.55;
}

/* ---------- Cards ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
@media (max-width: 560px) { .card { padding: 18px; } }

.card-title { margin: 0 0 4px; font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.card-note { margin: 0 0 20px; color: var(--muted); font-size: 14px; }

/* ---------- Forms ---------- */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  color: var(--muted);
}
.field em { font-style: normal; color: var(--accent-2); }

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input::placeholder { color: var(--faint); }
.field input:hover,
.field select:hover { border-color: var(--line-strong); }
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238f9cb0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

/* ---------- Buttons ---------- */
.btn {
  width: 100%;
  min-height: 50px;
  padding: 12px 18px;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-2); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-ghost {
  width: auto;
  flex: 0 0 auto;
  min-height: 0;
  padding: 10px 16px;
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); }

/* ---------- Pillars (home proof row) ---------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 28px;
}
@media (max-width: 560px) { .pillars { grid-template-columns: 1fr; } }
.pillar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: rgba(17, 22, 31, 0.5);
}
.pillar h3 { margin: 0 0 6px; font-size: 14.5px; font-weight: 600; }
.pillar p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 0 36px;
  font-size: 13px;
}
.footer-inner { display: flex; flex-direction: column; gap: 12px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }
.footer-note { margin: 0; color: var(--faint); }

/* ---------- Alerts ---------- */
.alert {
  margin-bottom: 16px;
  padding: 11px 14px;
  border: 1px solid #7d2f2f;
  border-radius: var(--radius-sm);
  background: #2a1416;
  color: #ffb4b4;
  font-size: 14px;
}

/* ---------- Quote box (built by swap.js, also used on order page) ---------- */
.quote-box {
  margin: 6px 0 18px;
  padding: 6px 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}
.quote-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  font-size: 14px;
}
.quote-row + .quote-row { border-top: 1px solid var(--line); }
.quote-key { color: var(--muted); flex: 0 0 auto; }
.quote-val {
  text-align: right;
  word-break: break-all;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.quote-note { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }

.mono { font-family: var(--font-mono); font-size: 0.93em; }
.muted { color: var(--muted); }
.neutral { color: var(--muted); }                       /* NEW: empty values */
.hint { margin-top: 20px; font-size: 13px; color: var(--muted); }

/* ---------- Order status ---------- */
.status-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
}
.status-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.status-badge[data-status="AWAITING_DEPOSIT"] { color: var(--warn); border-color: #6b551f; }
.status-badge[data-status="DEPOSIT_SEEN"],
.status-badge[data-status="UNDERPAID"] { color: var(--info); border-color: #1f4b7d; }
.status-badge[data-status="SENT"] { color: var(--violet); border-color: #4b2f7d; }
.status-badge[data-status="COMPLETED"] { color: var(--ok); border-color: #1a7f37; }
.status-badge[data-status="EXPIRED"],
.status-badge[data-status="CANCELLED"] { color: var(--muted); }
.status-badge[data-status="FAILED"],
.status-badge[data-status="REFUNDED"] { color: var(--bad); border-color: #7d2f2f; }

/* Only the waiting states pulse, and not for people who ask for less motion. */
.status-badge[data-status="AWAITING_DEPOSIT"]::before,
.status-badge[data-status="DEPOSIT_SEEN"]::before,
.status-badge[data-status="SENT"]::before {
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.countdown { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.countdown.expired { color: var(--bad); }
.countdown.low { color: var(--warn); }                  /* NEW: optional urgency */

/* ---------- NEW: status timeline (driven entirely by data-status) ----------
   Markup:
   <div class="timeline-wrap" id="timeline" data-status="AWAITING_DEPOSIT">
     <ol class="timeline">
       <li class="tl-step">Awaiting deposit</li>
       <li class="tl-step">Deposit seen</li>
       <li class="tl-step">Sent</li>
       <li class="tl-step">Completed</li>
     </ol>
     <p class="tl-branch" data-when="UNDERPAID">...</p>
     <p class="tl-branch" data-when="FAILED">...</p> etc.
   </div>
   order.js only has to update timeline.dataset.status. */
.timeline-wrap { margin-bottom: 20px; }
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.tl-step {
  position: relative;
  padding: 26px 8px 0 0;
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--faint);
}
.tl-step::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--line-strong);
}
.tl-step::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 16px;
  right: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--line);
}
.tl-step:last-child::after { display: none; }

/* current step */
.timeline-wrap[data-status="AWAITING_DEPOSIT"] .tl-step:nth-child(1),
.timeline-wrap[data-status="DEPOSIT_SEEN"] .tl-step:nth-child(2),
.timeline-wrap[data-status="UNDERPAID"] .tl-step:nth-child(2),
.timeline-wrap[data-status="SENT"] .tl-step:nth-child(3) {
  color: var(--text);
  font-weight: 600;
}
.timeline-wrap[data-status="AWAITING_DEPOSIT"] .tl-step:nth-child(1)::before,
.timeline-wrap[data-status="DEPOSIT_SEEN"] .tl-step:nth-child(2)::before,
.timeline-wrap[data-status="UNDERPAID"] .tl-step:nth-child(2)::before,
.timeline-wrap[data-status="SENT"] .tl-step:nth-child(3)::before {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline-wrap[data-status="UNDERPAID"] .tl-step:nth-child(2)::before {
  border-color: var(--warn);
  box-shadow: 0 0 0 4px rgba(227, 179, 65, 0.16);
}

/* completed steps */
.timeline-wrap[data-status="DEPOSIT_SEEN"] .tl-step:nth-child(-n+1),
.timeline-wrap[data-status="UNDERPAID"] .tl-step:nth-child(-n+1),
.timeline-wrap[data-status="SENT"] .tl-step:nth-child(-n+2),
.timeline-wrap[data-status="COMPLETED"] .tl-step:nth-child(-n+4) {
  color: var(--muted);
}
.timeline-wrap[data-status="DEPOSIT_SEEN"] .tl-step:nth-child(-n+1)::before,
.timeline-wrap[data-status="UNDERPAID"] .tl-step:nth-child(-n+1)::before,
.timeline-wrap[data-status="SENT"] .tl-step:nth-child(-n+2)::before,
.timeline-wrap[data-status="COMPLETED"] .tl-step:nth-child(-n+4)::before {
  background: var(--accent);
  border-color: var(--accent);
}
.timeline-wrap[data-status="DEPOSIT_SEEN"] .tl-step:nth-child(-n+1)::after,
.timeline-wrap[data-status="UNDERPAID"] .tl-step:nth-child(-n+1)::after,
.timeline-wrap[data-status="SENT"] .tl-step:nth-child(-n+2)::after,
.timeline-wrap[data-status="COMPLETED"] .tl-step:nth-child(-n+4)::after {
  background: var(--accent);
}
.timeline-wrap[data-status="COMPLETED"] .tl-step:nth-child(4) { color: var(--ok); font-weight: 600; }
.timeline-wrap[data-status="COMPLETED"] .tl-step:nth-child(4)::before {
  background: var(--ok);
  border-color: var(--ok);
}

/* off-path endings dim the line and show a branch note */
.timeline-wrap[data-status="EXPIRED"] .timeline,
.timeline-wrap[data-status="CANCELLED"] .timeline,
.timeline-wrap[data-status="FAILED"] .timeline,
.timeline-wrap[data-status="REFUNDED"] .timeline { opacity: 0.4; }

.tl-branch {
  display: none;
  margin: 16px 0 0;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 13.5px;
}
.timeline-wrap[data-status="UNDERPAID"] .tl-branch[data-when~="UNDERPAID"],
.timeline-wrap[data-status="EXPIRED"] .tl-branch[data-when~="EXPIRED"],
.timeline-wrap[data-status="CANCELLED"] .tl-branch[data-when~="CANCELLED"],
.timeline-wrap[data-status="FAILED"] .tl-branch[data-when~="FAILED"],
.timeline-wrap[data-status="REFUNDED"] .tl-branch[data-when~="REFUNDED"] {
  display: block;
}
.timeline-wrap[data-status="UNDERPAID"] .tl-branch { border-color: #6b551f; background: #241f10; color: #e3c77a; }
.timeline-wrap[data-status="FAILED"] .tl-branch,
.timeline-wrap[data-status="REFUNDED"] .tl-branch { border-color: #7d2f2f; background: #2a1416; color: #ffb4b4; }

@media (max-width: 420px) {
  .tl-step { font-size: 11.5px; }
}

/* ---------- Deposit box (QR is the focal point) ---------- */
.deposit-card { border-color: #1a7f37; }
.deposit-grid {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 16px;
}
.deposit-qr {
  flex: 0 0 auto;
  width: 208px;
  height: 208px;
  padding: 10px;
  background: #fff;
  border-radius: var(--radius-sm);
  image-rendering: pixelated;        /* keeps QR modules crisp when scaled up */
}
.deposit-side { flex: 1; min-width: 0; }
@media (max-width: 560px) {
  .deposit-grid { flex-direction: column; align-items: stretch; gap: 18px; }
  .deposit-qr { align-self: center; width: min(240px, 100%); height: auto; aspect-ratio: 1; }
}

.deposit-address {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 14px;
}
.deposit-address code {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 12px 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.45;
  word-break: break-all;
}

.warn-box {
  margin-top: 12px;
  padding: 11px 14px;
  border: 1px solid #6b551f;
  border-radius: var(--radius-sm);
  background: #241f10;
  color: #e3c77a;
  font-size: 13.5px;
}

/* ---------- Tabs ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tab {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--muted);
  transition: border-color 0.15s, color 0.15s;
}
.tab:hover { text-decoration: none; border-color: var(--accent); color: var(--text); }
.tab.active { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }

/* ---------- Tables (admin + markets; .data-table is an alias for later) ---------- */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.admin-table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.admin-table th, .admin-table td,
.data-table th, .data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.admin-table tbody tr:last-child td,
.data-table tbody tr:last-child td { border-bottom: 0; }
.admin-table th,
.data-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  background: var(--panel);
}
.admin-table tbody tr:hover td,
.data-table tbody tr:hover td { background: rgba(30, 39, 54, 0.45); }
.admin-table .warn { color: var(--warn); font-weight: 600; }

/* ---------- Markets ---------- */
.market-table th, .market-table td { vertical-align: middle; }
.market-table th:nth-child(n+3) { text-align: right; }
.market-table .rank { color: var(--faint); width: 40px; }
/* td stays a real table cell; put the flex layout on .coin-inner inside it.
   (Old markup with img/spans directly in the td still renders inline.) */
.market-table .coin img { border-radius: 50%; vertical-align: middle; margin-right: 8px; }
.market-table .coin-inner { display: flex; align-items: center; gap: 10px; }
.market-table .coin-inner img { margin-right: 0; flex: none; }
.market-table .coin-name { font-weight: 600; }
.market-table .sym { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.market-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.market-table .up { color: var(--ok); }
.market-table .down { color: var(--bad); }
.market-table .neutral { color: var(--muted); }

@media (max-width: 640px) {
  .hide-sm { display: none; }                           /* NEW: drop columns on phones */
}

/* ---------- Prose pages ---------- */
.prose { max-width: 66ch; font-size: 16px; line-height: 1.7; }
.prose h1 { letter-spacing: -0.03em; }
.prose h2 { margin: 36px 0 10px; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
.prose h3 { margin: 24px 0 8px; font-size: 16px; font-weight: 600; }
.prose p { margin: 0 0 14px; color: var(--text-soft); }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; color: var(--text-soft); }
.prose li { margin-bottom: 8px; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose table {
  width: 100%;
  margin: 14px 0 20px;
  border-collapse: collapse;
  font-size: 14px;
}
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.prose th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.fee-headline { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }

.steps { list-style: none; padding-left: 0; counter-reset: step; }
.steps li {
  position: relative;
  border-left: 2px solid var(--line);
  padding: 0 0 22px 24px;
  margin-bottom: 0;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: -13px;
  top: -2px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.steps li:last-child { border-left-color: transparent; }
.steps h3 { margin: 0 0 5px; font-size: 15.5px; }

/* ==========================================================================
   NEW: swap form pieces (used by the next template, swap_form.html)
   ========================================================================== */

/* Two stacked "legs" (send / receive) with a flip button between them. */
.swap-legs { position: relative; display: grid; gap: 6px; margin-bottom: 18px; }
.swap-leg {
  padding: 14px 16px 16px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.swap-leg:hover { border-color: var(--line-strong); }
.swap-leg:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.swap-leg-label { display: block; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.swap-leg-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }

/* Large amount field. Higher specificity than ".field input" on purpose. */
.swap-leg .amount-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--text);
  font-family: inherit;
  font-size: clamp(26px, 6vw, 34px);
  font-weight: 600;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}
.swap-leg .amount-input:focus { outline: none; border: 0; box-shadow: none; }
.swap-leg .amount-input::placeholder { color: var(--faint); }
.swap-leg-hint { color: var(--faint); font-size: 14px; }

.flip-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: var(--panel-3);
  border: 4px solid var(--panel);
  box-shadow: 0 0 0 1px var(--line-strong);
  color: var(--text);
  cursor: pointer;
  transition: box-shadow 0.15s, color 0.15s;
}
.flip-btn:hover { box-shadow: 0 0 0 1px var(--accent); color: var(--accent-2); }
.flip-btn svg { width: 16px; height: 16px; transition: transform 0.25s; }
.flip-btn:active svg { transform: rotate(180deg); }

/* Custom asset picker. The native <select> stays in the DOM (swap.js reads it);
   once JS enhances the form it adds .js-picker and the select is hidden
   visually but kept for forms, events and the no-JS fallback. */
.js-picker .native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.picker { position: relative; flex: 0 0 auto; }
.picker-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
  padding: 7px 14px 7px 8px;
  background: var(--panel-3);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s;
}
.picker-btn:hover,
.picker-btn[aria-expanded="true"] { border-color: var(--accent); }
.picker-btn::after {
  content: "";
  width: 7px;
  height: 7px;
  margin: -3px 2px 0 auto;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s;
}
.picker-btn[aria-expanded="true"]::after { transform: rotate(-135deg); margin-top: 3px; }

.picker-icon {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--panel);
  object-fit: contain;
}
.picker-label { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.picker-sym { font-size: 15px; }
.picker-net { font-size: 11.5px; font-weight: 400; color: var(--muted); }

.picker-list {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  max-width: calc(100vw - 2 * var(--gutter));
  max-height: 340px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.85);
}
.picker-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
}
.picker-option:hover,
.picker-option.is-active { background: var(--panel-3); }
.picker-option[aria-selected="true"] { background: var(--accent-soft); }
.picker-option[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }
.picker-option .picker-name { font-size: 13px; color: var(--muted); margin-left: auto; text-align: right; }

.deposit-side .hint { margin-top: 0; }
.tl-branch a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* Letter badge shown when a coin icon file is missing. */
.picker-icon.is-fallback {
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
}

/* No-JS fallback: the native select is shown (and styled) until swap.js
   adds .js-picker to the form. */
form:not(.js-picker) .swap-leg .native-select {
  flex: 0 0 auto;
  max-width: 55%;
  min-height: 44px;
  padding: 8px 34px 8px 12px;
  background-color: var(--panel-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238f9cb0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
form:not(.js-picker) .swap-leg .native-select:focus-visible { outline-offset: 2px; }

/* ==========================================================================
   Landing page
   ========================================================================== */
body { overflow-x: clip; }

.landing-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 456px);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  margin-bottom: 104px;
  padding-top: 8px;
}

/* Full-width backdrop: two soft colour pools plus floating coins. */
.hero-bg {
  position: absolute;
  z-index: -1;
  top: -120px;
  bottom: -60px;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  pointer-events: none;
  background:
    radial-gradient(620px 380px at 16% 34%, rgba(45, 212, 191, 0.17), transparent 70%),
    radial-gradient(560px 360px at 86% 18%, rgba(99, 102, 241, 0.17), transparent 70%);
}

.float-coin {
  position: absolute;
  display: none;
  border-radius: 50%;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.5));
  animation: float var(--d, 7s) ease-in-out var(--delay, 0s) infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-14px) rotate(3deg); }
}

/* Coins that float in the lane between the two columns. */
.fc-3 { left: calc(50% - 10px); top: 9%; --d: 6s; --delay: -2s; }
.fc-6 { left: calc(50% + 6px); top: 90%; --d: 8s; --delay: -4s; }
@media (min-width: 900px) {
  .fc-3, .fc-6 { display: block; }
}

/* Coins that sit in the page gutters; only shown when there is room. */
.fc-1 { left: calc(50% - 612px); top: 16%; --d: 7s; }
.fc-2 { left: calc(50% - 588px); top: 70%; --d: 9s; --delay: -3s; }
.fc-4 { left: calc(50% + 566px); top: 12%; --d: 8s; --delay: -1s; }
.fc-5 { left: calc(50% + 552px); top: 68%; --d: 6.5s; --delay: -5s; }
@media (min-width: 1260px) {
  .fc-1, .fc-2, .fc-4, .fc-5 { display: block; }
}

.hero-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(36px, 5.2vw, 58px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.hero-points {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.hero-points li {
  position: relative;
  padding-left: 32px;
  color: var(--text-soft);
  font-size: 15.5px;
}
.hero-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-soft);
}
.hero-points li::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 5px;
  width: 6px;
  height: 10px;
  border-right: 2px solid var(--accent-2);
  border-bottom: 2px solid var(--accent-2);
  transform: rotate(45deg) scale(0.85);
}

.hero-swap .card {
  box-shadow: var(--shadow), 0 30px 90px -34px rgba(45, 212, 191, 0.3);
}

@media (max-width: 900px) {
  .landing-hero { grid-template-columns: minmax(0, 1fr); margin-bottom: 72px; }
}

/* ---------- Sections ---------- */
.section { margin-bottom: 96px; }
@media (max-width: 560px) { .section { margin-bottom: 64px; } }
.section-head { max-width: 60ch; margin-bottom: 28px; }
.section-head h2 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.section-head p { margin: 0; color: var(--muted); }
.section-meta { margin: 14px 0 0; font-size: 12.5px; color: var(--faint); }
.section .pillars { margin-top: 0; }

/* Popular pairs */
.pair-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 860px) { .pair-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 440px) { .pair-grid { grid-template-columns: minmax(0, 1fr); } }

.pair-card {
  display: block;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  transition: border-color 0.15s;
}
.pair-card:hover { border-color: var(--accent); text-decoration: none; }
.pair-icons { display: flex; margin-bottom: 14px; }
.pair-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 2px solid var(--panel);
}
.pair-icon + .pair-icon { margin-left: -10px; }
.pair-icon.is-fallback {
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.pair-name, .pair-rate { display: block; }
.pair-name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.pair-rate {
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* How it works: a real sequence, so numbering is meaningful here. */
.how-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: how;
}
@media (max-width: 760px) { .how-steps { grid-template-columns: minmax(0, 1fr); } }
.how-step {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  counter-increment: how;
}
.how-step::before {
  content: counter(how);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-size: 14px;
  font-weight: 600;
}
.how-step h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.how-step p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; }

/* Closing call to action */
.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(26px, 5vw, 44px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    radial-gradient(520px 240px at 100% 0%, rgba(99, 102, 241, 0.18), transparent 70%),
    radial-gradient(520px 240px at 0% 100%, rgba(45, 212, 191, 0.16), transparent 70%),
    var(--panel);
}
.cta-band h2 {
  margin: 0;
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 600;
  letter-spacing: -0.025em;
}
.cta-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0 0; font-size: 14px; }
.cta-links a { color: var(--muted); }
.cta-links a:hover { color: var(--text); }
.btn-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: 12px 28px;
}
.btn-inline:hover { text-decoration: none; }

/* ==========================================================================
   Inner pages (markets, how it works, fees, about, and every page that
   uses .hero): shared glow header, card sections, steps, fee card.
   ========================================================================== */

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

/* Same soft glow as the landing hero, applied to every page header. */
.hero { position: relative; isolation: isolate; margin-bottom: 40px; }
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -140px;
  bottom: -30px;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  pointer-events: none;
  background:
    radial-gradient(520px 260px at 20% 30%, rgba(45, 212, 191, 0.14), transparent 70%),
    radial-gradient(480px 240px at 82% 10%, rgba(99, 102, 241, 0.14), transparent 70%);
}

/* Card sections */
.doc { display: grid; gap: 16px; }
.doc-after { margin-top: 16px; }
.doc-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.doc-card h2 { margin: 0 0 10px; font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.doc-card p { margin: 0 0 12px; color: var(--text-soft); line-height: 1.65; }
.doc-card p:last-child { margin-bottom: 0; }
.doc-card a, .doc-lead a, .pillar a { text-decoration: underline; text-underline-offset: 3px; }
.doc-card .table-wrap { margin: 16px 0 0; }
.doc-card .quote-box { margin: 14px 0 0; }
.doc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .doc-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .doc-card { padding: 20px; } }

.doc-lead {
  margin: 0;
  max-width: 62ch;
  color: var(--text-soft);
  font-size: clamp(17px, 2.4vw, 20px);
  line-height: 1.55;
}
.principles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 560px) { .principles { grid-template-columns: minmax(0, 1fr); } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.chip {
  padding: 6px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 13.5px;
}

/* How it works: numbered step cards */
.stepper { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: stp; }
.step-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  counter-increment: stp;
}
.step-card::before {
  content: counter(stp);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-weight: 600;
}
.step-body h3 { margin: 4px 0 6px; font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.step-body p { margin: 0; color: var(--text-soft); line-height: 1.65; }
@media (max-width: 560px) { .step-card { padding: 18px; gap: 14px; } }

/* Fees: the big number */
.fee-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 5vw, 56px);
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    radial-gradient(420px 220px at 0% 0%, rgba(45, 212, 191, 0.16), transparent 70%),
    var(--panel);
}
.fee-main { display: grid; gap: 6px; }
.fee-label { font-size: 13px; color: var(--muted); }
.fee-figure {
  font-size: clamp(52px, 9vw, 84px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
}
.fee-text { margin: 0; color: var(--text-soft); line-height: 1.65; max-width: 48ch; }
@media (max-width: 640px) { .fee-card { grid-template-columns: minmax(0, 1fr); } }

.data-table th.num, .data-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Markets: change pill + swap button */
.market-table .pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: color-mix(in srgb, currentColor 14%, transparent);
}
.market-table .act { text-align: right; width: 1%; white-space: nowrap; }
.btn-swap {
  display: inline-block;
  padding: 6px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  transition: border-color 0.15s, color 0.15s;
}
.btn-swap:hover { border-color: var(--accent); color: var(--accent-2); text-decoration: none; }
@media (max-width: 480px) { .hide-xs { display: none; } }

/* Closing band spacing on inner pages */
.page-cta { margin-top: 64px; }

/* ==========================================================================
   Text pages: lists with icons, FAQ accordion, notes, contact rows
   ========================================================================== */

.check-list, .cross-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.check-list li, .cross-list li {
  position: relative;
  padding-left: 31px;
  color: var(--text-soft);
  line-height: 1.55;
}
.check-list li::before, .cross-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
}
.check-list li::before { background: var(--accent-soft); }
.check-list li::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  width: 6px;
  height: 10px;
  border-right: 2px solid var(--accent-2);
  border-bottom: 2px solid var(--accent-2);
  transform: rotate(45deg) scale(0.85);
}
.cross-list li::before { background: rgba(255, 154, 154, 0.14); }
.cross-list li::after {
  content: "\00d7";
  position: absolute;
  left: 0;
  top: 2px;
  width: 20px;
  line-height: 20px;
  text-align: center;
  font-size: 16px;
  color: var(--bad);
}

.parties { list-style: none; margin: 0; padding: 0; }
.parties li {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  line-height: 1.55;
}
.parties li:first-child { border-top: 0; padding-top: 4px; }
.parties strong { color: var(--text); font-weight: 600; }
@media (max-width: 560px) { .parties li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

.doc-card-note { border-color: #6b551f; background: #17140c; }
.doc-card-note h2 { color: #e3c77a; }

/* FAQ accordion (native <details>, no JS) */
.faq { display: grid; gap: 10px; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.faq-item[open] { border-color: var(--line-strong); }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: -3px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s;
}
.faq-item[open] summary::after { transform: rotate(-135deg); margin-top: 3px; }
.faq-item summary:hover { color: var(--accent-2); }
.faq-body { padding: 0 22px 20px; }
.faq-body p { margin: 0; color: var(--text-soft); line-height: 1.65; max-width: 62ch; }
.faq-body a { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 560px) {
  .faq-item summary { padding: 16px 18px; }
  .faq-body { padding: 0 18px 18px; }
}

/* Contact */
.contact-rows { display: grid; gap: 10px; margin: 18px 0; }
.contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--text);
  transition: border-color 0.15s;
}
.contact-row:hover { border-color: var(--accent); text-decoration: none; }
.contact-label { color: var(--muted); font-size: 13.5px; }
.contact-value { font-weight: 600; word-break: break-all; text-align: right; }

/* Reserves */
.reserves-table .mono { word-break: break-all; min-width: 220px; font-size: 12.5px; }

/* ==========================================================================
   Phone fixes
   ========================================================================== */

/* Header: brand on the first row, all four nav links on a second row. */
@media (max-width: 560px) {
  .header-inner { height: auto; flex-wrap: wrap; row-gap: 2px; padding-block: 10px 8px; }
  .nav { width: 100%; justify-content: space-between; overflow: visible; font-size: 14px; }
  .nav a { padding: 7px 10px; }
}

/* Markets: each coin becomes a compact two-line row, so nothing needs a sideways scroll.
     [logo  BTC Bitcoin ........ Swap]
     [$97,000.50 ........... +1.20%  ]  */
@media (max-width: 640px) {
  .market-table,
  .market-table tbody,
  .market-table tr,
  .market-table td { display: block; }
  .market-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .market-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "coin act" "price chg";
    align-items: center;
    gap: 8px 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
  }
  .market-table tbody tr:last-child { border-bottom: 0; }
  .market-table tbody tr:hover { background: rgba(30, 39, 54, 0.45); }
  .market-table tbody tr:hover td { background: none; }
  .market-table tbody td { padding: 0; border: 0; }
  .market-table .rank { display: none; }
  .market-table .coin { grid-area: coin; }
  .market-table .act { grid-area: act; width: auto; }
  .market-table td.price { grid-area: price; text-align: left; font-size: 15px; font-weight: 600; }
  .market-table td.chg { grid-area: chg; text-align: right; }
}

/* Reserves: each wallet becomes a card, with the long address on its own line.
     [BTC Bitcoin ............ Balance 1.5 ]
     [Hot wallet .... Updated 2026-11-26 10:30]
     [bc1q...address wraps here             ]  */
@media (max-width: 760px) {
  .reserves-table,
  .reserves-table tbody,
  .reserves-table tr,
  .reserves-table td { display: block; }
  .reserves-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .reserves-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "asset bal" "label upd" "addr addr";
    align-items: baseline;
    gap: 4px 14px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
  }
  .reserves-table tbody tr:last-child { border-bottom: 0; }
  .reserves-table tbody tr:hover td { background: none; }
  .reserves-table tbody td { padding: 0; border: 0; }
  .reserves-table .r-asset { grid-area: asset; font-size: 16px; }
  .reserves-table .r-bal { grid-area: bal; text-align: right; font-size: 16px; font-weight: 600; }
  .reserves-table .r-label { grid-area: label; font-size: 13px; color: var(--muted); }
  .reserves-table .r-upd { grid-area: upd; text-align: right; font-size: 12.5px; }
  .reserves-table .r-addr {
    grid-area: addr;
    min-width: 0;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    background: var(--panel-2);
    font-size: 12px;
    word-break: break-all;
  }
  .reserves-table td[data-label]::before {
    content: attr(data-label) " ";
    color: var(--faint);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
}

/* Reserves: "live" tag next to on-chain balances */
.live-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

/* Landing headline: second line in the accent colour */
.hero-accent {
  display: block;
  margin-top: 10px;
  color: var(--accent-2);
  font-size: 0.46em;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

/* Fees example: let the long label wrap, and keep each amount on one line.
   (The default quote-box breaks values anywhere, which suits long addresses
   but split short amounts like $999.00 into single characters.) */
.doc-card .quote-row { align-items: baseline; }
.doc-card .quote-key { flex: 1 1 auto; min-width: 0; }
.doc-card .quote-val { flex: 0 0 auto; white-space: nowrap; word-break: normal; }

/* Markets: letter badge when a coin icon file is missing */
.market-table .coin-icon { flex: none; border-radius: 50%; }
.market-table .coin-icon.is-fallback {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

/* ==========================================================================
   Admin
   ========================================================================== */
.nav.nav-wrap { flex-wrap: wrap; overflow: visible; justify-content: flex-start; }
.login-card { max-width: 380px; }
.warn-text { color: var(--warn); font-weight: 600; }
.admin-table .mono { word-break: break-all; }

/* Order detail: details on the left, the action on the right. */
.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (min-width: 901px) {
  .admin-grid > .card { position: sticky; top: 88px; }
}
@media (max-width: 900px) {
  .admin-grid { grid-template-columns: minmax(0, 1fr); }
}

.form-section { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }

/* Success message in the alert box (admin "Saved.") */
.alert.alert-ok { border-color: #1a7f37; background: #0f2417; color: #7ee2a0; }

/* 404 and "order not found" pages */
.notfound-code {
  margin: 0 0 6px;
  font-size: clamp(76px, 20vw, 150px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.06em;
  color: var(--accent-2);
}
.notfound-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-top: 26px;
}
.doc .notfound-actions { margin-top: 4px; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}