/* ============================================================
   Alpha Finance: liquidation heatmap pages
   Page-scoped skin, loaded after alpha.css. Additive only: nothing in here
   changes a rule the rest of the site relies on.
   ============================================================ */

body.lq .section { padding: 34px 0 36px; }
body.lq .section-head { margin-bottom: 16px; }

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

.lqhero {
  position: relative;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 60% 90% at 85% 10%, color-mix(in srgb, var(--lime) 4%, transparent), transparent),
    var(--bg);
  overflow: hidden;
}
.lqhero .wrap { position: relative; }
.lqhero-inner { padding: 26px 0 0; max-width: 680px; }


.lqhero h1 {
  font-family: var(--display);
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.028em;
  color: var(--text);
}
.lqhero .dek {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-2);
}

/* live-state line. It reports what the page actually did: which venue
   answered, how many candles came back, when. Never a decorative badge. */
.feed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.feed b { font-weight: 500; color: var(--text-2); }
.feed .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--faint);
  vertical-align: 1px;
}
.feed.is-live .dot, .feed.is-captured .dot { background: var(--pos-text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pos-text) 18%, transparent); }
.feed.is-down .dot { background: var(--neg); }
.feed.is-stale .dot { background: var(--heat); }

/* ---------- stat rail ---------- */

