/* Navigation (jalon J3, lot L3, maquettes 01 à 03) : barre supérieure bleu nuit (marque, module courant, recherche
   Ctrl+K, cloche, aide, compte), menu latéral clair par famille, panneaux flottants, palette de recherche, fil
   d'Ariane. La barre reste sombre dans les deux thèmes : ses couleurs sont fixes et contrastées (AA). */

.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); grid-template-rows: 56px minmax(0, 1fr); height: 100%; }

/* Barre supérieure */
.barre { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 16px 0 20px; background: var(--side);
  color: #FFFFFF; min-width: 0; position: relative; z-index: 30; }
.barre a, .barre button { color: inherit; }
.barre-menu { display: none; }
.marque { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 18px; text-decoration: none; flex: 0 0 auto; }
.module-courant { border: 1px solid rgba(255, 255, 255, .22); border-radius: 6px; padding: 5px 11px; font-size: 13.5px;
  text-decoration: none; white-space: nowrap; flex: 0 0 auto; }
.module-courant:hover { background: rgba(255, 255, 255, .08); }
.barre-recherche { flex: 1 1 auto; max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 8px; min-width: 0;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .18); border-radius: 6px; padding: 7px 10px;
  color: var(--side-ink) !important; cursor: text; text-align: left; font-size: 14px; }
.barre-recherche:hover { border-color: rgba(255, 255, 255, .35); }
.recherche-texte { flex: 1; min-width: 0; white-space: nowrap; }
.barre kbd { font: 11px var(--mono); border: 1px solid rgba(255, 255, 255, .3); border-radius: 4px; padding: 1px 6px; color: var(--side-ink); }
.barre-droite { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.ancre-flottant { position: relative; }
.icone-btn { display: inline-grid; place-items: center; position: relative; width: 36px; height: 36px; border: 0; border-radius: 6px;
  background: transparent; cursor: pointer; }
.barre .icone-btn:hover, .compte-btn:hover { background: rgba(255, 255, 255, .1); }
.badge { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: #A4510C; color: #FFFFFF; font-size: 10.5px; line-height: 17px; text-align: center; }
.compte-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 4px 8px 4px 4px;
  border-radius: 20px; cursor: pointer; }
.avatar { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: #1F5AA6; color: #FFFFFF; display: grid;
  place-items: center; font-size: 12px; font-weight: 600; }
.compte-btn .qui { white-space: nowrap; font-size: 14px; }

/* Panneaux flottants (cloche, aide, compte) */
.flottant { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: min(380px, calc(100vw / var(--echelle) - 24px));
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 28px rgba(10, 20, 36, .18); max-height: calc(100vh / var(--echelle) - 80px); overflow: auto; }
.flottant a { color: var(--navy-2); }
.flottant > header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.flottant > header h2 { font-size: 14px; }
.flottant .icone-btn { width: 30px; height: 30px; color: var(--muted); }
.flottant .icone-btn:hover { background: var(--line-2); }
.flottant section { border-bottom: 1px solid var(--line); }
.flottant section h3 { padding: 12px 16px 6px; font-size: 13px; display: flex; justify-content: space-between; }
.corps-flottant { padding: 10px 16px; margin: 0; }
.panneau-activite { width: min(400px, calc(100vw / var(--echelle) - 24px)); }
.menu-compte .compte-nom { font-weight: 600; }
.actions-compte { display: flex; flex-direction: column; gap: 6px; padding: 10px 16px 14px; border-top: 1px solid var(--line); }
.actions-compte .btn { justify-content: flex-start; }
.raccourcis { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 8px 0 0; }
.raccourcis dd { margin: 0; color: var(--muted); }
kbd { font: 11.5px var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; }

/* Menu latéral clair */
.side { background: var(--surface); border-right: 1px solid var(--line); overflow: auto; min-height: 0; }
.nav { list-style: none; margin: 0; padding: 12px 10px 24px; }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav a { display: flex; align-items: center; gap: 10px; border-radius: 6px; padding: 7px 10px; color: var(--ink); text-decoration: none; font-size: 14px; }
.nav a .icone { color: var(--muted); flex: 0 0 auto; }
.nav a:hover { background: var(--line-2); }
.nav a[aria-current="page"] { background: var(--bleu-pale); color: var(--navy-2); font-weight: 500; }
.nav a[aria-current="page"] .icone { color: var(--navy-2); }
.nav-titre { flex: 1; min-width: 0; }
.nav .count { font-size: 12px; color: var(--muted); flex: 0 0 auto; min-width: 4ch; text-align: right; }   /* place réservée (9 999 au plus) */
.famille { margin-top: 14px; }
.famille-titre { display: block; padding: 6px 10px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted); }

