/* Styzen portals — definitive conflict-proof theme control r100 */

html[data-portal] .theme-toggle,
.top .theme-toggle{
  width:auto!important;
  min-width:132px!important;
  height:42px!important;
  min-height:42px!important;
  max-height:42px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  padding:0 13px!important;
  box-sizing:border-box!important;
  border:1px solid var(--line-strong,rgba(255,255,255,.18))!important;
  border-radius:10px!important;
  background:var(--surface-2,#0f2d53)!important;
  color:var(--ink,#f5f8ff)!important;
  box-shadow:none!important;
  filter:none!important;
  transform:none!important;
  font-size:0!important;
  line-height:1!important;
  white-space:nowrap!important;
  overflow:visible!important;
  cursor:pointer!important;
  transition:none!important;
}

/* Legacy runtimes may still rewrite the button contents. They are always hidden. */
html[data-portal] .theme-toggle>*,
.top .theme-toggle>*{
  display:none!important;
}

/* Real visual icon is rendered by CSS, so older JavaScript cannot remove it. */
html[data-portal] .theme-toggle::before,
.top .theme-toggle::before{
  content:""!important;
  position:static!important;
  display:block!important;
  width:18px!important;
  min-width:18px!important;
  height:18px!important;
  min-height:18px!important;
  flex:0 0 18px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  background-color:transparent!important;
  background-repeat:no-repeat!important;
  background-position:center!important;
  background-size:18px 18px!important;
  box-shadow:none!important;
  filter:none!important;
  transform:none!important;
  pointer-events:none!important;
  /* Dark theme -> action is light mode: show a clean gold sun. */
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F6C344' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.42 1.42M17.65 17.65l1.42 1.42M2 12h2M20 12h2M4.93 19.07l1.42-1.42M17.65 6.35l1.42-1.42'/%3E%3C/svg%3E")!important;
}

html[data-portal] .theme-toggle::after,
.top .theme-toggle::after{
  content:"Modo claro"!important;
  position:static!important;
  display:block!important;
  width:auto!important;
  height:auto!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  background:none!important;
  box-shadow:none!important;
  color:inherit!important;
  font-size:.78rem!important;
  font-weight:800!important;
  letter-spacing:0!important;
  line-height:1!important;
  white-space:nowrap!important;
  transform:none!important;
  pointer-events:none!important;
}

/* Light theme -> action is dark mode: show a clean crescent moon. */
html[data-theme="light"][data-portal] .theme-toggle::before,
html[data-theme="light"] .top .theme-toggle::before{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D8E5FF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.2 15.2A8.5 8.5 0 0 1 8.8 3.8 8.7 8.7 0 1 0 20.2 15.2Z'/%3E%3C/svg%3E")!important;
}

html[data-theme="light"][data-portal] .theme-toggle::after,
html[data-theme="light"] .top .theme-toggle::after{
  content:"Modo escuro"!important;
}

html[data-portal] .theme-toggle:hover,
html[data-portal] .theme-toggle:active,
.top .theme-toggle:hover,
.top .theme-toggle:active{
  transform:none!important;
  filter:none!important;
  box-shadow:none!important;
}

html[data-portal] .theme-toggle:focus-visible,
.top .theme-toggle:focus-visible{
  outline:2px solid var(--accent,#4b8dff)!important;
  outline-offset:2px!important;
}

@media(max-width:900px){
  html[data-portal] .theme-toggle,
  .top .theme-toggle{
    min-width:130px!important;
    width:130px!important;
    height:42px!important;
    min-height:42px!important;
    max-height:42px!important;
    padding:0 12px!important;
    gap:8px!important;
  }
}

@media(max-width:580px){
  html[data-portal] .theme-toggle,
  .top .theme-toggle{
    min-width:128px!important;
    width:128px!important;
    height:40px!important;
    min-height:40px!important;
    max-height:40px!important;
    padding:0 11px!important;
    border-radius:9px!important;
  }
  html[data-portal] .theme-toggle::before,
  .top .theme-toggle::before{
    width:17px!important;
    min-width:17px!important;
    height:17px!important;
    min-height:17px!important;
    flex-basis:17px!important;
    background-size:17px 17px!important;
  }
  html[data-portal] .theme-toggle::after,
  .top .theme-toggle::after{
    font-size:.74rem!important;
  }
}
