/* Quick Liq — dark fintech dashboard. Tokens first; everything reads from them. */

:root {
  --bg: #0B1120;            /* page plane */
  --surface: #131D33;       /* cards / chart surface */
  --surface-2: #1A2745;     /* raised rows, inputs */
  --border: rgba(255, 255, 255, 0.08);
  --ink: #F4F7FC;
  --ink-2: #AEB9CE;
  --ink-3: #7E8AA3;
  --grid: #1E2A47;          /* hairline gridlines, one step off surface */
  --brand: #F59E0B;
  --brand-hover: #FBBF24;
  --on-brand: #0B1120;
  --spark: #45526E;         /* sparkline de-emphasis hue */
  /* Categorical (validated on --surface: worst adjacent CVD dE 41.3) */
  --cat-1: #3987E5;
  --cat-2: #199E70;
  --cat-3: #C98500;
  --cat-4: #9085E9;
  --cat-5: #E66767;
  /* Status — reserved, never used as series colors */
  --good: #22C55E;
  --warn: #FAB219;
  --critical: #EF4444;
  --up: #22C55E;
  --down: #F87171;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--ink);
}
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { display: block; }
.nav-item svg, .icon-btn svg, .btn svg, .empty-state svg, .search-ico {
  fill: none; stroke: currentColor; stroke-width: 1.8;
}
.muted { color: var(--ink-3); font-weight: 400; font-size: 13px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 200;
  background: var(--brand); color: var(--on-brand);
  padding: 8px 14px; border-radius: 8px; font-weight: 600; text-decoration: none;
  transition: top 150ms ease-out;
}
.skip-link:focus { top: 8px; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ---------------- Shell layout ---------------- */

.shell { display: flex; min-height: 100dvh; }

.sidebar {
  width: 232px; flex: 0 0 auto;
  display: flex; flex-direction: column;
  padding: 20px 14px;
  border-right: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 0; height: 100dvh;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700; letter-spacing: -0.02em;
  padding: 2px 8px 18px;
}
.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 10px;
  color: var(--ink-2); font-weight: 500; font-size: 14.5px; text-decoration: none;
  transition: background 150ms ease-out, color 150ms ease-out;
}
.nav-item svg { width: 19px; height: 19px; }
.nav-item:hover { background: var(--surface); color: var(--ink); }
.nav-item.active { background: var(--surface-2); color: var(--ink); box-shadow: inset 3px 0 0 var(--brand); }
.badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand); color: var(--on-brand);
  border-radius: 10px; font-size: 12px; font-weight: 700;
}
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; padding: 0 8px; }
.net-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--border);
  padding: 6px 10px; border-radius: 999px; width: fit-content;
}
.net-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.disclaimer { font-size: 11.5px; color: var(--ink-3); line-height: 1.45; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
  background: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(10px);
}
.icon-btn.menu-btn { display: none; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-2); transition: background 150ms ease-out, color 150ms ease-out;
}
.icon-btn:hover { background: var(--surface); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }

.search-wrap { position: relative; flex: 1; max-width: 420px; }
.search-ico { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 17px; height: 17px; color: var(--ink-3); pointer-events: none; }
.search-wrap input {
  width: 100%; height: 42px;
  padding: 0 14px 0 38px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  color: var(--ink); font: inherit; font-size: 14px;
}
.search-wrap input::placeholder { color: var(--ink-3); }
.search-wrap input:focus { outline: 2px solid var(--brand); outline-offset: 0; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 10px;
  font-weight: 600; font-size: 14px; text-decoration: none;
  transition: background 150ms ease-out, transform 150ms ease-out;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand); color: var(--on-brand); margin-left: auto; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary { background: var(--surface-2); color: var(--ink); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--grid); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.ghost-btn {
  color: var(--ink-2); font-size: 13px; font-weight: 600; text-decoration: none;
  padding: 6px 12px; border-radius: 8px;
  transition: background 150ms ease-out, color 150ms ease-out;
}
.ghost-btn:hover { background: var(--surface-2); color: var(--ink); }
.ghost-btn[aria-pressed="true"] { background: var(--surface-2); color: var(--brand); }

