/* RoundTrip — testnet bridge interface */

:root {
  /* Plain values first so engines without clamp() still get a sane scale. */
  --text-xs: 0.78rem;
  --text-sm: 0.86rem;
  --text-base: 0.98rem;
  --text-lg: 1.12rem;
  --text-xl: 1.7rem;
  --text-2xl: 2.6rem;

  --text-xs: clamp(0.75rem, 0.7rem + 0.2vw, 0.8125rem);
  --text-sm: clamp(0.82rem, 0.78rem + 0.2vw, 0.9rem);
  --text-base: clamp(0.95rem, 0.9rem + 0.25vw, 1.02rem);
  --text-lg: clamp(1.05rem, 1rem + 0.4vw, 1.25rem);
  --text-xl: clamp(1.4rem, 1.15rem + 1vw, 2rem);
  --text-2xl: clamp(2rem, 1.4rem + 2.4vw, 3.4rem);
  --header-h: 60px;

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --space-12: 3rem; --space-16: 4rem;

  --color-bg: #eef4f6;
  --color-bg-accent: linear-gradient(165deg, #e4f3ef 0%, #eef4f6 48%, #e7eff7 100%);
  --color-surface: #ffffff;
  --color-surface-2: #f7fafb;
  --color-surface-3: #eef4f6;
  --color-divider: #dde7ea;
  --color-border: #cfdde3;

  --color-text: #0f2b46;
  --color-text-muted: #55708a;
  --color-text-faint: #576f87;

  --color-primary: #0c8275;
  --color-on-primary: #ffffff;
  --color-primary-hover: #0a746a;
  --color-primary-soft: #d8f1ec;
  --color-primary-ghost: rgba(12, 130, 117, 0.08);

  --color-success: #1a7a45;
  --color-success-soft: #dff2e4;
  --color-error: #b23a3a;
  --color-error-soft: #fbe3e3;
  --color-warning: #96601a;
  --color-warning-soft: #fdefd8;
  --color-info: #1d6fb8;
  --color-info-soft: #e0edf9;

  --header-bg: rgba(255, 255, 255, 0.84);
  --hero-glow-a: rgba(12, 130, 117, 0.16);
  --hero-glow-b: rgba(29, 111, 184, 0.1);
  --input-bg: #ffffff;
  --toast-bg: #12283d;
  --toast-text: #eaf3f7;
  --toast-err-bg: #5c1f1f;
  --overlay: rgba(15, 43, 70, 0.45);
  --shadow-sm: 0 1px 2px rgba(15, 43, 70, 0.06);
  --shadow-md: 0 6px 20px rgba(15, 43, 70, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 43, 70, 0.14);

  --radius-sm: 0.4rem;
  --radius-md: 0.65rem;
  --radius-lg: 0.9rem;
  --radius-xl: 1.3rem;

  --font-body: 'General Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme='midnight'] {
  --color-bg: #0b1220;
  --color-bg-accent: radial-gradient(1200px 600px at 15% -10%, #10263a 0%, #0b1220 55%, #0a101c 100%);
  --color-surface: #111a2c;
  --color-surface-2: #0d1526;
  --color-surface-3: #16213a;
  --color-divider: #1c2942;
  --color-border: #26365a;

  --color-text: #dde6f2;
  --color-text-muted: #93a4bd;
  --color-text-faint: #788aa2;

  --color-primary: #2dd4bf;
  --color-on-primary: #05251f;
  --color-primary-hover: #5ce8d5;
  --color-primary-soft: #12403a;
  --color-primary-ghost: rgba(45, 212, 191, 0.16);

  --color-success: #4ade80;
  --color-success-soft: #14301f;
  --color-error: #f87171;
  --color-error-soft: #3a1a1a;
  --color-warning: #fbbf24;
  --color-warning-soft: #33290f;
  --color-info: #60a5fa;
  --color-info-soft: #14294a;

  --header-bg: rgba(11, 18, 32, 0.86);
  --hero-glow-a: rgba(45, 212, 191, 0.14);
  --hero-glow-b: rgba(96, 165, 250, 0.1);
  --input-bg: #0d1526;
  --toast-bg: #1c2a44;
  --toast-text: #e2e8f0;
  --toast-err-bg: #4c1d1d;
  --overlay: rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
}

[data-theme='aurora'] {
  --color-bg: #f2effb;
  --color-bg-accent: linear-gradient(165deg, #efe9fb 0%, #f4f1fc 45%, #eaf0fd 100%);
  --color-surface: #ffffff;
  --color-surface-2: #f8f6fd;
  --color-surface-3: #efeaf9;
  --color-divider: #e4ddf4;
  --color-border: #d8d0ee;
  --color-text: #2a2140;
  --color-text-muted: #655c7e;
  --color-text-faint: #6f6389;
  --color-primary: #7c5cd6;
  --color-primary-hover: #6b4cc4;
  --color-primary-soft: #e9e2fa;
  --color-primary-ghost: rgba(124, 92, 214, 0.12);
  --color-success: #1a7a45;
  --color-success-soft: #e2f4e8;
  --color-error: #b0483c;
  --color-error-soft: #fae4e0;
  --color-warning: #8a5a16;
  --color-warning-soft: #f7ecd6;
  --color-info: #5b5bd6;
  --color-info-soft: #e6e4fa;
  --header-bg: rgba(255, 255, 255, 0.84);
  --hero-glow-a: rgba(124, 92, 214, 0.14);
  --hero-glow-b: rgba(91, 141, 239, 0.12);
  --input-bg: #ffffff;
  --overlay: rgba(42, 33, 64, 0.45);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--color-bg);
  background-image: var(--color-bg-accent);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Fixed attachment forces a repaint on every scroll frame on phones, and iOS
   ignores it anyway, so only desktop pointers keep the parallax feel. */
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  body { background-attachment: fixed; }
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
code, .mono { font-family: var(--font-mono); font-size: 0.86em; }

.skip-link {
  position: absolute; left: 0; top: 0; z-index: 100; transform: translateY(-120%);
  background: var(--color-surface); padding: 0.6rem 1rem; border-radius: 0 0 var(--radius-md) 0;
}
.skip-link:focus { transform: none; }

/* `clip` keeps sticky headers alive, `hidden` is the fallback for engines that
   predate it. Both are declared so the older value wins only where needed. */
html, body { overflow-x: hidden; }
@supports (overflow: clip) {
  html, body { overflow-x: clip; }
}

/* Header ------------------------------------------------------------------ */
.header {
  position: -webkit-sticky;
  position: sticky; top: 0; z-index: 40;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--color-divider);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .header { background: #f8fbfc; }
}
.header-inner {
  max-width: 1180px; margin: 0 auto; padding: 0.7rem var(--space-5);
  display: flex; align-items: center; gap: var(--space-5);
}
.brand { display: inline-flex; align-items: center; gap: 0.65rem; flex-shrink: 0; }
.brand-mark { border-radius: 10px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 1.02rem; letter-spacing: -0.02em; }
.brand-sub { font-size: 0.7rem; color: var(--color-text-muted); letter-spacing: 0.02em; }
.brand-sub .sep { opacity: 0.45; margin: 0 0.15rem; }

.nav { display: flex; gap: 0.15rem; margin-left: var(--space-4); }
.nav-link {
  padding: 0.45rem 0.75rem; border-radius: 999px; font-size: 0.88rem;
  color: var(--color-text-muted); transition: var(--transition);
}
.nav-link:hover { color: var(--color-text); background: var(--color-primary-ghost); }
.nav-link.is-active { color: var(--color-primary); background: var(--color-primary-ghost); font-weight: 500; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; }

.net-pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.75rem; border-radius: 999px;
  border: 1px solid var(--color-border); background: var(--color-surface);
  font-size: 0.8rem; color: var(--color-text-muted); cursor: pointer;
  transition: var(--transition); max-width: 180px;
}
.net-pill:hover { border-color: var(--color-primary); color: var(--color-text); }
.net-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-text-faint); flex-shrink: 0; }
.net-pill .dot.ok { background: var(--color-success); box-shadow: 0 0 0 3px var(--color-success-soft); }
.net-pill .dot.warn { background: var(--color-warning); box-shadow: 0 0 0 3px var(--color-warning-soft); }
#net-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.theme-switch { display: inline-flex; gap: 3px; align-items: center; padding-right: 0.2rem; }
.theme-dot {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--color-border);
  padding: 0; cursor: pointer; transition: var(--transition);
}
.theme-dot:hover { transform: scale(1.1); }
.theme-dot[aria-pressed='true'] { border-color: var(--color-primary); }
.theme-dot.t-emerald { background: linear-gradient(135deg, #e6f5f1, #0c8275); }
.theme-dot.t-midnight { background: linear-gradient(135deg, #0b1220, #2dd4bf); }
.theme-dot.t-aurora { background: linear-gradient(135deg, #7c5cd6, #5b8def); }

/* Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border: 1px solid transparent; border-radius: var(--radius-md);
  padding: 0.62rem 1.05rem; font-size: 0.9rem; font-weight: 500;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
  background: var(--color-surface); color: var(--color-text);
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary { background: var(--color-primary); color: var(--color-on-primary); box-shadow: var(--shadow-sm); }
.btn.primary:hover:not(:disabled) { background: var(--color-primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn.secondary { background: var(--color-primary-soft); color: var(--color-primary); }
.btn.secondary:hover:not(:disabled) { background: var(--color-primary-ghost); }
.btn.ghost { background: transparent; border-color: var(--color-border); color: var(--color-text); }
.btn.ghost:hover:not(:disabled) { border-color: var(--color-primary); color: var(--color-primary); }
.btn.danger, .btn.ghost.danger { color: var(--color-error); }
.btn.ghost.danger:hover:not(:disabled) { border-color: var(--color-error); background: var(--color-error-soft); }
.btn.small { padding: 0.4rem 0.7rem; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn.block { width: 100%; padding: 0.8rem 1rem; font-size: 0.95rem; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after {
  content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--color-on-primary-soft, rgba(255,255,255,0.4)); border-top-color: var(--color-on-primary);
  animation: spin 700ms linear infinite;
}
.btn.secondary.loading::after, .btn.ghost.loading::after { border-color: var(--color-border); border-top-color: var(--color-primary); }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); border: 1px solid var(--color-border); background: var(--color-surface-2);
  color: var(--color-text-muted); cursor: pointer; transition: var(--transition); flex-shrink: 0;
}
.icon-btn:hover { color: var(--color-primary); border-color: var(--color-primary); }

.link-btn { background: none; border: none; color: var(--color-primary); font-size: 0.78rem; cursor: pointer; padding: 0; font-weight: 500; }
.link { color: var(--color-primary); font-size: 0.82rem; }
.link:hover { text-decoration: underline; }

/* Layout ------------------------------------------------------------------ */
.page { padding: var(--space-8) var(--space-5) var(--space-16); }
.container { max-width: 1180px; margin: 0 auto; }

.notice {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.8rem 1rem; border-radius: var(--radius-md);
  background: var(--color-warning-soft); color: var(--color-warning);
  border: 1px solid rgba(150, 96, 26, 0.3);
  font-size: 0.85rem; margin-bottom: var(--space-5);
}
.notice strong { font-weight: 600; }
.notice span { flex: 1; min-width: 200px; color: var(--color-text-muted); }
.notice code { background: rgba(0,0,0,0.05); padding: 0.05rem 0.3rem; border-radius: 4px; }
.hidden { display: none !important; }

/* Hero -------------------------------------------------------------------- */
.hero {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: var(--space-10);
  align-items: start; padding: var(--space-6) 0 var(--space-12);
  position: relative;
}
.hero::before {
  content: ''; position: absolute; top: -60px; right: -80px; left: -80px; bottom: auto;
  height: 420px; z-index: -1;
  background:
    radial-gradient(420px 240px at 12% 20%, var(--hero-glow-a), transparent 70%),
    radial-gradient(380px 220px at 65% 0%, var(--hero-glow-b), transparent 70%);
  pointer-events: none;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--color-text-muted); border: 1px solid var(--color-border);
  background: var(--color-surface); padding: 0.3rem 0.65rem; border-radius: 999px;
}
.eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-primary); }
.hero h1 { font-size: var(--text-2xl); margin: var(--space-5) 0 var(--space-4); letter-spacing: -0.035em; }
.grad {
  background: linear-gradient(100deg, var(--color-primary), #1d6fb8 55%, var(--color-primary));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { color: var(--color-text-muted); max-width: 44ch; font-size: var(--text-base); }

.route-strip {
  display: flex; align-items: center; gap: var(--space-4);
  margin-top: var(--space-8); padding: 0.9rem 1rem;
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-surface); box-shadow: var(--shadow-sm); width: fit-content;
}
.route-end { display: flex; align-items: center; gap: 0.6rem; }
.route-end strong { display: block; font-size: 0.88rem; font-weight: 600; }
.route-end span { display: block; font-size: 0.72rem; color: var(--color-text-muted); }
.route-arrows { color: var(--color-primary); opacity: 0.8; }

.facts { display: flex; gap: var(--space-6); list-style: none; padding: 0; margin: var(--space-6) 0 0; }
.facts li { display: flex; flex-direction: column; gap: 0.1rem; }
.facts span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-faint); }
.facts strong { font-size: 0.9rem; font-weight: 500; }

/* Cards ------------------------------------------------------------------- */
.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-md);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-5); }
.card-head h2 { font-size: var(--text-lg); }

