/* --------- design tokens --------- */
:root {
  --bg:           #0a0c10;
  --bg-elev:      #11141a;
  --bg-elev-2:    #161a22;
  --border:       #232833;
  --border-soft:  #1b1f27;
  --text:         #e7ebf2;
  --text-dim:     #9aa3b2;
  --text-muted:   #6b7484;

  --accent:       #86efac;   /* mint, primary accent */
  --accent-2:     #fde68a;
  --accent-warm:  #fca5a5;

  --apy-ok:       #86efac;
  --apy-high:     #6ee7b7;
  --apy-hot:      #fde68a;
  --apy-extreme:  #fca5a5;
  --apy-low:      #9aa3b2;

  --up:           #4ade80;
  --down:         #f87171;

  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    14px;

  --shadow:       0 1px 0 rgba(255,255,255,.02), 0 8px 24px rgba(0,0,0,.35);

  --max:          1240px;
  --gap:          20px;

  --font-ui:      "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html {
  /* Global anchor-scroll offset — keeps the sticky header from
     covering any in-page target (#methodology, #disclaimer,
     #perp-vaults, …). Per-element scroll-margin-top still wins
     where it's set, this is just the safety net. */
  scroll-padding-top: 90px;
}
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background:
    radial-gradient(800px 400px at 50% -200px, rgba(134, 239, 172, .05), transparent 60%),
    var(--bg);
}

/* Live canvas background — pinned behind everything, never grabs
   clicks or scroll. Subtle dot-grid + cursor spotlight is drawn by
   bg.js; CSS just makes sure the element is invisible to interaction
   and out of the way. */
.bg-fx {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 1;
}
.site-header, main.wrap, .site-footer { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}
/* Phone-class viewports need a slightly bigger side padding so the
   header — and every other ``.wrap``-based row — has visible breathing
   room from the bezels instead of looking jammed against them. iOS
   adds safe-area insets on top of this when the user has a notch. */
@media (max-width: 720px) {
  .wrap {
    padding-left:  max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
}
@media (max-width: 480px) {
  .wrap {
    padding-left:  max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
  }
}

.muted { color: var(--text-muted); }
.num   { font-variant-numeric: tabular-nums; font-family: var(--font-mono); }

/* --------- header --------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 12, 16, .85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  min-width: 0;          /* allow flex children to shrink the wordmark */
  flex: 0 1 auto;
}
.brand-mark {
  width: 34px; height: 34px;
  display: inline-grid; place-items: center;
  background: var(--accent);
  color: #052e1a;
  font-weight: 800;
  border-radius: 9px;
  font-size: 18px;
  flex-shrink: 0;        /* never squish the round chip itself */
}
.brand-mark svg { width: 24px; height: 24px; display: block; }
.brand-name {
  letter-spacing: -0.01em;
  font-size: 18px;
  min-width: 0;
  /* On phone widths the bar truncates the wordmark with an ellipsis
     before it ever bleeds into the lang switcher / donate pill, so
     you get "stable…" rather than overlapping text. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-name-accent { color: var(--accent); }

.header-right { display: flex; align-items: center; gap: 14px; }
.header-nav { display: flex; gap: 22px; font-size: 14px; color: var(--text-dim); }
.header-nav a:hover { color: var(--text); }

/* Header pill that jumps the user to the perp-DEX section. Always
   visible when there's data in that section — it's the discoverability
   handle so users know that other surface even exists.
   Tinted with the warm "amber" accent and a slow shimmer so it
   pulls the eye without being a banner ad — the perp section is
   the lesser-known half of the site, this is its tap on the shoulder. */
.header-nav-link {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(253, 230, 138, .32);
  color: var(--accent-2);
  font-size: 13px;
  text-decoration: none;
  background: rgba(253, 230, 138, .05);
  box-shadow: 0 0 0 0 rgba(253, 230, 138, 0);
  transition: color .15s, border-color .15s, box-shadow .25s;
}
/* Shimmer is its own layer so we can fade it in/out around the
   edges of the loop — that way the gradient never visibly "jumps"
   when the animation restarts. */
.header-nav-link::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(110deg,
    transparent 38%,
    rgba(253, 230, 138, .26) 50%,
    transparent 62%
  );
  background-size: 240% 100%;
  background-repeat: no-repeat;
  background-position: 180% 0;
  animation: perp-pill-shimmer 7s ease-in-out infinite;
}
.header-nav-link > * { position: relative; }
.header-nav-link:hover {
  color: #fef3c7;
  border-color: rgba(253, 230, 138, .55);
  box-shadow: 0 0 0 4px rgba(253, 230, 138, .12);
}
.header-nav-icon { width: 13px; height: 13px; color: currentColor; }
.header-nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 17px;
  padding: 0 6px;
  border-radius: 8px;
  background: rgba(253, 230, 138, .12);
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  margin-left: 2px;
}
.header-nav-link:hover .header-nav-count {
  background: rgba(253, 230, 138, .22);
  color: #fef3c7;
}

@keyframes perp-pill-shimmer {
  /* Fade in just before the highlight enters the pill, hold full
     opacity during the actual sweep, fade out as it leaves. Both
     endpoints sit at opacity 0 so the wrap-around is invisible. */
  0%   { background-position: 180% 0;  opacity: 0; }
  18%  { opacity: 1; }
  82%  { opacity: 1; }
  100% { background-position: -80% 0;  opacity: 0; }
}
/* Respect users who explicitly opt out of motion — the pill keeps
   its golden tint but the sweep stops. */
@media (prefers-reduced-motion: reduce) {
  .header-nav-link::before { animation: none; opacity: 0; }
}

/* Contextual jump-anchor placed at the bottom of the main results that
   nudges the user toward the perp section if they didn't notice the
   header pill. Faintly highlighted but deliberately not noisy. */
.perp-jump {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 0;
  padding: 12px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
}
.perp-jump:hover {
  border-color: rgba(253, 230, 138, .4);
  background: rgba(253, 230, 138, .04);
  color: var(--text);
}
.perp-jump strong { color: var(--text); font-weight: 600; }
.perp-jump-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-elev-2);
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

/* Floating "back to top" button — bottom-right corner, fades in once
   the user has scrolled past the hero. */
.scroll-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(15, 19, 25, .92);
  color: var(--text-dim);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .18s, transform .18s, color .15s, border-color .15s, background .15s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
}
.scroll-top.is-shown { opacity: 1; transform: translateY(0); }
.scroll-top:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(15, 19, 25, .96);
}
.scroll-top svg { width: 16px; height: 16px; }
@media (max-width: 720px) {
  .scroll-top { right: 14px; bottom: 14px; width: 38px; height: 38px; }
  .header-nav-link { padding: 3px 8px 3px 7px; font-size: 11.5px; }
  .header-nav-count { display: none; }
  .perp-jump { font-size: 12px; padding: 10px 12px; }
}

/* --------- donate button + popover ---------
   Tinted "tip jar" pill — noticeable enough that the eye registers
   the warm coral cue without reading the label, but understated
   enough that it doesn't dominate the bar. Uses a translucent fill
   over the header background plus a thin border in the same hue,
   no glow, no heartbeat — quiet but unmistakably "support".  */
