.timeline {
    position: relative;
    padding-block: var(--space-md);
    background-color: var(--color-track);
    border-block: 1px solid var(--color-border);
}
.timeline__tracks {
    position: relative;
    display: grid;
    gap: var(--space-xs);
    overflow: hidden;
}
.timeline__track {
    position: relative;
    display: flex;
    align-items: center;
    height: var(--timeline-track-h);
}
.timeline__label {
    position: absolute;
    left: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 100%;
    font-family: var(--font-accent);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--color-text-subtle);
    background-color: var(--color-track);
    border-right: 1px solid var(--color-border);
}
.timeline__clips {
    display: flex;
    gap: var(--space-xs);
    width: max-content;
    height: 100%;
    padding-left: 3.25rem;
    animation: timeline-scroll 48s linear infinite;
}
.timeline__track--audio .timeline__clips { animation-duration: 64s; }
.timeline__track--text  .timeline__clips { animation-duration: 40s; }
.timeline__clip {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    width: var(--clip-w);
    height: 100%;
    padding-inline: var(--space-md);
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-text-strong);
    white-space: nowrap;
    border-radius: var(--radius-sm);
}
.timeline__track--video .timeline__clip {
    background-color: var(--color-clip-video);
    border: 1px solid var(--color-clip-video-border);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.timeline__track--audio .timeline__clip {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='40' fill='%23D1D1D1' fill-opacity='0.6'%3E%3Crect x='0' y='5' width='2' height='30' rx='1'/%3E%3Crect x='4' y='13' width='2' height='14' rx='1'/%3E%3Crect x='8' y='2' width='2' height='36' rx='1'/%3E%3Crect x='12' y='17' width='2' height='6' rx='1'/%3E%3Crect x='16' y='15' width='2' height='10' rx='1'/%3E%3Crect x='20' y='14' width='2' height='12' rx='1'/%3E%3Crect x='24' y='15' width='2' height='10' rx='1'/%3E%3Crect x='28' y='5' width='2' height='30' rx='1'/%3E%3Crect x='32' y='16' width='2' height='8' rx='1'/%3E%3Crect x='36' y='17' width='2' height='6' rx='1'/%3E%3Crect x='40' y='14' width='2' height='12' rx='1'/%3E%3Crect x='44' y='11' width='2' height='18' rx='1'/%3E%3Crect x='48' y='17' width='2' height='6' rx='1'/%3E%3Crect x='52' y='15' width='2' height='10' rx='1'/%3E%3Crect x='56' y='2' width='2' height='36' rx='1'/%3E%3Crect x='60' y='2' width='2' height='36' rx='1'/%3E%3Crect x='64' y='15' width='2' height='10' rx='1'/%3E%3Crect x='68' y='11' width='2' height='18' rx='1'/%3E%3Crect x='72' y='15' width='2' height='10' rx='1'/%3E%3Crect x='76' y='14' width='2' height='12' rx='1'/%3E%3Crect x='80' y='2' width='2' height='36' rx='1'/%3E%3Crect x='84' y='17' width='2' height='6' rx='1'/%3E%3Crect x='88' y='16' width='2' height='8' rx='1'/%3E%3Crect x='92' y='15' width='2' height='10' rx='1'/%3E%3Crect x='96' y='11' width='2' height='18' rx='1'/%3E%3Crect x='100' y='16' width='2' height='8' rx='1'/%3E%3Crect x='104' y='17' width='2' height='6' rx='1'/%3E%3Crect x='108' y='16' width='2' height='8' rx='1'/%3E%3Crect x='112' y='16' width='2' height='8' rx='1'/%3E%3Crect x='116' y='2' width='2' height='36' rx='1'/%3E%3Crect x='120' y='17' width='2' height='6' rx='1'/%3E%3Crect x='124' y='11' width='2' height='18' rx='1'/%3E%3Crect x='128' y='17' width='2' height='6' rx='1'/%3E%3Crect x='132' y='14' width='2' height='12' rx='1'/%3E%3Crect x='136' y='13' width='2' height='14' rx='1'/%3E%3Crect x='140' y='8' width='2' height='24' rx='1'/%3E%3Crect x='144' y='2' width='2' height='36' rx='1'/%3E%3Crect x='148' y='13' width='2' height='14' rx='1'/%3E%3Crect x='152' y='14' width='2' height='12' rx='1'/%3E%3Crect x='156' y='15' width='2' height='10' rx='1'/%3E%3C/svg%3E") center / 160px 70% repeat-x, var(--color-clip);
    border: 1px solid var(--color-border);
}
.timeline__track--text .timeline__clip {
    font-weight: 600;
    color: var(--color-secondary);
    background-color: var(--color-clip-text);
    border: 1px solid var(--color-border);
}
.timeline__playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    z-index: 2;
    width: 2px;
    background-color: var(--color-primary);
    box-shadow: 0 0 12px var(--color-primary);
}
.timeline__flag {
    position: absolute;
    top: 0;
    left: 50%;
    padding: 2px var(--space-sm);
    font-family: var(--font-accent);
    font-size: var(--text-xs);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--color-text-strong);
    white-space: nowrap;
    background-color: var(--color-primary);
    border-radius: var(--radius-sm);
    transform: translateX(-50%);
}
@keyframes timeline-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
    .timeline__clips { animation: none; }
}
.edit-layers {
    overflow: hidden;
    background-color: var(--color-track);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
}
.edit-layer {
    display: grid;
    grid-template-columns: 3.25rem 1fr;
    gap: var(--space-sm) var(--space-md);
    padding: var(--space-lg) var(--space-md);
    border-bottom: 1px solid var(--color-border);
}
.edit-layer:last-child {
    border-bottom: 0;
}
@media (min-width: 900px) {
    .edit-layer {
        grid-template-columns: 3.5rem minmax(16rem, 0.9fr) 1.1fr;
        align-items: center;
        gap: var(--space-xl);
        padding: var(--space-lg) var(--space-xl);
    }
}
.edit-layer__id {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2rem;
    font-family: var(--font-accent);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--color-text-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}
