.theme-menu-wrap {
  position: relative;
}

.theme-menu-wrap-fixed {
  position: fixed;
  z-index: 1000;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
}

.theme-menu-wrap-fixed .theme-btn {
  position: static;
}

.theme-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 184px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 12px);
  background: var(--surface);
  box-shadow: var(--shadow, 0 10px 30px rgba(0, 0, 0, 0.25));
}

.theme-dropdown[hidden] {
  display: none;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 0;
  border-radius: var(--radius-sm, 8px);
  background: transparent;
  color: var(--text, var(--ink, #f5f5f7));
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.theme-option > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.theme-option-label {
  flex: 1;
}

.theme-option:hover,
.theme-option[aria-checked="true"] {
  background: var(--surface-2);
}

.theme-option-check {
  color: var(--accent-2, var(--pink, #fc3c44));
  visibility: hidden;
}

.theme-option[aria-checked="true"] .theme-option-check {
  visibility: visible;
}

.theme-dropdown {
  animation: theme-menu-in 120ms ease-out;
  transform-origin: top right;
}

@keyframes theme-menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-dropdown {
    animation: none;
  }
}
