:root {
  color-scheme: light;
  --bg-gradient: radial-gradient(circle at top left, #f6f1ff 0%, #ebf6ff 45%, #f7fafc 100%);
  --surface: rgba(255, 255, 255, 0.92);
  --surface-muted: rgba(255, 255, 255, 0.7);
  --text-primary: #0f172a;
  --text-primary-mix-card: #cccccc;
  --text-secondary: #5f6b7d;
  --border-soft: rgba(255, 255, 255, 0.45);
  --shadow-soft: 0 24px 60px -35px rgba(15, 23, 42, 0.6);
  --accent: #f97316;
  --accent-strong: #ea580c;
  --accent-muted: rgba(249, 115, 22, 0.15);
  --neutral: rgba(15, 23, 42, 0.08);
  --chip-bg: rgba(15, 23, 42, 0.08);
  --chip-bg-active: #0f172a;
  --chip-text-active: #ffffff;
  --chip-required-bg: linear-gradient(140deg, rgba(59, 130, 246, 0.95), rgba(37, 99, 235, 0.85));
  --chip-required-border: rgba(147, 197, 253, 0.9);
  --chip-required-text: #f8fafc;
  --chip-include-bg: linear-gradient(140deg, rgba(34, 197, 94, 0.95), rgba(22, 163, 74, 0.85));
  --chip-include-border: rgba(134, 239, 172, 0.85);
  --chip-include-text: #f0fdf4;
  --chip-optional-bg: linear-gradient(140deg, rgba(251, 191, 36, 0.95), rgba(245, 158, 11, 0.85));
  --chip-optional-border: rgba(253, 224, 71, 0.85);
  --chip-optional-text: #0f172a;
  --required: #2563eb;
  --required-soft: rgba(59, 130, 246, 0.16);
  --include: #16a34a;
  --include-soft: rgba(34, 197, 94, 0.18);
  --optional: #f59e0b;
  --optional-soft: rgba(245, 158, 11, 0.18);
  --success: #16a34a;
  --warning: #facc15;
  --danger: #ef4444;
  --ghost-track: rgba(15, 23, 42, 0.08);
  --slider-green: #16a34a;
  --slider-yellow: #facc15;
  --slider-red: #ef4444;
  --slider-green-muted: rgba(22, 163, 74, 0.64);
  --slider-yellow-muted: rgba(250, 204, 21, 0.64);
  --slider-red-muted: rgba(250, 68, 68, 0.64);
  --slider-neutral: rgba(15, 23, 42, 0.18);
  --metric-bar: linear-gradient(90deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.22));
  --metric-highlight: rgba(249, 115, 22, 0.25);
  --tint-subtle: rgba(15, 23, 42, 0.04);
  --tint-soft: rgba(15, 23, 42, 0.08);
  --tint-medium: rgba(15, 23, 42, 0.12);
  --tint-strong: rgba(15, 23, 42, 0.14);
  --tint-border: rgba(15, 23, 42, 0.05);
  --tint-border-strong: rgba(15, 23, 42, 0.08);
  --form-field-surface: #fff;
  --form-field-border: rgba(15, 23, 42, 0.12);
  --form-field-text: var(--text-primary);
  --chip-surface: rgba(15, 23, 42, 0.08);
  --chip-surface-hover: rgba(15, 23, 42, 0.14);
  --toggle-border-strong: rgba(15, 23, 42, 0.4);
  --mix-panel-bg: rgba(13, 20, 31, 0.9);
  --mix-panel-text: #f8fafc;
  --mix-panel-subtle-text: rgba(248, 250, 252, 0.6);
  --mix-panel-border: rgba(15, 23, 42, 0.32);
  --mix-panel-layer: rgba(15, 23, 42, 0.45);
  --mix-panel-layer-muted: rgba(15, 23, 42, 0.3);
  --mix-panel-cap-bg: rgba(15, 23, 42, 0.5);
  --mix-panel-track: rgba(248, 250, 252, 0.16);
  --results-card-bg: rgba(15, 23, 42, 0.8);
  --results-card-border: rgba(248, 250, 252, 0.08);
  --results-card-text: #f8fafc;
  --results-card-subtle: rgba(248, 250, 252, 0.7);
  --results-card-title: #fff;
  --results-toggle-bg: rgba(15, 23, 42, 0.6);
  --results-toggle-border: rgba(248, 250, 252, 0.18);
  --results-toggle-hover-bg: rgba(248, 250, 252, 0.16);
  --results-toggle-hover-border: rgba(248, 250, 252, 0.36);
  --slider-track-gradient: linear-gradient(90deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.18));
  --select-arrow-icon: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2014%2010'%3E%3Cpolyline%20fill='none'%20stroke='%230f172a'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'%20points='2%203%207%207%2012%203'/%3E%3C/svg%3E");
  font-family: "Inter", "SF Pro Display", "Segoe UI", system-ui, sans-serif;
}