.badge {
  font-size: 0.72rem; letter-spacing: 0.03em; padding: 0.25rem 0.55rem; border-radius: 999px;
  background: var(--color-primary-soft); color: var(--color-primary); font-weight: 500; white-space: nowrap;
}
.badge.soft { background: var(--color-surface-3); color: var(--color-text-muted); }
.badge.ok { background: var(--color-success-soft); color: var(--color-success); }
.badge.warn { background: var(--color-warning-soft); color: var(--color-warning); }
.badge.err { background: var(--color-error-soft); color: var(--color-error); }

/* Bridge card ------------------------------------------------------------- */
.bridge-card { padding: var(--space-6); }
.chain-selects { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--space-2); align-items: end; }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field-label { font-size: 0.75rem; color: var(--color-text-muted); font-weight: 500; }
.field-label .hint { color: var(--color-text-faint); font-weight: 400; }
.select-wrap, .copy-row { position: relative; display: flex; align-items: center; gap: 0.4rem; }
.select-wrap {
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--input-bg); padding: 0.45rem 0.55rem; transition: var(--transition);
}
.select-wrap:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-ghost); }
.select-wrap img { flex-shrink: 0; border-radius: 50%; }
.select-wrap select {
  appearance: none; border: none; background: transparent; color: var(--color-text);
  font-size: 0.86rem; font-weight: 500; width: 100%; padding: 0.1rem 1.1rem 0.1rem 0; cursor: pointer;
}
.select-wrap .chev { position: absolute; right: 0.5rem; color: var(--color-text-muted); pointer-events: none; }

