:root {
  color-scheme: dark;
  --bg: #1c1e22;
  --bg-accent: #15171a;
  --ink: #ffffff;
  --muted: #cbd5e1;
  --panel: rgba(61, 64, 72, 0.9);
  --panel-border: rgba(255, 255, 255, 0.1);
  --primary: #5eead4;
  --primary-strong: #2dd4bf;
  --accent-blue: #7dd3fc;
  --accent-orange: #fdba74;
  --danger: #f87171;
  --danger-strong: #ef4444;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.05), transparent 60%),
    var(--bg);
}

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

.shell {
  width: min(1320px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.hero {
  margin-bottom: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
}

.hero h1 {
  margin: 0;
  max-width: 24ch;
  font-size: clamp(2.8rem, 6vw, 5.8rem);
  line-height: 0.94;
  color: #ff9933;
}

.hero h1 a,
.hero h1 a:visited,
.hero h1 a:hover,
.hero h1 a:active {
  color: #ff9933;
  text-decoration: none;
}

.intro {
  max-width: 78rem;
  margin: 1rem 0 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.controls-panel {
  padding: 1.2rem;
  margin-bottom: 1.25rem;
}

.controls-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: center;
}

.playback-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 1rem;
}

.secondary-actions {
  display: flex !important;
  width: 100%;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.playback-bar .field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 160px;
}

.playback-bar .field span {
  white-space: nowrap;
}

.playback-bar .button-row {
  flex: 0 0 auto;
}

.control-stack {
  display: grid;
  gap: 0.35rem;
}

.caption,
.status-label,
.field span,
.guide-content p {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.caption,
.guide-content p {
  margin-top: 0.8rem;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 500;
}

.toggle input {
  inline-size: 1.1rem;
  block-size: 1.1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field input,
.field select,
.file-field input[type="file"] {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--ink);
}

.import-status {
  margin: 1rem 0 0;
}

.track-panel {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.track-panel-heading {
  margin-bottom: 0.25rem;
}

.track-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.track-list {
  display: grid;
  gap: 0;
  margin-top: 0.9rem;
  max-width: 680px;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.track-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  align-items: start;
  padding: 0.55rem 0.8rem;
  border-top: 1px solid var(--panel-border);
  background: transparent;
}

.track-item:first-child {
  border-top: 0;
}

.track-item input {
  margin-top: 0.1rem;
}

.track-item strong {
  font-size: 0.94rem;
  line-height: 1.2;
  color: var(--primary);
}

.track-item span {
  margin-left: 0.45rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.3;
}

.button-row {
  display: inline-flex;
  gap: 0.75rem;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 140ms ease,
    background-color 140ms ease,
    color 140ms ease,
    opacity 140ms ease;
}

button:hover:enabled {
  transform: translateY(-1px);
}

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

.primary {
  background: var(--primary);
  color: #1f1d1a;
}

.primary:hover:enabled {
  background: var(--primary-strong);
}

.secondary,
.ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  border: 1px solid var(--panel-border);
}

.ghost:hover:enabled {
  background: rgba(255, 255, 255, 0.1);
}

.danger {
  background: var(--danger);
  color: #fff;
}

.danger:hover:enabled {
  background: var(--danger-strong);
}

.status-strip {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.status-strip strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.02rem;
  color: var(--accent-blue);
}

.editor-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.25rem;
}

.editor-grid .panel,
.notes {
  padding: 1.2rem;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.panel-actions {
  display: inline-flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.panel-heading h2,
.guide-panel h2,
.controls-panel h2,
.notes h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #ff9933;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.controls-panel h2 {
  margin-bottom: 0.9rem;
}

textarea,
.log-output {
  width: 100%;
  min-height: 400px;
  border-radius: 20px;
  border: 1px solid var(--panel-border);
  background: #2a2d33;
  color: #f5f2ea;
  padding: 1rem;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.5;
}

textarea {
  resize: vertical;
}

.log-output {
  margin: 0;
  max-height: 400px;
  overflow: auto;
  white-space: pre-wrap;
}

.guide-panel,
.notes {
  margin-top: 1.25rem;
  padding: 1.2rem;
}

.guide-content p,
.guide-content ol {
  margin: 0.8rem 0;
  line-height: 1.6;
}

.guide-content ol {
  padding-left: 1.25rem;
}

.guide-content li {
  margin-bottom: 0.4rem;
}

.guide-image-wrap {
  margin: 1.25rem auto 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  background: rgba(0, 0, 0, 0.2);
  max-width: 540px;
}

.guide-image-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

.notes ul {
  margin: 0.8rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.6;
}

code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
  background: rgba(255, 255, 255, 0.08);
  color: var(--primary);
  border-radius: 0.4rem;
  padding: 0.1rem 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.footer {
  text-align: center;
  margin: 3rem 0 4rem;
  color: var(--muted);
}

.footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 150ms ease, text-decoration 150ms ease;
}

.footer a:hover {
  color: #ff9933;
  text-decoration: underline;
}

@media (max-width: 900px) {
  .controls-grid,
  .playback-bar,
  .editor-grid,
  .status-strip {
    grid-template-columns: 1fr;
  }

  .button-row {
    width: 100%;
  }

  .button-row button {
    flex: 1;
  }

  .hero h1 {
    max-width: 100%;
  }
}