/* Live-devnet call to action — amber-accented, grouped to the right with the
   wallet button. margin-left:auto pushes it (and the wallet button after it)
   to the right edge, matching the existing topbar layout. */
.devnet-cta {
  margin-left: auto;
  background: var(--surface-2);
  color: var(--brand);
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.devnet-cta:hover { background: var(--grid); border-color: var(--brand); }
.devnet-cta .devnet-cta-arrow { font-weight: 700; }
.devnet-cta .live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand);
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6);
  animation: livePulse 2.4s ease-out infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* ---------------- Views & grids ---------------- */

main { padding: 24px 28px 56px; }
.view-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.grid { display: grid; gap: 16px; }
.hero-grid { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); margin-bottom: 16px; }
.tiles-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  min-width: 0;
}
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
}

/* Range presets (date filter row — scopes the charts below it) */
.range-row { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.range-btn {
  padding: 6px 12px; border-radius: 7px;
  font-size: 13px; font-weight: 600; color: var(--ink-3);
  transition: background 150ms ease-out, color 150ms ease-out;
}
.range-btn:hover { color: var(--ink); }
.range-btn.active { background: var(--surface-2); color: var(--brand); }

/* ---------------- How it works (onboarding strip) ---------------- */

.howto { margin-bottom: 16px; }
.howto-head { margin-bottom: 16px; }
.howto-head h2 { font-size: 16px; }
.howto-head .muted { margin-top: 3px; }
.howto-steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
}
.howto-steps li { display: flex; gap: 12px; align-items: flex-start; }
.howto-num {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(245, 158, 11, 0.14); color: var(--brand);
  font-size: 13px; font-weight: 700;
}
.howto-step-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.howto-step-body { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.howto-link { color: var(--brand); font-weight: 600; text-decoration: none; white-space: nowrap; }
.howto-link:hover { text-decoration: underline; }
.howto-link .ext { font-size: 11px; margin-left: 1px; }
@media (max-width: 860px) {
  .howto-steps { grid-template-columns: 1fr; gap: 14px; }
}

/* ---------------- Hero + stat tiles ---------------- */

.stat-label { font-size: 13px; color: var(--ink-2); }
.hero-number { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin-top: 2px; }
.hero-number.sm { font-size: 30px; }
.hero-delta { font-size: 14px; font-weight: 600; margin-top: 4px; }
.delta-up { color: var(--up); }
.delta-down { color: var(--down); }

/* 6 protocol tiles flow instead of a fixed 4-up */
.tiles-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* Loan terms + position rows */
.term-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.term-row:last-child { border-bottom: 0; }
.term-row .value { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Band pill (high/mid/low) */
.band-pill { display: inline-flex; text-transform: capitalize; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.band-high { color: var(--good); background: rgba(34,197,94,.14); }
.band-mid  { color: var(--warn); background: rgba(250,178,25,.14); }
.band-low  { color: var(--ink-3); }

/* Oracle warning under a card name */
.stale-flag { font-size: 11.5px; color: var(--warn); margin-top: 2px; }

.tile { display: flex; flex-direction: column; gap: 4px; }
.tile .tile-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.tile .value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.tile .delta { font-size: 12.5px; font-weight: 600; }

/* ---------------- Chart chrome ---------------- */

.chart-host { position: relative; }
.chart-host .gline { stroke: var(--grid); stroke-width: 1; }
.chart-host .tick { fill: var(--ink-3); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-host .crosshair { stroke: var(--ink-3); stroke-width: 1; }
.chart-host svg:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
.donut-seg { transition: opacity 150ms ease-out; cursor: pointer; }
.donut-seg:hover, .donut-seg:focus-visible { opacity: 0.85; }
.donut-total { fill: var(--ink); font-size: 22px; font-weight: 700; font-family: var(--font); letter-spacing: -0.02em; }

.chart-tip {
  position: absolute; translate: -50% -100%;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 7px 11px;
  pointer-events: none; opacity: 0; transition: opacity 120ms ease-out;
  box-shadow: var(--shadow); white-space: nowrap; z-index: 5;
}
.chart-tip.show { opacity: 1; }
.tip-value { font-size: 14px; font-weight: 700; }
.tip-label { font-size: 11.5px; color: var(--ink-2); }

.alloc-body { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.legend li { display: flex; align-items: center; gap: 9px; color: var(--ink-2); }
.legend .swatch { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto; }
.legend .lg-val { margin-left: auto; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; padding-left: 14px; }

.footnote { font-size: 12px; color: var(--ink-3); margin-top: 10px; }

/* ---------------- Movers ---------------- */

.movers { list-style: none; margin: 0; padding: 0; }
.movers li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 6px; border-radius: 10px;
  transition: background 150ms ease-out;
}
.movers li:hover { background: var(--surface-2); }
.movers li + li { border-top: 1px solid var(--border); }
.mover-meta { min-width: 0; }
.mover-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mover-set { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mover-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.mover-val { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.mover-delta { font-size: 12.5px; font-weight: 600; width: 52px; text-align: right; font-variant-numeric: tabular-nums; }

/* Card thumbnail — stylized slab, gradient per category */
.thumb {
  width: 34px; height: 46px; border-radius: 5px; flex: 0 0 auto;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.thumb.vintage  { background: linear-gradient(160deg, #2a4a8a, #16223f); }
.thumb.modern   { background: linear-gradient(160deg, #14684c, #10241d); }
.thumb.japanese { background: linear-gradient(160deg, #8a5c10, #33240a); }
.thumb.sealed   { background: linear-gradient(160deg, #4c4390, #1c1936); }
.thumb.raw      { background: linear-gradient(160deg, #8a3d3d, #2e1616); }

/* ---------------- Tables ---------------- */

.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left; font-size: 12px; font-weight: 600;
  color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em;
  padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr { transition: background 150ms ease-out; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num, .data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table.twin { margin-top: 10px; font-size: 13px; }
.sort-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit;
  padding: 2px 4px; border-radius: 5px;
}
.sort-btn:hover { color: var(--ink); }
.sort-btn::after { content: ''; width: 0; height: 0; }
th[aria-sort="ascending"] .sort-btn::after { content: '▲'; font-size: 8px; }
th[aria-sort="descending"] .sort-btn::after { content: '▼'; font-size: 8px; }
.cell-card { display: flex; align-items: center; gap: 12px; min-width: 220px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
  white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.chip.vaulted .dot { background: var(--good); }
.chip.collateral { color: var(--brand); background: rgba(245, 158, 11, 0.12); }
.chip.collateral .dot { background: var(--brand); }

select, input[type="range"] { accent-color: var(--brand); }
select {
  height: 40px; padding: 0 12px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: 10px;
  font: inherit; font-size: 14px;
}

/* ---------------- Loans ---------------- */

.loan-list { display: grid; gap: 14px; }
.loan-card { display: grid; gap: 14px; }
.loan-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.loan-id { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.loan-figures { display: flex; gap: 28px; flex-wrap: wrap; }
.loan-fig .stat-label { font-size: 12px; }
.loan-fig .value { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.loan-actions { margin-left: auto; display: flex; gap: 10px; }

.meter { position: relative; height: 8px; border-radius: 4px; overflow: hidden; }
.meter.ok       { background: rgba(34, 197, 94, 0.18); }
.meter.warn     { background: rgba(250, 178, 25, 0.18); }
.meter.critical { background: rgba(239, 68, 68, 0.18); }
.meter-fill { height: 100%; border-radius: 4px; transition: width 300ms ease-out; }
.meter.ok .meter-fill       { background: var(--good); }
.meter.warn .meter-fill     { background: var(--warn); }
.meter.critical .meter-fill { background: var(--critical); }
.meter-row { display: flex; align-items: center; gap: 12px; }
.meter-row .meter { flex: 1; }
.meter-caption { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

.status-line { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.status-line svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.status-good { color: var(--good); }
.status-warn { color: var(--warn); }
.status-critical { color: var(--critical); }

.empty-state {
  display: grid; justify-items: center; gap: 10px;
  text-align: center; padding: 44px 24px; color: var(--ink-2);
}
.empty-state svg { color: var(--ink-3); }
.empty-state p { max-width: 40ch; font-size: 14px; }
.empty-state .btn { margin-top: 6px; }

/* ---------------- Modal ---------------- */

.modal-scrim {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4, 8, 18, 0.6); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  width: 100%; max-width: 460px; max-height: 90dvh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow);
  animation: modal-in 200ms ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 0;
}
.modal-body { padding: 16px 20px 20px; display: grid; gap: 16px; }
.quote-card-row { display: flex; align-items: center; gap: 14px; }
.quote-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.quote-grid .stat-label { font-size: 12px; }
.quote-grid .value { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.slider-row label { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.slider-row output { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; }
.modal-note { font-size: 12px; color: var(--ink-3); line-height: 1.5; }

/* ---------------- Toasts ---------------- */

.toast-region { position: fixed; bottom: 20px; right: 20px; z-index: 150; display: grid; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--good);
  border-radius: 10px; padding: 12px 16px;
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow);
  animation: toast-in 200ms ease-out;
  max-width: 90vw;
}
.toast svg { width: 17px; height: 17px; fill: none; stroke: var(--good); stroke-width: 2.2; flex: 0 0 auto; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------------- Scrim / mobile nav ---------------- */

.scrim { position: fixed; inset: 0; background: rgba(4, 8, 18, 0.55); z-index: 45; }

/* ---------------- Responsive ---------------- */

@media (max-width: 1180px) {
  .tiles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 50; height: 100dvh;
    transform: translateX(-100%); transition: transform 250ms ease-out;
    background: var(--bg); box-shadow: var(--shadow); width: 260px;
  }
  .sidebar.open { transform: translateX(0); }
  .icon-btn.menu-btn { display: inline-flex; }
  .hero-grid, .two-col { grid-template-columns: 1fr; }
  main { padding: 20px 18px 48px; }
  .topbar { padding: 12px 18px; }
}
@media (max-width: 560px) {
  .tiles-grid { grid-template-columns: 1fr; }
  .movers .spark { display: none; }
  .hero-number { font-size: 32px; }
  .view-head { flex-direction: column; align-items: flex-start; }
  .range-row { width: 100%; justify-content: space-between; }
  .loan-actions { margin-left: 0; width: 100%; }
  .loan-actions .btn { flex: 1; justify-content: center; }
  .topbar .btn-primary span { display: none; }
  .topbar .btn-primary { padding: 0 13px; }
  /* Collapse the CTA to just its pulsing dot + arrow; the aria-label keeps it named. */
  .topbar .devnet-cta .devnet-cta-label { display: none; }
  .topbar .devnet-cta { padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============ Card values (explore) ============ */
.explore-lede { font-size: 15px; max-width: 62ch; margin-bottom: 18px; color: var(--ink-2); line-height: 1.55; }
.explore-search { display: flex; gap: 10px; margin-bottom: 12px; max-width: 640px; }
.explore-input-wrap { position: relative; flex: 1; }
.explore-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: none; stroke: var(--ink-3); stroke-width: 2; pointer-events: none; }
.explore-input-wrap input {
  width: 100%; height: 46px; padding: 0 14px 0 40px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  color: var(--ink); font-size: 15px; font-family: inherit;
}
.explore-input-wrap input::placeholder { color: var(--ink-3); }
.explore-input-wrap input:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }
.explore-search .btn-primary { height: 46px; }

.explore-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 24px; }
.chip {
  background: var(--surface); border: 1px solid var(--border); color: var(--ink-2);
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-family: inherit; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { background: var(--surface-2); color: var(--ink); border-color: rgba(255,255,255,.16); }

.explore-status { color: var(--ink-2); font-size: 14px; padding: 12px 0; }
.explore-status.is-error { color: var(--warn); }

.explore-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  margin-bottom: 22px;
}
.xcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.xcard-img {
  aspect-ratio: 3 / 2; background: var(--bg);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.xcard-img img { width: 100%; height: 100%; object-fit: contain; }
.xcard-img .xph { color: var(--ink-3); font-size: 12px; }
.xcard-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.xcard-title { font-weight: 600; font-size: 15px; line-height: 1.3; }
.xcard-sub { font-size: 12.5px; }
.xcard-value { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; flex-wrap: wrap; }
.xcard-value-main { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.xcard-value-basis { font-size: 12px; }
.xcard-borrow {
  margin-top: auto; padding-top: 10px; font-size: 13px; color: var(--ink-2);
  border-top: 1px solid var(--border);
}
.xcard-borrow strong { color: var(--brand); font-weight: 700; font-variant-numeric: tabular-nums; }
.xcard-grades { font-size: 12.5px; }
.xcard-grades summary { cursor: pointer; color: var(--ink-3); list-style: none; padding: 2px 0; }
.xcard-grades summary::-webkit-details-marker { display: none; }
.xcard-grades summary::before { content: '▸ '; }
.xcard-grades[open] summary::before { content: '▾ '; }
.xcard-grades ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.xcard-grades li { display: flex; justify-content: space-between; gap: 10px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.xcard-grades li span:first-child { color: var(--ink); }

.explore-disclaimer { max-width: 72ch; line-height: 1.6; margin-top: 4px; }
.explore-skeleton { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); height: 260px; animation: xpulse 1.4s ease-in-out infinite; }
@keyframes xpulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

@media (max-width: 560px) {
  .explore-search { flex-wrap: wrap; }
  .explore-search .btn-primary { width: 100%; }
  .explore-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .xcard-value-main { font-size: 20px; }
}

/* Collection table: card photo thumbnail next to the name */
.card-id { display: flex; align-items: center; gap: 12px; }
.card-thumb { flex: 0 0 auto; width: 40px; height: 56px; border-radius: 6px; overflow: hidden;
  background: #0d0d12; border: 1px solid var(--border); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Recent lends — public protocol activity feed on the dashboard */
.recent-card .card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.recent-card .card-head .muted { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.recent-wrap { display: flex; flex-direction: column; }
.recent-link { text-decoration: none; color: inherit; display: block; border-radius: 10px; }
.recent-link:hover { background: var(--surface-2); }
.recent-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-top: 1px solid var(--border); }
.recent-wrap > :first-child .recent-row, .recent-wrap > .recent-row:first-child { border-top: none; }
.recent-row .card-thumb { width: 34px; height: 46px; }
.recent-main { flex: 1; min-width: 0; }
.recent-name { font-weight: 600; font-size: 14px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-meta { font-size: 12.5px; margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.recent-right { text-align: right; flex: 0 0 auto; }
.recent-amt { font-weight: 700; font-size: 14.5px; margin: 0 0 3px; font-variant-numeric: tabular-nums; }
.st-pill { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; }
.st-active, .st-pending_settlement, .st-extended { background: rgba(96,165,250,.14); color: #93c5fd; }
.st-repaid { background: rgba(134,239,172,.14); color: #86efac; }
.st-defaulted, .st-forfeited, .st-liquidated { background: rgba(248,113,113,.14); color: #fca5a5; }
