/* Reusable non-modal palette selector. All colors come from palettes.css. */
.theme-picker {
  position: fixed;
  z-index: 110;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  color: var(--text);
  font: 14px/1.5 var(--font-b);
}
.theme-picker__toggle,
.theme-picker__close,
.theme-picker__option {
  font: inherit;
  cursor: pointer;
}
.theme-picker__toggle {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--bg2);
  color: var(--accent);
  box-shadow: 0 8px 32px rgb(var(--ink-rgb) / 0.35);
}
.theme-picker__toggle:hover,
.theme-picker__toggle[aria-expanded="true"] {
  background: var(--accent);
  color: var(--on-accent);
}
.theme-picker__toggle svg {
  width: 26px;
  height: 26px;
}
.theme-picker__panel {
  position: absolute;
  right: 0;
  bottom: 70px;
  width: 340px;
  max-width: calc(100vw - 40px);
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  background: var(--bg2);
  box-shadow: 0 20px 70px rgb(var(--ink-rgb) / 0.6);
}
.theme-picker__panel[hidden] {
  display: none;
}
.theme-picker__heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.theme-picker__title {
  margin: 0;
  font: 700 20px/1.2 var(--font-h);
  letter-spacing: -0.03em;
  text-transform: none;
}
.theme-picker__close {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 26px;
  line-height: 1;
}
.theme-picker__description,
.theme-picker__status {
  color: var(--muted);
  font-size: 13px;
}
.theme-picker__description {
  margin: 0 0 20px;
}
.theme-picker__options {
  display: grid;
  gap: 10px;
}
.theme-picker__option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}
.theme-picker__option:hover {
  background: var(--surface-2);
}
.theme-picker__option[aria-pressed="true"] {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}
.theme-picker__swatches {
  display: flex;
  flex: none;
  overflow: hidden;
  width: 76px;
  height: 28px;
  border: 1px solid var(--stroke);
  border-radius: 7px;
}
.theme-picker__swatch {
  flex: 1;
  background: var(--preview-bg);
}
.theme-picker__swatch:nth-child(2) {
  background: var(--preview-accent);
}
.theme-picker__swatch:nth-child(3) {
  background: var(--preview-soft);
}
.theme-picker__swatch:nth-child(4) {
  background: var(--white);
}
.theme-picker__option--orange {
  --preview-bg: var(--swatch-orange-bg);
  --preview-accent: var(--swatch-orange);
  --preview-soft: var(--swatch-orange-soft);
}
.theme-picker__option--blue {
  --preview-bg: var(--swatch-blue-bg);
  --preview-accent: var(--swatch-blue);
  --preview-soft: var(--swatch-blue-soft);
}
.theme-picker__option--red {
  --preview-bg: var(--swatch-red-bg);
  --preview-accent: var(--swatch-red);
  --preview-soft: var(--swatch-red-soft);
}
.theme-picker__check {
  width: 20px;
  height: 20px;
  margin-left: auto;
  color: var(--accent);
  visibility: hidden;
}
.theme-picker__option[aria-pressed="true"] .theme-picker__check {
  visibility: visible;
}
.theme-picker__status {
  display: block;
  margin-top: 20px;
}
.page--menu-open .theme-picker {
  visibility: hidden;
}
@media (max-width: 480px) {
  .theme-picker__panel {
    padding: 20px;
  }
}
