:root {
  color-scheme: light;
  --bg: #fdf5f5;
  --bg-alt: #f5e7e7;
  --bg-soft: #edd7d7;
  --text: #2a1416;
  --muted: #66474a;
  --soft: rgba(88, 60, 64, 0.78);
  --panel: rgba(255, 245, 245, 0.82);
  --panel-strong: rgba(245, 220, 220, 0.92);
  --panel-border: rgba(153, 0, 0, 0.28);
  --panel-border-hover: rgba(153, 0, 0, 0.55);
  --accent: #a91410;
  --accent-strong: #7f0000;
  --accent-bright: #b30000;
  --neon-blue: #168fca;
  --neon-pink: #d73587;
  --ink-shadow: rgba(22, 9, 16, 0.22);
  --shadow-soft: 0 16px 36px rgba(109, 50, 50, 0.08);
  --shadow-card: 0 26px 56px rgba(109, 50, 50, 0.12);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1018;
  --bg-alt: #151019;
  --bg-soft: #24181d;
  --text: #fff4f4;
  --muted: #d7bfc2;
  --soft: rgba(245, 219, 222, 0.78);
  --panel: rgba(32, 20, 24, 0.82);
  --panel-strong: rgba(48, 28, 33, 0.92);
  --panel-border: rgba(255, 177, 177, 0.2);
  --panel-border-hover: rgba(255, 177, 177, 0.42);
  --accent: #ff6b5f;
  --accent-strong: #ffb4ad;
  --accent-bright: #ff7a70;
  --neon-blue: #42bff7;
  --neon-pink: #ff68af;
  --ink-shadow: rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 16px 36px rgba(0, 0, 0, 0.22);
  --shadow-card: 0 26px 56px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 520px at 12% 18%, rgba(22, 143, 202, 0.12), transparent 60%),
    radial-gradient(980px 520px at 86% 8%, rgba(215, 53, 135, 0.14), transparent 62%),
    radial-gradient(1200px 620px at 88% -12%, rgba(153, 42, 42, 0.1), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.38) 0%, transparent 26%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-alt) 100%);
}

[data-theme="dark"] body {
  background:
    radial-gradient(900px 520px at 12% 18%, rgba(22, 143, 202, 0.13), transparent 60%),
    radial-gradient(980px 520px at 86% 8%, rgba(215, 53, 135, 0.13), transparent 62%),
    radial-gradient(1200px 620px at 88% -12%, rgba(255, 107, 95, 0.08), transparent 58%),
    linear-gradient(180deg, rgba(255, 244, 244, 0.04) 0%, transparent 28%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-alt) 100%);
}

button,
input,
label,
output {
  font: inherit;
}

