/* #/hot (class prefix ht-): site/js/views/hot.js. Lane updates-hot, docs/UPDATES-1.md section 1.
   One ranked list. Shared classes (.qpill, .chip, .seg, .heat, .qflag, .st-pill, .empty, .btn) are used as they are;
   only their size inside a row is set here. Colours only through the tokens of styles.css: no colour literal and no
   custom property is defined in this file (the row's stagger index is set from JS and only READ here).

   THE MONEY RULE, as far as a stylesheet can keep it: a row never changes height by itself. Line 1 is one line, line
   2 is one line that clips WHOLE items when the screen is narrow (a wrapped item lands on a second line that is not
   shown), and the why line is one line on a wide screen and behind the row's own expander on a phone. From 760 px
   line 1 and the why line have a FIXED height: a held row whose coin cooled loses its meter and its sentence, and
   must not get shorter (it did: four cooled rows put the next coin's pill under a resting pointer). An opened phone
   row has a fixed height for the same reason. So nothing slides under a thumb that is on its way to a pill. The
   order itself is held still from JS.

   Width contract (docs/LANES.md 3.7): under 560 px a row is a two-line card and the pill is 44 px tall; the controls
   are one strip that scrolls sideways inside itself; the page never scrolls sideways. The card stays the layout up
   to 760 px (a pill beside the numbers leaves them too little room before that); a touch screen keeps the 44 px. */

/* ---------- the page ---------- */
.ht-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.ht-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.ht-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; }
.ht-h1 { display: inline-flex; align-items: center; gap: 8px; margin: 0; text-transform: lowercase; }
.ht-h1-ico { width: 0.86em; height: 0.86em; flex: none; color: var(--heat-3); }
.ht-h1-ico path { fill: currentColor; stroke-width: 1.4; }
.ht-count { font-family: var(--font-mono); font-size: 12px; }
.ht-lead { max-width: 72ch; margin: 0; color: var(--muted); font-size: 14px; }
.ht-status { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; }
.ht-asof { color: var(--muted); font-size: 12.5px; }

/* ---------- the controls: ONE strip. It scrolls sideways inside itself; the page does not ---------- */
.ht-ctl { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 2px; scrollbar-width: none; }
.ht-ctl .seg { flex: none; flex-wrap: nowrap; max-width: none; }
.ht-ctl .seg-btn { white-space: nowrap; text-transform: lowercase; }

/* ---------- the list ---------- */
.ht-body { position: relative; min-width: 0; }
.ht-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0; padding: 0; list-style: none; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); overflow: hidden; }
.ht-empty .btn { margin-top: 4px; }
.ht-fine { max-width: 92ch; margin: 2px 0 0; }