.swap-btn {
  width: 34px; height: 34px; margin-bottom: 0.15rem; border-radius: 50%;
  border: 1px solid var(--color-border); background: var(--color-surface-2);
  color: var(--color-text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.swap-btn:hover { color: var(--color-primary); border-color: var(--color-primary); transform: rotate(180deg); }

.balance-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin: var(--space-4) 0 var(--space-5); }
.balance {
  background: var(--color-surface-2); border: 1px solid var(--color-divider);
  border-radius: var(--radius-md); padding: 0.55rem 0.7rem;
  display: flex; flex-direction: column; gap: 0.1rem;
}
.balance span { font-size: 0.72rem; color: var(--color-text-muted); }
.balance strong { font-size: 0.95rem; font-family: var(--font-mono); font-weight: 500; }

.amount-field { display: block; margin-bottom: var(--space-4); }
.amount-input {
  display: flex; align-items: center; gap: 0.5rem; margin-top: 0.35rem;
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--input-bg); padding: 0.6rem 0.75rem; transition: var(--transition);
}
.amount-input:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-ghost); }
.amount-input input {
  border: none; background: transparent; color: var(--color-text); font-size: 1.25rem;
  font-family: var(--font-mono); width: 100%; padding: 0; outline: none;
}
.amount-symbol { font-size: 0.85rem; color: var(--color-text-muted); font-weight: 500; }