.shell {
  width: min(980px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.site-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(153, 0, 0, 0.14);
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.nav-group-utility {
  justify-content: flex-end;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.35rem 0.15rem;
  color: var(--text);
  background: transparent;
  border: 0;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.nav-link:hover {
  color: var(--accent-strong);
  text-decoration: none;
}

.theme-toggle {
  gap: 0.35rem;
}

.theme-toggle::before {
  content: "Dark";
}

.theme-toggle[data-icon="sun"]::before {
  content: "Light";
}

.theme-icon {
  display: none;
  font-size: 0.86rem;
}

.theme-toggle[data-icon="moon"] .theme-icon-moon,
.theme-toggle[data-icon="sun"] .theme-icon-sun {
  display: inline-block;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.nav-brand-wordmark {
  gap: 0.7rem;
  color: var(--text);
}

.nav-brand-mark-image {
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  filter: drop-shadow(0 12px 20px rgba(109, 50, 50, 0.12));
}

.nav-brand-copy {
  display: grid;
  gap: 0.05rem;
  text-align: left;
}

.nav-brand-copy strong {
  font-size: 1.05rem;
  line-height: 1.05;
}

.hero {
  margin-bottom: 1rem;
  padding-top: 0.15rem;
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.3rem;
  color: var(--accent-strong);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 auto;
  max-width: 14ch;
  font-size: clamp(2rem, 4.7vw, 3.5rem);
  line-height: 0.96;
}

.hero h1.hero-title-balanced {
  max-width: 22ch;
}

.hero-title-balanced span {
  display: block;
}

@media (max-width: 420px) {
  .hero-title-balanced span {
    display: inline;
  }
}

.lede {
  max-width: 35rem;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.mode-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.72rem;
  width: fit-content;
  max-width: 100%;
  margin: 1.25rem auto 0;
  padding: 0.38rem;
  border: 1px solid rgba(153, 0, 0, 0.16);
  border-radius: 999px;
  background: rgba(255, 250, 250, 0.54);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 12px 30px rgba(109, 50, 50, 0.08);
}

.mode-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.58rem;
  min-height: 58px;
  padding: 0.72rem 1rem;
  border: 1px solid rgba(153, 0, 0, 0.16);
  border-radius: 999px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent),
    rgba(255, 250, 250, 0.72);
  font-weight: 700;
  cursor: default;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.mode-tab i {
  font-size: 1rem;
}

.mode-source-tabs {
  align-items: stretch;
}

.mode-copy {
  display: grid;
  gap: 0.12rem;
  min-width: 9.4rem;
  text-align: left;
}

.mode-copy strong {
  font-size: 0.9rem;
  line-height: 1.05;
}

.mode-copy small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.15;
}

.mode-tab.is-active .mode-copy small {
  color: rgba(255, 255, 255, 0.78);
}

.mode-tab[href] {
  cursor: pointer;
}

.mode-tab[href]:hover {
  border-color: rgba(153, 0, 0, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), transparent),
    rgba(153, 0, 0, 0.09);
  box-shadow: 0 12px 24px rgba(109, 50, 50, 0.09);
  text-decoration: none;
}

.mode-tab:focus-visible {
  outline: 3px solid rgba(176, 38, 38, 0.24);
  outline-offset: 3px;
}

.mode-tab.is-active {
  color: #fff;
  border-color: rgba(13, 20, 34, 0.72);
  background:
    radial-gradient(circle at 18% 28%, rgba(22, 143, 202, 0.92), transparent 36%),
    radial-gradient(circle at 84% 74%, rgba(215, 53, 135, 0.9), transparent 38%),
    linear-gradient(135deg, #101522 0%, #17121d 46%, #7f0000 100%);
  box-shadow: 0 18px 34px rgba(127, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.mode-tab:disabled {
  opacity: 0.72;
}

.mode-tab > span:not(.mode-copy) {
  padding: 0.14rem 0.42rem;
  border-radius: 999px;
  color: var(--accent-strong);
  background: rgba(153, 0, 0, 0.09);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mode-proof-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  max-width: 38rem;
  margin: 0.85rem auto 0;
}

.local-trust-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  max-width: 46rem;
  margin: 0.62rem auto 0;
}

.local-trust-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0.26rem 0.62rem;
  border: 1px solid rgba(228, 91, 91, 0.22);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(255, 250, 250, 0.32);
  font-size: 0.68rem;
  font-weight: 700;
  opacity: 0.88;
}

.mode-proof-grid > div {
  padding: 0.72rem 0.85rem;
  border: 1px solid rgba(153, 0, 0, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent),
    rgba(153, 0, 0, 0.045);
  text-align: left;
}

.mode-proof-grid span {
  display: block;
  margin-bottom: 0.18rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mode-proof-grid strong {
  display: block;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.2;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(3px);
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.panel:hover {
  border-color: var(--panel-border-hover);
  box-shadow: var(--shadow-card);
}

.upload-panel,
.controls-panel,
.analysis-grid > .panel,
.presets-panel {
  padding: 24px;
}

.upload-panel,
.analysis-grid,
.presets-panel {
  margin-bottom: 20px;
}

.upload-panel {
  background:
    radial-gradient(520px 240px at 14% 0%, rgba(22, 143, 202, 0.08), transparent 64%),
    radial-gradient(520px 240px at 86% 0%, rgba(215, 53, 135, 0.1), transparent 64%),
    linear-gradient(180deg, rgba(179, 0, 0, 0.025) 0%, transparent 38%),
    var(--panel-strong);
}

.workflow-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}

.workflow-grid > .upload-panel,
.workflow-grid > .workspace {
  margin-bottom: 0;
}

.workflow-grid .mutation-macro {
  grid-template-columns: 1fr;
  text-align: center;
}

.workflow-grid .mutation-macro-copy {
  justify-items: center;
}

.workflow-grid .mutation-macro-copy h3,
.workflow-grid .mutation-macro-copy p {
  max-width: 100%;
}

.workflow-grid .mutation-knob-mount {
  width: min(100%, 18rem);
}

.workflow-grid .control-grid,
.workflow-grid .preset-summary {
  grid-template-columns: 1fr;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
}

h2 {
  margin: 0;
  font-size: 1.24rem;
}

.muted {
  margin: 0;
  color: var(--muted);
}

.input-note {
  margin: 0.3rem 0 0;
  color: var(--soft);
  font-size: 0.84rem;
  line-height: 1.35;
}

.upload-message {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(176, 38, 38, 0.08);
  border: 1px solid rgba(176, 38, 38, 0.18);
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 500;
}

.upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 17px 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(176, 38, 38, 0.95) 0%, rgba(123, 7, 7, 0.98) 100%);
  border: 1px solid rgba(127, 0, 0, 0.18);
  box-shadow: 0 18px 32px rgba(109, 50, 50, 0.18);
  color: #fff7f7;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  white-space: nowrap;
}

.upload input {
  display: none;
}

.preset-drop-zone {
  min-height: 0;
  position: relative;
  margin-bottom: 16px;
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(153, 0, 0, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent),
    rgba(255, 245, 245, 0.42);
}

.preset-drop-inner {
  position: relative;
}

.preset-drop-cta {
  min-height: 128px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  padding: 16px;
}

.preset-drop-zone.has-preset .preset-drop-cta {
  display: none;
}

.drop-note {
  margin: 0;
  color: var(--soft);
  font-size: 0.9rem;
}

.drop-zone {
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.drop-zone.is-drop-active {
  border-color: rgba(176, 38, 38, 0.42);
  box-shadow: 0 24px 48px rgba(109, 50, 50, 0.16);
  background:
    linear-gradient(180deg, rgba(179, 0, 0, 0.04) 0%, transparent 40%),
    var(--panel-strong);
}

.preset-summary,
.control-grid,
.metric-grid {
  display: grid;
  gap: 14px;
}

.preset-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.control-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.preset-summary > div,
.control,
.metric,
.preset-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 250, 250, 0.68);
  border: 1px solid rgba(153, 0, 0, 0.12);
}

