/* File-cabinet tab interactions */
.v33-cab-tab:hover { background: var(--bg) !important; opacity: 1 !important; }
.v33-cab-tab[data-active="true"] {
  /* v37.x (Jim) — active engine tab = FLAT faded-gold solid (no gradient / XP-3D) + flat gold underline. */
  background-color: #201a0e !important;
  background-image: none !important;
  opacity: 1 !important; color: var(--text) !important;
  box-shadow: 0 -3px 0 0 var(--blue) inset;
}
  /* ── ACTION BUTTONS ── */
  .actions { display: flex; flex-direction: column; gap: 10px; }

  .action-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg3);
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    font-family: inherit;
    width: 100%;
  }

  .action-btn:hover {
    border-color: var(--blue);
    background: rgba(223,187,100,0.06);
  }

  .action-btn:active { transform: scale(0.98); }

  .action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
  }

  /* v36.11 (Jim #1: "make all 4 Run Engine buttons the same DESIGN and same
     WIDTH" + "put the actual time on all Run Engine Buttons"). One shared shape
     for every engine-run button across all 3 tabs: identical fixed width, a row
     layout with the step-number + label on the left and the run-time pill pinned
     to the right. Overrides .action-btn's column flow + width:100%. */
  /* v36.72 (Jim: "ugly af, hate the colors" + "position doesnt go with TODAY'S
     RECOMMENDATION"). Dropped the translucent cyan wash + neon glow entirely. The
     run CTAs are now a CLEAN solid raised button — prominence comes from SIZE
     (332px / 13.5px / beefy padding) and a crisp border, not loud color. Neutral
     by default; final accent is Jim's pick (see AskUserQuestion). Markup also
     reverted so the section title leads and the buttons sit left-aligned after it.
     v36.11 "all 4 identical width + time pinned right" invariant preserved. */
  .run-engine-btn {
    flex: 0 0 332px !important;   /* fixed basis, never grow/shrink → all 4 identical width */
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    width: 332px !important;
    min-width: 332px !important;
    max-width: 332px !important;
    box-sizing: border-box;
    padding: 13px 18px !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: 9px !important;
    background: var(--card) !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.35) !important;
  }
  .run-engine-btn:hover {
    border-color: var(--blue) !important;
    background: #1c1810 !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.40) !important;
    transform: translateY(-1px);
  }
  .run-engine-btn .re-main { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 700; }
  .run-engine-btn .re-time { opacity: 0.7; font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0; }
  .run-engine-btn .es-stepn { width: 20px !important; height: 20px !important; font-size: 12px !important; }
  /* narrow screens: go full-width + stack so the 332px basis never overflows. */
  @media (max-width: 680px) {
    .run-engine-btn { flex: 1 1 100% !important; width: 100% !important; min-width: 0 !important; max-width: none !important; }
  }

  /* ===== v37.x — FLAT-SOLID fills (Jim 2026-07-13: the gradient sheens read as corny Windows-XP
     "faded 3D". Use a PLAIN FLAT solid — no gradients, no bevels, no inset glow, nothing corny). ===== */
  .run-engine-btn, .action-btn.btn-scan, .action-btn.btn-claude {
    background-color: #191922 !important;   /* flat, a touch above the bg — no gradient */
    background-image: none !important;
  }
  .run-engine-btn:hover, .action-btn.btn-scan:hover, .action-btn.btn-claude:hover {
    background-color: #22222d !important;
    background-image: none !important;
  }
  /* Step 1 (algorithmic engine) LEADS — a flat "faded gold" solid fill + gold border. */
  #btn-algo-rec, .action-btn.btn-scan {
    background-color: #241f12 !important;
    background-image: none !important;
    border-color: var(--accent) !important;
  }
  #btn-algo-rec:hover, .action-btn.btn-scan:hover {
    background-color: #2f2816 !important;
    background-image: none !important;
  }
  /* Claude (step 2) — stale Engine data needs a fresh Engine+Claude workflow,
     but the button must remain clickable so the user can start that safe path. */
  [data-claude-gate].needs-fresh-engine {
    filter: saturate(0.88);
    cursor: pointer !important;
  }
  [data-claude-gate].needs-fresh-engine .es-stepn {
    background: rgba(223,187,100,0.16) !important; color: var(--gold) !important; border-color: rgba(223,187,100,0.50) !important;
  }
  /* Selected engine card (Model Target / Your Portfolio): a FLAT "faded gold" solid fill + gold
     border; the other stays plain. No gradient, no inset glow. */
  .es-eng-card.selected {
    background-color: #201a0e !important;
    background-image: none !important;
    border-color: var(--accent) !important;
  }
  /* v36.12 (Jim: "Panel Widths and Borders and Padding ... should be exactly the
     same" for all 3 engines). ONE shared outer frame for every engine's content so
     all three render at identical inner width + identical border/padding. The main
     engine (v33-section-header) and Long-Term (ltc-panel) already wrap their content
     in a bg2 panel; this class gives the ETF-Quant tab the same frame (it had none,
     so its cards were ~19px wider). */
  .es-engine-panel {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 16px;
  }
  /* v36.12 (Jim: "make pie chart bigger and fill the list of stocks on the right all
     the way to bottom of this panel ... for all panels"). Make every engine's Model
     Target + Your Portfolio card a flex COLUMN so its body fills the card height —
     then the in-card pie (height:100%) stretches to the bottom, killing the dead
     space below the donut. Applied to all 6 cards across the 3 engines. */
  .es-eng-card { display: flex !important; flex-direction: column !important; }
  .es-eng-card-body { flex: 1 1 auto !important; min-height: 0 !important; }
  /* ── RISK PROFILE SELECTOR ── */
  .rp-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 3000;
    overflow-y: auto;
    padding: 30px 16px;
  }
  .rp-backdrop[style*="display: flex"] {
    display: flex !important;
    align-items: flex-start;
    justify-content: center;
  }
  .rp-modal {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 1180px;
    max-width: 100%;
    padding: 28px 32px;
    margin-bottom: 30px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.7);
  }
  .rp-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 6px;
  }
  .rp-head h2 {
    font-size: 22px; margin: 0; color: var(--text);
  }
  .rp-close {
    background: transparent; color: var(--text2);
    border: 1px solid var(--border); border-radius: 5px;
    width: 28px; height: 28px; cursor: pointer; font-size: 16px; line-height: 1;
  }
  .rp-close:hover { color: var(--text); }
  .rp-subtitle {
    font-size: 13px; color: var(--text2);
    margin-bottom: 22px; line-height: 1.5;
  }
  .rp-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);    /* v37.114 (Jim: "if we have 4 why 1 in the 2nd row") — even 2×2 for the 4 profiles (was repeat(3) = 3+1 orphan) */
    gap: 14px;
  }
  @media (max-width: 900px) {
    .rp-cards-grid { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 600px) {
    .rp-cards-grid { grid-template-columns: 1fr; }
  }
  .rp-card {
    appearance: none;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 16px;
    display: flex; flex-direction: column;
    gap: 10px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s, background 0.15s;
    position: relative;
    text-align: left;
    width: 100%;
  }
  .rp-card:hover {
    border-color: var(--blue);
    transform: translateY(-2px);
  }
  .rp-card:focus-visible {
    border-color: var(--blue);
    outline: 2px solid var(--blue);
    outline-offset: 3px;
  }
  .rp-card.selected {
    border-color: var(--green);
    box-shadow: 0 0 0 2px rgba(143,173,157,0.30);
    background: rgba(143,173,157,0.04);
  }
  .rp-card.selected::after {
    content: attr(data-badge-active);
    position: absolute; top: 8px; right: 10px;
    font-size: 9px; font-weight: 800; color: var(--green);
    letter-spacing: 0.5px;
  }
  .rp-card.recommended::before {
    content: attr(data-badge-pre);
    position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
    font-size: 9px; font-weight: 800;
    color: #fff;
    background: var(--blue);
    padding: 2px 10px;
    border-radius: 8px;
    letter-spacing: 0.6px;
  }
  /* Extreme-risk profile gets danger styling */
  .rp-card.extreme {
    border-color: rgba(220,38,38,0.50);
    background: linear-gradient(180deg, rgba(220,38,38,0.06) 0%, var(--bg) 100%);
  }
  .rp-card.extreme::before {
    content: attr(data-badge-pre);
    position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
    font-size: 9px; font-weight: 800;
    color: #fff;
    background: #b98891;
    padding: 2px 10px;
    border-radius: 8px;
    letter-spacing: 0.6px;
    white-space: nowrap;
  }
  .rp-card.extreme:hover {
    border-color: #b98891;
  }
  .rp-warning-box {
    background: rgba(220,38,38,0.10);
    border: 1px solid rgba(220,38,38,0.40);
    border-left: 3px solid #b98891;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 10.5px;
    color: #fecaca;
    line-height: 1.4;
  }
  .rp-warning-box strong { color: #fca5a5; }

  .rp-icon-row {
    display: flex; align-items: center; gap: 10px;
  }
  .rp-icon-big {
    font-size: 28px;
    line-height: 1;
  }
  .rp-name-block .rp-name {
    font-size: 15px; font-weight: 800; color: var(--text);
    line-height: 1.1;
  }
  .rp-name-block .rp-sub {
    font-size: 10.5px; color: var(--text2);
    margin-top: 2px;
    text-transform: uppercase; letter-spacing: 0.4px;
  }

  /* Risk dots */
  .rp-risk-dots {
    display: inline-flex; gap: 3px; margin-top: 4px;
  }
  .rp-risk-dots span {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--text2); opacity: 0.30;
  }
  .rp-risk-dots span.filled { opacity: 1; }
  .rp-risk-dots[data-level="1"] span:nth-child(-n+1) { background: #dfbb64; opacity: 1; }
  .rp-risk-dots[data-level="2"] span:nth-child(-n+2) { background: #dfbb64; opacity: 1; }
  .rp-risk-dots[data-level="3"] span:nth-child(-n+3) { background: #f97316; opacity: 1; }
  .rp-risk-dots[data-level="4"] span:nth-child(-n+4) { background: #bf929a; opacity: 1; }

  /* Time horizon visual */
  .rp-horizon {
    display: flex; align-items: center; gap: 6px;
    font-size: 10.5px; color: var(--text2);
  }
  .rp-horizon-track {
    flex: 1;
    height: 5px;
    background: var(--bg2);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
  }
  .rp-horizon-fill {
    position: absolute; top: 0; bottom: 0;
    background: linear-gradient(90deg, var(--blue), var(--green));
    border-radius: 3px;
  }

  /* Mini stat rows */
  .rp-stat {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 6px;
    align-items: center;
    font-size: 11px;
  }
  .rp-stat .lbl {
    color: var(--text2);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }
  .rp-stat .bar-track {
    height: 6px;
    background: var(--bg2);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--border);
  }
  .rp-stat .bar-fill {
    height: 100%;
    border-radius: 3px;
  }
  .rp-stat .val {
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    font-size: 11px;
  }
  .rp-stat .val.muted { color: var(--text2); font-weight: 500; }

  .rp-leverage-pill {
    font-size: 10px; font-weight: 700;
    padding: 2px 8px; border-radius: 3px;
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text);
    display: inline-block;
  }
  .rp-leverage-pill.has-margin { background: rgba(191,146,154,0.18); color: #bf929a; border-color: rgba(191,146,154,0.40); }

  .rp-best-for {
    font-size: 10.5px; color: var(--text2); line-height: 1.4;
    border-top: 1px solid var(--border);
    padding-top: 8px;
  }
  .rp-best-for ul { margin: 4px 0 0 0; padding-left: 16px; }
  .rp-best-for li { margin-bottom: 2px; }
  .rp-tradeoff {
    font-size: 10px; color: var(--text2);
    font-style: italic;
    margin-top: 6px;
    padding: 5px 8px;
    background: var(--bg2);
    border-radius: 3px;
    border-left: 2px solid var(--text2);
  }

  .rp-footer {
    margin-top: 16px;
    font-size: 11px;
    color: var(--text2);
    text-align: center;
  }
  /* ── COST CHIP (header) ── */
  .cost-chip {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(63,185,80,0.10);
    color: var(--green);
    border: 1px solid rgba(63,185,80,0.20);
    cursor: pointer;
  }
  .cost-chip.warn { background: rgba(210,153,34,0.12); color: var(--yellow); border-color: rgba(210,153,34,0.25); }
  .cost-chip.over { background: rgba(248,81,73,0.12); color: var(--red);    border-color: rgba(248,81,73,0.25); }
  .cost-chip:hover { filter: brightness(1.2); }
/* ─── v35.11 STEP BADGES — the 1→2→3→4 walkthrough baked INTO the existing
   controls (Jim: "instead of adding UI, put the steps in the actual existing
   buttons and UI elements"). One shared style so the four numbers visually
   rhyme and read as a sequence; tooltip on each spells out the step. ─── */
/* Jim 2026-07-05: step badges were corny round purple discs — now clean SQUARE, de-purpled (blue), a touch bigger + professional. */
.es-stepn { display:inline-flex; align-items:center; justify-content:center; width:19px; height:19px; border-radius:5px; background:rgba(223,187,100,0.14); color:#dfbb64; font-size:11px; font-weight:800; line-height:1; flex:none; cursor:help; border:1px solid #dfbb64; vertical-align:middle; }
.es-step-wrap { display:inline-flex; align-items:center; gap:6px; }
/* ─── v35.18 (Jim: "make the Quant UI look more similar to MAIN ENGINE UI. like
   they are the same product"). The Main Engine section titles are uppercase, 13px,
   bold, letter-spaced, no emoji (TODAY'S RECOMMENDATION / MODEL TARGET / UPCOMING
   EARNINGS). This class gives the Quant tab the SAME voice so the two read as one
   product. ─── */
.es-quant-h { font-size:13px; font-weight:700; color:var(--text); text-transform:uppercase; letter-spacing:.4px; margin:0; }
