/* Flights: the list's totals, the flight page's strip, crew, ammunition and fault sections. */

.flight-route {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0 6px;
}

.flight-route span {
    color: var(--ft-stencil-soft);
}

/* Totals of the filtered flights, above the list. */
.flight-totals {
    margin-bottom: 12px;
    padding: 12px 16px;
}

.flight-totals__sum {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px 16px;
    margin: 0;
}

.flight-totals__sum dt,
.flight-strip__key,
.flight-strip__times dt {
    font-size: 0.76rem;
    color: var(--ft-stencil-soft);
}

.flight-totals__sum dd {
    margin: 2px 0 0;
    font: 600 1.3rem var(--ft-font-display);
    color: var(--ft-sky);
}

.flight-totals__toggle {
    margin-top: 6px;
}

.flight-scroll {
    overflow-x: auto;
}

.flight-table {
    width: 100%;
    margin-top: 8px;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.flight-table th {
    padding: 8px 10px;
    background: var(--ft-chalk-deep);
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    color: var(--ft-stencil);
}

.flight-table th:first-child {
    border-top-left-radius: var(--ft-radius-sm);
}

.flight-table th:last-child {
    border-top-right-radius: var(--ft-radius-sm);
}

.flight-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--ft-line);
    vertical-align: top;
}

/* The flight page's head: a flight-progress strip. The left edge tells flying, ground work and an abort apart. */
.flight-strip {
    display: grid;
    grid-template-columns: minmax(180px, 0.9fr) minmax(0, 2fr) auto;
    gap: 16px 28px;
    align-items: center;
    margin-bottom: 16px;
    padding: 16px 20px;
    border-left: 5px solid var(--ft-line);
}

.flight-strip--air { border-left-color: var(--ft-altimeter); }
.flight-strip--ground { border-left-color: var(--ft-stencil-soft); }
.flight-strip--abort { border-left-color: var(--ft-streamer); }

.flight-strip__aircraft {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.flight-strip__name {
    font: 600 1.35rem var(--ft-font-display);
    color: var(--ft-apron);
    overflow-wrap: anywhere;
}

.flight-strip__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.flight-strip__route {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(60px, 1.2fr) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.flight-strip__point {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.flight-strip__point--end {
    text-align: right;
}

.flight-strip__base {
    font: 600 1.15rem var(--ft-font-display);
    color: var(--ft-stencil);
    overflow-wrap: anywhere;
}

/* A runway centre line with the aircraft on it, nose towards the landing. */
.flight-strip__path {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ft-altimeter);
}

.flight-strip__line {
    flex: 1;
    border-top: 2px dashed var(--ft-line);
}

.flight-strip__plane {
    transform: rotate(90deg);
}

.flight-strip--ground .flight-strip__path { color: var(--ft-stencil-soft); }
.flight-strip--abort .flight-strip__path { color: var(--ft-streamer); }

.flight-strip__times {
    display: flex;
    gap: 20px;
    margin: 0;
}

.flight-strip__times dd {
    margin: 2px 0 0;
    font: 600 1.45rem var(--ft-font-display);
    color: var(--ft-sky);
}

.flight-crew {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.flight-crew li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--ft-line);
}

.flight-crew li:last-child {
    border-bottom: none;
}

.flight-crew span {
    font-size: 0.82rem;
    color: var(--ft-stencil-soft);
}

.flight-section {
    margin-bottom: 16px;
    padding: 14px 18px;
}

.flight-section__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--ft-sky);
}

.flight-section__head h2 {
    margin: 0;
    font: 600 1rem var(--ft-font-display);
    color: var(--ft-stencil);
}

.flight-section__count {
    min-width: 22px;
    padding: 0 7px;
    border-radius: var(--ft-radius-pill);
    background: var(--ft-chalk-deep);
    font: 600 0.8rem/22px var(--ft-font-display);
    text-align: center;
    color: var(--ft-stencil);
}

@media (max-width: 960px) {
    .flight-strip {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .flight-strip {
        padding: 14px 16px;
    }

    .flight-strip__route {
        grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr);
        gap: 8px;
    }

    .flight-strip__times {
        justify-content: space-between;
    }
}

/* The flight form: two fields side by side, one under the other on a phone. */
.flight-form__row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

/* The mission number with its "Seç" button, and the picker: the next number as a stamped plate, the unused ones as keys. */
.mission-no {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.mission-pick {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mission-pick__next {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--ft-caution);
    border-left: 5px solid var(--ft-caution);
    border-radius: var(--ft-radius);
    background: rgba(227, 179, 65, 0.12);
    font: inherit;
    color: var(--ft-stencil);
    cursor: pointer;
}

.mission-pick__next:hover,
.mission-pick__next:focus-visible {
    background: rgba(227, 179, 65, 0.24);
}

.mission-pick__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.mission-pick__number {
    font: 600 1.6rem var(--ft-font-display);
    color: var(--ft-apron);
}

.mission-pick__head {
    display: flex;
    align-items: center;
    gap: 8px;
    font: 600 0.92rem var(--ft-font-display);
    color: var(--ft-stencil);
}

.mission-pick__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 6px;
    max-height: 280px;
    overflow-y: auto;
    padding: 2px;
}

.mission-pick__gap {
    padding: 6px 4px;
    border: 1px solid var(--ft-line);
    border-radius: var(--ft-radius-sm);
    background: var(--ft-chalk);
    font: 600 0.95rem var(--ft-font-display);
    color: var(--ft-sky);
    cursor: pointer;
}

.mission-pick__gap:hover,
.mission-pick__gap:focus-visible {
    border-color: var(--ft-altimeter);
    background: var(--ft-chalk-deep);
}

.mission-pick__more {
    margin: 0;
    font-size: 0.8rem;
    color: var(--ft-stencil-soft);
}

/* The confirmation before saving: the strip, what it adds, what to confirm. */
.flight-confirm {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.flight-confirm .flight-strip {
    margin-bottom: 0;
}

.flight-confirm__adds h3 {
    margin: 0 0 8px;
    font: 600 0.92rem var(--ft-font-display);
    color: var(--ft-stencil);
}

.flight-confirm__warnings {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 10px 12px;
    border-left: 3px solid var(--ft-caution);
    border-radius: var(--ft-radius-sm);
    background: rgba(227, 179, 65, 0.12);
    list-style: none;
}

.flight-confirm__warnings li {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    color: #6B5100;
}

/* The details after a warning (numbers, counts) keep a space from its words; Razor drops the line break between them. */
.flight-confirm__warnings li strong {
    margin-left: 4px;
}

.flight-confirm__question {
    margin: 0;
    font-weight: 600;
}

/* The ammunition row's description and its add button on one line. */
.flight-ammo__add {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

@media (max-width: 600px) {
    .flight-ammo__add {
        grid-template-columns: 1fr;
    }
}
