/* ================= Nabla × Hyperliquid design system =================
   Palette extracted from hyperfoundation.org:
   mint #97FCE4 / #A6FFE8, forest #072723 / #0F3933 / #193833 / #23524C  */

:root {
  --bg: #051d1a;
  --bg-2: #072723;
  --card: #0c2f2a;
  --card-2: #0f3933;
  --card-3: #134139;
  --line: rgba(151, 252, 228, 0.09);
  --line-strong: rgba(151, 252, 228, 0.18);
  --mint: #97fce4;
  --mint-bright: #a6ffe8;
  --mint-dim: #50d2c1;
  --text: #e8f6f1;
  --text-2: #9db8b1;
  --text-3: #5f7d76;
  --green: #4ade80;
  --yellow: #fbbf24;
  --red: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", "Inter var", system-ui, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-family: var(--font); }

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 480px at 18% -10%, rgba(151, 252, 228, 0.07), transparent 60%),
    radial-gradient(700px 420px at 85% 8%, rgba(80, 210, 193, 0.05), transparent 60%),
    var(--bg);
}

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
.hidden { display: none !important; }
.accent { color: var(--mint) !important; }

/* ================= Header ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(5, 29, 26, 0.82);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.testnet-badge {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--mint);
  border: 1px solid var(--line-strong);
  background: rgba(151, 252, 228, 0.06);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.main-nav { display: flex; gap: 4px; flex: 1; }
.nav-link {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--text); background: rgba(151, 252, 228, 0.05); }
.nav-link.active { color: var(--mint); background: rgba(151, 252, 228, 0.08); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.btn-faucet {
  display: flex; align-items: center; gap: 6px;
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  font-size: 12.5px; font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.btn-faucet:hover { color: var(--mint); border-color: var(--mint-dim); }

.btn-connect {
  background: var(--mint);
  color: #072723;
  border: none;
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.btn-connect:hover { background: var(--mint-bright); box-shadow: 0 0 22px rgba(151, 252, 228, 0.25); }

.wallet-chip {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
}
.net-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.wallet-addr { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.demo-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--yellow);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 999px;
  padding: 1px 6px;
  margin-left: 2px;
  vertical-align: 1px;
}
.wallet-menu-btn { background: none; border: none; color: var(--text-2); display: flex; padding: 2px; }
.wallet-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 170px;
  background: var(--card-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 6px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.wallet-dropdown button, .wallet-dropdown a {
  background: none; border: none;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 7px;
}
.wallet-dropdown button:hover, .wallet-dropdown a:hover { background: rgba(151, 252, 228, 0.07); }
.wallet-dropdown .danger { color: var(--red); }

/* ================= Layout ================= */
.page-wrap { max-width: 1140px; margin: 0 auto; padding: 36px 20px 80px; width: 100%; flex: 1; }
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.page-sub { color: var(--text-2); margin-top: 6px; font-size: 14px; max-width: 560px; line-height: 1.5; }

