/* Shell-only styles — replace/extend when Stitch + Tailwind lands */
:root {
  --bg: #0b0f14;
  --bg-card: #121821;
  --bg-elevated: #1a222d;
  --text: #e8eef7;
  --muted: #8b98a8;
  --ok: #10b981;
  --warn: #f59e0b;
  --alarm: #e11d48;
  --info: #22d3ee;
  --border: rgba(255, 255, 255, 0.08);
  --app-height: 100dvh;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --tabbar-h: 64px;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: var(--app-height);
}

#app {
  min-height: var(--app-height);
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom));
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 20, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-mark {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-title {
  font-size: 16px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-chip {
  font-size: 11px;
  color: var(--muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main.shell-main {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.field label {
  font-size: 12px;
  color: var(--muted);
}

.field input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  padding: 12px 14px;
  min-height: 44px;
}
.field select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  padding: 12px 14px;
  min-height: 44px;
}

/* Champs du gate d'authentification (déverrouillage / enrôlement). */
.input {
  box-sizing: border-box;
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  padding: 12px 14px;
  min-height: 48px;
  margin: 4px 0;
}
.input:focus {
  outline: none;
  border-color: var(--accent, #3b82f6);
}

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

/* Espace client / profil. */
.profile-dl {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px 12px;
  margin: 0 0 12px;
}
.profile-dl dt {
  color: var(--muted);
  font-size: 13px;
}
.profile-dl dd {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  word-break: break-word;
}

/* Onboarding SoftAP. */
.onboard-steps {
  margin: 0 0 14px;
  padding-left: 20px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}
.onboard-steps li {
  margin: 6px 0;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0;
}
.field span {
  color: var(--muted);
  font-size: 13px;
}
.onboard-recap {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
}
.onboard-recap h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

/* Historique des tirs (admin). */
.shots-filter {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.shots-filter .field {
  flex: 1 1 120px;
  margin: 0;
}
.shots-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}
.shot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  font-size: 14px;
}
.shot-row .shot-time {
  color: var(--muted);
  font-size: 12px;
}
.shot-row .shot-source {
  font-weight: 600;
}

button,
.btn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  min-height: 48px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-panic-silent {
  background: linear-gradient(180deg, #1f2937, #111827);
  border-color: rgba(34, 211, 238, 0.35);
  color: var(--info);
}

.btn-panic-loud {
  background: linear-gradient(180deg, #3f121c, #1f0a10);
  border-color: rgba(225, 29, 72, 0.5);
  color: #fda4af;
}

.btn-ghost {
  background: transparent;
}

#shell-status {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  min-height: 1.2em;
}

#shell-status[data-kind="ok"] {
  color: var(--ok);
}
#shell-status[data-kind="err"] {
  color: var(--alarm);
}
#shell-status[data-kind="pending"] {
  color: var(--warn);
}
#shell-status[data-kind="info"] {
  color: var(--info);
}

/* Stitch drop zone — keep empty structure ready */
#stitch-root {
  /* Stitch export HTML/Tailwind goes here */
  min-height: 0;
}

#stitch-root:empty {
  display: none;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding: 6px 8px var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  background: rgba(12, 16, 22, 0.96);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(10px);
  z-index: 30;
}

.tabbar a {
  text-decoration: none;
  color: var(--muted);
  font-size: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  border-radius: 12px;
}

.tabbar a[aria-current="page"],
.tabbar a.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.tabbar .ico {
  font-size: 16px;
  line-height: 1;
}

.shell-only-note {
  font-size: 12px;
  color: var(--muted);
  border-left: 3px solid var(--info);
  padding-left: 10px;
  margin: 0;
}

/* Utility placeholders for Stitch tokens */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* === audit export / fleet panels === */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#account-type-badge[data-kind="pro"] {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.35);
}

