/* v37.110 (Jim: "overlap. ur QA shud have caught this") — when the rail is collapsed the floating
   "☰ Tools" reopen button (fixed top:56 left:8, right-edge ~75px) sat ON TOP of the macro strip
   (MACRO label + first tile). Shift the macro row right when collapsed so nothing overlaps.
   !important is REQUIRED: #v33-macro-row carries an inline `padding:6px 16px 8px`, and an inline
   longhand beats an external rule without it — that's exactly why the first attempt (no !important)
   read padding-left:16px and still collided. Clears the 75px chip by 33px. */
body.rail-collapsed #v33-macro-row { padding-left: 108px !important; }
.mv-spark-unavailable { display: block; font-size: 10px; font-weight: normal; color: #9ca3af; margin-top: 3px; }
/* v33.6: the compact 5-tile strip IS the default. The full mv-panel is
   hidden by default; click "+ 40 more" to expand. */
#v33-macro-row { display: flex !important; background-color: #060608; }
#v33-macro-mount { display: none; box-sizing: border-box; background-color: #0d1117; color: #eef2f8; overscroll-behavior: contain; }
#v33-macro-toggle-btn { background-color: #18212d; color: #eef2f8; border: 1px solid #657184; }
#v33-macro-mount.is-expanded { display: block; }
#v33-macro-mount .mv-panel { margin-bottom: 0 !important; display: block !important; }
#v33-macro-row > div#v33-macro-tiles { grid-template-columns: repeat(5, minmax(0,1fr)); }
  /* v29.27.63 — Market valuation tile row (Verdicts tab, above Engine Watch) */
  .mv-panel {
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(245,158,11,0.04), rgba(223,187,100,0.04));
    border: 1px solid rgba(245,158,11,0.20);
    border-radius: 8px;
    animation: mvFadeIn 280ms ease-out;
  }
  .mv-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
  @media (max-width: 900px) {
    #mv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mv-header { flex-wrap: wrap; }
  }
  @media (max-width: 590px) {
    #mv-grid { grid-template-columns: minmax(0, 1fr); }
    .mv-header { flex-direction: column; }
  }
  .mv-title { font-size: 12.5px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text); }
  .mv-sub { font-size: 14px; color: var(--text); margin-top: 4px; max-width: 900px; line-height: 1.5; }
  .mv-refresh {
    background: transparent; border: 1px solid var(--border); color: var(--text2);
    padding: 4px 10px; border-radius: 5px; font-size: 12px; cursor: pointer;
    transition: color 140ms ease, border-color 140ms ease;
  }
  .mv-refresh:hover { color: var(--text); border-color: var(--border2); }
  /* v29.30: 5-column grid. Tiles enforce equal heights via `min-height:96px`
     + flex layout (see .mv-tile below). The old `grid-auto-rows: 1fr` caused
     the "giant gap" — it forced the toggle-pill row to be 118px tall even
     though the pill is 24px. Switched to `grid-auto-rows: min-content` so
     non-tile rows (toggle row) collapse to their content height. */
  .mv-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-rows: min-content;
    gap: 8px;
    align-items: stretch;
  }
  .mv-tile {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 9px 12px;
    transition: border-color 140ms ease, transform 100ms ease;
    /* v37.35 (Jim: "for Macro panels no need to click … get rid of click"). Tiles reveal on
       HOVER now, not click — the help cursor signals "hover for detail", not a clickable control. */
    cursor: help;
    min-width: 0;  /* allow grid cells to shrink */
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* v29.30: enforce predictable row height so all tiles align even
       when one of them contains an SVG sparkline. The fixed min-height
       leaves room for: label + value + (optional sparkline) + sub + band. */
    min-height: 96px;
  }
  .mv-tile:hover { border-color: var(--border2); transform: translateY(-1px); }
  .mv-tile .lbl { font-size: 9.5px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--text2); }
  .mv-tile .val { font-size: 16px; font-weight: 700; color: var(--text); margin-top: 3px; font-variant-numeric: tabular-nums; }
  /* v34.40 Ultracode MACRO-1 (P1): the L2/L3/L4 circuit-breaker tile shows the
     most actionable token (leverage cap, "Kill spec sleeve") in `.sub` but was
     nowrap-ellipsis at ~140px width — the truncated "Kill s..." stripped the
     master risk dial's most useful text. Wrap to 2 lines instead. */
  .mv-tile .sub { font-size: 10.5px; color: var(--text2); margin-top: 2px; line-height: 1.3; word-break: break-word; }
  .mv-tile .band { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 9.5px; font-weight: 700; letter-spacing: 0.3px; margin-top: 4px; }
  /* Click-to-expand details */
  .mv-tile::after {
    content: 'ⓘ'; position: absolute; top: 6px; right: 8px;
    font-size: 10px; color: var(--text-3); opacity: 0; transition: opacity 140ms;
  }
  .mv-tile:hover::after { opacity: 0.7; }
  /* v29.30: compact toggle — was a full-row block that left a "huge bar"
     gap visually separating the panel from the next section. Now it's a
     small inline pill that floats at the bottom-right of the grid. */
  .mv-toggle-row {
    display: inline-flex; align-items: center; gap: 6px;
    justify-self: end; align-self: end;
    margin-top: 4px; padding: 4px 10px;
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: 999px; cursor: pointer;
    font-size: 10.5px; color: var(--text2);
    transition: color 140ms, border-color 140ms;
    /* Don't span all columns — float at the end of the row */
    grid-column: -3 / -1 !important;
    justify-content: flex-end;
    min-height: 0;
    width: fit-content;
    margin-left: auto;
  }
  .mv-toggle-row:hover { color: var(--text); border-color: var(--border2); }
  .mv-toggle-row::after { content: '▾'; font-size: 9px; transition: transform 140ms; }
  .mv-toggle-row.expanded::after { transform: rotate(180deg); }
  /* Hidden tiles slide in via simple opacity */
  .mv-tile.hidden-extra { display: none; }
  .mv-tile.hidden-extra.show { display: block; animation: mvFadeIn 220ms ease-out; }
  /* v33.14 #3 -- when the macro panel is relocated into v33-macro-mount (the
     "+ 40 more" expansion), force ALL tiles visible and hide the inner
     "Show N more macro signals" toggle. CSS wins regardless of when
     refreshMacroValuation re-paints the grid, unlike my v33.12 JS retries
     which kept losing the race. */
  #v33-macro-mount .mv-tile.hidden-extra { display: block !important; }
  #v33-macro-mount .mv-toggle-row,
  #v33-macro-mount .mv-expand-toggle { display: none !important; }
  /* v29.29: legacy 3-level band classes — kept for backward-compat on the
     commodities strip and any other non-macro panel that hasn't migrated. */
  .mv-tile .band.over     { background: rgba(191,146,154,0.14);  color: #fca5a5; border: 1px solid rgba(191,146,154,0.35); }
  .mv-tile .band.fair     { background: rgba(223,187,100,0.10); color: #e7c877; border: 1px solid rgba(223,187,100,0.30); }
  .mv-tile .band.under    { background: rgba(143,173,157,0.10);  color: #a4bdb0; border: 1px solid rgba(143,173,157,0.30); }

  /* v29.29: 7-LEVEL SYMMETRIC EQUITY-IMPACT SPECTRUM.
     3 bearish + 1 neutral + 3 bullish — diverging palette per the user's
     "red orange yellow — neutral — then going to green" with symmetric
     mirror on the bullish side.
     Levels (worst → best):
       very-bearish     → red       (severe — recession, crash, L3 CB, RED stress)
       bearish          → orange    (meaningful — TIGHT liq, FEAR vix, ORANGE stress)
       slightly-bearish → yellow    (mild — VERY RICH P/E, strong $, YELLOW stress)
       neutral          → gray      (no signal)
       slightly-bullish → yellow-grn(mild — slight tailwinds)
       bullish          → green     (clear — EASING liq, COMPLACENT vix, GREEN stress)
       very-bullish     → deep green(severe positive — L0 CB w/ all signals firing) */
  /* v36.75 (Jim: "macro panels ... what does Semi Leadership +11.1 even mean. is that
     good or bad ... at a glance must make sense — bullish or bearish"). The verdict chip
     was a tiny 14px arrow — easy to miss. It is now an explicit BULLISH / BEARISH /
     NEUTRAL word pill, top-right of every macro tile. The WORD is driven by the eq-class
     via ::after (below) so it stays correct when async tile updates swap the class. */
  .mv-tile .eq-impact {
    position: absolute; top: 6px; right: 6px;
    padding: 1px 6px; border-radius: 4px;
    border: 1px solid transparent;
    display: inline-flex; align-items: center;
    font-size: 8.5px; font-weight: 800; letter-spacing: 0.3px;
    pointer-events: none; z-index: 1; white-space: nowrap;
  }
  .mv-tile .eq-impact::after { content: "NEUTRAL"; }
  .mv-tile .eq-impact.eq-very-bullish::after,
  .mv-tile .eq-impact.eq-bullish::after,
  .mv-tile .eq-impact.eq-slightly-bullish::after { content: "\25B2 BULLISH"; }
  .mv-tile .eq-impact.eq-neutral::after { content: "NEUTRAL"; }
  .mv-tile .eq-impact.eq-very-bearish::after,
  .mv-tile .eq-impact.eq-bearish::after,
  .mv-tile .eq-impact.eq-slightly-bearish::after { content: "\25BC BEARISH"; }
  /* keep the tile label clear of the wider verdict pill */
  .mv-tile .lbl { padding-right: 58px; }
  .mv-tile .eq-impact.eq-very-bearish    { background: #bf929a; color: #ffffff; border-color: rgba(0,0,0,0.25); }
  .mv-tile .eq-impact.eq-bearish         { background: #f97316; color: #ffffff; border-color: rgba(0,0,0,0.20); }
  .mv-tile .eq-impact.eq-slightly-bearish{ background: #eab308; color: #1f1f1f; border-color: rgba(0,0,0,0.20); }
  .mv-tile .eq-impact.eq-neutral         { background: #94a3b8; color: #ffffff; border-color: rgba(0,0,0,0.15); }
  .mv-tile .eq-impact.eq-slightly-bullish{ background: #a9b583; color: #1f1f1f; border-color: rgba(0,0,0,0.18); }
  .mv-tile .eq-impact.eq-bullish         { background: #8fad9d; color: #ffffff; border-color: rgba(0,0,0,0.20); }
  .mv-tile .eq-impact.eq-very-bullish    { background: #15803d; color: #ffffff; border-color: rgba(0,0,0,0.25); }

  /* Left-edge color stripe — peripheral-vision signal at full tile height */
  .mv-tile.mv-eq-very-bearish     { box-shadow: inset 3px 0 0 #bf929a; }
  .mv-tile.mv-eq-bearish          { box-shadow: inset 3px 0 0 #f97316; }
  .mv-tile.mv-eq-slightly-bearish { box-shadow: inset 3px 0 0 #eab308; }
  .mv-tile.mv-eq-neutral          { box-shadow: inset 3px 0 0 #94a3b8; }
  .mv-tile.mv-eq-slightly-bullish { box-shadow: inset 3px 0 0 #a9b583; }
  .mv-tile.mv-eq-bullish          { box-shadow: inset 3px 0 0 #8fad9d; }
  .mv-tile.mv-eq-very-bullish     { box-shadow: inset 3px 0 0 #15803d; }

  /* Band uses the SAME spectrum class so the regime tag (e.g. "INVERTED",
     "BOOMING", "FEAR") visually matches the chip + stripe. One color tells
     the whole story per tile. */
  .mv-tile .band.eq-very-bearish    { background: rgba(191,146,154,0.20);  color: #fecaca; border: 1px solid rgba(191,146,154,0.55); }
  .mv-tile .band.eq-bearish         { background: rgba(249,115,22,0.18); color: #fed7aa; border: 1px solid rgba(249,115,22,0.50); }
  .mv-tile .band.eq-slightly-bearish{ background: rgba(234,179,8,0.18);  color: #fde68a; border: 1px solid rgba(234,179,8,0.50); }
  .mv-tile .band.eq-neutral         { background: rgba(148,163,184,0.14); color: #cbd5e1; border: 1px solid rgba(148,163,184,0.35); }
  .mv-tile .band.eq-slightly-bullish{ background: rgba(190,242,100,0.18); color: #d9f99d; border: 1px solid rgba(190,242,100,0.50); }
  .mv-tile .band.eq-bullish         { background: rgba(143,173,157,0.18);  color: #a4bdb0; border: 1px solid rgba(143,173,157,0.45); }
  .mv-tile .band.eq-very-bullish    { background: rgba(21,128,61,0.30);  color: #bbf7d0; border: 1px solid rgba(21,128,61,0.60); }

  /* Pad the label so it doesn't slide under the eq chip (5-col grid is tight).
     v29.29: shrunk chip from ~80px to 14px so this padding is now minimal. */
  .mv-tile .lbl { padding-right: 22px; }
  /* Move the hover ⓘ indicator down so it doesn't collide with eq chip */
  .mv-tile::after { top: 24px; right: 8px; }
  @keyframes mvFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
  /* Floating popover (anchored to trigger, follows scroll) — for global info icons */
  .popover-float {
    /* v36.75 (Jim: "theme heat, intraday flow.. user click on panel and panel does
       nothing"). ROOT CAUSE: these tools open as a z-index:9999 popup, but this popover
       was z-index:200 + position:absolute — so clicking a heat cell DID fire, but the
       popover rendered BEHIND the popup (invisible) = "does nothing". Fixed: float ABOVE
       the popup, viewport-anchored. */
    position: fixed; z-index: 10010; min-width: 220px; max-width: 360px;
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: 8px; padding: 12px 14px;
    font-size: 12px; color: var(--text); line-height: 1.55;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  }
  .popover-float .head {
    font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-3); font-weight: 600; margin-bottom: 4px;
  }
  .popover-float .body { color: var(--text); }
  .popover-float .body p + p { margin-top: 6px; }

/* The donor's click-away backdrop under the floating macro panel
   (v33-core.js _v33MacroFullSetFloating): below the sticky strip (49) so its
   toggle stays pressable, below the floated panel (60), dimming the page. */
.regal-macro-backdrop { position: fixed; inset: 0; z-index: 47; background: rgba(5,9,18,0.45); }
