/* themes.css — R3D3Y3 / PRAXION theme system
 * v1.2 — Default (current LeafFilter look) + R3D3Y3 STUDIOS + PRAXIONS +
 *        Daylight + LeafFilter Modern + multi-portal Agent stack infra.
 * Theme is applied via body[data-theme="..."] attribute, controlled by themes.js.
 * Restricted themes (r3d3eye, praxions, lf-modern) require email gate (jamesd.lhss@gmail.com).
 *
 * ╔═══════════════════════════════════════════════════════════════════════╗
 * ║ THEME RULES — DO NOT VIOLATE                                          ║
 * ╠═══════════════════════════════════════════════════════════════════════╣
 * ║ 1. EVERY theme follows the SAME layout for data and buttons.          ║
 * ║    Sections render in the same order on every theme. Buttons sit in   ║
 * ║    the same positions. Pills go in the same row. Only the VISUAL      ║
 * ║    treatment (colors, fonts, shadows, animation timing) changes.      ║
 * ║                                                                       ║
 * ║ 2. Theme blocks are ALLOWED to override:                              ║
 * ║      - CSS custom properties (--r3d-bg, --r3d-text, --r3d-accent, …)  ║
 * ║      - background / color / border-color                              ║
 * ║      - font-family / font-weight                                      ║
 * ║      - box-shadow / filter                                            ║
 * ║      - animation timing / cubic-bezier curves                         ║
 * ║                                                                       ║
 * ║ 3. Theme blocks are FORBIDDEN from overriding:                        ║
 * ║      - display / flex-direction / grid-template-* (= layout)          ║
 * ║      - order / flex-order (= section reordering)                      ║
 * ║      - position: absolute/fixed for repositioning sections            ║
 * ║      - hiding/showing whole sections (use feature flags instead)      ║
 * ║                                                                       ║
 * ║ 4. Structural layout variants (Timeline, Field Mode, etc.) are NOT    ║
 * ║    themes — they're separate "Card Layout" selectors under Display.   ║
 * ║                                                                       ║
 * ║ 5. User-facing labels use Agent vocabulary. Never "scrape", never     ║
 * ║    "automation". Workers are: GTR AGENT, CRM AGENT, DOC AGENT,        ║
 * ║    INBOX AGENT.                                                       ║
 * ╚═══════════════════════════════════════════════════════════════════════╝
 *
 * BENCHMARK: rev 00525-2ts is the stable revert point. If themes break dashboard
 * behavior, revert via:
 *   gcloud run services update-traffic lh-masterlog-agent-app \
 *     --to-revisions=lh-masterlog-agent-app-00525-2ts=100 --region=us-central1
 */

:root {
  --r3d-bg:           #FFFFFF;
  --r3d-card-bg:      #FFFFFF;
  --r3d-card-border:  #E5E7EB;
  --r3d-text:         #1A1A1A;
  --r3d-text-muted:   #6B7280;
  --r3d-accent:       #43A047;
  --r3d-accent-dim:   #2E7D32;
  --r3d-warn:         #F59E0B;
  --r3d-danger:       #EF4444;
  --r3d-success:      #10B981;
  --r3d-card-shadow:  0 1px 3px rgba(0,0,0,0.06);
  --r3d-anim-expand:  cubic-bezier(0.4, 0, 0.2, 1);
  --r3d-anim-time:    220ms;
}

/* ── R3D3Y3 STUDIOS — dark cyber-noir (JAMES ONLY) ─────────────────────────── */
body[data-theme="r3d3eye"] {
  /* R3D3Y3 internal palette */
  --r3d-bg:           #050810;
  --r3d-card-bg:      #0A0A0A;
  --r3d-card-border:  #1A1A1A;
  --r3d-text:         #F5F5F5;
  --r3d-text-muted:   #888888;
  --r3d-accent:       #FF1A1A;
  --r3d-accent-dim:   #B00000;
  --r3d-warn:         #FFC700;
  --r3d-danger:       #FF4444;
  --r3d-success:      #00E5FF;
  --r3d-card-shadow:  0 0 12px rgba(255,26,26,0.10), 0 1px 2px rgba(0,0,0,0.5);
  --r3d-anim-expand:  cubic-bezier(0.8, 0, 0.2, 1);
  --r3d-anim-time:    180ms;

  /* Universal palette override — themes EVERY element that uses --lf-*
     across all 7 templates (dashboard, leads, settings, estimator, etc.).
     LeafFilter green → red. Gold → cyan. All backgrounds → near-black. */
  --lf-darkest: #000000;
  --lf-dark:    #0A0A0A;
  --lf-primary: #FF1A1A;
  --lf-mid:     #FF4444;
  --lf-accent:  #FF6666;
  --lf-light:   #1A1A1A;
  --lf-pale:    #050810;
  --lf-gold:    #00E5FF;
  --lf-goldlt:  rgba(0,229,255,0.12);
  --bg:         #050810;
  --card:       #0A0A0A;
  --text:       #F5F5F5;
  --muted:      #888888;
  --border:     #1A1A1A;
  --red:        #FF4444;
  --orange:     #FF8800;
  --green:      #00E5FF;
}

body[data-theme="r3d3eye"] {
  background: var(--r3d-bg) !important;
  color: var(--r3d-text) !important;
}

body[data-theme="r3d3eye"] .lead-card,
body[data-theme="r3d3eye"] .my-leads-card,
body[data-theme="r3d3eye"] .est-recent-card {
  background: var(--r3d-card-bg) !important;
  border: 1px solid var(--r3d-card-border) !important;
  color: var(--r3d-text) !important;
  box-shadow: var(--r3d-card-shadow) !important;
  position: relative;
}
body[data-theme="r3d3eye"] .lead-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: var(--r3d-accent);
  box-shadow: 0 0 8px var(--r3d-accent);
}
body[data-theme="r3d3eye"] .lc-header {
  border-bottom: 1px solid var(--r3d-card-border) !important;
  background: linear-gradient(180deg, rgba(255,26,26,0.04) 0%, transparent 100%) !important;
}
body[data-theme="r3d3eye"] .lead-cust,
body[data-theme="r3d3eye"] .lc-cust-unknown {
  color: var(--r3d-text) !important;
}

/* ── PRAXIONS — AI-forward holographic (JAMES ONLY) ────────────────────────── */
body[data-theme="proxion"],
body[data-theme="praxions"] {
  /* PRAXIONS internal palette */
  --r3d-bg:           #0B0E14;
  --r3d-card-bg:      #131722;
  --r3d-card-border:  #1F2330;
  --r3d-text:         #F5F5F5;
  --r3d-text-muted:   #888888;
  --r3d-accent:       #00E5FF;
  --r3d-accent-dim:   #00B8CC;
  --r3d-warn:         #FBBF24;
  /* Universal palette — LF green → cyan. Gold → purple. */
  --lf-darkest: #0B0E14;
  --lf-dark:    #131722;
  --lf-primary: #00E5FF;
  --lf-mid:     #33EEFF;
  --lf-accent:  #66F2FF;
  --lf-light:   #1F2330;
  --lf-pale:    #0B0E14;
  --lf-gold:    #C4B5FD;
  --lf-goldlt:  rgba(196,181,253,0.15);
  --bg:         #0B0E14;
  --card:       #131722;
  --text:       #F5F5F5;
  --muted:      #888888;
  --border:     #1F2330;
  --red:        #FF4444;
  --orange:     #FBBF24;
  --green:      #34D399;
  --_palette_END: 0;  /* end-of-palette sentinel for diffability */
  --r3d-danger:       #FF1A1A;
  --r3d-success:      #34D399;
  --r3d-card-shadow:  0 0 16px rgba(0,229,255,0.08), 0 1px 2px rgba(0,0,0,0.5);
  --r3d-anim-expand:  cubic-bezier(0.16, 1, 0.3, 1);
  --r3d-anim-time:    260ms;
}

body[data-theme="proxion"],
body[data-theme="praxions"] {
  background: var(--r3d-bg) !important;
  color: var(--r3d-text) !important;
}

body[data-theme="proxion"] .lead-card,
body[data-theme="praxions"] .lead-card {
  background: var(--r3d-card-bg) !important;
  border: 1px solid var(--r3d-card-border) !important;
  color: var(--r3d-text) !important;
  box-shadow: var(--r3d-card-shadow) !important;
  position: relative;
}
body[data-theme="proxion"] .lead-card::before,
body[data-theme="praxions"] .lead-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #FF1A1A 0%, #00E5FF 100%);
}
body[data-theme="proxion"] .lc-header,
body[data-theme="praxions"] .lc-header {
  border-bottom: 1px solid var(--r3d-card-border) !important;
}
body[data-theme="proxion"] .lead-cust,
body[data-theme="praxions"] .lead-cust {
  color: var(--r3d-text) !important;
}

/* ── DAYLIGHT — clean bright (everyone) ────────────────────────────────────── */
body[data-theme="daylight"] {
  /* DAYLIGHT internal palette */
  --r3d-bg:           #F7F6F2;
  --r3d-card-bg:      #FFFFFF;
  --r3d-card-border:  #EFEEE8;
  --r3d-text:         #1A1A1A;
  --r3d-text-muted:   #6B7280;
  --r3d-accent:       #3B82F6;
  --r3d-accent-dim:   #1D4ED8;
  --r3d-card-shadow:  0 1px 3px rgba(0,0,0,0.05);

  /* Universal palette — LF green → blue. Stays light. Clean SaaS feel. */
  --lf-darkest: #1E3A8A;
  --lf-dark:    #1D4ED8;
  --lf-primary: #3B82F6;
  --lf-mid:     #60A5FA;
  --lf-accent:  #93C5FD;
  --lf-light:   #DBEAFE;
  --lf-pale:    #EFF6FF;
  --lf-gold:    #F59E0B;
  --lf-goldlt:  #FEF3C7;
  --bg:         #F8FAFC;
  --card:       #FFFFFF;
  --text:       #1F2937;
  --muted:      #6B7280;
  --border:     #E5E7EB;
}

body[data-theme="daylight"] {
  background: var(--r3d-bg) !important;
}

