/* A main system's timeline (MainSystemTimelineTab): lanes of bars positioned by date, CSS only. The lane colour names the kind;
   whether a record is closed is told by the fill (filled = closed, outlined = still open), so colour carries one meaning. */

.tl--fault {
    --tl-c: var(--ft-streamer);
}

.tl--maintenance {
    --tl-c: var(--ft-altimeter);
}

.tl--servicebulletin {
    --tl-c: #B7861A;
}

.tl--flight {
    --tl-c: #1F9AA8;
}

/* Zoom buttons beside the presets. */
.tl-zoom {
    display: inline-flex;
    gap: 4px;
}

/* The chart zooms with the wheel and pans with a drag; a horizontal swipe on the lanes pans instead of scrolling the card. */
.tl-grid:focus-visible {
    outline: 2px solid var(--ft-apron);
    outline-offset: 2px;
}

.tl-grid .tl-lane__track {
    cursor: grab;
    touch-action: pan-y;
}

.tl-grid.is-panning,
.tl-grid.is-panning .tl-lane__track,
.tl-grid.is-panning .tl-bar {
    cursor: grabbing;
    user-select: none;
}

/* Zoomed into the past: the lanes' right edge is not today. */
.tl-grid:not(.ends-today) .tl-lane__track {
    border-right-color: var(--ft-line);
}

/* The navigator: the whole span with the shown stretch marked; press or drag to move it. */
.tl-nav__label {
    align-self: center;
    font-size: 0.7rem;
    color: var(--ft-stencil-soft);
}

.tl-nav {
    position: relative;
    height: 14px;
    margin: 2px 0 6px;
    border-radius: var(--ft-radius-xs);
    background: var(--ft-chalk);
    box-shadow: inset 0 0 0 1px var(--ft-line);
    cursor: pointer;
    touch-action: none;
}

.tl-nav__window {
    position: absolute;
    top: 0;
    bottom: 0;
    min-width: 6px;
    border: 1.5px solid var(--ft-sky);
    border-radius: var(--ft-radius-xs);
    background: color-mix(in srgb, var(--ft-sky) 22%, transparent);
}

.tl {
    overflow: hidden;
}

.tl-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--ft-line);
}

.tl-toolbar__lanes,
.tl-toolbar__views {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.tl-toolbar .msb-segment button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tl-swatch {
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--tl-c);
}

.tl-toggle:not(.is-selected) .tl-swatch {
    background: var(--ft-line);
}

.tl-toggle__count {
    font-variant-numeric: tabular-nums;
    color: var(--ft-stencil-soft);
}

.tl-toggle__open {
    padding: 0 6px;
    border-radius: var(--ft-radius-pill);
    background: rgba(227, 179, 65, 0.18);
    color: #7A5A0E;
    font-size: 0.72rem;
}

.tl-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--ft-line);
    background: var(--ft-chalk);
    font-size: 0.8rem;
    color: var(--ft-stencil-soft);
}

.tl-summary strong {
    font-family: var(--ft-font-display);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--ft-stencil);
}

.tl-message {
    margin: 14px;
}

/* On a narrow screen the chart scrolls sideways inside its card; the lane names stay pinned on the left. */
.tl-scroll {
    overflow-x: auto;
    padding: 12px 14px 4px;
}

.tl-grid {
    --tl-row: 22px;
    --tl-bar: 12px;
    --tl-label: 136px;
    display: grid;
    grid-template-columns: var(--tl-label) minmax(0, 1fr);
    min-width: 640px;
}

.tl-lane__label {
    position: sticky;
    left: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 10px;
    border-bottom: 1px solid var(--ft-line);
    background: #FFFFFF;
}

.tl-lane__label strong {
    display: block;
    font: 600 0.85rem var(--ft-font-display);
    color: var(--ft-stencil);
}

.tl-lane__label small {
    display: block;
    font-size: 0.72rem;
    color: var(--ft-stencil-soft);
}

.tl-lane__track {
    position: relative;
    height: calc(var(--rows) * var(--tl-row) + 8px);
    overflow: hidden;
    border-right: 2px solid var(--ft-sky);
    border-bottom: 1px solid var(--ft-line);
    background: color-mix(in srgb, var(--tl-c) 4%, #FFFFFF);
}

.tl-tick {
    position: absolute;
    top: 0;
    bottom: 0;
    border-left: 1px dashed rgba(91, 103, 117, 0.22);
}

.tl-guide {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 1;
    border-left: 2px dashed var(--ft-caution);
}

.tl-bar {
    position: absolute;
    padding: 0;
    cursor: pointer;
    font: inherit;
    top: calc(4px + var(--row) * var(--tl-row) + (var(--tl-row) - var(--tl-bar)) / 2);
    z-index: 2;
    box-sizing: border-box;
    min-width: 4px;
    height: var(--tl-bar);
    border: 1.5px solid var(--tl-c);
    border-radius: var(--ft-radius-xs);
    background: var(--tl-c);
    transition: filter 0.12s ease, box-shadow 0.12s ease;
}

.tl-bar.is-ongoing {
    background: color-mix(in srgb, var(--tl-c) 16%, #FFFFFF);
}

/* Bulletin items without a work order: due since the release date, nothing done yet. */
.tl-bar.is-waiting {
    border-style: dashed;
    background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--tl-c) 28%, #FFFFFF) 0 4px, #FFFFFF 4px 8px);
}

.tl-bar:hover,
.tl-bar:focus-visible {
    z-index: 3;
    outline: none;
    filter: brightness(1.12);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--tl-c) 30%, transparent);
}

.tl-bar:focus-visible {
    box-shadow: 0 0 0 2px var(--ft-apron);
}

.tl-axis {
    position: relative;
    height: 24px;
}

.tl-axis__label {
    position: absolute;
    top: 5px;
    padding-left: 4px;
    font: 500 0.72rem var(--ft-font-display);
    letter-spacing: 0.02em;
    white-space: nowrap;
    color: var(--ft-stencil-soft);
}

.tl-axis__today {
    position: absolute;
    top: 5px;
    right: 0;
    z-index: 1;
    padding-left: 6px;
    background: #FFFFFF;
    font: 600 0.72rem var(--ft-font-display);
    color: var(--ft-sky);
}

.tl-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    padding: 6px 14px 12px;
    font-size: 0.75rem;
    color: var(--ft-stencil-soft);
}

.tl-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tl-legend > .muted {
    margin-left: auto;
}

.tl-key {
    box-sizing: border-box;
    width: 20px;
    height: 10px;
    border: 1.5px solid var(--ft-stencil-soft);
    border-radius: var(--ft-radius-xs);
    background: var(--ft-stencil-soft);
}

.tl-key.is-ongoing {
    background: color-mix(in srgb, var(--ft-stencil-soft) 16%, #FFFFFF);
}

.tl-key.is-waiting {
    border-style: dashed;
    background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--ft-stencil-soft) 28%, #FFFFFF) 0 4px, #FFFFFF 4px 8px);
}

.tl-key--guide {
    width: 0;
    height: 12px;
    border: 0;
    border-left: 2px dashed var(--ft-caution);
    border-radius: 0;
    background: none;
}

@media (max-width: 600px) {
    .tl-toolbar {
        align-items: stretch;
    }

    .tl-grid {
        --tl-label: 104px;
    }

    .tl-legend > .muted {
        margin-left: 0;
    }
}

/* The record dialog's title: the record on the left, open-page, full window and close on the right. */
.record-dialog__title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.record-dialog__tools {
    display: inline-flex;
    gap: 4px;
    margin-left: auto;
}
