/* BeginThings one-click theme switch (theme-toggle-r2). Pairs with /assets/bt-theme.js. Single header control. */
/* Old boxed ◐ header button retired: hidden even if a cached/old page still carries it. Footer "Appearance" link unaffected. */
/* Inside the shell layer: bt-chrome resets header controls with layered !important, which beats unlayered rules. */
@layer bts-shell {
#bts-header [data-bts-appearance]:not(.bt-theme-toggle) { display: none !important; }
#bts-header .bt-theme-toggle {
  position: relative !important;
  display: inline-grid !important;
  place-items: center !important;
  flex: 0 0 36px !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 36px !important;
  max-height: 36px !important;
  box-sizing: border-box !important;
  margin: 0 2px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--bts-fg, currentColor) !important;
  opacity: .82;
  line-height: 0 !important;
  font-size: 0 !important;
  cursor: pointer !important;
  outline: none !important;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .2s ease, opacity .2s ease, color .2s ease !important;
}
@media (hover: hover) {
  #bts-header .bt-theme-toggle:hover { background: color-mix(in srgb, currentColor 9%, transparent) !important; color: var(--bts-fg, currentColor) !important; opacity: 1; }
}
#bts-header .bt-theme-toggle:active { background: color-mix(in srgb, currentColor 14%, transparent) !important; }
#bts-header .bt-theme-toggle:focus:not(:focus-visible) { outline: none !important; box-shadow: none !important; }
#bts-header .bt-theme-toggle:focus-visible { outline: 1.5px solid color-mix(in srgb, var(--bts-accent, currentColor) 70%, transparent) !important; outline-offset: 3px !important; opacity: 1; }
#bts-header .bt-theme-toggle svg { position: absolute !important; top: 50% !important; left: 50% !important; flex: none !important; width: 18px !important; height: 18px !important; margin: -9px 0 0 -9px !important; padding: 0 !important; display: block !important; overflow: visible !important;
  fill: none !important; stroke: currentColor !important; stroke-width: 1.75px !important; stroke-linecap: round !important; stroke-linejoin: round !important; pointer-events: none !important;
  transition: transform .45s cubic-bezier(.4,0,.2,1), opacity .3s ease !important; }
#bts-header .bt-theme-toggle svg * { fill: none !important; stroke: currentColor !important; }
/* Light (aria-pressed=false): sun shown. Dark (true): moon shown. */
#bts-header .bt-theme-toggle .bt-tt-sun { opacity: 1 !important; transform: rotate(0deg) scale(1) !important; }
#bts-header .bt-theme-toggle .bt-tt-moon { opacity: 0 !important; transform: rotate(-90deg) scale(.5) !important; }
#bts-header .bt-theme-toggle[aria-pressed="true"] .bt-tt-sun { opacity: 0 !important; transform: rotate(90deg) scale(.5) !important; }
#bts-header .bt-theme-toggle[aria-pressed="true"] .bt-tt-moon { opacity: 1 !important; transform: rotate(0deg) scale(1) !important; }
/* Smooth colour cross-fade only while switching, never on load. */
html.bt-theme-anim, html.bt-theme-anim body, html.bt-theme-anim #bts-header, html.bt-theme-anim #bts-footer {
  transition: background-color .3s ease, color .3s ease !important;
}
@media (prefers-reduced-motion: reduce) {
  #bts-header .bt-theme-toggle svg, html.bt-theme-anim, html.bt-theme-anim body, html.bt-theme-anim #bts-header, html.bt-theme-anim #bts-footer { transition: none !important; }
}
html[data-bt-motion="reduce"] #bts-header .bt-theme-toggle svg { transition: none !important; }
@media (forced-colors: active) {
  #bts-header .bt-theme-toggle { border: 1px solid ButtonText !important; }
}
}