body[data-theme="daylight"] .lead-card {
  background: var(--r3d-card-bg) !important;
  border: 1px solid var(--r3d-card-border) !important;
  box-shadow: var(--r3d-card-shadow) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUILD #115b — Six additional themes per rep request.
   All themes share the same layout + button placement (universal rule:
   "themes change colors/textures only, not structure"). Each block
   overrides the --lf-* + universal vars (--bg/--card/--text/--muted/
   --border) and the lead-card surface so cards adopt the palette.
   ═══════════════════════════════════════════════════════════════════════════ */

/* 🌑 MIDNIGHT — deep navy/charcoal professional dark */
body[data-theme="midnight"] {
  --lf-darkest: #0F172A;
  --lf-dark:    #1E293B;
  --lf-primary: #334155;
  --lf-mid:     #475569;
  --lf-accent:  #38BDF8;
  --lf-light:   #1E40AF;
  --lf-pale:    #0F172A;
  --lf-gold:    #FACC15;
  --lf-goldlt:  #422006;
  --bg:         #020617;
  --card:       #0F172A;
  --text:       #E2E8F0;
  --muted:      #94A3B8;
  --border:     #1E293B;
  background: #020617 !important; color: #E2E8F0 !important;
}
body[data-theme="midnight"] .lead-card,
body[data-theme="midnight"] .my-leads-card,
body[data-theme="midnight"] .est-recent-card {
  background: #0F172A !important;
  border: 1px solid #1E293B !important;
  color: #E2E8F0 !important;
  box-shadow: 0 4px 18px rgba(0,0,0,0.35) !important;
}
/* build #115d — Header colors INTENTIONALLY left alone — result-type tint
   (.lc-header.demo/.nodemo/.nosale/.canceled, default sale-green) must
   win across ALL themes so reps can read result at a glance. */

/* 🌅 SUNSET — warm coral/orange */
body[data-theme="sunset"] {
  --lf-darkest: #7C2D12;
  --lf-dark:    #C2410C;
  --lf-primary: #EA580C;
  --lf-mid:     #F97316;
  --lf-accent:  #FB923C;
  --lf-light:   #FED7AA;
  --lf-pale:    #FFF7ED;
  --lf-gold:    #FCD34D;
  --lf-goldlt:  #FEF3C7;
  --bg:         #FFF7ED;
  --card:       #FFFFFF;
  --text:       #431407;
  --muted:      #9A3412;
  --border:     #FED7AA;
  background: #FFF7ED !important; color: #431407 !important;
}
body[data-theme="sunset"] .lead-card,
body[data-theme="sunset"] .my-leads-card,
body[data-theme="sunset"] .est-recent-card {
  background: #FFFFFF !important;
  border: 1px solid #FED7AA !important;
  box-shadow: 0 4px 16px rgba(234,88,12,0.12) !important;
}
/* lc-header omitted — result-type tint must win across themes. */

/* 🌊 OCEAN — cool teal/aqua */
body[data-theme="ocean"] {
  --lf-darkest: #134E4A;
  --lf-dark:    #0F766E;
  --lf-primary: #14B8A6;
  --lf-mid:     #2DD4BF;
  --lf-accent:  #5EEAD4;
  --lf-light:   #CCFBF1;
  --lf-pale:    #F0FDFA;
  --lf-gold:    #06B6D4;
  --lf-goldlt:  #CFFAFE;
  --bg:         #ECFEFF;
  --card:       #FFFFFF;
  --text:       #0F2A2A;
  --muted:      #475569;
  --border:     #99F6E4;
  background: #ECFEFF !important; color: #0F2A2A !important;
}
body[data-theme="ocean"] .lead-card,
body[data-theme="ocean"] .my-leads-card,
body[data-theme="ocean"] .est-recent-card {
  background: #FFFFFF !important;
  border: 1px solid #99F6E4 !important;
  box-shadow: 0 4px 16px rgba(20,184,166,0.12) !important;
}
/* lc-header omitted — result-type tint must win across themes. */

/* 🍂 AUTUMN — burnt orange + warm brown */
body[data-theme="autumn"] {
  --lf-darkest: #44190B;
  --lf-dark:    #92400E;
  --lf-primary: #B45309;
  --lf-mid:     #D97706;
  --lf-accent:  #F59E0B;
  --lf-light:   #FEF3C7;
  --lf-pale:    #FFFBEB;
  --lf-gold:    #FBBF24;
  --lf-goldlt:  #FEF3C7;
  --bg:         #FAF4E6;
  --card:       #FFFFFF;
  --text:       #3F1F0A;
  --muted:      #78350F;
  --border:     #FDE68A;
  background: #FAF4E6 !important; color: #3F1F0A !important;
}
body[data-theme="autumn"] .lead-card,
body[data-theme="autumn"] .my-leads-card,
body[data-theme="autumn"] .est-recent-card {
  background: #FFFFFF !important;
  border: 1px solid #FDE68A !important;
  box-shadow: 0 4px 16px rgba(180,83,9,0.12) !important;
}
/* lc-header omitted — result-type tint must win across themes. */

/* 🌿 SAGE — muted desaturated green, calm + professional */
body[data-theme="sage"] {
  --lf-darkest: #1F2A1F;
  --lf-dark:    #4D6A4D;
  --lf-primary: #688F68;
  --lf-mid:     #8FAE8F;
  --lf-accent:  #B5C9B5;
  --lf-light:   #DDE7DD;
  --lf-pale:    #EEF4EE;
  --lf-gold:    #C7A86A;
  --lf-goldlt:  #F2E8D2;
  --bg:         #F5F7F3;
  --card:       #FFFFFF;
  --text:       #1A2A1A;
  --muted:      #677867;
  --border:     #D7E0D2;
  background: #F5F7F3 !important; color: #1A2A1A !important;
}
body[data-theme="sage"] .lead-card,
body[data-theme="sage"] .my-leads-card,
body[data-theme="sage"] .est-recent-card {
  background: #FFFFFF !important;
  border: 1px solid #D7E0D2 !important;
  box-shadow: 0 2px 8px rgba(104,143,104,0.08) !important;
}
/* lc-header omitted — result-type tint must win across themes. */

/* ⚪ MINIMAL — monochrome ink-on-paper */
body[data-theme="minimal"] {
  --lf-darkest: #000000;
  --lf-dark:    #1A1A1A;
  --lf-primary: #2E2E2E;
  --lf-mid:     #5C5C5C;
  --lf-accent:  #8A8A8A;
  --lf-light:   #E5E5E5;
  --lf-pale:    #F5F5F5;
  --lf-gold:    #FBBF24;
  --lf-goldlt:  #FEF3C7;
  --bg:         #FFFFFF;
  --card:       #FFFFFF;
  --text:       #0A0A0A;
  --muted:      #6B6B6B;
  --border:     #E5E5E5;
  background: #FFFFFF !important; color: #0A0A0A !important;
}
body[data-theme="minimal"] .lead-card,
body[data-theme="minimal"] .my-leads-card,
body[data-theme="minimal"] .est-recent-card {
  background: #FFFFFF !important;
  border: 1px solid #E5E5E5 !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important;
}
/* lc-header omitted — result-type tint must win across themes. */

/* ═══════════════════════════════════════════════════════════════════════════
   BUILD #115c — Themes from yesterday's mockups (blueprint, glass,
   monolith, terminal) ported into the live theme system. Layout stays
   universal — only colors / textures / borders change.
   ═══════════════════════════════════════════════════════════════════════════ */

/* 📐 BLUEPRINT — drafting-table navy + amber + cyan accents */
body[data-theme="blueprint"] {
  --lf-darkest: #051527;
  --lf-dark:    #0A2540;
  --lf-primary: #1E3A5F;
  --lf-mid:     #60A5FA;
  --lf-accent:  #93C5FD;
  --lf-light:   #1E40AF;
  --lf-pale:    #0A2540;
  --lf-gold:    #FBBF24;
  --lf-goldlt:  #422006;
  --bg:         #0A2540;
  --card:       #082038;
  --text:       #E0F2FF;
  --muted:      #93C5FD;
  --border:     #1E3A5F;
  background:
    linear-gradient(rgba(96,165,250,0.06) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(90deg, rgba(96,165,250,0.06) 1px, transparent 1px) 0 0 / 20px 20px,
    #0A2540 !important;
  color: #E0F2FF !important;
}
body[data-theme="blueprint"] .lead-card,
body[data-theme="blueprint"] .my-leads-card,
body[data-theme="blueprint"] .est-recent-card {
  background: rgba(8,32,56,0.92) !important;
  border: 1.5px solid #60A5FA !important;
  color: #E0F2FF !important;
  box-shadow: 0 0 0 1px rgba(96,165,250,0.1), 0 4px 20px rgba(0,0,0,0.4) !important;
}
/* lc-header omitted — result-type tint must win across themes. */

/* 💎 GLASS — frosted glass with purple/cyan gradient bg */
body[data-theme="glass"] {
  --lf-darkest: #1A0F2E;
  --lf-dark:    #2D1B47;
  --lf-primary: #6D28D9;
  --lf-mid:     #A855F7;
  --lf-accent:  #C4B5FD;
  --lf-light:   #3B2A5C;
  --lf-pale:    #1A0F2E;
  --lf-gold:    #22D3EE;
  --lf-goldlt:  #0E7490;
  --bg:         #1A0F2E;
  --card:       rgba(20, 20, 35, 0.55);
  --text:       #F5F5F5;
  --muted:      #C4B5FD;
  --border:     rgba(168, 85, 247, 0.4);
  background: linear-gradient(135deg, #1A0F2E 0%, #0F2540 40%, #0F2A2E 100%) !important;
  color: #F5F5F5 !important;
}
body[data-theme="glass"] .lead-card,
body[data-theme="glass"] .my-leads-card,
body[data-theme="glass"] .est-recent-card {
  background: rgba(20,20,35,0.55) !important;
  border: 1px solid rgba(168,85,247,0.4) !important;
  color: #F5F5F5 !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.06) !important;
}
/* lc-header omitted — result-type tint must win across themes. */

/* ⬛ MONOLITH — pure black + grey + white, ultra-clean editorial */
body[data-theme="monolith"] {
  --lf-darkest: #000000;
  --lf-dark:    #0A0A0A;
  --lf-primary: #1A1A1A;
  --lf-mid:     #2A2A2A;
  --lf-accent:  #F5F5F5;
  --lf-light:   #2A2A2A;
  --lf-pale:    #0A0A0A;
  --lf-gold:    #F5F5F5;
  --lf-goldlt:  #2A2A2A;
  --bg:         #1A1A1A;
  --card:       #0A0A0A;
  --text:       #F5F5F5;
  --muted:      #888888;
  --border:     #2A2A2A;
  background: #1A1A1A !important; color: #F5F5F5 !important;
}
body[data-theme="monolith"] .lead-card,
body[data-theme="monolith"] .my-leads-card,
body[data-theme="monolith"] .est-recent-card {
  background: #0A0A0A !important;
  border: 1px solid #2A2A2A !important;
  color: #F5F5F5 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  transition: border-color 0.15s !important;
}
body[data-theme="monolith"] .lead-card:hover { border-color: #F5F5F5 !important; }
/* lc-header omitted — result-type tint must win across themes. */

/* 🖥️ TERMINAL — CRT-green monospace hacker chic */
body[data-theme="terminal"] {
  --lf-darkest: #050805;
  --lf-dark:    #0A0F0A;
  --lf-primary: #001A00;
  --lf-mid:     #008833;
  --lf-accent:  #00FF66;
  --lf-light:   #00331A;
  --lf-pale:    #0A0F0A;
  --lf-gold:    #FFAA00;
  --lf-goldlt:  #FFCC44;
  --bg:         #0A0F0A;
  --card:       #050805;
  --text:       #00FF66;
  --muted:      #00AA44;
  --border:     #00FF66;
  background: #0A0F0A !important; color: #00FF66 !important;
  font-family: 'JetBrains Mono', 'Courier New', monospace !important;
}
body[data-theme="terminal"] .lead-card,
body[data-theme="terminal"] .my-leads-card,
body[data-theme="terminal"] .est-recent-card {
  background: #050805 !important;
  border: 1.5px solid #00FF66 !important;
  color: #00FF66 !important;
  border-radius: 0 !important;
  box-shadow: 0 0 12px rgba(0,255,102,0.15), inset 0 0 18px rgba(0,255,102,0.03) !important;
  font-family: 'JetBrains Mono', 'Courier New', monospace !important;
}
/* lc-header omitted — result-type tint must win across themes. */
body[data-theme="terminal"] button {
  background: transparent !important;
  border: 1.5px solid #00FF66 !important;
  color: #00FF66 !important;
  font-family: 'JetBrains Mono', 'Courier New', monospace !important;
  letter-spacing: 1.5px !important;
}
body[data-theme="terminal"] button:hover { background: #00FF66 !important; color: #050805 !important; }


/* ── Smooth theme-switch transitions (all themes) ────────────────────────────
   Apply a short fade when CSS variables update so swapping themes via the
   floating picker doesn't snap-change the whole page. Limit to color/bg
   properties so layouts don't animate. */
body[data-theme] {
  transition: background-color 220ms ease, color 220ms ease;
}
body[data-theme] .lead-card,
body[data-theme] .my-leads-card,
body[data-theme] .lc-header,
body[data-theme] .lc-body,
body[data-theme] .lc-body-wrap,
body[data-theme] button,
body[data-theme] input,
body[data-theme] select,
body[data-theme] textarea,
body[data-theme] .nav-btn,
body[data-theme] .quick-btn,
body[data-theme] .agent-btn,
body[data-theme] .est-card,
body[data-theme] .rank-card,
body[data-theme] .stat-card,
body[data-theme] .tab-btn,
body[data-theme] .tab-panel,
body[data-theme] .settings-section,
body[data-theme] .settings-section-header {
  transition:
    background-color 220ms ease,
    color 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

/* ── Inline-style fallback overrides for dark themes ──────────────────────────
   Some templates use inline `style="background:#1B5E20"` / hardcoded
   LeafFilter green / pale-green text and don't read CSS variables. In dark
   themes those create unreadable light islands. These rules use attribute-
   substring matching to catch the most common offenders. !important required
   because inline styles outrank normal CSS specificity. */
body[data-theme="r3d3eye"] [style*="background:#fff"],
body[data-theme="r3d3eye"] [style*="background: #fff"],
body[data-theme="r3d3eye"] [style*="background:#FFFFFF"],
body[data-theme="r3d3eye"] [style*="background:#FFF"],
body[data-theme="praxions"] [style*="background:#fff"],
body[data-theme="praxions"] [style*="background: #fff"],
body[data-theme="praxions"] [style*="background:#FFFFFF"],
body[data-theme="praxions"] [style*="background:#FFF"] {
  background-color: var(--card) !important;
  color: var(--text) !important;
}
body[data-theme="r3d3eye"] [style*="background:#1B5E20"],
body[data-theme="r3d3eye"] [style*="background:#2E7D32"],
body[data-theme="r3d3eye"] [style*="background:#388E3C"],
body[data-theme="r3d3eye"] [style*="background:#43A047"],
body[data-theme="r3d3eye"] [style*="background:#0d3a14"] {
  background: linear-gradient(135deg, var(--lf-darkest), var(--lf-primary)) !important;
}
body[data-theme="praxions"] [style*="background:#1B5E20"],
body[data-theme="praxions"] [style*="background:#2E7D32"],
body[data-theme="praxions"] [style*="background:#388E3C"],
body[data-theme="praxions"] [style*="background:#43A047"],
body[data-theme="praxions"] [style*="background:#0d3a14"] {
  background: linear-gradient(135deg, var(--lf-darkest), var(--lf-primary)) !important;
}
/* Pale-green inline backgrounds (very common in chip/pill styles) */
body[data-theme="r3d3eye"] [style*="background:#E8F5E9"],
body[data-theme="r3d3eye"] [style*="background:#F1F8E9"],
body[data-theme="r3d3eye"] [style*="background:#F1F8F4"],
body[data-theme="r3d3eye"] [style*="background:#FFFDE7"],
body[data-theme="praxions"] [style*="background:#E8F5E9"],
body[data-theme="praxions"] [style*="background:#F1F8E9"],
body[data-theme="praxions"] [style*="background:#F1F8F4"],
body[data-theme="praxions"] [style*="background:#FFFDE7"] {
  background-color: rgba(255,255,255,0.05) !important;
  border-color: var(--border) !important;
}
/* Dark green text in inline styles — flip to lighter accent for legibility */
body[data-theme="r3d3eye"] [style*="color:#1B5E20"],
body[data-theme="r3d3eye"] [style*="color:#2E7D32"],
body[data-theme="r3d3eye"] [style*="color: #1B5E20"] {
  color: var(--lf-primary) !important;
}
body[data-theme="praxions"] [style*="color:#1B5E20"],
body[data-theme="praxions"] [style*="color:#2E7D32"],
body[data-theme="praxions"] [style*="color: #1B5E20"] {
  color: var(--lf-primary) !important;
}
/* Page-level body background — some templates set this inline */
body[data-theme="r3d3eye"] { color-scheme: dark; }
body[data-theme="proxion"],
body[data-theme="praxions"] { color-scheme: dark; }
body[data-theme="midnight"] { color-scheme: dark; }
body[data-theme="monolith"] { color-scheme: dark; }
body[data-theme="terminal"] { color-scheme: dark; }
body[data-theme="blueprint"] { color-scheme: dark; }
body[data-theme="glass"] { color-scheme: dark; }

/* ═══════════════════════════════════════════════════════════════════════════
   BUILD #115d — Contrast pass for ALL dark themes (calendar, ranking
   cards, info pills, tax tables, etc.). Catches inline-style hardcoded
   light backgrounds / dark text that became unreadable on the new dark
   themes. Mirrors the existing r3d3eye / praxions rules at lines 583+
   but folds in midnight / monolith / terminal / blueprint / glass.
   ═══════════════════════════════════════════════════════════════════════════ */

/* White / near-white inline backgrounds → use theme card background */
body[data-theme="midnight"]  [style*="background:#fff"],
body[data-theme="midnight"]  [style*="background: #fff"],
body[data-theme="midnight"]  [style*="background:#FFFFFF"],
body[data-theme="midnight"]  [style*="background:#FFF"],
body[data-theme="monolith"]  [style*="background:#fff"],
body[data-theme="monolith"]  [style*="background: #fff"],
body[data-theme="monolith"]  [style*="background:#FFFFFF"],
body[data-theme="monolith"]  [style*="background:#FFF"],
body[data-theme="terminal"]  [style*="background:#fff"],
body[data-theme="terminal"]  [style*="background: #fff"],
body[data-theme="terminal"]  [style*="background:#FFFFFF"],
body[data-theme="terminal"]  [style*="background:#FFF"],
body[data-theme="blueprint"] [style*="background:#fff"],
body[data-theme="blueprint"] [style*="background: #fff"],
body[data-theme="blueprint"] [style*="background:#FFFFFF"],
body[data-theme="blueprint"] [style*="background:#FFF"],
body[data-theme="glass"]     [style*="background:#fff"],
body[data-theme="glass"]     [style*="background: #fff"],
body[data-theme="glass"]     [style*="background:#FFFFFF"],
body[data-theme="glass"]     [style*="background:#FFF"] {
  background-color: var(--card) !important;
  color: var(--text) !important;
}

/* Pale-green inline backgrounds (chip / pill / cal-day cell defaults) */
body[data-theme="midnight"]  [style*="background:#E8F5E9"],
body[data-theme="midnight"]  [style*="background:#F1F8E9"],
body[data-theme="midnight"]  [style*="background:#F1F8F4"],
body[data-theme="midnight"]  [style*="background:#C8E6C9"],
body[data-theme="monolith"]  [style*="background:#E8F5E9"],
body[data-theme="monolith"]  [style*="background:#F1F8E9"],
body[data-theme="monolith"]  [style*="background:#F1F8F4"],
body[data-theme="monolith"]  [style*="background:#C8E6C9"],
body[data-theme="terminal"]  [style*="background:#E8F5E9"],
body[data-theme="terminal"]  [style*="background:#F1F8E9"],
body[data-theme="terminal"]  [style*="background:#F1F8F4"],
body[data-theme="terminal"]  [style*="background:#C8E6C9"],
body[data-theme="blueprint"] [style*="background:#E8F5E9"],
body[data-theme="blueprint"] [style*="background:#F1F8E9"],
body[data-theme="blueprint"] [style*="background:#F1F8F4"],
body[data-theme="blueprint"] [style*="background:#C8E6C9"],
body[data-theme="glass"]     [style*="background:#E8F5E9"],
body[data-theme="glass"]     [style*="background:#F1F8E9"],
body[data-theme="glass"]     [style*="background:#F1F8F4"],
body[data-theme="glass"]     [style*="background:#C8E6C9"] {
  background-color: rgba(255,255,255,0.05) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

/* Dark-green text in inline styles → flip to theme accent so it's readable */
body[data-theme="midnight"]  [style*="color:#1B5E20"],
body[data-theme="midnight"]  [style*="color:#2E7D32"],
body[data-theme="midnight"]  [style*="color: #1B5E20"],
body[data-theme="monolith"]  [style*="color:#1B5E20"],
body[data-theme="monolith"]  [style*="color:#2E7D32"],
body[data-theme="monolith"]  [style*="color: #1B5E20"],
body[data-theme="terminal"]  [style*="color:#1B5E20"],
body[data-theme="terminal"]  [style*="color:#2E7D32"],
body[data-theme="terminal"]  [style*="color: #1B5E20"],
body[data-theme="blueprint"] [style*="color:#1B5E20"],
body[data-theme="blueprint"] [style*="color:#2E7D32"],
body[data-theme="blueprint"] [style*="color: #1B5E20"],
body[data-theme="glass"]     [style*="color:#1B5E20"],
body[data-theme="glass"]     [style*="color:#2E7D32"],
body[data-theme="glass"]     [style*="color: #1B5E20"] {
  color: var(--lf-accent) !important;
}

/* Pale-green / mint borders → theme border */
body[data-theme="midnight"]  [style*="border:1.5px solid #C8E6C9"],
body[data-theme="midnight"]  [style*="border:1px solid #C8E6C9"],
body[data-theme="midnight"]  [style*="border-color:#C8E6C9"],
body[data-theme="monolith"]  [style*="border:1.5px solid #C8E6C9"],
body[data-theme="monolith"]  [style*="border:1px solid #C8E6C9"],
body[data-theme="monolith"]  [style*="border-color:#C8E6C9"],
body[data-theme="terminal"]  [style*="border:1.5px solid #C8E6C9"],
body[data-theme="terminal"]  [style*="border:1px solid #C8E6C9"],
body[data-theme="terminal"]  [style*="border-color:#C8E6C9"],
body[data-theme="blueprint"] [style*="border:1.5px solid #C8E6C9"],
body[data-theme="blueprint"] [style*="border:1px solid #C8E6C9"],
body[data-theme="blueprint"] [style*="border-color:#C8E6C9"],
body[data-theme="glass"]     [style*="border:1.5px solid #C8E6C9"],
body[data-theme="glass"]     [style*="border:1px solid #C8E6C9"],
body[data-theme="glass"]     [style*="border-color:#C8E6C9"] {
  border-color: var(--border) !important;
}

/* Calendar containers and ranking cards — push the universal --bg/--card/
   --text values so they're not stuck on hardcoded white/green. The calendar
   selectors below match the dashboard's calendar layout. */
body[data-theme="midnight"]  .cal-wrap,
body[data-theme="midnight"]  .calendar,
body[data-theme="midnight"]  .cal-day,
body[data-theme="midnight"]  .rank-card,
body[data-theme="midnight"]  .stat-card,
body[data-theme="midnight"]  .est-card,
body[data-theme="monolith"]  .cal-wrap,
body[data-theme="monolith"]  .calendar,
body[data-theme="monolith"]  .cal-day,
body[data-theme="monolith"]  .rank-card,
body[data-theme="monolith"]  .stat-card,
body[data-theme="monolith"]  .est-card,
body[data-theme="terminal"]  .cal-wrap,
body[data-theme="terminal"]  .calendar,
body[data-theme="terminal"]  .cal-day,
body[data-theme="terminal"]  .rank-card,
body[data-theme="terminal"]  .stat-card,
body[data-theme="terminal"]  .est-card,
body[data-theme="blueprint"] .cal-wrap,
body[data-theme="blueprint"] .calendar,
body[data-theme="blueprint"] .cal-day,
body[data-theme="blueprint"] .rank-card,
body[data-theme="blueprint"] .stat-card,
body[data-theme="blueprint"] .est-card,
body[data-theme="glass"]     .cal-wrap,
body[data-theme="glass"]     .calendar,
body[data-theme="glass"]     .cal-day,
body[data-theme="glass"]     .rank-card,
body[data-theme="glass"]     .stat-card,
body[data-theme="glass"]     .est-card {
  background-color: var(--card) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

/* Quantified by live-HTML audit (2026-05-20 — 18 occurrences) — light-green
   borders in inline styles. Map to themed border in dark themes. */
body[data-theme="r3d3eye"] [style*="border:1.5px solid #C8E6C9"],
body[data-theme="r3d3eye"] [style*="border:1px solid #C8E6C9"],
body[data-theme="r3d3eye"] [style*="border: 1px solid #C8E6C9"],
body[data-theme="r3d3eye"] [style*="border-color:#C8E6C9"],
body[data-theme="praxions"] [style*="border:1.5px solid #C8E6C9"],
body[data-theme="praxions"] [style*="border:1px solid #C8E6C9"],
body[data-theme="praxions"] [style*="border: 1px solid #C8E6C9"],
body[data-theme="praxions"] [style*="border-color:#C8E6C9"] {
  border-color: var(--border) !important;
}

/* Pale-yellow / pale-orange chip backgrounds (warning/info pills) — keep the
   warm tint but transparent in dark themes for legibility. */
body[data-theme="r3d3eye"] [style*="background:#FFF8E1"],
body[data-theme="r3d3eye"] [style*="background:#FFE0B2"],
body[data-theme="r3d3eye"] [style*="background:#FFF3E0"],
body[data-theme="r3d3eye"] [style*="background:#FFFDE7"],
body[data-theme="r3d3eye"] [style*="background:#FFF9C4"],
body[data-theme="praxions"] [style*="background:#FFF8E1"],
body[data-theme="praxions"] [style*="background:#FFE0B2"],
body[data-theme="praxions"] [style*="background:#FFF3E0"],
body[data-theme="praxions"] [style*="background:#FFFDE7"],
body[data-theme="praxions"] [style*="background:#FFF9C4"] {
  background-color: rgba(255, 199, 0, 0.10) !important;
  border-color: rgba(255, 199, 0, 0.35) !important;
}

/* Pale-red / error backgrounds — keep red tint but dark-mode friendly. */
body[data-theme="r3d3eye"] [style*="background:#FFEBEE"],
body[data-theme="r3d3eye"] [style*="background:#FCE4EC"],
body[data-theme="praxions"] [style*="background:#FFEBEE"],
body[data-theme="praxions"] [style*="background:#FCE4EC"] {
  background-color: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}

/* Pale-blue backgrounds (info pills) */
body[data-theme="r3d3eye"] [style*="background:#E3F2FD"],
body[data-theme="r3d3eye"] [style*="background:#BBDEFB"],
body[data-theme="praxions"] [style*="background:#E3F2FD"],
body[data-theme="praxions"] [style*="background:#BBDEFB"] {
  background-color: rgba(96, 165, 250, 0.12) !important;
  border-color: rgba(96, 165, 250, 0.35) !important;
}

/* Brown / warm text (commonly on yellow chip backgrounds) — flip to gold
   so it stays legible on the now-tinted dark backgrounds. */
body[data-theme="r3d3eye"] [style*="color:#5D4037"],
body[data-theme="r3d3eye"] [style*="color:#3E2723"],
body[data-theme="r3d3eye"] [style*="color:#4E342E"],
body[data-theme="r3d3eye"] [style*="color: #5D4037"],
body[data-theme="praxions"] [style*="color:#5D4037"],
body[data-theme="praxions"] [style*="color:#3E2723"],
body[data-theme="praxions"] [style*="color:#4E342E"],
body[data-theme="praxions"] [style*="color: #5D4037"] {
  color: var(--lf-gold) !important;
}

/* Inline-style background:linear-gradient(...#1B5E20...) catches the LH
   primary green gradient pattern used in many cards. Already covered above,
   but adding 0d3a14 (the darker green) for the header gradient explicitly. */
body[data-theme="r3d3eye"] [style*="linear-gradient(135deg,#0d3a14"],
body[data-theme="r3d3eye"] [style*="linear-gradient(135deg, #0d3a14"],
body[data-theme="praxions"] [style*="linear-gradient(135deg,#0d3a14"],
body[data-theme="praxions"] [style*="linear-gradient(135deg, #0d3a14"] {
  background: linear-gradient(135deg, var(--lf-darkest), var(--lf-primary)) !important;
}

/* Text:#fff hardcoded — keep white in dark themes (already readable);
   in light themes (lf-modern/daylight) it's normal. No override needed
   for color:#fff specifically; just listed here so future contributors
   don't waste time adding one. */

/* Light-mid grey text (#555 / #888 / #bbb / #aaa) reads OK on either light
   or dark backgrounds — no override needed. */

/* ── Stacked-paper sticky headers for leads page (all themes) ──────────────── */
body[data-theme] .leads-list .lead-card .lc-header {
  position: sticky;
  top: var(--r3d-sticky-top, 60px);
  z-index: 2;
  transition: background var(--r3d-anim-time) var(--r3d-anim-expand);
}

/* Card-expanded animation (works with existing toggleLeadCard) */
body[data-theme] .lead-card .lc-body-wrap {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--r3d-anim-time) var(--r3d-anim-expand),
              opacity var(--r3d-anim-time) var(--r3d-anim-expand);
  opacity: 0;
}
body[data-theme] .lead-card.card-expanded .lc-body-wrap {
  max-height: 4000px;
  opacity: 1;
}

/* ── Theme picker (floating, James only — injected by themes.js) ──────────────
   Picker accents the CURRENT theme's primary color so it visually belongs no
   matter which theme is active. Per-theme overrides below tune the glow. */
#r3d3-theme-picker {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--lf-primary, rgba(255, 26, 26, 0.3));
  border-radius: 999px;
  padding: 6px 12px 6px 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 12px rgba(255, 26, 26, 0.15);
  font-family: -apple-system, 'Segoe UI', sans-serif;
  font-size: 12px;
  user-select: none;
  transition: border-color 220ms ease, box-shadow 220ms ease;
}
body[data-theme="lf-modern"] #r3d3-theme-picker,
body[data-theme="daylight"]  #r3d3-theme-picker {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--lf-primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 0 12px rgba(0, 0, 0, 0.05);
}
body[data-theme="lf-modern"] #r3d3-theme-picker .lbl,
body[data-theme="daylight"]  #r3d3-theme-picker .lbl,
body[data-theme="lf-modern"] #r3d3-theme-picker select,
body[data-theme="daylight"]  #r3d3-theme-picker select {
  color: var(--lf-darkest);
}
body[data-theme="lf-modern"] #r3d3-theme-picker select option,
body[data-theme="daylight"]  #r3d3-theme-picker select option {
  background: #FFFFFF;
  color: var(--lf-darkest);
}
body[data-theme="praxions"] #r3d3-theme-picker {
  border-color: #00E5FF;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 12px rgba(0, 229, 255, 0.25);
}
#r3d3-theme-picker .lbl {
  font-size: 14px;
  line-height: 1;
}
#r3d3-theme-picker select {
  background: transparent;
  color: #F5F5F5;
  border: none;
  outline: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-family: 'Courier New', monospace;
  cursor: pointer;
  padding-right: 4px;
}
#r3d3-theme-picker select option {
  background: #0A0A0A;
  color: #F5F5F5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   v1.1 — LeafFilter Modern theme
   New card structure (floating portal + convo + full data) in LF green colors.
   JAMES ONLY for v1.1; promote to public after design review.
   ═══════════════════════════════════════════════════════════════════════════ */
