/* (755) Fiche détaillée d'un vol suivi par AlsaéroTrack (public/tracker-vol.php). Suit les thèmes du site (jetons --surface, --text, --border…). */
:root {
    --tv-c1: #1d4e89;
    --tv-c2: #c8571a;
    --tv-grid: rgba(107, 114, 128, .25);
    --tv-ground: rgba(107, 114, 128, .13);
    --tv-climb: rgba(47, 158, 82, .13);
    --tv-cruise: rgba(29, 78, 137, .10);
    --tv-descent: rgba(200, 87, 26, .13);
    --tv-excellent: #1f8a4c;
    --tv-good: #3b8f3b;
    --tv-normal: #b8860b;
    --tv-firm: #d2691e;
    --tv-hard: #c8102e;
    /* (824) fonds de la tuile « Taux d'atterrissage » : vert, jaune, orange, rouge */
    --tv-bg-green: #d9f3e1; --tv-fg-green: #14532d;
    --tv-bg-yellow: #fdf0c4; --tv-fg-yellow: #6b4e00;
    --tv-bg-orange: #ffdcc2; --tv-fg-orange: #8a3b00;
    --tv-bg-red: #fbd0d4; --tv-fg-red: #7a0f1d;
}
:root:is([data-theme="dark"], [data-theme="anthracite"]) {
    --tv-c1: #6fa8e8;
    --tv-c2: #f09a5b;
    --tv-grid: rgba(154, 165, 184, .25);
    --tv-ground: rgba(154, 165, 184, .14);
    --tv-climb: rgba(111, 211, 154, .14);
    --tv-cruise: rgba(111, 168, 232, .12);
    --tv-descent: rgba(240, 154, 91, .15);
    --tv-excellent: #6fd39a;
    --tv-good: #8fd36f;
    --tv-normal: #e7c15a;
    --tv-firm: #f09a5b;
    --tv-hard: #ff6b7e;
    --tv-bg-green: #1c4630; --tv-fg-green: #a8e8c1;
    --tv-bg-yellow: #4a3d12; --tv-fg-yellow: #f1d98a;
    --tv-bg-orange: #5a3015; --tv-fg-orange: #ffc08f;
    --tv-bg-red: #5c1a24; --tv-fg-red: #ffb3bd;
}

.tv-alert { border-left: 4px solid var(--tv-firm); }

