/* AI Calculator — brand dark theme overlay (2026-06-13)
   Loaded LAST on the calculator/content pages so the whole site matches the
   homepage/hub midnight-indigo theme. Uses !important to deterministically
   override the older light page CSS and inline rules. Palette = brand:
   midnight #0A0C1A, panels #12152B/#191D38, text #EAECFF, muted #C5CCE0,
   accents aqua #19E3D6 + indigo #6D6BF6 -> violet #A855F7. */

:root{
  --aic-bg:#0A0C1A; --aic-panel:#12152B; --aic-panel2:#191D38;
  --aic-line:rgba(255,255,255,.10); --aic-text:#EAECFF; --aic-muted:#C5CCE0;
  --aic-aqua:#19E3D6; --aic-grad:linear-gradient(135deg,#6D6BF6,#A855F7);
}

/* Canvas */
html,body{background:#0A0C1A !important;color:#EAECFF !important;}
.app-container,.container,.wrap,main,.page-layout,.page-main,.content,.main-content{background:transparent !important;color:#EAECFF !important;}

/* Headings & text */
h1,h2,h3,h4,h5,h6{color:#EAECFF !important;}
p,li,dd,dt,blockquote,figcaption,.f-label,.formula-label,.rlabel,small{color:#C5CCE0 !important;}
strong,b{color:#F5F7FF !important;}
main a,.section a,.static-content-block a,.faq a,.faq-a a,p a,li a,td a,.related-calculators a,.sidebar-footer a,.result-card a,.cta-widget a{color:#19E3D6 !important;}
main a:hover,.section a:hover,.static-content-block a:hover,p a:hover{color:#7FF3EA !important;}

/* Panels / cards / sections */
.section,.calc-widget,.result-card,.result-grid,.formula,.formula-box,.field,.input-group,
.inputs-grid,.faq,.faq-item,.cta-widget,.static-content-block,.popular-sidebar,
.related-calculators,.sidebar-footer,.card,.panel,[class*="-card"],[class*="-widget"],
[class*="result"],details,.note,.callout{
  background:#12152B !important;border-color:rgba(255,255,255,.10) !important;color:#EAECFF !important;
  box-shadow:none !important;
}
.section,.faq,.static-content-block{background:transparent !important;}

/* Formula / code blocks */
.formula,.formula-box,code,pre,kbd{background:#070815 !important;color:#A9F4EE !important;border:1px solid rgba(25,227,214,.20) !important;}

/* Inputs */
input,select,textarea{background:#0E1124 !important;color:#EAECFF !important;border:1px solid rgba(109,107,246,.35) !important;}
input::placeholder,textarea::placeholder{color:#9CA3D4 !important;}
input:focus,select:focus,textarea:focus{border-color:#19E3D6 !important;box-shadow:0 0 0 3px rgba(25,227,214,.18) !important;outline:none !important;}

/* Buttons */
button,.btn,.btn-primary,.btn-calc,.cable-calc-btn,input[type=submit],input[type=button],a.btn,a.btn-primary{
  background:linear-gradient(135deg,#6D6BF6,#A855F7) !important;color:#fff !important;border:none !important;
}
button:hover,.btn:hover,.btn-primary:hover,.btn-calc:hover{filter:brightness(1.08) !important;}
/* secondary / ghost buttons (print, etc.) */
.btn-secondary,.print-btn,[onclick*="print"]{background:#191D38 !important;color:#EAECFF !important;border:1px solid rgba(255,255,255,.16) !important;}

/* Result values keep the aqua accent */
.rvalue,.rvalue.ok,.result-value,[class*="result"] .value{color:#19E3D6 !important;}

/* Tables */
table{background:#12152B !important;border-color:rgba(255,255,255,.10) !important;color:#EAECFF !important;}
th,td{border-color:rgba(255,255,255,.10) !important;color:#E2E6FF !important;}
thead th{background:#191D38 !important;color:#EAECFF !important;}
tr:nth-child(even) td{background:rgba(255,255,255,.03) !important;}

/* Hero / breadcrumb / badges */
.hero,header.hero,.page-hero{background:linear-gradient(135deg,#0A0C1A 0%,#10132A 55%,#171a3a 100%) !important;color:#EAECFF !important;}
.breadcrumb,.breadcrumb a{color:#9CA3D4 !important;}
.breadcrumb a{color:#19E3D6 !important;}
.hero-badge,.hero-tag,.hero-tags span,.badge{background:rgba(109,107,246,.18) !important;color:#C4B5FD !important;border:1px solid rgba(109,107,246,.35) !important;}

/* FAQ accordion */
.faq-item{background:#12152B !important;border:1px solid rgba(255,255,255,.08) !important;}
.faq-q{color:#EAECFF !important;}
.faq-a{color:#C5CCE0 !important;}

/* CTA widget */
.cta-widget{background:linear-gradient(135deg,#12152B,#191D38) !important;color:#EAECFF !important;}

/* misc light boxes some pages use */
[style*="background:#fff"],[style*="background: #fff"],[style*="background:#f8f9fa"],[style*="background: #f8f9fa"],
[style*="background:#fafafa"],[style*="background:#f7f7fb"]{background:#12152B !important;color:#EAECFF !important;}

/* #ai-answer callout — revert to dark (page is now dark) so it's consistent & readable */
#ai-answer{background:#12152B !important;border:1px solid rgba(25,227,214,.25) !important;color:#EAECFF !important;}
#ai-answer h2,#ai-answer h3{color:#19E3D6 !important;}
#ai-answer p,#ai-answer li,#ai-answer span,#ai-answer strong,#ai-answer em{color:#EAECFF !important;}

/* Catch muted grays that would be too dark on the midnight background */
[style*="color:#555"],[style*="color: #555"],[style*="color:#666"],[style*="color:#333"],
[style*="color:#222"],[style*="color:#6b7280"],[style*="color:#6B7280"],[style*="color:#9ca3af"],
[style*="color:#9CA3AF"],[style*="color:#1a1a2e"],[style*="color:#2c3e50"]{color:#C5CCE0 !important;}

/* Preserve the unified header + search-band link colors (don't let content link rules recolor them) */
.aic-newhdr .aic-logo{color:#EAECFF !important;}
.aic-newhdr .aic-nl{color:#C2C7E8 !important;}
.aic-newhdr .aic-nl-fire{color:#FCA5A5 !important;}
.aic-newhdr .aic-nl-solar{color:#FDE68A !important;}
.usearch .us-chip{color:#9CA3D4 !important;}
.usearch .us-chip-fire{color:#FFE2DC !important;}
.usearch .us-chip-solar{color:#FFF6D9 !important;}

/* ── Result / output / callout boxes that use IDs or inline light tints ── */
#result,#cs-result,.calc-result,#bmi-result,[id$="-result"],[id*="-result"],
.result,.output,.calc-output,#output{
  background:#12152B !important;border:1px solid rgba(25,227,214,.22) !important;
  border-left:4px solid #19E3D6 !important;color:#EAECFF !important;
}
#result *,#cs-result *,.calc-result *,[id$="-result"] *,[id*="-result"] *,.result *{color:#EAECFF !important;}
#result strong,#cs-result strong,.calc-result strong{color:#19E3D6 !important;}

/* Error / warning boxes */
#error-msg,.error-msg,[id*="error"],.error,.warning{
  background:rgba(231,76,60,.12) !important;border-left:4px solid #ef4444 !important;color:#FCA5A5 !important;
}
#error-msg *,.error-msg *{color:#FCA5A5 !important;}

/* Broaden the inline light-background catch-all (light tints used on some pages) */
[style*="background:#f3f4f6"],[style*="background: #f3f4f6"],
[style*="background:#f0f9f4"],[style*="background: #f0f9f4"],
[style*="background:#fff5f5"],[style*="background: #fff5f5"],
[style*="background:#f9fafb"],[style*="background: #f9fafb"],
[style*="background:#f5f5f5"],[style*="background: #f5f5f5"],
[style*="background:#eef"],[style*="background:#f1f5f9"],
[style*="background:#e8f5e9"],[style*="background:#fefce8"],
[style*="background:#fff8"],[style*="background:#f6f8fa"]{
  background:#12152B !important;color:#EAECFF !important;
}

/* Remaining light callout tints (answer cards, info/success/warn boxes) -> dark */
[style*="background:#f3f6ff"],[style*="background: #f3f6ff"],
[style*="background:#ecfdf3"],[style*="background: #ecfdf3"],
[style*="background:#ecfdf5"],[style*="background: #ecfdf5"],
[style*="background:#eef2ff"],[style*="background: #eef2ff"],
[style*="background:#fee2e2"],[style*="background: #fee2e2"],
[style*="background:#fef3c7"],[style*="background: #fef3c7"],
[style*="background:#f4f1ff"],[style*="background: #f4f1ff"]{
  background:#12152B !important;color:#EAECFF !important;
}

/* ── Content article/section wrappers (bare element rules set these #fff) ── */
article,article section,article>section,main article,.article,.post,.content-block,.page-content{
  background:transparent !important;color:#C5CCE0 !important;
}
/* bespoke boxes on about/contact/legal/dosing pages */
.contact-box,.contact-card,.standard-card,.verification-badge,.response-box,.form-box,
.alert,.alert.danger,.alert.warning,.alert.info,.stat,.actions,.info-box,.callout-box,
.notice,.tip-box,.warning-box,.success-box,.spec-box,.data-box,.example-box{
  background:#12152B !important;border-color:rgba(255,255,255,.12) !important;color:#EAECFF !important;
}
.alert.danger{border-left:4px solid #ef4444 !important;}
.alert.warning,.warning-box{border-left:4px solid #fbbf24 !important;}

/* Catch white in other forms: keyword, uppercase hex, background-color, rgb */
[style*="background:#FFFFFF"],[style*="background: #FFFFFF"],[style*="background:#FFF"],
[style*="background:white"],[style*="background: white"],
[style*="background-color:#fff"],[style*="background-color: #fff"],
[style*="background-color:#FFFFFF"],[style*="background-color:white"],
[style*="background:rgb(255"],[style*="background: rgb(255"],
[style*="background-color:rgb(255"]{
  background:#12152B !important;color:#EAECFF !important;
}