body[data-theme='dark'] {
  color-scheme: dark;
  --bg-gradient: radial-gradient(circle at top left, #0b1220 0%, #0a172a 45%, #091321 100%);
  --surface: rgba(15, 23, 42, 0.78);
  --surface-muted: rgba(15, 23, 42, 0.62);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --border-soft: rgba(94, 106, 134, 0.48);
  --shadow-soft: 0 28px 70px -40px rgba(2, 6, 23, 0.85);
  --accent: #fb923c;
  --accent-strong: #f97316;
  --accent-muted: rgba(251, 146, 60, 0.15);
  --neutral: rgba(226, 232, 240, 0.14);
  --chip-bg: rgba(148, 163, 184, 0.16);
  --chip-bg-active: #f8fafc;
  --chip-text-active: #0f172a;
  --chip-required-bg: linear-gradient(140deg, rgba(96, 165, 250, 0.95), rgba(59, 130, 246, 0.85));
  --chip-required-border: rgba(147, 197, 253, 0.75);
  --chip-required-text: #e0f2fe;
  --chip-include-bg: linear-gradient(140deg, rgba(34, 197, 94, 0.95), rgba(21, 128, 61, 0.85));
  --chip-include-border: rgba(134, 239, 172, 0.75);
  --chip-include-text: #022c22;
  --chip-optional-bg: linear-gradient(140deg, rgba(251, 191, 36, 0.95), rgba(217, 119, 6, 0.85));
  --chip-optional-border: rgba(253, 224, 71, 0.75);
  --chip-optional-text: #0b1120;
  --success: #22c55e;
  --warning: #facc15;
  --danger: #f87171;
  --required: #60a5fa;
  --required-soft: rgba(96, 165, 250, 0.22);
  --include: #34d399;
  --include-soft: rgba(34, 197, 94, 0.24);
  --optional: #fbbf24;
  --optional-soft: rgba(245, 158, 11, 0.25);
  --ghost-track: rgba(148, 163, 184, 0.24);
  --slider-green-muted: rgba(34, 197, 94, 0.64);
  --slider-yellow-muted: rgba(250, 204, 21, 0.64);
  --slider-red-muted: rgba(248, 113, 113, 0.64);
  --slider-neutral: rgba(148, 163, 184, 0.4);
  --metric-bar: linear-gradient(90deg, rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0.32));
  --metric-highlight: rgba(251, 146, 60, 0.38);
  --tint-subtle: rgba(148, 163, 184, 0.08);
  --tint-soft: rgba(148, 163, 184, 0.12);
  --tint-medium: rgba(148, 163, 184, 0.18);
  --tint-strong: rgba(148, 163, 184, 0.24);
  --tint-border: rgba(15, 23, 42, 0.6);
  --tint-border-strong: rgba(148, 163, 184, 0.32);
  --form-field-surface: rgba(9, 14, 26, 0.9);
  --form-field-border: rgba(148, 163, 184, 0.36);
  --form-field-text: #e2e8f0;
  --chip-surface: rgba(148, 163, 184, 0.14);
  --chip-surface-hover: rgba(148, 163, 184, 0.25);
  --toggle-border-strong: rgba(148, 163, 184, 0.55);
  --mix-panel-bg: rgba(5, 10, 19, 0.92);
  --mix-panel-text: #e2e8f0;
  --mix-panel-subtle-text: rgba(226, 232, 240, 0.68);
  --mix-panel-border: rgba(51, 65, 85, 0.55);
  --mix-panel-layer: rgba(148, 163, 184, 0.14);
  --mix-panel-layer-muted: rgba(148, 163, 184, 0.12);
  --mix-panel-cap-bg: rgba(15, 23, 42, 0.75);
  --mix-panel-track: rgba(226, 232, 240, 0.22);
  --results-card-bg: rgba(15, 23, 42, 0.7);
  --results-card-border: rgba(148, 163, 184, 0.38);
  --results-card-text: #e2e8f0;
  --results-card-subtle: rgba(226, 232, 240, 0.68);
  --results-card-title: #f8fafc;
  --results-toggle-bg: rgba(15, 23, 42, 0.55);
  --results-toggle-border: rgba(148, 163, 184, 0.35);
  --results-toggle-hover-bg: rgba(148, 163, 184, 0.25);
  --results-toggle-hover-border: rgba(226, 232, 240, 0.48);
  --slider-track-gradient: linear-gradient(90deg, rgba(148, 163, 184, 0.14), rgba(148, 163, 184, 0.28));
  --select-arrow-icon: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2014%2010'%3E%3Cpolyline%20fill='none'%20stroke='%23e2e8f0'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'%20points='2%203%207%207%2012%203'/%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-primary);
  background: var(--bg-gradient);
  background-attachment: fixed;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: url("bg.jpg") center/cover no-repeat;
  mix-blend-mode: multiply;
  opacity: 0.35;
  z-index: -1;
  filter: blur(12px);
}

body[data-theme='dark']::after {
  mix-blend-mode: screen;
  opacity: 0.18;
}

body.legacy-mode {
  background: #f1f5f9;
}

.page {
  max-width: max(70vw, 1440px);
  margin: 0 auto;
  padding: 48px clamp(16px, 4vw, 48px) 64px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

@media (max-width: 960px) {
  .page {
    max-width: 100%;
  }
}

.card {
  background: var(--surface);
  border-radius: 28px;
  padding: clamp(20px, 2vw, 28px);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.lab-header {
  position: relative;
  overflow: hidden;
  padding: clamp(36px, 6vw, 68px) clamp(32px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 4vw, 52px);
  color: var(--text-primary, var(--text));
  isolation: isolate;
}

.lab-header::after {
  content: "";
  position: absolute;
  inset: -14% -18% -36% -18%;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.55), transparent 52%),
    radial-gradient(circle at 78% 26%, rgba(253, 230, 138, 0.45), transparent 58%),
    radial-gradient(circle at 42% 86%, rgba(249, 115, 22, 0.32), transparent 70%);
  opacity: 0.25;
  pointer-events: none;
  mix-blend-mode: screen;
  filter: blur(32px);
  transform-origin: center;
  animation: brightShimmer 22s ease-in-out infinite alternate;
  z-index: 0;
}

body[data-theme='dark'] .lab-header::after {
  opacity: 0.18;
  mix-blend-mode: color-dodge;
  animation-duration: 28s;
  filter: blur(28px);
}

.lab-header__liquid {
  position: absolute;
  inset: -8%;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 215, 94, 0.4), transparent 52%),
    radial-gradient(circle at 78% 25%, rgba(241, 149, 41, 0.38), transparent 58%),
    radial-gradient(circle at 42% 80%, rgba(245, 158, 11, 0.25), transparent 70%);
  filter: saturate(1.15);
  animation: maltGlow 24s ease-in-out infinite alternate;
}

body[data-theme='bright'] .lab-header__liquid {
  animation-duration: 20s;
}

body[data-theme='dark'] .lab-header__liquid {
  background:
    radial-gradient(circle at 14% 16%, rgba(253, 186, 116, 0.38), transparent 55%),
    radial-gradient(circle at 70% 22%, rgba(249, 115, 22, 0.32), transparent 62%),
    radial-gradient(circle at 48% 78%, rgba(234, 179, 8, 0.18), transparent 75%),
    radial-gradient(circle at 20% 85%, rgba(14, 116, 144, 0.1), transparent 75%);
  filter: saturate(1.05);
  animation-duration: 30s;
}


.lab-header__bubbles {
  position: absolute;
  inset: -6% -10% -14%;
  pointer-events: none;
}

.lab-header__bubble-field {
  position: absolute;
  inset: -12% -12% -20%;
  overflow: hidden;
  mix-blend-mode: screen;
}

.lab-header__bubble-field--back {
  opacity: 0.55;
}

.lab-header__bubble-field--front {
  opacity: 0.8;
}

body[data-theme='dark'] .lab-header__bubble-field--back {
  opacity: 0.4;
  mix-blend-mode: color-dodge;
}

body[data-theme='dark'] .lab-header__bubble-field--front {
  opacity: 0.72;
  mix-blend-mode: screen;
}

.lab-header__bubble {
  --x: 50%;
  --size: 46px;
  --duration: 20s;
  --delay: 0s;
  --drift: 0;
  --travel: 90;
  --scale: 1;
  --blur: 0px;
  --opacity: 0.6;
  position: absolute;
  bottom: -16%;
  left: var(--x);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.12) 64%, transparent 100%),
    radial-gradient(circle at 72% 68%, rgba(255, 255, 255, 0.22), transparent 70%);
  box-shadow: inset -4px -8px 18px rgba(255, 255, 255, 0.35);
  filter: blur(var(--blur));
  opacity: 0;
  transform: translate3d(-50%, 0, 0) scale(calc(var(--scale) * 0.75));
  animation: bubbleRise var(--duration) linear infinite;
  animation-delay: var(--delay);
}

body[data-theme='dark'] .lab-header__bubble {
  background:
    radial-gradient(circle at 30% 24%, rgba(226, 232, 240, 0.9), rgba(148, 163, 184, 0.12) 60%, transparent 100%),
    radial-gradient(circle at 68% 74%, rgba(226, 232, 240, 0.15), transparent 72%);
  box-shadow: inset -4px -6px 16px rgba(226, 232, 240, 0.28);
}

