
:root {
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);

    --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(160deg, #e3f2ef 0%, #eef4f6 45%, #e8f0f7 100%);
  --color-surface: #ffffff;
  --color-surface-2: #f7fafb;
  --color-surface-offset: #e9f0f2;
  --color-divider: #dce6ea;
  --color-border: #cfdde3;

    --color-text: #0f2b46;
  --color-text-muted: #55708a;
  --color-text-faint: #5a7186;
  --color-text-inverse: #ffffff;

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

    --color-success: #1a7a45;
  --color-success-soft: #dff2e4;
  --color-error: #bb3a3a;
  --color-error-soft: #fbe3e3;
  --color-warning: #9a5b00;
  --color-warning-soft: #fdefd8;
  --color-info: #1d6fb8;
  --color-info-soft: #e0edf9;
  --color-gold: #c98a12;

    --header-bg: rgba(255, 255, 255, 0.82);
  --brand-grad-a: #0c8275;
  --brand-grad-b: #0a7d8f;
  --card-accent-a: #ffffff;
  --card-accent-b: #eef8f6;
  --hero-glow-a: rgba(12, 130, 117, 0.14);
  --hero-glow-b: rgba(29, 111, 184, 0.10);
  --hero-glow-c: rgba(12, 130, 117, 0.08);
  --btn-secondary-hover: #c2e8e2;
  --notice-border: #f0dcae;
  --notice-info-border: #bcd8ef;
  --notice-info-text: #175787;
  --notice-error-border: #efc2c2;
  --notice-ok-border: #c4e5cd;
  --input-bg: #ffffff;
  --seg-active-bg: #ffffff;
  --toast-bg: #12283d;
  --toast-text: #eaf3f7;
  --toast-err-bg: #5c1f1f;
  --setup-border: #bcd8ef;
  --setup-text: #175787;
  --overlay: rgba(15, 43, 70, 0.45);
  --spinner-track: rgba(15, 43, 70, 0.2);
  --on-primary-soft: rgba(255, 255, 255, 0.4);

    --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.25rem;

  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-sm: 0 1px 2px rgba(15, 43, 70, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 43, 70, 0.08);
  --shadow-lg: 0 14px 40px rgba(15, 43, 70, 0.14);

  --font-body: 'General Sans', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg-accent);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
