:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #111416;
  color: #f3f0e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 7px;
  color: #101214;
  background: #f1c84b;
  cursor: pointer;
  font-weight: 750;
}

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

.app-shell {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(17, 20, 22, 0.1), #111416 70%),
    radial-gradient(circle at top left, rgba(44, 122, 112, 0.22), transparent 34%),
    #111416;
}

.preview-band {
  padding: 24px;
}

.preview-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  max-width: 1320px;
  margin: 0 auto;
}

.preview-pane {
  min-height: 360px;
  aspect-ratio: 16 / 9;
  background: #050607;
  border: 1px solid #2b3134;
  border-radius: 8px;
  overflow: hidden;
}

.youtube-frame,
.youtube-frame iframe {
  width: 100%;
  height: 100%;
}

.empty-preview {
  display: grid;
  height: 100%;
  min-height: 360px;
  place-items: center;
  color: #9aa3a6;
  text-align: center;
  padding: 24px;
}

.controls-pane {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-left: 1px solid #343b3f;
  background: rgba(20, 24, 26, 0.72);
}

.controls-pane label {
  color: #e6e0d2;
  font-size: 0.9rem;
  font-weight: 750;
}

.controls-pane input[type="text"],
.controls-pane input:not([type]) {
  width: 100%;
}

#youtube-url {
  width: 100%;
  border: 1px solid #3d464b;
  border-radius: 7px;
  background: #0b0d0e;
  color: #f3f0e8;
  padding: 12px;
  outline: none;
}

#youtube-url:focus {
  border-color: #f1c84b;
}

.drop-zone {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 18px;
  place-items: center;
  border: 1px dashed #728083;
  border-radius: 8px;
  background: #171d1f;
  text-align: center;
}

.drop-zone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.drop-zone label {
  cursor: pointer;
  color: #f3f0e8;
}

.drop-zone small {
  color: #95a2a5;
}

.drop-zone.is-uploading {
  border-color: #f1c84b;
}

.audio-preview {
  width: 100%;
}

.sync-readout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid #343b3f;
  border-bottom: 1px solid #343b3f;
}

.sync-readout span {
  color: #aab2b5;
}

.sync-readout strong {
  font-size: 1.25rem;
}

.transport {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.transport button {
  min-height: 42px;
}

.transport button + button {
  background: #d6ddd9;
}

.finalize-panel {
  display: grid;
  gap: 10px;
  padding-top: 6px;
}

.finalize-panel button,
.download-button {
  display: grid;
  min-height: 42px;
  place-items: center;
  border-radius: 7px;
  background: #64d2c8;
  color: #071011;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.render-status {
  min-height: 20px;
  color: #aab2b5;
  font-size: 0.86rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.render-status.is-error {
  color: #ff9b8f;
}

.finalize-note {
  margin: 0;
  color: #8e999c;
  font-size: 0.78rem;
  line-height: 1.45;
}

.timeline-band {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px 32px;
}

.timeline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

.timeline-toolbar div {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.timeline-toolbar span {
  color: #aab2b5;
}

.timeline-toolbar button {
  min-width: 110px;
  min-height: 38px;
}

.timeline-scroll {
  position: relative;
  overflow-x: auto;
  border: 1px solid #30383b;
  border-radius: 8px;
  background: #15191b;
}

.playhead {
  position: absolute;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 2px;
  height: 100%;
  min-height: 200px;
  padding: 0;
  border-radius: 0;
  background: #ffffff;
  color: #111416;
  touch-action: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 0 18px rgba(255, 255, 255, 0.34);
}

.playhead::before {
  content: "";
  position: absolute;
  top: 0;
  width: 14px;
  height: 14px;
  border-radius: 0 0 4px 4px;
  background: #ffffff;
}

.playhead span {
  position: absolute;
  top: 18px;
  left: 8px;
  min-width: 58px;
  padding: 4px 6px;
  border-radius: 5px;
  background: #ffffff;
  color: #111416;
  font-size: 0.75rem;
  font-weight: 850;
  white-space: nowrap;
}

.ruler {
  position: relative;
  height: 36px;
  border-bottom: 1px solid #2d3437;
}

.ruler span {
  position: absolute;
  top: 10px;
  color: #879195;
  font-size: 0.78rem;
}

.track-row {
  display: flex;
  border-bottom: 1px solid #2d3437;
}

.track-row:last-child {
  border-bottom: 0;
}

.track-label {
  flex: 0 0 90px;
  display: grid;
  place-items: center;
  color: #e5dfd2;
  background: #101315;
  border-right: 1px solid #2d3437;
  font-weight: 800;
}

.track-lane {
  position: relative;
  height: 82px;
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 80px 100%;
}

.clip {
  position: absolute;
  top: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 52px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #071011;
  cursor: grab;
  user-select: none;
  touch-action: none;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.clip:active {
  cursor: grabbing;
}

.clip span {
  overflow: hidden;
  flex: 1 1 auto;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mute-toggle {
  flex: 0 0 34px;
  display: grid;
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(7, 16, 17, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.32);
  color: #071011;
}

.mute-toggle:hover {
  background: rgba(255, 255, 255, 0.48);
}

.mute-toggle.is-muted {
  background: #071011;
  color: #64d2c8;
}

.video-clip {
  background: #64d2c8;
}

.audio-clip {
  background: #f1c84b;
}

@media (max-width: 900px) {
  .preview-band,
  .timeline-band {
    padding-inline: 14px;
  }

  .preview-inner {
    grid-template-columns: 1fr;
  }

  .controls-pane {
    border-left: 0;
    border-top: 1px solid #343b3f;
  }

  .preview-pane,
  .empty-preview {
    min-height: 220px;
  }

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

  .timeline-toolbar div {
    display: grid;
    gap: 4px;
  }
}