.lab-header__content {
  position: relative;
  z-index: 1;
  display: grid;
  /*gap: clamp(18px, 3vw, 28px);*/
}

.lab-header__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: clamp(24px, 4vw, 56px);
}

.lab-header__branding {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2vw, 18px);
}

.lab-header__title {
  margin: 0;
  font-size: clamp(2.8rem, 3.6vw, 4.2rem);
  letter-spacing: -0.02em;
  text-shadow: 0 16px 38px rgba(15, 23, 42, 0.18);
}

.lab-header__controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: clamp(14px, 2vw, 24px);
  flex-wrap: wrap;
}

.lab-header__support {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.language-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: clamp(10px, 1.8vw, 18px);
}

.language-switcher::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.45), rgba(249, 115, 22, 0.22));
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.language-switcher:focus-within::after {
  opacity: 1;
}


.language-switcher__flags {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 16px);
}

.language-flag {
  position: relative;
  width: clamp(40px, 4.5vw, 52px);
  height: clamp(40px, 4.5vw, 52px);
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.95), rgba(241, 245, 249, 0.85));
  display: grid;
  place-items: center;
  cursor: pointer;
  color: inherit;
  overflow: hidden;
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.45s ease, border-color 0.45s ease;
}



.language-flag::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(125deg, rgba(253, 230, 138, 0.38), rgba(249, 115, 22, 0.32));
  opacity: 0;
  z-index: -1;
  pointer-events: none;
}

.language-flag::after {
  content: '';
  position: absolute;
  inset: -40%;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.42), rgba(253, 230, 138, 0.04));
  transform: translateX(-100%) rotate(10deg);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s ease;
}

.language-flag:hover::before,
.language-flag:focus-visible::before {
  opacity: 1;
}

.language-flag:hover::after,
.language-flag:focus-visible::after {
  transform: translateX(90%) rotate(10deg);
  opacity: 0.45;
}

.language-flag:hover,
.language-flag:focus-visible {
  box-shadow: 0 16px 28px -22px rgba(249, 115, 22, 0.38);
  border-color: rgba(249, 115, 22, 0.28);
  transform: translateY(-2px) scale(1.015);
}

.language-flag:focus-visible {
  outline: 3px solid rgba(249, 115, 22, 0.35);
  outline-offset: 4px;
}

.language-flag--active::before {
  opacity: 1;
}

body[data-theme='dark'] .language-flag {
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.8));
  border-color: rgba(253, 230, 138, 0.32);
  box-shadow: inset 0 1px 2px rgba(253, 230, 138, 0.2);
}

body[data-theme='dark'] .language-flag::before {
  background: linear-gradient(125deg, rgba(253, 230, 138, 0.42), rgba(249, 115, 22, 0.3));
}

.language-flag__icon {
  width: 72%;
  height: 72%;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 6px 10px rgba(15, 23, 42, 0.18));
}

.language-flag__svg {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: visible;
}

.language-flag__emoji-fallback {
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
}

.language-flag__label {
  display: none;
}

.language-switcher input[type='hidden'] {
  display: none;
}

.lab-header__grid {
  display: grid;
  grid-template-columns: minmax(280px, 3fr) minmax(220px, 1fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: stretch;
}

.lab-header__story {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2vw, 18px);
}

.lab-header__description {
  margin: 0;
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  line-height: 1.75;
  color: var(--text-secondary);
}

.lab-header__disclaimer {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: clamp(0.85rem, 1.6vw, 0.95rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(99, 63, 17, 0.78);
}

body[data-theme='dark'] .lab-header__disclaimer {
  color: rgba(252, 211, 77, 0.78);
}

.lab-header__cta-panel {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.lab-header__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 2.8vw, 26px) clamp(22px, 3.2vw, 36px);
  border-radius: 28px;
  backdrop-filter: blur(14px);
  background: linear-gradient(135deg, rgba(248, 191, 72, 0.22), rgba(139, 92, 36, 0.28));
  border: 1px solid rgba(139, 92, 36, 0.35);
  box-shadow: 0 24px 48px -28px rgba(124, 58, 18, 0.55);
  min-width: min(320px, 100%);
}

body[data-theme='dark'] .lab-header__cta {
  background: linear-gradient(135deg, rgba(253, 230, 138, 0.18), rgba(30, 41, 59, 0.68));
  border-color: rgba(253, 230, 138, 0.32);
  box-shadow: 0 30px 65px -32px rgba(2, 6, 23, 0.85);
}

.support-buttons {
  display: inline-flex;
  align-items: center;
}

.support-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 14px 22px 14px 18px;
  border-radius: 999px;
  text-decoration: none;
  color: #1c1917;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, rgba(253, 230, 138, 0.85), rgba(249, 115, 22, 0.92));
  box-shadow: 0 18px 40px -22px rgba(124, 58, 18, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  overflow: hidden;
}

.support-cta__shine {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 60%),
    radial-gradient(circle at 70% 60%, rgba(255, 247, 237, 0.4), rgba(255, 247, 237, 0) 65%);
  opacity: 0.8;
  transition: transform 0.6s ease, opacity 0.6s ease;
}

.support-cta__icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 3px 6px rgba(124, 58, 18, 0.35));
  transition: transform 0.3s ease;
}

