/* Aave Paperwalet — full web dashboard. Near-black cool surfaces, single violet
   brand accent, CMC-standard green/red. Inter throughout (tabular numerals). */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('fonts/inter-var.woff2') format('woff2');
}
:root {
  --bg: #0B0E14;
  --bg-grad: radial-gradient(90% 60% at 100% -5%, rgba(46,186,198,.07), transparent 60%),
             radial-gradient(90% 60% at 0% -5%, rgba(138,108,240,.08), transparent 55%);
  --surface: #12151F; --surface-2: #171B27; --surface-3: #1F2430;
  --line: rgba(255,255,255,.06); --line-2: rgba(255,255,255,.12);
  --text: #F5F6FA; --muted: #8B90A3; --muted-2: #5B5F72;
  --brand: #8A6CF0; --brand-bg: rgba(138,108,240,.14);
  --grad: linear-gradient(120deg, #b6509e 0%, #8a6cf0 52%, #2ebac6 100%);
  --green: #16C784; --blue: #4AA3FF; --amber: #F0B90B; --red: #EA3943;
  --green-bg: rgba(22,199,132,.13); --blue-bg: rgba(74,163,255,.13); --red-bg: rgba(234,57,67,.13);
  --radius: 14px; --radius-md: 10px; --radius-sm: 8px;
  --shadow: 0 14px 40px rgba(0,0,0,.5); --ease: cubic-bezier(.22,1,.36,1);
  --display: 'Inter', -apple-system, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); background-image: var(--bg-grad); background-attachment: fixed; color: var(--text);
  -webkit-font-smoothing: antialiased; font-feature-settings: 'tnum' 1; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
.muted { color: var(--muted); } .small { font-size: 13px; } .xsmall { font-size: 11px; }
.spacer { flex: 1; } .mono { font-variant-numeric: tabular-nums; }

/* ---------- topbar ---------- */
.topbar { display: flex; align-items: center; gap: 16px; padding: 16px 28px; position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 38px; height: 38px; border-radius: 12px; }
.brand .name { font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.brand .sub { font-size: 11px; color: var(--muted); }
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 3px; }
.tab { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 7px 18px; border-radius: 99px; cursor: pointer; transition: .15s var(--ease); }
.tab:hover { color: var(--text); } .tab.on { color: var(--text); background: var(--surface-3); }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 8px 8px 12px; min-width: 300px; flex: 1; max-width: 460px; transition: .15s var(--ease); }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-bg); }
.search .lead { color: var(--muted); display: grid; place-items: center; }
.search .lead svg { width: 17px; height: 17px; }
.search input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 14px; min-width: 0; }
.search input::placeholder { color: var(--muted-2); }
.go { background: var(--brand); color: #fff; border: 0; border-radius: 9px; padding: 8px 16px; font: inherit;
  font-weight: 700; font-size: 13px; cursor: pointer; transition: .15s var(--ease); }
.go:hover { filter: brightness(1.1); }
.icon-btn { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); cursor: pointer; display: grid; place-items: center; transition: .15s var(--ease); }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.icon-btn svg { width: 17px; height: 17px; }

.recent-wrap { max-width: 1180px; margin: 0 auto; padding: 12px 28px 0; }
.recent { display: flex; flex-wrap: wrap; gap: 7px; }
.rchip { font-size: 12px; font-family: ui-monospace, monospace; color: var(--muted); background: var(--surface);
  border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; cursor: pointer; }
.rchip:hover { color: var(--text); border-color: var(--line-2); }

/* ---------- content ---------- */
.content { max-width: 1180px; margin: 0 auto; padding: 22px 28px 60px; }

/* ---------- markets stat row ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.bstat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; position: relative; overflow: hidden; }
.bstat::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--grad); opacity: .8; }
.bstat-l { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); }
.bstat-v { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -.02em; margin-top: 5px; font-variant-numeric: tabular-nums; }

/* ---------- chain filter chips ---------- */
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.fchip { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 7px 14px; cursor: pointer; transition: .15s var(--ease); }
.fchip:hover { color: var(--text); border-color: var(--line-2); }
.fchip.on { color: var(--text); background: var(--surface-3); border-color: var(--line-2); }
.cdot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--brand)); flex-shrink: 0; }

/* ---------- markets table ---------- */
.mtable { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mrow { display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr 1.2fr 1.2fr .8fr; align-items: center; gap: 10px;
  padding: 13px 18px; border-top: 1px solid var(--line); font-size: 13.5px; }
.mrow:first-child { border-top: 0; }
.mrow.thead { background: var(--surface-2); color: var(--muted-2); font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.mrow:not(.thead):not(.sk):hover { background: var(--surface-2); }
.thsort { cursor: pointer; user-select: none; } .thsort:hover { color: var(--text); }
.cell.num { text-align: right; justify-self: end; font-variant-numeric: tabular-nums; }
.cell.asset { display: flex; align-items: center; gap: 11px; min-width: 0; }
.asset-id { min-width: 0; } .sym { font-weight: 650; display: flex; align-items: center; gap: 6px; }
.logo { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); object-fit: cover; flex-shrink: 0; }
.cbadge { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 2px 8px; margin-left: auto; }
.apy { color: var(--green); } .apy-hi { color: var(--green); font-weight: 700; } .apy-zero { color: var(--muted-2); } .borrow { color: var(--blue); }
.frozen { color: var(--amber); font-size: 9px; font-weight: 700; text-transform: uppercase; border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent); border-radius: 4px; padding: 0 4px; }
.util { display: inline-block; width: 54px; height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; vertical-align: middle; margin-right: 7px; }
.util span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