.meta-label,
.metric-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.workspace {
  display: block;
  margin-bottom: 20px;
}

.control {
  display: grid;
  gap: 10px;
}

.control.is-hidden {
  display: none;
}

.mutation-macro {
  display: grid;
  grid-template-columns: minmax(13rem, 0.85fr) minmax(18rem, 1.15fr);
  gap: 1.4rem 1.7rem;
  align-items: center;
  margin-bottom: 1.05rem;
  padding: clamp(1rem, 3vw, 1.45rem);
  border: 1px solid rgba(153, 0, 0, 0.16);
  border-radius: 24px;
  background:
    radial-gradient(circle at 30% 12%, rgba(22, 143, 202, 0.14), transparent 34%),
    radial-gradient(circle at 78% 24%, rgba(215, 53, 135, 0.16), transparent 34%),
    rgba(255, 250, 250, 0.54);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), var(--shadow-soft);
}

.mutation-macro-copy {
  display: grid;
  gap: 0.45rem;
}

.mutation-macro-copy h3 {
  margin: 0;
  max-width: 9ch;
  font-size: clamp(1.65rem, 4vw, 2.55rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
}

.mutation-macro-copy p {
  max-width: 18rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.mutation-knob-mount {
  justify-self: center;
  width: min(100%, 22rem);
}

.preset-mutator-knob {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  user-select: none;
  -webkit-user-select: none;
}

.preset-knob-shell {
  position: relative;
  width: clamp(13.5rem, 34vw, 18.5rem);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transform: translateZ(0);
}

.preset-knob-ring {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: conic-gradient(from 218deg, var(--neon-blue), #7698ff 28%, var(--neon-pink) 56%, rgba(215, 53, 135, 0.1) 70%, rgba(22, 143, 202, 0.08) 100%);
  box-shadow: 0 0 32px rgba(22, 143, 202, 0.2), 0 0 38px rgba(215, 53, 135, 0.2), 0 28px 58px rgba(22, 9, 16, 0.2);
}

.preset-knob-ring::before {
  content: "";
  position: absolute;
  inset: 0.42rem;
  border-radius: inherit;
  background: var(--panel-strong);
  box-shadow: inset 0 0 26px rgba(22, 9, 16, 0.18);
}

.preset-knob-ticks {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
}

.preset-knob-tick {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 0.65rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 48%, transparent);
  transform: rotate(var(--tick-angle)) translateY(calc(-1 * clamp(6.1rem, 15.4vw, 8.3rem)));
  transform-origin: center;
  opacity: 0.52;
}

.preset-knob-tick.is-major {
  height: 0.95rem;
  background: linear-gradient(180deg, var(--neon-blue), var(--neon-pink));
  opacity: 0.86;
}

.preset-knob-face {
  --knob-angle: 0deg;
  position: relative;
  width: 69%;
  height: 69%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.28), transparent 18%),
    radial-gradient(circle at 66% 78%, rgba(0, 0, 0, 0.46), transparent 42%),
    repeating-conic-gradient(from 14deg, rgba(255, 255, 255, 0.045) 0deg 3deg, transparent 3deg 8deg),
    radial-gradient(circle, #34363a 0%, #181a1f 58%, #090a0d 100%);
  box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.24), inset 0 -18px 32px rgba(0, 0, 0, 0.55), inset 14px 10px 28px rgba(255, 255, 255, 0.06), 0 18px 38px rgba(0, 0, 0, 0.28);
  backface-visibility: hidden;
  transform: translateZ(0) rotate(var(--knob-angle));
  will-change: transform;
  z-index: 3;
}

