/* ============================================================
   Alpha Finance: aggregated liquidations dashboard (/liquidations/)
   Totals, the symbol treemap, the exchange split and the daily history.
   One snapshot on load, modelled from open interest and price; no
   streaming. Loaded after alpha.css and article.css.
   ============================================================ */

/* ---------- hero ---------- */

.liqshero {
  border-bottom: 1px solid var(--line);
  padding: 30px 0 0;
  background:
    radial-gradient(60% 130% at 85% -20%, color-mix(in srgb, var(--lime) 5%, transparent), transparent 60%),
    var(--bg-2);
}
.liqshero h1 {
  font-family: var(--display);
  font-size: clamp(27px, 3.2vw, 38px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.028em;
  margin-bottom: 10px;
}
.liqshero .dek {
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--text-2);
  max-width: 46em;
}
.liqshero .feed {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.liqshero .feed b { color: var(--text-2); font-weight: 500; }
.liqshero .feed .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--lime);
  margin-right: 6px;
  vertical-align: 1px;
}

/* ---------- totals cards ---------- */

.liq-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.lcard {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  padding: 14px 16px 15px;
}
.lcard .k {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.lcard .k .ic {
  display: inline-flex;
  width: 15px;
  height: 15px;
  color: var(--lime);
  flex: none;
}
.lcard .k .ic svg { width: 100%; height: 100%; display: block; }
.lcard .v {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.lcard .split {
  display: flex;
  gap: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}
.lcard .split .lg { color: var(--pos-text); }
.lcard .split .sh { color: var(--neg-text); }
.lcard .split i { font-style: normal; color: var(--faint); margin-right: 5px; }

/* ---------- panels ---------- */

.lpanel {
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}
.lpanel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.lpanel-head h2 {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.lpanel-head h2 small {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.ltabs { display: flex; gap: 2px; }
.ltabs button {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--r);
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.ltabs button:hover { color: var(--text-2); }
.ltabs button.on { color: #0a0b0d; background: var(--lime); }

.lpanel-body { padding: 14px; }
.lpanel-body canvas { display: block; width: 100%; }
.lpanel-foot {
  padding: 9px 18px 10px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  color: var(--faint);
}

/* legend chips for the history chart */
.lleg {
  display: inline-flex;
  gap: 14px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.lleg i {
  display: inline-block;
  width: 8px; height: 8px;
  margin-right: 6px;
  border-radius: 2px;
  vertical-align: 0;
}
.lleg .lg i { background: var(--pos); }
.lleg .sh i { background: var(--neg); }

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

.liq-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

/* ---------- exchange table ---------- */

.extbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.extbl th {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  text-align: right;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.extbl th:first-child { text-align: left; padding-left: 18px; }
.extbl td {
  padding: 9px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
  color: var(--text-2);
}
.extbl tr:last-child td { border-bottom: 0; }
.extbl td:first-child {
  text-align: left;
  padding-left: 18px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.extbl .exn { display: flex; align-items: center; gap: 9px; }
/* the summed row carries a sigma rather than a venue's mark */
.extbl .exlogo.is-all { display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.extbl .lg { color: var(--pos-text); }
.extbl .sh { color: var(--neg-text); }
.extbl .share { color: var(--muted); }
.extbl tr.all td { background: color-mix(in srgb, var(--panel-2) 60%, transparent); }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .liq-cards { grid-template-columns: 1fr 1fr; }
  .liq-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .liq-cards { grid-template-columns: 1fr; }
  .extbl th:nth-child(5), .extbl td:nth-child(5) { display: none; }
}

/* totals as one board: hairlines between cells, no separate cards */
.liq-cards { gap: 1px; }
.liq-cards .lcard { border: 0; border-radius: 0; box-shadow: 0 0 0 1px var(--line-2); }
.lcard .k .ic { color: var(--muted); }

/* status line: one quiet sentence in grey, not a row of mono chips.
   The dot still carries feed state; the words just read as words. */
.feed, .liqshero .feed {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  gap: 6px 0;
}
.feed > span + span::before, .liqshero .feed > span + span::before {
  content: "\00b7";
  margin: 0 9px;
  color: var(--faint);
}
.feed b, .liqshero .feed b { color: var(--text-2); font-weight: 500; }
