: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,
select,
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;
  border: 0;
  color: var(--text);
  background: transparent;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

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

.nav-link.active {
  border-bottom-color: var(--accent-bright);
}

.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-wordmark:hover {
  color: var(--accent-strong);
}

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

.nav-brand-copy span {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero {
  margin-bottom: 1rem;
  padding: 0.15rem 0 0;
  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: 19ch;
  font-size: clamp(2.05rem, 4.8vw, 3.7rem);
  line-height: 0.96;
}

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

.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, background 170ms ease;
}

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

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

.upload-panel,
.waveform-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);
  border-color: rgba(153, 0, 0, 0.22);
}

.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 > .intent-panel,
.workflow-grid > .intent-stack,
.workflow-grid > .workspace {
  margin-bottom: 0;
}

.intent-stack {
  display: grid;
  gap: 20px;
}

.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 .meta-grid {
  grid-template-columns: 1fr;
}

.workflow-grid .control-grid {
  gap: 10px;
}

.workflow-grid .control {
  padding: 13px 14px;
  border-radius: 16px;
}

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

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

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

.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-callout {
  margin: 0 0 16px;
  color: var(--accent-strong);
  font-weight: 500;
}

.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;
  text-align: center;
}

.upload input {
  display: none;
}

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

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

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

#waveform {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent),
    #f2dfdf;
  min-height: 84px;
  cursor: pointer;
}

.waveform-panel {
  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);
}

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

.waveform-drop-cta {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  padding: 16px;
}

.waveform-panel.has-waveform .waveform-drop-cta {
  display: none;
}

.waveform-empty-note {
  margin: 0;
  color: var(--soft);
  font-size: 0.9rem;
  max-width: 28rem;
}

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

.waveform-panel:not(.is-drop-active) .upload {
  position: relative;
  z-index: 1;
}

.waveform-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 14px 0 18px;
}

.playback-time {
  margin: 0;
  color: var(--soft);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

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

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

.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-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.08);
  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:active {
  cursor: ns-resize;
}

.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-section {
  border-radius: 18px;
  padding: 18px;
}

.control-section + .control-section {
  margin-top: 18px;
}

.control-section-free {
  background: rgba(255, 248, 248, 0.64);
  border: 1px solid rgba(153, 0, 0, 0.1);
}

.control-section-pro {
  background:
    linear-gradient(180deg, rgba(179, 0, 0, 0.04) 0%, transparent 44%),
    rgba(255, 244, 244, 0.78);
  border: 1px solid rgba(153, 0, 0, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.control-section-head {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.control-section-head h3 {
  margin: 0;
  font-size: 1rem;
}

.control-section-kicker {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pro-control-panel {
  margin-top: 18px;
}

.section-head-tight {
  margin-bottom: 14px;
}

.pro-control-panel h3 {
  margin: 0;
  font-size: 1rem;
}

.pro-control-grid {
  opacity: 1;
  transition: opacity 140ms ease;
}

.pro-control-panel.is-locked .pro-control-grid {
  opacity: 0.56;
}

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

.control-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--soft);
  cursor: help;
  transform: none;
}

.info-tooltip:hover,
.info-tooltip:focus-visible {
  background: rgba(153, 0, 0, 0.08);
  color: var(--accent-strong);
  outline: none;
}

.info-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  width: min(240px, 70vw);
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(39, 21, 23, 0.96);
  color: #fff4f4;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.45;
  box-shadow: 0 14px 30px rgba(39, 21, 23, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 20;
}

.info-tooltip:hover::after,
.info-tooltip:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

.control output {
  color: var(--accent-strong);
}

.fixed-value {
  color: var(--accent-strong);
  font-size: 1.05rem;
  font-weight: 700;
}

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

select,
input[type="range"] {
  width: 100%;
}

select {
  padding: 12px 14px;
  border: 1px solid rgba(153, 0, 0, 0.22);
  border-radius: 14px;
  background: rgba(255, 250, 250, 0.92);
  color: var(--text);
}

input[type="range"] {
  accent-color: var(--accent-bright);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.section-actions {
  justify-content: center;
}

button {
  padding: 13px 18px;
  border: 1px solid rgba(153, 0, 0, 0.18);
  border-radius: 999px;
  background: rgba(153, 0, 0, 0.12);
  color: var(--text);
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, opacity 120ms ease, border-color 120ms ease;
}

button:hover:enabled {
  transform: translateY(-1px);
  background: rgba(153, 0, 0, 0.18);
  border-color: rgba(153, 0, 0, 0.34);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#analyze-generate,
#generate-button,
.download-button {
  background: linear-gradient(180deg, rgba(176, 38, 38, 0.95) 0%, rgba(123, 7, 7, 0.98) 100%);
  border-color: rgba(239, 177, 177, 0.2);
  color: #fff4f4;
  font-weight: 700;
}

#generate-button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 56px;
  padding: 0.9rem 1.45rem;
  border-color: rgba(127, 0, 0, 0.24);
  box-shadow: 0 18px 36px rgba(153, 0, 0, 0.24);
  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;
}

#analyze-generate {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  transition: opacity 140ms ease, transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.button-spinner {
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid rgba(255, 244, 244, 0.28);
  border-top-color: #fff4f4;
  border-radius: 999px;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 140ms ease, transform 140ms ease;
}

#analyze-generate.is-loading .button-spinner,
#generate-button.is-loading .button-spinner {
  opacity: 1;
  transform: scale(1);
  animation: preset-mutator-spin 1s linear infinite;
}

#analyze-generate.is-loading .button-label,
#generate-button.is-loading .button-label {
  opacity: 0.96;
}