.donate-wrap { position: relative; }
.donate-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(252, 165, 165, .10);
  color: #fecaca;
  border: 1px solid rgba(252, 165, 165, .35);
  border-radius: 999px;
  padding: 6px 14px 6px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.donate-btn:hover, .donate-btn[aria-expanded="true"] {
  color: #fff5f5;
  border-color: rgba(252, 165, 165, .6);
  background: rgba(252, 165, 165, .16);
}
.donate-btn:focus-visible {
  outline: none;
  border-color: rgba(252, 165, 165, .8);
  box-shadow: 0 0 0 3px rgba(252, 165, 165, .22);
}
.donate-label-short { display: none; }
.donate-heart {
  width: 14px; height: 14px;
  color: var(--accent-warm);
  transition: transform .2s ease;
}
.donate-btn:hover .donate-heart { transform: scale(1.15); }
@media (prefers-reduced-motion: reduce) {
  .donate-btn:hover .donate-heart { transform: none; }
}

.donate-popover {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 380px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 48px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.02);
  padding: 16px 16px 12px;
  z-index: 60;
  animation: pop-in .14s ease-out;
}
@keyframes pop-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.donate-arrow {
  position: absolute;
  top: -6px; right: 30px;
  width: 10px; height: 10px;
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
}
.donate-popover h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.donate-sub {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.donate-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.donate-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}
.donate-row-head { display: inline-flex; align-items: center; gap: 8px; }
.donate-coin {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: #0a0c10;
  letter-spacing: -.02em;
}
.donate-coin-btc { background: #f7931a; }
.donate-coin-eth { background: #c8d6ff; }
.donate-coin-sol { background: linear-gradient(135deg, #9945ff, #14f195); color: #fff; }
.donate-coin-ton { background: #0098ea; color: #fff; }
.donate-row-meta { display: flex; flex-direction: column; gap: 1px; line-height: 1.15; }
.donate-net   { font-size: 12.5px; color: var(--text); font-weight: 500; }
.donate-asset { font-size: 10.5px; color: var(--text-muted); font-family: var(--font-mono); }
.donate-addr {
  display: none; /* hidden by default — too long for the row, copy button is the action */
}
.donate-copy {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.donate-copy:hover { color: var(--accent); border-color: var(--accent); }
.donate-copy svg { width: 13px; height: 13px; }
.donate-copy.ok { color: var(--accent); border-color: var(--accent); background: rgba(134,239,172,.1); }
/* Anchor the "copied!" pill to the button so it floats above the row
   neatly. It's a proper tooltip-styled chip now, no longer just bare
   text overlapping the address. */
.donate-copy { position: relative; }
.donate-copy.ok::after {
  content: "copied";
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  padding: 3px 8px;
  background: var(--bg-elev-2);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .35);
  font-size: 10.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: .02em;
  color: var(--accent);
  white-space: nowrap;
  pointer-events: none;
  z-index: 20;
  animation: copied-pop .15s ease-out;
}
.donate-copy.ok::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 1px);
  right: 9px;
  width: 7px; height: 7px;
  background: var(--bg-elev-2);
  border-right: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  transform: rotate(45deg);
  pointer-events: none;
  z-index: 19;
}
@keyframes copied-pop {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: translateY(0); }
}
.donate-foot {
  margin: 10px 0 0;
  font-size: 10.5px;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}

@media (max-width: 720px) {
  .donate-popover {
    width: calc(100vw - 32px);
    right: -8px;
  }
  .donate-arrow { right: 38px; }
}

.snapshot-stamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.snapshot-stamp time { font-family: var(--font-mono); color: var(--text); }
.snapshot-stamp .snapshot-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(134, 239, 172, .12);
}
.snapshot-stamp.pending .snapshot-dot { background: var(--text-muted); box-shadow: none; }
.snapshot-stamp.refreshing { color: var(--text); }
.snapshot-stamp.refreshing .snapshot-dot {
  background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(253, 230, 138, .6);
  animation: pulse 1.6s ease-out infinite;
}
/* Data older than 3× the configured refresh interval — primary
   source is probably down. Soft amber, not red: still serving the
   last known snapshot, so it's a "heads up", not an outage. */
.snapshot-stamp.is-stale { color: var(--accent-warm); }
.snapshot-stamp.is-stale .snapshot-dot {
  background: var(--accent-warm);
  box-shadow: 0 0 0 4px rgba(252, 165, 165, .14);
}
.snapshot-stamp .muted { color: var(--text-muted); font-family: var(--font-mono); }
.refresh-text { display: inline-flex; align-items: center; gap: 6px; }
.refresh-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(253, 230, 138, .12);
}
.refresh-eta { color: var(--text-muted); font-family: var(--font-mono); font-size: 11.5px; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0   rgba(253, 230, 138, .55); }
  70%  { box-shadow: 0 0 0 10px rgba(253, 230, 138, 0); }
  100% { box-shadow: 0 0 0 0   rgba(253, 230, 138, 0); }
}

main.wrap { flex: 1 0 auto; padding-top: 36px; padding-bottom: 56px; }

/* --------- legal disclaimer (DYOR banner) --------- */
.legal-notice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  margin: 0 0 28px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(253, 230, 138, .35);
  background:
    linear-gradient(135deg, rgba(253, 230, 138, .08), rgba(252, 165, 165, .05)),
    rgba(20, 18, 12, .55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  color: var(--text);
  position: relative;
}
.legal-notice.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 220ms ease, transform 220ms ease;
}
.legal-notice-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(253, 230, 138, .14);
  color: var(--accent-2);
}
.legal-notice-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.45;
  font-size: 13.5px;
}
.legal-notice-title {
  color: var(--accent-2);
  font-weight: 600;
  letter-spacing: .01em;
}
.legal-notice-text {
  color: var(--text-dim);
}
.legal-notice-dismiss {
  flex: 0 0 auto;
  align-self: center;
  padding: 8px 14px;
  border: 1px solid rgba(253, 230, 138, .4);
  border-radius: 999px;
  background: transparent;
  color: var(--accent-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.legal-notice-dismiss:hover {
  background: rgba(253, 230, 138, .12);
  border-color: var(--accent-2);
}
.legal-notice-dismiss:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}
@media (max-width: 640px) {
  .legal-notice {
    flex-wrap: wrap;
    padding: 12px 14px;
    gap: 10px;
  }
  .legal-notice-body { flex: 1 1 100%; font-size: 13px; }
  .legal-notice-dismiss { margin-left: auto; }
}

/* --------- hero --------- */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: end;
  margin-bottom: 36px;
}
.hero-text h1 {
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  font-weight: 700;
}
.hero-text p {
  margin: 0;
  max-width: 56ch;
  color: var(--text-dim);
}
.hero-text strong { color: var(--text); font-weight: 600; }

/* Right column of the hero: snapshot stamp on top, three stat
   cards below. Aligned to the bottom (same as the original hero)
   so the stat strip still lines up with the lede paragraph. */
.hero-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}
.snapshot-stamp.in-hero {
  align-self: flex-end;
  padding: 6px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--bg-elev);
  font-size: 12px;
}
.snapshot-stamp.in-hero time { font-size: 12px; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  overflow: hidden;
}
.stat-strip li {
  padding: 18px 20px;
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  align-items: center;
}
.stat-strip li:last-child { border-right: none; }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
.stat-value { font-family: var(--font-mono); font-size: 22px; font-weight: 600; letter-spacing: -.01em; line-height: 1; }
.stat-value.accent { color: var(--accent); }

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; align-items: start; gap: 24px; }
  .stat-strip { grid-template-columns: repeat(3, 1fr); }
  .stat-strip li { padding: 14px 8px; }
  .stat-value { font-size: 18px; }
}

/* --------- FAQ section ---------
   Sits below the perp vaults on the homepage. Each Q+A uses a
   native <details> element so it works without JavaScript and
   stays accessible for keyboard / screen-reader users. Mirrored
   to a schema.org/FAQPage JSON-LD block for Google rich snippets. */
