/* One appearance button only, at the historical selector's fixed position. */
#ps-theme-switcher {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: calc(100vw - 28px);
  margin: 0;
  padding: 7px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 3px 12px rgba(15, 23, 42, .12);
  color: #334155;
  font: 400 12px/1.45 system-ui, sans-serif;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transform: none;
  transition: none;
}

#ps-theme-switcher:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

#ps-theme-switcher:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 3px;
}

#ps-theme-switcher .ps-theme-icon {
  display: block;
  flex: 0 0 16px;
}

#ps-theme-switcher .ps-theme-icon--studio {
  display: none;
}

#ps-theme-switcher [data-ps-theme-label] {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Keep the existing preference/storage feedback available to screen readers. */
#ps-theme-preference-note {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

html[data-ps-theme="studio"] #ps-theme-switcher {
  border-color: var(--ps-line-strong);
  background: var(--ps-surface-soft);
  color: var(--ps-text);
  font-family: var(--ps-font-ui);
}

html[data-ps-theme="studio"] #ps-theme-switcher:hover {
  border-color: var(--ps-gold);
  background: var(--ps-bg-soft);
  color: var(--ps-ink);
}

html[data-ps-theme="studio"] #ps-theme-switcher:focus-visible {
  outline-color: var(--ps-focus);
}

html[data-ps-theme="studio"] #ps-theme-switcher .ps-theme-icon--original {
  display: none;
}

html[data-ps-theme="studio"] #ps-theme-switcher .ps-theme-icon--studio {
  display: block;
}

@media (max-width: 640px) {
  #ps-theme-switcher { left: 8px; bottom: 8px; }
}
