:root {
    --timeline-label-width: 220px;
    --segment-color: #0d6efd;
    --segment-bg: rgba(13, 110, 253, 0.12);
}

body {
    background-color: #f5f7fb;
}

.timeline-card {
    min-height: 480px;
}

.timeline-scroll {
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ced4da #f8f9fa;
}

.timeline-scroll.loading::after {
    content: 'Loading…';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #6c757d;
    z-index: 5;
}

.timeline-inner {
    width: 100%;
    padding-bottom: 1rem;
}

.timeline-axis {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    margin-bottom: 1rem;
    min-height: 36px;
}

.timeline-axis-placeholder {
    width: var(--timeline-label-width);
    flex-shrink: 0;
}

.timeline-axis-track-wrapper {
    flex: 1;
    overflow: visible;
}

.timeline-axis-track {
    position: relative;
    height: 36px;
    border-bottom: 1px solid #ced4da;
    width: 100%;
}

.timeline-axis-tick {
    position: absolute;
    bottom: 0;
    transform: translateX(-50%);
    width: 1px;
    height: 100%;
    background-color: rgba(108, 117, 125, 0.3);
}

.timeline-axis-label {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #f8f9fa;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.75rem;
    white-space: nowrap;
    color: #495057;
    border: 1px solid rgba(222, 226, 230, 0.8);
}

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.timeline-row,
.timeline-editor-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.timeline-editor-header {
    padding: 0.2rem 0;
}

.timeline-label {
    width: var(--timeline-label-width);
    flex-shrink: 0;
    font-weight: 500;
    font-size: 0.9rem;
}

.timeline-track-wrapper {
    position: relative;
    flex: 1;
    overflow: hidden;
}

.timeline-track {
    position: relative;
    width: 100%;
    min-height: 34px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: repeating-linear-gradient(90deg, rgba(248, 249, 250, 0.9) 0, rgba(248, 249, 250, 0.9) 24px, rgba(255, 255, 255, 0.9) 24px, rgba(255, 255, 255, 0.9) 48px);
}

.timeline-segment {
    position: absolute;
    top: 6px;
    height: 22px;
    border-radius: 6px;
}

.timeline-segment::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-color: rgba(255, 255, 255, 0.15);
    mix-blend-mode: screen;
    pointer-events: none;
}

.timeline-track::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-color: rgba(13, 110, 253, 0.04);
    pointer-events: none;
}

@media (max-width: 767.98px) {
    :root {
        --timeline-label-width: 120px;
    }

    .timeline-axis {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
        min-height: auto;
    }

    .timeline-axis-placeholder {
        width: auto;
        display: none;
    }

    .timeline-inner {
        width: 100%;
    }

    .timeline-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
        margin-bottom: 0.5rem;
    }

    .timeline-label {
        width: auto;
        flex-shrink: 1;
        padding-left: 0.25rem;
    }

    .timeline-track-wrapper {
        margin-left: 0;
    }
}

.timeline-segment-openai {
    background-image: linear-gradient(135deg, #343a40, #000000);
    box-shadow: 0 0.3rem 0.6rem rgba(0, 0, 0, 0.35);
}

.timeline-segment-openai:hover {
    background-image: linear-gradient(135deg, #000000, #343a40);
}

.timeline-segment-anthropic {
    background-image: linear-gradient(135deg, #a52a2a, #800000);
    box-shadow: 0 0.3rem 0.6rem rgba(139, 69, 19, 0.35);
}

.timeline-segment-anthropic:hover {
    background-image: linear-gradient(135deg, #800000, #a52a2a);
}

.timeline-segment-googleai {
    background-image: linear-gradient(135deg, #4285f4, #0d47a1);
    box-shadow: 0 0.3rem 0.6rem rgba(66, 133, 244, 0.35);
}

.timeline-segment-googleai:hover {
    background-image: linear-gradient(135deg, #0d47a1, #4285f4);
}

