/* HTerminal Signals: full-height liquidations column + slim source intel (Nov 22) */

/* -------- desktop / landscape: 4 columns, radar & liq full height, intel slim right -------- */
@media (min-width: 1101px) {
  .display[data-d=signals] {
    grid-template-columns: minmax(0,1.22fr) minmax(0,1.18fr) minmax(0,1.28fr) minmax(210px,0.78fr) !important;
    grid-template-rows: minmax(0,1.1fr) minmax(320px,0.95fr) !important;
  }
  .display[data-d=signals] .p-impact { grid-column: 1; grid-row: 1 / -1 !important; min-height: 0; }
  .display[data-d=signals] .p-radar  { grid-column: 2; grid-row: 1 / -1 !important; min-height: 0; }
  .display[data-d=signals] .p-liq    { grid-column: 3; grid-row: 1 / -1 !important; min-height: 0; }
  .display[data-d=signals] .p-score  { grid-column: 4; grid-row: 1 !important; min-height: 0; }
  .display[data-d=signals] .p-stocksig { grid-column: 4; grid-row: 2 !important; min-height: 0; }
  .display[data-d=signals] .p-store  { display: none !important; }
  /* Smart Money (other worker) shares the impact column instead of opening a short implicit row */
  .display[data-d=signals]:has(.p-smartmoney) .p-impact { grid-column: 1; grid-row: 1 !important; min-height: 0; overflow: hidden; }
  .display[data-d=signals] .p-smartmoney { grid-column: 1; grid-row: 2 !important; min-height: 0; overflow: hidden; }
  .display[data-d=signals] .p-liq,
  .display[data-d=signals] .p-score,
  .display[data-d=signals] .p-stocksig {
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
  }
  .display[data-d=signals] .p-liq .body,
  .display[data-d=signals] .p-score .body,
  .display[data-d=signals] .p-stocksig .body {
    overflow-y: auto !important;
    overflow-x: hidden;
    flex: 1 1 auto !important;
    min-height: 0;
  }
}

/* -------- tablet: radar + impact on top, liquidations full width, intel under -------- */
@media (max-width: 1100px) and (min-width: 761px) {
  .display[data-d=signals] {
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: minmax(240px,0.9fr) minmax(300px,1.2fr) auto auto auto !important;
  }
  .display[data-d=signals] .p-impact { grid-column: 1; grid-row: 1 !important; }
  .display[data-d=signals] .p-radar  { grid-column: 2; grid-row: 1 !important; }
  .display[data-d=signals] .p-liq    { grid-column: 1 / -1; grid-row: 2 !important; }
  .display[data-d=signals] .p-score  { grid-column: 1 / -1; grid-row: 3 !important; max-height: 220px; }
  .display[data-d=signals] .p-stocksig { grid-column: 1 / -1; grid-row: 4 !important; min-height: 0; }
  .display[data-d=signals] .p-store  { display: none !important; }
  .display[data-d=signals] .p-smartmoney { grid-column: 1 / -1; grid-row: 5 !important; max-height: 280px; min-height: 0; }
}

/* -------- phone: stack and scroll with the page (do not trap gestures, no pointer-events:none) -------- */
@media (max-width: 760px) {
  .display[data-d=signals] {
    display: flex !important;
    flex-direction: column;
    overflow-y: auto !important;
    overflow-x: hidden;
    height: 100%;
  }
  .display[data-d=signals] .p-liq,
  .display[data-d=signals] .p-score,
  .display[data-d=signals] .p-stocksig { display: flex !important; }
  .display[data-d=signals] .p-store { display: none !important; }
  .display[data-d=signals] .mob-sheet-bar { order: 0; }
  .display[data-d=signals] .p-smartmoney { order: 1; flex: 0 0 auto !important; height: auto !important; }
  .display[data-d=signals] .p-impact { order: 2; flex: 0 0 auto !important; height: auto !important; }
  .display[data-d=signals] .p-liq { order: 3; flex: 0 0 auto !important; height: auto !important; min-height: 0; max-height: none !important; overflow: visible !important; }
  .display[data-d=signals] .p-stocksig { order: 4; flex: 0 0 auto !important; height: auto !important; min-height: 0; max-height: none !important; overflow: visible !important; }
  .display[data-d=signals] .p-score { order: 5; flex: 0 0 auto !important; height: auto !important; min-height: 0; max-height: none !important; overflow: visible !important; }
  .display[data-d=signals] .p-radar { order: 6; flex: 0 0 auto !important; height: auto !important; }
  .display[data-d=signals] .p-liq .body,
  .display[data-d=signals] .p-score .body,
  .display[data-d=signals] .p-stocksig .body,
  .display[data-d=signals] #htLiq,
  .display[data-d=signals] #htStock,
  .display[data-d=signals] #htIntel {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
    flex: 0 0 auto !important;
  }
}

