/* =========================================================
   K2 PLANNER — STANDALONE FLASK UI
   No Dream/Korvest sidebar and no Bootstrap dependency.
   ========================================================= */

:root {
    --korvest-paper: #ffffff;
    --korvest-bg: #f4f7f5;
    --korvest-ink: #1f2933;
    --korvest-muted: #6b7280;
    --korvest-line: #dde3df;
    --korvest-green: #2e7d32;
    --korvest-green-dark: #1b5e20;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    margin: 0;
    background: var(--korvest-bg);
    color: var(--korvest-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    line-height: 1.45;
    -webkit-text-size-adjust: 100%;
}

button, input, select { font: inherit; }

[hidden] { display: none !important; }

.k2-app-shell {
    width: min(1180px, calc(100% - 24px));
    margin: 0 auto;
    padding: 18px 0 30px;
}

.k2-flight-planner {
    width: 100%;
    padding: 18px;
    background: #ffffff;
    border: 1px solid var(--korvest-line);
    border-radius: 12px;
    box-shadow: 0 6px 22px rgba(0,0,0,.04);
}

/* Minimal utility/form/button layer used by the existing Planner markup. */
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
.flex-wrap { flex-wrap: wrap !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-center { align-items: center !important; }
.align-self-center { align-self: center !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: .25rem !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mt-3 { margin-top: 1rem !important; }
.text-start { text-align: left !important; }
.text-center { text-align: center !important; }
.text-end { text-align: right !important; }
.text-muted { color: var(--korvest-muted) !important; }
.small { font-size: .82rem !important; }
.h4 { font-size: 1.35rem; line-height: 1.2; margin-top: 0; }

.badge {
    display: inline-block;
    padding: .38rem .58rem;
    border-radius: .42rem;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}
.text-bg-light { background: #f8faf9; color: #374151; }
.border { border: 1px solid var(--korvest-line) !important; }

.form-label { display: inline-block; color: #374151; }
.form-control, .form-select {
    display: block;
    width: 100%;
    padding: .42rem .55rem;
    color: #111827;
    background: #ffffff;
    border: 1px solid #cfd7d2;
    border-radius: .42rem;
    outline: none;
}
.form-control:focus, .form-select:focus {
    border-color: #6aa16f;
    box-shadow: 0 0 0 2px rgba(46,125,50,.10);
}
.form-check { display: flex; align-items: center; gap: .42rem; }
.form-check-input { margin: 0; width: 1rem; height: 1rem; }
.form-check-label { cursor: pointer; }
.form-check-input:disabled + .form-check-label { color: #9ca3af; cursor: default; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: .44rem .78rem;
    border: 1px solid transparent;
    border-radius: .42rem;
    font-weight: 650;
    line-height: 1.1;
    cursor: pointer;
    text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: #146c43; border-color: #146c43; color: #ffffff; }
.btn-primary:hover:not(:disabled) { background: #0f5d39; }
.btn-outline-secondary { background: #ffffff; border-color: #aeb7b2; color: #4b5563; }
.btn-outline-secondary:hover:not(:disabled) { background: #f3f5f4; }
.btn-sm { min-height: 31px; padding: .32rem .58rem; font-size: .82rem; }

.btn-close {
    width: 30px;
    height: 30px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    color: #4b5563;
    font-size: 0;
}
.btn-close::before { content: "×"; font-size: 1.55rem; line-height: 1; }
.btn-close:hover { background: rgba(0,0,0,.05); }

.alert {
    padding: .7rem .85rem;
    border: 1px solid transparent;
    border-radius: .5rem;
}
.alert-warning {
    color: #664d03;
    background: #fff3cd;
    border-color: #ffecb5;
}

@media (max-width: 575.98px) {
    .k2-app-shell { width: calc(100% - 12px); padding: 6px 0 16px; }
    .k2-flight-planner { padding: 12px; border-radius: 9px; }
}

/* ==================================================
   K2 COPILOT — FLIGHT PLANNER
   SECTION: FLIGHT PLAN INPUT LAYOUT

   PURPOSE:
   Keep all planning inputs on one desktop line.

   LEFT BLOCK:
   Departure + Arrival
   Wider controls for airport name + identifier.

   RIGHT BLOCK:
   Altitude + Fuel L + Fuel R + Plan
   Compact operational controls.

   The space between the blocks is intentional so the
   route selection and aircraft data read separately.
   ================================================== */


/* ==================================================
   K2 COPILOT — FLIGHT PLANNER
   INPUT ROW: TWO DISTINCT HORIZONTAL BLOCKS
   ================================================== */

.k2-planner-input-row {
    display: flex;
    align-items: flex-end;

    width: 100%;

    /*
     * Deliberate visual separation between
     * ROUTE block and FLIGHT DATA block.
     */
    gap: 42px;
}


/* ==================================================
   K2 COPILOT — FLIGHT PLANNER
   LEFT BLOCK: DEPARTURE + ARRIVAL
   ================================================== */

.k2-planner-route-block {
    flex: 1 1 52%;
    min-width: 0;
}


.k2-planner-route-inputs {
    display: grid;

    /*
     * Departure and Arrival are intentionally
     * wider than the other planning fields.
     */
    grid-template-columns:
        minmax(220px, 1fr)
        minmax(220px, 1fr);

    gap: 14px;

    align-items: end;
}


/* Airport selection boxes */

.k2-planner-route-inputs > div {
    min-width: 0;
}


.k2-planner-route-inputs .form-control {
    width: 100%;
}


/* ==================================================
   K2 COPILOT — FLIGHT PLANNER
   LOCAL FAA AIRPORT SEARCH
   ================================================== */

.k2-airport-select-row {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 7px;
    align-items: stretch;
    min-width: 0;
}

/* Locked state-selector width: deliberately stable across route changes. */
.k2-airport-state {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    padding-left: 10px;
    padding-right: 24px;
    font-weight: 700;
}



/* Arrival search filter: All (default) / 100LL Fuel. */
.k2-arrival-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 22px;
    margin-bottom: 4px;
}

.k2-arrival-filter {
    display: inline-flex;
    align-items: center;
    gap: 22px;
    padding: 2px 6px 2px 4px;
    color: var(--korvest-muted);
    font-size: .82rem;
    white-space: nowrap;
}

.k2-arrival-filter label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 54px;
    margin: 0;
    cursor: pointer;
}

.k2-arrival-filter input {
    width: 16px;
    height: 16px;
    margin: 0;
    flex: 0 0 auto;
}

.k2-airport-picker {
    position: relative;
    min-width: 0;
}

.k2-airport-search {
    padding-right: 30px;
}

.k2-airport-results {
    position: absolute;
    z-index: 1200;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    max-height: 260px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid var(--korvest-line);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0,0,0,.14);
}

.k2-airport-result {
    display: block;
    width: 100%;
    padding: 8px 10px;
    background: #ffffff;
    border: 0;
    border-bottom: 1px solid #eef0f2;
    color: var(--korvest-ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.k2-airport-result:last-child {
    border-bottom: 0;
}

.k2-airport-result:hover,
.k2-airport-result:focus-visible,
.k2-airport-result-active {
    background: #f3f7f4;
    outline: none;
}

.k2-airport-result-top {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.k2-airport-result-top strong {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
}

.k2-airport-result-top span {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.k2-airport-result-top .k2-airport-result-name {
    flex: 1 1 auto;
}

.k2-airport-result-fuel {
    flex: 0 0 auto;
    min-width: max-content;
    margin-left: auto;
    overflow: visible;
    font-weight: 800;
    color: #176b3a;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.k2-airport-result-meta,
.k2-airport-result-empty {
    color: var(--korvest-muted);
    font-size: .75rem;
}

.k2-airport-result-meta {
    margin-top: 2px;
}

.k2-airport-result-empty {
    padding: 10px;
}


/* ==================================================
   K2 COPILOT — FLIGHT PLANNER
   RIGHT BLOCK: ALTITUDE + FUEL + PLAN
   ================================================== */

.k2-planner-flight-block {
    flex: 0 0 auto;
}


.k2-planner-flight-inputs {
    display: grid;

    /*
     * Compact operational controls.
     *
     * Altitude | Fuel L | Fuel R | Plan
     */
    grid-template-columns:
        105px
        78px
        78px
        88px;

    gap: 10px;

    align-items: end;
}


.k2-planner-flight-inputs > div {
    min-width: 0;
}


/* ==================================================
   K2 COPILOT — FLIGHT PLANNER
   INPUT CONTROL HEIGHT CONSISTENCY

   PURPOSE:
   Keep select boxes, numeric fields and Plan button
   visually aligned on the same horizontal baseline.
   ================================================== */

.k2-planner-route-inputs .form-control,
.k2-planner-flight-inputs .form-control,
.k2-planner-flight-inputs .btn {
    min-height: 38px;
}


/* ==================================================
   K2 COPILOT — FLIGHT PLANNER
   TABLET FALLBACK

   On smaller screens the two logical blocks may stack,
   but each block retains its own internal horizontal
   organization.
   ================================================== */

@media (max-width: 991.98px) {

    .k2-planner-input-row {
        flex-direction: column;
        align-items: stretch;

        gap: 20px;
    }


    .k2-planner-route-block,
    .k2-planner-flight-block {
        width: 100%;
    }


    .k2-planner-flight-inputs {
        grid-template-columns:
            1.2fr
            1fr
            1fr
            1fr;
    }

}


/* ==================================================
   K2 COPILOT — FLIGHT PLANNER
   PHONE FALLBACK
   ================================================== */

@media (max-width: 575.98px) {

    .k2-planner-route-inputs {
        grid-template-columns:
            1fr
            1fr;
    }


    .k2-planner-flight-inputs {
        grid-template-columns:
            1.2fr
            1fr
            1fr
            1fr;
    }

}

/* ==================================================
   K2 COPILOT — FLIGHT PLANNER
   SECTION: FLIGHT PROGRESS / TIME / INLINE METRICS

   PURPOSE:
   1. Departure + Arrival on one line
   2. Time labels row
   3. Time values row
   4. Compact single-line planning metrics
   ================================================== */


/* ==================================================
   K2 COPILOT — FLIGHT PLANNER
   PROGRESS AREA
   ================================================== */

.k2-flight-progress {
    margin-top: 10px;
    margin-bottom: 18px;
}


.k2-flight-progress-airports {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 10px;

    font-size: 1rem;
    font-weight: 700;
}


.k2-flight-progress-time-labels,
.k2-flight-progress-time-values {
    display: grid;
    grid-template-columns:
        minmax(300px, 1.55fr)
        minmax(105px, .75fr)
        minmax(130px, .9fr)
        minmax(120px, .85fr)
        minmax(90px, .7fr);
    align-items: center;
}


.k2-flight-progress-time-labels {
    margin-bottom: 4px;

    color: var(--korvest-muted);
    font-size: 0.82rem;
    font-weight: 500;
}


.k2-flight-progress-time-values {
    margin-bottom: 10px;

    font-variant-numeric: tabular-nums;
}


.k2-flight-progress-time-values > div {
    min-width: 0;
}


.k2-start-time-inline {
    width: 132px;
    min-width: 132px;
    max-width: 100%;
    min-height: 34px;

    padding: 0.3rem 0.5rem;

    border: 1px solid var(--korvest-line);
    border-radius: 0.375rem;
    background: #ffffff;

    font-weight: 600;
    font-variant-numeric: tabular-nums;
}


.k2-flight-progress-line {
    display: flex;
    align-items: center;
    width: 100%;
}


.k2-progress-track {
    flex: 1;
    height: 4px;
    background: var(--korvest-green-dark);
}


.k2-progress-point {
    width: 11px;
    height: 11px;

    flex: 0 0 11px;

    background: #ffffff;
    border: 3px solid var(--korvest-green-dark);
    border-radius: 50%;
}


/* ==================================================
   K2 COPILOT — FLIGHT PLANNER
   INLINE METRICS
   ================================================== */

.k2-flight-inline-metrics {
    display: grid;
    grid-template-columns:
        repeat(5, minmax(0, 1fr));

    gap: 16px;

    padding: 10px 0 4px;
    border-top: 1px solid var(--korvest-line);
}


.k2-inline-metric {
    min-width: 0;
}


.k2-inline-metric span {
    display: block;

    margin-bottom: 2px;

    color: var(--korvest-muted);
    font-size: 0.78rem;
}


.k2-inline-metric strong {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
}


.k2-inline-metric b {
    font-weight: 700;
}


/* ==================================================
   K2 COPILOT — FLIGHT PLANNER
   TABLET / PHONE
   ================================================== */

@media (max-width: 991.98px) {

    .k2-flight-inline-metrics {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
        row-gap: 12px;
    }

}


@media (max-width: 575.98px) {

    .k2-flight-inline-metrics {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .k2-start-time-inline {
        width: 124px;
        min-width: 124px;
    }

}

/* ==================================================
   K2 COPILOT — FLIGHT PLANNER
   SECTION: OPERATIONAL DETAIL CARDS

   PURPOSE:
   Three equal cockpit-readable cards:
   Departure | Fuel | Arrival

   STANDARD:
   Gray labels.
   Bold core data.
   Units placed in labels where practical.
   ================================================== */

.k2-flight-detail-cards {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 16px;

    margin-top: 16px;
}


.k2-flight-detail-card {
    min-width: 0;

    padding: 16px;

    background: #ffffff;

    border: 1px solid var(--korvest-line);
    border-radius: 10px;
}


/* ==================================================
   K2 COPILOT — FLIGHT PLANNER
   DETAIL CARD HEADER
   ================================================== */

.k2-detail-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;

    gap: 12px;

    margin-bottom: 14px;

    font-weight: 700;
}


.k2-detail-card-airport {
    min-width: 0;

    overflow: hidden;

    font-size: 0.9rem;

    white-space: nowrap;
    text-overflow: ellipsis;
}


.k2-detail-card-note {
    color: var(--korvest-muted);

    font-size: 0.75rem;
    font-weight: 500;
}


/* ==================================================
   K2 COPILOT — FLIGHT PLANNER
   DETAIL LABEL / DATA STANDARD
   ================================================== */

.k2-detail-grid {
    display: grid;

    /* Labels use the left side; every parameter value is anchored
       against the right edge of the card. */
    grid-template-columns:
        minmax(0, 1fr)
        max-content;

    gap: 8px 14px;
    align-items: baseline;

    width: 100%;
    min-width: 0;

    font-size: 0.9rem;
}


.k2-detail-label {
    min-width: 0;
    color: var(--korvest-muted);
    white-space: nowrap;
}


.k2-detail-data {
    justify-self: end;
    min-width: 0;
    max-width: 100%;

    text-align: right;

    font-weight: 700;
    font-variant-numeric: tabular-nums;

    white-space: nowrap;
}

/* Long warning text stays right-aligned but may wrap inward instead of
   pushing the value column outside the card. */
#k2DepartureWarning,
#k2ArrivalWarning,
#k2ModalWarning {
    justify-self: end;
    max-width: 250px;
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
}


.k2-detail-legend {
    margin-top: 10px;

    color: var(--korvest-muted);

    font-size: 0.75rem;
}


/* ==================================================
   K2 COPILOT — FLIGHT PLANNER
   ARRIVAL WIND PRIORITY

   PURPOSE:
   Wind is one of the most important dynamic arrival
   values and should be immediately visible.
   ================================================== */

.k2-arrival-wind-label {
    font-weight: 600;
}


.k2-arrival-wind-data {
    font-size: 1.05rem;
}


/* ==================================================
   K2 COPILOT — FLIGHT PLANNER
   FUEL CARD: TWO TANK BARS

   PURPOSE:
   Left and Right tank calculated fuel displayed
   visually side-by-side.
   ================================================== */

.k2-fuel-tanks {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 28px;

    margin-bottom: 16px;
}


.k2-fuel-tank {
    display: flex;
    flex-direction: column;
    align-items: center;

    min-width: 0;
}


.k2-fuel-tank-label {
    margin-bottom: 2px;

    color: var(--korvest-muted);

    font-size: 0.82rem;
}


.k2-fuel-tank-value {
    margin-bottom: 6px;

    font-size: 1.05rem;
    font-weight: 700;

    font-variant-numeric: tabular-nums;
}


/* Vertical fuel gauge */

.k2-fuel-bar-shell {
    position: relative;

    display: flex;
    align-items: flex-end;

    width: 54px;
    height: 118px;

    overflow: hidden;

    background: #f3f4f6;

    border: 1px solid var(--korvest-line);
    border-radius: 6px;
}


.k2-fuel-bar-fill {
    width: 100%;

    background: var(--korvest-green);

    transition:
        height 0.35s ease;
}


/* Active tank indication */

.k2-fuel-active {
    min-height: 18px;

    margin-top: 5px;

    color: var(--korvest-green-dark);

    font-size: 0.72rem;
    font-weight: 700;

    white-space: nowrap;
}


/* ==================================================
   K2 COPILOT — FLIGHT PLANNER
   FUEL CARD: TOTAL / SWITCH
   ================================================== */

.k2-fuel-summary {
    padding-top: 12px;

    border-top: 1px solid var(--korvest-line);
}


.k2-fuel-switch-time {
    font-size: 1.05rem;
}


/* ==================================================
   K2 COPILOT — FLIGHT PLANNER
   FUEL CARD: CHANGE-TANK WARNING

   Hidden normally.

   Future active-flight behavior:
   Red / flashing when the timer reaches zero.
   ================================================== */

.k2-fuel-change-warning {
    width: 100%;

    margin-top: 12px;
    padding: 8px 10px;

    color: #ffffff;
    background: #b91c1c;

    border: 0;
    border-radius: 6px;

    font-weight: 800;
    letter-spacing: 0.04em;
}


.k2-fuel-change-warning.k2-warning-active {
    animation:
        k2-fuel-warning-flash
        1s
        ease-in-out
        infinite;
}


@keyframes k2-fuel-warning-flash {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.45;
    }

}


/* ==================================================
   K2 COPILOT — FLIGHT PLANNER
   TABLET

   Keep cards readable when cockpit width decreases.
   ================================================== */

@media (max-width: 991.98px) {

    .k2-flight-detail-cards {
        grid-template-columns:
            1fr
            1fr;
    }


    /*
     * Fuel remains visually important.
     * On a two-column layout it spans the full width.
     */

    .k2-fuel-card {
        grid-column: 1 / -1;
        grid-row: 2;
    }

}


/* ==================================================
   K2 COPILOT — FLIGHT PLANNER
   PHONE
   ================================================== */

@media (max-width: 575.98px) {

    .k2-flight-detail-cards {
        grid-template-columns: 1fr;
    }


    .k2-fuel-card {
        grid-column: auto;
        grid-row: auto;
    }

}

/* ==================================================
   K2 COPILOT — FLIGHT PLANNER
   SECTION: NEARBY AIRPORTS
   ================================================== */

.k2-nearby-airports {
    margin-top: 18px;
}

.k2-nearby-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 8px;
}

/* Locked status width prevents the Nearby header from shifting as age changes. */
.k2-nearby-updated {
    flex: 0 0 150px;
    width: 150px;
    min-width: 150px;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.k2-nearby-title {
    font-size: 0.95rem;
    font-weight: 700;
}

.k2-nearby-note {
    margin-top: 2px;
    color: var(--korvest-muted);
    font-size: 0.72rem;
}

/* Same three-column rhythm as Departure | Fuel | Arrival. */
.k2-nearby-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

/* Columns stay visually open; individual airports are borderless buttons. */
.k2-nearby-card {
    min-width: 0;
    padding: 0;
    background: transparent;
    border: 0;
}

.k2-nearby-card-title {
    margin-bottom: 5px;
    padding-bottom: 5px;
    color: var(--korvest-muted);
    border-bottom: 1px solid var(--korvest-line);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-align: left;
}

.k2-nearby-list {
    display: grid;
    grid-auto-rows: 32px;
    align-content: start;
    gap: 0;
    height: 128px;
    overflow: hidden;
}

.k2-nearby-row {
    display: grid;
    grid-template-columns: minmax(54px, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 32px;
    padding: 4px 2px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #eef0f2;
    border-radius: 0;
    color: #111827;
    font: inherit;
    font-size: 0.82rem;
    text-align: left;
    cursor: pointer;
}

.k2-nearby-row:last-child {
    border-bottom: 0;
}

.k2-nearby-row:hover,
.k2-nearby-row:focus-visible {
    background: #f8fafc;
    outline: none;
}

.k2-nearby-ident {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.k2-nearby-private {
    flex: 0 0 auto;
    padding: 1px 4px;
    border: 1px solid var(--korvest-line);
    border-radius: 3px;
    color: var(--korvest-muted);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.15;
}

.k2-nearby-distance,
.k2-nearby-bearing {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.k2-nearby-distance {
    font-weight: 700;
}

/* Forward/aft is communicated by bearing color, not by a box border. */
.k2-nearby-forward .k2-nearby-bearing {
    color: var(--korvest-green);
    font-weight: 800;
}

.k2-nearby-aft .k2-nearby-bearing {
    color: #dc3545;
    font-weight: 800;
}

.k2-nearby-empty {
    padding: 6px 2px;
    color: var(--korvest-muted);
}


/* ==================================================
   K2 COPILOT — FLIGHT PLANNER
   SECTION: AIRPORT DETAIL MODAL

   DESKTOP:
   Top-align with the Fuel / Arrival cards and use the Fuel-card
   width. The panel may extend downward over Nearby Airports so
   all airport details remain visible without internal scrolling.
   Departure and Arrival remain visible side-by-side.
   ================================================== */

.k2-airport-modal[hidden] {
    display: none !important;
}

.k2-airport-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    pointer-events: none;
}

.k2-airport-modal-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    background: rgba(255, 255, 255, 0.01);
    border: 0;
    pointer-events: auto;
}

.k2-airport-modal-panel {
    position: fixed;
    z-index: 1;
    overflow: visible;
    padding: 14px;
    background: #f7faf7;
    border: 1px solid var(--korvest-line);
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
    pointer-events: auto;
}

.k2-airport-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
}

.k2-airport-modal-title {
    margin-top: 1px;
    font-size: 1.1rem;
    font-weight: 800;
}

.k2-modal-position {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 8px;
    font-size: 0.82rem;
}

.k2-modal-dot {
    margin: 0 4px;
    color: var(--korvest-muted);
}

.k2-modal-detail-grid {
    padding-top: 8px;
    gap: 6px 12px;
    font-size: 0.84rem;
    border-top: 1px solid var(--korvest-line);
}

.k2-modal-runway-list {
    display: grid;
    gap: 2px;
    margin-top: 8px;
}

.k2-modal-runway-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 5px;
    border-top: 1px solid #eef0f2;
    font-size: 0.8rem;
}

.k2-modal-runway-row span {
    color: var(--korvest-muted);
    text-align: right;
}

.k2-airport-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}


@media (max-width: 767.98px) {

    .k2-nearby-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .k2-nearby-row {
        grid-template-columns: 1fr;
        gap: 1px;
        padding: 6px 2px;
    }

    .k2-nearby-distance,
    .k2-nearby-bearing {
        font-size: 0.76rem;
    }

    .k2-airport-modal {
        display: grid;
        place-items: center;
        padding: 10px;
    }

    .k2-airport-modal-panel {
        position: relative;
        left: auto !important;
        top: auto !important;
        width: min(520px, 100%) !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible;
        padding: 14px;
    }

}


@media (max-width: 575.98px) {

    .k2-nearby-note {
        display: none;
    }

    .k2-nearby-card-title {
        font-size: 0.64rem;
        letter-spacing: 0.04em;
    }

    .k2-nearby-row {
        font-size: 0.78rem;
    }

    .k2-airport-modal-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .k2-airport-modal-actions .btn {
        width: 100%;
    }

}


/* Remaining-flight values stay compact beside Current Time. */
#k2CurrentTime,
#k2DistanceRemaining,
#k2TimeRemaining,
#k2Eta {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 991.98px) {
    .k2-flight-progress-time-labels,
    .k2-flight-progress-time-values {
        grid-template-columns:
            minmax(250px, 1.45fr)
            minmax(90px, .75fr)
            minmax(115px, .85fr)
            minmax(110px, .8fr)
            minmax(80px, .65fr);
        column-gap: 8px;
    }

    .k2-flight-progress-time-labels {
        font-size: .75rem;
    }
}

@media (max-width: 767.98px) {
    .k2-flight-progress-time-labels,
    .k2-flight-progress-time-values {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 7px;
    }

    .k2-flight-progress-time-labels {
        display: none;
    }

    .k2-flight-progress-time-values > div::before {
        display: block;
        margin-bottom: 2px;
        color: var(--korvest-muted);
        font-size: .72rem;
        font-weight: 500;
    }

    .k2-flight-progress-time-values > div:nth-child(1)::before { content: "Start Time"; }
    .k2-flight-progress-time-values > div:nth-child(2)::before { content: "Current Time"; }
    .k2-flight-progress-time-values > div:nth-child(3)::before { content: "Distance Remaining"; }
    .k2-flight-progress-time-values > div:nth-child(4)::before { content: "Time Remaining"; }
    .k2-flight-progress-time-values > div:nth-child(5)::before { content: "ETA"; }

    .k2-flight-progress-time-values > div {
        text-align: left !important;
    }
}

/* ==================================================
   K2 PLANNER — 60X DESKTOP SIMULATION
   ================================================== */

.k2-sim-start-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.k2-sim-toggle {
    min-height: 34px;
    padding: 0.3rem 0.65rem;
    white-space: nowrap;
    font-size: 0.82rem;
    font-weight: 700;
}

.k2-sim-toggle.k2-sim-running {
    border-color: #9b2c2c;
    color: #9b2c2c;
    background: #fff7f7;
}

.k2-sim-rate {
    color: var(--korvest-muted);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.k2-progress-track {
    position: relative;
}

.k2-sim-progress-marker {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: var(--korvest-green-dark);
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 1px var(--korvest-green-dark);
}

@media (max-width: 767.98px) {
    .k2-sim-start-cell {
        flex-wrap: wrap;
        gap: 5px;
    }

    .k2-sim-toggle {
        min-height: 32px;
        padding-inline: 0.5rem;
    }
}


/* K2 Planner operational-time cloud/ceiling values may contain multiple layers. */
.k2-weather-detail {
    max-width: 200px;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

/* ==================================================
   K2 PLANNER — AIRCRAFT SELECTOR

   Main Planner stays compact:
   Aircraft [saved profile list] [+]
   ================================================== */

.k2-aircraft-selector-block {
    width: min(500px, 100%);
}

.k2-aircraft-selector-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 7px;
    align-items: stretch;
}

.k2-aircraft-selector-row .form-select,
.k2-aircraft-add {
    min-height: 38px;
}

.k2-aircraft-add {
    width: 42px;
    min-width: 42px;
    padding: 0;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
}

.k2-planner-flight-inputs.k2-single-start-tank {
    grid-template-columns:
        105px
        100px
        88px;
}

.k2-fuel-tanks.k2-single-tank {
    grid-template-columns: 1fr;
    justify-items: center;
}

.k2-fuel-tanks.k2-single-tank .k2-fuel-tank {
    width: 100%;
}


/* ==================================================
   K2 PLANNER — ADD AIRCRAFT MODAL
   ================================================== */

.k2-profile-modal[hidden] {
    display: none !important;
}

.k2-profile-modal {
    position: fixed;
    inset: 0;
    z-index: 2600;
    display: grid;
    place-items: center;
    padding: 12px;
}

.k2-profile-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.24);
}

.k2-profile-modal-panel {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    padding: 16px;
    background: #ffffff;
    border: 1px solid var(--korvest-line);
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.k2-profile-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.k2-profile-modal-title {
    margin-top: 1px;
    font-size: 1.08rem;
    font-weight: 800;
}

.k2-aircraft-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.k2-aircraft-modal-wide {
    grid-column: 1 / -1;
}

.k2-profile-modal-error {
    margin-bottom: 12px;
}

.k2-profile-modal-note {
    margin-top: 12px;
    color: var(--korvest-muted);
    font-size: .78rem;
}

.k2-profile-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

@media (max-width: 575.98px) {
    .k2-aircraft-selector-block {
        width: 100%;
    }

    .k2-aircraft-modal-grid {
        grid-template-columns: 1fr;
    }

    .k2-aircraft-modal-wide {
        grid-column: auto;
    }

    .k2-profile-modal-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .k2-profile-modal-actions .btn {
        width: 100%;
    }
}

/* ==================================================
   K2 PLANNER — FACTUAL OPERATIONAL WARNING STRIP

   Hidden when there are no reportable conditions.
   Flight-category labels are informational only; this
   component never generates route or go/no-go advice.
   ================================================== */

.k2-operational-warnings {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 10px 0 2px;
    padding: 7px 9px;
    border: 1px solid #d9dfdc;
    border-radius: 7px;
    background: #fafbfa;
}

.k2-operational-warning-label {
    flex: 0 0 auto;
    padding-top: 3px;
    color: #59636d;
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.k2-operational-warning-items {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.k2-operational-warning-item {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 25px;
    padding: 3px 7px;
    border: 1px solid #d4dad7;
    border-radius: 5px;
    background: #ffffff;
    font-size: .76rem;
    line-height: 1.25;
}

.k2-operational-warning-text {
    font-weight: 750;
}

.k2-operational-warning-source {
    color: #68727c;
    font-size: .7rem;
    font-weight: 500;
}

.k2-operational-warning-mvfr {
    border-color: #c9b66f;
    background: #fffdf1;
}

.k2-operational-warning-ifr,
.k2-operational-warning-lifr {
    border-color: #cf9b96;
    background: #fff7f6;
}

.k2-operational-warning-unavailable,
.k2-operational-warning-notice {
    border-color: #c9ced3;
    background: #f7f8f9;
}

@media (max-width: 575.98px) {
    .k2-operational-warnings {
        display: block;
    }

    .k2-operational-warning-label {
        margin-bottom: 5px;
        padding-top: 0;
    }
}
