/* Akala-Nav démo — carte marine : mer, terre, encre ; un accent « signal » bleu canard ;
   rouge, ambre et vert réservés aux états (détresse, alerte, normal).
   Mise en page : téléphone simulé à gauche, console de surveillance à droite. */
:root {
  --mer: #d6e4e9;
  --terre: #ebe3cf;
  --terre-trait: #c4b894;
  --grille: rgba(20, 60, 80, .10);
  --fond: #e9eff1;
  --surface: #ffffff;
  --surface-2: #f3f7f8;
  --encre: #13252d;
  --encre-2: #536a75;
  --ligne: #d2dde2;
  --accent: #0a6a85;
  --accent-doux: rgba(10, 106, 133, .12);
  --ok: #2a7a4a;
  --alerte: #a65f00;
  --alerte-doux: #fbefdc;
  --critique: #c1262e;
  --critique-doux: #fbe3e3;
  --boitier: #11171a;
  --f-titre: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --f-texte: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --mer: #0c1a21; --terre: #232b26; --terre-trait: #3d4840; --grille: rgba(140, 190, 210, .08);
    --fond: #081115; --surface: #0f1b21; --surface-2: #14232a; --encre: #dbe6ea; --encre-2: #8ea5af;
    --ligne: #21343c; --accent: #3aaecb; --accent-doux: rgba(58, 174, 203, .16); --ok: #52b77c;
    --alerte: #e3a23d; --alerte-doux: #33250f; --critique: #f0595f; --critique-doux: #3b1517; --boitier: #000;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --mer: #0c1a21; --terre: #232b26; --terre-trait: #3d4840; --grille: rgba(140, 190, 210, .08);
  --fond: #081115; --surface: #0f1b21; --surface-2: #14232a; --encre: #dbe6ea; --encre-2: #8ea5af;
  --ligne: #21343c; --accent: #3aaecb; --accent-doux: rgba(58, 174, 203, .16); --ok: #52b77c;
  --alerte: #e3a23d; --alerte-doux: #33250f; --critique: #f0595f; --critique-doux: #3b1517; --boitier: #000;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--fond); color: var(--encre); font-family: var(--f-texte); font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.discret { color: var(--encre-2); }

/* ---------- Barre ---------- */
.barre {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  padding-block: 12px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  border-bottom: 1px solid var(--ligne); background: var(--surface);
}
.marque { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-right: auto; min-width: 0; }
.marque h1 { margin: 0; white-space: nowrap; font-family: var(--f-titre); font-weight: 700; font-size: 26px; letter-spacing: .01em; }
.marque span { color: var(--encre-2); font-size: 13px; }
.mode { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--ligne); background: var(--surface-2); }
.mode i { width: 8px; height: 8px; border-radius: 50%; background: var(--alerte); }
.mode.api i { background: var(--ok); }
.groupe { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.segment { display: inline-flex; border: 1px solid var(--ligne); border-radius: 8px; overflow: hidden; }
.segment button { border: 0; background: var(--surface); padding: 5px 10px; font-size: 13px; }
.segment button + button { border-left: 1px solid var(--ligne); }
.segment button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.btn { border: 1px solid var(--ligne); background: var(--surface); border-radius: 8px; padding: 6px 12px; font-weight: 500; }
.btn:hover { border-color: var(--accent); }
.btn.plein { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { background: var(--critique); border-color: var(--critique); color: #fff; }
.btn.petit { padding: 3px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.bascule { display: none; gap: 8px; padding-block: 10px 0; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.bascule .segment { width: 100%; }
.bascule .segment button { flex: 1; padding: 8px; }

/* ---------- Scène ---------- */
.scene {
  display: grid; grid-template-columns: 384px minmax(0, 1fr); gap: 20px; align-items: start;
  padding-block: 18px 28px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.col-terminal { display: flex; flex-direction: column; gap: 14px; align-items: center; min-width: 0; }
.etiquette { font-family: var(--f-titre); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--encre-2); }

/* ---------- Téléphone ---------- */
.telephone { width: 360px; max-width: 100%; height: 740px; background: var(--boitier); border-radius: 46px; padding: 11px; box-shadow: 0 18px 40px rgba(10, 30, 40, .25); position: relative; }
.ecran { height: 100%; border-radius: 36px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; position: relative; }
.ilot { position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 96px; height: 26px; border-radius: 14px; background: var(--boitier); z-index: 1200; }
.statut { display: flex; justify-content: space-between; align-items: center; padding: 12px 22px 4px; font-size: 12px; font-weight: 600; height: 40px; }
.statut .droite { display: flex; gap: 8px; align-items: center; }
.barres { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.barres b { width: 3px; background: var(--encre); border-radius: 1px; opacity: .25; }
.barres b:nth-child(1) { height: 4px; } .barres b:nth-child(2) { height: 6px; } .barres b:nth-child(3) { height: 8px; } .barres b:nth-child(4) { height: 11px; }
.barres[data-n="1"] b:nth-child(-n+1), .barres[data-n="2"] b:nth-child(-n+2), .barres[data-n="3"] b:nth-child(-n+3), .barres[data-n="4"] b:nth-child(-n+4) { opacity: 1; }
.app-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 16px 10px; border-bottom: 1px solid var(--ligne); }
.app-tete strong { font-family: var(--f-titre); font-size: 20px; font-weight: 700; display: block; line-height: 1.1; }
.app-tete small { color: var(--encre-2); font-size: 12px; }
.canal { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; letter-spacing: .04em; white-space: nowrap; }
.canal.DATA { background: var(--accent-doux); color: var(--accent); }
.canal.SMS { background: var(--alerte-doux); color: var(--alerte); }
.canal.LOCAL { background: var(--surface-2); color: var(--encre-2); border: 1px dashed var(--ligne); }
.vues { flex: 1; position: relative; min-height: 0; }
.vue { position: absolute; inset: 0; overflow-y: auto; display: flex; flex-direction: column; }
.nav { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ligne); padding: 4px 6px 14px; background: var(--surface); }
.nav button { border: 0; background: none; padding: 6px 0 2px; font-size: 11px; color: var(--encre-2); display: flex; flex-direction: column; align-items: center; gap: 2px; position: relative; }
.nav button svg { width: 22px; height: 22px; }
.nav button[aria-current="true"] { color: var(--accent); font-weight: 600; }
.nav .pastille { position: absolute; top: 2px; right: calc(50% - 20px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--critique); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }

.carte { flex: 1; min-height: 0; background: var(--mer); }
.instruments { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ligne); background: var(--surface); }
.instruments div { padding: 7px 10px; }
.instruments div + div { border-left: 1px solid var(--ligne); }
.instruments label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--encre-2); }
.instruments b { font-family: var(--f-mono); font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.coord-ligne { font-family: var(--f-mono); font-size: 11px; padding: 5px 10px; color: var(--encre-2); border-top: 1px solid var(--ligne); display: flex; justify-content: space-between; gap: 6px; background: var(--surface); }
.bouton-sos { position: absolute; right: 12px; bottom: 120px; z-index: 900; width: 62px; height: 62px; border-radius: 50%; border: 3px solid #fff; background: var(--critique); color: #fff; font-family: var(--f-titre); font-weight: 700; font-size: 18px; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.zone-bandeau { position: absolute; left: 10px; right: 84px; top: 10px; z-index: 900; display: flex; flex-wrap: wrap; gap: 4px; pointer-events: none; }
.chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--ligne); color: var(--encre); }
.chip.INTERDITE, .chip.AMP { background: var(--alerte-doux); border-color: var(--alerte); color: var(--alerte); }
.chip.PORT { background: var(--accent-doux); border-color: var(--accent); color: var(--accent); }

.page { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.page h2 { margin: 0; font-family: var(--f-titre); font-size: 22px; font-weight: 700; }
.liste { display: flex; flex-direction: column; gap: 8px; }
.avis { border: 1px solid var(--ligne); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.avis.HAUTE { border-color: var(--critique); background: var(--critique-doux); }
.avis h3 { margin: 0 0 4px; font-size: 15px; }
.avis p { margin: 0 0 6px; }
.avis small { color: var(--encre-2); font-size: 12px; }
.fil { display: flex; flex-direction: column; gap: 6px; flex: 1; overflow-y: auto; padding: 10px 14px; }
.bulle { max-width: 82%; padding: 7px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--ligne); align-self: flex-start; }
.bulle.moi { align-self: flex-end; background: var(--accent-doux); border-color: transparent; }
.bulle.attente { opacity: .65; border-style: dashed; }
.bulle small { display: block; font-size: 11px; color: var(--encre-2); }
.bulle.sms-recu { border-color: var(--alerte); }
.composer { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--ligne); }
.composer input { flex: 1; min-width: 0; border: 1px solid var(--ligne); border-radius: 18px; padding: 7px 12px; background: var(--surface); }
.choix-canal { padding: 8px 10px 0; display: flex; gap: 6px; overflow-x: auto; }
.choix-canal button { white-space: nowrap; border: 1px solid var(--ligne); background: var(--surface); border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.choix-canal button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-doux); font-weight: 600; }

