.ruler-row {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 6;
    background: var(--panel);
}

.head-spacer {
    flex: 0 0 var(--head-width);
    width: var(--head-width);
    position: sticky;
    left: 0;
    z-index: 7;
    background: var(--panel);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.ruler {
    position: relative;
    flex: 0 0 auto;
    height: 28px;
    cursor: pointer;
}

.ruler-tick {
    position: absolute;
    top: 4px;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}

.ruler-tick::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 14px;
    width: 1px;
    height: 8px;
    background: var(--line);
}

.tracks {
    position: relative;
}

.track-row {
    display: flex;
    align-items: stretch;
}

.track-head {
    flex: 0 0 var(--head-width);
    width: var(--head-width);
    position: sticky;
    left: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 6px 10px;
    background: var(--panel);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.track-name {
    font-size: 13px;
    font-weight: 600;
}

.track-buttons {
    display: flex;
    gap: 6px;
}

.track-btn {
    width: 26px;
    height: 20px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #f2f2fb;
    color: var(--muted);
    font-size: 11px;
    line-height: 1;
}

.track-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.track-volume {
    width: 100%;
    accent-color: var(--primary);
}

.track-lane {
    position: relative;
    flex: 0 0 auto;
    height: 64px;
    border-bottom: 1px solid var(--line);
    background-color: rgba(108, 92, 231, 0.03);
    background-image: repeating-linear-gradient(
            to right,
            rgba(108, 92, 231, 0.3) 0 1px,
            transparent 1px 100%
        ),
        repeating-linear-gradient(
            to right,
            rgba(108, 92, 231, 0.1) 0 1px,
            transparent 1px 100%
        );
    background-repeat: repeat;
    background-size: 200px 100%, 50px 100%;
}

.track-lane.drop-target {
    background-color: rgba(108, 92, 231, 0.16);
}

.clip {
    position: absolute;
    top: 6px;
    height: 52px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 6px 0 8px;
    border-radius: 8px;
    color: #fff;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.clip.dragging {
    opacity: 0.85;
    z-index: 10;
    cursor: grabbing;
}

.clip-title {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clip-remove {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-left: auto;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
    font-size: 12px;
    line-height: 1;
}

.clip-remove:hover {
    background: rgba(255, 0, 0, 0.6);
}

.playhead {
    position: absolute;
    top: 28px;
    bottom: 0;
    width: 2px;
    left: var(--head-width);
    background: #e74c3c;
    z-index: 4;
    pointer-events: none;
}

.playhead::after {
    content: "";
    position: absolute;
    top: 0;
    left: -5px;
    width: 12px;
    height: 12px;
    background: #e74c3c;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
}
