:root {
  /* --orange est historiquement l'accent (bleu) : nom conserve pour ne pas
     toucher a tous les usages. Style inspire d'une appli de carnet de vol de
     reference : barre de titre ardoise, fond gris-bleu, cartes tres arrondies,
     accent bleu marine, titres de section en majuscules espacees. */
  --orange: #0d3b99;
  --navy: #0d3b99;
  --accent-soft: #e2e8f5;
  --accent-ink: #0d3b99;
  --ink: #1b1f27;
  --muted: #5d6676; /* contraste >= 4.5:1 sur --bg et --surface (WCAG AA) */
  --line: #dde1ea;
  --bg: #e8ebf2;
  --surface: #f8f9fd;
  --header-bg: #22252b;
  --header-ink: #ffffff;
  --hero-from: #1b2a55;
  --hero-to: #2c4175;
  --brand-a: #0d3b99; /* degrades de marque (ecran de connexion, carrousel) : suivent la couleur d'accent choisie */
  --brand-b: #1d5fd0;
  --fsec: #5b8fc4; /* barres de section (details.fsec) : suivent la couleur d'accent */
  --ok: #0a7d2c;
  --warn: #b26a00;
  --err: #c0392b;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 4px 14px rgba(20, 30, 60, .06);
  --sidebar-width: 220px;
  --sidebar-width-collapsed: 64px;
  --bottom-nav-height: 60px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* Theme sombre : soit via preference systeme (mode "auto", pas de data-theme
   pose sur <html>), soit force manuellement via data-theme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --orange: #3a78c9;
    --navy: #8db4f0;
    --ink: #eef1f5;
    --muted: #9aa4b2;
    --line: #2a3038;
    --bg: #0f1319;
    --surface: #1a1f27;
    --accent-soft: #1f2b3d;
    --accent-ink: #9cc0f5;
    --header-bg: #181b21;
    --warn: #e0a040;
    --fsec: #2f5f94;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  --orange: #3a78c9;
  --navy: #8db4f0;
  --ink: #eef1f5;
  --muted: #9aa4b2;
  --line: #2a3038;
  --bg: #0f1319;
  --surface: #1a1f27;
  --accent-soft: #1f2b3d;
  --accent-ink: #9cc0f5;
  --header-bg: #181b21;
  --warn: #e0a040;
  --fsec: #2f5f94;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
}
:root[data-theme="light"] {
  --orange: #0d3b99;
  --navy: #0d3b99;
  --ink: #1b1f27;
  --muted: #5d6676;
  --line: #dde1ea;
  --bg: #e8ebf2;
  --surface: #f8f9fd;
  --accent-soft: #e2e8f5;
  --accent-ink: #0d3b99;
  --header-bg: #22252b;
  --warn: #b26a00;
  --fsec: #5b8fc4;
  --shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 4px 14px rgba(20, 30, 60, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg);
  font-size: clamp(14px, 0.9vw + 12px, 16px);
  line-height: 1.5;
}
h1, h2, h3 { margin: 0; }
h1 { font-size: clamp(1.25rem, 1rem + 1vw, 2rem); }
h2 { font-size: clamp(1.1rem, 0.95rem + 0.6vw, 1.4rem); margin: 24px 0 12px; }
h3 { font-size: clamp(0.75rem, 0.7rem + 0.2vw, 0.85rem); margin: 16px 0 8px; color: var(--navy); text-transform: uppercase; letter-spacing: .09em; font-weight: 700; }
p { font-size: max(14px, 1em); }
a { color: var(--orange); }

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Apparence : pastilles de couleur d'accent (Profil). */
.accent-palette { display: grid; grid-template-columns: repeat(4, 44px); justify-content: center; gap: 14px; }
.accent-swatch { width: 44px; height: 44px; min-width: 44px; min-height: 44px; border-radius: 50%; border: 3px solid transparent; padding: 0; cursor: pointer; box-shadow: 0 0 0 1px var(--line); }
.accent-swatch.active { border-color: var(--ink); transform: scale(1.1); }
.accent-custom { grid-column: 1 / -1; display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; margin: 0; }
.accent-custom input[type="color"] { width: 44px; height: 44px; min-height: 44px; padding: 0; border: 2px solid var(--line); border-radius: 50%; background: none; cursor: pointer; }
@media (min-width: 481px) {
  .accent-palette { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; }
  .accent-custom { grid-column: auto; }
}

