.poka-theme-toggle {
  position: fixed;
  z-index: 60;
  right: 14px;
  top: 14px;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 8px;
}

.poka-theme-trigger {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1.5px solid var(--line, #d9d2c2);
  border-radius: 50%;
  background: var(--paper, #fffdf7);
  color: var(--muted, #68716c);
  display: grid;
  place-items: center;
  opacity: .5;
  cursor: pointer;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, .12);
  transition: opacity .15s ease, background .15s ease, color .15s ease, transform .1s ease, border-color .15s ease;
}
.poka-theme-trigger svg { width: 16px; height: 16px; }
.poka-theme-toggle:hover .poka-theme-trigger,
.poka-theme-trigger:focus-visible,
.poka-theme-toggle[data-open="true"] .poka-theme-trigger {
  opacity: 1;
  color: var(--ink, #17231f);
  border-color: var(--ink, #17231f);
}
.poka-theme-trigger:active { transform: scale(.94); }
.poka-theme-trigger:focus-visible { outline: 3px solid var(--blue, #77bcd2); outline-offset: 2px; }

.poka-theme-toggle--hosted {
  position: relative;
  z-index: 60;
  inset: auto;
  margin-left: auto;
  display: block;
}
.poka-theme-toggle--hosted .poka-theme-trigger {
  width: 40px;
  height: 40px;
  border: 2px solid var(--ink, #17231f);
  background: var(--soft, #f6f1e7);
  color: var(--ink, #17231f);
  opacity: 1;
  box-shadow: 2px 2px 0 var(--ink, #17231f);
}
.poka-theme-toggle--hosted .poka-theme-trigger svg { width: 18px; height: 18px; }
.poka-theme-toggle--hosted .poka-theme-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: max-content;
}
.poka-theme-toggle--hosted .poka-theme-option {
  min-width: 0;
  padding-right: 5px;
}

.poka-theme-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px;
  border: 1.5px solid var(--line, #d9d2c2);
  border-radius: 14px;
  background: var(--paper, #fffdf7);
  box-shadow: 2px 3px 0 rgba(0, 0, 0, .1), 0 10px 24px rgba(0, 0, 0, .16);
}
.poka-theme-menu[hidden] { display: none; }

.poka-theme-option {
  min-width: 190px;
  height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted, #68716c);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .68rem;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.poka-theme-option svg { width: 15px; height: 15px; flex: 0 0 auto; }
.poka-theme-option:hover { background: var(--soft, #f6f1e7); color: var(--ink, #17231f); }
.poka-theme-option[aria-checked="true"] { background: var(--soft, #f6f1e7); color: var(--ink, #17231f); font-weight: 900; }
.poka-theme-option:focus-visible { outline: 3px solid var(--blue, #77bcd2); outline-offset: -2px; }

.poka-theme-toggle:not(.poka-theme-toggle--hosted) .poka-theme-option,
.poka-theme-toggle:not(.poka-theme-toggle--hosted) .poka-theme-option[aria-checked="true"] {
  font-weight: 400;
}

body[data-theme-position="bottom-right"] .poka-theme-toggle {
  top: auto;
  bottom: 14px;
  right: 14px;
}

@media (max-width: 420px) {
  .poka-theme-toggle { top: 10px; right: 10px; }
  .poka-theme-toggle--hosted { inset: auto; }
  body[data-theme-position="bottom-right"] .poka-theme-toggle {
    top: auto;
    bottom: 10px;
    right: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .poka-theme-trigger { transition: none; }
}
