/**
 * Alfred PWA — Styles Exécutifs Séquence République
 * Palette souveraine : Bleu Nuit, Bleu France, Or Exécutif, Rouge Marianne
 */

:root {
  --bg-primary: #070b14;
  --bg-surface: #0f172a;
  --bg-card: #141e33;
  --bg-card-hover: #1b2845;
  --border-subtle: #1e293b;
  --border-accent: #2e3e5e;

  --color-primary: #2563eb;
  --color-primary-glow: rgba(37, 99, 235, 0.25);
  --color-gold: #f59e0b;
  --color-gold-glow: rgba(245, 158, 11, 0.2);
  --color-red: #ef4444;
  --color-green: #10b981;
  --color-bleu-france: #000091;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  /* Texte atténué : au moins 4,5:1 sur tous les fonds, cartes survolées ou non lues comprises
     (#7f8ea6 tombait à 4,4:1 sur --bg-card-hover ; l'ancien #64748b faisait 3,7:1) */
  --text-dim: #8a99b0;
  --text-link: #60a5fa;
  --color-danger: #ef4444;
  /* Fond des pastilles de compteur : texte blanc à 4,8:1 (le rouge #ef4444 ne donnait que 3,8:1) */
  --color-pastille: #dc2626;
  --text-danger: #f87171;

  /* Charte (lot 1, audit UX du 10/10/2026) : échelle typographique, espacements, cible tactile */
  --fs-xs: 0.8125rem;  /* 13 px : métadonnées, jamais moins */
  --fs-sm: 0.875rem;   /* 14 px : textes secondaires, boutons */
  /* Texte à lire : fluide, 16 px sur téléphone (plancher), 18 px sur grand écran (plafond, vu de plus loin) */
  --fs-md: clamp(1rem, 0.94rem + 0.3vw, 1.125rem);
  --fs-lg: 1.125rem;   /* 18 px : titres de carte */
  --fs-xl: 1.375rem;   /* 22 px : titres de page */
  --lh-texte: 1.6;
  --e1: 4px;
  --e2: 8px;
  --e3: 12px;
  --e4: 16px;
  --e5: 24px;
  --e6: 32px;
  --cible: 48px; /* Standard ergonomique mobile pouce adulte (WCAG 2.5.5 / 2.5.8) */
  --duree: 160ms;
  --courbe: cubic-bezier(0.2, 0.8, 0.2, 1);

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;

  --header-height: 64px;
  --footer-min-height: 68px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-pill: 9999px;

  --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);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  /* 100 % : la taille choisie par l'utilisateur dans son navigateur ou son téléphone est respectée (RGAA 10.4) */
  font-size: 100%;
  line-height: 1.5;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
}

button, .icon-btn, .action-btn, .prompt-chip, .mails-onglet, .nav-tab {
  touch-action: manipulation;
}

.chat-container,
.mails-liste,
.notif-list,
.status-modal-body,
.suivi-contenu {
  overscroll-behavior-y: contain;
}

/* Texte à lire, à copier : sélectionnable (le reste de l'interface ne l'est pas, pour éviter les sélections au toucher) */
.markdown-content,
.mail-detail-entete,
.mail-detail-texte,
.mail-bref,
.mail-a-retenir,
.mail-assistant-reponse,
.notif-item-titre,
.notif-item-texte,
.fiche-entete,
.fiche-resume,
.fiche-fait-enonce,
.fiche-fait-extrait,
.contact-fiche,
.contact-import-resultat,
.visionneuse-texte {
  user-select: text;
  -webkit-user-select: text;
}

/* Focus au clavier (PC) */
:focus-visible {
  outline: 2px solid var(--text-link);
  outline-offset: 2px;
}

/* ==============================================================================
   HEADER EXÉCUTIF
   ============================================================================== */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--header-height) + var(--safe-top));
  padding-top: var(--safe-top);
  padding-left: max(16px, var(--safe-left));
  padding-right: max(16px, var(--safe-right));
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-container {
  position: relative;
  width: 42px;
  height: 42px;
}

.avatar-core {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gold);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.crest-icon {
  width: 22px;
  height: 22px;
}

.status-indicator {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}

/* Mascotte : pas de point quand tout va bien, seulement en cas d'attente ou de coupure */
.avatar-container .status-indicator.online {
  display: none;
}

.status-indicator.online {
  background-color: var(--color-green);
  box-shadow: 0 0 8px var(--color-green);
}

.status-indicator.busy {
  background-color: var(--color-gold);
  box-shadow: 0 0 8px var(--color-gold);
}

.status-indicator.offline {
  background-color: var(--color-red);
}

.identity-info {
  display: flex;
  flex-direction: column;
}

.assistant-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

/* État du réseau ou de l'assistant : affiché seulement en cas de problème */
.etat-alerte {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--e2);
}

.header-status-pill {
  width: auto !important;
  min-width: unset !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 12px;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
}

.header-status-pill .status-indicator {
  position: static;
  width: 8px;
  height: 8px;
  border: none;
  flex-shrink: 0;
}

.status-label-short {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-main);
}

.icon-btn {
  position: relative;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  width: var(--cible);
  height: var(--cible);
  min-width: var(--cible);
  min-height: var(--cible);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:active {
  background: var(--bg-card);
  color: var(--text-main);
  transform: scale(0.95);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.push-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--color-gold);
}