.download-button,
.preview-button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.preview-button {
  background: rgba(255, 245, 245, 0.78);
  border-color: rgba(153, 0, 0, 0.18);
  color: var(--text);
  font-weight: 700;
}

.download-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.35rem;
  padding: 0.22rem 0.52rem;
  border-radius: 999px;
  background: rgba(255, 244, 244, 0.18);
  border: 1px solid rgba(255, 244, 244, 0.22);
  color: #fffafa;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(153, 0, 0, 0.1);
  border: 1px solid rgba(153, 0, 0, 0.18);
  color: #6a2020;
}

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

.upgrade-hint {
  margin: 14px 0 0;
  color: var(--soft);
  font-size: 0.92rem;
}

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

.analysis-grid > .panel:only-child {
  grid-column: 1 / -1;
}

.analysis-shell {
  margin-bottom: 20px;
  padding: 18px 20px;
  background: rgba(255, 248, 248, 0.56);
  border-color: rgba(153, 0, 0, 0.12);
}

.analysis-shell-head {
  margin-bottom: 0;
}

.analysis-shell.is-open .analysis-shell-head {
  margin-bottom: 16px;
}

.analysis-toggle {
  white-space: nowrap;
}

.analysis-panel {
  opacity: 1;
}

.intent-stack > .analysis-panel {
  padding: 18px;
}

.intent-stack > .analysis-panel .section-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 12px;
}

.intent-stack > .analysis-panel h2 {
  font-size: 1rem;
}

.intent-stack > .analysis-panel .muted {
  font-size: 0.78rem;
}

.intent-stack > .analysis-panel .metric-grid {
  gap: 10px;
}

.intent-stack > .analysis-panel .metric {
  padding: 12px;
  border-radius: 14px;
}

.intent-stack > .analysis-panel .metric-value {
  font-size: 0.94rem;
}

.analysis-panel .metric {
  background: rgba(255, 245, 245, 0.6);
}

.analysis-panel .metric-value {
  font-size: 1.08rem;
}

.analysis-panel .section-head,
.presets-panel .section-head {
  margin-bottom: 14px;
}

.analysis-panel h2,
.presets-panel h2 {
  font-size: 1.16rem;
}

.analysis-panel .muted,
.presets-panel .muted {
  max-width: 27rem;
  font-size: 0.84rem;
  line-height: 1.45;
}

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

.metric-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.analysis-panel .metric-label {
  margin-bottom: 0.35rem;
  font-size: 0.68rem;
}

.preset-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.presets-panel.is-pack .preset-list {
  grid-template-columns: 1fr;
  gap: 18px;
}

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

.preset-group-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 245, 245, 0.52);
  border: 1px solid rgba(153, 0, 0, 0.12);
  text-align: left;
}

.preset-group-head:hover:enabled {
  background: rgba(255, 241, 241, 0.68);
}

.preset-group-head h3 {
  margin: 0;
  font-size: 1rem;
}

.preset-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.8rem;
  margin-left: 0.45rem;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  background: rgba(209, 76, 76, 0.12);
  border: 1px solid rgba(209, 76, 76, 0.18);
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 700;
}

.preset-group-head p {
  margin: 0.25rem 0 0;
  color: var(--soft);
  font-size: 0.9rem;
  line-height: 1.45;
}