/* Fil d'Ariane */
.fil ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 6px; padding: 0; font-size: 13px; color: var(--muted); }
.fil li + li::before { content: "/"; margin-right: 4px; color: var(--muted); }
.fil a { text-decoration: none; }
.fil a:hover { text-decoration: underline; }
/* Téléphone (D97) : cibles d'au moins 24 px de haut, espacées, même sur un chemin profond */
@media (max-width: 767px) { .fil ol { gap: 4px 6px; } .fil a { display: inline-block; min-height: 24px; padding: 3px 0; } }
/* Étape dont le nom arrive après coup : largeur fixe, texte coupé si besoin (règle de stabilité, docs/j3-conception.md) */
.fil li.reserve > * { display: inline-block; width: 13em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* Boutons à bascule groupés (Grille / Orbite, filtres) */
.segments { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.segments button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 5px 11px;
  font-size: 13px; color: var(--muted); cursor: pointer; }
.segments button + button { border-left: 1px solid var(--line); }
.segments button[aria-pressed="true"] { background: var(--bleu-pale); color: var(--navy-2); font-weight: 500; }
.segments.vue button[aria-pressed="true"] { background: var(--navy-2); color: var(--on-accent); }

/* Bouton favori */
.btn.favori.actif { background: var(--bleu-pale); border-color: var(--navy-3); color: var(--navy-2); }

/* Palette de recherche (Ctrl+K) */
.palette-recherche { padding: 0; border: 1px solid var(--line); border-radius: 10px; width: min(680px, calc(100vw / var(--echelle) - 24px)); margin-top: 10vh;
  background: var(--surface); color: var(--ink); box-shadow: 0 18px 48px rgba(10, 20, 36, .3); }
.palette-recherche::backdrop { background: rgba(10, 20, 36, .45); }
.palette-saisie { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-saisie input { border: 0; padding: 6px 0; font-size: 16px; background: transparent; color: var(--ink); box-shadow: none !important; }
.palette-res { max-height: min(calc(60vh / var(--echelle)), 520px); overflow: auto; padding: 6px 0; }
.palette-groupe { padding: 8px 16px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.palette-option { display: flex; align-items: center; gap: 10px; padding: 7px 16px; cursor: pointer; }
.palette-option .icone { color: var(--muted); flex: 0 0 auto; }
.palette-option.active { background: var(--bleu-pale); }
.palette-option.active .icone { color: var(--navy-2); }
.palette-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.palette-titre { overflow-wrap: anywhere; }
.palette-detail { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.palette-type { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; white-space: nowrap; }
.palette-vide { padding: 14px 16px; color: var(--muted); font-size: 13.5px; }
.palette-pied { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.palette-pied kbd { margin-right: 3px; }

/* Portable et téléphone : menu en tiroir, barre resserrée */
@media (max-width: 1023px) {
  .app { grid-template-columns: 1fr; }
  .barre { gap: 8px; padding: 0 8px 0 12px; }
  .barre-menu { display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 6px; padding: 4px 9px; cursor: pointer; }
  .barre-menu span { font-size: 13px; }
  .module-courant { display: none; }
  .barre-recherche { flex: 0 0 auto; width: 38px; height: 36px; padding: 0; justify-content: center; margin: 0 0 0 auto; }
  .recherche-texte, .barre-recherche kbd { display: none; }
  .compte-btn .qui { display: none; }
  .side { position: fixed; top: 56px; bottom: 0; left: 0; width: min(300px, 80vw); z-index: 40; transform: translateX(-102%);
    transition: transform .2s ease; visibility: hidden; }
  .app.open .side { transform: none; visibility: visible; }
  .voile { position: fixed; inset: 56px 0 0 0; z-index: 39; background: rgba(10, 20, 36, .4); }
}

/* Téléphone (J5, L1) : la barre accueille le bouton « Assistant » ; le mot « Lagune » cède sa place, le logo reste
   (nom accessible « Lagune, accueil ») */
@media (max-width: 480px) {
  .marque span { display: none; }
}

/* Ordinateur compact : le nom du compte et le module courant cèdent la place à la recherche (rien n'est tronqué) */
@media (max-width: 1279px) {
  .compte-btn .qui, .module-courant { display: none; }
}

/* Ecrans hors module (accueil, favoris, activité) : pas de menu latéral, le contenu prend toute la largeur */
.app.sans-menu { grid-template-columns: minmax(0, 1fr); }

/* Ecrans réservés à l'ordinateur (D71) : message à la place sous le point de rupture « tablette » */
.petit-ecran { display: none; }
@media (max-width: 1023px) {
  .ordinateur-seulement, .app.plein .ordinateur-seulement { display: none; }   /* plein écran : D71 l'emporte (D97) */
  .petit-ecran { display: block; }
}

/* Espaces de travail (D73) : aucune largeur maximale, toute la largeur et toute la hauteur ; menu latéral replié en
   tiroir, ouvert par le bouton « Menu » de la barre, à toutes les largeurs (maquette 06) */
.app.travail { grid-template-columns: minmax(0, 1fr); }
.app.travail .barre-menu { display: inline-flex; align-items: center; gap: 6px; background: none;
  border: 1px solid rgba(255, 255, 255, .25); border-radius: 6px; padding: 4px 9px; cursor: pointer; }
.app.travail .barre-menu span { font-size: 13px; }
.app.travail .side { position: fixed; top: 56px; bottom: 0; left: 0; width: 280px; z-index: 40; transform: translateX(-102%);
  transition: transform .2s ease; visibility: hidden; box-shadow: 0 10px 28px rgba(10, 20, 36, .18); }
.app.travail.open .side { transform: none; visibility: visible; }
.app.travail .voile { position: fixed; inset: 56px 0 0 0; z-index: 39; background: rgba(10, 20, 36, .4); }
.app.travail .head-in, .app.travail .content, .app.large .head-in, .app.large .content,
.app.travail .head-fil, .app.large .head-fil { max-width: none; }

/* Ligne du fil d'Ariane et « Comment ça marche ? » (J7, L12, D255) : sur toute la largeur de l'en-tête, au-dessus du titre
   et des actions ; des actions qui arrivent après coup ne la déplacent pas */
.head-fil { max-width: var(--largeur-max); margin-inline: auto; width: 100%; padding: 22px 32px 0; }
@media (max-width: 1023px) { .head-fil { padding: 18px 16px 0; } }
.fil-ligne { display: flex; align-items: baseline; gap: 4px 16px; margin: 0 0 6px; font-size: 13px; }
.fil-ligne .fil { flex: 1 1 auto; min-width: 0; }
.fil-ligne .fil ol { margin: 0; }
.bouton-aide { margin-left: auto; flex: 0 0 auto; background: none; border: 0; padding: 0; font: inherit; color: var(--navy-2);
  cursor: pointer; white-space: nowrap; }
.bouton-aide:hover { text-decoration: underline; }
.bouton-aide:focus-visible { outline: 2px solid var(--navy-2); outline-offset: 2px; }
@media (max-width: 767px) { .bouton-aide { min-height: 24px; padding: 3px 0; } }
.aide-intro { margin-left: 12px; font-size: 13px; }
.aide-intro .bouton-aide { margin-left: 0; }