/* ======================= Ecran de connexion ======================= */
.login-screen {
  min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--hero-from), var(--brand-a));
  padding: max(16px, var(--safe-top)) max(16px, var(--safe-right)) max(16px, var(--safe-bottom)) max(16px, var(--safe-left));
}
.login-card {
  background: var(--surface); border-radius: var(--radius); padding: 32px; width: 100%; max-width: 380px;
  display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-card h1 { font-size: 22px; text-align: center; }
.login-card p.meta { color: var(--muted); font-size: 13px; text-align: center; margin: 0 0 8px; }
.login-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.login-tabs button { flex: 1; background: var(--accent-soft); color: var(--muted); }
.login-tabs button.active { background: var(--orange); color: #fff; }
.login-card .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-err { color: var(--err); font-size: 13px; min-height: 18px; }

/* ======================= App shell (mobile first) ======================= */
header {
  background: var(--header-bg); color: var(--header-ink);
  padding: 12px 16px; padding-top: calc(12px + var(--safe-top));
  padding-left: calc(16px + var(--safe-left)); padding-right: calc(16px + var(--safe-right));
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
  position: sticky; top: 0; z-index: 40;
}
.header-left { display: flex; align-items: center; gap: 8px; }
header h1 { font-size: clamp(1rem, 0.9rem + 0.5vw, 1.2rem); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.header-user { font-size: 13px; color: #cfd5e3; display: flex; align-items: center; gap: 10px; }
.header-user #user-label { display: none; }

.icon-btn {
  background: none; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-sm);
  min-width: 44px; min-height: 44px; font-size: 18px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
}
.icon-btn:hover { background: var(--accent-soft); filter: none; }
header .icon-btn { color: var(--header-ink); border-color: rgba(255, 255, 255, .22); }
header .icon-btn:hover { background: rgba(255, 255, 255, .12); }
header button.ghost { background: transparent; color: var(--header-ink); border-color: rgba(255, 255, 255, .4); }
header button.ghost:hover { background: rgba(255, 255, 255, .12); }
.drawer-toggle { display: inline-flex; }

/* Coquille en colonne flex de la hauteur exacte du viewport : header a sa
   hauteur naturelle (flex-shrink:0), .app-body prend le reste (flex:1 +
   min-height:0 — indispensable, un enfant flex ne retrecit jamais sous sa
   hauteur de contenu par defaut) et seuls main/.sidebar defilent en interne
   (overflow-y:auto), jamais le document entier. Remplace un ancien calcul
   `calc(100vh - 62px)` fragile qui supposait a tort une hauteur de header
   fixe (elle ne l'est pas : `header` a flex-wrap et une hauteur variable) —
   c'est ce qui empechait le scroll interne de fonctionner correctement.
   Voir CLAUDE.md. */
#app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
header { flex-shrink: 0; }

.app-body { display: flex; align-items: stretch; flex: 1; min-height: 0; }

.sidebar { display: none; }

main {
  flex: 1; min-width: 0; overflow-y: auto;
  padding: 16px; padding-bottom: calc(16px + var(--bottom-nav-height) + var(--safe-bottom));
  max-width: 1440px; margin: 0 auto; width: 100%;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Bottom navigation — mobile uniquement */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: grid; grid-template-columns: 1fr 1fr auto 1fr 1fr; align-items: center;
  background: var(--surface); border-top: none; border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -2px 14px rgba(20, 30, 60, .12);
  padding: 6px max(8px, var(--safe-right)) calc(6px + var(--safe-bottom)) max(8px, var(--safe-left));
}
.bottom-nav .tab-btn {
  background: none; border: none; color: var(--muted); font-size: 10px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 48px; padding: 4px; border-radius: var(--radius-sm);
}
.bottom-nav .tab-btn span { font-size: 10px; }
.bottom-nav .tab-btn.active { color: var(--orange); }
.fab-btn {
  width: 52px; height: 52px; border-radius: 50%; background: var(--orange); color: #fff;
  font-size: 26px; line-height: 1; display: flex; align-items: center; justify-content: center;
  margin: 0 auto; box-shadow: 0 4px 12px rgba(0,0,0,.25); border: none;
}

/* Drawer (menu complementaire mobile) */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 46; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 47; width: min(280px, 80vw);
  background: var(--surface); box-shadow: 4px 0 20px rgba(0,0,0,.2);
  padding: calc(16px + var(--safe-top)) 16px 16px calc(16px + var(--safe-left));
  display: flex; flex-direction: column; gap: 4px;
  transform: translateX(-100%); transition: transform .2s ease;
}
.drawer:not(.hidden) { transform: translateX(0); }
.drawer.hidden { display: flex; visibility: hidden; pointer-events: none; }
.drawer .tab-btn { justify-content: flex-start; }
.sidebar .tab-btn, .drawer .tab-btn {
  background: none; color: var(--ink); border-radius: var(--radius-sm); font-weight: 600;
  display: flex; align-items: center; gap: 10px; text-align: left;
}
.sidebar .tab-btn:hover, .drawer .tab-btn:hover { background: var(--accent-soft); filter: none; }
.sidebar .tab-btn.active, .drawer .tab-btn.active { background: var(--navy); color: #fff; }
:root[data-theme="dark"] .sidebar .tab-btn.active, :root[data-theme="dark"] .drawer .tab-btn.active { background: var(--orange); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sidebar .tab-btn.active, :root:not([data-theme="light"]) .drawer .tab-btn.active { background: var(--orange); }
}

@media (min-width: 768px) {
  .drawer-toggle, .drawer, .drawer-overlay, .bottom-nav { display: none !important; }

  .sidebar {
    display: flex; flex-direction: column; gap: 2px; width: var(--sidebar-width-collapsed);
    background: var(--surface); border-right: none; box-shadow: 1px 0 0 var(--line);
    padding: 12px 8px calc(12px + var(--safe-bottom)); flex-shrink: 0;
    overflow-y: auto;
  }
  .sidebar .tab-btn { justify-content: center; flex: 1 1 0; min-height: 44px; max-height: 60px; }
  .sidebar .tab-btn span { display: none; }
  .sidebar { gap: 8px; }
  .sidebar.is-open { width: var(--sidebar-width); padding: 12px; }
  .sidebar.is-open .tab-btn { justify-content: flex-start; }
  .sidebar.is-open .tab-btn span { display: inline; }
  .sidebar { transition: width .18s ease; }
  main { padding-bottom: 16px; }
}
.sidebar-toggle {
  display: none; align-self: flex-end; flex: 0 0 auto; width: 32px; height: 32px; min-height: 0; padding: 0; margin-bottom: 6px;
  border-radius: 50%; background: var(--accent-soft); color: var(--ink); font-size: 20px; line-height: 1;
}
.sidebar-toggle:hover { filter: brightness(.95); }
@media (min-width: 768px) {
  .sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .sidebar:not(.is-open) .sidebar-toggle { align-self: center; }
}

.card { background: var(--surface); border: none; border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }

/* Sous-navigation en onglets, toujours visible (pas de menu deroulant) — cf.
   CLAUDE.md "Sous-navigation (subnav3)". */
.subnav3 { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.subnav3 button { padding: 8px 18px; min-height: 40px; border: none; background: var(--accent-soft); cursor: pointer; font-weight: 600; color: var(--muted); border-radius: 999px; }
.subnav3 button.active { background: var(--orange); color: #fff; }
.subnav3-panel { display: none; }
.subnav3-panel.active { display: block; }
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
/* Sans ca, une colonne de grille ne peut jamais retrecir sous la largeur
   naturelle de son contenu (min-width:auto par defaut sur un enfant de
   grid) — un <select> a options longues (type avion, approches IFR) ou
   deux <input> cote a cote (atterrissages jour/nuit) debordaient alors de
   leur cellule au lieu de s'y adapter. */
.grid > * { min-width: 0; }
@media (min-width: 480px) {
  .grid.cols-2, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
}
/* Bandeau Prevu/OUT/OFF/ON/IN/Prevu du formulaire de vol — meme approche que
   .stat-tiles juste en dessous (readout correspondant) : auto-fit plutot
   qu'un cols-6 fixe, pour que les champs masques (commercial-field/
   full-only-field, cf. updateFieldVisibility()) laissent les autres se
   redistribuer au lieu de creuser des trous dans la grille. */
.grid.time-grid { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 480px) {
  .grid.time-grid { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
}

label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 4px; }
/* Deux champs cote a cote dans un meme label (ex. atterrissages jour/nuit,
   latitude/longitude) : sans ca, chaque input garde sa largeur naturelle et
   deborde du label/de la colonne de grille qui le contient. */
.input-row { display: flex; gap: 6px; }
.input-row input { flex: 1; min-width: 0; }
.stepper-row { gap: 10px; }
.stepper { display: flex; align-items: center; gap: 4px; flex: 1; }
.stepper input { text-align: center; min-width: 0; padding: 10px 4px; }
.icon-btn.small { min-width: 32px; min-height: 32px; font-size: 16px; flex-shrink: 0; }

/* Toggle segmente (Type de vol : Général/Commercial/Simulateur) — radios
   natives masquees visuellement (accessibilite/clavier preserves), stylees
   en pilule iOS-like via le <span> associe. Toujours en pleine largeur du
   formulaire (jamais dans une grille a plusieurs colonnes) : ecrase a 1/4 de
   la largeur du modal, "Commercial"/"Simulateur" se retrouvaient tronques. */
.type-toggle { display: flex; background: var(--accent-soft); border-radius: var(--radius-sm); padding: 4px; gap: 4px; }
.type-toggle label { flex: 1; margin: 0; flex-direction: row; gap: 0; }
.type-toggle input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.type-toggle span {
  display: flex; align-items: center; justify-content: center; width: 100%;
  min-height: 40px; padding: 8px 6px; cursor: pointer; font-size: 12px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
  color: var(--muted); text-align: center; box-sizing: border-box;
  border-radius: 9px; transition: background .15s ease, color .15s ease;
}
.type-toggle input:checked + span { background: var(--orange); color: #fff; }
.type-toggle input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }
@media (min-width: 1024px) { .type-toggle span { min-height: 36px; font-size: 11px; } }
input, select, textarea {
  font-size: max(14px, 16px); padding: 10px; border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink); background: var(--surface); font-family: inherit;
  min-height: 44px; max-width: 100%; box-sizing: border-box;
}
textarea { resize: vertical; min-height: 72px; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; flex-shrink: 0; }
.check-row { flex-direction: row; align-items: center; gap: 8px !important; min-height: 44px; }
@media (min-width: 1024px) {
  input, select, textarea { font-size: 14px; min-height: 38px; padding: 8px; }
}

button {
  background: var(--orange); color: #fff; border: none; border-radius: var(--radius-sm); padding: 11px 18px;
  font-size: 14px; cursor: pointer; font-weight: 600; min-height: 44px;
}
button:hover { filter: brightness(.95); }
button.ghost { background: var(--surface); color: var(--orange); border: 1px solid var(--orange); }
button.ghost.danger { color: var(--err); border-color: var(--err); }
button.small { padding: 8px 12px; font-size: 12px; min-height: 40px; }
.actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
@media (min-width: 1024px) {
  button { padding: 9px 16px; min-height: 38px; }
  button.small { padding: 5px 10px; min-height: 32px; }
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; }
tbody tr:hover { background: var(--accent-soft); }
.table-wrap { overflow-x: auto; }
td.actions-cell { display: flex; gap: 6px; white-space: nowrap; }

/* Tableaux responsives : cartes sous 768px (zero scroll horizontal impose),
   tableau classique au-dessus. */
@media (max-width: 767px) {
  .responsive-table thead { display: none; }
  .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table { border: none; }
  .responsive-table tr {
    margin-bottom: 10px; border: none; border-radius: var(--radius-sm); padding: 10px 12px;
    background: var(--surface); box-shadow: var(--shadow);
  }
  .responsive-table td {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 6px 0; border: none; white-space: normal; text-align: right;
  }
  .responsive-table td::before {
    content: attr(data-label); font-weight: 600; color: var(--muted); font-size: 11px;
    text-transform: uppercase; letter-spacing: .02em; text-align: left;
  }
  .responsive-table td:empty::before { content: none; }
  .table-wrap { overflow-x: visible; }
}

.list { display: flex; flex-direction: column; gap: 8px; }
#aircraft-hours-list, #category-hours-list, #countries-list { max-height: 420px; overflow-y: auto; }
#airports-visited-wrap { max-height: 420px; overflow-y: auto; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.item .meta { font-size: 12px; color: var(--muted); }

.stat-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 480px) { .stat-tiles { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); } }
.stat-tile { background: var(--surface); border: none; border-radius: var(--radius); padding: 14px; text-align: center; box-shadow: var(--shadow); }
.stat-tile .value { font-size: clamp(1.1rem, 1rem + 0.6vw, 1.4rem); font-weight: 700; color: var(--orange); }
.stat-tile .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
/* Tuiles de totaux (Apercu du tableau de bord) : degrade bleu nuit, grand chiffre. */
/* Carriere : 12 tuiles de meme taille, alignees en 2 / 3 / 4 colonnes (plus de derniere ligne orpheline). */
#career-tiles { grid-template-columns: repeat(2, 1fr); }
#career-tiles .stat-tile { display: flex; flex-direction: column; justify-content: center; min-height: 96px; }
#career-tiles .stat-tile .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
@media (min-width: 560px) { #career-tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { #career-tiles { grid-template-columns: repeat(4, 1fr); } }


#stat-tiles-main { margin-bottom: 10px; }
#stat-tiles-main .stat-tile { background: linear-gradient(145deg, var(--hero-from), var(--hero-to)); padding: 20px 12px; }
#stat-tiles-main .stat-tile .value { color: #fff; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); font-weight: 600; letter-spacing: -.01em; }
#stat-tiles-main .stat-tile .label { color: #b9c6e6; }

/* Carrousel "hero" de l'Apercu : 4 diapositives (total, repartition par fonction,
   carnet d'activite, situation) en defilement horizontal a accroche (scroll-snap) :
   balayage tactile natif, fleches clavier, points et fleches cliquables. */
.hero-carousel {
  position: relative; background: linear-gradient(135deg, var(--brand-a), var(--brand-b)); color: #fff;
  border-radius: var(--radius); margin-bottom: 10px; box-shadow: var(--shadow); overflow: hidden;
}
.hero-track { display: flex; align-items: flex-start; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hero-track::-webkit-scrollbar { display: none; }
.hero-track:focus-visible { outline: 3px solid #fff; outline-offset: -4px; }
.hero-slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; padding: 16px 22px 40px; }
/* Diapositive 1 : total a gauche, "vols" et "moyenne par mois" a droite en cartes verre. */
#hero-slide-total { display: flex; align-items: center; }
.hero-main { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 20px 28px; flex-wrap: wrap; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 150px); gap: 10px; }
.hero-stat { background: rgba(255, 255, 255, .13); border-radius: 16px; padding: 12px 14px; text-align: center; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.hero-stat b { display: block; font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); font-weight: 600; line-height: 1.1; letter-spacing: -.01em; }
.hero-stat span { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #bcd0f5; margin-top: 4px; }
/* Diapositive 2 : ecran initial (total, vols, moyenne, courbe des 12 mois). */
.hero-total { display: flex; align-items: baseline; gap: 10px; }
.hero-total span { font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.4rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.hero-total small { font-size: 1rem; color: #cfe0ff; }
.hero-sub { display: flex; gap: 18px; flex-wrap: wrap; color: #dbe7ff; font-size: 14px; margin-top: 4px; }
.hero-spark { display: block; width: 100%; height: 76px; margin-top: 14px; }
.hero-spark path.area { fill: rgba(255, 255, 255, .18); }
.hero-spark path.line { fill: none; stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.hero-label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #bcd0f5; }
.hero-big { font-size: clamp(3rem, 2rem + 4vw, 5rem); font-weight: 600; line-height: 1.1; letter-spacing: -.02em; margin: 2px 0; }
.hero-line { color: #dbe7ff; font-size: 15px; }
.hero-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; margin: 14px 0 10px; }
.hero-legend { display: flex; justify-content: space-between; gap: 6px 18px; flex-wrap: wrap; font-size: 13px; }
.hero-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.hero-legend small { color: #bcd0f5; }
.hero-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); grid-auto-columns: 1fr; gap: 3px; margin-top: 10px; }
.hero-grid div { aspect-ratio: 1; border-radius: 3px; max-height: 13px; }
.hero-cards { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.hero-cards > div { flex: 1 1 190px; background: rgba(255, 255, 255, .12); border-radius: 14px; padding: 12px 16px; }
.hero-cards b { display: block; font-size: 1.5rem; font-weight: 500; margin: 2px 0; letter-spacing: .02em; }
.hero-cards small { color: #cfe0ff; font-size: 13px; }
.hero-exp { margin-top: 14px; }
.hero-exp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.hero-exp-row b { min-width: 58px; font-size: 1.05rem; font-weight: 600; }
.hero-chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .14); white-space: nowrap; }
.hero-chip.ok { background: rgba(120, 220, 160, .28); }
.hero-chip.warn { background: rgba(255, 190, 90, .34); }
.hero-chip.bad { background: rgba(255, 120, 120, .38); }
.hero-dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 10px; }
.hero-dots button { position: relative; width: 10px; height: 10px; min-height: 0; padding: 0; border-radius: 999px; background: rgba(255, 255, 255, .35); transition: width .2s ease, background .2s ease; }
.hero-dots button::before { content: ""; position: absolute; inset: -14px -6px; }
.hero-dots button[aria-current="true"] { width: 24px; background: #fff; }
.hero-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; font-size: 24px; line-height: 1; }
.hero-nav:hover { background: rgba(255, 255, 255, .3); filter: none; }
.hero-nav.prev { left: 8px; } .hero-nav.next { right: 8px; }
.hero-nav:disabled { visibility: hidden; }
@media (hover: hover) and (min-width: 768px) { .hero-slide { padding-left: 60px; padding-right: 60px; } }
@media (hover: none), (max-width: 767px) { .hero-nav { display: none; } }
@media (prefers-reduced-motion: reduce) { .hero-dots button { transition: none; } }

/* Statut retard (cf. delayTone() dans app.js, seuil OTP15) — toute la tuile
   se teinte, pas seulement un petit texte a cote, a l'instar de la reference
   FlightLog. rgba() plutot qu'un hex pastel fixe (comme .badge.ok/.warn/.err)
   pour rester lisible sans redefinition dediee en theme sombre. */
.stat-tile.tile-ok { background: rgba(10, 125, 44, .12); box-shadow: inset 0 0 0 1px rgba(10, 125, 44, .3); }
.stat-tile.tile-warn { background: rgba(154, 91, 0, .12); box-shadow: inset 0 0 0 1px rgba(154, 91, 0, .3); }
.stat-tile.tile-err { background: rgba(192, 57, 43, .12); box-shadow: inset 0 0 0 1px rgba(192, 57, 43, .3); }
.stat-tile.tile-ok .value { color: var(--ok); }
.stat-tile.tile-warn .value { color: #9a5b00; }
.stat-tile.tile-err .value { color: var(--err); }
.stat-tile.tile-ok .label, .stat-tile.tile-warn .label, .stat-tile.tile-err .label { color: inherit; opacity: .8; }

.okfly-banner { text-align: center; }
.okfly-status { font-size: 1.4rem; font-weight: 800; letter-spacing: .02em; padding: 6px 0; border-radius: 8px; }
.okfly-status.ok { color: var(--ok); }
.okfly-status.warn { color: #9a5b00; }
.okfly-status.err { color: var(--err); }

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar-weekday { text-align: center; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding-bottom: 6px; }
.calendar-day {
  background: var(--surface); border: none; border-radius: var(--radius-sm); box-shadow: var(--shadow);
  min-height: 64px; padding: 6px; display: flex; flex-direction: column; gap: 4px;
}
.calendar-day.outside { opacity: .35; }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--orange); }
.calendar-day .calendar-day-num { font-size: 12px; font-weight: 600; }
.calendar-count {
  align-self: center; margin-top: auto; min-width: 28px; min-height: 28px; height: 28px; padding: 0 8px; border-radius: 999px;
  background: var(--orange); color: #fff; font-size: 13px; font-weight: 700; line-height: 1;
}
@media (max-width: 767px) {
  .calendar-day { min-height: 56px; padding: 4px; align-items: center; }
  .calendar-count { min-width: 26px; min-height: 26px; height: 26px; padding: 0 6px; font-size: 12px; }
  .calendar-day .calendar-day-num { font-size: 10px; }
  .calendar-weekday { font-size: 9px; }
}

/* N'affiche les champs/colonnes PF/PM, IFR, ME que pour les pilotes dont le
   profil (renseigne par un administrateur, onglet Admin) l'indique — cf.
   CLAUDE.md et boot() dans app.js. */
body:not(.pilot-multicrew) .pilot-function-field,
body:not(.pilot-multicrew) .col-pilot-function,
body:not(.pilot-multicrew) .fatigue-field,
body:not(.pilot-ifr) .ifr-field,
body:not(.pilot-ifr) .col-ifr,
body:not(.pilot-me) .me-field {
  display: none;
}

.map-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; font-size: 12px; }
.map-legend button {
  flex: 1 1 auto; justify-content: center;
  display: inline-flex; align-items: center; gap: 5px; min-height: 36px;
  padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--muted); cursor: pointer; opacity: .5;
}
.map-legend button.active { color: var(--ink); opacity: 1; border-color: var(--orange); }
.map-legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.map-legend .legend-static { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 4px 10px; color: var(--ink); }
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; margin-top: 8px; margin-bottom: 24px; } /* les libelles des barres sortent de 18 px sous le graphique */
.bar-chart .bar { flex: 1; background: var(--orange); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.bar-chart .bar span { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 9px; color: var(--muted); }

.progress-track { background: var(--accent-soft); border-radius: 999px; height: 10px; overflow: hidden; margin-top: 6px; }
.progress-fill { background: linear-gradient(90deg, var(--orange), #4f8fd6); height: 100%; border-radius: 999px; }
.progress-fill.achieved { background: linear-gradient(90deg, var(--ok), #3fb15f); }
.progress-fill.warn { background: linear-gradient(90deg, #e8821a, #f2a21f); }
.progress-fill.err { background: linear-gradient(90deg, var(--err), #e0594a); }
.progress-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 4px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--accent-soft); color: var(--accent-ink); }
.badge.ok { background: #e6f4ea; color: var(--ok); }
.badge.warn { background: #fff4e5; color: #9a5b00; }
.badge.err { background: #fdeaea; color: var(--err); }
.badge.muted { background: var(--accent-soft); color: var(--muted); }

/* Champ que l'IA signale comme incertain (import photo carnet papier) —
   meme palette que .badge.warn, pour rester coherent visuellement avec les
   autres alertes "a verifier" deja utilisees ailleurs dans l'app. */
.field-uncertain input, .field-uncertain select, .field-uncertain textarea {
  border-color: #9a5b00;
  background: #fff4e5;
}

/* Badges d'accomplissement (paliers d'heures) — distincts des pastilles de
   statut ci-dessus : tuiles rondes plus grandes, avec l'icone du palier. */
.badge-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.badge-tile {
  width: 84px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center;
}
.badge-tile .badge-icon {
  width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 24px; background: var(--accent-soft); border: 2px solid var(--line);
}
.badge-tile.achieved .badge-icon { background: #fff4d6; border-color: var(--orange); }
.badge-tile:not(.achieved) .badge-icon { filter: grayscale(1); opacity: .45; } /* pastilles à emoji ; les écussons SVG sont grisés dans le SVG (ci-dessous) */
.badge-tile .badge-hours { font-size: 12px; font-weight: 700; color: var(--ink); }
.badge-tile:not(.achieved) .badge-hours { color: var(--muted); }
.badge-tile .badge-date { font-size: 10px; color: var(--muted); }
.leg-row { position: relative; margin-bottom: 10px; }
.leg-row .remove-leg { margin-top: 10px; }
tr.trip-row td:first-child { border-left: 3px solid var(--orange); }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-start; justify-content: center; padding: 20px 12px; padding-top: max(20px, var(--safe-top)); overflow-y: auto; z-index: 50; }
.modal {
  background: var(--surface); border-radius: var(--radius); padding: 20px; width: 100%; max-width: 560px;
  max-height: min(85vh, 700px); overflow-y: auto;
}
.modal h2 { margin-top: 0; }
.modal-close { float: right; }
@media (min-width: 768px) { .modal-overlay { padding: 30px 16px; } .modal { padding: 22px; max-height: min(80vh, 760px); } }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(24px + var(--bottom-nav-height) + var(--safe-bottom));
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 8px; font-size: 14px;
  opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90%; z-index: 100;
}
.toast.show { opacity: 1; }
.toast.err { background: var(--err); color: #fff; }
@media (min-width: 768px) { .toast { bottom: 24px; } }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.right { text-align: right; }

@media (min-width: 1440px) {
  main { padding-left: 32px; padding-right: 32px; }
}
input[data-hm].invalid { border-color: var(--err); }
@media (max-width: 479px) {
  header { flex-wrap: nowrap; gap: 6px; padding-left: calc(10px + var(--safe-left)); padding-right: calc(10px + var(--safe-right)); }
  header h1 .app-version { display: none; }
  header .header-user { gap: 6px; flex-shrink: 0; }
  header button.small { padding: 6px 10px; }
}
.ftl-row { padding: 10px 0; }
.ftl-row + .ftl-row { border-top: 1px solid var(--line); }
.ftl-head strong { color: var(--ink); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.ftl-head span { color: var(--ink); font-weight: 600; }

/* Carte : pastilles flottantes (filtres en haut, compteurs en bas) + etiquettes d'aeroports. */
.map-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.map-summary span { background: var(--accent-soft); color: var(--muted); border-radius: 999px; padding: 6px 14px; font-size: 13px; }
.map-summary b { color: var(--accent-ink); font-weight: 700; }

/* Modale de vol : en-tete "route" + sections repliables a en-tete bleu. */
.route-hero {
  margin-top: 12px; padding: 16px 14px; border-radius: var(--radius);
  background: linear-gradient(145deg, var(--hero-from), var(--hero-to)); color: #fff; text-align: center;
}
.route-hero-top { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; min-height: 26px; }
.route-hero .chip { background: rgba(255, 255, 255, .18); border-radius: 999px; padding: 3px 12px; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.route-hero-main { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.route-input { background: transparent; border: none; border-bottom: 1px dashed rgba(255, 255, 255, .35); color: inherit; text-align: center; text-transform: uppercase; min-width: 0; width: 100%; padding: 0; font-family: inherit; }
.route-input::placeholder { color: rgba(255, 255, 255, .4); font-size: .45em; letter-spacing: .1em; text-transform: none; }
.route-input:focus { outline: none; border-bottom-color: #fff; }
.chip-input { border: none; color: inherit; text-align: center; width: 110px; text-transform: uppercase; font-family: inherit; }
.chip-input::placeholder { color: rgba(255, 255, 255, .55); text-transform: none; }
.chip-input:focus { outline: 2px solid rgba(255, 255, 255, .6); }
.route-hero-nature { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.route-hero-nature select { width: auto; max-width: 100%; background: rgba(255, 255, 255, .16); color: inherit; border: none; border-radius: 999px; padding: 5px 12px; font-size: 12px; }
.route-hero-nature select option { color: #1d2330; }
.route-hero-nature .muted { color: #cfd9f5; font-size: 12px; }
.route-code { flex: 1; font-size: clamp(1.8rem, 1.2rem + 3vw, 2.8rem); font-weight: 300; letter-spacing: .04em; line-height: 1.1; }
.route-arrow { font-size: 1.6rem; opacity: .85; }
.route-hero-sub { font-size: 13px; color: #cfd9f5; margin-top: 6px; min-height: 18px; }

details.fsec { margin-top: 12px; }
details.fsec > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  background: var(--fsec); color: #fff; padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; min-height: 44px;
}
details.fsec > summary::-webkit-details-marker { display: none; }
details.fsec > summary::after { content: "›"; font-size: 22px; line-height: 1; transform: rotate(90deg); transition: transform .15s ease; }
details.fsec[open] > summary::after { transform: rotate(-90deg); }
details.fsec[open] > summary { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
details.fsec > :not(summary) { margin-left: 0; margin-right: 0; }
details.fsec[open] { background: var(--accent-soft); border-radius: var(--radius-sm); padding-bottom: 12px; }
details.fsec[open] > :not(summary) { margin-left: 12px; margin-right: 12px; }
details.fsec[open] > summary + * { margin-top: 12px; }
#flight-form .actions button[type="submit"] { flex: 1 1 100%; min-height: 48px; font-size: 15px; letter-spacing: .04em; }
:root[data-theme="dark"] details.fsec > summary { background: var(--fsec); }


/* Diapositive 1 : pastilles d'information sous le total. */
.hero-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.hero-chips span { background: rgba(255, 255, 255, .1); border-radius: 999px; padding: 5px 14px; font-size: 13px; color: #dbe7ff; }
.hero-chips b { color: #fff; font-weight: 600; margin-left: 4px; }
#hero-slide-total { flex-direction: column; justify-content: center; align-items: stretch; }
/* Diapositive 2 : reperes sous la courbe. */
.hero-axis { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: #bcd0f5; margin-top: 6px; }
.hero-axis span:nth-child(2) { color: #fff; text-align: center; }
@media (max-width: 560px) { .hero-axis span:nth-child(2) { display: none; } }

/* Pastilles de totaux : une seule ligne des que la largeur le permet (nombre de colonnes = nombre de pastilles). */
@media (min-width: 900px) { #stat-tiles { grid-template-columns: repeat(var(--tile-cols, 4), 1fr); } }

/* Graphique mensuel : bulle de detail et barre active. */
.chart-wrap { position: relative; }
.bar-chart .bar { cursor: pointer; transition: filter .12s ease; }
.bar-chart .bar:hover, .bar-chart .bar.active, .bar-chart .bar:focus-visible { filter: brightness(1.25); }
.bar-tip { position: absolute; transform: translateX(-50%); z-index: 5; background: var(--ink); color: var(--bg); border-radius: 10px; padding: 8px 12px; font-size: 13px; line-height: 1.35; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); pointer-events: none; text-align: center; }
.bar-tip[hidden] { display: none; }

/* Vols recents cliquables + fiche detaillee. */
.item.clickable { cursor: pointer; }
.item.clickable:hover, .item.clickable:focus-visible { background: var(--accent-soft); }
.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 14px 0 0; }
.detail-list dt { color: var(--muted); font-size: 13px; }
.detail-list dd { margin: 0; font-weight: 600; word-break: break-word; }
#stat-tiles { margin-bottom: 16px; }

/* Portrait (tablette / telephone) : composition symetrique, tout centre. */
@media (max-width: 899px) {
  .hero-main { flex-direction: column; justify-content: center; text-align: center; }
  .hero-stats { width: 100%; max-width: 420px; grid-template-columns: repeat(3, 1fr); }
  .hero-legend { display: grid; grid-template-columns: 1fr 1fr; justify-items: center; }
  #stat-tiles { display: flex; flex-wrap: wrap; justify-content: center; }
  #stat-tiles .stat-tile { flex: 0 0 calc(25% - 8px); }
}
@media (max-width: 479px) { #stat-tiles .stat-tile { flex-basis: calc(33.333% - 7px); } }
.hero-legend span { white-space: nowrap; }
@media (max-width: 479px) { .hero-legend { font-size: 12px; gap: 6px 6px; } .hero-legend small { display: none; } }

/* Carte du detail de vol. */
.flight-detail-map { clear: both; height: 200px; border-radius: var(--radius-sm); overflow: hidden; margin-top: 12px; z-index: 0; }
.fd-pin span { position: absolute; transform: translate(-50%, -140%); background: #1d4ed8; color: #fff; font-weight: 700; font-size: 12px; padding: 2px 7px; border-radius: 999px; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.fd-pin::after { content: ""; position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #fff; border: 3px solid #1d4ed8; }

/* Echeances : le badge reste sur la ligne du libelle, meme sur petit ecran. */
#expiry-list .item { flex-wrap: nowrap; }
#expiry-list .item > span:first-child { min-width: 0; }
#expiry-list .item .badge { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 400px) {
  #expiry-card { padding-left: 12px; padding-right: 12px; }
  #expiry-list .item { padding: 10px 8px; gap: 6px; }
  #expiry-list .item > span:first-child { font-size: 14px; white-space: nowrap; }
  #expiry-list .item .badge { font-size: 10px; padding: 2px 6px; }
}

.hero-sub-split { font-size: 14px; color: #cfe0ff; margin-top: 2px; }
.hero-sub-split b { color: #fff; font-weight: 600; }
@media (max-width: 899px) { .hero-sub-split { text-align: center; } }

/* Prerequis de prorogation (REG-001). */
.row-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.prereq-section { margin-top: 14px; }
.prereq-section h3 { font-size: 15px; margin: 0 0 8px; }
.prereq-option h4 { margin: 10px 0 6px; font-size: 14px; }
.prereq-item { margin-bottom: 6px; align-items: flex-start; }

.badges { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }

.prereq-mark-row { display: inline-flex; gap: 6px; align-items: center; margin-top: 4px; }
.prereq-mark-row input { min-height: 0; padding: 4px 8px; font-size: 13px; width: auto; }

/* Horaires : tuiles a saisie directe (STD/STA, OOOI, bloc reel / vol reel / nuit). */
.time-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.time-row.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 560px) { .time-row.four { grid-template-columns: repeat(2, 1fr); } }
.time-tile { background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 10px 6px 8px; text-align: center; min-width: 0; }
.time-tile .tt-main { font-size: 1.15rem; font-weight: 700; color: var(--orange); min-height: 2rem; display: flex; align-items: center; justify-content: center; }
.time-tile .tt-main input { text-align: center; font-size: 1.1rem; font-weight: 700; padding: 6px 4px; width: 100%; border-color: transparent; background: transparent; }
.time-tile .tt-main input:focus { background: var(--surface); }
.time-tile .tt-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 2px; }
.time-tile .tt-sub { font-size: 11px; color: var(--muted); min-height: 1.3em; margin-top: 2px; }
.time-tile.is-readout { background: var(--accent-soft); box-shadow: none; }
.time-tile.tile-ok { background: rgba(10, 125, 44, .12); box-shadow: inset 0 0 0 1px rgba(10, 125, 44, .3); }
.time-tile.tile-warn { background: rgba(154, 91, 0, .12); box-shadow: inset 0 0 0 1px rgba(154, 91, 0, .3); }
.time-tile.tile-err { background: rgba(192, 57, 43, .12); box-shadow: inset 0 0 0 1px rgba(192, 57, 43, .3); }

/* Decollages / atterrissages : une ligne par mouvement (jour, nuit, PF/PM), tout visible. */
.mv-grid { display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); gap: 8px 10px; align-items: end; margin-top: 12px; }
.mv-title { grid-column: 1; font-weight: 600; align-self: center; padding-top: 16px; }
.mv-cell { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); min-width: 0; }
.mv-cell select { min-width: 64px; }
.mv-cell select, .mv-cell .stepper { min-height: 44px; box-sizing: border-box; align-items: center; }
.mv-cell select { padding-top: 0; padding-bottom: 0; }
@media (max-width: 560px) {
  .mv-grid { grid-template-columns: 1fr 1fr; }
  .mv-title { grid-column: 1 / -1; padding-top: 6px; }
}
.mv-cell .stepper { gap: 3px; }
.mv-cell .stepper input { flex: 0 0 3.2em; width: 3.2em; min-width: 3.2em; padding: 10px 2px; }
.mv-cell .stepper .icon-btn { flex: 0 0 auto; padding: 8px 10px; }

.ifr-tile { cursor: pointer; }
.ifr-tile input[type=checkbox] { width: 26px; height: 26px; margin: 0; cursor: pointer; }

/* Guide utilisateur */
.guide { display: flex; flex-direction: column; gap: 10px; }
.guide-sec { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 16px; }
.guide-sec summary { cursor: pointer; font-weight: 600; padding: 12px 0; }
.guide-sec ul { margin: 0 0 12px; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; line-height: 1.5; }

/* Diapositive 1 : le total a gauche, trois tuiles qui occupent toute la largeur restante. */
.hero-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 24px; align-items: stretch; }
.hero-main > div:first-child { display: flex; flex-direction: column; justify-content: center; }
.hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; max-width: none; align-items: stretch; }
.hero-stat { display: flex; flex-direction: column; justify-content: center; padding: 38px 10px; }
.hero-stat b { font-size: clamp(1.7rem, 1.1rem + 2vw, 3rem); }
.hero-stat span { font-size: 12px; margin-top: 8px; }
@media (max-width: 899px) { .hero-main { grid-template-columns: 1fr; } .hero-stats { max-width: none; } }

/* Carte : les puces de legende (et « Pays visites ») et les reglages occupent toute la ligne, meme style. */
.map-controls { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 700px) { .map-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Diapositive 1 : les chiffres des trois tuiles restent sur la meme ligne, meme si une etiquette passe sur 2 lignes. */
.hero-stat { justify-content: flex-start; }
.hero-stat span { min-height: 2.6em; }

/* Pas de « page blanche » qui defile : l'application tient dans la hauteur de l'ecran (seuls main et la barre laterale
   defilent), le document lui-meme ne defile ni ne rebondit (iOS/Safari), et le defilement interne ne se propage pas. */
html { background: var(--bg); overscroll-behavior: none; }
body { overscroll-behavior: none; }
body:has(#app:not(.hidden)) { overflow: hidden; height: 100vh; height: 100dvh; }
main, .sidebar, .drawer { overscroll-behavior-y: contain; }

/* Cause du defilement « blanc » : les radios masques (position:absolute, ex. Par type / Par avion) ne trouvaient pas de parent
   positionne dans main, donc n'etaient pas coupes par son overflow et agrandissaient la hauteur du document. */
main, .sidebar { position: relative; }

/* --- Lot A (SUP) --- */
/* Tuiles de l'Apercu : centrees quand la derniere ligne n'est pas pleine. */
#stat-tiles, #stat-tiles-main { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
#stat-tiles .stat-tile { flex: 1 1 130px; max-width: 220px; }
#stat-tiles-main .stat-tile { flex: 1 1 260px; max-width: 520px; }
/* Experience recente (diapositive Situation) : deux colonnes, couleur selon l'echeance. */
.hero-exp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.hero-exp-card { background: rgba(255, 255, 255, .1); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.hero-exp-card strong { font-size: 1.05rem; }
.hero-exp-card .hero-chip { display: block; white-space: normal; border-radius: 8px; padding: 5px 9px; }
.hero-chip.ok { background: rgba(70, 190, 120, .38); }
.hero-chip.warn { background: rgba(255, 170, 60, .45); }
.hero-chip.bad { background: rgba(240, 90, 90, .5); }
@media (max-width: 560px) { .hero-exp-grid { grid-template-columns: 1fr; } }
/* Prerequis : la pastille d'etat garde la meme colonne et la meme largeur, quelle que soit la longueur du texte. */
.prereq-item { display: grid; grid-template-columns: minmax(0, 1fr) 8rem; gap: 12px; align-items: start; }
.prereq-item .badge { width: 100%; text-align: center; justify-self: end; }
#currency-tiles { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
#currency-tiles .item { margin-top: 6px; }
/* Diapositive 1 : le chiffre s'adapte a la largeur de sa tuile (jamais colle a la voisine). */
.hero-stat { container-type: inline-size; }
.hero-stat b { font-size: clamp(1.2rem, 19cqw, 3rem); white-space: nowrap; }

/* --- Donnees operationnelles (lot C) --- */
#panel-operationnel .stat-tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 4px 0 16px; }
#panel-operationnel .stat-tile { display: flex; flex-direction: column; justify-content: center; min-height: 88px; }
#panel-operationnel .stat-tile .label { line-height: 1.25; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.ops-light-toggle { margin: 4px 0 12px; }
.gauss { width: 100%; height: auto; display: block; }
.gauss-tick { font-size: 13px; }
.gauss-hit { fill: transparent; cursor: pointer; } .gauss-hit:hover, .gauss-hit:focus-visible { fill: rgba(13, 59, 153, .12); outline: none; } .gauss-hit.sel { fill: rgba(13, 59, 153, .2); }
.gauss-label rect { fill: var(--ink); } .gauss-label text { fill: var(--surface); font-size: 13px; font-weight: 600; }
.ops-pie { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 16px; } .ops-pie svg { width: min(100%, 300px); height: auto; aspect-ratio: 1; flex: none; }
.pie-slice { cursor: pointer; transition: transform .15s; transform-origin: 90px 90px; } .pie-slice:hover { opacity: .85; } .pie-slice.sel { transform: scale(1.06); }
.ops-pie-value { font-size: 14px; min-height: 1.4em; text-align: center; } .ops-pie-value i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.ops-flight { cursor: pointer; } .ops-flight:hover, .ops-flight:focus-visible { background: var(--accent-soft); outline: none; }
.ops-ap { border-radius: 10px; }
.ops-ap-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.ops-ap-badges { display: flex; gap: 6px; flex-shrink: 0; }
.ops-ap-body { display: none; padding: 10px 14px 14px; } .ops-ap.open .ops-ap-body { display: block; }
.ops-ap.open > .ops-ap-head { background: var(--accent-soft); }
.gauss-bar { fill: #6d8fd6; opacity: .55; }
.gauss-curve { fill: none; stroke: var(--orange); stroke-width: 2.5; }
.gauss-ok { fill: rgba(10, 125, 44, .1); }
.gauss-mean { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 4 3; }
.gauss-axis { stroke: var(--muted); stroke-width: 1; }
.gauss-tick { fill: var(--muted); }
.gauss-stats { margin-top: 10px; }

/* --- Lot D : bandeau bleu editable --- */
.chip-date { width: auto; min-width: 140px; color-scheme: dark; cursor: pointer; }
.route-hero-sim { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; text-align: left; }
.route-hero-sim label { color: #cfd9f5; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.route-hero-sim input, .route-hero-sim select { background: rgba(255, 255, 255, .16); color: #fff; border: none; border-radius: 10px; padding: 9px 10px; font-size: 1.05rem; }
.route-hero-sim select option { color: #1d2330; }
.route-input.invalid { border-bottom-color: #ff8f8f; }

/* --- Lot G : flotte et aeroports --- */
.add-wide { display: block; width: 100%; margin: 0 0 14px; text-align: center; padding: 14px; font-size: 1.05rem; }
.item.clickable, tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--accent-soft); }
.ap-head { margin-bottom: 8px; }
.ap-tiles { margin: 10px 0; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.ap-source { font-size: 12px; margin-top: 14px; }
/* Liste des aeroports : une seule ligne par terrain (le detail est dans la fiche). */
.airport-filter { display: block; margin: 0 0 12px; }
.airport-filter input { width: 100%; }
#airport-list .item { flex-wrap: nowrap; }
.ap-line { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pager { justify-content: space-between; align-items: center; }

/* --- Medailles (Objectifs) --- */
.ach-card { margin-top: 14px; }
.ach-next { margin: 12px 0 0; font-size: 14px; }
.badge-tile { max-width: 130px; text-align: center; }
.badge-tile .badge-hours { line-height: 1.2; }
.ach-bronze.achieved .badge-icon { background: #f6e3d2; border-color: #cd7f32; }
.ach-silver.achieved .badge-icon { background: #eceff4; border-color: #aab2bf; }
.ach-gold.achieved .badge-icon { background: #fff4d6; border-color: #e0b32b; }
.ach-platinum.achieved .badge-icon { background: #e4eefc; border-color: #5f8fdc; }

/* --- Guide : visuels --- */
.guide-visual { margin: 6px 0 4px; padding: 10px 12px; background: var(--accent-soft); border-radius: var(--radius-sm); list-style: none; }
.guide-svg { width: 100%; max-width: 640px; height: auto; display: block; margin: 0 auto; }
.guide-svg .g-axis { stroke: var(--muted); stroke-width: 1.5; }
.guide-svg .g-dots circle { fill: var(--orange); }
.guide-svg .g-dots .g-sched { fill: var(--muted); }
.guide-svg text { fill: var(--ink); font-size: 12px; }
.guide-svg .g-sub { fill: var(--muted); font-size: 10.5px; }
.guide-svg .g-strong { font-weight: 700; font-size: 12px; }
.guide-svg .g-brace { stroke: var(--orange); stroke-width: 2; fill: none; }
.guide-svg .g-ok { fill: rgba(10, 125, 44, .15); }
.guide-svg .g-curve { fill: none; stroke: var(--orange); stroke-width: 2.5; }
.guide-svg .g-dash { stroke: var(--ink); stroke-dasharray: 4 3; }
.guide-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.g-chip { background: var(--c); color: #1d2330; font-weight: 700; font-size: 12px; padding: 4px 12px; border-radius: 999px; }
.guide-chips small, .guide-exp small { flex-basis: 100%; color: var(--muted); }
.guide-exp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.g-card { border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.g-card.ok { background: rgba(70, 190, 120, .28); }
.g-card.warn { background: rgba(255, 170, 60, .32); }
.guide-exp small { grid-column: 1 / -1; }
@media (max-width: 560px) { .guide-exp { grid-template-columns: 1fr; } }
.g-li { list-style: none; margin-left: -18px; }

/* ======================= Mobile portrait : alignement et centrage ======================= */
@media (max-width: 480px) {
  /* Sous-onglets : centres et plus compacts (4 onglets tiennent sur une ligne, jamais un onglet seul a gauche). */
  .subnav3 { justify-content: center; gap: 6px; }
  .subnav3 button { padding: 8px 12px; font-size: 14px; }
  /* Tuiles du carrousel : libelles en capitales plus serres pour ne pas toucher les bords (« TOTAL SIMULATEUR »). */
  .hero-stat { padding: 24px 6px; }
  .hero-stat span { font-size: 10px; letter-spacing: .03em; overflow-wrap: anywhere; }
  /* Lignes de liste avec un bouton d'action en fin (Modifier...) : le bouton reste a droite et centre verticalement,
     c'est le texte qui passe a la ligne (sinon le bouton tombait sous le texte, a gauche, pour les noms longs). */
  .item:has(> button:last-child) { flex-wrap: nowrap; }
  .item:has(> button:last-child) > :first-child { flex: 1 1 auto; min-width: 0; }
  .item:has(> button:last-child) > button { flex: 0 0 auto; }
  /* Boutons d'action des formulaires et fenetres : empiles, pleine largeur et centres (plus de bouton isole a gauche). */
  .modal .actions { flex-direction: column; align-items: stretch; }
  .modal .actions > button, .modal .actions > a { width: 100%; justify-content: center; text-align: center; }
  /* Pagination de la liste des aeroports : compteur puis boutons, centres. */
  .pager { flex-direction: column; justify-content: center; text-align: center; gap: 8px; }
}

/* ======================= Accordeons (filtres, cartes du Profil) ======================= */
details.acc { padding: 0; }
details.acc > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 12px 16px;
  font-size: clamp(0.75rem, 0.7rem + 0.2vw, 0.85rem); font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--navy);
}
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after { content: "›"; margin-left: auto; font-size: 22px; line-height: 1; color: var(--muted); transform: rotate(90deg); transition: transform .15s ease; }
details.acc[open] > summary::after { transform: rotate(-90deg); }
details.acc > .acc-body { padding: 0 16px 16px; }
details.acc[open] > summary { padding-bottom: 6px; }
.acc-count { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent-ink); border-radius: 999px; padding: 2px 10px; }
.acc-count.hidden { display: none; }
details.fsec > div { padding: 0; }
@media (max-width: 480px) { details.acc > summary { padding: 12px 14px; } details.acc > .acc-body { padding: 0 14px 14px; } }
@media (max-width: 480px) {
  /* Filtres ouverts : deux champs par ligne (Du / Au, Avion / Role...) pour limiter la hauteur. */
  .filters-acc .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* ======================= Controle du carnet ======================= */
.nav-badge { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--err); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.nav-badge.hidden { display: none; }
.subnav3 button.active .nav-badge { background: #fff; color: var(--orange); }
.health-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.health-row .health-label { flex: 1 1 220px; min-width: 0; }
.health-row .health-fix { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.health-row input[type="time"], .health-row input[data-hm] { width: 96px; min-height: 40px; }
.health-sev { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.health-sev.error { background: var(--err); } .health-sev.warn { background: var(--warn); } .health-sev.info { background: var(--muted); }
#health-groups details.acc { margin-bottom: 12px; }
@media (max-width: 480px) { .health-row .health-fix { width: 100%; } }

.reval-card .card-head { gap: 8px; }
.reval-next { margin: 0 0 0 4px; padding-left: 18px; font-size: 13px; }
.reval-next li { margin: 2px 0; }
#reval-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#reval-tiles .stat-tile .label { font-size: 11px; }
#dossier-pdf-link { border: 1px solid var(--accent-ink); color: var(--accent-ink); font-weight: 600; }
@media (max-width: 480px) { #dossier-pdf-link { width: 100%; justify-content: center; } }
@media (max-width: 480px) {
  /* Exigences de prerequis / de progression : le badge d'etat passe sous le texte pour laisser toute la largeur au libelle. */
  .prereq-item { flex-direction: column; align-items: flex-start; }
}

/* ======================= Liste des vols : une ligne par vol ======================= */
#flights-list { gap: 8px; }
#flights-list .item { flex-wrap: nowrap; padding: 12px 14px; }
.flight-line .fl-main { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flight-line .fl-times { font-size: .85em; margin-left: 4px; }
.flight-line .fl-end { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.flight-line .fl-end .badge { font-size: 10px; padding: 1px 6px; }
.flight-line .fl-end b { min-width: 42px; text-align: right; }
@media (max-width: 420px) {
  .flight-line .fl-role { display: none; }
  /* « a completer » implique deja « hors stats » : une seule pastille pour garder le trajet lisible. */
  .flight-line.fl-warn .badge.muted { display: none; }
}

/* ======================= Trace de vol (fiche du vol) ======================= */
.flight-track { margin-top: 14px; }
.flight-track h3 { margin-top: 0; }
.flight-track h4 { margin: 14px 0 6px; }
.track-tiles { margin: 8px 0; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.track-tiles .stat-tile .value { font-size: 1.05rem; }
.track-profile { display: block; width: 100%; height: 70px; margin-top: 6px; }
.track-profile .area { fill: var(--accent-soft); stroke: none; }
.track-profile .line { fill: none; stroke: var(--orange); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.track-profile-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.track-warn { margin: 6px 0; font-size: 13px; color: var(--warn); }
.track-note, .track-file { font-size: 12px; margin: 4px 0; }
.track-apply .check-row { margin: 6px 0; align-items: flex-start; }
label.track-replace { display: inline-flex; align-items: center; padding: 9px 16px; border-radius: 6px; cursor: pointer; border: 1px solid var(--accent-ink); color: var(--accent-ink); font-weight: 600; margin: 0; }

/* Ecussons de medailles (public/badges.js) : SVG rond, grise tant que le palier n'est pas obtenu. */
.ach-card .badge-tile { width: 96px; max-width: 96px; }
.ach-card .badge-tile .badge-icon { width: 80px; height: 80px; background: none; border: 0; border-radius: 0; font-size: 0; }
.ach-card .badge-tile .badge-svg { width: 80px; height: 80px; display: block; }
.ach-card .badge-tile.achieved .badge-icon { background: none; border: 0; }
.ach-card .badge-tile:not(.achieved) .badge-icon { filter: none; opacity: .6; } /* grisé dans le SVG (badges.js, locked) : pas de filtre CSS, cf. WebKit */
.ach-card .badge-tile .badge-real { font-size: 10px; line-height: 1.25; color: var(--accent-ink); font-style: italic; }
.ach-card .badge-tile { width: 104px; max-width: 104px; }

/* Controle du carnet : espace entre les pastilles du haut et les cartes du dessous (elles se touchaient). */
#health-tiles { margin-bottom: 16px; }
#subnav3p-controle > .card, #subnav3p-controle > details.card { margin-top: 0; margin-bottom: 12px; }

/* Bilan de l'annee (Tableau de bord > Bilan) */
.yr-head { display: flex; justify-content: flex-end; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.yr-select { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.yr-select select { min-height: 40px; height: 40px; width: auto; margin: 0; box-sizing: border-box; }
.yr-pdf { box-sizing: border-box; height: 40px; }
.yr-hero { background: linear-gradient(135deg, var(--brand-a), var(--brand-b)); color: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 12px; }
.yr-hero-label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #bcd0f5; }
.yr-hero-big { font-size: clamp(2.6rem, 2rem + 4vw, 4.4rem); font-weight: 600; line-height: 1.1; letter-spacing: -.02em; margin: 2px 0; }
.yr-hero-sub { color: #dbe7ff; font-size: 15px; }
.yr-hero-delta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 10px; }
.yr-delta { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .14); white-space: nowrap; }
.yr-delta.up { background: rgba(120, 220, 160, .3); } .yr-delta.down { background: rgba(255, 105, 140, .42); }
.yr-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.yr-stat { flex: 1 1 130px; max-width: 190px; background: rgba(255, 255, 255, .13); border-radius: 14px; padding: 10px 12px; text-align: center; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.yr-stat b { display: block; font-size: 1.25rem; font-weight: 600; line-height: 1.15; white-space: nowrap; }
.yr-stat { display: flex; flex-direction: column; align-items: center; }
.yr-stat span:not(.yr-trend) { min-height: 2.6em; display: flex; align-items: center; justify-content: center; }
.yr-stat .yr-trend { margin-top: auto !important; }
.yr-stat b { margin-bottom: 0; }
.yr-stat span:not(.yr-trend) { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #bcd0f5; margin-top: 3px; }
.yr-months { height: 140px; margin-bottom: 22px; }
.yr-pdf { background: var(--accent-soft); color: var(--accent-ink); border-radius: 999px; font-weight: 600; text-decoration: none; min-height: 40px; display: inline-flex; align-items: center; padding: 0 16px; font-size: 13px; cursor: pointer; }
.yr-trend { display: inline-block; margin-top: 6px; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .16); white-space: nowrap; text-transform: none; letter-spacing: 0; color: #fff; }
.yr-stat .yr-trend { display: block; width: fit-content; margin: 6px auto 0; }
.yr-trend.up { background: rgba(120, 220, 160, .34); } .yr-trend.down { background: rgba(255, 105, 140, .45); }
.card .yr-trend { color: var(--ink); background: rgba(128, 128, 128, .14); } .card .yr-trend.up { color: #1b7a43; background: rgba(46, 160, 90, .16); } .card .yr-trend.down { color: #c0264a; background: rgba(240, 90, 130, .16); }
.yr-months .bar { cursor: pointer; transition: filter .15s; } .yr-months .bar:hover, .yr-months .bar:focus-visible { filter: brightness(1.15); outline: none; } .yr-months .bar.sel { outline: 2px solid var(--brand-a); outline-offset: 2px; }
.yr-month-detail { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(128, 128, 128, .08); }
.yr-month-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.yr-pill-mini { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(128, 128, 128, .16); }
.yr-month-list { display: flex; flex-wrap: wrap; gap: 6px; }
.yr-flight { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: rgba(128, 128, 128, .12); }
.yr-pills { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 14px; }
.yr-pill { justify-content: flex-start; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 16px; background: rgba(128, 128, 128, .09); box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .15); }
.yr-pill-ico { font-size: 20px; line-height: 1; } .yr-pill-l { min-height: 2.6em; display: flex; align-items: flex-end; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.yr-pill b { font-size: 1.15rem; font-weight: 600; } .yr-pill-s { font-size: 12.5px; color: var(--muted); }
.yr-facts { margin: 12px 0 0; padding-left: 18px; font-size: 14px; display: grid; gap: 4px; }
.yr-bar { margin: 10px 0 12px; height: 14px; }
.yr-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.yr-sub { font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.yr-medals .badge-tile { width: 96px; max-width: 96px; }
.yr-medals .badge-tile .badge-icon { width: 80px; height: 80px; background: none; border: 0; font-size: 0; }
.yr-medals .badge-tile .badge-svg { width: 80px; height: 80px; display: block; }

.ops-more > .acc-body > .card { box-shadow: none; border: 1px solid var(--line); }
.ops-more > .acc-body > .ops-sub-title { margin: 18px 0 8px; }

/* PWA : bandeau de mise a jour */
.pwa-update { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + var(--safe-bottom)); z-index: 60; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 24px); padding: 10px 14px; border-radius: 14px; background: var(--ink); color: var(--surface); box-shadow: var(--shadow); font-size: 14px; }
.pwa-update button { min-height: 36px; }
@media (min-width: 900px) { .pwa-update { bottom: 20px; } }

.duty-ignored { opacity: .6; }

/* Valeur ecrite au-dessus de chaque barre (graphique « Dose par mois ») */
.bar-chart.with-values { padding-top: 18px; box-sizing: content-box; }
.bar-chart .bar .bar-val { position: absolute; bottom: 100%; left: -3px; right: -3px; margin-bottom: 2px; text-align: center; font-style: normal; font-size: 10px; font-weight: 600; color: var(--ink); white-space: nowrap; }

.offline-bar { position: fixed; left: 0; right: 0; top: 0; z-index: 60; padding: 4px 12px; text-align: center; font-size: 0.8rem; background: var(--warn-bg, #fff4d6); color: var(--warn-ink, #7a5200); border-bottom: 1px solid rgba(0,0,0,.12); padding-top: calc(4px + env(safe-area-inset-top)); }
.offline-bar.hidden { display: none; }

/* Saisie / complétion d'un vol : boutons Enregistrer, Supprimer, Fermer sur toute la largeur (aussi sur grand écran). */
#flight-form > .actions, #doc-complete-modal .actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
#flight-form > .actions button, #doc-complete-modal .actions button { width: 100%; }

/* Revalidation : les pastilles (Échues, Fenêtre ouverte, Dans 6 mois) ne collent plus à la première échéance. */
#reval-tiles { margin-bottom: 14px; }

/* Profil › Rappels par e-mail : cases et délai sur une même ligne (pas l'aspect formulaire). */
.rem-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.rem-row .check-row, .rem-row .rem-lead { margin: 0; }
#reminders-form .rem-row .rem-lead { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; white-space: nowrap; font-size: inherit; }
#reminders-form .rem-row .rem-lead input { width: 72px; margin: 0; }

/* Condition « au choix » déjà remplie : les autres options sont atténuées. */
.prereq-option-dim { opacity: .6; }

/* Visionneuse de PDF : toujours une barre avec « Fermer » (dans l'application installée, un PDF ouvert en plein écran n'a pas de retour). */
.pdf-viewer { position: fixed; inset: 0; z-index: 70; background: var(--bg, #fff); display: flex; flex-direction: column; }
.pdf-viewer.hidden { display: none; }
.pdf-viewer-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; padding-top: max(8px, var(--safe-top)); background: var(--surface); border-bottom: 1px solid var(--border, rgba(128,128,128,.3)); }
.pdf-viewer-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.pdf-viewer-bar button { min-height: 44px; }
.pdf-viewer iframe { flex: 1; width: 100%; border: 0; background: #888; }
.page-card { border: 1px solid var(--border, rgba(128,128,128,.3)); border-radius: 8px; margin-bottom: 8px; }
.page-card > summary { padding: 10px 12px; cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-card .page-flight { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 12px; border-top: 1px solid var(--border, rgba(128,128,128,.2)); font-size: 14px; }
.page-card .page-flight button { min-height: 44px; }
.page-card .page-flight.starts { background: color-mix(in srgb, var(--brand-a, #2563eb) 10%, transparent); }
@media (max-width: 480px) { .pdf-viewer-title { display: none; } .pdf-viewer-bar { justify-content: space-between; } .pdf-viewer-bar .pdf-close { margin-right: auto; } }

/* Accueil « validité » : pastilles d'état (médical, licences, qualifications, expérience récente). Rétablir l'ancien accueil : Profil › Apparence. */
.validity-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.validity-head h3 { margin: 0; }
.validity-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
@media (min-width: 768px) { .validity-grid { grid-template-columns: repeat(4, 1fr); } }
.vstat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; min-height: 44px; padding: 12px; border-radius: 10px; border: 1px solid var(--border, rgba(128,128,128,.3)); background: var(--surface); color: inherit; border-left-width: 6px; cursor: pointer; font: inherit; }
.vstat .vlabel { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.vstat .vmain { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vstat .vsub { font-size: 12.5px; color: var(--muted); }
.vstat.ok { border-left-color: var(--ok); } .vstat.warn { border-left-color: var(--warn); } .vstat.bad { border-left-color: var(--err); } .vstat.none { border-left-color: var(--muted); }
.vstat.ok .vmain { color: var(--ok); } .vstat.warn .vmain { color: var(--warn); } .vstat.bad .vmain { color: var(--err); }
.validity-lines { margin-top: 10px; display: grid; gap: 6px; }
.validity-lines button { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border, rgba(128,128,128,.3)); background: transparent; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.home-classic #validity-card { display: none; }
.home-validity #expiry-card { display: none !important; }

/* Saisie rapide : dupliquer le dernier vol / vol retour (sous « + Nouveau vol »). */
.quick-entry { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: -4px 0 14px; }
.quick-entry button { min-height: 44px; }
@media (max-width: 480px) { .quick-entry { grid-template-columns: 1fr; } }

/* Menu « + » (mobile) : feuille d'actions en bas d'écran. */
.sheet-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 48; }
.add-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 49; background: var(--surface); border-radius: 16px 16px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.25);
  padding: 8px 12px calc(12px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 6px; max-height: 85vh; overflow-y: auto; }
.add-sheet.hidden, .sheet-overlay.hidden { display: none; }
.add-sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--border, rgba(128,128,128,.4)); margin: 4px auto 6px; }
.add-item { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--border, rgba(128,128,128,.25)); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.add-item .add-ico { font-size: 24px; width: 32px; text-align: center; flex: none; }
.add-item b { display: block; font-size: 16px; }
.add-item small { display: block; color: var(--muted); font-size: 13px; }
.add-item:disabled { opacity: .5; cursor: default; }
.add-cancel { min-height: 48px; }
@media (min-width: 768px) { .add-sheet, .sheet-overlay { display: none !important; } }

/* Carnet de vol : seconde rangée (Données / Outils), plus discrète que la première. */
.subnav3-sub { margin-top: -8px; }
.subnav3-sub button { min-height: 36px; padding: 6px 14px; font-size: 14px; background: transparent; border: 1px solid var(--accent-soft); }
.subnav3-sub button.active { border-color: var(--orange); }

/* Recherche globale (⌘K) : palette de commandes. */
.palette-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 80; }
.palette { position: fixed; z-index: 81; left: 50%; top: max(8vh, calc(8px + var(--safe-top))); transform: translateX(-50%); width: min(640px, calc(100vw - 16px)); max-height: 80vh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.35); overflow: hidden; }
.palette.hidden, .palette-overlay.hidden { display: none; }
.palette-bar { display: flex; gap: 8px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); }
.palette-bar input { flex: 1; min-height: 44px; font-size: 16px; }
.palette-results { overflow-y: auto; padding: 6px; }
.palette-group { margin: 6px 4px 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.palette-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.palette-item .pi-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item .pi-sub { color: var(--muted); font-size: 13px; margin-left: 6px; }
.palette-item[aria-selected="true"], .palette-item:hover { background: var(--accent-soft); }
.palette-hint { margin: 0; padding: 6px 12px 10px; font-size: 12px; }
@media (max-width: 480px) { .palette-hint { display: none; } }

/* Liste des vols : deux densités (réglage sur l'appareil). Compact : lignes serrées, pastilles secondaires masquées ; sur mobile la hauteur reste de 44 px (cible tactile). */
.list-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: 0 0 8px; }
.density-compact #flights-list { gap: 3px; }
.density-compact #flights-list .item { padding: 4px 10px; min-height: 36px; font-size: 13.5px; border-radius: 6px; }
.density-compact .flight-line .fl-end .badge:not(.warn):not(.fl-role) { display: none; }
.density-compact .flight-line .fl-times { display: none; }
@media (max-width: 767px) { .density-compact #flights-list .item { min-height: 44px; } }
@media (max-width: 480px) { header h1 { white-space: nowrap; font-size: 16px; } header .header-user { gap: 6px; } header #logout-btn { padding: 6px 8px; font-size: 12px; } }

/* ======================= Style « cockpit » (réversible : Profil › Apparence › Style) =======================
   Chiffres d'afficheur de bord (chasse fixe, tabulaires), jauges en arc sur les échéances, route tracée entre deux terrains. Tout est sous `.cockpit`. */
:root { --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace; }
.cockpit .hero-big, .cockpit .hero-total span, .cockpit .hero-stat b, .cockpit .stat-tile .value, .cockpit .flight-line .fl-end b, .cockpit .vstat .vmain.num {
  font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.04em; font-weight: 500;
}
.cockpit .hero-big { letter-spacing: -.06em; font-size: clamp(2.6rem, 1.8rem + 3.6vw, 4.4rem); }
.cockpit .hero-stat b { letter-spacing: -.06em; }
.vstat { position: relative; }
.vgauge { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; display: none; }
.cockpit .vgauge { display: block; }
.vgauge .vg-track { fill: none; stroke: var(--line); stroke-width: 4; }
.vgauge .vg-bar { fill: none; stroke: var(--muted); stroke-width: 4; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 18px 18px; transition: stroke-dasharray .6s ease; }
.vstat.ok .vg-bar { stroke: var(--ok); } .vstat.warn .vg-bar { stroke: var(--warn); } .vstat.bad .vg-bar { stroke: var(--err); }
.vgauge text { font: 700 9px var(--mono); fill: currentColor; text-anchor: middle; font-variant-numeric: tabular-nums; }
.cockpit .vstat { padding-right: 56px; }
.rt-arc { display: none; width: 26px; height: 10px; vertical-align: middle; margin: 0 3px; stroke: currentColor; fill: none; stroke-width: 1.3; opacity: .8; }
.rt-arc circle.dot { fill: currentColor; stroke: none; }
.cockpit .rt-arc { display: inline-block; }
.cockpit .rt-arrow { display: none; }
@media (prefers-reduced-motion: reduce) { .vgauge .vg-bar { transition: none; } }
.validity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .validity-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.vstat { min-width: 0; }
.cockpit .vstat { padding-right: 52px; }
.cockpit .vstat { padding-right: 12px; }
.vgauge { top: auto; bottom: 8px; right: 8px; width: 38px; height: 38px; }
.cockpit .vstat .vsub { padding-right: 36px; min-height: 34px; }
.cockpit .flight-line strong { font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .rt-arc { width: 16px; height: 8px; margin: 0 1px; } }

/* ======================= Médailles en « passeport » (Tableau de bord › Objectifs ; retour aux écussons : bascule au-dessus) ======================= */
#achievements .passport { --paper: #f5efdf; --paper-ink: #3a3326; --paper-line: #d9cfb6; display: grid; gap: 14px; }
:root[data-theme="dark"] #achievements .passport { --paper: #2b2820; --paper-ink: #e8e0cc; --paper-line: #4a4535; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #achievements .passport { --paper: #2b2820; --paper-ink: #e8e0cc; --paper-line: #4a4535; } }
.pp-cover { position: relative; border-radius: 14px; padding: 22px 18px; text-align: center; color: #e9d9a6; background: linear-gradient(145deg, #12294f, #1c3c70 60%, #12294f); box-shadow: inset 0 0 0 3px rgba(233,217,166,.35), 0 6px 18px rgba(0,0,0,.18); }
.pp-cover::after { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(233,217,166,.35); border-radius: 9px; pointer-events: none; }
.pp-cover-emblem { font-size: 42px; line-height: 1; }
.pp-cover-title { margin-top: 8px; font-weight: 800; letter-spacing: .28em; font-size: 15px; }
.pp-cover-sub { font-size: 11px; letter-spacing: .2em; opacity: .75; margin-top: 2px; }
.pp-cover-name { margin-top: 14px; font-size: 18px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.pp-cover-stats { margin-top: 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; font-size: 13px; font-variant-numeric: tabular-nums; }
.pp-page { background: var(--paper); color: var(--paper-ink); border: 1px solid var(--paper-line); border-radius: 12px; padding: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.08);
  background-image: repeating-linear-gradient(0deg, transparent 0 22px, rgba(120,100,60,.05) 22px 23px); }
.pp-page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; border-bottom: 2px solid var(--paper-line); padding-bottom: 6px; margin-bottom: 10px; }
.pp-page-head h3 { margin: 0; font-size: 13px; letter-spacing: .18em; color: var(--paper-ink); }
.pp-page-count { font-variant-numeric: tabular-nums; font-size: 13px; opacity: .8; }
.pp-stamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.pp-stamp { aspect-ratio: 1; padding: 2px; border: 0; background: transparent; cursor: pointer; border-radius: 50%; min-height: 44px; color: var(--paper-ink); }
.pp-stamp:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.pp-stamp.got { mix-blend-mode: multiply; }
:root[data-theme="dark"] .pp-stamp.got { mix-blend-mode: normal; filter: brightness(1.5) saturate(1.1); }
.pp-stamp-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.pp-t-ring { font: 700 6.4px system-ui, sans-serif; letter-spacing: .06em; }
.pp-t-thr { font: 800 11px ui-monospace, "SF Mono", Menlo, monospace; }
.pp-t-small { font: 600 6px system-ui, sans-serif; letter-spacing: .08em; }
.pp-detail { display: flex; gap: 12px; align-items: flex-start; margin-top: 10px; padding: 10px; border: 1px dashed var(--paper-line); border-radius: 10px; font-size: 14px; }
.pp-detail-art { flex: none; width: 72px; height: 72px; }
.pp-detail-art svg { width: 100%; height: 100%; }
#achievements .passport .ach-next { color: var(--paper-ink); margin: 10px 0 0; font-size: 13.5px; }
.pp-mrz { margin-top: 12px; font: 500 11px/1.25 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .12em; opacity: .55; overflow: hidden; white-space: nowrap; }
#achievements .passport { grid-template-columns: minmax(0, 1fr); }
.pp-page, .pp-cover { min-width: 0; }
.pp-page-head h3 { background: none; color: var(--paper-ink); padding: 0; margin: 0; border: 0; box-shadow: none; }

/* Route tracée dans la fiche du vol (style cockpit) : bandeau départ ⌒ arrivée + arc géodésique sur la carte. */
.fd-route { margin: 4px 0 8px; color: var(--ink); }
body:not(.cockpit) .fd-route { display: none !important; }
.fd-route svg { width: 100%; height: auto; display: block; max-height: 130px; }
.fd-route .fr-arc { fill: none; stroke: var(--orange); stroke-width: 2; stroke-dasharray: 5 6; stroke-linecap: round; }
.fd-route .fr-dot { fill: var(--orange); }
.fd-route .fr-code { font: 700 17px var(--mono, ui-monospace, Menlo, monospace); fill: currentColor; letter-spacing: -.02em; }
.fd-route .fr-meta { font: 600 11px var(--mono, ui-monospace, Menlo, monospace); fill: var(--muted); font-variant-numeric: tabular-nums; }
.fd-route .fr-plane { fill: var(--orange); }
.fd-plane-icon { background: none; border: 0; }
.fd-plane-icon svg { width: 26px; height: 26px; fill: #e8590c; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }

/* Accueil « Statut de vol » : carte sur fond bleu (couleurs de marque), titre blanc ; pastilles claires dessus. */
.validity-card { background: linear-gradient(135deg, var(--brand-a, #0d3b99), var(--brand-b, #2a5fd1)); color: #fff; border-color: transparent; }
.validity-card .validity-head h3 { color: #fff; background: none; margin: 0; font-size: 15px; letter-spacing: .14em; }
.validity-card .validity-head .ghost { color: #fff; border-color: rgba(255,255,255,.55); background: transparent; }
.validity-card .vstat { background: var(--surface); color: var(--ink); border-color: transparent; border-left-color: var(--muted); }
.validity-card .vstat.ok { border-left-color: var(--ok); } .validity-card .vstat.warn { border-left-color: var(--warn); } .validity-card .vstat.bad { border-left-color: var(--err); }
.validity-card .validity-lines button { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.35); color: #fff; }
.validity-card .validity-lines .badge { background: rgba(255,255,255,.9); color: #12327a; }
.validity-restore { margin: 0 0 12px; }
.validity-restore button { width: 100%; min-height: 48px; }
/* Visionneuse PDF : rendu par pages (pdf.js) pour les appareils dont le lecteur intégré affiche un document vide (iPhone, Android). */
.pdf-pages { flex: 1; overflow: auto; background: #6b6f78; padding: 8px; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y pinch-zoom; }
.pdf-pages.hidden { display: none; }
.pdf-pages canvas { display: block; margin: 0 auto 10px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.4); max-width: none; }
.pdf-pages .pdf-msg { color: #fff; padding: 16px; text-align: center; }
.pdf-zoom { display: inline-flex; gap: 4px; }
.pdf-zoom.hidden { display: none; }

.track-actions-row { flex-wrap: nowrap; align-items: center; }
.track-actions-row > * { margin: 0; white-space: nowrap; }
@media (max-width: 560px) { .track-actions-row { flex-wrap: wrap; } }

/* Carnet de vol › Saisie : « Filtres » et « Affichage » sur une même ligne (plus de bande vide à droite des filtres). */
.filters-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.filters-row > .filters-acc { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
.filters-row > .list-tools { flex: 0 0 auto; margin: 0; min-height: 48px; }
@media (max-width: 560px) { .filters-row { flex-wrap: wrap; } .filters-row > .filters-acc { flex-basis: 100%; } .filters-row > .list-tools { justify-content: flex-start; min-height: 0; } }

/* Statut de vol : tuiles au choix (menu ▾ en haut à droite de chaque tuile). */
.vcell { position: relative; min-width: 0; display: flex; }
.vcell > .vstat { flex: 1; width: 100%; }
.vpick { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; min-height: 0; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 13px; line-height: 1; cursor: pointer; }
.vpick:hover, .vpick:focus-visible { background: var(--line); color: inherit; }
@media (pointer: coarse) { .vpick { width: 44px; height: 44px; top: 0; right: 0; } }
.validity-card { position: relative; }
.vmenu { color: var(--ink); position: absolute; z-index: 20; width: 260px; max-height: 340px; overflow-y: auto; padding: 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.vmenu-group { padding: 8px 10px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.vmenu button { display: block; width: 100%; min-height: 36px; padding: 6px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.vmenu button:hover:not(:disabled), .vmenu button.current { background: var(--line); }
.vmenu button:disabled { opacity: .4; cursor: default; }
.vcell .vstat .vlabel { padding-right: 24px; }

/* Passeport : page « Licences » (titres obtenus seulement) et page « Parcours » (jalons). */
.pp-licences { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.pp-licence { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; border-radius: 10px; border: 1px solid var(--line); text-align: center; }
.pp-licence-icon { font-size: 28px; line-height: 1.2; }
.pp-page-head .small { margin-left: auto; }

/* Temps de service : trois groupes (repos et dernière vacation, cumul de service, cumul de vol). */
.ftl-group { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ftl-group:first-child { margin-top: 0; }

/* Visite guidée (public/tour.js) : cadre lumineux (le reste de l'écran s'assombrit) et bulle. */
.tour-spot { position: fixed; z-index: 9000; border-radius: 12px; pointer-events: none; box-shadow: 0 0 0 9999px rgba(8, 14, 30, .55), 0 0 0 3px var(--brand-b, #2a5fd1); transition: top .25s, left .25s, width .25s, height .25s; }
.tour-spot[hidden] { display: none; }
.tour-bubble { position: fixed; z-index: 9001; width: min(360px, calc(100vw - 24px)); padding: 14px 16px; border-radius: 14px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0, 0, 0, .35); }
.tour-bubble[hidden] { display: none; }
.tour-bubble.centered { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.tour-bubble h3 { margin: 2px 0 6px; font-size: 17px; }
.tour-bubble p { margin: 0 0 10px; line-height: 1.45; }
.tour-bubble .tour-meta { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.tour-bubble .tour-hint { font-weight: 600; color: var(--brand-b, #2a5fd1); }
.tour-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.tour-actions button { min-height: 44px; }
.tour-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.tour-links .linklike { min-height: 44px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
@media (max-width: 639px) {
  .tour-bubble { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); top: auto; width: auto; max-height: 55vh; overflow-y: auto; }
  .tour-bubble.centered { transform: none; top: auto; left: 12px; }
}
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } }
[data-tour] { scroll-margin-top: 92px; }

/* Session de démonstration : bandeau en haut de l'application. */
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 6px 12px; background: #fff3cd; color: #5c4400; font-size: 13px; border-bottom: 1px solid #e6cf85; }
.demo-bar.hidden { display: none; }
.demo-bar-actions { display: flex; gap: 8px; }
.demo-bar button { min-height: 44px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .demo-bar { background: #4a3d12; color: #f5e6b0; border-bottom-color: #7a6521; } }
:root[data-theme="dark"] .demo-bar { background: #4a3d12; color: #f5e6b0; border-bottom-color: #7a6521; }

/* Après le geste, la bulle se range en bas à droite : la fenêtre ou le menu que le geste a ouvert reste visible (sur mobile, la feuille basse ne bouge pas). */
@media (min-width: 640px) { .tour-bubble.docked { top: auto !important; left: auto !important; right: 16px; bottom: 16px; } }

/* Clic hors script pendant la visite : la bulle « tremble » et rappelle d'utiliser ses boutons. */
.tour-bubble .tour-note { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.tour-bubble.nudge { animation: tour-nudge .35s; }
@keyframes tour-nudge { 0%, 100% { translate: 0 0; } 25% { translate: -6px 0; } 75% { translate: 6px 0; } }
@media (prefers-reduced-motion: reduce) { .tour-bubble.nudge { animation: none; outline: 2px solid var(--brand-b, #2a5fd1); } }

/* Mobile : la feuille de la visite passe en haut quand la cible est dans sa moitié (une action à faire ne doit jamais être cachée par la bulle). */
@media (max-width: 639px) { .tour-bubble.sheet-top { top: calc(12px + env(safe-area-inset-top)); bottom: auto; } }

/* Dernière page de la visite : tuile de contact pour un compte de bêta-test. */
.tour-tile { margin: 4px 0 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--brand-b, #2a5fd1); background: color-mix(in srgb, var(--brand-b, #2a5fd1) 10%, transparent); }
.tour-tile p { margin: 0 0 8px; }
.tour-mail { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 8px; background: var(--brand-b, #2a5fd1); color: #fff; font-weight: 600; text-decoration: none; }
.demo-bar a.demo-bar-mail { color: inherit; font-weight: 600; text-decoration: underline; display: inline-flex; align-items: center; min-height: 44px; }

/* Visite guidée : teinte verte (sarcelle), distincte du blanc et du bleu de l'application */
.tour-bubble { --tour-a: #0f766e; --tour-bg: #e6f6f2; --tour-ink: #0b3a35; --tour-line: #8fd0c6; background: var(--tour-bg); color: var(--tour-ink); border: 2px solid var(--tour-a); }
.tour-bubble .tour-meta, .tour-bubble .tour-note, .tour-links .linklike { color: #2f6f66; }
.tour-bubble .tour-hint { color: var(--tour-a); }
.tour-bubble button:not(.linklike) { background: var(--tour-a); border-color: var(--tour-a); color: #fff; }
.tour-bubble button.ghost { background: transparent; color: var(--tour-a); }
.tour-bubble button:disabled { opacity: .5; }
.tour-spot { box-shadow: 0 0 0 9999px rgba(8, 14, 30, .55), 0 0 0 3px #4fd1c0; }
.tour-tile { border-color: var(--tour-a, #0f766e); background: #cdeee7; }
.tour-mail { background: var(--tour-a, #0f766e); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tour-bubble { --tour-a: #4fd1c0; --tour-bg: #12312d; --tour-ink: #e3faf6; --tour-line: #2f6f66; }
  :root:not([data-theme="light"]) .tour-bubble .tour-meta, :root:not([data-theme="light"]) .tour-bubble .tour-note, :root:not([data-theme="light"]) .tour-links .linklike { color: #a8e0d6; }
  :root:not([data-theme="light"]) .tour-bubble button:not(.linklike) { color: #06221f; }
  :root:not([data-theme="light"]) .tour-bubble button.ghost { color: #bff0e8; }
  :root:not([data-theme="light"]) .tour-tile { background: #1d4a44; }
}
:root[data-theme="dark"] .tour-bubble { --tour-a: #4fd1c0; --tour-bg: #12312d; --tour-ink: #e3faf6; --tour-line: #2f6f66; }
:root[data-theme="dark"] .tour-bubble .tour-meta, :root[data-theme="dark"] .tour-bubble .tour-note, :root[data-theme="dark"] .tour-links .linklike { color: #a8e0d6; }
:root[data-theme="dark"] .tour-bubble button:not(.linklike) { color: #06221f; }
:root[data-theme="dark"] .tour-bubble button.ghost { color: #bff0e8; }
:root[data-theme="dark"] .tour-tile { background: #1d4a44; }

/* Passeport ouvert : double page (identité + titres à gauche, parcours à droite) ; une seule colonne sur petit écran. */
.pp-spread { display: grid; grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr); border-radius: 12px; overflow: hidden; border: 1px solid var(--paper-line); box-shadow: 0 2px 8px rgba(0,0,0,.08); background: var(--paper); }
.pp-spread .pp-page { border: 0; border-radius: 0; box-shadow: none; min-width: 0; display: flex; flex-direction: column; }
.pp-spine { background: linear-gradient(90deg, rgba(120,100,60,.22), rgba(120,100,60,.04) 50%, rgba(120,100,60,.22)); }
.pp-id { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; margin-bottom: 14px; }
.pp-id-emblem { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 30px; color: #e9d9a6; background: #1c3c70; box-shadow: inset 0 0 0 2px rgba(233,217,166,.5); }
.pp-id-name { font-size: 17px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; overflow-wrap: anywhere; }
.pp-id-stats { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 3px; font-size: 13px; font-variant-numeric: tabular-nums; opacity: .85; }
.pp-sub { margin-top: 4px; }
.pp-spread .pp-licences { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pp-spread .pp-licence { flex-direction: row; text-align: left; gap: 8px; padding: 8px 10px; border: 1px solid var(--paper-line); background: rgba(255,255,255,.35); }
.pp-spread .pp-licence b { display: block; font-size: 13px; font-weight: 600; }
.pp-spread .pp-licence .muted { font-size: 12px; }
.pp-spread .pp-licence-icon { font-size: 22px; flex: none; }
.pp-spread .pp-mrz { margin-top: auto; padding-top: 12px; }
.pp-timeline { position: relative; list-style: none; margin: 0; padding: 0 0 0 18px; }
.pp-timeline::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; border-left: 2px dashed var(--paper-line); }
.pp-timeline li { position: relative; margin: 0 0 12px; font-size: 14px; line-height: 1.4; }
.pp-timeline li::before { content: ""; position: absolute; left: -18px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #1c3c70; box-shadow: 0 0 0 3px var(--paper); }
.pp-timeline li.custom::before { background: #b8842a; }
.pp-tl-date { font-weight: 700; font-variant-numeric: tabular-nums; }
.pp-timeline small { display: block; opacity: .75; }
.pp-timeline .small { min-height: 44px; }
.pp-foot { display: flex; justify-content: space-between; margin-top: auto; padding-top: 8px; font-size: 12px; opacity: .7; }
@media (max-width: 639px) {
  .pp-spread { grid-template-columns: minmax(0, 1fr); }
  .pp-spine { display: none; }
  .pp-spread .pp-right { border-top: 2px solid var(--paper-line); }
  .pp-spread .pp-licences { grid-template-columns: minmax(0, 1fr); }
}

/* Passeport « Aéropostale » (années 1920-30, lignes Toulouse – Casablanca – Dakar – Buenos Aires) : liseré courrier « par avion » rouge / blanc / bleu,
   papier crème, titres Art déco, licences en timbres dentelés avec cachet postal, parcours en ligne aérienne. Tout est en CSS (aucune police ni image). */
#achievements .passport { --pp-ink: #1d3f94; --pp-red: #c8372d; --pp-gold: #c8372d; --pp-deco: "Futura", "Century Gothic", "Avenir Next Condensed", "Trebuchet MS", sans-serif; --pp-serif: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --paper: #f6edd6; --paper-ink: #1c2a4a; --paper-line: #d8c9a2; }
:root[data-theme="dark"] #achievements .passport { --pp-ink: #8fb0ff; --pp-red: #ff7a6b; --pp-gold: #ff7a6b; --paper: #1e2433; --paper-ink: #e9e2cc; --paper-line: #3b4560; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #achievements .passport { --pp-ink: #8fb0ff; --pp-red: #ff7a6b; --pp-gold: #ff7a6b; --paper: #1e2433; --paper-ink: #e9e2cc; --paper-line: #3b4560; } }
#achievements .pp-page, #achievements .pp-spread { font-family: var(--pp-serif); }
#achievements .pp-page { position: relative; padding: 20px 20px 16px; background-color: var(--paper);
  background-image: radial-gradient(ellipse at 50% 40%, transparent 60%, rgba(150,110,40,.12) 100%); }
#achievements .pp-page::before { content: ""; position: absolute; inset: 7px; border: 1px solid var(--pp-ink); outline: 1px solid color-mix(in srgb, var(--pp-red) 55%, transparent); outline-offset: 3px; border-radius: 2px; pointer-events: none; opacity: .7; }
#achievements .pp-page-head { border-bottom: 2px solid var(--pp-ink); padding-bottom: 7px; margin-bottom: 12px; position: relative; }
#achievements .pp-page-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -5px; border-bottom: 1px solid var(--pp-red); }
#achievements .pp-page-head h3 { font-family: var(--pp-deco); font-weight: 700; font-size: 13px; letter-spacing: .3em; color: var(--pp-ink); text-transform: uppercase; }
#achievements .pp-page-head h3::before { content: "✦ "; color: var(--pp-red); letter-spacing: 0; }
#achievements .pp-page-count { font-family: var(--pp-deco); color: var(--pp-red); font-weight: 700; letter-spacing: .1em; }
/* Passeport ouvert : liseré courrier aérien */
#achievements .pp-spread { border: 11px solid transparent; border-image: repeating-linear-gradient(135deg, #c8372d 0 14px, #fff 14px 24px, #1d3f94 24px 38px, #fff 38px 48px) 11; border-radius: 0; background-clip: padding-box;
  box-shadow: 0 6px 20px rgba(20,30,60,.25); background-color: var(--paper); }
#achievements .pp-spread .pp-page { border: 0; background-color: transparent; }
.pp-spine { position: relative; background: linear-gradient(90deg, rgba(20,40,90,.28), rgba(20,40,90,.04) 45%, rgba(255,255,255,.15) 55%, rgba(20,40,90,.26)); }
.pp-spine::after { content: ""; position: absolute; left: 50%; top: 10px; bottom: 10px; border-left: 2px dotted var(--pp-red); opacity: .8; }
.pp-id-emblem { width: 72px; height: 72px; background: none; box-shadow: none; display: block; }
.pp-id-emblem svg { width: 100%; height: 100%; display: block; }
.pp-spread .pp-id { grid-template-columns: 72px minmax(0, 1fr); }
.pp-id-name { font-family: var(--pp-deco); font-size: 19px; font-weight: 700; letter-spacing: .16em; color: var(--pp-ink); }
.pp-id-stats { font-style: italic; letter-spacing: .02em; }
/* Licences : timbres dentelés avec cachet postal */
.pp-spread .pp-licence { position: relative; background: color-mix(in srgb, var(--pp-ink) 10%, var(--paper)); border: 6px dotted var(--paper); outline: 1px solid var(--pp-ink); outline-offset: -1px; border-radius: 2px; color: var(--pp-ink); padding: 8px 10px; overflow: visible; box-shadow: 0 0 0 1px color-mix(in srgb, var(--pp-ink) 25%, transparent); }
.pp-spread .pp-licence:nth-child(odd) { transform: rotate(-1deg); }
.pp-spread .pp-licence:nth-child(even) { transform: rotate(1deg); }
.pp-spread .pp-licence::after { content: "★"; position: absolute; right: -8px; top: -8px; width: 34px; height: 34px; border-radius: 50%; border: 2px double var(--pp-red); color: var(--pp-red); font-size: 12px; display: flex; align-items: center; justify-content: center; transform: rotate(-14deg); opacity: .6; background: transparent; pointer-events: none; }
.pp-spread .pp-licence b { font-family: var(--pp-deco); letter-spacing: .1em; font-size: 14px; text-transform: uppercase; }
.pp-spread .pp-licence .muted { color: var(--pp-ink); opacity: .85; font-style: italic; }
/* Parcours : ligne aérienne avec escales */
.pp-timeline { padding-left: 20px; }
.pp-timeline::before { border-left: 2px dotted var(--pp-red); left: 5px; }
.pp-timeline li { font-family: var(--pp-serif); }
.pp-timeline li::before { left: -20px; top: 3px; width: auto; height: auto; border-radius: 0; background: none; box-shadow: none; transform: none; content: "✈"; font-size: 12px; color: var(--pp-red); }
.pp-timeline li.custom::before { color: var(--pp-ink); }
.pp-tl-date { font-family: var(--pp-deco); color: var(--pp-ink); letter-spacing: .06em; }
.pp-foot { font-family: var(--pp-deco); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--pp-red); opacity: 1; }
#achievements .pp-mrz { font-family: ui-monospace, "SF Mono", Menlo, monospace; opacity: .5; }
#achievements .pp-detail { border-color: var(--pp-ink); font-family: var(--pp-serif); }
@media (max-width: 639px) { #achievements .pp-spread .pp-right { border-top: 2px solid var(--pp-ink); } }
.pp-id-stats { display: block; }
.pp-id-stats .pp-st-visas { display: block; }
.pp-id-stats .pp-st-line { display: flex; flex-wrap: nowrap; gap: 0 14px; margin-top: 2px; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Crédits des portraits : détaché de la dernière page de visas (il était collé dessous). */
#badge-credits { margin-top: 18px; }
.pp-spread .pp-licence-icon { width: 52px; height: 52px; font-size: 0; flex: none; }
.pp-spread .pp-licence-icon svg { width: 100%; height: 100%; display: block; }

/* Photo du passeport : médaillon d'identité (image stylisée, anneau rouge) et fenêtre de cadrage. */
.pp-id-emblem .pp-photo { width: 100%; height: 100%; display: block; border-radius: 50%; object-fit: cover; border: 3px solid var(--pp-red, #c8372d); box-sizing: border-box; box-shadow: 0 0 0 1px var(--pp-ink, #1d3f94); background: #cec7ae; }
.photo-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.photo-preview { width: 72px; height: 72px; flex: none; }
.photo-preview svg, .photo-preview img { width: 100%; height: 100%; display: block; border-radius: 50%; object-fit: cover; }
.photo-stage { display: flex; justify-content: center; margin: 10px 0 12px; }
#photo-canvas { width: 240px; height: 240px; max-width: 100%; border-radius: 50%; border: 4px solid #c8372d; box-sizing: border-box; touch-action: none; cursor: grab; background: #cec7ae; }
#photo-canvas:active { cursor: grabbing; }

/* Sélecteur de langue (écran de connexion) */
.lang-switch { display: flex; justify-content: flex-end; margin: -6px 0 6px; }
.lang-switch select { width: auto; min-height: 36px; padding: 2px 8px; font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Entre deux étapes de la visite : écran assombri sans cadre (jamais de clignotement) */
.tour-spot.none { border-radius: 0; transition: none; box-shadow: 0 0 0 9999px rgba(8, 14, 30, .55); }

/* Visite guidée : changements d'écran en fondu, bulle qui s'estompe et glisse au lieu de sauter */
@keyframes tour-fade { from { opacity: .55; } to { opacity: 1; } }
body.tour-on .tab-panel.active, body.tour-on .subnav3-panel.active { animation: tour-fade .3s ease both; }
.tour-bubble { transition: opacity .22s ease; }
.tour-bubble.swap { opacity: .25; pointer-events: none; }
@media (min-width: 640px) { .tour-bubble { transition: opacity .22s ease, top .35s ease, left .35s ease; } }
@media (prefers-reduced-motion: reduce) { body.tour-on .tab-panel.active, body.tour-on .subnav3-panel.active { animation: none; } .tour-bubble { transition: none; } }

/* Visite guidée : le cadre rétablit son contour et se déplace lentement (grandit depuis le centre de la cible), pour éviter tout mouvement brusque. */
.tour-spot { transition: top .65s cubic-bezier(.4, 0, .2, 1), left .65s cubic-bezier(.4, 0, .2, 1), width .65s cubic-bezier(.4, 0, .2, 1), height .65s cubic-bezier(.4, 0, .2, 1); }
.tour-spot.none { transition: none; }
@media (min-width: 640px) { .tour-bubble { transition: opacity .3s ease, top .6s cubic-bezier(.4, 0, .2, 1), left .6s cubic-bezier(.4, 0, .2, 1); } }
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } }

/* Écran de connexion compact : tout tient sur un écran d'iPhone ou d'iPad sans défiler.
   Sélecteur de langue en coin, « ou » retiré, messages d'erreur vides sans hauteur, marges réduites ; sur écran bas, texte d'accroche et d'aide en moins. */
.login-card { position: relative; padding: 22px 26px; gap: 8px; }
.login-card .lang-switch { position: absolute; top: 10px; right: 12px; margin: 0; }
.login-card .lang-switch select { min-height: 32px; }
.login-card h1 { margin: 0; }
.login-card .field-err:empty { display: none; min-height: 0; }
.login-card #login-form .actions { margin-top: 10px; }
#passkey-login { margin-top: 0 !important; }
#passkey-login > p.muted { display: none; }
@media (max-height: 760px) {
  .login-card { padding: 16px 22px; gap: 6px; }
  .login-card p.meta, #login-remember-help { display: none; }
  .login-card .check-row { min-height: 36px; }
  .login-card #login-form .actions { margin-top: 6px; }
}

/* Mention « à titre indicatif » sous les calculs de FDP maximale */
.ftl-disclaimer { font-size: 12px; margin: 8px 0 0; padding-left: 8px; border-left: 3px solid var(--line); }

/* Remises de gaz : case pleine largeur avec compteur */
.goaround-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 10px 12px; background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.goaround-box .mv-title { margin: 0; }
.goaround-box .stepper { flex: 0 0 auto; }
.goaround-box .stepper input { width: 64px; flex: 0 0 64px; }

/* Décollages et atterrissages : tous les champs centrés */
details[data-sec="temps"] #total-slot label { align-items: center; text-align: center; }
details[data-sec="temps"] #total-slot input { text-align: center; }
details[data-sec="temps"] .mv-grid { justify-content: center; justify-items: center; align-items: end; }
/* Décollages / Atterrissages : au niveau des champs (Jour, Nuit, PF/PM), pas centrés sur la hauteur de la cellule avec son intitulé */
details[data-sec="temps"] .mv-title { justify-self: center; text-align: center; align-self: end; display: flex; align-items: center; justify-content: center; min-height: 44px; padding-top: 0; }
details[data-sec="temps"] .mv-cell { align-items: center; text-align: center; }
details[data-sec="temps"] .mv-cell select { text-align: center; text-align-last: center; }
details[data-sec="temps"] .mv-cell .stepper { justify-content: center; }
details[data-sec="temps"] .goaround-box { flex-direction: row; flex-wrap: nowrap; justify-content: center; align-items: center; text-align: left; gap: 14px; }
details[data-sec="temps"] .goaround-box .stepper { justify-content: center; }
@media (max-width: 560px) { details[data-sec="temps"] .mv-cell.pilot-function-field { grid-column: 1 / -1; } } /* PF/PM seul sur sa ligne : centré sous les deux autres champs */
@media (max-width: 560px) { details[data-sec="temps"] .mv-title { min-height: 0; margin-top: 6px; } }

/* Tuile « FDP du jour » : icône qui renvoie à la page Temps de service */
.vstat .vgo { position: absolute; bottom: 8px; right: 10px; font-size: 18px; line-height: 1; color: var(--brand-b, var(--muted)); opacity: .85; }

/* Logo Logavia (traits arrondis, sans avion, mention BETA TEST) */
.logo { display: block; height: 44px; width: auto; --logo-a: #1c3680; --logo-b: #2b9bd6; } /* « log » / « avia » : deux couleurs, la même pour toutes les applications devavia */
.login-card h1.logo-h1 { display: flex; justify-content: center; margin: 26px 0 0; } /* sous le sélecteur de langue, qui occupe le coin */
.login-card .logo { height: 72px; }
header h1.logo-h1 { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; }
header .logo { height: 34px; --logo-a: #ffffff; --logo-b: #6cc4f4; }
@media (max-width: 480px) { header .logo { height: 28px; } }
@media (max-height: 760px) { .login-card .logo { height: 56px; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .login-card .logo { --logo-a: #dbe6ff; --logo-b: #6cc4f4; } }
:root[data-theme="dark"] .login-card .logo { --logo-a: #dbe6ff; --logo-b: #6cc4f4; }
.drawer .drawer-link { justify-content: flex-start; background: none; color: var(--ink); border-radius: var(--radius-sm); font-weight: 600; display: flex; align-items: center; gap: 10px; text-align: left; }
.drawer .drawer-link:hover { background: var(--accent-soft); filter: none; }
/* Petits écrans : le bouton « avis » de l'en-tête laisse la place à Déconnexion (il reste dans le menu ☰ et sur la connexion) */
@media (max-width: 480px) { header #feedback-btn { display: none; } }

/* Acceptation des CGU : écran bloquant au-dessus de tout (même de la visite guidée) */
.terms-gate { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(8, 14, 30, .82); overflow-y: auto; }
.terms-gate.hidden { display: none; }
.terms-card { background: var(--surface); color: var(--ink); border-radius: var(--radius); padding: 24px; width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.terms-card h2 { margin: 0; font-size: 20px; }
.terms-card p { margin: 0; line-height: 1.5; }
.terms-card .actions { margin-top: 4px; }

/* Aéroport ouvert : stands, pistes, SID et STAR en barres (valeur, barre proportionnelle, nombre) */
.ap-blocks { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
@media (min-width: 640px) { .ap-blocks { grid-template-columns: 1fr 1fr; } }
.ap-block { background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 10px 12px 12px; }
.ap-block h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ap-bar { display: grid; grid-template-columns: 8.5em 1fr 2.2em; align-items: center; gap: 8px; margin: 5px 0; }
.ap-bar-label { font-weight: 700; font-variant-numeric: tabular-nums; word-break: break-word; }
.ap-bar-track { height: 8px; border-radius: 4px; background: var(--accent-soft, rgba(128,128,128,.18)); overflow: hidden; }
.ap-bar-fill { display: block; height: 100%; border-radius: 4px; background: var(--brand-b, #2a5fd1); }
.ap-bar-n { text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