/* ================= Stats ================= */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-label { font-size: 12px; color: var(--text-3); font-weight: 500; letter-spacing: 0.02em; }
.stat-value { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ================= Backstop card ================= */
.backstop-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(135deg, var(--card-2) 0%, var(--card) 70%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 26px;
  position: relative;
  overflow: hidden;
}
.backstop-card::after {
  content: "";
  position: absolute;
  right: -60px; top: -80px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(151, 252, 228, 0.08), transparent 70%);
  pointer-events: none;
}
.backstop-title-row { display: flex; gap: 14px; align-items: flex-start; }
.backstop-title-row h2 { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.backstop-tag {
  font-size: 10.5px; font-weight: 600;
  color: var(--mint);
  background: rgba(151, 252, 228, 0.08);
  border: 1px solid var(--line-strong);
  padding: 2px 7px;
  border-radius: 999px;
}
.backstop-title-row p { color: var(--text-2); font-size: 13px; margin-top: 5px; max-width: 480px; line-height: 1.5; }
.backstop-stats { display: flex; gap: 36px; margin-top: 16px; }
.backstop-stats > div { display: flex; flex-direction: column; gap: 3px; }
.bs-label { font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.bs-value { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.backstop-actions { display: flex; flex-direction: column; gap: 10px; min-width: 130px; position: relative; z-index: 1; }

/* covered swap pools + surplus chips */
.bs-pools { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.bs-pools-label { font-size: 11.5px; color: var(--text-3); font-weight: 500; margin-right: 2px; }
.bs-pool-chip {
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  cursor: default;
}
.chip-pos { color: var(--green); border-color: rgba(74, 222, 128, 0.25); background: rgba(74, 222, 128, 0.06); }
.chip-neg { color: var(--red); border-color: rgba(248, 113, 113, 0.25); background: rgba(248, 113, 113, 0.06); }

/* pending timelocked withdrawals */
.bs-pending, .modal-pending { margin-top: 14px; }
.pw-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(251, 191, 36, 0.05);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 12.5px;
  margin-top: 8px;
}
.pw-label { font-weight: 600; }
.pw-phase { color: var(--text-2); font-variant-numeric: tabular-nums; }
.pw-phase strong { color: var(--yellow); }
.pw-claim { color: var(--green); font-weight: 600; }
.pw-exp { color: var(--red); }
.pw-btn { margin-left: auto; }
.pw-head { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 2px 0 4px; display: flex; align-items: center; }
#pfPending { margin-bottom: 10px; }
#pfPending:empty { margin-bottom: 0; }

/* cap utilization under TVL */
.cap-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
  cursor: default;
  justify-content: flex-end;
}
.cap-bar {
  width: 44px;
  height: 3px;
  border-radius: 99px;
  background: rgba(151, 252, 228, 0.1);
  overflow: hidden;
  display: inline-block;
}
.cap-fill { display: block; height: 100%; border-radius: 99px; background: var(--mint-dim); }
.cap-fill.cap-hot { background: var(--yellow); }
.pf-total { float: right; font-variant-numeric: tabular-nums; color: var(--text); }

/* ================= Buttons ================= */
.btn-primary {
  background: var(--mint);
  color: #072723;
  border: none;
  font-weight: 600;
  font-size: 14px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.btn-primary:hover:not(:disabled) { background: var(--mint-bright); box-shadow: 0 0 24px rgba(151, 252, 228, 0.22); }
.btn-primary:disabled { background: var(--card-3); color: var(--text-3); cursor: not-allowed; }
.btn-ghost {
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.btn-ghost:hover { border-color: var(--mint-dim); color: var(--mint); }
.icon-btn {
  background: none; border: none;
  color: var(--text-2);
  padding: 6px;
  border-radius: 8px;
  display: flex;
  transition: all 0.15s;
}
.icon-btn:hover { color: var(--text); background: rgba(151, 252, 228, 0.07); }

/* ================= Table toolbar ================= */
.table-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  color: var(--text-3);
  flex: 0 0 260px;
  transition: border-color 0.15s;
}
.search-box:focus-within { border-color: var(--mint-dim); }
.search-box input {
  background: none; border: none; outline: none;
  color: var(--text);
  font-size: 13.5px;
  padding: 10px 0;
  width: 100%;
}
.search-box input::placeholder { color: var(--text-3); }
.toggle-mine { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; cursor: pointer; user-select: none; }
.toggle-mine input { accent-color: var(--mint); width: 15px; height: 15px; cursor: pointer; }

/* ================= Pools table ================= */
.pool-table-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  overflow-x: auto;
}
.pool-table { width: 100%; border-collapse: collapse; }
.pool-table thead th {
  text-align: right;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.pool-table thead th.th-asset { text-align: left; padding-left: 20px; }
.pool-table thead th.th-coverage { text-align: left; }
.pool-table thead th.sortable { cursor: pointer; user-select: none; }
.pool-table thead th.sortable:hover { color: var(--text-2); }
.sort-arrow::after { content: "↕"; opacity: 0.45; margin-left: 3px; }
th.sorted-desc .sort-arrow::after { content: "↓"; opacity: 1; color: var(--mint); }
th.sorted-asc .sort-arrow::after { content: "↑"; opacity: 1; color: var(--mint); }

.pool-table tbody td {
  padding: 15px 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.pool-table tbody tr:last-child td { border-bottom: none; }
.pool-table tbody tr { transition: background 0.12s; }
.pool-table tbody tr:hover { background: rgba(151, 252, 228, 0.025); }

.cell-asset { display: flex; align-items: center; gap: 11px; text-align: left; }
.asset-name { font-weight: 600; font-size: 14.5px; }
.asset-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }

.token-icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  color: #072723;
  flex-shrink: 0;
  background: var(--mint);
}
.token-icon[data-token="USDT0"] { background: #50d2a0; }
.token-icon[data-token="USDC"]  { background: #7cc5f4; }
.token-icon[data-token="WHYPE"] { background: #97fce4; }
.token-icon[data-token="UBTC"]  { background: #f4b06c; }
.token-icon[data-token="UETH"]  { background: #a8b8f8; }

.cov-cell { display: flex; flex-direction: column; gap: 5px; min-width: 104px; }
.cov-top { display: flex; justify-content: space-between; font-size: 12.5px; }
.cov-pct { font-weight: 600; }
.cov-bar { height: 4px; border-radius: 99px; background: rgba(151, 252, 228, 0.1); overflow: hidden; }
.cov-fill { height: 100%; border-radius: 99px; background: var(--mint); transition: width 0.4s; }
.cov-ok .cov-pct { color: var(--green); }
.cov-ok .cov-fill { background: var(--green); }
.cov-warn .cov-pct { color: var(--yellow); }
.cov-warn .cov-fill { background: var(--yellow); }
.cov-low .cov-pct { color: var(--red); }
.cov-low .cov-fill { background: var(--red); }

.cell-val { display: flex; flex-direction: column; }
.apy-cell { font-weight: 700; color: var(--mint); cursor: default; }
.apy-breakdown {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
  display: block;
  margin-top: 2px;
}
.pos-empty { color: var(--text-3); }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn-row {
  background: rgba(151, 252, 228, 0.07);
  border: 1px solid var(--line-strong);
  color: var(--mint);
  font-weight: 600;
  font-size: 12.5px;
  padding: 7px 13px;
  border-radius: 8px;
  transition: all 0.15s;
}
.btn-row:hover { background: rgba(151, 252, 228, 0.14); }
.btn-row.subtle { color: var(--text-2); background: none; }
.btn-row.subtle:hover { color: var(--text); border-color: var(--text-3); }

.table-empty { padding: 36px; text-align: center; color: var(--text-3); font-size: 14px; }

/* info tooltip */
.info-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1px solid var(--text-3);
  color: var(--text-3);
  font-size: 9.5px;
  font-weight: 600;
  cursor: help;
  position: relative;
  margin-left: 4px;
  text-transform: none;
}
.info-dot:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 230px;
  background: var(--card-3);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.45;
  padding: 9px 11px;
  border-radius: 9px;
  white-space: normal;
  text-align: left;
  z-index: 20;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* table-header tooltips open downward so the card doesn't clip them */
thead .info-dot:hover::after {
  bottom: auto;
  top: calc(100% + 8px);
}

/* ================= Swap ================= */
.swap-wrap { display: flex; justify-content: center; padding-top: 12px; }
.swap-card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  position: relative;
}
.swap-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.swap-head h1 { font-size: 18px; font-weight: 700; }

.swap-settings {
  display: flex; flex-direction: column; gap: 9px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 12.5px;
  color: var(--text-2);
}
.settings-row { display: flex; align-items: center; justify-content: space-between; }
.deadline-unit { font-size: 12px; color: var(--text-3); align-self: center; }
#swapDeadline { width: 52px; text-align: right; }
.slippage-opts { display: flex; gap: 6px; }
.slippage-opts button {
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 7px;
}
.slippage-opts button.active { background: rgba(151, 252, 228, 0.1); color: var(--mint); border-color: var(--mint-dim); }
.slippage-opts input {
  width: 64px;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--text);
  font-size: 12px;
  padding: 5px 8px;
  outline: none;
}
.slippage-opts input:focus { border-color: var(--mint-dim); }

.swap-box {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  transition: border-color 0.15s;
}
.swap-box:focus-within { border-color: var(--mint-dim); }
.swap-box-row1 { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-3); margin-bottom: 8px; }
.swap-balance { cursor: default; }
.swap-box-row2 { display: flex; align-items: center; gap: 12px; }
.swap-box-row2 input {
  flex: 1;
  min-width: 0;
  background: none; border: none; outline: none;
  color: var(--text);
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.swap-box-row2 input::placeholder { color: var(--text-3); }
.token-select {
  display: flex; align-items: center; gap: 7px;
  background: var(--card-3);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  padding: 7px 11px;
  border-radius: 999px;
  transition: all 0.15s;
  flex-shrink: 0;
}
.token-select:hover { border-color: var(--mint-dim); }
.token-select .token-icon { width: 22px; height: 22px; font-size: 8px; }
.swap-box-row3 { display: flex; justify-content: space-between; margin-top: 6px; min-height: 17px; }
.swap-usd { font-size: 12px; color: var(--text-3); }
.max-link {
  background: none; border: none;
  color: var(--mint);
  font-size: 12px;
  font-weight: 600;
  padding: 0;
}
.max-link:hover { color: var(--mint-bright); }

.swap-flip {
  display: flex;
  margin: -7px auto;
  position: relative;
  z-index: 2;
  background: var(--card-3);
  border: 3px solid var(--card);
  color: var(--mint);
  width: 34px; height: 34px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.swap-flip:hover { background: var(--card-2); transform: rotate(180deg); }

.swap-details {
  margin-top: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.swap-details > div { display: flex; justify-content: space-between; font-size: 12.5px; }
.swap-details span:first-child { color: var(--text-3); }
.swap-details span:last-child { font-variant-numeric: tabular-nums; font-weight: 500; }
#swapImpact.impact-warn { color: var(--yellow); }
#swapImpact.impact-bad { color: var(--red); }

.btn-swap { width: 100%; margin-top: 12px; padding: 13px; font-size: 15px; border-radius: 12px; }

/* ================= Portfolio ================= */
.portfolio-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.pf-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.pf-card h3 { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 14px; }
.pf-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.pf-row:last-child { border-bottom: none; }
.pf-row .token-icon { width: 28px; height: 28px; font-size: 9.5px; }
.pf-main { flex: 1; }
.pf-sym { font-weight: 600; font-size: 14px; }
.pf-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.pf-amt { text-align: right; font-variant-numeric: tabular-nums; }
.pf-amt .pf-sym { font-size: 14px; }
.pf-empty { color: var(--text-3); font-size: 13.5px; padding: 18px 0; }

/* ================= Modals ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2, 16, 14, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  width: 100%;
  max-width: 420px;
  background: var(--card-2);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  animation: modal-in 0.18s ease-out;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.modal-sm { max-width: 360px; }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-head h2 { font-size: 16px; font-weight: 700; }
.modal-title { display: flex; align-items: center; gap: 10px; }
.modal-title .token-icon { width: 28px; height: 28px; font-size: 9.5px; }

.modal-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 16px;
}
.modal-tab {
  background: none;
  border: none;
  color: var(--text-2);
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px;
  border-radius: 8px;
  transition: all 0.15s;
}
.modal-tab.active { background: var(--card-3); color: var(--mint); }

.amount-box {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  transition: border-color 0.15s;
}
.amount-box:focus-within { border-color: var(--mint-dim); }
.amount-box.error { border-color: var(--red); }
.amount-row1 { display: flex; align-items: center; gap: 10px; }
.amount-row1 input {
  flex: 1;
  min-width: 0;
  background: none; border: none; outline: none;
  color: var(--text);
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.amount-row1 input::placeholder { color: var(--text-3); }
.amount-sym { font-weight: 700; font-size: 15px; color: var(--text-2); }
.amount-row2 { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--text-3); min-height: 16px; }
.bal-group { display: flex; gap: 7px; align-items: center; }
.amt-error { color: var(--red); font-size: 12.5px; margin-top: 8px; }

/* modal sub-header: current position + share (matches the live app) */
.modal-sub {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}

/* percent slider inside the amount box */
.pct-slider { margin-top: 12px; }
.pct-slider input[type="range"] {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 99px;
  background: rgba(151, 252, 228, 0.12);
  outline: none;
  cursor: pointer;
}
.pct-slider input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 2.5px solid var(--mint);
  cursor: grab;
}
.pct-slider input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 2.5px solid var(--mint);
  cursor: grab;
}
.pct-marks { display: flex; justify-content: space-between; margin-top: 6px; }
.pct-marks button {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 0;
  text-decoration: underline;
  text-decoration-color: rgba(151, 252, 228, 0.25);
  text-underline-offset: 3px;
}
.pct-marks button:hover { color: var(--mint); }

/* pool share before → after chips */
.share-chip {
  background: var(--card-3);
  border-radius: 6px;
  padding: 2px 7px;
  font-variant-numeric: tabular-nums;
}
.share-arr { color: var(--text-3); margin: 0 2px; }

/* rich pending-withdrawal card in the modal */
.pwc {
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 4px;
}
.pwc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pwc-title { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.pw-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.pw-badge-delay { color: var(--yellow); background: rgba(251, 191, 36, 0.1); border: 1px solid rgba(251, 191, 36, 0.3); }
.pw-badge-claim { color: var(--green); background: rgba(74, 222, 128, 0.1); border: 1px solid rgba(74, 222, 128, 0.3); }
.pw-badge-exp { color: var(--red); background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.3); }
.pwc-row1 { display: flex; justify-content: space-between; align-items: center; font-size: 17px; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.pwc-asset, .pwc-asset-fixed {
  background: var(--card-3);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
.pwc-asset:hover { border-color: var(--mint-dim); }
.pwc-asset-fixed { cursor: default; }
.pwc-exp { display: flex; gap: 18px; font-size: 12.5px; color: var(--text-3); margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.pwc-exp strong { color: var(--text-2); font-weight: 600; }
.pwc-actions { display: flex; gap: 8px; }
.pwc-btn { flex: 1; padding: 9px; font-size: 13px; border-radius: 9px; }

/* replace-withdrawal warning under the CTA */
.modal-warn {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 10px;
  background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--yellow);
  line-height: 1.45;
}
.modal-warn svg { flex-shrink: 0; margin-top: 1px; }

/* redeem-from-backstop link */
.redeem-link {
  display: block;
  margin: 14px auto 0;
  background: none;
  border: none;
  color: var(--mint);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(151, 252, 228, 0.4);
}
.redeem-link:hover { color: var(--mint-bright); }

.payout-select { margin-top: 14px; }
.payout-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; display: flex; align-items: center; }
.payout-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.payout-opts .payout-opt { flex: 1 1 auto; min-width: 120px; }
.payout-opt {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.payout-opt.active { border-color: var(--mint-dim); color: var(--mint); background: rgba(151, 252, 228, 0.06); }
.payout-opt:disabled { opacity: 0.45; cursor: not-allowed; }

.modal-details {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.modal-details > div { display: flex; justify-content: space-between; font-size: 12.5px; }
.modal-details span:first-child { color: var(--text-3); }
.modal-details span:last-child { font-variant-numeric: tabular-nums; font-weight: 500; }

.modal-note {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.5;
  padding: 0 2px;
}
.btn-modal { width: 100%; margin-top: 14px; padding: 13px; font-size: 15px; border-radius: 12px; }

/* token list modal */
.token-list { display: flex; flex-direction: column; gap: 2px; }
.token-list-item {
  display: flex; align-items: center; gap: 12px;
  background: none;
  border: none;
  color: var(--text);
  padding: 10px;
  border-radius: var(--radius-sm);
  text-align: left;
  transition: background 0.12s;
}
.token-list-item:hover:not(:disabled) { background: rgba(151, 252, 228, 0.06); }
.token-list-item:disabled { opacity: 0.4; cursor: not-allowed; }
.tli-main { flex: 1; }
.tli-sym { font-weight: 600; font-size: 14px; }
.tli-name { font-size: 11.5px; color: var(--text-3); }
.tli-bal { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text-2); }

/* tx modal */
.tx-modal { text-align: center; padding: 30px 24px 24px; }
.tx-state h3 { font-size: 16px; font-weight: 700; margin-top: 16px; }
.tx-state p { color: var(--text-2); font-size: 13px; margin-top: 6px; line-height: 1.5; }
.spinner {
  width: 44px; height: 44px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(151, 252, 228, 0.15);
  border-top-color: var(--mint);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.tx-check {
  width: 52px; height: 52px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--mint);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pop-in 0.25s ease-out;
}
@keyframes pop-in { from { transform: scale(0.5); opacity: 0; } to { transform: none; opacity: 1; } }
.tx-link { display: inline-block; color: var(--mint); font-size: 13px; margin-top: 12px; text-decoration: none; }
.tx-link:hover { text-decoration: underline; }
.tx-modal .btn-primary { width: 100%; margin-top: 18px; }

/* ================= Toasts ================= */
.toast-stack {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--card-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.4);
  animation: toast-in 0.2s ease-out;
  max-width: 340px;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast.success { border-color: rgba(74, 222, 128, 0.4); }
.toast.error { border-color: rgba(248, 113, 113, 0.4); }
.toast .t-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); flex-shrink: 0; }
.toast.success .t-dot { background: var(--green); }
.toast.error .t-dot { background: var(--red); }

/* ================= Footer ================= */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  max-width: 1140px;
  margin: 0 auto;
  width: 100%;
  color: var(--text-3);
  font-size: 12px;
}
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--text-3); text-decoration: none; }
.footer-links a:hover { color: var(--mint); }

/* ================= Skeletons ================= */
.skeleton {
  display: inline-block;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--card-3) 25%, var(--card-2) 50%, var(--card-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  color: transparent !important;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ================= Responsive ================= */
@media (max-width: 900px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .backstop-card { flex-direction: column; align-items: stretch; }
  .backstop-actions { flex-direction: row; }
  .backstop-actions button { flex: 1; }
  .backstop-stats { flex-wrap: wrap; gap: 18px 28px; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .main-nav { gap: 0; }
  .nav-link { padding: 8px 10px; font-size: 13px; }
  .btn-faucet span { display: none; }
}

@media (max-width: 760px) {
  .header-inner { gap: 10px; padding: 0 14px; }
  .brand-name { display: none; }
  .testnet-badge { display: none; }
  .btn-faucet { display: none; }
  .nav-link { padding: 8px 8px; font-size: 13px; }
  .wallet-chip { min-width: 0; padding: 6px 8px; }
  .wallet-addr { font-size: 12px; }
  .demo-tag { display: none; }
}

/* hide the volume column on narrower desktops so the table never scrolls */
@media (max-width: 1060px) {
  .pool-table th:nth-child(3),
  .pool-table td:nth-child(3) { display: none; }
}

@media (max-width: 880px) {
  /* pools table → card list */
  .pool-table thead { display: none; }
  .pool-table, .pool-table tbody, .pool-table td { display: block; }
  .pool-table tr {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
  }
  .pool-table tr:last-child { border-bottom: none; }
  .pool-table td { border: none; padding: 4px 0; text-align: left; white-space: normal; }
  .pool-table td:nth-child(3) { display: block; }
  .pool-table td[data-th] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }
  .pool-table td[data-th]::before {
    content: attr(data-th);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-3);
    flex-shrink: 0;
  }
  .pool-table td[data-th] > * { text-align: right; }
  .cell-asset { margin-bottom: 8px; }
  .cov-cell { min-width: 0; width: 150px; }
  .apy-breakdown { text-align: right; }
  .row-actions { justify-content: stretch; margin-top: 10px; }
  .row-actions .btn-row { flex: 1; padding: 10px; }
  .search-box { flex: 1; }
  .wallet-addr { white-space: nowrap; font-size: 12px; }
  .wallet-chip { padding: 6px 8px; }
}
