/* ============================================================
   Alpha Finance terminal: the Overview page (/terminal/)

   Only what the overview adds on top of the desk's panel language in
   alpha.css and the .ov rules in terminal.css: the pulse strip, the
   section heads, and the small in-panel layouts (gauges, the long/short
   columns, exchange flows, prediction rows, news columns).
   ============================================================ */

/* ---------- pulse strip ----------
   Six chips, each with a label, the number, a note, and a small graphic of
   the series behind the number (a sparkline, columns, a split bar, a zone
   scale, the New York day). The accent --a is set by the script from the
   reading itself, a zone colour or green and red by sign, and colours only
   the number. */

.ov-pulse { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 0 0 10px; }
.pulse {
  --a: var(--text);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "label viz" "value viz" "sub sub";
  align-items: center;
  column-gap: 10px;
  row-gap: 3px;
  min-width: 0;
  padding: 9px 12px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s;
}
.pulse:hover { border-color: var(--line-2); background: var(--panel-2, var(--panel)); }
.pulse .pl {   /* site.css has a .pl of its own (the partner logos): restate the alignment */
  grid-area: label;
  display: flex; align-items: center; justify-content: flex-start; gap: 6px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pulse .pl i { display: inline-flex; flex: none; color: var(--muted); }
.pulse .pl i svg { width: 12px; height: 12px; display: block; }
.pulse .pv {
  grid-area: value;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--a);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pulse .pv .up, .pulse .pv .down, .pulse .pv span { color: inherit; }
.pulse .pg { grid-area: viz; display: block; width: 64px; height: 28px; align-self: center; }
.pulse .pg svg { display: block; }
.pulse .pg:empty { width: 0; }
.pulse .ps {
  grid-area: sub;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pulse .ps .up { color: var(--pos-text); }
.pulse .ps .down { color: var(--neg-text); }

/* ---------- the top: map and stock perps left, the wires the full height right ---------- */

.ov-top {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 10px;
  margin: 0 0 6px;
}
.ov-top .ov-prices { grid-column: 1; grid-row: 1; }
.ov-top .heromap { grid-column: 1; grid-row: 2; }
.ov-top .ov-rwap { grid-column: 1; grid-row: 3; }
/* the feed takes the height the left column sets, and scrolls inside it */
.ov-feedwrap { grid-column: 2; grid-row: 1 / 4; position: relative; min-height: 420px; }
.ov-prices .panel-body { padding: 10px 12px; }
.panel-head .ph-seg { margin-left: auto; }
.panel-head .ph-seg + .view { margin-left: 14px; }
.panel-head .ph-seg button { height: 22px; padding: 0 8px; font-size: 10px; }
.ov-feed { position: absolute; inset: 0; display: flex; flex-direction: column; }
.ov-feed .panel-body { flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 4px 10px 6px; scrollbar-width: thin; }
body.term .ov .heromap .panel-body.is-map { height: 300px; }
.ov-rwap .panel-body.is-map { height: 256px; }
.ov-rpmap { position: absolute; inset: 10px 12px 8px; display: block; margin: 0; min-height: 0; flex: none; text-decoration: none; }
.ov-rpmap .rp-tile, .ov-rpmap .rp-grp { pointer-events: none; }  /* one target: the panel opens the page */
.ov-rpmap .rp-tile { pointer-events: auto; cursor: pointer; }
.ov-rpmap .ov-none { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.panel-head .ph-note { margin-left: auto; font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; }
.panel-head .ph-note + .view { margin-left: 14px; }
.panel-head .ph-note .up { color: var(--pos-text); }
.ov-ramp { display: inline-block; vertical-align: middle; width: 54px; height: 5px; margin-right: 7px; border-radius: 3px; background: linear-gradient(90deg, rgb(204, 78, 60), rgb(30, 35, 42) 50%, rgb(27, 140, 116)); }

/* six rows fit the same 208px body as five: a little less air per row */
.ov-tight .mini-row { padding: 4.5px 0; }
.mini-v .up, .mini-v .down { font-style: normal; }
/* a quiet single line for a feed that did not answer */
.ov-none {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  padding: 14px 0;
}

/* ---------- gauges (fear & greed, MVRV, Mayer) ---------- */

.ov-gauge { display: block; width: 150px; height: 96px; max-width: 100%; }
.ov-gauge-row { display: flex; align-items: center; gap: 18px; }
.ov-gauge-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gv {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.gz {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--text-2);
}
.ov-gauge-txt .gd { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.ov-gauge-txt .gd em { font-style: normal; color: var(--faint); margin-right: 6px; }
/* the seven-day strip under the fear & greed gauge: one column a day on a
   0 to 100 scale, coloured by zone, the weekday beneath */
.ov-week { margin-top: 14px; }
.ov-week-h {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.ov-week-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.ov-week-g span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ov-week-g span > i {
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 34px;
  border-radius: 3px;
  background: var(--bg-2);
  overflow: hidden;
}
.ov-week-g span > i > i { display: block; width: 100%; border-radius: 3px 3px 0 0; opacity: 0.85; }
.ov-week-g span b { font-weight: 500; color: var(--text-2); }
.ov-week-g span small { font-size: 9px; letter-spacing: 0.04em; color: var(--faint); }
.ov-week-g span.is-now b, .ov-week-g span.is-now small { color: var(--text); }
.ov-week-g span.is-now > i { outline: 1px solid var(--line-2); }
.ov-week-g span.is-now > i > i { opacity: 1; }

/* Bitcoin valuation: each reading on its zone scale, the number beside it */
.ov-macro { display: flex; flex-direction: column; justify-content: space-between; height: 100%; gap: 10px; }
.ov-zone {
  display: grid; grid-template-columns: 74px minmax(0, 1fr); grid-template-areas: "v k" "v b"; column-gap: 12px; row-gap: 7px; align-items: start;
  padding: 2px 0; color: inherit; text-decoration: none;
}
.ov-zone .zv { grid-area: v; font-family: var(--display); font-size: 28px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; align-self: center; }
.ov-zone .zk { grid-area: k; font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.2; }
.ov-zone .zk small { display: block; margin-top: 3px; font-family: var(--mono); font-size: 9.5px; font-weight: 400; letter-spacing: 0.03em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-zone:hover .zk { text-decoration: underline; text-underline-offset: 3px; }
.ov-zone .zb { grid-area: b; display: block; min-width: 0; }
.zb-track { position: relative; display: flex; gap: 2px; height: 8px; border-radius: 2px; overflow: visible; }
.zb-track i { display: block; height: 100%; border-radius: 2px; opacity: 0.35; }
.zb-track i.is-on { opacity: 1; }
.zb-track u { position: absolute; top: -4px; width: 3px; height: 16px; margin-left: -1.5px; border-radius: 1.5px; background: #eceef0; box-shadow: 0 0 0 1px var(--panel); }
.zb-labels { display: flex; gap: 2px; margin-top: 5px; }
.zb-labels em { display: block; font-style: normal; font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.04em; color: var(--faint); white-space: nowrap; overflow: hidden; }
.zb-labels em.is-on { color: var(--text-2); overflow: visible; }
.zb-labels em.is-hid { visibility: hidden; }
.zb-ends { display: flex; justify-content: space-between; margin-top: 2px; font-family: var(--mono); font-size: 8.5px; color: var(--faint); }

/* ---------- long/short: two columns of five ---------- */

.ov-lsr { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.ov-lsr .col-h {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 4px 0 7px;
  border-bottom: 1px solid var(--line);
}
.ov-lsr .col-h.is-l { color: var(--pos-text); }
.ov-lsr .col-h.is-s { color: var(--neg-text); }
.ov-lsr .row {
  display: grid;
  grid-template-columns: 46px 1fr 40px;
  align-items: center;
  gap: 8px;
  padding: 6.5px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.ov-lsr .row:last-child { border-bottom: 0; }
.ov-lsr .row b {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ov-lsr .row .bar { height: 6px; border-radius: 2px; background: color-mix(in srgb, var(--panel-2) 80%, transparent); overflow: hidden; }
.ov-lsr .row .bar i { display: block; height: 100%; min-width: 2px; background: var(--muted); }
.ov-lsr .is-l .row .bar i { background: var(--pos); }
.ov-lsr .is-s .row .bar i { background: var(--neg); }
.ov-lsr .row .v {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- exchange flows: a headline, then the four biggest moves ---------- */

.ov-exf .head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 2px 0 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2px;
}
.ov-exf .head b {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.ov-exf .head span { font-family: var(--mono); font-size: 10.5px; color: var(--text-2); }
.ov-exf .head .up, .ov-exf .head .down { font-style: normal; }

/* ---------- prediction markets: three rows ---------- */

.ov-pm { display: flex; flex-direction: column; overflow: hidden; }
.ov-pm .row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  grid-template-areas: "pic t m" "pic sub m";
  align-items: center;
  gap: 3px 10px;
  padding: 6px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  color: inherit;
  text-decoration: none;
}
.ov-pm .row:last-child { border-bottom: 0; }
.ov-pm .pic { grid-area: pic; width: 36px; height: 36px; border-radius: 6px; overflow: hidden; background: var(--panel-2); }
.ov-pm .pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ov-pm .pic.is-none { background: var(--panel-2); }
.ov-pm .t {
  grid-area: t;
  align-self: end;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ov-pm .row:hover .t { text-decoration: underline; text-underline-offset: 3px; }
.ov-pm .m {
  grid-area: m;
  text-align: right;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ov-pm .m small { display: block; font-family: var(--mono); font-size: 10px; font-weight: 400; margin-top: 3px; }
.ov-pm .sub {
  grid-area: sub;
  align-self: start;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ov-pm .cat {
  flex: none;
  padding: 1px 5px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
}

/* ---------- news: six headlines in two columns ---------- */

.ov-news { display: block; }
.ov-news .row {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 9px 6px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  border-radius: 5px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.12s;
}
.ov-news .row:last-child { border-bottom: 0; }
.ov-news .row:hover { background: var(--panel-2); }
.ov-news .pic { flex: none; width: 58px; height: 44px; border-radius: 4px; overflow: hidden; background: var(--panel-2); }
.ov-news .pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ov-news .pic.is-none { display: none; }
.ov-news .txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ov-news .ttl {
  font-size: 12.5px; font-weight: 500; line-height: 1.35; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ov-news .row:hover .ttl { text-decoration: underline; text-underline-offset: 3px; }
.ov-news .src { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-news .src b { font-weight: 500; color: var(--text-2); }

/* Section heads: the board never styled these on the desktop layout, so a
   22.5px heading sat 7px under the cards above it with its link stacked
   2px below. Same shape as .section-head elsewhere: title and link on one
   line, a clear break above, a tight bond to the cards underneath. */
.ov-sec {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin: 26px 0 10px;
}
.ov-sec a {
  margin-left: auto;
  font-size: 13px;
  font-weight: 500;
  color: var(--lime);
}
.ov-sec a:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 1400px) {
  .ov-pulse { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .ov-top { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .ov-top .ov-prices, .ov-top .heromap, .ov-top .ov-rwap, .ov-feedwrap { grid-column: 1; grid-row: auto; }
  .ov-feedwrap { min-height: 0; }
  .ov-feed { position: static; }
  .ov-feed .panel-body { flex: none; height: 380px; }
}
@media (max-width: 900px) {
  .ov-pulse { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-sec { margin: 18px 0 8px; }
}
/* phones: the figure gets the chip's full width, the little chart sits under the label's row end */
@media (max-width: 640px) {
  .ov-pulse { gap: 6px; }
  .pulse { grid-template-areas: "label viz" "value value" "sub sub"; padding: 9px 10px 8px; }
  .pulse .pg { width: 48px; height: 18px; }
  .pulse .pv { font-size: 19px; }
  .pulse .ps { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* panel heads: the title on one line, the live badge gives way to the controls */
  body.term .ov .panel-head { gap: 8px; }
  body.term .ov .panel-head h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  body.term .ov .panel-head .badge { display: none; }
  body.term .ov .panel-head .seg { width: auto; margin-left: auto; }
  body.term .ov .panel-head .seg button { min-height: 30px; padding-left: 9px; padding-right: 9px; }
}

/* a coin with no logo in the set: a mono initial in the same 16px box */
.mini-n .tt-ic.is-mono { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-right: 7px; vertical-align: -3.5px; border-radius: 50%; background: var(--panel-2, rgba(255,255,255,0.06)); font-family: var(--mono); font-size: 9px; color: var(--muted); }
.mini-n b { font-weight: 600; }