.faq-section {
  margin: 56px 0 32px;
  padding: 28px 0 8px;
  border-top: 1px solid var(--border-soft);
}
.faq-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 18px;
  letter-spacing: -0.005em;
  color: var(--text);
}
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 820px;
}
.faq-item {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--bg-elev);
  overflow: hidden;
  transition: border-color .15s, background .15s;
}
.faq-item[open] {
  border-color: var(--border);
  background: var(--bg-elev-2);
}
.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  list-style: none;
  user-select: none;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q:hover { color: var(--accent); }
.faq-caret {
  width: 14px; height: 14px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform .2s ease;
}
.faq-item[open] .faq-caret { transform: rotate(180deg); color: var(--accent); }
.faq-a {
  padding: 0 18px 16px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
}
@media (max-width: 560px) {
  .faq-section { margin: 40px 0 24px; padding-top: 22px; }
  .faq-title { font-size: 19px; }
  .faq-q { font-size: 14px; padding: 12px 14px; }
  .faq-a { padding: 0 14px 14px; font-size: 13.5px; }
}

/* --------- filter bar --------- */
.filter-bar {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.search {
  flex: 1 1 320px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-muted);
}
.search:focus-within { border-color: var(--accent); color: var(--text); }
.search svg { width: 16px; height: 16px; flex-shrink: 0; }
.search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font: inherit;
}

.min-apy { display: flex; align-items: center; gap: 10px; color: var(--text-dim); font-size: 13px; }
.apy-input {
  display: inline-flex;
  align-items: center;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}
.apy-input input {
  width: 64px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13.5px;
  text-align: right;
}
.apy-input .suffix { color: var(--text-muted); font-family: var(--font-mono); padding-left: 4px; }

button.apply {
  background: var(--accent);
  color: #052e1a;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s;
}
button.apply:hover { filter: brightness(1.05); }

/* Legacy class kept in case it's referenced elsewhere. */
a.clear { color: var(--text-muted); font-size: 13px; padding: 8px 10px; border-radius: var(--radius-sm); }
a.clear:hover { color: var(--text); background: var(--bg-elev-2); }

/* Primary "Reset filters" button — always present, dims when nothing
   is active so users always know how to undo their filter changes. */
.clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s, transform .15s;
}
.clear-btn svg { width: 12px; height: 12px; opacity: .8; }
.clear-btn:hover {
  color: #fca5a5;
  border-color: rgba(252, 165, 165, .45);
  background: rgba(252, 165, 165, .06);
}
.clear-btn:hover svg { opacity: 1; }
.clear-btn .clear-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  background: rgba(252, 165, 165, .18);
  color: #fca5a5;
  margin-left: 2px;
}
.clear-btn.is-disabled {
  opacity: .35;
  pointer-events: none;
  cursor: default;
}

/* Compact "N filters active · clear all" pill next to the results header. */
.active-filters {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  border: 1px solid rgba(252, 165, 165, .35);
  background: rgba(252, 165, 165, .07);
  color: var(--text-dim);
  font-size: 12px;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.active-filters:hover {
  background: rgba(252, 165, 165, .15);
  border-color: #fca5a5;
  color: var(--text);
}
.active-filters-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fca5a5;
  color: #2b0f10;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
}
.active-filters-clear {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-left: 8px;
  border-left: 1px solid rgba(252, 165, 165, .25);
  color: #fca5a5;
  font-weight: 500;
}
.active-filters-clear svg { width: 11px; height: 11px; }

.facet-block summary {
  cursor: pointer;
  list-style: none;
  font-size: 12.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .08em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  user-select: none;
}
.facet-block summary::-webkit-details-marker { display: none; }
.facet-block summary::before {
  content: "▸";
  font-size: 10px;
  transition: transform .15s;
  color: var(--text-muted);
}
.facet-block[open] summary::before { transform: rotate(90deg); }
.facet-block .muted { text-transform: none; letter-spacing: 0; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  max-height: 168px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.chips::-webkit-scrollbar { width: 6px; }
.chips::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
  transition: border-color .12s, color .12s, background .12s;
}
.chip input { display: none; }
.chip:hover { color: var(--text); border-color: #303744; }
.chip.is-on {
  background: rgba(134, 239, 172, .12);
  border-color: rgba(134, 239, 172, .45);
  color: var(--accent);
}

/* --------- risk row --------- */
.risk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.risk-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
  transition: border-color .12s, color .12s, background .12s;
}
.risk-chip input { display: none; }
.risk-chip .risk-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: .7;
}
.risk-chip .risk-count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  color: var(--text-muted);
}
.risk-chip:hover { color: var(--text); border-color: #303744; }

.risk-chip.risk-safe.is-on {
  color: #86efac;
  background: rgba(74, 222, 128, .10);
  border-color: rgba(74, 222, 128, .45);
}
.risk-chip.risk-medium.is-on {
  color: #fde68a;
  background: rgba(253, 230, 138, .10);
  border-color: rgba(253, 230, 138, .42);
}
.risk-chip.risk-risky.is-on {
  color: #fca5a5;
  background: rgba(252, 165, 165, .10);
  border-color: rgba(252, 165, 165, .42);
}

/* --------- results --------- */
.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.results-head h2 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-dim);
  margin: 0;
}
.results-head h2 strong { color: var(--text); font-weight: 600; }

.sort-row { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text-muted); }
.sort-link {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
}
.sort-link:hover { color: var(--text); background: var(--bg-elev); }
.sort-link.is-active { color: var(--text); background: var(--bg-elev-2); }
.sort-link .arrow { color: var(--accent); margin-left: 2px; }

.empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px;
  text-align: center;
  color: var(--text-dim);
}
.empty p { margin: 6px 0; }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
}
table.yields {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 760px;
}
table.yields thead th {
  position: sticky;
  top: 0;
  background: var(--bg-elev);
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  z-index: 1;
}
table.yields thead th.num { text-align: right; }

/* Sortable headers — wrap the label in a link so clicks rebuild the
   filter URL and the next direction toggles between asc / desc. */
table.yields thead th.sortable { padding: 0; }
table.yields thead th.sortable .th-sort {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: color .12s, background .12s;
}
table.yields thead th.sortable.num .th-sort { justify-content: flex-end; }
table.yields thead th.sortable .th-sort:hover { color: var(--text); background: rgba(255,255,255,.025); }
table.yields thead th.sortable.is-sorted .th-sort { color: var(--text); }
table.yields thead th.sortable .sort-arrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  opacity: .55;
  transition: opacity .12s, color .12s;
  min-width: 10px;
  text-align: center;
}
table.yields thead th.sortable.is-sorted .sort-arrow { color: var(--accent); opacity: 1; }
table.yields thead th.sortable .th-sort:hover .sort-arrow { opacity: 1; }

table.yields tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
table.yields tbody tr:last-child td { border-bottom: none; }
table.yields tbody tr:hover td { background: rgba(255,255,255,.02); }
table.yields td.num { text-align: right; }

.proto-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; position: relative; }
.risk-stripe {
  position: absolute;
  left: -16px;
  top: -12px;
  bottom: -12px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--text-muted);
}
.risk-stripe.risk-safe   { background: #4ade80; }
.risk-stripe.risk-medium { background: #fbbf24; }
.risk-stripe.risk-risky  { background: #f87171; }
.logo {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--bg-elev-2);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-soft);
}
.logo.placeholder {
  display: inline-grid; place-items: center;
  font-weight: 600;
  color: var(--text-dim);
  font-size: 12px;
}
.proto-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.proto-name {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}
a.proto-link {
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
  color: var(--text);
  transition: color .12s;
  border-bottom: 1px dashed transparent;
  padding-bottom: 1px;
  max-width: 100%;
}
a.proto-link:hover,
a.proto-link:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent-2);
}
.proto-link-icon {
  flex: 0 0 auto;
  width: 11px; height: 11px;
  color: var(--text-muted);
  opacity: .7;
  transition: opacity .12s, color .12s, transform .12s;
}
a.proto-link:hover .proto-link-icon,
a.proto-link:focus-visible .proto-link-icon {
  color: var(--accent);
  opacity: 1;
  transform: translate(1px, -1px);
}

