/* Workspace timeline annotation markers — same single-SVG glyph as page transport. */
/* Hide red playhead while dragging an M marker (stem + head). */
#timelineTrack.is-marker-dragging #playhead {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#wsTimelineMarkers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 25;
}

#timelineTrack .ws-timeline-marker {
  position: absolute;
  top: 2px;
  width: 8px;
  /* Stem tip at ruler bottom (user red line), not into the video lane. */
  height: calc(var(--timeline-ruler-h, 42px) - 2px);
  padding: 0;
  border: 0;
  pointer-events: auto;
  cursor: ew-resize;
  touch-action: none;
  transform: translateX(-4px);
  background: transparent;
  display: block;
  line-height: 0;
  overflow: hidden;
}

/* Kill any cached legacy pseudo-element stem/flag from older builds. */
#timelineTrack .ws-timeline-marker::before,
#timelineTrack .ws-timeline-marker::after {
  content: none !important;
  display: none !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Flag + stem to ruler edge; stem paint from SVG gradient (fade to transparent). */
#timelineTrack .ws-timeline-marker .ws-marker-glyph {
  display: block;
  width: 8px;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  transform-origin: 4px 3px;
}

#timelineTrack .ws-timeline-marker .ws-marker-flag {
  fill: var(--ws-marker-fill, #a3e635);
  stroke: none;
}

#timelineTrack .ws-timeline-marker .ws-marker-stem {
  fill: none;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

#timelineTrack .ws-timeline-marker .ws-marker-note {
  fill: rgba(255, 255, 255, 0.95);
  stroke: none;
  display: none;
}

#timelineTrack .ws-timeline-marker.has-note .ws-marker-note {
  display: block;
}

#timelineTrack .ws-timeline-marker:hover,
#timelineTrack .ws-timeline-marker.is-dragging {
  z-index: 30;
}

#timelineTrack .ws-timeline-marker:hover .ws-marker-glyph {
  transform: scale(1.15);
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.28)) brightness(1.1);
}

#timelineTrack .ws-timeline-marker.is-dragging {
  cursor: grabbing;
}

#timelineTrack .ws-timeline-marker.is-dragging .ws-marker-glyph {
  transform: scale(1.25);
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.3)) brightness(1.15);
}

#timelineTrack .ws-timeline-marker.is-dragging .ws-marker-stem {
  stroke-width: 1.5;
}

#timelineTrack .ws-timeline-marker.is-selected .ws-marker-glyph {
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.28)) brightness(1.12);
}

#cutgo-ws-timeline-marker-dialog {
  position: fixed;
  z-index: 2147483646;
  width: min(92vw, 300px);
  pointer-events: auto;
}

#cutgo-ws-timeline-marker-dialog[hidden] {
  display: none !important;
}

#cutgo-ws-timeline-marker-dialog .ctmd-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(18, 18, 21, 0.97);
  color: rgba(245, 245, 247, 0.94);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
}

#cutgo-ws-timeline-marker-dialog .ctmd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#cutgo-ws-timeline-marker-dialog .ctmd-title {
  font: 700 12px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.02em;
}

#cutgo-ws-timeline-marker-dialog .ctmd-close {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  cursor: pointer;
  font-size: 16px;
}

#cutgo-ws-timeline-marker-dialog .ctmd-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10px;
  color: rgba(245, 245, 247, 0.62);
}

#cutgo-ws-timeline-marker-dialog .ctmd-field-note textarea {
  min-height: 84px;
  resize: vertical;
  font: 500 12px/1.4 -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
}

#cutgo-ws-timeline-marker-dialog .ctmd-field input,
#cutgo-ws-timeline-marker-dialog .ctmd-field textarea {
  width: 100%;
  box-sizing: border-box;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.28);
  color: rgba(245, 245, 247, 0.95);
  padding: 8px 9px;
  font: 500 11px/1.35 -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
}

#cutgo-ws-timeline-marker-dialog .ctmd-field textarea::placeholder {
  color: rgba(245, 245, 247, 0.38);
}

#cutgo-ws-timeline-marker-dialog .ctmd-colors {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

#cutgo-ws-timeline-marker-dialog .ctmd-color {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--ctmd-color);
  cursor: pointer;
  padding: 0;
}

#cutgo-ws-timeline-marker-dialog .ctmd-color.is-active {
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
}

#cutgo-ws-timeline-marker-dialog .ctmd-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

#cutgo-ws-timeline-marker-dialog .ctmd-actions button {
  height: 28px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  font: 600 10px/1 -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
  cursor: pointer;
}

#cutgo-ws-timeline-marker-dialog .ctmd-actions button.primary {
  color: #a3e635;
  border-color: rgba(163, 230, 53, 0.35);
  background: rgba(163, 230, 53, 0.12);
}

#cutgo-ws-timeline-marker-dialog .ctmd-actions button.danger {
  color: #ff9f0a;
}
