:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --transition: 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] {
  --bg-page: #06090f;
  --bg-surface: #0d131d;
  --bg-surface-2: #141c2b;
  --bg-surface-hover: #1b263a;
  --bg-glass: rgba(13, 19, 29, 0.84);
  --bg-input: #090d14;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --accent: #00e6b8;
  --accent-2: #7c5cff;
  --accent-soft: rgba(0, 230, 184, 0.12);
  --accent-border: rgba(0, 230, 184, 0.36);
  --accent-text: #00e6b8;
  --on-accent: #041d18;
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.14);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.14);
  --shadow-card: 0 20px 44px -18px rgba(0, 0, 0, 0.65);
  --shadow-modal: 0 28px 64px -16px rgba(0, 0, 0, 0.88);
  --grid-color: rgba(148, 163, 184, 0.045);
}

html[data-theme="light"] {
  --bg-page: #f4f7fb;
  --bg-surface: #ffffff;
  --bg-surface-2: #eef3f8;
  --bg-surface-hover: #e2eaf2;
  --bg-glass: rgba(255, 255, 255, 0.9);
  --bg-input: #f8fafd;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-subtle: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.2);
  --accent: #059669;
  --accent-2: #6d28d9;
  --accent-soft: rgba(5, 150, 105, 0.1);
  --accent-border: rgba(5, 150, 105, 0.35);
  --accent-text: #047857;
  --on-accent: #ffffff;
  --success: #059669;
  --success-soft: rgba(5, 150, 105, 0.12);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.1);
  --shadow-card: 0 14px 36px -18px rgba(15, 23, 42, 0.14);
  --shadow-modal: 0 24px 60px -16px rgba(15, 23, 42, 0.28);
  --grid-color: rgba(15, 23, 42, 0.035);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark light; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); letter-spacing: -0.02em; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Ambient background */
