/* ── .fl-gauge-* — shared gauge primitive (Liquidité & Flux, L1) ────────────
   Horizontal bar + moving marker. Sober palette (russet → amber → sage),
   NOT pricing green/red (reserved for directional figures). Reusable as the
   stress-o-meter (L2), the reservoir (L4), and — via --segments — the cockpit
   traffic-lights (L5). Placed at file end so it overrides nothing by accident. */
.fl-gauge { margin: 0; }
.fl-gauge-head {
  display: flex; align-items: baseline; gap: var(--s-2);
  margin-bottom: var(--s-2);
}
.fl-gauge-state {
  font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--text);
}
.fl-gauge-score {
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.fl-gauge-track {
  position: relative; height: 6px; border-radius: 3px;
  /* Adverse → favorable read as red → amber → green (lecture instantanée). */
  background: linear-gradient(90deg, #c0453d 0%, #c2913f 50%, #3f9e5a 100%);
}
.fl-gauge-marker {
  position: absolute; top: -4px; width: 3px; height: 14px;
  border-radius: 2px; background: var(--text);
  box-shadow: 0 0 0 2px var(--panel);
  transform: translateX(-50%);
  transition: left .4s ease;
}
.fl-gauge-zones {
  display: flex; justify-content: space-between;
  margin-top: var(--s-2);
  font-size: 9px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--dim);
}
/* Segment variant (cockpit traffic-lights, L5) */
.fl-gauge--segments .fl-gauge-track { background: none; display: flex; gap: 4px; height: 14px; }
.fl-gauge--segments .fl-gauge-cell {
  flex: 1; border-radius: var(--r-sm); background: var(--elevated);
}
.fl-gauge--segments .fl-gauge-cell.is-on { background: #3f8a7a; }

/* ── ① La Marée — panel chrome (Liquidité & Flux, L1) ──────────────────────
   Reuses the dashboard's existing conventions: the .comp-period-bar chip
   selector, the themed slider, fl-card-style detail rows. All on :root tokens,
   color-mix for tints (no rgba literals). Placed at file end. */

/* the title-question, sat just under the header */
.panel-question {
  padding: var(--s-3) var(--s-4) 0;
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
  letter-spacing: .01em;
}

/* asset selector — segmented chip bar (mirrors .comp-period-bar) */
.maree-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: var(--s-2) var(--s-4) var(--s-1);
}
.maree-seg-btn {
  padding: 3px 10px;
  font-size: 12px;
  font-family: var(--font-sans);
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: background .15s, color .15s;
  user-select: none;
}
.maree-seg-btn:hover {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
}
.maree-seg-active {
  background: var(--accent) !important;
  color: #0a0a0a !important;
  font-weight: 600;
}

/* the overlay chart */
.maree-overlay {
  width: 100%;
  height: 200px;
  flex-shrink: 0;
}

/* lag slider row */
.maree-lag-row {
  padding: var(--s-1) var(--s-4) var(--s-2);
}
.maree-lag-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2px;
}
.maree-lag-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--dim);
}
.maree-lag-value {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
/* recolour the dcc.Slider (rc-slider) to the app accent, slimmer profile */
.maree-lag-row .rc-slider { padding: 5px 0; }
.maree-lag-row .rc-slider-rail { background: var(--border); height: 3px; }
.maree-lag-row .rc-slider-track { background: var(--accent); height: 3px; }
.maree-lag-row .rc-slider-handle {
  width: 12px; height: 12px; margin-top: -5px;
  background: var(--accent); border: 2px solid var(--panel);
  opacity: 1; box-shadow: none;
}
.maree-lag-row .rc-slider-handle:hover,
.maree-lag-row .rc-slider-handle:active,
.maree-lag-row .rc-slider-handle-click-focused:focus {
  border-color: var(--panel);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
}
.maree-lag-row .rc-slider-dot { display: none; }

/* the answer block: gauge + plain-French verdict, set apart by a soft rule */
.maree-answer {
  padding: var(--s-3) var(--s-4) var(--s-2);
  border-top: 1px solid var(--border);
}
.maree-verdict { margin-top: var(--s-3); }
.maree-verdict-main {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
.maree-verdict-frein {
  margin-top: var(--s-1);
  font-size: 11px;
  color: var(--muted);
}

/* numeric breakdown — fl-card-style rows */
.maree-detail {
  padding: 0 var(--s-4) var(--s-3);
}
.maree-d-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--dim);
  padding: var(--s-3) 0 var(--s-1);
  border-top: 1px solid var(--border);
}
.maree-d-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
}
.maree-d-row:last-child { border-bottom: none; }
.maree-d-lab {
  font-size: 12px;
  color: var(--muted);
}
.maree-d-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* score info bubble — hover/focus popover explaining the score (opens upward
   so the panel's overflow:hidden never clips it) */
.maree-info {
  position: relative;
  margin-left: 5px;
  color: var(--dim);
  font-size: 12px;
  line-height: 1;
  cursor: help;
  user-select: none;
}
.maree-info:hover,
.maree-info:focus { color: var(--muted); outline: none; }
.maree-info-pop {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 50;
  width: 260px;
  padding: var(--s-3);
  background: var(--elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px color-mix(in srgb, #000 55%, transparent);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity .14s ease, transform .14s ease, visibility .14s;
}
.maree-info:hover .maree-info-pop,
.maree-info:focus .maree-info-pop,
.maree-info:focus-within .maree-info-pop {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.maree-info-title {
  font-size: 11px; font-weight: 600; color: var(--text);
  letter-spacing: .02em; margin-bottom: 4px;
}
.maree-info-lead { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.maree-info-list { margin: 0 0 6px; padding-left: 16px; }
.maree-info-list li { font-size: 11px; color: var(--muted); line-height: 1.5; }
.maree-info-bands {
  font-size: 10px; color: var(--dim);
  font-family: var(--font-mono);
  padding-top: 6px; border-top: 1px solid var(--border);
}

/* ── ② La Plomberie — panel chrome (Liquidité & Flux, L2) ──────────────────
   Reuses the .fl-gauge-* primitive (hero variant + ticks), a NEUTRAL verdict
   band (no teal), and aligned sensor rows. :root tokens; color-mix for tints
   (no rgba literals). Severity hex (#c0453d/#c2913f/#3f9e5a) matches the
   existing .fl-gauge-track gradient. Placed at file end (cascade). */

/* hero gauge card */
.plomberie-hero {
  margin: var(--s-3) var(--s-4);
  padding: var(--s-4) var(--s-4) var(--s-3);
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 3%, transparent);
}
/* hero variant of the shared gauge: bigger state, thicker track, ticks */
.fl-gauge--hero .fl-gauge-state { font-size: 21px; }
.fl-gauge--hero .fl-gauge-track {
  height: 9px; border-radius: 5px;
  box-shadow: inset 0 1px 2px color-mix(in srgb, #000000 40%, transparent);
}
.fl-gauge--hero .fl-gauge-marker {
  top: -4px; height: 17px;
  box-shadow: 0 0 0 2px var(--elevated);
}
.fl-gauge-ticks { position: relative; height: 7px; margin-top: 2px; }
.fl-gauge-ticks i {
  position: absolute; top: 0; width: 1px; height: 4px;
  background: var(--border-strong); transform: translateX(-50%);
}

/* verdict band — neutral grey left rule on an elevated fill */
.plomberie-band {
  margin: 0 var(--s-4) var(--s-2);
  padding: var(--s-3);
  background: var(--elevated);
  border: 1px solid var(--border);
  border-left: 2px solid var(--muted);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.plomberie-verdict { font-size: 13px; line-height: 1.55; color: var(--text); }
.plomberie-frein { margin-top: var(--s-2); font-size: 11px; color: var(--muted); }
.plomberie-frein:empty { display: none; }

/* sensors */
.plomberie-sec {
  margin: var(--s-4) var(--s-4) var(--s-2);
  font-size: 9px; letter-spacing: .10em; text-transform: uppercase; color: var(--dim);
}
.plomberie-sensor {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-2) var(--s-4);
  border-top: 1px solid var(--border);
}
.plomberie-sensor:last-of-type { border-bottom: 1px solid var(--border); }
.plomberie-slab { width: 150px; flex: none; font-size: 12px; color: var(--text); }
.plomberie-mini {
  flex: 1; position: relative; height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, #c0453d 0%, #c2913f 50%, #3f9e5a 100%);
}
.plomberie-mini.is-na {
  background: var(--elevated); border: 1px solid var(--border);
}
.plomberie-sval {
  width: 76px; flex: none; text-align: right;
  font-family: var(--font-mono); font-size: 12px; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.plomberie-tag { width: 64px; flex: none; text-align: right; font-size: 10px; letter-spacing: .04em; }
.plomberie-tag.t-ok  { color: #3f9e5a; }
.plomberie-tag.t-mid { color: #c2913f; }
.plomberie-tag.t-bad { color: #c0453d; }
/* per-sensor ⓘ info-bubble (mirrors the .maree-info pattern; opens upward) */
.plomberie-info {
  position: relative; margin-left: 5px;
  color: var(--dim); font-size: 11px; line-height: 1;
  cursor: help; user-select: none;
}
.plomberie-info:hover, .plomberie-info:focus { color: var(--muted); outline: none; }
.plomberie-info-pop {
  position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 50;
  width: 260px; padding: var(--s-3);
  background: var(--elevated); border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px color-mix(in srgb, #000000 55%, transparent);
  opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity .14s ease, transform .14s ease, visibility .14s;
}
.plomberie-info:hover .plomberie-info-pop,
.plomberie-info:focus .plomberie-info-pop,
.plomberie-info:focus-within .plomberie-info-pop {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.plomberie-info-title {
  font-size: 11px; font-weight: 600; color: var(--text);
  letter-spacing: .02em; margin-bottom: 4px;
}
.plomberie-info-lead { font-size: 11px; color: var(--muted); line-height: 1.5; margin-bottom: 6px; }
.plomberie-info-read {
  font-size: 10px; color: var(--dim); line-height: 1.5;
  padding-top: 6px; border-top: 1px solid var(--border);
}

/* ── ③ Les Flux — panel chrome (Liquidité & Flux, L3) ──────────────────────
   Rotation map: synthesis gauge (.fl-gauge--hero, reused) + a banded
   Défensif|Cyclique heatmap grid + factor/region pairs + neutral verdict band
   + the Howell sequence ribbon (.fl-gauge--segments, reused). Cell tint is
   data-driven and injected INLINE from Python (style.css stays rgba-free).
   :root tokens + color-mix only. Placed at file end (cascade). */

/* horizon selector — mirrors .maree-seg */
.flux-seg { display: flex; gap: 6px; padding: var(--s-2) var(--s-4) var(--s-1); }
.flux-seg-btn {
  padding: 3px 12px; font-size: 12px; color: var(--muted);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  cursor: pointer; user-select: none;
}
.flux-seg-btn:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.flux-seg-active { background: var(--accent) !important; color: #0a0a0a !important; border-color: var(--accent) !important; }

/* hero card */
.flux-hero {
  margin: var(--s-3) var(--s-4);
  padding: var(--s-4) var(--s-4) var(--s-3);
  background: var(--elevated); border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

/* grid (Défensif | Cyclique) */
.flux-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin-top: var(--s-4); }
.flux-col { min-width: 0; }
.flux-band-h { font-size: 9px; letter-spacing: .07em; text-transform: uppercase; color: var(--dim); margin: 0 0 var(--s-1) 2px; }
.flux-band-h--wide { margin-top: var(--s-3); }
.flux-cell {
  display: flex; align-items: center; gap: var(--s-2);
  padding: 5px 9px; margin-bottom: 3px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
}
.flux-lab { font-size: 11px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.flux-tk { margin-left: 5px; color: var(--dim); font-family: var(--font-mono); font-size: 9.5px; }
.flux-num { font-family: var(--font-mono); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.flux-car { width: 10px; text-align: center; color: var(--muted); font-size: 10px; flex: none; }

/* factor/region pairs */
.flux-pair {
  display: flex; align-items: center; gap: var(--s-2);
  padding: 5px 9px; margin-bottom: 3px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
}
.flux-pair-lab { flex: 1; font-size: 11px; color: var(--text); }

/* verdict band — neutral grey left rule on an elevated fill */
.flux-band {
  margin: 0 var(--s-4) var(--s-2);
  padding: var(--s-3);
  background: var(--elevated); border: 1px solid var(--border);
  border-left: 2px solid var(--muted); border-radius: 0 var(--r-md) var(--r-md) 0;
}
.flux-verdict { font-size: 13px; line-height: 1.55; color: var(--text); }
.flux-frein { margin-top: var(--s-2); font-size: 11px; color: var(--muted); }
.flux-frein:empty { display: none; }

/* sequence ribbon (reuses .fl-gauge--segments) */
.flux-seq { margin: var(--s-3) var(--s-4) var(--s-2); }
.flux-seq-label { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin-bottom: 5px; }
.flux-seq .fl-gauge-track { height: auto; }
.flux-seq .fl-gauge-cell { font-size: 10.5px; text-align: center; padding: 4px 0; color: var(--dim); }
.flux-seq .fl-gauge-cell.is-on { color: var(--text); }
.flux-seq-active { box-shadow: inset 0 0 0 1px var(--accent); }
.flux-seq-cap { margin-top: 5px; font-family: var(--font-mono); font-size: 10px; color: var(--muted); }

.flux-foot { padding: var(--s-2) var(--s-4) var(--s-3); font-size: 9px; color: var(--dim); font-family: var(--font-mono); }

/* ── ④ Le Consensus — panel chrome + history-band primitive (L&F, L4) ───────
   Contrarian "reservoir": two history bands (NOT a 4th .fl-gauge), a text
   synthesis line, a neutral verdict band, detail rows. Severity hex
   (#c0453d/#c2913f/#3f9e5a) injected INLINE from modules/consensus.py
   (style.css stays rgba-free). :root tokens + color-mix only. File end. */

/* synthesis line (text only — light, no graphic) */
.cons-syn { display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-4) var(--s-1); }
.cons-syn-state { font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.cons-syn-sep { width: 1px; height: 11px; background: var(--border-strong); }
.cons-syn-score { font-family: var(--font-mono); font-size: 11px; color: var(--muted);
  font-variant-numeric: tabular-nums; }
.cons-syn-score .lab { color: var(--dim); font-size: 10px; letter-spacing: .4px; margin-right: 4px; }
.cons-syn-spacer { flex: 1; }

/* hero card holding the two bands */
.cons-hero { margin: var(--s-2) var(--s-4) var(--s-3); padding: var(--s-4);
  background: var(--elevated); border: 1px solid var(--border); border-radius: var(--r-lg); }

/* one history band */
.cons-band + .cons-band { margin-top: var(--s-4); }
.cons-band-top { display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: var(--s-2); gap: var(--s-2); }
.cons-band-name { font-size: 11px; font-weight: 600; color: var(--text); letter-spacing: .2px; }
.cons-band-name .tk { color: var(--dim); font-weight: 400; font-family: var(--font-mono);
  font-size: 10px; margin-left: 6px; }
.cons-band-pct { font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.cons-band-pct .ord { font-size: 9px; vertical-align: super; }
.cons-band-pct .lab { font-size: 9px; letter-spacing: .5px; text-transform: uppercase;
  color: var(--dim); margin-left: 6px; }
.cons-band-fig { width: 100%; }
.cons-band-axis { display: flex; justify-content: space-between; margin-top: var(--s-1);
  font-size: 9px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }

/* neutral verdict band (mirrors .plomberie-band) */
.cons-band-verdict { margin: 0 var(--s-4) var(--s-2); padding: var(--s-3);
  background: var(--elevated); border: 1px solid var(--border);
  border-left: 2px solid var(--muted); border-radius: 0 var(--r-md) var(--r-md) 0; }
.cons-verdict { font-size: 13px; line-height: 1.55; color: var(--text); }
.cons-frein { margin-top: var(--s-2); font-size: 11px; color: var(--muted); }
.cons-frein:empty { display: none; }

/* detail rows (mirror .maree-d-row) */
.cons-detail { padding: 0 var(--s-4) var(--s-3); }
.cons-d-row { display: flex; align-items: baseline; justify-content: space-between;
  padding: 6px 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
.cons-d-row:last-child { border-bottom: none; }
.cons-d-row.sub .cons-d-lab { padding-left: var(--s-3); color: var(--dim); }
.cons-d-lab { font-size: 12px; color: var(--muted); }
.cons-d-val { font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums;
  color: var(--text); }
.cons-foot { padding: 0 var(--s-4) var(--s-3); font-size: 10px; color: var(--dim); }
