/* ============================================================================================
   VOLURR — SOVEREIGN UI · V2-E · the LAB and CONSENSUS grammar
   (app/static/css/sovereign-lab.css — loads after sovereign-chart.css; tokens only)
   ============================================================================================
   The Lab is not chat. It is a sealed process with named phases, and its numbers are the
   server's, printed beside the sample they came from (room-lab.js computes nothing). This file
   gives the surface the module renders (#lrLab) one grammar:
     · the phase as a caption with a state colour that means something (sealed → open → final)
     · counts as a numeric grid with their labels, never a lone number
     · the consensus as institutional bars with the denominator on the same line — no gauges
     · the analyst matrix as a table that reads at a glance
   Reveal is the only motion here: a revealed row rises in, once.                                */

#lrLab.lrlab{ position:relative; margin:var(--sv-4) 0; padding:var(--sv-5); border-radius:var(--sv-r-m);
  font:var(--sv-t-body); color:var(--sv-text-primary); background:var(--sv-surface-1); border:1px solid var(--sv-border-subtle); }

/* ── the phase ──────────────────────────────────────────────────────────────────────────── */
#lrLab .lrlab-hd{ display:flex; align-items:center; gap:var(--sv-4); margin-bottom:var(--sv-4); }
#lrLab .lrlab-state{ display:inline-flex; align-items:center; gap:6px; font:var(--sv-t-caption); letter-spacing:var(--sv-caption-track); text-transform:uppercase;
  padding:3px 8px; border-radius:var(--sv-r-pill); border:1px solid var(--sv-border-subtle); color:var(--sv-text-secondary); background:var(--sv-surface-2); }
#lrLab .lrlab-state::before{ content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
#lrLab .lrlab-state[data-state="DRAFT"]{ color:var(--sv-text-muted); }
#lrLab .lrlab-state[data-state="OPEN_COMMIT"]{ color:var(--sv-red); border-color:var(--sv-red-line); background:var(--sv-red-soft); }
#lrLab .lrlab-state[data-state="COMMIT_CLOSED"]{ color:var(--sv-warning); border-color:color-mix(in srgb, var(--sv-warning) 40%, transparent); background:var(--sv-warning-soft); }
#lrLab .lrlab-state[data-state="OPEN_REVEAL"]{ color:var(--sv-info); border-color:color-mix(in srgb, var(--sv-info) 40%, transparent); background:var(--sv-info-soft); }
#lrLab .lrlab-state[data-state="REVEAL_CLOSED"]{ color:var(--sv-text-secondary); }
#lrLab .lrlab-state[data-state="FINALIZED"]{ color:var(--sv-success); border-color:color-mix(in srgb, var(--sv-success) 40%, transparent); background:var(--sv-success-soft); }
/* sealed: the person's own analysis is committed and unreadable until reveal — say so quietly */
#lrLab .lrlab-mine{ display:inline-flex; align-items:center; gap:6px; font:var(--sv-t-meta); color:var(--sv-text-muted); }
#lrLab .lrlab-mine::before{ content:""; width:10px; height:12px; border:1.5px solid currentColor; border-radius:3px; border-top-width:4px; opacity:.8; }

/* ── counts with their labels: a numeric grid, not a sentence of numbers ────────────────── */
#lrLab .lrlab-counts{ display:grid; grid-template-columns:repeat(auto-fill, minmax(108px, 1fr)); gap:var(--sv-3); margin:var(--sv-4) 0; }
#lrLab .lrlab-c{ display:flex; flex-direction:column; gap:2px; padding:var(--sv-3) var(--sv-4); border-radius:var(--sv-r-s); background:var(--sv-surface-0); border:1px solid var(--sv-border-subtle); }
#lrLab .lrlab-c i{ font:var(--sv-t-caption); letter-spacing:var(--sv-caption-track); text-transform:uppercase; color:var(--sv-text-muted); font-style:normal; }
#lrLab .lrlab-c b{ font:var(--sv-t-financial); font-variant-numeric:tabular-nums; color:var(--sv-text-primary); }