.bg-ambient { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.bg-orb { position: absolute; border-radius: 50%; filter: blur(115px); opacity: 0.22; }
html[data-theme="light"] .bg-orb { opacity: 0.13; }
.orb-a { width: 520px; height: 520px; top: -180px; left: -120px; background: radial-gradient(circle, var(--accent), transparent 70%); }
.orb-b { width: 500px; height: 500px; top: 90px; right: -140px; background: radial-gradient(circle, var(--accent-2), transparent 70%); }
.bg-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(to right, var(--grid-color) 1px, transparent 1px), linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.65), transparent 85%);
}

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.gradient-text { background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.accent-text { color: var(--accent-text); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-weight: 600; font-size: 0.9rem; border-radius: var(--radius-sm); padding: 10px 15px;
  transition: transform var(--transition), background-color var(--transition), border-color var(--transition), filter var(--transition);
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 8px 12px; font-size: 0.83rem; }
.btn-lg { padding: 14px 20px; font-size: 1rem; border-radius: var(--radius-md); }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-icon svg { width: 18px; height: 18px; }
.btn-sm-icon { width: 32px; height: 32px; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #22d3ee);
  color: #031d17;
  box-shadow: 0 8px 22px -10px rgba(0, 230, 184, 0.55);
}
html[data-theme="light"] .btn-primary {
  color: #ffffff;
  background: linear-gradient(135deg, #059669, #6d28d9);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
.btn-surface { background: var(--bg-surface-2); border: 1px solid var(--border-subtle); color: var(--text-primary); }
.btn-surface:hover:not(:disabled) { background: var(--bg-surface-hover); border-color: var(--border-strong); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #ffffff; }
.btn-ghost-xs {
  font-size: 0.76rem; font-weight: 600; padding: 5px 10px; border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-border);
}
.btn-ghost-xs:hover { background: var(--accent); color: var(--on-accent); }
.link-btn { font-size: 0.8rem; font-weight: 600; color: var(--accent-text); }
.link-btn:hover { text-decoration: underline; }

/* Navbar */
.navbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg-glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}
.navbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; height: 68px; }
.nav-left { display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-logo { width: 38px; height: 38px; display: inline-flex; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; letter-spacing: 0.03em; }
.brand-sub { font-size: 0.7rem; color: var(--accent-text); font-weight: 600; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link { padding: 8px 12px; border-radius: var(--radius-sm); font-size: 0.87rem; font-weight: 500; color: var(--text-secondary); transition: var(--transition); }
.nav-link:hover { color: var(--text-primary); background: var(--bg-surface-2); }
.nav-link.active { color: var(--accent-text); background: var(--accent-soft); font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 8px; }

html[data-theme="dark"] .icon-sun { display: block; }
html[data-theme="dark"] .icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: none; }
html[data-theme="light"] .icon-moon { display: block; }

.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); display: inline-block; flex-shrink: 0; }
.status-dot.pulse { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); animation: pulseDot 2.2s infinite; }
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Dropdown */
.dropdown-wrap { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0; width: 270px;
  background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  padding: 8px; box-shadow: var(--shadow-modal); display: none; z-index: 60;
}
.dropdown-menu.dropdown-sm { width: 225px; }
.dropdown-menu.open { display: block; }
.dropdown-header { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 6px 10px 8px; }
.dropdown-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); text-align: left; transition: var(--transition); }
.dropdown-item:hover { background: var(--bg-surface-2); }
.dropdown-item.active { background: var(--accent-soft); }
.lang-flag { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; padding: 3px 6px; border-radius: 6px; background: var(--bg-surface-2); border: 1px solid var(--border-subtle); min-width: 32px; text-align: center; }
.chain-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-elysium { background: #00e6b8; }
.dot-testnet { background: #f59e0b; }
.dot-hyperevm { background: #7c5cff; }
.chain-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.chain-info strong { font-size: 0.84rem; }
.chain-info small { font-size: 0.72rem; color: var(--text-muted); }
.chain-badge { font-size: 0.68rem; font-weight: 700; padding: 3px 7px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent-text); }
.chain-badge.badge-muted { background: var(--warning-soft); color: var(--warning); }
.chain-badge.badge-info { background: rgba(124, 92, 255, 0.16); color: #a78bfa; }
.dropdown-divider { height: 1px; background: var(--border-subtle); margin: 6px 0; }
.dropdown-action { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 0.82rem; font-weight: 600; color: var(--accent-text); }
.dropdown-action:hover { background: var(--accent-soft); }

.mobile-menu-btn { display: none; }
.mobile-nav { border-top: 1px solid var(--border-subtle); background: var(--bg-surface); padding: 12px 0; }
.mobile-nav-inner { display: flex; flex-direction: column; gap: 6px; }
.mobile-nav-link { text-align: left; padding: 10px 12px; border-radius: var(--radius-sm); font-weight: 500; color: var(--text-secondary); }
.mobile-nav-link.active, .mobile-nav-link:hover { background: var(--accent-soft); color: var(--accent-text); }

/* Main */
.main-content { padding-top: 26px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 42px; }
.section-block { scroll-margin-top: 84px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.section-head h2 { font-size: 1.5rem; }
.section-head p { color: var(--text-secondary); font-size: 0.92rem; margin-top: 4px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Hero */
.hero-section { display: flex; flex-direction: column; gap: 22px; }
.hero-pills { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.pill-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--radius-pill); font-size: 0.78rem; font-weight: 600; background: var(--bg-surface); border: 1px solid var(--border-subtle); color: var(--text-secondary); }
.pill-clickable:hover { border-color: var(--accent-border); color: var(--accent-text); }
.hero-copy h1 { font-size: clamp(1.85rem, 3.6vw, 2.75rem); line-height: 1.12; margin-bottom: 10px; }
.hero-subtitle { max-width: 680px; color: var(--text-secondary); font-size: 1rem; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 16px 18px; display: flex; flex-direction: column; gap: 5px; box-shadow: var(--shadow-card); }
.kpi-label { font-size: 0.76rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-value { font-size: 1.32rem; font-weight: 700; display: flex; align-items: baseline; gap: 8px; }
.kpi-sub { font-size: 0.78rem; color: var(--text-secondary); }
.delta-up { font-size: 0.76rem; color: var(--success); background: var(--success-soft); padding: 2px 7px; border-radius: var(--radius-pill); }

/* Cards */
.card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-card); }
.card-subtitle { font-size: 0.84rem; color: var(--text-secondary); margin-top: 3px; }
.card-top-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.card-top-actions { display: flex; align-items: center; gap: 8px; }

.segmented-tabs { display: inline-flex; background: var(--bg-surface-2); padding: 4px; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); }
.seg-tab { padding: 8px 14px; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); transition: var(--transition); }
.seg-tab.active { background: var(--bg-surface); color: var(--text-primary); box-shadow: 0 2px 8px rgba(0,0,0,0.16); }

/* Swap Layout */
.swap-layout { display: grid; grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr); gap: 20px; align-items: start; }
.swap-right-col { display: flex; flex-direction: column; gap: 20px; }