body[data-theme="lf-modern"] {
  /* LF MODERN internal palette — keeps LF greens, modernizes bg/cards */
  --r3d-bg:           #F1F8F4;
  --r3d-card-bg:      #FFFFFF;
  --r3d-card-border:  #C8E6C9;
  --r3d-text:         #1B5E20;
  --r3d-text-muted:   #5D7C5F;
  --r3d-accent:       #2E7D32;
  --r3d-accent-dim:   #1B5E20;
  --r3d-warn:         #F9A825;
  --r3d-danger:       #C62828;
  --r3d-success:      #43A047;
  --r3d-card-shadow:  0 2px 8px rgba(27, 94, 32, 0.10), 0 1px 2px rgba(0, 0, 0, 0.05);

  /* Universal palette — KEEP LF greens (intentional brand alignment),
     just refresh the neutral surfaces (bg/card/border) for a modern feel. */
  --bg:     #F1F8F4;
  --card:   #FFFFFF;
  --text:   #1B5E20;
  --muted:  #5D7C5F;
  --border: #C8E6C9;
  /* --lf-* greens intentionally NOT overridden — this theme leans into the
     LeafFilter palette while refreshing the surrounding surfaces. */
}

body[data-theme="lf-modern"] {
  background: var(--r3d-bg) !important;
}
body[data-theme="lf-modern"] .lead-card {
  background: var(--r3d-card-bg) !important;
  border: 1px solid var(--r3d-card-border) !important;
  box-shadow: var(--r3d-card-shadow) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ACTIVITY RAIL (d1800) — the old floating portal stack, moved to the very
   bottom as thin coloured lines (static/js/themes.js builds it).
     #r3d3-portal-stack
       .r3d3-rail-tags    small tags naming each running worker; tap = details
         .r3d3-portal[data-worker]  tag row + hidden detail panel (opens upward)
       .r3d3-rail-lines   one 3px line per worker, in its own colour
   ═══════════════════════════════════════════════════════════════════════════ */

#r3d3-portal-stack {
  position: fixed;
  left: 0; right: 0; bottom: 0; top: auto;
  height: auto;
  z-index: 1500;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
#r3d3-portal-stack:not(.r3d3-has) { display: none; }
#r3d3-portal-stack .r3d3-portal,
#r3d3-portal-stack .r3d3-rail-line { pointer-events: auto; }

#r3d3-portal-stack [data-worker="crm"]   { --rp: #2E7D32; --rp-hi: #66BB6A; }
#r3d3-portal-stack [data-worker="email"] { --rp: #1565C0; --rp-hi: #42A5F5; }
#r3d3-portal-stack [data-worker="gtr"]   { --rp: #7B1FA2; --rp-hi: #BA68C8; }
#r3d3-portal-stack [data-worker="doc"]   { --rp: #E65100; --rp-hi: #FFA726; }
#r3d3-portal-stack [data-worker="other"] { --rp: #00796B; --rp-hi: #4DB6AC; }

/* tags: one small row, left-aligned, just above the lines */
.r3d3-rail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 8px 3px;
  align-items: flex-end;
}
.r3d3-portal {
  position: relative;
  font: 600 10.5px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: #fff;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.r3d3-portal.r3d3-leaving, .r3d3-rail-line.r3d3-leaving { opacity: 0; }
.r3d3-portal.r3d3-leaving { transform: translateY(4px); }

.r3d3-portal-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: min(320px, calc(100vw - 16px));
  padding: 2px 4px 2px 7px;
  border-radius: 999px;
  background: rgba(15, 20, 25, 0.82);
  border: 1px solid var(--rp, #2E7D32);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  user-select: none;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.r3d3-portal-row:focus-visible { outline: 2px solid var(--rp-hi, #66BB6A); outline-offset: 1px; }
.r3d3-portal-row .r3d3-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--rp-hi, #66BB6A);
  box-shadow: 0 0 5px var(--rp-hi, #66BB6A);
  flex-shrink: 0;
  animation: r3d3-pulse 1.1s ease-in-out infinite;
}
@keyframes r3d3-pulse { 50% { opacity: 0.35; } }
.r3d3-portal.r3d3-ok .r3d3-dot { animation: none; background: #69F0AE; box-shadow: none; }
.r3d3-portal.r3d3-err .r3d3-dot { animation: none; background: #FF5252; box-shadow: none; }
.r3d3-portal.r3d3-err .r3d3-portal-row { border-color: #E53935; }
.r3d3-portal-row .r3d3-label { font-weight: 800; white-space: nowrap; flex-shrink: 0; }
.r3d3-portal-row .r3d3-step {
  opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.r3d3-portal-row .r3d3-step:not(:empty)::before { content: '· '; }
.r3d3-portal-close {
  background: transparent; border: 0; color: #fff; opacity: 0.6;
  font-size: 13px; line-height: 1; padding: 0 3px; cursor: pointer; flex-shrink: 0;
}
.r3d3-portal-close:hover { opacity: 1; }

/* detail panel — opens upward from its tag */
.r3d3-portal-body {
  position: absolute;
  left: 0; bottom: calc(100% + 6px);
  width: min(340px, calc(100vw - 16px));
  padding: 8px;
  border-radius: 12px;
  background: #0F1419;
  border: 1px solid var(--rp, #2E7D32);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  display: none;
  flex-direction: column;
  gap: 6px;
}
.r3d3-portal.r3d3-expanded .r3d3-portal-body { display: flex; }
.r3d3-portal-body-head { font-weight: 800; font-size: 12px; color: var(--rp-hi, #66BB6A); }
.r3d3-portal-video {
  min-height: 70px;
  background: #000;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px; text-align: center; padding: 10px;
  position: relative;
}
.r3d3-portal-video-live { padding: 0; min-height: 150px; overflow: hidden; align-items: stretch; }
.r3d3-portal-frame { width: 100%; height: 100%; max-height: 260px; object-fit: contain; background: #000; display: block; }
.r3d3-portal-video-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 4px 8px; font-size: 10px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.7));
  color: rgba(255,255,255,0.88); text-align: center;
}
.r3d3-portal-body-actions { display: flex; gap: 6px; }
.r3d3-pbtn {
  flex: 1; padding: 6px 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff; border-radius: 7px;
  font: 700 11px/1.2 inherit; cursor: pointer;
}
.r3d3-pbtn:hover { background: rgba(255, 255, 255, 0.16); }
.r3d3-pbtn.danger { color: #FF8A80; border-color: rgba(255, 138, 128, 0.4); }
.r3d3-pbtn.warn { color: #FFD740; border-color: rgba(255, 215, 64, 0.4); }

/* the lines: 3px each, its worker's colour, full width */
.r3d3-rail-lines { display: flex; flex-direction: column; gap: 1px; }
.r3d3-rail-line { transition: opacity 0.3s ease; }
.r3d3-portal-mini-bar {
  position: relative;
  height: 3px;
  background: color-mix(in srgb, var(--rp, #2E7D32) 22%, transparent);
  overflow: hidden;
}
.r3d3-portal-mini-fill {
  position: absolute; inset: 0 auto 0 0;
  height: 100%;
  background: linear-gradient(90deg, var(--rp, #2E7D32), var(--rp-hi, #66BB6A));
  transition: width 0.7s ease;
}
.r3d3-portal-mini-fill::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.65), transparent);
  transform: translateX(-100%);
  animation: r3d3-shimmer 1.3s linear infinite;
}
@keyframes r3d3-shimmer { to { transform: translateX(100%); } }
.r3d3-rail-line.r3d3-ok .r3d3-portal-mini-fill::after,
.r3d3-rail-line.r3d3-err .r3d3-portal-mini-fill::after { animation: none; display: none; }
.r3d3-rail-line.r3d3-err .r3d3-portal-mini-fill { background: linear-gradient(90deg, #B71C1C, #EF5350); }

@media (prefers-reduced-motion: reduce) {
  .r3d3-portal-row .r3d3-dot, .r3d3-portal-mini-fill::after { animation: none; }
  .r3d3-portal-mini-fill { transition: none; }
}

/* APPROVAL PROMPT — pops OVER the portal stack */
.r3d3-portal-prompt {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%) translateY(-200%);
  width: min(360px, calc(100vw - 32px));
  z-index: 2000;
  background: #FFFFFF;
  color: #1A1A1A;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.2);
  padding: 16px 18px 14px;
  transition: transform 380ms cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, 'Segoe UI', sans-serif;
}
.r3d3-portal-prompt.r3d3-active { transform: translateX(-50%) translateY(0); }
.r3d3-portal-prompt::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #FBBF24 0%, #F59E0B 100%);
  border-radius: 14px 14px 0 0;
}
.r3d3-portal-prompt h3 { font-size: 14px; font-weight: 800; color: #B45309; letter-spacing: 0.5px; margin: 4px 0 6px; }
.r3d3-portal-prompt p  { font-size: 13px; color: #4B5563; margin-bottom: 14px; line-height: 1.55; }
.r3d3-portal-prompt-buttons { display: flex; gap: 8px; }
.r3d3-portal-prompt-buttons .r3d3-pbtn-modal {
  flex: 1;
  padding: 11px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  letter-spacing: 0.5px;
  font-family: -apple-system, 'Segoe UI', sans-serif;
}
.r3d3-portal-prompt-buttons .r3d3-approve { background: #10B981; color: #FFF; }
.r3d3-portal-prompt-buttons .r3d3-deny    { background: #FEE2E2; color: #991B1B; }

.r3d3-prompt-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0; pointer-events: none;
  transition: opacity 300ms;
  z-index: 1999;
}
.r3d3-prompt-backdrop.r3d3-active { opacity: 1; pointer-events: auto; }

/* ═══════════════════════════════════════════════════════════════════════════
 * build #115aq — UNIVERSAL READABILITY SAFETY NET
 *
 * Rep directive: "all themes and dark mode equivalents needs a comprehensive
 * audit to all writing and background colors. there is still unreadable
 * content in all themes and light/dark mode. need everything visible."
 *
 * The codebase has thousands of inline-style colors hardcoded in HTML. They
 * frequently break in dark mode (e.g. color:#1B5E20 on a #0F1A0F background
 * is unreadable). Surgically auditing each one is unrealistic in one pass.
 *
 * Strategy: high-specificity overrides that force every theme variant to
 * have legible foreground against its background. We do NOT touch layout,
 * just patch readability holes.
 * ═══════════════════════════════════════════════════════════════════════════ */

/* DARK MODE (data-dark="1") — text-color floor.
   2026-10-09 audit: every page sets data-dark on <html> (document.documentElement), never on
   <body>, so the old `[data-dark="1"] …` selectors below had never matched — the whole dark
   safety net was dead and the light-mode block further down fired IN dark mode. Rewritten to
   `[data-dark="1"] …` (same specificity as the pages' own rules, which load later and win ties). */
[data-dark="1"] body {
  color: #E8F5E9;
  background: #0a0a0a;
}
/* Any inline-styled text that hardcodes a green close to the dark bg
   (#1B5E20, #0d3a14, #1a2620, #0d2a4a) flips to light green. The
   selectors target the exact hex values to avoid touching elements that
   already render fine. */
[data-dark="1"] [style*="color:#1B5E20"],
[data-dark="1"] [style*="color: #1B5E20"],
[data-dark="1"] [style*="color:#0d3a14"],
[data-dark="1"] [style*="color: #0d3a14"],
[data-dark="1"] [style*="color:#1a2620"],
[data-dark="1"] [style*="color: #1a2620"],
[data-dark="1"] [style*="color:#0d2a4a"],
[data-dark="1"] [style*="color: #0d2a4a"],
[data-dark="1"] [style*="color:#222"],
[data-dark="1"] [style*="color: #222"],
[data-dark="1"] [style*="color:#333"],
[data-dark="1"] [style*="color: #333"],
[data-dark="1"] [style*="color:#37474F"],
[data-dark="1"] [style*="color: #37474F"],
[data-dark="1"] [style*="color:#5D4037"],
[data-dark="1"] [style*="color: #5D4037"],
[data-dark="1"] [style*="color:#6D4C41"],
[data-dark="1"] [style*="color: #6D4C41"],
[data-dark="1"] [style*="color:#4A148C"],
[data-dark="1"] [style*="color: #4A148C"],
[data-dark="1"] [style*="color:#1A237E"],
[data-dark="1"] [style*="color: #1A237E"],
[data-dark="1"] [style*="color:#1565C0"],
[data-dark="1"] [style*="color: #1565C0"] {
  color: #E8F5E9 !important;
}
/* Mid-tone greens and browns used as label/caption text — also unreadable. */
[data-dark="1"] [style*="color:#558B2F"],
[data-dark="1"] [style*="color: #558B2F"],
[data-dark="1"] [style*="color:#33691E"],
[data-dark="1"] [style*="color: #33691E"],
[data-dark="1"] [style*="color:#2E7D32"],
[data-dark="1"] [style*="color: #2E7D32"] {
  color: #A5D6A7 !important;
}
/* White-bg cards inside dark mode → flip to a dark card so text stays
   readable. Only target the most common card backgrounds. */
[data-dark="1"] [style*="background:#fff"],
[data-dark="1"] [style*="background: #fff"],
[data-dark="1"] [style*="background:#FFFFFF"],
[data-dark="1"] [style*="background: #FFFFFF"],
[data-dark="1"] [style*="background-color:#fff"],
[data-dark="1"] [style*="background-color: #fff"] {
  background: #162A18 !important;
  color: #E8F5E9 !important;
}
[data-dark="1"] [style*="background:#F1F8E9"],
[data-dark="1"] [style*="background: #F1F8E9"],
[data-dark="1"] [style*="background:#E8F5E9"],
[data-dark="1"] [style*="background: #E8F5E9"],
[data-dark="1"] [style*="background:#FAFFFA"],
[data-dark="1"] [style*="background: #FAFFFA"] {
  background: #0F1A0F !important;
  color: #E8F5E9 !important;
}
[data-dark="1"] [style*="background:#FFF8E1"],
[data-dark="1"] [style*="background: #FFF8E1"] {
  background: #2A2410 !important;
  color: #FFE082 !important;
}
[data-dark="1"] [style*="background:#E3F2FD"],
[data-dark="1"] [style*="background: #E3F2FD"] {
  background: #102236 !important;
  color: #BBDEFB !important;
}
[data-dark="1"] [style*="background:#FFEBEE"],
[data-dark="1"] [style*="background: #FFEBEE"] {
  background: #2B1414 !important;
  color: #FFCDD2 !important;
}
[data-dark="1"] [style*="background:#EDE7F6"],
[data-dark="1"] [style*="background: #EDE7F6"] {
  background: #1B0F2E !important;
  color: #D1C4E9 !important;
}
/* Inputs / textareas / selects — common readability blackhole in dark mode. */
[data-dark="1"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
[data-dark="1"] textarea,
[data-dark="1"] select {
  background: #162A18 !important;
  color: #E8F5E9 !important;
  border-color: #2E5C30 !important;
}
[data-dark="1"] input::placeholder,
[data-dark="1"] textarea::placeholder {
  color: #81C784 !important;
  opacity: 0.7;
}

/* Restricted themes — apply the same safety net to r3d3eye / praxions /
   lf-modern which all run on dark backgrounds. */
body[data-theme="r3d3eye"] [style*="color:#1B5E20"],
body[data-theme="praxions"] [style*="color:#1B5E20"] {
  color: var(--r3d-text, #E8F5E9) !important;
}
body[data-theme="r3d3eye"] [style*="background:#fff"],
body[data-theme="praxions"] [style*="background:#fff"] {
  background: var(--r3d-card-bg, #1a1a2e) !important;
}

/* Element-type fallbacks — INTENTIONALLY INERT (2026-10-09 audit).
   The old `body[data-dark="1"]` prefix never matched (the app sets data-dark on <html>), so this
   block never ran. Enabling it would paint every un-styled <div>/<span> light, including labels
   on the pastel agent buttons and yellow bars that stay light in dark mode. Pages carry
   their own scoped [data-dark="1"] rules instead. Kept for reference only. */
/*
 Element-type fallbacks: bare <body>, <main>, <section>, <article>, and
   any unstyled paragraph should always inherit the theme text color. 
[data-dark="1"] body,
[data-dark="1"] main,
[data-dark="1"] section,
[data-dark="1"] article,
[data-dark="1"] p:not([style*="color"]),
[data-dark="1"] span:not([style*="color"]),
[data-dark="1"] div:not([style*="color"]),
[data-dark="1"] li:not([style*="color"]),
[data-dark="1"] td:not([style*="color"]),
[data-dark="1"] th:not([style*="color"]) {
  color: #E8F5E9;
}
*/

/* Force-visible: links should never be unreadable. */
[data-dark="1"] a:not([style*="color"]):not([class]),
body[data-theme="r3d3eye"] a:not([style*="color"]):not([class]),
body[data-theme="praxions"] a:not([style*="color"]):not([class]) {
  color: #81C784;
}
[data-dark="1"] a:not([style*="color"]):not([class]):hover {
  color: #C5E1A5;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * build #115ar — RESTRICTED THEMES SAFETY NET (r3d3eye / praxions / lf-modern)
 *
 * The dark-mode safety net targets [data-dark="1"]. Named themes set their
 * own body[data-theme="..."] attribute and override CSS variables, but
 * inline-styled hex colors in HTML templates bypass variables entirely.
 * This block mirrors the dark-mode patches for each restricted theme.
 * ═══════════════════════════════════════════════════════════════════════════ */

/* Foreground patches: any inline-styled element using one of the dark-on-light
   greens / blues / browns gets remapped to a high-contrast theme color. */
body[data-theme="r3d3eye"] [style*="color:#1B5E20"],
body[data-theme="r3d3eye"] [style*="color: #1B5E20"],
body[data-theme="r3d3eye"] [style*="color:#0d3a14"],
body[data-theme="r3d3eye"] [style*="color: #0d3a14"],
body[data-theme="r3d3eye"] [style*="color:#1a2620"],
body[data-theme="r3d3eye"] [style*="color: #1a2620"],
body[data-theme="r3d3eye"] [style*="color:#0d2a4a"],
body[data-theme="r3d3eye"] [style*="color: #0d2a4a"],
body[data-theme="r3d3eye"] [style*="color:#5D4037"],
body[data-theme="r3d3eye"] [style*="color: #5D4037"],
body[data-theme="r3d3eye"] [style*="color:#37474F"],
body[data-theme="r3d3eye"] [style*="color: #37474F"],
body[data-theme="r3d3eye"] [style*="color:#1565C0"],
body[data-theme="r3d3eye"] [style*="color: #1565C0"],
body[data-theme="r3d3eye"] [style*="color:#222"],
body[data-theme="r3d3eye"] [style*="color: #222"],
body[data-theme="r3d3eye"] [style*="color:#333"],
body[data-theme="r3d3eye"] [style*="color: #333"],
body[data-theme="r3d3eye"] [style*="color:#558B2F"],
body[data-theme="r3d3eye"] [style*="color: #558B2F"],
body[data-theme="r3d3eye"] [style*="color:#2E7D32"],
body[data-theme="r3d3eye"] [style*="color: #2E7D32"] {
  color: #F5F5F5 !important;
}

body[data-theme="praxions"] [style*="color:#1B5E20"],
body[data-theme="praxions"] [style*="color: #1B5E20"],
body[data-theme="praxions"] [style*="color:#0d3a14"],
body[data-theme="praxions"] [style*="color: #0d3a14"],
body[data-theme="praxions"] [style*="color:#1a2620"],
body[data-theme="praxions"] [style*="color: #1a2620"],
body[data-theme="praxions"] [style*="color:#0d2a4a"],
body[data-theme="praxions"] [style*="color: #0d2a4a"],
body[data-theme="praxions"] [style*="color:#5D4037"],
body[data-theme="praxions"] [style*="color: #5D4037"],
body[data-theme="praxions"] [style*="color:#37474F"],
body[data-theme="praxions"] [style*="color: #37474F"],
body[data-theme="praxions"] [style*="color:#1565C0"],
body[data-theme="praxions"] [style*="color: #1565C0"],
body[data-theme="praxions"] [style*="color:#222"],
body[data-theme="praxions"] [style*="color: #222"],
body[data-theme="praxions"] [style*="color:#333"],
body[data-theme="praxions"] [style*="color: #333"],
body[data-theme="praxions"] [style*="color:#558B2F"],
body[data-theme="praxions"] [style*="color: #558B2F"],
body[data-theme="praxions"] [style*="color:#2E7D32"],
body[data-theme="praxions"] [style*="color: #2E7D32"] {
  color: #F5F5F5 !important;
}

/* (lf-modern-only rule removed 2026-10-09b: lf-modern is a light theme) */


/* Background patches: white cards inside dark themes → dark card surfaces. */
body[data-theme="r3d3eye"] [style*="background:#fff"],
body[data-theme="r3d3eye"] [style*="background: #fff"],
body[data-theme="r3d3eye"] [style*="background:#FFFFFF"],
body[data-theme="r3d3eye"] [style*="background: #FFFFFF"],
body[data-theme="r3d3eye"] [style*="background-color:#fff"],
body[data-theme="r3d3eye"] [style*="background-color: #fff"] {
  background: #0A0A0A !important;
  color: #F5F5F5 !important;
}
body[data-theme="praxions"] [style*="background:#fff"],
body[data-theme="praxions"] [style*="background: #fff"],
body[data-theme="praxions"] [style*="background:#FFFFFF"],
body[data-theme="praxions"] [style*="background: #FFFFFF"],
body[data-theme="praxions"] [style*="background-color:#fff"],
body[data-theme="praxions"] [style*="background-color: #fff"] {
  background: #131722 !important;
  color: #F5F5F5 !important;
}
/* (lf-modern-only rule removed 2026-10-09b: lf-modern is a light theme) */


/* Pale green / yellow / blue cards in restricted dark themes. */
body[data-theme="r3d3eye"] [style*="background:#F1F8E9"],
body[data-theme="r3d3eye"] [style*="background: #F1F8E9"],
body[data-theme="r3d3eye"] [style*="background:#E8F5E9"],
body[data-theme="r3d3eye"] [style*="background: #E8F5E9"],
body[data-theme="praxions"] [style*="background:#F1F8E9"],
body[data-theme="praxions"] [style*="background: #F1F8E9"],
body[data-theme="praxions"] [style*="background:#E8F5E9"],
body[data-theme="praxions"] [style*="background: #E8F5E9"] {
  background: #0A0A0A !important;
  color: #F5F5F5 !important;
  border-color: #2E5C30 !important;
}
body[data-theme="r3d3eye"] [style*="background:#FFF8E1"],
body[data-theme="r3d3eye"] [style*="background: #FFF8E1"],
body[data-theme="praxions"] [style*="background:#FFF8E1"],
body[data-theme="praxions"] [style*="background: #FFF8E1"] {
  background: #1A1408 !important;
  color: #FFE082 !important;
  border-color: #5D4037 !important;
}

/* Inputs / textareas / selects across restricted themes. */
body[data-theme="r3d3eye"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
body[data-theme="r3d3eye"] textarea,
body[data-theme="r3d3eye"] select,
body[data-theme="praxions"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
body[data-theme="praxions"] textarea,
body[data-theme="praxions"] select {
  background: #0A0A0A !important;
  color: #F5F5F5 !important;
  border-color: #2A2A2A !important;
}
body[data-theme="r3d3eye"] input::placeholder,
body[data-theme="r3d3eye"] textarea::placeholder,
body[data-theme="praxions"] input::placeholder,
body[data-theme="praxions"] textarea::placeholder {
  color: #888 !important;
  opacity: 0.85;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * build #115ar — LIGHT-MODE READABILITY (default theme)
 *
 * Catches the inverse problem: bright-color text on a near-white background
 * that washes out — e.g. inline color:#FFD700 (gold) on white pages where
 * the gold is invisible. Or color:#A5D6A7 (pale green) which is fine on
 * dark cards but vanishes when the same chip is placed on a white card.
 *
 * We only patch where the body is in DEFAULT mode (no data-dark, no
 * restricted theme) AND the element doesn't already have a dark bg.
 * ═══════════════════════════════════════════════════════════════════════════ */

html:not([data-dark="1"]) body:not([data-theme="r3d3eye"]):not([data-theme="praxions"]) [style*="color:#FFD700"]:not([style*="background"]),
html:not([data-dark="1"]) body:not([data-theme="r3d3eye"]):not([data-theme="praxions"]) [style*="color: #FFD700"]:not([style*="background"]),
html:not([data-dark="1"]) body:not([data-theme="r3d3eye"]):not([data-theme="praxions"]) [style*="color:#FFE082"]:not([style*="background"]),
html:not([data-dark="1"]) body:not([data-theme="r3d3eye"]):not([data-theme="praxions"]) [style*="color: #FFE082"]:not([style*="background"]) {
  color: #E65100 !important;   /* gold → deep orange on white pages */
}
html:not([data-dark="1"]) body:not([data-theme="r3d3eye"]):not([data-theme="praxions"]) [style*="color:#A5D6A7"]:not([style*="background"]),
html:not([data-dark="1"]) body:not([data-theme="r3d3eye"]):not([data-theme="praxions"]) [style*="color: #A5D6A7"]:not([style*="background"]),
html:not([data-dark="1"]) body:not([data-theme="r3d3eye"]):not([data-theme="praxions"]) [style*="color:#C8E6C9"]:not([style*="background"]),
html:not([data-dark="1"]) body:not([data-theme="r3d3eye"]):not([data-theme="praxions"]) [style*="color: #C8E6C9"]:not([style*="background"]),
html:not([data-dark="1"]) body:not([data-theme="r3d3eye"]):not([data-theme="praxions"]) [style*="color:#81C784"]:not([style*="background"]),
html:not([data-dark="1"]) body:not([data-theme="r3d3eye"]):not([data-theme="praxions"]) [style*="color: #81C784"]:not([style*="background"]) {
  color: #1B5E20 !important;   /* pale green → forest green on white pages */
}
html:not([data-dark="1"]) body:not([data-theme="r3d3eye"]):not([data-theme="praxions"]) [style*="color:#fff"]:not([style*="background"]),
html:not([data-dark="1"]) body:not([data-theme="r3d3eye"]):not([data-theme="praxions"]) [style*="color: #fff"]:not([style*="background"]),
html:not([data-dark="1"]) body:not([data-theme="r3d3eye"]):not([data-theme="praxions"]) [style*="color:#FFFFFF"]:not([style*="background"]),
html:not([data-dark="1"]) body:not([data-theme="r3d3eye"]):not([data-theme="praxions"]) [style*="color: #FFFFFF"]:not([style*="background"]) {
  color: #1B5E20 !important;   /* white → forest green when no bg paired */
}

/* ═══════════════════════════════════════════════════════════════════════════
 * build #115ar — UNIVERSAL TEXT/BUTTON CONTRAST FLOOR
 *
 * Buttons should always have visible text. Many inline button styles set
 * a background but rely on inherited color — which can be wrong per theme.
 * ═══════════════════════════════════════════════════════════════════════════ */

button:not([style*="color"]) {
  /* Default to current text color; specific themes override below. */
}
/* 2026-10-09 audit: inert on purpose — a blanket light colour on every class-styled button would
   break the pastel agent / demo-book buttons that keep a light background in dark mode. */
body.lh-never[data-dark="1"] button:not([style*="color"]):not(.disc-btn):not(.act-btn) {
  color: #E8F5E9;
}
body[data-theme="r3d3eye"] button:not([style*="color"]):not(.disc-btn):not(.act-btn) {
  color: #F5F5F5;
}
body[data-theme="praxions"] button:not([style*="color"]):not(.disc-btn):not(.act-btn) {
  color: #F5F5F5;
}

/* Last-resort GUARANTEE: any text node whose parent has BOTH inline color
   and background that happen to match (super-rare but possible) gets one
   final override via a high-z-index visibility-promotion class. Activated
   only by .lh-force-readable for surgical use. */
.lh-force-readable,
.lh-force-readable * {
  text-shadow: 0 0 2px rgba(0,0,0,0.35) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * build #115as — CALENDAR + BOX SECTIONS theme audit
 *
 * Per rep report: "calendar and other box sections still struggling to
 * change background and writing color." The calendar uses inline styles
 * like rgba(76,175,80,0.30) borders and #FFF8E1 backgrounds that bypass
 * the previous safety net. This block hits them across every theme.
 * ═══════════════════════════════════════════════════════════════════════════ */

/* CALENDAR — applies to dark mode + every restricted theme. */
[data-dark="1"] #cal-grid,
body[data-theme="r3d3eye"] #cal-grid,
body[data-theme="praxions"] #cal-grid {
  background: transparent !important;
  color: #E8F5E9 !important;
}
[data-dark="1"] #cal-grid > div,
body[data-theme="r3d3eye"] #cal-grid > div,
body[data-theme="praxions"] #cal-grid > div {
  background: #0F1A0F !important;
  color: #E8F5E9 !important;
  border-color: #2E5C30 !important;
}
body[data-theme="r3d3eye"] #cal-grid > div {
  background: #0A0A0A !important;
  color: #F5F5F5 !important;
  border-color: #1A1A1A !important;
}
body[data-theme="praxions"] #cal-grid > div {
  background: #131722 !important;
  color: #F5F5F5 !important;
  border-color: #1F2330 !important;
}
/* Today / selected day highlights stay visible. */
[data-dark="1"] #cal-grid > div[style*="background:#FFF8E1"],
body[data-theme="r3d3eye"] #cal-grid > div[style*="background:#FFF8E1"],
body[data-theme="praxions"] #cal-grid > div[style*="background:#FFF8E1"] {
  background: #2A2410 !important;
  color: #FFE082 !important;
  border-color: #FFD54F !important;
}
[data-dark="1"] #cal-grid > div span,
body[data-theme="r3d3eye"] #cal-grid > div span,
body[data-theme="praxions"] #cal-grid > div span {
  color: inherit !important;
}
/* Faded out-of-month days. */
[data-dark="1"] #cal-grid > div[style*="color:#bbb"],
[data-dark="1"] #cal-grid > div [style*="color:#bbb"],
body[data-theme="r3d3eye"] #cal-grid > div[style*="color:#bbb"],
body[data-theme="r3d3eye"] #cal-grid > div [style*="color:#bbb"],
body[data-theme="praxions"] #cal-grid > div[style*="color:#bbb"],
body[data-theme="praxions"] #cal-grid > div [style*="color:#bbb"] {
  color: #5E7A5E !important;
}
/* Event chips inside calendar cells (money/percent labels). */
[data-dark="1"] #cal-event-list,
body[data-theme="r3d3eye"] #cal-event-list,
body[data-theme="praxions"] #cal-event-list {
  color: #E8F5E9 !important;
}

/* SETTINGS sections — common card containers. */
[data-dark="1"] .settings-section,
body[data-theme="r3d3eye"] .settings-section,
body[data-theme="praxions"] .settings-section {
  background: #162A18 !important;
  color: #E8F5E9 !important;
  border-color: #2E5C30 !important;
}
body[data-theme="r3d3eye"] .settings-section { background: #0A0A0A !important; border-color: #1A1A1A !important; color: #F5F5F5 !important; }
body[data-theme="praxions"] .settings-section { background: #131722 !important; border-color: #1F2330 !important; color: #F5F5F5 !important; }

[data-dark="1"] .settings-section-header,
body[data-theme="r3d3eye"] .settings-section-header,
body[data-theme="praxions"] .settings-section-header {
  color: #E8F5E9 !important;
}
body[data-theme="r3d3eye"] .settings-section-header,
body[data-theme="praxions"] .settings-section-header { color: #F5F5F5 !important; }

[data-dark="1"] .settings-section-body,
body[data-theme="r3d3eye"] .settings-section-body,
body[data-theme="praxions"] .settings-section-body {
  background: transparent !important;
  color: #E8F5E9 !important;
}
body[data-theme="r3d3eye"] .settings-section-body,
body[data-theme="praxions"] .settings-section-body { color: #F5F5F5 !important; }

/* Admin rank-cards (Worker Timings panel, Commission Rules panel, etc.) */
[data-dark="1"] .rank-card,
body[data-theme="r3d3eye"] .rank-card,
body[data-theme="praxions"] .rank-card {
  background: #162A18 !important;
  color: #E8F5E9 !important;
  border-color: #2E5C30 !important;
}
body[data-theme="r3d3eye"] .rank-card { background: #0A0A0A !important; border-color: #1A1A1A !important; color: #F5F5F5 !important; }
body[data-theme="praxions"] .rank-card { background: #131722 !important; border-color: #1F2330 !important; color: #F5F5F5 !important; }
[data-dark="1"] .rank-card-title,
body[data-theme="r3d3eye"] .rank-card-title,
body[data-theme="praxions"] .rank-card-title { color: #FFD54F !important; }

/* CFG-CARD (integration config cards in settings) */
[data-dark="1"] [id^="cfg-card-"],
body[data-theme="r3d3eye"] [id^="cfg-card-"],
body[data-theme="praxions"] [id^="cfg-card-"] {
  background: transparent !important;
  color: #E8F5E9 !important;
}

/* Sheet inputs (settings field labels) */
[data-dark="1"] .sheet-field-label,
body[data-theme="r3d3eye"] .sheet-field-label,
body[data-theme="praxions"] .sheet-field-label {
  color: #A5D6A7 !important;
}
body[data-theme="r3d3eye"] .sheet-field-label { color: #FF8888 !important; }
body[data-theme="praxions"] .sheet-field-label { color: #66F2FF !important; }

[data-dark="1"] .sheet-input,
body[data-theme="r3d3eye"] .sheet-input,
body[data-theme="praxions"] .sheet-input {
  background: #0F1A0F !important;
  color: #E8F5E9 !important;
  border-color: #2E5C30 !important;
}
body[data-theme="r3d3eye"] .sheet-input { background: #050810 !important; border-color: #1A1A1A !important; color: #F5F5F5 !important; }
body[data-theme="praxions"] .sheet-input { background: #0B0E14 !important; border-color: #1F2330 !important; color: #F5F5F5 !important; }

/* Connection pills (Not Connected / Connected) */
[data-dark="1"] .conn-pill,
body[data-theme="r3d3eye"] .conn-pill,
body[data-theme="praxions"] .conn-pill {
  filter: brightness(1.05);
}

/* Generic box-shadow restoration so cards on dark themes still feel layered */
[data-dark="1"] .settings-section,
[data-dark="1"] .rank-card,
body[data-theme="r3d3eye"] .settings-section,
body[data-theme="r3d3eye"] .rank-card,
body[data-theme="praxions"] .settings-section,
body[data-theme="praxions"] .rank-card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.5), 0 0 1px rgba(255,255,255,0.04) !important;
}

/* Headers / titles that hardcode forest green text — invisible against
   dark-green backgrounds. Promote to bright green in any non-default mode. */
[data-dark="1"] h1, [data-dark="1"] h2, [data-dark="1"] h3, [data-dark="1"] h4 {
  color: #A5D6A7 !important;
}
body[data-theme="r3d3eye"] h1, body[data-theme="r3d3eye"] h2, body[data-theme="r3d3eye"] h3, body[data-theme="r3d3eye"] h4 {
  color: #FF6666 !important;
}
body[data-theme="praxions"] h1, body[data-theme="praxions"] h2, body[data-theme="praxions"] h3, body[data-theme="praxions"] h4 {
  color: #66F2FF !important;
}

/* Catch any element using rgba(76,175,80,...) green-tint inline backgrounds
   — these are calendar cells + sundry settings boxes. */
[data-dark="1"] [style*="rgba(76,175,80"],
body[data-theme="r3d3eye"] [style*="rgba(76,175,80"],
body[data-theme="praxions"] [style*="rgba(76,175,80"] {
  background: rgba(46,124,50,0.25) !important;
  color: #E8F5E9 !important;
}

/* Anything with var(--lf-pale) or var(--lf-light) backgrounds */
[data-dark="1"] [style*="background:var(--lf-pale)"],
[data-dark="1"] [style*="background: var(--lf-pale)"],
[data-dark="1"] [style*="background:var(--lf-light)"],
[data-dark="1"] [style*="background: var(--lf-light)"] {
  background: #0F1A0F !important;
  color: #E8F5E9 !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * v1.9.42 — small contrast fixes found in a readability sweep.
 * (Light text inside dark cards is handled in themes.js — see
 * "keepLightTextOnDark" — because only a script can see which ancestor
 * actually paints the background.)
 * ═══════════════════════════════════════════════════════════════════════════ */
/* "NEEDS ATTENTION" was orange on the green header — light amber reads. */
.attention-label { color: #FFCC80 !important; }
/* Empty-state lines on the dark estimator bar were 30% white. */
.est-car-empty, #sn-empty, .sn-empty { color: rgba(255,255,255,0.68) !important; }
/* Grey hints on white cards were #aaa (2.1:1). */
.cdt-hint, .ds-empty { color: #6f6f6f !important; }
/* Rankings tables: the header row is dark green, but `.lb-table th` set the
   cells to the muted grey-green, so the column names disappeared. */
.lb-table tr[style*="background"] th { color: #fff !important; }

/* ═══════════════════════════════════════════════════════════════════════════
 * v1.9.43 — visual sweep fixes (phone first, then desktop).
 * Found by checking every page at 390px wide for things running off the
 * screen, overlapping, or unreadable.
 * ═══════════════════════════════════════════════════════════════════════════ */

/* Status pills on the customer card carried long raw error text (e.g. an
   Appium failure) on one line, which ran off the side of a phone. Keep it to
   one line with an ellipsis; the full text is still in the pill's tooltip. */
.lc-vpill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; display: inline-block; }
/* Saved-quote chips with long scopes (6LF1 30 + 6LF2 88 + …) did the same. */
.lc-ql-chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

@media (max-width: 600px) {
  /* Dashboard header: the account chip was pushed off the right edge. */
  .header-inner { flex-wrap: wrap !important; row-gap: 6px; }
  #auth-bar { width: 100%; justify-content: flex-end; margin-left: 0 !important; }
  /* BETA badge sat on top of "EaveDrop" and the tagline. */
  .lh-brand-block .beta-badge { top: 12px !important; right: -46px !important; left: auto !important; transform: scale(0.85) !important; }
  .lh-brand-block .beta-sub { display: none !important; }
  /* Dashboard sync buttons ran off the right edge in one long row. */
  #sync-log-btns { flex-wrap: wrap !important; }
  #sync-log-btns > * { flex: 1 1 calc(50% - 6px) !important; min-width: 0 !important; }
  /* Settings: ten tabs squeezed into one row ran together
     ("ProfileIntegrationsDisplay…") and off the screen. Let the row scroll. */
  .tab-bar:has(> .tab-btn:nth-child(5)) { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tab-bar:has(> .tab-btn:nth-child(5))::-webkit-scrollbar { display: none; }
  .tab-bar:has(> .tab-btn:nth-child(5)) > .tab-btn { flex: 0 0 auto !important; padding: 10px 12px !important; white-space: nowrap; }
  /* Commission: the per-job table was wider than a phone. Let it scroll. */
  .wrap > table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
/* ═══════════════════════════════════════════════════════════════════════════
 * 2026-10-09b — THEME READABILITY AUDIT (d340)
 *
 * J: "take one look at a live view page of all the themes to do an audit of all the colors. Some of
 * them still need adjusting to be able to read everything on the site."
 *
 * Method: every theme x every page (dashboard, leads, estimator, communications, settings incl. every
 * tab, action needed, social inbox, sheet view) rendered at 390 and 1280 in headless Chromium with
 * open lead cards, the Email Updates sheet, menus, chat, SGS, the Rec overlay and the Server tab, then
 * a DOM walk measured the real foreground / background of every piece of text, every placeholder and
 * every control edge (WCAG: 4.5:1 body, 3:1 large text / edges). Everything below is a fix for a
 * measured failure. Rules are grouped by what they fix; theme character is kept (same hues, only the
 * failing surface or ink moves).
 *
 * Two root causes explain most of the ~350 failures per theme:
 *   1. --lf-light / --lf-pale are "pale green" in the default palette and are used BOTH as a light
 *      surface and as light ink on dark bands. The dark themes remapped --lf-light to a DARK colour
 *      (midnight #1E40AF, monolith #2A2A2A ...), so every label that paints with it vanished
 *      (estimator commission bar, section headers, chat subtitle, drawer titles). --lf-light is now a
 *      light tint in every dark theme again; surfaces that need to stay dark are handled per class.
 *   2. The pages' dark rules force light ink on whole subtrees (`.lead-card .lc-body *`,
 *      `.settings-section *`) but lead_card.css / the Server tab keep light pills, slots and tiles,
 *      so those read light-on-light. Those surfaces now get a dark tint in dark mode.
 * ═══════════════════════════════════════════════════════════════════════════ */

/* ── 0. Palette touch-ups ─────────────────────────────────────────────────── */
/* default: --muted (#607D60) measured 4.1:1 on the page and card. One step darker keeps the tone. */
html:not([data-dark="1"]) body[data-theme="default"] { --muted: #4E6B4F; }
/* light-ink variable for the dark themes (see root cause 1). */
body[data-theme="midnight"]  { --lf-light: #BFDBFE; }
body[data-theme="blueprint"] { --lf-light: #BFDBFE; }
body[data-theme="glass"]     { --lf-light: #DDD6FE; }
body[data-theme="monolith"]  { --lf-light: #D4D4D4; }
body[data-theme="terminal"]  { --lf-light: #9CFFC4; }
body[data-theme="r3d3eye"]   { --lf-light: #FFB3B3; }
body[data-theme="proxion"],
body[data-theme="praxions"]  { --lf-light: #B3F5FF; }
/* proxion painted header bands, buttons and pills with bright cyan (#00E5FF) under white text (1.6:1).
   The bands move to a deep teal; the cyan stays as --lf-mid / --lf-accent for borders and highlights. */
body[data-theme="proxion"],
body[data-theme="praxions"]  { --lf-primary: #0E7490; --lf-dark: #155E75; }
/* r3d3eye: white on pure #FF1A1A measured 4.0:1 on the header band. */
body[data-theme="r3d3eye"]   { --lf-primary: #D50000; }
/* ocean: white on #14B8A6 bands measured 2.4:1; aqua stays in --lf-mid / --lf-accent. */
body[data-theme="ocean"]     { --lf-primary: #0F766E; --lf-dark: #115E59; }
/* sunset: white on #EA580C measured 3.3:1. */
body[data-theme="sunset"]    { --lf-primary: #C2410C; }
/* sage: white on #688F68 measured 3.4:1. */
body[data-theme="sage"]      { --lf-primary: #4D6A4D; --lf-dark: #3E573E; }
/* daylight: white on #3B82F6 measured 3.7:1. */
body[data-theme="daylight"]  { --lf-primary: #2563EB; }
/* autumn: white on #B45309 measured 4.0:1. */
body[data-theme="autumn"]    { --lf-primary: #92400E; --lf-dark: #7C3A0C; }
/* terminal: the #00AA44 "muted" ink measured 4.0:1 on the near-black page. */
body[data-theme="terminal"]  { --muted: #2EC46A; }
/* sage / daylight / lf-modern muted ink measured 4.3-4.5:1 on their page colour. */
body[data-theme="sage"]      { --muted: #5B6E5B; }
body[data-theme="daylight"]  { --muted: #5B6472; --r3d-text-muted: #5B6472; }
body[data-theme="lf-modern"] { --muted: #4E6B4F; --r3d-text-muted: #4E6B4F; }
/* midnight: #94A3B8 muted on the #0F172A card is fine; #1E40AF --lf-light handled above. */

/* ── 1. Header bands and chips (every theme; the default header too) ──────────
   White on var(--lf-primary) (#388E3C) measured 4.1:1 for the page titles, 3.3:1 for the back button,
   2.0:1 for the "Active" count. The band gradient now ends at --lf-dark instead of --lf-primary, and the
   small chips on it get a darker backdrop. */
.header, .leads-header, .settings-header {
  background: linear-gradient(135deg, var(--lf-darkest), var(--lf-dark)) !important;
}
.header .back-btn, .back-btn, .sdd-btn, .rep-chip, .active-reps-pill, #ticker-rankings-trigger {
  background: rgba(0,0,0,0.28) !important;
  color: #fff !important;
}
.active-reps-pill .live-active-num, .live-active-word, .sdd-btn > span, .rep-chip > span, .rep-chip-gear { color: #fff !important; }
.rep-avatar { background: rgba(0,0,0,0.38) !important; color: #fff !important; border: 2px solid rgba(255,255,255,0.6) !important; }
.header-sub, .lh-brand-block .header-sub, #header-clock { color: rgba(255,255,255,0.93) !important; }
.beta-badge .beta-label { color: #1A1A1A !important; background: #FFD54F !important; }
.beta-badge .beta-sub { color: #FFE082 !important; }
#attention-bar .attention-label, .attention-label { color: #FFF8E1 !important; }
.ticker-item .ti-cat { color: #FFF59D !important; }
#lh-beta-badge .beta-label { color: #1A1A1A !important; }
/* chat panel header */
.chat-header { background: linear-gradient(135deg, var(--lf-darkest), var(--lf-dark)) !important; }
.chat-header-name { color: #fff !important; }
.chat-header-sub  { color: rgba(255,255,255,0.93) !important; }
/* weather strip and tour header (pale green on #2E7D32: 3.8:1) */
#wx-sub.weather-sub, .weather-sub, #wx-arrow, #tut-step-counter, #tut-subtitle { color: rgba(255,255,255,0.92) !important; }
/* est ticker: the bar's gradient ran into --lf-mid (#43A047) where white measured 3.3:1 and the
   yellow / orange result labels 1.2-1.7:1. The bar keeps the brand gradient but ends at --lf-dark. */
.est-bar { background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0) 60%), var(--lf-darkest) !important; }
.est-bar-label { color: #fff !important; }
.est-row-label.today .today-chev, .est-row-label.sale .sale-chev { color: inherit !important; }
.est-car-sub { color: rgba(255,255,255,0.82) !important; }
/* 2026-10-10 -- J: canceled is written in BLACK (unresulted is the white one). Black ink on a light
   chip (dashboard.html .est-car-cxl / .est-row-label.canceled) -- 15:1 on #ECEFF1 in every theme. */
/* 2026-10-10 d355 - J: canceled entries are just black text with NO white background (chip removed). */
.est-bar .est-row-label.canceled { color: #111111 !important; text-decoration-color: #111111 !important; text-shadow: none !important; background: none !important; }
.est-bar .est-car-item.est-car-cxl { background: none !important; }
.est-bar .est-car-item.est-car-cxl .est-car-id, .est-bar .est-car-item.est-car-cxl .est-car-sub, .est-bar .est-car-item.est-car-cxl .est-car-sub span { color: #111111 !important; text-shadow: none !important; -webkit-text-stroke: 0 !important; }
.est-row-label.nodemo, #est-ticker-track-nodemo .est-car-id { color: #FFCCBC !important; text-decoration-color: #FFCCBC !important; }
.est-row-label.demo, #est-ticker-track-demo .est-car-id { color: #FFE082 !important; text-decoration-color: #FFE082 !important; }
.est-row-label.sale, #est-ticker-track-sale .est-car-id { color: #B9F6CA !important; text-decoration-color: #B9F6CA !important; }
.est-row-label.today_install { color: #90CAF9 !important; text-decoration-color: #90CAF9 !important; }

/* ── 2. Light-theme ink that measured under 4.5:1 (default and the six light themes) ─── */
.section-label, .demo-books-title, .my-leads-title, .totals-title, .sort-label, .actions-bar-label,
footer.footer, .footer, #tt-note { color: var(--muted) !important; }
footer.footer > div, footer.footer > div > span, footer > div { color: var(--muted) !important; opacity: 1 !important; }
.er-when, .er-job { color: #616161 !important; }
.er-dir { color: #37474F !important; }
.cdt-hint, .ds-empty, .slot-label > span, .acct-menu-slider span, .acct-menu-group { color: #5F6F63 !important; }
.lc-imagery-none > span { color: #5F6F63 !important; }
.lc-ql--empty .lc-ql-none { color: #5A6F5E !important; }
.lc-body .lc-hseg--na em, .lc-body .lc-hseg--na, .lc-body .lc-hseg--todo em { color: #455A64 !important; }
.lc-header .lc-hseg--na em, .lc-header .lc-hseg--todo em { color: #37474F !important; }
.lc-ql--wo .lc-ql-head .lc-ql-sf--done { background: rgba(255,255,255,0.18) !important; color: #fff !important; border-color: rgba(255,255,255,0.5) !important; }
.comm-bar, .drawer-comm-bar { background: linear-gradient(135deg, var(--lf-darkest), var(--lf-dark)) !important; }
.est-bar [style*="color:#000"]:not(.est-car-cxl *) { color: #ECEFF1 !important; }
.lc-header.sale .lc-hbar--full .lc-hseg--done, .lc-header.sale .lc-hbar--full .lc-hseg--done em { color: #fff !important; }
.lc-ql--empty { opacity: 0.9 !important; }
.lc-hd-todo { opacity: 0.9 !important; }
/* 2026-10-10 d352 - J: "See more leads page is not showing the relevant lead colors on the lead or opportunities
   per day." The line that stood here (`.day-chip { background:#616161 !important }`) painted EVERY per-day result
   chip gray, so Sale / Demo / No Demo / Not Hit / Reset / Canceled all looked the same. Only the gray Not Resulted
   chip (#9E9E9E, white ink 2.7:1) needed the darker #616161. Each chip keeps its result colour and gets readable ink;
   the specificity also beats the dark-mode [style*="color:#3E2723"] remap (light ink on yellow) and r3d3eye's
   [style*="background:#1B5E20"] reset (transparent Sale chip). */
/* 2026-10-10 d353 - J: "Today's leads unresulted should be pink." Not Resulted chips are PINK #F8BBD0 with dark plum
   ink #4A1B2C (8.6:1), no longer gray #9E9E9E/#616161; Demo No Sale chips are the yellow Demo chip. */
html body .day-divider .day-chip[style*="background:#F8BBD0"] { background: #F8BBD0 !important; color: #4A1B2C !important; }
html body .day-divider .day-chip[style*="background:#1B5E20"] { background: #1B5E20 !important; color: #FFFFFF !important; }
html body .day-divider .day-chip[style*="background:#F9A825"] { background: #F9A825 !important; color: #3E2723 !important; }
html body .day-divider .day-chip[style*="background:#BF360C"] { background: #BF360C !important; color: #FFFFFF !important; }
html body .day-divider .day-chip[style*="background:#546E7A"] { background: #546E7A !important; color: #FFFFFF !important; }
html body .day-divider .day-chip[style*="background:#37474F"] { background: #37474F !important; color: #FFFFFF !important; }
html body .day-divider .day-chip[style*="background:#000000"] { background: #000000 !important; color: #FFFFFF !important; }
.act-btn-flow-estimator, .act-btn-gbb { background: #546E7A !important; color: #fff !important; }
.rank-card-title span, .rank-card-title { color: inherit; }
/* orange ink on the pale agent / demo-book buttons (2.9-3.0:1) */
.aob-label, .aob-agent, .demo-book-btn, #page-sales-btn svg text { color: #8D3A00 !important; fill: #8D3A00 !important; }
#page-socialmkt-btn .aob-label, #page-socialmkt-btn .aob-agent { color: #880E4F !important; }
#page-comms-btn .aob-label, #page-comms-btn .aob-agent { color: #0D47A1 !important; }
.aob-leaf .aob-label, .aob-leaf .aob-agent, #page-chat-btn .aob-label, #page-chat-btn .aob-agent { color: #1B5E20 !important; }
[style*="color:#E65100"]:not([style*="background"]), [style*="color: #E65100"]:not([style*="background"]) { color: #BF360C !important; }
.action-chip { color: #8D3A00 !important; }
.action-chip .ac-age { color: #5D4037 !important; }
#sync-result { color: #BF360C !important; }
#liveversa-cam-card [style*="background:#FFE082"] { color: #1A1A1A !important; }
[data-dark="1"] #liveversa-cam-card [style*="color:#A5D6A7"] { color: #C8E6C9 !important; }
[data-dark="1"] .page > div > strong[style*="BETA"], [data-dark="1"] strong[style*="background:#FFCC80"] { color: #1A1A1A !important; }
/* estimator: price-sheet item codes (2.2:1) and the Build button */
html:not([data-dark="1"]) .item-code-badge { color: #1B5E20 !important; background: #F1F8E9 !important; }
[data-dark="1"] .item-code-badge { color: #C8E6C9 !important; background: rgba(255,255,255,0.10) !important; }
.slot-num { color: #0D3A14 !important; }
#build-btn { color: #1A1A1A !important; }
.step-card-header-text p { color: #4E6B4F !important; }
/* Server tab small print (4.4:1 on white) */
#sh-body .sh-sub, #sh-body .sh-tile span { color: #5A6F5E !important; }
/* settings: rankings donor wall + roadmap help boxes, BETA chips */
#donor-wall span, #donor-wall { color: #fff !important; }
.settings-section-title span[style*="background"] { color: #1A1A1A !important; }
/* icon-only chat textarea had no visible edge */
.chat-input, #chat-input { border: 1.5px solid #757575 !important; }
#leads-search, .search-bar input { border: 1.5px solid #757575 !important; }
/* day-of-month "est" placeholder and out-of-month days in the calendar (#bbb: 1.9:1) */
#cal-grid [style*="color:#bbb"], #cal-grid [style*="color: #bbb"] { color: #757575 !important; }

/* ── 3. DARK MODE — components the page-level dark rules left light ────────── */
/* lead card body + result tints (the dashboard had none; /leads already carries the same set) */
[data-dark="1"] .lead-card .lc-body { background: #162A18 !important; }
[data-dark="1"] .lead-card.lead-card-sale .lc-body,  [data-dark="1"] .lead-card.opportunity-card-sale .lc-body  { background: #122E14 !important; }
[data-dark="1"] .lead-card.lead-card-demo .lc-body,  [data-dark="1"] .lead-card.opportunity-card-demo .lc-body  { background: #3A2E0A !important; }
[data-dark="1"] .lead-card.lead-card-nodemo .lc-body,[data-dark="1"] .lead-card.opportunity-card-nodemo .lc-body { background: #3A1F08 !important; }
[data-dark="1"] .lead-card.lead-card-nosale .lc-body,[data-dark="1"] .lead-card.opportunity-card-nosale .lc-body { background: #2E0F1E !important; }
[data-dark="1"] .lead-card.lead-card-canceled .lc-body, [data-dark="1"] .lead-card.opportunity-card-canceled .lc-body { background: #0F0F0F !important; }
[data-dark="1"] .lead-card .lc-header          { background: #1F3621 !important; border-bottom-color: #2E5C30 !important; }
[data-dark="1"] .lead-card .lc-header.sale     { background: #1B4620 !important; }
[data-dark="1"] .lead-card .lc-header.nosale   { background: #880E4F !important; }   /* d353 pink (not resulted) */
[data-dark="1"] .lead-card .lc-header.nothit   { background: #455A64 !important; }
[data-dark="1"] .lead-card .lc-header.reset    { background: #263238 !important; }
[data-dark="1"] .lead-card .lc-header.nodemo   { background: #7A2E00 !important; }
[data-dark="1"] .lead-card .lc-header.demo     { background: #7A5800 !important; }
[data-dark="1"] .lead-card .lc-header.canceled { background: #000 !important; }
[data-dark="1"] .lead-card .lc-header .hdr-when, [data-dark="1"] .lead-card .lc-header .hdr-name,
[data-dark="1"] .lead-card .lc-header .lead-cust, [data-dark="1"] .lead-card .lc-header .appt-time { color: #fff !important; }
[data-dark="1"] .lead-card .lc-header .hdr-rtype-primary { background: rgba(0,0,0,0.38) !important; color: #fff !important; border-color: rgba(255,255,255,0.25) !important; }
[data-dark="1"] .lead-card .lc-header .lead-contact-row span, [data-dark="1"] .lead-card .lc-header .lead-address span,
[data-dark="1"] .lead-card .lc-header .lead-contact-row a { color: #fff !important; }
[data-dark="1"] .lead-card .lc-header .lead-contact-row > div, [data-dark="1"] .lead-card .lc-header .lead-address { background: rgba(0,0,0,0.3) !important; }
/* job facts column, pills, segments, slots */
[data-dark="1"] .lead-card .lc-hd { background: rgba(255,255,255,0.06) !important; }
[data-dark="1"] .lead-card .lc-hd .lc-hd-k { color: #AAB8AB !important; }
[data-dark="1"] .lead-card .lc-hd .lc-hd-v, [data-dark="1"] .lead-card .lc-hd .lc-hd-v span { color: #E8F5E9 !important; }
[data-dark="1"] .lead-card .lc-hd .lc-hd-todo { color: #FFCC80 !important; opacity: 1 !important; }
[data-dark="1"] .lead-card .lc-body .lc-vpill { background: rgba(255,255,255,0.09) !important; color: #E8F5E9 !important; border-color: rgba(255,255,255,0.22) !important; }
[data-dark="1"] .lead-card .lc-body .lc-vpill--ok    { background: rgba(129,199,132,0.18) !important; color: #C8E6C9 !important; border-color: rgba(129,199,132,0.45) !important; }
[data-dark="1"] .lead-card .lc-body .lc-vpill--warn  { background: rgba(255,183,77,0.18) !important;  color: #FFCC80 !important; border-color: rgba(255,183,77,0.5) !important; }
[data-dark="1"] .lead-card .lc-body .lc-vpill--bad   { background: rgba(239,154,154,0.18) !important; color: #FFCDD2 !important; border-color: rgba(239,154,154,0.5) !important; }
[data-dark="1"] .lead-card .lc-body .lc-vpill--bonus { background: rgba(100,181,246,0.18) !important; color: #BBDEFB !important; border-color: rgba(100,181,246,0.5) !important; }
[data-dark="1"] .lead-card .lc-body .lc-vpill--none  { color: #CFD8DC !important; }
[data-dark="1"] .lead-card .lc-hseg--todo, [data-dark="1"] .lead-card .lc-hseg--na { background: rgba(255,255,255,0.10) !important; }
[data-dark="1"] .lead-card .lc-hseg--todo em, [data-dark="1"] .lead-card .lc-hseg--na em { color: #E8F5E9 !important; }
[data-dark="1"] .lead-card .lc-hseg--done, [data-dark="1"] .lead-card .lc-header.sale .lc-hbar--full .lc-hseg--done { background: linear-gradient(180deg,#1976D2,#0D47A1) !important; }
[data-dark="1"] .lead-card .lc-hseg--done em { color: #fff !important; }
[data-dark="1"] .lead-card .lc-hbar-top, [data-dark="1"] .lead-card .lc-hbar--stack .lc-hbar-top { background: rgba(0,0,0,0.35) !important; }
[data-dark="1"] .lead-card .lc-hbar-need, [data-dark="1"] .lead-card .lc-hbar-lbl, [data-dark="1"] .lead-card .lc-hbar-pct { color: #fff !important; }
[data-dark="1"] .lead-card .lc-body .lc-imagery-none { background: rgba(255,255,255,0.06) !important; border-color: #2E5C30 !important; }
[data-dark="1"] .lead-card .lc-body .lc-imagery-none span { color: #CFD8DC !important; }
[data-dark="1"] .lead-card .lc-body .lc-imagery-none button, [data-dark="1"] .lead-card .lc-cxl-btn { background: rgba(255,255,255,0.12) !important; color: #fff !important; border-color: rgba(255,255,255,0.3) !important; }
[data-dark="1"] .lead-card .lc-body .lc-img-bar { background: rgba(255,255,255,0.08) !important; color: #E8F5E9 !important; }
[data-dark="1"] .lead-card .lc-body .act-btn { background: rgba(255,255,255,0.08) !important; color: #E8F5E9 !important; border-color: rgba(255,255,255,0.22) !important; }
[data-dark="1"] .lead-card .lc-body .act-btn-flow-estimator, [data-dark="1"] .lead-card .lc-body .act-btn-gbb { background: rgba(84,110,122,0.6) !important; color: #fff !important; }
[data-dark="1"] .lead-card .lc-ql { background: rgba(255,255,255,0.06) !important; opacity: 1 !important; }
[data-dark="1"] .lead-card .lc-ql--empty { opacity: 0.9 !important; }
[data-dark="1"] .lead-card .lc-hbar--stack, [data-dark="1"] .lead-card .lc-header .lc-hbar { background: rgba(0,0,0,0.35) !important; }
[data-dark="1"] .lead-card .lc-body .lc-ql--empty .lc-ql-none { background: rgba(255,255,255,0.05) !important; color: #CFD8DC !important; }
[data-dark="1"] .lead-card .lc-body .lc-ql--empty .lc-ql-head { background: rgba(249,168,37,0.22) !important; }
[data-dark="1"] .lead-card .lc-body .lc-ql--empty .lc-ql-title, [data-dark="1"] .lead-card .lc-body .lc-ql-sf--none { color: #FFE082 !important; background: transparent !important; }
[data-dark="1"] .lead-card .lc-body .lc-ql-sf--done { background: rgba(129,199,132,0.22) !important; color: #C8E6C9 !important; }
[data-dark="1"] .lead-card .lc-body [id^="lc-match-"] > div { background: rgba(239,68,68,0.18) !important; }
[data-dark="1"] .lead-card .lc-body [id^="lc-match-"] > div > span, [data-dark="1"] .lead-card .lc-body [id^="lc-match-"] [style*="color:#B91C1C"] { color: #FFCDD2 !important; }
[data-dark="1"] .lead-card .lc-body [id^="lc-match-"] [style*="color:#92400E"] { color: #FFE082 !important; }
[data-dark="1"] .lead-card .lc-body .lc-gtr-status-row { background: rgba(0,0,0,0.3) !important; }
[data-dark="1"] .travel-leg-row, [data-dark="1"] .travel-leg-row .tleg-inner { color: #C8E6C9 !important; opacity: 1 !important; }
[data-dark="1"] .travel-leg-row .tleg-inner { background: rgba(255,255,255,0.07) !important; border-color: #2E5C30 !important; }
.travel-leg-row .tleg-inner[style*="opacity"] { opacity: 1 !important; color: #2E7D32; }
/* Email Updates sheet */
[data-dark="1"] .er-grp > summary, [data-dark="1"] .er-grp summary { background: #1A2A1A !important; color: #E8F5E9 !important; }
[data-dark="1"] .er-nm { color: #E8F5E9 !important; }
[data-dark="1"] .er-dir { color: #CFD8DC !important; }
[data-dark="1"] .er-sub { color: #B0BEC5 !important; }
[data-dark="1"] .er-when, [data-dark="1"] .er-job { color: #AAB8AB !important; }
[data-dark="1"] .er-open { color: #EF9A9A !important; }
[data-dark="1"] .er-it { background: #162A18 !important; border-color: #2E5C30 !important; }
/* dashboard stat numbers + anything inked with --lf-darkest / --lf-dark inline */
[data-dark="1"] .stat-num { color: #E8F5E9 !important; }
[data-dark="1"] [style*="color:var(--lf-darkest)"], [data-dark="1"] [style*="color: var(--lf-darkest)"],
[data-dark="1"] [style*="color:var(--lf-dark)"],    [data-dark="1"] [style*="color: var(--lf-dark)"],
[data-dark="1"] [style*="color:#3E2723"], [data-dark="1"] [style*="color: #3E2723"],
[data-dark="1"] [style*="color:#444"],    [data-dark="1"] [style*="color:#555"],
[data-dark="1"] [style*="color:#0D47A1"], [data-dark="1"] [style*="color:#0d47a1"],
[data-dark="1"] [style*="color:#004D40"], [data-dark="1"] [style*="color:#1A237E"],
[data-dark="1"] [style*="color:#B71C1C"], [data-dark="1"] [style*="color:#B91C1C"], [data-dark="1"] [style*="color:#C62828"] { color: #E8F5E9 !important; }
[data-dark="1"] [style*="color:#B71C1C"], [data-dark="1"] [style*="color:#B91C1C"], [data-dark="1"] [style*="color:#C62828"], [data-dark="1"] .sh-bad, [data-dark="1"] #sum-cxl, [data-dark="1"] .summary-num .cxl { color: #FF8A80 !important; }
[data-dark="1"] [style*="color:#E65100"]:not([style*="background"]), [data-dark="1"] [style*="color: #E65100"]:not([style*="background"]), [data-dark="1"] .action-chip, [data-dark="1"] #sync-result, [data-dark="1"] .actions-bar-label { color: #FFCC80 !important; }
[data-dark="1"] .action-chip { background: rgba(255,183,77,0.16) !important; }
[data-dark="1"] .action-chip .ac-age { color: #FFE0B2 !important; }
[data-dark="1"] [style*="color:#888"], [data-dark="1"] [style*="color:#999"], [data-dark="1"] [style*="color:#777"], [data-dark="1"] [style*="color:#666"] { color: #AAB8AB !important; }
[data-dark="1"] [style*="color:#607D60"], [data-dark="1"] [style*="color:#607d60"], [data-dark="1"] [style*="color:var(--muted)"] { color: #9FB3A1 !important; }
[data-dark="1"] [style*="color:#000"]:not([style*="background"]) { color: #E8F5E9 !important; }
[data-dark="1"] .section-label, [data-dark="1"] .demo-books-title, [data-dark="1"] .my-leads-title, [data-dark="1"] .totals-title, [data-dark="1"] .sort-label,
[data-dark="1"] footer.footer, [data-dark="1"] footer.footer div, [data-dark="1"] footer.footer span, [data-dark="1"] footer > div, [data-dark="1"] #tt-note { color: #9FB3A1 !important; }
[data-dark="1"] .acct-menu-group, [data-dark="1"] .acct-menu-slider span { color: #AAB8AB !important; }
[data-dark="1"] .lhcr-off.na .t, [data-dark="1"] .lhcr-off.cost .t, [data-dark="1"] .lhcr-off.emp .t, [data-dark="1"] .lhcr-off .c span, [data-dark="1"] .lhcr-note, [data-dark="1"] .lhcr-btn.na small,
[data-dark="1"] .action-chip .ac-name { color: #FFCC80 !important; }
/* chat + inputs: placeholders were 2.3-4.5:1, and the input edge did not separate from its card */
[data-dark="1"] input::placeholder, [data-dark="1"] textarea::placeholder, [data-dark="1"] .pcust-input::placeholder, [data-dark="1"] input.pcust-input::placeholder { color: #8BC98F !important; opacity: 1 !important; }
[data-dark="1"] .ds-empty, [data-dark="1"] .cdt-hint { color: #AAB8AB !important; }
[data-dark="1"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
[data-dark="1"] textarea, [data-dark="1"] select { border: 1.5px solid #5C9A60 !important; }
[data-dark="1"] .chat-input, [data-dark="1"] #chat-input, [data-dark="1"] #leads-search, [data-dark="1"] #conv-search, [data-dark="1"] #q.search { border: 1.5px solid #5C9A60 !important; background: #0F1A0F !important; color: #E8F5E9 !important; }
[data-dark="1"] .cl-pill { border-color: #5C9A60 !important; }
/* estimator */
[data-dark="1"] .slot-label { background: #1A2A1A !important; color: #E8F5E9 !important; border-color: #2E5C30 !important; }
[data-dark="1"] .slot-label > span { color: #AAB8AB !important; }
[data-dark="1"] .slot-num { background: var(--lf-light) !important; color: #0D3A14 !important; }
[data-dark="1"] .step-card-header { background: #1A2A1A !important; }
[data-dark="1"] .step-card-header h3 { color: #E8F5E9 !important; }
[data-dark="1"] .step-card-header-text p { color: #AAB8AB !important; }
[data-dark="1"] .drawer-scope-title { color: #E8F5E9 !important; background: #1A2A1A !important; }
[data-dark="1"] #drawer-scope, [data-dark="1"] .drawer-scope { background: #162A18 !important; color: #E8F5E9 !important; }
[data-dark="1"] .sform-group { background: #1A2A1A !important; }
[data-dark="1"] .sform-group label { color: #C8E6C9 !important; }
[data-dark="1"] .cb-label, [data-dark="1"] .drawer-title p, [data-dark="1"] .dc-meta, [data-dark="1"] .drawer-comm-bar div { color: rgba(255,255,255,0.86) !important; }
[data-dark="1"] #est-body tr.section-hdr td { color: #fff !important; }
[data-dark="1"] .col-qty-hdr span { color: #0D3A14 !important; }
[data-dark="1"] .clear-all-btn { background: #B71C1C !important; color: #fff !important; }
[data-dark="1"] #build-btn { color: #1A1A1A !important; }
[data-dark="1"] #bulk-zone, [data-dark="1"] #bulk-zone > div { background: #1A2A1A !important; color: #E8F5E9 !important; }
[data-dark="1"] .sgs-panel input, [data-dark="1"] .sgs-panel textarea, [data-dark="1"] .sgs-panel select { background: #0F1A0F !important; }
/* settings */
[data-dark="1"] .settings-section-title span[style*="background"] { color: #1A1A1A !important; }
[data-dark="1"] .lh-paste-btn { background: rgba(129,199,132,0.18) !important; color: #C8E6C9 !important; border-color: rgba(129,199,132,0.45) !important; }
[data-dark="1"] .sheet-save-btn, [data-dark="1"] a.sheet-save-btn, [data-dark="1"] #sec-display-device .dfit-btn { background: linear-gradient(135deg, var(--lf-dark), var(--lf-primary)) !important; color: #fff !important; }
[data-dark="1"] #sec-display-device .dfit-ghost { background: rgba(255,255,255,0.08) !important; color: #E8F5E9 !important; border-color: #5C9A60 !important; }
[data-dark="1"] #sec-display-device .dfit-group { background: #0F1A0F !important; color: #C8E6C9 !important; }
[data-dark="1"] #dfit-current, [data-dark="1"] .dfit-current { background: rgba(255,255,255,0.06) !important; color: #E8F5E9 !important; }
[data-dark="1"] #dfit-list, [data-dark="1"] .dfit-list { background: #1A2A1A !important; }
[data-dark="1"] #tab-privacy div[style*="background:linear-gradient"], [data-dark="1"] #tab-privacy div[style*="background:#F"], [data-dark="1"] #tab-privacy div[style*="background:#f"], [data-dark="1"] #tab-privacy div[style*="background:#E"], [data-dark="1"] #tab-privacy div[style*="background:#e"], [data-dark="1"] #tab-privacy div[style*="background:#C"], [data-dark="1"] #tab-privacy ol, [data-dark="1"] #tab-privacy ul { background: #162A18 !important; color: #E8F5E9 !important; border-color: #2E5C30 !important; }
[data-dark="1"] #rank-period-bar span, [data-dark="1"] #tab-privacy p, [data-dark="1"] #tab-privacy strong, [data-dark="1"] #tab-privacy u, [data-dark="1"] #tab-privacy li { color: #E8F5E9 !important; }
[data-dark="1"] #tab-tax label, [data-dark="1"] #tax-estimate-grid div { color: #C8E6C9 !important; }
[data-dark="1"] #tab-tax [style*="background:#E3F2FD"] div, [data-dark="1"] #tab-tax [style*="color:#0D47A1"] { color: #BBDEFB !important; }
[data-dark="1"] #roadmap-queued-body td, [data-dark="1"] #roadmap-shipped-body td, [data-dark="1"] #roadmap-shipped-body td code { color: #E8F5E9 !important; }
[data-dark="1"] #roadmap-shipped-body tr, [data-dark="1"] #roadmap-shipped-body td, [data-dark="1"] #roadmap-queued-body td { background: transparent !important; }
[data-dark="1"] #roadmap-shipped-body td code, [data-dark="1"] td > code { background: rgba(255,255,255,0.1) !important; }
[data-dark="1"] .vote-trigger { color: #E8F5E9 !important; }
[data-dark="1"] #donor-wall span, [data-dark="1"] #donor-wall { color: #fff !important; }
[data-dark="1"] #tab-buildhistory td, [data-dark="1"] #tab-buildhistory td span { color: #E8F5E9 !important; }
[data-dark="1"] #tab-buildhistory tr[style*="background"] { background: #1A2A1A !important; }
/* Server tab: white tiles / tables under light ink */
[data-dark="1"] #sh-body .sh-tile, [data-dark="1"] #sh-body table { background: #1A2A1A !important; color: #E8F5E9 !important; border-color: #2E5C30 !important; }
[data-dark="1"] #sh-body .sh-tile b, [data-dark="1"] #sh-body td, [data-dark="1"] #sh-body td b { color: #E8F5E9 !important; }
[data-dark="1"] #sh-body th { background: #0F1A0F !important; color: #A5D6A7 !important; }
[data-dark="1"] #sh-body td, [data-dark="1"] #sh-body th { border-top-color: #2E5C30 !important; }
[data-dark="1"] #sh-body .sh-sub, [data-dark="1"] #sh-body .sh-tile span { color: #AAB8AB !important; }
[data-dark="1"] #sh-body .sh-ok { color: #81C784 !important; }
[data-dark="1"] #sh-body .sh-warn { background: #2B1414 !important; color: #FFCDD2 !important; }
[data-dark="1"] #sh-body .sh-late, [data-dark="1"] #sh-body .sh-od { color: #FFCC80 !important; }
[data-dark="1"] #sh-body .sh-errnote { color: #FF8A80 !important; }
[data-dark="1"] #sh-body svg text { fill: #CFD8DC !important; }
/* admin panels (scoreboard channels, group-chat learnings) */
[data-dark="1"] #admin-scoreboard-panel, [data-dark="1"] #gcl-panel, [data-dark="1"] .gcl-panel { background: #1A2A1A !important; border-color: #2E5C30 !important; color: #E8F5E9 !important; }
[data-dark="1"] #admin-scoreboard-panel b, [data-dark="1"] #admin-scoreboard-panel [style*="color:#004D40"], [data-dark="1"] .gcl-panel b { color: #80CBC4 !important; }

/* ── 4. Named dark themes: the same surfaces in each theme's own hues ────────
   The generic dark rules above paint LeafFilter-green surfaces (#162A18 / #1A2A1A). On a named dark
   theme those green cards looked out of place, so each theme recolours them to its own card colour. */
/* each theme's --border was 1.3-1.6:1 against its own page; lifted to the line colour so card edges and inputs show */
body[data-theme="midnight"]  { --border: #334155; } body[data-theme="blueprint"] { --border: #2B5078; } body[data-theme="glass"] { --border: rgba(196,181,253,0.45); }
body[data-theme="monolith"]  { --border: #3A3A3A; } body[data-theme="r3d3eye"] { --border: #3A3A3A; } body[data-theme="proxion"], body[data-theme="praxions"] { --border: #353C4F; }
body[data-theme="midnight"]  { --lh-dk-card: #0F172A; --lh-dk-surf: #1E293B; --lh-dk-line: #334155; --lh-dk-ink: #E2E8F0; --lh-dk-mute: #A7B4C6; }
body[data-theme="blueprint"] { --lh-dk-card: #082038; --lh-dk-surf: #0F2D4B; --lh-dk-line: #2B5078; --lh-dk-ink: #E0F2FF; --lh-dk-mute: #A9C7E6; }
body[data-theme="glass"]     { --lh-dk-card: #1E1836; --lh-dk-surf: #2A2347; --lh-dk-line: #4C3F75; --lh-dk-ink: #F5F5F5; --lh-dk-mute: #C4B5FD; }
body[data-theme="monolith"]  { --lh-dk-card: #0A0A0A; --lh-dk-surf: #1A1A1A; --lh-dk-line: #3A3A3A; --lh-dk-ink: #F5F5F5; --lh-dk-mute: #A3A3A3; }
body[data-theme="terminal"]  { --lh-dk-card: #050805; --lh-dk-surf: #0D160D; --lh-dk-line: #1F6B3A; --lh-dk-ink: #00FF66; --lh-dk-mute: #2EC46A; }
body[data-theme="r3d3eye"]   { --lh-dk-card: #0A0A0A; --lh-dk-surf: #161616; --lh-dk-line: #3A3A3A; --lh-dk-ink: #F5F5F5; --lh-dk-mute: #A3A3A3; }
body[data-theme="proxion"], body[data-theme="praxions"] { --lh-dk-card: #131722; --lh-dk-surf: #1B2130; --lh-dk-line: #353C4F; --lh-dk-ink: #F5F5F5; --lh-dk-mute: #A9B1C6; }
body[data-theme="midnight"] .lead-card .lc-body, body[data-theme="blueprint"] .lead-card .lc-body, body[data-theme="glass"] .lead-card .lc-body,
body[data-theme="monolith"] .lead-card .lc-body, body[data-theme="terminal"] .lead-card .lc-body, body[data-theme="r3d3eye"] .lead-card .lc-body,
body[data-theme="proxion"] .lead-card .lc-body, body[data-theme="praxions"] .lead-card .lc-body { background: var(--lh-dk-surf) !important; }
body[data-theme="midnight"] .settings-section, body[data-theme="blueprint"] .settings-section, body[data-theme="glass"] .settings-section,
body[data-theme="monolith"] .settings-section, body[data-theme="terminal"] .settings-section, body[data-theme="r3d3eye"] .settings-section,
body[data-theme="proxion"] .settings-section, body[data-theme="praxions"] .settings-section,
body[data-theme="midnight"] .rank-card, body[data-theme="blueprint"] .rank-card, body[data-theme="glass"] .rank-card,
body[data-theme="monolith"] .rank-card, body[data-theme="terminal"] .rank-card, body[data-theme="r3d3eye"] .rank-card,
body[data-theme="proxion"] .rank-card, body[data-theme="praxions"] .rank-card,
body[data-theme="midnight"] .er-box, body[data-theme="blueprint"] .er-box, body[data-theme="glass"] .er-box, body[data-theme="monolith"] .er-box,
body[data-theme="terminal"] .er-box, body[data-theme="r3d3eye"] .er-box, body[data-theme="proxion"] .er-box,
body[data-theme="midnight"] .slot-label, body[data-theme="blueprint"] .slot-label, body[data-theme="glass"] .slot-label, body[data-theme="monolith"] .slot-label,
body[data-theme="terminal"] .slot-label, body[data-theme="r3d3eye"] .slot-label, body[data-theme="proxion"] .slot-label,
body[data-theme="midnight"] .step-card-header, body[data-theme="blueprint"] .step-card-header, body[data-theme="glass"] .step-card-header, body[data-theme="monolith"] .step-card-header,
body[data-theme="terminal"] .step-card-header, body[data-theme="r3d3eye"] .step-card-header, body[data-theme="proxion"] .step-card-header,
body[data-theme="midnight"] #sh-body .sh-tile, body[data-theme="blueprint"] #sh-body .sh-tile, body[data-theme="glass"] #sh-body .sh-tile, body[data-theme="monolith"] #sh-body .sh-tile,
body[data-theme="terminal"] #sh-body .sh-tile, body[data-theme="r3d3eye"] #sh-body .sh-tile, body[data-theme="proxion"] #sh-body .sh-tile,
body[data-theme="midnight"] #sh-body table, body[data-theme="blueprint"] #sh-body table, body[data-theme="glass"] #sh-body table, body[data-theme="monolith"] #sh-body table,
body[data-theme="terminal"] #sh-body table, body[data-theme="r3d3eye"] #sh-body table, body[data-theme="proxion"] #sh-body table {
  background: var(--lh-dk-card) !important; border-color: var(--lh-dk-line) !important; color: var(--lh-dk-ink) !important;
}
body[data-theme="midnight"] .er-grp > summary, body[data-theme="blueprint"] .er-grp > summary, body[data-theme="glass"] .er-grp > summary, body[data-theme="monolith"] .er-grp > summary,
body[data-theme="terminal"] .er-grp > summary, body[data-theme="r3d3eye"] .er-grp > summary, body[data-theme="proxion"] .er-grp > summary,
body[data-theme="midnight"] .er-it, body[data-theme="blueprint"] .er-it, body[data-theme="glass"] .er-it, body[data-theme="monolith"] .er-it,
body[data-theme="terminal"] .er-it, body[data-theme="r3d3eye"] .er-it, body[data-theme="proxion"] .er-it,
body[data-theme="midnight"] .sform-group, body[data-theme="blueprint"] .sform-group, body[data-theme="glass"] .sform-group, body[data-theme="monolith"] .sform-group,
body[data-theme="terminal"] .sform-group, body[data-theme="r3d3eye"] .sform-group, body[data-theme="proxion"] .sform-group,
body[data-theme="midnight"] #sh-body th, body[data-theme="blueprint"] #sh-body th, body[data-theme="glass"] #sh-body th, body[data-theme="monolith"] #sh-body th,
body[data-theme="terminal"] #sh-body th, body[data-theme="r3d3eye"] #sh-body th, body[data-theme="proxion"] #sh-body th {
  background: var(--lh-dk-surf) !important; border-color: var(--lh-dk-line) !important;
}
/* ink in those themes (the generic rules use LeafFilter pale green; swap to each theme's ink) */
body[data-theme="midnight"] .lead-card .lc-body *:not(.lc-vpill):not(.lc-hseg):not(em):not(button):not(a):not(.lc-hd-todo):not(.lc-ql-title):not(.lc-ql-sf),
body[data-theme="blueprint"] .lead-card .lc-body *:not(.lc-vpill):not(.lc-hseg):not(em):not(button):not(a):not(.lc-hd-todo):not(.lc-ql-title):not(.lc-ql-sf),
body[data-theme="monolith"] .lead-card .lc-body *:not(.lc-vpill):not(.lc-hseg):not(em):not(button):not(a):not(.lc-hd-todo):not(.lc-ql-title):not(.lc-ql-sf),
body[data-theme="glass"] .lead-card .lc-body *:not(.lc-vpill):not(.lc-hseg):not(em):not(button):not(a):not(.lc-hd-todo):not(.lc-ql-title):not(.lc-ql-sf),
body[data-theme="r3d3eye"] .lead-card .lc-body *:not(.lc-vpill):not(.lc-hseg):not(em):not(button):not(a):not(.lc-hd-todo):not(.lc-ql-title):not(.lc-ql-sf),
body[data-theme="proxion"] .lead-card .lc-body *:not(.lc-vpill):not(.lc-hseg):not(em):not(button):not(a):not(.lc-hd-todo):not(.lc-ql-title):not(.lc-ql-sf) { color: var(--lh-dk-ink) !important; }
body[data-theme="terminal"] .lead-card .lc-body *:not(.lc-vpill):not(.lc-hseg):not(em):not(button):not(a):not(.lc-hd-todo):not(.lc-ql-title):not(.lc-ql-sf) { color: #00FF66 !important; }
body[data-theme="terminal"] .lead-card .lc-header *, body[data-theme="terminal"] .lead-card .lc-header .hdr-rtype-primary { color: #00FF66 !important; }
body[data-theme="terminal"] .lead-card .lc-header { background: #0A0F0A !important; border-bottom-color: #00FF66 !important; }
body[data-theme="terminal"] .lead-card .lc-header.nosale, body[data-theme="terminal"] .lead-card .lc-header.nodemo, body[data-theme="terminal"] .lead-card .lc-header.demo { background: #0A0F0A !important; }
/* inputs per theme: the green input edge is replaced by the theme's own line colour */
body[data-theme="midnight"] input:not([hidden]), body[data-theme="midnight"] textarea:not([hidden]), body[data-theme="midnight"] select:not([hidden]),
body[data-theme="blueprint"] input:not([hidden]), body[data-theme="blueprint"] textarea:not([hidden]), body[data-theme="blueprint"] select:not([hidden]),
body[data-theme="glass"] input:not([hidden]), body[data-theme="glass"] textarea:not([hidden]), body[data-theme="glass"] select:not([hidden]),
body[data-theme="monolith"] input:not([hidden]), body[data-theme="monolith"] textarea:not([hidden]), body[data-theme="monolith"] select:not([hidden]),
body[data-theme="r3d3eye"] input:not([hidden]), body[data-theme="r3d3eye"] textarea:not([hidden]), body[data-theme="r3d3eye"] select:not([hidden]),
body[data-theme="proxion"] input:not([hidden]), body[data-theme="proxion"] textarea:not([hidden]), body[data-theme="proxion"] select:not([hidden]) {
  background: var(--lh-dk-card) !important; color: var(--lh-dk-ink) !important; border: 1.5px solid var(--lh-dk-mute) !important;
}
body[data-theme="terminal"] input:not([hidden]), body[data-theme="terminal"] textarea:not([hidden]), body[data-theme="terminal"] select:not([hidden]) { background: #050805 !important; color: #00FF66 !important; border: 1.5px solid #00AA44 !important; }
body[data-theme="midnight"] input::placeholder, body[data-theme="midnight"] textarea::placeholder, body[data-theme="blueprint"] input::placeholder, body[data-theme="blueprint"] textarea::placeholder,
body[data-theme="glass"] input::placeholder, body[data-theme="glass"] textarea::placeholder, body[data-theme="monolith"] input::placeholder, body[data-theme="monolith"] textarea::placeholder,
body[data-theme="r3d3eye"] input::placeholder, body[data-theme="r3d3eye"] textarea::placeholder, body[data-theme="proxion"] input::placeholder, body[data-theme="proxion"] textarea::placeholder { color: var(--lh-dk-mute) !important; opacity: 1 !important; }
body[data-theme="terminal"] input::placeholder, body[data-theme="terminal"] textarea::placeholder { color: #2EC46A !important; opacity: 1 !important; }
/* terminal: every <button> is outlined green on transparent, but a few buttons sit on green bands */
body[data-theme="terminal"] .sh-unit button[aria-pressed="true"], body[data-theme="terminal"] .si-chip.active, body[data-theme="terminal"] .tab-btn.active { background: #00FF66 !important; color: #050805 !important; }
body[data-theme="terminal"] .r3d3-approve { background: #00FF66 !important; color: #050805 !important; }
/* r3d3eye / proxion: the old safety net inked calendar + settings with LeafFilter greens; retint */
body[data-theme="r3d3eye"] .sheet-field-label { color: #FF8A80 !important; }
body[data-theme="r3d3eye"] h1, body[data-theme="r3d3eye"] h2, body[data-theme="r3d3eye"] h3, body[data-theme="r3d3eye"] h4 { color: #FF8A80 !important; }
body[data-theme="proxion"] h1, body[data-theme="proxion"] h2, body[data-theme="proxion"] h3, body[data-theme="proxion"] h4 { color: #80F0FF !important; }
body[data-theme="proxion"] .sheet-field-label { color: #80F0FF !important; }
body[data-theme="r3d3eye"] a:not([style*="color"]):not([class]) { color: #FF8A80; }
body[data-theme="proxion"] a:not([style*="color"]):not([class]) { color: #80F0FF; }
/* glass: translucent cards over the gradient — give text surfaces a little more body */
body[data-theme="glass"] .lead-card, body[data-theme="glass"] .my-leads-card, body[data-theme="glass"] .est-recent-card { background: rgba(20,20,35,0.78) !important; }
/* blueprint: --lf-mid (#60A5FA) is used as a band colour under white text in a few spots */
body[data-theme="blueprint"] .est-bar { background: linear-gradient(135deg, #051527, #0A2540) !important; }

/* ── 5. lf-modern is a LIGHT theme. The old "restricted themes safety net" treated it as dark
   (dark settings cards, forest-green text flipped to white, white cards flipped to green). Those
   selectors are removed above in this file; what is left here restores the light surfaces. ── */
body[data-theme="lf-modern"] .settings-section, body[data-theme="lf-modern"] .rank-card { background: #FFFFFF !important; color: #1B5E20 !important; border-color: #C8E6C9 !important; box-shadow: var(--r3d-card-shadow) !important; }
body[data-theme="lf-modern"] .settings-section-header, body[data-theme="lf-modern"] .settings-section-body, body[data-theme="lf-modern"] .rank-card-title { color: #1B5E20 !important; }
body[data-theme="lf-modern"] .sheet-input { background: #FFFFFF !important; color: #1B5E20 !important; border-color: #A5D6A7 !important; }
body[data-theme="lf-modern"] .sheet-field-label { color: #2E7D32 !important; }
body[data-theme="lf-modern"] #cal-grid > div { background: #FFFFFF !important; color: #1B5E20 !important; border-color: #C8E6C9 !important; }
body[data-theme="lf-modern"] #cal-grid > div[style*="background:#FFF8E1"] { background: #FFF8E1 !important; color: #5D4037 !important; }
body[data-theme="lf-modern"] #cal-grid, body[data-theme="lf-modern"] #cal-event-list { color: #1B5E20 !important; }
body[data-theme="lf-modern"] [id^="cfg-card-"] { color: #1B5E20 !important; }

/* ── 6. Small shared fixes found on the second pass ─────────────────────────── */
.lc-hd-k { opacity: 0.85 !important; }
.lc-hseg--done, .lc-header .lc-hseg--done { background: linear-gradient(180deg,#1976D2,#0D47A1) !important; }
.lc-hbar--full .lc-hseg--done { background: linear-gradient(180deg,#388E3C,#1B5E20) !important; }
tr[style*="background:#E65100"] { background: #BF360C !important; }
a[style*="linear-gradient(135deg,#FFD700"], button[style*="linear-gradient(135deg,#FFD700"] { color: #1A1A1A !important; }
[data-dark="1"] a[style*="linear-gradient(135deg,#FFD700"] { color: #1A1A1A !important; }
[data-dark="1"] [style*="background:#FFCC80"] { background: #5D4037 !important; color: #FFE0B2 !important; }
.agent-oval-coming { opacity: 1 !important; }
[data-dark="1"] .stat-label, [data-dark="1"] .dfit-row span { color: #AAB8AB !important; }
body[data-theme="proxion"] .cb-group, body[data-theme="proxion"] .drawer-comm-bar, body[data-theme="proxion"] #comm-bar, body[data-theme="proxion"] .cb-tier { background: #0E7490 !important; color: #fff !important; }
body[data-theme="proxion"] .hdr-resulted, body[data-theme="r3d3eye"] .hdr-resulted { background: #B71C1C !important; color: #fff !important; }
[data-dark="1"] .vote-trigger { background: rgba(255,255,255,0.12) !important; border: 1px solid rgba(255,255,255,0.35) !important; }
[data-dark="1"] #lv-analyze-btn[disabled] { color: #CFD8DC !important; }
.header-sub[style*="opacity"] { opacity: 0.88 !important; }
html:not([data-dark="1"]) [style*="color:#FF8F00"]:not([style*="background"]) { color: #BF360C !important; }
html:not([data-dark="1"]) [style*="color:#999"]:not([style*="background"]) { color: #616161 !important; }
.est-bar [style*="color:#F9A825"] { color: #FFE082 !important; }
.est-bar [style*="color:#FF7043"] { color: #FFCCBC !important; }
.est-bar [style*="color:#69F0AE"] { color: #B9F6CA !important; }
.beta-badge .beta-sub { color: #FFF3C4 !important; }