.preset-knob-face::after {
  content: "";
  position: absolute;
  inset: 16%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: inherit;
  background: radial-gradient(circle at 42% 34%, rgba(255, 255, 255, 0.08), transparent 46%);
}

.preset-knob-indicator {
  position: absolute;
  left: 50%;
  top: 7%;
  width: 0.28rem;
  height: 2.25rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.38));
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.28);
  transform: translateX(-50%);
  z-index: 4;
}

.preset-knob-cap {
  position: absolute;
  inset: 27%;
  border-radius: inherit;
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.18), transparent 34%),
    repeating-radial-gradient(circle, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 4px),
    #15161a;
  box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.12), inset 0 -9px 16px rgba(0, 0, 0, 0.54);
  z-index: 5;
}

.preset-knob-control {
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: 999px;
  cursor: ns-resize;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.preset-knob-control:focus-visible {
  outline: 3px solid rgba(176, 38, 38, 0.28);
  outline-offset: 8px;
}

.preset-knob-readout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  width: min(100%, 20rem);
  align-items: center;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preset-knob-readout span:last-child {
  text-align: right;
}

.preset-knob-readout strong {
  color: var(--accent-strong);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.preset-knob-center-label {
  margin-top: -0.35rem;
  color: var(--soft);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.control output,
.fixed-value {
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 700;
}

.control input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  justify-content: center;
}

.actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(127, 0, 0, 0.16);
  background: rgba(255, 245, 245, 0.75);
  color: var(--text);
  cursor: pointer;
}

.actions button:last-child {
  background: linear-gradient(180deg, rgba(176, 38, 38, 0.95) 0%, rgba(123, 7, 7, 0.98) 100%);
  color: #fff7f7;
}

#generate-button {
  min-height: 56px;
  padding: 0.9rem 1.45rem;
  border-color: rgba(127, 0, 0, 0.24);
  background: linear-gradient(180deg, rgba(176, 38, 38, 0.95) 0%, rgba(123, 7, 7, 0.98) 100%);
  box-shadow: 0 18px 36px rgba(153, 0, 0, 0.24);
  color: #fff4f4;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

#generate-button:hover:enabled {
  background: linear-gradient(180deg, rgba(190, 32, 32, 0.98) 0%, rgba(127, 0, 0, 1) 100%);
  border-color: rgba(127, 0, 0, 0.34);
  box-shadow: 0 22px 42px rgba(153, 0, 0, 0.3);
}

#generate-button:focus-visible {
  outline: 3px solid rgba(176, 38, 38, 0.24);
  outline-offset: 3px;
}

.actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.button-spinner {
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  display: none;
  animation: spin 1s linear infinite;
}

button.is-loading .button-spinner {
  display: inline-block;
}

.status,
.upgrade-hint,
.empty-state {
  color: var(--muted);
}

.status {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 245, 245, 0.52);
  border: 1px solid rgba(153, 0, 0, 0.12);
}

.upgrade-hint {
  margin: 12px 0 0;
  font-size: 0.84rem;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.preset-list {
  display: grid;
  gap: 16px;
}

.preset-group {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 245, 245, 0.45);
  border: 1px solid rgba(153, 0, 0, 0.1);
}