/* ── notes: measured / not measured, never dressed as a result ─────────────────────────── */
#lrLab .lrlab-note{ font:var(--sv-t-secondary); color:var(--sv-text-secondary); padding:var(--sv-3) var(--sv-4); border-inline-start:2px solid var(--sv-border-subtle); margin:var(--sv-3) 0; }
#lrLab .lrlab-note.lrlab-pending{ color:var(--sv-text-muted); border-inline-start-color:var(--sv-warning); }

/* ── the result: consensus as bars with the denominator on the line ───────────────────── */
#lrLab .lrlab-result{ margin-top:var(--sv-5); padding-top:var(--sv-4); border-top:1px solid var(--sv-border-subtle); }
#lrLab .lrlab-rhd{ display:flex; align-items:baseline; gap:var(--sv-3); font:var(--sv-t-caption); letter-spacing:var(--sv-caption-track); text-transform:uppercase; color:var(--sv-text-muted); margin:var(--sv-4) 0 var(--sv-3); }
#lrLab .lrlab-rhd i{ font:var(--sv-t-numeric); font-style:normal; color:var(--sv-text-secondary); text-transform:none; letter-spacing:0; }
#lrLab .lrlab-bias{ display:flex; flex-direction:column; gap:var(--sv-2); }
#lrLab .lrlab-b{ position:relative; display:grid; grid-template-columns:96px 1fr 56px; align-items:center; gap:var(--sv-4); min-height:26px; font:var(--sv-t-secondary); }
#lrLab .lrlab-b i{ font-style:normal; color:var(--sv-text-secondary); text-transform:capitalize; }
#lrLab .lrlab-b b{ font:var(--sv-t-numeric); font-variant-numeric:tabular-nums; text-align:end; color:var(--sv-text-primary); }
/* the bar is the middle column: a hairline track and a fill whose length is the server's percentage (set by the module as --pct when present) */
#lrLab .lrlab-b::before{ content:""; grid-column:2; height:6px; border-radius:var(--sv-r-pill); background:var(--sv-surface-2); border:1px solid var(--sv-border-subtle); }
#lrLab .lrlab-b::after{ content:""; grid-column:2; grid-row:1; height:6px; border-radius:var(--sv-r-pill); background:var(--sv-text-secondary); width:var(--pct, 0%); margin-inline-start:1px; align-self:center; justify-self:start; }
#lrLab .lrlab-b[data-bias="bullish"]::after{ background:var(--up); }
#lrLab .lrlab-b[data-bias="bearish"]::after{ background:var(--down); }
#lrLab .lrlab-den{ font:var(--sv-t-meta); color:var(--sv-text-muted); margin-top:var(--sv-2); }

/* ── the analyst matrix ─────────────────────────────────────────────────────────────────── */
#lrLab .lrlab-matrix{ width:100%; border-collapse:collapse; font:var(--sv-t-secondary); margin-top:var(--sv-2); }
#lrLab .lrlab-matrix td{ padding:var(--sv-3) var(--sv-3); border-top:1px solid var(--sv-border-subtle); vertical-align:top; color:var(--sv-text-secondary); }
#lrLab .lrlab-matrix td.lrlab-who{ font:var(--sv-t-numeric); color:var(--sv-text-primary); white-space:nowrap; }
#lrLab .lrlab-matrix tr[data-revealed="true"] td{ color:var(--sv-text-primary); }
#lrLab .lrlab-matrix td:last-child{ text-align:end; }

/* ── reveal is a moment: the result rises in once; nothing pulses afterwards ───────────── */
@keyframes sv-reveal{ from{ opacity:0; transform:translateY(6px); } to{ opacity:1; transform:none; } }
#lrLab .lrlab-result{ animation:sv-reveal var(--sv-panel) var(--sv-ease) both; }
@media (prefers-reduced-motion:reduce){ #lrLab .lrlab-result{ animation:none; } }