.proto-name-row { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.proto-mobile-extras { display: none; }  /* shown only at mobile breakpoint */

/* Gift icon next to a protocol that has an override / airdrop. */
.airdrop-flag {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 5px;
  background: rgba(253, 230, 138, .12);
  color: var(--accent-2);
  cursor: help;
  outline: none;
  flex-shrink: 0;
}
.airdrop-flag svg { width: 11px; height: 11px; display: block; }
.airdrop-flag:hover, .airdrop-flag:focus-visible {
  background: rgba(253, 230, 138, .22);
  color: var(--accent-2);
}
.airdrop-flag .tip-bubble { left: -8px; right: auto; width: 240px; }
.airdrop-flag .tip-bubble::before { left: 12px; right: auto; }
.airdrop-flag:hover .tip-bubble,
.airdrop-flag:focus-visible .tip-bubble {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Airdrops filter chip in the risk row. */
.airdrop-chip {
  color: var(--text-dim);
  border-color: var(--border);
}
.airdrop-chip:hover { color: var(--accent-2); border-color: rgba(253, 230, 138, .35); }
.airdrop-chip.is-on {
  background: rgba(253, 230, 138, .18);
  border-color: var(--accent-2);
  color: var(--accent-2);
  box-shadow: 0 0 0 1px rgba(253, 230, 138, .25);
}
.airdrop-chip-icon { width: 13px; height: 13px; color: currentColor; }
.airdrop-chip .risk-label { color: inherit; }

/* Quick-filter chips for popular chains. Sit on their own row at
   the bottom of the filter bar — one click toggles a chain on/off
   while preserving every other active filter (the href is built
   with `_qs(filters, chains=...)`). Visually distinct from the
   facet chips above: thinner border, lighter weight, dimmer when
   off, brand-tinted when on. */
.quick-chain-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px dashed var(--border-soft);
}
.quick-chain-lead {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  margin-right: 4px;
}
.quick-chain-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 8px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color .12s, color .12s, background .12s, transform .12s;
}
.quick-chain-chip:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--bg-elev);
}
.quick-chain-chip.is-on {
  color: var(--accent);
  border-color: rgba(127, 200, 255, .5);
  background: rgba(127, 200, 255, .08);
}
.quick-chain-icon {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg-elev);
  object-fit: cover;
  flex-shrink: 0;
}
@media (max-width: 560px) {
  .quick-chain-row { gap: 8px; padding-top: 10px; }
  .quick-chain-lead { width: 100%; margin-right: 0; margin-bottom: 2px; }
  .quick-chain-chip { font-size: 12px; padding: 4px 10px 4px 7px; }
}
.proto-meta {
  display: flex; gap: 6px; align-items: center;
  font-size: 11.5px; color: var(--text-muted);
}
.proto-meta .cat { color: var(--text-dim); }
.asset-pill {
  display: inline-block;
  padding: 3px 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  letter-spacing: .02em;
}
/* Multi-asset stack — used for Balancer-style LP rows where one
   pool holds several stablecoins (USDC + USDT + DAI). Primary
   pill is full-opacity; extras render slightly dimmer and with a
   leading "+" so they read as additions to the main asset, not
   as separate rows. The trailing pill carries a hover tooltip
   listing the full basket. */
.asset-cell {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 100%;
}
.asset-cell .asset-pill.asset-extra {
  background: var(--bg-elev-1);
  color: var(--text-muted);
  padding: 3px 8px;
  font-size: 11px;
}
.asset-cell .asset-more {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  cursor: help;
  position: relative;
  outline: none;
}
.asset-cell .asset-more:hover,
.asset-cell .asset-more:focus-visible {
  color: var(--text);
  border-color: var(--accent);
}
.asset-cell .asset-more .tip-bubble {
  left: -8px;
  right: auto;
  width: 220px;
}
.asset-cell .asset-more .tip-bubble::before { left: 18px; right: auto; }
.asset-cell .asset-more:hover .tip-bubble,
.asset-cell .asset-more:focus-visible .tip-bubble {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.col-chain { color: var(--text-dim); }
.chain-cell { display: inline-flex; align-items: center; gap: 8px; }
.chain-icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  flex-shrink: 0;
}
/* Omnichain perp vaults — same vault, multiple deposit chains.
   The icons overlap slightly so a row of 4 still fits in the
   chain column without bumping into the next column. The "multichain"
   label replaces the per-chain name; a hover-tooltip (same style as
   the airdrop flag) reveals the full chain list. */