.edit-layer__title {
    margin-bottom: var(--space-xs);
    font-size: var(--text-lg);
    color: var(--color-text-strong);
}
.edit-layer__text p {
    color: var(--color-text-subtle);
}
.edit-layer__track {
    position: relative;
    grid-column: 1 / -1;
    height: var(--timeline-track-h);
    background-color: var(--color-bg);
    border-radius: var(--radius-sm);
}
@media (min-width: 900px) {
    .edit-layer__track {
        grid-column: auto;
    }
}
.edit-layer__clip {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: var(--start);
    width: var(--len);
    display: flex;
    align-items: center;
    padding-inline: var(--space-sm);
    overflow: hidden;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--color-secondary);
    white-space: nowrap;
    border-radius: var(--radius-sm);
}
.edit-layer--video .edit-layer__clip {
    background-color: var(--color-clip-video);
    border: 1px solid var(--color-clip-video-border);
}
.edit-layer--text .edit-layer__clip {
    background-color: var(--color-clip-text);
    border: 1px solid var(--color-border);
}
@media (max-width: 899px) {
    .edit-layer--text .edit-layer__clip {
        color: transparent;
    }
}
.edit-layer--audio .edit-layer__clip {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='40' fill='%23D1D1D1' fill-opacity='0.6'%3E%3Crect x='0' y='5' width='2' height='30' rx='1'/%3E%3Crect x='4' y='13' width='2' height='14' rx='1'/%3E%3Crect x='8' y='2' width='2' height='36' rx='1'/%3E%3Crect x='12' y='17' width='2' height='6' rx='1'/%3E%3Crect x='16' y='15' width='2' height='10' rx='1'/%3E%3Crect x='20' y='14' width='2' height='12' rx='1'/%3E%3Crect x='24' y='15' width='2' height='10' rx='1'/%3E%3Crect x='28' y='5' width='2' height='30' rx='1'/%3E%3Crect x='32' y='16' width='2' height='8' rx='1'/%3E%3Crect x='36' y='17' width='2' height='6' rx='1'/%3E%3Crect x='40' y='14' width='2' height='12' rx='1'/%3E%3Crect x='44' y='11' width='2' height='18' rx='1'/%3E%3Crect x='48' y='17' width='2' height='6' rx='1'/%3E%3Crect x='52' y='15' width='2' height='10' rx='1'/%3E%3Crect x='56' y='2' width='2' height='36' rx='1'/%3E%3Crect x='60' y='2' width='2' height='36' rx='1'/%3E%3Crect x='64' y='15' width='2' height='10' rx='1'/%3E%3Crect x='68' y='11' width='2' height='18' rx='1'/%3E%3Crect x='72' y='15' width='2' height='10' rx='1'/%3E%3Crect x='76' y='14' width='2' height='12' rx='1'/%3E%3Crect x='80' y='2' width='2' height='36' rx='1'/%3E%3Crect x='84' y='17' width='2' height='6' rx='1'/%3E%3Crect x='88' y='16' width='2' height='8' rx='1'/%3E%3Crect x='92' y='15' width='2' height='10' rx='1'/%3E%3Crect x='96' y='11' width='2' height='18' rx='1'/%3E%3Crect x='100' y='16' width='2' height='8' rx='1'/%3E%3Crect x='104' y='17' width='2' height='6' rx='1'/%3E%3Crect x='108' y='16' width='2' height='8' rx='1'/%3E%3Crect x='112' y='16' width='2' height='8' rx='1'/%3E%3Crect x='116' y='2' width='2' height='36' rx='1'/%3E%3Crect x='120' y='17' width='2' height='6' rx='1'/%3E%3Crect x='124' y='11' width='2' height='18' rx='1'/%3E%3Crect x='128' y='17' width='2' height='6' rx='1'/%3E%3Crect x='132' y='14' width='2' height='12' rx='1'/%3E%3Crect x='136' y='13' width='2' height='14' rx='1'/%3E%3Crect x='140' y='8' width='2' height='24' rx='1'/%3E%3Crect x='144' y='2' width='2' height='36' rx='1'/%3E%3Crect x='148' y='13' width='2' height='14' rx='1'/%3E%3Crect x='152' y='14' width='2' height='12' rx='1'/%3E%3Crect x='156' y='15' width='2' height='10' rx='1'/%3E%3C/svg%3E") center / 160px 80% repeat-x, var(--color-clip);
    border: 1px solid var(--color-border);
}
.edit-layer--color .edit-layer__clip {
    background: linear-gradient(90deg, #5d6166 0%, #6f6a66 35%, #b0664a 70%, #d9502e 100%);
}
.edit-layer--motion .edit-layer__clip {
    background-color: var(--color-clip);
    border: 1px dashed var(--color-clip-video-border);
}
.edit-layer--motion .edit-layer__clip::before,
.edit-layer--motion .edit-layer__clip::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 8px;
    height: 8px;
    background-color: var(--color-primary);
    transform: translateY(-50%) rotate(45deg);
}
.edit-layer--motion .edit-layer__clip::before { left: 6px; }
.edit-layer--motion .edit-layer__clip::after  { right: 6px; }
.edit-layer__playhead {
    position: absolute;
    top: -6px;
    bottom: -6px;
    left: calc(var(--layers-progress) * 100%);
    z-index: 1;
    width: 2px;
    background-color: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary);
}
.editor-note {
    display: grid;
    gap: var(--space-xs);
    max-width: var(--container-lg);
    margin: var(--space-2xl) auto 0;
    padding: var(--space-lg) var(--space-xl);
    text-align: center;
    border: 1px solid var(--color-clip-video-border);
    border-radius: var(--radius-lg);
    background-color: var(--color-clip-video);
}
.editor-note__title {
    font-size: var(--text-lg);
    font-weight: 800;
    color: var(--color-text-strong);
}
.editor-note__text {
    color: var(--color-secondary);
}
.edit-layers {
    margin-top: var(--space-2xl);
}