/* ---- Light-theme fixes for pages whose authored CSS was dark-only (scoped by canonical URL) ---- */
html[data-bt-theme="light"]:has(link[rel="canonical"][href$="/process.html"],link[rel="canonical"][href$="/case-studies.html"],link[rel="canonical"][href$="/lead-magnet.html"],link[rel="canonical"][href$="/resources.html"],link[rel="canonical"][href$="/sample-audit.html"],link[rel="canonical"][href$="/testimonials.html"]) {
  color-scheme: light;
  --bg:#f7f8fa; --bg-elev:#eef0f4; --bg-card:#ffffff; --text:#14161c; --text-2:#3b4250; --text-3:#4b5263; --text-muted:#5b6272;
  --accent:#c2410c; --accent-h:#9a3412; --green:#15803d; --red:#b91c1c; --border:#d6dae2;
}
html[data-bt-theme="light"]:has(link[rel="canonical"][href$="/audits-this-week.html"]) {
  color-scheme: light;
  --bg:#f7f8fa; --bg-card:#ffffff; --text:#14161c; --text-secondary:#3b4250; --text-muted:#5b6272;
  --accent:#c2410c; --accent-subtle:rgba(194,65,12,.07); --border:#d6dae2; --green:#15803d;
}
html[data-bt-theme="light"]:has(link[rel="canonical"][href$="/audits-this-week.html"]) .week-meta { color:#9a3412; }
html[data-bt-theme="light"]:has(link[rel="canonical"][href$="/audit-checklist.html"]) {
  color-scheme: light;
  --bg:#f5f7fb; --bg-elev:#eaf0f7; --bg-card:#ffffff; --text:#14202e; --text-2:#3d4c60; --text-muted:#4d5d72;
  --accent:#0e6f86; --accent-h:#0b5567; --on-accent:#ffffff; --green:#15803d; --red:#be123c; --border:#cdd6e2;
}
html[data-bt-theme="light"]:has(link[rel="canonical"][href$="/order-help.html"]) {
  color-scheme: light;
  --bg:#f7f9fc; --surface:#ffffff; --ink:#182638; --muted:#4d6078; --line:#c3cddd; --accent:#285bb7; --violet:#6842b5;
  --gradient:linear-gradient(110deg,#126a99,#365bc3 52%,#7844b9);
}
/* Shared light fixes for the process/case-study family hard-coded surfaces */
html[data-bt-theme="light"]:has(link[rel="canonical"][href$="/process.html"],link[rel="canonical"][href$="/case-studies.html"],link[rel="canonical"][href$="/lead-magnet.html"],link[rel="canonical"][href$="/resources.html"],link[rel="canonical"][href$="/sample-audit.html"],link[rel="canonical"][href$="/testimonials.html"]) .cta-card { background:linear-gradient(135deg,#ffffff,#fff4ec); }
html[data-bt-theme="light"]:has(link[rel="canonical"][href$="/process.html"],link[rel="canonical"][href$="/case-studies.html"],link[rel="canonical"][href$="/lead-magnet.html"],link[rel="canonical"][href$="/resources.html"],link[rel="canonical"][href$="/sample-audit.html"],link[rel="canonical"][href$="/testimonials.html"]) :is(.cta-card p a, .step a) { color:#1d4ed8; }
html[data-bt-theme="light"]:has(link[rel="canonical"][href$="/process.html"],link[rel="canonical"][href$="/case-studies.html"],link[rel="canonical"][href$="/lead-magnet.html"],link[rel="canonical"][href$="/resources.html"],link[rel="canonical"][href$="/sample-audit.html"],link[rel="canonical"][href$="/testimonials.html"]) .btn-primary { background:#c2410c; }
/* Dark-theme link contrast on process family (UA blue on near-black) */
html[data-bt-theme="dark"] .step a:not([class]) { color:#7cc4ff; }

/* Freelance invoice niche pages (free-tools/invoice-freelance-*) */
html[data-bt-theme="light"]:has(link[rel="canonical"][href*="/free-tools/invoice-freelance-"]) {
  color-scheme: light;
  --bg-dark:#f6f6fa; --text-dark:#15141f; --text-muted-dark:#4a4f63; --border-dark:#d4d2e2;
  --cta-bg-dark:#ffffff; --cta-hover-dark:#f0eefa; --field-bg-dark:#ffffff; --shape1-color-dark:#6d28d9; --shape2-color-dark:#0e7490;
}
html[data-bt-theme="light"]:has(link[rel="canonical"][href*="/free-tools/invoice-freelance-"]) .brand-header { background:rgba(246,246,250,.9); }
html[data-bt-theme="light"]:has(link[rel="canonical"][href*="/free-tools/invoice-freelance-"]) .form-control { color:#15141f; color-scheme:light; }
html[data-bt-theme="light"]:has(link[rel="canonical"][href*="/free-tools/invoice-freelance-"]) :is(.phead .text-muted, .tool-container .text-muted, .invoice-preview-section > .text-muted) { color:#4a4f63 !important; }
html[data-bt-theme="light"]:has(link[rel="canonical"][href*="/free-tools/invoice-freelance-"]) .phead h1 span { background:linear-gradient(120deg,#6d28d9,#0e7490) !important; -webkit-background-clip:text !important; background-clip:text !important; }
html[data-bt-theme="light"]:has(link[rel="canonical"][href*="/free-tools/invoice-freelance-"]) .pbadge { color:#5b21b6; background:#f1ecff; border-color:#c4b5fd; }
html[data-bt-theme="light"]:has(link[rel="canonical"][href*="/free-tools/invoice-freelance-"]) :is(.btn-tool-secondary, .btn-tool.btn-tool-secondary) { background:#ffffff; color:#15141f; border-color:#c4b5fd; }
html[data-bt-theme="light"]:has(link[rel="canonical"][href*="/free-tools/invoice-freelance-"]) .tool-container [class$="-tip-box"] { background:#f5f1ff; border-color:#c4b5fd; }
html[data-bt-theme="light"]:has(link[rel="canonical"][href*="/free-tools/invoice-freelance-"]) .tool-container [class$="-tip-box"] strong { color:#5b21b6 !important; }
html[data-bt-theme="light"]:has(link[rel="canonical"][href*="/free-tools/invoice-freelance-"]) :is(.tool-container [class$="-tip-box"] a, .invoice-privacy a) { color:#0e7490 !important; }
html[data-bt-theme="light"]:has(link[rel="canonical"][href*="/free-tools/invoice-freelance-"]) #items-container .btn { color:#be123c !important; }

/* Pricing plan cards: authored with a fixed dark surface */
html[data-bt-theme="light"] .btg-plan-card { background:#ffffff; border-color:#c3cddd; }
html[data-bt-theme="light"] .btg-plan-card.btg-plan-featured { background:linear-gradient(140deg,#eef2ff,#f3eeff); border-color:#6d5fd0; }
html[data-bt-theme="light"] .btg-plan-price { color:#14202e; }
html[data-bt-theme="light"] .btg-plan-pill { color:#3b2f99; border-color:#6d5fd0; }
html[data-bt-theme="light"] .btg-plan-card :is(.btg-plan-billing,.btg-plan-eq) { color:#4d6078; }

/* Free-tool embed panel + converter chip */
html[data-bt-theme="light"] .bt-embed :is(h2,h3) { color:#17171c !important; }
html[data-bt-theme="light"] .bt-embed { color:#2a2a33 !important; }
html[data-bt-theme="light"] .cvchip.to { color:#6d28d9; }
html[data-bt-theme="light"]:has(link[rel="canonical"][href*="/free-tools/invoice-freelance-"]) .tool-container .text-white { color:#15141f !important; }
html[data-bt-theme="light"]:has(link[rel="canonical"][href*="/free-tools/invoice-freelance-"]) :is(.niche-chip.active, .niche-chip:hover) { color:#15141f; background:#ede9fe; border-color:#6d28d9; }
html[data-bt-theme="light"]:has(link[rel="canonical"][href*="/free-tools/invoice-freelance-"]) .niche-chip:focus-visible { outline-color:#6d28d9; }

/* Light-theme contrast fixes found in the audit (text authored for dark backgrounds) */
html[data-bt-theme="light"] .bt-editorial-silo code { color:#5b21b6; }
html[data-bt-theme="light"] .rh-reader :is(p, li, .guide-meta, time, .lede) { color:#3d4a5c; }
html[data-bt-theme="light"] .btg-block .btg-title { color:#14202e; }
html[data-bt-theme="light"] .btg-block .btg-link { color:#285bb7; }
html[data-bt-theme="light"] :is(.rh-toc a, header.hero .eyebrow, header.hero .post-meta a, .ab-sub a) { color:#6d28d9; }
html[data-bt-theme="light"] .ab-wrap li { color:#4a4760; }
html[data-bt-theme="light"] :is(.cl-brand-badge, .cl-milestone-num) { color:#0f766e; }
html[data-bt-theme="light"] :is(.cl-eyebrow span, .cl-card-head .badge, .cl-seo-card h3) { color:#0e7490; }
html[data-bt-theme="light"] .fix-card .impact.high { color:#b91c1c; }
html[data-bt-theme="light"] .fix-card .impact.med { color:#9a3412; }
html[data-bt-theme="light"] .fix-card .impact.low { color:#15803d; }
html[data-bt-theme="light"] .badge.no { color:#92400e; }
html[data-bt-theme="light"] .badge.yes { color:#166534; }
html[data-bt-theme="light"] .tool-card .btn-open-tool { filter:brightness(.62) saturate(1.2); }

/* No seat counts: hide the Early Bird "X of N left" figure everywhere (offer block itself unchanged). */
[data-bt-founding-left] { display:none !important; }
html[data-bt-theme="light"] .btg-block :is(.btg-eyebrow, .btg-text, .btg-small) { color:#3d4c60; }
html[data-bt-theme="light"] .btg-block { --btg-bg:#ffffff !important; --btg-ink:#14202e !important; --btg-muted:#3d4c60 !important; --btg-line:#c3cddd !important; --btg-accent:#285bb7 !important; }