.support-cta__content {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.support-cta__title {
  font-size: 1rem;
}

.support-cta__subtitle {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(28, 25, 23, 0.78);
}

.support-cta:focus-visible {
  outline: 3px solid rgba(249, 115, 22, 0.45);
  outline-offset: 3px;
}

.support-cta:hover .support-cta__shine,
.support-cta:focus-visible .support-cta__shine {
  transform: scale(1.08) translate3d(4px, -4px, 0);
  opacity: 1;
}

.support-cta:hover .support-cta__icon,
.support-cta:focus-visible .support-cta__icon {
  transform: translateY(-2px);
}

body[data-theme='dark'] .support-cta {
  color: #f8fafc;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.92));
  box-shadow: 0 20px 45px -24px rgba(2, 6, 23, 0.75), inset 0 1px 0 rgba(148, 163, 184, 0.3);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

body[data-theme='dark'] .support-cta__subtitle {
  color: rgba(226, 232, 240, 0.7);
}

body[data-theme='dark'] .support-cta__shine {
  background: radial-gradient(circle at 35% 30%, rgba(148, 163, 184, 0.32), rgba(148, 163, 184, 0) 60%),
    radial-gradient(circle at 70% 60%, rgba(30, 64, 175, 0.35), rgba(30, 64, 175, 0) 65%);
  opacity: 0.55;
}

.support-buttons:hover .support-cta {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.05);
}

.support-buttons iframe,
.support-buttons button,
.support-buttons a {
  transform-origin: center;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.support-buttons:hover iframe,
.support-buttons:hover button,
.support-buttons:hover a {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.08);
}

@keyframes maltGlow {
  0% {
    transform: scale(1) rotate(0deg);
    background-position: 0% 0%, 75% 25%, 50% 80%;
  }
  50% {
    transform: scale(1.05) rotate(1deg);
    background-position: 12% 10%, 65% 20%, 55% 70%;
  }
  100% {
    transform: scale(1) rotate(-1deg);
    background-position: 6% 18%, 80% 32%, 45% 85%;
  }
}

@keyframes brightShimmer {
  0% {
    transform: rotate(-2deg) scale(1.02);
    opacity: 0.22;
    filter: blur(28px);
  }
  48% {
    transform: rotate(1deg) scale(1.06);
    opacity: 0.32;
    filter: blur(30px);
  }
  100% {
    transform: rotate(-0.5deg) scale(1.04);
    opacity: 0.24;
    filter: blur(33px);
  }
}

@keyframes bubbleRise {
  0% {
    transform: translate3d(-50%, 0, 0) scale(calc(var(--scale) * 0.72));
    opacity: 0;
  }
  12% {
    opacity: var(--opacity);
  }
  55% {
    transform: translate3d(calc(-50% + var(--drift) * 0.35px), calc(var(--travel) * -0.56vh), 0)
      scale(calc(var(--scale) * 1.04));
    opacity: var(--opacity);
  }
  100% {
    transform: translate3d(calc(-50% + var(--drift) * 1px), calc(var(--travel) * -1.08vh), 0)
      scale(calc(var(--scale) * 0.6));
    opacity: 0;
  }
}

@media (max-width: 1100px) {
  .lab-header__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .lab-header__cta-panel {
    justify-content: flex-start;
  }
}

@media (max-width: 960px) {
  .lab-header {
    padding: clamp(28px, 8vw, 48px);
  }

  .lab-header__top {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(20px, 6vw, 32px);
  }

  .lab-header__controls {
    justify-content: flex-start;
    flex-direction: row;
    align-items: flex-start;
  }

  .lab-header__support {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .lab-header__title {
    font-size: clamp(2.2rem, 9vw, 2.8rem);
  }

  .language-switcher {
    justify-content: flex-start;
  }

  .language-switcher__flags {
    flex: 1;
    justify-content: space-between;
  }

  .lab-header__cta {
    min-width: 0;
    width: 100%;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.legacy-mode-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--chip-surface);
  cursor: pointer;
  transition: background 0.2s ease;
}

.legacy-mode-toggle:hover {
  background: var(--chip-surface-hover);
}

.legacy-mode-toggle input {
  accent-color: var(--accent);
}

.theme-switcher {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-switcher__label {
  display: flex;
  align-items: center;
  gap: 0.45em;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.theme-toggle {
  --toggle-track-off: linear-gradient(135deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.2));
  --toggle-track-on: linear-gradient(135deg, rgba(249, 115, 22, 0.85), rgba(234, 88, 12, 0.95));
  --toggle-thumb-off: linear-gradient(135deg, #ffffff, #f8fafc);
  --toggle-thumb-on: linear-gradient(135deg, #fcd34d, #f97316);
  --toggle-track-border: var(--toggle-border-strong);
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 6px 18px 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.35s ease, border-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease, transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
  box-shadow: 0 18px 40px -28px rgba(15, 23, 42, 0.8);
  touch-action: manipulation;
  position: relative;
  overflow: hidden;
}

.theme-toggle::before {
  content: '';
  position: absolute;
  inset: -30%;
  border-radius: inherit;
  background: radial-gradient(circle at center, rgba(253, 230, 138, 0.55), rgba(249, 115, 22, 0.15) 55%, rgba(15, 23, 42, 0));
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
  z-index: 0;
  pointer-events: none;
}

.theme-toggle > * {
  position: relative;
  z-index: 1;
}

.theme-toggle:hover {
  background: var(--surface);
  border-color: var(--toggle-border-strong);
  color: var(--text-primary);
  transform: translateY(-3px) scale(1.01);
}

.theme-toggle:hover::before {
  opacity: 0.75;
  transform: scale(1.08);
}

.theme-toggle:active {
  transform: translateY(-1px) scale(0.995);
}

.theme-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-muted), 0 0 0 4px rgba(249, 115, 22, 0.35);
}

.theme-toggle__track {
  position: relative;
  width: 60px;
  height: 30px;
  border-radius: 999px;
  background: var(--toggle-track-off);
  border: 1px solid var(--toggle-track-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.35s ease, border-color 0.35s ease;
}

.theme-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--toggle-thumb-off);
  box-shadow: 0 10px 24px -14px rgba(15, 23, 42, 0.65);
  transform: translateX(0);
  transition: transform 0.35s ease, background 0.35s ease, box-shadow 0.35s ease;
}

.theme-toggle__icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  opacity: 0.7;
  transition: color 0.35s ease, opacity 0.35s ease;
  pointer-events: none;
}

.theme-toggle__icon--sun {
  left: 9px;
}

.theme-toggle__icon--moon {
  right: 9px;
}

.theme-toggle__text {
  min-width: 3.5ch;
  display: inline-flex;
  justify-content: center;
  color: var(--text-secondary);
  transition: color 0.35s ease;
}

.theme-toggle[aria-pressed='true'] {
  background: rgba(249, 115, 22, 0.12);
  border-color: rgba(249, 115, 22, 0.45);
  color: var(--text-primary);
}

.theme-toggle[aria-pressed='true'] .theme-toggle__track {
  background: var(--toggle-track-on);
  border-color: rgba(249, 115, 22, 0.6);
}

.theme-toggle[aria-pressed='true'] .theme-toggle__thumb {
  transform: translateX(30px);
  background: var(--toggle-thumb-on);
  box-shadow: 0 16px 32px -20px rgba(249, 115, 22, 0.8);
}

.theme-toggle[aria-pressed='true'] .theme-toggle__icon--sun {
  opacity: 0.35;
}

.theme-toggle[aria-pressed='true'] .theme-toggle__icon--moon {
  color: #0f172a;
  opacity: 1;
}

.theme-toggle[aria-pressed='true'] .theme-toggle__text {
  color: var(--text-primary);
}

body[data-theme='dark'] .theme-toggle {
  --toggle-track-off: linear-gradient(135deg, rgba(148, 163, 184, 0.25), rgba(15, 23, 42, 0.6));
  --toggle-track-on: linear-gradient(135deg, rgba(251, 146, 60, 0.75), rgba(234, 88, 12, 0.95));
  --toggle-thumb-off: linear-gradient(135deg, #0f172a, #1f2937);
  --toggle-thumb-on: linear-gradient(135deg, #fb923c, #f97316);
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(148, 163, 184, 0.35);
  color: var(--mix-panel-subtle-text);
  box-shadow: 0 18px 40px -26px rgba(2, 6, 23, 0.9);
}

body[data-theme='dark'] .theme-toggle:hover {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(148, 163, 184, 0.55);
  color: var(--results-card-text);
}

body[data-theme='dark'] .theme-toggle:hover::before {
  background: radial-gradient(circle at center, rgba(253, 230, 138, 0.4), rgba(249, 115, 22, 0.12) 55%, rgba(15, 23, 42, 0));
}

body[data-theme='dark'] .theme-toggle[aria-pressed='true'] {
  background: rgba(251, 146, 60, 0.2);
  border-color: rgba(251, 146, 60, 0.55);
  color: var(--results-card-title);
}

body[data-theme='dark'] .theme-toggle__icon {
  color: rgba(226, 232, 240, 0.8);
}

body[data-theme='dark'] .theme-toggle[aria-pressed='true'] .theme-toggle__icon--moon {
  color: rgba(15, 23, 42, 0.9);
}

body[data-theme='dark'] .theme-toggle__text {
  color: var(--mix-panel-subtle-text);
}

body[data-theme='dark'] .theme-toggle[aria-pressed='true'] .theme-toggle__text {
  color: var(--results-card-title);
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle,
  .theme-toggle__track,
  .theme-toggle__thumb,
  .theme-toggle__icon,
  .theme-toggle__text {
    transition: none;
  }

  .language-flag,
  .language-flag::after,
  .theme-toggle::before {
    transition: none;
  }

  .language-flag:hover,
  .language-flag:focus-visible,
  .theme-toggle:hover,
  .theme-toggle:active {
    transform: none;
  }

  .language-flag::after,
  .theme-toggle::before {
    opacity: 0;
  }
}

.lab-header__band-inner {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: clamp(16px, 3vw, 32px);
  align-items: center;
}

.band-style-picker .label {
  display: flex;
  align-items: center;
  gap: 0.5em;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.band-style-picker .label-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4em;
  padding: 0 0.4em;
  border-radius: 999px;
  background: var(--chip-surface);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-secondary);
}

.band-style-meta {
  display: flex;
  align-items: center;
}

.style-ghosts {
  display: grid;
  gap: 12px;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.style-ghost {
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--tint-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.style-ghost__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.style-ghost__bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.style-ghost__track {
  position: relative;
  flex: 1;
  height: 12px;
  border-radius: 999px;
  background: var(--ghost-track);
  overflow: hidden;
}

.style-ghost__segment {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: var(--segment-color, var(--slider-neutral));
  min-width: 2px;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.style-ghost__segment[data-band='green'] {
  --segment-color: var(--slider-green-muted);
}

.style-ghost__segment[data-band='yellow'] {
  --segment-color: var(--slider-yellow-muted);
}

.style-ghost__segment[data-band='red'] {
  --segment-color: var(--slider-red-muted);
}

.style-ghost__segment[data-band='neutral'] {
  --segment-color: var(--slider-neutral);
}

.style-ghost[data-has-range="false"] .style-ghost__track {
  opacity: 0.35;
}

.style-ghost[data-has-range="false"] .style-ghost__segment {
  display: none;
}

.lab-form {
  display: flex;
  flex-direction: column;
}

.lab-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.6fr) minmax(0, 3fr) minmax(0, 2.4fr);
  grid-template-areas: 'attributes ingredients mix';
  gap: clamp(24px, 3vw, 32px);
  align-items: start;
}

.lab-layout > * {
  min-width: 0;
}

.phase-card--attributes {
  grid-area: attributes;
}

.phase-card--ingredients {
  grid-area: ingredients;
}

.mix-panel {
  grid-area: mix;
}

.phase-card {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.phase-card__header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.phase-card__header-main {
  flex: 1 1 150px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.phase-card__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.phase-card__step {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-strong);
  font-weight: 600;
}

.phase-card__intro {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.phase-card__title {
  margin: 0 0 0;
  font-size: clamp(1.35rem, 1.6vw, 1.75rem);
  font-weight: 700;
}

.phase-card__hint {
  margin: 10px 0 0;
  color: var(--text-secondary);
  max-width: 45ch;
}

.target-summary {
  flex: 0 1 220px;
  min-width: 220px;
  max-width: 100%;
  border-left: 1px solid var(--tint-border-strong);
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
}

.target-summary h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.target-summary dl {
  margin: 0;
  display: grid;
  gap: 8px;
}

.target-summary__row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.target-summary__row dt {
  font-weight: 600;
}

.target-summary__row dd {
  margin: 0;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.target-summary__value[data-color-only='true'] [data-target-summary-text] {
  display: none;
}

.target-summary__colors {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.target-summary__color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 0 1px var(--surface);
}

.target-summary__color--green {
  background: var(--slider-green);
}

.target-summary__color--yellow {
  background: var(--slider-yellow);
}

.target-summary__color--red {
  background: var(--slider-red);
}

.attr-grid {
  display: grid;
  gap: clamp(16px, 2.5vw, 24px);
}

.attr-card {
  border-radius: 22px;
  padding: 18px clamp(16px, 2vw, 20px);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.attr-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.attr-card__header > * {
  min-width: 0;
}

.attr-card__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.attr-card__title {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.attr-card__title h3 {
  margin: 0;
  font-size: 1.1rem;
}

.attr-card__band-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 999px;
  border: none;
  appearance: none;
  background: var(--chip-bg);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.2s ease, color 0.2s ease;
}

.chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-muted), 0 0 0 4px rgba(249, 115, 22, 0.35);
}

body[data-theme='dark'] .chip:focus-visible {
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.35), 0 0 0 4px rgba(251, 146, 60, 0.55);
}

.chip:not([data-selected="true"]):hover {
  background: var(--chip-surface-hover);
  color: var(--text-primary-mix-card);
}

.chip[data-color="green"]:not([data-selected="true"]):hover {
  background: rgba(22, 163, 74, 0.18);
  color: #14532d;
}

.chip[data-color="yellow"]:not([data-selected="true"]):hover {
  background: rgba(250, 204, 21, 0.2);
  color: #854d0e;
}

.chip[data-color="red"]:not([data-selected="true"]):hover {
  background: rgba(239, 68, 68, 0.2);
  color: #991b1b;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.chip span {
  padding: 6px 12px;
  border-radius: inherit;
}

.chip[data-selected="true"],
.chip input:checked + span {
  background: var(--chip-bg-active);
  color: var(--chip-text-active);
}

.chip-clear {
  background: var(--tint-subtle);
  font-size: 0.75rem;
}

.attr-card__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.attr-card__slider {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.range-slider {
  position: relative;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: var(--slider-track-gradient);
  overflow: visible;
}

.range-slider::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--slider-track, var(--slider-track-gradient));
  opacity: 0.75;
  border-radius: inherit;
}

.range-slider-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--accent);
  box-shadow: 0 6px 18px -6px rgba(249, 115, 22, 0.7);
  cursor: grab;
  z-index: 2;
  transition: transform 0.15s ease;
}

.range-slider-thumb:active {
  transform: translate(-50%, -50%) scale(1.05);
}

.attr-card__value {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 120px;
  text-align: right;
}

.slider-value__label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
}