input[type='text'] {
  width: 100%; border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--input-bg); color: var(--color-text); padding: 0.6rem 0.7rem;
  font-size: 0.86rem; font-family: var(--font-mono); transition: var(--transition); outline: none;
}
input[type='text']:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-ghost); }
.copy-row input { flex: 1; }
.recipient-field { margin-bottom: var(--space-4); }
.recipient-field input { margin-top: 0.35rem; }

.gas-hint {
  display: flex; align-items: flex-start; gap: 0.45rem; margin-bottom: var(--space-3);
  padding: 0.55rem 0.7rem; border-radius: var(--radius-md);
  background: var(--color-warning-soft); color: var(--color-warning); font-size: 0.78rem;
}
.gas-hint svg { flex-shrink: 0; margin-top: 1px; }
.gas-hint a { text-decoration: underline; }

.card-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
  margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px dashed var(--color-divider);
  font-size: 0.72rem; color: var(--color-text-faint);
}

/* Progress ---------------------------------------------------------------- */
.progress { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--color-divider); }
.progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; margin-bottom: var(--space-4); }
.progress-head strong { font-size: 0.9rem; }
.progress-head .mono { color: var(--color-text-faint); font-size: 0.72rem; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.step {
  display: grid; grid-template-columns: 22px 1fr; gap: 0.65rem; position: relative;
  padding-bottom: 1.1rem;
}
.step:last-child { padding-bottom: 0; }
.step::before {
  content: ''; position: absolute; left: 10px; top: 20px; bottom: 0; width: 1px; background: var(--color-divider);
}
.step:last-child::before { display: none; }
.step-dot {
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--color-border);
  background: var(--color-surface); margin-top: 1px; position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.6rem;
}
.step.done .step-dot { background: var(--color-success); border-color: var(--color-success); }
.step.done .step-dot::after { content: '✓'; color: #fff; font-size: 0.7rem; line-height: 1; }
.step.active .step-dot { border-color: var(--color-primary); box-shadow: 0 0 0 4px var(--color-primary-ghost); }
.step.active .step-dot::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary); animation: pulse 1.2s infinite; }
.step.err .step-dot { background: var(--color-error); border-color: var(--color-error); }
.step.err .step-dot::after { content: '!'; color: #fff; font-size: 0.7rem; }
@keyframes pulse { 50% { opacity: 0.35; } }
.step-line { display: flex; align-items: center; gap: 0.5rem; }
.step-line strong { font-size: 0.85rem; font-weight: 600; }
.step-state { font-size: 0.72rem; color: var(--color-text-faint); }
.step.done .step-state { color: var(--color-success); }
.step.active .step-state { color: var(--color-primary); }
.step.err .step-state { color: var(--color-error); }
.step-body p { font-size: 0.76rem; color: var(--color-text-muted); margin-top: 0.15rem; }
.tx-link { display: inline-block; font-size: 0.74rem; color: var(--color-primary); margin-top: 0.25rem; font-family: var(--font-mono); }
.progress-actions { display: flex; gap: 0.5rem; margin-top: var(--space-4); }

/* Panels ------------------------------------------------------------------ */
.panel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); margin-bottom: var(--space-12); }
.panel { padding: var(--space-5); display: flex; flex-direction: column; }
.panel-text { font-size: 0.82rem; color: var(--color-text-muted); margin-bottom: var(--space-4); min-height: 3.2em; }
.panel .field { margin-bottom: var(--space-3); }
.panel .btn.block { margin-top: auto; }
.panel .field + .btn.block { margin-top: 0.25rem; }
.mini-row { display: flex; gap: var(--space-3); margin-bottom: var(--space-4); }
.mini { flex: 1; background: var(--color-surface-2); border: 1px solid var(--color-divider); border-radius: var(--radius-md); padding: 0.45rem 0.6rem; }
.mini span { display: block; font-size: 0.68rem; color: var(--color-text-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.mini strong { font-size: 0.82rem; font-family: var(--font-mono); font-weight: 500; }
.fine { font-size: 0.72rem; color: var(--color-text-faint); margin-top: var(--space-3); }
.link-row { display: flex; gap: var(--space-4); margin-top: var(--space-3); }

/* Sections ---------------------------------------------------------------- */
.section { margin-bottom: var(--space-12); scroll-margin-top: 90px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-4); margin-bottom: var(--space-5); }
.section-head h2 { font-size: var(--text-xl); }
.section-sub { font-size: 0.84rem; color: var(--color-text-muted); margin-top: 0.3rem; max-width: 60ch; }
.activity-actions { display: flex; align-items: center; gap: 0.6rem; }

.table-card { padding: 0; overflow: hidden; }
.table-empty { padding: var(--space-8) var(--space-5); text-align: center; color: var(--color-text-muted); font-size: 0.88rem; }
.table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.table th {
  text-align: left; padding: 0.7rem 1rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--color-text-faint); border-bottom: 1px solid var(--color-divider); font-weight: 500; background: var(--color-surface-2);
}
.table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--color-divider); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table .mono { font-size: 0.76rem; color: var(--color-text-muted); }
.route-cell { display: flex; align-items: center; gap: 0.4rem; font-weight: 500; }
.route-cell svg { color: var(--color-text-faint); }
.tx-mini { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--color-primary); font-family: var(--font-mono); font-size: 0.74rem; }
.tx-mini.dim { color: var(--color-text-faint); }

