:root {
  color-scheme: dark;
  --ink: #eff8f3;
  --muted: #9fb7ad;
  --panel: rgba(11, 21, 19, 0.82);
  --panel-strong: rgba(14, 32, 30, 0.94);
  --line: rgba(168, 231, 204, 0.2);
  --aqua: #7cf7d4;
  --gold: #f2c36b;
  --rose: #e77f9c;
  --leaf: #8ddf7f;
  --night: #07100f;
  --blueprint: #102d35;
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 12%, rgba(124, 247, 212, 0.11), transparent 32%),
    linear-gradient(135deg, #06100f 0%, #0a1614 39%, #18131d 70%, #07100f 100%);
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.studio-shell {
  min-height: 100vh;
  padding: clamp(16px, 3vw, 32px);
}

.workbench {
  width: min(1480px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.launch-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 16, 15, 0.72);
}

.launch-strip p {
  margin: 0;
  color: #dbece4;
  text-align: left;
  font-size: 0.94rem;
}

.launch-strip a {
  flex: 0 0 auto;
  color: #07100f;
  text-decoration: none;
  font-weight: 900;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--gold);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--aqua);
  font-size: 0.77rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 5.4rem);
  line-height: 0.92;
}

h2 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.status-strip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(8, 19, 17, 0.78);
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--leaf);
  box-shadow: 0 0 20px var(--leaf);
}

.control-grid {
  display: grid;
  grid-template-columns: minmax(290px, 360px) minmax(440px, 1fr) minmax(310px, 430px);
  gap: 16px;
  align-items: stretch;
}

.input-panel,
.output-panel,
.visual-stage {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.input-panel,
.output-panel {
  padding: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.section-title p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.icon-shell {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid rgba(124, 247, 212, 0.28);
  border-radius: 6px;
  color: var(--aqua);
  background: rgba(124, 247, 212, 0.08);
}

label,
fieldset {
  display: grid;
  gap: 7px;
  margin: 0 0 13px;
  color: #d7e6df;
  font-size: 0.82rem;
  font-weight: 760;
}

fieldset {
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 7px;
  color: #d7e6df;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(168, 231, 204, 0.24);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(3, 10, 9, 0.68);
  padding: 0 11px;
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(124, 247, 212, 0.75);
  box-shadow: 0 0 0 3px rgba(124, 247, 212, 0.12);
}

.split-row {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.segmented label {
  margin: 0;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  place-items: center;
  min-height: 36px;
  border: 1px solid rgba(168, 231, 204, 0.2);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.segmented input:checked + span {
  color: #07100f;
  border-color: transparent;
  background: linear-gradient(135deg, var(--aqua), var(--gold));
}

.primary-action {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  color: #07100f;
  font-weight: 900;
  cursor: pointer;
  background: linear-gradient(135deg, var(--aqua), var(--gold) 52%, var(--rose));
}

.secondary-action {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  border: 1px solid rgba(124, 247, 212, 0.35);
  border-radius: 6px;
  color: var(--aqua);
  font-weight: 860;
  cursor: pointer;
  background: rgba(124, 247, 212, 0.07);
}

.visual-stage {
  overflow: hidden;
  min-height: 680px;
  background:
    linear-gradient(rgba(124, 247, 212, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 247, 212, 0.07) 1px, transparent 1px),
    radial-gradient(circle at 50% 35%, rgba(242, 195, 107, 0.14), transparent 38%),
    var(--blueprint);
  background-size: 34px 34px, 34px 34px, auto, auto;
}

.skyline {
  position: relative;
  min-height: 680px;
}

.audio-console {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 72px minmax(120px, 180px);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(124, 247, 212, 0.28);
  border-radius: 8px;
  background: rgba(4, 13, 12, 0.72);
  backdrop-filter: blur(14px);
}

.audio-console strong,
.audio-console span {
  display: block;
}

.audio-console strong {
  font-size: 0.86rem;
}

.audio-console span,
.audio-console label {
  color: var(--muted);
  font-size: 0.74rem;
}

.audio-console button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  color: #07100f;
  font-weight: 900;
  cursor: pointer;
  background: var(--aqua);
}

.audio-console input {
  min-height: 26px;
  padding: 0;
  accent-color: var(--aqua);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 680px;
}

.bagua-map {
  position: absolute;
  left: 50%;
  top: 48%;
  display: grid;
  grid-template-columns: repeat(3, minmax(62px, 1fr));
  width: min(58%, 430px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotateX(58deg) rotateZ(-3deg);
  transform-origin: center;
  border: 1px solid rgba(242, 195, 107, 0.55);
  box-shadow: 0 0 42px rgba(242, 195, 107, 0.18);
}

.bagua-map span,
.bagua-map strong {
  display: grid;
  place-items: center;
  min-width: 0;
  border: 1px solid rgba(242, 195, 107, 0.25);
  color: rgba(255, 238, 198, 0.88);
  font-size: clamp(0.58rem, 1vw, 0.78rem);
  text-align: center;
  text-transform: uppercase;
}

.bagua-map strong {
  color: var(--aqua);
}

.scan-line {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(124, 247, 212, 0.18) 50%, transparent 100%);
  height: 120px;
  animation: scan 5s infinite ease-in-out;
  pointer-events: none;
}

@keyframes scan {
  0% {
    transform: translateY(-140px);
  }
  100% {
    transform: translateY(720px);
  }
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.metric-row div {
  min-height: 76px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
}

.metric-row span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
}

.metric-row strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1rem, 2vw, 1.55rem);
  line-height: 1;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-bottom: 12px;
}

.tab-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.035);
}

.tab-button.active {
  color: #07100f;
  border-color: transparent;
  background: var(--aqua);
}

.output-box {
  min-height: 415px;
  max-height: 500px;
  overflow: auto;
  white-space: pre-wrap;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(168, 231, 204, 0.2);
  border-radius: 6px;
  color: #dffcf0;
  background: rgba(3, 10, 9, 0.72);
  font-size: 0.86rem;
  line-height: 1.55;
}

@media (max-width: 1180px) {
  .control-grid {
    grid-template-columns: 1fr 1fr;
  }

  .visual-stage {
    grid-column: 1 / -1;
    order: -1;
  }

  .skyline,
  canvas,
  .visual-stage {
    min-height: 520px;
  }
}

@media (max-width: 780px) {
  .studio-shell {
    padding: 12px;
  }

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

  .launch-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .launch-strip a {
    text-align: center;
  }

  .control-grid,
  .split-row,
  .metric-row {
    grid-template-columns: 1fr;
  }

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

  .skyline,
  canvas,
  .visual-stage {
    min-height: 430px;
  }

  .bagua-map {
    width: 82%;
  }

  .audio-console {
    grid-template-columns: 1fr;
  }
}