.preset-group-toggle-label {
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.preset-group-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.self-test-note {
  margin: 0 0 14px;
  color: var(--soft);
  font-size: 0.9rem;
}

.presets-panel {
  border-color: rgba(219, 127, 127, 0.32);
  box-shadow: 0 24px 54px rgba(47, 8, 10, 0.16);
}

.presets-panel.has-results {
  border-color: rgba(239, 177, 177, 0.56);
  box-shadow: 0 34px 72px rgba(72, 10, 14, 0.34);
  background:
    linear-gradient(180deg, rgba(209, 76, 76, 0.06), transparent 26%),
    var(--panel-strong);
}

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

.presets-panel.is-pack .preset-card {
  gap: 11px;
}

.preset-role {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(209, 76, 76, 0.12);
  border: 1px solid rgba(209, 76, 76, 0.2);
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.preset-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.preset-name {
  margin: 0;
  font-size: 1.1rem;
}

.presets-panel.is-pack .preset-name {
  font-size: 1rem;
}

.preset-family {
  color: var(--accent-strong);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.preset-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-quality-score {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.preset-quality-score span {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  max-width: 100%;
  padding: 0.34rem 0.58rem;
  border: 1px solid rgba(153, 0, 0, 0.14);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(153, 0, 0, 0.045);
  font-size: 0.78rem;
  line-height: 1.2;
}

.preset-quality-score strong {
  flex: 0 0 auto;
  color: var(--accent-strong);
}

.preset-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.56rem;
  border-radius: 999px;
  background: rgba(255, 245, 245, 0.82);
  border: 1px solid rgba(153, 0, 0, 0.12);
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 600;
}

.presets-panel.is-pack .preset-summary,
.presets-panel.is-pack .preset-quality {
  font-size: 0.92rem;
}

.param-list {
  display: grid;
  gap: 8px;
}

.presets-panel.is-pack .param-list {
  gap: 6px;
}

.param-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
}

.presets-panel.is-pack .param-row {
  font-size: 0.88rem;
  padding-bottom: 6px;
}

.param-row span:last-child {
  color: var(--accent-strong);
}

.empty-state {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.paid-feature-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 18px 22px;
  align-items: start;
  margin-bottom: 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);
}

.paid-feature-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);
}

.paid-feature-kicker {
  margin: 0 0 0.45rem;
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.paid-feature-copy p {
  margin: 0;
  color: var(--muted);
}

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

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

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

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

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

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

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

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

.paid-feature-note {
  margin-top: 0.6rem !important;
  color: var(--soft) !important;
  font-size: 0.9rem;
  line-height: 1.5;
}

.paid-feature-audience {
  margin: 0 0 0.55rem !important;
  color: var(--muted) !important;
  font-weight: 500;
}

.paid-feature-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);
}

.paid-feature-toggle {
  min-width: 0;
}

.paid-feature-meta {
  margin: 0;
  color: var(--soft);
  font-size: 0.8rem;
  line-height: 1.45;
}

.paid-feature-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);
}

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

.paid-feature-unlock-button {
  white-space: nowrap;
}

.paid-feature-unlock-note {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  color: var(--soft);
  font-size: 0.84rem;
  line-height: 1.45;
}

.paid-feature-preview {
  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);
}

.paid-feature-preview-badge {
  margin: 0 0 0.35rem;
  color: #14893c;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.paid-feature-preview-note {
  margin: 0;
  color: var(--soft);
  line-height: 1.5;
}

.paid-feature-preview-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.paid-feature-download-note {
  margin: 0;
  color: var(--soft);
  font-size: 0.84rem;
  line-height: 1.4;
}

.app-footer {
  padding: 1.1rem 0 0.2rem;
  color: var(--soft);
  font-size: 0.92rem;
  text-align: center;
}

.app-footer p {
  margin: 0;
}

.app-version {
  margin-top: 0.3rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(88, 60, 64, 0.72);
}

@media (max-width: 960px) {
  .site-nav {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .paid-feature-panel {
    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;
  }

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

  .paid-feature-unlock,
  .paid-feature-actions {
    justify-content: flex-start;
  }

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

  .nav-brand-wordmark {
    gap: 0.55rem;
  }

  .nav-brand-copy {
    text-align: center;
  }

  .workspace,
  .workflow-grid,
  .analysis-grid,
  .paid-feature-panel,
  .mutation-macro,
  .mode-proof-grid,
  .meta-grid,
  .control-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

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

  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .mutation-macro {
    grid-template-columns: 1fr;
    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);
  }

  .info-tooltip::after {
    right: 0;
    left: auto;
    width: min(220px, calc(100vw - 48px));
    transform: none;
  }

  .info-tooltip:hover::after,
  .info-tooltip:focus-visible::after {
    transform: translateY(-2px);
  }
}

.panel,
.waveform-panel,
.control,
.meta-grid > div,
.preset-card,
.suite-card,
.paid-feature-card,
.paid-feature-panel,
.metric-grid > 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"] .paid-feature-card,
[data-theme="dark"] .paid-feature-panel,
  [data-theme="dark"] .metric-grid > div,
  [data-theme="dark"] .mode-proof-grid > div,
  [data-theme="dark"] .mutation-macro,
  [data-theme="dark"] .paid-benefit-grid div,
[data-theme="dark"] .paid-feature-actions,
[data-theme="dark"] .paid-feature-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"] .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);
}
