/* Shared Timeline playhead — used by standalone Timeline and Narrative Map */

.tl-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0;
    z-index: 12;
    pointer-events: none;
    will-change: transform;
}

.tl-playhead[hidden] {
    display: none !important;
}

.tl-has-datescale .tl-playhead-label {
    top: 22px;
}

.tl-has-datescale .tl-playhead-handle {
    top: 40px;
}

.tl-playhead-label {
    position: absolute;
    top: 4px;
    left: 0;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    color: #1f2937;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    padding: 1px 7px;
    pointer-events: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.tl-playhead-handle {
    position: absolute;
    top: 22px;
    left: 0;
    width: 28px;
    height: 28px;
    transform: translateX(-50%);
    pointer-events: auto;
    cursor: grab;
    border: 0;
    background: transparent;
    padding: 0;
    z-index: 2;
}

.tl-playhead-handle:active {
    cursor: grabbing;
}

.tl-playhead-handle::before {
    content: "";
    position: absolute;
    top: 1px;
    left: 50%;
    width: 0;
    height: 0;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #111827;
}

.tl-playhead-handle::after {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    width: 10px;
    height: 10px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: #111827;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.22);
}

.tl-playhead-handle:focus {
    outline: none;
}

.tl-playhead-handle:focus-visible::after {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.22), 0 0 0 3px rgba(59, 130, 246, 0.45);
}

.tl-playhead-line,
.tl-playhead [data-tl-cursor] {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 2px;
    transform: translateX(-50%);
    background: rgba(17, 24, 39, 0.4);
    pointer-events: none;
}

#timelineCursor:not(.tl-playhead-line) {
    /* Legacy cursor is replaced by .tl-playhead when the shared controller is active. */
}

.tl-grid {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
}

.tl-grid[hidden] {
    display: none !important;
}

.tl-grid-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(0, 0, 0, 0.06);
    transform: translateX(-50%);
}

.tl-grid-line.is-minor {
    background: rgba(0, 0, 0, 0.035);
}

.tl-scale {
    position: sticky;
    top: 0;
    z-index: 3;
    height: 20px;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.94);
}

.tl-scale[hidden] {
    display: none !important;
}

.tl-scale-tick {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0;
}

.tl-scale-label {
    position: absolute;
    top: 1px;
    left: 0;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    color: rgba(75, 85, 99, 0.82);
}

.tl-scale-tick.is-start .tl-scale-label {
    transform: translateX(0);
}

.tl-scale-tick.is-end .tl-scale-label {
    transform: translateX(-100%);
}

.tl-scale-mark {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 1px;
    height: 6px;
    background: rgba(0, 0, 0, 0.18);
    transform: translateX(-50%);
}

.tl-lane {
    position: relative;
    z-index: 1;
}