.panel[hidden] {
  display: none !important;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-block {
  width: 100%;
  margin-top: 14px;
}

.btn-primary {
  background: linear-gradient(180deg, #164e63, #0e7490);
  border-color: rgba(34, 211, 238, 0.45);
  color: #ecfeff;
}

.export-format-row {
  margin-top: 10px;
}

.fleet-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.fleet-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  min-height: 48px;
}

.fleet-row input {
  width: 18px;
  height: 18px;
}

.fleet-id {
  font-weight: 650;
  font-size: 14px;
}

.fleet-meta {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}

/* Badge batterie (Phase 4b) — seuils produit : low ≤ 15 %, critical ≤ 5 %. */
.fleet-batt {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.fleet-batt[data-level="ok"] {
  color: var(--ok);
}
.fleet-batt[data-level="low"] {
  color: var(--warn);
  border-color: var(--warn);
}
.fleet-batt[data-level="critical"] {
  color: var(--alarm);
  border-color: var(--alarm);
  animation: batt-blink 1.2s ease-in-out infinite;
}
@keyframes batt-blink {
  50% {
    opacity: 0.45;
  }
}

.status-line {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  min-height: 1.2em;
}
.status-line[data-kind="ok"] { color: var(--ok); }
.status-line[data-kind="err"] { color: var(--alarm); }
.status-line[data-kind="pending"] { color: var(--warn); }
.status-line[data-kind="info"] { color: var(--info); }
.status-line[data-kind="warn"] { color: var(--warn); }

@media (max-width: 380px) {
  .field-row { grid-template-columns: 1fr; }
}

/* ── Mise en service : procédure terrain (2026-09-10) ───────────────────
 * Remplace le scan BLE et l'écriture directe, tous deux impossibles à
 * exécuter (pas de BLE dans le firmware, contenu mixte bloqué). L'écran
 * explique la manipulation réelle au lieu de prétendre l'automatiser. */
.guide-lead {
  margin: 0 0 14px;
  font-size: 0.94rem;
  line-height: 1.45;
  color: var(--text);
}
.field-hint {
  margin: -4px 0 14px;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
}
.field-hint[data-kind="ok"] { color: var(--ok); }
.field-hint[data-kind="warn"] { color: var(--warn); }
.field-hint code,
.guide-steps code,
.onboard-steps code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  /* Un nom de réseau ne doit jamais être coupé en deux lignes : on le lit
     pour le retrouver à l'identique dans les réglages Wi-Fi. */
  white-space: nowrap;
}
.guide-steps {
  counter-reset: guide;
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}
.guide-steps li {
  counter-increment: guide;
  position: relative;
  padding: 0 0 16px 42px;
  border-left: 1px solid var(--border);
  margin-left: 13px;
}
.guide-steps li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}
.guide-steps li::before {
  content: counter(guide);
  position: absolute;
  left: -13px;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--bg);
  background: var(--info);
}
/* Enfants DIRECTS seulement : un <strong> de mise en valeur au fil du texte
   (« 3 secondes ») ne doit pas passer en bloc et casser la phrase. */
.guide-steps li > strong {
  display: block;
  font-size: 0.94rem;
  margin: 3px 0 4px;
}
.guide-steps li > span {
  display: block;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
}
.guide-note {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.guide-note strong {
  display: block;
  font-size: 0.86rem;
  margin-bottom: 6px;
}
.guide-note ul {
  margin: 0;
  padding-left: 18px;
}
.guide-note li {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
  margin-bottom: 5px;
}
.guide-note li:last-child { margin-bottom: 0; }
/* Lien d'action au fil du texte : même cible tactile qu'un bouton. */
.btn-inline-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--info);
  text-decoration: underline;
  cursor: pointer;
}

/* ══ Améliorations 2026-09-10 ═══════════════════════════════════════════ */

/* ── Barre d'onglets ────────────────────────────────────────────────────
 * Les styles .tabbar existaient déjà (grille 5 colonnes, safe-area) mais ne
 * visaient que des <a>. Les onglets sont des <button> — même rendu, sémantique
 * correcte pour une action qui ne navigue pas. */
.tabbar .tab {
  appearance: none;
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 2px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.15;
  text-align: center;
  /* Cible tactile confortable au pouce, quelle que soit la longueur du mot. */
  min-height: 48px;
}
.tabbar .tab .ico {
  font-size: 1.05rem;
  line-height: 1;
}
.tabbar .tab[aria-current="page"] {
  color: var(--text);
  background: var(--bg-elevated);
}