/* ---------- portfolio hero ---------- */
.phero { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; }
.phero::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--grad); }
.phero-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hero-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted-2); }
.net { font-family: var(--display); font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; margin-top: 4px; }
.hero-stats { display: flex; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.hstat { flex: 1; padding: 0 20px; } .hstat:first-child { padding-left: 0; } .hstat:not(:first-child) { border-left: 1px solid var(--line); }
.hstat-l { font-size: 11.5px; color: var(--muted); } .hstat-v { font-family: var(--display); font-weight: 700; font-size: 18px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.hstat-v.pos { color: var(--green); } .hstat-v.neg { color: var(--red); }
.mini-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; cursor: pointer; transition: .15s var(--ease); }
.mini-btn svg { width: 13px; height: 13px; } .mini-btn:hover { color: var(--text); border-color: var(--line-2); } .mini-btn.copied { color: var(--green); border-color: var(--green); }

/* ---------- portfolio chain cards ---------- */
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 18px 14px; margin-top: 14px; }
.sec-head { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 13.5px; padding: 12px 0 8px; }
.sec-name { font-weight: 650; } .emode { display: inline-flex; align-items: center; gap: 3px; color: var(--teal, #2ebac6); background: var(--blue-bg); border: 1px solid var(--line-2); font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.emode svg { width: 11px; height: 11px; }
.pos-list { display: flex; flex-direction: column; }
.prow { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.prow.thead { border-top: 0; padding: 0 0 8px; color: var(--muted-2); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.prow:not(.thead):hover { background: var(--surface-2); border-radius: var(--radius-sm); box-shadow: 0 0 0 10px var(--surface-2); }
.leg-v { font-family: var(--display); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; } .leg-sub { font-size: 12px; color: var(--muted); margin-top: 2px; } .leg-empty { color: var(--muted-2); }
.coll { color: #2ebac6; font-size: 9px; font-weight: 700; letter-spacing: .04em; border: 1px solid color-mix(in srgb, #2ebac6 45%, transparent); padding: 0 5px; border-radius: 5px; }
.rewards { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; }
.rewards svg { width: 15px; height: 15px; color: var(--amber); flex-shrink: 0; } .rewards-l { color: var(--muted); }

.hf-pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hf-safe { color: var(--green); background: var(--green-bg); } .hf-ok { color: var(--blue); background: var(--blue-bg); }
.hf-warn { color: var(--amber); background: rgba(240,185,11,.14); } .hf-danger { color: var(--red); background: var(--red-bg); }

/* ---------- states ---------- */
.loading-note { color: var(--muted); font-size: 12.5px; padding: 4px 2px 12px; display: flex; align-items: center; gap: 8px; }
.empty { color: var(--muted); text-align: center; padding: 30px; }
.empty.big { display: flex; flex-direction: column; align-items: center; padding: 70px 24px; }
.empty-mark { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line-2); color: var(--brand); margin-bottom: 18px; }
.empty-mark svg { width: 30px; height: 30px; } .empty-title { font-family: var(--display); font-size: 19px; font-weight: 800; color: var(--text); } .empty-body { font-size: 13.5px; line-height: 1.6; margin-top: 8px; max-width: 380px; }
.err { display: flex; align-items: center; gap: 9px; background: rgba(240,185,11,.14); border: 1px solid var(--line-2); color: var(--amber); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 16px; font-size: 13px; }
.err svg { width: 17px; height: 17px; flex-shrink: 0; }

/* ---------- skeleton ---------- */
@keyframes sk { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
.mrow.sk .sk-dot, .mrow.sk .sk-line { animation: sk 1.3s var(--ease) infinite; }
.sk-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); }
.sk-line { display: inline-block; height: 12px; width: 90px; border-radius: 6px; background: var(--surface-3); } .sk-line.sm { width: 50px; }

/* ---------- footer ---------- */
.footer { max-width: 1180px; margin: 0 auto; padding: 28px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--muted-2); line-height: 1.5; border-top: 1px solid var(--line); }
.footer strong { color: var(--muted); }
.ro-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: #2ebac6;
  background: var(--blue-bg); border: 1px solid var(--line-2); padding: 5px 12px; border-radius: 99px; white-space: nowrap; }
.ro-pill svg { width: 12px; height: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .topbar { gap: 12px; padding: 14px 18px; }
  .search { min-width: 100%; order: 5; max-width: none; }
  .content, .recent-wrap, .footer { padding-left: 18px; padding-right: 18px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .mrow { grid-template-columns: 1.6fr 1fr 1fr; }
  .mrow .cell:nth-child(4), .mrow .cell:nth-child(6), .mrow .cell:nth-child(7) { display: none; }
  .net { font-size: 34px; } .hero-stats { flex-wrap: wrap; gap: 12px; } .hstat { flex-basis: 40%; border-left: 0 !important; padding-left: 0; }
}