/* ht_alive already injects a heat/sort strip — we replace those features, hide the duplicates */
.p-liq .alive-liqviz,
.p-liq .alive-sortbar { display: none !important; }
.p-score .alive-scoreviz,
.p-score .alive-sortbar { display: none !important; }

/* -------- liquidations column -------- */
.p-liq > h3 small { letter-spacing: .04em; }
#htLiq { display: block; height: auto !important; max-height: none; overflow: visible; font-variant-numeric: tabular-nums; }
#htLiq > * { flex: none !important; height: auto; max-height: none; margin-bottom: 9px; }
#htLiq > *:last-child { margin-bottom: 0; }
#htLiq .hl-sec { border: 1px solid rgba(57,255,106,.12); border-radius: 6px; padding: 7px 8px 8px; background: rgba(0,8,4,.28); }
#htLiq .hl-h, #htStock .hl-h, #htIntel .hl-h {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  font: 700 9.5px var(--mono); letter-spacing: .16em; color: var(--dim); margin: 0 0 6px;
}
#htLiq .hl-h b, #htStock .hl-h b { color: var(--txt); letter-spacing: .08em; font-weight: 700; }
#htLiq .hl-h span, #htStock .hl-h span { letter-spacing: .06em; min-width: 0; text-align: right; }
#htLiq .hl-est {
  display: inline-block; margin-left: 6px; padding: 0 5px; border: 1px solid rgba(255,201,74,.45);
  border-radius: 3px; color: var(--amber); font: 700 9px var(--mono); letter-spacing: .08em;
}

/* cascade banner */
.hl-cas { position: relative; overflow: hidden; padding: 9px 10px 10px; }
.hl-cas[data-tone=caution] { border-color: rgba(255,59,92,.4); box-shadow: inset 0 0 24px rgba(255,59,92,.08); }
.hl-cas[data-tone=watch] { border-color: rgba(255,201,74,.4); box-shadow: inset 0 0 24px rgba(255,201,74,.08); }
.hl-cas[data-tone=calm] { border-color: rgba(57,255,106,.14); }
.hl-cas .hl-cas-top { display: flex; align-items: center; gap: 10px; }
.hl-cas .hl-meter {
  --p: 0; width: 44px; height: 44px; flex: none; border-radius: 50%;
  background: conic-gradient(var(--hl-mc, var(--amber)) calc(var(--p) * 1%), rgba(255,255,255,.08) 0);
  display: grid; place-items: center;
}
.hl-cas .hl-meter i {
  width: 30px; height: 30px; border-radius: 50%; background: rgba(2,10,6,.92);
  display: grid; place-items: center; font: 700 11px var(--mono); color: #fff;
}
.hl-cas h4 { margin: 0; font: 700 12px var(--mono); letter-spacing: .08em; color: #fff; }
.hl-cas p { margin: 5px 0 0; font: 12px/1.45 var(--sans); color: var(--txt); }
.hl-cas p.hl-watch { color: var(--dim); font-size: 11.5px; }

/* totals + pressure */
.hl-wins { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; min-width: 0; }
.hl-win { text-align: center; padding: 4px 2px 2px; min-width: 0; }
.hl-win small { display: block; font: 700 9px var(--mono); letter-spacing: .14em; color: var(--dim); }
.hl-win b { display: block; font: 700 13px var(--mono); color: #fff; margin: 2px 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hl-win .hl-leg { flex-wrap: wrap; justify-content: center; gap: 1px 8px; font-size: 10.5px; }
.hl-split { display: flex; height: 7px; border-radius: 6px; overflow: hidden; background: rgba(255,255,255,.06); }
.hl-split i:first-child { background: var(--dn); width: var(--l, 50%); }
.hl-split i:last-child { background: var(--up); width: var(--s, 50%); }
.hl-leg { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; font: 10px var(--mono); color: var(--dim); }
.hl-press { font: 11px var(--mono); color: var(--txt); text-align: center; margin-top: 4px; }

/* venue / coin bars */
.hl-barrow { display: grid; grid-template-columns: 52px 1fr auto; gap: 6px; align-items: center; font: 11px var(--mono); padding: 2px 0; }
.hl-barrow .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--txt); }
.hl-barrow .nm.star::before { content: "★ "; color: var(--amber); }
.hl-track { height: 6px; border-radius: 5px; background: rgba(255,255,255,.06); display: flex; overflow: hidden; }
.hl-track i.dn { background: var(--dn); }
.hl-track i.up { background: var(--up); }
.hl-barrow em { font-style: normal; color: var(--dim); font-size: 10px; }

