/* SightLift — extracted from team_activity_dashboard.html v73.
 * Contains all UI styles. Inline style="..." attributes remain in
 * the JS templates for dynamic colors / widths.
 */
/* Hide body until app-boot.js reveals it. Must be in an external .css file
   because style-src 'self' in the CSP blocks inline style elements. */
body { visibility: hidden; }
  :root {
    --bg: #0f1419;
    --panel: #1a1f29;
    --panel-2: #232a36;
    --text: #e6e9ef;
    --muted: #8b95a8;
    --accent: #00D4FF;
    --accent-2: #ff9e6b;
    --border: #2a3140;
    --c-product: #00D4FF;
    --c-design: #a78bfa;
    --c-marketing: #ff9e6b;
    --c-engineering: #34d399;
    --c-operations: #fbbf24;
    --c-community: #f472b6;
    --c-sales: #818cf8;
    --c-finance: #2dd4bf;
    --c-nonwork: #94a3b8;
    --c-uncat: #4b5563;
    --cx-simple: #34d399;
    --cx-medium: #00D4FF;
    --cx-complex: #fbbf24;
    --cx-deep: #ff9e6b;
    /* Positive / success / savings green. ONE token for every "this is good"
       surface (connected, ok, savings, metric-improved) so the success color
       is changed in one place. Distinct from the coincidentally-green topic
       (--c-engineering) and tier (--cx-simple) category colors above, which
       are categorical and must not move with success. --success-rgb gives the
       channels for translucent fills: rgba(var(--success-rgb), <alpha>). */
    --success: #34d399;
    --success-rgb: 52, 211, 153;
  }
  * { box-sizing: border-box; }
  body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); margin: 0; padding: 24px; line-height: 1.5; }
  h1 { margin: 0 0 4px 0; font-size: 24px; font-weight: 600; }
  /* Brand wordmark (SightLift.ai brand-guide treatment): "Sight" and ".ai"
     in the cyan accent, "Lift" in text color. .cy is shared by the header
     and footer marks. */
  h1 .brand { color: var(--text); font-weight: 700; letter-spacing: -0.3px; }
  .brand .cy { color: var(--accent); }
  h1 .brand-sep { color: var(--border); font-weight: 400; margin: 0 4px; }
  /* Entity-name badge: pill next to the brand in the site header so a
     multi-tenant operator can confirm which org's data is on screen.
     Hidden when no name is set; sized to feel attached to the brand
     without competing visually. */
  h1 .entity-badge[hidden] { display: none; }
  h1 .entity-badge { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 2px 10px; font-size: 12px; font-weight: 500; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 999px; letter-spacing: 0.2px; }
  /* Entity-name editor in Settings — input + button + inline status. */
  .entity-name-row { display: flex; align-items: center; gap: 10px; }
  .entity-name-status { font-size: 12px; color: var(--muted); }
  h2 { font-size: 16px; font-weight: 600; margin: 0 0 16px 0; }
  h3 { font-size: 14px; font-weight: 600; margin: 0 0 10px 0; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
  .subtitle { color: var(--muted); margin: 0 0 24px 0; font-size: 13px; }
  .panel { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 20px; }
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
  .grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }
  @media (max-width: 900px) { .grid-2, .grid-3, .grid-1-2 { grid-template-columns: 1fr; } }
  .chart-wrap { position: relative; height: 280px; }
  /* AI-use score monthly tier ribbon (PLAN-AI-USE-SCORE) */
  .aus-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
  .aus-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
  .aus-legend span { display: flex; align-items: center; gap: 6px; }
  .aus-key { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
  /* Grain (lookback) zoom toggle — weekly / monthly / quarterly segmented control */
  .aus-grain { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2, rgba(127,127,127,0.06)); }
  .aus-grain:empty { display: none; }
  .aus-grain-btn { appearance: none; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 6px; cursor: pointer; }
  .aus-grain-btn:hover { color: var(--text); }
  .aus-grain-on { background: var(--accent, #00D4FF); color: #0a1828; }
  .aus-grain-on:hover { color: #0a1828; }
  .aus-grid { display: grid; gap: 6px; align-items: center; }
  .aus-head { text-align: center; font-size: 12px; color: var(--muted); }
  .aus-row-label { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .aus-row-org { font-weight: 600; color: var(--text); }
  .aus-cell { height: 34px; border-radius: 6px; display: flex; align-items: center; justify-content: center; gap: 2px; font-size: 14px; font-weight: 600; cursor: pointer; }
  .aus-cell:hover { filter: brightness(1.18); outline: 1px solid var(--border); }
  .aus-cell-empty { height: 34px; border-radius: 6px; border: 1px dashed var(--border); cursor: default; font-weight: 400; }
  .aus-cell-empty:hover { filter: none; outline: none; }
  .aus-tip { position: fixed; z-index: 9999; pointer-events: none; display: none;
    background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
    border-radius: 8px; padding: 8px 10px; font-size: 12px; min-width: 168px; white-space: nowrap;
    box-shadow: 0 6px 18px rgba(0,0,0,0.5); }
  .aus-tip-h { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); }
  .aus-tip-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: none; }
  .aus-tip-score { color: var(--muted); font-size: 11px; margin: 1px 0 6px; }
  .aus-tip-row { display: flex; justify-content: space-between; gap: 18px; line-height: 1.7; }
  .aus-tip-row span:first-child { color: var(--muted); }
  .aus-tip-row span:last-child { font-weight: 600; color: var(--text); }
  /* AI-use score "why this score" breakdown panel */
  .aus-bd { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
  .aus-bd-head { display: flex; justify-content: space-between; align-items: center; }
  .aus-bd-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
  .aus-bd-x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 4px; }
  .aus-bd-x:hover { color: var(--text); }
  .aus-bd-sub { color: var(--muted); font-size: 12px; margin: 3px 0 12px; }
  .aus-bd-rows { display: grid; gap: 8px; }
  .aus-bd-row { background: var(--panel-2); border-radius: 6px; padding: 8px 10px; }
  .aus-bd-rowtop { display: flex; justify-content: space-between; font-weight: 600; font-size: 13px; }
  .aus-bd-detail { color: var(--muted); font-size: 12px; margin-top: 3px; }
  .aus-bd-delta { font-size: 12px; font-weight: 600; margin-left: 6px; }
  .aus-bd-up { color: #34d399; }
  .aus-bd-down { color: #f0a23a; }
  .aus-bd-flat { color: var(--muted); }
  .aus-bd-recs { margin-top: 14px; }
  .aus-bd-recs-h { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
  .aus-bd-rec { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; cursor: pointer; font-family: inherit; color: var(--text); }
  .aus-bd-rec:hover { border-color: var(--accent); }
  .aus-bd-rec-arch { flex: none; font-size: 11px; text-transform: capitalize; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 1px 8px; color: var(--muted); }
  .aus-bd-rec-head { flex: 1; font-size: 13px; }
  .aus-bd-rec-dim { flex: none; font-size: 11px; color: var(--accent); text-transform: capitalize; }
  .aus-bd-drill { margin-top: 12px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 8px 12px; cursor: pointer; font-family: inherit; font-size: 13px; }
  .aus-bd-drill:hover { border-color: var(--accent); color: var(--accent); }
  /* Redesigned "why this score" detail (openBreakdown): hero score + plain-language
     headline, a highlighted driver card, then the other factors. Additive classes
     layered on the shared .aus-bd-* base — only rendered for the AI-use score panel,
     so the Recommendations / Data Signals drawers (same base classes) are untouched. */
  .aus-bd-hero { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; margin: 8px 0 4px; }
  .aus-bd-hero-score { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
  .aus-bd-hero-num { font-size: 40px; font-weight: 700; line-height: 1; }
  .aus-bd-hero-max { font-size: 13px; font-weight: 600; color: var(--muted); }
  .aus-bd-hero-delta { font-size: 16px; font-weight: 700; }
  .aus-bd-hero-head { flex: 1 1 260px; min-width: 240px; align-self: center; font-size: 14px; line-height: 1.45; color: var(--text); }
  .aus-bd-sectionlabel { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 16px 0 7px; }
  .aus-bd-driver { border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 8px; background: rgba(0,212,255,0.06); padding: 12px 14px; }
  .aus-bd-driver-top { display: flex; align-items: center; gap: 10px; }
  .aus-bd-driver-name { font-size: 15px; font-weight: 700; }
  .aus-bd-driver-val { font-size: 15px; font-weight: 700; }
  .aus-bd-driver-tag { margin-left: auto; flex: none; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 9px; border-radius: 10px; }
  .aus-bd-tag-up { background: rgba(52,211,153,0.18); color: #34d399; }
  .aus-bd-tag-down { background: rgba(240,162,58,0.18); color: #f0a23a; }
  .aus-bd-tag-opp { background: rgba(0,212,255,0.16); color: var(--accent); }
  .aus-bd-driver-metric { font-size: 17px; font-weight: 700; color: var(--text); margin: 8px 0 2px; }
  .aus-bd-driver-def { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
  .aus-bd-next { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; margin-top: 11px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); font-family: inherit; font-size: 13px; }
  button.aus-bd-next { cursor: pointer; }
  button.aus-bd-next:hover { border-color: var(--accent); }
  .aus-bd-next-k { flex: none; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); }
  .aus-bd-next-t { flex: 1; line-height: 1.4; }
  .aus-bd-next-go { flex: none; color: var(--accent); font-weight: 700; }
  .aus-bd-metricline { font-size: 13px; font-weight: 600; color: var(--text); margin-top: 2px; }
  /* Recommendations "how we got here" drawer — expands IN PLACE directly under
     the clicked card and MERGES with it into one block: no top border, squared
     top corners, and the per-archetype left rail (var(--rec-accent), inherited
     from the host's .rec-arch-* class) continued unbroken from the card above, so
     the colored line reads as one. Scoped to #rec-breakdown so the AI-use score
     breakdown (same .aus-bd-* classes) is untouched. */
  /* The drawer is inserted as a flex sibling of the card inside .dsig-cards
     (gap: 12px), so cancel that gap with a matching negative margin to butt the
     drawer flush against the pill — otherwise it floats 12px below and reads as a
     detached box. -13px tucks it 1px under the card's bottom border so the seam is
     a single shared line, not a double border. */
  #rec-breakdown { margin-top: -13px; }
  #rec-breakdown .aus-bd {
    margin-top: 0; border: 1px solid var(--border); border-top: none;
    border-left: 3px solid var(--rec-accent, var(--border)); border-radius: 0 0 8px 8px;
    background: rgba(0,212,255,0.05); padding: 4px 14px 12px;
  }
  #rec-breakdown .aus-bd-head { padding-top: 8px; }
  #rec-breakdown .aus-bd-sub { margin: 0; }
  /* Concise signal summary: an unfurl toggle ("5 trend signals") plus a glossary
     ⓘ that explains "what's a data signal?" on hover, sitting contextually beside
     it. The auditable per-signal list lives in .aus-bd-rows, collapsed until the
     toggle is clicked. */
  #rec-breakdown .rec-sig-head { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
  #rec-breakdown .rec-sig-toggle {
    display: inline-flex; align-items: center; gap: 5px; padding: 2px 0;
    background: none; border: none; cursor: pointer; font-family: inherit;
    font-size: 12.5px; font-weight: 600; color: var(--text);
  }
  #rec-breakdown .rec-sig-toggle:hover { color: var(--accent); }
  #rec-breakdown .aus-bd-rows { margin: 8px 4px 0 12px; padding-left: 10px; border-left: 2px solid var(--border); }
  #rec-breakdown .aus-bd-row { padding: 7px 10px; }
  #rec-breakdown .aus-bd-drill { margin: 12px 0 2px 12px; border-color: var(--accent); color: var(--accent); font-weight: 600; }
  #rec-breakdown .aus-bd-drill:hover { background: var(--panel); }
  /* Caret on the signal-summary unfurl toggle (the per-signal rows below drill
     straight to conversations, so they carry a "N conversations →" affordance
     instead of a caret). */
  #rec-breakdown .rec-sig-caret { display: inline-block; width: 1em; color: var(--muted); font-size: 10px; }
  /* Constituent signal row — one click drills into its conversations. The row is
     the readable summary; the affordance on the right names the destination. */
  #rec-breakdown .rec-sig-row.clickable { transition: background .12s ease; }
  #rec-breakdown .rec-sig-row.clickable:hover { background: rgba(255,255,255,0.05); }
  #rec-breakdown .rec-sig-drill { color: var(--accent); font-size: 11px; font-weight: 600; white-space: nowrap; margin-left: 10px; }
  /* The card whose Data Signals drawer is open — full cyan accent (unchanged). */
  .dsig-card.dsig-card-expanded,
  .dsig-card.dsig-card-expanded.clickable:hover { border-color: var(--accent); border-left-color: var(--accent); background: rgba(0,212,255,0.08); }
  /* The card whose recommendation drawer is open — tint it + square the bottom so
     it fuses with the drawer below, but KEEP its per-archetype left rail (not the
     cyan accent) so the colored line flows down into the drawer. The :hover variant
     (specificity 0,4,0) outranks .dsig-card.clickable:hover so the rail + tint hold
     while the pointer rests on the (clickable) expanded card. */
  .dsig-card.rec-card-expanded,
  .dsig-card.rec-card-expanded.clickable:hover {
    border-color: var(--accent); border-left-color: var(--rec-accent);
    background: rgba(0,212,255,0.08);
    border-bottom-left-radius: 0; border-bottom-right-radius: 0;
  }
  /* Data Signals "why it triggered" drawer — same in-place treatment as
     #rec-breakdown (recessed box under the clicked card), plus a metric-stat
     grid for the "what crossed the line" numbers. */
  #dsig-breakdown { margin-top: -2px; }
  #dsig-breakdown .aus-bd {
    margin-top: 0; border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg); padding: 12px 14px 10px;
  }
  #dsig-breakdown .aus-bd-drill { margin: 16px 0 2px; border-color: var(--accent); color: var(--accent); font-weight: 600; }
  #dsig-breakdown .aus-bd-drill:hover { background: var(--panel); }
  .dsig-bd-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
  .dsig-bd-stat { display: flex; justify-content: space-between; gap: 8px; background: var(--panel-2); border-radius: 6px; padding: 6px 10px; }
  .dsig-bd-stat-k { color: var(--muted); font-size: 12px; }
  .dsig-bd-stat-v { font-weight: 600; font-size: 12px; color: var(--text); }
  .aus-cell-low { opacity: 0.5; }
  /* Per-chart PNG export control — auto-injected into every .chart-wrap, */
  /* revealed on hover/focus so it stays out of the way of the chart. */
  .chart-export-btn {
    position: absolute; top: 4px; right: 4px; z-index: 2;
    width: 26px; height: 26px; padding: 0; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    background: var(--panel-2); border: 1px solid var(--border); border-radius: 5px;
    color: var(--text); font-size: 13px; cursor: pointer; font-family: inherit;
    opacity: 0; transition: opacity 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  }
  .chart-wrap:hover .chart-export-btn,
  .chart-export-btn:focus-visible { opacity: 0.85; }
  .chart-export-btn:hover { opacity: 1; border-color: var(--accent); color: var(--accent); }
  /* Touch devices have no hover — keep the control permanently visible there. */
  @media (hover: none) { .chart-export-btn { opacity: 0.85; } }

  .chip { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; margin-right: 4px; }
  .topic-product { background: rgba(0,212,255,0.18); color: var(--c-product); }
  .topic-design { background: rgba(167,139,250,0.18); color: var(--c-design); }
  .topic-marketing { background: rgba(255,158,107,0.18); color: var(--c-marketing); }
  .topic-engineering { background: rgba(52,211,153,0.18); color: var(--c-engineering); }
  .topic-operations { background: rgba(251,191,36,0.18); color: var(--c-operations); }
  .topic-community { background: rgba(244,114,182,0.18); color: var(--c-community); }
  .topic-sales { background: rgba(129,140,248,0.18); color: var(--c-sales); }
  .topic-finance { background: rgba(45,212,191,0.18); color: var(--c-finance); }
  .topic-non-work { background: rgba(148,163,184,0.18); color: var(--c-nonwork); }
  .topic-uncategorized { background: rgba(75,85,99,0.25); color: #9ca3af; }
  .tier-Simple { background: rgba(52,211,153,0.18); color: var(--cx-simple); }
  .tier-Medium { background: rgba(0,212,255,0.18); color: var(--cx-medium); }
  .tier-Complex { background: rgba(251,191,36,0.18); color: var(--cx-complex); }
  .tier-Deep { background: rgba(255,158,107,0.18); color: var(--cx-deep); }

  /* Topic cards */
  .topic-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
  .topic-header { padding: 14px 18px; display: flex; align-items: center; gap: 18px; cursor: pointer; transition: background 0.15s; }
  .topic-header:hover { background: var(--panel-2); }
  .topic-header .swatch { width: 6px; align-self: stretch; border-radius: 3px; }
  .topic-header .name { font-weight: 600; font-size: 15px; flex: 0 0 200px; }
  .topic-header .name .total { color: var(--muted); font-size: 12px; font-weight: 400; display: block; margin-top: 2px; }
  .topic-header .tier-mini { flex: 1; }
  .topic-header .tier-mini .bar { display: flex; height: 14px; border-radius: 3px; overflow: hidden; }
  .topic-header .tier-mini .legend { font-size: 10px; color: var(--muted); margin-top: 3px; }
  .topic-header .arrow { color: var(--muted); font-size: 18px; line-height: 1; transition: transform 0.2s; }
  .topic-card.open .arrow { transform: rotate(90deg); }
  .topic-body { display: none; padding: 18px; border-top: 1px solid var(--border); background: var(--panel-2); }
  .topic-card.open .topic-body { display: block; }

  /* Subtopic rows inside a topic card */
  .sub-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .sub-row:last-child { border-bottom: none; }
  .sub-row .top { display: flex; align-items: center; gap: 12px; cursor: pointer; }
  .sub-row .top .sub-name { flex: 0 0 200px; font-weight: 500; font-size: 13px; }
  .sub-row .top .sub-name .cnt { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
  .sub-row .top .sub-bar { flex: 1; display: flex; height: 14px; border-radius: 3px; overflow: hidden; background: rgba(255,255,255,0.04); }
  .sub-row .top .sub-bar .seg { height: 100%; }
  .sub-row .top .contributors { flex: 0 0 240px; font-size: 11px; color: var(--muted); text-align: right; }
  .sub-row .sub-arrow { color: var(--muted); font-size: 14px; margin-left: 8px; transition: transform 0.2s; }
  .sub-row.open .sub-arrow { transform: rotate(90deg); }
  .sub-row .examples { display: none; padding: 12px 0 4px 0; }
  .sub-row.open .examples { display: block; }
  .sub-row .examples .ex { font-size: 12px; padding: 4px 0; display: flex; gap: 8px; align-items: center; }
  .sub-row .examples .ex .ttl { flex: 1; color: var(--text); }
  /* v29: sub-row hover + topic "view all" button */
  .sub-row .top { transition: background 0.1s, border-radius 0.1s; padding: 4px 6px; margin: -4px -6px; border-radius: 4px; }
  .sub-row .top:hover { background: rgba(0,212,255,0.06); }
  .sub-row .top:hover .sub-name { color: var(--accent); }
  .view-all-btn { background: transparent; border: 1px solid var(--border); color: var(--muted); padding: 4px 10px; font-size: 11px; border-radius: 4px; cursor: pointer; font-family: inherit; margin-left: 8px; white-space: nowrap; }
  .view-all-btn:hover { color: var(--accent); border-color: var(--accent); background: rgba(0,212,255,0.06); }
  .topic-header { gap: 14px; }
  .sub-row .examples .ex .meta { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11px; }

  .complex-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
  .complex-table th, .complex-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; }
  .complex-table th { color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
  .complex-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

  .caveat { background: rgba(255, 158, 107, 0.08); border-left: 3px solid var(--accent-2); padding: 12px 14px; border-radius: 6px; font-size: 13px; color: var(--muted); margin-bottom: 20px; }
  .caveat strong { color: var(--text); }

  .totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
  .stat { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
  .stat .label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
  .stat .value { font-size: 22px; font-weight: 600; margin-top: 4px; }
  /* Drill pills (Spend, New Recommendations, New Agent Opportunities) keep the
     card's 10px radius on hover and pick up an accent border + tint. */
  .stat.clickable:hover { background: rgba(0,212,255,0.07); border-color: var(--accent); border-radius: 10px; }
  .stat.clickable:hover .label { color: var(--accent); }

  .legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
  .legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

  .subtopic-list { font-size: 12px; color: var(--muted); }
  .subtopic-list .sb { display: inline-block; background: var(--panel); padding: 3px 8px; border-radius: 10px; margin: 2px; font-variant-numeric: tabular-nums; }
  .subtopic-list .sb strong { color: var(--text); font-weight: 500; margin-right: 4px; }

  .toggle-row { display: inline-flex; gap: 4px; padding: 3px; background: var(--panel-2); border-radius: 6px; margin-bottom: 12px; }
  .toggle-row button { background: transparent; color: var(--muted); border: 0; padding: 6px 12px; border-radius: 4px; font-size: 12px; cursor: pointer; }
  .toggle-row button.active { background: var(--panel); color: var(--text); }

  /* Agent candidate cards */
  .agent-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 12px; }
  .agent-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .agent-head .title { font-weight: 600; font-size: 15px; }
  .agent-head .tagline { color: var(--muted); font-size: 12px; margin-top: 2px; }
  .agent-head .stars { color: #fbbf24; font-size: 14px; letter-spacing: 1px; white-space: nowrap; }
  .agent-criteria { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; }
  .agent-criteria .crit { display: flex; flex-direction: column; }
  .agent-criteria .crit .lbl { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
  .agent-criteria .crit .val { font-weight: 600; }
  .agent-detail { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; }
  .agent-card.open .agent-detail { display: block; }
  .agent-detail .row { display: grid; grid-template-columns: 100px 1fr; gap: 12px; margin-bottom: 8px; }
  .agent-detail .row .k { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; padding-top: 1px; }
  .agent-detail .row .v { color: var(--text); }
  .agent-detail .examples { margin-top: 8px; }
  .agent-detail .examples .ex { font-size: 12px; padding: 4px 0; display: flex; gap: 8px; align-items: center; }
  .agent-detail .examples .ex .ttl { flex: 1; }
  .agent-detail .examples .ex .meta { color: var(--muted); font-size: 11px; }
  .agent-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
  .agent-toggle { background: transparent; border: 1px solid var(--border); color: var(--accent); cursor: pointer; padding: 6px 10px; font-size: 11px; border-radius: 4px; }
  .agent-toggle:hover { background: rgba(0,212,255,0.08); }
  .agent-artifact-btn { background: var(--accent); border: 1px solid var(--accent); color: var(--bg); cursor: pointer; padding: 7px 14px; font-size: 12px; font-weight: 600; border-radius: 5px; transition: transform 0.08s ease, box-shadow 0.15s ease, filter 0.15s ease; }
  .agent-artifact-btn[data-type="prd"] { margin-left: auto; }
  .agent-artifact-btn[data-type="skill"] { background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%); border-color: transparent; }
  .agent-artifact-btn:hover { filter: brightness(1.08); box-shadow: 0 2px 12px rgba(0, 212, 255, 0.28); transform: translateY(-1px); }
  .agent-artifact-btn[data-type="skill"]:hover { box-shadow: 0 2px 12px rgba(255, 158, 107, 0.30); }
  .agent-artifact-btn:active { transform: translateY(0); }
  .agent-artifact-btn:disabled { opacity: 0.55; cursor: not-allowed; filter: none; box-shadow: none; transform: none; }


  /* Calendar heatmap popover */
  .heatmap-popover { position: fixed; display: none; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; box-shadow: 0 6px 24px rgba(0,0,0,0.5); z-index: 9999; pointer-events: none; min-width: 320px; }
  .heatmap-popover.open { display: block; }
  .heatmap-popover .hm-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
  .heatmap-popover .hm-sub { color: var(--muted); font-size: 11px; margin-bottom: 10px; font-family: ui-monospace, monospace; }
  .heatmap-grid { display: grid; gap: 3px; margin-bottom: 8px; }
  .heatmap-grid .dow-label { font-size: 9px; color: var(--muted); text-align: right; padding-right: 4px; height: 16px; display: flex; align-items: center; justify-content: flex-end; }
  .heatmap-grid .col-label { font-size: 9px; color: var(--muted); text-align: center; }
  .heatmap-grid .cell { height: 16px; border-radius: 2px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.03); }
  .heatmap-grid .cell.empty-outside { background: transparent; border: none; }
  .heatmap-grid .cell.today { box-shadow: 0 0 0 1px var(--accent-2); }
  .heatmap-foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
  .heatmap-foot strong { color: var(--text); }
  .heatmap-legend { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--muted); margin-top: 6px; justify-content: flex-end; }
  .heatmap-legend .swatch { width: 12px; height: 12px; border-radius: 2px; }
  .dense-bars { display: flex; flex-direction: column; gap: 6px; }
  .dense-bar { display: flex; align-items: center; gap: 8px; font-size: 12px; }
  .dense-bar .name { flex: 0 0 120px; }
  .dense-bar .track { flex: 1; height: 14px; background: rgba(255,255,255,0.04); border-radius: 3px; overflow: hidden; }
  .dense-bar .fill { height: 100%; border-radius: 3px; }
  .dense-bar .val { flex: 0 0 70px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
  .dense-bar .val .pct { color: var(--muted); font-size: 10px; margin-left: 4px; }


  /* Drill-through modal */
  .drill-overlay { position: fixed; inset: 0; background: rgba(15,20,25,0.75); display: none; align-items: flex-start; justify-content: center; z-index: 10000; padding: 5vh 5vw; }
  .drill-overlay.open { display: flex; }
  .drill-modal { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; width: 100%; max-width: 1100px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,0.6); }
  .drill-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
  .drill-head .title { font-weight: 600; font-size: 15px; }
  .drill-head .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
  .drill-close { background: transparent; border: 1px solid var(--border); color: var(--muted); cursor: pointer; padding: 6px 12px; border-radius: 6px; font-size: 12px; }
  /* v74.5: drill-head actions cluster */
  .drill-head-actions { display: flex; gap: 8px; align-items: center; }
  .drill-export { background: transparent; border: 1px solid var(--border); color: var(--text); cursor: pointer; padding: 6px 12px; border-radius: 6px; font-size: 12px; font-family: inherit; }
  .drill-export:hover { border-color: var(--accent); color: var(--accent); }
  .drill-close:hover { color: var(--text); background: var(--panel-2); }
  .drill-stats { padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--panel); display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
  .drill-stats .s { display: flex; flex-direction: column; }
  .drill-stats .s .lbl { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
  .drill-stats .s .val { font-size: 18px; font-weight: 600; margin-top: 2px; }
  .drill-stats .s .sub { color: var(--muted); font-size: 11px; }
  .drill-bar { display: flex; height: 14px; border-radius: 3px; overflow: hidden; margin-top: 4px; background: rgba(255,255,255,0.04); }
  .drill-bar .seg { height: 100%; }
  .drill-table-wrap { overflow: auto; flex: 1; padding: 0 4px; }
  .drill-table { width: 100%; border-collapse: collapse; font-size: 12px; }
  .drill-table thead { position: sticky; top: 0; background: var(--bg); z-index: 1; }
  .drill-table th { color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer; user-select: none; padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; }
  .drill-table th:hover { color: var(--accent); }
  .drill-table th.num { text-align: right; }
  .drill-table th { position: relative; }
  .drill-table th::after { content: '⇅'; color: rgba(255,255,255,0.15); margin-left: 6px; font-size: 11px; }
  .drill-table th.sort-asc::after { content: '▲'; color: var(--accent); }
  .drill-table th.sort-desc::after { content: '▼'; color: var(--accent); }
  .drill-table th .arrow { display: none; }
  .drill-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
  .drill-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
  .drill-table tr:hover td { background: var(--panel); }
  .drill-table td .date { color: var(--muted); font-size: 11px; }
  .drill-empty { text-align: center; padding: 40px; color: var(--muted); }
  .clickable { cursor: pointer; transition: background 0.1s; }
  .clickable:hover { background: rgba(0,212,255,0.07); border-radius: 4px; }
  .clickable .name { transition: color 0.1s; }
  .clickable:hover .name { color: var(--accent); }
  /* Output chip — neutral by default */
  .output-chip { background: rgba(168, 139, 250, 0.15); color: #c4b5fd; font-size: 11px; padding: 2px 8px; border-radius: 10px; }

  /* PRD review modal — reuses .drill-overlay / .drill-modal chrome and narrows
     the reading column. The rendered-Markdown typography lives in the shared
     .md-doc block below (this body carries `md-doc`); only the container box is
     styled here. */
  .prd-modal { max-width: 820px; }
  .prd-body { overflow: auto; flex: 1; padding: 20px 28px 28px; line-height: 1.6; font-size: 14px; color: var(--text); }
  /* Markdown-doc typography — shared by both review modals (#prd-body and
     #rec-artifact-content), keyed on the .md-doc marker each carries. The class
     set (.md-h/.md-ul/.md-code/…) is App.Util.renderMarkdown's output contract;
     keeping the .md-doc prefix on the bare-tag rules (p/li/strong/code) scopes
     them to the doc bodies so they don't bleed into the rest of the app. */
  .md-doc .md-h { font-weight: 600; line-height: 1.3; margin: 22px 0 8px; color: var(--text); }
  .md-doc .md-h:first-child { margin-top: 0; }
  .md-doc .md-h1 { font-size: 22px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
  .md-doc .md-h2 { font-size: 18px; color: var(--accent); }
  .md-doc .md-h3 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); }
  .md-doc .md-h4, .md-doc .md-h5, .md-doc .md-h6 { font-size: 14px; }
  .md-doc p { margin: 0 0 12px; }
  .md-doc .md-ul, .md-doc .md-ol { margin: 0 0 12px; padding-left: 22px; }
  .md-doc li { margin: 3px 0; }
  .md-doc strong { color: var(--text); font-weight: 600; }
  .md-doc code { background: var(--panel-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
  .md-doc .md-code { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin: 0 0 14px; overflow: auto; }
  .md-doc .md-code code { background: none; border: none; padding: 0; font-size: 12px; line-height: 1.5; white-space: pre; }
  .md-doc .md-quote { margin: 0 0 14px; padding: 4px 14px; border-left: 3px solid var(--border); color: var(--muted); }
  .md-doc .md-hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }


  /* Effort tier colors (distinct from complexity) */
  :root {
    --eff-quick: #94a3b8;
    --eff-light: #00D4FF;
    --eff-substantial: #fbbf24;
    --eff-deep: #ff6b6b;
  }
  .chip.effort-quick { background: rgba(148, 163, 184, 0.18); color: var(--eff-quick); }
  .chip.effort-light { background: rgba(0, 212, 255, 0.18); color: var(--eff-light); }
  .chip.effort-substantial { background: rgba(251, 191, 36, 0.18); color: var(--eff-substantial); }
  .chip.effort-deep { background: rgba(255, 107, 107, 0.18); color: var(--eff-deep); }
  /* Sensitive-conversation markers (Drill title cell). The amber chip confirms to
     a privileged viewer that a conversation is gated (and why); the lock placeholder
     is what a non-privileged viewer sees in place of a redacted sensitive row. */
  .chip.sensitive-chip { background: rgba(240, 162, 58, 0.18); color: #f0a23a; font-weight: 600; white-space: nowrap; }
  /* Determinism badge (Capability Layer PR2) — on Agent Opportunity cards.
     high = strongly deterministic (automation-leaning, green); low = judgment
     work (skill-leaning, muted). Same .chip base as the effort/tier chips. */
  .chip.determinism-high { background: rgba(52, 211, 153, 0.18); color: #34d399; font-weight: 600; white-space: nowrap; }
  .chip.determinism-low { background: rgba(148, 163, 184, 0.18); color: var(--muted); font-weight: 600; white-space: nowrap; }
  /* Low-corroboration flag on a capability card (GOVERNANCE §8). */
  .chip.cap-lowcorr { background: rgba(251, 191, 36, 0.16); color: #fbbf24; font-weight: 600; white-space: nowrap; }

  /* ---- Capability Layer lifecycle board (PR3) — src/27-ui-capabilities.js ---- */
  .cap-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
  .cap-col { flex: 0 0 260px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
  .cap-col-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
  .cap-col-label { font-weight: 600; font-size: 13px; color: var(--text); }
  .cap-col-count { font-size: 12px; color: var(--muted); background: var(--panel); border-radius: 10px; padding: 1px 8px; }
  .cap-col-hint { font-size: 11px; color: var(--muted); margin-bottom: 10px; }
  .cap-col-cards { display: flex; flex-direction: column; gap: 10px; }
  .cap-card { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
  .cap-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
  .cap-card-title { font-weight: 600; font-size: 13px; color: var(--text); line-height: 1.3; }
  .cap-score { font-size: 11px; color: var(--muted); flex: 0 0 auto; }
  .cap-card-badges { margin: 6px 0 2px; }
  .cap-card-cell { font-size: 12px; color: var(--muted); margin-top: 2px; }
  .cap-card-foot { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
  .cap-meta { font-size: 11px; color: var(--muted); }
  .cap-owner { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sensitive-lock { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-style: italic; font-size: 12px; }
  /* Mini effort bar (inline with output bars) */
  .effort-mini { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: rgba(255,255,255,0.04); margin-top: 4px; max-width: 120px; }
  .effort-mini .e-seg { height: 100%; }


  /* v72: error boundary fallback — visible but non-alarming. */
  .error-boundary { padding: 16px; border: 1px solid var(--border); border-radius: 6px; background: rgba(255, 107, 107, 0.05); color: var(--text); font-size: 13px; margin: 16px 0; }
  /* v72: empty state for filtered panels — used by People list when filter window has zero rows. */
  .empty-state { padding: 24px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 6px; font-size: 13px; margin: 12px 0; }
  /* v71: a11y — skip link is visually hidden until keyboard-focused. */
  .skip-link { position: absolute; left: -9999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 4px; text-decoration: none; z-index: 100; }
  .skip-link:focus { left: 8px; }
  /* v71: a11y — visible focus indicator for keyboard users (default UA rings
     are sometimes invisible against dark themes). */
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .tab-nav { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
  .tab-btn { background: transparent; border: 0; color: var(--muted); padding: 12px 20px; font-size: 14px; font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; transition: color 0.15s, border-color 0.15s; font-family: inherit; margin-bottom: -1px; }
  .tab-btn:hover { color: var(--text); }
  .tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }
  .tab-pane { display: none; }
  .tab-pane.active { display: block; }


  /* People consolidated section (v18) */
  .pp-row { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; overflow: hidden; transition: border-color 0.15s; }
  .pp-row:hover { border-color: rgba(0,212,255,0.3); }
  /* Stack the row's four columns: identity / stacked bars+heatmap / stats / arrow.
     align-items: start so the right-side stats stay top-aligned with the name when
     the middle column grows taller from the heatmap. */
  .pp-row-top { display: grid; grid-template-columns: 280px 1fr 160px 24px; gap: 18px; align-items: start; padding: 14px 18px; cursor: pointer; }
  .pp-row-top:hover { background: var(--panel-2); }
  .pp-row .pp-id .pp-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; }
  .pp-row .pp-id .pp-email { color: var(--muted); font-size: 11px; font-family: ui-monospace, "SF Mono", Menlo, monospace; margin-top: 2px; }
  .pp-row .pp-id .pp-role { color: var(--muted); font-size: 11px; margin-top: 4px; line-height: 1.35; }
  .pp-row .pp-bars { display: flex; flex-direction: column; gap: 5px; }
  .pp-row .pp-bars .pp-mini { display: flex; align-items: center; gap: 8px; }
  .pp-row .pp-bars .pp-mini .pp-lbl { flex: 0 0 60px; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
  .pp-row .pp-bars .pp-mini .pp-bar { flex: 1; display: flex; height: 12px; border-radius: 3px; overflow: hidden; background: rgba(255,255,255,0.04); }
  .pp-row .pp-bars .pp-mini .pp-bar .pp-seg { height: 100%; cursor: pointer; transition: filter 0.1s; }
  .pp-row .pp-bars .pp-mini .pp-bar .pp-seg:hover { filter: brightness(1.35); }
  /* Middle column of each person row puts the Topics/Complex/Effort bars
     side-by-side with the 30-day calendar heatmap. Bars stretch to fill
     remaining width; calendar is intrinsic-sized. min-width: 0 keeps the
     bars honest inside the parent grid's 1fr column. */
  .pp-row .pp-row-middle { display: flex; flex-direction: row; gap: 18px; min-width: 0; align-items: center; }
  .pp-row .pp-row-middle .pp-bars { flex: 1; min-width: 0; }
  .pp-row .pp-row-middle .pp-hm-cal { flex: 0 0 auto; }
  /* Wall-calendar layout: M T W T F S S header row across the top, then
     N weeks of day cells underneath in row-major order. Padding divs at
     the head of .pp-hm-cells push day-1 onto its real column; cells then
     wrap row-by-row left-to-right. Cell click opens the Drill modal
     scoped to {acc, day} — pointer cursor signals it's clickable.
     Cells sized 20px so the calendar reads at a glance; brightness
     ramp in buildInlineHeatmapStrip() also boosted. */
  .pp-row .pp-hm-cal { display: flex; flex-direction: column; gap: 4px; }
  .pp-row .pp-hm-dows { display: grid; grid-template-columns: repeat(7, 20px); gap: 3px; }
  .pp-row .pp-hm-dow { font-size: 10px; line-height: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; text-align: center; font-weight: 600; }
  .pp-row .pp-hm-cells { display: grid; grid-template-columns: repeat(7, 20px); grid-auto-rows: 20px; gap: 3px; }
  .pp-row .pp-hm-cells .pp-hm-cell { border-radius: 4px; transition: filter 0.1s, transform 0.1s; cursor: pointer; }
  .pp-row .pp-hm-cells .pp-hm-cell:hover { filter: brightness(1.3); transform: scale(1.08); }
  .pp-row .pp-hm-cells .pp-hm-cell.today { box-shadow: 0 0 0 1.5px var(--accent-2); }
  .pp-row .pp-hm-cells .pp-hm-pad { /* slot-holder so day-1 lands on its real dow column */ }
  .pp-row .pp-hm-caption { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }
  .pp-row .pp-hm-range { font-variant-numeric: tabular-nums; }
  .pp-row .pp-hm-stat { text-transform: none; letter-spacing: 0; }
  .pp-row .pp-hm-stat strong { color: var(--text); font-variant-numeric: tabular-nums; }
  .pp-row .pp-stats { display: flex; flex-direction: column; align-items: flex-end; font-size: 11px; color: var(--muted); white-space: nowrap; }
  .pp-row .pp-stats .pp-convs { font-size: 22px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1; }
  .pp-row .pp-stats .pp-sub { margin-top: 4px; font-size: 11px; }
  .pp-row .pp-arrow { color: var(--muted); font-size: 16px; transition: transform 0.2s; text-align: right; align-self: center; }
  .pp-row.open .pp-arrow { transform: rotate(90deg); }
  .pp-row-body { display: none; padding: 18px; border-top: 1px solid var(--border); background: var(--panel-2); }
  .pp-row.open .pp-row-body { display: block; }

  /* Per-person recommendation-signal pill (Team list) — severity-tinted count
     next to the name. color + border-color are set inline from _sevColor. */
  .pp-row .pp-id .pp-name .pp-sig-pill {
    display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto;
    font-size: 11px; font-weight: 600; padding: 0 7px; border-radius: 10px;
    border: 1px solid var(--border); background: rgba(255,255,255,0.04);
    font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 18px;
  }
  /* "Why they're flagged" section inside the expanded body. */
  .pp-sig-h { display: flex; align-items: center; gap: 8px; }
  .pp-sig-h .pp-sig-h-icon { color: #e5534b; }
  .pp-sig-h .pp-sig-count {
    font-size: 11px; font-weight: 600; color: var(--muted);
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 10px; padding: 0 7px; line-height: 16px;
  }
  .pp-sig-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
  /* Signal rows mirror the Recommendations drilldown's constituent rows
     (.aus-bd-row.rec-sig-row): a flat two-line summary — tagline + "N
     conversations →" on top, lane chip + action below — where one click drills
     straight to the conversations behind that signal. */
  .pp-sig-list .rec-sig-row { padding: 7px 10px; }
  .pp-sig-list .rec-sig-row.clickable { cursor: pointer; transition: background .12s ease; }
  .pp-sig-list .rec-sig-row.clickable:hover { background: rgba(255,255,255,0.05); }
  .pp-sig-list .rec-sig-drill { color: var(--accent); font-size: 11px; font-weight: 600; white-space: nowrap; margin-left: 10px; }

  .pp-sort-label { font-size: 12px; color: var(--muted); margin-left: auto; }


  .mockup-banner { background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.25); color: #fbbf24; padding: 10px 14px; border-radius: 8px; font-size: 12px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
  .mockup-banner::before { content: "●"; }
  .settings-section { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 22px; margin-bottom: 20px; }
  .settings-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
  .settings-section-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
  .settings-section-sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
  .btn { background: var(--accent); color: var(--bg); border: 0; padding: 8px 14px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit; }
  .btn:hover { filter: brightness(1.1); }
  .btn-secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
  .btn-secondary:hover { background: var(--border); }
  .role-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
  @media (max-width: 900px) { .role-grid { grid-template-columns: repeat(2, 1fr); } }
  .role-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
  .role-card .role-name { font-weight: 600; font-size: 13px; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
  .role-card .role-desc { color: var(--muted); font-size: 11px; line-height: 1.4; }
  .role-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
  .role-dot.admin { background: #ff9e6b; }
  .role-dot.editor { background: #00D4FF; }
  .role-dot.viewer { background: #a78bfa; }
  .role-dot.disabled { background: #4b5563; }
  .users-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .users-table th { color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .users-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
  .users-table tr:hover td { background: var(--panel-2); }
  .user-cell { display: flex; align-items: center; gap: 10px; }
  .user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--panel-2); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--text); border: 1px solid var(--border); flex-shrink: 0; }
  .user-meta .un { font-weight: 500; font-size: 13px; }
  .user-meta .ue { color: var(--muted); font-size: 11px; font-family: ui-monospace, "SF Mono", Menlo, monospace; margin-top: 1px; }
  .role-select { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 5px 26px 5px 10px; font-size: 12px; font-family: inherit; cursor: pointer; }
  /* Read-only role label shown to non-admins (members / viewers). Plain
     text styled to match the dropdown's vertical rhythm so the column
     doesn't look broken next to the role column for admins. */
  .role-readonly { display: inline-block; color: var(--text); padding: 5px 0; font-size: 12px; font-family: inherit; }
  .status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 10px; font-size: 11px; font-weight: 500; }
  .status-pill::before { content: "●"; font-size: 7px; }
  .status-pill.active { background: rgba(var(--success-rgb), 0.15); color: var(--success); }
  .status-pill.pending { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
  .status-pill.disabled { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
  .row-action { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 4px; font-size: 16px; line-height: 1; }
  .row-action:hover { background: var(--panel-2); color: var(--text); }
  /* §4.1: full-width accordion rows replace the cramped 3-across grid. */
  .section-help-link { font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: none; margin-left: 10px; }
  .section-help-link:hover { color: var(--accent); text-decoration: underline; }
  .integrations-grid { display: flex; flex-direction: column; gap: 12px; }
  /* Accordion integration row. The head is the full-width clickable summary;
     the body holds the (heavy) config and is hidden until expanded. */
  .integration-card.accordion { padding: 0; overflow: hidden; }
  .integration-card.accordion .accordion-head { margin-bottom: 0; padding: 14px 18px; cursor: pointer; gap: 12px; }
  .integration-card.accordion .accordion-head:hover { background: var(--panel); }
  .integration-card.accordion.open .accordion-head { border-bottom: 1px solid var(--border); }
  .accordion-head-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
  .accordion-manage { font-size: 12px; color: var(--accent); font-weight: 600; }
  .accordion-head .setup-guide-link { font-size: 11px; color: var(--muted); text-decoration: none; white-space: nowrap; }
  .accordion-head .setup-guide-link:hover { color: var(--accent); text-decoration: underline; }
  .accordion-chevron { color: var(--muted); font-size: 13px; transition: transform 0.15s ease; }
  .integration-card.accordion.open .accordion-chevron { transform: rotate(90deg); }
  .accordion-body { padding: 16px 18px 18px 18px; }
  @media (max-width: 700px) {
    .accordion-head .setup-guide-link, .accordion-manage { display: none; }
  }
  /* Live-telemetry (OTEL) method body. */
  .otel-cta { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 18px; text-align: center; }
  .otel-cta .btn { background: rgba(0,212,255,0.14); color: var(--accent); border: 1px solid rgba(0,212,255,0.35); }
  .otel-cta .btn:hover { background: rgba(0,212,255,0.22); }
  .otel-reveal { background: rgba(0,212,255,0.06); border: 1px solid rgba(0,212,255,0.3); border-radius: 8px; padding: 14px; margin-bottom: 16px; }
  .otel-reveal-head { font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 8px; }
  .otel-keys-table { width: 100%; border-collapse: collapse; font-size: 12px; }
  .otel-keys-table th, .otel-keys-table td { padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--border); }
  .otel-keys-table th { color: var(--muted); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: 0.3px; }
  .otel-keys-table tr.revoked { opacity: 0.5; }
  .otel-revoke-btn { background: transparent; border: 1px solid var(--border); color: var(--muted); cursor: pointer; padding: 3px 10px; border-radius: 5px; font-size: 11px; }
  .otel-revoke-btn:hover { border-color: var(--danger, #ef4444); color: var(--danger, #ef4444); }
  .otel-issue-row { display: flex; gap: 8px; align-items: center; }
  .otel-issue-row .form-input { flex: 1; }
  .integrations-help { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; margin-bottom: 16px; display: grid; gap: 10px; }
  .integrations-help .help-row { font-size: 12px; color: var(--text); line-height: 1.55; }
  .integrations-help .help-row strong { color: var(--text); }
  .integrations-help .help-row em { color: var(--accent); font-style: normal; font-weight: 500; }
  .integrations-help .help-tag { display: inline-block; min-width: 110px; padding: 1px 8px; margin-right: 8px; border-radius: 10px; background: rgba(0,212,255,0.12); color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: 0.2px; text-align: center; }
  .sync-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 11px; color: var(--muted); margin: 6px 0 12px 0; }
  .sync-meta .sm-item { display: inline-flex; align-items: baseline; gap: 4px; }
  .sync-meta .sm-key { color: var(--muted); }
  .sync-meta .sm-val { color: var(--text); font-family: ui-monospace, monospace; }
  .scope-line { font-size: 11px; color: var(--muted); margin: 2px 0 12px 0; line-height: 1.5; }
  .scope-line code { background: var(--panel); padding: 1px 6px; border-radius: 3px; font-size: 10.5px; color: var(--text); }
  .tier-bar { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; }
  .tier-bar label { font-size: 11px; color: var(--muted); display: block; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.3px; }
  .tier-bar .form-select { width: 100%; }
  .tier-locked-note { background: rgba(255, 158, 107, 0.08); border: 1px solid rgba(255, 158, 107, 0.25); border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; font-size: 11.5px; color: var(--text); line-height: 1.5; }
  .tier-locked-note .lock-icon { color: var(--c-marketing); margin-right: 4px; font-weight: 700; }
  .tier-locked-note strong { color: var(--c-marketing); }
  .method-toggle button.disabled { opacity: 0.4; cursor: not-allowed; }
  .method-toggle button.disabled:hover { background: transparent; }
  .tier-matrix-wrap { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; }
  .tier-matrix-wrap summary { cursor: pointer; font-size: 11.5px; color: var(--muted); list-style: none; padding: 4px 0; }
  .tier-matrix-wrap summary::-webkit-details-marker { display: none; }
  .tier-matrix-wrap summary::before { content: '▸ '; color: var(--accent); }
  .tier-matrix-wrap[open] summary::before { content: '▾ '; }
  .tier-matrix-wrap summary:hover { color: var(--text); }
  .tier-matrix { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 11px; }
  .tier-matrix th, .tier-matrix td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--border); }
  .tier-matrix th { color: var(--muted); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: 0.3px; }
  .tier-matrix tr.current { background: rgba(0, 212, 255, 0.06); }
  .tier-matrix tr.current td:first-child { color: var(--accent); font-weight: 600; }
  .tier-matrix .yes { color: var(--success); font-weight: 600; }
  .tier-matrix .no { color: #6b7280; }
  .tier-matrix .partial { color: #fbbf24; font-weight: 600; }
  .tier-matrix td:first-child { font-weight: 500; color: var(--text); }
  .integration-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
  .integration-card.connected { border-color: rgba(var(--success-rgb), 0.3); }
  .integration-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .integration-head .provider { display: flex; align-items: center; gap: 10px; }
  .integration-head .logo { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: var(--bg); }
  .integration-head .logo.anthropic { background: #cc785c; }
  .integration-head .logo.openai { background: #10a37f; }
  .integration-head .logo.google { background: #4285f4; }
  .integration-head .name { font-weight: 600; font-size: 14px; }
  .integration-head .sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
  .form-field { margin-bottom: 12px; }
  .form-field label { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
  .form-input { width: 100%; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font-size: 12px; font-family: ui-monospace, "SF Mono", Menlo, monospace; box-sizing: border-box; }
  .form-input:focus { outline: none; border-color: var(--accent); }
  .form-select { width: 100%; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font-size: 12px; font-family: inherit; cursor: pointer; }
  .key-wrap { display: flex; gap: 6px; }
  .key-wrap .form-input { flex: 1; }
  .show-btn { background: var(--panel); border: 1px solid var(--border); color: var(--muted); padding: 0 12px; border-radius: 6px; cursor: pointer; font-size: 11px; }
  .show-btn:hover { color: var(--text); }
  .integration-actions { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
  /* Inline text button that reads as a link (e.g. "View history"). */
  .linklike { background: none; border: none; padding: 0; font: inherit; color: var(--accent, #4a9eff); cursor: pointer; text-decoration: underline; }
  .test-result { font-size: 11px; margin-top: 8px; min-height: 14px; color: var(--muted); }
  .test-result.ok { color: var(--success); }
  .test-result.err { color: #ff6b6b; }
  .invite-modal { position: fixed; inset: 0; background: rgba(15,20,25,0.75); display: none; align-items: center; justify-content: center; z-index: 10000; }
  .invite-modal.open { display: flex; }
  .invite-modal .modal-inner { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 22px; max-width: 420px; width: 100%; }
  .invite-modal h3 { margin: 0 0 12px 0; font-size: 16px; }
  .invite-modal .mod-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

  /* Dataset sync-history popup (Settings → Datasets, live-feed row). Wider
     than the invite modal and scrollable since a feed can accrue many runs. */
  .history-modal { position: fixed; inset: 0; background: rgba(15,20,25,0.75); display: none; align-items: flex-start; justify-content: center; z-index: 10000; padding: 8vh 5vw; }
  .history-modal.open { display: flex; }
  .history-modal .modal-inner { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 22px; max-width: 600px; width: 100%; max-height: 84vh; overflow-y: auto; }
  .history-modal h3 { margin: 0 0 4px 0; font-size: 16px; text-transform: none; letter-spacing: normal; color: var(--text); }
  .history-modal .mod-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
  .history-table { width: 100%; border-collapse: collapse; margin-top: 14px; }
  .history-table th { color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
  .history-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text); }
  .history-table th.num, .history-table td.num { text-align: right; }
  /* Link-styled button — the "View history" affordance in the feed row. */
  .link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-size: 11px; text-decoration: underline; font-family: inherit; }
  .link-btn:hover { filter: brightness(1.15); }


  /* Row action menu */
  .row-action-wrap { position: relative; display: inline-block; }
  .row-menu { position: absolute; right: 0; top: 28px; min-width: 200px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 100; display: none; padding: 4px 0; }
  .row-menu.open { display: block; }
  .row-menu .mi { display: block; width: 100%; text-align: left; background: transparent; border: 0; padding: 8px 14px; font-size: 12px; color: var(--text); cursor: pointer; font-family: inherit; }
  .row-menu .mi:hover { background: var(--panel-2); }
  .row-menu .mi.danger { color: #ff6b6b; }
  .row-menu .mi.danger:hover { background: rgba(255, 107, 107, 0.08); }
  .row-menu .mi.disabled { color: var(--muted); cursor: not-allowed; }
  .row-menu .mi.disabled:hover { background: transparent; }
  .row-menu .mi-sep { height: 1px; background: var(--border); margin: 4px 0; }
  /* Confirm dialog */
  .confirm-modal { position: fixed; inset: 0; background: rgba(15,20,25,0.75); display: none; align-items: center; justify-content: center; z-index: 11000; }  /* chrome band: above any stacked modal (10000 + depth*10) */
  .confirm-modal.open { display: flex; }
  .confirm-modal .modal-inner { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 22px; max-width: 420px; width: 100%; }
  .confirm-modal h3 { margin: 0 0 8px 0; font-size: 16px; }
  .confirm-modal p { color: var(--muted); font-size: 13px; margin: 0 0 18px 0; line-height: 1.5; }
  .confirm-modal .mod-actions { display: flex; gap: 8px; justify-content: flex-end; }
  .btn-danger { background: #ff6b6b; color: white; }
  /* v74.6: keyboard shortcuts overlay */
  .kbd-overlay { position: fixed; inset: 0; background: rgba(15,20,25,0.75); display: none; align-items: flex-start; justify-content: center; z-index: 10001; padding: 8vh 4vw; }
  .kbd-overlay.open { display: flex; }
  .kbd-modal { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; max-width: 560px; width: 100%; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
  .kbd-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
  .kbd-head h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); }
  .kbd-close { background: transparent; border: 1px solid var(--border); color: var(--muted); cursor: pointer; padding: 6px 12px; border-radius: 6px; font-size: 12px; font-family: inherit; }
  .kbd-close:hover { color: var(--text); border-color: var(--accent); }
  .kbd-body { display: flex; flex-direction: column; gap: 20px; }
  .kbd-section h3 { margin: 0 0 10px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
  .kbd-list { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; margin: 0; font-size: 13px; }
  .kbd-list dt { display: flex; gap: 4px; align-items: center; }
  .kbd-list dd { margin: 0; color: var(--text); display: flex; align-items: center; }
  kbd { background: var(--bg); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 2px 6px; font-family: ui-monospace, monospace; font-size: 11px; color: var(--text); min-width: 18px; text-align: center; }
  /* v74.4: search row — narrow, paired with status announcer for a11y. */
  .search-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
  .search-input { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; color: var(--text); font-size: 13px; font-family: inherit; min-width: 280px; max-width: 360px; }
  .search-input:focus { outline: none; border-color: var(--accent); }
  .search-input::placeholder { color: var(--muted); }
  .search-status { font-size: 12px; color: var(--muted); }
  /* v74.3: toast stack — multiple notifications visible at once. */
  .toast-stack { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column-reverse; gap: 8px; z-index: 11010; pointer-events: none; max-width: 360px; }  /* chrome band: toasts above everything incl. stacked modals + confirm */
  .toast { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px 12px 36px; font-size: 13px; color: var(--text); box-shadow: 0 8px 24px rgba(0,0,0,0.4); position: relative; pointer-events: auto; transform: translateX(120%); opacity: 0; transition: transform 0.2s, opacity 0.2s; display: flex; align-items: center; gap: 8px; }
  .toast.show { transform: translateX(0); opacity: 1; }
  .toast::before { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-weight: 700; }
  /* legacy kinds — ok/err — preserved for backward compatibility */
  .toast.ok::before, .toast.success::before  { content: "✓"; color: var(--success); }
  .toast.err::before, .toast.error::before   { content: "✗"; color: #ff6b6b; }
  .toast.warn::before                        { content: "!"; color: #fbbf24; }
  .toast.info::before                        { content: "i"; color: #00D4FF; font-style: italic; font-family: serif; }
  .toast-msg { flex: 1; min-width: 0; word-wrap: break-word; }
  .toast-close { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 0 4px; font-size: 16px; line-height: 1; flex-shrink: 0; }
  .toast-close:hover { color: var(--text); }


  .method-toggle { display: inline-flex; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 2px; margin-bottom: 14px; }
  .method-toggle button { background: transparent; border: 0; color: var(--muted); padding: 5px 11px; font-size: 11px; font-weight: 500; cursor: pointer; border-radius: 4px; font-family: inherit; }
  .method-toggle button.active { background: var(--panel-2); color: var(--text); }
  .method-toggle button:hover:not(.active) { color: var(--text); }
  .drop-zone { border: 1.5px dashed var(--border); border-radius: 8px; padding: 18px 14px; text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; margin-bottom: 12px; display: block; }
  .drop-zone:hover, .drop-zone.dragging { border-color: var(--accent); background: rgba(0,212,255,0.04); }
  .drop-zone .dz-icon { font-size: 22px; color: var(--muted); margin-bottom: 6px; }
  .drop-zone .dz-text { font-size: 12px; color: var(--text); }
  .drop-zone .dz-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
  .drop-zone input[type=file] { display: none; }
  .upload-meta { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; font-size: 11px; margin-bottom: 12px; }
  .upload-meta .um-name { color: var(--text); font-weight: 500; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
  .upload-meta .um-sub { color: var(--muted); margin-top: 2px; }
  .upload-meta.processing { border-color: rgba(251,191,36,0.4); }
  .upload-meta.ok { border-color: rgba(var(--success-rgb), 0.4); }


  /* Cost tab */
  .cost-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
  .cost-kpi { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
  .cost-kpi .lbl { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
  .cost-kpi .val { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
  .cost-kpi .delta { font-size: 11px; margin-top: 4px; }
  /* Tighter KPI bar on the Cost tab only. The .cost-kpi idiom is also reused by
     the Outcomes closed-won quartile cards (renderOutcomes), which keep the
     original spacing — so scope the density change to #tab-cost, not the base
     rules above, to avoid leaking across tabs. */
  #tab-cost .cost-kpi-grid { gap: 12px; margin-bottom: 14px; }
  #tab-cost .cost-kpi { padding: 10px 16px; }
  #tab-cost .cost-kpi .lbl { margin-bottom: 4px; }
  #tab-cost .cost-kpi .val { font-size: 22px; line-height: 1.2; }
  #tab-cost .cost-kpi .delta { margin-top: 3px; }
  /* Savings recommendations (PLAN-SAVINGS.md S3) — card per recommendation.
     All cards green (savings = win); fidelity is shown by ~/est./◐, not color. */
  #cost-savings-rows.savings-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
  .savings-card { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--success); border-radius: 0 10px 10px 0; padding: 16px 18px; }
  .savings-card-amt { font-size: 26px; font-weight: 700; color: var(--success); font-variant-numeric: tabular-nums; line-height: 1.1; }
  .savings-card-per { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 6px; }
  .savings-card-swap { display: flex; align-items: center; gap: 8px; margin: 12px 0 8px; font-size: 13px; flex-wrap: wrap; }
  .savings-card-swap .swap-pill { border: 1px solid var(--border); padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
  .savings-card-swap .swap-pill.to { color: var(--success); border-color: rgba(var(--success-rgb), 0.45); }
  .savings-card-swap .swap-arrow { color: var(--muted); }
  .savings-card-meta { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
  .savings-card-btn { width: 100%; padding: 8px; font-size: 13px; cursor: pointer; background: none; border: 1px solid var(--border); border-radius: 8px; color: var(--accent); }
  .savings-card-btn:hover { background: rgba(255,255,255,0.04); }
  .savings-card-note { font-size: 12px; color: var(--muted); text-align: center; padding: 8px 0; }
  .savings-disclaimer { grid-column: 1 / -1; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; line-height: 1.5; }
  button.savings-nudge { background: none; border: none; padding: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 11px; text-align: left; }
  button.savings-nudge:hover { text-decoration: underline; }
  .cost-kpi .delta.up { color: #ff6b6b; }
  .cost-kpi .delta.down { color: var(--success); }
  .cost-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .cost-table th { color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .cost-table th.num { text-align: right; }
  .cost-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .cost-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
  .cost-table tr:hover td { background: var(--panel-2); }
  /* Aligned-spend column: shown only when a company.md is configured (JS adds
     .has-aligned to #cost-user-table). Hidden by default so non-adopters see no
     empty column. */
  .cost-table:not(.has-aligned) .col-aligned { display: none; }
  /* Outcomes quartile drilldown: the detail row is one wide cell holding all
     member reps, so the table's row-hover would highlight the whole list.
     Neutralize it and move the hover to each member instead. */
  .cost-table tr.oq-detail-row:hover td { background: transparent; }
  .oq-member { border-radius: 6px; }
  .oq-member:hover { background: var(--panel-2); }
  .budget-bar { background: var(--panel-2); height: 8px; border-radius: 4px; overflow: hidden; margin-top: 8px; }
  .budget-bar .fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--success)); }
  .budget-bar .fill.warn { background: linear-gradient(90deg, var(--accent), #fbbf24); }
  .budget-bar .fill.over { background: linear-gradient(90deg, #fbbf24, #ff6b6b); }


  /* Explore tab — chat UI */
  /* Capped (not full-viewport) so the Data Signals section below it on the
     Explore tab stays discoverable — its top edge peeks above the fold rather
     than sitting a full screen down behind a viewport-tall chat. */
  .explore-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 0; height: clamp(440px, 60vh, 760px); display: flex; flex-direction: column; overflow: hidden; margin-bottom: 20px; }
  /* Initial load shows only the empty-state suggestions. Fit the panel to that
     content so the thread doesn't get an inner scrollbar before any chat exists;
     the fixed height + internal scroll above takes over once messages render. */
  .explore-wrap:has(.empty-state) { height: auto; }
  .explore-head { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; }
  .explore-head .left { display: flex; align-items: center; gap: 10px; }
  .explore-head .model-badge { display: flex; align-items: center; gap: 8px; background: var(--panel-2); padding: 5px 10px; border-radius: 6px; font-size: 12px; }
  .explore-head .model-badge .logo { width: 18px; height: 18px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 10px; color: var(--bg); }
  .explore-head .model-badge .logo.anthropic { background: #cc785c; }
  .explore-head .model-badge .logo.openai { background: #10a37f; }
  .explore-head .model-badge .logo.google { background: #4285f4; }
  .explore-head .model-badge select { background: transparent; color: var(--text); border: 0; font-size: 12px; cursor: pointer; font-family: inherit; padding: 0 12px 0 0; }
  .explore-head .model-badge select option { background: var(--panel); }
  .explore-head .clear-btn { background: transparent; border: 1px solid var(--border); color: var(--muted); cursor: pointer; padding: 6px 12px; border-radius: 6px; font-size: 12px; font-family: inherit; }
  .explore-head .clear-btn:hover { color: var(--text); background: var(--panel-2); }
  .msg-thread { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; }
  .empty-state { text-align: center; color: var(--muted); padding: 16px 20px; font-size: 13px; }
  .empty-state h3 { color: var(--text); font-size: 18px; margin: 0 0 8px 0; }
  .empty-state p { margin: 0 0 14px 0; max-width: 460px; margin-left: auto; margin-right: auto; line-height: 1.5; }
  .suggested-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; max-width: 860px; margin: 0 auto; }
  .suggested-prompt { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; text-align: left; cursor: pointer; font-size: 12px; color: var(--text); transition: border-color 0.15s, background 0.15s; font-family: inherit; }
  .suggested-prompt:hover { border-color: var(--accent); background: rgba(0, 212, 255, 0.05); }
  .suggested-prompt .sp-tag { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
  .msg { display: flex; gap: 12px; max-width: 100%; }
  .msg.user { justify-content: flex-end; }
  .msg .bubble { padding: 12px 16px; border-radius: 12px; font-size: 13px; line-height: 1.5; max-width: 100%; }
  .msg.user .bubble { background: var(--accent); color: var(--bg); max-width: 70%; }
  .msg.assistant { flex-direction: row; align-items: flex-start; }
  .msg.assistant .bubble { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); width: 100%; }
  .msg.assistant .avatar { width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; color: var(--bg); }
  .msg.assistant .avatar.anthropic { background: #cc785c; }
  .msg.assistant .avatar.openai { background: #10a37f; }
  .msg.assistant .avatar.google { background: #4285f4; }
  .bubble .msg-text { white-space: pre-wrap; }
  .bubble .msg-table-wrap { margin-top: 12px; overflow-x: auto; }
  .bubble table.msg-table { width: 100%; border-collapse: collapse; font-size: 12px; }
  .bubble table.msg-table th { color: var(--muted); font-weight: 500; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
  .bubble table.msg-table th.num { text-align: right; }
  .bubble table.msg-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
  .bubble table.msg-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
  .bubble table.msg-table tr:last-child td { border-bottom: 0; }
  .bubble .msg-chart-wrap { margin-top: 12px; height: 220px; position: relative; }
  .bubble .msg-foot { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; gap: 8px; font-size: 11px; color: var(--muted); }
  .bubble .msg-foot button { background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 4px; padding: 3px 8px; font-size: 11px; cursor: pointer; font-family: inherit; }
  .bubble .msg-foot button:hover { color: var(--text); background: var(--panel); }
  .typing { display: inline-flex; gap: 4px; padding: 4px 0; }
  .typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: t 1.4s infinite ease-in-out; }
  .typing span:nth-child(1) { animation-delay: 0s; }
  .typing span:nth-child(2) { animation-delay: 0.2s; }
  .typing span:nth-child(3) { animation-delay: 0.4s; }
  @keyframes t { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-4px); opacity: 1; } }
  .msg-input-wrap { padding: 14px 20px; border-top: 1px solid var(--border); flex-shrink: 0; }
  .msg-input { display: flex; gap: 10px; align-items: flex-end; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; transition: border-color 0.15s; }
  .msg-input:focus-within { border-color: var(--accent); }
  .msg-input textarea { flex: 1; background: transparent; border: 0; color: var(--text); resize: none; font-family: inherit; font-size: 13px; outline: none; max-height: 120px; min-height: 20px; }
  .msg-input textarea::placeholder { color: var(--muted); }
  .send-btn { background: var(--accent); color: var(--bg); border: 0; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
  .send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
  .send-btn:hover:not(:disabled) { filter: brightness(1.1); }
  .input-hint { color: var(--muted); font-size: 10px; margin-top: 6px; text-align: right; }


  /* Stacked output bars (effort segmented) */
  .dense-bar .stack-track { flex: 1; height: 14px; background: rgba(255,255,255,0.04); border-radius: 3px; overflow: hidden; display: flex; }
  .dense-bar .stack-seg { height: 100%; transition: filter 0.1s; cursor: pointer; }
  .dense-bar .stack-seg:hover { filter: brightness(1.3); }
  /* Effort legend strip */
  .effort-legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); margin-bottom: 12px; align-items: center; flex-wrap: wrap; }
  .effort-legend .lg-item { display: inline-flex; align-items: center; gap: 5px; }
  .effort-legend .lg-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
  /* Pagination */
  .pp-pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px 4px; gap: 16px; flex-wrap: wrap; }
  .pp-pagination .status { color: var(--muted); font-size: 12px; }
  .pp-pagination .controls { display: flex; align-items: center; gap: 6px; }
  .pp-pagination .ctl-btn { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); padding: 5px 10px; font-size: 12px; border-radius: 5px; cursor: pointer; font-family: inherit; min-width: 30px; }
  .pp-pagination .ctl-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
  .pp-pagination .ctl-btn:disabled { opacity: 0.4; cursor: not-allowed; }
  .pp-pagination .ctl-btn.active { background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 600; }
  .pp-pagination .page-size { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 5px; padding: 5px 8px; font-size: 12px; font-family: inherit; cursor: pointer; }


  /* Custom instant tooltip */
  .tt-pop { position: fixed; display: none; background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 8px 12px; font-size: 12px; line-height: 1.4; box-shadow: 0 6px 18px rgba(0,0,0,0.5); pointer-events: none; z-index: 99999; max-width: 320px; white-space: normal; }
  .tt-pop.open { display: block; }


  /* Cost time-range toggle */
  .cost-time-toggle { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 3px; }
  .cost-time-toggle button { background: transparent; border: 0; color: var(--muted); padding: 6px 12px; font-size: 11px; font-weight: 500; cursor: pointer; border-radius: 4px; font-family: inherit; white-space: nowrap; }
  .cost-time-toggle button:hover { color: var(--text); }
  .cost-time-toggle button.active { background: var(--panel); color: var(--text); }


  /* Glossary */
  .glossary-nav { position: sticky; top: 10px; display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 20px; z-index: 50; }
  .glossary-nav a { color: var(--muted); text-decoration: none; font-size: 12px; padding: 5px 10px; border-radius: 4px; transition: background 0.1s, color 0.1s; }
  .glossary-nav a:hover { color: var(--text); background: var(--panel-2); }
  .glossary-section { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 22px; margin-bottom: 20px; scroll-margin-top: 80px; }
  .glossary-section h2 { margin: 0 0 4px 0; font-size: 17px; font-weight: 600; }
  .glossary-section .section-sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
  .glossary-grid { display: grid; grid-template-columns: 220px 1fr; gap: 14px 24px; align-items: baseline; }
  @media (max-width: 700px) { .glossary-grid { grid-template-columns: 1fr; gap: 4px 0; } .glossary-grid dt { margin-top: 12px; } }
  .glossary-grid dt { font-weight: 600; font-size: 13px; color: var(--text); }
  .glossary-grid dt .slug { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px; color: var(--muted); margin-left: 6px; font-weight: 400; }
  .glossary-grid dd { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
  .glossary-section h3.g-lane { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 28px 0 12px; font-size: 13px; font-weight: 500; color: var(--muted); }
  .glossary-section h3.g-lane:first-of-type { margin-top: 10px; }
  .g-admin-note { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.5px; color: #e8cf6b; border: 1px solid rgba(232,207,107,0.4); border-radius: 4px; padding: 1px 6px; font-weight: 600; }
  .glossary-grid dd .ex { color: var(--text); font-style: italic; font-size: 12px; margin-top: 4px; display: block; }
  .glossary-grid dd .stat { color: var(--text); font-size: 11px; font-family: ui-monospace, monospace; }
  .topic-color-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
  .formula { background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 14px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; margin: 8px 0; line-height: 1.7; color: var(--text); white-space: pre-wrap; }
  .tier-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
  .tier-badges .chip { font-size: 11px; padding: 3px 8px; border-radius: 10px; }


  /* Global dashboard time filter */
  .global-time { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px; margin-bottom: 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; position: sticky; top: 8px; z-index: 100; backdrop-filter: blur(8px); background: rgba(26, 31, 41, 0.92); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4); }
  .global-time::before { content: ""; position: absolute; inset: -8px 0 0 0; background: var(--bg); z-index: -1; pointer-events: none; }
  .global-time .gt-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
  .global-time .gt-range { color: var(--muted); font-size: 12px; font-family: ui-monospace, "SF Mono", Menlo, monospace; margin-left: auto; }


  /* ============================================================ */
  /* v74.7: Print stylesheet — light theme, expanded layout,      */
  /* hide chrome that doesn't belong in a printed report.         */
  /* ============================================================ */
  @media print {
    /* Flip palette to light so it doesn't burn ink. */
    :root {
      --bg: #ffffff;
      --panel: #ffffff;
      --text: #111827;
      --muted: #4b5563;
      --border: #e5e7eb;
    }
    body { background: #ffffff !important; color: #111827 !important; padding: 0; }
    /* Hide interactive chrome that doesn't translate to print. */
    .skip-link,
    .tab-nav,
    .global-time,
    .search-row,
    .pp-pagination,
    .toast-stack,
    .heatmap-popover,
    .drill-overlay,
    .glossary-overlay,
    .glossary-trigger,
    .settings-overlay,
    .settings-trigger,
    .kbd-overlay,
    .invite-overlay,
    .confirm-overlay,
    .explore-wrap,
    .topic-toggle-row,
    .output-toggle-row,
    .toggle-row,
    .ctl-btn,
    .drill-export,
    .drill-close,
    .view-all-btn,
    .agent-toggle,
    .agent-artifact-btn,
    .pp-arrow,
    .row-menu,
    .row-menu-btn,
    .integration-card,
    .help-row {
      display: none !important;
    }
    /* Force every non-active tab pane visible so a single print includes all sections. */
    .tab-pane { display: block !important; page-break-after: always; }
    .tab-pane:last-of-type { page-break-after: auto; }
    /* Expand all person rows so their body content prints. */
    .pp-row-body { display: block !important; }
    .pp-row.open .pp-row-body, .pp-row .pp-row-body { display: block !important; }
    /* Panels become flat sections. */
    .panel { background: transparent; border: 0; box-shadow: none; padding: 0 0 16px; margin-bottom: 16px; page-break-inside: avoid; }
    /* Keep charts at print-friendly sizes. */
    canvas { max-width: 100% !important; height: auto !important; }
    /* Don't break links across pages awkwardly. */
    h1, h2, h3, .topic-card { page-break-after: avoid; }
    table { page-break-inside: avoid; }
    /* Show URLs after links so context survives the medium switch. */
    a[href]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #6b7280; }
  }

  /* ============================================================ */
  /* v74.10: Loading skeleton — shimmer placeholder shown during  */
  /* initial render. Removed once App.UI.Overview.applyTimeFilter */
  /* completes. CSS animation, no JS animation loops.             */
  /* ============================================================ */
  @keyframes sl-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
  }
  .sl-skeleton {
    background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%);
    background-size: 200% 100%;
    animation: sl-shimmer 1.4s linear infinite;
    border-radius: 4px;
    color: transparent;
  }
  .sl-skeleton-line { height: 1em; margin: 4px 0; }
  .sl-skeleton-block { min-height: 100px; }
  /* Hide skeletons once main content is populated. */
  body.sl-ready .sl-skeleton { display: none; }

  /* ============================================================ */
  /* v74.11: Mobile responsive pass — phones (≤768px wide).        */
  /* Stack grids, scroll the tab nav horizontally, shrink padding.*/
  /* ============================================================ */
  @media (max-width: 768px) {
    body { padding: 12px; font-size: 14px; }
    h1 { font-size: 18px; }
    h2 { font-size: 14px; }
    .caveat { font-size: 12px; padding: 10px 12px; }
    .panel { padding: 14px; margin-bottom: 14px; border-radius: 8px; }
    /* Tab nav becomes horizontally scrollable so 6 tabs still fit on phone. */
    .tab-nav { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
    .tab-btn { padding: 10px 14px; font-size: 13px; white-space: nowrap; }
    /* Sticky time-bar — full-width range label drops below toggles on phone. */
    .global-time { padding: 8px 12px; gap: 8px; }
    .global-time .gt-range { margin-left: 0; width: 100%; order: 99; }
    .global-time button { padding: 5px 9px; font-size: 11px; }
    /* KPI cards: 2 columns instead of auto-fit. */
    .totals { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat { padding: 10px 12px; }
    .stat .value { font-size: 18px; }
    /* Force any two/three-column grid to stack. */
    .grid-2, .grid-3, .grid-1-2 { grid-template-columns: 1fr; gap: 14px; }
    .chart-wrap { height: 220px; }
    /* People row: layout vertically so dense bars don't squish to 0. */
    .pp-row-top { flex-wrap: wrap; gap: 8px; }
    .pp-bars { width: 100%; }
    /* Drill modal: full-width on phone. */
    .drill-modal { max-width: 100%; }
    .glossary-modal { max-width: 100%; }
    .drill-table { font-size: 11px; }
    .drill-table th, .drill-table td { padding: 6px 4px; }
    /* Search input — wider on small screens since there's a stack layout. */
    .search-input { min-width: 0; width: 100%; max-width: none; }
    .search-row { flex-wrap: wrap; }
    /* Toast — full-width minus margin. */
    .toast-stack { bottom: 12px; right: 12px; left: 12px; max-width: none; }
    /* Keyboard help dialog — narrower padding. */
    .kbd-modal { padding: 16px; }
    .kbd-list { grid-template-columns: 100px 1fr; gap: 6px 12px; font-size: 12px; }
    /* Hide the heatmap popover entirely on phones (hover is meaningless on touch). */
    .heatmap-popover { display: none !important; }
  }

  /* ============================================================ */
  /* v74.12: Color-blind safe palette — uses Okabe-Ito with high  */
  /* lightness contrast so deuteranopia/protanopia/tritanopia all */
  /* parse the topic and tier colors reliably.                    */
  /* Activated by adding `cb-safe` class to <body>.                */
  /* ============================================================ */
  body.cb-safe {
    --c-product:     #0072B2;  /* blue */
    --c-design:      #CC79A7;  /* reddish purple */
    --c-marketing:   #E69F00;  /* orange */
    --c-engineering: #009E73;  /* bluish green */
    --c-operations:  #F0E442;  /* yellow */
    --c-community:   #56B4E9;  /* sky blue */
    --c-sales:       #D55E00;  /* vermilion (Okabe-Ito) */
    --c-finance:     #785EF0;  /* accessible blue-purple (IBM palette) */
    --c-nonwork:     #999999;  /* neutral gray */
    --c-uncat:       #333333;  /* near black */
    --cx-simple:     #009E73;
    --cx-medium:     #0072B2;
    --cx-complex:    #E69F00;
    --cx-deep:       #D55E00;  /* vermillion */
  }

  /* v74.12: appearance settings row */
  .appearance-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel-2); font-size: 13px; line-height: 1.4; }
  .appearance-row input[type=checkbox] { margin-top: 3px; }
  .appearance-row strong { color: var(--text); }

  /* v74.12: per-person row actions */
  .pp-actions { display: flex; gap: 8px; margin-bottom: 16px; }
  .pp-action-btn { background: transparent; border: 1px solid var(--border); color: var(--text); cursor: pointer; padding: 6px 12px; border-radius: 6px; font-size: 12px; font-family: inherit; }
  .pp-action-btn:hover { border-color: var(--accent); color: var(--accent); }

  /* v74.12: drill column visibility menu */
  .drill-cols-wrap { position: relative; }
  .drill-cols-menu { position: absolute; top: 100%; right: 0; margin-top: 4px; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 8px; min-width: 180px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 10010; }
  .drill-cols-menu label { display: flex; gap: 8px; align-items: center; padding: 4px 6px; font-size: 12px; cursor: pointer; }
  .drill-cols-menu label:hover { background: var(--panel-2); border-radius: 4px; }
  /* When a column is hidden, set table cells display:none via [data-hide-col=col]. */
  /* Generated dynamically by JS using CSS classes col-hide-<key>. */

  /* v74.13: notification dot on a tab button. Position absolute, top-right. */
  .tab-btn { position: relative; }
  .tab-btn[data-unread="1"]::after { content: ""; position: absolute; top: 8px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); border: 2px solid var(--bg); }

  /* v74.14: bulk-action bar shown above the Users table when rows are selected */
  .bulk-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: rgba(0,212,255,0.08); border: 1px solid var(--accent); border-radius: 6px; padding: 10px 14px; margin-bottom: 12px; flex-wrap: wrap; }
  /* `display: flex` above wins against the [hidden] attribute's default
     `display: none`. Without this explicit override, members (whose
     bulk-bar is gated via data-require-action) saw an empty blue-
     bordered rectangle instead of nothing. */
  .bulk-bar[hidden] { display: none; }
  .bulk-count { font-size: 13px; font-weight: 500; color: var(--accent); }
  .bulk-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .bulk-clear { background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; padding: 0 6px; line-height: 1; }
  .bulk-clear:hover { color: var(--text); }

  /* v74.15: custom date range picker */
  .date-row { display: flex; gap: 12px; flex-wrap: wrap; }
  .date-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); flex: 1; min-width: 120px; }
  .date-row input[type=date] { background: var(--panel-2); border: 1px solid var(--border); border-radius: 4px; padding: 6px 8px; color: var(--text); font-family: inherit; font-size: 13px; }
  .date-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

  /* v74.16: comparison toggle + delta chips on KPI values */
  .compare-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
  .kpi-delta { font-size: 11px; font-weight: 500; padding: 2px 6px; border-radius: 4px; margin-left: 6px; vertical-align: middle; font-family: ui-monospace, monospace; }
  .kpi-delta.up   { background: rgba(var(--success-rgb), 0.15); color: var(--success); }
  .kpi-delta.down { background: rgba(255,107,107,0.15); color: #ff6b6b; }
  .kpi-delta.flat { background: rgba(139,149,168,0.15); color: var(--muted); }

  /* v74.17: thread viewer side panel — slides in from the right */
  .thread-overlay { position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 100vw; background: var(--panel); border-left: 1px solid var(--border); transform: translateX(110%); transition: transform 0.2s; z-index: 10005;  /* stack participant (Modal.register) — lifts itself when stacked; must stay BELOW the 11000 chrome band */ display: flex; flex-direction: column; }
  .thread-overlay.open { transform: translateX(0); box-shadow: -8px 0 32px rgba(0,0,0,0.5); }
  .thread-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
  .thread-title { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.4; }
  .thread-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
  .thread-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
  .thread-body dl { display: grid; grid-template-columns: 100px 1fr; gap: 8px 12px; margin: 0; font-size: 12px; }
  .thread-body dt { color: var(--muted); }
  .thread-body dd { margin: 0; color: var(--text); font-variant-numeric: tabular-nums; }
  .thread-note { margin-top: 24px; padding: 12px; border: 1px dashed var(--border); border-radius: 6px; font-size: 11px; color: var(--muted); line-height: 1.5; }
  .thread-close { background: transparent; border: 1px solid var(--border); color: var(--text); cursor: pointer; width: 32px; height: 32px; border-radius: 6px; font-size: 22px; line-height: 1; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-family: inherit; }
  .thread-close:hover { background: var(--hover, rgba(255,255,255,0.05)); border-color: var(--accent); color: var(--accent); }
  .thread-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  @media (max-width: 768px) {
    .thread-overlay { width: 100%; }
  }

/* Site header with user menu */
.site-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.site-header__title { flex:1; min-width:0; }
.site-header__user { display:flex; align-items:center; gap:10px; padding-top:6px; flex-shrink:0; }

/* Site footer — quiet page chrome at the bottom of every tab. Mirrors the
   header's space-between layout; muted 12px text on a top border so it reads as
   a boundary, not a panel. The wordmark reuses the header's brand treatment at
   a smaller size (the `h1 .brand` color rule is scoped, so size is repeated
   here; the shared `.brand .cy` rule colors the cyan parts). Stacks on narrow
   viewports. */
.site-footer { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-top:32px; padding-top:18px; border-top:1px solid var(--border); color:var(--muted); font-size:12px; }
.site-footer__brand { display:flex; align-items:center; gap:10px; min-width:0; }
.site-footer__brand .brand { color: var(--text); font-weight:700; letter-spacing:-0.2px; font-size:13px; }
.site-footer__copy { color: var(--muted); }
.site-footer__links { display:flex; align-items:center; gap:16px; }
.site-footer__links a { color: var(--muted); text-decoration:none; }
.site-footer__links a:hover { color: var(--accent); }
@media (max-width: 768px) { .site-footer { flex-direction:column; align-items:flex-start; gap:8px; } }
.user-menu__name { font-size:13px; color:var(--muted); }
.user-menu__logout { font-size:12px; padding:4px 10px; border:1px solid var(--border); border-radius:5px; background:var(--surface); color:var(--text); cursor:pointer; transition:background .15s; }
.user-menu__logout:hover { background:var(--bg); }

  /* Erase action — danger variant of pp-action-btn (GDPR right-to-erasure) */
  .pp-action-btn.danger { color: #ff6b6b; border-color: rgba(255,107,107,0.3); }
  .pp-action-btn.danger:hover { background: rgba(255,107,107,0.08); border-color: #ff6b6b; color: #ff6b6b; }

  /* Cost-tab dense-bar rows (by topic / by tier) */
  .db-row { display: grid; grid-template-columns: 160px 1fr 90px; align-items: center; gap: 12px; font-size: 12px; }
  .db-row .db-name { color: var(--text); font-weight: 500; display: flex; flex-direction: column; gap: 2px; }
  .db-row .db-name .db-sub { color: var(--muted); font-size: 10px; font-weight: 400; }
  .db-row .db-bar { height: 14px; background: rgba(255,255,255,0.04); border-radius: 3px; overflow: hidden; }
  .db-row .db-bar .db-seg { height: 100%; transition: width 0.3s ease; }
  .db-row .db-val { color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }

  /* ===== Data Signals table (Explore tab) ===== */
  #data-signals { margin-top: 20px; margin-bottom: 16px; }
  #data-signals .dsig-head-row, #recommendations .dsig-head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
  #data-signals .dsig-head-row h2, #recommendations .dsig-head-row h2 { margin: 0; }
  #data-signals .dsig-head-actions, #recommendations .dsig-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  #rec-digest-btn.is-subscribed { color: #8fd6a4; border-color: rgba(143,214,164,0.5); background: rgba(143,214,164,0.10); }
  /* Recommendations type (archetype) filter — single-select pills above the cards. */
  #recommendations .rec-filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
  #recommendations .rec-filter-pill { background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); padding: 4px 11px; font-size: 12px; border-radius: 999px; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 6px; }
  #recommendations .rec-filter-pill:hover { border-color: var(--accent); color: var(--text); }
  #recommendations .rec-filter-pill.active { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 600; }
  #recommendations .rec-filter-count { font-variant-numeric: tabular-nums; opacity: 0.7; }
  #recommendations .rec-filter-pill.active .rec-filter-count { opacity: 0.85; }
  #data-signals .dsig-count {
    font-size: 12px; font-weight: 600; color: var(--muted);
    background: var(--panel-2); border-radius: 10px; padding: 1px 8px; margin-left: 8px;
    vertical-align: middle;
  }
  /* ----- Glossary tree: category (lane) → signal type (rule) → signal -----
     A compact, expandable replacement for the old flat card list. Each level is
     one row; children indent under their parent. Reuses .dsig-chip-<lane> for the
     category badge and #dsig-breakdown .aus-bd for the in-place detail drawer. */
  .dsig-tree, .dsig-types, .dsig-sigs { display: flex; flex-direction: column; gap: 2px; }
  .dsig-cat-row, .dsig-type-row, .dsig-sig-row {
    display: flex; align-items: center; gap: 8px; border-radius: 6px;
    padding: 6px 8px; line-height: 1.3;
    transition: background .12s ease, box-shadow .12s ease;
  }
  .dsig-cat-row, .dsig-type-row, .dsig-sig-row { cursor: pointer; }
  .dsig-type-row { margin-left: 18px; }
  .dsig-sig-row { margin-left: 36px; }
  /* Hover affordance shared by all three tree levels: a cyan-tinted fill plus a
     cyan inset edge on the left, and the caret/labels lift to accent — so every
     row reads interactive on mouse-over, not just the leaf signals. */
  .dsig-cat-row:hover, .dsig-type-row:hover, .dsig-sig-row:hover {
    background: rgba(0,212,255,0.08); box-shadow: inset 2px 0 0 var(--accent);
  }
  .dsig-cat-row:hover > .dsig-cat-caret, .dsig-type-row:hover > .dsig-cat-caret { color: var(--accent); }
  .dsig-type-row:hover .dsig-type-label { color: var(--accent); }
  .dsig-cat-row.is-empty { cursor: default; opacity: 0.45; }
  .dsig-cat-row.is-empty:hover { background: none; box-shadow: none; }
  .dsig-cat-caret {
    flex: 0 0 12px; width: 12px; text-align: center; color: var(--muted);
    font-size: 10px; transition: transform .12s ease, color .12s ease;
  }
  .dsig-cat-row.is-open > .dsig-cat-caret, .dsig-type-row.is-open > .dsig-cat-caret { transform: rotate(90deg); }
  .dsig-cat-count, .dsig-type-count {
    margin-left: auto; font-size: 11px; font-weight: 600; color: var(--muted);
    background: var(--panel-2); border-radius: 10px; padding: 1px 8px;
    font-variant-numeric: tabular-nums; min-width: 22px; text-align: center;
  }
  .dsig-type-label { color: var(--text); font-size: 13px; font-weight: 500; }
  .dsig-sig-dot { flex: 0 0 12px; width: 12px; text-align: center; color: var(--muted); }
  .dsig-sig-what { color: var(--text); font-size: 13px; line-height: 1.35; margin-right: auto; }
  /* Per-signal drill affordances, right-aligned: a cyan "N convs" pill (only
     when evidence exists) plus a chevron that brightens + nudges on hover and
     rotates open when the detail drawer is showing — so the row reads clickable. */
  .dsig-sig-drill {
    font-size: 11px; font-weight: 600; color: var(--accent);
    background: rgba(0,212,255,0.10); border-radius: 10px; padding: 1px 8px;
    font-variant-numeric: tabular-nums; opacity: 0.8;
    transition: opacity .12s ease, background .12s ease;
  }
  .dsig-sig-caret {
    flex: 0 0 12px; width: 12px; text-align: center; color: var(--muted);
    font-size: 14px; opacity: 0.5;
    transition: color .12s ease, opacity .12s ease, transform .12s ease;
  }
  .dsig-sig-row:hover .dsig-sig-drill { opacity: 1; background: rgba(0,212,255,0.18); }
  .dsig-sig-row:hover .dsig-sig-caret { color: var(--accent); opacity: 1; transform: translateX(2px); }
  .dsig-sig-row.dsig-sig-expanded { background: rgba(0,212,255,0.08); }
  .dsig-sig-row.dsig-sig-expanded .dsig-sig-what { color: var(--accent); font-weight: 600; }
  .dsig-sig-row.dsig-sig-expanded .dsig-sig-caret { color: var(--accent); opacity: 1; transform: rotate(90deg); }
  .dsig-sigs > #dsig-breakdown { margin-left: 36px; }
  /* Shared "open the glossary at section X" affordance. .dsig-info-btn is the
     original (Data Signals ⓘ); .glossary-info-btn is the generic alias
     used on panel headers across the Dashboard / Cost / Agent Opportunities tabs. */
  .dsig-info-btn, .glossary-info-btn {
    background: none; border: none; color: var(--muted); cursor: pointer;
    font-size: 14px; line-height: 1; padding: 0 2px; margin-left: 6px;
    vertical-align: middle; opacity: 0.75; transition: opacity .12s ease, color .12s ease;
  }
  .dsig-info-btn:hover, .glossary-info-btn:hover { color: #8fd6ff; opacity: 1; }
  /* ranked card list — full-width single column, matching the Agent
     Opportunities cards (.agent-card): cards fill the panel, no width cap. */
  .dsig-cards { display: flex; flex-direction: column; gap: 12px; }
  .dsig-card {
    background: var(--panel-2); border: 1px solid var(--border);
    border-left: 3px solid var(--border); border-radius: 8px;
    padding: 11px 14px; display: flex; flex-direction: column; gap: 5px;
  }
  .dsig-card.clickable { cursor: pointer; transition: border-color .15s ease, background .15s ease; }
  .dsig-card.clickable:hover { background: rgba(255,255,255,0.03); border-color: var(--muted); }
  .dsig-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
  .dsig-sev-pill { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; flex: 0 0 auto; line-height: 1.35; }
  .dsig-card-what { color: var(--text); font-weight: 600; font-size: 14px; line-height: 1.35; }
  /* Novelty badge on a rec card (is_new / is_escalating). Inline after the
     headline; sized to sit on the headline baseline without bloating the row. */
  .rec-novelty { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.03em;
    text-transform: uppercase; padding: 1px 6px; border-radius: 8px; vertical-align: middle;
    margin-left: 2px; white-space: nowrap; }
  .rec-novelty-new { background: rgba(var(--success-rgb), 0.16); color: var(--success); }
  .rec-novelty-esc { background: rgba(217,164,65,0.18); color: #e6c277; }
  /* Inline "See all recommendations" link in the Recent Recommendations empty
     state — a button (for switch-tab) styled as an accent text link. */
  .rec-recent-link { background: none; border: 0; padding: 0; margin-left: 4px; cursor: pointer;
    color: var(--accent); font: inherit; font-size: inherit; }
  .rec-recent-link:hover { text-decoration: underline; }
  .dsig-card-act  { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
  .dsig-card-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .dsig-foot-drill { color: var(--accent); font-size: 11.5px; margin-left: auto; }
  .dsig-chip {
    font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px;
    background: var(--panel-2); color: var(--text); white-space: nowrap;
  }
  .dsig-chip-trend         { background: rgba(0,212,255,0.16);  color: #8fd6ff; }
  .dsig-chip-person        { background: rgba(255,158,107,0.16); color: #ffb98f; }
  .dsig-chip-cost          { background: rgba(217,164,65,0.18);  color: #e6c277; }
  .dsig-chip-concentration { background: rgba(229,83,75,0.16);   color: #f29089; }
  .dsig-chip-roster        { background: rgba(140,149,168,0.18); color: #aab3c4; }
  .dsig-chip-celebration   { background: rgba(120,200,140,0.16); color: #8fd6a4; }
  .dsig-chip-workload      { background: rgba(193,130,216,0.16); color: #d3a4e6; }
  .dsig-chip-tools         { background: rgba(127,209,192,0.16); color: #8fd6c8; }
  .dsig-chip-source        { background: rgba(176,184,224,0.16); color: #b8c0e8; }
  .dsig-chip-quality       { background: rgba(154,163,181,0.16); color: #aab3c4; }
  .dsig-chip-friction      { background: rgba(229,143,181,0.16); color: #e8a0c2; }
  .dsig-chip-collab        { background: rgba(127,200,224,0.16); color: #8fd0e6; }
  .dsig-chip-governance    { background: rgba(232,207,107,0.16); color: #e8cf6b; }
  .dsig-chip-outcomes      { background: rgba(46,164,128,0.18);  color: #5cc9a7; }
  /* per-lane left accent — matches the chip hue */
  .dsig-card.dsig-lane-trend         { border-left-color: #8fd6ff; }
  .dsig-card.dsig-lane-person        { border-left-color: #ffb98f; }
  .dsig-card.dsig-lane-cost          { border-left-color: #e6c277; }
  .dsig-card.dsig-lane-concentration { border-left-color: #f29089; }
  .dsig-card.dsig-lane-roster        { border-left-color: #aab3c4; }
  .dsig-card.dsig-lane-celebration   { border-left-color: #8fd6a4; }
  .dsig-card.dsig-lane-workload      { border-left-color: #d3a4e6; }
  .dsig-card.dsig-lane-tools         { border-left-color: #8fd6c8; }
  .dsig-card.dsig-lane-source        { border-left-color: #b8c0e8; }
  .dsig-card.dsig-lane-quality       { border-left-color: #aab3c4; }
  .dsig-card.dsig-lane-friction      { border-left-color: #e8a0c2; }
  .dsig-card.dsig-lane-collab        { border-left-color: #8fd0e6; }
  .dsig-card.dsig-lane-governance    { border-left-color: #e8cf6b; }
  .dsig-card.dsig-lane-outcomes      { border-left-color: #5cc9a7; }

  /* Recommended plays (PLAN-RECOMMENDATIONS R2) — reuses the .dsig-card shell;
     these add the per-archetype accent/chip + the member/meta rows. */
  .rec-foot-meta { color: var(--muted); font-size: 11.5px; }
  .rec-artifact-btn {
    margin-left: auto; background: var(--panel-2); border: 1px solid var(--border);
    color: var(--text); padding: 3px 9px; font-size: 11.5px; border-radius: 5px;
    cursor: pointer; font-family: inherit; white-space: nowrap;
    transition: border-color .12s ease, color .12s ease;
  }
  .rec-artifact-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
  .rec-artifact-btn:disabled { opacity: 0.5; cursor: not-allowed; }
  /* Generated-doc review modal (reuses .drill-overlay/.drill-modal chrome) */
  .rec-artifact-modal { max-width: 760px; }
  /* Container only; inner element typography comes from the shared .md-doc block
     (this div carries `md-doc`), so the rec modal and the PRD modal render
     generated markdown identically. */
  .rec-artifact-content { overflow-y: auto; padding: 20px 24px; line-height: 1.6; font-size: 14px; color: var(--text); }
  .rec-artifact-status { display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 14px; padding: 56px 24px; color: var(--muted); text-align: center; font-size: 13.5px; }
  .rec-spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--accent);
    border-radius: 50%; animation: rec-spin 0.7s linear infinite; }
  @keyframes rec-spin { to { transform: rotate(360deg); } }
  .rec-artifact-error { color: #e5534b; }
  @media (prefers-reduced-motion: reduce) { .rec-spinner { animation-duration: 1.6s; } }
  .rec-members { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
  .rec-member-chip {
    background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
    border-radius: 999px; padding: 2px 9px; font-size: 11.5px; line-height: 1.4;
  }
  .rec-member-chip.rec-member-count { color: var(--muted); font-style: italic; }
  /* per-archetype chip hue + left accent (mirrors the Data Signals lane palette) */
  .dsig-chip.rec-chip-coach        { background: rgba(255,158,107,0.16); color: #ffb98f; }
  .dsig-chip.rec-chip-restructure  { background: rgba(229,83,75,0.16);   color: #f29089; }
  .dsig-chip.rec-chip-enable       { background: rgba(127,209,192,0.16); color: #8fd6c8; }
  .dsig-chip.rec-chip-optimize     { background: rgba(90,180,214,0.16);  color: #7fc6e6; }
  .dsig-chip.rec-chip-govern       { background: rgba(232,207,107,0.16); color: #e8cf6b; }
  .dsig-chip.rec-chip-celebrate    { background: rgba(120,200,140,0.16); color: #8fd6a4; }
  .dsig-chip.rec-chip-train        { background: rgba(193,130,216,0.16); color: #d3a4e6; }
  /* Per-archetype accent as a custom property so the SAME hue paints the card's
     left rail AND flows down into the breakdown drawer's left rail — both the card
     and the drawer host carry a .rec-arch-* class, so the var resolves on each and
     the colored line is unbroken from card to drawer. */
  .rec-arch-coach        { --rec-accent: #ffb98f; }
  .rec-arch-restructure  { --rec-accent: #f29089; }
  .rec-arch-enable       { --rec-accent: #8fd6c8; }
  .rec-arch-optimize     { --rec-accent: #7fc6e6; }
  .rec-arch-govern       { --rec-accent: #e8cf6b; }
  .rec-arch-celebrate    { --rec-accent: #8fd6a4; }
  .rec-arch-train        { --rec-accent: #d3a4e6; }
  .dsig-card[class*="rec-arch-"] { border-left-color: var(--rec-accent); }

  /* Base control button — themed pill/button used by the Data Signals
     header, the Recommendations filters, and the Notifications card. Previously
     only `.pp-pagination .ctl-btn` was styled, so every other `.ctl-btn` fell
     back to the raw native button look. The pagination rule is more specific,
     so it still wins where it applies. */
  .ctl-btn {
    background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
    padding: 5px 11px; font-size: 12px; line-height: 1.4; border-radius: 6px;
    cursor: pointer; font-family: inherit; white-space: nowrap;
    transition: border-color .12s ease, color .12s ease, background .12s ease;
  }
  .ctl-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
  .ctl-btn:disabled { opacity: 0.4; cursor: not-allowed; }
  .ctl-btn.active { background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 600; }

  /* Header user menu — account name + gear, right of the brand. */
  #site-user-menu { display: flex; align-items: center; gap: 10px; }

  /* Full-screen glossary view — mirrors .drill-overlay, but
     wider (it carries the roomy two-column .glossary-grid) and with a scrollable
     body so the sticky #glossary-nav anchors stay usable. */
  .glossary-trigger {
    background: transparent; border: none; color: var(--muted);
    cursor: pointer; padding: 5px; line-height: 0; border-radius: 6px;
    transition: color .12s ease, background .12s ease;
  }
  .glossary-trigger:hover { color: var(--text); background: var(--panel-2); }
  .glossary-trigger svg { width: 20px; height: 20px; display: block; }
  .glossary-overlay { position: fixed; inset: 0; background: rgba(15,20,25,0.75); display: none; align-items: flex-start; justify-content: center; z-index: 10000; padding: 5vh 5vw; }
  .glossary-overlay.open { display: flex; }
  .glossary-modal { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; width: 100%; max-width: 1100px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,0.6); }
  .glossary-modal__head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex: none; }
  .glossary-modal__head .title { font-weight: 600; font-size: 15px; }
  .glossary-modal__head .sub { color: var(--muted); font-size: 12px; margin-top: 2px; max-width: 640px; line-height: 1.4; }
  .glossary-modal__body { overflow: auto; flex: 1; padding: 18px 20px 22px; }
  /* The nav was sticky to the page; inside the scrollable modal body it sticks
     to the body's scroll container instead — same behavior, new context. */
  .glossary-modal__body .glossary-nav { top: 0; }
  .glossary-modal__body .glossary-section:last-child { margin-bottom: 0; }

  /* Full-screen Configuration overlay — mirrors .glossary-overlay, but the body
     is a two-column flex (left rail of sub-tabs + a scrollable content column)
     instead of a single scroll. Reuses .settings-section for each block. */
  .settings-trigger {
    background: transparent; border: none; color: var(--muted);
    cursor: pointer; padding: 5px; line-height: 0; border-radius: 6px;
    transition: color .12s ease, background .12s ease;
  }
  .settings-trigger:hover, .settings-trigger[aria-expanded="true"] { color: var(--text); background: var(--panel-2); }
  .settings-trigger svg { width: 20px; height: 20px; display: block; }
  .settings-overlay { position: fixed; inset: 0; background: rgba(15,20,25,0.75); display: none; align-items: flex-start; justify-content: center; z-index: 10000; padding: 5vh 3vw; }
  .settings-overlay.open { display: flex; }
  .settings-modal { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; width: 100%; max-width: 1320px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,0.6); }
  .settings-modal__head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex: none; }
  .settings-modal__head .title { font-weight: 600; font-size: 15px; }
  .settings-modal__head .sub { color: var(--muted); font-size: 12px; margin-top: 2px; max-width: 640px; line-height: 1.4; }
  .settings-modal__body { flex: 1; display: flex; min-height: 0; overflow: hidden; }
  .settings-rail { flex: none; width: 208px; border-right: 1px solid var(--border); padding: 14px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; background: var(--panel); }
  .settings-rail__btn { display: block; width: 100%; text-align: left; background: transparent; border: none; border-left: 2px solid transparent; color: var(--muted); font-family: inherit; font-size: 13px; font-weight: 500; padding: 9px 12px; border-radius: 6px; cursor: pointer; transition: color .12s ease, background .12s ease; }
  .settings-rail__btn:hover { color: var(--text); background: var(--panel-2); }
  .settings-rail__btn.active { color: var(--text); background: var(--panel-2); border-left-color: var(--accent); }
  .settings-content { flex: 1; min-width: 0; overflow-y: auto; padding: 20px 22px 24px; }
  .settings-panel { display: none; }
  .settings-panel.active { display: block; }
  .settings-content .settings-section:last-child { margin-bottom: 0; }
  @media (max-width: 720px) {
    .settings-modal__body { flex-direction: column; }
    .settings-rail { width: auto; flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--border); }
    .settings-rail__btn { border-left: none; border-bottom: 2px solid transparent; }
    .settings-rail__btn.active { border-left-color: transparent; border-bottom-color: var(--accent); }
  }

/* ── Token budget review modal (App.UI.BudgetReview) ───────────────────────
   Reuses .drill-overlay/.drill-modal chrome; these style the inner panels. */
.br-modal { max-width: 760px; }
.br-open-btn { background: var(--panel-2); border: 1px solid var(--border); color: var(--accent);
  border-radius: 6px; padding: 5px 10px; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.br-open-btn:hover { border-color: var(--accent); background: rgba(0,212,255,0.08); }
.br-window { display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 14px 20px; border-bottom: 1px solid var(--border); }
.br-window-label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.br-date { background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font: inherit; font-size: 12.5px; padding: 6px 9px; color-scheme: dark; }
.br-window-note { flex: 1 1 260px; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
#br-body { padding: 18px 20px; }
.br-loading, .br-error { color: var(--muted); font-size: 13px; padding: 8px 0; }
.br-error { color: #ff6b6b; }
.br-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.br-read { border: 1px solid var(--border); border-left: 3px solid var(--muted);
  border-radius: 8px; padding: 12px 14px; margin-bottom: 18px; }
.br-read.br-good { border-left-color: var(--success); background: rgba(52,211,153,0.06); }
.br-read.br-warn { border-left-color: #fbbf24; background: rgba(251,191,36,0.06); }
.br-read.br-bad  { border-left-color: #ff6b6b; background: rgba(255,107,107,0.06); }
.br-read-kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 5px; }
.br-read.br-good .br-read-kicker { color: var(--success); }
.br-read.br-warn .br-read-kicker { color: #fbbf24; }
.br-read.br-bad  .br-read-kicker { color: #ff6b6b; }
.br-read-body { font-size: 13px; line-height: 1.5; color: var(--text); }
.br-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.br-col-head { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px; }
.br-bar-row { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; }
.br-bar { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; margin-bottom: 10px; }
.br-bar-fill { height: 100%; background: var(--accent); }
.br-bar-fill.br-bar-muted { background: var(--c-uncat); }
.br-eff-row { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; margin-bottom: 9px; }
.br-gate { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border); }
.br-gate-label { font-size: 12.5px; color: var(--muted); }
.br-gate-sigs { margin-top: 9px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.br-sig { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.br-sig-chip { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 1px 8px; font-size: 11px; }
.br-sig-good .br-sig-chip { color: var(--success); }
.br-sig-bad .br-sig-chip { color: #ff6b6b; }
.br-yield { margin-top: 18px; border: 1px dashed var(--border); border-radius: 8px; padding: 12px 14px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; opacity: 0.8; }
.br-yield > span:first-child { font-size: 12.5px; color: var(--muted); }
.br-roadmap { font-size: 11px; color: var(--muted); background: var(--panel-2);
  border: 1px solid var(--border); padding: 2px 9px; border-radius: 999px; }
.br-yield .br-muted { flex-basis: 100%; }
.br-muted { color: var(--muted); font-size: 12px; }
.br-mono { font-family: ui-monospace, monospace; color: var(--muted); }
  .br-empty { color: var(--muted); font-size: 13px; line-height: 1.6; padding: 14px 4px 6px; }
  .br-empty-head { color: var(--text); font-size: 14px; font-weight: 600; margin-bottom: 5px; }
  .br-was { color: var(--muted); font-size: 11px; font-weight: 400; margin: 2px 6px 0 0; }
  .br-eff-row .br-was { margin-right: 8px; }
