/* Tab Biên tập — timeline & workspace */
.editor-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .editor-workspace {
    grid-template-columns: 1fr;
  }
}

.editor-sidebar .card {
  margin-bottom: 0.75rem;
}

.editor-project-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.65rem;
}

.editor-project-head input[type="text"] {
  flex: 1 1 160px;
  min-width: 0;
}

.editor-project-list {
  max-height: 200px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.editor-project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.editor-project-row:last-child {
  border-bottom: none;
}

.editor-project-row.is-active {
  background: rgba(var(--accent-rgb, 59, 130, 246), 0.12);
}

.editor-main {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.editor-preview-wrap {
  position: relative;
}

.editor-video-stage {
  position: relative;
  width: 100%;
  max-width: 100%;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.editor-video-stage video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.editor-custom-overlays-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.editor-custom-overlays-layer .vps-custom-overlay-item,
.editor-custom-overlays-layer .editor-overlay-preview-item {
  pointer-events: auto;
  cursor: grab;
}

.editor-custom-overlays-layer .editor-overlay-preview-item.is-selected {
  outline: 2px solid #f59e0b;
}

.editor-overlays-panel .custom-overlays-list {
  max-height: 420px;
  overflow: auto;
}

.editor-timeline-card {
  padding: 0.65rem 0.75rem 0.75rem;
}

.editor-timeline-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.editor-timeline-toolbar .hint {
  margin: 0;
  flex: 1 1 200px;
}

.editor-timeline-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated, #111);
  user-select: none;
}

.editor-timeline-inner {
  position: relative;
  min-width: 100%;
}

.editor-timeline-ruler {
  position: relative;
  height: 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.editor-timeline-ruler-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 10px;
  color: var(--muted);
  padding: 2px 0 0 3px;
  pointer-events: none;
}

.editor-timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #f59e0b;
  z-index: 6;
  pointer-events: none;
  transform: translateX(-1px);
}

.editor-timeline-playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #f59e0b;
}

.editor-timeline-tracks {
  position: relative;
}

.editor-track-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  min-height: 44px;
  border-bottom: 1px solid var(--border);
}

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

.editor-track-label {
  display: flex;
  align-items: center;
  padding: 0.35rem 0.45rem;
  font-size: 12px;
  color: var(--muted);
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.editor-track-lane {
  position: relative;
  min-height: 44px;
  background: rgba(255, 255, 255, 0.015);
}

.editor-clip-block {
  position: absolute;
  top: 6px;
  bottom: 6px;
  min-width: 8px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.55);
  border: 1px solid rgba(147, 197, 253, 0.65);
  color: #fff;
  font-size: 11px;
  padding: 0.15rem 0.35rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: grab;
  box-sizing: border-box;
}

.editor-clip-block.is-audio {
  background: rgba(16, 185, 129, 0.5);
  border-color: rgba(110, 231, 183, 0.65);
}

.editor-clip-block.is-overlay {
  background: rgba(168, 85, 247, 0.45);
  border-color: rgba(216, 180, 254, 0.65);
  top: 10px;
  bottom: 10px;
}

.editor-clip-block.is-selected {
  outline: 2px solid #f59e0b;
  z-index: 3;
}

.editor-clip-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
  z-index: 2;
}

.editor-clip-handle--left {
  left: 0;
}

.editor-clip-handle--right {
  right: 0;
}

.editor-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.65rem;
}

.editor-panel-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
}

.editor-panel-card h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
}

.editor-cut-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.editor-cut-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.35rem;
  align-items: center;
}

.editor-empty-hint {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
}

main.main--editor-wide .card {
  max-width: none;
}
