/* Theme menu — colours read live from --tz-* on <html> (set by applyPalette) */
#theme-switcher {
  --theme-menu-width: 20rem;
  --menu-brand-accent: #ff4d4d;
  --menu-brand-accent-hover: #b91c1c;
  --menu-radius: 6px;
  --menu-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --menu-font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --menu-font-display: Georgia, 'Times New Roman', serif;
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  font-family: var(--menu-font);
  color: var(--tz-text, #1a2b3c);
}

#theme-switcher * {
  font-family: inherit;
}

.theme-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--theme-menu-width);
  height: 100vh;
  height: 100dvh;
  background: var(--tz-white, #ffffff);
  border-right: 1px solid var(--tz-border, #d8e0ea);
  box-shadow: 8px 0 40px rgba(0, 0, 0, 0.12);
  transform: translateX(-100%);
  transition: transform 0.35s var(--menu-ease);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  z-index: 10000;
}

.theme-menu.is-open { transform: translateX(0); }

.theme-menu-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid var(--tz-border, #d8e0ea);
  background: var(--tz-cream, #f4f5f7);
  flex-shrink: 0;
}

.theme-menu-header h2 {
  font-family: var(--menu-font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--tz-text, #1a2b3c);
  line-height: 1.2;
}

.theme-menu-header p {
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  color: var(--tz-muted, #5c6b7a);
  line-height: 1.45;
}

.theme-menu-close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--tz-white, #ffffff);
  border: 1px solid var(--tz-border, #d8e0ea);
  border-radius: var(--menu-radius);
  color: var(--tz-muted, #5c6b7a);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.theme-menu-close:hover {
  color: var(--tz-text, #1a2b3c);
  border-color: var(--tz-primary, #2c5282);
  background: var(--tz-primary-light, #e8f0f8);
}

.theme-menu-body {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--tz-border, #d8e0ea) transparent;
}

.theme-menu-body::-webkit-scrollbar { width: 6px; }

.theme-menu-body::-webkit-scrollbar-thumb {
  background: var(--tz-border, #d8e0ea);
  border-radius: 999px;
}

.theme-menu-brand {
  flex-shrink: 0;
  padding: 0.875rem 1.25rem 1.125rem;
  border-top: 1px solid var(--tz-border, #d8e0ea);
  background: var(--tz-white, #ffffff);
}

.theme-menu-brand-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--tz-muted, #5c6b7a);
  text-decoration: none;
  transition: color 0.2s;
}

.theme-menu-brand-link:hover {
  color: var(--tz-text, #1a2b3c);
}

.theme-menu-brand-icon {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.375rem;
}

.theme-menu-brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
  min-width: 0;
}

.theme-menu-brand-label {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
}

.theme-menu-brand-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--menu-brand-accent);
  line-height: 1.2;
}

.theme-menu-brand-link:hover .theme-menu-brand-name {
  color: var(--menu-brand-accent-hover);
}

.theme-group {
  border-bottom: 1px solid var(--tz-border, #d8e0ea);
}

.theme-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.9375rem 1rem;
  background: var(--tz-white, #ffffff);
  border: none;
  border-left: 3px solid var(--tz-accent, #2563eb);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.theme-group-toggle:hover { background: var(--tz-cream, #f4f5f7); }

.theme-group.is-open .theme-group-toggle {
  background: var(--tz-cream, #f4f5f7);
  border-bottom: 1px solid var(--tz-border, #d8e0ea);
}

.theme-group-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.theme-group-title {
  font-family: var(--menu-font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--tz-text, #1a2b3c);
  line-height: 1.2;
}

.theme-group-hint {
  font-size: 0.6875rem;
  color: var(--tz-muted, #5c6b7a);
  line-height: 1.3;
}

.theme-group-chevron {
  flex-shrink: 0;
  color: var(--tz-muted, #5c6b7a);
  transition: transform 0.25s var(--menu-ease);
}

.theme-group.is-open .theme-group-chevron { transform: rotate(180deg); }

.theme-group-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s var(--menu-ease);
}

.theme-group.is-open .theme-group-panel { grid-template-rows: 1fr; }

.theme-group-panel > * {
  min-height: 0;
  overflow: hidden;
}

.theme-group.is-open .theme-group-panel > * { overflow: visible; }

.theme-group-inner {
  background: color-mix(in srgb, var(--tz-cream, #f4f5f7) 45%, var(--tz-white, #ffffff));
  border-top: 1px solid color-mix(in srgb, var(--tz-border, #d8e0ea) 70%, transparent);
}

.theme-section {
  border-bottom: 1px solid var(--tz-border, #d8e0ea);
}

.theme-section:last-child,
.theme-group-inner .theme-section:last-child { border-bottom: none; }

.theme-section--nested .theme-section-toggle {
  padding: 0.75rem 1rem 0.75rem 1.125rem;
  border-left: 3px solid var(--tz-accent, #2563eb);
}

.theme-section--nested .theme-section-title {
  font-size: 0.875rem;
  font-weight: 600;
}

.theme-section--nested.is-open .theme-section-toggle {
  position: static;
  box-shadow: none;
  border-bottom: 1px solid var(--tz-border, #d8e0ea);
}

.theme-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--tz-white, #ffffff);
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.theme-section-toggle:hover { background: var(--tz-cream, #f4f5f7); }

.theme-section.is-open .theme-section-toggle {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--tz-cream, #f4f5f7);
  border-bottom: 1px solid var(--tz-border, #d8e0ea);
  box-shadow: 0 1px 0 var(--tz-border, #d8e0ea);
}

.theme-section-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.theme-section-title {
  font-family: var(--menu-font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--tz-text, #1a2b3c);
  line-height: 1.2;
}

.theme-section-hint {
  font-size: 0.6875rem;
  color: var(--tz-muted, #5c6b7a);
  line-height: 1.3;
}

.theme-section-chevron {
  flex-shrink: 0;
  color: var(--tz-muted, #5c6b7a);
  transition: transform 0.25s var(--menu-ease);
}

.theme-section.is-open .theme-section-chevron { transform: rotate(180deg); }

.theme-section-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s var(--menu-ease);
}

.theme-section.is-open .theme-section-panel { grid-template-rows: 1fr; }

.theme-section-panel > * {
  min-height: 0;
  overflow: hidden;
  padding: 0 1rem;
}

.theme-section.is-open .theme-section-panel > * {
  padding: 0.75rem 1rem 1rem;
  overflow: visible;
}

.section-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.section-reset {
  width: 100%;
  padding: 0.625rem 0.75rem;
  margin-bottom: 0.125rem;
  background: var(--tz-white, #ffffff);
  border: 1px solid var(--tz-border, #d8e0ea);
  border-radius: var(--menu-radius);
  color: var(--tz-muted, #5c6b7a);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.section-reset:hover {
  color: var(--tz-text, #1a2b3c);
  border-color: var(--tz-primary, #2c5282);
  background: var(--tz-primary-light, #e8f0f8);
}

.theme-tools-btn {
  width: 100%;
  padding: 0.625rem 0.75rem;
  background: var(--tz-white, #ffffff);
  border: 1px solid var(--tz-border, #d8e0ea);
  border-radius: var(--menu-radius);
  color: var(--tz-text, #1a2b3c);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.theme-tools-btn:hover {
  border-color: var(--tz-primary, #2c5282);
  background: var(--tz-primary-light, #e8f0f8);
}

.theme-tools-btn--danger {
  color: #b42318;
  border-color: rgba(180, 35, 24, 0.25);
}

.theme-tools-btn--danger:hover {
  background: rgba(180, 35, 24, 0.08);
  border-color: rgba(180, 35, 24, 0.4);
}

.theme-tools-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.theme-tools-hint {
  margin-top: 0.625rem;
  font-size: 0.6875rem;
  color: var(--tz-muted, #5c6b7a);
  line-height: 1.4;
}

.theme-snapshot-save {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.theme-snapshot-input {
  width: 100%;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--tz-border, #d8e0ea);
  border-radius: var(--menu-radius);
  font-size: 0.75rem;
  color: var(--tz-text, #1a2b3c);
  background: var(--tz-white, #ffffff);
}

.theme-snapshot-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-top: 0.625rem;
}

.theme-snapshot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.theme-snapshot-load {
  flex: 1;
  text-align: left;
  padding: 0.5rem 0.625rem;
  background: var(--tz-white, #ffffff);
  border: 1px solid var(--tz-border, #d8e0ea);
  border-radius: var(--menu-radius);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tz-text, #1a2b3c);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.theme-snapshot-load:hover {
  border-color: var(--tz-primary, #2c5282);
  background: var(--tz-primary-light, #e8f0f8);
}

.theme-snapshot-date {
  font-size: 0.625rem;
  color: var(--tz-muted, #5c6b7a);
  white-space: nowrap;
}

.theme-snapshot-delete {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  background: var(--tz-white, #ffffff);
  border: 1px solid var(--tz-border, #d8e0ea);
  border-radius: var(--menu-radius);
  color: var(--tz-muted, #5c6b7a);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.theme-snapshot-delete:hover {
  color: #b42318;
  border-color: rgba(180, 35, 24, 0.35);
  background: rgba(180, 35, 24, 0.08);
}

.choice-option-preview--ext {
  display: block;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 3px;
  border: 1.5px solid var(--tz-border, #d8e0ea);
  background: var(--tz-white, #ffffff);
}

.choice-option-preview--ext-sharp { border-radius: 0; }
.choice-option-preview--ext-soft { border-radius: 2px; }
.choice-option-preview--ext-rounded { border-radius: 4px; }
.choice-option-preview--ext-generous { border-radius: 7px; }

.choice-option-preview--ext-small {
  font-size: 0.5rem;
  line-height: 1.375rem;
  text-align: center;
  font-weight: 700;
}

.choice-option-preview--ext-default {
  font-size: 0.5625rem;
  line-height: 1.375rem;
  text-align: center;
  font-weight: 700;
}

.choice-option-preview--ext-large {
  font-size: 0.625rem;
  line-height: 1.375rem;
  text-align: center;
  font-weight: 700;
}

.choice-option-preview--ext-light {
  background: linear-gradient(135deg, color-mix(in srgb, var(--tz-primary, #2c5282) 20%, transparent) 50%, color-mix(in srgb, var(--tz-primary, #2c5282) 5%, transparent) 50%);
}
.choice-option-preview--ext-medium {
  background: linear-gradient(135deg, color-mix(in srgb, var(--tz-primary, #2c5282) 45%, transparent) 50%, color-mix(in srgb, var(--tz-primary, #2c5282) 15%, transparent) 50%);
}
.choice-option-preview--ext-dark {
  background: linear-gradient(135deg, color-mix(in srgb, var(--tz-primary, #2c5282) 65%, transparent) 50%, color-mix(in srgb, var(--tz-primary, #2c5282) 30%, transparent) 50%);
}
.choice-option-preview--ext-heavier {
  background: linear-gradient(135deg, color-mix(in srgb, var(--tz-primary, #2c5282) 80%, transparent) 50%, color-mix(in srgb, var(--tz-primary, #2c5282) 45%, transparent) 50%);
}

.theme-options,
.font-options,
.choice-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.choice-option {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  background: var(--tz-white, #ffffff);
  border: 2px solid var(--tz-border, #d8e0ea);
  border-radius: var(--menu-radius);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.choice-option:hover {
  border-color: var(--tz-primary, #2c5282);
  background: var(--tz-primary-light, #e8f0f8);
}

.choice-option.is-active {
  border-color: var(--tz-primary, #2c5282);
  background: var(--tz-primary-light, #e8f0f8);
  box-shadow: var(--tz-shadow, 0 4px 16px rgba(0,0,0,0.1));
}

.choice-option-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  background: var(--tz-cream, #f4f5f7);
  border-radius: var(--menu-radius);
  overflow: hidden;
}

.choice-option-preview--btn {
  width: 2rem;
  height: 0.875rem;
  background: var(--tz-primary, #2c5282);
  border: 1.5px solid var(--tz-primary, #2c5282);
  border-radius: 3px;
}

.choice-option-preview--btn-pill { border-radius: 999px; }
.choice-option-preview--btn-sharp { border-radius: 0; }
.choice-option-preview--btn-outline {
  background: transparent;
  border-color: var(--tz-primary, #2c5282);
}
.choice-option-preview--btn-soft {
  background: var(--tz-primary-light, #e8f0f8);
  border-color: transparent;
}
.choice-option-preview--btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: inset 0 0 0 1.5px var(--tz-primary, #2c5282);
}
.choice-option-preview--btn-gradient {
  background: linear-gradient(135deg, var(--tz-primary, #2c5282) 0%, var(--tz-button, var(--tz-accent, #2563eb)) 100%);
  border-color: transparent;
}
.choice-option-preview--btn-chunky { width: 2.125rem; height: 1.125rem; }
.choice-option-preview--btn-link {
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--tz-primary, #2c5282);
  border-radius: 0;
  height: 0.5rem;
}
.choice-option-preview--btn-inset {
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.choice-option-preview--layout {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 1.5rem;
  padding: 0.25rem 0;
}

.choice-option-preview--layout span {
  display: block;
  height: 3px;
  background: var(--tz-primary, #2c5282);
  border-radius: 1px;
}

.choice-option-preview--layout-compact span:nth-child(1) { width: 100%; }
.choice-option-preview--layout-compact span:nth-child(2) { width: 72%; }
.choice-option-preview--layout-compact span:nth-child(3) { width: 88%; }

.choice-option-preview--layout-balanced span:nth-child(1) { width: 100%; }
.choice-option-preview--layout-balanced span:nth-child(2) { width: 80%; }
.choice-option-preview--layout-balanced span:nth-child(3) { width: 92%; }

.choice-option-preview--layout-spacious span:nth-child(1) { width: 100%; }
.choice-option-preview--layout-spacious span:nth-child(2) { width: 68%; }
.choice-option-preview--layout-spacious span:nth-child(3) { width: 84%; }

.choice-option-preview--layout-tight span:nth-child(1) { width: 100%; }
.choice-option-preview--layout-tight span:nth-child(2) { width: 58%; }
.choice-option-preview--layout-tight span:nth-child(3) { width: 70%; }
.choice-option-preview--layout-tight span { height: 2px; gap: 2px; }

.choice-option-preview--layout-airy span:nth-child(2) { width: 62%; }
.choice-option-preview--layout-airy span:nth-child(3) { width: 78%; }
.choice-option-preview--layout-airy span { height: 4px; }

.choice-option-preview--layout-wide span:nth-child(1) { width: 110%; margin-left: -5%; }
.choice-option-preview--layout-wide span:nth-child(2) { width: 95%; }
.choice-option-preview--layout-wide span:nth-child(3) { width: 100%; }

.choice-option-preview--layout-editorial span:nth-child(1) { width: 72%; margin: 0 auto; }
.choice-option-preview--layout-editorial span:nth-child(2) { width: 64%; margin: 0 auto; }
.choice-option-preview--layout-editorial span:nth-child(3) { width: 68%; margin: 0 auto; }

.choice-option-preview--mode {
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  border: 2px solid var(--tz-border, #d8e0ea);
}

.choice-option-preview--mode-light {
  background: linear-gradient(135deg, var(--tz-white, #ffffff) 50%, var(--tz-primary-light, #e8f0f8) 50%);
}

.choice-option-preview--mode-dark {
  background: linear-gradient(135deg, var(--tz-text, #1a2b3c) 50%, var(--tz-primary, #2c5282) 50%);
  border-color: var(--tz-border, #d8e0ea);
}
.choice-option-preview--mode-auto {
  background: linear-gradient(135deg, #fff 0%, #fff 45%, #1a2b3c 55%, #1a2b3c 100%);
}
.choice-option-preview--mode-contrast {
  background: #fff;
  border-color: #0a1628;
  border-width: 3px;
}

.choice-option-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.choice-option-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--tz-text, #1a2b3c);
  line-height: 1.25;
}

.choice-option-hint {
  font-size: 0.6875rem;
  color: var(--tz-muted, #5c6b7a);
  line-height: 1.25;
}

.choice-option.is-active .menu-check { opacity: 1; }

.choice-option-preview--card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 1.625rem;
  padding: 0.3rem 0.25rem;
  background: var(--tz-white, #ffffff);
  border-radius: 3px;
}

.choice-option-preview--card > span:first-child {
  display: block;
  height: 0.5rem;
  background: var(--tz-primary-light, #e8f0f8);
  border-radius: 1px;
}

.choice-option-preview--card > span:last-child {
  display: block;
  height: 0.25rem;
  background: var(--tz-border, #d8e0ea);
  border-radius: 1px;
}

.choice-option-preview--card-shadow { box-shadow: 0 2px 6px color-mix(in srgb, var(--tz-primary, #2c5282) 18%, transparent); }
.choice-option-preview--card-bordered { border: 1.5px solid var(--tz-border, #d8e0ea); }
.choice-option-preview--card-flat { border: none; box-shadow: none; }
.choice-option-preview--card-elevated { box-shadow: 0 4px 10px color-mix(in srgb, var(--tz-primary, #2c5282) 22%, transparent); }
.choice-option-preview--card-accent-edge {
  border: 1px solid var(--tz-border, #d8e0ea);
  border-left: 3px solid var(--tz-primary, #2c5282);
}
.choice-option-preview--card-rounded { border-radius: 6px; }
.choice-option-preview--card-inset { box-shadow: inset 0 1px 4px color-mix(in srgb, var(--tz-primary, #2c5282) 15%, transparent); }
.choice-option-preview--card-frame { border: 2px solid var(--tz-border, #d8e0ea); box-shadow: 0 0 0 1px var(--tz-white, #ffffff); }
.choice-option-preview--card-gradient-top { border-top: 3px solid var(--tz-primary, #2c5282); }
.choice-option-preview--card-soft-fill { background: var(--tz-cream, #f4f5f7); }

.choice-option-preview--form {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 1.75rem;
  height: 1.375rem;
  padding: 0.25rem;
  border-radius: 3px;
  overflow: hidden;
}
.choice-option-preview--form > span {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.9);
}
.choice-option-preview--form > span:first-child {
  height: 0.35rem;
  margin-bottom: 1px;
  border-radius: 2px 2px 0 0;
}
.choice-option-preview--form-boxed {
  background: var(--tz-primary, #2c5282);
  border: 1px solid var(--tz-primary-dark, #1e4976);
}
.choice-option-preview--form-light {
  background: var(--tz-white, #ffffff);
  border: 1px solid var(--tz-border, #d8e0ea);
}
.choice-option-preview--form-light > span { background: var(--tz-primary-light, #e8f0f8); }
.choice-option-preview--form-elevated {
  background: var(--tz-white, #ffffff);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--tz-primary, #2c5282) 20%, transparent);
}
.choice-option-preview--form-elevated > span { background: var(--tz-primary-light, #e8f0f8); }
.choice-option-preview--form-bordered {
  background: var(--tz-cream, #f4f5f7);
  border: 2px solid var(--tz-primary, #2c5282);
}
.choice-option-preview--form-bordered > span { background: var(--tz-white, #ffffff); }
.choice-option-preview--form-minimal {
  background: transparent;
  border: 1px dashed var(--tz-border, #d8e0ea);
}
.choice-option-preview--form-minimal > span {
  background: transparent;
  border-bottom: 2px solid var(--tz-border, #d8e0ea);
  height: 1px;
  border-radius: 0;
}
.choice-option-preview--form-minimal > span:first-child {
  height: 0.25rem;
  border-bottom: none;
  background: var(--tz-primary, #2c5282);
}
.choice-option-preview--form-glass {
  background: color-mix(in srgb, var(--tz-white, #ffffff) 55%, transparent);
  border: 1px solid var(--tz-border, #d8e0ea);
}
.choice-option-preview--form-glass > span { background: color-mix(in srgb, var(--tz-white, #ffffff) 80%, transparent); }
.choice-option-preview--form-accent-header {
  background: var(--tz-white, #ffffff);
  border: 1px solid var(--tz-border, #d8e0ea);
  padding: 0;
}
.choice-option-preview--form-accent-header > span:first-child {
  height: 0.45rem;
  background: var(--tz-primary, #2c5282);
  margin: 0;
  border-radius: 2px 2px 0 0;
}
.choice-option-preview--form-accent-header > span:not(:first-child) {
  margin: 0 0.25rem;
  background: var(--tz-primary-light, #e8f0f8);
}
.choice-option-preview--form-inset {
  background: var(--tz-primary-light, #e8f0f8);
  border: 1px solid var(--tz-border, #d8e0ea);
}
.choice-option-preview--form-inset > span {
  background: color-mix(in srgb, var(--tz-white, #ffffff) 70%, var(--tz-primary-light, #e8f0f8));
  box-shadow: inset 0 1px 2px color-mix(in srgb, var(--tz-primary, #2c5282) 12%, transparent);
}
.choice-option-preview--form-compact {
  background: var(--tz-primary, #2c5282);
  gap: 2px;
  padding: 0.2rem;
}
.choice-option-preview--form-compact > span:first-child { height: 0.25rem; }
.choice-option-preview--form-compact > span:not(:first-child) { height: 1.5px; }
.choice-option-preview--form-deep {
  background: #071f33;
  border: 1px solid #0c2d4d;
}

.choice-option-preview--hero {
  position: relative;
  width: 1.75rem;
  height: 1.375rem;
  border-radius: 3px;
  overflow: hidden;
  background: var(--tz-primary-light, #e8f0f8);
}

.choice-option-preview--hero > span:first-child {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--tz-primary, #2c5282) 0%, transparent 100%);
  opacity: 0.55;
}

.choice-option-preview--hero > span:last-child {
  position: absolute;
  left: 0.25rem;
  bottom: 0.25rem;
  width: 0.75rem;
  height: 0.1875rem;
  background: #fff;
  border-radius: 1px;
}

.choice-option-preview--hero-cinematic > span:first-child {
  background: linear-gradient(180deg, transparent 0%, var(--tz-primary, #2c5282) 100%);
  opacity: 0.7;
}
.choice-option-preview--hero-cinematic > span:last-child {
  left: 50%;
  transform: translateX(-50%);
}

.choice-option-preview--hero-minimal > span:first-child { opacity: 0.3; }
.choice-option-preview--hero-bold > span:first-child { opacity: 0.85; }
.choice-option-preview--hero-bold > span:last-child { width: 1rem; height: 0.25rem; }
.choice-option-preview--hero-split-screen > span:last-child { bottom: 0.15rem; width: 1rem; }
.choice-option-preview--hero-editorial > span:first-child {
  background: linear-gradient(0deg, var(--tz-primary, #2c5282) 0%, transparent 100%);
}
.choice-option-preview--hero-gradient > span:first-child {
  background: linear-gradient(135deg, var(--tz-primary, #2c5282) 0%, #c45c26 100%);
  opacity: 0.65;
}
.choice-option-preview--hero-fullbleed > span:first-child { opacity: 0.2; }
.choice-option-preview--hero-boxed > span:last-child {
  width: 1rem;
  height: 0.625rem;
  background: color-mix(in srgb, var(--tz-primary, #2c5282) 50%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 2px;
}

.choice-option-preview--nav {
  display: flex;
  align-items: center;
  gap: 2px;
  width: 1.75rem;
  height: 0.75rem;
  padding: 0 0.2rem;
  background: var(--tz-primary, #2c5282);
  border-radius: 2px;
}

.choice-option-preview--nav > span {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 1px;
}

.choice-option-preview--nav-minimal > span { height: 1.5px; opacity: 0.7; }
.choice-option-preview--nav-underline > span:nth-child(2) {
  box-shadow: 0 2px 0 #fff;
}
.choice-option-preview--nav-pill > span:nth-child(2) {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  height: 4px;
}
.choice-option-preview--nav-glass {
  background: color-mix(in srgb, var(--tz-primary, #2c5282) 70%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.choice-option-preview--nav-accent-bar {
  border-bottom: 3px solid #c45c26;
}
.choice-option-preview--nav-bordered {
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.choice-option-preview--nav-compact { height: 0.5rem; }
.choice-option-preview--nav-spaced > span { height: 1.5px; opacity: 0.9; letter-spacing: 0.05em; }
.choice-option-preview--nav-deep { background: var(--tz-primary-dark, #1e4976); }

/* Nav layout previews */
.choice-option-preview--nav-top-bar > span:nth-child(2) { opacity: 1; }
.choice-option-preview--nav-centered {
  flex-direction: column;
  height: 1rem;
  gap: 1px;
  padding: 0.15rem 0.25rem;
}
.choice-option-preview--nav-centered > span:first-child {
  width: 0.5rem;
  height: 3px;
  flex: none;
  align-self: center;
  border-radius: 1px;
}
.choice-option-preview--nav-centered > span:not(:first-child) { height: 1.5px; opacity: 0.75; }
.choice-option-preview--nav-sticky-minimal { height: 0.5rem; }
.choice-option-preview--nav-sticky-minimal > span { opacity: 0.8; }
.choice-option-preview--nav-sidebar-left,
.choice-option-preview--nav-sidebar-right {
  width: 1.75rem;
  height: 1.375rem;
  padding: 0;
  gap: 0;
  background: var(--tz-cream, #f4f5f7);
  border: 1px solid var(--tz-border, #d8e0ea);
  overflow: hidden;
}
.choice-option-preview--nav-sidebar-left > span,
.choice-option-preview--nav-sidebar-right > span {
  display: block;
  flex: none;
  width: 0.45rem;
  height: 100%;
  background: var(--tz-primary, #2c5282);
  border-radius: 0;
}
.choice-option-preview--nav-sidebar-left > span:not(:first-child),
.choice-option-preview--nav-sidebar-right > span:not(:first-child) {
  width: auto;
  flex: 1;
  background: var(--tz-primary-light, #e8f0f8);
  height: 2px;
  margin: 0.2rem;
  align-self: center;
}
.choice-option-preview--nav-sidebar-right { flex-direction: row-reverse; }
.choice-option-preview--nav-hamburger {
  justify-content: flex-end;
  padding-right: 0.25rem;
}
.choice-option-preview--nav-hamburger > span:first-child,
.choice-option-preview--nav-hamburger > span:nth-child(2) { display: none; }
.choice-option-preview--nav-hamburger > span:last-child {
  width: 0.65rem;
  height: 0.65rem;
  flex: none;
  background:
    linear-gradient(#fff, #fff) 0 0 / 100% 2px no-repeat,
    linear-gradient(#fff, #fff) 0 50% / 100% 2px no-repeat,
    linear-gradient(#fff, #fff) 0 100% / 100% 2px no-repeat;
  border-radius: 0;
}

/* Hero layout previews */
.choice-option-preview--hero-left-text > span:last-child { left: 0.25rem; }
.choice-option-preview--hero-centered > span:last-child {
  left: 50%;
  transform: translateX(-50%);
  bottom: 0.35rem;
}
.choice-option-preview--hero-fullscreen {
  height: 1.625rem;
}
.choice-option-preview--hero-fullscreen > span:last-child {
  left: 50%;
  transform: translateX(-50%);
  bottom: 0.4rem;
}
.choice-option-preview--hero-split-screen {
  background: var(--tz-cream, #f4f5f7);
}
.choice-option-preview--hero-split-screen > span:first-child {
  width: 50%;
  background: var(--tz-primary, #2c5282);
  opacity: 1;
}
.choice-option-preview--hero-split-screen > span:last-child {
  left: auto;
  right: 0.2rem;
  bottom: 0.25rem;
  width: 0.55rem;
}

/* Services display previews */
.choice-option-preview--services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  width: 1.75rem;
  height: 1.25rem;
  padding: 0.2rem;
  background: var(--tz-cream, #f4f5f7);
}
.choice-option-preview--services > span {
  display: block;
  background: var(--tz-primary-light, #e8f0f8);
  border: 1px solid var(--tz-border, #d8e0ea);
  border-radius: 1px;
}
.choice-option-preview--services-grid-4 > span { display: block; }
.choice-option-preview--services-grid-3 > span:last-child { display: none; }
.choice-option-preview--services-alternating {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.choice-option-preview--services-alternating > span {
  height: 0.3rem;
  width: 100%;
}
.choice-option-preview--services-alternating > span:nth-child(odd) {
  background: linear-gradient(90deg, var(--tz-primary, #2c5282) 45%, var(--tz-primary-light, #e8f0f8) 45%);
}
.choice-option-preview--services-carousel {
  display: flex;
  gap: 2px;
  overflow: hidden;
}
.choice-option-preview--services-carousel > span {
  flex: 0 0 0.55rem;
  height: 1rem;
}
.choice-option-preview--services-timeline {
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  padding-left: 0.35rem;
}
.choice-option-preview--services-timeline::before {
  content: '';
  position: absolute;
  left: 0.1rem;
  top: 0.1rem;
  bottom: 0.1rem;
  width: 1px;
  background: var(--tz-border, #d8e0ea);
}
.choice-option-preview--services-timeline > span {
  height: 0.25rem;
  width: 100%;
  position: relative;
}
.choice-option-preview--services-timeline > span::before {
  content: '';
  position: absolute;
  left: -0.3rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--tz-button, var(--tz-accent, #2563eb));
}

/* Layout preset previews */
.choice-option-preview--preset {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 1.75rem;
  height: 1.375rem;
  padding: 0.2rem;
  background: var(--tz-cream, #f4f5f7);
  border: 1px solid var(--tz-border, #d8e0ea);
}
.choice-option-preview--preset > span {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: var(--tz-primary-light, #e8f0f8);
}
.choice-option-preview--preset > span:first-child {
  height: 0.35rem;
  background: var(--tz-primary, #2c5282);
  opacity: 0.85;
}
.choice-option-preview--preset-classic-corporate > span:nth-child(2) { width: 70%; }
.choice-option-preview--preset-modern-saas > span:first-child { border-radius: 2px; }
.choice-option-preview--preset-modern-saas > span:nth-child(2),
.choice-option-preview--preset-modern-saas > span:nth-child(3) {
  display: inline-block;
  width: 45%;
  margin-right: 4%;
}
.choice-option-preview--preset-warm-approachable > span:first-child { opacity: 0.55; }
.choice-option-preview--preset-minimal-elegant > span { height: 1.5px; margin: 1px 0.5rem; }
.choice-option-preview--preset-bold-editorial > span:first-child { height: 0.5rem; }
.choice-option-preview--preset-dashboard {
  flex-direction: row;
  gap: 1px;
}
.choice-option-preview--preset-dashboard > span:first-child {
  width: 0.35rem;
  height: 100%;
  flex-shrink: 0;
}
.choice-option-preview--preset-dashboard > span:not(:first-child) { flex: 1; height: 2px; }
.choice-option-preview--preset-story-first > span { height: 3px; }

.section-subheading {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tz-muted, #5c6b7a);
  margin: 0.25rem 0 0;
}

.color-pickers {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.color-picker-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.color-picker-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--tz-text, #1a2b3c);
}

.color-picker-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  background: var(--tz-cream, #f4f5f7);
  border: 1px solid var(--tz-border, #d8e0ea);
  border-radius: var(--menu-radius);
}

.color-picker-control input[type="color"] {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  border-radius: var(--menu-radius);
  background: none;
  cursor: pointer;
}

.color-picker-control input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }

.color-picker-control input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: calc(var(--menu-radius) - 2px);
}

.color-picker-value {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--tz-muted, #5c6b7a);
  font-family: ui-monospace, monospace;
  text-transform: uppercase;
}

.font-option,
.theme-option {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  background: var(--tz-white, #ffffff);
  border: 2px solid var(--tz-border, #d8e0ea);
  border-radius: var(--menu-radius);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.font-option:hover,
.theme-option:hover {
  border-color: var(--tz-primary, #2c5282);
  background: var(--tz-primary-light, #e8f0f8);
}

.font-option.is-active,
.theme-option.is-active {
  border-color: var(--tz-primary, #2c5282);
  background: var(--tz-primary-light, #e8f0f8);
  box-shadow: var(--tz-shadow, 0 4px 16px rgba(0,0,0,0.1));
}

.font-option-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  font-family: var(--menu-font-display);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1;
  color: var(--tz-primary, #2c5282);
  background: var(--tz-cream, #f4f5f7);
  border-radius: var(--menu-radius);
}

.font-option-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.font-option-heading {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--tz-text, #1a2b3c);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.font-option-body {
  font-size: 0.6875rem;
  color: var(--tz-muted, #5c6b7a);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-swatch {
  display: flex;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  width: 2.5rem;
  height: 2.5rem;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.theme-swatch span { flex: 1; height: 100%; }

.theme-option-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.theme-option-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--tz-text, #1a2b3c);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-option-preview {
  display: flex;
  height: 0.375rem;
  border-radius: 999px;
  overflow: hidden;
}

.theme-option-preview span { flex: 1; }

.menu-check {
  flex-shrink: 0;
  color: var(--tz-primary, #2c5282);
  opacity: 0;
  transition: opacity 0.2s;
}

.theme-option.is-active .menu-check,
.font-option.is-active .menu-check { opacity: 1; }

.theme-tab {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 10001;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--menu-brand-accent);
  color: #fff;
  border: none;
  border-radius: 0 var(--menu-radius) var(--menu-radius) 0;
  padding: 0.875rem 1rem 0.875rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--menu-brand-accent) 28%, transparent);
  transition: left 0.35s var(--menu-ease), background 0.25s var(--menu-ease);
}

.theme-tab:hover { background: var(--menu-brand-accent-hover); }

.theme-tab.is-open { left: var(--theme-menu-width); }

.theme-tab-icon { flex-shrink: 0; }

.theme-tab-icon--close { display: none; }

.theme-tab.is-open .theme-tab-icon--open { display: none; }

.theme-tab.is-open .theme-tab-icon--close { display: block; }

.theme-tab-label { white-space: nowrap; }

.theme-tab.is-hinted {
  animation: tz-hint-pulse 2.4s ease-in-out infinite;
}

@keyframes tz-hint-pulse {
  0%, 100% {
    box-shadow: 0 8px 24px color-mix(in srgb, var(--menu-brand-accent) 28%, transparent);
  }
  50% {
    box-shadow:
      0 8px 24px color-mix(in srgb, var(--menu-brand-accent) 28%, transparent),
      0 0 0 4px color-mix(in srgb, var(--menu-brand-accent) 32%, transparent);
  }
}

.theme-customize-hint {
  position: fixed;
  z-index: 10000;
  left: 9.5rem;
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  max-width: 13.5rem;
  padding: 0.75rem 0.875rem;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--tz-border, #d8e0ea);
  border-radius: var(--menu-radius);
  box-shadow: 0 10px 32px color-mix(in srgb, var(--tz-primary, #2c5282) 16%, transparent);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.45s var(--menu-ease),
    visibility 0.45s var(--menu-ease),
    transform 0.45s var(--menu-ease);
}

.theme-customize-hint::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: rgba(255, 255, 255, 0.97);
  filter: drop-shadow(-1px 0 0 var(--tz-border, #d8e0ea));
}

.theme-customize-hint.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
  pointer-events: auto;
  z-index: 10002;
}

.theme-customize-hint-text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--tz-text, #1a2b3c);
  font-weight: 500;
}

.theme-customize-hint-dismiss {
  margin-top: 0.5rem;
  padding: 0;
  border: none;
  background: none;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--tz-primary, #2c5282);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.theme-customize-hint-dismiss:hover {
  color: var(--tz-primary-dark, #1e4976);
}

.theme-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--menu-ease), visibility 0.3s var(--menu-ease);
  z-index: 9998;
}

.theme-menu-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.tz-menu-open,
body.tz-mobile-nav-open {
  overflow: hidden;
}

@media (max-width: 767px) {
  .container { padding-left: 1rem; padding-right: 1rem; }

  .hero-section,
  .hero-content {
    min-height: 70vh;
    min-height: 70dvh;
  }

  .hero-content {
    padding-bottom: clamp(5rem, 14vw, 8rem);
    align-items: flex-end;
  }

  .hero-floats,
  [data-layout-preset="warm-approachable"] .hero-floats,
  [data-layout-preset="story-first"] .hero-floats {
    margin-top: -3rem;
    padding-bottom: 2.5rem;
  }

  .hero-subtitle { font-size: 1rem; }

  .hero-title { max-width: none; }

  [data-hero-treatment="bold"] .hero-title,
  [data-layout-preset="bold-editorial"] .hero-title {
    font-size: clamp(2.25rem, 9vw, 3rem);
    max-width: none;
  }

  [data-hero-layout="split-screen"] .hero-content {
    align-items: center;
    padding-bottom: clamp(4rem, 12vw, 6rem);
  }

  .page-hero { min-height: 16rem; }

  [data-hero-treatment="cinematic"] .page-hero { min-height: 18rem; }

  [data-hero-treatment="bold"] .page-hero h1 {
    font-size: clamp(1.75rem, 7vw, 2.5rem);
  }

  .float-card-body { padding: 1.25rem; }

  .accent-panel { padding: 1.5rem; }

  .consult-form-box { padding: 1.75rem 1.25rem; }

  [data-form-style="accent-header"] .consult-form-box h2 {
    padding: 1rem 1.25rem;
  }

  [data-form-style="accent-header"] .consult-form-box form {
    padding: 1.25rem 1.25rem 1.75rem;
  }

  .form-field input,
  .form-field textarea { font-size: 1rem; }

  .stat-value { font-size: 1.75rem; }

  .stat-label { font-size: 0.75rem; }

  #menu-btn {
    min-width: 2.75rem;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-menu .nav-link,
  .mobile-menu a.block {
    min-height: 2.75rem;
    display: flex;
    align-items: center;
  }

  .header-phone-link {
    min-width: 2.75rem;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
    transition: color 0.2s;
  }

  .header-phone-link:hover { color: #fff; }

  .header-contact-compact {
    font-size: 0.6875rem;
    padding: 0.5rem 0.75rem;
  }

  [data-services-display="carousel"] .services-grid::after {
    content: 'Swipe to explore →';
    display: block;
    flex: 0 0 100%;
    text-align: center;
    font-size: 0.75rem;
    color: var(--tz-muted);
    padding-top: 0.5rem;
  }

  #theme-switcher { --theme-menu-width: min(20rem, 100vw); }

  .theme-menu-close {
    width: 2.75rem;
    height: 2.75rem;
  }

  .theme-menu-brand {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .theme-tab {
    top: auto;
    bottom: max(1rem, env(safe-area-inset-bottom));
    left: auto;
    right: max(0.75rem, env(safe-area-inset-right));
    transform: none;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    gap: 0;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--menu-brand-accent) 32%, transparent);
    transition: background 0.25s var(--menu-ease), box-shadow 0.25s var(--menu-ease);
  }

  .theme-tab.is-open {
    left: auto;
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .theme-tab-label { display: none; }

  .theme-tab.is-hinted {
    animation: tz-hint-pulse-mobile 2.4s ease-in-out infinite;
  }

  @keyframes tz-hint-pulse-mobile {
    0%, 100% {
      box-shadow: 0 4px 14px color-mix(in srgb, var(--menu-brand-accent) 32%, transparent);
    }
    50% {
      box-shadow:
        0 4px 14px color-mix(in srgb, var(--menu-brand-accent) 32%, transparent),
        0 0 0 4px color-mix(in srgb, var(--menu-brand-accent) 32%, transparent);
    }
  }

  .theme-customize-hint {
    left: auto;
    right: max(0.75rem, env(safe-area-inset-right));
    top: auto;
    bottom: calc(3.75rem + env(safe-area-inset-bottom));
    transform: translateY(6px);
    max-width: 11.5rem;
    text-align: center;
  }

  .theme-customize-hint::before {
    left: auto;
    right: 1rem;
    top: auto;
    bottom: -6px;
    transform: none;
    border: 6px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.97);
    border-right-color: transparent;
    filter: drop-shadow(0 1px 0 var(--tz-border, #d8e0ea));
  }

  .theme-customize-hint.is-visible {
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  #theme-switcher { --theme-menu-width: min(20rem, 100vw); }
}

@media (prefers-reduced-motion: reduce) {
  .theme-menu,
  .theme-tab,
  .theme-customize-hint,
  .theme-menu-backdrop {
    transition: none !important;
  }

  .theme-tab.is-hinted {
    animation: none;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--menu-brand-accent) 28%, transparent);
  }
}