.slider-value__number {
  font-size: 1.1rem;
  font-weight: 600;
}

.slider-value-range {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
}

.slider-range-value {
  display: flex;
  justify-content: space-between;
  flex-direction: column;
}

.attr-card__fine-toggle {
  border: none;
  background: var(--chip-surface);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.attr-card__fine-toggle[data-active="true"],
.attr-card__fine-toggle[aria-pressed="true"] {
  background: var(--accent-muted);
  color: var(--accent-strong);
}

.attr-card__fine-toggle[data-expanded="true"]:hover {
  background: rgba(249, 115, 22, 0.22);
  color: var(--accent-strong);
}

.attr-card__fine-toggle:hover {
  background: var(--chip-surface-hover);
  color: var(--text-primary);
}

.attr-card__advanced {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
}

.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mode-btn,
.icon-btn {
  border: none;
  background: var(--chip-surface);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.mode-btn:hover {
  background: var(--chip-surface-hover);
}

.mode-btn[aria-pressed="true"],
.mode-btn:focus-visible {
  background: var(--accent);
  color: #fff;
}

.mode-btn[aria-pressed="true"]:hover {
  background: var(--accent-strong);
}

.icon-btn:hover {
  background: var(--chip-surface-hover);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.ingredients-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-secondary,
.btn-primary {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary {
  background: var(--chip-surface);
  color: var(--text-secondary);
}

.btn-secondary:hover:not([disabled]) {
  background: var(--chip-surface-hover);
  color: var(--text-primary);
}

.btn-secondary[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 24px -12px rgba(249, 115, 22, 0.9);
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-primary:hover:not([disabled]) {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.btn-primary[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.ingredient-browser {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
}

.ingredient-browser[data-hide-attributes="true"] .ingredient-card__metrics {
  display: none;
}

.ingredient-browser[data-hide-attributes="true"] .ingredient-card {
  gap: 12px;
}

.ingredient-tabs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--tint-subtle);
  border-radius: 18px;
  padding: 12px;
  overflow-y: auto;
}

.ingredient-tab {
  border: none;
  border-radius: 14px;
  padding: 12px 14px;
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.ingredient-tab:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}

.ingredient-tab--active {
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--tint-border-strong);
}

.ingredient-tab--active:hover {
  background: var(--surface);
}

.ingredient-tab__count {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.ingredient-list {
  position: relative;
}

.ingredient-category {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.ingredient-category[data-active="true"],
.ingredient-category:not([hidden]) {
  display: flex;
}

.ingredient-category__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.ingredient-category__grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: stretch;
}

.ingredient-card {
  position: relative;
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ingredient-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
}

.ingredient-card--locked {
  border-style: dashed;
}

.ingredient-card__header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.ingredient-toggle {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--chip-surface);
  cursor: pointer;
}

.ingredient-toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.ingredient-toggle__icon {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 2px solid var(--toggle-border-strong);
  background: transparent;
  transition: all 0.2s ease;
}

.ingredient-toggle--include input:checked + .ingredient-toggle__icon {
  background: var(--success);
  border-color: var(--success);
}

.ingredient-card--locked .ingredient-toggle--include .ingredient-toggle__icon {
  border-color: var(--required);
}

.ingredient-card--locked .ingredient-toggle--include input:checked + .ingredient-toggle__icon {
  background: var(--required);
  border-color: var(--required);
}

.ingredient-toggle--optional .ingredient-toggle__icon {
  border-radius: 50%;
}

.ingredient-toggle--optional input:checked + .ingredient-toggle__icon {
  background: var(--optional);
  border-color: var(--optional);
}

.ingredient-card__title {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ingredient-card__name {
  font-weight: 600;
  font-size: 1rem;
}

.ingredient-card__badge {
  align-self: flex-start;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--required-soft);
  color: var(--required);
}

.ingredient-card__metrics {
  margin: 0;
  display: grid;
  gap: 10px;
}

.ingredient-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ingredient-metric dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin: 0;
}

.ingredient-metric dd {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.metric-bar {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--metric-bar);
  overflow: hidden;
}

.metric-bar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(100%, calc(var(--metric-value, 0) / 11 * 100%));
  background: var(--metric-highlight);
  border-radius: inherit;
}

.metric-value {
  font-size: 0.85rem;
  font-weight: 600;
}

.ingredient-card__footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.mix-panel {
  position: sticky;
  top: 40px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--mix-panel-bg);
  color: var(--mix-panel-text);
  box-shadow: 0 28px 60px -36px rgba(15, 23, 42, 0.7);
  border: 1px solid var(--mix-panel-border);
  border-radius: 24px;
  backdrop-filter: blur(18px);
}

.mix-panel__header {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.mix-panel__header .phase-card__step {
  color: var(--mix-panel-subtle-text);
}

.mix-panel__header .phase-card__title {
  color: var(--mix-panel-text);
}

.mix-panel__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mix-summary__title {
  margin: 0 0 6px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--mix-panel-subtle-text);
}

.mix-summary__list {
  list-style: none;
  margin: 0;
  padding: 0;
  padding-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mix-summary__toggle {
  margin: 0 0 16px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent-color, #38bdf8);
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
}

.mix-summary__toggle:hover,
.mix-summary__toggle:focus-visible {
  text-decoration: underline;
}

.mix-summary__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--mix-panel-layer);
}

