.template-switcher {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
  padding: 8px;
  border: 1px solid var(--theme-border, rgba(184, 138, 68, 0.24));
  border-radius: 999px;
  background: rgba(255, 250, 243, 0.86);
  box-shadow: 0 18px 42px rgba(68, 47, 34, 0.18);
  backdrop-filter: blur(16px);
}

.template-switcher-label {
  padding: 0 5px 0 8px;
  color: var(--theme-muted, #756b61);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.template-options {
  display: flex;
  gap: 6px;
}

.template-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  max-width: 156px;
  padding: 4px 10px 4px 4px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--theme-ink, #27211d);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.template-option:hover,
.template-option:focus-visible {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.54);
  outline: 0;
}

.template-option.is-active {
  border-color: var(--theme-primary, #b88a44);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 8px 18px rgba(68, 47, 34, 0.1);
}

.template-swatch {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid rgba(39, 33, 29, 0.12);
  border-radius: 50%;
  background:
    linear-gradient(135deg, var(--swatch-a) 0 35%, var(--swatch-b) 35% 68%, var(--swatch-c) 68% 100%);
}

.template-option-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .template-switcher {
    right: 50%;
    bottom: 12px;
    transform: translateX(50%);
    width: min(calc(100vw - 24px), 420px);
    justify-content: space-between;
  }

  .template-switcher-label {
    display: none;
  }

  .template-options {
    width: 100%;
    justify-content: space-between;
  }

  .template-option {
    min-width: 40px;
    padding: 4px;
  }

  .template-option-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}