ul[role='list'] { list-style: none; }
input, button, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.15; font-weight: 600; }
p, li { text-wrap: pretty; max-width: 72ch; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--color-primary-soft); }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: var(--radius-sm); }
button { cursor: pointer; background: none; border: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
.skip-link { position: absolute; left: -999px; top: 0; background: var(--color-primary); color: var(--color-on-primary); padding: var(--space-2) var(--space-4); z-index: 100; border-radius: 0 0 var(--radius-md) 0; }
.skip-link:focus { left: 0; }
.mono { font-family: var(--font-mono); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

a, button, input, textarea, select { transition: color var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition); }

.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-divider);
}
.header-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
}
.brand { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-grad-a), var(--brand-grad-b));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; font-size: var(--text-base); letter-spacing: -0.01em; }
.brand-accent { color: var(--color-primary); }
.brand-sub { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 500; }
.nav { display: flex; gap: var(--space-1); margin-left: var(--space-4); overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-link {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
}
.nav-link:hover { color: var(--color-text); background: var(--color-primary-ghost); text-decoration: none; }
.nav-short { display: none; }
.nav-link.active { color: var(--color-on-primary); background: var(--color-primary); box-shadow: var(--shadow-sm); }
@media (max-width: 1180px) {
  .nav { gap: 0; margin-left: var(--space-2); }
  .nav-link { padding-left: var(--space-2); padding-right: var(--space-2); }
}
.header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
@media (min-width: 721px) {
  .brand { flex: none; }
}
.net-pill {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); font-weight: 600; color: var(--color-success);
  background: var(--color-success-soft);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full, 9999px);
  white-space: nowrap;
}
.net-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-success); animation: pulse 2.4s infinite; }
.net-pill.bad { color: var(--color-error); background: var(--color-error-soft); }
.net-pill.bad .dot { background: var(--color-error); animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.icon-btn {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  color: var(--color-text-muted); background: var(--color-surface);
}
.icon-btn:hover { color: var(--color-text); border-color: var(--color-primary); }

.page-wrap { padding: var(--space-8) 0 var(--space-12); }
.container { max-width: 1180px; margin: 0 auto; padding: 0 var(--space-5); }
.page-title { font-size: var(--text-xl); font-weight: 700; letter-spacing: -0.02em; }
.page-sub { color: var(--color-text-muted); font-size: var(--text-sm); margin-top: var(--space-1); }
.page-head { margin-bottom: var(--space-6); }

.grid { display: grid; gap: var(--space-5); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.halves { grid-template-columns: 1.4fr 1fr; }
.stack { display: flex; flex-direction: column; gap: var(--space-5); }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}
.card-tight { padding: var(--space-4) var(--space-5); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.card-title { font-size: var(--text-lg); font-weight: 600; letter-spacing: -0.01em; }
.card-desc { color: var(--color-text-muted); font-size: var(--text-sm); margin-bottom: var(--space-4); }
.card-accent {
  border: 1px solid var(--color-primary-soft);
  background: linear-gradient(150deg, var(--card-accent-a) 55%, var(--card-accent-b) 100%);
}

.market-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-8) var(--space-10);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  animation: market-banner-glow 3.2s ease-in-out infinite;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.market-banner:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.market-banner-glow {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  pointer-events: none;
  background: radial-gradient(520px 160px at 92% 50%, var(--color-primary-soft), transparent 65%);
}
.market-banner::before {
  content: '';
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 45%;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 0%, var(--color-primary-ghost) 35%, var(--color-primary-soft) 50%, var(--color-primary-ghost) 65%, transparent 100%);
  transform: translateX(-130%) skewX(-16deg);
  animation: market-banner-shine 4.2s cubic-bezier(0.4, 0, 0.25, 1) infinite;
}
@keyframes market-banner-shine {
  0%, 45% { transform: translateX(-130%) skewX(-16deg); }
  90%, 100% { transform: translateX(320%) skewX(-16deg); }
}
.market-banner-title {
  position: relative;
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--color-text);
}
.market-banner-hint {
  position: relative;
  flex: none;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
}
@keyframes market-banner-glow {
  0%, 100% { border-color: var(--color-primary); box-shadow: 0 0 0 rgba(12, 130, 117, 0); }
  50% { border-color: var(--color-primary-hover); box-shadow: 0 0 22px var(--hero-glow-a); }
}
@media (prefers-reduced-motion: reduce) {
  .market-banner,
  .market-banner::before { animation: none; }
}
@media (max-width: 640px) {
  .market-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-6);
  }
  .market-banner-title { font-size: var(--text-lg); }
}

.hero {
  background:
    radial-gradient(1200px 400px at 85% -60%, var(--hero-glow-a), transparent 60%),
    radial-gradient(900px 300px at 0% 0%, var(--hero-glow-b), transparent 55%),
    var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none;
  background: radial-gradient(600px 200px at 90% 120%, var(--hero-glow-c), transparent 60%);
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--color-primary); background: var(--color-primary-soft);
  padding: var(--space-1) var(--space-3); border-radius: 9999px;
}
.hero h1 { font-size: var(--text-xl); font-weight: 700; letter-spacing: -0.02em; margin-top: var(--space-4); }
.hero p { color: var(--color-text-muted); margin-top: var(--space-2); max-width: 60ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.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); box-shadow: var(--shadow-md); }
.btn.secondary { background: var(--color-primary-soft); color: var(--color-primary-active); }
.btn.secondary:hover:not(:disabled) { background: var(--btn-secondary-hover); }
.btn.ghost { border-color: var(--color-border); color: var(--color-text); background: var(--color-surface); }
.btn.ghost:hover:not(:disabled) { border-color: var(--color-primary); color: var(--color-primary); }
.btn.danger { background: var(--color-error-soft); color: var(--color-error); }
.btn.wide { width: 100%; }
.btn.small { padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; margin: auto;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid var(--on-primary-soft); border-top-color: var(--color-on-primary);
  animation: spin 0.7s linear infinite;
}
.btn.secondary.loading::after, .btn.ghost.loading::after { border-color: var(--spinner-track); border-top-color: var(--color-primary); }