.champ { display: flex; flex-direction: column; gap: 4px; }
.champ label { font-size: 12px; font-weight: 600; color: var(--encre-2); }
.champ input, .champ select, .champ textarea { border: 1px solid var(--ligne); border-radius: 8px; padding: 7px 10px; background: var(--surface); min-width: 0; }
.unites-choix { display: flex; flex-direction: column; gap: 6px; }
.unites-choix label { display: flex; gap: 10px; align-items: center; border: 1px solid var(--ligne); border-radius: 10px; padding: 9px 12px; }
.unites-choix label:has(input:checked) { border-color: var(--accent); background: var(--accent-doux); }
.unites-choix label.desactive { opacity: .5; }

.sos-ecran { align-items: center; text-align: center; }
.anneau { position: relative; width: 190px; height: 190px; margin: 6px auto; }
.anneau svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.anneau button { position: absolute; inset: 18px; border-radius: 50%; border: 0; background: var(--critique); color: #fff; font-family: var(--f-titre); font-size: 34px; font-weight: 700; touch-action: none; user-select: none; -webkit-user-select: none; }
.types { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.types button { border: 1px solid var(--ligne); background: var(--surface); border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.types button[aria-pressed="true"] { border-color: var(--critique); color: var(--critique); background: var(--critique-doux); font-weight: 600; }
.etapes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; text-align: left; width: 100%; }
.etapes li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--ligne); }
.etapes li i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ligne); margin-top: 4px; flex: none; }
.etapes li.fait i { background: var(--ok); border-color: var(--ok); }
.etapes li.encours i { border-color: var(--critique); background: var(--critique); animation: pouls 1s infinite alternate; }