.chain-icon-stack {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.chain-icon-stack .chain-icon + .chain-icon {
  margin-left: -6px;
}
.chain-icon-stack .chain-icon {
  box-shadow: 0 0 0 1.5px var(--bg);
}
.chain-name { display: inline-flex; align-items: center; gap: 6px; }
.chain-cell.chain-multi {
  position: relative;
  cursor: help;
  outline: none;
}
.chain-cell.chain-multi .tip-bubble { left: -8px; right: auto; width: 260px; }
.chain-cell.chain-multi .tip-bubble::before { left: 18px; right: auto; }
.chain-cell.chain-multi:hover .tip-bubble,
.chain-cell.chain-multi:focus-visible .tip-bubble {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* --------- info tooltip (?) --------- */
.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  margin-left: 4px;
  color: var(--text-muted);
  cursor: help;
  outline: none;
  vertical-align: -2px;
}
.info-tip svg { width: 100%; height: 100%; display: block; }
.info-tip:hover, .info-tip:focus-visible { color: var(--accent); }

.tip-bubble {
  position: absolute;
  top: calc(100% + 10px);
  right: -8px;
  width: 260px;
  padding: 10px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 28px rgba(0,0,0,.45);
  color: var(--text);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: 0;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .14s, transform .14s;
  z-index: 5;
}
.tip-bubble::before {
  content: "";
  position: absolute;
  top: -6px; right: 12px;
  width: 10px; height: 10px;
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
}
.info-tip:hover .tip-bubble,
.info-tip:focus-visible .tip-bubble {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.tip-bubble b { color: var(--accent); font-weight: 600; }
.tip-example { display: block; margin-top: 6px; color: var(--text-dim); font-size: 11.5px; }

.apy-value { font-family: var(--font-mono); font-weight: 600; font-size: 14.5px; color: var(--text); }
.row.risk-safe   .apy-value { color: #86efac; }
.row.risk-medium .apy-value { color: #fde68a; }
.row.risk-risky  .apy-value { color: #fca5a5; }
/* APY below the dashboard's floor — dimmed so it's visually clear it
   wouldn't normally surface on the main board. */
.apy-value.apy-cool { color: var(--text-muted) !important; font-weight: 500; }

.apy-breakdown {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

.trend { font-family: var(--font-mono); font-size: 12.5px; }
.trend.up   { color: var(--up); }
.trend.down { color: var(--down); }

.col-tvl { color: var(--text-dim); }

/* --------- perp vaults section --------- */
.perps-section {
  margin-top: 32px;
}
.perps-section .results-head {
  margin-bottom: 12px;
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}
.perps-section h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.perps-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(253, 230, 138, .12);
  color: var(--accent-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.perps-sub {
  margin: 0;
  max-width: 60ch;
  color: var(--text-muted);
  font-size: 12.5px;
}
.perps-table { font-size: 13.5px; }
.perps-table thead th { background: rgba(253, 230, 138, .03); }
.perps-section .table-wrap { border-color: rgba(253, 230, 138, .14); }

/* --------- admin login --------- */
.admin-login {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 56px 0 80px;
}
.admin-login-card {
  width: 100%;
  max-width: 380px;
  padding: 28px 28px 22px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
}
.admin-login-head { margin-bottom: 16px; }
.admin-login-head h1 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.admin-login-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12.5px;
}
.admin-login-error {
  margin-bottom: 14px;
  padding: 10px 12px;
  background: rgba(252, 165, 165, .08);
  border: 1px solid rgba(252, 165, 165, .35);
  border-radius: var(--radius-sm);
  color: #fecaca;
  font-size: 12.5px;
}
.admin-login-label {
  display: block;
  margin: 12px 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: .02em;
}
.admin-login-input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  transition: border-color .12s, box-shadow .12s;
}
.admin-login-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(134, 239, 172, .15);
}
.admin-login-captcha {
  margin: 18px 0 0;
  display: flex;
  justify-content: center;
}
/* Altcha widget styling — match the form's dark surface so it
   doesn't look like a third-party pop-in. Variables are read by
   the widget itself (it's a custom element, all properties scoped). */
.admin-login-captcha altcha-widget {
  --altcha-color-base: var(--bg-elev-2);
  --altcha-color-text: var(--text);
  --altcha-color-border: var(--border);
  --altcha-color-error-text: #fecaca;
  --altcha-color-footer-bg: transparent;
  --altcha-border-radius: var(--radius-sm);
  --altcha-max-width: 100%;
  width: 100%;
}
.admin-login-submit {
  width: 100%;
  margin-top: 18px;
  padding: 10px 14px;
  background: var(--accent);
  color: #052e1a;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .12s;
}
.admin-login-submit:hover { filter: brightness(1.05); }
.admin-login-submit:active { filter: brightness(.95); }
.admin-login-foot {
  margin: 16px 0 0;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.5;
}
.admin-login-foot code {
  padding: 0 4px;
  background: var(--bg-elev-2);
  border-radius: 4px;
  font-size: 11px;
}

/* --------- admin (link overrides) --------- */
.admin-logout-form { margin: 0; }
.admin-logout-btn {
  padding: 6px 12px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.admin-logout-btn:hover {
  color: var(--text);
  border-color: var(--accent-warm);
  background: rgba(252, 165, 165, .08);
}
.admin-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}
.admin-hero h1 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.admin-hero p {
  margin: 0;
  max-width: 60ch;
  color: var(--text-dim);
  font-size: 13.5px;
}
.admin-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-pill {
  padding: 6px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-dim);
}
.admin-pill strong { color: var(--text); font-family: var(--font-mono); margin-right: 4px; }

.admin-toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.admin-search {
  flex: 1 1 320px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}
.admin-search svg { width: 14px; height: 14px; }
.admin-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.admin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
  cursor: pointer;
}
.admin-toggle input { accent-color: var(--accent); }

.admin-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  overflow: hidden;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table thead th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: 10px 14px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.admin-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr.saving td { background: rgba(253, 230, 138, .04); }
.admin-table tbody tr.ok td {
  background: rgba(134, 239, 172, .08);
  transition: background 1.2s ease-out;
}
.admin-table tbody tr.error td { background: rgba(248, 113, 113, .1); }

.col-name { width: 28%; }
.col-origin { width: 24%; }
.col-override { width: 28%; }
.col-airdrop { width: 9%; text-align: center; }
.col-action { width: 11%; text-align: right; white-space: nowrap; }

.admin-airdrop-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.admin-airdrop-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.admin-airdrop-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .02);
  color: var(--text-dim);
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.admin-airdrop-toggle:hover .admin-airdrop-pill {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.admin-airdrop-toggle input:checked + .admin-airdrop-pill {
  background: rgba(134, 239, 172, .14);
  border-color: rgba(134, 239, 172, .55);
  color: #86efac;
}
.admin-airdrop-toggle input:focus-visible + .admin-airdrop-pill {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Dormant protocol rows — kept around so overrides survive an APY dip. */
.admin-table tbody tr.is-dormant td {
  opacity: 0.62;
}
.admin-table tbody tr.is-dormant:hover td {
  opacity: 0.88;
}
.admin-dormant-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(154, 163, 178, 0.12);
  border: 1px solid var(--border);
  border-radius: 999px;
  vertical-align: middle;
  cursor: help;
}
/* Star next to a protocol name in the admin grid → upstream URL
   carried a referral param. Subtle gold so it reads as info, not
   warning; helps the operator spot "this team has a partner
   program" without scanning the URL column. */
.admin-ref-star {
  display: inline-block;
  margin-left: 6px;
  color: var(--accent-2);
  font-size: 13px;
  line-height: 1;
  vertical-align: middle;
  cursor: help;
  text-shadow: 0 0 6px rgba(253, 230, 138, .35);
}
.admin-pill-sub {
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 2px;
}

.admin-proto { display: flex; align-items: center; gap: 10px; }
.admin-proto .logo { width: 26px; height: 26px; }
.admin-proto-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.admin-proto-name { font-weight: 500; color: var(--text); }
.admin-proto-meta { font-size: 10.5px; color: var(--text-muted); font-family: var(--font-mono); }
.admin-slug { color: var(--text-dim); }
.admin-cat, .admin-pool-n { color: var(--text-muted); }

.admin-original-link {
  display: inline-block;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  vertical-align: middle;
}
.admin-original-link:hover { color: var(--accent); }

.admin-override-input {
  width: 100%;
  padding: 7px 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
  transition: border-color .12s;
}
.admin-override-input:focus { border-color: var(--accent); }
.admin-override-input::placeholder { color: var(--text-muted); opacity: .6; }

.admin-save-btn, .admin-clear-btn {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.admin-save-btn { color: var(--accent); border-color: rgba(134, 239, 172, .3); }
.admin-save-btn:hover { background: rgba(134, 239, 172, .08); border-color: var(--accent); }
.admin-clear-btn { margin-left: 6px; color: var(--text-muted); }
.admin-clear-btn:hover { color: var(--accent-warm); border-color: var(--accent-warm); }

/* --------- admin tabs --------- */
.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: 18px 0 22px;
  flex-wrap: wrap;
}
.admin-tab {
  position: relative;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 13.5px;
  padding: 10px 16px 12px;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color .12s, background .12s;
}
.admin-tab:hover { color: var(--text); background: rgba(255,255,255,.025); }
.admin-tab.is-active { color: var(--text); }
.admin-tab.is-active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}
.admin-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--bg-elev-2);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}
.admin-tab.is-active .admin-tab-count {
  background: rgba(134, 239, 172, .15);
  color: var(--accent);
}

.admin-panel { display: none; }
.admin-panel.is-active { display: block; }
.admin-panel-intro {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 18px;
  max-width: 760px;
}
.admin-panel-intro code {
  background: var(--bg-elev-2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text);
}

/* --------- admin CRUD cards (support, partners) --------- */
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.admin-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  padding: 16px 18px;
  transition: border-color .15s, background .15s, opacity .2s;
}
.admin-card.saving { border-color: rgba(253, 230, 138, .35); }
.admin-card.ok     { border-color: rgba(134, 239, 172, .45); background: rgba(134, 239, 172, .04); }
.admin-card.error  { border-color: rgba(252, 165, 165, .55); }
.admin-card-new {
  border-style: dashed;
  background: rgba(255, 255, 255, .015);
}
.admin-card-head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.api-token-new-result {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(253, 230, 138, .06);
  border: 1px solid rgba(253, 230, 138, .35);
}
.api-token-new-warn {
  margin: 0 0 8px;
  font-size: 12px;
  color: #fde68a;
  letter-spacing: .02em;
}
.api-token-new-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, .35);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.api-token-new-box code {
  flex: 1;
  font-size: 13px;
  word-break: break-all;
  color: var(--text);
}