.version-line {
  margin-top: 8px;
  font-size: var(--fs-xs);
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.update-banner {
  /* Sous l'en-tête fixe, comme la bannière hors ligne */
  position: fixed;
  top: calc(var(--header-height) + var(--safe-top));
  left: 0;
  right: 0;
  z-index: 95;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: #422006;
  border-bottom: 1px solid var(--color-gold);
  color: #fef3c7;
  font-size: 0.88rem;
}

.update-btn {
  flex-shrink: 0;
  background: var(--color-gold);
  color: #111;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-weight: 700;
  cursor: pointer;
}

.notif-count {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background-color: var(--color-pastille);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.125rem;
  text-align: center;
}

/* ==============================================================================
   BANNIÈRE SYNCHRO HORS-LIGNE
   ============================================================================== */
.sync-banner {
  position: fixed;
  top: calc(var(--header-height) + var(--safe-top));
  left: 0;
  right: 0;
  background: #78350f;
  color: #fef3c7;
  font-size: var(--fs-xs);
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 90;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ==============================================================================
   ZONE DE CHAT & MESSAGERIE
   ============================================================================== */
.chat-container {
  position: absolute;
  top: calc(var(--header-height) + var(--safe-top));
  bottom: calc(var(--footer-min-height) + 56px + var(--safe-bottom));
  left: 0;
  right: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px max(16px, var(--safe-left)) 16px max(16px, var(--safe-right));
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.chat-history {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: popIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: text;
  -webkit-user-select: text;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

.bubble-body {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  font-size: var(--fs-md);
  line-height: 1.55;
  overflow-wrap: break-word;
}

.bubble-body p:not(:last-child) {
  margin-bottom: 8px;
}

.bubble-body strong {
  color: #fff;
  font-weight: 600;
}

.bubble-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.bubble-body pre {
  background: #090d16;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin: 8px 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* Message Utilisateur */
.user-message {
  align-self: flex-end;
}

.user-message .bubble-body {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 16px var(--color-primary-glow);
}

.user-message .bubble-header {
  justify-content: flex-end;
}

/* Message Alfred (assistant-message : réponses rechargées depuis l'historique) */
.alfred-message,
.assistant-message {
  align-self: flex-start;
}

.alfred-message .bubble-body,
.assistant-message .bubble-body {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  color: var(--text-main);
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Métriques de temps de réponse et moteur (P1-HIST-01) */
.bubble-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

.latency-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: #94a3b8;
}

.latency-badge.fast {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.25);
}

.latency-badge.standard {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.25);
}

/* Carte d'accueil intro */
.intro-card {
  max-width: 100%;
}

.intro-card .bubble-body {
  background: linear-gradient(180deg, #14203a, #0d1527);
  border: 1px solid #233559;
}

/* Cartes de suggestions d'actions */
.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* Icônes au trait de la planche commune (index.html) */
.planche-icones {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ic {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.2em;
}

/* Couleur de sens pour quelques icônes d'état */
.ic--ok { color: var(--color-green); }
.ic--erreur, .ic--urgent { color: var(--color-red); }
.ic--alerte { color: var(--color-gold); }
.ic--etoile { color: var(--color-gold); fill: currentColor; }

.prompt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.prompt-chip:active {
  background: rgba(37, 99, 235, 0.3);
  color: #ffffff;
  transform: scale(0.96);
}

/* Statuts d'étapes d'outils (Tool Calling live) */
.tool-step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-accent);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  color: var(--color-gold);
  margin-bottom: 8px;
}

.tool-spinner {
  width: 10px;
  height: 10px;
  border: 2px solid var(--color-gold);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Carte d'Arbitrage Interactive */
.arbitrage-card {
  background: #101c36;
  border: 1px solid #3b82f6;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 10px;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}

.arbitrage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.arbitrage-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}

.arbitrage-amount {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--color-gold);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.arbitrage-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.arbitrage-actions {
  display: flex;
  gap: 10px;
}

.btn-approve {
  flex: 1;
  background: #059669;
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-approve:active {
  background: #047857;
  transform: scale(0.97);
}

.btn-reject {
  flex: 1;
  background: #dc2626;
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-reject:active {
  background: #b91c1c;
  transform: scale(0.97);
}

/* Image dans la bulle */
.bubble-image {
  max-width: 100%;
  max-height: 280px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Curseur clignotant lors du streaming SSE */
.streaming-cursor::after {
  content: "▋";
  color: var(--text-link);
  animation: blink 0.8s infinite;
  margin-left: 2px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ==============================================================================
   DRAWER APERÇU PHOTO AVANT ENVOI
   ============================================================================== */
.attachment-preview-drawer {
  position: fixed;
  bottom: calc(var(--footer-min-height) + var(--safe-bottom) + 8px);
  left: 16px;
  right: 16px;
  max-width: 760px;
  margin: 0 auto;
  z-index: 80;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.preview-card {
  background: #111a2f;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.preview-card img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.preview-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.preview-filename {
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.preview-status {
  font-size: var(--fs-xs);
  color: #60a5fa;
}

.remove-preview-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
}

/* Inputs fichiers strictement masqués */
.hidden-file-input,
input[type="file"] {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  left: -9999px !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ==============================================================================
   FOOTER & BARRE D'ACTION MOBILE
   ============================================================================== */
.app-footer {
  position: fixed;
  bottom: calc(56px + var(--safe-bottom));
  left: 0;
  right: 0;
  min-height: var(--footer-min-height);
  padding-bottom: 8px;
  padding-left: max(8px, var(--safe-left));
  padding-right: max(8px, var(--safe-right));
  padding-top: 8px;
  background: rgba(11, 17, 32, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  z-index: 100;
}

.input-bar {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--e2);
}

.action-btn {
  width: var(--cible);
  height: var(--cible);
  min-width: var(--cible);
  min-height: var(--cible);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-accent);
  background: var(--bg-card);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}

.action-btn:active {
  transform: scale(0.92);
}

.action-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.camera-btn:active, .file-btn:active {
  background: var(--bg-card-hover);
  color: #fff;
}

/* Champ texte extensible */
.textarea-wrapper {
  flex: 1;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  transition: border-color 0.2s ease;
}

.textarea-wrapper:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-glow);
}

#chat-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 1rem;
  resize: none;
  max-height: 100px;
  line-height: 1.4;
  touch-action: manipulation;
}

#chat-input::placeholder {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* Dictée Vocale avec Animation d'Écoute */
.mic-btn.listening {
  background: var(--color-red);
  color: #fff;
  border-color: #f87171;
  animation: pulseMic 1.2s infinite;
}

@keyframes pulseMic {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  70% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Bouton d'Envoi */
.send-btn {
  background: var(--color-primary);
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 10px var(--color-primary-glow);
}

.send-btn:active {
  background: #1d4ed8;
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==============================================================================
   MODAL SYSTÈME & PARAMÈTRES
   ============================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 400; /* Au-dessus de la bottom-nav (300) sur écran large */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: #0f172a;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.6);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.125rem;
  cursor: pointer;
  width: var(--cible);
  height: var(--cible);
  min-width: var(--cible);
  min-height: var(--cible);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.info-group label {
  display: block;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.info-group p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.primary-btn {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 6px;
}

/* Page Notifications */
.notif-card {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px - var(--safe-top) - var(--safe-bottom));
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.notif-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.notif-item.non-lue {
  border-left-color: var(--color-gold);
  background: var(--bg-card-hover);
}

.notif-item.urgent {
  border-left-color: var(--color-danger);
}

.notif-item.cliquable {
  cursor: pointer;
}

.notif-niveau {
  font-size: var(--fs-xs);
  margin-right: 4px;
}

.notif-outils {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.notif-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.notif-action {
  background: transparent;
  border: 1px solid var(--border-accent);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: var(--fs-xs);
  cursor: pointer;
}

.notif-action:disabled {
  opacity: 0.5;
}

.notif-item-entete {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.notif-item-titre {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.notif-item-date {
  flex-shrink: 0;
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

.notif-item-texte {
  font-size: 0.88rem;
  color: var(--text-muted);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.notif-annuler {
  margin-top: 8px;
  background: transparent;
  color: var(--color-gold);
  border: 1px solid var(--color-gold);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.notif-annuler:disabled {
  opacity: 0.5;
}

.notif-resultat {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.notif-vide {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  padding: 20px 0;
}

/* ==============================================================================
   TOAST NOTIFICATIONS
   ============================================================================== */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + var(--safe-top) + 12px);
  right: 16px;
  left: 16px;
  max-width: 400px;
  margin: 0 auto;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #1e293b;
  border: 1px solid var(--border-accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  animation: toastIn 0.25s ease;
  pointer-events: auto;
}

.toast.success {
  border-color: var(--color-green);
}

.toast.error {
  border-color: var(--color-red);
}

@keyframes toastIn {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.hidden {
  display: none !important;
}

/* ==============================================================================
   PAGE ANNUAIRE TERRITORIAL & FICHES ÉVOLUTIVES
   ============================================================================== */
/* ==============================================================================
   PAGE CONTACTS (0.19.0) : listes, cartes, fiche, correction, import d'un carnet (docs/CONTACTS.md § 5)
   La page reprend la structure de la page Mails (.mails-card, .mails-vue, .mails-recherche, .mails-filtre).
   ============================================================================== */
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.contacts-compteur {
  margin-left: 5px; /* la pastille est en inline-flex : l'espace du texte ne compte pas */
  font-weight: 600;
  opacity: 0.85;
}

/* Barre d'actions : Importer un carnet, Exporter (.vcf), même taille, même forme */
.contacts-outils {
  display: flex;
  gap: var(--e2);
  flex-shrink: 0;
}

.contacts-outils .mail-outil {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--e1);
  text-decoration: none;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}

.contacts-info {
  margin: var(--e4) 0;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-md);
  line-height: var(--lh-texte);
}

/* Carte d'un contact : tout le corps ouvre la fiche ; 📞 et ✉️ sont des cibles de 44 px à part */
.contact-item {
  display: flex;
  align-items: center;
  gap: var(--e2);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--e1) var(--e2) var(--e1) var(--e3);
  min-height: 56px;
}

.contact-item.ecarte {
  opacity: 0.7;
}

.contact-item-corps {
  flex: 1;
  min-width: 0;
  min-height: var(--cible);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: var(--e1) 0;
  background: transparent;
  border: 0;
  color: var(--text-main);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.contact-item-corps:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.contact-item-nom {
  font-size: var(--fs-md);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.contact-item-detail {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.contact-marque {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.4;
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  margin-left: 6px;
  vertical-align: 2px;
  border: 1px solid transparent;
}

.contact-marque.a-valider {
  background: var(--color-gold-glow);
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.45);
}

.contact-marque.ecarte,
.contact-marque.neutre {
  background: var(--bg-card-hover);
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

.contact-item-actions {
  display: flex;
  gap: var(--e1);
  flex-shrink: 0;
}

.contact-item-actions a {
  width: var(--cible);
  height: var(--cible);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  font-size: 1.125rem;
  text-decoration: none;
  color: var(--text-main);
}

.contact-item-actions a:active,
.contact-item-actions a:hover {
  background: var(--bg-card-hover);
}

/* Fiche d'un contact */
.contact-fiche {
  display: flex;
  flex-direction: column;
  gap: var(--e3);
}

.contact-fiche-role {
  margin: 0;
  font-size: var(--fs-md);
  line-height: var(--lh-texte);
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.contact-fiche-marques {
  display: flex;
  flex-wrap: wrap;
  gap: var(--e1);
}

.contact-fiche-marques .contact-marque {
  margin-left: 0;
}

.contact-coordonnees {
  display: flex;
  flex-direction: column;
  gap: var(--e2);
}

.contact-coordonnee {
  display: flex;
  align-items: center;
  gap: var(--e2);
  min-height: var(--cible);
  padding: var(--e1) var(--e3);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-link);
  text-decoration: none;
  font-size: var(--fs-md);
  overflow-wrap: anywhere;
}

.contact-coordonnee:active,
.contact-coordonnee:hover {
  background: var(--bg-card-hover);
}

.contact-fiche-texte {
  margin: 0;
  font-size: var(--fs-md);
  line-height: var(--lh-texte);
  color: var(--text-main);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.contact-fiche-texte.vide {
  color: var(--text-muted);
}

.contact-sources {
  margin: 0;
  padding-left: 20px;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--text-muted);
}

.contact-fiche-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--e2);
  padding-top: var(--e2);
  border-top: 1px solid var(--border-subtle);
}

.contact-fiche-actions .primary-btn,
.contact-fiche-actions .secondary-btn {
  flex: 1 1 45%;
  min-width: 0;
  white-space: normal;
  text-align: center;
}

/* Écrans étroits (360 px) : un bouton par ligne, rien ne déborde */
@media (max-width: 380px) {
  .contact-fiche-actions .primary-btn,
  .contact-fiche-actions .secondary-btn {
    flex-basis: 100%;
  }
}

.contact-fiche-note {
  align-self: flex-start;
}

/* Formulaires (correction, import) : mêmes champs que Confier une tâche, en 16 px (aucun zoom sur mobile) */
.contact-formulaire {
  margin-top: 0;
}

.contact-formulaire input,
.contact-formulaire select,
.contact-formulaire textarea {
  font-size: var(--fs-md);
  min-height: var(--cible);
}

.contact-formulaire textarea {
  min-height: 72px;
  resize: vertical;
}

/* Import d'un carnet */
.contact-import {
  display: flex;
  flex-direction: column;
  gap: var(--e3);
}

.contact-import-fichier {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.contact-import-choix {
  display: flex;
  align-items: center;
  gap: var(--e2);
  flex-wrap: wrap;
}

.contact-import-nom {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  overflow-wrap: anywhere;
  min-width: 0;
}

.contact-import-resultat {
  display: flex;
  flex-direction: column;
  gap: var(--e3);
}

.contact-import-compteurs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--e2);
}

.contact-import-compteur {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--e2);
  text-align: center;
}

.contact-import-compteur strong {
  display: block;
  font-size: var(--fs-xl);
  line-height: 1.2;
}

.contact-import-compteur span {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.contact-import-compteur.nouveau strong {
  color: var(--color-green);
}

.contact-import-compteur.complete strong {
  color: var(--text-link);
}

.contact-import-compteur.ambigu strong {
  color: var(--color-gold);
}

.contact-import-lignes {
  display: flex;
  flex-direction: column;
  gap: var(--e1);
}

.contact-import-ligne {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--e2) var(--e3);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.contact-import-ligne.nouveau {
  border-left-color: var(--color-green);
}

.contact-import-ligne.complete {
  border-left-color: var(--color-primary);
}

.contact-import-ligne.ambigu {
  border-left-color: var(--color-gold);
  background: rgba(245, 158, 11, 0.08);
}

.contact-import-ligne.identique,
.contact-import-ligne.ignore {
  opacity: 0.8;
}

.contact-import-ligne-nom {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.contact-import-ligne-decision {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 4px;
}

.contact-import-ligne.ambigu .contact-import-ligne-decision {
  color: #fde68a;
}

.contact-import-ligne-detail {
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.contact-import-autres summary {
  min-height: var(--cible);
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.contact-import-autres[open] summary {
  margin-bottom: var(--e2);
}

/* ==============================================================================
   MODAL DE NOTE RELATIONNELLE ÉVOLUTIVE
   ============================================================================== */
.note-modal-card {
  max-width: 500px;
  width: 100%;
}

.note-modal-subtitle {
  font-size: var(--fs-xs);
  color: var(--color-gold);
  display: block;
}

.note-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notes-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  display: block;
}

.existing-notes-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  max-height: 140px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.existing-notes-content {
  font-size: 0.82rem;
  color: #fde68a;
  white-space: pre-line;
  line-height: 1.4;
}

.new-note-wrapper textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 10px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  min-height: 90px;
  outline: none;
  box-sizing: border-box;
}

.new-note-wrapper textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-glow);
}

.note-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.secondary-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

/* ==============================================================================
   MODAL ÉTAT DES CONNEXIONS & DIAGNOSTICS SOUVERAINS
   ============================================================================== */
.status-badge-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-green);
  border: 1.5px solid var(--bg-surface);
  transition: background-color 0.2s ease;
}

.status-badge-dot.warning {
  background-color: var(--color-gold);
  box-shadow: 0 0 6px var(--color-gold-glow);
}

.status-badge-dot.error {
  background-color: var(--color-red);
}

.status-modal-card {
  max-width: 720px;
  max-height: calc(100vh - 40px - var(--safe-top) - var(--safe-bottom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.status-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-header-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(15, 23, 42, 0.9));
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-link);
  flex-shrink: 0;
}

.status-modal-subtitle {
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

.status-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.status-last-check {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.status-refresh-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.status-refresh-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--color-primary);
}

.status-refresh-btn.refreshing svg {
  animation: spinRefresh 1s linear infinite;
}

@keyframes spinRefresh {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.status-modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.status-category {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-category-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.status-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.status-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s ease;
}

.status-card.online {
  border-left-color: var(--color-green);
}

.status-card.warning {
  border-left-color: var(--color-gold);
}

.status-card.offline {
  border-left-color: var(--color-red);
}

.status-card.checking {
  border-left-color: var(--color-primary);
}

.status-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.status-card-title-group {
  display: flex;
  flex-direction: column;
}

.status-card-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.status-card-url {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.status-pill {
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.status-pill.status-online {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill.status-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-pill.status-offline {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-pill.status-checking {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.status-card-detail {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 2px;
}

/* ==============================================================================
   CONNEXION ÉPURÉE LA SUITE NUMÉRIQUE (08/10/2026)
   ============================================================================== */
.suite-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 6px;
  padding: 12px 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
}

.suite-status-banner.hidden {
  display: none !important;
}

.suite-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.suite-banner-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.suite-banner-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: #10b981;
}

.suite-banner-detail {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin: 0;
}

.suite-renew-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: var(--fs-xs);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.suite-renew-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: var(--border-accent);
}

.suite-reconnexion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0 6px;
  padding: 14px;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.suite-reconnexion.hidden {
  display: none !important;
}

.suite-reconnexion-info h3 { margin: 0 0 4px; font-size: 1rem; color: var(--text-main); }
.suite-reconnexion-info p { margin: 0; font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }
.nav-suite-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  justify-content: center;
  align-items: stretch;
  background: rgba(2, 6, 23, 0.92);
  padding: var(--safe-top) 0 env(safe-area-inset-bottom, 0px);
}
.nav-suite-backdrop.hidden { display: none; }
.nav-suite-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface);
}
.nav-suite-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}
.nav-suite-ecran {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: #ffffff;
}
.nav-suite-ecran img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  touch-action: manipulation;
  user-select: none;
}

.nav-suite-actions-rapides {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-suite-action-pill {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  user-select: none;
}

.nav-suite-action-pill:active {
  transform: scale(0.96);
  background: var(--bg-card-hover);
}

#btn-nav-suite-coller-code {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(16, 185, 129, 0.25));
  border-color: var(--color-primary);
  color: #93c5fd;
}

.nav-suite-saisie {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  align-items: center;
}

.nav-suite-saisie input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-accent);
  background: #070b14;
  color: var(--text-main);
  font-size: 1rem; /* évite le zoom auto sur smartphone */
  outline: none;
}

.nav-suite-saisie input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-glow);
}

.nav-suite-saisie button {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.nav-suite-mdp {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-top: 2px solid var(--color-primary);
  background: var(--bg-card);
}
.nav-suite-mdp.hidden { display: none; }
.nav-suite-mdp p { margin: 0; color: var(--text-main); font-weight: 600; }
.nav-suite-mdp input[type="email"], .nav-suite-mdp input[type="password"] {
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-accent);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 1rem;
}
.nav-suite-mdp label { font-size: 0.85rem; color: var(--text-muted); display: flex; gap: 6px; align-items: center; }


/* ==============================================================================
   PAGE MAILS (lecture seule, mémoire documentaire)
   ============================================================================== */
.mails-card {
  display: flex;
  flex-direction: column;
  max-width: 640px;
  height: calc(100vh - 40px - var(--safe-top) - var(--safe-bottom));
  height: calc(100dvh - 40px - var(--safe-top) - var(--safe-bottom));
  padding: 16px;
}

@media (min-width: 768px) {
  .mails-card {
    max-width: 820px;
    width: 90vw;
  }
}

.mails-card .modal-header {
  gap: 8px;
  margin-bottom: 10px;
}

.mails-card .modal-header h2 {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mails-corps {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.mails-vue {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--e3);
}

.mails-vue.hidden {
  display: none;
}

.mails-recherche {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 10px 12px;
  font-size: 1rem; /* évite le zoom automatique sur mobile */
}

.mails-filtres {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mails-filtre {
  background: transparent;
  border: 1px solid var(--border-accent);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: var(--fs-xs);
  cursor: pointer;
}

.mails-filtre.actif {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.mails-liste {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Fiche d'un mail : importance, « En bref », « À retenir », Demander à Alfred */
.mail-important {
  font-size: 0.85rem;
  color: var(--color-gold);
  margin: 8px 0;
}

.mail-bref p {
  margin: 4px 0;
  font-size: 0.9rem;
  color: var(--text-main);
}

.mail-a-retenir {
  margin: 4px 0 10px;
  padding-left: 4px;
  list-style: none;
  font-size: 0.88rem;
  color: var(--text-main);
}

.mail-a-retenir li {
  margin: 4px 0;
  overflow-wrap: anywhere;
}

.mail-assistant {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.mail-assistant-boutons,
.mail-assistant-question {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mail-assistant-question input {
  flex: 1 1 180px;
  min-width: 0;
}

.mail-assistant button {
  background: transparent;
  border: 1px solid var(--border-accent);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.85rem;
  cursor: pointer;
}

.mail-assistant button:disabled {
  opacity: 0.5;
}

.mail-assistant-reponse {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  color: var(--text-main);
  background: var(--bg-card-hover);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.mail-item {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: var(--text-main);
  cursor: pointer;
  font: inherit;
}

.mail-item:hover,
.mail-item:focus-visible {
  background: var(--bg-card-hover);
}

.mail-item.actif-selection {
  border-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.15);
  box-shadow: inset 3px 0 0 var(--color-primary);
}

.mail-item.ecarte {
  opacity: 0.7;
}

.mail-item-entete {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.mail-item-expediteur {
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.mail-item-date {
  flex-shrink: 0;
  color: var(--text-dim);
}

.mail-item-objet {
  font-size: 0.92rem;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.mail-item-apercu {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-item-meta {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

.mails-suite {
  background: transparent;
  border: 1px dashed var(--border-accent);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
}

.mail-detail-entete {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
  overflow-wrap: anywhere;
}

.mail-detail-entete strong {
  color: var(--text-main);
}

/* Texte d'un mail : nettoyé avant affichage (nettoyerTexteMail : espaces spéciales et invisibles, suites d'espaces
   au milieu des lignes) ; pre-wrap garde les paragraphes et l'indentation. Audit UX § 2.1. */
.mail-detail-texte {
  font-size: var(--fs-md);
  line-height: var(--lh-texte);
  color: var(--text-main);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
  tab-size: 2;
  text-align: start;
}

.mail-detail-note {
  font-size: var(--fs-xs);
  color: var(--color-gold);
}

.mail-section-titre {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-top: 4px;
}

.mail-piece {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mail-piece-nom {
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.mail-piece-taille {
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

.mail-fiches {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mail-fiche {
  font-size: var(--fs-xs);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  background: var(--bg-card-hover);
  color: var(--text-muted);
}

/* En-tête sur téléphone étroit : les cinq boutons restent visibles (Mails ajouté en 0.8.0) */
@media (max-width: 430px) {
  .header-left { gap: 8px; min-width: 0; }
  .identity-info { min-width: 0; overflow: hidden; }
  .header-right { gap: 0; flex-shrink: 0; }
  .app-header { padding-left: max(10px, var(--safe-left)); padding-right: max(6px, var(--safe-right)); }
  .avatar-container { width: 36px; height: 36px; }
}

/* Onglets Mails / Mémoire, page Mémoire (P1-PWA-14) */
.mails-onglets {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border-radius: var(--radius-pill);
  padding: 3px;
  margin-bottom: 10px;
}

.mails-onglet {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  padding: 7px 10px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.mails-onglet.actif {
  background: var(--color-primary);
  color: #fff;
}

.fiche-item-type {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-gold);
}

.fiche-entete {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.fiche-entete-nom {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.fiche-resume {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.fiche-fait {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fiche-fait.remplace {
  opacity: 0.6;
}

.fiche-fait.llm {
  border-left-color: var(--color-gold);
}

.fiche-fait-enonce {
  font-size: 0.88rem;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.fiche-fait-extrait {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-style: italic;
  border-left: 2px solid var(--border-accent);
  padding-left: 8px;
  overflow-wrap: anywhere;
}

.fiche-fait-source {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

.lien-discret {
  background: transparent;
  border: none;
  color: var(--text-link);
  padding: 0;
  font-size: var(--fs-xs);
  cursor: pointer;
  text-decoration: underline;
}

.lien-discret.danger {
  color: var(--text-danger);
}

.mail-fiche.cliquable {
  border: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-size: var(--fs-xs);
}

.fiche-action {
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--color-red);
  color: var(--text-danger);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: var(--fs-xs);
  cursor: pointer;
}

.fiche-action:disabled {
  opacity: 0.5;
}

/* ===========================================================================
   Retours sur les réponses (👍 / 👎) et page Suivi (observabilité)
   =========================================================================== */
.retour-reponse {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.retour-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: 0.9rem;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.retour-btn:hover,
.retour-btn.actif {
  opacity: 1;
}

.retour-btn.actif {
  border-color: var(--color-gold);
  background: var(--color-gold-glow);
}

.retour-motifs {
  flex-basis: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.retour-motifs-titre {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.retour-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.retour-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  color: var(--text-main);
  border-radius: var(--radius-pill);
  padding: 5px 11px;
  font-size: var(--fs-xs);
  cursor: pointer;
}

.retour-chip.actif {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.retour-commentaire {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 8px;
  font: inherit;
}

.retour-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.retour-actions button {
  width: auto;
  padding: 7px 14px;
  margin: 0;
}

.suivi-card {
  display: flex;
  flex-direction: column;
  max-width: 760px;
  height: calc(100vh - 40px - var(--safe-top) - var(--safe-bottom));
  height: calc(100dvh - 40px - var(--safe-top) - var(--safe-bottom));
  padding: 16px;
}

.suivi-periodes {
  display: flex;
  gap: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 3px;
  margin-bottom: 10px;
}

.suivi-periode {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  padding: 7px 10px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.suivi-periode.actif {
  background: var(--color-primary);
  color: #fff;
}

.suivi-contenu {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.suivi-periode-texte,
.suivi-note,
.suivi-vide {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

.suivi-cartes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.suivi-carte {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  min-width: 0;
}

.suivi-carte.alerte {
  border-color: rgba(239, 68, 68, 0.45);
}

.suivi-carte-valeur {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.suivi-carte-titre {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.suivi-carte-detail {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  margin-top: 4px;
}

.suivi-section h3 {
  font-size: 0.92rem;
  margin: 0 0 6px;
  color: var(--color-gold);
}

.suivi-table-zone {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.suivi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-xs);
}

.suivi-table th,
.suivi-table td {
  text-align: left;
  padding: 5px 6px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.suivi-table th {
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.suivi-table td code {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  word-break: break-all;
}

.suivi-rouge {
  color: var(--text-danger);
  font-weight: 700;
}

.suivi-systeme {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.suivi-systeme > div {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.suivi-systeme strong {
  font-size: 1rem;
  color: var(--text-main);
}

.suivi-courbe {
  width: 100%;
  height: 28px;
  margin-top: 4px;
}

.suivi-negatifs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.suivi-negatif {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--color-red);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  font-size: var(--fs-xs);
}

.suivi-negatif summary {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
}

.suivi-negatif summary::-webkit-details-marker {
  display: none;
}

.suivi-negatif-motif {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-danger);
  font-weight: 700;
}

.suivi-negatif-question {
  color: var(--text-main);
}

.suivi-negatif-meta {
  color: var(--text-dim);
  font-size: var(--fs-xs);
}

.suivi-negatif-commentaire {
  margin: 8px 0 4px;
  color: var(--color-gold);
}

.suivi-negatif-reponse {
  margin: 4px 0;
  color: var(--text-muted);
}

/* Fiche « Confier une tâche » (Projets) */
.fiche-tache {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
}

.fiche-tache label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
}

.fiche-tache input,
.fiche-tache select,
.fiche-tache textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 7px 8px;
  font: inherit;
  font-size: 1rem;
}

.fiche-tache-ligne {
  display: flex;
  gap: 8px;
}

@media (max-width: 380px) {
  .fiche-tache-ligne {
    flex-direction: column;
  }
}

.fiche-tache label.fiche-tache-case {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
  font-size: 0.84rem;
  padding-top: 16px;
}

.fiche-tache label.fiche-tache-case input {
  width: auto;
}

.fiche-tache-message {
  margin: 0;
  min-height: 1em;
  font-size: var(--fs-xs);
  color: var(--color-gold);
}

.fiche-tache-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.fiche-tache-actions button {
  width: auto;
  margin: 0;
  padding: 8px 14px;
  white-space: nowrap;
}

.fiche-tache-fait {
  font-size: 0.86rem;
  color: var(--text-main);
}

.fiche-tache-fait a {
  color: #38bdf8;
}

.taches-recentes h3 {
  font-size: 0.92rem;
  margin: 6px 0;
  color: var(--color-gold);
}

.tache-recente {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.82rem;
}

.tache-recente-meta {
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

/* ==============================================================================
   CHARTE — LOT 1 (audit UX du 10/10/2026, docs/UX_AUDIT_2026-10-10.md)
   Composants communs : les anciennes classes de bouton sont gardées (le code et les parcours s'en servent),
   regroupées ici pour une taille, une forme et une cible tactile communes (44 px).
   ============================================================================== */

/* Boutons d'action : 44 px de haut au moins */
.primary-btn,
.secondary-btn,
.notif-action,
.notif-annuler,
.mail-assistant button,
.mail-assistant-copier,
.visionneuse-outils button,
.fiche-action,
.mails-suite,
.status-refresh-btn,
.suite-renew-btn,
.update-btn,
.btn-approve,
.btn-reject,
.nav-suite-action-pill,
.nav-suite-saisie button,
.fiche-tache-actions button,
.retour-actions button {
  min-height: var(--cible);
  padding-top: 0;
  padding-bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--e2);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  line-height: 1.2;
}

.secondary-btn {
  color: var(--text-main);
  border-color: var(--border-accent);
}

.btn-bloc {
  width: 100%;
  margin-top: var(--e2);
}

/* Boutons-icônes : carrés de 44 px */
.icon-btn,
.action-btn,
.modal-close,
.remove-preview-btn,
.retour-btn {
  min-width: var(--cible);
  min-height: var(--cible);
}

.icon-btn,
.action-btn {
  width: var(--cible);
  height: var(--cible);
}

.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  font-size: 1.25rem;
  line-height: 1;
}

.modal-close:active,
.remove-preview-btn:active {
  background: var(--bg-card);
  color: var(--text-main);
}

/* Puces (filtres, suggestions, motifs, fiches liées) : 36 px visibles, zone de toucher portée à 44 px */
.mails-filtre,
.evenements-filtre,
.btn-action-ev,
.retour-chip,
.prompt-chip,
.mail-fiche.cliquable {
  position: relative;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-sm);
}

.mails-filtre::after,
.evenements-filtre::after,
.btn-action-ev::after,
.retour-chip::after,
.prompt-chip::after,
.mail-fiche.cliquable::after {
  content: "";
  position: absolute;
  inset: -4px 0;
}

.mails-onglet,
.suivi-periode {
  min-height: 44px;
}

/* Champs de recherche, onglets des réglages : 44 px au moins (audit du 12/11/2026) */
.mails-recherche,
.cabinet-tab-btn {
  min-height: 44px;
}

/* Liens d'action dans le texte (Ouvrir le mail, Oublier, Séparer) : vrais boutons de 44 px */
.lien-discret {
  display: inline-flex;
  align-items: center;
  min-height: var(--cible);
  padding: 0 var(--e2);
  margin: 0 calc(-1 * var(--e2));
  font-size: var(--fs-sm);
}

.retour-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--e3);
}

/* Champs : 16 px (lecture, pas de zoom automatique) et 44 px */
.fiche-tache input,
.fiche-tache select,
.fiche-tache textarea,
.retour-commentaire,
.new-note-wrapper textarea {
  font-size: var(--fs-md);
}

.fiche-tache input,
.fiche-tache select {
  min-height: var(--cible);
}

.fiche-tache label {
  font-size: var(--fs-sm);
}

/* Lecture : 15 à 16 px */
.notif-item-texte,
.fiche-fait-enonce,
.fiche-resume,
.mail-bref p,
.mail-a-retenir {
  font-size: 0.9375rem;
  line-height: 1.55;
}

.mail-assistant-reponse {
  font-size: var(--fs-md);
  line-height: var(--lh-texte);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

/* Fenêtres sans hauteur fixe (menu ⋮, note) : défilement plutôt que débordement */
.modal-card {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

/* Fenêtres en plein écran sur téléphone : plus de marge de 20 px autour d'une carte étroite */
@media (max-width: 600px) {
  .modal-backdrop {
    padding: 0;
    align-items: stretch;
  }

  .modal-card,
  .mails-card,
  .suivi-card,
  .notif-card,
  .status-modal-card {
    max-width: none;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
    padding: calc(var(--e2) + var(--safe-top)) var(--e4) calc(var(--e2) + var(--safe-bottom));
  }

  /* Note relationnelle : feuille basse, le clavier reste visible au-dessus */
  .note-modal-card {
    margin-top: auto;
    height: auto;
    max-height: 100dvh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding-bottom: calc(var(--e4) + var(--safe-bottom));
  }

  .modal-header {
    min-height: var(--cible);
    margin-bottom: var(--e2);
  }
}

/* Page Confier une tâche : bouton de création collé en bas de la fenêtre */
#taches-contenu .fiche-tache-actions {
  position: sticky;
  bottom: calc(-1 * var(--e3));
  z-index: 2;
  margin: 0 calc(-1 * var(--e3)) calc(-1 * var(--e3));
  padding: var(--e2) var(--e3) var(--e3);
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

@media (max-width: 600px) {
  #taches-contenu .fiche-tache-actions button {
    flex: 1;
  }
}

/* ------------------------------------------------------------------------------
   Fiche d'un mail : pièces jointes en tête, « Demander à Alfred » collé en bas
   ------------------------------------------------------------------------------ */
.mail-pieces {
  display: flex;
  gap: var(--e2);
  overflow-x: auto;
  padding: 2px 0 var(--e1);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}

.mail-pieces::-webkit-scrollbar {
  display: none;
}

.mail-pieces .mail-piece {
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  gap: var(--e2);
  min-height: 52px;
  max-width: min(290px, 76vw);
  overflow: hidden;
  padding: 6px var(--e3);
  border-color: var(--border-accent);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.mail-pieces .mail-piece:active {
  background: var(--bg-card-hover);
}

.mail-piece.absente {
  border-style: dashed;
}

.mail-piece-icone {
  font-size: 1.375rem;
  line-height: 1;
  flex-shrink: 0;
}

.mail-piece-infos {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mail-pieces .mail-piece-nom {
  font-size: var(--fs-sm);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
}

.mail-piece-taille {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mail-assistant-resultat:empty {
  display: none;
}

.mail-assistant {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: auto 0 0;
  padding: var(--e2) 0 var(--e2);
  border: 0;
  border-top: 1px solid var(--border-subtle);
  border-radius: 0;
  background: var(--bg-surface);
  box-shadow: 0 -10px 16px -8px rgba(0, 0, 0, 0.45);
}

.mail-assistant-boutons {
  flex-wrap: nowrap;
}

.mail-assistant-boutons button {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 var(--e2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mail-assistant-question.hidden {
  display: none;
}

.mail-assistant-question input {
  min-height: var(--cible);
}

.mail-assistant-question button {
  flex: 0 0 auto;
}

/* ------------------------------------------------------------------------------
   Visionneuse plein écran (pièces jointes, photos) : zoom par pincement, double toucher, molette et boutons
   ------------------------------------------------------------------------------ */
.visionneuse {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  flex-direction: column;
  background: #000;
  color: var(--text-main);
}

.visionneuse.hidden {
  display: none;
}

.visionneuse-barre,
.visionneuse-outils {
  display: flex;
  align-items: center;
  gap: var(--e2);
  background: rgba(15, 23, 42, 0.94);
  flex-shrink: 0;
}

.visionneuse-barre {
  padding: calc(var(--e1) + var(--safe-top)) var(--e2) var(--e1);
  border-bottom: 1px solid var(--border-subtle);
}

.visionneuse-titre {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.visionneuse-nom {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visionneuse-detail {
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

.visionneuse-zone {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  overscroll-behavior: contain;
}

.visionneuse-zone.mode-image {
  touch-action: none;
  cursor: zoom-in;
}

.visionneuse-zone.mode-image.agrandie {
  cursor: grab;
}

.visionneuse-zone.mode-texte {
  overflow-y: auto;
  align-items: flex-start;
  background: var(--bg-surface);
  -webkit-overflow-scrolling: touch;
}

.visionneuse-zone img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}

.visionneuse-texte {
  width: 100%;
  max-width: 72ch;
  padding: var(--e4);
  font-size: var(--fs-md);
  line-height: var(--lh-texte);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.visionneuse-texte .mail-detail-note {
  margin-bottom: var(--e3);
}

.visionneuse-message {
  padding: var(--e5) var(--e4);
  color: var(--text-muted);
  text-align: center;
}

.visionneuse-outils {
  flex-wrap: wrap;
  justify-content: center;
  padding: var(--e2) var(--e2) calc(var(--e2) + var(--safe-bottom));
  border-top: 1px solid var(--border-subtle);
}

.visionneuse-outils button {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  color: var(--text-main);
  padding: 0 var(--e3);
  cursor: pointer;
}

.visionneuse-outils button.actif {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.visionneuse-outils .visionneuse-zoom-valeur {
  min-width: 64px;
}

.visionneuse-barre .modal-close {
  color: var(--text-main);
}

.bubble-image {
  cursor: zoom-in;
}

/* Mouvement réduit : animations et transitions coupées */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Gmail : raison pour laquelle un mail est montré, et pied de liste des mails non affichés */
.mail-item-pertinence {
  margin-top: var(--e1);
  font-size: var(--fs-xs);
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

.mails-masques {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--e2);
  padding: var(--e4) var(--e2);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.mails-masques a {
  text-decoration: none;
  padding: 0 var(--e4);
}

/* Bouton Copier de « Demander à Alfred » */
.mail-assistant-copier {
  align-self: flex-start;
  margin-top: var(--e2);
  padding: 0 var(--e4);
  background: transparent; /* comme les boutons de la barre « Demander à Alfred » */
  border: 1px solid var(--border-accent);
  color: var(--text-main);
  white-space: nowrap;
  cursor: pointer;
}

.mail-assistant-copier:active {
  background: var(--bg-card-hover);
}

.visionneuse-outils button:disabled {
  opacity: 0.5;
  cursor: progress;
}

/* Notification recopiée dans la conversation : touchable */
.notif-conversation .bubble-body {
  cursor: pointer;
}

.notif-conversation .bubble-body:active {
  background: var(--bg-card-hover);
}

/* Feuille basse : texte complet d'une notification */
.feuille-backdrop {
  align-items: flex-end;
  padding: 0;
}

.feuille-backdrop .feuille-card {
  width: 100%;
  max-width: 560px;
  height: auto;
  max-height: 80dvh;
  margin: auto auto 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--e4) var(--e4) calc(var(--e4) + var(--safe-bottom));
  overflow-y: auto;
}

/* Grand écran (> 600px) : dialogue centré élégant (non collé au bas ni masqué par la barre de navigation) */
@media (min-width: 601px) {
  .feuille-backdrop {
    align-items: center;
    justify-content: center;
    padding: 20px;
  }

  .feuille-backdrop .feuille-card {
    margin: auto;
    border-radius: var(--radius-lg);
    max-height: calc(100dvh - 80px);
    padding: var(--e4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  }
}

.feuille-date {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  margin-bottom: var(--e3);
}

.feuille-texte {
  font-size: var(--fs-md);
  line-height: var(--lh-texte);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  user-select: text;
  -webkit-user-select: text;
}

/* ---------------------------------------------------------------- Alertes lisibles (demande de l'élu du 25/11)
   Liste : un intertitre par jour, la nature de l'alerte en pastille, le titre en grand, le texte en lignes
   « étiquette : valeur », ce que fait un toucher dit en bas. Fiche : même mise en forme, plus large. */
.notif-list {
  gap: var(--e3);
}

.notif-jour {
  margin: var(--e3) 0 0;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.notif-jour:first-child {
  margin-top: 0;
}

.notif-item {
  padding: var(--e4);
  border-left-width: 4px;
}

/* Une couleur par famille d'alerte, portée par la vignette, le mot de la pastille et le filet de gauche */
.notif-item {
  --teinte: #cbd5e1;
  --teinte-fond: rgba(148, 163, 184, 0.16);
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: var(--e3);
  align-items: start;
  border-left-color: var(--teinte);
}

.notif-item--mails { --teinte: #7dd3fc; --teinte-fond: rgba(56, 189, 248, 0.16); }
.notif-item--agenda { --teinte: #c4b5fd; --teinte-fond: rgba(167, 139, 250, 0.18); }
.notif-item--projets { --teinte: #6ee7b7; --teinte-fond: rgba(52, 211, 153, 0.16); }
.notif-item--documents { --teinte: #fcd34d; --teinte-fond: rgba(251, 191, 36, 0.16); }
.notif-item--territoire { --teinte: #f9a8d4; --teinte-fond: rgba(244, 114, 182, 0.16); }
.notif-item--point { --teinte: #fb923c; --teinte-fond: rgba(249, 115, 22, 0.2); }
.notif-item--systeme { --teinte: #cbd5e1; --teinte-fond: rgba(148, 163, 184, 0.16); }

.notif-item.non-lue {
  border-left-color: var(--teinte);
}

.notif-item.urgent {
  border-left-color: var(--color-danger);
}

.notif-vignette {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--teinte-fond);
  color: var(--teinte);
}

.notif-vignette .ic {
  width: 24px;
  height: 24px;
}

.notif-item-corps {
  min-width: 0;
}

.notif-item .notif-type {
  padding: 0;
  border: 0;
  color: var(--teinte);
  font-weight: 700;
  letter-spacing: 0.02em;
  min-width: 0;
  max-width: 100%;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-item.urgent .notif-niveau.est-urgent {
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

.notif-objet {
  margin: 0;
  font-weight: 600;
  color: var(--text-main);
}

/* Seul le début du texte d'un mail est coupé (le mail s'ouvre d'un toucher) : le reste se lit en entier */
.notif-apercu {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.notif-apercu {
  margin: 0;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  color: var(--text-muted);
}

.notif-puces {
  margin: 0;
  padding: 0;
  list-style: none;
}

.notif-puces li {
  padding: 4px 0 4px var(--e3);
  border-left: 2px solid var(--border-accent);
  overflow-wrap: anywhere;
}

.notif-puces li + li {
  margin-top: 4px;
}

@media (max-width: 600px) {
  .notif-item {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: var(--e2) var(--e3);
    padding: var(--e3);
  }

  .notif-vignette {
    width: 36px;
    height: 36px;
  }

  .notif-vignette .ic {
    width: 20px;
    height: 20px;
  }
}

.notif-item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--e2);
  min-height: 28px;
  margin-bottom: 2px;
}

.notif-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.notif-type .ic {
  color: var(--color-gold);
}

.notif-niveau {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.notif-niveau.est-urgent {
  font-weight: 700;
  color: var(--text-danger);
}

.notif-item-meta .notif-item-date {
  margin-left: auto;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.notif-item-meta .notif-marquer-lu {
  margin: -10px -8px -10px 0;
}

.notif-item-titre {
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: 1.35;
}

.notif-item.non-lue .notif-item-titre::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: var(--e2);
  border-radius: 50%;
  background: var(--color-gold);
  vertical-align: middle;
}

.notif-item-texte {
  margin-top: var(--e2);
  font-size: var(--fs-md);
  line-height: 1.55;
  white-space: normal;
  color: #cbd5e1;
}

.notif-paragraphe,
.notif-citation,
.notif-etiquette,
.notif-champs {
  margin: 0;
}

.notif-item-texte > * + *,
.feuille-texte > * + * {
  margin-top: var(--e2);
}

.notif-champ {
  display: grid;
  grid-template-columns: minmax(6rem, 28%) minmax(0, 1fr);
  gap: 0 var(--e3);
  padding: 3px 0;
}

.notif-champ dt {
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.notif-champ dd {
  margin: 0;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.notif-citation {
  padding: var(--e2) var(--e3);
  border-left: 3px solid var(--border-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-main);
}

.notif-etiquette {
  font-weight: 600;
  color: var(--text-muted);
}

.notif-rubrique {
  margin: var(--e4) 0 0;
  padding-top: var(--e3);
  border-top: 1px solid var(--border-accent);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-gold);
}

.notif-item-pied {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--e2);
  margin-top: var(--e3);
}

.notif-item-pied .notif-annuler,
.notif-item-pied .notif-resultat {
  margin-top: 0;
}

.notif-suite {
  margin-left: auto;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-link);
}

.notif-annuler,
.notif-resultat,
.notif-action {
  font-size: var(--fs-sm);
}

/* Fiche d'une alerte : plus large sur ordinateur, titre et texte à taille de lecture */
.feuille-backdrop .feuille-card {
  max-width: 720px;
}

#notif-feuille-titre {
  font-size: var(--fs-xl);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.feuille-date {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--e2) var(--e3);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: var(--e4);
}

.feuille-texte {
  color: #dbe3ee;
}

.feuille-texte .notif-champ {
  padding: 6px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.notif-detail {
  margin-top: var(--e4);
  padding-top: var(--e4);
  border-top: 1px solid var(--border-accent);
}

.notif-pieces {
  margin-top: var(--e4);
}

.feuille-actions:not(:empty) {
  flex-wrap: wrap;
  align-items: center;
}

.feuille-actions .notif-annuler {
  margin-top: 0;
}

@media (max-width: 600px) {
  .notif-champ {
    grid-template-columns: minmax(0, 1fr);
  }

  .notif-champ dt {
    font-size: var(--fs-sm);
  }
}

/* Détail du point du jour : une rubrique par bloc, un élément par ligne (repère à gauche, précision dessous) */
.feuille-texte.est-structure {
  white-space: normal;
}

.point-section + .point-section {
  margin-top: var(--e4);
  padding-top: var(--e4);
  border-top: 1px solid var(--border-accent);
}

.point-titre {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--e2);
  margin: 0 0 var(--e2);
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main, inherit);
}

.point-titre .ic {
  align-self: center;
  color: var(--color-gold);
}

.point-section--alertes .point-titre .ic {
  color: #fbbf24;
}

.point-note {
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--text-muted);
}

.point-liste {
  list-style: none;
  margin: 0;
  padding: 0;
}

.point-ligne {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: var(--e3);
  padding: var(--e2) 0;
  align-items: baseline;
}

.point-ligne.sans-repere {
  grid-template-columns: minmax(0, 1fr);
}

.point-ligne + .point-ligne {
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.point-repere {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-gold);
  font-variant-numeric: tabular-nums;
}

.point-repere.est-retard {
  color: var(--text-danger);
}

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

.point-texte {
  font-size: var(--fs-md);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.point-ligne.est-synthese .point-texte {
  font-weight: 600;
}

.point-precision {
  font-size: var(--fs-sm);
  line-height: 1.4;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.point-pied {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--e2);
  margin: var(--e2) 0 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.point-pied .auj-lien {
  margin-left: auto;
  min-height: var(--cible);
}

.point-vide {
  color: var(--text-muted);
}

/* Dossier de séance : texte clair sur le fond de l'application */
.feuille-memo {
  padding: var(--e3);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: inherit;
  font-size: var(--fs-md);
  line-height: var(--lh-texte);
}

.feuille-actions:not(:empty) {
  margin-top: var(--e4);
  display: flex;
  justify-content: flex-end;
  gap: var(--e2);
}

/* ==============================================================================
   LOTS 2 ET 3 (audit UX du 10/10/2026, § 6) : écrans réorganisés, mascotte, animations
   ============================================================================== */

/* ---------------------------------------------------------------- Mascotte : en-tête, accueil, réflexion */
.avatar-core {
  overflow: hidden;
  padding: 0;
  background: #14203a;
}

.avatar-mascotte {
  width: 100%;
  height: 100%;
  display: block;
}

.intro-mascotte {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto var(--e3);
  animation: bonjour 700ms var(--courbe) 300ms 1 both;
}

@keyframes bonjour {
  0% { transform: translateY(6px); opacity: 0; }
  60% { transform: translateY(-4px); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

.alfred-reflechit {
  display: flex;
  align-items: center;
  gap: var(--e3);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  min-height: 44px;
}

.alfred-reflechit img {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.alfred-reflechit span {
  animation: respire 1.6s ease-in-out infinite;
}

@keyframes respire {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

/* Mouvement réduit : mascottes immobiles (la règle interne du SVG suffit aussi, ceci la double) */
@media (prefers-reduced-motion: reduce) {
  .alfred-reflechit img,
  .chargement-long img {
    content: url('/icons/mascotte.svg');
  }
}

/* ---------------------------------------------------------------- Réponses : Copier, Réessayer, 👍 / 👎 sur une ligne */
.actions-reponse {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--e2);
  margin-top: var(--e2);
}

.actions-reponse .retour-reponse {
  margin-top: 0;
}

.action-reponse {
  min-height: var(--cible);
  padding: 0 var(--e3);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
}

.action-reponse:active {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.reponse-arretee {
  margin-top: var(--e2);
  font-size: var(--fs-sm);
  color: var(--text-dim);
}

/* Markdown des réponses */
.markdown-content .md-titre {
  margin: var(--e3) 0 var(--e1);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text-main);
}

.markdown-content h4.md-titre {
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.markdown-content ul,
.markdown-content ol {
  margin: var(--e1) 0 var(--e2);
  padding-left: 1.4em;
}

.markdown-content li {
  margin: 2px 0;
}

.markdown-content blockquote {
  margin: var(--e2) 0;
  padding-left: var(--e3);
  border-left: 3px solid var(--border-accent);
  color: var(--text-muted);
}

.markdown-content p + p {
  margin-top: var(--e2);
}

/* ---------------------------------------------------------------- Saisie : « + », micro ou envoyer, arrêter */
.app-footer .input-bar {
  gap: var(--e1);
}

.joindre-btn {
  color: var(--text-main);
}

.joindre-btn[aria-expanded="true"] {
  background: var(--bg-card-hover);
}

.stop-btn {
  display: none;
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--text-danger);
}

.input-bar.en-reponse .stop-btn {
  display: flex;
}

.input-bar.en-reponse .send-btn,
.input-bar.en-reponse .mic-btn,
.input-bar.vide:not(.sans-micro) .send-btn,
/* Le micro reste visible pendant une dictée, même quand le champ se remplit */
.input-bar:not(.vide) .mic-btn:not(.listening) {
  display: none;
}

.menu-joindre {
  position: absolute;
  bottom: calc(100% + var(--e2));
  left: max(var(--e2), var(--safe-left));
  z-index: 3;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  padding: var(--e1);
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: monte var(--duree) var(--courbe);
}

.menu-joindre-item {
  display: flex;
  align-items: center;
  gap: var(--e3);
  min-height: 48px;
  padding: 0 var(--e3);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
}

.menu-joindre-item:active {
  background: var(--bg-card-hover);
}

.suggestions {
  display: flex;
  gap: var(--e2);
  max-width: 760px;
  margin: 0 auto var(--e2);
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 2px;
}

.suggestions::-webkit-scrollbar {
  display: none;
}

.suggestions .prompt-chip {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* La conversation et l'aperçu suivent la hauteur réelle du pied (suggestions comprises) et des bandeaux */
.chat-container {
  top: calc(var(--header-height) + var(--safe-top) + var(--hauteur-bandeaux, 0px));
  bottom: var(--hauteur-pied, calc(var(--footer-min-height) + 56px + var(--safe-bottom)));
}

.attachment-preview-drawer {
  bottom: calc(var(--hauteur-pied, calc(var(--footer-min-height) + 56px + var(--safe-bottom))) + var(--e2));
}

.btn-bas {
  position: fixed;
  right: max(var(--e4), var(--safe-right));
  bottom: calc(var(--hauteur-pied, 76px) + var(--e3));
  z-index: 90;
  min-height: var(--cible);
  padding: 0 var(--e4);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  color: var(--text-main);
  font: inherit;
  font-size: var(--fs-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  animation: monte var(--duree) var(--courbe);
}

/* ---------------------------------------------------------------- Toasts : en bas, à portée de pouce */
.toast-container {
  top: auto;
  bottom: calc(var(--hauteur-pied, 76px) + var(--e3));
  flex-direction: column-reverse;
}

/* Un toast ne bloque jamais un toucher sur ce qu'il recouvre ; seul son bouton d'action est actif */
.toast {
  display: flex;
  align-items: center;
  gap: var(--e3);
  min-height: var(--cible);
  font-size: var(--fs-sm);
  pointer-events: none;
  animation: monte var(--duree) var(--courbe);
}

.toast-action {
  pointer-events: auto;
}

.toast span {
  flex: 1;
}

.toast.sortie {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-action {
  flex-shrink: 0;
  min-height: 36px;
  padding: 0 var(--e3);
  background: transparent;
  border: 1px solid var(--color-gold);
  border-radius: var(--radius-sm);
  color: var(--color-gold);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* ---------------------------------------------------------------- Fenêtres : apparition douce */
@keyframes monte {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-backdrop:not(.hidden) > .modal-card {
  animation: monte 180ms var(--courbe);
}

.notif-item {
  animation: monte 200ms var(--courbe) both;
  animation-delay: calc(var(--rang, 0) * 40ms);
}

/* Chargement : squelette tout de suite, mascotte si l'attente dure plus de 0,4 s */
.chargement {
  display: flex;
  flex-direction: column;
  gap: var(--e3);
  padding: var(--e2) 0;
}

.squelette {
  height: 64px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--bg-card) 0%, var(--bg-card-hover) 50%, var(--bg-card) 100%);
  background-size: 200% 100%;
  animation: reflet-squelette 1.2s linear infinite;
}

.squelette.court {
  width: 70%;
}

@keyframes reflet-squelette {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.chargement-long {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--e3);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  opacity: 0;
  animation: apparait 200ms ease 400ms forwards;
}

@keyframes apparait {
  to { opacity: 1; }
}

/* ---------------------------------------------------------------- Menu ⋮ */
.menu-liste {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 calc(-1 * var(--e2));
}

.menu-item {
  display: flex;
  align-items: center;
  gap: var(--e3);
  width: 100%;
  min-height: 52px;
  padding: 0 var(--e3);
  background: none;
  border: 0;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font: inherit;
  font-size: var(--fs-md);
  text-align: start;
  cursor: pointer;
}

.menu-item .ic {
  width: 22px;
  height: 22px;
  margin: 0 3px;
  color: var(--text-muted);
}

.menu-item:active,
.menu-item:hover {
  background: var(--bg-card-hover);
}

.menu-notifications {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--e3);
  margin-top: var(--e3);
  padding: var(--e3);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.menu-notifications p {
  margin-top: 2px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.menu-notifications .primary-btn {
  flex-shrink: 0;
  margin-top: 0;
}

.menu-apropos {
  margin-top: var(--e3);
}

.menu-apropos summary,
.fiche-tache-plus summary,
.suivi-details summary {
  display: flex;
  align-items: center;
  min-height: var(--cible);
  padding: 0 var(--e2);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
}

.menu-apropos summary::-webkit-details-marker,
.fiche-tache-plus summary::-webkit-details-marker,
.suivi-details summary::-webkit-details-marker {
  display: none;
}

.menu-apropos summary::after,
.fiche-tache-plus summary::after,
.suivi-details summary::after {
  content: "▾";
  margin-left: auto;
  transition: transform var(--duree) var(--courbe);
}

.menu-apropos[open] summary::after,
.fiche-tache-plus[open] summary::after,
.suivi-details[open] summary::after {
  transform: rotate(180deg);
}

.menu-apropos .modal-body {
  padding: var(--e2);
}

/* ---------------------------------------------------------------- Mails : liste et fiche */
.mails-filtres {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 1px;
  flex-shrink: 0;
}

.mails-filtres::-webkit-scrollbar {
  display: none;
}

.mails-filtre {
  flex: 0 0 auto;
  white-space: nowrap;
}

.mail-item-apercu {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.mail-item-objet {
  font-size: 0.9375rem;
  font-weight: 600;
}

.mail-outils {
  display: flex;
  gap: var(--e2);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.mail-outils::-webkit-scrollbar {
  display: none;
}

.mail-outil {
  flex: 0 0 auto;
  min-width: var(--cible);
  min-height: var(--cible);
  padding: 0 var(--e3);
  background: transparent;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font: inherit;
  font-size: var(--fs-sm);
  white-space: nowrap;
  cursor: pointer;
}

.mail-outil:disabled {
  opacity: 0.35;
  cursor: default;
}

.mail-bref,
.mail-a-retenir {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--color-gold);
  border-radius: var(--radius-md);
  padding: var(--e2) var(--e3);
}

.mail-a-retenir li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--e2);
}

.retenir-action {
  flex-shrink: 0;
  min-height: 36px;
  padding: 0 var(--e3);
  background: transparent;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-pill);
  color: var(--text-link);
  font: inherit;
  font-size: var(--fs-xs);
  cursor: pointer;
  position: relative;
}

.retenir-action::after {
  content: "";
  position: absolute;
  inset: -4px 0;
}

/* Modales et feuilles ouvertes par-dessus les rubriques principales */
#taches-backdrop,
#suivi-backdrop,
#classement-backdrop,
#note-modal-backdrop,
#notif-feuille-backdrop {
  z-index: 450;
}

/* ---------------------------------------------------------------- Notifications */
.notif-item-entete {
  align-items: flex-start;
}

.notif-item-titre {
  flex: 1;
  min-width: 0;
}

.notif-marquer-lu {
  flex-shrink: 0;
  width: var(--cible);
  height: var(--cible);
  margin: -10px -8px -10px 0;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--color-gold);
  font-size: 1.125rem;
  cursor: pointer;
}

.notif-marquer-lu:active {
  background: var(--bg-card);
}

.notif-actions {
  flex-wrap: nowrap;
  overflow-x: auto;
}

.notif-action {
  flex: 0 0 auto;
  white-space: nowrap;
}

.notif-action.a-confirmer {
  border-color: var(--text-danger);
  color: var(--text-danger);
}

/* ---------------------------------------------------------------- Connexions */
.status-synthese {
  padding: var(--e3) var(--e4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-accent);
  background: var(--bg-card);
  font-weight: 600;
}

.status-synthese.ok {
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.status-synthese.attention {
  border-color: rgba(245, 158, 11, 0.5);
  color: #fbbf24;
}

.status-synthese.panne {
  border-color: rgba(239, 68, 68, 0.5);
  color: var(--text-danger);
}

.status-modal-body > .suite-status-banner,
.status-modal-body > .suite-reconnexion {
  margin: 0;
}

.status-pill {
  font-size: var(--fs-xs);
  text-transform: none;
  letter-spacing: 0;
}

.status-pill.status-neutre {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.status-card.neutre {
  border-left-color: var(--border-subtle);
  opacity: 0.75;
}

.status-card-action {
  align-self: flex-start;
  margin-top: var(--e2);
}

/* ---------------------------------------------------------------- Confier une tâche : précisions repliables */
.fiche-tache-plus {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--e1);
}

.fiche-tache-plus[open] {
  display: flex;
  flex-direction: column;
  gap: var(--e2);
}

/* ---------------------------------------------------------------- Suivi : synthèse en clair */
.suivi-synthese {
  padding: var(--e3) var(--e4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-accent);
  background: var(--bg-card);
}

.suivi-synthese.ok {
  border-color: rgba(16, 185, 129, 0.45);
}

.suivi-synthese.attention {
  border-color: rgba(245, 158, 11, 0.5);
}

.suivi-synthese ul {
  margin: var(--e2) 0 0;
  padding-left: 1.2em;
  color: var(--text-muted);
}

/* Suivi : dépense du modèle (0.69.0) */
.suivi-depense {
  display: flex;
  flex-direction: column;
  gap: var(--e2);
}

.suivi-jauge {
  height: 0.6rem;
  border-radius: 999px;
  background: var(--border-subtle);
  overflow: hidden;
}

.suivi-jauge span {
  display: block;
  height: 100%;
  background: var(--color-gold);
  border-radius: inherit;
}

.suivi-jauge.alerte span {
  background: var(--text-danger);
}

.suivi-barres {
  width: 100%;
  height: 4.5rem;
  fill: var(--color-gold);
}

/* Texte réservé aux lecteurs d'écran (légende du tableau des usages) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.suivi-barres-legende {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

.suivi-details-contenu {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: var(--e2);
}

/* Menu : bloc Notifications ; Connexions : descriptions en police de texte (plus de police de code) */
.menu-notifications strong {
  display: block;
}

.status-card-url {
  font-family: inherit;
  font-size: var(--fs-xs);
}

/* Reconnexion Google (Agenda & Gmail) */
.google-reauth-card {
  max-width: 500px;
}

.google-icon {
  background: rgba(66, 133, 244, 0.15);
  color: #4285f4;
}

.google-reauth-body {
  padding: var(--e3) var(--e4) var(--e4);
  display: flex;
  flex-direction: column;
  gap: var(--e3);
}

.google-reauth-intro {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1.5;
  margin: 0;
}

.google-reauth-direct-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: var(--e3);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--e2);
}

.google-reauth-btn-main {
  width: 100%;
  padding: 12px 18px;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.google-reauth-note {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  margin: 0;
  line-height: 1.4;
}

.google-reauth-secours-details {
  border: 1px dashed var(--border-accent);
  border-radius: var(--radius-md);
  padding: var(--e2) var(--e3);
  background: var(--bg-card);
  font-size: var(--fs-sm);
}

.google-reauth-secours-summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
}

.google-reauth-secours-content {
  margin-top: var(--e3);
  display: flex;
  flex-direction: column;
  gap: var(--e2);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.google-reauth-steps {
  padding-left: 1.3em;
  margin: var(--e2) 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.google-reauth-btn-secours {
  font-size: var(--fs-xs);
  padding: 6px 12px;
}

.google-reauth-code-input-group {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.google-reauth-code-input-group input {
  flex: 1;
  padding: 8px 10px;
  font-size: 1rem;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-main);
}

.google-reauth-cloud-info {
  margin-top: var(--e2);
  padding: var(--e2);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border-left: 3px solid #3182ce;
}

.google-reauth-cloud-info p {
  margin: 4px 0;
  font-size: var(--fs-xs);
}

.google-reauth-uri-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  background: var(--bg-card);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-accent);
}

.google-reauth-uri-copy code {
  flex: 1;
  font-size: var(--fs-xs);
  overflow-x: auto;
  white-space: nowrap;
  color: var(--text-main);
}

.google-reauth-copy-btn {
  padding: 4px 10px;
  font-size: var(--fs-xs);
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
}

/* ==============================================================================
   BOTTOM NAVIGATION BAR (Thumb zone native)
   ============================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(56px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 300;
}

.nav-tab {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
  transition: color 0.15s ease, transform 0.1s ease;
}

.nav-tab:active {
  transform: scale(0.92);
}

.nav-tab.active {
  color: var(--text-link);
}

.nav-tab.active svg {
  stroke: var(--text-link);
  stroke-width: 2.3;
}

.nav-tab-icon-wrap {
  position: relative;
  display: inline-flex;
}

.nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--color-pastille);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.125rem;
  text-align: center;
}

/* ==============================================================================
   BANNIÈRE D'INSTALLATION PWA (A2HS)
   ============================================================================== */
.install-banner {
  position: fixed;
  top: calc(var(--header-height) + var(--safe-top));
  left: 0;
  right: 0;
  z-index: 96;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-accent);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  animation: slideDown 0.25s ease;
}

.install-banner.hidden {
  display: none !important;
}

.install-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.install-app-icon {
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.install-texts {
  min-width: 0;
}

.install-texts strong {
  display: block;
  font-size: var(--fs-sm);
  color: var(--text-main);
}

.install-texts p {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.install-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.install-btn-ok {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.install-btn-ok:active {
  background: #1d4ed8;
  transform: scale(0.95);
}

.install-btn-dismiss {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
}

.install-btn-dismiss:active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

/* ==============================================================================
   WIDGET POINT DU JOUR (BRIEFING MATINAL)
   ============================================================================== */
.briefing-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(15, 23, 42, 0.8));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: var(--e3);
  margin-top: var(--e3);
  margin-bottom: var(--e2);
}

.briefing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--e2);
}

.briefing-badge {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.briefing-date {
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

.briefing-items {
  display: flex;
  flex-direction: column;
  gap: var(--e2);
}

.briefing-item {
  display: flex;
  align-items: center;
  gap: var(--e3);
  padding: var(--e2) var(--e3);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.15s ease;
}

.briefing-item:active {
  background: var(--bg-card-hover);
  transform: scale(0.98);
}

.briefing-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  color: var(--text-muted);
}

.briefing-text {
  min-width: 0;
}

.briefing-text strong {
  display: block;
  font-size: var(--fs-sm);
  color: var(--text-main);
}

.briefing-text span {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==============================================================================
   LOT 5 & 7 : COMMUTATEUR FORMAT MAIL & IFRAME NEWSLETTER (0.22.0)
   ============================================================================== */
/* Commutateur de vue bien visible au-dessus du corps */
.mail-format-toggle {
  display: inline-flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-pill);
  padding: 4px;
  margin: var(--e2) 0;
}

.format-toggle-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.15s ease;
}

.format-toggle-btn.actif {
  background: var(--color-primary);
  color: #ffffff;
}

/* Conteneur Newsletter Responsive façon Webmail */
.mail-conteneur-html {
  width: 100%;
  background: #ffffff;
  border-radius: var(--radius-md);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--e2) 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 350px;
}

.mail-iframe-rendu {
  width: 100%;
  min-height: 350px;
  border: none;
  display: block;
  background: #ffffff;
}

/* ==============================================================================
   LOT 6 : NAVIGATION CONTINUE MOBILE & FENÊTRES AU-DESSUS DE LA BARRE (0.22.0)
   ============================================================================== */
@media (max-width: 600px) {
  #mails-backdrop,
  #annuaire-backdrop,
  #notif-backdrop,
  #evenements-backdrop {
    bottom: calc(56px + var(--safe-bottom));
    height: auto;
    max-height: calc(100dvh - 56px - var(--safe-bottom));
    z-index: 200; /* Sur mobile, sous la bottom-nav (300) pour permettre la navigation continue */
  }

  #taches-backdrop,
  #suivi-backdrop,
  #classement-backdrop,
  #note-modal-backdrop,
  #notif-feuille-backdrop {
    z-index: 450; /* Au-dessus de la bottom-nav (300) pour garantir l'accès direct aux boutons d'actions */
  }

  #mails-backdrop .modal-card,
  #annuaire-backdrop .modal-card,
  #notif-backdrop .modal-card,
  #evenements-backdrop .modal-card {
    height: 100%;
    max-height: 100%;
    padding-bottom: var(--e3);
  }
}

/* Guide d'installation Safari iOS */
.ios-install-sheet {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 350;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.ios-install-sheet.hidden {
  display: none;
}

.ios-install-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-accent);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--e4);
  padding-bottom: calc(var(--e4) + var(--safe-bottom));
  animation: monte 0.25s var(--courbe);
  color: var(--text-main);
}

.ios-install-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--e3);
}

.ios-install-header strong {
  font-size: var(--fs-md);
  font-weight: 600;
}

.ios-install-card p {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: var(--e3);
}

.ios-steps {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--e2);
  font-size: var(--fs-sm);
}

.ios-steps li {
  line-height: 1.4;
}

/* Indicateur d'attente hors-ligne (Outbox) */
.user-message.pending-outbox {
  opacity: 0.85;
  border: 1px dashed var(--border-accent);
}

.outbox-pending-tag {
  font-size: var(--fs-xs);
  color: #f59e0b;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.outbox-sent-tag {
  font-size: var(--fs-xs);
  color: #10b981;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: apparait 0.2s ease-out;
}

/* ==============================================================================
   AUTHENTIFICATION SOUVERAINE & DOUBLE FACTEUR (2FA) — CHANTIER 1
   ============================================================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at 50% 20%, #172554 0%, #070b14 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--e4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.auth-overlay.hidden {
  display: none !important;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: var(--e5);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 40px rgba(37, 99, 235, 0.15);
  animation: apparait 0.25s var(--courbe);
  color: var(--text-main);
  max-height: 90vh;
  overflow-y: auto;
}

.auth-header {
  text-align: center;
  margin-bottom: var(--e4);
}

.auth-avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--e3);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(245, 158, 11, 0.2));
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
}

.auth-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  margin: 0 0 var(--e1);
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 40%, var(--color-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-subtitle {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin: 0 0 var(--e2);
}

.auth-tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  border-radius: var(--radius-pill);
  background: rgba(37, 99, 235, 0.15);
  color: var(--text-link);
  border: 1px solid rgba(37, 99, 235, 0.3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--e3);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: var(--e1);
  text-align: left;
}

.auth-field label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-field input {
  height: var(--cible);
  padding: 0 var(--e3);
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: var(--fs-md);
  font-family: inherit;
  transition: border-color var(--duree) var(--courbe), box-shadow var(--duree) var(--courbe);
  width: 100%;
}

.auth-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.auth-password-wrapper input {
  padding-right: 48px; /* réserve l'espace pour le bouton œil */
}

.auth-toggle-pwd {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color var(--duree) var(--courbe), background-color var(--duree) var(--courbe);
}

.auth-toggle-pwd:hover,
.auth-toggle-pwd:focus-visible {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.auth-toggle-pwd svg {
  display: block;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.auth-totp-field input {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  letter-spacing: 0.35em;
  text-align: center;
}

.auth-step-desc {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: var(--lh-texte);
  margin: 0;
  text-align: center;
}

.auth-checkbox-field {
  margin: var(--e1) 0;
}

.auth-checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--e2);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.auth-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.auth-error-box {
  padding: var(--e2) var(--e3);
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--color-red);
  border-radius: var(--radius-sm);
  color: var(--text-danger);
  font-size: var(--fs-sm);
  line-height: 1.4;
  animation: apparait 0.2s ease-out;
}

.auth-submit-btn {
  height: var(--cible);
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--fs-md);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--e2);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  transition: transform var(--duree) var(--courbe), box-shadow var(--duree) var(--courbe);
}

.auth-submit-btn:hover {
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}

.auth-submit-btn:active {
  transform: translateY(0);
}

.auth-actions {
  display: flex;
  gap: var(--e2);
}

.auth-back-btn {
  height: var(--cible);
  padding: 0 var(--e4);
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
}

.auth-back-btn:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}

.auth-actions .auth-submit-btn {
  flex: 1;
}

.auth-qr-container {
  background: #ffffff;
  padding: var(--e3);
  border-radius: var(--radius-md);
  margin: var(--e2) auto;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.auth-qr-container svg {
  width: 100% !important;
  height: 100% !important;
}

.auth-secret-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--e2);
  margin: var(--e1) 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.auth-secret-code {
  font-family: var(--font-mono);
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  color: var(--color-gold);
  letter-spacing: 0.1em;
  user-select: all;
}

.auth-logout-btn {
  padding: 6px 14px;
  font-size: var(--fs-xs);
  font-weight: 600;
  background: rgba(239, 68, 68, 0.15);
  color: var(--text-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--duree) var(--courbe);
}

.auth-logout-btn:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* ==============================================================================
   CHANTIER 1 & 2 : LAYOUT DESKTOP EXÉCUTIF & ÉVÉNEMENTS (SPEC_UX_WEB_EVENEMENTS_GRIST)
   ============================================================================== */
.desktop-sidebar {
  display: none;
}

.desktop-sidecar {
  display: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #14203a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  font-family: inherit;
  border-radius: 8px;
  color: #94a3b8;
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease-in-out;
}

.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
}

.sidebar-nav-item.active {
  background: #1e293b;
  color: #38bdf8;
  box-shadow: inset 3px 0 0 #38bdf8;
}

.sidebar-nav-item:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

/* Une seule famille d'icônes au trait, dans une case fixe : les libellés partent tous du même bord */
.sidebar-icone {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
}

.sidebar-libelle {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Le second groupe (Suivi, Réglages, Plus) est poussé en bas du panneau */
.sidebar-nav-separateur {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
}

.sidebar-badge {
  flex-shrink: 0;
  min-width: 1.375rem;
  height: 1.375rem;
  padding: 0 6px;
  line-height: 1.375rem;
  border-radius: var(--radius-pill);
  background: var(--color-pastille);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-align: center;
}

.sidebar-footer {
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.sidebar-version {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* Sidecar Desktop */
.sidecar-bloc {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.sidecar-header-row,
.sidecar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sidecar-titre,
.sidecar-section-title {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sidecar-date {
  font-size: var(--fs-xs);
  color: var(--color-gold);
  font-weight: 600;
}


.sidecar-kpi-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #14203a;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidecar-kpi-heure {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: #38bdf8;
}

.sidecar-kpi-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidecar-kpi-info strong {
  font-size: var(--fs-xs);
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidecar-kpi-info span {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.sidecar-link-btn {
  background: transparent;
  border: none;
  color: var(--text-link);
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.sidecar-link-btn:hover {
  text-decoration: underline;
}

.sidecar-events-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidecar-event-placeholder {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-align: center;
  padding: 10px 0;
}

.sidecar-event-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #0f172a;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 0.15s ease;
}

.sidecar-event-mini:hover {
  background: #1e293b;
}

.sidecar-event-mini-date {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-gold);
  min-width: 44px;
}

.sidecar-event-mini-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.sidecar-event-mini-titre {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidecar-event-mini-commune {
  font-size: var(--fs-xs);
  color: #94a3b8;
}

/* Modale et Liste Événements */
.evenements-card {
  display: flex;
  flex-direction: column;
  max-width: 640px;
  height: calc(100vh - 40px - var(--safe-top) - var(--safe-bottom));
  height: calc(100dvh - 40px - var(--safe-top) - var(--safe-bottom));
  padding: 16px;
}

@media (min-width: 768px) {
  .evenements-card {
    max-width: 860px;
    width: 90vw;
  }
}

.evenements-titre-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.evenements-icone-titre {
  font-size: 1.25rem;
}

.evenements-compteur-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  color: var(--color-gold);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  font-size: var(--fs-xs);
  font-weight: 700;
}

.evenements-controles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.evenements-filtres-row {
  display: flex;
  flex-direction: column;
  gap: 8px; /* les zones de toucher (36 px + 4 px de part et d'autre) ne se chevauchent pas */
}

.evenements-filtres {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.evenements-filtre {
  background: transparent;
  border: 1px solid var(--border-accent);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: all 0.15s ease;
}

.evenements-filtre.actif {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.evenements-recherche-wrap {
  width: 100%;
}

.evenements-liste {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--e3);
}

.evenement-card {
  display: flex;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.evenement-card:hover {
  border-color: var(--border-accent);
}

.evenement-card.est-weekend {
  border-left: 3px solid var(--color-gold);
}

.evenement-date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 54px;
  min-width: 54px;
  height: 64px;
  background: #14203a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  text-align: center;
  line-height: 1;
  padding: 4px 2px;
}

.ev-date-jour {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
}

.ev-date-num {
  font-size: 1.25rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 3px 0 2px;
}

.ev-date-mois {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-link);
  text-transform: uppercase;
}

.evenement-corps {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.evenement-meta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: var(--fs-xs);
}

.evenement-badge-perimetre {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.evenement-badge-perimetre.badge-ville {
  background: #d9e8f5;
  color: #0c4a6e;
}

.evenement-badge-perimetre.badge-ccac {
  background: #dcfce7;
  color: #14532d;
}

.evenement-badge-doute {
  background: #fef3c7;
  color: #92400e;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.evenement-commune {
  color: var(--text-muted);
  font-weight: 500;
}

.evenement-titre {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  line-height: 1.35;
}

.evenement-horaire,
.evenement-lieu {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.evenement-desc {
  font-size: var(--fs-xs);
  color: #94a3b8;
  line-height: 1.4;
  margin: 2px 0 6px;
}

.evenement-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.btn-action-ev {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-accent);
  background: transparent;
  color: var(--text-main);
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-action-ev:hover {
  background: var(--bg-card-hover);
  border-color: var(--color-primary);
  color: #93c5fd;
}

.evenement-affiche-wrap {
  width: 72px;
  min-width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  display: none;
  align-items: center;
  justify-content: center;
}

.evenement-affiche-wrap.affiche-chargee {
  display: flex;
}

.evenement-affiche-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.2s ease, opacity 0.2s ease;
  font-size: 0 !important;
  color: transparent !important;
  line-height: 0 !important;
  text-indent: -9999px;
  display: block;
}

.evenement-affiche-thumb:hover {
  transform: scale(1.06);
}

/* ==============================================================================
   RESPONSIVE DESKTOP LAYOUT (>= 1024px & >= 1280px)
   ============================================================================== */
@media (min-width: 1024px) {
  .bottom-nav {
    display: none !important;
  }

  .desktop-sidebar {
    display: flex !important;
    flex-direction: column;
    width: 240px;
    background: #0f172a;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 100;
    padding: 18px 12px;
    flex-shrink: 0;
    overflow-y: auto;
  }

  .app-header {
    left: 240px;
    width: calc(100% - 240px);
    transition: all 0.2s ease;
  }

  /* Le menu de gauche porte déjà la mascotte et le nom : pas de doublon dans l'en-tête */
  .app-header .avatar-container {
    display: none;
  }

  /* Le titre reste lu par les lecteurs d'écran (seul titre de niveau 1 de la page) */
  .app-header .assistant-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .chat-container {
    left: 240px !important;
    width: calc(100% - 240px) !important;
    bottom: var(--hauteur-pied, 80px) !important;
    padding-bottom: 20px;
  }

  .chat-history {
    max-width: 880px;
    margin: 0 auto;
    width: 100%;
  }

  .app-footer {
    left: 240px !important;
    width: calc(100% - 240px) !important;
    bottom: 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(11, 17, 32, 0.98);
  }

  .app-footer .input-bar {
    max-width: 880px;
    margin: 0 auto;
  }

  .modal-card.mails-card,
  .modal-card.evenements-card,
  .modal-card.cabinet-modal-card {
    max-width: 900px;
    width: 90vw;
  }
}

@media (min-width: 1280px) {
  .desktop-sidecar {
    display: flex !important;
    flex-direction: column;
    width: 380px !important;
    background: #0b1120;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    padding: 20px;
    overflow-y: auto;
    z-index: 90;
    gap: 18px;
  }

  .app-header {
    right: 380px !important;
    width: calc(100% - 240px - 380px) !important;
  }

  .chat-container {
    right: 380px !important;
    width: calc(100% - 240px - 380px) !important;
  }

  .app-footer {
    right: 380px !important;
    width: calc(100% - 240px - 380px) !important;
  }
}

/* ==============================================================================
   CHANTIER 1 : ESPACE « MON CABINET & RÉGLAGES » (ZÉRO JARGON)
   ============================================================================== */
.auth-aide-cabinet {
  margin-top: 14px;
  text-align: center;
}

.auth-aide-link {
  font-size: var(--fs-xs);
  color: var(--color-muted, #94a3b8);
  text-decoration: underline;
  transition: color 0.15s ease;
}

.auth-aide-link:hover {
  color: var(--color-primary-light, #60a5fa);
}

.cabinet-modal-card {
  max-width: 900px;
  width: 95vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.cabinet-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cabinet-header-icon {
  font-size: 1.625rem;
  line-height: 1;
}

.cabinet-modal-subtitle {
  font-size: var(--fs-xs);
  color: var(--color-muted, #94a3b8);
  display: block;
}

/* 5 Volets horizontaux */
.cabinet-tabs {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.cabinet-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-muted, #94a3b8);
  font-size: var(--fs-xs);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.cabinet-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
}

.cabinet-tab-btn.active {
  background: rgba(37, 99, 235, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  font-weight: 600;
}

.cabinet-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.cabinet-intro-bloc {
  background: rgba(30, 41, 59, 0.5);
  border-left: 3px solid var(--color-primary, #2563eb);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 20px;
}

.cabinet-intro-bloc h3 {
  margin: 0 0 4px 0;
  font-size: 0.9375rem;
  color: #f8fafc;
}

.cabinet-intro-bloc p {
  margin: 0;
  font-size: var(--fs-xs);
  color: #94a3b8;
  line-height: 1.4;
}

.cabinet-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.cabinet-form-grid.hours-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.cabinet-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cabinet-field.full-width {
  grid-column: 1 / -1;
}

.cabinet-field label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cabinet-field input,
.cabinet-field select,
.cabinet-field textarea {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.6);
  color: #f8fafc;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.cabinet-field input:focus,
.cabinet-field select:focus,
.cabinet-field textarea:focus {
  border-color: var(--color-primary, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.cabinet-hint {
  font-size: var(--fs-xs);
  color: #94a3b8;
  line-height: 1.4;
  margin-top: 4px;
}

.cabinet-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}

.cabinet-feedback {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: var(--fs-xs);
  margin-bottom: 14px;
}

.cabinet-feedback.succes {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.cabinet-feedback.erreur {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.cabinet-subheading {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #e2e8f0;
  margin: 16px 0 10px 0;
}

.cabinet-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 20px 0;
}

/* Cartes Boîtes aux lettres */
.cabinet-boites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.cabinet-boite-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.cabinet-boite-icon {
  font-size: 1.375rem;
}

.cabinet-boite-info {
  flex: 1;
}

.cabinet-boite-nom {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: #f8fafc;
}

.cabinet-boite-statut {
  font-size: var(--fs-xs);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.dot-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-status.actif {
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

.dot-status.deconnecte {
  background: #f59e0b;
}

/* Card Box */
.cabinet-card-box {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
}

.cabinet-card-box-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.cabinet-card-box-icon {
  font-size: 1.5rem;
}

.cabinet-card-box-info {
  flex: 1;
}

.cabinet-card-box-info h4 {
  margin: 0 0 4px 0;
  font-size: 0.9375rem;
  color: #f8fafc;
}

.cabinet-card-box-info p {
  margin: 0;
  font-size: var(--fs-xs);
  color: #94a3b8;
  line-height: 1.4;
}

.cabinet-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}

.cabinet-badge.badge-active {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.cabinet-badge.badge-warning {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.cabinet-card-box-actions {
  display: flex;
  justify-content: center;
  margin: 14px 0 8px 0;
}

.btn-large {
  padding: 12px 24px !important;
  font-size: 0.9375rem !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.cabinet-territoire-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(15, 23, 42, 0.5);
  padding: 12px 14px;
  border-radius: 8px;
}

.cabinet-param-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-xs);
  color: #94a3b8;
}

.cabinet-param-row strong {
  color: #f1f5f9;
}

/* Sessions list */
.cabinet-sessions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.cabinet-session-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  font-size: var(--fs-xs);
}

.cabinet-session-device {
  font-weight: 500;
  color: #e2e8f0;
}

.cabinet-session-meta {
  font-size: var(--fs-xs);
  color: #94a3b8;
  margin-top: 2px;
}

.cabinet-urgence-bloc {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px;
  margin-top: 14px;
}

.danger-btn {
  background: #dc2626;
  color: #ffffff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.danger-btn:hover {
  background: #b91c1c;
}

/* Agenda Souverain & Hub d'Action La Suite */
.cabinet-souverain-card {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.25) 0%, rgba(15, 23, 42, 0.6) 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.cabinet-transition-card {
  opacity: 0.85;
  background: rgba(15, 23, 42, 0.3);
  border-style: dashed;
}

.cabinet-flux-box {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px;
  margin: 14px 0;
}

.cabinet-flux-title {
  margin: 0 0 6px 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #f1f5f9;
}

.cabinet-flux-desc {
  margin: 0 0 14px 0;
  font-size: var(--fs-xs);
  color: #94a3b8;
  line-height: 1.45;
}

.cabinet-flux-actions {
  display: flex;
  margin-bottom: 14px;
}

.cabinet-copy-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cabinet-copy-field label {
  font-size: var(--fs-xs);
  color: #94a3b8;
  font-weight: 500;
}

.cabinet-copy-input-group {
  display: flex;
  gap: 8px;
}

.cabinet-copy-input-group input {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #cbd5e1;
  padding: 8px 12px;
  font-size: 1rem;
  font-family: monospace;
}

.cabinet-copy-feedback {
  font-size: var(--fs-xs);
  color: #4ade80;
  font-weight: 500;
  margin-top: 2px;
}

.cabinet-interco-section {
  margin: 16px 0 10px 0;
}

.cabinet-interco-title {
  margin: 0 0 10px 0;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: #e2e8f0;
}

.cabinet-interco-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.cabinet-interco-pill {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
}

.interco-icon {
  font-size: 1.125rem;
  line-height: 1;
}

.interco-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.interco-text strong {
  font-size: var(--fs-xs);
  color: #f8fafc;
}

.interco-text span {
  font-size: var(--fs-xs);
  color: #94a3b8;
  line-height: 1.35;
}

/* ==============================================================================
   v0.25.0 — HUB D'ACTION AGENDA, SIDECAR TEMPS RÉEL, PALETTE CTRL+K & SPLIT MAILS
   ============================================================================== */

/* Bouton d'ajout 1 clic inscrit à l'agenda officiel */
.btn-action-ev.btn-ev-agenda.inscrit {
  background: rgba(34, 197, 94, 0.18) !important;
  border-color: rgba(34, 197, 94, 0.45) !important;
  color: #86efac !important;
  font-weight: 600;
}

/* Sidecar Exécutif : Engagements réels & Courriels prioritaires */
.sidecar-engagements-list,
.sidecar-mails-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidecar-engagement-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sidecar-engagement-item:hover {
  background: rgba(37, 99, 235, 0.14);
  border-color: rgba(59, 130, 246, 0.35);
}

.sidecar-engagement-heure {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.18);
  padding: 4px 7px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.sidecar-engagement-corps {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.sidecar-engagement-titre {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.sidecar-engagement-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: var(--fs-xs);
  color: #94a3b8;
}

.sidecar-badge-mandat {
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.sidecar-badge-mandat.ccac {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.sidecar-mail-mini {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 11px;
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: inherit;
  font: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sidecar-mail-mini:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(250, 204, 21, 0.35);
}

.sidecar-mail-mini-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  color: #cbd5e1;
  font-weight: 600;
}

.sidecar-mail-mini-exp {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.sidecar-mail-mini-objet {
  font-size: var(--fs-xs);
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Bouton Recherche rapide dans le header (Desktop uniquement) */
.header-cmdk-btn {
  display: none !important;
}

@media (min-width: 1024px) {
  .header-cmdk-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    width: auto !important;
    height: 36px !important;
    padding: 0 12px !important;
    border-radius: 999px !important;
    background: rgba(30, 41, 59, 0.75) !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    color: #cbd5e1 !important;
    font-size: var(--fs-xs);
    margin-right: 4px;
  }

  .header-cmdk-btn:hover {
    background: rgba(51, 65, 85, 0.85) !important;
    border-color: rgba(96, 165, 250, 0.45) !important;
    color: #f8fafc !important;
  }

  .cmdk-trigger-kbd {
    font-family: inherit;
    font-size: var(--fs-xs);
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #94a3b8;
  }

  /* Consultation Courriels Master-Detail côte à côte sur grand écran */
  .modal-card.mails-card.mode-split {
    max-width: 1140px;
    width: 92vw;
    height: 86vh;
  }

  #mails-corps.mail-detail-actif {
    display: grid;
    grid-template-columns: 370px minmax(0, 1fr);
    gap: 18px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  #mails-corps.mail-detail-actif #mails-vue-liste.hidden {
    display: flex !important;
    padding-right: 14px;
    border-right: 1px solid rgba(148, 163, 184, 0.16);
  }

  #mails-corps.mail-detail-actif #mails-vue-detail {
    min-width: 0;
    padding-left: 2px;
  }
}

/* Palette de Commande Rapide Exécutive (#cmdk-backdrop) */
.cmdk-backdrop {
  align-items: flex-start !important;
  padding-top: min(12vh, 96px) !important;
  z-index: 1200 !important;
}

.cmdk-card {
  width: min(580px, 94vw);
  max-height: 76vh;
  background: #0f172a;
  border: 1px solid rgba(96, 165, 250, 0.32);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cmdk-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.95);
}

.cmdk-search-icon {
  color: #60a5fa;
  flex-shrink: 0;
}

.cmdk-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-size: 1rem;
  font-family: inherit;
}

.cmdk-input::placeholder {
  color: var(--text-dim);
}

.cmdk-results {
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 54vh;
}

.cmdk-section-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 8px 10px 4px;
}

.cmdk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #e2e8f0;
  text-align: left;
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  transition: background 0.1s ease;
}

.cmdk-item:hover,
.cmdk-item.selected {
  background: rgba(37, 99, 235, 0.22);
  color: #ffffff;
}

.cmdk-item-icon {
  font-size: 1.125rem;
  line-height: 1;
  flex-shrink: 0;
}

.cmdk-item-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.cmdk-item-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmdk-item-sub {
  font-size: var(--fs-xs);
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmdk-item-tag {
  font-size: var(--fs-xs);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  flex-shrink: 0;
}

.cmdk-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: rgba(2, 6, 23, 0.65);
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

.cmdk-footer kbd {
  font-family: inherit;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  margin-right: 3px;
}




/* Classement des pièces jointes (0.28.0) */
.classement-liste { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.classement-piece { padding: 10px 12px; border-radius: 10px; background: var(--color-surface-2, rgba(127, 127, 127, 0.08)); overflow-wrap: anywhere; }
.classement-piece .classement-detail { font-size: 0.9em; opacity: 0.8; margin-top: 2px; }
.classement-piece .action-btn { margin-top: 8px; min-height: 44px; }

/* ==============================================================================
   TYPOGRAPHIE : RGAA (10.4, 10.11, 10.12, 3.2) ET CONFORT DE LECTURE (0.36.0)
   Règles : docs/TYPOGRAPHIE.md. Toutes les tailles de texte sont en rem (aucune en px).
   ============================================================================== */

/* Champs de saisie : 16 px au moins, sinon Safari sur iPhone zoome tout seul à la saisie.
   Valeur de base ; une règle propre à un champ peut l'agrandir (code à 6 chiffres), jamais la réduire
   (contrôlé par tests/pwa-typographie.test.ts). */
input,
textarea,
select {
  font-size: 1rem;
}

/* Chiffres alignés en colonnes dans les tableaux, les heures et les compteurs */
table,
time,
.suivi-table,
.bubble-header,
.sidecar-kpi-heure,
.sidecar-engagement-heure,
.ev-date-num {
  font-variant-numeric: tabular-nums;
}

/* Longueur de ligne : 65 à 70 caractères pour le texte à lire en continu (au-delà de 80, l'œil perd la ligne).
   En rem, pas en ch : les blocs voisins de la fiche d'un mail gardent la même largeur. */
.bubble-body,
.mail-detail-texte,
.mail-bref,
.mail-a-retenir,
.mail-assistant-reponse,
.fiche-resume {
  max-width: 42rem;
}

/* Très peu de hauteur (zoom à 400 % sur PC, téléphone couché) : la zone de lecture garde la place */
@media (max-height: 420px) {
  :root {
    --header-height: 48px;
  }
  .suggestions {
    display: none;
  }
}

/* Barre d'onglets : un libellé ne déborde jamais sur l'onglet voisin (320 px, espacements imposés) */
.nav-tab > span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ==============================================================================
   PAGE « AUJOURD'HUI » (R4, R5 et R9 de l'audit du 12/11/2026)
   Page d'accueil du téléphone ; sur ordinateur, le même contenu occupe le volet de droite.
   ============================================================================== */
:root {
  --largeur-volet: 320px;
}

.aujourdhui,
.retour-aujourdhui {
  display: none;
}

.aujourdhui-entete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--e3);
  margin-bottom: var(--e3);
}

.aujourdhui-titre {
  margin: 0;
  font-size: var(--fs-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.aujourdhui-date {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  text-align: right;
}

.aujourdhui-corps {
  display: flex;
  flex-direction: column;
  gap: var(--e3);
}

.auj-bloc {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--e2) var(--e3);
}

.auj-bloc--attention {
  border-color: var(--color-gold);
}

.auj-bloc-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--e2);
  min-height: 44px;
}

.auj-bloc-titre {
  display: flex;
  align-items: center;
  gap: var(--e2);
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-muted);
}

.auj-lien {
  min-height: 44px;
  padding: 0 var(--e2);
  margin-right: calc(-1 * var(--e2));
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-link);
  font-family: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
}

.auj-item {
  display: flex;
  align-items: flex-start;
  gap: var(--e3);
  width: 100%;
  min-height: var(--cible);
  padding: var(--e2) 0;
  background: none;
  border: none;
  border-top: 1px solid var(--border-subtle);
  border-radius: 0;
  color: var(--text-main);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.auj-item:hover .auj-item-titre {
  color: var(--text-link);
}

.auj-item:focus-visible,
.auj-lien:focus-visible,
.auj-bouton:focus-visible,
.aujourdhui-reprendre:focus-visible,
.retour-aujourdhui:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.auj-heure {
  flex: 0 0 4rem;
  display: flex;
  flex-direction: column;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.auj-jour {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-muted);
}

.auj-item-corps {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auj-item-titre {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.auj-item-titre .ic {
  margin-right: 6px;
  vertical-align: -2px;
}

.auj-item-detail {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auj-item-detail--long {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.auj-item-marge {
  flex: 0 1 auto;
  max-width: 34%;
  font-size: var(--fs-xs);
  color: var(--text-dim);
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auj-vide {
  margin: 0;
  padding: var(--e1) 0 var(--e2);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.auj-attention {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--e3);
  min-height: var(--cible);
}

.auj-attention-texte {
  display: flex;
  align-items: center;
  gap: var(--e2);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.auj-bouton {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 var(--e4);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-pill);
  background: var(--bg-card-hover);
  color: var(--text-main);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}

.auj-bouton:disabled {
  opacity: 0.6;
  cursor: default;
}

.auj-bouton--discret {
  background: transparent;
  color: var(--text-muted);
}

.auj-alerte-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--e2);
  padding-bottom: var(--e2);
}

.auj-alerte-actions .notif-resultat {
  flex: 1;
  margin: 0;
  font-size: var(--fs-sm);
}

.aujourdhui-reprendre {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--e2);
  width: 100%;
  min-height: var(--cible);
  margin-top: var(--e4);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

/* Bandeau plein et opaque en haut de la conversation : les messages défilent dessous sans se mêler au texte */
.retour-aujourdhui {
  position: sticky;
  top: -16px;
  z-index: 5;
  align-items: center;
  gap: var(--e1);
  width: calc(100% + max(16px, var(--safe-left)) + max(16px, var(--safe-right)));
  min-height: 44px;
  padding: 0 max(16px, var(--safe-right)) 0 max(16px, var(--safe-left));
  margin: -16px calc(-1 * max(16px, var(--safe-right))) var(--e2) calc(-1 * max(16px, var(--safe-left)));
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  background: var(--bg-primary);
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}

/* Téléphone et tablette : Aujourd'hui à l'ouverture, la conversation au premier message */
@media (max-width: 1023.98px) {
  body.vue-aujourdhui .aujourdhui {
    display: block;
    max-width: 640px;
    margin: 0 auto;
  }

  body.vue-aujourdhui .chat-history,
  body.vue-aujourdhui .btn-bas {
    display: none !important;
  }

  body:not(.vue-aujourdhui) .retour-aujourdhui {
    display: flex;
  }
}

/* Ordinateur : la conversation au centre, Aujourd'hui toujours visible à droite (dès 1024 px) */
@media (min-width: 1024px) {
  .desktop-sidecar {
    display: flex !important;
    flex-direction: column;
    width: var(--largeur-volet) !important;
    background: #0b1120;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    padding: 20px;
    overflow-y: auto;
    z-index: 90;
    gap: 0;
  }

  /* Rien de la conversation ne passe sous le volet */
  .btn-bas {
    right: calc(var(--largeur-volet) + var(--e4));
  }

  .attachment-preview-drawer {
    left: 256px;
    right: calc(var(--largeur-volet) + 16px);
  }

  .app-header,
  .chat-container,
  .app-footer {
    right: var(--largeur-volet) !important;
    width: calc(100% - 240px - var(--largeur-volet)) !important;
  }
}

@media (min-width: 1280px) {
  :root {
    --largeur-volet: 380px;
  }
}

/* ==============================================================================
   LOT NAVIGATION (R2, R6, R19, R24 de l'audit du 12/11/2026)
   Mails, Territoire, Contacts et Alertes sont des pages : elles occupent la zone de contenu, sous l'en-tête et
   au-dessus de la barre basse, sans fond assombri, sans ✕ et sans glissement de fermeture.
   ============================================================================== */
.modal-backdrop.page-onglet {
  top: calc(var(--header-height) + var(--safe-top) + var(--hauteur-bandeaux, 0px));
  bottom: calc(56px + var(--safe-bottom));
  left: 0;
  right: 0;
  height: auto;
  max-height: none;
  padding: 0;
  align-items: stretch;
  justify-content: center;
  background: var(--bg-primary);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: none;
  z-index: 200; /* sous la barre basse (300) et sous l'en-tête n'est pas nécessaire : la page commence dessous */
}

.modal-backdrop.page-onglet > .modal-card,
.modal-backdrop.page-onglet:not(.hidden) > .modal-card {
  width: 100%;
  max-width: 1140px;
  height: 100%;
  max-height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--bg-primary);
  padding: var(--e3) max(var(--e4), var(--safe-right)) var(--e3) max(var(--e4), var(--safe-left));
  animation: none;
  transform: none !important;
}

/* Une page ne se ferme pas : on en sort par la barre basse ou le menu de gauche */
.page-onglet .modal-header > .modal-close[aria-label="Fermer"] {
  display: none;
}

@media (min-width: 1024px) {
  .modal-backdrop.page-onglet {
    left: 240px;
    right: 0;
    bottom: 0;
    z-index: 110; /* au-dessus de la conversation, de sa barre de saisie (100) et du volet (90), sous les fenêtres (400) */
  }

  .modal-backdrop.page-onglet > .modal-card,
  .modal-backdrop.page-onglet > .modal-card.mails-card.mode-split {
    width: 100%;
    max-width: 1140px;
    height: 100%;
    padding: var(--e4) var(--e5);
  }
}

/* Détail d'un mail ou d'une fiche (R6), sur téléphone : ← et ↻ dans l'en-tête, plus de sélecteur Mails / Mémoire
   (sur ordinateur la liste reste affichée à côté du mail : le sélecteur y garde son sens) */
@media (max-width: 1023.98px) {
  .mails-card.en-detail .mails-onglets {
    display: none;
  }
}

.mails-card.detail-mail #btn-mails-actualiser {
  margin-left: auto;
}

/* L'objet du mail se lit en entier dans le contenu ; le titre de l'en-tête reste pour les
   lecteurs d'écran */
.mails-card.detail-mail .modal-header h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.mails-card.detail-mail .modal-header {
  justify-content: flex-start;
  margin-bottom: var(--e1);
}

.mail-detail-objet {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

/* Les blocs du détail gardent leur hauteur : la barre d'actions collée en bas ne passe plus sur le contenu */
#mails-vue-detail > *,
#memoire-vue-detail > * {
  flex-shrink: 0;
}

/* Outils du mail : ‹ › et ⋯ sur téléphone, tout sur une ligne quand la place existe */
.mail-outils {
  flex-wrap: wrap;
  overflow: visible;
}

.mail-outils-menu {
  display: none;
  flex-basis: 100%;
  flex-direction: column;
  gap: var(--e2);
}

.mail-outils.menu-ouvert .mail-outils-menu {
  display: flex;
}

.mail-outils-menu .mail-outil {
  justify-content: flex-start;
  width: 100%;
}

.mail-outil-plus {
  margin-left: auto;
  min-width: 44px;
  font-size: 1.25rem;
  line-height: 1;
}

@media (min-width: 768px) {
  .mail-outil-plus {
    display: none;
  }

  .mail-outils-menu,
  .mail-outils.menu-ouvert .mail-outils-menu {
    display: contents;
  }

  .mail-outils-menu .mail-outil {
    width: auto;
  }
}

/* « En bref » replié à deux lignes au-dessus du texte du mail */
.mail-bref.replie .mail-bref-texte {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mail-bref-suite {
  min-height: 44px;
  padding: 0;
  background: none;
  border: none;
  color: var(--text-link);
  font-family: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
}

/* Grand écran : la page laisse le volet Aujourd'hui visible (liste et détail gardent la place qu'il leur faut) */
@media (min-width: 1600px) {
  .modal-backdrop.page-onglet {
    right: var(--largeur-volet);
  }
}

/* Écran d'ordinateur courant (moins de 1600 px) : la page ouverte prend toute la largeur, le volet et sa bande
   d'en-tête lui laissent la place */
@media (min-width: 1024px) and (max-width: 1599.98px) {
  body:has(.page-onglet:not(.hidden)) .desktop-sidecar {
    display: none !important;
  }

  body:has(.page-onglet:not(.hidden)) .app-header {
    right: 0 !important;
    width: calc(100% - 240px) !important;
  }
}

/* ==============================================================================
   PAGE AGENDA (R25 de l'audit du 12/11/2026)
   ============================================================================== */
.agenda-navigation {
  display: flex;
  align-items: center;
  gap: var(--e2);
  margin-bottom: var(--e2);
}

.agenda-periode {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.agenda-corps {
  gap: var(--e3);
}

.agenda-corps > * {
  flex-shrink: 0;
}

.agenda-jour {
  display: flex;
  flex-direction: column;
  gap: var(--e2);
}

.agenda-jour-titre {
  display: flex;
  align-items: center;
  gap: var(--e2);
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-muted);
}

.agenda-jour-titre button {
  min-height: 44px;
  padding: 0;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.agenda-jour.est-aujourdhui .agenda-jour-titre button {
  color: var(--text-main);
}

.agenda-jour-marque {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 700;
}

/* Jours sans rendez-vous : une ligne discrète, la semaine reste courte */
.agenda-jour.est-vide {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--e3);
}

.agenda-jour.est-vide .auj-vide {
  padding: 0;
}

.agenda-rdv {
  display: flex;
  align-items: flex-start;
  gap: var(--e3);
  width: 100%;
  min-height: var(--cible);
  padding: var(--e3);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--text-dim);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  text-align: left;
}

button.agenda-rdv {
  cursor: pointer;
}

button.agenda-rdv:hover {
  background: var(--bg-card-hover);
}

/* Couleur par mandat, toujours doublée du nom du mandat en toutes lettres */
.agenda-rdv--ville {
  border-left-color: #60a5fa;
}

.agenda-rdv--interco {
  border-left-color: #34d399;
}

.agenda-rdv-heure {
  flex: 0 0 3.5rem;
  display: flex;
  flex-direction: column;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.agenda-rdv-fin {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-muted);
}

.agenda-rdv-corps {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.agenda-rdv-titre {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.agenda-rdv-detail {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.agenda-rdv-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.agenda-mandat {
  font-weight: 700;
}

.agenda-mandat--ville {
  color: #93c5fd;
}

.agenda-mandat--interco {
  color: #6ee7b7;
}

.agenda-a-confirmer {
  padding: 1px 8px;
  border: 1px solid var(--color-gold);
  border-radius: var(--radius-pill);
  color: #fbbf24;
  font-weight: 600;
}

.agenda-rdv-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--e2);
}

.agenda-rdv-actions a.auj-bouton {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.agenda-territoire {
  margin-top: var(--e2);
  padding: var(--e2) var(--e3);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.agenda-rdv:focus-visible,
.agenda-jour-titre button:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.agenda-avis {
  margin: 0;
  padding: var(--e2) var(--e3);
  border: 1px solid var(--color-gold);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  color: var(--text-main);
}

/* ==============================================================================
   LOT CONFORT (0.42.0) : menu en feuille basse, Connexions, proposition des notifications
   ============================================================================== */

/* R10. Sur téléphone, le menu monte du bas : toutes ses lignes sont à portée du pouce */
@media (max-width: 600px) {
  #modal-backdrop {
    align-items: flex-end;
  }

  #modal-backdrop .menu-card {
    height: auto;
    max-height: calc(100dvh - var(--safe-top) - 40px);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: var(--e2) var(--e4) calc(var(--e3) + var(--safe-bottom));
    animation: feuille-monte 180ms ease-out;
  }

  /* Poignée : la feuille se referme en la tirant vers le bas, ou en touchant au-dessus */
  #modal-backdrop .menu-card::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    margin: 0 auto var(--e1);
    border-radius: var(--radius-pill);
    background: var(--border-accent);
  }
}

@keyframes feuille-monte {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  #modal-backdrop .menu-card {
    animation: none;
  }
}

/* R32. Connexions : ce qui demande une action en tête, le reste replié */
.status-a-faire {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-reste > summary {
  display: flex;
  align-items: center;
  min-height: var(--cible);
  padding: 0 var(--e2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.status-reste > summary::-webkit-details-marker {
  display: none;
}

.status-reste > summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--text-muted);
  transition: transform var(--duree) var(--courbe);
}

.status-reste[open] > summary::after {
  transform: rotate(180deg);
}

.status-reste > summary:focus-visible {
  outline: 2px solid var(--accent, currentColor);
  outline-offset: 2px;
}

.status-reste-corps {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: var(--e3);
}

/* R15. Page Aujourd'hui : proposition d'être prévenu, sans le ton d'une alerte */
.auj-proposition-texte {
  display: flex;
  align-items: flex-start;
  gap: var(--e2);
  margin: 0 0 var(--e2);
  font-size: 1rem;
  color: var(--text-main);
}

.auj-proposition-texte .ic {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--text-muted);
}

.auj-proposition-actions {
  display: flex;
  gap: var(--e2);
}

/* ==============================================================================
   PAGE PROJETS (0.43.0) : avancement des tableaux des mandats
   ============================================================================== */
.projets-corps {
  gap: var(--e3);
}

.projets-corps > * {
  flex-shrink: 0;
}

.projets-actions,
.projets-idee-actions,
.projet-carte-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--e2);
}

.projets-actions a.auj-bouton,
.projet-carte-actions a.auj-bouton {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.projets-idee {
  display: flex;
  flex-direction: column;
  gap: var(--e2);
  padding: var(--e3);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.projets-idee label,
.projet-carte-actions label {
  display: flex;
  flex-direction: column;
  gap: var(--e1);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.projets-idee input,
.projets-idee textarea,
.projet-carte-actions select {
  min-height: 44px;
  padding: var(--e2) var(--e3);
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
}

.projets-idee-actions {
  justify-content: flex-end;
}

.projets-resume {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.projet-retard {
  color: var(--color-red);
  font-weight: 600;
}

.projets-colonne {
  display: flex;
  flex-direction: column;
}

.projets-colonne > summary {
  display: flex;
  align-items: center;
  gap: var(--e2);
  min-height: 44px;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
}

.projets-colonne > summary::-webkit-details-marker {
  display: none;
}

.projets-colonne > summary::after {
  content: "▾";
  margin-left: auto;
  transition: transform var(--duree) var(--courbe);
}

.projets-colonne[open] > summary::after {
  transform: rotate(180deg);
}

.projets-colonne--elu > summary {
  color: var(--text-main);
}

.projets-compte {
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-card-hover);
  font-size: var(--fs-xs);
}

.projets-colonne--elu .projets-compte {
  background: var(--color-primary);
  color: #fff;
}

.projet-carte {
  margin-bottom: var(--e2);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--text-dim);
  border-radius: var(--radius-sm);
}

.projet-carte.est-retard {
  border-left-color: var(--color-red);
}

.projet-carte-tete {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-height: var(--cible);
  padding: var(--e2) var(--e3);
  background: none;
  border: none;
  color: var(--text-main);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.projet-carte-tete:focus-visible,
.projets-colonne > summary:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.projet-carte-titre {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.projet-carte-meta {
  display: flex;
  align-items: center;
  gap: var(--e1);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.projet-carte-meta.projet-retard {
  color: var(--color-red);
}

.projet-carte-meta .ic {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.projet-carte-actions {
  align-items: flex-end;
  padding: 0 var(--e3) var(--e3);
}

/* Page Projets : archivage des cartes terminées (0.50.0), bloc replié sous les tableaux */
.projets-archivage {
  gap: var(--e2);
  padding-top: var(--e2);
  border-top: 1px solid var(--border-subtle);
}

.projets-archivage > summary {
  padding: var(--e1) 0;
}

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

.projets-archivage-tete .projets-resume {
  font-weight: 400;
}

.projets-archivage > summary .projets-compte {
  flex-shrink: 0;
}

.projets-archivage-tableau {
  display: flex;
  flex-direction: column;
  gap: var(--e1);
  margin-top: var(--e2);
}

.projets-archivage-liste {
  margin: 0;
  padding: 0;
  list-style: none;
}

.projets-archive-ligne {
  margin-bottom: var(--e1);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--text-dim);
  border-radius: var(--radius-sm);
}

.projets-archive-ligne .projet-carte-tete {
  box-sizing: border-box;
  justify-content: center;
  text-decoration: none;
  cursor: default;
}

.projets-archive-ligne a.projet-carte-tete {
  cursor: pointer;
}

.projets-archive-ligne a.projet-carte-tete:hover .projet-carte-titre {
  color: var(--text-link);
  text-decoration: underline;
}

.projets-archivage-confirmer,
.projets-archivage-bilan {
  display: flex;
  flex-direction: column;
  gap: var(--e2);
  margin-top: var(--e2);
  padding: var(--e3);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.projets-archivage-confirmer p,
.projets-archivage-bilan p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.projets-archivage-bilan .projet-retard {
  font-weight: 400;
}

.projets-archivage > p.projets-resume {
  margin-top: var(--e3);
}

.projets-archivage-bilan p:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.projets-archivage-dernier {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--e2);
  margin-top: var(--e2);
}

.projets-archivage .projets-actions {
  margin-top: var(--e2);
}

.projets-archivage a.auj-lien {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin-right: 0;
  padding-left: 0;
}

/* Fiche « Confier une tâche » : collaborateurs et échéances en un toucher (R27) */
.fiche-tache-pastilles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--e2);
}

/* Page Projets : filtre par tableau, quand un mandat en suit plusieurs (0.51.0) */
.projets-tableaux .projets-compte {
  margin-left: var(--e1);
}

/* Page Projets : bilan par personne et relance préparée (0.45.0) */
.projet-bilan-ligne.est-retard {
  border-left-color: var(--color-red);
}

.projet-bilan-ligne {
  margin-bottom: var(--e2);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--text-dim);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-height: var(--cible);
  padding: var(--e2) var(--e3);
  color: var(--text-main);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.projets-relance {
  display: flex;
  flex-direction: column;
  gap: var(--e2);
  padding: 0 var(--e3) var(--e3);
}

.projets-relance label {
  display: flex;
  flex-direction: column;
  gap: var(--e1);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.projets-relance textarea {
  min-height: 88px;
  padding: var(--e2) var(--e3);
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
}

/* Page Projets : idée confiée, idées proches (0.47.0) */
.projets-confier {
  display: flex;
  flex-direction: column;
  gap: var(--e2);
  padding: 0 var(--e3) var(--e3);
}

.projets-confier label {
  display: flex;
  flex-direction: column;
  gap: var(--e1);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.projets-confier input[type="date"] {
  min-height: 44px;
  padding: var(--e2) var(--e3);
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
}

.projets-proches {
  padding: 0 var(--e3) var(--e2);
}

/* Événements associatifs (0.56.0) : fichiers de l'association sous l'aperçu du mail */
.notif-pieces {
  margin-top: 1rem;
  white-space: normal;
}
.notif-pieces ul {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
}
.notif-pieces .lien-texte {
  background: none;
  border: 0;
  padding: 0.25rem 0;
  min-height: 44px;
  color: inherit;
  text-decoration: underline;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.notif-pieces li {
  margin: 0.25rem 0;
}

/* Mails restés sans réponse (0.59.0) : filtre de la page Mails, encart du détail, bloc « À répondre » */
.mails-attente-entete {
  margin: 0 0 var(--e1);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.5;
}

.mail-item-attente {
  flex-shrink: 0;
  color: var(--color-gold);
  font-weight: 600;
}

.mail-item-motif {
  color: var(--text-muted);
  font-weight: 600;
}

.mail-attente {
  margin: var(--e2) 0;
  padding: var(--e2) var(--e3);
  border: 1px solid var(--border-accent);
  border-left: 3px solid var(--color-gold);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}

.mail-attente-texte {
  margin: 0 0 var(--e2);
  font-size: var(--fs-sm);
  color: var(--text-main);
  line-height: 1.5;
}

.mail-attente-texte .ic {
  margin-right: 6px;
  vertical-align: -2px;
  color: var(--color-gold);
}

.mail-attente-motif {
  color: var(--text-muted);
}

.mail-attente-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--e2);
}

.auj-item-marge--attente {
  color: var(--color-gold);
  font-weight: 600;
}

/* Promesses de l'élu restées sans suite (0.70.0) : filtre de la page Mails, encart du détail, bloc « À tenir » */
.mail-item-phrase {
  margin-top: 2px;
  font-size: var(--fs-md);
  font-style: italic;
  color: var(--text-main);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.mail-promesse-texte {
  margin: 0 0 var(--e1);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.5;
}

.mail-promesse-texte .ic {
  margin-right: 6px;
  vertical-align: -2px;
  color: var(--color-gold);
}

.mail-promesse-phrase {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-md);
  font-style: italic;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.mail-promesse-meta {
  margin: 0 0 var(--e2);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.5;
}

/* Dictée (0.70.0) : bouton caché tant que le navigateur ne sait pas dicter, annonce pour les lecteurs d'écran */
.mic-btn[hidden] {
  display: none !important;
}

.lecteur-seul {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.dictee-avertissement {
  margin: 0 0 var(--e2);
  font-size: var(--fs-md);
  color: var(--text-main);
  line-height: 1.5;
}

.dictee-precision {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.5;
}

/* Dossier de la veille : une rubrique par rendez-vous, intertitres (« Derniers mails »…) en petites capitales */
.point-section--dossier .point-ligne.est-synthese {
  margin-top: var(--e2);
  padding-bottom: 0;
}

.point-section--dossier .point-ligne.est-synthese .point-texte {
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Dossier d'un rendez-vous : chaque ligne liée s'ouvre d'un toucher */
.point-ligne.dossier-ligne {
  display: block;
  padding: 0;
}

.dossier-lien {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr) auto;
  gap: var(--e3);
  align-items: baseline;
  width: 100%;
  min-height: 44px;
  padding: var(--e2) var(--e1);
  margin: 0 calc(-1 * var(--e1));
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.sans-repere > .dossier-lien {
  grid-template-columns: minmax(0, 1fr) auto;
}

.dossier-lien:hover,
.dossier-lien:focus-visible {
  background: var(--bg-card-hover);
}

.dossier-lien:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.dossier-lien .point-texte {
  color: var(--color-primary-light, #60a5fa);
}

.dossier-suite {
  font-size: var(--fs-md);
  color: var(--text-muted);
}

.dossier-mots {
  margin: var(--e4) 0 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* Comptes rendus de réunion : liste, fiche et tâches à décider */
.cr-liste-annonce {
  margin: 0 0 var(--e3);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.cr-liste {
  display: flex;
  flex-direction: column;
  gap: var(--e2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.cr-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-height: 44px;
  padding: var(--e2) var(--e3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-main);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.cr-item.non-lu {
  border-left: 3px solid var(--color-gold);
}

.cr-item:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.cr-item-titre {
  font-size: var(--fs-md);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.cr-item-meta {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.cr-item-attente {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-gold);
}

.cr-resume {
  margin: 0 0 var(--e3);
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.5;
}

.cr-texte {
  font-size: var(--fs-md);
  line-height: 1.6;
}

.cr-taches {
  margin-top: var(--e4);
  padding-top: var(--e3);
  border-top: 1px solid var(--border-subtle);
}

.cr-taches-titre {
  margin: 0 0 var(--e2);
  font-size: var(--fs-lg);
}

.cr-taches-liste {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cr-tache {
  padding: var(--e2) 0;
}

.cr-tache + .cr-tache {
  border-top: 1px solid var(--border-subtle);
}

.cr-tache-titre {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.cr-tache-detail {
  margin: 2px 0 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.cr-tache-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--e2);
  margin-top: var(--e2);
}

.cr-tache-etat {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
}

a.auj-bouton {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.cr-tache-note {
  margin: var(--e1) 0 0;
  font-size: var(--fs-sm);
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* ==============================================================================
   CONVERSATIONS RANGÉES (0.70.0) : en-tête de la conversation ouverte, séparateurs de jour,
   feuille « Conversations » (groupes, actions, archives)
   ============================================================================== */

/* Bandeau plein et opaque en haut de la conversation : les messages défilent dessous */
.conv-entete {
  position: sticky;
  top: -16px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: var(--e1);
  min-height: 56px;
  padding: var(--e1) max(8px, var(--safe-right)) var(--e1) max(8px, var(--safe-left));
  margin: -16px calc(-1 * max(16px, var(--safe-right))) var(--e2) calc(-1 * max(16px, var(--safe-left)));
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-primary);
}

/* Le retour à Aujourd'hui (téléphone) devient un chevron dans le bandeau */
.conv-entete .retour-aujourdhui {
  position: relative;
  top: auto;
  flex: 0 0 auto;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
}

.conv-entete .retour-aujourdhui span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.conv-titre-btn {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: var(--e1) var(--e2);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-main);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.conv-titre-btn:hover,
.conv-btn:hover,
.conv-entete .retour-aujourdhui:hover {
  background: var(--bg-card);
}

.conv-titre-btn[aria-disabled="true"] {
  cursor: default;
}

.conv-titre-btn[aria-disabled="true"] .ic--modifier {
  display: none;
}

.conv-titre-ligne {
  display: flex;
  align-items: center;
  gap: var(--e1);
  min-width: 0;
  max-width: 100%;
}

.conv-titre {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 1rem;
  font-weight: 700;
}

.conv-titre-ligne .ic {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  color: var(--text-dim);
}

.conv-date {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.conv-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
}

.conv-btn .ic {
  width: 22px;
  height: 22px;
}

.conv-titre-btn:focus-visible,
.conv-btn:focus-visible,
.conv-entete .retour-aujourdhui:focus-visible,
.conv-ouvrir:focus-visible,
.conv-plus:focus-visible,
.conv-action:focus-visible,
.conv-nouvelle:focus-visible,
.conv-archivees > summary:focus-visible,
.conv-derniere button:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

/* Téléphone : le bandeau suit la conversation (caché sur la page Aujourd'hui) */
@media (max-width: 1023.98px) {
  body.vue-aujourdhui .conv-entete {
    display: none !important;
  }
}

/* Séparateur de jour dans le fil */
.jour-separateur {
  display: flex;
  align-items: center;
  gap: var(--e3);
  margin: var(--e2) 0 0;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.jour-separateur::before,
.jour-separateur::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--border-subtle);
}

.jour-separateur span::first-letter {
  text-transform: uppercase;
}

/* Accueil vide : la dernière conversation à reprendre, discrète */
.conv-derniere {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--e2);
  margin-top: var(--e3);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.conv-derniere.hidden {
  display: none;
}

.conv-derniere-titre {
  color: var(--text-main);
}

.conv-derniere button {
  min-height: 44px;
  padding: 0 var(--e2);
  border: 0;
  background: transparent;
  color: var(--text-link);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* Feuille « Conversations » */
.conv-nouvelle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--e2);
  width: 100%;
  min-height: 48px;
  margin-bottom: var(--e3);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.conv-groupe + .conv-groupe {
  margin-top: var(--e4);
}

.conv-groupe-titre {
  margin: 0 0 var(--e2);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-muted);
}

.conv-liste {
  display: flex;
  flex-direction: column;
  gap: var(--e2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.conv-ligne {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  white-space: normal;
}

.conv-ligne.ouverte {
  border-color: var(--color-primary);
}

.conv-ligne-rangee {
  display: flex;
  align-items: stretch;
}

.conv-ouvrir {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--e2) var(--e3);
  border: 0;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: transparent;
  color: var(--text-main);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.conv-ouvrir:hover {
  background: var(--bg-card-hover);
}

.conv-ligne-haut {
  display: flex;
  align-items: baseline;
  gap: var(--e2);
  min-width: 0;
}

.conv-ligne-titre {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 1rem;
  font-weight: 600;
}

.conv-ligne-quand {
  flex: 0 0 auto;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.conv-ligne-apercu {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.conv-ligne-meta {
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

.conv-plus {
  flex: 0 0 auto;
  width: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-left: 1px solid var(--border-subtle);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
}

.conv-plus[aria-expanded="true"] {
  background: var(--bg-card-hover);
}

.conv-plus .ic {
  width: 22px;
  height: 22px;
}

.conv-actions,
.conv-renommer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--e2);
}

.conv-actions {
  padding: var(--e2) var(--e3) var(--e3);
  border-top: 1px solid var(--border-subtle);
}

.conv-actions.hidden {
  display: none;
}

.conv-action {
  display: inline-flex;
  align-items: center;
  gap: var(--e1);
  min-height: 44px;
  padding: 0 var(--e3);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}

.conv-action:disabled {
  opacity: 0.6;
  cursor: default;
}

.conv-action-principale {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

.conv-renommer {
  display: flex;
  flex-direction: column;
  gap: var(--e2);
  padding: var(--e3);
}

.conv-renommer-libelle {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
}

.conv-renommer-champ {
  width: 100%;
  min-height: 44px;
  padding: var(--e2) var(--e3);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
}

.conv-renommer-actions {
  justify-content: flex-end;
}

.conv-archivees,
.conv-archivees-vide {
  margin-top: var(--e4);
}

.conv-archivees > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--e2);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}

.conv-archivees[open] > summary {
  margin-bottom: var(--e2);
}

.conv-archivees-vide {
  padding: 0 var(--e2);
  font-size: var(--fs-sm);
  color: var(--text-dim);
}

/* Les bulles (« Conversation archivée. » et son « Annuler ») restent visibles au-dessus des feuilles et fenêtres */
.toast-container {
  z-index: 500;
}