/* ── Pastille de flux temps réel ────────────────────────────────────── */
.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  color: var(--muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px 2px 7px;
  white-space: nowrap;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.live-chip[data-state="live"] { color: var(--ok); }
.live-chip[data-state="live"] .live-dot {
  background: var(--ok);
  animation: live-pulse 2s ease-in-out infinite;
}
.live-chip[data-state="connecting"] .live-dot,
.live-chip[data-state="retrying"] .live-dot { background: var(--warn); }
.live-chip[data-state="retrying"] { color: var(--warn); }
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
@media (prefers-reduced-motion: reduce) {
  .live-chip[data-state="live"] .live-dot { animation: none; }
}

/* Ligne de flotte qui vient d'être rafraîchie par le flux : un signal bref,
   sinon l'écran change sous les yeux sans qu'on sache d'où ça vient. */
.fleet-row.row-pulse {
  animation: row-pulse 0.9s ease-out;
}
@keyframes row-pulse {
  0% { background: rgba(34, 211, 238, 0.16); }
  100% { background: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .fleet-row.row-pulse { animation: none; }
}
.fleet-state {
  font-size: 0.72rem;
  color: var(--muted);
}

/* ── Bandeau réseau ─────────────────────────────────────────────────── */
.net-banner {
  margin: 0 12px 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.78rem;
  line-height: 1.4;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
}
.net-banner[data-mode="offline"] { border-color: rgba(245, 158, 11, 0.45); }
.net-banner[data-mode="no-api"] { border-color: rgba(34, 211, 238, 0.4); }

/* ── Appui maintenu ─────────────────────────────────────────────────────
 * La jauge est un dégradé piloté par --hold, mis à jour à chaque frame par
 * bindHoldToFire. Pas d'élément supplémentaire : le bouton EST la jauge. */
.hold-btn,
[data-action="panic-loud"] {
  position: relative;
  overflow: hidden;
  touch-action: none; /* le maintien ne doit pas faire défiler la page */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.hold-btn::after,
[data-action="panic-loud"]::after {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--hold, 0%);
  background: rgba(255, 255, 255, 0.22);
  pointer-events: none;
  transition: width 60ms linear;
}
.hold-btn.holding,
[data-action="panic-loud"].holding {
  transform: scale(0.985);
}
.hold-btn.armed,
[data-action="panic-loud"].armed {
  outline: 2px solid var(--warn);
  outline-offset: 2px;
}

/* ── Notifications & invitation ─────────────────────────────────────── */
.push-row {
  margin: 14px 0 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.push-row h3 {
  margin: 0 0 6px;
  font-size: 0.88rem;
}
.invite-link {
  margin: 0 0 6px;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  /* Un lien long doit rester lisible en entier plutôt que déborder. */
  word-break: break-all;
}

/* ── Rappel de cible (écran Commandes) ──────────────────────────────────
 * Depuis que Commandes est une vue à part, la liste des boîtiers n'est plus
 * à l'écran : le nom de la cible doit rester visible en permanence au-dessus
 * des ordres. Non repliable, volontairement. */
.cmd-target {
  margin: -2px 0 14px;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.cmd-target-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cmd-target-label {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.25;
  /* Un nom long ne doit pas repousser le bouton hors de l'écran. */
  min-width: 0;
  overflow-wrap: anywhere;
}
.cmd-target-switch {
  appearance: none;
  flex: none;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--info);
  background: transparent;
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 999px;
  padding: 7px 12px;
  min-height: 36px;
  cursor: pointer;
}
.cmd-target-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 7px;
}
.cmd-target-state {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
/* État jamais reçu : on le dit, on ne laisse pas croire à une valeur fraîche. */
.cmd-target-state[data-known="0"] {
  color: var(--warn);
  font-weight: 500;
  font-style: italic;
}
.cmd-target-id {
  font-size: 11px;
  color: var(--muted);
}

/* ── Boutons pleine largeur dans une rangée à deux colonnes ─────────────
 * .btn-row est une grille 2 colonnes, et chaque commande du bloc Alarme /
 * Dissuasion / Panique est seule dans sa propre .btn-row : `width: 100%` de
 * .btn-block valait donc 100 % d'UNE colonne. Résultat, des boutons à
 * mi-largeur collés à gauche, avec du vide à droite — y compris « PANIQUE
 * SONORE ». Un bouton déclaré pleine largeur occupe désormais les deux
 * colonnes ; les vraies rangées de deux (Fermer / Se déconnecter) ne portent
 * pas .btn-block et gardent leur disposition. */
.btn-row > .btn-block {
  grid-column: 1 / -1;
}

/* Modale générique (passkeys : renommer / supprimer) */
.leo-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.6);
}
.leo-modal[hidden] { display: none; }
.leo-modal-card { width: 100%; max-width: 420px; background: var(--bg-elevated); }
.leo-modal .btn-danger, .leo-modal #leo-modal-ok.danger { background: var(--alarm); color: #fff; }

/* ── Feuille de confirmation Face ID (step-up) ───────────────────────── */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  padding: 16px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.sheet[hidden] { display: none; }
.sheet-card { width: 100%; max-width: 480px; }
[data-trigger-action="STOP"] { touch-action: manipulation; }
[data-trigger-action="STOP"].stop-armed { outline: 2px solid var(--alarm); outline-offset: 2px; }

/* ── Retour (sous-écrans) ──────────────────────────────────────────────── */
.btn-back {
  background: none;
  border: 0;
  color: var(--info);
  font: inherit;
  font-size: 16px;
  padding: 8px 8px 8px 0;
  min-height: 44px;
  cursor: pointer;
}
.btn-back[hidden] { display: none; }
.btn-back:disabled { opacity: 0.4; }

/* ── iOS : défilement, zoom et zones sûres ─────────────────────────────── */
html,
body {
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}
#app { padding-top: 0; }
.app-header {
  padding-top: calc(12px + var(--safe-top));
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
#main, .shell-main { overscroll-behavior-y: contain; }
#auth-gate {
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.leo-modal {
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
input, select, textarea { font-size: 16px; }
.tabbar { grid-template-columns: repeat(var(--tab-count, 5), 1fr); }
/* « display: grid » de .tabbar l'emportait sur l'attribut hidden : la barre
   d'onglets restait visible (et cliquable) sous l'écran Face ID, sans session. */
.tabbar[hidden], .tabbar .tab[hidden] { display: none !important; }
[data-view][hidden], [data-panel][hidden] { display: none !important; }
#shell-env[data-env="beta"] { color: var(--warn); border-color: var(--warn); }
.update-toast {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 8px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.update-toast[hidden] { display: none; }

/* ── En-tête compact sur iPhone ────────────────────────────────────────── */
@media (max-width: 480px) {
  #shell-user,
  .app-header .brand-mark { display: none; }
  .app-header .header-right { gap: 6px; flex-wrap: nowrap; min-width: 0; }
  .app-header .meta-chip { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
