.timeline {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    padding: 12px 12px 10px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
}

.timeline-header-left {
    display: inline-block;
}

.timeline-track {
    position: relative;
    height: 14px;
    border-radius: 999px;
    overflow: hidden;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
}

.timeline-scroll {
    position: relative;
}

.timeline-inner {
    position: relative;
    min-width: 100%;
}

.timeline-sticky-start {
    display: none;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
    user-select: none;
}

.timeline-seg {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 999px;
}

.timeline-seg.working {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.22) 0%, rgba(34, 197, 94, 0.34) 50%, rgba(34, 197, 94, 0.22) 100%);
}

.timeline-seg.busy {
    background: rgba(239, 68, 68, 0.55);
}

.timeline-seg.selected {
    background: rgba(14, 165, 233, 0.70);
    box-shadow: 0 0 0 1px rgba(2, 132, 199, 0.55) inset;
}

.timeline-seg.conflict {
    background: rgba(239, 68, 68, 0.90);
    box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.75) inset;
}

.timeline-ticks {
    position: relative;
    height: 40px;
    margin-top: 8px;
}

.timeline-tick {
    position: absolute;
    top: 0;
    width: 1px;
    height: 6px;
    background: #9ca3af;
}

.timeline-tick.major {
    height: 15px;
    background: #4b5563;
    width: 2px;
}

.timeline-tick.minor {
    height: 6px;
    background: #6b7280;
}

.timeline-tick-label {
    position: absolute;
    top: 20px;
    transform: translateX(-50%);
    font-size: 10px;
    color: #6b7280;
    font-weight: 700;
    white-space: nowrap;
}

.timeline-tick-min-label {
    position: absolute;
    top: 12px;
    transform: translateX(-50%);
    font-size: 9px;
    color: #111827;
    opacity: 0.70;
    white-space: nowrap;
}

.timeline-legend {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-right: 6px;
    vertical-align: -1px;
}

@media (max-width: 576px) {
    .timeline-track {
        height: 20px;
    }

    .timeline-ticks {
        height: 46px;
        margin-top: 10px;
    }

    .timeline-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }

    .timeline-sticky-start {
        display: block;
        position: sticky;
        left: 0;
        z-index: 6;
        background: #fff;
        padding-right: 10px;
    }

    .timeline-header-left {
        display: none;
    }

    .timeline-legend {
        flex-wrap: nowrap;
        white-space: nowrap;
    }

    .timeline-seg.busy,
    .timeline-seg.selected,
    .timeline-seg.conflict {
        min-width: 8px;
    }
}