.mix-summary__item--empty {
  justify-content: flex-start;
  background: var(--mix-panel-layer-muted);
  color: var(--mix-panel-subtle-text);
}

.mix-summary__item--collapsed {
  display: none;
}

.mix-summary__name {
  font-weight: 600;
  font-size: 0.95rem;
}

.mix-summary__badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--mix-panel-track);
}

.mix-summary__item[data-status="required"] .mix-summary__badge {
  background: var(--required-soft);
  color: var(--required);
}

.mix-summary__item[data-status="selected"] .mix-summary__badge {
  background: var(--include-soft);
  color: var(--include);
}

.mix-summary__item[data-status="optional"] .mix-summary__badge {
  background: var(--optional-soft);
  color: var(--optional);
}

.mix-caps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mix-cap {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--mix-panel-cap-bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.mix-cap::after {
  content: "";
  position: absolute;
  inset: auto 14px 10px 14px;
  height: 4px;
  border-radius: 999px;
  background: var(--mix-panel-track);
}

.mix-cap::before {
  content: "";
  position: absolute;
  left: 14px;
  right: calc(14px + (1 - var(--cap-progress, 0)) * 100%);
  bottom: 10px;
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
  transition: right 0.3s ease;
}

.mix-cap__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mix-panel-subtle-text);
}

.mix-cap__value {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.mix-cap-bottom {
  display: flex;
  justify-content: center;
}

.results-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.results-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent-muted), rgba(15, 23, 42, 0.82));
  border: 1px solid var(--results-card-border);
  box-shadow:
    0 18px 38px rgba(15, 23, 42, 0.45),
    0 0 0 1px rgba(148, 163, 184, 0.12);
  overflow: hidden;
}

.results-header::before {
  content: '';
  position: absolute;
  inset: auto -40% -60px auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle at center, rgba(249, 115, 22, 0.35), transparent 65%);
  transform: rotate(12deg);
  pointer-events: none;
}

.results-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.results-title {
  margin: 0;
  align-items: center;
  color: var(--results-card-title);
}

.results-title__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(249, 115, 22, 0.18);
  color: var(--accent-strong);
  box-shadow: 0 8px 18px rgba(249, 115, 22, 0.28);
  font-size: 1.2rem;
}

.results-total-highlight {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  margin-inline: 4px;
  border-radius: 999px;
  background: var(--accent-muted);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.results-placeholder,
.results-status,
.results-status-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--results-card-subtle);
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-card {
  background: var(--results-card-bg);
  border-radius: 16px;
  border: 1px solid var(--results-card-border);
  color: var(--results-card-text);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.result-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.result-card-title-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-card-style {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--results-card-subtle);
}