.api-usage {
  margin-top: 28px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
}
.api-usage-head {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.api-usage-head h3 {
  margin: 0 0 4px;
  font-size: 15px;
  letter-spacing: .02em;
}
.api-usage-sub {
  margin: 0;
  font-size: 12px;
  max-width: 56ch;
}
.api-usage-sub code {
  background: rgba(255, 255, 255, .04);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text);
}
.api-usage-input {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 320px;
  flex: 1;
  max-width: 480px;
}
.api-usage-input > span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
}
.api-usage-input > input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--border);
  color: var(--text);
}
.api-usage-input > input:focus {
  outline: none;
  border-color: rgba(134, 239, 172, .45);
}

.api-usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 14px;
}
.api-usage-card {
  background: rgba(0, 0, 0, .25);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.api-usage-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  letter-spacing: .02em;
  background: rgba(255, 255, 255, .015);
}
.api-usage-card pre {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text);
  background: transparent;
}
.api-usage-card pre code {
  background: transparent;
  padding: 0;
}
.api-usage-copy {
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.api-usage-copy:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(134, 239, 172, .45);
}
.api-usage-warn {
  margin: 0;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(253, 230, 138, .04);
}

.api-usage-details {
  margin-top: 16px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, .15);
}
.api-usage-details summary {
  cursor: pointer;
  font-size: 12px;
  letter-spacing: .02em;
  color: var(--text-muted);
}
.api-usage-details[open] summary { color: var(--text); margin-bottom: 8px; }
.api-usage-details code {
  background: rgba(255, 255, 255, .04);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.admin-form { display: flex; flex-direction: column; gap: 10px; }
.admin-form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.admin-form-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 1 160px;
  min-width: 120px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.admin-form-row label.grow { flex: 1 1 280px; }
.admin-form-row label.narrow { flex: 0 0 96px; min-width: 0; }
.admin-form-row label > span { display: inline-flex; gap: 4px; align-items: baseline; }
.admin-form-row label .muted { font-weight: 400; text-transform: none; letter-spacing: 0; }
.admin-form-row input[type="text"],
.admin-form-row input[type="url"],
.admin-form-row input[type="number"] {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .12s;
}
.admin-form-row input:focus { border-color: var(--accent); }
.admin-form-row input::placeholder { color: var(--text-muted); opacity: .6; }

.admin-form-actions { display: flex; gap: 8px; flex: 0 0 auto; padding-bottom: 1px; }
.admin-delete-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.admin-delete-btn:hover {
  color: #fca5a5;
  border-color: rgba(252, 165, 165, .45);
  background: rgba(252, 165, 165, .06);
}

/* --------- public partners strip --------- */
.partners-strip {
  position: relative;
  z-index: 1;
  padding: 36px 0 28px;
  border-top: 1px solid var(--border-soft);
  margin-top: 60px;
}
.partners-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.partners-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .12em;
}
.partners-sub { color: var(--text-muted); font-size: 12.5px; }
.partners-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.partner-card { display: flex; }
.partner-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s, background .15s, transform .15s;
}
.partner-link:hover {
  border-color: var(--accent);
  background: rgba(134, 239, 172, .04);
  transform: translateY(-1px);
}
.partner-name {
  font-weight: 600;
  font-size: 13.5px;
  flex-shrink: 0;
}
.partner-blurb {
  color: var(--text-muted);
  font-size: 11.5px;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.partner-arrow {
  width: 12px;
  height: 12px;
  color: var(--text-muted);
  opacity: .7;
  flex-shrink: 0;
  transition: color .15s, opacity .15s, transform .15s;
}
.partner-link:hover .partner-arrow {
  color: var(--accent);
  opacity: 1;
  transform: translate(1px, -1px);
}

/* ---- partners: marquee mode (auto-applied when ≥ 5 partners) ---- */
.partners-marquee-wrap {
  position: relative;
  overflow: hidden;
  /* Soft fade-out at both edges so cards don't pop in/out abruptly. */
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 4%,
    #000 96%,
    transparent 100%
  );
          mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 4%,
    #000 96%,
    transparent 100%
  );
}
.partners-list.is-marquee {
  display: flex;
  flex-wrap: nowrap;
  /* Each card sets its own min-width — the list must grow to fit
     all of them (incl. the cloned half) so the animation has room
     to slide. */
  width: max-content;
  gap: 12px;
  /* 38s is the sweet spot for 8–15 cards — slow enough to read
     each name, fast enough to feel alive. JS-free; rate is set
     in seconds, not px/s, so the loop looks consistent regardless
     of how many partners are in it. */
  animation: partners-marquee 38s linear infinite;
}
.partners-list.is-marquee .partner-card {
  /* Fixed width keeps every card the same size and prevents the
     last item in a row from stretching to fill the remainder. */
  flex: 0 0 240px;
  min-width: 240px;
}
.partners-marquee-wrap:hover .partners-list.is-marquee,
.partners-marquee-wrap:focus-within .partners-list.is-marquee {
  animation-play-state: paused;
}
@keyframes partners-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
/* Users who opted out of motion: stop the auto-scroll and expose a
   normal horizontal scrollbar so they can pan manually. The clone
   becomes redundant in this mode but doesn't hurt anything. */
@media (prefers-reduced-motion: reduce) {
  .partners-marquee-wrap {
    overflow-x: auto;
    -webkit-mask-image: none;
            mask-image: none;
  }
  .partners-list.is-marquee {
    animation: none;
    width: max-content;
  }
}

@media (max-width: 920px) {
  .admin-hero { flex-direction: column; }
  .col-origin { display: none; }
  .col-name { width: 36%; }
  .col-override { width: 44%; }
  .col-airdrop { width: 10%; }
  .admin-form-row { gap: 8px; }
  .admin-form-row label { flex: 1 1 100%; }
  .admin-form-actions { width: 100%; justify-content: flex-end; }
}
@media (max-width: 720px) {
  .partners-strip { padding: 28px 0 20px; margin-top: 40px; }
  /* Static grid only applies when we're NOT in marquee mode —
     the marquee uses its own flex layout. */
  .partners-list:not(.is-marquee) { grid-template-columns: 1fr 1fr; gap: 10px; }
  .partners-list.is-marquee .partner-card { flex: 0 0 200px; min-width: 200px; }
  .partner-link { padding: 10px 12px; gap: 8px; }
  .partner-name { font-size: 12.5px; }
  .partner-blurb { display: none; }
  .admin-tab { padding: 8px 12px 10px; font-size: 12.5px; }
}

/* --------- footer --------- */
.site-footer {
  margin-top: auto;
  padding: 24px 0 32px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg);
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.footer-row time { color: var(--text); font-family: var(--font-mono); }
/* Copyright sits at the far right of the top footer row, balancing
   the nav / contact strip on the left. */
.footer-copy {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Footer navigation row: real anchor links to /about, /api etc.
   Sized as a low-weight inline list so it doesn't fight the
   timestamp + copyright for attention. */
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-right: 16px;
}
.footer-nav a {
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.15s ease;
}
.footer-nav a:hover { color: var(--text); }

/* Footer contact strip: small monochrome SVG buttons next to the
   site nav. Inherits ``currentColor`` from the anchor, so hover
   lights them up without needing per-brand fills. */