.preset-group-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.preset-group-head h3 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.02rem;
}

.preset-group-head p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.preset-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.8rem;
  height: 1.8rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: rgba(153, 0, 0, 0.08);
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 700;
}

.preset-group-toggle-label {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.preset-group-list {
  display: grid;
  gap: 14px;
}

.preset-card {
  display: grid;
  gap: 14px;
}

.preset-card-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.preset-role {
  display: inline-flex;
  width: fit-content;
  padding: 0.38rem 0.62rem;
  border-radius: 999px;
  background: rgba(179, 0, 0, 0.08);
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preset-card h3,
.preset-card p {
  margin: 0;
}

.preset-subline {
  color: var(--muted);
  font-size: 0.92rem;
}

.preset-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  padding: 0.44rem 0.72rem;
  border-radius: 999px;
  background: rgba(153, 0, 0, 0.08);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 600;
}

.preset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.download-button,
.preview-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: fit-content;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(127, 0, 0, 0.16);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(176, 38, 38, 0.95) 0%, rgba(123, 7, 7, 0.98) 100%);
  color: #fff7f7;
  text-decoration: none;
  cursor: pointer;
}

.preview-button {
  background: rgba(255, 245, 245, 0.75);
  color: var(--text);
  font-weight: 700;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(127, 0, 0, 0.16);
  background: rgba(255, 245, 245, 0.75);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: linear-gradient(180deg, rgba(176, 38, 38, 0.95) 0%, rgba(123, 7, 7, 0.98) 100%);
  color: #fff7f7;
}

.button.secondary {
  background: rgba(255, 245, 245, 0.75);
  color: var(--text);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.download-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  height: 1.45rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.hidden {
  display: none !important;
}

.preset-quality {
  margin: -0.15rem 0 0.85rem;
  color: var(--soft);
  font-size: 0.92rem;
  line-height: 1.5;
}

.suite-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 18px 22px;
  align-items: start;
  margin-top: 20px;
  padding: 26px;
  background:
    radial-gradient(720px 280px at 16% 0%, rgba(215, 53, 135, 0.12), transparent 62%),
    radial-gradient(620px 260px at 86% 4%, rgba(176, 38, 38, 0.12), transparent 62%),
    linear-gradient(180deg, rgba(179, 0, 0, 0.05) 0%, transparent 42%),
    var(--panel-strong);
  border-color: rgba(153, 0, 0, 0.32);
  box-shadow: 0 30px 70px rgba(109, 50, 50, 0.14);
}

.suite-panel.is-unlocked {
  background:
    linear-gradient(180deg, rgba(20, 137, 60, 0.08) 0%, transparent 42%),
    var(--panel-strong);
  border-color: rgba(20, 137, 60, 0.24);
}

.suite-kicker,
.suite-active-badge {
  margin: 0 0 0.4rem;
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.suite-copy h2,
.suite-copy p,
.suite-list,
.suite-meta,
.suite-unlock-note,
.suite-active-note {
  margin: 0;
}

.suite-copy h2 {
  max-width: 24rem;
  font-size: clamp(1.3rem, 2.4vw, 1.85rem);
  line-height: 1.02;
}

.suite-price {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0 0 0.55rem !important;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(209, 76, 76, 0.1);
  border: 1px solid rgba(209, 76, 76, 0.18);
  color: var(--accent-strong) !important;
  font-size: 0.84rem;
  font-weight: 700;
}

.suite-ownership {
  margin-bottom: 0.5rem !important;
  color: var(--accent-strong);
  font-weight: 600;
}

.suite-benefit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0.9rem 0 0.85rem;
}

.suite-benefit-grid div {
  padding: 0.78rem 0.85rem;
  border: 1px solid rgba(153, 0, 0, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent),
    rgba(255, 250, 250, 0.58);
}

.suite-benefit-grid strong {
  display: block;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.12;
}

