/* DeFiEarns — "Terminal" design system. Dark only. */
:root {
  --bg: #0b0e11; --bg-2: #0f1317; --panel: #12171d; --panel-2: #171d24;
  --line: #1e262f; --line-2: #2a3440;
  --text: #e6edf3; --muted: #8b98a6; --dim: #5c6874;
  --green: #2bd97d; --green-2: #1fa864; --green-soft: rgba(43, 217, 125, .12);
  --red: #ff5d5d; --amber: #f2b441; --amber-soft: rgba(242, 180, 65, .14); --blue: #5ea8ff; --purple: #9c8cff;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 6px; --gutter: 20px; --max: 1280px;
}
* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--green); }
p a, .prose a, .faq-a a { color: var(--green); text-decoration: underline; text-decoration-color: var(--green-2); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--mono); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(22px, 3vw, 30px); }
h2 { font-size: 17px; margin-bottom: 10px; }
h3 { font-size: 14px; }
p { margin: 0 0 10px; }
small, .muted { color: var(--muted); }
code, kbd { font-family: var(--mono); font-size: .92em; }
b { font-weight: 600; }
.num, .tbl td.c-num, .tile-v { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -999px; top: 0; background: var(--green); color: #000; padding: 6px 10px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* header */
.top { position: sticky; top: 0; z-index: 30; background: rgba(11, 14, 17, .92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 18px; height: 52px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 16px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.brand b { color: var(--green); font-weight: 600; }
.brand .cursor { display: inline-block; width: 7px; height: 15px; background: var(--green); margin-left: 3px; vertical-align: -2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .brand .cursor { animation: none; } }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; font-family: var(--mono); font-size: 12.5px; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 6px 9px; border-radius: 4px; color: var(--muted); white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a.on { color: var(--green); background: var(--green-soft); }
.search-btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); padding: 6px 10px; cursor: pointer; }
.search-btn:hover { color: var(--text); border-color: var(--dim); }
.search-btn kbd { background: var(--bg); border: 1px solid var(--line-2); border-radius: 3px; padding: 0 4px; font-size: 10px; }

/* page header */
.ph { padding: 26px 0 14px; display: grid; gap: 8px; }
.crumbs { font-family: var(--mono); font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--green); }
.lead { color: var(--muted); max-width: 78ch; margin: 0; }
.updated { font-family: var(--mono); font-size: 11.5px; color: var(--dim); }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 12px 0 18px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.tile-v { font-size: 22px; font-weight: 500; color: var(--text); }
.tile.pos .tile-v { color: var(--green); }
.tile-l { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: end; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin-bottom: 12px; }
.fld { display: grid; gap: 4px; font-family: var(--mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.fld input[type=search], .fld select { font: 13px var(--mono); color: var(--text); background: var(--bg); border: 1px solid var(--line-2); border-radius: 4px; padding: 6px 8px; min-width: 150px; height: 32px; }
.fld.toggles { grid-auto-flow: column; align-items: center; gap: 14px; text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--text); padding-bottom: 6px; }
.tog { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.tog input { accent-color: var(--green); }
.hint { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--line-2); color: var(--muted); font-size: 10px; cursor: help; }
.btn { font: 12.5px var(--mono); color: #06110b; background: var(--green); border: 1px solid var(--green); border-radius: 4px; padding: 7px 12px; cursor: pointer; height: 32px; }
.btn:hover { background: #46e592; color: #06110b; }
.btn.ghost { background: transparent; color: var(--muted); border-color: var(--line-2); display: inline-grid; place-items: center; }
.btn.ghost:hover { color: var(--text); }
.btn-sm { font: 11.5px var(--mono); color: var(--green); border: 1px solid var(--green-2); border-radius: 4px; padding: 3px 8px; white-space: nowrap; }
.btn-sm:hover { background: var(--green-soft); }

/* chips / presets */
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.preset { font: 12px var(--mono); color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 10px; }
.preset:hover { color: var(--text); border-color: var(--dim); }
.preset.on { color: var(--green); border-color: var(--green-2); background: var(--green-soft); }
.chip { display: inline-block; font: 10.5px var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-2); border-radius: 3px; padding: 1px 5px; margin: 1px 0; white-space: nowrap; cursor: default; }
.chip.ok { color: var(--green); border-color: rgba(43, 217, 125, .45); }
.chip.warn { color: var(--amber); border-color: rgba(242, 180, 65, .45); }
.chip.bad { color: var(--red); border-color: rgba(255, 93, 93, .45); }

/* tables */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { background: var(--panel-2); font: 500 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl th.c-num, .tbl td.c-num { text-align: right; }
.th-sort { color: var(--muted); }
.th-sort.on { color: var(--green); }
.tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--panel-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td.empty { color: var(--muted); text-align: center; padding: 28px 10px; }
.tbl td small { display: block; font: 11px var(--mono); color: var(--dim); }
.pool-link { display: flex; align-items: center; gap: 9px; min-width: 200px; }
.coin { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line-2); display: grid; place-items: center; font: 600 8.5px var(--mono); color: var(--muted); letter-spacing: -.02em; }
.pool-txt b { display: block; font-weight: 600; }
.pool-txt span { display: block; font: 11.5px var(--mono); color: var(--muted); }
.apy-v { font-family: var(--mono); font-size: 14px; font-weight: 500; }
.apy-v.pos { color: var(--green); }
.c-spark { width: 100px; }
.spark polyline { fill: none; stroke: var(--green); stroke-width: 1.5; }
.spark circle { fill: var(--green); }
.spark.down polyline { stroke: var(--red); }
.spark.down circle { fill: var(--red); }
.spark-none { color: var(--dim); }
.chain-link { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.c-act { text-align: right; white-space: nowrap; }
.tbl .neg { color: var(--red); }
.tbl .pos { color: var(--green); }

/* mobile: rows become cards */
@media (max-width: 760px) {
  .tbl.pools thead, .tbl.cefi thead, .tbl.borrow thead { display: none; }
  .tbl.pools, .tbl.pools tbody, .tbl.pools tr, .tbl.pools td, .tbl.cefi, .tbl.cefi tbody, .tbl.cefi tr, .tbl.cefi td, .tbl.borrow, .tbl.borrow tbody, .tbl.borrow tr, .tbl.borrow td { display: block; }
  .tbl.pools tr, .tbl.cefi tr, .tbl.borrow tr { padding: 10px 12px; border-bottom: 1px solid var(--line-2); display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
  .tbl.pools td, .tbl.cefi td, .tbl.borrow td { padding: 0; border: 0; text-align: left !important; }
  .tbl td[data-label]::before { content: attr(data-label); display: block; font: 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
  .tbl td.c-pool { grid-column: 1 / -1; }
  .tbl td.c-pool::before { display: none; }
  .tbl td.c-act { grid-column: 1 / -1; text-align: left !important; margin-top: 4px; }
  .tbl td.c-num.apy { text-align: right !important; }
  .fld input[type=search], .fld select { min-width: 0; width: 100%; }
  .fld { width: 100%; }
  .fld.toggles { grid-auto-flow: row; gap: 6px; }
}

/* pager */
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 14px 0; font-family: var(--mono); font-size: 12.5px; }
.pager a, .pager .on, .pager .gap { padding: 5px 9px; border: 1px solid var(--line-2); border-radius: 4px; color: var(--muted); }
.pager .on { color: var(--green); border-color: var(--green-2); }
.pager .gap { border: 0; }
.pager-total { margin-left: auto; color: var(--dim); }

/* sections */
.sec { margin: 26px 0; }
.sec h2 { display: flex; align-items: baseline; gap: 10px; }
.sec h2 small { font: 11px var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.list li:last-child { border-bottom: 0; }
.list .k { font-family: var(--mono); }
.list .v { font-family: var(--mono); color: var(--muted); white-space: nowrap; }
.list .v b { color: var(--green); font-weight: 500; }
.taglist { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font: 12px var(--mono); color: var(--text); border: 1px solid var(--line-2); border-radius: 4px; padding: 4px 8px; background: var(--panel); }
.tag:hover { border-color: var(--green-2); color: var(--green); }
.tag small { color: var(--dim); margin-left: 5px; }
.prose { max-width: 74ch; font-size: 15px; line-height: 1.65; }
.prose h2 { margin-top: 26px; }
.prose h3 { margin-top: 18px; margin-bottom: 6px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 4px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.prose th, .prose td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.note { font-size: 12.5px; color: var(--muted); margin: 10px 0; max-width: 90ch; }
.faq { margin: 26px 0; max-width: 80ch; }
.faq-item { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); margin-bottom: 6px; }
.faq-item summary { cursor: pointer; padding: 10px 14px; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq-item summary::after { content: "+"; font-family: var(--mono); color: var(--green); }
.faq-item[open] summary::after { content: "–"; }
.faq-a { padding: 0 14px 12px; color: var(--muted); font-size: 13.5px; }
.faq-a b { color: var(--text); }
.bench { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin: 14px 0; }
.bench a { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.bench a:hover { border-color: var(--green-2); }
.bench .bv { font: 500 20px var(--mono); color: var(--green); }
.bench .bl { font: 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.bench .bs { font-size: 12px; color: var(--dim); margin-top: 2px; }
.cols { columns: 3 220px; column-gap: 24px; }
.cols a { display: block; padding: 3px 0; font-family: var(--mono); font-size: 13px; break-inside: avoid; }
.cols a small { color: var(--dim); margin-left: 6px; }
.chart { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart text { font: 10.5px var(--mono); fill: var(--muted); }
.chart .area { fill: rgba(43, 217, 125, .12); }
.chart .line { fill: none; stroke: var(--green); stroke-width: 1.6; }
.chart .line2 { fill: none; stroke: var(--blue); stroke-width: 1.2; stroke-dasharray: 3 3; }
.legend { display: flex; gap: 14px; font: 11px var(--mono); color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 5px; background: var(--green); }
.legend i.b { background: var(--blue); }
.alert { background: var(--amber-soft); border: 1px solid rgba(242, 180, 65, .4); border-radius: var(--r); padding: 10px 14px; color: var(--text); font-size: 13.5px; margin: 12px 0; }

/* footer */
.foot { margin-top: 50px; border-top: 1px solid var(--line); background: var(--bg-2); }
.foot-in { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; padding-block: 28px 36px; }
.foot-col a { display: block; font-family: var(--mono); font-size: 12.5px; color: var(--muted); padding: 3px 0; }
.foot-col a:hover { color: var(--green); }
.foot-h { font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin-bottom: 6px; }
.foot-brand { font: 600 16px var(--mono); margin-bottom: 8px; }
.foot-brand b { color: var(--green); }
.foot-note { font-size: 12.5px; color: var(--muted); max-width: 60ch; }
@media (max-width: 760px) { .foot-in { grid-template-columns: 1fr; } .top-in { gap: 10px; } .search-btn span { display: none; } }

/* command palette */
.palette { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 50; display: grid; place-items: start center; padding: 12vh 16px; }
.palette[hidden] { display: none; }
.palette-box { width: min(560px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); overflow: hidden; }
.palette-input { width: 100%; font: 15px var(--mono); color: var(--text); background: var(--bg); border: 0; border-bottom: 1px solid var(--line-2); padding: 12px 14px; outline: none; }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
.palette-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 4px; cursor: pointer; font-family: var(--mono); font-size: 13px; }
.palette-list li.on, .palette-list li:hover { background: var(--green-soft); color: var(--green); }
.palette-list li span { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.palette-hint { font: 11px var(--mono); color: var(--dim); padding: 6px 12px 10px; border-top: 1px solid var(--line); }

/* errors */
.err { padding: 60px 0; text-align: center; }
.err h1 { font-size: 46px; color: var(--green); }