/* Setup ------------------------------------------------------------------- */
.setup-card { padding: var(--space-6); }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); }
.setup-chain { display: flex; flex-direction: column; gap: var(--space-3); }
.setup-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.2rem; }
.setup-head strong { font-size: 0.9rem; }
.setup-head .mono { margin-left: auto; color: var(--color-text-faint); font-size: 0.72rem; }
.setup-relayer { display: grid; grid-template-columns: 1fr auto; gap: var(--space-3); align-items: end; margin-top: var(--space-6); }
.addr-board { margin-top: var(--space-6); padding: var(--space-4); border: 1px solid var(--color-divider); border-radius: var(--radius-md); background: var(--color-surface-raised, rgba(255, 255, 255, 0.02)); }
.addr-board-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: var(--space-3); }
.addr-board-head strong { font-size: 0.95rem; }
.addr-list { display: grid; gap: 0.45rem; }
.addr-row { display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr) auto; align-items: center; gap: 0.5rem; }
.addr-label { font-size: 0.82rem; color: var(--color-text-muted); }
.addr-value { font-family: var(--font-mono); font-size: 0.78rem; overflow-wrap: anywhere; }
.addr-value.dim { color: var(--color-text-muted); font-style: italic; }
.addr-row .icon-btn:disabled { opacity: 0.35; cursor: default; }
.setup-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--color-divider); }