/* a row. Phone first: line 1 = rank, picture, ticker, heat, pill (+ the expander); line 2 = lane and the numbers */
.ht-row { position: relative; display: grid; grid-template-columns: 20px 36px minmax(0, 1fr) auto; grid-template-areas: "rank pic top act" "l2 l2 l2 l2" "x x x x"; align-items: center; gap: 6px 8px; min-width: 0; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.ht-row:last-child { border-bottom: 0; }
.ht-row:hover { background: var(--hover); }
/* how hot, as a shape on the row's edge (the ember red is never text) */
.ht-row[data-level="1"] { box-shadow: inset 2px 0 0 var(--heat-1); }
.ht-row[data-level="2"] { box-shadow: inset 2px 0 0 var(--heat-2); }
.ht-row[data-level="3"] { box-shadow: inset 2px 0 0 var(--heat-3); }
.ht-row[data-level="4"] { box-shadow: inset 3px 0 0 var(--heat-4); }
.ht-row.busy { opacity: 0.86; }
/* the order is held and this coin is not hot any more: the row stays where the finger expects it, without a rank or a heat word that is no longer real */
.ht-row.ht-cold { opacity: 0.5; }
.ht-row.ht-cold .ht-rank, .ht-row.ht-cold .ht-heat { visibility: hidden; }
/* ...and none of the reading's numbers, its sentence or its level edge: a reading that is gone or minutes old is not shown as live (hidden, not removed: the row keeps its height) */
.ht-row.ht-cold { box-shadow: none; }
.ht-row.ht-cold .ht-basis, .ht-row.ht-cold .ht-tpm, .ht-row.ht-cold .ht-net, .ht-row.ht-cold .ht-why { visibility: hidden; }
/* the coin LEFT the board while the order is held: no pill at all (there is no fresh card to hand to a buy) */
.ht-row.ht-gone .ht-quick { visibility: hidden; }
/* a buy on this coin was confirmed: a still green edge for a moment (profit and loss colours stay buy and sell only) */
.ht-row.ht-filled { box-shadow: inset 3px 0 0 var(--up); background: var(--up-soft); }

.ht-rank { grid-area: rank; text-align: center; color: var(--muted); font: 700 13px/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.ht-row[data-rank="1"] .ht-rank { color: var(--heat-4); }
.ht-row[data-rank="2"] .ht-rank, .ht-row[data-rank="3"] .ht-rank { color: var(--heat-3); }
.ht-pic { grid-area: pic; display: inline-flex; }
.ht-pic .coin-img { width: 36px; height: 36px; }

.ht-top { grid-area: top; display: flex; align-items: center; gap: 8px; min-width: 0; }
/* the whole row opens the coin: the link is stretched over it, and what must take its own click sits above it */
.ht-link { display: flex; align-items: baseline; gap: 6px; flex: 1 1 auto; min-width: 0; color: var(--text); }
.ht-link:hover { color: var(--text); text-decoration: none; }
.ht-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.ht-link:focus-visible { outline: none; }
.ht-link:focus-visible::after { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 6px; }
.ht-sym { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 15px/1.25 var(--font-ui); }
.ht-name { display: none; flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12.5px; }
/* "not ours" / "not confirmed": a coin that carries the project's ticker or name and is not its address (views/pulse.js nameOnlyChip).
   16 px in the ticker's line: the row keeps its height. Above the row's link, so its hint can be read. */
.ht-nope { position: relative; z-index: 2; flex: none; display: inline-flex; align-items: center; height: 16px; padding: 0 6px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font: 600 10.5px/1 var(--font-mono); white-space: nowrap; cursor: help; }
.ht-heat { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.ht-meter { display: inline-flex; align-items: center; }
.ht-meter:empty { display: none; }
.ht-meter .heat-bars { display: none; }
.ht-word { display: none; color: var(--muted); font: 700 11.5px/1 var(--font-ui); white-space: nowrap; }
.ht-row[data-level="2"] .ht-word { color: var(--brand-text); }
.ht-row[data-level="3"] .ht-word { color: var(--heat-3); }
.ht-row[data-level="4"] .ht-word { color: var(--heat-hot); }

/* the pill: 44 px to the thumb on a phone, never wrapped off the line */
.ht-act { grid-area: act; display: inline-flex; align-items: center; gap: 4px; flex: none; }
.ht-quick { display: inline-flex; flex: none; }
.ht-quick .qpill { height: auto; min-height: 44px; padding: 0 13px 0 10px; font-size: 13px; }
.ht-quick .qpill .ico { width: 13px; height: 13px; }
.ht-quick .ht-pill-no { padding: 0 11px; font-family: var(--font-ui); font-size: 12px; cursor: not-allowed; }
/* (updates 4, the order "watching": no pill. Its place holds a plain link to the coin's page, a thumb's height, never orange) */
.ht-quick .ht-go { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--text); text-decoration: none; text-transform: lowercase; white-space: nowrap; }
/* (updates 4, switch skeletons: the strut that keeps the pill's height in a skeleton row, never a shape; 34 px to a mouse below) */
.ht-quick .sk-strut { display: inline-block; width: 1px; min-height: 44px; visibility: hidden; }
.ht-more { position: relative; z-index: 2; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; min-height: 44px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); }
.ht-more:hover { background: var(--chip); color: var(--text); }
.ht-more .ico { width: 18px; height: 18px; }
.ht-row.ht-open .ht-more { color: var(--brand-text); }

/* line 2: ONE line. An item that does not fit wraps to a second line that is clipped, so it goes whole or not at
   all and the row keeps its height. The ::before is a strut: it makes the first line exactly as tall as the box. */
.ht-l2 { grid-area: l2; display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start; gap: 0 8px; height: 24px; min-width: 0; overflow: hidden; }
.ht-l2::before { content: ""; flex: none; width: 0; height: 24px; margin-right: -8px; }
.ht-l2 > * { flex: none; }
.ht-l2 > .is-none { display: none; }
/* what a narrow line gives up first is what stands last ON SCREEN: the age, then the lane (the switch above already
   says it), then the watching chip. The safety word and the numbers stay. The order in the document does not change. */
.ht-watch { order: 1; }
.ht-lane { order: 2; }
.ht-age { order: 3; }
.ht-net .k { display: none; }
.ht-lane { text-transform: lowercase; }
.ht-row[data-lane="stretch"] .ht-lane { border-color: var(--brand-a50); background: var(--brand-soft); color: var(--brand-hi); }
.ht-row[data-lane="migrated"] .ht-lane { border-color: var(--line-2); color: var(--text); }
.ht-kv { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; color: var(--text); font-size: 12.5px; }
.ht-kv .k { color: var(--muted); font: 600 11px/1 var(--font-ui); }
.ht-kv b { font-weight: 700; border-radius: 4px; }
.ht-net.up b { color: var(--up); }
.ht-net.down b { color: var(--down); }
.ht-mc .mc-mid { color: var(--heat-3); }
.ht-mc .mc-hi { color: var(--heat-4); }
.ht-mc .mc-top { color: var(--heat-hot); text-shadow: 0 0 8px var(--heat-3), 0 0 2px var(--heat-4); }
.ht-age { color: var(--muted); font-size: 12px; }
.ht-row [data-tip], .ht-basis, .ht-watch { position: relative; z-index: 2; cursor: help; }
/* what the reading stands on. A 5-minute average is always marked; "live" is spelled out where there is room */
.ht-basis-live { display: none; border-color: var(--brand-a50); color: var(--brand-hi); }
.ht-basis-avg { border-style: dashed; }

/* behind the expander on a phone: the volume of the window picked, and why it is hot (the reading's own sentence) */
.ht-x { grid-area: x; display: none; min-width: 0; }
.ht-row.ht-open .ht-x { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 4px; height: 84px; padding: 2px 0 2px; overflow: hidden; }
.ht-why { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; }
.ht-why:empty { display: none; }

/* "order held while you aim": under the list, never over a row, never in the way of a tap */
.ht-held { position: sticky; bottom: calc(var(--tab-h) + 12px); z-index: 3; width: fit-content; max-width: 100%; margin: 8px 0 0 auto; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg-2-a94); color: var(--muted); pointer-events: none; }