.toasts { position: absolute; left: 10px; right: 10px; top: 46px; z-index: 1100; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast { background: var(--encre); color: var(--surface); padding: 8px 12px; border-radius: 10px; font-size: 13px; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); animation: entree .2s ease-out; }
.toast.alerte { background: var(--alerte); color: #fff; }
.toast.critique { background: var(--critique); color: #fff; }

/* ---------- Pilote du simulateur ---------- */
.pilote { width: 360px; max-width: 100%; background: var(--surface); border: 1px solid var(--ligne); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.pilote .ligne { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pilote .segment { flex-wrap: wrap; }
.journal { font-family: var(--f-mono); font-size: 11.5px; display: flex; flex-direction: column; gap: 2px; max-height: 128px; overflow-y: auto; background: var(--surface-2); border-radius: 8px; padding: 6px 8px; }
.journal span.DATA, .journal span.SYNC { color: var(--accent); }
.journal span.SMS { color: var(--alerte); }
.journal span.LOCAL { color: var(--encre-2); }
.journal span.ERREUR { color: var(--critique); }
.file { display: flex; justify-content: space-between; font-size: 13px; }

/* ---------- Console ---------- */
.console { background: var(--surface); border: 1px solid var(--ligne); border-radius: 14px; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.console-tete { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--ligne); }
.console-tete h2 { margin: 0 auto 0 0; font-family: var(--f-titre); font-size: 22px; font-weight: 700; }
.stats { display: flex; flex-wrap: wrap; gap: 6px; }
.stat { display: flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--ligne); }
.stat b { font-family: var(--f-mono); font-size: 16px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--encre-2); }
.stat.SILENCE b { color: var(--alerte); }
.stat.SOS { border-color: var(--critique); }
.stat.SOS b { color: var(--critique); }
.bandeau-sos { display: flex; flex-direction: column; gap: 1px; background: var(--critique); }
.bandeau-sos > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 16px; color: #fff; background: var(--critique); }
.bandeau-sos > div.ACQUITTE { background: color-mix(in srgb, var(--critique) 70%, #000); }
.bandeau-sos strong { font-family: var(--f-titre); font-size: 19px; letter-spacing: .02em; }
.bandeau-sos .btn { background: #fff; color: var(--critique); border-color: #fff; font-weight: 600; }
.bandeau-sos input { border: 0; border-radius: 6px; padding: 4px 8px; color: #13252d; background: #fff; min-width: 0; width: 160px; }
.bandeau-sos .clignote { width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: pouls .6s infinite alternate; }
.console-corps { display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 640px; }
.console-carte { position: relative; min-height: 640px; background: var(--mer); }
.console-carte .carte { position: absolute; inset: 0; }
.legende { position: absolute; left: 10px; bottom: 10px; z-index: 900; background: var(--surface); border: 1px solid var(--ligne); border-radius: 8px; padding: 6px 10px; font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px 12px; max-width: calc(100% - 20px); }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.panneau { border-left: 1px solid var(--ligne); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.onglets { display: flex; overflow-x: auto; border-bottom: 1px solid var(--ligne); }
.onglets button { border: 0; background: none; padding: 10px 12px; font-size: 13px; color: var(--encre-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.onglets button[aria-selected="true"] { color: var(--encre); border-bottom-color: var(--accent); font-weight: 600; }
.panneau-corps { flex: 1; overflow-y: auto; min-height: 0; max-height: 600px; }
.evt { display: grid; grid-template-columns: 64px 1fr; gap: 2px 10px; padding: 8px 14px; border-bottom: 1px solid var(--ligne); border-left: 3px solid transparent; cursor: pointer; }
.evt:hover { background: var(--surface-2); }
.evt.ALERTE { border-left-color: var(--alerte); }
.evt.CRITIQUE { border-left-color: var(--critique); background: var(--critique-doux); }
.evt time { font-family: var(--f-mono); font-size: 11.5px; color: var(--encre-2); grid-row: span 2; padding-top: 2px; }
.evt b { font-size: 13px; }
.evt span { font-size: 13px; color: var(--encre-2); }
table.unites { width: 100%; border-collapse: collapse; font-size: 13px; }
table.unites th { text-align: left; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--encre-2); padding: 8px 10px; border-bottom: 1px solid var(--ligne); position: sticky; top: 0; background: var(--surface); }
table.unites td { padding: 8px 10px; border-bottom: 1px solid var(--ligne); vertical-align: top; }
table.unites tr { cursor: pointer; }
table.unites tr:hover td, table.unites tr.choisi td { background: var(--surface-2); }
.etat { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; letter-spacing: .03em; }
.etat.EN_MER { background: var(--accent-doux); color: var(--accent); }
.etat.AU_PORT { background: var(--surface-2); color: var(--encre-2); border: 1px solid var(--ligne); }
.etat.SILENCE { background: var(--alerte-doux); color: var(--alerte); }
.etat.SOS { background: var(--critique); color: #fff; }
.etat.SANS_POSITION { color: var(--encre-2); border: 1px dashed var(--ligne); }
.formulaire { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--ligne); }
.formulaire .ligne { display: flex; gap: 8px; flex-wrap: wrap; }
.formulaire .ligne > * { flex: 1; min-width: 120px; }
.sms { padding: 8px 14px; border-bottom: 1px solid var(--ligne); font-size: 12.5px; }
.sms code { font-family: var(--f-mono); font-size: 11.5px; word-break: break-all; display: block; color: var(--encre); margin-top: 2px; }
.sms .sens { font-weight: 700; font-size: 11px; letter-spacing: .05em; }
.sms .sens.ENTRANT { color: var(--accent); }
.sms .sens.SORTANT { color: var(--alerte); }
.fiche { padding: 12px 14px; border-bottom: 1px solid var(--ligne); background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.fiche h3 { margin: 0; font-family: var(--f-titre); font-size: 20px; }
.fiche dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: 13px; }
.fiche dt { color: var(--encre-2); }
.fiche dd { margin: 0; }
.vide { padding: 18px 14px; color: var(--encre-2); font-size: 13px; }
.msg-console { padding: 8px 14px; border-bottom: 1px solid var(--ligne); font-size: 13px; }
.msg-console small { color: var(--encre-2); display: block; font-size: 11.5px; }
.toasts-console { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); top: calc(70px + env(safe-area-inset-top, 0px)); z-index: 2000; display: flex; flex-direction: column; gap: 6px; max-width: min(360px, calc(100vw - 32px)); }

/* ---------- Carte (Leaflet) ---------- */
.leaflet-container { background: var(--mer); font-family: var(--f-texte); }
.leaflet-container path.terre { fill: var(--terre); stroke: var(--terre-trait); fill-opacity: 1; stroke-width: 1; }
.leaflet-container path.grille { stroke: var(--grille); }
.leaflet-container path.z-PORT { stroke: var(--accent); fill: var(--accent); fill-opacity: .14; }
.leaflet-container path.z-INTERDITE { stroke: var(--alerte); fill: var(--alerte); fill-opacity: .12; stroke-dasharray: 6 4; }
.leaflet-container path.z-AMP { stroke: var(--ok); fill: var(--ok); fill-opacity: .10; }
.leaflet-container path.z-PECHE { stroke: var(--encre-2); fill: none; fill-opacity: 0; stroke-dasharray: 2 6; }
.leaflet-container path.trace { stroke: var(--accent); fill: none; }
.leaflet-container path.trace-console { stroke: var(--critique); fill: none; }
.leaflet-container path.route { stroke: var(--encre-2); stroke-dasharray: 4 6; fill: none; }
.leaflet-tooltip.nom-unite { background: var(--surface); color: var(--encre); border: 1px solid var(--ligne); font-size: 11px; font-weight: 600; padding: 1px 6px; box-shadow: none; }
.leaflet-tooltip.nom-unite::before { display: none; }
.leaflet-control-attribution { font-size: 10px; background: color-mix(in srgb, var(--surface) 80%, transparent) !important; color: var(--encre-2); }
.leaflet-control-zoom a { background: var(--surface) !important; color: var(--encre) !important; border-color: var(--ligne) !important; }
.marqueur { width: 26px; height: 26px; display: grid; place-items: center; }
.marqueur svg { width: 26px; height: 26px; overflow: visible; }
.marqueur.SOS::after { content: ''; position: absolute; width: 44px; height: 44px; left: -9px; top: -9px; border-radius: 50%; border: 2px solid var(--critique); animation: onde 1.2s infinite; }

@keyframes pouls { from { opacity: 1; } to { opacity: .35; } }
@keyframes entree { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes onde { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Responsive ---------- */
@media (max-width: 1360px) {
  .console-corps { grid-template-columns: 1fr; }
  .panneau { border-left: 0; border-top: 1px solid var(--ligne); }
  .console-carte { min-height: 460px; }
}
@media (max-width: 1000px) {
  .bascule { display: flex; }
  .scene { grid-template-columns: minmax(0, 1fr); }
  .scene[data-vue="terminal"] .col-console, .scene[data-vue="console"] .col-terminal { display: none; }
}
@media (max-width: 420px) {
  .telephone { height: 680px; border-radius: 40px; padding: 8px; }
  .ecran { border-radius: 32px; }
  .console-carte { min-height: 380px; }
}

/* ---------- Pages séparées ---------- */
.liens { display: flex; gap: 14px; font-size: 13px; }
.liens a { color: var(--accent); text-decoration: none; font-weight: 600; }
.liens a:hover { text-decoration: underline; }
.avert { background: var(--alerte-doux); color: var(--encre); border-bottom: 1px solid var(--alerte); font-size: 13px; padding-block: 8px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.scene-seule { padding-block: 18px 28px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.scene-mobile .col-terminal { max-width: 420px; margin: 0 auto; }
.scene-console .console-corps { min-height: calc(100vh - 190px); }
.scene-console .console-carte { min-height: calc(100vh - 190px); }
.scene-console .panneau-corps { max-height: calc(100vh - 240px); }

.chip-facteur { position: absolute; right: 12px; top: 10px; z-index: 950; min-width: 58px; padding: 6px 10px; border-radius: 999px; border: 2px solid var(--accent); background: var(--surface); color: var(--accent); font-family: var(--f-mono); font-weight: 500; font-size: 14px; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.chip-facteur:active { transform: scale(.96); }
#v-carte .zone-bandeau { right: 84px; }
.option-gps { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--accent); background: var(--accent-doux); border-radius: 10px; padding: 9px 12px; }
.option-gps input { margin-top: 3px; }
.bloc-gps { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--ligne); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); }
.gps-etat { margin: 0; font-weight: 600; font-size: 13px; color: var(--ok); }
.gps-etat.erreur { color: var(--critique); }
.mesures { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; font-size: 12.5px; }
.mesures dt { color: var(--encre-2); }
.mesures dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Sur un vrai téléphone, la page terminal occupe tout l'écran : pas de cadre simulé. */
@media (max-width: 520px) {
  body[data-page="mobile"] .barre-compacte .marque span { display: none; }
  body[data-page="mobile"] .scene-seule { padding: 0; }
  body[data-page="mobile"] .telephone { width: 100%; height: calc(100dvh - 58px); border-radius: 0; padding: 0; box-shadow: none; background: none; }
  body[data-page="mobile"] .ecran { border-radius: 0; }
  body[data-page="mobile"] .ilot, body[data-page="mobile"] .col-terminal > .etiquette { display: none; }
  body[data-page="mobile"] .statut { padding-top: 6px; height: 30px; }
  body[data-page="mobile"] .pilote { width: auto; margin: 12px max(16px, env(safe-area-inset-left, 0px)) 24px; }
}
@media (max-width: 520px) {
  body[data-page="mobile"] .barre-compacte { flex-wrap: nowrap; gap: 10px; padding-block: 8px; }
  body[data-page="mobile"] .barre-compacte h1 { font-size: 22px; }
  body[data-page="mobile"] .barre-compacte .mode span { display: inline-block; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
  body[data-page="mobile"] .barre-compacte .liens a + a { display: none; }
  body[data-page="mobile"] .telephone { height: calc(100dvh - 50px); }
}