/* About ------------------------------------------------------------------- */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--space-8); padding: var(--space-8); border-radius: var(--radius-xl); background: var(--color-surface); border: 1px solid var(--color-border); }
.about h2 { font-size: var(--text-xl); margin-bottom: var(--space-4); }
.about p { color: var(--color-text-muted); font-size: 0.9rem; margin-bottom: var(--space-3); max-width: 62ch; }
.about em { font-style: normal; color: var(--color-text); }
.about-links { display: flex; flex-direction: column; gap: 0.55rem; }
.about-link {
  display: flex; justify-content: space-between; align-items: center; gap: 0.6rem;
  padding: 0.7rem 0.85rem; border: 1px solid var(--color-border); border-radius: var(--radius-md);
  font-size: 0.84rem; transition: var(--transition); background: var(--color-surface-2);
}
.about-link:hover { border-color: var(--color-primary); color: var(--color-primary); transform: translateX(2px); }

/* Footer ------------------------------------------------------------------ */
.footer { border-top: 1px solid var(--color-divider); padding-top: var(--space-5); font-size: 0.76rem; color: var(--color-text-faint); }
.footer p + p { margin-top: 0.5rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; }
.footer-links a:hover { color: var(--color-primary); }

/* Modal / toasts ---------------------------------------------------------- */
.modal-backdrop {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  background: var(--overlay);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: var(--space-5); z-index: 60;
}
.modal {
  background: var(--color-surface); border-radius: var(--radius-lg); border: 1px solid var(--color-border);
  width: 100%; max-width: 420px; padding: var(--space-5); box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.modal-head h2 { font-size: 1.1rem; }
.modal-sub { font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: var(--space-4); }
.wallet-list { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.wallet-list button {
  width: 100%; display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.7rem;
  border: 1px solid var(--color-border); background: var(--color-surface-2); border-radius: var(--radius-md);
  cursor: pointer; transition: var(--transition); color: var(--color-text); font-size: 0.86rem; text-align: left;
}
.wallet-list button:hover { border-color: var(--color-primary); background: var(--color-primary-ghost); }
.wallet-list img { width: 24px; height: 24px; border-radius: 6px; }
.wallet-list .wallet-meta { display: flex; flex-direction: column; }
.wallet-list .wallet-meta span { font-size: 0.7rem; color: var(--color-text-faint); }
.modal-note { font-size: 0.74rem; color: var(--color-text-faint); }

.toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 80; max-width: min(360px, calc(100vw - 2rem)); }
.toast {
  background: var(--toast-bg); color: var(--toast-text); padding: 0.65rem 0.85rem; border-radius: var(--radius-md);
  font-size: 0.8rem; box-shadow: var(--shadow-lg); animation: slide-in 220ms ease; line-height: 1.45;
}
.toast.err { background: var(--toast-err-bg); }
.toast strong { display: block; font-weight: 600; margin-bottom: 0.1rem; }
@keyframes slide-in { from { opacity: 0; transform: translateY(8px); } }


/* Mobile navigation -------------------------------------------------------- */
.menu-btn {
  display: none; width: 38px; height: 38px; flex-shrink: 0;
  align-items: center; justify-content: center; padding: 0;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-surface); color: var(--color-text);
  cursor: pointer; transition: var(--transition);
}
.menu-btn:hover, .menu-btn[aria-expanded='true'] { border-color: var(--color-primary); color: var(--color-primary); }
.mobile-nav {
  display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 45;
  padding: 0.45rem 0.75rem 0.75rem; background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider); box-shadow: var(--shadow-lg);
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.72rem 0.8rem; border-radius: var(--radius-md);
  font-size: 0.94rem; color: var(--color-text); border: 1px solid transparent;
}
.mobile-nav a + a { margin-top: 2px; }
.mobile-nav a:hover { background: var(--color-primary-ghost); }
.mobile-nav a.is-active { background: var(--color-primary-ghost); color: var(--color-primary); border-color: rgba(12, 130, 117, 0.16); font-weight: 500; }
.mobile-nav a svg { opacity: 0.5; }