.suite-benefit-grid span {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.suite-list {
  margin: 0 0 0.8rem;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.suite-list li + li {
  margin-top: 0.18rem;
}

.suite-actions {
  display: grid;
  gap: 0.7rem;
  justify-items: start;
  align-self: center;
  padding: 0.85rem;
  border: 1px solid rgba(153, 0, 0, 0.12);
  border-radius: 18px;
  background: rgba(255, 250, 250, 0.38);
}

.suite-meta {
  color: var(--soft);
  font-size: 0.8rem;
  line-height: 1.45;
}

.suite-unlock {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: center;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 250, 250, 0.7);
  border: 1px solid rgba(153, 0, 0, 0.12);
}

.suite-unlock input {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid rgba(153, 0, 0, 0.18);
  border-radius: 999px;
  background: rgba(255, 250, 250, 0.92);
  color: var(--text);
  font: inherit;
}

.suite-unlock-note {
  grid-column: 1 / -1;
  color: var(--soft);
  font-size: 0.84rem;
  line-height: 1.45;
}

.suite-active {
  grid-column: 1 / -1;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(239, 252, 243, 0.82);
  border: 1px solid rgba(20, 137, 60, 0.18);
}

.suite-active-badge {
  color: #14893c;
}

.suite-active-note {
  color: var(--soft);
  line-height: 1.5;
}

.suite-active-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.suite-active-meta {
  margin-top: 12px !important;
  color: var(--soft);
  font-size: 0.84rem;
  line-height: 1.45;
}

.app-footer {
  margin-top: 22px;
  text-align: center;
  color: var(--muted);
}

.app-footer p {
  margin: 0.2rem 0;
}

.app-version {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.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;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 880px) {
  .workspace,
  .workflow-grid,
  .analysis-grid,
  .mutation-macro,
  .mode-proof-grid,
  .suite-panel {
    grid-template-columns: 1fr;
  }

  .preset-summary,
  .control-grid,
  .preset-metrics {
    grid-template-columns: 1fr;
  }

  .site-nav {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .nav-group,
  .nav-group-utility {
    justify-content: center;
  }

  .suite-unlock {
    grid-template-columns: 1fr;
  }

  .mode-tabs {
    width: 100%;
    max-width: 30rem;
    border-radius: 24px;
  }

  .mode-tab {
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .mode-copy {
    min-width: 0;
  }

  .suite-benefit-grid {
    grid-template-columns: 1fr;
  }

  .mutation-macro {
    text-align: center;
  }

  .mutation-macro-copy {
    justify-items: center;
  }

  .mutation-macro-copy h3,
  .mutation-macro-copy p {
    max-width: 100%;
  }

}

@media (max-width: 560px) {
  .preset-knob-shell {
    width: min(100%, 15.5rem);
  }
}

@media (max-width: 960px) {
  .workspace,
  .workflow-grid,
  .analysis-grid,
  .mode-proof-grid,
  .preset-summary {
    grid-template-columns: 1fr;
  }

  .control-grid,
  .preset-metrics,
  .suite-panel {
    grid-template-columns: 1fr;
  }

  .suite-unlock {
    grid-template-columns: 1fr;
  }

  .site-nav {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .nav-group {
    justify-content: center;
  }

}

.panel,
.waveform-panel,
.control,
.meta-grid > div,
.preset-card,
.suite-card,
.suite-panel,
.preset-summary > div,
.preset-metrics > div,
.mode-proof-grid > div {
  background-color: rgba(255, 250, 250, 0.56);
}

input,
select,
textarea {
  color: var(--text);
  background: rgba(255, 250, 250, 0.72);
}

input::placeholder,
textarea::placeholder {
  color: rgba(102, 71, 74, 0.34);
}

[data-theme="dark"] .panel,
[data-theme="dark"] .waveform-panel,
[data-theme="dark"] .control,
[data-theme="dark"] .meta-grid > div,
[data-theme="dark"] .preset-card,
[data-theme="dark"] .suite-card,
[data-theme="dark"] .suite-panel,
[data-theme="dark"] .preset-summary > div,
  [data-theme="dark"] .preset-metrics > div,
  [data-theme="dark"] .mode-proof-grid > div,
  [data-theme="dark"] .mutation-macro,
  [data-theme="dark"] .suite-benefit-grid div,
[data-theme="dark"] .suite-actions,
[data-theme="dark"] .suite-unlock,
[data-theme="dark"] .local-trust-strip span {
  background-color: rgba(32, 20, 24, 0.72);
}

[data-theme="dark"] .mode-tabs,
[data-theme="dark"] .mode-tab,
[data-theme="dark"] .preset-drop-zone {
  background-color: rgba(32, 20, 24, 0.58);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  color: var(--text);
  background: rgba(32, 20, 24, 0.78);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: rgba(245, 219, 222, 0.36);
}