@keyframes spin { to { transform: rotate(360deg); } }

.notice {
  display: flex; flex-direction: column; gap: var(--space-1);
  background: var(--color-warning-soft);
  border: 1px solid var(--notice-border);
  color: var(--color-warning);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  margin-bottom: var(--space-5);
}
.notice.info { background: var(--color-info-soft); border-color: var(--notice-info-border); color: var(--notice-info-text); }
.notice.error { background: var(--color-error-soft); border-color: var(--notice-error-border); color: var(--color-error); }
.notice.ok { background: var(--color-success-soft); border-color: var(--notice-ok-border); color: var(--color-success); }

.badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  font-size: var(--text-xs); font-weight: 600;
  padding: 2px var(--space-2); border-radius: 9999px;
  white-space: nowrap;
}
.badge.pending { background: var(--color-warning-soft); color: var(--color-warning); }
.badge.submitted { background: var(--color-info-soft); color: var(--color-info); }
.badge.ok { background: var(--color-success-soft); color: var(--color-success); }
.badge.fail { background: var(--color-error-soft); color: var(--color-error); }
.badge.unknown { background: var(--color-surface-offset); color: var(--color-text-muted); }
.badge.neutral { background: var(--color-surface-offset); color: var(--color-text-muted); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-4); }
.stat-label { font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-faint); }
.stat-value { font-size: var(--text-lg); font-weight: 600; font-family: var(--font-mono); margin-top: var(--space-1); overflow-wrap: anywhere; }
.stat-value.small { font-size: var(--text-sm); }
.kv { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--color-divider); font-size: var(--text-sm); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--color-text-muted); }
.kv .v { font-family: var(--font-mono); font-size: var(--text-sm); overflow-wrap: anywhere; text-align: right; }

.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field label { font-size: var(--text-sm); font-weight: 600; }
.field .hint { font-size: var(--text-xs); color: var(--color-text-faint); }
.input, .select {
  width: 100%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-base);
}
.input:focus, .select:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-ghost); background: var(--input-bg); }
.input.mono { font-family: var(--font-mono); }
.select { font-family: var(--font-body); -webkit-appearance: none; -moz-appearance: none; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--color-text-muted) 50%), linear-gradient(135deg, var(--color-text-muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: var(--space-8); }
.input-row { display: flex; gap: var(--space-2); }
.input-row .input { flex: 1; }
.seg { display: inline-flex; background: var(--color-surface-offset); border-radius: var(--radius-md); padding: 3px; gap: 2px; }
.seg button {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm); font-weight: 600;
  color: var(--color-text-muted);
}
.seg button.active { background: var(--seg-active-bg); color: var(--color-text); box-shadow: var(--shadow-sm); }