/* Focus and motion --------------------------------------------------------- */
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
a:focus, button:focus { outline-color: var(--color-primary); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* The hero glow bleeds 80px on each side, which only has room to do so on a
   viewport wide enough to hold the container plus that bleed. */
@media (max-width: 1380px) {
  .hero::before { left: 0; right: 0; }
}

/* Responsive -------------------------------------------------------------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; gap: var(--space-8); }
  /* Below the container width the glow has no room to bleed, so it stays inside. */
  .hero::before { height: 300px; }
  .panel-grid { grid-template-columns: 1fr 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
}
@media (max-width: 720px) {
  .page { padding: var(--space-5) var(--space-3) var(--space-10); }
  .header-inner { padding: 0.55rem var(--space-3); gap: 0.5rem; }
  .brand-sub { display: none; }
  .theme-switch { display: none; }
  .net-pill { display: none; }
  .panel-grid { grid-template-columns: 1fr; }
  .setup-grid { grid-template-columns: 1fr; }
  .setup-relayer { grid-template-columns: 1fr; }
  .addr-row { grid-template-columns: 1fr auto; }
  .addr-label { grid-column: 1; }
  .addr-value { grid-column: 1 / -1; grid-row: 2; }
  .balance-row { grid-template-columns: 1fr; }
  .chain-selects { grid-template-columns: 1fr; gap: var(--space-2); }
  .chain-selects .swap-btn { justify-self: center; }
  .chain-selects .swap-btn svg { transform: rotate(90deg); }
  .route-strip { gap: var(--space-3); }
  .route-end { gap: 0.5rem; }
  .route-end img { width: 24px; height: 24px; }
  .route-end span { display: none; }
  .route-arrows svg { width: 34px; }
  .facts { flex-wrap: wrap; gap: var(--space-4); }
  .route-strip { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .table-card { overflow-x: auto; }
  .table { min-width: 620px; }
  .bridge-card { padding: var(--space-4); }
  .card-foot { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 430px) {
  .wallet-label-name { display: none; }
}
@media (max-width: 380px) {
  .header-inner { gap: 0.4rem; padding-left: var(--space-2); padding-right: var(--space-2); }
  .header-actions { gap: 0.4rem; }
  .brand-name { display: none; }
  #connect-btn { padding: 0.5rem 0.66rem; font-size: 0.8rem; max-width: 168px; }
  .menu-btn { width: 34px; height: 34px; }
  .page { padding-left: var(--space-2); padding-right: var(--space-2); }
  .hero h1 { font-size: 2.1rem; }
}