.swap-box { background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 14px 16px; transition: border-color var(--transition); }
.swap-box:focus-within { border-color: var(--accent-border); }
.swap-box-head, .swap-box-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.78rem; color: var(--text-muted); }
.swap-box-head { margin-bottom: 8px; }
.swap-box-foot { margin-top: 8px; }
.balance-label strong { color: var(--text-primary); }
.swap-box-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.amount-input { width: 100%; min-width: 0; border: none; background: transparent; color: var(--text-primary); font-size: 1.5rem; font-weight: 700; outline: none; }
.amount-input::placeholder { color: var(--text-muted); }
.amount-input::-webkit-outer-spin-button, .amount-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.token-select-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px 7px 8px;
  border-radius: var(--radius-pill); background: var(--bg-surface-2); border: 1px solid var(--border-subtle);
  font-weight: 700; font-size: 0.88rem; flex-shrink: 0; transition: var(--transition);
}
.token-select-btn:hover { border-color: var(--accent-border); background: var(--bg-surface-hover); }
.tok-pill-static { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: var(--radius-pill); background: var(--bg-surface-2); border: 1px solid var(--border-subtle); font-weight: 700; font-size: 0.86rem; flex-shrink: 0; }

.tok-badge {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #2563eb); color: #ffffff;
  font-size: 0.72rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tok-badge.zomes { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #041d18; }
.tok-badge.hype { background: linear-gradient(135deg, #00e6b8, #0ea5e9); color: #041d18; }
.tok-badge.purr { background: linear-gradient(135deg, #f472b6, #a855f7); color: #ffffff; }
.tok-badge.weth { background: linear-gradient(135deg, #64748b, #94a3b8); color: #ffffff; }

.flip-row { display: flex; justify-content: center; margin: -10px 0; position: relative; z-index: 2; }
.flip-btn {
  width: 36px; height: 36px; border-radius: 11px;
  background: var(--bg-surface); border: 2px solid var(--border-strong); color: var(--text-primary);
  display: inline-flex; align-items: center; justify-content: center; transition: transform 0.2s ease, border-color 0.2s ease;
}
.flip-btn:hover { border-color: var(--accent); transform: rotate(180deg); color: var(--accent-text); }

.percent-pills { display: flex; gap: 6px; }
.pct-btn { padding: 4px 8px; border-radius: 7px; font-size: 0.72rem; font-weight: 700; background: var(--bg-surface-2); border: 1px solid var(--border-subtle); color: var(--text-secondary); }
.pct-btn:hover, .pct-btn.active { border-color: var(--accent-border); color: var(--accent-text); background: var(--accent-soft); }

.route-pill { font-size: 0.72rem; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--bg-surface-2); color: var(--text-secondary); }
.rate-toggle-btn { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.rate-toggle-btn:hover { color: var(--accent-text); }

.summary-box { background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 13px 15px; display: flex; flex-direction: column; gap: 8px; margin: 14px 0 16px; }
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.83rem; }
.summary-row span { color: var(--text-secondary); }

.field-group { margin-bottom: 14px; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.field-label { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.field-hint { font-size: 0.76rem; color: var(--text-muted); }
.form-select { width: 100%; padding: 10px 13px; border-radius: var(--radius-md); background: var(--bg-input); border: 1px solid var(--border-subtle); color: var(--text-primary); font-family: inherit; font-size: 0.88rem; }
.form-select-sm { padding: 7px 10px; font-size: 0.82rem; border-radius: var(--radius-sm); }

/* Chart Card */
.chart-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.pair-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pair-title-row h2 { font-size: 1.15rem; }
.chart-price-row { display: flex; align-items: baseline; gap: 10px; }
.chart-big-price { font-size: 1.6rem; font-weight: 700; }
.timeframe-pills { display: flex; gap: 4px; background: var(--bg-surface-2); padding: 4px; border-radius: var(--radius-sm); border: 1px solid var(--border-subtle); }
.tf-btn { padding: 5px 10px; border-radius: 7px; font-size: 0.76rem; font-weight: 600; color: var(--text-secondary); }
.tf-btn.active { background: var(--bg-surface); color: var(--accent-text); }
.sparkline-wrap { width: 100%; height: 180px; border-radius: var(--radius-md); background: var(--bg-input); border: 1px solid var(--border-subtle); overflow: hidden; padding: 8px 0 0; }
.sparkline-wrap svg { width: 100%; height: 100%; display: block; }
.chart-stats-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-subtle); }
.chart-stats-row span { display: block; font-size: 0.73rem; color: var(--text-muted); }
.chart-stats-row strong { font-size: 0.9rem; }

.assets-mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.asset-chip { background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.asset-chip-top { display: flex; align-items: center; justify-content: space-between; font-size: 0.78rem; font-weight: 700; }
.asset-chip strong { font-size: 0.92rem; }
.asset-chip small { font-size: 0.72rem; color: var(--text-muted); }

/* Staking Section */
.staking-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.tier-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.tier-option { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px; border-radius: var(--radius-md); background: var(--bg-surface-2); border: 1px solid var(--border-subtle); text-align: left; }
.tier-option.active { background: var(--accent-soft); border-color: var(--accent-border); }
.tier-name { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
.tier-apy { font-size: 0.95rem; color: var(--accent-text); }
.tier-meta { font-size: 0.7rem; color: var(--text-muted); }
.apy-pill, .count-pill { padding: 5px 10px; border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: 700; background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-border); }

.portfolio-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.p-metric { background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 12px; display: flex; flex-direction: column; gap: 3px; }
.p-metric.highlight { border-color: var(--accent-border); background: var(--accent-soft); }
.p-label { font-size: 0.73rem; color: var(--text-secondary); font-weight: 600; }
.p-val { font-size: 1rem; font-weight: 700; }
.p-metric small { font-size: 0.72rem; color: var(--text-muted); }

.subhead-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.positions-list { display: flex; flex-direction: column; gap: 8px; max-height: 250px; overflow-y: auto; }
.position-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; border-radius: var(--radius-md); background: var(--bg-surface-2); border: 1px solid var(--border-subtle); }
.position-item strong { display: block; font-size: 0.88rem; }
.position-item small { font-size: 0.74rem; color: var(--text-muted); }
.empty-state { padding: 20px; text-align: center; border-radius: var(--radius-md); border: 1px dashed var(--border-strong); color: var(--text-muted); font-size: 0.84rem; }

/* Utility & Governance */
.utility-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.utility-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; }
.util-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--accent-border); display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.utility-card h3 { font-size: 1.02rem; }
.utility-card p { font-size: 0.83rem; color: var(--text-secondary); line-height: 1.5; }

.gov-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.gov-item { background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 15px; display: flex; flex-direction: column; gap: 10px; }
.gov-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gov-item p { font-size: 0.82rem; color: var(--text-secondary); }
.gov-bar { height: 8px; border-radius: var(--radius-pill); background: var(--bg-surface); overflow: hidden; border: 1px solid var(--border-subtle); }
.gov-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.3s ease; }
.gov-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.gov-actions { display: flex; gap: 6px; }

/* Activity Table */
.history-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-pill { padding: 6px 12px; border-radius: var(--radius-pill); font-size: 0.8rem; font-weight: 600; background: var(--bg-surface-2); border: 1px solid var(--border-subtle); color: var(--text-secondary); }
.filter-pill.active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-text); }
.count-text { font-size: 0.78rem; color: var(--text-muted); }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.data-table th { text-align: left; font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); padding: 10px 12px; border-bottom: 1px solid var(--border-subtle); }
.data-table td { padding: 12px; font-size: 0.85rem; border-bottom: 1px solid var(--border-subtle); }
.data-table tbody tr:last-child td { border-bottom: none; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: var(--radius-pill); font-size: 0.74rem; font-weight: 600; background: var(--success-soft); color: var(--success); }
.tx-hash-btn { color: var(--accent-text); font-family: var(--font-mono); font-size: 0.8rem; text-decoration: underline dotted; }

/* Bottom Multi-Column Footer */
.footer { border-top: 1px solid var(--border-subtle); background: var(--bg-surface); padding: 40px 0 24px; }
.footer-columns { display: grid; grid-template-columns: 1.15fr 0.75fr 1.35fr 0.85fr; gap: 26px; padding-bottom: 28px; border-bottom: 1px solid var(--border-subtle); }
.footer-col h4 { font-size: 0.88rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 12px; }
.brand-inline { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.footer-desc { font-size: 0.83rem; color: var(--text-secondary); line-height: 1.55; margin-bottom: 14px; }
.footer-status { display: inline-flex; align-items: center; gap: 8px; font-size: 0.76rem; padding: 6px 11px; border-radius: var(--radius-pill); background: var(--bg-surface-2); border: 1px solid var(--border-subtle); color: var(--text-secondary); }
.footer-list, .dev-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-link { font-size: 0.85rem; color: var(--text-secondary); text-align: left; }
.footer-link:hover { color: var(--accent-text); }
.dev-list li { display: flex; flex-direction: column; gap: 1px; }
.dev-list strong { font-size: 0.85rem; color: var(--text-primary); }
.dev-list span { font-size: 0.75rem; color: var(--text-muted); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 18px; font-size: 0.8rem; color: var(--text-muted); }

/* Modals */
.modal-backdrop { position: fixed; inset: 0; background: rgba(2, 6, 12, 0.74); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100; }
.modal-backdrop[hidden] { display: none; }
.modal-card { width: 100%; max-width: 460px; background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-modal); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-header h3 { font-size: 1.15rem; }
.modal-sub { font-size: 0.82rem; color: var(--text-secondary); margin-top: 3px; }
.modal-close { width: 30px; height: 30px; border-radius: 8px; background: var(--bg-surface-2); color: var(--text-secondary); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.modal-close:hover { color: var(--text-primary); background: var(--bg-surface-hover); }

.search-box { display: flex; align-items: center; gap: 8px; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 9px 12px; }
.search-box input { border: none; background: transparent; color: var(--text-primary); font-family: inherit; font-size: 0.86rem; outline: none; }

.token-list, .wallet-options, .faucet-options { display: flex; flex-direction: column; gap: 8px; }
.token-row-btn, .wallet-option-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 13px; border-radius: var(--radius-md); background: var(--bg-surface-2); border: 1px solid var(--border-subtle); text-align: left;
}
.token-row-btn:hover, .wallet-option-btn:hover { border-color: var(--accent-border); background: var(--accent-soft); }
.wallet-opt-left { display: flex; align-items: center; gap: 11px; }
.wallet-icon-box { width: 34px; height: 34px; border-radius: 10px; background: var(--bg-surface); border: 1px solid var(--border-subtle); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.82rem; overflow: hidden; }
.wallet-icon-box img { width: 22px; height: 22px; object-fit: contain; }
.wallet-tag { font-size: 0.7rem; font-weight: 700; padding: 3px 8px; border-radius: var(--radius-pill); background: var(--success-soft); color: var(--success); }
.wallet-tag.muted { background: var(--bg-surface); color: var(--text-muted); border: 1px solid var(--border-subtle); }

.modal-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0; font-size: 0.75rem; color: var(--text-muted); }
.modal-divider::before, .modal-divider::after { content: ""; flex: 1; height: 1px; background: var(--border-subtle); }
.demo-badge { font-size: 0.65rem; font-weight: 800; padding: 2px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-text); }
.slippage-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.account-box { background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 14px; }
.account-addr-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border-subtle); }
.account-addr { font-size: 0.84rem; word-break: break-all; }
.account-balances { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 12px; }
.account-balances span { display: block; font-size: 0.73rem; color: var(--text-muted); }
.copy-btn { padding: 4px 8px; border-radius: 6px; font-size: 0.72rem; font-weight: 700; background: var(--bg-surface); border: 1px solid var(--border-subtle); color: var(--text-secondary); }
.copy-btn:hover { border-color: var(--accent-border); color: var(--accent-text); }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--bg-surface-2); border: 1px solid var(--border-subtle); margin-top: 12px; cursor: pointer; }
.toggle-copy { display: flex; flex-direction: column; }
.toggle-copy strong { font-size: 0.84rem; }
.toggle-copy small { font-size: 0.74rem; color: var(--text-muted); }
.switch-input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-slider { position: relative; width: 42px; height: 24px; background: var(--border-strong); border-radius: var(--radius-pill); flex-shrink: 0; transition: background-color 0.2s ease; }
.switch-slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s ease; }
.switch-input:checked + .switch-slider { background: var(--accent); }
.switch-input:checked + .switch-slider::after { transform: translateX(18px); }
.account-modal-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.account-modal-actions .btn-danger { grid-column: span 2; }

/* Toasts */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 120; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast { background: var(--bg-surface); border: 1px solid var(--border-strong); border-left: 4px solid var(--accent); border-radius: var(--radius-md); padding: 12px 15px; box-shadow: var(--shadow-modal); font-size: 0.84rem; }
.toast.error { border-left-color: var(--danger); }
.toast strong { display: block; margin-bottom: 2px; }
.toast span { color: var(--text-secondary); font-size: 0.78rem; }

@media (max-width: 1060px) {
  .kpi-grid, .utility-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .swap-layout, .staking-grid, .gov-list { grid-template-columns: 1fr; }
  .footer-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: inline-flex; }
}
@media (max-width: 600px) {
  .hide-xs, .hide-sm { display: none; }
  .kpi-grid, .utility-grid, .portfolio-metrics, .assets-mini-grid, .footer-columns { grid-template-columns: 1fr; }
  .tier-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 16px; }
}
