:root {
  color-scheme: dark;
  --bg-1: #050912;
  --bg-2: #111827;
  --panel: rgba(12, 18, 34, 0.86);
  --panel-edge: rgba(255, 255, 255, 0.08);
  --text: #f5f7fb;
  --muted: #93a0bb;
  --soft: rgba(255, 255, 255, 0.06);
  --accent: #8aa0ff;
  --accent-strong: #c9d4ff;
  --gold: #f0cd8a;
  --gold-soft: rgba(240, 205, 138, 0.14);
  --success: #8de3a8;
  --warning: #ffbf72;
  --warning-bg: rgba(255, 191, 114, 0.14);
  --danger: #ff9b9b;
  --danger-bg: rgba(255, 155, 155, 0.18);
  --track: rgba(255, 255, 255, 0.08);
  --shadow: 0 32px 96px rgba(0, 0, 0, 0.46);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(138, 160, 255, 0.2), transparent 30%),
    radial-gradient(circle at top right, rgba(240, 205, 138, 0.14), transparent 28%),
    linear-gradient(180deg, var(--bg-2), var(--bg-1) 55%, #03060c);
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

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

.top-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid rgba(240, 205, 138, 0.28);
  border-radius: 999px;
  color: #f6ddad;
  background: rgba(240, 205, 138, 0.06);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.74rem;
  font-weight: 700;
}

.back-link:hover {
  background: rgba(240, 205, 138, 0.12);
}

.docs-link {
  border-color: rgba(138, 160, 255, 0.3);
  color: var(--accent-strong);
  background: rgba(138, 160, 255, 0.1);
}

.docs-link:hover {
  background: rgba(138, 160, 255, 0.18);
}

.studio-panel {
  position: relative;
  padding: 26px;
  border: 1px solid var(--panel-edge);
  border-radius: 36px;
  background:
    linear-gradient(145deg, rgba(17, 24, 39, 0.95), rgba(8, 12, 22, 0.96)),
    var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  isolation: isolate;
}

.studio-panel::before,
.studio-panel::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(16px);
  pointer-events: none;
  z-index: -1;
}

.studio-panel::before {
  width: 260px;
  height: 260px;
  top: -120px;
  right: -40px;
  background: rgba(138, 160, 255, 0.12);
}

.studio-panel::after {
  width: 280px;
  height: 280px;
  bottom: -170px;
  left: -100px;
  background: rgba(240, 205, 138, 0.09);
}

.policy-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 14px 16px;
  border-radius: 22px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
}

.policy-banner strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.94rem;
}

.policy-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.policy-banner.recommended {
  border-color: rgba(141, 227, 168, 0.2);
  background: rgba(141, 227, 168, 0.08);
}

.policy-banner.not-tested {
  border-color: rgba(255, 191, 114, 0.22);
  background: rgba(255, 191, 114, 0.08);
}

.policy-banner.not-recommended {
  border-color: rgba(255, 155, 155, 0.22);
  background: rgba(255, 155, 155, 0.08);
}

.policy-inline-button {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: start;
  margin-bottom: 28px;
}

.hero-mark {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 28px;
  background: linear-gradient(135deg, #90a7ff, #f0cd8a);
  color: #11162a;
  font-family: "Italiana", Georgia, serif;
  font-size: 2.45rem;
  letter-spacing: 0.08em;
  box-shadow: 0 22px 44px rgba(138, 160, 255, 0.22);
}

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

.hero-topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.eyebrow,
.section-eyebrow {
  margin: 0;
  color: #f0cd8a;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 800;
}

.hero h1 {
  margin: 10px 0 0;
  font-family: "Italiana", Georgia, serif;
  font-size: clamp(2.8rem, 6vw, 4.9rem);
  letter-spacing: 0.06em;
  line-height: 0.95;
  text-transform: uppercase;
}

.subtitle {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.75;
  font-size: 0.98rem;
}

.session-note {
  margin: 12px 0 0;
  color: #ced8ef;
  font-size: 0.86rem;
}

.status-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.policy-chip,
.launch-chip,
.chip,
.time-pill,
.preset-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 800;
}

