/* Smith Digital / Theme switch V4 unified — 19 Nov 2026
 * Inline SVG icons, NOT CSS masks. Separate file name avoids stale CDN caches.
 * Used by landing, login, register, blog, member and administrator pages.
 * Existing click handlers & theme localStorage are unchanged.
 */
html button.sdg-theme-pill:is(#themeToggle,#sv31-theme-toggle,#theme-toggle,#smm-admin-theme-toggle){
  --pill-active-bg:#22262d;
  --pill-active-ink:#fff;
  --pill-idle-ink:#455167;
  box-sizing:border-box!important;
  -webkit-appearance:none!important;appearance:none!important;
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  align-items:center!important;justify-items:stretch!important;
  position:relative!important;isolation:isolate!important;
  width:80px!important;min-width:80px!important;max-width:80px!important;
  height:40px!important;min-height:40px!important;max-height:40px!important;
  flex:0 0 80px!important;
  margin:0!important;padding:3px!important;gap:0!important;
  border:1px solid #cbd3df!important;border-radius:999px!important;
  background:#f1f3f7!important;
  color:#455167!important;
  box-shadow:inset 0 1px 3px rgba(12,25,49,.08),0 2px 5px rgba(15,30,56,.09)!important;
  font-size:initial!important;line-height:1!important;
  cursor:pointer!important;overflow:hidden!important;
  -webkit-tap-highlight-color:transparent;touch-action:manipulation;
  transition:background .28s ease,border-color .28s ease,box-shadow .28s ease!important;
}
/* A single moving disc behind the two real SVGs. */
html button.sdg-theme-pill:is(#themeToggle,#sv31-theme-toggle,#theme-toggle,#smm-admin-theme-toggle)::before{
  content:""!important;display:block!important;visibility:visible!important;opacity:1!important;
  position:absolute!important;top:3px!important;left:3px!important;
  width:32px!important;height:32px!important;border:0!important;border-radius:50%!important;
  background:var(--pill-active-bg)!important;
  box-shadow:0 2px 6px rgba(0,0,0,.19)!important;
  z-index:0!important;pointer-events:none!important;
  transform:translateX(0)!important;
  transition:transform .32s cubic-bezier(.2,.8,.2,1),background .25s ease!important;
}
html button.sdg-theme-pill:is(#themeToggle,#sv31-theme-toggle,#theme-toggle,#smm-admin-theme-toggle)::after{
  content:none!important;display:none!important;
}
html button.sdg-theme-pill:is(#themeToggle,#sv31-theme-toggle,#theme-toggle,#smm-admin-theme-toggle) .sdg-theme-option{
  box-sizing:border-box!important;
  display:flex!important;align-items:center!important;justify-content:center!important;
  position:relative!important;z-index:2!important;
  width:100%!important;height:32px!important;min-width:0!important;min-height:0!important;
  padding:0!important;margin:0!important;
  background:transparent!important;border:0!important;border-radius:0!important;
  opacity:1!important;visibility:visible!important;
  color:var(--pill-idle-ink)!important;
  pointer-events:none!important;
  transition:color .25s ease!important;
}
html button.sdg-theme-pill:is(#themeToggle,#sv31-theme-toggle,#theme-toggle,#smm-admin-theme-toggle) .sdg-theme-option::before,
html button.sdg-theme-pill:is(#themeToggle,#sv31-theme-toggle,#theme-toggle,#smm-admin-theme-toggle) .sdg-theme-option::after{
  content:none!important;display:none!important;
}
/* SVG paths are rendered directly: unaffected by mask support, fonts or blocked data URLs. */
html button.sdg-theme-pill:is(#themeToggle,#sv31-theme-toggle,#theme-toggle,#smm-admin-theme-toggle) .sdg-theme-option > svg{
  box-sizing:border-box!important;display:block!important;
  width:21px!important;height:21px!important;min-width:21px!important;min-height:21px!important;
  max-width:21px!important;max-height:21px!important;
  flex:0 0 21px!important;
  margin:0!important;padding:0!important;
  position:relative!important;z-index:3!important;
  opacity:1!important;visibility:visible!important;
  fill:none!important;stroke:currentColor!important;
  stroke-width:2.5!important;stroke-linecap:round!important;stroke-linejoin:round!important;
  color:inherit!important;
  transform:none!important;filter:none!important;
}
html button.sdg-theme-pill:is(#themeToggle,#sv31-theme-toggle,#theme-toggle,#smm-admin-theme-toggle) .sdg-theme-option svg :is(path,circle,line,polyline){
  fill:none!important;stroke:currentColor!important;
  stroke-width:2.5!important;stroke-linecap:round!important;stroke-linejoin:round!important;
  opacity:1!important;visibility:visible!important;
}
html button.sdg-theme-pill:is(#themeToggle,#sv31-theme-toggle,#theme-toggle,#smm-admin-theme-toggle) .sdg-theme-sun{
  color:var(--pill-active-ink)!important;
}
html:is([data-theme="dark"],[data-smith-theme="dark"],[data-landing-theme="dark"]) button.sdg-theme-pill:is(#themeToggle,#sv31-theme-toggle,#theme-toggle,#smm-admin-theme-toggle){
  --pill-active-bg:#f6f8fc;--pill-active-ink:#162239;--pill-idle-ink:#c8d7f0;
  background:#1e2c45!important;border-color:#52627c!important;color:#dce7f9!important;
  box-shadow:inset 0 1px 3px rgba(0,0,0,.20),0 2px 5px rgba(0,0,0,.14)!important;
}
html:is([data-theme="dark"],[data-smith-theme="dark"],[data-landing-theme="dark"]) button.sdg-theme-pill:is(#themeToggle,#sv31-theme-toggle,#theme-toggle,#smm-admin-theme-toggle)::before{
  transform:translateX(40px)!important;
}
html:is([data-theme="dark"],[data-smith-theme="dark"],[data-landing-theme="dark"]) button.sdg-theme-pill:is(#themeToggle,#sv31-theme-toggle,#theme-toggle,#smm-admin-theme-toggle) .sdg-theme-sun{
  color:var(--pill-idle-ink)!important;
}
html:is([data-theme="dark"],[data-smith-theme="dark"],[data-landing-theme="dark"]) button.sdg-theme-pill:is(#themeToggle,#sv31-theme-toggle,#theme-toggle,#smm-admin-theme-toggle) .sdg-theme-moon{
  color:var(--pill-active-ink)!important;
}
html button.sdg-theme-pill:is(#themeToggle,#sv31-theme-toggle,#theme-toggle,#smm-admin-theme-toggle):hover{
  box-shadow:0 3px 9px rgba(20,53,105,.20)!important;
}
html button.sdg-theme-pill:is(#themeToggle,#sv31-theme-toggle,#theme-toggle,#smm-admin-theme-toggle):focus-visible{
  outline:3px solid #337af5!important;outline-offset:3px!important;
}
@media(max-width:430px){
  html button.sdg-theme-pill:is(#themeToggle,#sv31-theme-toggle,#theme-toggle,#smm-admin-theme-toggle){
    width:76px!important;min-width:76px!important;max-width:76px!important;
    height:38px!important;min-height:38px!important;max-height:38px!important;flex-basis:76px!important;
  }
  html button.sdg-theme-pill:is(#themeToggle,#sv31-theme-toggle,#theme-toggle,#smm-admin-theme-toggle)::before{
    width:30px!important;height:30px!important;
  }
  html:is([data-theme="dark"],[data-smith-theme="dark"],[data-landing-theme="dark"]) button.sdg-theme-pill:is(#themeToggle,#sv31-theme-toggle,#theme-toggle,#smm-admin-theme-toggle)::before{
    transform:translateX(38px)!important;
  }
  html button.sdg-theme-pill:is(#themeToggle,#sv31-theme-toggle,#theme-toggle,#smm-admin-theme-toggle) .sdg-theme-option{height:30px!important;}
}
@media(prefers-reduced-motion:reduce){
  html button.sdg-theme-pill:is(#themeToggle,#sv31-theme-toggle,#theme-toggle,#smm-admin-theme-toggle),
  html button.sdg-theme-pill:is(#themeToggle,#sv31-theme-toggle,#theme-toggle,#smm-admin-theme-toggle)::before,
  html button.sdg-theme-pill:is(#themeToggle,#sv31-theme-toggle,#theme-toggle,#smm-admin-theme-toggle) .sdg-theme-option{
    transition:none!important;
  }
}

/* Admin legacy visual styles: retain modern two-icon control on desktop/mobile. */
html button#smm-admin-theme-toggle.sdg-theme-pill .smm-theme-word,
html button#smm-admin-theme-toggle.sdg-theme-pill .smm-theme-symbol{display:none!important}
@media (max-width:740px){html button#smm-admin-theme-toggle.sdg-theme-pill{display:grid!important}}