/* the first paint: the rows come in one after the other (styles.css switches every animation off under reduced motion) */
.ht-row.ht-in { animation: ht-in 0.34s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 32ms); }
@keyframes ht-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- alpha (docs/UPDATES-2-ALPHA.md): one more order, the weights sheet, the alerts of this visit ----------
   Nothing here moves a row: the alpha number stands where the heat number stood (same line, same height), the sheet
   is the shared dialog over the page, the alert toast floats, and the log sits UNDER the list. */
/* the weights button: beside the order chips, in the strip */
.ht-wbtn { flex: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-transform: lowercase; }
.ht-wbtn .ico { width: 14px; height: 14px; }
.ht-wbtn-on { padding: 1px 6px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-hi); font: 600 10.5px/1.4 var(--font-mono); }
/* in the alpha order the alpha number stands where the heat number stands; the meter and the heat word stay: they are the coin's reading */
.ht-alpha { flex: none; color: var(--text); font: 700 12px/1 var(--font-mono); font-variant-numeric: tabular-nums; cursor: help; position: relative; z-index: 2; }
.ht-row.ht-by-alpha .ht-meter .heat-n { display: none; }
/* the alerts of this visit: under the list, so a new line moves no row */
.ht-log { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.ht-log-h { margin: 0; font: 700 13px/1.2 var(--font-ui); text-transform: lowercase; }
.ht-log-note { margin: 0; }
.ht-log-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0; padding: 0; list-style: none; min-width: 0; }
.ht-log-list:empty { display: none; }
.ht-log-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; min-width: 0; padding: 6px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.ht-log-at { flex: none; color: var(--muted); }
.ht-log-sym { flex: 0 1 auto; min-width: 0; max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ht-log-why { flex: 1 1 12ch; min-width: 0; color: var(--muted); }
.ht-log-open { flex: none; padding: 6px 0; font-weight: 700; }
/* the weights sheet, inside the shared dialog: one column, no fixed width */
.ht-sheet { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.ht-sheet-true { color: var(--text); }
.ht-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.ht-preset[aria-pressed="true"] { border-color: var(--brand-a50); background: var(--brand-soft); color: var(--brand-hi); }
.ht-w { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.ht-w-t { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; min-width: 0; }
.ht-w-k { font: 600 13px/1.2 var(--font-ui); }
.ht-w-h { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.ht-w-warm { color: var(--warn); font-size: 11.5px; line-height: 1.35; }
.ht-w.ht-w-off .ht-w-k { color: var(--muted); }
.ht-w-step { flex: none; display: inline-flex; align-items: center; gap: 4px; }
.ht-w-b { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-height: 44px; padding: 0; border: 1px solid var(--line-2); border-radius: 9px; background: transparent; color: var(--text); font: 700 16px/1 var(--font-mono); }
.ht-w-b:hover { background: var(--chip); }
.ht-w-b:disabled { opacity: 0.4; cursor: not-allowed; }
.ht-w-n { min-width: 2ch; text-align: center; font: 700 14px/1 var(--font-mono); }

/* ---------- under 560 px: the two-line card. The switches get a thumb's height ---------- */
@media (max-width: 559px) {
  .ht-ctl .seg-btn { min-height: 38px; }
  .ht-wbtn { min-height: 38px; }
  .ht-quick .qpill { min-height: 44px; }
  .ht-lane { padding: 0; border: 0; background: none; }
  .ht-row[data-lane="stretch"] .ht-lane { background: none; }
}

/* ---------- from 560 px: more air, and the coin's name next to its ticker. Still the two-line card ---------- */
@media (min-width: 560px) {
  .ht-row { gap: 6px 12px; padding: 10px 14px; }
  .ht-name { display: block; }
}
/* a mouse does not need a thumb's pill (a touch screen keeps its 44 px at every width) */
@media (min-width: 560px) and (pointer: fine) {
  .ht-quick .qpill, .ht-more { min-height: 34px; }
  .ht-w-b { width: 34px; min-height: 34px; }
  .ht-quick .ht-go { min-height: 34px; }
  .ht-quick .sk-strut { min-height: 34px; }
}

/* ---------- from 760 px: the numbers sit under the ticker and the why line is always there. No expander ---------- */
@media (min-width: 760px) {
  .ht-row { grid-template-columns: 26px 44px minmax(0, 1fr) auto; grid-template-areas: "rank pic top act" "rank pic l2 act" "rank pic x act"; gap: 3px 12px; }
  .ht-pic .coin-img { width: 44px; height: 44px; }
  .ht-l2 { gap: 0 10px; }
  .ht-l2::before { margin-right: -10px; }
  .ht-watch, .ht-lane, .ht-age { order: 0; }
  .ht-net .k { display: inline; }
  .ht-word { display: inline; }
  .ht-meter .heat-bars { display: inline-flex; }
  .ht-more { display: none; }
  .ht-basis-live { display: inline-flex; }
  .ht-top { height: 21px; }
  .ht-x, .ht-row.ht-open .ht-x { display: flex; align-items: baseline; gap: 10px; height: 20px; padding: 0; overflow: hidden; }
  .ht-x .ht-vol { flex: none; }
  .ht-why { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- from 1000 px: every number has its own place on the line, so the eye runs down a column ---------- */
@media (min-width: 1000px) {
  .ht-l2 { flex-wrap: nowrap; gap: 0 12px; }
  .ht-l2::before { margin-right: -12px; }
  .ht-l2 > .is-none { display: inline-flex; visibility: hidden; }
  .ht-lane { flex: 0 0 100px; justify-content: center; }
  .ht-flag { flex: 0 0 62px; }
  .ht-tpm { flex: 0 0 74px; }
  .ht-basis { flex: 0 0 58px; justify-content: center; }
  .ht-net { flex: 0 0 128px; }
  .ht-mc { flex: 0 0 88px; }
  .ht-age { flex: 0 0 36px; }
}

/* ---------- updates 3 (docs/UPDATES-3.md section 3): the wire, how a coin gets its alpha ----------
   Nothing here moves a row: the wire sits UNDER the list like the alert log, and the popover is fixed over the page. */
.ht-wire { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.ht-wire-h { display: flex; align-items: center; gap: 6px; margin: 0; font: 700 13px/1.2 var(--font-ui); text-transform: lowercase; }
.ht-wire-ico { width: 14px; height: 14px; color: var(--brand-hi); }
.ht-wire-note { margin: 0; }
.ht-wire-what { margin: 0; color: var(--text); }
.ht-wire-flag { flex: none; }
.ht-wire-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0; padding: 0; list-style: none; min-width: 0; }
.ht-wire-list:empty { display: none; }
.ht-wire-row { min-width: 0; border-top: 1px solid var(--line); }
.ht-wire-a { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; min-width: 0; min-height: 44px; padding: 8px 0; color: var(--text); font-size: 12.5px; text-decoration: none; box-sizing: border-box; }
.ht-wire-a:hover .ht-wire-sym, .ht-wire-a:focus-visible .ht-wire-sym { color: var(--brand-hi); }
.ht-wire-at { flex: none; color: var(--muted); }
.ht-wire-sym { flex: 0 1 auto; min-width: 0; max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ht-wire-why { flex: 1 1 14ch; min-width: 0; color: var(--muted); overflow-wrap: anywhere; }
/* the alpha number, tappable: a bigger target by padding that a negative margin takes back (the line keeps its height) */
.ht-alpha.ht-alpha-tap { cursor: pointer; padding: 10px 4px; margin: -10px -4px; text-decoration: underline dotted; text-underline-offset: 3px; }
.ht-parts { position: fixed; z-index: 90; width: 320px; max-width: calc(100vw - 32px); display: grid; gap: 8px; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 16px 40px -12px var(--shade-a80); color: var(--text); box-sizing: border-box; }
.ht-parts.ht-parts-up { transform: translateY(-100%); }
.ht-parts-h { font: 700 13px/1.2 var(--font-ui); }
.ht-parts-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0; padding: 0; list-style: none; }
.ht-parts-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 4ch; align-items: baseline; gap: 6px; padding: 5px 0; border-top: 1px solid var(--line); font-size: 12px; }
.ht-parts-k { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ht-parts-at, .ht-parts-w { color: var(--muted); white-space: nowrap; }
.ht-parts-add { text-align: right; font-variant-numeric: tabular-nums; }
.ht-parts-note { margin: 0; }

/* ---------- updates 4 (docs/UPDATES-4.md section 2): the order "watching" (switch watchOrder) ----------
   The caution sits ABOVE the list while that order is on. It comes and goes only with the order, in the same refresh
   as the rows' slots, so the tap guard has started by then. (The link that stands in the pill's place: above.) */
.ht-caution { margin: 0; padding: 6px 10px; border-left: 3px solid var(--warn); border-radius: 6px; background: var(--warn-soft); color: var(--text); overflow-wrap: anywhere; }
.ht-caution[hidden] { display: none; }

/* ---------- updates 4 (docs/UPDATES-4.md section 4): loading that keeps its shape (switch skeletons) ----------
   The skeleton is a .ht-list of .ht-row frames (js/skeleton.js hotSkeleton), so every line keeps the fixed heights
   above at every width, and the first real row lands where the first skeleton row stood. The pill's place holds an
   invisible strut of the pill's height (44 px to a thumb, 34 px to a mouse from 560 px): no shape that looks like a pill. */
.ht-row.sk-row .ht-top .sk-line { height: 12px; }
.ht-row.sk-row .ht-l2 .sk-line { height: 9px; align-self: center; }