.policy-chip,
.launch-chip,
.preset-status {
  padding: 8px 12px;
}

.policy-chip.recommended {
  color: #b6f2c7;
  background: rgba(141, 227, 168, 0.12);
}

.policy-chip.not-tested {
  color: #ffd7a6;
  background: rgba(255, 191, 114, 0.12);
}

.policy-chip.not-recommended {
  color: #ffc0c0;
  background: rgba(255, 155, 155, 0.14);
}

.launch-chip {
  color: #d7e0ff;
  background: rgba(138, 160, 255, 0.14);
}

.notice {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  line-height: 1.5;
}

.notice-error {
  color: var(--danger);
  border-color: rgba(255, 155, 155, 0.24);
  background: var(--danger-bg);
}

.notice-warning {
  color: var(--warning);
  border-color: rgba(255, 191, 114, 0.24);
  background: var(--warning-bg);
}

.upload-shell {
  margin-top: 12px;
}

.upload-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 340px;
  padding: 36px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 32px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.02), rgba(138, 160, 255, 0.08)),
    rgba(12, 18, 34, 0.6);
  text-align: center;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.upload-card:hover {
  transform: translateY(-2px);
  border-color: rgba(138, 160, 255, 0.48);
  box-shadow: 0 24px 64px rgba(138, 160, 255, 0.16);
}

.upload-kicker {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #cad3e7;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 800;
}