.lqstats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.lqstat {
  padding: 13px 15px 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
}
.lqstat-k {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.lqstat-row {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-top: 9px;
}
.lqstat-v {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.lqstat-c {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.lqstat-c.up { color: var(--pos-text); }
.lqstat-c.down { color: var(--neg-text); }
.lqstat-s {
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  color: var(--faint);
}

/* ---------- the map ---------- */

.mappanel {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  overflow: hidden;
}
.map-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.map-head h2 {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--text);
  margin-right: auto;
}
.map-head h2 small {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

/* segmented controls: one dense mono rail rather than a row of pills */
.seg {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.seg button {
  padding: 6px 10px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.13s, background 0.13s;
}
.seg button:first-child { border-left: 0; }
.seg button:hover { color: var(--text-2); background: var(--panel-2); }
.seg button[aria-pressed="true"] {
  color: #0a0b0d;
  background: var(--lime);
}
/* Each control is a self-contained label + widget group. The label used to be
   a loose sibling pulled back with a negative margin tuned to the head's own
   column gap, which collided the moment a second control was added. */
.pick {
  display: flex;
  align-items: center;
  gap: 9px;
}
.pick-l {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}
.pick select {
  appearance: none;
  -webkit-appearance: none;
  padding: 6px 26px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 5'%3E%3Cpath d='M0 0h8L4 5z' fill='%23a6adb6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 8px 5px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.13s, color 0.13s;
}
.pick select:hover { border-color: var(--line-2); color: var(--text); }
.pick select:focus-visible { outline: 1px solid var(--lime); outline-offset: 2px; }
/* the popup itself is painted by the OS, so it needs real colours */
.pick option { background: var(--panel-2); color: var(--text); }

/* a venue with no open interest history has candles but no surface */
.mappanel.no-heat .ramp:first-child { opacity: 0.3; }


.map-body {
  position: relative;
  background: var(--bg-2);
}
#map-cv { display: block; width: 100%; height: 420px; }
.map-empty {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.map-empty b { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); }
.mappanel.is-empty .map-empty { display: flex; }

.map-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
}
/* a sequential ramp has to ship with a scale legend, and the legend has to
   carry the numbers the scale was actually built on */
.ramp {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.ramp b { font-weight: 400; color: var(--muted); margin-right: 2px; }
.ramp #ramp-max { color: var(--text-2); font-variant-numeric: tabular-nums; }
.ramp i {
  width: 118px;
  height: 7px;
  border-radius: 2px;
  /* the depth ramp: monotonic lightness, one-way hue sweep from blue to lime */
  background: linear-gradient(90deg, #0e1220, #16243f, #15415f, #116b63,
    #2b9550, #6fc03c, #b8f24b, #e8ffb8);
}

/* candles are keyed separately, because they do not use the ramp's hue */
.ramp-key { gap: 6px; }
.ramp-key .ck {
  width: 3px;
  height: 11px;
  border-radius: 1px;
  margin-left: 6px;
}
.ramp-key .ck:first-child { margin-left: 0; }
.ramp-key .up { background: var(--text); }
.ramp-key .dn { background: var(--neg-text); }
.map-note {
  margin-left: auto;
  max-width: 620px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- key levels ladder ---------- */

.ladders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ladder {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  overflow: hidden;
}
.ladder-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}
.ladder-head h3 {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-2);
}
.ladder-head .sum {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ladder-head .side {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ladder-head .side.short { color: var(--neg-text); }
.ladder-head .side.long { color: var(--pos-text); }

.lvrow {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 62px 76px;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.lvrow:last-child { border-bottom: 0; }
/* the bar is the datum, not decoration: width is the cluster's share of the
   largest cluster on this side of price */
.lvrow .bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  /* the bar is measured across the flexible first column only, so its bright
     end never lands on top of the distance or size figures */
  width: calc((100% - 162px) * var(--w));
  background: color-mix(in srgb, var(--lime) 13%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--lime) 55%, transparent);
  pointer-events: none;
}
.lvrow .px { position: relative; color: var(--text); }
.lvrow .dist { position: relative; color: var(--muted); text-align: right; }
.lvrow .sz { position: relative; color: var(--text-2); text-align: right; }
.ladder .empty {
  padding: 22px 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--faint);
}

.spotline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.spotline b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }

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

@media (max-width: 1080px) {
  .lqstats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .lqhero-inner { padding-top: 22px; }
  .lqhero .dek { font-size: 14px; }
  .ladders { grid-template-columns: 1fr; }
  .map-head { gap: 10px 12px; }
  .map-head h2 { width: 100%; margin-right: 0; }
  .map-note { margin-left: 0; }
  #map-cv { height: 320px; }
  .pick-l { display: none; }
}
@media (max-width: 520px) {
  .lqstats { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .seg button, .assetrail a { transition: none; }
}


/* ---------- rendering sliders ----------
   Native ranges tinted by accent-color: the browser draws them, the page
   only picks the hue, which keeps them as cheap as the selects beside them. */
.pick-range input[type="range"] {
  width: 92px;
  height: 18px;
  margin: 0;
  background: transparent;
  accent-color: var(--lime);
  cursor: pointer;
}
.pick-v {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-2);
  min-width: 36px;
  font-variant-numeric: tabular-nums;
}


/* ============================================================
   Hero-side stats: the four headline figures beside the H1,
   matching the other dashboards; the asset rail spans the grid.
   ============================================================ */

.lqhero-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 0 56px;
  align-items: center;
}
.lqhero-grid .assetrail { grid-column: 1 / -1; }
.lqhero-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 24px 0 10px;
}
.lqhero-side .lqstats { display: contents; }
.lqhero-side .lqstat { min-width: 0; overflow: hidden; padding: 10px 12px 11px; }
.lqhero-side .lqstat-v { font-size: 16px; }
.lqhero-side .lqstat-row { flex-wrap: wrap; row-gap: 2px; margin-top: 7px; }
/* the notional chip is a sentence-length figure: below the value, not beside */
.lqhero-side .lqstat-s {
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lqstat-ic {
  display: inline-flex;
  width: 15px;
  height: 15px;
  align-self: center;
  color: var(--lime);
  flex: none;
}
.lqstat-ic svg { width: 100%; height: 100%; display: block; }
/* an asset whose mark is a logo file rather than a glyph */
.lqstat-ic img { width: 100%; height: 100%; display: block; border-radius: 50%; }
.lqstat-ic.is-coin { color: var(--cb); }
@media (max-width: 980px) {
  .lqhero-grid { grid-template-columns: 1fr; }
  .lqhero-side { padding-top: 4px; }
}
@media (max-width: 480px) { .lqhero-side { grid-template-columns: 1fr; } }

/* hero tiles as one board: hairlines between cells, no separate cards */
.lqhero-side { gap: 1px; }
.lqhero-side .lqstat { border: 0; border-radius: 0; box-shadow: 0 0 0 1px var(--line-2); }
.lqstat-ic:not(.is-coin) { 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; }