.footer-contacts {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 16px;
}
.footer-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--text-dim);
  transition: color .15s ease, background .15s ease, transform .15s ease;
}
.footer-contact:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .05);
  transform: translateY(-1px);
}
.footer-contact .contact-icon { display: block; }

/* About page — Contact section list, larger icon + label combo. */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.contact-list li { margin: 0; }
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elev);
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s, background .15s, transform .15s;
}
.contact-link:hover {
  border-color: rgba(134, 239, 172, .45);
  background: rgba(134, 239, 172, .05);
  transform: translateY(-1px);
}
.contact-link .contact-icon { color: var(--text-dim); }
.contact-link:hover .contact-icon { color: var(--text); }
.contact-link span { font-weight: 500; letter-spacing: .01em; }

/* Admin contacts tab — small inline preview icon next to the URL field. */
.contact-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  background: rgba(0, 0, 0, .25);
  transition: color .15s, border-color .15s;
}
.contact-preview:hover { color: var(--text); border-color: rgba(134, 239, 172, .45); }

/* --------- static pages (/about, /404) --------- */

.static-page {
  max-width: 760px;
  margin: 32px auto 56px;
  padding: 0 4px;
  line-height: 1.62;
  color: var(--text);
  font-size: 15.5px;
}
.static-hero {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-soft);
}
.static-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 12px;
}
.static-page h1 {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  line-height: 1.18;
}
.static-lede {
  font-size: 17px;
  color: var(--text-dim);
  margin: 0;
}
.static-lede strong { color: var(--text); }
.static-section {
  margin-top: 40px;
  /* Scroll-margin lives on the <section> itself (not its h2) so
     anchor links like #methodology / #disclaimer land just below
     the sticky header instead of having the heading hidden under
     it. Putting it on the h2 has no effect — the browser scrolls
     to the element matching the id, which is the <section>. */
  scroll-margin-top: 90px;
}
.static-section h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 12px;
  letter-spacing: -0.005em;
}
.static-section p { margin: 0 0 12px; color: var(--text-dim); }
.static-section p strong { color: var(--text); }
.static-section a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.static-section code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--text);
}
.static-steps { padding-left: 20px; margin: 0; color: var(--text-dim); }
.static-steps li { margin-bottom: 12px; }
.static-steps li strong { color: var(--text); }
.static-list { padding-left: 20px; margin: 0; color: var(--text-dim); }
.static-list li { margin-bottom: 6px; }

.static-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 20px;
  font-size: 14px;
}
.static-table th,
.static-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
.static-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 600;
}
.static-table td:first-child { white-space: nowrap; color: var(--text); }
.static-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: middle;
}
.static-dot.safe   { background: #34d399; }
.static-dot.medium { background: #fbbf24; }
.static-dot.risky  { background: #f87171; }
.static-meta { font-size: 13px; }

.static-footer-cta { margin-top: 48px; }
.static-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.static-cta:hover { border-color: var(--accent); color: var(--accent); }
.static-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
}
.static-cta-secondary:hover { color: var(--accent); }

.error-page { text-align: center; margin-top: 72px; }
.error-page h1 { font-size: 48px; }
.error-page .static-eyebrow {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin-bottom: 0;
  line-height: 1;
}

@media (max-width: 720px) {
  .static-page { font-size: 14.5px; }
  .static-page h1 { font-size: 28px; }
  .static-lede { font-size: 15px; }
  .static-section h2 { font-size: 18px; }
  .static-table { font-size: 13px; }
  .footer-nav { gap: 14px; }
  .error-page h1 { font-size: 32px; }
  .error-page .static-eyebrow { font-size: 40px; }
}

/* --------- mobile / narrow screens --------- */
@media (max-width: 720px) {
  .header-nav a:not(:first-child) { display: none; }

  /* On mobile the only columns we show are: protocol, asset, APY.
     The chain icon is folded into the protocol cell as a meta line,
     7d and TVL are dropped entirely — they're the least scannable
     numbers on a small screen. */
  table.yields .col-chain,
  table.yields .col-7d,
  table.yields .col-tvl { display: none; }
  .table-wrap { overflow: hidden; }
  table.yields {
    min-width: 0;
    width: 100%;
    font-size: 13px;
    table-layout: fixed;
  }
  /* Lock column proportions so APY is always visible regardless of asset
     symbol length. Protocol gets most of the room, asset is a fixed pill,
     APY is right-aligned and snug. */
  table.yields .col-proto  { width: auto; }
  table.yields .col-asset  { width: 92px; }
  table.yields .col-apy    { width: 78px; }
  table.yields thead th { padding: 10px 10px; font-size: 10.5px; }
  table.yields thead th.sortable .th-sort { padding: 10px 10px; }
  table.yields tbody td { padding: 10px 10px; }

  .proto-cell { min-width: 0; gap: 10px; }
  .proto-text { min-width: 0; flex: 1; overflow: hidden; }
  .proto-name-row {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .proto-name { max-width: none; font-size: 13.5px; }
  .proto-meta { display: none; }
  .proto-mobile-extras {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .proto-mobile-extras .chain-cell {
    gap: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  .proto-mobile-extras .chain-icon { width: 13px; height: 13px; }
  .logo { width: 26px; height: 26px; }

  .apy-value { font-size: 14px; }
  .apy-breakdown { display: none; }
  .asset-pill {
    font-size: 10.5px;
    padding: 2px 7px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
  }

  /* Filter bar compaction */
  .filter-bar { padding: 12px 14px; gap: 10px; }
  .primary-row { gap: 8px; }
  .search { flex-basis: 100%; padding: 6px 10px; }
  .min-apy { font-size: 12px; }
  .apy-input input { width: 56px; font-size: 12.5px; }
  button.apply { padding: 6px 14px; }
  .facet-block summary { font-size: 12px; }
  .chips { max-height: 200px; }
  .chip { font-size: 11.5px; padding: 3px 9px; }
  .risk-row { gap: 8px; }
  .risk-chip { padding: 4px 10px; font-size: 11.5px; }

  /* Header — phone breakpoint. We deliberately keep brand + lang +
     donate on a single row (no flex-wrap) so the bar looks compact
     instead of accordion-ing into a 2-line tower with the right-
     side controls floating off in the air. The perp shortcut is
     redundant on phones (also exposed as a banner above the main
     table and as the section H2 below), so we hide it to free up
     horizontal room. We *only* zero the vertical padding here —
     leaving horizontal alone so the inherited ``.wrap`` 18-22px
     side padding keeps the bar away from the screen edges instead
     of sticking the brand mark to the bezel. */
  .header-row { height: 60px; padding-block: 0; flex-wrap: nowrap; column-gap: 10px; }
  /* Right-side controls (lang + donate) must NEVER shrink — they're
     fixed-width fixtures. The brand block absorbs every spare pixel
     and truncates the wordmark with an ellipsis instead. Without
     this flex-shrink: 0 the lang button would sit *under* a longer
     "stablesonar" wordmark on iPhone-class widths. */
  .header-right { flex: 0 0 auto; justify-content: flex-end; gap: 8px; flex-wrap: nowrap; }
  .header-right > * { flex-shrink: 0; }
  .brand { flex: 1 1 auto; min-width: 0; gap: 9px; }
  .brand-mark { width: 30px; height: 30px; flex-shrink: 0; }
  .brand-mark svg { width: 22px; height: 22px; }
  .brand-name { font-size: 16px; white-space: nowrap; }
  .snapshot-stamp { font-size: 11.5px; }
  /* Donate stays the visually-dominant CTA — keep the fill, keep
     the label (just swap "Support us" → "Donate" so it fits). */
  .donate-btn { font-size: 12.5px; padding: 6px 13px 6px 11px; gap: 6px; }
  .donate-label-full  { display: none; }
  .donate-label-short { display: inline; }
  .header-nav-link { display: none; }

  /* Hero compaction */
  .hero { margin-bottom: 24px; gap: 20px; }
  .hero-text h1 { font-size: 26px; }
  .hero-text p { font-size: 13px; }

  /* Perp section */
  .perps-table .col-chain { display: none; }
  .perps-section h2 { font-size: 14.5px; }

  /* Footer stack */
  .footer-row { flex-direction: column; align-items: flex-start; gap: 8px; font-size: 11.5px; }
  .footer-copy { margin-left: 0; }
  .footer-nav { margin-right: 0; gap: 12px; }
}

@media (max-width: 480px) {
  /* Ultra-narrow (iPhone SE class, 360–480px). Brand wordmark
     stays visible — it's the most-asked-for tweak — but we trim
     gaps and font sizes so brand + lang + donate still fit on
     one neat row instead of wrapping. */
  .header-row { column-gap: 8px; height: 56px; }
  .header-right { gap: 6px; }
  .brand { gap: 8px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-mark svg { width: 20px; height: 20px; }
  .brand-name { font-size: 15px; }
  .lang-btn { max-width: 9ch; padding: 4px 8px 4px 10px; font-size: 11px; }
  .donate-btn { padding: 5px 11px 5px 9px; font-size: 12px; gap: 5px; }
  .donate-heart { width: 13px; height: 13px; }
}

/* Bottom-rung phones (<= 360px, e.g. iPhone SE 1st gen). Last
   stop — if even the compact row above bursts the viewport we'd
   rather drop the wordmark than wrap. */
@media (max-width: 360px) {
  .brand-name { display: none; }
  .donate-btn { padding: 5px 10px; }
}

/* ---------------- admin · Content tab (editable copy) ---------------- */
.admin-toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin: 8px 0 18px;
}
.admin-search {
  position: relative;
  flex: 1 1 320px;
  min-width: 240px;
  display: flex;
  align-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 10px 0 34px;
}
.admin-search svg {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.admin-search input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-size: 13px;
  width: 100%;
  padding: 9px 0;
}
.admin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
}
.admin-toggle input { accent-color: var(--accent); }

.content-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 14px;
  background: var(--bg-elev);
  overflow: hidden;
}
.content-group > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  user-select: none;
}
.content-group > summary::-webkit-details-marker { display: none; }
.content-group > summary::before {
  content: "▸";
  display: inline-block;
  width: 12px;
  color: var(--muted);
  transition: transform 0.15s ease;
}
.content-group[open] > summary::before { transform: rotate(90deg); }
.content-group-count {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 999px;
}

.content-rows {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
.content-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background 0.18s ease;
}
.content-row:last-child { border-bottom: none; }
.content-row.is-override { background: rgba(255, 196, 80, 0.04); }
.content-row.saving { background: rgba(120, 160, 255, 0.08); }
.content-row.ok { background: rgba(80, 200, 120, 0.10); }
.content-row.error { background: rgba(240, 90, 90, 0.10); }

.content-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.content-row-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
}
.content-row-label strong { font-weight: 600; color: var(--fg); }
.content-pill {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 196, 80, 0.18);
  color: #ffcb6b;
  border: 1px solid rgba(255, 196, 80, 0.35);
}
.content-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(120, 160, 255, 0.14);
  color: #9ab8ff;
}
.admin-slug {
  font-size: 11.5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}
