:root {
  color-scheme: dark;
  --bg: #101114;
  --panel: #191b21;
  --panel-2: #20232b;
  --line: #343845;
  --text: #f4f0e8;
  --muted: #b8b1a6;
  --amber: #f2b84b;
  --green: #74d38b;
  --red: #f05d5d;
  --cyan: #72d2db;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(114, 210, 219, 0.08), transparent 42%),
    linear-gradient(315deg, rgba(242, 184, 75, 0.08), transparent 38%),
    var(--bg);
  color: var(--text);
}

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

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-height: 118px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 720px;
  font-size: clamp(2rem, 5vw, 4.8rem);
  line-height: 0.94;
}

h2 {
  font-size: 1.15rem;
}

.status-pill {
  min-width: 132px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #14161b;
  color: var(--green);
  text-align: center;
  font-weight: 800;
}

.status-stack {
  display: grid;
  gap: 8px;
  min-width: 160px;
}

.render-progress {
  display: none;
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #08090c;
}

.render-progress.active {
  display: block;
}

.render-progress i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--amber));
  transition: width 180ms ease;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  gap: 18px;
  padding-top: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 92%, black);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.26);
}

.transport-panel,
.mixer-panel {
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

#clock {
  min-width: 78px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0c0d10;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.drop-zone {
  display: grid;
  gap: 8px;
  min-height: 138px;
  padding: 22px;
  border: 1px dashed #5d6371;
  border-radius: 8px;
  background: var(--panel-2);
  cursor: pointer;
}

.drop-zone:focus-within,
.drop-zone:hover {
  border-color: var(--amber);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.drop-title {
  align-self: end;
  font-size: 1.45rem;
  font-weight: 850;
}

.drop-copy {
  max-width: 46ch;
  color: var(--muted);
}

.visualizer-panel {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.visual-row {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111318;
}

.visual-row.live {
  background: #141a18;
  border-color: #33443a;
}

.visual-row.master-preview {
  margin-top: 18px;
  background: #17151a;
  border-color: #44364a;
}

.transcript-row {
  background: #11161a;
}

.transcript-box {
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid #252a34;
  border-radius: 6px;
  background: #090a0d;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
  resize: vertical;
  width: 100%;
}

.visual-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.visual-title output {
  color: var(--cyan);
}

.wave-box {
  --wave-level: 0%;
  --wave-color: var(--cyan);
  --playhead: -2px;
  display: block;
  width: 100%;
  height: 34px;
  max-height: 34px;
  overflow: hidden;
  position: relative;
  border-radius: 6px;
  border: 1px solid #252a34;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--wave-color) 48%, transparent), color-mix(in srgb, var(--wave-color) 18%, transparent)) 0 0 / var(--wave-level) 100% no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    #090a0d;
  background-size: var(--wave-level) 100%, 100% 25%, 8.33% 100%, auto;
}

.wave-box::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--playhead);
  width: 2px;
  background: var(--red);
  opacity: 0;
}

.wave-box.playing::after {
  opacity: 1;
}

.master-waveform {
  height: 48px;
  max-height: 48px;
}

.voice-light {
  width: 100%;
  height: 28px;
  border: 1px solid #303743;
  border-radius: 4px;
  background: #050608;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  transition: background 45ms linear, box-shadow 45ms linear;
}

.voice-light.talking {
  background: #ffffff;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.72);
}

.loudness-strip {
  height: 8px;
  overflow: hidden;
  border: 1px solid #2d313b;
  border-radius: 999px;
  background: #07080a;
}

.loudness-strip i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green) 0%, var(--green) 58%, var(--amber) 78%, var(--red) 100%);
  transition: width 60ms linear;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.tool-button,
.small-button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #262a33;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 14px;
}

.small-button {
  min-height: 34px;
  padding: 0 12px;
}

.tool-button:hover,
.small-button:hover {
  border-color: #687080;
}

.tool-button:disabled,
.small-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.primary {
  background: #3b2427;
  border-color: #6d3036;
}

.accent {
  background: #243638;
  border-color: #38686d;
}

.tuned {
  background: #30243b;
  border-color: #5a3c78;
}

.remix {
  background: #343016;
  border-color: #756729;
}

.icon-dot,
.icon-square,
.icon-play,
.icon-wave,
.icon-tune,
.icon-remix {
  display: inline-block;
  flex: 0 0 auto;
}

.icon-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--red);
}

.icon-square {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--text);
}

.icon-play {
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid var(--green);
}

.icon-wave {
  width: 24px;
  height: 14px;
  border-top: 3px solid var(--cyan);
  border-bottom: 3px solid var(--cyan);
  border-radius: 50%;
}

.icon-tune {
  width: 18px;
  height: 18px;
  border: 3px solid #d087ff;
  border-left-color: transparent;
  border-radius: 50%;
  transform: rotate(-28deg);
}

.icon-remix {
  position: relative;
  width: 20px;
  height: 16px;
  border-top: 3px solid var(--amber);
  border-bottom: 3px solid var(--amber);
}

.icon-remix::before,
.icon-remix::after {
  content: "";
  position: absolute;
  right: -1px;
  width: 7px;
  height: 7px;
  border-right: 3px solid var(--amber);
  border-bottom: 3px solid var(--amber);
  transform: rotate(-45deg);
}

.icon-remix::before {
  top: -7px;
}

.icon-remix::after {
  bottom: -7px;
}

.audio-stack {
  display: grid;
  gap: 12px;
}

.audio-stack label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

audio {
  width: 100%;
  min-height: 42px;
}

.download-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid #6f5c2d;
  border-radius: 7px;
  background: #332b1b;
  color: var(--text);
  font-weight: 850;
  text-decoration: none;
}

.download-link.disabled {
  pointer-events: none;
  opacity: 0.45;
}

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

.download-grid .download-link {
  min-height: 42px;
  padding: 0 10px;
  text-align: center;
}

.meters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.meter-block {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #0c0d10;
  border: 1px solid #2d313b;
}

.meter i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--amber), var(--red));
  transition: width 80ms linear;
}

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

.control {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #15171c;
}

.control span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 22px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
}

output {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

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

select {
  width: 100%;
  min-height: 34px;
  border: 1px solid #3c414e;
  border-radius: 6px;
  background: #0d0f13;
  color: var(--text);
  padding: 0 10px;
}

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

.timing-buttons .small-button {
  min-height: 32px;
  font-size: 0.86rem;
}

.tips {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  padding: 13px;
  border-left: 3px solid var(--amber);
  background: #211d17;
  color: var(--muted);
}

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

@media (max-width: 850px) {
  .topbar {
    display: grid;
    align-items: start;
  }

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

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

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

  .tips {
    display: grid;
  }
}