.tv-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; }
.tv-tile { display: flex; flex-direction: column; gap: .15rem; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-alt); min-width: 0; }
.tv-tile__label { font-size: .8rem; color: var(--text-muted); }
.tv-tile__value { font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.tv-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.tv-cols > .card { margin: 0; }
@media (max-width: 760px) { .tv-cols { grid-template-columns: minmax(0, 1fr); } }

.tv-dl { display: grid; grid-template-columns: fit-content(50%) minmax(0, 1fr); gap: .3rem 1.2rem; margin: 0; }
.tv-dl dt { color: var(--text-muted); }
.tv-dl dd { margin: 0; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.tv-dl dt { min-width: 0; overflow-wrap: anywhere; }

.tv-tile__value .tv-rate__quality { font-size: .85rem; margin-left: .35rem; }
.tv-rate { display: flex; align-items: baseline; gap: .8rem; margin: 0 0 .8rem; }
.tv-rate__value { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tv-rate__value small { font-size: .9rem; font-weight: 400; color: var(--text-muted); }
.tv-rate__quality { font-weight: 600; }
.tv-rate--excellent .tv-rate__quality { color: var(--tv-excellent); }
.tv-rate--good .tv-rate__quality { color: var(--tv-good); }
.tv-rate--normal .tv-rate__quality { color: var(--tv-normal); }
.tv-rate--firm .tv-rate__quality { color: var(--tv-firm); }
.tv-rate--hard .tv-rate__quality { color: var(--tv-hard); }

/* Courbes */
.tv-charts { display: flex; flex-direction: column; gap: 1rem; position: relative; overflow-x: clip; }
.tvc__head { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: baseline; margin-bottom: .2rem; }
.tvc__title { font-weight: 600; font-size: .9rem; }
.tvc__legend { display: flex; gap: .9rem; font-size: .8rem; color: var(--text-muted); }
.tvc__legend i { display: inline-block; width: .9rem; height: 3px; border-radius: 2px; margin-right: .35rem; vertical-align: middle; }
.tvc svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.tvc text { fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.tvc .tvc-grid { stroke: var(--tv-grid); stroke-width: 1; }
.tvc .tvc-zero { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }
.tvc .tvc-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tvc .tvc-line--1 { stroke: var(--tv-c1); }
.tvc .tvc-line--2 { stroke: var(--tv-c2); }
.tvc .tvc-area { fill: var(--tv-c1); opacity: .14; }
.tvc .tvc-band--ground { fill: var(--tv-ground); }
.tvc .tvc-band--climb { fill: var(--tv-climb); }
.tvc .tvc-band--cruise { fill: var(--tv-cruise); }
.tvc .tvc-band--descent { fill: var(--tv-descent); }
.tvc .tvc-mark { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 4 3; }
.tvc .tvc-cross { stroke: var(--text); stroke-width: 1; opacity: .6; }
.tvc .tvc-dot { stroke: var(--surface); stroke-width: 2; }
.tvc .tvc-dot--1 { fill: var(--tv-c1); }
.tvc .tvc-dot--2 { fill: var(--tv-c2); }
.tv-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 9.5rem; padding: .45rem .6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18); font-size: .8rem; font-variant-numeric: tabular-nums; }
.tv-tip b { display: block; margin-bottom: .15rem; }
.tv-tip span { color: var(--text-muted); }

/* Phases */
.tv-phasebar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin-bottom: .9rem; border: 1px solid var(--border); }
.tv-phase { flex-basis: 0; min-width: 2px; }
.tv-phase--parked, .tv-phase--taxi_out, .tv-phase--taxi_in, .tv-phase--arrived { background: #8a94a6; }
.tv-phase--takeoff, .tv-phase--climb { background: #2f9e52; }
.tv-phase--cruise { background: #2f6fed; }
.tv-phase--descent, .tv-phase--approach, .tv-phase--landing { background: #d9822b; }
.tv-dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; margin-right: .5rem; flex: none; }
.tv-tablewrap { overflow-x: auto; }
.tv-table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.tv-table th, .tv-table td { text-align: left; padding: .35rem .8rem .35rem 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tv-table th { color: var(--text-muted); font-weight: 600; font-size: .85rem; }

.tv-events { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.tv-events time { display: inline-block; min-width: 4.8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* (769) « Revoir le vol » : carte, tableau d'instruments et barre de lecture */
.tvr { display: flex; flex-direction: column; gap: .75rem; }
.tvr__main { display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: .75rem; align-items: stretch; }
.tvr__map { height: 480px; border-radius: 8px; min-width: 0; z-index: 0; }
.tvr__panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: .5rem; min-width: 0; }
.tvr__cell--wide { grid-column: 1 / -1; }
.tvr__cell { display: flex; flex-direction: column; gap: .1rem; padding: .5rem .7rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-alt); min-width: 0; }
.tvr__label { font-size: .75rem; color: var(--text-muted); }
.tvr__value { font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tvr__cell--wide .tvr__value { font-size: .85rem; font-weight: 500; }
.tvr__bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .9rem; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-alt); }
.tvr__btn { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 0; background: var(--tv-c1); color: var(--surface); font-size: 1rem; line-height: 1; cursor: pointer; }
.tvr__btn:focus-visible, .tvr__tick:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.tvr__timelabel { flex: none; min-width: 6.5rem; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.tvr__track { position: relative; flex: 1 1 14rem; min-width: 0; padding-top: 14px; }
.tvr__ticks { position: absolute; left: 0; right: 0; top: 0; height: 14px; pointer-events: none; }
.tvr__tick { position: absolute; top: 0; width: 12px; height: 14px; margin-left: -6px; padding: 0; border: 0; background: transparent; cursor: pointer; pointer-events: auto; }
.tvr__tick::after { content: ""; position: absolute; left: 5px; top: 0; width: 2px; height: 14px; border-radius: 1px; background: var(--text-muted, #8a94a6); }
.tvr__tick--major::after { background: var(--tv-c2); width: 3px; left: 4px; }
.tvr__range { display: block; width: 100%; margin: 0; accent-color: var(--tv-c1); }
.tvr__speed { flex: none; padding: .3rem .4rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }
.tvr__follow { flex: none; display: inline-flex; align-items: center; gap: .4rem; font-size: .9rem; cursor: pointer; }
.tvr-plane-wrap { background: transparent; border: 0; }
.tvr-plane { width: 34px; height: 34px; transform-origin: 50% 50%; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
@media (max-width: 760px) {
    .tvr__main { grid-template-columns: minmax(0, 1fr); }
    .tvr__map { height: 360px; }
}

/* (775) Note du vol */
.tv-score__value { font-size: 2.6rem; font-weight: 700; margin: 0 0 .6rem; font-variant-numeric: tabular-nums; }
.tv-score__value small { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
.tv-score__value--good { color: var(--tv-excellent); }
.tv-score__value--mid { color: var(--tv-firm); }
.tv-score__value--low { color: var(--tv-hard); }
.tv-score__row--penalty td:last-child { color: var(--tv-hard); font-weight: 600; }
.tv-score__row--na td { color: var(--text-muted); }

/* (792) Détails du vol en tableaux regroupés. */
.tv-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
@media (max-width: 760px) { .tv-info-grid { grid-template-columns: minmax(0, 1fr); } }
.tv-info { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.tv-info--wide { grid-column: 1 / -1; }
.tv-info thead th { text-align: left; padding: .55rem .85rem; font-size: .9rem; font-weight: 600; background: var(--surface-alt); border-bottom: 1px solid var(--border); }
.tv-info tbody th, .tv-info tbody td { padding: .45rem .85rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); font-size: .92rem; }
.tv-info tbody tr:last-child th, .tv-info tbody tr:last-child td { border-bottom: 0; }
.tv-info tbody th { width: 45%; font-weight: 400; color: var(--text-muted); }
.tv-info tbody td { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tv-info--wide tbody th { width: 14rem; }
@media (max-width: 520px) { .tv-info--wide tbody th { width: 45%; } }
.tv-info tbody th { overflow-wrap: anywhere; }

/* (824) Tuile du taux d'atterrissage : fond selon l'échelle (très doux et doux = vert, normal à ferme et ferme = jaune, dur potentiel = orange, risque important = rouge) */
.tv-tile.tv-rate--very_soft, .tv-tile.tv-rate--soft { background: var(--tv-bg-green); color: var(--tv-fg-green); border-color: transparent; }
.tv-tile.tv-rate--normal, .tv-tile.tv-rate--firm { background: var(--tv-bg-yellow); color: var(--tv-fg-yellow); border-color: transparent; }
.tv-tile.tv-rate--hard { background: var(--tv-bg-orange); color: var(--tv-fg-orange); border-color: transparent; }
.tv-tile.tv-rate--severe { background: var(--tv-bg-red); color: var(--tv-fg-red); border-color: transparent; }
.tv-tile[class*="tv-rate--"] .tv-tile__label { color: inherit; opacity: .8; }
.tv-tile[class*="tv-rate--"] .tv-rate__quality { color: inherit; }