/* heat strip */
.hl-heat { display: flex; height: 28px; gap: 1px; align-items: flex-end; }
.hl-heat b { flex: 1; min-width: 0; display: flex; flex-direction: column-reverse; height: 100%; }
.hl-heat b i { width: 100%; display: block; }
.hl-heat b i.dn { background: var(--dn); opacity: .9; }
.hl-heat b i.up { background: var(--up); opacity: .9; }

/* liquidation map */
.hl-map-tabs { display: flex; gap: 4px; }
.hl-map-tabs button { min-height: 26px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 4px; font: 700 10px var(--mono); color: var(--dim); }
.hl-map-tabs button.on { background: rgba(57,255,106,.16); color: var(--g); border-color: var(--g); }
.hl-ladder { position: relative; height: 168px; margin: 4px 0 2px; }
.hl-ladder canvas { width: 100%; height: 100%; display: block; }
.hl-map-note { font: 10.5px/1.4 var(--sans); color: var(--dim); margin: 4px 0 0; }

/* stocks */
.hl-stock { display: flex; flex-direction: column; gap: 6px; }
.hl-kv { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font: 11px var(--mono); }
.hl-kv span { color: var(--dim); }
.hl-kv b { color: #fff; font-weight: 650; }
.hl-sq { padding: 5px 0; border-top: 1px solid rgba(57,255,106,.08); cursor: pointer; }
.hl-sq b { display: block; font: 700 11.5px var(--mono); color: #fff; }
.hl-sq p { margin: 2px 0 0; font: 11.5px/1.4 var(--sans); color: var(--txt); }
.hl-lim { font: 10.5px/1.4 var(--sans); color: var(--dim); margin-top: 4px; }

/* tape */
.hl-tools { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 2px 0 6px; }
.hl-tools .btn.on { background: var(--g); color: #001a07; }
.hl-tools input[type=date] { padding: 3px 5px; font: 10.5px var(--mono); color-scheme: dark; max-width: 118px; }
.hl-row {
  display: grid; grid-template-columns: minmax(0,1fr) 72px 46px; gap: 6px; align-items: center;
  font: 11.5px var(--mono); padding: 4px 2px; border-top: 1px solid rgba(57,255,106,.07); cursor: pointer;
}
.hl-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-row.whale { background: linear-gradient(90deg, rgba(255,201,74,.12), transparent 70%); }
.hl-row.in { animation: hlIn .45s cubic-bezier(.22,1,.36,1); }
@keyframes hlIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hl-row.in { animation: none; } }
[data-motion=off] .hl-row.in { animation: none; }
.hl-row .mut { font-size: 10px; }
.hl-asof { margin-top: 6px; font: 10.5px/1.4 var(--mono); color: var(--dim); }
.hl-asof a { color: var(--g2); }

/* -------- slim source intel (far right) -------- */
#htIntel { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.hi-ring-wrap { display: flex; align-items: center; gap: 10px; }
.hi-ring { width: 74px; height: 74px; flex: none; }
.hi-ring svg { width: 100%; height: 100%; display: block; }
.hi-ring-lab { font: 11px/1.35 var(--sans); color: var(--txt); }
.hi-ring-lab b { display: block; font: 700 18px var(--mono); color: #fff; }
.hi-list .hi-row {
  display: grid; grid-template-columns: minmax(0,1fr) 36px 32px; gap: 4px; align-items: center;
  font: 11px var(--mono); padding: 3px 0; border-top: 1px solid rgba(57,255,106,.07); cursor: pointer;
}
.hi-list .hi-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hi-exp { margin-top: 2px; }
.hi-exp > button {
  width: 100%; min-height: 30px; border: 1px solid var(--line); border-radius: 4px;
  font: 700 10px var(--mono); letter-spacing: .12em; color: var(--dim);
}
.hi-exp > button:hover, .hi-exp.open > button { color: var(--g); border-color: var(--g); }
.hi-more { display: none; margin-top: 8px; }
.hi-exp.open .hi-more { display: block; }
.hi-more .sbar { font-size: 11px; }
.hi-store { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.hi-store div { border: 1px solid rgba(57,255,106,.1); border-radius: 4px; padding: 6px; text-align: center; }
.hi-store small { display: block; font: 700 9px var(--mono); letter-spacing: .12em; color: var(--dim); }
.hi-store b { display: block; font: 700 16px var(--mono); color: #fff; margin-top: 2px; }

@media (max-width: 760px) {
  .hl-ladder { height: 200px; }
  .hl-row, .hl-barrow, .hi-list .hi-row { font-size: 12.5px; padding: 6px 0; }
  .hl-cas p { font-size: 13px; }
}

.p-score .hl-h { letter-spacing: .1em; }
.hi-list .hl-h span { letter-spacing: .08em; }
.hi-ring { width: 74px; height: 74px; flex: none; }
.hi-ring svg { width: 74px; height: 74px; display: block; }

/* GEX / dark pool on the stock side */
.hl-gex { margin-top: 2px; }
.hl-gex-mini { margin-top: 4px; }
.hl-stock .hl-h { margin-top: 2px; }


/* -------- header: keep title fully visible, timestamp clear of i/expand -------- */
.display[data-d=signals] .p-liq > h3,
.display[data-d=signals] .p-stocksig > h3 {
  align-items: center;
  padding: 12px 14px 10px;
  min-height: 44px;
  line-height: 1.3;
  letter-spacing: .12em;
  overflow: visible;
  box-sizing: border-box;
  white-space: nowrap;
}
.display[data-d=signals] .p-liq > h3 small,
.display[data-d=signals] .p-stocksig > h3 small { letter-spacing: .04em; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.display[data-d=signals] .p-liq > h3 .fresh,
.display[data-d=signals] .p-stocksig > h3 .fresh {
  margin-left: auto;
  margin-right: 8px;
  flex: 0 1 auto;
  max-width: 8.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: static;
}
.display[data-d=signals] .p-liq > h3 .alive-det-btn,
.display[data-d=signals] .p-liq > h3 .alive-max-btn,
.display[data-d=signals] .p-stocksig > h3 .alive-det-btn,
.display[data-d=signals] .p-stocksig > h3 .alive-max-btn {
  position: static;
  margin-left: 0;
  flex: none;
}

/* readable type */
#htLiq, #htStock { font-size: 12px; }
#htLiq .hl-barrow, #htLiq .hl-row, #htLiq .hl-kv, #htStock .hl-kv, #htStock .hl-barrow, #htStock .hl-sq {
  font-size: 12px; padding: 6px 0;
}
#htLiq .hl-barrow em, #htLiq .hl-row .mut { font-size: 11.5px; }
#htLiq .hl-h, #htStock .hl-h, #htIntel .hl-h { font-size: 10.5px; }
#htLiq .hl-press, #htLiq .hl-win b { font-size: 12px; }
#htLiq .hl-win .hl-leg { font-size: 10.5px; }
#htLiq .hl-cas p, #htLiq .hl-map-note, #htStock .hl-map-note { font-size: 12px; line-height: 1.45; }
#htLiq .hl-track { height: 8px; }
#htLiq .hl-barrow { grid-template-columns: 64px minmax(0,1fr) auto; gap: 8px; }

/* switcher */
.hl-switch { display: flex; gap: 4px; margin: 0 0 10px; padding: 3px; border: 1px solid rgba(57,255,106,.16); border-radius: 8px; background: rgba(0,8,4,.35); }
.hl-switch button {
  flex: 1; min-height: 32px; border: 0; border-radius: 6px; background: transparent;
  font: 700 11.5px var(--mono); letter-spacing: .1em; color: var(--dim); cursor: pointer;
}
.hl-switch button.on, .hl-switch button[aria-selected=true] { background: rgba(57,255,106,.16); color: var(--g); }
.hl-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font: 12px var(--mono); color: var(--txt); margin: 0 0 8px; }
.hl-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.hl-legend i.dn { background: var(--dn); }
.hl-legend i.up { background: var(--up); }
.hl-legend .tot { margin-left: auto; color: var(--dim); }

/* heat with axes + tooltip */
.hl-heatsec { position: relative; }
.hl-heat-wrap { display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 6px 8px; align-items: stretch; }
.hl-heat-y { display: flex; flex-direction: column; justify-content: space-between; text-align: right; font: 10.5px var(--mono); color: var(--dim); padding: 2px 0 18px; }
.hl-heat-plot { position: relative; min-width: 0; }
.hl-heat { display: flex; height: 88px; gap: 1px; align-items: flex-end; border-bottom: 1px solid rgba(57,255,106,.18); border-left: 1px solid rgba(57,255,106,.18); padding: 0 0 0 0; }
.hl-heat b { flex: 1; min-width: 0; display: flex; flex-direction: column-reverse; height: 100%; cursor: pointer; position: relative; }
.hl-heat b:hover { outline: 1px solid rgba(255,255,255,.35); outline-offset: -1px; }
.hl-heat-x { display: flex; justify-content: space-between; font: 10.5px var(--mono); color: var(--dim); margin-top: 4px; }
.hl-heat-tip {
  position: absolute; z-index: 3; pointer-events: none; min-width: 140px;
  background: rgba(2,12,7,.96); border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 8px; font: 11.5px var(--mono); color: #fff; box-shadow: 0 8px 20px rgba(0,0,0,.45);
}
.hl-heat-tip[hidden] { display: none !important; }

/* taller map */
.hl-ladder { height: 240px; margin: 6px 0 4px; }
.hl-map-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.hl-info { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--dim); font: italic 700 12px/1 Georgia,serif; cursor: pointer; flex: none; }
.hl-info:hover, .hl-info.on { color: #031; background: var(--g); border-color: var(--g); }
.hl-map-long { display: none; margin: 6px 0 0; font: 12px/1.45 var(--sans); color: var(--dim); }
.hl-map-long.on { display: block; }

#htStock { display: block; }

@media (max-width: 760px) {
  #htLiq, #htStock { font-size: 13px; }
  #htLiq .hl-barrow, #htLiq .hl-row, #htLiq .hl-kv, #htStock .hl-kv, #htStock .hl-barrow, #htStock .hl-sq { font-size: 13px; padding: 8px 0; }
  #htLiq .hl-barrow { grid-template-columns: 72px minmax(0,1fr) auto; }
  .hl-switch button { min-height: 38px; font-size: 12.5px; }
  .hl-heat { height: 100px; }
  .hl-ladder { height: 260px; }
  .hl-wins { grid-template-columns: 1fr; }
}


/* stock signals: last line must not clip; body scrolls with end padding */
.display[data-d=signals] .p-stocksig > .body,
#stocksig, #htStock {
  overflow-y: auto !important;
  scrollbar-gutter: stable;
  padding-bottom: 18px;
  box-sizing: border-box;
}
#htStock .hl-sec:last-child, #stocksig .hl-sec:last-child { margin-bottom: 8px; }
#htStock .hl-map-note, #stocksig .hl-map-note { overflow-wrap: anywhere; padding-bottom: 2px; }


/* stocksig header buttons must stay visible; note must not mid-clip at rest */
.display[data-d=signals] .p-stocksig > h3 small { display: none; }
.display[data-d=signals] .p-stocksig > h3 {
  overflow: visible;
  gap: 6px;
}
.display[data-d=signals] .p-stocksig > h3 .fresh { max-width: 6.5rem; }
#stocksig .hl-map-note, #htStock .hl-map-note {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6;
  overflow: hidden;
}
