:root {
  --bg: #0a0d0b;
  --surface: #0e1210;
  --surface-2: #121815;
  --border: rgba(244, 247, 242, 0.08);
  --border-strong: rgba(244, 247, 242, 0.16);
  --text: #f4f7f2;
  --text-dim: #97a39b;
  --accent: #22e06b;
  --accent-dim: rgba(34, 224, 107, 0.14);
  --danger: #ff6b6b;
  --warn: #ffd166;
  --radius: 16px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 32px 20px 80px; }
@media (max-width: 460px) {
  .wrap { padding: 20px 16px 64px; }
}

/* typography */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; line-height: 1.05; }
h1 { font-size: clamp(34px, 6vw, 56px); margin: 0 0 8px; }
h2 { font-size: 26px; margin: 0 0 16px; }
.lede { color: var(--text-dim); max-width: 560px; margin: 0 0 32px; font-size: 17px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 11px; color: var(--accent); font-weight: 700; }

/* header */
header.top { display: flex; align-items: center; justify-content: space-between; padding: 24px 0 8px; }
.brand { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.brand .dot { color: var(--accent); }
.tabs { display: flex; gap: 4px; }
.tab { padding: 9px 18px; border-radius: 999px; cursor: pointer; color: var(--text-dim); font-weight: 600; font-size: 14px; border: 1px solid transparent; }
.tab.active { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.tab:hover { color: var(--text); }

/* cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}
.card h3 { margin-top: 0; font-size: 20px; }
@media (max-width: 460px) { .card { padding: 20px; } }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; border: 1px solid var(--border-strong);
  padding: 13px 26px; font-size: 15px; font-weight: 700; cursor: pointer;
  background: var(--surface-2); color: var(--text); font-family: var(--font);
  transition: transform .06s ease, background .12s ease, border-color .12s ease;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #05260f; }
.btn.primary:hover { background: #3ceb7d; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: rgba(255,107,107,0.4); }
.btn.small { padding: 8px 16px; font-size: 13px; }
.btn.block { width: 100%; }

/* forms */
.field { margin-bottom: 16px; }
label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }
input, select, textarea {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 13px 16px; color: var(--text); font-family: var(--font); font-size: 15px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 84px; resize: vertical; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat .k { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.stat .v { font-size: 24px; font-weight: 700; font-family: var(--serif); margin-top: 4px; }

/* asset picker */
.assets { display: flex; flex-direction: column; gap: 10px; }
.asset {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; cursor: pointer; background: var(--surface-2);
}
.asset:hover { border-color: var(--accent); }
.asset.sel { border-color: var(--accent); background: var(--accent-dim); }
.asset .name { font-weight: 700; }
.asset .meta { font-size: 12px; color: var(--text-dim); }
.asset .bal { font-weight: 700; text-align: right; }

/* two-sided amount */
.amount-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
@media (max-width: 460px) { .amount-grid { grid-template-columns: 1fr; } }
.amount-grid .swap { text-align: center; color: var(--text-dim); font-size: 18px; }
.amount-grid .swap span { color: var(--accent); }

/* quote / total */
.quote-line { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.quote-line .v { font-weight: 700; }
.quote-line.dim { color: var(--text-dim); }
.all-in { font-size: 20px; font-weight: 700; font-family: var(--serif); }

/* referrer line */
.referrer { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: var(--accent-dim); color: var(--accent); font-weight: 600; font-size: 13px; }

/* status panel */
.status-steps { display: flex; flex-direction: column; gap: 0; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; }
.step .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); flex: 0 0 auto; margin-top: 1px; }
.step.done .dot { background: var(--accent); border-color: var(--accent); }
.step.active .dot { border-color: var(--accent); }
.step .t { font-weight: 700; font-size: 14px; }
.step .s { font-size: 13px; color: var(--text-dim); }
.hash { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--text-dim); word-break: break-all; }
.delay-note { margin-top: 12px; padding: 12px 16px; border-radius: 12px; background: var(--warn); color: #3a2e00; font-size: 13px; font-weight: 600; }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
td .code { font-family: ui-monospace, Menlo, monospace; }
tr:hover td { background: rgba(244,247,242,0.02); }
.scroll-x { overflow-x: auto; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; }
.badge.paid, .badge.delivered, .badge.approved { background: var(--accent-dim); color: var(--accent); }
.badge.pending, .badge.applied { background: rgba(255,209,102,0.15); color: var(--warn); }
.badge.claimable { background: rgba(34,224,107,0.08); color: var(--accent); }
.badge.refunded, .badge.failed_treasury, .badge.rejected { background: rgba(255,107,107,0.15); color: var(--danger); }
.badge.quoting, .badge.awaiting_inbound, .badge.inbound_confirmed, .badge.treasury_sending { background: rgba(151,163,155,0.15); color: var(--text-dim); }

/* treasury banner + state badges */
#treasury-banner { margin: 6px 0 0; }
.alert { border-radius: 12px; padding: 14px 18px; margin-bottom: 14px; font-weight: 600; border: 1px solid var(--border); }
.alert-warning { background: rgba(255,209,102,0.12); color: var(--warn); border-color: rgba(255,209,102,0.3); }
.alert-critical { background: rgba(255,107,107,0.14); color: var(--danger); border-color: rgba(255,107,107,0.3); }
.badge.ok { background: var(--accent-dim); color: var(--accent); }
.badge.warning { background: rgba(255,209,102,0.15); color: var(--warn); }
.badge.critical { background: rgba(255,107,107,0.15); color: var(--danger); }

/* misc */
.muted { color: var(--text-dim); }
.mono { font-family: ui-monospace, Menlo, monospace; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.notice { padding: 14px 18px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 16px; font-size: 14px; }
.notice.error { border-color: rgba(255,107,107,0.4); color: var(--danger); }
.notice.ok { border-color: var(--accent); color: var(--accent); }
.countdown { font-size: 12px; color: var(--text-dim); }
.qrbox { background: #fff; padding: 14px; border-radius: 12px; display: inline-block; }
.qrbox canvas, .qrbox img { display: block; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .split { grid-template-columns: 1fr; } }
.footnote { font-size: 12px; color: var(--text-dim); margin-top: 24px; }
.wallet-pill { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); padding: 4px 10px; border-radius: 999px; }

/* WalletConnect — brand blue, deliberately distinct from the green primary */
.btn.wc {
  background: #3B99FC;
  border-color: #3B99FC;
  color: #06182b;
  font-weight: 600;
}
.btn.wc:hover { background: #57a9fd; border-color: #57a9fd; }
.btn.wc:active { transform: scale(0.98); }
.btn.wc::before {
  content: "";
  display: inline-block;
  width: 14px; height: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  background: currentColor;
  -webkit-mask: radial-gradient(circle at 30% 70%, #000 0 3px, transparent 3px),
                radial-gradient(circle at 70% 70%, #000 0 3px, transparent 3px),
                radial-gradient(circle at 50% 30%, #000 0 3px, transparent 3px);
  mask: radial-gradient(circle at 30% 70%, #000 0 3px, transparent 3px),
        radial-gradient(circle at 70% 70%, #000 0 3px, transparent 3px),
        radial-gradient(circle at 50% 30%, #000 0 3px, transparent 3px);
}

/* hero copy */
.subline { color: var(--muted); font-size: 17px; line-height: 1.55; margin: 14px 0 0; max-width: 34ch; }
.tokenline {
  display: inline-flex; align-items: center; gap: 9px;
  margin: 18px 0 0; padding: 7px 15px 7px 12px;
  border: 1px solid rgba(211,169,113,.32); border-radius: 999px;
  background: rgba(211,169,113,.07);
  color: #d3a971; font-size: 13.5px; letter-spacing: .01em;
}
.gold-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: #d3a971; box-shadow: 0 0 8px rgba(211,169,113,.75);
}
@media (max-width: 520px) { .subline { font-size: 15.5px; } .tokenline { font-size: 12.5px; } }

/* ---------------------------------------------------------------- chrome */
.logo-img { width: 30px; height: 30px; display: block; flex: none; }
.topbar { display: flex; align-items: center; gap: 11px; padding: 18px 0 0; }
.wordmark { font-weight: 700; letter-spacing: .02em; color: #f4f7f2; }
header img.logo-img { display: inline-block; vertical-align: middle; margin-right: 11px; }

.site-footer {
  /* match .wrap's content column so the left edge lines up with the page above */
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 64px;
  padding: 30px 20px 44px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex; flex-direction: column; gap: 14px; align-items: flex-start;
}
.footer-logo { width: 42px; height: 42px; flex: none; opacity: .9; }
.footer-body { flex: 1; min-width: 0; }
.footer-brand { font-size: 15px; font-weight: 650; color: #f4f7f2; letter-spacing: .01em; }
.footer-brand span { color: #22e06b; font-weight: 500; }
.footer-line { color: #97a39b; font-size: 12.5px; margin: 5px 0 0; }
.footer-links { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 7px 16px; }
.footer-links a { color: #cfd8d2; font-size: 12.5px; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.14); }
.footer-links a:hover { color: #22e06b; border-color: #22e06b; }
.footer-risk { color: #6f7d75; font-size: 11.5px; line-height: 1.55; margin: 14px 0 0; max-width: 62ch; }

@media (max-width: 520px) {
  .site-footer { gap: 12px; margin-top: 44px; padding-left: 16px; padding-right: 16px; }
  .footer-logo { width: 34px; height: 34px; }
}

.footer-credit {
  margin: 16px 0 0; padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.05);
  color: #5c6a61; font-size: 11px; letter-spacing: .03em; text-transform: uppercase;
}

/* ---------------------------------------------------------- alignment baseline
   Everything shares one left edge. Anything added later inherits it. */
#checkout, #panel-ref, .site-footer > * { text-align: left; }
.eyebrow, h1, .subline, .tokenline, .lede { margin-left: 0; margin-right: 0; }
nav.tabs, header { text-align: left; }

/* ---------------------------------------------------- no horizontal scroll
   A long referral URL inside a flex row will push the whole document wider
   than the viewport unless the text is allowed to break and the flex item is
   allowed to shrink. Both rules are required. */
html, body { max-width: 100%; overflow-x: hidden; }
.wrap, .card, section, .split, .row { min-width: 0; }
.row, .split { flex-wrap: wrap; }

a, code, pre, .mono, .addr, .share-link, .code,
[id*="link"], [class*="link"] {
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

/* the referral code + share link strip specifically */
#code-badge, #share-link, .ref-code, .ref-link { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 520px) {
  h1 { font-size: 30px; }
}