.result-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.result-card-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.result-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff7ed;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.25), rgba(249, 115, 22, 0.5));
  border: 1px solid rgba(254, 215, 170, 0.6);
  box-shadow: 0 14px 32px -20px rgba(249, 115, 22, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(12px);
  text-shadow: 0 1px 3px rgba(15, 23, 42, 0.6);
}

.result-card-badge--single::before {
  content: '✨';
  font-size: 0.8rem;
  line-height: 1;
}

.result-card h3 {
  margin: 0;
  font-size: 1rem;
}

.result-card-subtitle {
  font-size: 0.8rem;
  color: var(--results-card-subtle);
}

.result-card-toggle {
  appearance: none;
  border: 1px solid var(--results-toggle-border);
  background: var(--mix-panel-track);
  color: var(--results-card-title);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.2;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease,
    box-shadow 0.25s ease;
}

.result-card-toggle:hover,
.result-card-toggle:focus-visible {
  background: var(--results-toggle-hover-bg);
  border-color: var(--results-toggle-hover-border);
  color: var(--results-card-title);
  outline: none;
}

.result-card-toggle[data-icon-state='expanded'] {
  background: var(--results-toggle-hover-bg);
  border-color: var(--results-toggle-hover-border);
}

.result-card-toggle:focus-visible {
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.35);
}

.result-card-toggle-label {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.result-card-toggle-icon {
  position: relative;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  border: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.result-card-toggle-icon::before,
.result-card-toggle-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  background: currentColor;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease;
}

.result-card-toggle-icon::before {
  width: 10px;
  height: 2px;
}

.result-card-toggle-icon::after {
  width: 2px;
  height: 10px;
}

.result-card-toggle[data-icon-state='expanded'] .result-card-toggle-icon {
  background: var(--results-toggle-hover-bg);
  border-color: var(--results-toggle-hover-border);
}

.result-card-toggle[data-icon-state='expanded'] .result-card-toggle-icon::after {
  transform: translate(-50%, -50%) scaleY(0);
  opacity: 0;
}

.result-card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  transform-origin: top center;
  will-change: height, opacity, transform;
}

.result-card-body.is-animating {
  pointer-events: none;
}

.result-card[data-expanded='false'] .result-card-toggle {
  background: var(--results-toggle-bg);
  color: var(--results-card-text);
}

.result-card[data-expanded='false'] .result-card-toggle:hover,
.result-card[data-expanded='false'] .result-card-toggle:focus-visible {
  background: var(--results-toggle-hover-bg);
}

.result-ingredients,
.result-cost,
.result-attr-bars,
.result-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-section-title {
  margin: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--results-card-subtle);
}

.result-ingredients__chips {
  gap: 10px;
}


.result-ingredients__chip {
  position: relative;
  padding: 0;
  cursor: default;
  background: var(--chip-include-bg);
  border: 1px solid var(--chip-include-border);
  color: var(--chip-include-text);
  box-shadow: 0 18px 38px -24px rgba(22, 163, 74, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-ingredients__chip::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: transparent;
  pointer-events: none;
  transition: background 0.2s ease;
}

.result-ingredients__chip span {
  padding: 9px 18px;
  position: relative;
  z-index: 1;
}

.result-ingredients__chip:hover {
  transform: translateY(-2px);
}

.result-ingredients__chip:hover::after {
  background: rgba(255, 255, 255, 0.08);
}

.result-ingredients__chip[data-status='required'] {
  background: var(--chip-required-bg);
  border-color: var(--chip-required-border);
  color: var(--chip-required-text);
  box-shadow: 0 18px 38px -24px rgba(37, 99, 235, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.result-ingredients__chip[data-status='required']:hover {
  box-shadow: 0 24px 56px -26px rgba(37, 99, 235, 0.55);
}

.result-ingredients__chip[data-status='include'] {
  background: var(--chip-include-bg);
  border-color: var(--chip-include-border);
  color: var(--chip-include-text);
  box-shadow: 0 18px 38px -24px rgba(22, 163, 74, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.result-ingredients__chip[data-status='include']:hover {
  box-shadow: 0 24px 56px -26px rgba(22, 163, 74, 0.55);
}

.result-ingredients__chip[data-status='optional'] {
  background: var(--chip-optional-bg);
  border-color: var(--chip-optional-border);
  color: var(--chip-optional-text);
  box-shadow: 0 18px 38px -24px rgba(217, 119, 6, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.result-ingredients__chip[data-status='optional']:hover {
  box-shadow: 0 24px 56px -26px rgba(217, 119, 6, 0.55);
}

.result-cost-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  margin: 0;
}

.result-cost-summary dt {
  font-weight: 600;
  color: rgba(248, 250, 252, 0.7);
}

.result-cost-summary dd {
  margin: 0;
}

.result-cost-chart {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 8px 12px 4px;
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.08);
}

.result-cost-chart-column {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.result-cost-chart-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(248, 250, 252, 0.75);
}

.result-cost-chart-bar-wrapper {
  width: clamp(28px, 5vw, 42px);
  height: 160px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.16);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.result-cost-chart-bar {
  width: 100%;
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.3), rgba(249, 115, 22, 0.8));
  border-radius: inherit;
  transition: height 0.2s ease;
}

.result-cost-chart-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(248, 250, 252, 0.7);
}

.result-band-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(248, 250, 252, 0.12);
  border: 1px solid rgba(248, 250, 252, 0.18);
  color: #f8fafc;
}

.pill.green {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(34, 197, 94, 0.5);
  color: #bbf7d0;
}

.pill.yellow {
  background: rgba(250, 204, 21, 0.2);
  border-color: rgba(250, 204, 21, 0.6);
  color: #fef08a;
}

.pill.red {
  background: rgba(248, 113, 113, 0.22);
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecaca;
}

.pill.neutral,
.pill.n-a {
  background: rgba(148, 163, 184, 0.2);
  border-color: rgba(148, 163, 184, 0.4);
  color: rgba(248, 250, 252, 0.85);
}

.result-attr-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 16px;
  justify-items: center;
}

.result-attr-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.result-attr-value {
  font-weight: 600;
  font-size: 0.85rem;
}

.result-attr-track {
  width: 18px;
  height: 140px;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.18);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.result-attr-fill {
  width: 100%;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.1), rgba(248, 250, 252, 0.35));
  border-radius: inherit;
  transition: height 0.2s ease;
}

.result-attr-fill[data-band='green'] {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.35), rgba(34, 197, 94, 0.85));
}

.result-attr-fill[data-band='yellow'] {
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.35), rgba(250, 204, 21, 0.85));
}

.result-attr-fill[data-band='red'] {
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.35), rgba(248, 113, 113, 0.85));
}

.result-attr-fill[data-band='neutral'],
.result-attr-fill[data-band='n-a'] {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.35), rgba(148, 163, 184, 0.7));
}

.result-attr-name {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(248, 250, 252, 0.6);
  text-align: center;
}

.support-container {
  display: flex;
  justify-content: center;
}

.support-section {
  display: flex;
  flex-direction: column;
  width: 66%;
}