.content-row-hint {
  font-size: 11.5px;
  color: var(--muted);
}
.content-row-hint code {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--fg);
}
.content-row-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--fg);
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
}
.content-row-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(120, 160, 255, 0.18);
}
textarea.content-row-input {
  min-height: 80px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12.5px;
}
.content-row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.content-default-toggle {
  margin-left: auto;
  font-size: 11.5px;
}
.content-default-toggle > summary {
  cursor: pointer;
  color: var(--muted);
  user-select: none;
  list-style: none;
}
.content-default-toggle > summary::-webkit-details-marker { display: none; }
.content-default-toggle > summary:hover { color: var(--fg); }
.content-default-text {
  margin-top: 6px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  white-space: pre-wrap;
  color: var(--muted);
  max-height: 260px;
  overflow: auto;
}

/* ---------------- header · language switcher ---------------- */
.lang-wrap { position: relative; display: inline-block; }
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--fg);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 10px 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  /* Native script labels vary in width (English vs Українська vs 한국어).
     Cap the button so the header layout doesn't twitch when the user
     switches language. */
  max-width: 16ch;
}
.lang-btn .lang-native {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lang-btn:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.18); }
.lang-btn[aria-expanded="true"] { background: rgba(255, 255, 255, 0.10); border-color: var(--accent); }
.lang-caret { width: 10px; height: 10px; opacity: 0.65; flex-shrink: 0; }

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.lang-menu[hidden] { display: none; }
.lang-option {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--fg);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.12s ease;
}
.lang-option:hover { background: rgba(255, 255, 255, 0.06); }
.lang-option.is-active { background: rgba(255, 255, 255, 0.08); }
.lang-option.is-active::after {
  content: "✓";
  margin-left: auto;
  color: var(--accent);
  font-weight: 700;
}
.lang-option .lang-native { font-weight: 500; }

@media (max-width: 760px) {
  .lang-btn { padding: 4px 9px 4px 11px; font-size: 11.5px; max-width: 12ch; }
  .lang-caret { width: 9px; height: 9px; }
  .lang-menu { right: -4px; min-width: 180px; }
}

/* ---------------- admin · Content tab · locale switcher ---------------- */
.admin-locale-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding: 10px 14px;
  background: rgba(120, 160, 255, 0.04);
  border: 1px solid rgba(120, 160, 255, 0.18);
  border-radius: 12px;
}
.admin-locale-label {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.2px;
}
.admin-locale-pills {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}
.admin-locale-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.admin-locale-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}
.admin-locale-pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0c10;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(120, 200, 140, 0.25);
}
.admin-locale-pill.is-active .admin-locale-tag { color: #0a0c10; opacity: 0.85; }
.admin-locale-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.55;
  color: var(--fg);
}

/* Bilingual panes for the Content tab */
.content-row-bi {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.content-row-bi.is-mono { grid-template-columns: 1fr; }
.content-pane {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.content-pane-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
}
.content-pane-en .content-row-input {
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  cursor: default;
}
.content-pane-loc .content-row-input {
  border-color: rgba(120, 160, 255, 0.3);
}
.content-pane-loc .content-row-input:focus {
  border-color: var(--accent);
}

/* Per-locale source badges */
.content-pill.pill-override {
  background: rgba(255, 196, 80, 0.18);
  color: #ffcb6b;
  border: 1px solid rgba(255, 196, 80, 0.35);
}
.content-pill.pill-translation {
  background: rgba(120, 200, 140, 0.16);
  color: #8fdfa3;
  border: 1px solid rgba(120, 200, 140, 0.34);
}
.content-pill.pill-fallback {
  background: rgba(240, 120, 100, 0.14);
  color: #ff9b8a;
  border: 1px solid rgba(240, 120, 100, 0.32);
}

@media (max-width: 900px) {
  .content-row-bi { grid-template-columns: 1fr; }
}

.admin-panel-intro {
  margin: 0 0 16px;
  padding: 12px 16px;
  background: rgba(120, 160, 255, 0.06);
  border-left: 3px solid rgba(120, 160, 255, 0.6);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}
.admin-panel-intro strong { color: var(--fg); }
.admin-panel-intro code {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px;
  color: var(--fg);
}
