.controls-row {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) auto minmax(8rem, 1fr);
  align-items: center;
  gap: 1rem;
}

.timeline-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.timeline-controls_center {
  justify-content: center;
}

.timeline-range {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.timeline-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 0;
  outline: none;
  box-shadow: none;
}

.timeline-slider::-webkit-slider-runnable-track {
  height: 0.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--sg-color-text) 12%, transparent);
  border: 0;
}

.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  margin-top: -0.33rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid var(--sg-color-card-bg);
  background: var(--sg-filter-chip-active-bg);
}

.timeline-slider::-moz-range-track {
  height: 0.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--sg-color-text) 12%, transparent);
  border: 0;
}

.timeline-slider::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid var(--sg-color-card-bg);
  background: var(--sg-filter-chip-active-bg);
}

.timeline-slider:focus-visible::-webkit-slider-thumb,
.timeline-slider:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sg-filter-chip-active-bg) 24%, transparent);
}

.control-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 4.25rem;
  justify-content: center;
}

.control-btn_primary[tuiButton][tuiAppearance][data-appearance='primary'] {
  background: var(--sg-filter-chip-active-bg);
  color: var(--sg-filter-chip-active-fg);
}

.control-btn_primary[tuiButton][tuiAppearance][data-appearance='primary']:hover:not(
    [data-state='disabled']
  ) {
  background: var(--sg-filter-chip-active-bg-hover);
}

.control-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.time-meta {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 1rem;
}

.time-meta_start {
  width: 100%;
  justify-content: flex-start;
  justify-self: start;
}

.time-meta_end {
  width: 100%;
  justify-content: flex-end;
  justify-self: end;
}

.time-meta__col {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.time-meta__col_end {
  align-items: flex-end;
  text-align: right;
}

@media (max-width: 720px) {
  .controls-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .time-meta_start,
  .timeline-controls_center,
  .time-meta_end {
    justify-content: center;
  }

  .time-meta__col,
  .time-meta__col_end {
    align-items: center;
    text-align: center;
  }
}

.time-meta__position {
  font: var(--tui-font-text-m);
  font-weight: 600;
  color: var(--tui-text-primary);
}

.time-meta__clock {
  font: var(--tui-font-text-s);
  color: var(--tui-text-tertiary);
}

.input-preview {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 2rem;
  width: 100%;
  overflow-x: auto;
}

.input-preview app-keyboard-view {
  flex: 0 0 auto;
}

.input-preview app-mouse-view {
  flex: 0 0 auto;
}

.mouse-sidebar {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  align-self: stretch;
  min-height: 0;
}

@media (max-width: 980px) {
  .input-preview {
    flex-direction: column;
    align-items: center;
  }
}

.interactive-transcript-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--tui-border-normal);
}

.interactive-transcript-field {
  width: 100%;
}

.heatmap-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.heatmap-title {
  font-size: 1rem;
  font-weight: 500;
  margin: 0;
  color: var(--tui-text-primary);
}

.heatmap-container {
  display: flex;
  height: 48px;
  width: 100%;
  position: relative;
  border-radius: var(--tui-radius-s);
  overflow: hidden;
  background: var(--tui-background-base-alt, #f5f5f6);
  border: 1px solid var(--tui-border-normal);
  cursor: pointer;
}

.heatmap-bucket {
  flex-grow: 1;
  height: 100%;
  transition: opacity 0.1s;
}

.heatmap-bucket:hover {
  opacity: 0.7;
}

.heatmap-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--tui-primary, #3872c2);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 2;
  box-shadow: 0 0 4px var(--tui-primary, rgba(56, 114, 194, 0.4));
}

.interactive-transcript-hint {
  margin: 0;
  max-width: 52rem;
}