.swap-box {
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
}
.swap-line { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.swap-token { display: flex; align-items: center; gap: var(--space-2); font-weight: 600; }
.token-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; font-family: var(--font-body); }
.token-dot.zth { background: linear-gradient(135deg, #1d6fb8, #0e9384); }
.token-dot.wttta { background: linear-gradient(135deg, #c98a12, #e0a63c); }
.token-dot.tok-0 { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.token-dot.tok-1 { background: linear-gradient(135deg, #be185d, #f472b6); }
.token-dot.tok-2 { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.token-dot.tok-3 { background: linear-gradient(135deg, #b45309, #f59e0b); }
.token-dot.tok-4 { background: linear-gradient(135deg, #1e40af, #3b82f6); }
.token-dot.tok-5 { background: linear-gradient(135deg, #4d7c0f, #84cc16); }
.token-dot.tok-6 { background: linear-gradient(135deg, #9f1239, #fb7185); }
.token-dot.tok-7 { background: linear-gradient(135deg, #334155, #64748b); }
.swap-arrow {
  display: flex; align-items: center; justify-content: center;
  margin: var(--space-2) 0;
}
.swap-arrow button {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--color-surface); border: 1px solid var(--color-border);
  display: grid; place-items: center; color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}
.swap-arrow button:hover { border-color: var(--color-primary); transform: rotate(180deg); }
.swap-meta { display: flex; flex-direction: column; gap: 4px; margin-top: var(--space-4); font-size: var(--text-sm); }
.swap-meta .row { display: flex; justify-content: space-between; }
.swap-meta .row .k { color: var(--color-text-muted); }
.swap-meta .row .v { font-family: var(--font-mono); }

.activity { display: flex; flex-direction: column; }
.activity-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
  font-size: var(--text-sm);
}
.activity-item:last-child { border-bottom: none; }
.activity-item .title { font-weight: 600; }
.activity-item .meta { color: var(--color-text-muted); font-size: var(--text-xs); }
.activity-item .spacer { flex: 1; }
.activity-item a { font-family: var(--font-mono); font-size: var(--text-xs); }
.empty {
  padding: var(--space-8) var(--space-4);
  text-align: center; color: var(--color-text-faint); font-size: var(--text-sm);
}

.gift-link-box {
  background: var(--color-surface-2);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
  word-break: break-all;
}

.qa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-4); }
.qa {
  display: flex; flex-direction: column; gap: var(--space-2);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  color: inherit; text-decoration: none;
}
.qa:hover { border-color: var(--color-primary); box-shadow: var(--shadow-md); text-decoration: none; transform: translateY(-2px); }
.qa .qa-icon {
  width: 38px; height: 38px; border-radius: var(--radius-md);
  display: grid; place-items: center;
  background: var(--color-primary-soft); color: var(--color-primary);
}
.qa .qa-title { font-weight: 600; font-size: var(--text-sm); }
.qa .qa-desc { color: var(--color-text-muted); font-size: var(--text-xs); line-height: 1.5; }

.modal-backdrop {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100;
  background: var(--overlay);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  padding: var(--space-4);
}
.modal {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  width: min(420px, 100%);
  box-shadow: var(--shadow-lg);
  max-height: 90vh; max-height: 90dvh; overflow-y: auto;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2); }
.modal-head h2 { font-size: var(--text-lg); }
.modal-sub { color: var(--color-text-muted); font-size: var(--text-sm); margin-bottom: var(--space-4); }
.wallet-list { display: flex; flex-direction: column; gap: var(--space-2); }
.wallet-option {
  display: flex; align-items: center; gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  font-size: var(--text-sm); font-weight: 600; text-align: left;
}
.wallet-option:hover { border-color: var(--color-primary); background: var(--color-primary-ghost); }
.wallet-option .w-icon { width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--color-surface-offset); display: grid; place-items: center; overflow: hidden; flex: none; }
.wallet-option .w-icon img { width: 28px; height: 28px; }
.wallet-option .w-sub { display: block; font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 500; }
.modal-note { margin-top: var(--space-4); font-size: var(--text-xs); color: var(--color-text-muted); }

.toasts {
  position: fixed; bottom: var(--space-5); right: var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-2);
  z-index: 200; max-width: min(380px, calc(100vw - 40px));
}
.toast {
  background: var(--toast-bg); color: var(--toast-text);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: var(--space-3);
  animation: toast-in 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.err { background: var(--toast-err-bg); }
.toast .t-icon { flex: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.footer {
  margin-top: var(--space-16);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  display: flex; flex-direction: column; gap: var(--space-2);
}
.footer-links { display: flex; gap: var(--space-4); flex-wrap: wrap; }

.setup-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
  background: var(--color-info-soft);
  border: 1px solid var(--setup-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--setup-text);
  margin-bottom: var(--space-5);
}
.link-row { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.divider { border: none; border-top: 1px solid var(--color-divider); margin: var(--space-5) 0; }
code.inline { font-family: var(--font-mono); background: var(--color-surface-offset); padding: 1px 6px; border-radius: 4px; font-size: 0.9em; }

.claim-hero { text-align: center; }
.claim-amount { font-size: var(--text-xl); font-family: var(--font-mono); font-weight: 600; color: var(--color-primary); margin: var(--space-2) 0; }
.claim-status-badge { margin: var(--space-3) auto; width: fit-content; }

.guide-step {
  display: flex; gap: var(--space-3); align-items: flex-start;
  margin-top: var(--space-4);
}
.guide-step .num {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--color-primary); color: var(--color-on-primary);
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.8125rem;
}
.guide-step-text { min-width: 0; }
.guide-step-title { font-weight: 600; margin: 0; }
.guide-step-body { margin: 4px 0 0; color: var(--color-text-muted); line-height: 1.75; }
.guide-step-body a { word-break: break-word; }

@media (max-width: 900px) {
  .grid.cols-3, .grid.halves { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .grid.cols-2 { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; padding: var(--space-3) var(--space-4); row-gap: var(--space-2); }
  .net-pill { display: none; }
  .hero { padding: var(--space-6); }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .stat-value { font-size: var(--text-sm); }
  .stat-value.small { font-size: var(--text-xs); }
}

[data-theme='midnight'] {
  --color-bg-accent: #0b1220;
  --color-surface: #111a2c;
  --color-surface-2: #0d1526;
  --color-surface-3: #16213a;
  --color-divider: #1c2942;
  --color-border: #233252;

  --color-text: #dbe4f0;
  --color-text-muted: #8494ac;
  --color-text-faint: #5a6a84;

  --color-primary: #2dd4bf;
  --color-on-primary: #06251f;
  --color-primary-hover: #5ce8d5;
  --color-primary-active: #9ff2e5;
  --color-primary-soft: #123c38;
  --color-primary-ghost: rgba(45, 212, 191, 0.18);

  --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;
  --color-gold: #fbbf24;

  --header-bg: rgba(11, 18, 32, 0.85);
  --brand-grad-a: #0f766e;
  --brand-grad-b: #155e75;
  --card-accent-a: #131c30;
  --card-accent-b: #0f1828;
  --hero-glow-a: rgba(45, 212, 191, 0.10);
  --hero-glow-b: rgba(96, 165, 250, 0.08);
  --hero-glow-c: rgba(45, 212, 191, 0.06);
  --btn-secondary-hover: #175049;
  --notice-border: #4a3b1a;
  --notice-info-border: #274467;
  --notice-info-text: #7cc0ff;
  --notice-error-border: #5c2626;
  --notice-ok-border: #27502f;
  --input-bg: #0d1526;
  --seg-active-bg: #0d1526;
  --toast-bg: #1c2a44;
  --toast-text: #e2e8f0;
  --toast-err-bg: #4c1d1d;
  --setup-border: #274467;
  --setup-text: #7cc0ff;
  --overlay: rgba(0, 0, 0, 0.6);
  --spinner-track: rgba(219, 228, 240, 0.25);
  --on-primary-soft: rgba(6, 37, 31, 0.4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.5);
}

[data-theme='aurora'] {
  --color-bg-accent: #f1eefb;
  --color-surface: #ffffff;
  --color-surface-2: #f7f5fd;
  --color-surface-3: #ece8f8;
  --color-divider: #e4def4;
  --color-border: #d9d1ef;

  --color-text: #2a2140;
  --color-text-muted: #6b6285;
  --color-text-faint: #9c94b3;

  --color-primary: #7c5cd6;
  --color-primary-hover: #6b4cc4;
  --color-primary-active: #5a3fae;
  --color-primary-soft: #e9e2fa;
  --color-primary-ghost: rgba(124, 92, 214, 0.16);

  --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;
  --color-gold: #b07d1e;

  --header-bg: rgba(255, 255, 255, 0.82);
  --brand-grad-a: #7c5cd6;
  --brand-grad-b: #5b8def;
  --card-accent-a: #ffffff;
  --card-accent-b: #f3effc;
  --hero-glow-a: rgba(124, 92, 214, 0.12);
  --hero-glow-b: rgba(91, 141, 239, 0.10);
  --hero-glow-c: rgba(124, 92, 214, 0.07);
  --btn-secondary-hover: #ddd2f5;
  --notice-border: #e7d8b8;
  --notice-info-border: #d3d9f5;
  --notice-info-text: #4a5a8f;
  --notice-error-border: #efc2c2;
  --notice-ok-border: #c9e5d2;
  --input-bg: #ffffff;
  --seg-active-bg: #ffffff;
  --toast-bg: #241c3d;
  --toast-text: #ece7f8;
  --toast-err-bg: #4c2438;
  --setup-border: #d3d9f5;
  --setup-text: #4a5a8f;
  --overlay: rgba(42, 33, 64, 0.45);
  --spinner-track: rgba(42, 33, 64, 0.2);
}

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

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--space-6); align-items: start; }
.layout > .stack { min-width: 0; }
.side-col { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }
.stack.narrow { max-width: 760px; }
.page-head + .layout, .notice + .layout { margin-top: 0; }
@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
}

.card-desc, .hint, .card .page-sub { max-width: none; }
.card-head { align-items: center; }

.input, .select { height: 48px; padding-top: 0; padding-bottom: 0; line-height: 1.2; }
.select { font-family: var(--font-body); font-size: var(--text-sm); font-weight: 500; }
.input-row { align-items: stretch; }
.input-row .btn { height: 48px; }
.btn-row { display: flex; gap: var(--space-3); margin-top: var(--space-4); }
.btn-row .btn { flex: 1; height: 46px; }
.btn.primary.wide { height: 50px; font-size: var(--text-base); }
.grid.cols-2 { align-items: start; }
.field label { line-height: 1.2; }

.swap-box { position: relative; background: none; border: none; padding: 0; display: flex; flex-direction: column; }
.swap-panel {
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
}
.swap-panel:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-ghost); }
.swap-panel-top { display: flex; justify-content: space-between; align-items: center; min-height: 28px; margin-bottom: var(--space-2); }
.swap-panel-main { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: var(--space-3); align-items: center; }
.swap-panel .input {
  background: transparent; border: none; box-shadow: none; padding: 0;
  font-size: 1.6rem; font-weight: 600; height: 52px;
}
.swap-panel .input:focus { box-shadow: none; background: transparent; }
.swap-panel .select { background-color: var(--color-surface); height: 48px; font-weight: 600; }
.swap-out { min-width: 0; height: 52px; display: flex; align-items: center; }
.swap-out .v { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-text); }
.swap-arrow { height: 0; position: relative; z-index: 2; margin: 0; display: flex; justify-content: center; align-items: center; }
.swap-arrow button { width: 40px; height: 40px; border: 3px solid var(--color-surface); box-shadow: 0 0 0 1px var(--color-border), var(--shadow-sm); }
.swap-arrow button:hover { transform: none; background: var(--color-primary-soft); }
.swap-arrow button svg { transition: transform var(--transition); }
.swap-arrow button:hover svg { transform: rotate(180deg); }
.swap-box .swap-panel + .swap-arrow + .swap-panel { margin-top: 0; }
.swap-box > .swap-arrow { margin: -1px 0; }
.swap-box > .swap-panel:first-child { margin-bottom: var(--space-2); }
.swap-meta { margin-top: var(--space-4); padding: var(--space-3) var(--space-4); background: var(--color-surface-2); border-radius: var(--radius-md); gap: var(--space-2); }
.swap-meta .row { align-items: center; }
.field-inline { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-4); }
.field-inline label { font-size: var(--text-sm); font-weight: 600; }
.field-inline .seg button { min-width: 64px; }

.stat-grid.pool-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid > div { background: var(--color-surface-2); border: 1px solid var(--color-divider); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); min-width: 0; }
.stat-grid .stat-value { font-size: var(--text-base); }
.stat-grid .stat-value.small { font-size: var(--text-sm); }
@media (max-width: 560px) { .stat-grid.pool-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .swap-panel-main { grid-template-columns: minmax(0, 1fr) 120px; } .btn-row { flex-direction: column; } }

.side-card { padding: var(--space-5); }
.side-card .card-title { font-size: var(--text-base); }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); font-weight: 600; color: var(--color-success); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--color-success); animation: pulse 2.4s infinite; }
.mk-list { display: flex; flex-direction: column; }
.mk-row { display: grid; grid-template-columns: minmax(0, 1fr) 72px auto; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-divider); }
.mk-row:last-child { border-bottom: none; }
.mk-name { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.mk-name img { width: 24px; height: 24px; border-radius: 50%; flex: none; }
.mk-name div { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.mk-name strong { font-size: var(--text-sm); }
.mk-name span { font-size: var(--text-xs); color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-price { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.mk-price strong { font-family: var(--font-mono); font-size: var(--text-sm); }
.mk-price span { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600; }
.mk-price .up { color: var(--color-success); }
.mk-price .down { color: var(--color-error); }
.fng { margin-top: var(--space-3); padding-top: var(--space-4); border-top: 1px solid var(--color-divider); }
.fng:empty { display: none; }
.fng-top { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--text-sm); }
.fng-bar { position: relative; height: 8px; border-radius: 9999px; margin-top: var(--space-3); background: linear-gradient(90deg, #d9534f, #e8a33d 35%, #d8c94a 55%, #3cae6a); }
.fng-bar i { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--color-surface); border: 3px solid var(--color-text); transform: translate(-50%, -50%); }
.side-foot { display: block; margin-top: var(--space-3); font-size: var(--text-xs); color: var(--color-text-faint); }
.news-list { display: flex; flex-direction: column; }
.news-item { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) 0; border-bottom: 1px solid var(--color-divider); color: var(--color-text); }
.news-item:last-child { border-bottom: none; padding-bottom: 0; }
.news-item:first-child { padding-top: 0; }
.news-item:hover { text-decoration: none; }
.news-item:hover .news-title { color: var(--color-primary); }
.news-title { font-size: var(--text-sm); font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-meta { font-size: var(--text-xs); color: var(--color-text-faint); }
.hint { font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.55; }
.lp-status:empty, p.hint:empty { display: none; }

@media (min-width: 721px) and (max-width: 1020px) {
  .nav-link .nav-long { display: none; }
  .nav-link { padding-left: 8px; padding-right: 8px; }
  .nav { margin-left: var(--space-2); gap: 0; }
  .brand-sub { display: none; }
}
@media (max-width: 720px) {
  .nav {
    order: 3; flex: 0 0 100%; width: 100%; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px;
    overflow: visible;
  }
  .nav-link {
    display: flex; align-items: center; justify-content: center; text-align: center;
    min-height: 38px; padding: 0 4px; font-size: 13px; line-height: 1.1;
  }
  .nav-link .nav-long { display: inline; }
  .brand-sub { display: none; }
  .header-actions { gap: 6px; }
  .header-actions .btn { padding-left: 12px; padding-right: 12px; }
  input, select, textarea, .input, .select { font-size: 16px; }
  .swap-panel .input, .swap-out .v { font-size: 1.35rem; }
  .card { padding: var(--space-4); }
  .side-card { padding: var(--space-4); }
  .page-title { word-break: break-word; }
  .mono, .stat-value { overflow-wrap: anywhere; }
}
@media (max-width: 440px) {
  .nav-link .nav-long { display: none; }
  .nav { grid-template-columns: repeat(6, auto); justify-content: space-between; }
  .nav-link { font-size: 12px; padding: 0 2px; }
  .swap-panel-main { grid-template-columns: minmax(0, 1fr) 112px; }
  .swap-panel { padding: var(--space-3) var(--space-4); }
  .field-inline { flex-direction: column; align-items: stretch; }
  .field-inline .seg { width: 100%; }
  .field-inline .seg button { flex: 1; }
  .btn-row { flex-direction: column; }
  .stat-grid.pool-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 340px) {
  .nav-full { display: none; }
  .nav-short { display: inline; }
  .nav { gap: 2px; }
  .nav-link { font-size: 12px; padding: 0 2px; }
  .brand-name { font-size: 14px; }
  .header-actions .icon-btn { display: none; }
}