.support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: center;
}

.support-note {
  margin-top: 0;
  color: var(--text-secondary);
}

.site-footer {
  background: rgba(15, 23, 42, 0.85);
  color: rgba(248, 250, 252, 0.8);
  padding: 24px clamp(16px, 4vw, 48px);
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: inherit;
  text-decoration: none;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(248, 250, 252, 0.25);
  border-top-color: #fff;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1440px) {
  .lab-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      'attributes ingredients'
      'mix mix';
  }

  .mix-panel {
    position: static;
    align-self: stretch;
  }
}

@media (max-width: 1200px) {
  .lab-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      'attributes'
      'ingredients'
      'mix';
  }

  .mix-panel {
    position: static;
    align-self: stretch;
  }
}

@media (max-width: 1100px) {
  .lab-header__band-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .lab-layout {
    grid-template-columns: 1fr;
  }

  .mix-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .lab-header__top {
    flex-direction: column;
    align-items: flex-start;
  }

  .phase-card__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .attr-card__slider {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .mix-caps {
    grid-template-columns: 1fr;
  }

  .support-section {
    width: unset;
  }
}

@media (max-width: 520px) {
  .ingredient-browser {
    grid-template-columns: 1fr;
  }

  .ingredient-tabs {
    flex-direction: row;
    overflow-x: auto;
  }

  .ingredient-tab {
    min-width: 100px;
  }
}

body.legacy-mode .lab-layout {
  grid-template-columns: 1fr;
}

body.legacy-mode .mix-panel {
  position: static;
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-soft);
}

body.legacy-mode .mix-summary__item {
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-primary);
}

body.legacy-mode .mix-cap {
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-primary);
}

body.legacy-mode .ingredient-card {
  transform: none !important;
  box-shadow: none !important;
}

body.legacy-mode .ingredient-browser {
  grid-template-columns: 1fr;
}

body.legacy-mode .ingredient-tabs {
  flex-direction: row;
}

body.legacy-mode .card {
  background: #fff;
  backdrop-filter: none;
}

body.legacy-mode .mix-panel__header .phase-card__title,
body.legacy-mode .results-title {
  color: var(--text-primary);
}

body.legacy-mode .results-section {
  background: transparent;
}

body.legacy-mode .result-card {
  background: #fff;
  color: var(--text-primary);
}

body.legacy-mode .mix-summary__badge {
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-secondary);
}
.band-style-picker select,
select,
input,
button {
  font-family: inherit;
}

.band-style-picker select {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--form-field-border);
  padding: 12px 16px;
  font-size: 0.95rem;
  background: var(--form-field-surface);
  color: var(--form-field-text);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  appearance: none;
  padding-right: 44px;
  background-image: var(--select-arrow-icon);
  background-position: calc(100% - 18px) 50%;
  background-size: 14px 10px;
  background-repeat: no-repeat;
}

.band-style-picker select:hover {
  border-color: rgba(15, 23, 42, 0.25);
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.12);
}

.band-style-picker select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
  background-color: var(--form-field-surface);
}

body[data-theme='dark'] .band-style-picker select {
  background-image: var(--select-arrow-icon);
  background-color: rgba(9, 14, 26, 0.94);
  border-color: rgba(148, 163, 184, 0.32);
  box-shadow: 0 10px 30px -18px rgba(2, 6, 23, 0.85), inset 0 1px 1px rgba(15, 23, 42, 0.5);
}

body[data-theme='dark'] .band-style-picker select:hover {
  border-color: rgba(148, 163, 184, 0.45);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.55);
}

body[data-theme='dark'] .band-style-picker select:focus {
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.28);
}

/* Legal pages */
body.legal-page {
  padding: clamp(32px, 6vw, 72px) clamp(16px, 6vw, 72px);
  display: flex;
  justify-content: center;
  background: radial-gradient(circle at top, rgba(249, 250, 252, 0.85), rgba(236, 242, 255, 0.75)),
    var(--bg-gradient);
  background-attachment: fixed;
}

body.legal-page::after {
  opacity: 0.18;
  filter: blur(28px);
}

body[data-theme='dark'].legal-page {
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.65)), var(--bg-gradient);
}

body[data-theme='dark'].legal-page::after {
  opacity: 0.12;
  filter: blur(32px);
}

.legal-page .legal-container {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: clamp(32px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2vw, 28px);
  line-height: 1.65;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.88));
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 40px 80px -45px rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(20px);
}

body[data-theme='dark'].legal-page .legal-container {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.78));
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 0 32px 64px -40px rgba(2, 6, 23, 0.85);
}

.legal-page .legal-container > * {
  margin: 0;
}

.legal-page .back-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent-strong);
  background: rgba(249, 115, 22, 0.1);
  border-radius: 999px;
  text-decoration: none;
  transition: background-color 0.25s ease, transform 0.25s ease, color 0.25s ease;
}

.legal-page .back-link:hover {
  background: rgba(249, 115, 22, 0.18);
  color: var(--accent);
  transform: translateX(-2px);
}

.legal-page h1 {
  font-size: clamp(2.4rem, 5vw, 3rem);
  letter-spacing: -0.02em;
  margin-top: 8px;
}

.legal-page h2 {
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-top: clamp(32px, 6vw, 48px);
  padding-top: clamp(20px, 4vw, 30px);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

body[data-theme='dark'].legal-page h2 {
  border-color: rgba(148, 163, 184, 0.24);
}

.legal-page h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.legal-page h3 {
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  margin-top: clamp(24px, 4vw, 32px);
  color: var(--text-primary);
}

.legal-page h4 {
  font-size: clamp(1rem, 2vw, 1.15rem);
  margin-top: clamp(20px, 3vw, 28px);
  color: var(--text-secondary);
  text-transform: none;
}

.legal-page p,
.legal-page ul,
.legal-page ol {
  color: var(--text-secondary);
}

.legal-page p {
  font-size: 1.02rem;
}

.legal-page ul {
  padding: clamp(12px, 3vw, 18px) clamp(20px, 4vw, 32px);
  margin: clamp(8px, 2vw, 16px) 0;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.06);
  display: grid;
  gap: clamp(10px, 2vw, 16px);
}

body[data-theme='dark'].legal-page ul {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.2);
}

.legal-page li {
  margin: 0;
  padding-left: 12px;
}

.legal-page a {
  color: var(--accent-strong);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(249, 115, 22, 0.4);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.legal-page a:hover {
  color: var(--accent);
  text-decoration-color: rgba(249, 115, 22, 0.75);
}

.legal-page .legal-container > p + h2,
.legal-page .legal-container > p + h3 {
  margin-top: clamp(24px, 4vw, 36px);
}

@media (max-width: 768px) {
  body.legal-page {
    padding: clamp(24px, 6vw, 48px) clamp(12px, 6vw, 36px);
  }

  .legal-page .legal-container {
    padding: clamp(24px, 5vw, 36px);
    border-radius: 20px;
  }

  .legal-page .back-link {
    position: sticky;
    top: 0;
  }

  .legal-page ul {
    padding: clamp(16px, 5vw, 22px) clamp(18px, 6vw, 28px);
  }
}