.upload-card strong,
.drop-overlay-card strong {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.upload-card span:last-of-type {
  color: var(--muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

.upload-card small {
  color: #b7c2da;
  font-size: 0.84rem;
  line-height: 1.6;
}

.workspace {
  display: grid;
  gap: 20px;
}

.toolbar-card,
.waveform-card,
.preset-card,
.control-card,
.export-card {
  padding: 22px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.toolbar-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.track-meta {
  min-width: 0;
}

.chip {
  padding: 6px 10px;
  background: rgba(138, 160, 255, 0.12);
  color: #c9d3f0;
}

.track-meta h2 {
  margin: 12px 0 0;
  font-size: 1.12rem;
  letter-spacing: -0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-actions,
.waveform-actions,
.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.secondary-button,
.pill-button {
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.secondary-button:hover,
.pill-button:hover {
  background: rgba(255, 255, 255, 0.11);
}

.secondary-button.quiet {
  color: #f2c6c6;
  background: rgba(255, 155, 155, 0.08);
}

.secondary-button.quiet:hover {
  background: rgba(255, 155, 155, 0.14);
}

.compare-button.active {
  color: #11162a;
  background: linear-gradient(135deg, #ffffff, #d9deea);
}

.waveform-card {
  overflow: hidden;
}

.waveform-header,
.waveform-footer,
.preset-header,
.control-header,
.export-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.waveform-header h3,
.preset-header h3,
.export-header h3 {
  margin: 8px 0 0;
  font-size: 1.18rem;
  letter-spacing: -0.03em;
}

.waveform-side-meta {
  display: flex;
  gap: 10px;
}

.time-pill {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #edf2ff;
}

.time-pill.subdued {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.waveform-panel {
  position: relative;
  height: 220px;
  margin: 18px 0 16px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    rgba(6, 10, 18, 0.82);
}

#waveform-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.waveform-region,
.waveform-playhead,
.loop-handle {
  position: absolute;
  top: 0;
  bottom: 0;
}

.waveform-region {
  border-left: 1px solid rgba(240, 205, 138, 0.65);
  border-right: 1px solid rgba(240, 205, 138, 0.65);
  background: rgba(240, 205, 138, 0.12);
  pointer-events: none;
}

.waveform-playhead {
  width: 2px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.34);
  pointer-events: none;
}

.loop-handle {
  width: 30px;
  padding: 0;
  border-radius: 0;
  transform: translateX(-50%);
  background: transparent;
  color: transparent;
}

.loop-handle::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 50%;
  width: 3px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #f0cd8a;
  box-shadow: 0 0 18px rgba(240, 205, 138, 0.34);
}

.loop-handle::after {
  content: attr(aria-label);
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 22px;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(240, 205, 138, 0.9);
  color: #11162a;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.loop-handle.start::after {
  content: "L";
}

.loop-handle.end::after {
  content: "R";
}

.waveform-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
  font-size: 0.86rem;
}

.waveform-stats strong {
  color: var(--text);
}

.preset-status {
  color: #d7e0ff;
  background: rgba(138, 160, 255, 0.12);
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.preset-button {
  padding: 14px 12px;
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
  color: #d8e0f6;
  text-align: left;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
}

.preset-button:hover {
  background:
    linear-gradient(145deg, rgba(138, 160, 255, 0.22), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.05);
}

.preset-button.active {
  color: #11162a;
  background: linear-gradient(135deg, #f7e6b5, #8aa0ff);
}

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

.control-label {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  font-weight: 800;
}

.control-card h3 {
  margin: 10px 0 0;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: -0.05em;
}

.control-hint,
.export-note {
  margin: 0;
  color: #a5aec4;
  font-size: 0.78rem;
  line-height: 1.5;
}

.range-input {
  --fill: 0%;
  --range-accent: #8aa0ff;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background:
    linear-gradient(
      to right,
      var(--range-accent) 0%,
      var(--range-accent) var(--fill),
      var(--track) var(--fill),
      var(--track) 100%
    );
  outline: none;
}

.range-indigo {
  --range-accent: #8aa0ff;
}

.range-amber {
  --range-accent: #f0cd8a;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
}

.range-input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
}

.export-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.field input,
.field select {
  width: 100%;
  padding: 14px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(138, 160, 255, 0.36);
  outline-offset: 2px;
}

.transport-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.transport-button {
  min-width: 120px;
  padding: 15px 18px;
  border-radius: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.transport-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.transport-primary {
  min-width: 164px;
  padding: 20px 28px;
  background: linear-gradient(135deg, #ffffff, #d9deea);
  color: #11162a;
  box-shadow: 0 20px 40px rgba(255, 255, 255, 0.14);
}

.transport-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.transport-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.footer-row {
  justify-content: center;
}

.pill-button {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

.pill-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f6ddad;
  background: rgba(240, 205, 138, 0.08);
}

.pill-link:hover {
  background: rgba(240, 205, 138, 0.14);
}

.drop-overlay,
.overlay,
.policy-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 7, 13, 0.86);
  backdrop-filter: blur(14px);
}

.drop-overlay {
  z-index: 1800;
  background: rgba(7, 12, 23, 0.72);
}

.drop-overlay-card,
.overlay-card,
.policy-gate-card {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 30px 34px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(17, 24, 39, 0.92);
  text-align: center;
  box-shadow: var(--shadow);
}

.drop-overlay-card {
  min-width: min(520px, calc(100vw - 48px));
}

.overlay-card p {
  margin: 0;
  font-family: "Italiana", Georgia, serif;
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.spinner {
  width: 58px;
  height: 58px;
  border: 4px solid rgba(255, 255, 255, 0.12);
  border-top-color: #f0cd8a;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.policy-gate-card {
  width: min(560px, calc(100vw - 36px));
  justify-items: stretch;
  gap: 14px;
  text-align: left;
}

.policy-gate-card h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.04em;
}

.policy-gate-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.policy-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

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

@media (max-width: 980px) {
  .preset-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .export-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 18px, 100%);
    padding: 18px 0 28px;
  }

  .studio-panel {
    padding: 20px 16px;
    border-radius: 28px;
  }

  .policy-banner,
  .toolbar-card,
  .waveform-header,
  .waveform-footer,
  .preset-header,
  .control-header,
  .export-header,
  .hero-topline {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-mark {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    font-size: 2rem;
  }

  .track-actions,
  .waveform-actions,
  .status-cluster,
  .policy-gate-actions {
    width: 100%;
    justify-content: flex-start;
  }

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

  .waveform-panel {
    height: 190px;
  }

  .transport-row {
    gap: 12px;
  }

  .transport-button,
  .policy-gate-actions .transport-button,
  .policy-gate-actions .pill-link {
    width: 100%;
  }
}
