:root {
  --c-primary: #2563eb;
  --c-primary-dark: #1d4ed8;
  --c-primary-light: #dbeafe;
  --c-cyan: #009d98;
  --c-cyan-dark: #007c78;
  --c-cyan-light: #d4f1ef;
  --c-accent: #f59e0b;
  --c-accent-dark: #d97706;
  --c-accent-light: #fef3c7;
  --c-bg: #f1f5fb;
  --c-surface: #ffffff;
  --c-text: #0f172a;
  --c-muted: #64748b;
  --c-border: #e2e8f0;
  --c-success: #16a34a;
  --c-danger: #dc2626;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow: 0 6px 24px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 18px 48px rgba(15, 23, 42, 0.12);
  --font-size-base: 18px;
  --gradient-brand: linear-gradient(135deg, #009d98 0%, #22c1c3 55%, #2563eb 100%);
  --gradient-soft: radial-gradient(1200px 500px at 10% -10%, #d4f1ef 0%, transparent 60%),
    radial-gradient(1000px 600px at 110% 10%, #dbeafe 0%, transparent 55%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f8 100%);
  /* Surfaces "tintées" utilisées dans tout le CSS — variabilisées pour le mode sombre. */
  --c-tint-cool: #f8fafc;        /* slate-50  : fonds très doux */
  --c-tint-cool-2: #f1f5f9;      /* slate-100 : hover/highlight */
  --c-tint-cool-3: #e2e8f0;      /* slate-200 : borders/lite */
  --c-tint-cool-4: #cbd5e1;      /* slate-300 : disabled */
  --c-error-bg: #fee2e2;
  --c-success-bg: #dcfce7;
  --c-info-bg: #eff6ff;
  --c-pink-bg: #fce7f3;
}

/* === Mode sombre ===
   Active via [data-theme="dark"] sur <html>. On redéfinit les variables
   et on ajoute quelques overrides pour les couleurs hardcodées les plus visibles. */
[data-theme="dark"] {
  --c-primary: #60a5fa;
  --c-primary-dark: #3b82f6;
  --c-primary-light: #1e3a8a;
  --c-cyan: #22c1c3;
  --c-cyan-dark: #009d98;
  --c-cyan-light: #0e3a3a;
  --c-accent: #fbbf24;
  --c-accent-dark: #f59e0b;
  --c-accent-light: #3a2a05;
  --c-bg: #0b1220;
  --c-surface: #1e293b;
  --c-text: #f1f5f9;
  --c-muted: #94a3b8;
  --c-border: #334155;
  --c-success: #4ade80;
  --c-danger: #f87171;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.6);
  --gradient-soft: radial-gradient(1200px 500px at 10% -10%, #0e3a3a 0%, transparent 60%),
    radial-gradient(1000px 600px at 110% 10%, #1e3a8a 0%, transparent 55%),
    linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
  --c-tint-cool: #293548;
  --c-tint-cool-2: #334155;
  --c-tint-cool-3: #475569;
  --c-tint-cool-4: #475569;
  --c-error-bg: #4b1d1d;
  --c-success-bg: #14532d;
  --c-info-bg: #1e3a8a;
  --c-pink-bg: #4a1d3a;
  /* Demande au navigateur d'utiliser ses chromes (scrollbars, dropdowns
     natifs des <select>, datepickers, etc.) en thème sombre. Sans cela
     la liste déroulante d'un <select> reste blanche en dark mode. */
  color-scheme: dark;
}

/* Sécurité supplémentaire pour les options des <select> : certains
   navigateurs (Chrome sur Windows notamment) ignorent color-scheme pour
   le menu déroulant. On force explicitement des couleurs sombres. */
[data-theme="dark"] select,
[data-theme="dark"] select option {
  background-color: var(--c-surface);
  color: var(--c-text);
}

[data-theme="dark"] .card {
  border-color: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .card.glass {
  background: rgba(30, 41, 59, 0.78);
  border-color: rgba(148, 163, 184, 0.18);
}

/* Liste des patients (vue proche/aidant) : fond bleu nuit en dark mode
   au lieu du gradient blanc → bleu très clair du mode clair. */
[data-theme="dark"] .patient-card {
  background: linear-gradient(135deg, #1e293b 0%, #1e3a8a 100%);
  border-color: rgba(96, 165, 250, 0.35);
}
[data-theme="dark"] .patient-card:hover {
  background: linear-gradient(135deg, #253347 0%, #243ea0 100%);
  filter: none;
}
[data-theme="dark"] .patient-card.archived {
  background: linear-gradient(135deg, #1a2333 0%, #243044 100%);
  border-color: var(--c-border);
}

/* Cercles décoratifs des stat-cards (Proches suivis / PIN définis / Sécurité) :
   en dark mode les variables --c-*-light deviennent sombres → invisibles.
   On force ici des teintes vives semi-transparentes pour que les ronds
   restent visibles sur fond sombre. */
[data-theme="dark"] .stat-card::before {
  background: rgba(96, 165, 250, 0.42);
  opacity: 1;
}
[data-theme="dark"] .stat-card.cyan::before {
  background: rgba(34, 193, 195, 0.42);
}
[data-theme="dark"] .stat-card.amber::before {
  background: rgba(251, 191, 36, 0.42);
}

/* Sélecteurs en cards (type de suivi, période) : en mode sombre, le fond
   sélectionné doit être assez foncé pour laisser lire le texte clair. */
[data-theme="dark"] .kind-option.selected,
[data-theme="dark"] .period-option.selected {
  background: linear-gradient(135deg, #1e3a8a 0%, #0e3a3a 100%);
  border-color: var(--c-primary);
  color: var(--c-text);
}

/* Boutons secondaires (« Annuler » notamment) : en dark mode, le fond
   var(--c-surface) sur une card var(--c-surface) les rendrait invisibles.
   On utilise une teinte plus claire et une bordure bleue contrastée pour
   bien démarquer le bouton du fond noir. */
[data-theme="dark"] button.secondary {
  background: var(--c-tint-cool);
  color: var(--c-primary);
  border-color: rgba(96, 165, 250, 0.5);
}
[data-theme="dark"] button.secondary:hover:not(:disabled) {
  background: var(--c-tint-cool-2);
  border-color: var(--c-primary);
}

/* Bouton flottant de bascule clair/sombre — visible sur toutes les pages. */
/* =========================================================================
   Toast global (composant <ToastHost />)
   ========================================================================= */
.toast-host {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(420px, calc(100% - 24px));
  max-width: 100%;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: 0 10px 28px -6px rgba(15, 23, 42, 0.28),
    0 4px 10px -2px rgba(15, 23, 42, 0.18);
  border: 1px solid var(--c-border);
  font-size: 0.92rem;
  line-height: 1.35;
  animation: toast-in 0.22s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.toast--success { border-left: 4px solid #10b981; }
.toast--error   { border-left: 4px solid #dc2626; }
.toast--info    { border-left: 4px solid #3b82f6; }
.toast__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}
.toast--success .toast__icon { background: #10b981; }
.toast--error   .toast__icon { background: #dc2626; }
.toast--info    .toast__icon { background: #3b82f6; }
.toast__msg {
  flex: 1;
  word-break: break-word;
}
.toast__close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  min-height: 0;
  border: none;
  background: transparent;
  color: var(--c-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  box-shadow: none;
}
.toast__close:hover:not(:disabled) {
  background: var(--c-tint-cool);
  color: var(--c-text);
  transform: none;
  box-shadow: none;
}
@media (max-width: 600px) {
  .toast-host { top: 60px; }
  .toast { font-size: 0.88rem; padding: 10px 12px; }
}

/* Barre de chrome (thème + déconnexion) rendue dans le flux, alignée à
   droite, sans plus aucun position:fixed — les boutons défilent désormais
   avec la page. */
.chrome-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 0;
  pointer-events: none;
}
.chrome-actions > * {
  pointer-events: auto;
}
.theme-toggle,
.logout-toggle {
  position: relative;
  width: 44px;
  height: 44px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  background: var(--c-surface);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease,
    color 0.2s ease;
}
.logout-toggle {
  margin-right: 4px;
}
.theme-toggle:hover:not(:disabled),
.logout-toggle:hover:not(:disabled) {
  background: var(--c-surface);
  transform: scale(1.06);
  box-shadow: var(--shadow);
}
.logout-toggle:hover:not(:disabled) {
  color: var(--c-danger);
  border-color: var(--c-danger);
}
.theme-toggle:active:not(:disabled),
.logout-toggle:active:not(:disabled) {
  transform: scale(0.96);
}

* {
  box-sizing: border-box;
}

/* =========================================================================
   Mode iframe d'aperçu (DeviceFrame GSM/tablette).
   iOS Safari (et certains contextes desktop avec iframe imbriqué) ne
   respectent pas position:fixed quand <body> est le conteneur scrollable :
   les boutons chrome (thème, déconnexion) défilent avec le contenu au
   lieu de rester ancrés au viewport.
   Patron iOS-safe : on retire totalement <body> du flux scrollable en le
   passant en position:fixed inset:0, et on délègue le scroll à un enfant
   #root en position:absolute. Les éléments position:fixed sont alors
   VRAIMENT fixes par rapport au viewport de l'iframe (parce que <body>
   ne scrolle plus du tout, même côté document).
   ========================================================================= */
html.cortexia-in-frame,
html.cortexia-in-frame body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}
html.cortexia-in-frame #root {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  /* Scrollbar masquée dans l'iframe d'aperçu : sinon elle empiète sur les
     boutons chrome (theme + logout) calés à right:8px et donne l'illusion
     qu'ils défilent avec le contenu. Le scroll reste fonctionnel (touch +
     molette). */
  scrollbar-width: none;
}
html.cortexia-in-frame #root::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
/* Hors iframe : quand on simule un appareil (GSM / tablette / watch), on
   cache uniquement les boutons thème + déconnexion (déjà rendus à
   l'intérieur de l'iframe). La toolbar de démo, elle, reste visible :
   c'est l'outil pour changer de mode. */
html[data-cortexia-view="gsm"]:not(.cortexia-in-frame) .chrome-actions > .theme-toggle,
html[data-cortexia-view="gsm"]:not(.cortexia-in-frame) .chrome-actions > .logout-toggle,
html[data-cortexia-view="tablette"]:not(.cortexia-in-frame) .chrome-actions > .theme-toggle,
html[data-cortexia-view="tablette"]:not(.cortexia-in-frame) .chrome-actions > .logout-toggle,
html[data-cortexia-view="watch"]:not(.cortexia-in-frame) .chrome-actions > .theme-toggle,
html[data-cortexia-view="watch"]:not(.cortexia-in-frame) .chrome-actions > .logout-toggle {
  display: none;
}

/* En aperçu tablette / GSM, on descend la barre d'aperçu pour l'aligner
   avec les boutons thème / déconnexion situés en haut du cadre simulé.
   (.device-stage étant en position:fixed, ce margin ne le décale pas.)
   Le GSM a une encoche → son chrome interne est un peu plus bas. */
html[data-cortexia-view="tablette"]:not(.cortexia-in-frame) .chrome-toolbar {
  margin-top: 40px;
}
html[data-cortexia-view="gsm"]:not(.cortexia-in-frame) .chrome-toolbar {
  margin-top: 50px;
}

/* Hors iframe : la .chrome-actions des pages détail (fiche patient, etc.)
   est dans le flux normal du document — derrière .device-stage qui est
   position:fixed z-index:1. On la fait flotter en top-right avec un z-index
   plus élevé pour qu'elle reste visible ET cliquable au-dessus du cadre
   simulé en mode tablette/gsm/watch. Children gardent pointer-events:auto. */
html[data-cortexia-view]:not(.cortexia-in-frame) .chrome-actions {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 100;
}

/* Pages avec sidebar master : les boutons d'aperçu (data-demo-toggle) sont
   dans le footer de la sidebar — invisibles derrière .device-stage en mode
   preview. device-frame.js les détache vers <body> pour survivre au hide et
   ce CSS les fait flotter en haut à droite. Selector indépendant du parent
   pour couvrir les deux états (avant/après détachement). */
html[data-cortexia-view]:not(.cortexia-in-frame) [data-demo-toggle] {
  position: fixed;
  top: 12px;
  right: 16px;
  left: auto;
  z-index: 100;
  width: auto;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  grid-template-columns: none;
  background: var(--c-surface);
  border-radius: 999px;
  padding: 6px 10px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--c-border);
}
/* Les boutons héritent d'un fond translucide blanc pour le sidebar foncé —
   sur le badge top-right (fond clair), on remet la couleur du chrome PC. */
html[data-cortexia-view]:not(.cortexia-in-frame) [data-demo-toggle] .chrome-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  color: var(--c-text);
  border-color: var(--c-border);
}
html[data-cortexia-view]:not(.cortexia-in-frame) [data-demo-toggle] .chrome-icon-btn.active {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}

html,
body,
#root {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: var(--font-size-base);
  color: var(--c-text);
  background: var(--gradient-soft);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  letter-spacing: -0.01em;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  min-height: 56px;
  padding: 0 24px;
  border: none;
  border-radius: var(--radius);
  background: var(--gradient-brand);
  background-size: 180% 180%;
  background-position: 0% 50%;
  color: white;
  font-weight: 600;
  font-size: 1.05rem;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.18);
  transition: background-position 0.4s ease, transform 0.15s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

button:hover:not(:disabled) {
  background-position: 100% 50%;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

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

/* Bouton réduit à une simple icône : aucun fond, aucune bordure, aucune
   ombre, aucun effet de survol. Annule entièrement la règle globale
   `button` (utilisé pour les actions Modifier/Supprimer). */
button.icon-btn-bare {
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  transition: none;
}
button.icon-btn-bare:hover:not(:disabled),
button.icon-btn-bare:active:not(:disabled) {
  background: none;
  box-shadow: none;
  transform: none;
}

/* Boutons d'actions de modal/dialog (Annuler, Créer, fermeture) sans effet
   de survol : neutralise la règle globale `button` (hauteur 56px, ombre,
   translateY au hover, dégradé). Les styles inline du bouton (padding,
   fond, bordure, couleur) restent appliqués. */
button.dialog-flat-btn {
  min-height: 0;
  box-shadow: none;
  transition: none;
  background-size: 100% 100%;
  background-position: 0% 50%;
}
button.dialog-flat-btn:hover:not(:disabled),
button.dialog-flat-btn:active:not(:disabled) {
  box-shadow: none;
  transform: none;
  background-position: 0% 50%;
}

/* Paginateur — Master › Questions. Boutons compacts (numéros de page +
   navigation), page courante en dégradé. Annule la règle globale
   `button` (hauteur 56px, ombre, effet de survol). */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 22px;
}
.pager button {
  min-height: 0;
  height: 36px;
  min-width: 36px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--c-border);
  background: var(--c-card);
  color: var(--c-text);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.pager button.pager-nav {
  width: 36px;
  padding: 0;
}
.pager button:hover:not(:disabled):not(.is-active) {
  border-color: var(--c-primary);
  color: var(--c-primary);
  background: var(--c-primary-light);
  transform: none;
  box-shadow: none;
}
.pager button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.pager button.is-active {
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
  cursor: default;
}
.pager-ellipsis {
  min-width: 20px;
  text-align: center;
  color: var(--c-muted);
  font-weight: 700;
  user-select: none;
}

button.secondary {
  background: var(--c-surface);
  color: var(--c-primary-dark);
  border: 2px solid var(--c-primary-light);
  box-shadow: none;
}

button.secondary:hover:not(:disabled) {
  background: var(--c-primary-light);
}

button.secondary.active-period {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}

button.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.2);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--c-border);
  border-radius: 12px;
  background: var(--c-surface);
  font-size: 1rem;
  transition: border-color 0.15s;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--c-primary);
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--c-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.app-shell {
  /* 60px ≈ barre de chrome (thème/déconnexion) rendue au-dessus : sans
     cette soustraction, toute page déborde et garde une scrollbar. */
  min-height: calc(100vh - 60px);
  padding: 24px;
  max-width: 900px;
  margin: 0 auto;
}

/* Variante "écran jeux & activités" : on profite davantage de la largeur
   pour afficher les chips et la grille de cards sans être à l'étroit. */
.app-shell.games-shell {
  max-width: 1200px;
  padding: 20px 16px;
}
@media (max-width: 600px) {
  .app-shell.games-shell {
    padding: 16px 10px;
  }
}

.card {
  background: var(--c-surface);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  border: 1px solid rgba(226, 232, 240, 0.5);
  animation: fadeInUp 0.45s ease both;
}

.card.glass {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-lg);
}

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

.card h1,
.card h2,
.card h3 {
  margin-top: 0;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 24px 0;
}

.header h1 {
  margin: 0;
  font-size: 1.6rem;
  color: var(--c-primary-dark);
}

.header .logout {
  background: transparent;
  color: var(--c-muted);
  min-height: auto;
  padding: 8px 16px;
  border: 1px solid var(--c-border);
}

/* Header spécifique à la page Profil patient */
.pc-page-header {
  margin-top: 8px;
  gap: 12px;
}
.pc-back-btn {
  background: transparent;
  color: var(--c-muted);
  min-height: auto;
  padding: 6px 12px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.pc-back-btn:hover {
  color: var(--c-text);
  border-color: var(--c-primary);
}

/* Bouton retour visible UNIQUEMENT en aperçu tablette/téléphone (à l'intérieur
   de l'iframe DeviceFrame) ou sur petit viewport (utilisateur mobile réel).
   En aperçu PC, la nav par onglets suffit — pas de retour. */
.preview-back-btn {
  display: none;
}
html.cortexia-in-frame .preview-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
@media (max-width: 720px) {
  .preview-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
}
.pc-header-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.pc-header-actions .btn-compact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 0.85rem;
  min-height: auto;
}

/* Toggle Proche / Super Admin (visible uniquement pour role=master)
   Segmented control avec indicateur coulissant gradient. */
.view-toggle {
  position: relative;
  display: inline-flex;
  background: linear-gradient(180deg, var(--c-tint-cool) 0%, var(--c-bg) 100%);
  border: 1px solid var(--c-border);
  border-radius: 14px;
  padding: 5px;
  gap: 0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}
.view-toggle__indicator {
  position: absolute;
  top: 5px;
  left: 5px;
  width: calc(50% - 5px);
  height: calc(100% - 10px);
  background: var(--gradient-brand);
  border-radius: 10px;
  box-shadow:
    0 6px 16px -4px rgba(36, 99, 159, 0.45),
    0 2px 4px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 0;
}
.view-toggle button {
  position: relative;
  z-index: 1;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: transparent;
  border: none;
  color: var(--c-muted);
  padding: 9px 18px;
  min-height: auto;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color 0.25s ease, transform 0.15s ease;
  white-space: nowrap;
}
.view-toggle button svg {
  transition: transform 0.25s ease;
}
.view-toggle button:hover:not(.active) {
  color: var(--c-text);
}
.view-toggle button:hover:not(.active) svg {
  transform: scale(1.1);
}
.view-toggle button.active {
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}
.view-toggle button.active svg {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.18));
}
[data-theme="dark"] .view-toggle {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .view-toggle__indicator {
  box-shadow:
    0 6px 18px -4px rgba(0, 0, 0, 0.55),
    0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

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

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.muted {
  color: var(--c-muted);
}

.error {
  background: var(--c-error-bg);
  color: var(--c-danger);
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.success {
  background: var(--c-success-bg);
  color: var(--c-success);
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.patient-card {
  background: var(--c-primary-light);
  border: 2px solid var(--c-primary);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.patient-card:hover {
  background: var(--c-primary-light);
  filter: brightness(0.95);
}

.patient-card h3 {
  margin: 0;
  font-size: 1.3rem;
}

.patient-card .avatar-chip {
  width: 86px;
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  flex-shrink: 0;
}

/* PinPad */
.pinpad {
  max-width: 320px;
  margin: 0 auto;
}

.pinpad .dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 28px;
}

.pinpad .dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid var(--c-primary);
  background: var(--c-surface);
}

.pinpad .dot.filled {
  background: var(--c-primary);
}

.pinpad .keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.pinpad .keys button {
  height: 70px;
  font-size: 1.6rem;
  background: var(--c-surface);
  color: var(--c-primary-dark);
  border: 2px solid var(--c-border);
}

.pinpad .keys button:hover {
  background: var(--c-primary-light);
}

/* Mood scale */
.mood-scale {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 12px 0;
}

.mood-scale button {
  flex: 1;
  height: 72px;
  font-size: 2rem;
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  border-radius: var(--radius);
  transition: all 0.15s;
}

.mood-scale button.selected {
  background: var(--c-accent-light);
  border-color: var(--c-accent);
  transform: scale(1.05);
}

/* Energy scale */
.energy-scale {
  display: flex;
  gap: 8px;
}

.energy-scale button {
  flex: 1;
  height: 56px;
  background: var(--c-surface);
  color: var(--c-text);
  border: 2px solid var(--c-border);
  font-size: 1.2rem;
  font-weight: 700;
}

.energy-scale button.selected {
  background: var(--c-primary);
  color: white;
  border-color: var(--c-primary);
}

/* Questions */
.question-card {
  background: var(--c-surface);
  padding: 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.question-card .question-text {
  font-size: 1.3rem;
  line-height: 1.5;
  margin-bottom: 24px;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.choices button {
  background: var(--c-surface);
  color: var(--c-text);
  border: 2px solid var(--c-border);
  min-height: 64px;
  text-align: left;
  padding: 0 24px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: flex-start;
}

.choice-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  background: var(--c-primary-light);
  color: var(--c-primary-dark);
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}
.choices button.correct .choice-letter {
  background: var(--c-success-bg);
  color: var(--c-success);
}
.choices button.wrong .choice-letter {
  background: var(--c-error-bg);
  color: var(--c-danger);
}
.choice-text {
  flex: 1;
  min-width: 0;
}

.choices button:hover:not(:disabled) {
  background: var(--c-primary-light);
  border-color: var(--c-primary);
}

.choices button.correct {
  background: var(--c-success-bg);
  border-color: var(--c-success);
  color: var(--c-success);
}

.choices button.wrong {
  background: var(--c-error-bg);
  border-color: var(--c-danger);
  color: var(--c-danger);
}

/* Avatar SVG container (historique — conservé pour ExerciseSession) */
.avatar-container {
  display: flex;
  justify-content: center;
  padding: 20px;
}

/* Zone de prévisualisation de l'avatar en création/édition : pas de fond,
   pas de cadre, l'avatar flotte. */
.avatar-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 0 20px 0;
  background: transparent;
}

/* Bloc avatar dans PatientDetail : avatar centré, titre, bouton Modifier
   en dessous (et non collé à l'image). */
.avatar-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.avatar-detail .avatar-name {
  margin: 8px 0 2px;
  font-size: 1rem;
  color: var(--c-text);
  font-weight: 500;
}

/* Badge nom + sexe sous l'avatar */
.avatar-name-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 2px;
}
.avatar-name-badge .avatar-name-label {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--c-text);
  letter-spacing: -0.01em;
}
.avatar-sex-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 6px;
  border-radius: 12px;
}
.avatar-sex-tag.male {
  background: var(--c-primary-light);
  color: var(--c-primary-dark);
}
.avatar-sex-tag.female {
  background: var(--c-pink-bg);
  color: #db2777;
}

/* Champ nom d'avatar avec icône — style plus travaillé */
.avatar-name-field .avatar-name-input-wrap {
  display: flex;
  align-items: center;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--c-tint-cool);
  transition: border-color 0.2s;
}
.avatar-name-field .avatar-name-input-wrap:focus-within {
  border-color: var(--c-primary);
  background: var(--c-surface);
}
.avatar-name-field .avatar-name-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--c-primary);
  flex-shrink: 0;
}
.avatar-name-field .avatar-name-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 10px 14px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--c-text);
  margin: 0;
  border-radius: 0;
}

/* Sélecteur de voix avatar */
.voice-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.voice-option {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: var(--c-tint-cool);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
  width: 100%;
  overflow: hidden;
}
.voice-option:hover {
  background: var(--c-tint-cool-2);
}
.voice-option.selected {
  border-color: var(--c-primary);
  background: var(--c-primary-light);
}
.voice-option .voice-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  min-height: 52px;
  flex-shrink: 0;
  color: var(--c-primary);
  cursor: pointer;
  transition: background 0.15s;
  border-right: 1px solid #e2e8f0;
}
.voice-option .voice-preview:hover {
  background: var(--c-primary-light);
}
.voice-option.selected .voice-preview {
  border-right-color: #bfdbfe;
}
.voice-option .voice-text {
  flex: 1;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}
.voice-option .voice-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--c-text);
  line-height: 1.3;
}
.voice-option .voice-desc {
  font-size: 0.8rem;
  color: var(--c-muted);
  line-height: 1.3;
}

/* Ligne question + toggle micro */
.question-text-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* Toggle micro à côté des questions */
.voice-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  background: var(--c-tint-cool);
  color: var(--c-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  padding: 0;
  min-width: 0;
}
.voice-toggle:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
  background: var(--c-primary-light);
}
.voice-toggle.active {
  border-color: var(--c-primary);
  background: var(--c-primary);
  color: #fff;
}

/* Bouton répondre vocalement */
.voice-answer-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: var(--c-tint-cool);
  color: var(--c-muted);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s;
}
.voice-answer-toggle:hover {
  border-color: var(--c-cyan);
  color: var(--c-cyan);
}
.voice-answer-toggle.active {
  border-color: var(--c-cyan);
  background: var(--c-cyan-light);
  color: var(--c-cyan-dark);
}
.voice-answer-toggle.listening {
  border-color: var(--c-danger, #dc2626);
  background: var(--c-error-bg);
  color: var(--c-danger, #dc2626);
  animation: pulse-border 1.5s ease infinite;
}
@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

/* Ligne météo sous le greeting patient */
.patient-weather-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
  font-size: 0.9rem;
  color: var(--c-muted);
}
.patient-weather-row .weather-icon-label {
  font-size: 1.3rem;
  line-height: 1;
}
.patient-weather-row .weather-info {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.patient-weather-row .weather-divider {
  color: var(--c-muted);
}
.patient-weather-row .weather-temp {
  font-weight: 600;
  color: var(--c-text);
}

/* ---- Page Jeux — Design premium ---- */

/* Barre d'onglets Jeux / Activités */
.games-tab-bar {
  display: flex;
  gap: 10px;
  background: var(--c-tint-cool-2);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 16px;
}
.games-tab {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: transparent;
  border-radius: 11px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--c-muted);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 0;
}
.games-tab.active {
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
/* En mode sombre, var(--c-surface) est plus foncé que la barre. On force
   un fond accentué (gradient bleu/cyan de la marque) pour que l'onglet
   actif ressorte clairement et que le texte blanc soit lisible. */
[data-theme="dark"] .games-tab-bar {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--c-border);
}
[data-theme="dark"] .games-tab {
  color: var(--c-muted);
}
[data-theme="dark"] .games-tab.active {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 4px 14px rgba(34, 193, 195, 0.35);
}

/* Chips catégories — une seule ligne, réparties uniformément */
.games-cat-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 12px;
  margin: 0;
}

/* Chip vertical : emoji en haut, label en dessous (peut passer sur 2-3
   lignes quand le texte est long type "Mémoire autobiographique"). */
.games-cat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 0 110px;
  max-width: 180px;
  padding: 10px 8px;
  border: 2px solid var(--c-border);
  border-radius: 12px;
  background: var(--c-surface);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: var(--c-text);
  cursor: pointer;
  white-space: normal;
  word-break: break-word;
  hyphens: auto;
  transition: all 0.2s;
  min-width: 0;
  min-height: 72px;
}
.games-cat-chip:hover {
  border-color: var(--chip-color);
  color: var(--chip-color);
}
.games-cat-chip.active {
  background: var(--chip-gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.games-cat-chip-emoji {
  font-size: 1.4rem;
  line-height: 1;
}

/* Banner catégorie active */
.games-cat-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 16px;
  color: #fff;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.games-cat-banner-emoji {
  font-size: 2.2rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}
.games-cat-banner-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.games-cat-banner-sub {
  margin: 2px 0 0;
  font-size: 0.82rem;
  opacity: 0.85;
  font-weight: 500;
}

/* Grille des cartes de jeu */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.game-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 14px 16px;
  background: var(--c-surface);
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  color: inherit;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.game-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-accent);
  border-radius: 16px 16px 0 0;
}
.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
  border-color: var(--card-accent);
}
.game-card-emoji {
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 10px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}
.game-card-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--c-text);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.game-card-desc {
  font-size: 0.78rem;
  color: var(--c-muted);
  line-height: 1.35;
  margin-bottom: 12px;
  flex: 1;
}
.game-card-play {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--card-accent);
  letter-spacing: 0.02em;
  transition: letter-spacing 0.2s;
}
.game-card:hover .game-card-play {
  letter-spacing: 0.08em;
}
.game-card-best {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #f59e0b;
  margin-top: 4px;
  letter-spacing: 0.01em;
}

@media (max-width: 400px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .game-card {
    padding: 16px 10px 14px;
  }
}

/* Tuile action cyan — Discuter avec l'avatar */
.action-tile.cyan {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: white;
  border-color: transparent;
  box-shadow: 0 14px 30px rgba(6, 182, 212, 0.22);
}
.action-tile.cyan .action-sub {
  color: rgba(255, 255, 255, 0.88);
}

/* Tuile action violet — Jeux et activités */
.action-tile.purple {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
  border-color: transparent;
  box-shadow: 0 14px 30px rgba(139, 92, 246, 0.22);
}
.action-tile.purple .action-sub {
  color: rgba(255, 255, 255, 0.88);
}

/* ---- Chat page ---- */
.chat-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  padding-bottom: 0 !important;
}
.chat-avatar-row {
  display: flex;
  justify-content: center;
  padding: 8px 0;
  flex-shrink: 0;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  word-break: break-word;
}
.chat-bubble p {
  margin: 0;
}
.chat-bubble.user {
  align-self: flex-end;
  background: var(--c-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble.assistant {
  align-self: flex-start;
  background: var(--c-tint-cool-2);
  color: var(--c-text);
  border-bottom-left-radius: 4px;
}
.chat-bubble-name {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-cyan-dark);
  margin-bottom: 2px;
}
.chat-typing {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}
.chat-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  animation: chat-dot 1.2s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chat-dot {
  0%, 60%, 100% { transform: scale(0.6); opacity: 0.4; }
  30% { transform: scale(1); opacity: 1; }
}

.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
  flex-shrink: 0;
}
.chat-text-input {
  flex: 1;
  border: 2px solid #e2e8f0;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  margin: 0;
}
.chat-text-input:focus {
  border-color: var(--c-primary);
}
.chat-mic-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  background: var(--c-tint-cool);
  color: var(--c-muted);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  min-width: 0;
  transition: all 0.2s;
}
.chat-mic-btn:hover {
  border-color: var(--c-cyan);
  color: var(--c-cyan);
}
.chat-mic-btn.listening {
  border-color: #dc2626;
  background: var(--c-error-bg);
  color: var(--c-danger);
  animation: pulse-border 1.5s ease infinite;
}
.chat-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--c-primary);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  min-width: 0;
  transition: background 0.2s;
}
.chat-send-btn:hover:not(:disabled) {
  background: var(--c-primary-dark);
}
.chat-send-btn:disabled {
  background: var(--c-tint-cool-4);
  cursor: default;
}

/* Patient sélectionné dans les paramètres */
.selected-patient {
  border-color: var(--c-primary) !important;
  background: var(--c-primary-light) !important;
  color: var(--c-primary-dark) !important;
}

/* Bannière d'information bleue avec icône */
.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--c-info-bg);
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--c-primary-dark);
  line-height: 1.5;
}
.info-banner svg {
  flex-shrink: 0;
  margin-top: 2px;
}

/* Bloc identité patient dans PatientDetail : illustration + infos texte */
.patient-identity {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
}

.patient-illustration {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.patient-info {
  flex: 1;
  min-width: 220px;
}

.patient-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.patient-title {
  margin: 0 0 8px 0;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--c-text);
}

.patient-age {
  color: var(--c-muted);
  font-weight: 400;
  font-size: 1.05rem;
}

.patient-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
  color: var(--c-text);
  font-size: 0.9rem;
}

.patient-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Photo uploadée par le Master : pas de bordure ni de fond. On limite
   juste la taille pour qu'elle reste dans le flux. */
.photo-preview-wrap {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.photo-preview {
  max-width: 200px;
  max-height: 200px;
  object-fit: contain;
  background: transparent;
  border: none;
  border-radius: 12px;
}

.avatar-svg {
  width: 160px;
  height: 160px;
  animation: breathing 3s ease-in-out infinite;
}

.avatar-svg.speaking {
  animation: speaking 0.5s ease-in-out infinite;
}

@keyframes breathing {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

@keyframes speaking {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Simple bar chart */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-row .label {
  width: 120px;
  font-size: 0.95rem;
  color: var(--c-muted);
}

.bar-row .bar {
  flex: 1;
  height: 20px;
  background: var(--c-border);
  border-radius: 10px;
  overflow: hidden;
}

.bar-row .bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  border-radius: 10px;
}

.bar-row .val {
  width: 50px;
  text-align: right;
  font-weight: 600;
}

.big {
  font-size: 3rem;
  font-weight: 700;
  color: var(--c-primary-dark);
}

.centered {
  text-align: center;
}

nav.links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

nav.links a {
  color: var(--c-primary);
  text-decoration: none;
  font-weight: 600;
}

a.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 24px;
  background: var(--c-primary);
  color: #ffffff;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.15s, transform 0.15s;
}

a.button-link:hover {
  background: var(--c-primary-dark);
  transform: translateY(-1px);
}

a.button-link.outline {
  background: transparent;
  color: var(--c-primary);
  border: 2px solid var(--c-primary);
}

a.button-link.outline:hover {
  background: var(--c-primary-light);
}

a.button-link.cyan {
  background: var(--c-cyan);
}

a.button-link.cyan:hover {
  background: var(--c-cyan-dark);
}

a.button-link svg,
button svg {
  flex-shrink: 0;
}

/* Landing */
.landing-hero {
  text-align: center;
  padding: 40px 24px 24px 24px;
}

.landing-hero h1 {
  font-size: 3.2rem;
  color: var(--c-cyan);
  margin: 0 0 8px 0;
  letter-spacing: -1px;
  font-weight: 800;
}

.landing-hero .slogan {
  color: var(--c-muted);
  font-size: 1.2rem;
  margin: 0 0 8px 0;
  font-style: italic;
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 16px;
}

@media (max-width: 700px) {
  .two-cols {
    grid-template-columns: 1fr;
  }
  .landing-hero h1 {
    font-size: 2.4rem;
  }
}

.role-card {
  background: var(--c-surface);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid transparent;
}

.role-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border-color: var(--c-cyan-light);
}

.role-card .illustration {
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.role-card h2 {
  margin: 0;
  font-size: 1.4rem;
  color: var(--c-cyan-dark);
}

.role-card .role-desc {
  color: var(--c-muted);
  font-size: 0.95rem;
  min-height: 40px;
  margin: 0;
}

.role-card .role-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.role-card .role-actions .button-link {
  width: 100%;
}

/* -------- Auth / 2FA -------- */
.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-header h1 {
  margin: 8px 0 4px;
  font-size: 1.8rem;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-cyan-light);
  color: var(--c-cyan-dark);
  margin-bottom: 6px;
}

.auth-illustration {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}

.profile-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 560px) {
  .profile-picker {
    grid-template-columns: 1fr;
  }
}

.profile-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  min-height: 72px;
  background: var(--c-surface);
  color: var(--c-text);
  border: 2px solid var(--c-border);
  border-radius: var(--radius-sm);
  box-shadow: none;
  text-align: left;
}

.profile-option:hover:not(:disabled) {
  background: var(--c-primary-light);
  border-color: var(--c-primary-light);
  transform: none;
  box-shadow: var(--shadow-sm);
}

.profile-option.selected {
  border-color: var(--c-primary);
  background: var(--c-primary-light);
  color: var(--c-primary-dark);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.14);
}

.profile-option .profile-label {
  font-weight: 700;
  font-size: 1rem;
}

.profile-option .profile-desc {
  font-size: 0.82rem;
  color: var(--c-muted);
  font-weight: 500;
  line-height: 1.2;
}

.profile-option.selected .profile-desc {
  color: var(--c-primary-dark);
  opacity: 0.8;
}

/* Consent row (checkbox + link) */
.consent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  font-size: 1rem;
  color: var(--c-text);
  cursor: pointer;
  font-weight: 500;
}

.consent-row input[type="checkbox"] {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  accent-color: var(--c-primary);
  cursor: pointer;
}

.inline-link {
  background: none;
  border: none;
  padding: 0;
  min-height: auto;
  box-shadow: none;
  color: var(--c-primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-size: inherit;
  display: inline;
}

.inline-link:hover:not(:disabled) {
  color: var(--c-primary-dark);
  background: none;
  transform: none;
  box-shadow: none;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

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

.modal-card {
  background: var(--c-surface);
  border-radius: var(--radius);
  max-width: 640px;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: fadeInUp 0.3s ease;
}

.modal-header {
  padding: 24px 28px 12px;
  border-bottom: 1px solid var(--c-border);
}

.modal-header h2 {
  margin: 0 0 4px;
  font-size: 1.4rem;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.modal-header p {
  margin: 0;
  font-size: 0.85rem;
}

/* Variante du modal-header avec un bouton d'action (Supprimer) à droite,
   aligné verticalement avec le titre. */
.modal-header-actionable {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.modal-header-actionable .modal-header-text {
  flex: 1;
  min-width: 0;
}
.modal-header-delete {
  flex-shrink: 0;
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 10px;
  background: transparent;
  color: #dc2626;
  border: 1.5px solid rgba(220, 38, 38, 0.4);
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  /* Aligne le bouton sur la baseline du titre (légère marge top pour
     compenser la hauteur du h2). */
  margin-top: 2px;
}
.modal-header-delete:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.08);
  border-color: #dc2626;
  transform: none;
  box-shadow: none;
}
[data-theme="dark"] .modal-header-delete {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.45);
}
[data-theme="dark"] .modal-header-delete:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.12);
  border-color: #f87171;
}
@media (max-width: 480px) {
  .modal-header-delete span {
    display: none;
  }
  .modal-header-delete {
    padding: 0 10px;
    min-height: 36px;
  }
}

.modal-body {
  padding: 20px 28px;
  overflow-y: auto;
  line-height: 1.6;
  color: var(--c-text);
  font-size: 0.98rem;
}

.modal-body h3 {
  margin: 20px 0 6px;
  font-size: 1.05rem;
  color: var(--c-primary-dark);
}

.modal-body p {
  margin: 0 0 8px;
}

.modal-footer {
  padding: 16px 28px 22px;
  border-top: 1px solid var(--c-border);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  background: var(--c-bg);
}

.modal-footer button {
  min-width: 140px;
}

@media (max-width: 560px) {
  .modal-footer {
    flex-direction: column-reverse;
  }
  .modal-footer button {
    width: 100%;
  }
}

.back-link {
  background: transparent;
  color: var(--c-muted);
  border: 1px solid var(--c-border);
  min-height: 42px;
  padding: 0 18px;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: none;
  margin-bottom: 16px;
}

.back-link:hover:not(:disabled) {
  background: var(--c-surface);
  color: var(--c-primary-dark);
  border-color: var(--c-primary-light);
  transform: none;
  box-shadow: var(--shadow-sm);
}

.totp-input {
  text-align: center;
  letter-spacing: 0.6em;
  font-size: 2rem;
  font-weight: 700;
  padding: 16px;
  background: var(--c-bg) !important;
  border: 2px dashed var(--c-primary-light) !important;
}

.totp-input:focus {
  border-color: var(--c-primary) !important;
  background: var(--c-surface) !important;
}

.qr-wrap {
  display: flex;
  justify-content: center;
  padding: 20px;
  background: var(--c-surface);
  border-radius: var(--radius-sm);
  border: 2px dashed var(--c-border);
  margin-bottom: 16px;
}

.secret-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--c-bg);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
}

.secret-box code {
  flex: 1;
  font-family: "JetBrains Mono", "Menlo", monospace;
  font-size: 0.95rem;
  word-break: break-all;
  color: var(--c-primary-dark);
}

.secret-box button {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.9rem;
}

.feature-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.feature-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-primary-light);
  color: var(--c-primary-dark);
  flex-shrink: 0;
}

.status-chip {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-chip.on {
  background: var(--c-success-bg);
  color: var(--c-success);
}

.status-chip.off {
  background: var(--c-tint-cool-2);
  color: var(--c-muted);
}

/* -------- Dashboard / stats -------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--c-surface);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(226, 232, 240, 0.6);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: -30px;
  right: -30px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--c-primary-light);
  opacity: 0.6;
  z-index: 0;
}

.stat-card.cyan::before {
  background: var(--c-cyan-light);
}

.stat-card.amber::before {
  background: var(--c-accent-light);
}

.stat-card .stat-label {
  color: var(--c-muted);
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

.stat-card .stat-value {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--c-primary-dark);
  position: relative;
  z-index: 1;
  line-height: 1.1;
}

.stat-card.cyan .stat-value {
  color: var(--c-cyan-dark);
}

.stat-card.amber .stat-value {
  color: var(--c-accent-dark);
}

/* -------- Progress bar -------- */
.progress {
  height: 10px;
  background: var(--c-border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 24px;
}

.progress .progress-fill {
  height: 100%;
  background: var(--gradient-brand);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* -------- Welcome banner -------- */
.welcome-banner {
  background: var(--gradient-brand);
  color: white;
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.5s ease both;
}

.welcome-banner h2 {
  margin: 0 0 6px;
  font-size: 1.6rem;
  color: white;
}

.welcome-banner p {
  margin: 0;
  opacity: 0.92;
}

.welcome-banner::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.25), transparent 70%);
}

/* -------- Line chart -------- */
.line-chart-wrap {
  background: var(--c-bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid var(--c-border);
}

.line-chart {
  width: 100%;
  height: 180px;
}

/* -------- Session action buttons -------- */
.action-tile {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  color: var(--c-text);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  min-height: 80px;
}

.action-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--c-primary-light);
}

.action-tile.primary {
  background: var(--gradient-brand);
  color: white;
  border-color: transparent;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.22);
}

.action-tile.primary .action-sub {
  color: rgba(255, 255, 255, 0.85);
}

.action-tile.amber {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
  border-color: transparent;
  box-shadow: 0 14px 30px rgba(245, 158, 11, 0.22);
}

.action-tile.amber .action-sub {
  color: rgba(255, 255, 255, 0.9);
}

/* Variante "fait" : dégradé vert (cohérent avec les autres tiles
   colorées primary/amber). Utilisée pour les tiles d'actions accomplies
   dans la journée (séance du jour, check-in du jour) afin de signaler
   visuellement l'état "validé". */
.action-tile.done {
  background: linear-gradient(135deg, #4ade80, #16a34a); /* green-400 → green-600 */
  color: white;
  border-color: transparent;
  box-shadow: 0 14px 30px rgba(22, 163, 74, 0.22);
}

.action-tile.done .action-emoji {
  color: white;
  font-weight: 800;
}

.action-tile.done .action-sub {
  color: rgba(255, 255, 255, 0.9);
}

.action-tile .action-emoji {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.action-tile .action-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}

.action-tile .action-sub {
  font-size: 0.9rem;
  color: var(--c-muted);
  margin-top: 2px;
}

/* -------- Brand mark -------- */
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--c-cyan-dark);
}

.brand-mark .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gradient-brand);
  box-shadow: 0 0 0 4px rgba(0, 157, 152, 0.18);
}

.landing-hero h1 {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.landing-logo {
  display: block;
  margin: 0 auto 12px;
  max-width: 180px;
  width: 45%;
  height: auto;
}

/* ajustements carte patient */
.patient-card {
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
  border: 1px solid var(--c-primary-light);
  transition: background 0.18s, filter 0.18s;
}

.patient-card:hover {
  background: linear-gradient(135deg, #eaf3ff 0%, #dbeafe 100%);
  filter: none;
}

/* Boutons de navigation secondaires aux tons chaleureux médicaux.
   - btn-amber : ambre/miel chaleureux (historique)
   - btn-sage  : vert sauge apaisant (paramètres) */
.button-link.btn-amber {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border: 1px solid #fcd34d;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.12);
}

.button-link.btn-amber:hover {
  background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.18);
}

.button-link.btn-sage {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  color: #065f46;
  border: 1px solid #a7f3d0;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.1);
}

.button-link.btn-sage:hover {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.15);
}

/* Carte patient archivé — pas de lien, pas d'effet de hover, moins contrastée */
.patient-card.archived {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  opacity: 0.92;
}

.patient-card.archived:hover {
  transform: none;
  box-shadow: none;
}

/* headings gradient for main screens */
.header h1 {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* big numbers */
.big {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------------------------------------------------------------------------
 * Page Paramètres (MasterSettings)
 * ------------------------------------------------------------------------- */

.settings-tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0 16px;
  flex-wrap: wrap;
}

.settings-tabs .tab {
  flex: 1;
  min-width: 110px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--c-tint-cool-2);
  border: 1px solid transparent;
  color: var(--c-text);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.settings-tabs .tab:hover {
  background: var(--c-tint-cool-3);
}

.settings-tabs .tab.active {
  background: linear-gradient(135deg, #e0f2fe 0%, #d4f1ef 100%);
  border-color: var(--c-primary-light, #7dd3fc);
  color: var(--c-primary-dark, #0369a1);
}

/* Checklist de mot de passe */
.password-checklist {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
  font-size: 0.85rem;
}

.password-checklist li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  width: 100%;
  color: var(--c-muted);
}

.password-checklist li.ok {
  color: #16a34a;
}

.password-checklist li.ko {
  color: #ef4444;
}

/* Divider "ou" pour la zone OAuth */
.oauth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0 10px;
  color: var(--c-muted);
  font-size: 0.85rem;
}

.oauth-divider::before,
.oauth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

.oauth-divider span {
  padding: 0 12px;
}

.oauth-google-wrap {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

/* Grille de types de suivi */
.kind-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.kind-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: 12px;
  background: var(--c-tint-cool);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.kind-option:hover {
  background: var(--c-tint-cool-2);
}

.kind-option.selected {
  background: linear-gradient(135deg, #e0f2fe 0%, #d4f1ef 100%);
  border-color: var(--c-primary, #06b6d4);
}

.kind-icon {
  font-size: 1.8rem;
}

.kind-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--c-text);
}

/* Switch on/off pour activer un suivi */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: absolute;
  inset: 0;
  background: var(--c-tint-cool-4);
  border-radius: 26px;
  cursor: pointer;
  transition: background 0.2s;
}

.switch .slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch input:checked + .slider {
  background: var(--c-primary, #06b6d4);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.tracking-card textarea {
  width: 100%;
}

/* Tuiles de suivi inline sur la page Profil patient */
.tracking-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.tracking-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-width: 110px;
  max-width: 160px;
  padding: 12px 10px;
  border-radius: 14px;
  background: var(--c-tint-cool);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
  text-align: center;
  position: relative;
}

.tracking-tile:hover {
  background: var(--c-tint-cool-2);
  border-color: #e2e8f0;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.tracking-tile.disabled {
  opacity: 0.55;
}

.tracking-tile.add {
  background: linear-gradient(135deg, #e0f2fe 0%, #d4f1ef 100%);
  color: var(--c-primary, #06b6d4);
  border-style: dashed;
  border-color: var(--c-primary, #06b6d4);
}

.tracking-tile.add:hover {
  background: linear-gradient(135deg, #cdeaff 0%, #b9ede6 100%);
}

.tracking-tile-icon {
  font-size: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
}

.tracking-tile-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.2;
}

.tracking-tile.add .tracking-tile-label {
  color: var(--c-primary, #06b6d4);
}

.tracking-tile-meta {
  font-size: 0.72rem;
  color: var(--c-muted);
  line-height: 1.2;
}

.tracking-tile-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--c-tint-cool-3);
  color: var(--c-text);
  font-weight: 600;
}

/* ===========================================================================
   Brochures — section présentation sur la Landing
   =========================================================================== */
.brochures-section {
  margin-top: 36px;
}

.brochures-header {
  text-align: center;
  margin-bottom: 18px;
}

.brochures-header h2 {
  font-size: 1.5rem;
  color: #0c4a6e;
  margin: 0 0 4px 0;
}

.brochures-header p {
  margin: 0;
  font-size: 0.95rem;
}

.brochures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.brochure-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 22px 18px 18px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}

.brochure-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.brochure-card.cyan {
  border-color: #bae6fd;
  background: linear-gradient(180deg, #ecfeff 0%, #f0f9ff 100%);
}

.brochure-card.primary {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #eff6ff 0%, #e0f2fe 100%);
}

.brochure-card.violet {
  border-color: #c4b5fd;
  background: linear-gradient(180deg, #f5f3ff 0%, #ede9fe 100%);
}

.brochure-emoji {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 10px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.brochure-text h3 {
  margin: 4px 0 6px 0;
  font-size: 1.15rem;
  color: #0c4a6e;
}

.brochure-text p {
  margin: 0 0 14px 0;
  font-size: 0.9rem;
  color: var(--c-text);
  line-height: 1.4;
}

.brochure-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: auto;
  flex-wrap: wrap;
}

.brochure-actions .button-link {
  flex: 1 1 120px;
  justify-content: center;
  padding: 8px 10px;
  font-size: 0.88rem;
}

textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}

select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  font-family: inherit;
  font-size: 0.95rem;
  background: white;
}

/* ---------------------------------------------------------------------------
 * Avatar image-based (remplace les anciens SVG inline)
 * ------------------------------------------------------------------------- */

.avatar-wrap {
  position: relative;
  display: inline-block;
  overflow: visible;
  cursor: pointer;
  transition: transform 0.25s ease;
}

.avatar-wrap:hover {
  transform: translateY(-2px);
}

.avatar-wrap:hover .avatar-ground-shadow {
  transform: scaleX(1.05) scaleY(1.05);
  opacity: 1;
}

.avatar-img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  animation: avatar-idle 6s ease-in-out infinite, avatar-enter 0.55s ease-out;
  transform-origin: 50% 90%;
  will-change: transform, opacity;
  background: transparent;
  z-index: 2;
}

/* Animation d'entrée quand la clé de l'image change (état awake → eating,
   etc.) — fade-in + légère montée. */
@keyframes avatar-enter {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Micro-clignement : léger squash vertical centré sur la zone des yeux
   (~30% du haut), toutes les ~5 secondes, durée 120ms. Invisible la plupart
   du temps mais donne l'illusion que l'avatar cligne. On applique la même
   animation que l'idle mais en composant via un second layer. Ici on l'ajoute
   directement dans l'animation idle via une keyframe supplémentaire. */

/* Réaction au clic : petit bond de joie qui supplante l'idle le temps de
   l'animation. */
.avatar-img.reacting {
  animation: avatar-react 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Ombre au sol sous l'avatar — ellipse douce qui respire avec l'idle. */
.avatar-ground-shadow {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 4%;
  height: 8%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.22), rgba(15, 23, 42, 0) 70%);
  pointer-events: none;
  z-index: 1;
  animation: avatar-ground 6s ease-in-out infinite;
}

@keyframes avatar-ground {
  0%, 100% { transform: scaleX(1) scaleY(1); opacity: 0.85; }
  50%      { transform: scaleX(0.95) scaleY(0.92); opacity: 0.6; }
}

@keyframes avatar-react {
  0%   { transform: translateY(0) scale(1) rotate(0deg); }
  30%  { transform: translateY(-14px) scale(1.08) rotate(-3deg); }
  60%  { transform: translateY(-4px)  scale(1.03) rotate(2deg); }
  100% { transform: translateY(0)     scale(1)    rotate(0deg); }
}

.avatar-img.speaking {
  animation: avatar-speak 0.9s ease-in-out infinite;
}

.avatar-img.avatar-state-sleeping {
  animation: avatar-breathe 4.5s ease-in-out infinite;
}

.avatar-img.avatar-state-eating {
  animation: avatar-munch 1.2s ease-in-out infinite;
  transform-origin: 50% 85%;
}

/* Idle enrichi : bob + léger balancement gauche/droite + micro-scale,
   le tout sur 6 secondes pour rester doux. */
@keyframes avatar-idle {
  0%   { transform: translateY(0)   rotate(0deg)   scale(1); }
  20%  { transform: translateY(-2px) rotate(-0.6deg) scale(1.005); }
  40%  { transform: translateY(-3px) rotate(0deg)   scale(1.01); }
  60%  { transform: translateY(-2px) rotate(0.6deg) scale(1.005); }
  80%  { transform: translateY(0)   rotate(0deg)   scale(1); }
  100% { transform: translateY(0)   rotate(0deg)   scale(1); }
}

@keyframes avatar-speak {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-2px) scale(1.04); }
}

@keyframes avatar-breathe {
  0%, 100% { transform: scale(1) translateY(0); }
  50%      { transform: scale(1.02) translateY(-1px); }
}

@keyframes avatar-munch {
  0%, 100% { transform: translateY(0) scale(1); }
  25%      { transform: translateY(-1px) scale(1.015); }
  50%      { transform: translateY(0) scale(0.99); }
  75%      { transform: translateY(-1px) scale(1.015); }
}

/* ---------------------------------------------------------------------------
 * Overlay d'ambiance jour/nuit (dégradé radial discret derrière l'avatar)
 * ------------------------------------------------------------------------- */

.ambient-overlay {
  position: absolute;
  inset: -10%;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: multiply;
  opacity: 0.55;
  transition: background 1.6s ease, opacity 1.6s ease;
}

.ambient-overlay.ambient-dawn {
  background: radial-gradient(circle at 50% 40%, #fef3c7 0%, #fed7aa 45%, transparent 75%);
}
.ambient-overlay.ambient-day {
  background: radial-gradient(circle at 50% 40%, #fefce8 0%, #fef9c3 50%, transparent 80%);
  opacity: 0.25;
}
.ambient-overlay.ambient-dusk {
  background: radial-gradient(circle at 50% 40%, #fbcfe8 0%, #c4b5fd 50%, transparent 80%);
}
.ambient-overlay.ambient-night {
  background: radial-gradient(circle at 50% 40%, #1e3a8a 0%, #0f172a 55%, transparent 85%);
  mix-blend-mode: normal;
  opacity: 0.22;
}

/* La nuit on atténue aussi un chouïa l'image elle-même pour l'intégrer à
   l'ambiance sans tout assombrir. */
.avatar-wrap.ambient-night .avatar-img {
  filter: brightness(0.88) contrast(0.95) saturate(0.85);
  transition: filter 1.6s ease;
}

/* En mode sombre, l'avatar doit rester strictement identique au mode clair :
   on l'isole dans une petite scène claire (halo blanc en arrière-plan) pour
   que les blend-modes, l'ombre au sol et les bords doux des PNG par défaut
   soient rendus exactement comme sur fond clair, qu'il y ait ambient ou non. */
[data-theme="dark"] .avatar-wrap::before {
  content: "";
  position: absolute;
  inset: -4%;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 48%,
    #ffffff 58%,
    rgba(255, 255, 255, 0.85) 78%,
    rgba(255, 255, 255, 0) 100%
  );
  z-index: 0;
  pointer-events: none;
}

.avatar-wrap.ambient-dawn .avatar-img,
.avatar-wrap.ambient-dusk .avatar-img {
  filter: saturate(1.05);
  transition: filter 1.6s ease;
}

/* ---------------------------------------------------------------------------
 * Particules d'humeur (petites étincelles qui montent autour de l'avatar)
 * ------------------------------------------------------------------------- */

.mood-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
}

.mood-particles .particle {
  position: absolute;
  bottom: 10%;
  font-size: 0.9rem;
  opacity: 0;
  animation: particle-float 6s ease-in-out infinite;
  filter: drop-shadow(0 1px 2px rgba(251, 191, 36, 0.35));
  will-change: transform, opacity;
}

/* ---------------------------------------------------------------------------
 * Particules saisonnières (pétales, papillons, feuilles, flocons)
 * ------------------------------------------------------------------------- */

.season-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
}

.season-particles .season-piece {
  position: absolute;
  top: -8%;
  opacity: 0;
  display: inline-block;
  will-change: transform, opacity;
}

/* Mouvements différents par saison pour donner du caractère. */
.season-spring .season-piece {
  animation: season-drift 9s linear infinite;
}
.season-summer .season-piece {
  animation: season-flutter 10s ease-in-out infinite;
}
.season-autumn .season-piece {
  animation: season-fall 10s ease-in infinite;
}
.season-winter .season-piece {
  animation: season-snow 11s linear infinite;
}

@keyframes season-drift {
  0%   { transform: translateY(0)   translateX(0)   rotate(0deg); opacity: 0; }
  10%  { opacity: 0.85; }
  50%  { transform: translateY(60%) translateX(14px) rotate(180deg); }
  90%  { opacity: 0.6; }
  100% { transform: translateY(120%) translateX(-6px) rotate(360deg); opacity: 0; }
}

@keyframes season-flutter {
  0%   { transform: translateY(0)   translateX(0)   rotate(-8deg); opacity: 0; }
  10%  { opacity: 0.9; }
  30%  { transform: translateY(20%) translateX(18px) rotate(6deg); }
  60%  { transform: translateY(55%) translateX(-12px) rotate(-6deg); }
  90%  { opacity: 0.7; }
  100% { transform: translateY(110%) translateX(8px) rotate(4deg); opacity: 0; }
}

@keyframes season-fall {
  0%   { transform: translateY(0)    rotate(0deg); opacity: 0; }
  10%  { opacity: 0.9; }
  50%  { transform: translateY(60%)  rotate(180deg); }
  90%  { opacity: 0.7; }
  100% { transform: translateY(120%) rotate(380deg); opacity: 0; }
}

@keyframes season-snow {
  0%   { transform: translateY(0)   translateX(0)   rotate(0deg); opacity: 0; }
  10%  { opacity: 0.95; }
  50%  { transform: translateY(60%) translateX(10px) rotate(180deg); }
  100% { transform: translateY(115%) translateX(-4px) rotate(360deg); opacity: 0; }
}

@keyframes particle-float {
  0%   { transform: translateY(0)    scale(0.7); opacity: 0; }
  15%  { transform: translateY(-10px) scale(1);   opacity: 0.9; }
  70%  { transform: translateY(-70px) scale(1.1); opacity: 0.7; }
  100% { transform: translateY(-110px) scale(0.6); opacity: 0; }
}

/* Overlay météo — ne capte pas les clics */
.weather-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.weather-overlay .weather-drops {
  animation: drops-fall 1.3s linear infinite;
}

.weather-overlay .weather-snow {
  animation: snow-fall 3s ease-in-out infinite;
}

@keyframes drops-fall {
  0%   { transform: translateY(-8px); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translateY(12px); opacity: 0; }
}

@keyframes snow-fall {
  0%   { transform: translateY(-6px); opacity: 0.4; }
  50%  { transform: translateY(6px); opacity: 1; }
  100% { transform: translateY(16px); opacity: 0.3; }
}

/* Bouton compact : padding réduit, typographie plus serrée. */
button.btn-compact,
.btn-compact {
  padding: 6px 12px;
  font-size: 0.85rem;
  min-height: 0;
}

/* Spinner utilisé pendant la génération d'avatar (création patient) */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--c-primary, #06b6d4);
  border-radius: 50%;
  margin: 0 auto;
  animation: spinner-rotate 0.9s linear infinite;
}

/* Bouton minimaliste pour les petites icônes (crayon, etc.) à côté des titres.
   Aucune bordure, aucun fond, aucun outline — juste l'icône. */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  color: var(--c-muted);
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s, color 0.15s, transform 0.15s;
}

.icon-btn:hover {
  opacity: 1;
  color: #0369a1;
  transform: scale(1.08);
}

.icon-btn:focus,
.icon-btn:focus-visible,
.icon-btn:active {
  outline: none;
  border: none;
  box-shadow: none;
}

/* Mini-spinner inline, utilisé dans les boutons */
.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spinner-rotate 0.8s linear infinite;
  flex-shrink: 0;
}

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

/* Liste de suggestions de villes (autocomplete Open-Meteo) */
.city-suggest {
  list-style: none;
  padding: 0;
  margin: 4px 0 0 0;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
  position: absolute;
  left: 0;
  right: 0;
  z-index: 10;
}

.city-suggest li {
  border-bottom: 1px solid #f1f5f9;
}

.city-suggest li:last-child {
  border-bottom: none;
}

.city-suggest button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--c-text);
  font-size: 0.9rem;
  display: block;
}

.city-suggest button:hover {
  background: var(--c-tint-cool);
}

/* Grille de périodes pour la modale "Télécharger bilan" */
.period-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.period-option {
  padding: 14px 8px;
  border-radius: 12px;
  background: var(--c-tint-cool);
  border: 2px solid transparent;
  cursor: pointer;
  font-weight: 500;
  color: var(--c-text);
  transition: all 0.15s;
}

.period-option:hover {
  background: var(--c-tint-cool-2);
}

.period-option.selected {
  background: linear-gradient(135deg, #e0f2fe 0%, #d4f1ef 100%);
  border-color: var(--c-primary, #06b6d4);
  color: var(--c-primary-dark, #0369a1);
}

/* ─── Mode ambiant : overlay d'interpellation ─────────────────────────── */

.ambient-backdrop {
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(3, 105, 161, 0.55) 0%,
    rgba(15, 23, 42, 0.85) 75%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  padding: 24px;
  animation: ambient-fade-in 320ms ease-out;
}

@keyframes ambient-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ambient-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 28px;
  padding: 36px 32px 32px;
  max-width: 520px;
  width: 100%;
  text-align: center;
  box-shadow:
    0 24px 64px rgba(3, 105, 161, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  animation: ambient-pop-in 420ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes ambient-pop-in {
  from { transform: translateY(24px) scale(0.9); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.ambient-avatar {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
  position: relative;
}

.ambient-avatar.speaking::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(6, 182, 212, 0.28) 0%,
    rgba(6, 182, 212, 0) 70%
  );
  animation: ambient-pulse 1.6s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes ambient-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%      { transform: scale(1.15); opacity: 1; }
}

.ambient-title {
  font-size: 1.5rem;
  color: #0369a1;
  margin: 0 0 8px;
  font-weight: 700;
}

.ambient-message {
  color: var(--c-text);
  line-height: 1.5;
  margin: 0 0 20px;
  font-size: 1.05rem;
}

.ambient-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.ambient-primary {
  background: linear-gradient(135deg, #0369a1 0%, #06b6d4 100%);
  color: #fff;
  border: none;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(3, 105, 161, 0.25);
  transition: transform 0.12s ease;
}

.ambient-primary:hover {
  transform: translateY(-1px);
}

.ambient-secondary {
  background: transparent;
  border: none;
  color: var(--c-muted);
  font-size: 0.95rem;
  padding: 10px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.12s;
}

.ambient-secondary:hover {
  background: var(--c-tint-cool-2);
  color: var(--c-text);
}

/* Indicateur "Mode ambiant actif" sur PatientHome */
.ambient-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #e0f2fe 0%, #d4f1ef 100%);
  color: #0369a1;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.ambient-indicator::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #06b6d4;
  animation: ambient-blink 1.8s ease-in-out infinite;
}

@keyframes ambient-blink {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 1; box-shadow: 0 0 8px rgba(6, 182, 212, 0.6); }
}

/* ============================================================
   MasterLayout — sidebar master
   Barre latérale verticale dark navy, visible uniquement pour
   le rôle "master". Inspirée d'un dashboard SaaS premium.
   ============================================================ */
.master-layout {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
  /* Remonte la mise en page master sous la barre de chrome (thème /
     déconnexion, ~56px) : le menu de gauche démarre ainsi tout en haut,
     sans espace vide au-dessus. */
  margin-top: -56px;
}
@media (max-width: 600px) {
  .master-layout {
    margin-top: -48px;
  }
}

.master-sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  width: 248px;
  flex-shrink: 0;
  height: 100vh;
  /* Même gradient que le bandeau "Bienvenue sur Cortexia" (var(--gradient-brand))
     mais légèrement opacifié pour un rendu plus doux. Une couche sombre
     diagonale conserve assez de contraste pour les labels blancs. */
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.18) 0%, rgba(15, 23, 42, 0.05) 100%),
    linear-gradient(160deg, rgba(0, 157, 152, 0.92) 0%, rgba(34, 193, 195, 0.88) 50%, rgba(37, 99, 235, 0.94) 100%);
  color: rgba(255, 255, 255, 0.92);
  display: flex;
  flex-direction: column;
  padding: 26px 16px;
  gap: 22px;
  box-shadow: 4px 0 22px -8px rgba(8, 47, 73, 0.3);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 10;
}

/* Le fond du sidebar étant déjà un brand-gradient, on retire l'ancienne
   bande verticale redondante (::before). */

.master-sidebar__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.master-sidebar__logo img {
  width: 96px;
  height: 96px;
  border-radius: 18px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px;
  box-shadow:
    0 6px 16px -6px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.master-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
}

.master-sidebar__item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 500;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease,
    box-shadow 0.18s ease;
  white-space: nowrap;
}

.master-sidebar__item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.master-sidebar__item.active {
  background: #ffffff;
  color: var(--c-primary-dark);
  font-weight: 600;
  box-shadow:
    0 4px 12px -4px rgba(8, 47, 73, 0.45),
    0 2px 4px rgba(0, 0, 0, 0.1);
}

.master-sidebar__item.active .master-sidebar__icon {
  color: var(--c-cyan-dark);
}

.master-sidebar__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.master-sidebar__label {
  flex: 1;
}

.master-sidebar__footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 6px;
}

.master-sidebar__hr {
  margin: 0 4px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.master-content {
  flex: 1 1 auto;
  min-width: 0;
}

/* Dans le master shell, on retire le max-width 900px de .app-shell pour que
   les cards et diagrammes prennent toute la largeur disponible, et on
   réduit le padding latéral pour gagner de l'espace utile. */
.master-content .app-shell {
  max-width: none;
  padding: 20px 24px;
}
@media (max-width: 900px) {
  .master-content .app-shell {
    padding: 16px;
  }
}

/* Le header de chaque page master réserve une marge à droite pour ne pas
   bousculer les deux boutons flottants (ThemeToggle + LogoutButton). 12 +
   44 + 8 + 44 + 12 ≈ 120px occupés en haut à droite, on met 130 pour avoir
   un peu d'air. Le margin-top dégage de la place sous les deux boutons
   flottants pour que le titre + le sélecteur ne soient pas tassés contre. */
.master-content .header {
  padding-right: 130px;
  margin-top: 40px;
}
@media (max-width: 900px) {
  .master-content .header {
    padding-right: 110px;
    margin-top: 32px;
  }
}

/* Mode sombre : on conserve le brand-gradient mais avec une couche
   sombre plus marquée pour rester cohérent avec le reste de l'UI dark. */
[data-theme="dark"] .master-sidebar {
  background:
    linear-gradient(180deg, rgba(8, 14, 30, 0.55) 0%, rgba(8, 14, 30, 0.4) 100%),
    linear-gradient(160deg, rgba(0, 157, 152, 0.95) 0%, rgba(34, 193, 195, 0.92) 50%, rgba(37, 99, 235, 0.95) 100%);
}

[data-theme="dark"] .master-sidebar__item:hover {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .master-sidebar__item.active {
  background: var(--c-surface);
  color: var(--c-primary);
}

/* Responsive : en dessous de 900px, le sidebar passe en mode "icônes seules"
   (64px de large) — les labels sont masqués mais restent dans le DOM
   (accessible via title et lecteurs d'écran). */
@media (max-width: 900px) {
  .master-sidebar {
    width: 64px;
    padding: 18px 8px;
  }
  .master-sidebar__label {
    display: none;
  }
  .master-sidebar__logo {
    justify-content: center;
    padding: 4px 0 12px 0;
  }
  .master-sidebar__logo img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    padding: 6px;
  }
  .master-sidebar__item {
    justify-content: center;
    padding: 11px 8px;
    gap: 0;
  }
}

/* ============================================================
   Dashboard master — grille de KPI tiles
   ============================================================ */
.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-tile {
  background: var(--c-surface);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(226, 232, 240, 0.6);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.kpi-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.kpi-tile::before {
  /* Pastille colorée en arrière-plan, dans le coin haut-droit */
  content: "";
  position: absolute;
  top: -28px;
  right: -28px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--kpi-color, var(--c-primary));
  opacity: 0.1;
  z-index: 0;
}

.kpi-tile__icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--kpi-color, var(--c-primary));
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.15);
}

.kpi-tile__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.kpi-tile__label {
  color: var(--c-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.kpi-tile__value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--c-text);
  line-height: 1.15;
}

.kpi-tile__hint {
  color: var(--c-muted);
  font-size: 0.78rem;
  margin-top: 2px;
}

[data-theme="dark"] .kpi-tile {
  border-color: var(--c-border);
}

/* ============================================================
   Dashboard master — diagrammes (revenus + types d'abonnements)
   ============================================================ */
.dashboard-charts {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: stretch;
}
@media (max-width: 900px) {
  .dashboard-charts {
    grid-template-columns: 1fr;
  }
}

.dashboard-chart__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.chart-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chart-wrap svg {
  width: 100%;
  height: auto;
  max-width: 100%;
}

.chart-wrap--donut {
  flex-direction: column;
  gap: 18px;
}
.chart-wrap--donut svg {
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}

.chart-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chart-legend__row {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--c-tint-cool);
  border-radius: 10px;
  font-size: 0.88rem;
}
.chart-legend__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.chart-legend__label {
  color: var(--c-text);
  font-weight: 500;
}
.chart-legend__count {
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
}
.chart-legend__amount {
  color: var(--c-text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .chart-legend__row {
  background: rgba(255, 255, 255, 0.04);
}

/* ============================================================
   Carte d'autorisation micro (PatientHome)
   ============================================================ */
.mic-perm-card {
  position: relative;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: linear-gradient(135deg, var(--c-cyan-light), var(--c-primary-light));
  border: 1px solid var(--c-primary-light);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.mic-perm-card__icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px -4px rgba(37, 99, 235, 0.45);
}
.mic-perm-card__body {
  flex: 1;
  min-width: 0;
}
.mic-perm-card__title {
  margin: 0 0 6px 0;
  font-size: 1.1rem;
  color: var(--c-primary-dark);
}
.mic-perm-card__text {
  margin: 0 0 12px 0;
  color: var(--c-text);
  line-height: 1.45;
  font-size: 0.95rem;
}
.mic-perm-card__btn {
  min-height: 44px;
  padding: 0 20px;
  background: var(--c-primary);
  color: #fff;
  border-radius: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.mic-perm-card__btn:disabled {
  opacity: 0.6;
}
.mic-perm-card__steps {
  margin: 0;
  padding-left: 22px;
  color: var(--c-text);
  font-size: 0.92rem;
  line-height: 1.5;
}
.mic-perm-card__steps li {
  margin-bottom: 4px;
}
.mic-perm-card__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--c-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}
.mic-perm-card__close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--c-text);
}
[data-theme="dark"] .mic-perm-card {
  background: linear-gradient(135deg, rgba(0, 157, 152, 0.18), rgba(37, 99, 235, 0.18));
  border-color: rgba(255, 255, 255, 0.12);
}
[data-theme="dark"] .mic-perm-card__title {
  color: #cfe1ff;
}

/* Toast micro refusé (PatientHome). Plus discret que la carte, affiché
   uniquement après une vraie tentative d'autorisation refusée. */
.mic-denied-toast {
  position: relative;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
  color: #78350f;
  border-radius: 12px;
  padding: 14px 44px 14px 18px;
  margin-bottom: 16px;
  font-size: 0.92rem;
  line-height: 1.45;
  box-shadow: var(--shadow-sm);
}
.mic-denied-toast strong {
  color: #b45309;
}
.mic-denied-toast__close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: #78350f;
  font-size: 1.25rem;
  line-height: 1;
  box-shadow: none;
}
.mic-denied-toast__close:hover {
  background: rgba(120, 53, 15, 0.1);
}
[data-theme="dark"] .mic-denied-toast {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.1));
  border-color: rgba(245, 158, 11, 0.5);
  color: #fde68a;
}
[data-theme="dark"] .mic-denied-toast strong {
  color: #fcd34d;
}
[data-theme="dark"] .mic-denied-toast__close {
  color: #fde68a;
}

/* ── PatientDetail dashboard layout ── */

/* Hero card */
.pd-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.pd-hero-avatar {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--c-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pd-hero-info {
  flex: 1;
  min-width: 180px;
}
.pd-hero-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.pd-hero-name {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--c-text);
  line-height: 1.2;
}
.pd-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.pd-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--c-tint-cool);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.8rem;
  color: var(--c-muted);
  white-space: nowrap;
}
.pd-meta-chip.relation {
  background: var(--c-primary-light);
  border-color: rgba(37, 99, 235, 0.3);
  color: var(--c-primary-dark);
  font-weight: 500;
}
.pd-meta-chip.patho {
  background: var(--c-accent-light);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--c-accent-dark);
}
.pd-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}
@media (max-width: 600px) {
  .pd-hero { flex-direction: column; align-items: flex-start; }
  .pd-hero-actions { flex-direction: row; margin-left: 0; width: 100%; }
}

/* KPI row */
.pd-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 600px) {
  .pd-kpis { grid-template-columns: repeat(2, 1fr); }
}
.pd-kpi-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 16px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: box-shadow 0.2s;
}
.pd-kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--c-primary);
  line-height: 1;
}
.pd-kpi-card.cyan .pd-kpi-value { color: var(--c-cyan); }
.pd-kpi-card.amber .pd-kpi-value { color: var(--c-accent); }
.pd-kpi-label {
  font-size: 0.75rem;
  color: var(--c-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* 2-column grid */
.pd-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 800px) {
  .pd-grid-2 { grid-template-columns: 1fr; }
}

[data-theme="dark"] .pd-meta-chip.relation {
  background: rgba(96, 165, 250, 0.15);
  border-color: rgba(96, 165, 250, 0.3);
  color: #93c5fd;
}
[data-theme="dark"] .pd-meta-chip.patho {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fcd34d;
}

/* ── PatientCard v3 — fidèle à interface_profil_patient.png ── */

/* Plein écran avec juste un léger espace gauche/droite. Le fond est porté
   par <html> (`.cortexia-pd` ci-dessous) et non par le shell, pour qu'il
   couvre toute la page sans bande au-dessus. */
.pc-shell {
  max-width: none !important;
  padding: 24px 36px !important;
  background: transparent !important;
  min-height: calc(100vh - 60px);
}

/* Fond du profil patient appliqué sur <html> → couvre tout le viewport,
   y compris la zone derrière la barre de chrome. La classe est posée /
   retirée par PatientDetail. body + #root passent en transparent pour
   laisser apparaître ce fond. */
html.cortexia-pd {
  background: linear-gradient(145deg, #eff6ff 0%, #fafafa 55%, #f0fdf4 100%);
}
/* Aligné sur Angular : un seul fond pour les deux sexes (patient-bg-male.png =
   le fond bleu floral utilisé verbatim côté /preview-app/master/patients/<id>). */
html.cortexia-pd.cortexia-pd--photo,
html.cortexia-pd.cortexia-pd--male,
html.cortexia-pd.cortexia-pd--female {
  background:
    linear-gradient(rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.82)),
    url('/patient-bg-male.png') center top / cover no-repeat;
}
html.cortexia-pd[data-theme="dark"] {
  background: linear-gradient(145deg, #0d1526 0%, #131e2e 55%, #0d1f14 100%);
}
html.cortexia-pd.cortexia-pd--photo[data-theme="dark"],
html.cortexia-pd.cortexia-pd--male[data-theme="dark"],
html.cortexia-pd.cortexia-pd--female[data-theme="dark"] {
  background:
    linear-gradient(rgba(15, 21, 38, 0.82), rgba(15, 21, 38, 0.82)),
    url('/patient-bg-male.png') center top / cover no-repeat;
}
html.cortexia-pd body,
html.cortexia-pd #root {
  background: transparent;
}

/* Hero row : 3 cards côte à côte — avatar | infos | suivis */
.pc-hero-row {
  display: grid;
  grid-template-columns: 230px 1fr 360px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1000px) {
  .pc-hero-row { grid-template-columns: auto 1fr; }
  .pc-upcoming-card { display: none; }
}
@media (max-width: 640px) {
  .pc-hero-row { grid-template-columns: 1fr; }
}

/* Card 1 : Avatar seul dans son cadre */
.pc-avatar-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  flex-shrink: 0;
  min-width: 220px;
}

/* Card 2 : Infos patient */
.pc-info-card {
  padding: 18px 22px;
}

/* Ligne du haut : n séances (gauche) + badge (droite) */
.pc-info-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

/* Colonne photo (legacy — gardé pour compatibilité) */
.pc-photo-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.pc-photo-frame {
  width: 198px;
  height: 198px;
  border-radius: 18px;
  overflow: hidden;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  box-shadow: none;
}
.pc-photo-frame .avatar-wrap {
  width: 100% !important;
  height: 100% !important;
}
.pc-photo-frame svg,
.pc-photo-frame img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}
.pc-photo-btns {
  display: flex;
  gap: 6px;
  width: 100%;
}
.pc-btn-call,
.pc-btn-schedule {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 8px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  border: none;
  box-shadow: none;
}
.pc-btn-call {
  background: var(--c-primary);
  color: #fff;
}
.pc-btn-call:hover { opacity: 0.88; transform: translateY(-1px); box-shadow: none; }
.pc-btn-schedule {
  background: transparent;
  color: var(--c-primary);
  border: 1.5px solid var(--c-primary);
}
.pc-btn-schedule:hover { background: var(--c-primary-light); transform: translateY(-1px); box-shadow: none; }

/* Colonne infos */
.pc-info-col {
  flex: 1;
  min-width: 0;
}
.pc-sessions-hint {
  font-size: 0.78rem;
  color: var(--c-muted);
  margin: 0 0 4px 0;
  font-weight: 500;
}
.pc-patient-name {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--c-text);
  margin: 0 0 14px 0;
  line-height: 1.15;
}
.pc-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 20px;
  background: rgba(0,157,152,0.12);
  color: var(--c-cyan);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(0,157,152,0.3);
  margin-bottom: 14px;
}

/* Grille démographique — 4 colonnes séparées par un diviseur vertical */
.pc-demog-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 14px;
}
.pc-demog-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  padding: 10px 14px;
  border-right: 1px solid var(--c-border);
  flex: 1;
  min-width: 80px;
}
.pc-demog-col:last-child { border-right: none; }
.pc-demog-label {
  font-size: 0.67rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 500;
  white-space: nowrap;
  text-align: center;
}
.pc-demog-value {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--c-text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  text-align: center;
}

.pc-edit-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--c-primary);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font-weight: 500;
  box-shadow: none;
  min-height: unset;
  text-decoration: underline;
}
.pc-edit-profile-link:hover { opacity: 0.75; transform: none; box-shadow: none; }

/* Card droite — Suivis actifs (Upcoming Appointment style) */
.pc-upcoming-card {
  padding: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pc-upcoming-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-tint-cool);
}
.pc-upcoming-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--c-text);
}
.pc-upcoming-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
  transition: background 0.12s;
}
.pc-upcoming-row:last-child { border-bottom: none; }
.pc-upcoming-row:hover { background: var(--c-tint-cool); }
.pc-upcoming-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--c-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.pc-upcoming-info { flex: 1; min-width: 0; }
.pc-upcoming-label {
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-upcoming-time {
  font-size: 0.75rem;
  color: var(--c-muted);
  margin-top: 2px;
}
.pc-badge-confirmed {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(22,163,74,0.1);
  color: #16a34a;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid rgba(22,163,74,0.25);
  white-space: nowrap;
  flex-shrink: 0;
}
.pc-upcoming-more {
  display: flex;
  justify-content: center;
  padding: 10px 16px;
  border-top: 1px solid var(--c-border);
}

/* Stats row (4 tuiles) */
.pc-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 600px) {
  .pc-stats-row { grid-template-columns: repeat(2, 1fr); }
}
.pc-stat-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pc-stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--c-text);
  line-height: 1;
}
.pc-stat-card.pc-stat-blue .pc-stat-value { color: var(--c-primary); }
.pc-stat-card.pc-stat-amber .pc-stat-value { color: var(--c-accent); }
.pc-stat-label {
  font-size: 0.72rem;
  color: var(--c-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Tabs — style underline (comme la référence) */
.pc-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--c-border);
  justify-content: center;
  margin-bottom: 20px;
}
.pc-tab {
  flex: 1;
  text-align: center;
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--c-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  box-shadow: none;
  border-radius: 0;
  min-height: unset;
}
.pc-tab:hover:not(.active) { color: var(--c-text); transform: none; box-shadow: none; }
.pc-tab.active {
  color: var(--c-primary);
  font-weight: 700;
  border-bottom-color: var(--c-primary);
  box-shadow: none;
}

/* Overview — 3 colonnes */
.pc-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 1000px) {
  .pc-overview-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .pc-overview-grid { grid-template-columns: 1fr; }
}
.pc-col-card {
  padding: 18px 18px 20px 18px;
}

/* Card Premium-only verrouillée pour les comptes Standard. On garde le
   contenu visible (en filigrane) et on superpose un bouton qui couvre la
   surface et redirige vers /pricing. */
.pc-card-locked {
  position: relative;
  overflow: hidden;
}
.pc-card-locked > *:not(.pc-col-header):not(.pc-lock-overlay) {
  filter: blur(2px) opacity(0.45);
  pointer-events: none;
  user-select: none;
}
.pc-lock-overlay {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.85) 60%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border: none;
  border-radius: inherit;
  cursor: pointer;
  text-align: center;
  z-index: 5;
  color: var(--c-text);
  transition: background 0.2s ease;
  /* Laisser l'en-tête (titre + badge Premium) au-dessus de l'overlay. */
  top: 56px;
}
.pc-lock-overlay:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.95) 60%);
}
[data-theme="dark"] .pc-lock-overlay {
  background: linear-gradient(180deg, rgba(15, 21, 38, 0.55) 0%, rgba(15, 21, 38, 0.92) 60%);
  color: rgba(255, 255, 255, 0.92);
}
.pc-lock-overlay > svg {
  color: var(--c-accent, #d97706);
  margin-bottom: 4px;
}
.pc-lock-overlay__title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.pc-lock-overlay__cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-primary);
  margin-top: 2px;
}

/* Petit badge "Premium" affiché à côté du titre des cards verrouillées. */
.pc-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid #fcd34d;
}

/* Variante "verrouillée" du bouton + ronde — fond ambré pour signaler la
   limite Standard atteinte et inviter à passer Premium. */
.pc-add-btn--locked {
  background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
  color: #92400e !important;
  border-color: #fcd34d !important;
}
.pc-add-btn--locked:hover {
  background: linear-gradient(135deg, #fde68a, #fcd34d) !important;
}

/* Ligne "X rapports supplémentaires — Passer Premium" affichée sous la
   liste de rapports en mode Standard. Conçue comme un appel à l'action
   discret mais cliquable. */
.pc-report-locked {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px dashed #fbbf24;
  color: #92400e;
  font-size: 0.83rem;
  text-align: left;
  cursor: pointer;
  min-height: 0;
  box-shadow: none;
}
.pc-report-locked:hover {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}
.pc-report-locked > svg {
  flex-shrink: 0;
}
[data-theme="dark"] .pc-report-locked {
  background: linear-gradient(135deg, rgba(146, 64, 14, 0.18) 0%, rgba(146, 64, 14, 0.28) 100%);
  border-color: rgba(251, 191, 36, 0.5);
  color: #fde68a;
}

/* Boutons période en version desktop : long visible, court masqué. */
.pc-period-long { display: inline; }
.pc-period-short { display: none; }

/* Boutons période verrouillés (Standard) — fond ambré + étoile à côté. */
.pc-period-btn--locked {
  background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
  color: #92400e !important;
  border-color: #fcd34d !important;
  position: relative;
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
}
.pc-period-btn--locked:hover {
  background: linear-gradient(135deg, #fde68a, #fcd34d) !important;
}
.pc-period-btn__premium {
  margin-left: 2px;
}

/* Aperçu flouté des séances verrouillées (Standard) : 2-3 lignes en
   filigrane + bannière CTA Premium juste en-dessous. */
.pc-sessions-locked {
  margin-top: 10px;
  position: relative;
}
.pc-sessions-locked__ghost {
  filter: blur(3px) opacity(0.45);
  pointer-events: none;
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pc-sessions-locked .pc-report-locked {
  margin-top: 10px;
}
.pc-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--c-border);
}
.pc-col-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--c-text);
  margin: 0;
  text-transform: none;
}
.pc-vitality-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--c-tint-cool);
  border: 1px solid var(--c-border);
  color: var(--c-muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  min-height: unset;
  box-shadow: none;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.pc-vitality-btn.active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: none;
}
.pc-vitality-btn:hover:not(.active) { background: var(--c-tint-cool-2); transform: none; box-shadow: none; }

/* Filtres catégories dans Séance */
.pc-cat-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 14px;
}
.pc-cat-btn {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 11px;
  border-radius: 20px;
  background: var(--c-tint-cool);
  border: 1px solid var(--c-border);
  color: var(--c-muted);
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  min-height: unset;
  box-shadow: none;
  transition: background 0.15s;
}
.pc-cat-btn.active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
  font-weight: 600;
}
.pc-cat-btn:hover:not(.active) { background: var(--c-tint-cool-2); transform: none; box-shadow: none; }

/* ── Lignes de suivi (remplacement des tracking-tiles dans les tabs) ── */
.pc-tracking-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pc-trow {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--c-tint-cool);
  border: 1px solid var(--c-border);
  cursor: pointer;
  text-align: left;
  min-height: unset;
  box-shadow: none;
  transition: background 0.12s;
  color: var(--c-text);
}
.pc-trow:hover { background: var(--c-tint-cool-2); transform: none; box-shadow: none; }
.pc-trow.disabled { opacity: 0.55; }
.pc-trow-icon { font-size: 1.1rem; flex-shrink: 0; line-height: 1; }
.pc-trow-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pc-trow-label {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-trow-meta {
  font-size: 0.72rem;
  color: var(--c-muted);
}
/* Chips d'heures dans "Suivis actifs" — colorées selon le statut du jour :
   - taken    : vert  (✓ confirmé près de cette heure)
   - missed   : rouge (✕ passé sans confirmation)
   - upcoming : ambre (à venir aujourd'hui) */
.pc-hour-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
}
.pc-hour-chip--taken {
  background: rgba(34, 197, 94, 0.12);
  color: #065f46;
  border-color: rgba(34, 197, 94, 0.45);
}
.pc-hour-chip--missed {
  background: rgba(239, 68, 68, 0.10);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.40);
}
.pc-hour-chip--upcoming {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.45);
}
[data-theme="dark"] .pc-hour-chip--taken {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.5);
}
[data-theme="dark"] .pc-hour-chip--missed {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.5);
}
[data-theme="dark"] .pc-hour-chip--upcoming {
  background: rgba(245, 158, 11, 0.20);
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.55);
}

/* Pastille verte "✓ Pris le …" affichée sous le libellé du suivi quand
   le patient a confirmé via sa montre connectée. */
.pc-trow-confirmed {
  font-size: 0.7rem;
  font-weight: 700;
  color: #065f46;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border: 1px solid #6ee7b7;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-self: flex-start;
  margin-top: 4px;
  white-space: nowrap;
}
[data-theme="dark"] .pc-trow-confirmed {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.4);
  color: #bbf7d0;
}
.pc-trow-disabled {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--c-danger);
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 12px;
  padding: 1px 7px;
  flex-shrink: 0;
}
.pc-trow-add {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 9px;
  background: transparent;
  border: 1.5px dashed var(--c-border);
  color: var(--c-muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  min-height: unset;
  box-shadow: none;
  transition: border-color 0.15s, color 0.15s;
  margin-top: 2px;
}
.pc-trow-add:hover { border-color: var(--c-primary); color: var(--c-primary); transform: none; box-shadow: none; }

/* Section headers dans les colonnes */
.pc-col-section { margin-bottom: 16px; }
.pc-col-section:last-child { margin-bottom: 0; }
.pc-col-section-hdr {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

/* Ligne "séance" dans l'historique (tab Séance) */
.pc-session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  background: var(--c-tint-cool);
  border-radius: 9px;
  border: 1px solid var(--c-border);
  gap: 8px;
}
.pc-session-row + .pc-session-row { margin-top: 5px; }
.pc-session-date { font-weight: 600; font-size: 0.83rem; color: var(--c-text); }
.pc-session-score {
  font-size: 0.92rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Bouton PDF Q&A de l'historique des séances : aucun effet ni hauteur
   minimale hérités du style global des <button> (ombre, translation). */
.pc-session-pdf-btn {
  min-height: 0;
  box-shadow: none;
  transition: none;
}
.pc-session-pdf-btn:hover:not(:disabled),
.pc-session-pdf-btn:active:not(:disabled) {
  transform: none;
  box-shadow: none;
}

/* Ligne rapport dans tab Séance */
.pc-report-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--c-tint-cool);
  border-radius: 9px;
  border: 1px solid var(--c-border);
  cursor: pointer;
  width: 100%;
  text-align: left;
  min-height: unset;
  box-shadow: none;
  transition: background 0.12s;
  color: var(--c-text);
}
.pc-report-row:hover { background: var(--c-tint-cool-2); transform: none; box-shadow: none; }
.pc-report-row + .pc-report-row { margin-top: 5px; }
.pc-report-icon { font-size: 1.25rem; flex-shrink: 0; }
.pc-report-info { flex: 1; min-width: 0; }
.pc-report-name { font-weight: 600; font-size: 0.83rem; color: var(--c-text); }
.pc-report-meta { font-size: 0.72rem; color: var(--c-muted); margin-top: 1px; }
.pc-report-action { font-size: 0.75rem; color: var(--c-primary); font-weight: 600; flex-shrink: 0; }

/* Dark mode pour les nouvelles classes */
[data-theme="dark"] .pc-trow { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .pc-trow:hover { background: rgba(255,255,255,0.07); }
[data-theme="dark"] .pc-session-row,
[data-theme="dark"] .pc-report-row { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .pc-report-row:hover { background: rgba(255,255,255,0.07); }

/* Légende MultiLineChart */
.mlc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 10px;
  font-size: 0.75rem;
  color: var(--c-muted);
}
.mlc-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mlc-legend-line {
  width: 22px;
  height: 3px;
  border-radius: 2px;
  flex-shrink: 0;
}
.mlc-legend-bar {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
  opacity: 0.85;
}
.mlc-legend-dash {
  width: 22px;
  height: 0;
  border-top: 2px dashed;
  flex-shrink: 0;
}

/* Dark mode */
[data-theme="dark"] .pc-status-badge {
  background: rgba(0,200,194,0.15);
  color: #67e8f9;
  border-color: rgba(103,232,249,0.3);
}
[data-theme="dark"] .pc-badge-confirmed {
  background: rgba(34,197,94,0.12);
  color: #4ade80;
  border-color: rgba(74,222,128,0.3);
}
[data-theme="dark"] .pc-photo-frame {
  background: transparent;
  border: none;
}
[data-theme="dark"] .pc-upcoming-header,
[data-theme="dark"] .pc-upcoming-row:hover {
  background: rgba(255,255,255,0.04);
}
[data-theme="dark"] .pc-upcoming-icon {
  background: rgba(96,165,250,0.15);
}
[data-theme="dark"] .pc-demog-row {
  border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .pc-demog-col {
  border-right-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .pc-btn-schedule {
  color: #93c5fd;
  border-color: #93c5fd;
}
[data-theme="dark"] .pc-btn-schedule:hover { background: rgba(96,165,250,0.1); }
[data-theme="dark"] .pc-tab.active { color: #93c5fd; border-bottom-color: #93c5fd; }
[data-theme="dark"] .pc-edit-profile-link { color: #93c5fd; }
[data-theme="dark"] .pc-stat-card.pc-stat-blue .pc-stat-value { color: #93c5fd; }
[data-theme="dark"] .pc-stat-card.pc-stat-amber .pc-stat-value { color: #fcd34d; }
.pdv2-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.pdv2-name {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--c-text);
  margin: 0;
  line-height: 1.2;
}
.pdv2-rel-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 20px;
  background: rgba(0, 157, 152, 0.12);
  color: var(--c-cyan);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(0, 157, 152, 0.25);
  white-space: nowrap;
}
.pdv2-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 10px 0 14px 0;
}
.pdv2-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pdv2-meta-label {
  font-size: 0.7rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.pdv2-meta-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Suivis (upcoming-style) */
.pdv2-upcoming-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--c-tint-cool);
  border-bottom: 1px solid var(--c-border);
}
.pdv2-upcoming-header h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--c-text);
}
.pdv2-upcoming-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
  transition: background 0.15s;
}
.pdv2-upcoming-row:last-child {
  border-bottom: none;
}
.pdv2-upcoming-row:hover {
  background: var(--c-tint-cool);
}
.pdv2-upcoming-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--c-primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pdv2-upcoming-info {
  flex: 1;
  min-width: 0;
}
.pdv2-upcoming-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pdv2-upcoming-time {
  font-size: 0.76rem;
  color: var(--c-muted);
  margin-top: 2px;
}
.pdv2-confirmed-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid rgba(22, 163, 74, 0.25);
  white-space: nowrap;
  flex-shrink: 0;
}
.pdv2-upcoming-more {
  display: flex;
  justify-content: center;
  padding: 10px;
  border-top: 1px solid var(--c-border);
}
.pdv2-upcoming-more button {
  font-size: 0.82rem;
  min-height: 30px;
  padding: 0 16px;
  border-radius: 20px;
}

/* Tab navigation */
.pdv2-tabs {
  display: flex;
  gap: 0;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.pdv2-tab {
  flex: 1;
  min-height: 38px;
  padding: 0 12px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--c-muted);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: none;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.pdv2-tab.active {
  background: var(--c-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.pdv2-tab:hover:not(.active):not(:disabled) {
  background: var(--c-tint-cool);
  color: var(--c-text);
  transform: none;
  box-shadow: none;
}

/* Category filter tabs (Séance) */
.pdv2-cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.pdv2-cat-tab {
  min-height: 30px;
  padding: 0 13px;
  font-size: 0.78rem;
  border-radius: 20px;
  background: var(--c-tint-cool);
  color: var(--c-muted);
  border: 1px solid var(--c-border);
  box-shadow: none;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.pdv2-cat-tab.active {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
  font-weight: 600;
}
.pdv2-cat-tab:hover:not(.active) {
  background: var(--c-tint-cool-2);
  color: var(--c-text);
  transform: none;
  box-shadow: none;
}

/* Vitalité metric toggle */
.pdv2-vitality-toggle {
  display: flex;
  gap: 6px;
}
.pdv2-vitality-btn {
  min-height: 30px;
  padding: 0 14px;
  font-size: 0.8rem;
  border-radius: 20px;
  background: var(--c-tint-cool);
  color: var(--c-muted);
  border: 1px solid var(--c-border);
  box-shadow: none;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.pdv2-vitality-btn.active {
  background: var(--c-cyan);
  color: #fff;
  border-color: var(--c-cyan);
  font-weight: 600;
}
.pdv2-vitality-btn:hover:not(.active) {
  background: var(--c-tint-cool-2);
  color: var(--c-text);
  transform: none;
  box-shadow: none;
}

/* Responsive */
@media (max-width: 640px) {
  .pdv2-hero { flex-direction: column; align-items: flex-start; }
  .pdv2-hero-actions { flex-direction: row; width: 100%; }
  .pdv2-action-btn { flex: 1; }
  .pdv2-hero-body { width: 100%; }
  .pdv2-name { font-size: 1.3rem; }
  .pdv2-meta-row { gap: 12px; }
  .pdv2-tabs { gap: 0; }
  .pdv2-tab { font-size: 0.78rem; padding: 0 6px; }
}

/* Dark mode */
[data-theme="dark"] .pdv2-rel-badge {
  background: rgba(0, 200, 194, 0.15);
  color: #67e8f9;
  border-color: rgba(103, 232, 249, 0.3);
}
[data-theme="dark"] .pdv2-confirmed-badge {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.3);
}
[data-theme="dark"] .pdv2-upcoming-header {
  background: rgba(255,255,255,0.03);
}
[data-theme="dark"] .pdv2-upcoming-row:hover {
  background: rgba(255,255,255,0.04);
}
[data-theme="dark"] .pdv2-upcoming-icon {
  background: rgba(96, 165, 250, 0.15);
}
[data-theme="dark"] .pdv2-tab.active {
  background: var(--c-primary);
}
[data-theme="dark"] .pdv2-cat-tab,
[data-theme="dark"] .pdv2-vitality-btn {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.5);
}
[data-theme="dark"] .pdv2-cat-tab:hover:not(.active),
[data-theme="dark"] .pdv2-vitality-btn:hover:not(.active) {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.85);
}
[data-theme="dark"] .pdv2-avatar-circle {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(255,255,255,0.15);
}


/* =========================================================================
   MOBILE / TÉLÉPHONE — Lot 1 (Auth + landing) & Lot 2 (Master + tab bar)
   Breakpoint cible : ≤ 600px (couvre tous les téléphones en portrait,
   préserve la mise en page tablette ≥ 768px).
   ========================================================================= */
@media (max-width: 600px) {
  /* ---- Shell & cards (commun à toutes les pages) ---- */
  .app-shell {
    padding: 14px 12px;
  }
  .card {
    padding: 18px 16px;
    border-radius: 16px;
    margin-bottom: 14px;
  }
  .card.glass {
    /* Backdrop-filter coûte cher sur Safari mobile et provoque des
       saccades au scroll → on le désactive en téléphone. */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--c-surface);
  }
  .header {
    padding: 10px 0 14px 0;
  }
  .header h1 {
    font-size: 1.35rem;
    line-height: 1.2;
  }
  /* Header en mobile : on autorise le wrap pour que les éléments
     secondaires (badge premium, lien "Fonctionnalités Premium",
     bouton "← Retour") s'empilent proprement sous le titre. */
  .header {
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
  }

  /* Boutons & inputs : cibles tactiles confortables, pas de zoom Safari. */
  button {
    min-height: 50px;
    font-size: 1rem;
    padding: 0 18px;
  }
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="date"],
  input[type="number"],
  input[type="tel"],
  textarea,
  select {
    /* iOS Safari zoome dès que font-size < 16px → on garde 16px. */
    font-size: 16px;
    padding: 12px 14px;
  }

  /* Boutons Logout + Theme — un peu plus petits sur mobile. */
  .theme-toggle,
  .logout-toggle {
    width: 40px;
    height: 40px;
  }
  .chrome-actions {
    padding: 8px 10px 0;
  }

  /* ---- Lot 1 : Auth (Login/Register/2FA/Reset) ---- */
  .auth-header {
    margin-bottom: 16px;
  }
  .auth-header h1 {
    font-size: 1.5rem;
  }
  .auth-icon {
    width: 56px;
    height: 56px;
  }
  .auth-illustration svg,
  .auth-illustration img {
    max-width: 110px;
    height: auto;
  }
  .profile-picker {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .profile-option {
    min-height: 60px;
    padding: 12px 14px;
  }
  .totp-input {
    font-size: 1.5rem;
    letter-spacing: 0.5em;
    padding: 14px 12px;
  }

  /* ---- Paramètres / 2FA en mobile : tabs scrollables horizontalement,
     feature-row qui wrap proprement, secret box compact. ---- */
  .settings-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 4px 0 14px;
    gap: 6px;
    /* Masque les scrollbars iOS/macOS pour rester propre. */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .settings-tabs::-webkit-scrollbar {
    display: none;
  }
  .settings-tabs .tab {
    flex: 0 0 auto;
    min-width: 0;
    padding: 8px 12px;
    font-size: 0.85rem;
    gap: 5px;
  }
  .settings-tabs .tab span {
    font-size: 0.82rem;
  }

  /* Feature-row : sur 375 px, l'icône 48 + texte + chip dépassent. On
     réduit l'icône, on autorise le texte à wrap, et on garde le chip
     compact à droite. */
  .feature-row {
    gap: 10px;
    align-items: flex-start;
  }
  .feature-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }
  .feature-row h2 {
    font-size: 1.05rem !important;
    line-height: 1.25;
  }
  .feature-row p.muted {
    font-size: 0.85rem;
    line-height: 1.4;
  }
  .status-chip {
    padding: 4px 10px;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    /* Empêche le chip de pousser le texte : il se place sur la même ligne
       que le titre via align-self center, ou wrap en haut à droite. */
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
    white-space: nowrap;
  }

  /* Cards du 2FA tab : padding intérieur réduit pour 375 px. */
  .qr-wrap {
    margin: 12px 0;
    text-align: center;
  }
  .qr-wrap svg {
    width: 100% !important;
    height: auto !important;
    max-width: 280px;
  }
  .secret-box {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px;
  }
  .secret-box code {
    font-size: 0.78rem;
    word-break: break-all;
    text-align: center;
  }
  .secret-box button {
    width: 100%;
  }

  /* Card 2FA "Désactiver" : padding réduit. */
  .pricing-shell {
    padding-left: 8px;
    padding-right: 8px;
  }
  .consent-row {
    font-size: 0.95rem;
    align-items: flex-start;
    gap: 10px;
  }
  .stack {
    gap: 14px;
  }

  /* ---- Lot 1 : Landing (deux cartes proche/patient) ---- */
  .landing-hero {
    padding: 24px 12px 12px 12px;
  }
  .landing-hero h1 {
    font-size: 1.9rem;
  }
  .landing-hero .slogan {
    font-size: 1rem;
  }
  .landing-logo {
    max-width: 200px;
  }
  .role-card {
    padding: 22px 18px;
    gap: 14px;
  }
  .role-card .illustration {
    width: 120px;
    height: 120px;
  }
  .role-card h2 {
    font-size: 1.2rem;
  }
  .role-card .role-desc {
    min-height: 0;
    font-size: 0.92rem;
  }

  /* ---- Lot 2 : Master shell — masquer la sidebar, ajouter padding-bottom
     pour la tab bar fixe ---- */
  .master-sidebar {
    display: none;
  }
  .master-content .app-shell {
    padding: 14px 12px 88px 12px; /* 88px = 64 tab bar + 16 + safe-area */
  }
  .master-content .header {
    padding-right: 110px !important;
  }

  /* ---- Lot 2 : grilles dashboards ----
     Charts : 1 col (les diagrammes ont besoin de toute la largeur)
     Stats / KPI : 2 cols compact pour rester scannable d'un coup d'œil */
  .dashboard-charts {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .dashboard-kpis,
  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .kpi-tile {
    padding: 12px 12px !important;
    gap: 8px !important;
  }
  .kpi-tile .kpi-value,
  .kpi-tile strong {
    font-size: 1.15rem !important;
  }

  /* En mobile/tablette : on garde l'idée "page non-scrollable, liste
     scrollable", mais on réduit les paddings et tailles des éléments
     au-dessus pour que la liste reste lisible. */
  .master-home-shell {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
  }
  .master-home-shell > .master-patients-list {
    overflow-y: auto;
    padding-right: 2px;
  }

  /* Dashboard chart en plein écran sur mobile : utiliser tout le viewport
     en mode paysage (CSS-rotation gérée dans la règle générique). */
  .dashboard-chart--fs {
    padding: 14px !important;
  }
  .welcome-banner {
    padding: 18px 16px;
  }
  .welcome-banner h2,
  .welcome-banner h1 {
    font-size: 1.25rem;
  }

  /* ---- Lot 2 : Tables (MasterQuestions, AdminUsers) → cards ---- */
  /* Le pattern : on transforme chaque ligne en bloc empilé. Les <td> qui
     portent un attribut data-label affichent leur libellé en italique
     gris au-dessus de la valeur. Sans data-label, la cellule s'affiche
     simplement en pleine largeur (utile pour la colonne "Actions"). */
  .responsive-table,
  .responsive-table thead,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table th,
  .responsive-table td {
    display: block;
    width: 100% !important;
  }
  .responsive-table thead {
    /* On masque la rangée d'en-tête : chaque cellule porte son propre
       libellé via data-label, plus lisible empilé. */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }
  .responsive-table tr {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
  }
  .responsive-table td {
    padding: 6px 0 !important;
    border: none !important;
    text-align: left !important;
    white-space: normal !important;
    max-width: none !important;
  }
  .responsive-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
  }
  /* Cellule "Actions" sans label : on lui donne une marge top pour
     respirer après la dernière donnée. */
  .responsive-table td:not([data-label]) {
    margin-top: 8px;
    padding-top: 8px !important;
    border-top: 1px solid var(--c-border) !important;
  }

  /* ---- Lot 3 : AdminHome standard (proches/aidants) ----
     Règles communes aux trois pages d'accueil (Admin/Premium/Master)
     via la classe .actions-row : empile les boutons d'action en
     colonne pleine largeur, ce qui évite les boutons écrasés à 80px
     de large quand on les met côte à côte sur 375px. */
  .actions-row {
    flex-direction: column;
    gap: 10px;
  }
  .actions-row > .button-link,
  .actions-row > a.button-link,
  .actions-row > button {
    flex: 1 1 auto !important;
    width: 100%;
    min-width: 0;
  }

  /* ---- Lot 4 : navigation par onglets Premium (PremiumHome,
     PremiumSuivi, PremiumTests, PremiumReports). Onglets construits
     en inline-style — on cible la signature `display:flex` dans
     `.app-shell > div` n'est pas fiable, donc on ajoute la classe
     utilitaire .premium-nav-tabs côté JSX, plus propre. */
  .premium-nav-tabs {
    margin-bottom: 14px !important;
    gap: 2px !important;
    padding: 3px !important;
    /* Indique visuellement qu'on peut scroll horizontal si nécessaire. */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .premium-nav-tabs::-webkit-scrollbar {
    display: none;
  }
  .premium-nav-tabs > a {
    padding: 7px 12px !important;
    font-size: 0.82rem !important;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* ---- Lot 4 : PremiumSuivi — steppers d'objectifs ----
     Réduit le gap entre les deux blocs (Sessions/sem + Durée) pour
     éviter qu'ils prennent deux lignes pour rien. Les boutons +/−
     restent à 36px = cible tactile correcte. */
  .premium-goal-row {
    gap: 12px !important;
  }
  .premium-goal-row > div {
    min-width: 140px !important;
  }

  /* ---- Lot 4 (PatientDetail) : header sur une ligne en mobile / aperçu ----
     Layout via CSS Grid à 3 colonnes :
       [← back icône]  [Profil patient ──────]  [Modifier][Export]
     Le bouton retour est ainsi collé au titre (et non sur sa propre
     ligne), comme demandé pour les aperçus tablette / GSM. */
  .pc-shell.app-shell {
    padding-top: 14px !important;
  }
  .pc-page-header {
    display: grid !important;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "back title actions";
    column-gap: 8px !important;
    padding: 0 8px 12px 0 !important;
    margin-top: 0 !important;
    align-items: center;
  }
  .pc-back-btn {
    grid-area: back;
    justify-self: start;
    padding: 0 !important;
    width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    font-size: 1rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
  }
  .pc-back-label {
    display: none !important;
  }
  .pc-page-header h1 {
    grid-area: title;
    font-size: 1.2rem !important;
    margin: 0 !important;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .pc-header-actions {
    grid-area: actions;
    justify-self: end;
    margin: 0 !important;
    gap: 6px !important;
    display: flex !important;
    align-items: center;
    position: static !important;
  }
  /* Boutons d'action 40 px ronds → match exact theme-toggle / logout-toggle
     (40 px en mobile). Visuellement : [Modifier][Export] sur la même ligne
     que le titre, alignés verticalement avec theme/logout flottants. */
  .pc-action-btn {
    width: 40px !important;
    height: 40px !important;
    min-height: 0 !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
  }
  .pc-action-btn__label {
    display: none !important;
  }

  /* ---- Bouton "+ Ajouter" / "+ Définir" / "+ Générer" sur les en-têtes
     de cartes : icône seule (rond 30 px) en mobile. */
  .pc-add-btn {
    width: 30px !important;
    height: 30px !important;
    min-height: 0 !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
  }
  .pc-add-btn__label {
    display: none !important;
  }

  /* ---- Vitalité : segmented control icône-seule en mobile (❤️ 😊 ⚡). */
  .pc-vitality-btn span {
    display: none !important;
  }
  .pc-vitality-btn {
    padding: 4px 6px !important;
    min-width: 30px;
  }

  /* ---- Score par catégorie : boutons période en version courte (1m/3m/1a)
     pour économiser la place. */
  .pc-period-long {
    display: none;
  }
  .pc-period-short {
    display: inline;
  }
  .pc-period-btn {
    padding: 4px 8px !important;
    font-size: 0.75rem !important;
    min-height: 0 !important;
  }
  .pc-period-group {
    display: flex;
    align-items: center;
    gap: 3px;
  }

  /* ---- Lot 4 (PatientDetail) : bandeau démographique ----
     À 375 px, 4-5 colonnes (Sexe/Âge/Naissance/Ville/Diagnostic)
     deviennent illisibles : la date est tronquée et les colonnes
     se collent. On force un wrap à 2 colonnes par ligne et on
     ajoute un séparateur en bas (en plus de la bordure droite
     existante) pour la deuxième rangée. */
  .pc-demog-col {
    flex: 1 1 calc(50% - 0.5px) !important;
    min-width: 0 !important;
    padding: 8px 8px !important;
    border-bottom: 1px solid var(--c-border);
  }
  .pc-demog-col:nth-child(2n) {
    border-right: none;
  }
  .pc-demog-col:nth-last-child(-n + 2) {
    border-bottom: none;
  }
  .pc-demog-value {
    white-space: normal !important;
    font-size: 0.82rem !important;
  }
  .pc-demog-label {
    font-size: 0.62rem !important;
  }

  /* ---- Lot 4 : PremiumTests / PremiumReports — listes de cartes ----
     Les cartes d'action utilisent `display:flex; gap:8px; flex-wrap:wrap`
     en inline. En mobile on force pleine largeur pour les boutons
     d'action en bas de carte via la classe .card-actions. */
  .card-actions {
    gap: 8px !important;
    flex-wrap: wrap;
  }
  .card-actions > .button-link,
  .card-actions > a.button-link,
  .card-actions > button {
    flex: 1 1 auto !important;
    min-width: 0;
    padding: 0 14px !important;
    font-size: 0.88rem !important;
  }
}

/* =========================================================================
   PATIENT WATCH — Cadran Galaxy Watch 4 + notifications One UI Watch
   ========================================================================= */
.watch-stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  padding: 0;
  /* Famille One UI = Roboto-like ; on garde la police système (lisible
     sur AMOLED) et on désactive le smoothing pour le rendu pixel pur. */
  font-family: "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
}
.watch-screen {
  width: 100%;
  height: 100%;
  min-height: 220px;
  background: #000;
  color: #fff;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 22px;
  text-align: center;
  overflow: hidden;
  position: relative;
}

/* -------- Cadran "One UI Watch" (face par défaut) -------- */
.gw-face {
  justify-content: center;
  gap: 4px;
}
.gw-face__top-actions {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
}
.gw-mini-btn {
  width: 22px;
  height: 22px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.15s ease;
}
.gw-mini-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}
.gw-face__time {
  font-size: 2.3rem;
  font-weight: 200; /* One UI Watch utilise une typo ultra fine pour l'heure */
  line-height: 1;
  letter-spacing: -1px;
  color: #fff;
  font-variant-numeric: tabular-nums;
  margin-top: 18px;
}
.gw-face__date {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.55);
  text-transform: capitalize;
  letter-spacing: 0.6px;
  margin-top: 1px;
}
.gw-face__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0;
}

/* Complications style anneau avec icône + valeur, en arc en bas. */
.gw-face__complications {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  justify-content: center;
  margin-top: 2px;
}
.gw-comp {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 30px;
  padding: 3px 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
}
.gw-comp--cyan  { border-color: rgba(34, 211, 238, 0.45); }
.gw-comp--green { border-color: rgba(34, 197, 94, 0.45); }
.gw-comp--amber { border-color: rgba(245, 158, 11, 0.55); }
.gw-comp__icon {
  font-size: 0.62rem;
  line-height: 1;
}
.gw-comp__val {
  font-size: 0.58rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  font-variant-numeric: tabular-nums;
}

/* Pastille de notification (en bas du cadran) — discrète mais cliquable
   pour ouvrir la notif en plein écran. */
.gw-face__notif-pill {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.22);
  border: 1px solid rgba(14, 165, 233, 0.5);
  color: #67e8f9;
  font-size: 0.6rem;
  min-height: 0;
  cursor: pointer;
  box-shadow: none;
  animation: gw-notif-glow 1.8s ease-in-out infinite;
}
.gw-face__notif-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 6px rgba(34, 211, 238, 0.9);
}
@keyframes gw-notif-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
  50%      { box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.18); }
}

/* -------- Notification "incoming" style One UI Watch --------
   Sur Galaxy Watch 4, l'arrivée d'une notif déclenche une vibration
   puis une carte qui glisse depuis le bas avec un liseré coloré de
   l'app, le nom de l'app + l'heure, le titre en gras, le corps
   et 2 boutons d'action (Fermer / Ouvrir). */
.gw-incoming {
  cursor: pointer;
  position: relative;
}
.gw-incoming__backdrop {
  position: absolute;
  inset: 0;
  background: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: blur(1px) opacity(0.35);
}
.gw-incoming__bg-time {
  margin: 0;
}

.gw-incoming__card {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  background: #0b1220;
  border-radius: 50%;
  padding: 22px 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  /* Animation de slide-up depuis le bas comme sur la vraie Galaxy Watch. */
  animation: gw-incoming-slide 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
  overflow: hidden;
}
@keyframes gw-incoming-slide {
  0%   { transform: translateY(40%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Liseré coloré accent en haut (8 px) — bleu cyan pour les séances,
   ambre/or pour les rappels de suivi. */
.gw-incoming__accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #0ea5e9 0%, #38bdf8 100%);
}
.gw-incoming--tracking .gw-incoming__accent {
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.gw-incoming__header {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 6px;
  letter-spacing: 0.4px;
}
.gw-incoming__app-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  font-size: 0.6rem;
}
.gw-incoming--tracking .gw-incoming__app-icon {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.gw-incoming__app-name {
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}
.gw-incoming__time {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.6);
}

.gw-incoming__title {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  margin-bottom: 4px;
  max-width: 100%;
}
.gw-incoming__body {
  font-size: 0.62rem;
  font-weight: 400;
  line-height: 1.32;
  color: rgba(255, 255, 255, 0.82);
  max-width: 100%;
  flex: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

/* Boutons d'action en bas (Fermer / Ouvrir) — rond + pillule, comme
   sur la vraie Galaxy Watch en mode notif. */
.gw-incoming__actions {
  display: flex;
  gap: 5px;
  margin-top: 8px;
  width: 100%;
  justify-content: center;
}
.gw-incoming__action {
  min-height: 0;
  padding: 0;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.66rem;
  letter-spacing: 0.4px;
  box-shadow: none;
  transition: background 0.15s ease, transform 0.15s ease;
}
.gw-incoming__action--dismiss {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
}
.gw-incoming__action--dismiss:hover {
  background: rgba(255, 255, 255, 0.22);
}
.gw-incoming__action--open {
  height: 26px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  color: #001018;
}
.gw-incoming--tracking .gw-incoming__action--open {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #1a0e00;
}
.gw-incoming__action--open:hover {
  filter: brightness(1.08);
}

/* Accusé de réception "Confirmé à HH:MM" affiché à la place des actions
   après clic sur ✓ Pris. Animation pop pour valider visuellement. */
.gw-incoming__confirmed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: #86efac;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  animation: gw-confirmed-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.gw-incoming__confirmed-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #22c55e;
  color: #052e16;
  font-weight: 900;
  font-size: 0.7rem;
}
@keyframes gw-confirmed-pop {
  0%   { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Toast côté panneau de test quand la montre envoie une confirmation. */
.watch-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border: 1px solid #34d399;
  color: #065f46;
  font-size: 0.82rem;
  animation: watch-toast-in 0.3s ease-out;
}
.watch-toast__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #22c55e;
  color: #fff;
  font-weight: 900;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.watch-toast__sub {
  font-size: 0.74rem;
  font-weight: 500;
  margin-top: 1px;
  color: #14532d;
}
@keyframes watch-toast-in {
  0%   { transform: translateY(6px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
[data-theme="dark"] .watch-toast {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.3));
  border-color: rgba(34, 197, 94, 0.5);
  color: #bbf7d0;
}
[data-theme="dark"] .watch-toast__sub {
  color: rgba(187, 247, 208, 0.85);
}

/* =========================================================================
   DASHBOARD — Chart "Revenus abonnements" plein écran
   ========================================================================= */
.chart-fs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--c-tint-cool-2, #f1f5f9);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  cursor: pointer;
  padding: 0;
  min-height: 0;
  box-shadow: none;
  transition: background 0.15s ease, transform 0.15s ease;
}
.chart-fs-btn:hover {
  background: var(--c-primary-light, #e0f2fe);
  transform: scale(1.06);
}

/* Carte en mode plein écran. Le but est d'afficher le graphique
   en mode PAYSAGE pour mieux lire l'évolution mensuelle, peu importe
   l'orientation du téléphone. Stratégie :
     - En orientation portrait (cas iPhone tenu droit), on fait pivoter
       le conteneur de 90° via CSS pour simuler le paysage. L'utilisateur
       n'a pas à tourner son téléphone.
     - En orientation paysage (téléphone tourné, écran déjà large), pas
       de rotation : on prend tout le viewport normalement. */
.dashboard-chart--fs {
  position: fixed !important;
  inset: 0 !important;
  margin: 0 !important;
  z-index: 9990;
  border-radius: 0 !important;
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  padding: 24px !important;
  overflow: auto;
  transform-origin: center center;
}
.dashboard-chart--fs .dashboard-chart__header {
  flex-shrink: 0;
}
.dashboard-chart--fs .line-chart-wrap,
.dashboard-chart--fs .line-chart {
  flex: 1;
  width: 100%;
  height: auto;
  max-height: 80vh;
}

/* Portrait : on pivote le conteneur. Largeur = hauteur de l'écran et
   inversement, puis rotation 90° autour du centre du viewport. */
@media (orientation: portrait) {
  .dashboard-chart--fs {
    width: 100vh !important;
    height: 100vw !important;
    top: 50% !important;
    left: 50% !important;
    inset: auto !important;
    transform: translate(-50%, -50%) rotate(90deg);
  }
  .dashboard-chart--fs .line-chart-wrap,
  .dashboard-chart--fs .line-chart {
    /* En paysage simulé, le viewport "long" devient la largeur. */
    max-height: none;
  }
}
.dashboard-chart__hint {
  font-size: 0.82rem;
  font-style: italic;
  text-align: center;
  margin-top: 16px;
}

/* MasterHome : la page entière NE SCROLL PAS. Seule la liste de patients
   est scrollable, à l'intérieur de la zone allouée. On utilise un flex
   column qui remplit la hauteur du viewport (iframe ou fenêtre). */
.master-home-shell {
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* On garde la largeur max héritée de .app-shell ; le padding reste. */
}
/* Tous les enfants du shell (header, welcome banner, stats, actions, etc.)
   gardent leur taille naturelle. Seule la liste prend la place restante. */
.master-home-shell > *:not(.master-patients-list) {
  flex-shrink: 0;
}
.master-home-shell > .master-patients-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding-right: 4px;
  /* Joli scrollbar discret. */
  scrollbar-width: thin;
  scrollbar-color: var(--c-border) transparent;
}
.master-home-shell > .master-patients-list::-webkit-scrollbar {
  width: 6px;
}
.master-home-shell > .master-patients-list::-webkit-scrollbar-thumb {
  background: var(--c-border);
  border-radius: 3px;
}
.master-home-shell > .master-patients-list::-webkit-scrollbar-track {
  background: transparent;
}
/* En aperçu tablette / GSM (iframe DeviceFrame), on masque la scrollbar
   de la liste des patients — la liste reste défilable au toucher. */
html.cortexia-in-frame .master-patients-list {
  scrollbar-width: none;
}
html.cortexia-in-frame .master-patients-list::-webkit-scrollbar {
  width: 0;
  display: none;
}

/* Override responsive : en mobile/tablette (iframe DeviceFrame compris), le
   height:100vh + overflow:hidden ci-dessus écraserait la liste de patients
   à 0px (header + welcome + stats + boutons dépassent déjà 100vh une fois
   empilés). On laisse la page entière scroller à la place. Cette règle doit
   être placée APRÈS le bloc .master-home-shell de base, sinon la cascade
   la perd (même spécificité, la dernière déclarée gagne). */
@media (max-width: 600px) {
  /* Sur téléphone réel : on garde le scroll uniquement sur la liste
     (cohérent avec le comportement desktop / iframe tablette/GSM). */
  .master-home-shell {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
  }
  .master-home-shell > .master-patients-list {
    overflow-y: auto;
  }
}

/* =========================================================================
   Aperçu appareil (iframe DeviceFrame GSM/tablette) — page « Mes proches ».
   Contrairement au PC, on NE fige PAS la hauteur de page : tout défile
   naturellement comme une vraie app mobile, et la liste de patients
   s'affiche en entier — aucun scroll interne, aucune scrollbar. Le
   comportement « page figée + liste scrollable » reste réservé au PC.
   ========================================================================= */
html.cortexia-in-frame .master-home-shell {
  height: auto;
  max-height: none;
  overflow: visible;
}
html.cortexia-in-frame .master-home-shell > .master-patients-list {
  flex: none;
  overflow-y: visible;
}
/* En aperçu GSM, la largeur utile du header est réduite (~241px) par la
   réserve de 110px gardée pour les boutons chrome. À 1.35rem,
   « Mes proches suivis » déborde et « suivis » passe à la ligne. On réduit
   la taille pour garder le titre + l'icône premium sur une seule ligne. */
@media (max-width: 430px) {
  html.cortexia-in-frame .master-home-shell .header h1 {
    font-size: 1.15rem;
    white-space: nowrap;
  }
}

/* =========================================================================
   ADMIN STANDARD — Vue verrouillée pour les onglets Premium
   ========================================================================= */
.admin-lock-view {
  position: relative;
  min-height: 420px;
  margin-top: 12px;
}
.admin-lock-view__ghost {
  /* Cards en filigrane pour suggérer ce qu'offre la version Premium. */
  display: flex;
  flex-direction: column;
  gap: 14px;
  filter: blur(4px) opacity(0.45);
  pointer-events: none;
  user-select: none;
}
.admin-lock-view__card {
  background: var(--c-surface);
  padding: 20px 22px;
}
.admin-lock-view__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.92) 60%);
  border-radius: 18px;
  border: 1px solid var(--c-border);
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.15);
}
.admin-lock-view__overlay > svg:first-child {
  color: var(--c-accent, #d97706);
  margin-bottom: 4px;
}
.admin-lock-view__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--c-text);
  max-width: 480px;
  line-height: 1.3;
}
.admin-lock-view__sub {
  margin: 4px 0 0;
  color: var(--c-muted);
  font-size: 0.92rem;
  max-width: 460px;
  line-height: 1.45;
}
.admin-lock-view__overlay .button-link {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: 1px solid #d97706;
}
.admin-lock-view__overlay .button-link:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
}
[data-theme="dark"] .admin-lock-view__overlay {
  background: linear-gradient(180deg, rgba(15, 21, 38, 0.55) 0%, rgba(15, 21, 38, 0.92) 60%);
}
[data-theme="dark"] .admin-lock-view__title {
  color: rgba(255, 255, 255, 0.92);
}

/* =========================================================================
   PRICING PAGE — Header compact + bannière brand + CTA d'abonnement
   ========================================================================= */
.pricing-header {
  display: flex;
  align-items: center;
  gap: 12px;
  /* Plus de marge top imposante : la chrome-actions (thème + déconnexion)
     est désormais dans le flux et n'écrase plus le titre. */
  padding: 8px 0 12px 0;
}
.pricing-back-btn {
  flex-shrink: 0;
}

/* Vue mobile cachée par défaut — on l'affiche uniquement ≤ 720 px. */
.pricing-mobile-cards {
  display: none;
}

/* Carte plan en mode mobile : header coloré (icône, nom, prix), liste
   de features, bouton CTA en bas. */
.pricing-mobile-card {
  position: relative;
  border-radius: 16px;
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 4px 18px -6px rgba(0, 0, 0, 0.12);
}
.pricing-mobile-card.is-popular {
  border-color: var(--c-primary);
  box-shadow: 0 6px 22px -6px rgba(0, 157, 152, 0.35);
}
.pricing-mobile-card__badge {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 3px 12px;
  border-radius: 99px;
  letter-spacing: 0.6px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}
.pricing-mobile-card__head {
  color: #fff;
  padding: 22px 18px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.pricing-mobile-card__icon {
  font-size: 1.6rem;
}
.pricing-mobile-card__name {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.4px;
}
.pricing-mobile-card__sub {
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 10px;
  border-radius: 99px;
}
.pricing-mobile-card__price {
  margin-top: 6px;
  font-weight: 900;
  font-size: 1.6rem;
  line-height: 1;
}
.pricing-mobile-card__sub2 {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 10px;
  border-radius: 99px;
  margin-top: 2px;
}
.pricing-mobile-card__features {
  list-style: none;
  padding: 14px 16px;
  margin: 0;
}
.pricing-mobile-card__feat {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--c-border);
}
.pricing-mobile-card__feat:last-child {
  border-bottom: none;
}
.pricing-mobile-card__feat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-weight: 900;
  font-size: 0.82rem;
  flex-shrink: 0;
}
.pricing-mobile-card__feat.ok .pricing-mobile-card__feat-icon {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46;
}
.pricing-mobile-card__feat.ko .pricing-mobile-card__feat-icon {
  background: var(--c-error-bg, #fee2e2);
  color: var(--c-danger, #dc2626);
}
.pricing-mobile-card__feat.ko {
  opacity: 0.55;
}
.pricing-mobile-card__feat-label {
  flex: 1;
  color: var(--c-text);
  line-height: 1.35;
}
.pricing-mobile-card__feat-meta {
  font-style: italic;
  color: var(--c-muted);
  font-size: 0.78rem;
}
.pricing-mobile-card__cta {
  width: calc(100% - 32px);
  margin: 0 16px 16px;
  padding: 12px;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.pricing-mobile-card__cta:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -4px rgba(0, 0, 0, 0.28);
}
.pricing-mobile-card__cta:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}
/* Plan effectivement souscrit par l'utilisateur — fond gris neutre + texte
   sombre pour bien signaler que le bouton est inactif (vs simplement
   semi-transparent). S'applique aux cartes mobile. */
.pricing-mobile-card__cta.is-current {
  background: var(--c-tint-cool-2, #e2e8f0) !important;
  color: var(--c-muted, #64748b) !important;
  opacity: 1;
  box-shadow: none;
}

[data-theme="dark"] .pricing-mobile-card {
  background: var(--c-surface);
  border-color: rgba(255, 255, 255, 0.08);
}

/* Switch desktop/mobile : sous 720 px (vue tablette compacte + GSM), on
   masque le tableau comparatif et on affiche les cartes empilées. */
@media (max-width: 720px) {
  .pricing-desktop-table {
    display: none;
  }
  .pricing-mobile-cards {
    display: block;
  }
  /* Bouton retour : juste la flèche en mobile (libellé masqué) — même
     pattern que .pc-back-btn sur PatientDetail. */
  .pricing-back-btn .pc-back-label {
    display: none;
  }
  .pricing-back-btn {
    padding: 0 !important;
    width: 36px;
    height: 36px;
    min-height: 36px;
    border-radius: 50% !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
  }
  .pricing-title {
    font-size: 1.25rem;
  }
}
.pricing-title {
  margin: 0;
  font-size: 1.6rem;
  color: var(--c-primary-dark);
}

/* Bannière brand pour titre + description (style "Bienvenue sur Cortexia"). */
.pricing-banner {
  margin-top: 0;
  margin-bottom: 18px;
}
.pricing-banner h2 {
  font-size: 1.35rem;
}

/* CTA "Choisir cet abonnement" intégré dans chaque colonne plan, sous
   le prix. Bouton blanc opaque pour bien ressortir sur le gradient
   coloré du plan ; couleur du texte = couleur du plan (passée en inline
   style côté JSX). */
.pricing-plan-cta {
  /* margin-top:auto pousse le bouton en bas de la cellule (flex-column),
     pour que tous les CTA s'alignent malgré le contenu variable (sub2
     présent uniquement sur l'offre annuelle). Ainsi le tableau ne se
     décale plus quand on ajoute/retire le badge "95,90 €/an".
     Le padding-top ajoute juste un peu d'air entre le prix et le bouton. */
  margin-top: auto;
  padding-top: 8px;
  width: 100%;
  padding-bottom: 8px;
  padding-left: 10px;
  padding-right: 10px;
  border-radius: 8px;
  border: none;
  background: #fff;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  min-height: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pricing-plan-cta:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -4px rgba(0, 0, 0, 0.3);
}
.pricing-plan-cta:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}
/* Plan effectivement souscrit par l'utilisateur — fond gris neutre + texte
   sombre pour bien signaler que le bouton est inactif (vs simplement
   semi-transparent). S'applique au tableau desktop. */
.pricing-plan-cta.is-current {
  background: var(--c-tint-cool-2, #e2e8f0);
  color: var(--c-muted, #64748b);
  opacity: 1;
  box-shadow: none;
}

/* =========================================================================
   DEVICE FRAME — Aperçu téléphone / tablette (compte démo)
   Rendu par <DeviceFrame> quand cortexia_view_mode = "gsm" ou "tablette".
   Inspiration : "device toolbar" des DevTools navigateur.
   ========================================================================= */
.device-stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  /* Fond clair illustré, même esthétique que la fiche patient : on pose
     une couche blanche translucide par-dessus le motif pour rester doux. */
  background:
    linear-gradient(rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.78)),
    url('/patient-bg-male.png') center top / cover no-repeat;
  /* Appareil aligné en haut (position stable) — la barre d'aperçu est
     descendue par CSS pour s'aligner avec le chrome du cadre. */
  padding: 16px 20px 30px 20px;
  overflow: auto;
  z-index: 1;
}

/* En thème sombre, on conserve un fond doux mais plus contrasté pour que
   le cadre noir de l'appareil ressorte sans agresser l'œil. */
[data-theme="dark"] .device-stage {
  background:
    linear-gradient(rgba(15, 21, 38, 0.7), rgba(15, 21, 38, 0.7)),
    url('/patient-bg-male.png') center top / cover no-repeat;
}

/* Coque du téléphone / tablette : grosse bordure noire arrondie. */
.device-shell {
  position: relative;
  background: #0a0a0a;
  border-radius: 36px;
  box-shadow:
    0 0 0 2px #1f2937,
    0 30px 60px -20px rgba(0, 0, 0, 0.6),
    0 12px 24px -10px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  /* La largeur/hauteur sont injectées en inline style par DeviceFrame
     (dimensions appareil + bordures coque). */
}

.device-shell--tablette {
  border-radius: 24px;
}

/* Coque Galaxy Watch 4 — boîtier ROND avec bezel acier, bracelet noir
   en haut/bas, et deux boutons latéraux à droite (Home + Back). */
.device-shell--watch {
  border-radius: 50%;
  /* Bezel acier brossé style Galaxy Watch. */
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.18) 0%, transparent 35%),
    linear-gradient(135deg, #4b5563 0%, #1f2937 70%, #0f172a 100%);
  box-shadow:
    inset 0 0 0 4px rgba(0, 0, 0, 0.4),
    inset 0 0 0 5px rgba(255, 255, 255, 0.08),
    0 30px 60px -20px rgba(0, 0, 0, 0.7),
    0 12px 24px -10px rgba(0, 0, 0, 0.4);
}
.device-shell--watch .device-iframe {
  border-radius: 50%;
  background: #000;
}
/* Bracelet noir mat haut + bas, étiré derrière le boîtier. */
.device-shell__strap {
  position: absolute;
  left: 50%;
  width: 78%;
  height: 36px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #1f2937 0%, #0f172a 100%);
  border-radius: 8px;
  z-index: 0;
}
.device-shell__strap--top {
  top: -22px;
}
.device-shell__strap--bottom {
  bottom: -22px;
  background: linear-gradient(0deg, #1f2937 0%, #0f172a 100%);
}
/* Deux boutons latéraux droits façon Galaxy Watch (Home en haut, Back en bas). */
.device-shell__side-btn {
  position: absolute;
  right: -5px;
  width: 6px;
  height: 30px;
  background: linear-gradient(90deg, #6b7280 0%, #1f2937 100%);
  border-radius: 0 3px 3px 0;
  z-index: 2;
  box-shadow: 1px 0 2px rgba(0, 0, 0, 0.4);
}
.device-shell__side-btn--top {
  top: 28%;
}
.device-shell__side-btn--bottom {
  top: 56%;
}

/* Scène watch : layout horizontal — montre à gauche, panneau de test à
   droite. En mobile, le panneau passe sous la montre. */
.device-stage--watch {
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-direction: row;
  flex-wrap: wrap;
}

/* Panneau de test pour démos. */
.watch-test-panel {
  width: 280px;
  max-width: 90vw;
  background: var(--c-surface);
  border-radius: 16px;
  border: 1px solid var(--c-border);
  padding: 20px;
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.18);
}
.watch-test-panel h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}
.watch-test-panel p.muted {
  margin: 0 0 14px;
  font-size: 0.82rem;
  line-height: 1.4;
}
/* Sélecteur de patient à tester dans le mode montre. */
.watch-test-panel__picker {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.watch-test-panel__picker label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--c-muted);
}
.watch-test-panel__picker select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  width: 100%;
  min-height: 0;
}

.watch-test-panel__btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.watch-test-panel__btns button {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--c-border);
  background: var(--c-tint-cool-2, #f1f5f9);
  color: var(--c-text);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  text-align: left;
  min-height: 0;
  box-shadow: none;
  transition: background 0.15s ease, transform 0.15s ease;
}
.watch-test-panel__btns button:hover {
  background: var(--c-primary-light, #e0f2fe);
  transform: translateY(-1px);
}
.watch-test-panel__btns button.primary {
  background: var(--gradient-brand, var(--c-primary));
  color: #fff;
  border-color: transparent;
}
.watch-test-panel__btns button.primary:hover {
  filter: brightness(1.06);
}
[data-theme="dark"] .watch-test-panel {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .watch-test-panel__btns button {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

/* Encoche style iPhone (gsm uniquement) — petit oval noir centré en haut
   (portrait) ou à gauche (paysage). */
.device-shell__notch {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 22px;
  background: #000;
  border-radius: 14px;
  z-index: 2;
}
.device-shell--gsm.device-shell--paysage .device-shell__notch {
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  width: 22px;
  height: 110px;
}

/* Barre du bas (gestures bar iOS) — un trait clair sous l'écran ou
   à droite quand l'appareil est en paysage. */
.device-shell__home {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  z-index: 2;
}
.device-shell--paysage .device-shell__home {
  bottom: 50%;
  left: auto;
  right: 14px;
  transform: translateY(50%);
  width: 4px;
  height: 100px;
}

.device-shell--tablette .device-shell__home {
  width: 60px;
  height: 3px;
}
.device-shell--tablette.device-shell--paysage .device-shell__home {
  width: 3px;
  height: 60px;
}

/* L'iframe = écran de l'appareil. Rebord arrondi pour épouser la coque. */
.device-iframe {
  border: none;
  border-radius: 22px;
  background: #fff;
  display: block;
}

.device-shell--tablette .device-iframe {
  border-radius: 14px;
}

/* Toolbar de démo (boutons ronds 44 px) — rendue dans le flux, au sein de
   .chrome-actions. `margin-right: auto` la cale à gauche pendant que
   theme-toggle / logout-toggle restent à droite ; elle défile avec la page.
   Standard/Premium + Auto/Tablette/GSM. */
.chrome-toolbar {
  position: relative;
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  z-index: 9999;
}

.chrome-icon-btn {
  width: 44px;
  height: 44px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  background: var(--c-surface);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease,
    border-color 0.2s ease, box-shadow 0.2s ease;
  font-size: 0;
}

.chrome-icon-btn:hover:not(:disabled) {
  transform: scale(1.06);
  box-shadow: var(--shadow);
}

.chrome-icon-btn.active {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.chrome-icon-btn--premium.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border-color: #d97706;
  box-shadow: 0 2px 10px rgba(217, 119, 6, 0.4);
}

.chrome-toolbar__sep {
  width: 1px;
  height: 22px;
  background: var(--c-border);
  margin: 0 4px;
}

/* Variante sidebar — utilisée dans la colonne gauche du master.
   Layout vertical, alignement centré, boutons en grille 2 colonnes. */
.chrome-toolbar--sidebar {
  position: static;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 4px;
  width: 100%;
}
.chrome-toolbar--sidebar .chrome-icon-btn {
  width: 100%;
  min-width: 0;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}
.chrome-toolbar--sidebar .chrome-icon-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.22);
}
.chrome-toolbar--sidebar .chrome-icon-btn.active {
  background: #fff;
  color: var(--c-primary-dark);
  border-color: #fff;
}
.chrome-toolbar--sidebar .chrome-toolbar__sep {
  display: none;
}
/* En mode "icônes seules" (sidebar ≤ 900px), on remet en une seule colonne. */
@media (max-width: 900px) {
  .chrome-toolbar--sidebar {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .chrome-toolbar--sidebar .chrome-icon-btn {
    height: 36px;
  }
}

@media (max-width: 600px) {
  /* Sur téléphone (vrai mobile + iframe GSM 375 px) : on rapproche tout
     pour qu'il reste de la place pour le titre des pages. Boutons 36 px,
     gap 4 px, séparateur plus court. */
  .chrome-toolbar {
    gap: 4px;
  }
  .chrome-icon-btn {
    width: 36px;
    height: 36px;
  }
  .chrome-toolbar__sep {
    height: 16px;
    margin: 0 2px;
  }
}

/* =========================================================================
   MOBILE — Bottom tab bar (Master uniquement, ≤ 600px)
   Affichée par MasterLayout via <MasterTabBar />. Hors mobile, le
   composant n'est tout simplement pas rendu (display:none ci-dessous
   serait redondant — le composant teste lui-même via media query JS).
   ========================================================================= */
.master-tabbar {
  display: none;
}
@media (max-width: 600px) {
  .master-tabbar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    /* Safe area iOS pour les iPhone à encoche/dynamic island. */
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: var(--c-surface);
    border-top: 1px solid var(--c-border);
    box-shadow: 0 -2px 14px -6px rgba(15, 23, 42, 0.18);
    z-index: 9000;
    align-items: stretch;
    justify-content: space-around;
  }
  .master-tabbar__item {
    flex: 1;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: transparent;
    border: none;
    color: var(--c-muted);
    font-size: 0.7rem;
    font-weight: 500;
    text-decoration: none;
    padding: 6px 4px 4px 4px;
    min-height: 0;
    box-shadow: none;
    border-radius: 0;
    transition: color 0.15s ease;
    position: relative;
  }
  .master-tabbar__item:hover {
    background: transparent;
    color: var(--c-primary);
    transform: none;
    box-shadow: none;
  }
  .master-tabbar__item.active {
    color: var(--c-primary);
  }
  .master-tabbar__item.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 3px;
    background: var(--gradient-brand);
    border-radius: 0 0 3px 3px;
  }
  .master-tabbar__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
  }
  .master-tabbar__label {
    line-height: 1;
    white-space: nowrap;
  }
  [data-theme="dark"] .master-tabbar {
    background: var(--c-surface);
    border-top-color: rgba(255, 255, 255, 0.08);
  }
}

/* Badge premium / master — swap pilule ↔ icône starburst.
   PC (clavier/souris, viewport large) : pilule textuelle "✓ Premium" /
   "★ Master". Tablette/GSM (iframe DeviceFrame, vrais devices tactiles,
   ou viewport ≤ 1024 px) : juste l'icône starburst, pour libérer la
   barre titre et éviter la double indication. */
.premium-badge--pill {
  display: inline-flex !important;
}
.premium-badge--icon {
  display: none !important;
  line-height: 0;
}
html.cortexia-in-frame .premium-badge--pill {
  display: none !important;
}
html.cortexia-in-frame .premium-badge--icon {
  display: inline-flex !important;
}
@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
  .premium-badge--pill {
    display: none !important;
  }
  .premium-badge--icon {
    display: inline-flex !important;
  }
}

/* Lien "Passer au Premium" / "Fonctionnalités Premium" dans le .header
   admin. margin-left: auto pour qu'il reste TOUJOURS calé à droite, y
   compris en tablette/GSM quand .header passe en flex-wrap: wrap. */
.admin-pricing-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .admin-pricing-cta {
    font-size: 0.78rem;
  }
}

/* =========================================================================
   Admin Home — onglets (proches / tests / suivi)
   Sur desktop, les 3 onglets s'enchaînent sur une ligne avec un peu d'air.
   Sur mobile (≤ 600 px), on les répartit en 3 colonnes égales pour que les
   3 soient TOUS visibles à l'écran d'un coup, sans scroll horizontal.
   ========================================================================= */
.admin-nav-tabs {
  display: flex;
  gap: 6px;
  background: var(--c-surface, #f8fafc);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
}
.admin-tab-btn {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--c-muted, #64748b);
  transition: background 0.15s, color 0.15s;
  min-height: 0;
  box-shadow: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}
.admin-tab-btn > span {
  display: inline-block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-tab-btn.active {
  background: var(--c-primary, #3b82f6);
  color: #fff;
}
.admin-tab-btn:hover:not(:disabled):not(.active) {
  background: rgba(0, 0, 0, 0.04);
  color: var(--c-text);
  transform: none;
  box-shadow: none;
}
@media (max-width: 600px) {
  .admin-nav-tabs {
    /* Force la répartition en 3 colonnes parfaitement égales sur mobile,
       sans scroll horizontal — les 3 onglets restent visibles. */
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
    padding: 3px;
  }
  .admin-tab-btn {
    padding: 8px 6px;
    font-size: 0.78rem;
    gap: 3px;
  }
  .admin-tab-btn__premium-icon {
    flex-shrink: 0;
  }
}

/* =========================================================================
   Patient list — moteur de recherche + meta carte (code, séances)
   ========================================================================= */
.patient-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 8px 12px;
  margin: 0 0 14px;
  color: var(--c-muted);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.patient-search:focus-within {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  color: var(--c-primary);
}
.patient-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.95rem;
  color: var(--c-text);
  padding: 4px 0;
}
.patient-search__clear {
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--c-muted);
  border: none;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.patient-search__clear:hover:not(:disabled) {
  background: var(--c-tint-cool);
  color: var(--c-text);
  transform: none;
  box-shadow: none;
}

.patient-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
  font-size: 0.85rem;
}
.patient-pin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.patient-pin--on {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}
.patient-pin--off {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}
[data-theme="dark"] .patient-pin--on {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
}
[data-theme="dark"] .patient-pin--off {
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
}
@media (max-width: 600px) {
  .patient-card-meta {
    font-size: 0.78rem;
    gap: 4px;
  }
  .patient-pin {
    font-size: 0.72rem;
    padding: 2px 6px;
  }
}

/* =========================================================================
   Constructeur de tests personnalisés — étape 2.
   Mise en page 2 colonnes (filtres | questions) tenant dans la page sans
   scroll : seule la liste de questions défile.
   ========================================================================= */

/* Puces de catégorie + boutons de mode (choix simple / multiple). */
.test-cat-chip,
.test-cat-mode__btn {
  min-height: 0;
  border-radius: 999px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.test-cat-chip {
  padding: 6px 12px;
  font-size: 0.82rem;
}
.test-cat-mode__btn {
  padding: 5px 12px;
  font-size: 0.8rem;
}
.test-cat-chip:hover,
.test-cat-mode__btn:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
}
.test-cat-chip.active,
.test-cat-mode__btn.active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}

/* Shell de l'étape 2 : hauteur bornée pour éviter tout scroll de page.
   64px ≈ barre de chrome (thème/déconnexion) rendue au-dessus. */
.test-builder-shell {
  height: calc(100vh - 64px);
  max-height: calc(100vh - 64px);
  min-height: 0;
  /* Pleine largeur : pas de marge gauche/droite pour cette étape. */
  max-width: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
}
.test-builder-step2 {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(320px, 380px) 1fr;
  gap: 16px;
}
/* Colonne gauche : filtres, séparée par un trait à droite. */
.test-builder-filters {
  border-right: 1px solid var(--c-border);
  padding-right: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.test-builder-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--c-muted);
  margin-top: 8px;
}
.test-builder-label:first-child {
  margin-top: 0;
}
.test-cat-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
/* Séparation verticale entre les types de choix et les catégories. */
.test-cat-sep {
  width: 1px;
  align-self: stretch;
  min-height: 26px;
  background: var(--c-border);
  margin: 0 3px;
}
.test-builder-diff {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--c-border);
  font-size: 0.88rem;
}
/* Colonne droite : compteur + cadre des questions + actions. */
.test-builder-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.test-builder-count {
  margin: 0 0 6px;
  font-size: 0.85rem;
  font-weight: 600;
}
.test-builder-qcard {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.test-builder-qlist {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.test-builder-hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 12px 0;
}
/* Sous 720px (tablette / GSM), on empile les deux colonnes — la mise en
   page 2 colonnes large est réservée au PC. */
@media (max-width: 720px) {
  .test-builder-step2 {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .test-builder-filters {
    border-right: none;
    border-bottom: 1px solid var(--c-border);
    padding-right: 0;
    padding-bottom: 10px;
  }
}

/* Aperçu tablette / GSM (iframe DeviceFrame) : on resserre légèrement
   l'espace au-dessus des titres de page pour gagner de la hauteur. */
html.cortexia-in-frame .header {
  padding-top: 6px;
}

/* =========================================================================
   Cartes de la liste des tests personnalisés (page « Tests perso. »).
   Carte fine : icône catégorie | infos | menu d'actions (⋮).
   ========================================================================= */
.test-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  /* Marge à droite réservée au bouton ⋮ positionné en haut à droite. */
  padding: 12px 44px 12px 16px;
}
/* La carte dont le menu est ouvert passe au-dessus des suivantes. */
.test-card--menu-open {
  z-index: 20;
}
.test-card__icon {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  line-height: 1;
}
.test-card__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.test-card__title {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.test-card__meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--c-muted);
  line-height: 1.45;
}

/* Menu d'actions : bouton ⋮ calé en haut à droite du cadre, sans aucun
   habillage (ni bordure, ni fond, ni effet) — juste l'icône. */
.test-card__menu {
  position: absolute;
  top: 8px;
  right: 10px;
}
.test-card__kebab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  min-height: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--c-muted);
  cursor: pointer;
  transition: none;
}
/* Aucun effet : ni survol, ni clic, ni focus (on neutralise le style
   global des <button> : ombre, translation, dégradé…). */
.test-card__kebab:hover:not(:disabled),
.test-card__kebab:active:not(:disabled),
.test-card__kebab:focus,
.test-card__kebab:focus-visible {
  background: transparent;
  box-shadow: none;
  transform: none;
  outline: none;
}
.test-card__dropdown {
  /* Liste déroulante en flyout à droite du cadre (à côté du bouton ⋮). */
  position: absolute;
  top: 0;
  left: calc(100% + 14px);
  z-index: 50;
  min-width: 168px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
/* Aperçu tablette / GSM (et petits écrans) : le menu s'ouvre en dessous
   du bouton ⋮ — à droite il déborderait du cadre étroit. */
@media (max-width: 720px) {
  .test-card__dropdown {
    top: calc(100% + 4px);
    left: auto;
    right: 0;
  }
}
.test-card__dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  min-height: 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--c-text);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}
.test-card__dropdown-item:hover {
  background: var(--c-bg);
}
.test-card__dropdown-item--danger {
  color: var(--c-danger);
}
.test-card__dropdown-item--danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* =========================================================================
   Pop-up « Voir » — gestion des patients assignés à un test personnalisé.
   ========================================================================= */
.test-assign {
  max-width: 560px;
}
.test-assign__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}
.test-assign__back {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  min-height: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: none;
  font-size: 1.05rem;
  cursor: pointer;
}
.test-assign__back:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
}
.test-assign__title {
  margin: 0;
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.test-assign__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.test-assign__frame {
  padding: 14px 16px;
}
.test-assign__frame-title {
  margin: 0 0 8px;
  font-size: 0.92rem;
  font-weight: 700;
}
.test-assign__empty {
  margin: 0;
  font-size: 0.85rem;
}
.test-assign__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 2px;
  border-top: 1px solid var(--c-border);
}
.test-assign__row:first-of-type {
  border-top: none;
}
.test-assign__name {
  font-size: 0.88rem;
  min-width: 0;
}
.test-assign__sex {
  display: inline-block;
  width: 14px;
  font-weight: 700;
  text-align: center;
}
.test-assign__sex--m {
  color: #3b82f6;
}
.test-assign__sex--f {
  color: #ec4899;
}
.test-assign__date {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--c-muted);
  white-space: nowrap;
}
.test-assign__act {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  min-height: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid transparent;
  box-shadow: none;
  cursor: pointer;
}
/* Neutralise l'ombre / la translation du style global des <button>. */
.test-assign__back:hover:not(:disabled),
.test-assign__act:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
}
.test-assign__act--remove {
  background: var(--c-surface);
  color: var(--c-danger);
  border-color: var(--c-danger);
}
.test-assign__act--remove:hover:not(:disabled) {
  background: var(--c-danger);
  color: #fff;
}
.test-assign__act--add {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}
.test-assign__act--add:hover:not(:disabled) {
  background: var(--c-primary-dark);
}
.test-assign__act:disabled {
  opacity: 0.5;
  cursor: default;
}

/* =========================================================================
   HomeQuickActions — rangée d'actions des accueils (entre Bienvenue et
   recherche). Style à libellés inline sur PC ; style « tuiles » (icône
   colorée + libellé) en aperçu mobile/tablette (iframe ou ≤ 720px).
   ========================================================================= */
.home-quick-actions {
  display: flex;
  gap: 12px;
  margin: 16px 0;
}
.hqa-tile {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.hqa-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.hqa-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hqa-tile--new .hqa-icon { color: var(--c-primary); }
.hqa-tile--history .hqa-icon { color: #d97706; }
.hqa-tile--settings .hqa-icon { color: #059669; }
.hqa-tile--premium .hqa-icon { color: #d97706; }
.hqa-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Style « tuiles » : appliqué en aperçu (iframe DeviceFrame) ET sur petit
   viewport réel — même condition que .preview-back-btn. Deux blocs séparés
   (un sélecteur de classe ne se combine pas avec une media query). */
html.cortexia-in-frame .hqa-tile {
  flex-direction: column;
  gap: 6px;
  padding: 12px 6px;
}
html.cortexia-in-frame .hqa-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: #fff;
}
html.cortexia-in-frame .hqa-tile--new .hqa-icon { background: var(--c-primary); }
html.cortexia-in-frame .hqa-tile--history .hqa-icon { background: #f59e0b; }
html.cortexia-in-frame .hqa-tile--settings .hqa-icon { background: #10b981; }
html.cortexia-in-frame .hqa-tile--premium .hqa-icon {
  /* Cercle blanc cerclé : le starburst premium (orange) doit ressortir —
     un fond orange le rendrait invisible (orange sur orange). */
  background: #fff;
  box-shadow: 0 0 0 1px var(--c-border);
}
html.cortexia-in-frame .hqa-label { font-size: 0.78rem; }

@media (max-width: 720px) {
  .hqa-tile {
    flex-direction: column;
    gap: 6px;
    padding: 12px 6px;
  }
  .hqa-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    color: #fff;
  }
  .hqa-tile--new .hqa-icon { background: var(--c-primary); }
  .hqa-tile--history .hqa-icon { background: #f59e0b; }
  .hqa-tile--settings .hqa-icon { background: #10b981; }
  .hqa-tile--premium .hqa-icon {
    /* Cercle blanc cerclé — le starburst premium orange doit rester visible. */
    background: #fff;
    box-shadow: 0 0 0 1px var(--c-border);
  }
  .hqa-label { font-size: 0.78rem; }
}

/* Bandeau d'invite « activer la voix » — accueil patient, préférence vocale
   non définie. Affiché une seule fois (mémorisé en localStorage). */
.voice-invite {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 12px 0;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #e0f2fe 0%, #d4f1ef 100%);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #0c4a6e;
}
.voice-invite__text {
  font-weight: 600;
  font-size: 0.92rem;
}
.voice-invite__actions {
  display: flex;
  gap: 8px;
}
.voice-invite__accept,
.voice-invite__later {
  min-height: auto;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.voice-invite__accept {
  background: var(--c-primary);
  color: #fff;
  border: 1px solid var(--c-primary);
}
.voice-invite__later {
  background: transparent;
  color: #0c4a6e;
  border: 1px solid rgba(6, 182, 212, 0.4);
}

/* Toggle « mode ambiant » unique — accueil patient. L'état actif/inactif
   est porté par ce seul bouton (plus de badge indicateur séparé). */
.ambient-toggle {
  min-height: auto;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--c-surface);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.ambient-toggle.active {
  background: linear-gradient(135deg, #e0f2fe 0%, #d4f1ef 100%);
  color: #0369a1;
  border-color: rgba(6, 182, 212, 0.4);
}

/* =====================================================================
   PAGE D'ACCUEIL PUBLIQUE — Landing.tsx (v2, inspirée Medihouse)
   ===================================================================== */

.public-page {
  width: 100%;
  min-height: 100vh;
  background: var(--c-bg);
  color: var(--c-text);
}

/* ---------------------------------------------------------------------
   Navbar publique v2 (logo + menu d'ancres + CTA)
   --------------------------------------------------------------------- */
.public-navbar-v2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 32px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(8px);
}
.public-navbar-brand img {
  height: 56px;
  display: block;
}
.public-navbar-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  justify-content: center;
}
.public-navbar-links a {
  color: var(--c-text);
  opacity: 0.78;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 4px;
  border-bottom: 2px solid transparent;
  transition: opacity 0.15s, border-color 0.15s, color 0.15s;
}
.public-navbar-links a:hover {
  opacity: 1;
  color: var(--c-primary);
  border-bottom-color: var(--c-primary);
}
.public-navbar-cta {
  display: inline-flex;
  align-items: center;
  padding: 11px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  color: #fff !important;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.92rem;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: transform 0.15s, box-shadow 0.15s;
}
.public-navbar-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

/* ---------------------------------------------------------------------
   HERO v2 (split avec card primaire + illustration)
   --------------------------------------------------------------------- */
.public-hero-v2 {
  position: relative;
  padding: 80px 32px 120px;
  background:
    radial-gradient(800px 400px at 20% 0%, rgba(37, 99, 235, 0.08), transparent 60%),
    radial-gradient(700px 360px at 90% 30%, rgba(0, 157, 152, 0.08), transparent 60%),
    var(--c-bg);
}
.public-hero-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}
.public-hero-card {
  position: relative;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
  color: #fff;
  border-radius: 28px;
  padding: 56px 48px;
  box-shadow: 0 24px 64px -16px rgba(37, 99, 235, 0.4);
  overflow: hidden;
}
.public-hero-card::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 60%);
  border-radius: 50%;
  pointer-events: none;
}
.public-hero-kicker {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.12);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}
.public-hero-title {
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  line-height: 1.08;
  font-weight: 800;
  margin: 0 0 20px;
  color: #fff;
  letter-spacing: -0.02em;
}
.public-hero-lead {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.6;
  margin: 0 0 32px;
  color: rgba(255, 255, 255, 0.92);
  max-width: 520px;
}
.public-hero-actions-v2 {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  position: relative;
  z-index: 1;
}
.public-hero-illustration {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(180deg, #e6f0ff, #f1f5fb);
  aspect-ratio: 4 / 3;
  box-shadow: 0 24px 48px -16px rgba(15, 23, 42, 0.18);
}
.public-hero-illustration img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------------------------------------------------------------------
   Boutons publics (variantes)
   --------------------------------------------------------------------- */
.public-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
}
.public-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}
.public-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.public-btn.large {
  padding: 15px 32px;
  font-size: 1.02rem;
}
.public-btn.primary {
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  color: #fff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.3);
}
.public-btn.primary:hover:not(:disabled) {
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.4);
}
.public-btn.outline {
  background: transparent;
  color: var(--c-text);
  border-color: var(--c-border);
}
.public-btn.outline:hover:not(:disabled) {
  background: var(--c-surface);
  border-color: var(--c-primary);
  color: var(--c-primary);
}
.public-btn.light {
  background: #fff;
  color: var(--c-primary);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}
.public-btn.light:hover:not(:disabled) {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
  color: var(--c-primary-dark);
}
.public-btn.ghost-light {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}
.public-btn.ghost-light:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
}
.public-btn .play-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.75rem;
  margin-right: 2px;
}

/* ---------------------------------------------------------------------
   Trust strip (chevauche le hero)
   --------------------------------------------------------------------- */
.public-trust-strip {
  max-width: 1200px;
  margin: -60px auto 0;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  position: relative;
  z-index: 2;
}
.trust-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--c-surface);
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: 0 12px 32px -12px rgba(15, 23, 42, 0.18);
  border: 1px solid var(--c-border);
}
.trust-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.trust-icon svg { width: 26px; height: 26px; }
.trust-icon-primary { background: var(--c-primary-light); color: var(--c-primary); }
.trust-icon-cyan { background: var(--c-cyan-light); color: var(--c-cyan-dark); }
.trust-icon-accent { background: var(--c-accent-light); color: var(--c-accent-dark); }
.trust-card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text);
}
.trust-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--c-muted);
}

/* ---------------------------------------------------------------------
   Sections génériques
   --------------------------------------------------------------------- */
.public-section {
  padding: 96px 32px 56px;
  max-width: 1200px;
  margin: 0 auto;
}
.public-section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 48px;
}
.section-kicker {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-primary);
  margin-bottom: 12px;
}
.section-kicker-light {
  color: rgba(255, 255, 255, 0.85);
}
.public-section-title-v2 {
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--c-text);
  margin: 0 0 16px;
}
.public-section-title-v2.on-blue {
  color: #fff;
}

/* ---------------------------------------------------------------------
   À propos (split)
   --------------------------------------------------------------------- */
.public-about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  gap: 64px;
  align-items: center;
}
.public-about-visual {
  position: relative;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}
.about-circle {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--c-primary-light), var(--c-cyan-light));
  box-shadow: 0 24px 64px -16px rgba(37, 99, 235, 0.3);
}
.about-circle::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.6);
  pointer-events: none;
}
.about-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.78;
}
.about-circle-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(160deg, rgba(37, 99, 235, 0.18) 0%, rgba(0, 157, 152, 0.12) 100%);
  pointer-events: none;
}
.about-badge {
  position: absolute;
  background: var(--c-surface);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 16px 32px -12px rgba(15, 23, 42, 0.25);
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--c-border);
  z-index: 2;
}
.about-badge .badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--c-primary-light);
  color: var(--c-primary);
  flex-shrink: 0;
}
.about-badge .badge-icon svg {
  width: 18px;
  height: 18px;
}
.about-badge p {
  margin: 0;
  font-weight: 700;
  color: var(--c-text);
  font-size: 0.88rem;
  white-space: nowrap;
}
.about-badge-1 { top: 4%; left: -10%; }
.about-badge-1 .badge-icon { background: var(--c-accent-light); color: var(--c-accent-dark); }
.about-badge-2 { top: 44%; right: -10%; }
.about-badge-2 .badge-icon { background: #fce7f3; color: #be185d; }
.about-badge-3 { bottom: 4%; left: 4%; }
.about-badge-3 .badge-icon { background: var(--c-cyan-light); color: var(--c-cyan-dark); }
.public-about-text p {
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--c-text);
  opacity: 0.88;
  margin: 0 0 16px;
}
.about-bullets {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}
.about-bullets li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.96rem;
  color: var(--c-text);
  font-weight: 500;
}
.check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c-cyan-light);
  color: var(--c-cyan-dark);
  font-weight: 800;
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------
   Objectifs v3 — 2 colonnes (Compagnons / Proches)
   --------------------------------------------------------------------- */
.public-objectives {
  background: var(--c-surface);
  max-width: none;
  padding-left: 32px;
  padding-right: 32px;
}
.public-objectives > .public-section-head,
.public-objectives > .objectives-two-cols {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
.public-section-sub {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--c-muted);
  max-width: 640px;
  margin: 12px auto 0;
}
.objectives-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: stretch;
}
.obj-group {
  position: relative;
  border-radius: 28px;
  padding: 32px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border: 1px solid var(--c-border);
  transition: transform 0.2s, box-shadow 0.2s;
}
.obj-group:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 48px -20px rgba(15, 23, 42, 0.18);
}
.obj-group-warm {
  background: linear-gradient(160deg, #fff7ed 0%, #fff 60%);
}
.obj-group-cool {
  background: linear-gradient(160deg, #eff6ff 0%, #fff 60%);
}
.obj-group-header h3 {
  margin: 12px 0 8px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--c-text);
  letter-spacing: -0.01em;
}
.obj-group-lead {
  margin: 0;
  line-height: 1.55;
  color: var(--c-muted);
  font-size: 0.98rem;
}
.obj-group-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--c-surface);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-text);
  border: 1px solid var(--c-border);
}
.obj-tag-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.obj-tag-dot-warm { background: var(--c-accent); }
.obj-tag-dot-cool { background: var(--c-primary); }
.obj-group-illu {
  border-radius: 18px;
  overflow: hidden;
  background: var(--c-surface);
  box-shadow: 0 12px 32px -16px rgba(15, 23, 42, 0.15);
  aspect-ratio: 4 / 3;
}
.obj-group-illu img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.obj-group-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.obj-group-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.obj-group-list li > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.obj-group-list li strong {
  font-weight: 700;
  color: var(--c-text);
  font-size: 1rem;
  line-height: 1.3;
}
.obj-group-list li div {
  color: var(--c-muted);
  font-size: 0.94rem;
  line-height: 1.5;
}
.obj-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  flex-shrink: 0;
}
.obj-mini svg { width: 20px; height: 20px; }
.obj-mini-warm { background: var(--c-accent-light); color: var(--c-accent-dark); }
.obj-mini-cool { background: var(--c-primary-light); color: var(--c-primary); }

/* ---------------------------------------------------------------------
   Pourquoi Cortexia (bandeau bleu pleine largeur)
   --------------------------------------------------------------------- */
.public-why {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 60%, #0f3a8e 100%);
  color: #fff;
  padding: 96px 32px;
  position: relative;
  overflow: hidden;
}
.public-why::before {
  content: "";
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0, 157, 152, 0.25), transparent 60%);
  border-radius: 50%;
  pointer-events: none;
}
.public-why-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 64px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.why-bullets {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.why-bullets li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.02rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.95);
}
.check-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* Drapeau belge inline pour le clin d'œil « Made in Belgium » */
.be-flag {
  display: inline-flex;
  width: 22px;
  height: 16px;
  border-radius: 3px;
  overflow: hidden;
  margin-left: 8px;
  vertical-align: -3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.be-stripe {
  flex: 1;
  display: block;
}
.be-black { background: #1a1a1a; }
.be-yellow { background: #fdda24; }
.be-red { background: #ef3340; }

.public-why-visual {
  position: relative;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}
.why-center {
  position: absolute;
  inset: 25%;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.2);
}
.why-center img {
  width: 60%;
  height: auto;
}
.why-bubble {
  position: absolute;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-primary);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  animation: float 6s ease-in-out infinite;
}
.why-bubble svg { width: 32px; height: 32px; }
.why-bubble-2 svg { color: var(--c-accent-dark); }
.why-bubble-3 svg { color: var(--c-cyan-dark); }
.why-bubble-4 svg { color: #be185d; }
.why-bubble-1 { width: 80px; height: 80px; top: 4%; left: 8%; animation-delay: 0s; }
.why-bubble-2 { width: 64px; height: 64px; top: 12%; right: 6%; animation-delay: 1s; }
.why-bubble-3 { width: 70px; height: 70px; bottom: 8%; left: 6%; animation-delay: 2s; }
.why-bubble-4 { width: 90px; height: 90px; bottom: 6%; right: 10%; animation-delay: 3s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ---------------------------------------------------------------------
   Pour qui v2
   --------------------------------------------------------------------- */
.audience-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}
.audience-card-v2 {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 24px;
  padding: 40px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.audience-card-v2:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -16px rgba(15, 23, 42, 0.18);
}
.audience-icon {
  margin-bottom: 18px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-primary);
}
.audience-icon svg { width: 44px; height: 44px; }
.audience-icon-warm {
  background: linear-gradient(135deg, var(--c-accent-light), #fef3c7);
  color: var(--c-accent-dark);
}
.audience-icon-cool {
  background: linear-gradient(135deg, var(--c-primary-light), var(--c-cyan-light));
  color: var(--c-primary);
}
.audience-card-v2 h3 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-text);
}
.audience-card-v2 p {
  margin: 0 0 20px;
  line-height: 1.6;
  color: var(--c-muted);
  font-size: 0.98rem;
}
.audience-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--c-primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.98rem;
  margin-top: auto;
  transition: gap 0.15s, color 0.15s;
}
.audience-link:hover {
  gap: 12px;
  color: var(--c-primary-dark);
}

/* ---------------------------------------------------------------------
   Tarifs / Pricing (Standard / Premium Mensuel / Premium Annuel)
   --------------------------------------------------------------------- */
/* ---------- Section Actualités (landing) ---------- */
.public-news {
  background: var(--c-bg);
  max-width: none;
  padding-left: 32px;
  padding-right: 32px;
}
.public-news > .public-section-head,
.public-news > .news-grid,
.public-news > .news-carousel {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Carrousel actualités (3 cartes visibles + flèches) ----------
   Le composant <NewsCarousel> rend une row flex en overflow:hidden et
   décale `transform: translateX(...)` en fonction de l'index courant.
   --news-gap : espace inter-cartes (synchronisé entre le gap CSS et le
   calcul de translateX côté JS pour rester pixel-perfect).             */
.news-carousel {
  --news-gap: 24px;
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.news-carousel-viewport {
  overflow: hidden;
  padding: 4px 4px 14px; /* room for shadow + hover translateY */
}
.news-carousel-track {
  display: flex;
  gap: var(--news-gap);
  transition: transform 420ms cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}
.news-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.news-arrow {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease,
    box-shadow 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  box-shadow: 0 4px 12px -8px rgba(15, 23, 42, 0.25);
}
.news-arrow:hover:not(:disabled) {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
  transform: translateY(-1px);
}
.news-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.news-carousel-counter {
  font-size: 0.88rem;
  color: var(--c-muted);
  font-weight: 600;
  min-width: 100px;
  text-align: center;
  letter-spacing: 0.02em;
}
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 36px;
}
.news-card {
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 10px 30px -22px rgba(15, 23, 42, 0.18);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 40px -22px rgba(15, 23, 42, 0.28);
  border-color: rgba(15, 23, 42, 0.12);
}
.news-card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 18px;
}
.news-card-media img {
  width: 92%;
  height: 92%;
  object-fit: contain;
  object-position: center center;
  display: block;
  transition: transform 0.4s ease;
}
.news-card:hover .news-card-media img {
  transform: scale(1.04);
}
.news-card-body {
  padding: 10px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.news-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--c-muted);
  font-weight: 500;
}
.news-card-cat {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--c-text);
}
.news-card-dot { opacity: 0.4; }
.news-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--c-text);
  margin: 2px 0 0;
}
.news-card-excerpt {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--c-muted);
  flex: 1;
}
.news-card-link {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--c-primary);
}
.news-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 6px;
}
.news-theme-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--c-muted);
}
.news-card:hover .news-card-link { color: var(--c-primary-dark); }

/* Accents par couleur — tint sur la catégorie et le lien uniquement.
   Le fond de la zone image reste neutre pour laisser l'illustration
   se présenter sans cadre coloré. */
.news-accent-violet .news-card-cat,
.news-accent-violet .news-theme-tag { background: rgba(139, 92, 246, 0.16); color: #6d28d9; }
.news-accent-violet .news-card-link { color: #7c3aed; }
.news-accent-violet:hover .news-card-link { color: #6d28d9; }

.news-accent-ambre .news-card-cat,
.news-accent-ambre .news-theme-tag { background: rgba(245, 158, 11, 0.20); color: #b45309; }
.news-accent-ambre .news-card-link { color: #d97706; }
.news-accent-ambre:hover .news-card-link { color: #b45309; }

.news-accent-cyan .news-card-cat,
.news-accent-cyan .news-theme-tag { background: rgba(6, 182, 212, 0.18); color: #0e7490; }
.news-accent-cyan .news-card-link { color: #0891b2; }
.news-accent-cyan:hover .news-card-link { color: #0e7490; }

/* Thème IA — magenta / rose */
.news-accent-rose .news-card-cat,
.news-accent-rose .news-theme-tag { background: rgba(236, 72, 153, 0.16); color: #be185d; }
.news-accent-rose .news-card-link { color: #db2777; }
.news-accent-rose:hover .news-card-link { color: #be185d; }

/* Thème Business — émeraude */
.news-accent-emerald .news-card-cat,
.news-accent-emerald .news-theme-tag { background: rgba(16, 185, 129, 0.16); color: #047857; }
.news-accent-emerald .news-card-link { color: #059669; }
.news-accent-emerald:hover .news-card-link { color: #047857; }

/* ---------- Page détail article ---------- */
/* ---------- Page détail article ----------
   Layout magazine en 3 zones :
   1) .article-hero      : entête texte (kicker + titre + lead + meta)
   2) .article-hero-figure : photo réaliste pleine largeur, 16:9
   3) .article-body      : corps lecture, colonne centrée 720 px max
   4) .article-source    : bloc source/niveau de maturité
*/
.article-hero {
  position: relative;
  background: var(--c-bg);
  padding: 40px 0 28px;
}
.article-hero-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.article-hero-kicker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.article-hero-kicker-row .section-kicker {
  margin: 0;
  line-height: 1;
}
.article-hero-back {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-muted);
  text-decoration: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.article-hero-back:hover {
  color: var(--c-text);
  background: rgba(15, 23, 42, 0.1);
  transform: translateX(-2px);
}
.article-hero-title {
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--c-text);
  margin: 6px 0 0;
}
.article-hero-excerpt {
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--c-muted);
  font-weight: 500;
  margin: 8px 0 4px;
  max-width: 760px;
}
.article-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--c-muted);
  font-size: 0.92rem;
  font-weight: 500;
}

/* Pastille niveau A/B/C – petit chip discret à côté du kicker */
.article-level-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--c-muted);
}
.article-level-A { background: rgba(16, 185, 129, 0.15); color: #047857; }
.article-level-A-B { background: rgba(20, 184, 166, 0.15); color: #0f766e; }
.article-level-B { background: rgba(245, 158, 11, 0.18); color: #b45309; }
.article-level-B-C { background: rgba(249, 115, 22, 0.18); color: #9a3412; }
.article-level-C { background: rgba(148, 163, 184, 0.22); color: #475569; }

.article-accent-violet,
.article-accent-ambre,
.article-accent-cyan,
.article-accent-rose,
.article-accent-emerald { background: var(--c-bg); }

/* Photo hero entre l'entête et le corps — calée sur la même largeur
   que .article-body (720 px) pour un alignement vertical parfait. */
.article-hero-figure {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.article-hero-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 30px 80px -40px rgba(15, 23, 42, 0.5);
  display: block;
}
.article-hero-figcaption {
  font-size: 0.82rem;
  color: var(--c-muted);
  text-align: right;
  padding-right: 4px;
  font-style: italic;
}

/* Corps de lecture — colonne resserrée */
.article-body {
  max-width: 720px;
  margin: 56px auto 0;
  padding: 0 24px;
  color: var(--c-text);
}
.article-section { margin-bottom: 36px; }
.article-section h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--c-text);
  margin: 0 0 14px;
}
.article-section p {
  font-size: 1.06rem;
  line-height: 1.7;
  color: var(--c-text);
  opacity: 0.86;
  margin: 0;
}

/* Bloc source + niveau de maturité en fin d'article */
.article-source {
  margin-top: 8px;
  padding: 22px 24px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--c-border);
}
.article-source-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}
.article-source-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.article-source-link {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--c-primary);
  text-decoration: none;
  line-height: 1.4;
}
.article-source-link:hover { color: var(--c-primary-dark); text-decoration: underline; }
.article-source-level {
  margin: 10px 0 0;
  font-size: 0.92rem;
  color: var(--c-muted);
  line-height: 1.5;
}
.article-source-level strong { color: var(--c-text); font-weight: 700; }

/* Articles connexes */
.article-related {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}
.article-missing {
  max-width: 640px;
  margin: 80px auto;
  text-align: center;
  padding: 0 24px;
}
.article-missing h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.article-missing p {
  color: var(--c-muted);
  margin-bottom: 24px;
}

.public-pricing {
  background: var(--c-surface);
  max-width: none;
  padding-left: 32px;
  padding-right: 32px;
}
.public-pricing > .public-section-head,
.public-pricing > .pricing-grid,
.public-pricing > .pricing-foot {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}
.pricing-card {
  position: relative;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 24px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -16px rgba(15, 23, 42, 0.16);
  border-color: var(--c-primary-light);
}
.pricing-card.featured {
  background: linear-gradient(160deg, #fff8ed 0%, #fff 70%);
  border: 2px solid var(--c-accent);
  box-shadow: 0 24px 56px -20px rgba(245, 158, 11, 0.35);
}
.pricing-card.featured:hover {
  border-color: var(--c-accent-dark);
  box-shadow: 0 28px 64px -20px rgba(245, 158, 11, 0.5);
}
.pricing-ribbon {
  position: absolute;
  top: -14px;
  right: 24px;
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-dark));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 999px;
  box-shadow: 0 8px 20px -8px rgba(245, 158, 11, 0.6);
}
.pricing-tag {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-primary);
  background: var(--c-primary-light);
  padding: 5px 12px;
  border-radius: 999px;
}
.pricing-tag-premium {
  color: var(--c-primary-dark);
  background: var(--c-primary-light);
}
.pricing-tag-premium-annual {
  color: var(--c-accent-dark);
  background: var(--c-accent-light);
}
.pricing-head h3 {
  margin: 12px 0 6px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--c-text);
  letter-spacing: -0.01em;
}
.pricing-lead {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.5;
  color: var(--c-muted);
}
.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
}
.pricing-amount {
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 800;
  color: var(--c-text);
  letter-spacing: -0.02em;
  line-height: 1;
}
.pricing-period {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--c-muted);
}
.pricing-billed {
  margin: -10px 0 0;
  font-size: 0.85rem;
  color: var(--c-accent-dark);
  font-weight: 600;
}
.pricing-features {
  list-style: none;
  padding: 0;
  margin: 6px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pricing-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.94rem;
  color: var(--c-text);
  line-height: 1.4;
}
.check-cool { background: var(--c-primary-light); color: var(--c-primary); }
.check-warm { background: var(--c-primary-light); color: var(--c-primary-dark); }
.check-accent { background: var(--c-accent-light); color: var(--c-accent-dark); }
.pricing-cta {
  margin-top: auto;
  width: 100%;
}
.public-btn.accent {
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-dark));
  color: #fff;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
}
.public-btn.accent:hover:not(:disabled) {
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.45);
}
.pricing-foot {
  margin: 32px auto 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--c-muted);
  max-width: 720px;
}

/* ---------------------------------------------------------------------
   CTA banner pleine largeur
   --------------------------------------------------------------------- */
.public-cta-banner {
  padding: 32px;
  background: var(--c-bg);
}
.cta-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  background: linear-gradient(135deg, var(--c-primary), var(--c-cyan));
  border-radius: 28px;
  padding: 56px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto;
  align-items: center;
  gap: 32px;
  color: #fff;
  box-shadow: 0 24px 56px -20px rgba(37, 99, 235, 0.45);
  position: relative;
  overflow: hidden;
}
.cta-banner-inner::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 50%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.15), transparent 60%);
  transform: rotate(15deg);
  pointer-events: none;
}
.cta-banner-inner h2 {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 800;
  margin: 0 0 8px;
  color: #fff;
  letter-spacing: -0.015em;
}
.cta-banner-inner p {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
  max-width: 540px;
}
.cta-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  position: relative;
  z-index: 1;
}

/* ---------------------------------------------------------------------
   Contact v2
   --------------------------------------------------------------------- */
.public-contact-header {
  max-width: 720px;
  margin: 0 0 32px;
}
.public-contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.85fr);
  gap: 32px;
  align-items: stretch;
}
.public-contact-form-wrap {
  display: flex;
  height: 100%;
}
.public-contact-form-wrap .contact-form-card {
  flex: 1;
}
.public-contact-info {
  height: 100%;
}
.public-section-intro {
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--c-text);
  opacity: 0.85;
}
.contact-form-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  padding: 28px 28px 30px;
  box-shadow: 0 18px 40px -28px rgba(15, 23, 42, 0.22);
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}
.contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.92rem;
  color: var(--c-text);
}
.contact-form input,
.contact-form textarea {
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 0.98rem;
  font-family: inherit;
  resize: vertical;
}
.contact-form input:disabled,
.contact-form textarea:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.contact-form .public-btn {
  align-self: flex-start;
  margin-top: 6px;
  min-width: 220px;
}
.public-contact-info {
  background: linear-gradient(160deg, var(--c-primary-light), var(--c-surface));
  border: 1px solid var(--c-border);
  border-radius: 24px;
  padding: 32px 28px;
}
.public-contact-info h3 {
  margin: 0 0 20px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c-text);
}
.public-contact-info ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.public-contact-info li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  color: var(--c-text);
  font-size: 0.96rem;
  line-height: 1.45;
}
.contact-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--c-surface);
  color: var(--c-primary);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}
.contact-emoji svg { width: 20px; height: 20px; }
.public-contact-info li > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.public-contact-info li strong {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--c-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.public-contact-info a {
  color: var(--c-primary);
  text-decoration: none;
  font-weight: 500;
}
.public-contact-info a:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------------------
   Footer foncé v2
   --------------------------------------------------------------------- */
.public-footer-v2 {
  background: #0f172a;
  color: #cbd5e1;
  padding: 64px 32px 24px;
  margin-top: 32px;
}
.footer-cols {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 48px;
}
.footer-brand img {
  height: 64px;
  margin-bottom: 20px;
  display: block;
}
.footer-brand p {
  margin: 0 0 8px;
  font-size: 0.98rem;
  font-weight: 600;
  color: #f1f5f9;
}
.footer-brand .footer-tagline {
  font-weight: 400;
  color: #94a3b8;
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 320px;
}
.footer-col h4 {
  margin: 0 0 16px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.94rem;
  transition: color 0.15s;
}
.footer-col a:hover {
  color: #fff;
}
.footer-copy {
  max-width: 1200px;
  margin: 48px auto 0;
  padding-top: 24px;
  border-top: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.88rem;
  color: #94a3b8;
}
.footer-copy p {
  margin: 0;
}

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .public-hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .public-hero-illustration {
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
  }
  .public-about-grid,
  .public-why-grid,
  .public-contact-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .public-about-visual,
  .public-why-visual {
    max-width: 380px;
  }
  .cta-banner-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .cta-banner-inner p {
    margin: 0 auto;
  }
  .cta-banner-actions {
    justify-content: center;
  }
  .footer-cols {
    grid-template-columns: 1fr 1fr;
  }
  .public-navbar-links {
    display: none;
  }
  .objectives-two-cols {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .news-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .article-hero-inner,
  .article-hero-figure {
    padding-left: 18px;
    padding-right: 18px;
  }
}
@media (max-width: 720px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
  .article-hero {
    padding: 24px 0 24px;
  }
  .article-hero-inner,
  .article-hero-figure {
    padding-left: 14px;
    padding-right: 14px;
  }
  .article-hero-figure img {
    border-radius: 16px;
    aspect-ratio: 4 / 3;
  }
  .article-body {
    margin-top: 36px;
    padding: 0 14px;
  }
  .article-section h2 { font-size: 1.25rem; }
  .article-related { padding: 24px 18px 60px; }
  .public-navbar-v2 {
    padding: 12px 18px;
  }
  .public-navbar-brand img {
    height: 44px;
  }
  .public-navbar-cta {
    padding: 9px 16px;
    font-size: 0.85rem;
  }
  .public-hero-v2 {
    padding: 56px 18px 100px;
  }
  .public-hero-card {
    padding: 40px 28px;
    border-radius: 22px;
  }
  .public-trust-strip {
    grid-template-columns: 1fr;
    padding: 0 18px;
    margin-top: -40px;
  }
  .public-section {
    padding: 72px 18px 40px;
  }
  .public-objectives,
  .public-why,
  .public-cta-banner {
    padding-left: 18px;
    padding-right: 18px;
  }
  .public-why {
    padding-top: 72px;
    padding-bottom: 72px;
  }
  .cta-banner-inner {
    padding: 40px 24px;
    border-radius: 22px;
  }
  .about-bullets {
    grid-template-columns: 1fr;
  }
  .contact-row {
    grid-template-columns: 1fr;
  }
  .contact-form-card {
    padding: 22px 20px 24px;
    border-radius: 16px;
  }
  .footer-cols {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .footer-copy {
    flex-direction: column;
    text-align: center;
  }
}

/* =====================================================================
   PAGES DE DÉMO GUIDÉE (/demo, /demo/compagnon, /demo/proche)
   Style scrollytelling inspiré Samsung One UI.
   ===================================================================== */

/* ---------- Demo choice page ---------- */
.demo-choice-hero {
  padding: 72px 32px 120px;
  background:
    radial-gradient(800px 400px at 20% 0%, rgba(37, 99, 235, 0.08), transparent 60%),
    radial-gradient(700px 360px at 90% 30%, rgba(245, 158, 11, 0.08), transparent 60%),
    var(--c-bg);
}
.demo-choice-inner {
  max-width: 880px;
  margin: 0 auto 48px;
  text-align: center;
}
.demo-choice-title {
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--c-text);
  margin: 12px 0 16px;
}
.demo-choice-lead {
  color: var(--c-muted);
  font-size: 1.08rem;
  line-height: 1.55;
  max-width: 640px;
  margin: 0 auto;
}
.demo-choice-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.demo-choice-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 40px 36px 36px;
  border-radius: 26px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  text-decoration: none;
  color: var(--c-text);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}
.demo-choice-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, transparent 60%, currentColor 200%);
  opacity: 0.04;
  pointer-events: none;
}
.demo-choice-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 56px -28px rgba(15, 23, 42, 0.28);
}
.demo-choice-cool {
  color: var(--c-primary);
}
.demo-choice-cool:hover { border-color: var(--c-primary); }
.demo-choice-warm {
  color: var(--c-accent-dark);
}
.demo-choice-warm:hover { border-color: var(--c-accent); }
.demo-choice-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: currentColor;
  color: #fff;
  display: grid;
  place-items: center;
  opacity: 0.95;
}
.demo-choice-cool .demo-choice-icon { background: var(--c-primary); }
.demo-choice-warm .demo-choice-icon { background: var(--c-accent); }
.demo-choice-tag {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}
.demo-choice-card h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--c-text);
  margin: 4px 0 4px;
}
.demo-choice-card > p {
  color: var(--c-muted);
  font-size: 0.98rem;
  line-height: 1.55;
  margin: 0;
}
.demo-choice-bullets {
  list-style: none;
  padding: 0;
  margin: 8px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
}
.demo-choice-bullets li {
  position: relative;
  padding-left: 18px;
  font-size: 0.93rem;
  color: var(--c-text);
  opacity: 0.88;
}
.demo-choice-bullets li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: currentColor;
  font-weight: 700;
}
.demo-choice-cta {
  margin-top: auto;
  padding-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.98rem;
  color: currentColor;
}
.demo-choice-foot {
  margin: 48px auto 0;
  text-align: center;
  color: var(--c-muted);
  font-size: 0.92rem;
}

/* ---------- Hero des tours (Compagnon / Proche) ---------- */
.demo-hero {
  padding: 56px 32px 24px;
  background: var(--c-bg);
}
.demo-hero-cool {
  background:
    radial-gradient(800px 400px at 15% 10%, rgba(37, 99, 235, 0.10), transparent 60%),
    var(--c-bg);
}
.demo-hero-warm {
  background:
    radial-gradient(800px 400px at 85% 10%, rgba(245, 158, 11, 0.12), transparent 60%),
    var(--c-bg);
}
.demo-hero-inner {
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
}
.demo-back-link {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 0.92rem;
  color: var(--c-muted);
  text-decoration: none;
  opacity: 0.8;
}
.demo-back-link:hover { color: var(--c-primary); opacity: 1; }
.demo-hero h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--c-text);
  margin: 12px 0 16px;
}
.demo-hero p {
  color: var(--c-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 720px;
  margin: 0 auto;
}

/* ---------- Scrollytelling layout ---------- */
.scrolly-section {
  padding: 0 32px 120px;
  background: var(--c-bg);
}
.scrolly-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 64px;
  align-items: flex-start;
}
.scrolly-scenes {
  display: flex;
  flex-direction: column;
  gap: 16vh;
  padding: 10vh 0 18vh;
}
.scrolly-scene {
  opacity: 0.4;
  transform: translateY(8px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.scrolly-scene.is-active {
  opacity: 1;
  transform: translateY(0);
}
.scrolly-step {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.scrolly-step-num {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--c-primary);
  letter-spacing: 0.02em;
}
.scrolly-step-tag {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-muted);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--c-surface-alt, var(--c-surface));
  border: 1px solid var(--c-border);
}
.scrolly-scene h2 {
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--c-text);
  margin: 0 0 12px;
  line-height: 1.2;
}
.scrolly-scene-body {
  color: var(--c-muted);
  font-size: 1.02rem;
  line-height: 1.65;
  margin: 0 0 16px;
}
.scrolly-scene-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.scrolly-scene-bullets li {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.96rem;
  color: var(--c-text);
}
.scrolly-sticky {
  position: sticky;
  top: 96px;
  height: calc(100vh - 96px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.scrolly-device-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.scrolly-device-caption {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-muted);
  opacity: 0.75;
}

/* ---------- Tablet mockup (Compagnon) ---------- */
.dmo-tablet {
  position: relative;
  width: min(440px, 90%);
  aspect-ratio: 3 / 4;
  background: linear-gradient(160deg, #1f2937, #0f172a);
  border-radius: 36px;
  padding: 18px;
  box-shadow:
    0 30px 70px -30px rgba(15, 23, 42, 0.5),
    inset 0 0 0 2px rgba(255, 255, 255, 0.06);
}
.dmo-tablet-camera {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #475569;
}
.dmo-tablet-screen-frame {
  width: 100%;
  height: 100%;
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  position: relative;
}
.dmo-screen {
  position: absolute;
  inset: 0;
  padding: 18px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: dmoFade 0.45s ease both;
}
@keyframes dmoFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.dmo-bg-warm {
  background:
    radial-gradient(400px 240px at 100% 0%, rgba(245, 158, 11, 0.18), transparent 60%),
    #fff8ed;
}
.dmo-bg-cool {
  background:
    radial-gradient(400px 240px at 0% 0%, rgba(37, 99, 235, 0.16), transparent 60%),
    #eff6ff;
}
.dmo-bg-light { background: #ffffff; }
.dmo-status-bar {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #475569;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.dmo-greeting {
  text-align: center;
  margin-top: 6px;
}
.dmo-avatar-circle {
  width: 84px;
  height: 84px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  display: grid;
  place-items: center;
  font-size: 42px;
  box-shadow: 0 10px 22px -10px rgba(245, 158, 11, 0.6);
}
.dmo-greeting h3 {
  margin: 0 0 4px;
  font-size: 1.4rem;
  font-weight: 800;
  color: #111827;
}
.dmo-greeting p {
  margin: 0;
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.4;
}
.dmo-card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.dmo-mini-card {
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 700;
  color: #111827;
}
.dmo-mini-card span { font-size: 1.05rem; }
.dmo-mini-card small { font-size: 0.72rem; opacity: 0.7; font-weight: 500; }
.dmo-mini-icon { font-size: 1.4rem; }
.dmo-mini-warm { background: rgba(245, 158, 11, 0.15); }
.dmo-mini-cool { background: rgba(37, 99, 235, 0.12); }
.dmo-primary-btn {
  margin-top: auto;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 12px 24px -12px rgba(37, 99, 235, 0.6);
}
.dmo-h3 {
  margin: 4px 0 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #111827;
  text-align: center;
}
.dmo-mood-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin: 8px 0;
}
.dmo-mood-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0, 0, 0, 0.05);
  font-size: 26px;
  cursor: pointer;
  transition: transform 0.15s;
}
.dmo-mood-selected {
  border-color: var(--c-primary);
  transform: scale(1.12);
  box-shadow: 0 10px 22px -10px rgba(37, 99, 235, 0.45);
}
.dmo-mood-label {
  text-align: center;
  margin: -4px 0 6px;
  font-weight: 700;
  color: var(--c-primary);
}
.dmo-energy { display: flex; flex-direction: column; gap: 6px; }
.dmo-energy label { font-size: 0.85rem; font-weight: 600; color: #475569; }
.dmo-energy-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  overflow: hidden;
}
.dmo-energy-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-primary-light), var(--c-primary));
  border-radius: 999px;
}
.dmo-progress-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 4px 0;
}
.dmo-progress-dots .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.12);
}
.dmo-progress-dots .dot.done { background: var(--c-primary); }
.dmo-progress-dots .dot.active {
  background: var(--c-accent);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}
.dmo-quote {
  text-align: center;
  margin: 6px 0;
  font-size: 1.05rem;
  font-style: italic;
  color: #1f2937;
}
.dmo-answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.dmo-answer {
  padding: 12px 10px;
  border-radius: 12px;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  font-weight: 600;
  color: #1f2937;
  cursor: pointer;
}
.dmo-answer-active {
  border-color: var(--c-primary);
  background: rgba(37, 99, 235, 0.08);
  color: var(--c-primary-dark);
}
.dmo-avatar-tip {
  position: relative;
  margin-top: auto;
  background: rgba(245, 158, 11, 0.15);
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  color: #92400e;
  font-weight: 500;
}
.dmo-memory-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex: 1;
}
.dmo-memory-tile {
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 80px;
  font-weight: 600;
  color: #1f2937;
}
.dmo-memory-tile span { font-size: 1.8rem; }
.dmo-memory-tile small { font-size: 0.78rem; opacity: 0.75; }
.dmo-tile-1 { background: rgba(245, 158, 11, 0.18); }
.dmo-tile-2 { background: rgba(37, 99, 235, 0.14); }
.dmo-tile-3 { background: rgba(34, 197, 94, 0.14); }
.dmo-tile-4 { background: rgba(244, 114, 182, 0.14); }
.dmo-chat-row {
  display: flex;
  margin: 4px 0;
}
.dmo-chat-row-right { justify-content: flex-end; }
.dmo-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.92rem;
  max-width: 80%;
  line-height: 1.4;
}
.dmo-bubble-ai {
  background: #fff;
  color: #1f2937;
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 10px -6px rgba(0, 0, 0, 0.1);
}
.dmo-bubble-user {
  background: var(--c-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.dmo-mic-bar {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(37, 99, 235, 0.12);
  border-radius: 14px;
  font-weight: 600;
  color: var(--c-primary-dark);
}
.dmo-mic-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
  animation: micPulse 1.5s ease-in-out infinite;
}
@keyframes micPulse {
  50% { transform: scale(1.4); opacity: 0.6; }
}
.dmo-act-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  flex: 1;
}
.dmo-act {
  border-radius: 14px;
  padding: 14px 6px;
  text-align: center;
  font-weight: 600;
  color: #1f2937;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.dmo-act span { font-size: 1.9rem; }
.dmo-act small { font-size: 0.78rem; opacity: 0.85; }
.dmo-act-1 { background: rgba(245, 158, 11, 0.18); }
.dmo-act-2 { background: rgba(168, 85, 247, 0.14); }
.dmo-act-3 { background: rgba(34, 197, 94, 0.14); }
.dmo-act-4 { background: rgba(244, 114, 182, 0.14); }
.dmo-act-5 { background: rgba(37, 99, 235, 0.12); }
.dmo-act-6 { background: rgba(245, 158, 11, 0.10); }

/* ---------- Écran d'accueil reflétant la vraie app ---------- */
.dmo-screen-app { gap: 10px; padding: 14px 14px 16px; }
.dmo-app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dmo-app-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}
.dmo-ambient-pill {
  font-size: 0.66rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--c-primary-dark);
  border: 1px solid rgba(37, 99, 235, 0.18);
  white-space: nowrap;
}
.dmo-avatar-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: 0 6px 16px -10px rgba(15, 23, 42, 0.18);
}
.dmo-avatar-big {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fde68a, #fbbf24);
  display: grid;
  place-items: center;
  font-size: 2.1rem;
  box-shadow: 0 8px 20px -8px rgba(245, 158, 11, 0.55);
}
.dmo-avatar-line {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: #334155;
  text-align: center;
  line-height: 1.3;
}
.dmo-avatar-line em { color: var(--c-primary-dark); font-style: normal; font-weight: 700; }
.dmo-weather-row {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 0.74rem;
  color: #64748b;
  font-weight: 500;
}
.dmo-dot-sep { opacity: 0.4; }

.dmo-tiles {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}
.dmo-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}
.dmo-tile-ico { font-size: 1.4rem; flex-shrink: 0; }
.dmo-tile-title {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
}
.dmo-tile-sub {
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.3;
}
.dmo-tile-primary {
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 20px -10px rgba(37, 99, 235, 0.45);
}
.dmo-tile-primary .dmo-tile-sub { color: rgba(255, 255, 255, 0.85); }
.dmo-tile-amber {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #fff;
  border-color: transparent;
}
.dmo-tile-amber .dmo-tile-sub { color: rgba(255, 255, 255, 0.9); }
.dmo-tile-cyan {
  background: linear-gradient(135deg, #22d3ee, #0891b2);
  color: #fff;
  border-color: transparent;
}
.dmo-tile-cyan .dmo-tile-sub { color: rgba(255, 255, 255, 0.9); }
.dmo-tile-purple {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #fff;
  border-color: transparent;
}
.dmo-tile-purple .dmo-tile-sub { color: rgba(255, 255, 255, 0.9); }

/* ---------- Médicaments (check-in) ---------- */
.dmo-meds { display: flex; flex-direction: column; gap: 6px; }
.dmo-meds label { font-size: 0.85rem; font-weight: 600; color: #475569; }
.dmo-meds-row { display: flex; gap: 6px; flex-wrap: wrap; }
.dmo-med-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 0.74rem;
  font-weight: 600;
  color: #475569;
}
.dmo-med-on { background: rgba(34, 197, 94, 0.16); color: #15803d; }

/* ---------- MoCA 5 mots ---------- */
.dmo-instr {
  margin: 4px 0 8px;
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.4;
}
.dmo-words {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex: 1;
  align-content: center;
}
.dmo-words .dmo-word:nth-child(5) {
  grid-column: 1 / -1;
  justify-self: center;
  min-width: 60%;
}
.dmo-word {
  text-align: center;
  padding: 14px 8px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  color: #5b21b6;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  box-shadow: 0 4px 14px -8px rgba(139, 92, 246, 0.45);
}

/* ---------- Jeux cognitifs (reflet PatientGames) ---------- */
.dmo-games-tabs {
  display: flex;
  gap: 6px;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 3px;
}
.dmo-games-tab {
  flex: 1;
  text-align: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
}
.dmo-games-tab.active {
  background: #fff;
  color: var(--c-primary-dark);
  box-shadow: 0 2px 6px -2px rgba(15, 23, 42, 0.15);
}
.dmo-games-chips {
  display: flex;
  gap: 6px;
  overflow: hidden;
  flex-wrap: nowrap;
}
.dmo-chip {
  padding: 5px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}
.dmo-chip-active {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  box-shadow: 0 4px 12px -6px rgba(139, 92, 246, 0.55);
}
.dmo-games-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  box-shadow: 0 10px 24px -14px rgba(139, 92, 246, 0.6);
}
.dmo-games-banner-ico { font-size: 1.7rem; }
.dmo-games-banner-title { font-size: 1rem; font-weight: 800; line-height: 1.1; }
.dmo-games-banner-sub { font-size: 0.74rem; opacity: 0.85; }
.dmo-games-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex: 1;
}
.dmo-game-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  position: relative;
}
.dmo-game-emoji { font-size: 1.6rem; }
.dmo-game-name { font-size: 0.78rem; font-weight: 700; color: #0f172a; }
.dmo-game-desc { font-size: 0.66rem; color: #64748b; line-height: 1.3; }
.dmo-game-best {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.62rem;
  font-weight: 700;
  color: #b45309;
  background: rgba(245, 158, 11, 0.18);
  padding: 2px 6px;
  border-radius: 999px;
}

/* Carte d'activité en bas de l'écran "Activités" */
.dmo-act-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
}
.dmo-act-card-emoji { font-size: 1.6rem; }
.dmo-act-card-name { font-size: 0.84rem; font-weight: 700; color: #0f172a; }
.dmo-act-card-desc { font-size: 0.7rem; color: #64748b; }

/* ---------- Bandeau de réassurance "Prends ton temps" ---------- */
.dmo-reassure {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  font-weight: 700;
  font-size: 0.92rem;
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 10px 24px -16px rgba(245, 158, 11, 0.6);
  animation: reassureIn 0.45s ease both;
}
@keyframes reassureIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Démo : barre de navigation top (bouton retour à gauche) ---------- */
.demo-hero-topnav {
  max-width: 1280px;
  margin: 0 auto 8px;
  padding: 0 8px;
  text-align: left;
}

/* ---------- Écran Check-in (reflet step-by-step) ---------- */
.dmo-checkin-head {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.dmo-checkin-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 6px 16px -10px rgba(15, 23, 42, 0.18);
}
.dmo-checkin-q {
  margin: 4px 0 0;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  line-height: 1.3;
}
.dmo-checkin-hint {
  margin: 0;
  font-size: 0.78rem;
  color: #64748b;
  text-align: center;
}
.dmo-step-info {
  margin: 0;
  text-align: center;
  font-size: 0.75rem;
  color: #64748b;
}

/* ---------- Écran Exercice (reflet ExerciseSession MCQ) ---------- */
.dmo-exo-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
}
.dmo-exo-q { color: #0f172a; }
.dmo-exo-cat {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  font-size: 0.7rem;
}
.dmo-progress {
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.dmo-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-primary), var(--c-primary-dark));
  border-radius: 999px;
}
.dmo-exo-text {
  margin: 4px 0 6px;
  font-size: 0.92rem;
  color: #0f172a;
  line-height: 1.45;
}
.dmo-exo-text strong { color: var(--c-primary-dark); font-weight: 800; }
.dmo-choices { display: flex; flex-direction: column; gap: 7px; }
.dmo-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  text-align: left;
  font-size: 0.86rem;
  color: #0f172a;
}
.dmo-choice-letter {
  color: var(--c-primary);
  font-weight: 800;
  font-size: 0.78rem;
}
.dmo-choice-text { font-weight: 600; }
.dmo-choice-picked {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.16));
  border-color: var(--c-primary);
  box-shadow: 0 6px 14px -8px rgba(37, 99, 235, 0.4);
}

/* ---------- Page de choix de démo (Demo.tsx — refonte) ---------- */
.demo-pick-hero {
  padding: 64px 32px 80px;
  background:
    radial-gradient(720px 340px at 18% 10%, rgba(37, 99, 235, 0.08), transparent 60%),
    radial-gradient(720px 340px at 82% 12%, rgba(245, 158, 11, 0.10), transparent 60%),
    var(--c-bg);
}
.demo-pick-hero-inner {
  max-width: 920px;
  margin: 0 auto 48px;
  text-align: center;
}
.demo-pick-title {
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--c-text);
  margin: 14px 0 16px;
}
.demo-pick-lead {
  color: var(--c-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto;
}
.demo-pick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  max-width: 1180px;
  margin: 0 auto;
}
.demo-pick-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 36px 32px 32px;
  border-radius: 24px;
  text-decoration: none;
  color: inherit;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  box-shadow: 0 14px 40px -22px rgba(15, 23, 42, 0.18);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  overflow: hidden;
}
.demo-pick-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 50px -22px rgba(15, 23, 42, 0.28);
}
.demo-pick-card-cool {
  background:
    radial-gradient(500px 280px at 0% 0%, rgba(37, 99, 235, 0.10), transparent 60%),
    var(--c-surface);
}
.demo-pick-card-cool:hover { border-color: rgba(37, 99, 235, 0.4); }
.demo-pick-card-warm {
  background:
    radial-gradient(500px 280px at 100% 0%, rgba(245, 158, 11, 0.12), transparent 60%),
    var(--c-surface);
}
.demo-pick-card-warm:hover { border-color: rgba(245, 158, 11, 0.45); }

.demo-pick-device-wrap {
  display: flex;
  justify-content: center;
  margin: -4px auto 24px;
  width: 100%;
  min-height: 240px;
  align-items: center;
}

/* Mini-tablette (carte Compagnon) */
.demo-pick-tablet {
  position: relative;
  width: 220px;
  aspect-ratio: 3 / 4;
  background: linear-gradient(160deg, #1f2937, #0f172a);
  border-radius: 24px;
  padding: 12px;
  box-shadow: 0 30px 60px -28px rgba(15, 23, 42, 0.5);
}
.demo-pick-tablet-camera {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #475569;
}
.demo-pick-tablet-screen {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  background: #fff;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
}
.demo-pick-mini-app { display: flex; flex-direction: column; gap: 5px; }
.demo-pick-mini-greet {
  font-size: 0.78rem;
  font-weight: 800;
  color: #0f172a;
  text-align: center;
}
.demo-pick-mini-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fde68a, #fbbf24);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  margin: 2px auto 4px;
}
.demo-pick-mini-tile {
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 0.6rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.demo-pick-tile-primary { background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark)); }
.demo-pick-tile-amber { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.demo-pick-tile-cyan { background: linear-gradient(135deg, #22d3ee, #0891b2); }
.demo-pick-tile-purple { background: linear-gradient(135deg, #a78bfa, #7c3aed); }

/* Mini-PC (carte Proche) */
.demo-pick-laptop {
  position: relative;
  width: 320px;
  border-radius: 12px 12px 4px 4px;
  background: linear-gradient(160deg, #1f2937, #0f172a);
  padding: 6px 6px 0;
  box-shadow: 0 30px 60px -28px rgba(15, 23, 42, 0.5);
}
.demo-pick-laptop-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #111827;
  border-radius: 8px 8px 0 0;
}
.demo-pick-laptop-url {
  flex: 1;
  margin-left: 8px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  font-size: 0.62rem;
  color: #cbd5e1;
}
.demo-pick-laptop-screen {
  background: #fff;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 180px;
}
.demo-pick-laptop-foot {
  height: 8px;
  background: #0f172a;
  margin: 0 -8px;
  border-radius: 0 0 14px 14px;
  box-shadow: inset 0 4px 6px rgba(0, 0, 0, 0.5);
}
.demo-pick-mini-h1 { font-size: 0.78rem; font-weight: 800; color: var(--c-primary-dark); }
.demo-pick-mini-tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 3px;
}
.demo-pick-mini-tab {
  flex: 1;
  text-align: center;
  font-size: 0.6rem;
  font-weight: 600;
  color: #64748b;
  padding: 3px 6px;
  border-radius: 999px;
}
.demo-pick-mini-tab.active { background: #fff; color: var(--c-primary-dark); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.demo-pick-mini-pcard {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.demo-pick-mini-pavatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fde68a;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
}
.demo-pick-mini-pname { font-size: 0.66rem; font-weight: 700; color: #0f172a; }
.demo-pick-mini-pmeta { font-size: 0.56rem; color: #64748b; }

.demo-pick-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
  align-self: flex-start;
}
.demo-pick-tag-cool { background: rgba(37, 99, 235, 0.12); color: var(--c-primary-dark); }
.demo-pick-tag-warm { background: rgba(245, 158, 11, 0.18); color: #b45309; }
.demo-pick-card-title {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: var(--c-text);
}
.demo-pick-card-desc {
  color: var(--c-muted);
  font-size: 1rem;
  line-height: 1.55;
  margin: 0 0 18px;
}
.demo-pick-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.demo-pick-feat {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--c-surface-alt, #f1f5f9);
  border: 1px solid var(--c-border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-text);
}
.demo-pick-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.98rem;
  color: #fff;
  align-self: flex-start;
  margin-top: auto;
  transition: transform 0.2s ease;
}
.demo-pick-cta-cool { background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark)); }
.demo-pick-cta-warm { background: linear-gradient(135deg, var(--c-accent), var(--c-accent-dark)); }
.demo-pick-card:hover .demo-pick-cta { transform: translateX(4px); }
.demo-pick-foot {
  text-align: center;
  color: var(--c-muted);
  font-size: 0.92rem;
  margin-top: 36px;
}

/* ---------- Écrans Proche (reflet PremiumHome / PatientDetail / etc.) ---------- */
.proche-screen {
  background: #fff;
  border-radius: 0 0 8px 8px;
  padding: 12px 14px;
  height: 380px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: dmoFade 0.45s ease both;
}
.proche-app-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.proche-back {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 7px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 0.7rem;
  font-weight: 600;
  color: #475569;
}
.proche-app-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.proche-app-title h2 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}
.proche-premium-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #fff;
}
.proche-nav-tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 3px;
}
.proche-tab {
  flex: 1;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  padding: 5px 10px;
  border-radius: 999px;
}
.proche-tab.active {
  background: #fff;
  color: var(--c-primary-dark);
  box-shadow: 0 2px 6px -2px rgba(15, 23, 42, 0.18);
}
.proche-welcome {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.10), rgba(245, 158, 11, 0.02));
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(245, 158, 11, 0.18);
}
.proche-welcome h3 { margin: 0; font-size: 0.82rem; font-weight: 800; color: #0f172a; }
.proche-welcome p { margin: 2px 0 0; font-size: 0.68rem; color: #64748b; }

.proche-cards { display: flex; flex-direction: column; gap: 6px; }
.proche-pcard {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
}
.proche-pcard-body strong { display: block; font-size: 0.78rem; font-weight: 700; color: #0f172a; }
.proche-pcard-body small {
  display: flex;
  gap: 5px;
  font-size: 0.62rem;
  color: #64748b;
  align-items: center;
  margin-top: 2px;
}
.proche-pin {
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.58rem;
}
.proche-pin-on { background: rgba(34, 197, 94, 0.18); color: #15803d; }
.proche-pin-off { background: rgba(148, 163, 184, 0.18); color: #475569; }
.proche-avatar-chip {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ---- Fiche patient ---- */
.proche-hero-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1.2fr;
  gap: 7px;
}
.proche-hero-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  font-size: 0.66rem;
}
.proche-hero-avatar { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.proche-big-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fde68a, #fbbf24);
  display: grid;
  place-items: center;
  font-size: 1.8rem;
}
.proche-hero-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.proche-mini-btn {
  padding: 3px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 0.58rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}
.proche-pname { font-size: 0.84rem; font-weight: 600; color: #0f172a; margin-bottom: 6px; }
.proche-pname strong { font-weight: 800; text-transform: uppercase; }
.proche-demog {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
}
.proche-demog > div { display: flex; flex-direction: column; }
.proche-demog span { font-size: 0.54rem; text-transform: uppercase; color: #64748b; letter-spacing: 0.04em; font-weight: 600; }
.proche-demog strong { font-size: 0.7rem; color: #0f172a; font-weight: 700; }
.proche-hero-info hr { margin: 6px 0; border: 0; border-top: 1px solid #e2e8f0; }
.proche-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 4px;
}
.proche-stats > div { text-align: center; }
.proche-stats strong { display: block; font-size: 0.88rem; font-weight: 800; color: var(--c-primary-dark); }
.proche-stats small { font-size: 0.54rem; color: #64748b; }
.proche-track-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.proche-track-head strong { font-size: 0.74rem; }
.proche-track-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 6px;
  border-left: 3px solid #10b981;
  background: rgba(16, 185, 129, 0.06);
  border-radius: 0 6px 6px 0;
  margin-bottom: 4px;
  font-size: 0.62rem;
  flex-wrap: wrap;
}
.proche-track-icon { font-size: 0.85rem; }
.proche-track-label { font-weight: 600; color: #0f172a; flex: 1; min-width: 0; }
.proche-hour-chip {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.56rem;
  font-weight: 700;
}
.proche-hour-chip.taken { background: rgba(34, 197, 94, 0.18); color: #15803d; }
.proche-hour-chip.upcoming { background: rgba(245, 158, 11, 0.18); color: #b45309; }

.proche-pc-tabs {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
}
.proche-pc-tab {
  font-size: 0.74rem;
  font-weight: 600;
  color: #64748b;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  margin-bottom: -5px;
}
.proche-pc-tab.active {
  color: var(--c-primary-dark);
  border-bottom-color: var(--c-primary);
}

/* ---- Onglet Principal (3 colonnes) ---- */
.proche-cols-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
  flex: 1;
  min-height: 0;
}
.proche-col {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  font-size: 0.62rem;
  overflow: hidden;
}
.proche-col > strong { display: block; font-size: 0.72rem; color: #0f172a; margin-bottom: 6px; }
.proche-col-sub {
  font-size: 0.54rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  font-weight: 700;
  margin: 6px 0 4px;
}
.proche-tline {
  padding: 4px 6px;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 0.6rem;
  color: #0f172a;
  margin-bottom: 3px;
}
.proche-tline.muted { color: #94a3b8; }
.proche-goal-row { display: flex; gap: 4px; margin-bottom: 6px; }
.proche-goal-chip {
  flex: 1;
  text-align: center;
  background: rgba(37, 99, 235, 0.10);
  border-radius: 6px;
  padding: 4px 2px;
}
.proche-goal-chip span { display: block; font-size: 0.85rem; font-weight: 800; color: var(--c-primary-dark); }
.proche-goal-chip small { font-size: 0.5rem; color: #64748b; }
.proche-goal-chip.purple { background: rgba(99, 102, 241, 0.12); }
.proche-goal-chip.purple span { color: #6366f1; }
.proche-vit-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}
.proche-vit-tabs span {
  flex: 1;
  text-align: center;
  font-size: 0.54rem;
  font-weight: 600;
  color: #64748b;
  padding: 3px;
  border-radius: 5px;
  background: #f1f5f9;
}
.proche-vit-tabs span.active { background: var(--c-primary); color: #fff; }
.proche-vit-chart { width: 100%; height: 70px; }
.proche-vit-legend {
  display: flex;
  gap: 10px;
  justify-content: center;
  font-size: 0.54rem;
  color: #64748b;
}
.proche-vit-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 3px; }

/* ---- Tests perso. ---- */
.proche-test-cta {
  text-align: center;
  padding: 7px 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}
.proche-test-list { display: flex; flex-direction: column; gap: 6px; }
.proche-test-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
}
.proche-test-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
}
.proche-test-body { flex: 1; min-width: 0; }
.proche-test-body strong { display: block; font-size: 0.72rem; color: #0f172a; }
.proche-test-body small { font-size: 0.56rem; color: #64748b; }
.proche-test-kebab { color: #94a3b8; font-size: 1rem; letter-spacing: 0.05em; }

/* ---- Rapports ---- */
.proche-report-chart {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
}
.proche-report-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.proche-report-chart-head strong { font-size: 0.72rem; color: #0f172a; }
.proche-report-chart-head small { font-size: 0.56rem; color: #64748b; }
.proche-report-chart svg { width: 100%; height: 70px; }
.proche-report-gen {
  text-align: center;
  padding: 6px;
  border-radius: 8px;
  background: var(--c-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}
.proche-report-list { display: flex; flex-direction: column; gap: 5px; }
.proche-report-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 9px;
  border-radius: 8px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
}
.proche-report-row.selected { border-color: var(--c-primary); }
.proche-report-row strong { font-size: 0.72rem; color: #0f172a; display: block; }
.proche-report-row small { font-size: 0.54rem; color: #64748b; }
.proche-pdf-btn {
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--c-primary);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
}
.proche-pdf-pending {
  padding: 2px 7px;
  border-radius: 999px;
  background: #fef9c3;
  color: #a16207;
  font-size: 0.55rem;
  font-weight: 700;
}

/* ---- Suivi & objectifs ---- */
.proche-suivi-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  flex-wrap: wrap;
}
.proche-suivi-name { flex: 1; min-width: 90px; }
.proche-suivi-name strong { font-weight: 800; text-transform: uppercase; font-size: 0.72rem; color: #0f172a; }
.proche-suivi-name small { display: block; font-size: 0.56rem; color: #64748b; }
.proche-stepper { text-align: center; }
.proche-stepper small {
  display: block;
  font-size: 0.55rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 3px;
}
.proche-stepper div { display: flex; align-items: center; gap: 4px; }
.proche-stepper button {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 0.7rem;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
}
.proche-stepper strong { min-width: 22px; text-align: center; font-size: 0.8rem; font-weight: 700; color: #0f172a; }

/* ---------- Hero showcase animé (Samsung One UI vibe) ---------- */
.hero-showcase {
  margin: 48px auto 0;
  width: min(460px, 92%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
/* Variante Proche : mini-PC plus large que la tablette */
.hero-showcase-proche {
  width: min(720px, 96%);
}
.hero-showcase-tablet {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: linear-gradient(160deg, #1f2937, #0f172a);
  border-radius: 28px;
  padding: 14px;
  box-shadow:
    0 40px 80px -30px rgba(15, 23, 42, 0.55),
    inset 0 0 0 2px rgba(255, 255, 255, 0.06);
}
.hero-showcase-camera {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #475569;
}
.hero-showcase-screen {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  position: relative;
}
/* Les écrans réels sont denses : densité réduite pour rester lisible
   dans la mini-tablette du hero (paddings et tailles ajustés). */
.hero-showcase-screen .dmo-screen { padding: 14px; gap: 10px; }
.hero-showcase-screen .dmo-app-header h3 { font-size: 0.95rem; }
.hero-showcase-screen .dmo-ambient-pill { font-size: 0.58rem; padding: 3px 7px; }
.hero-showcase-screen .dmo-tile { padding: 8px 10px; gap: 8px; }
.hero-showcase-screen .dmo-tile-ico { font-size: 1.15rem; }
.hero-showcase-screen .dmo-tile-title { font-size: 0.72rem; }
.hero-showcase-screen .dmo-tile-sub { font-size: 0.6rem; }
.hero-showcase-screen .dmo-avatar-big { width: 52px; height: 52px; font-size: 1.7rem; }
.hero-showcase-screen .dmo-avatar-line { font-size: 0.72rem; }
.hero-showcase-screen .dmo-weather-row { font-size: 0.66rem; }
.hero-showcase-screen .dmo-h3 { font-size: 0.95rem; }
.hero-showcase-screen .dmo-instr { font-size: 0.74rem; }
.hero-showcase-screen .dmo-word { font-size: 0.78rem; padding: 10px 6px; }
.hero-showcase-screen .dmo-games-banner-title { font-size: 0.86rem; }
.hero-showcase-screen .dmo-games-banner-sub { font-size: 0.66rem; }
.hero-showcase-screen .dmo-chip { font-size: 0.62rem; padding: 4px 8px; }
.hero-showcase-screen .dmo-games-tab { font-size: 0.68rem; }
.hero-showcase-screen .dmo-bubble { font-size: 0.78rem; padding: 8px 10px; }

/* Mini-PC du hero Proche : même architecture que la tablette mais plus
   large pour montrer le layout 3 colonnes / fiche patient lisible. */
.hero-showcase-laptop {
  position: relative;
  width: 100%;
  border-radius: 14px 14px 4px 4px;
  background: linear-gradient(160deg, #1f2937, #0f172a);
  padding: 6px 6px 0;
  box-shadow:
    0 40px 80px -30px rgba(15, 23, 42, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.hero-showcase-laptop-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #111827;
  border-radius: 8px 8px 0 0;
}
.hero-showcase-laptop-url {
  flex: 1;
  margin-left: 10px;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  font-size: 0.74rem;
  color: #cbd5e1;
  letter-spacing: 0.02em;
}
.hero-showcase-laptop-screen {
  position: relative;
  background: #fff;
  border-radius: 0 0 4px 4px;
  height: 460px;
  overflow: hidden;
}
/* Le .proche-screen rendu dans hero-frame doit remplir tout le viewport
   du laptop (sinon le contenu rétrécit). */
.hero-showcase-laptop-screen .proche-screen {
  height: 100%;
  border-radius: 0;
  padding: 14px 18px;
}
.hero-showcase-proche .hero-frame {
  /* Le frame doit également porter le viewport pour que le .proche-screen
     hérite de 100% de hauteur. */
  display: block;
}

.hero-frame {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: heroCycle 14s infinite ease-in-out;
}
.hero-frame-1 { animation-delay: 0s; }
.hero-frame-2 { animation-delay: 3.5s; }
.hero-frame-3 { animation-delay: 7s; }
.hero-frame-4 { animation-delay: 10.5s; }
@keyframes heroCycle {
  0%, 2% { opacity: 0; transform: translateY(8px); }
  4%, 22% { opacity: 1; transform: translateY(0); }
  25%, 100% { opacity: 0; transform: translateY(-4px); }
}
.hero-showcase-dots {
  display: flex;
  gap: 8px;
}
.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.15);
  animation: heroDot 14s infinite ease-in-out;
}
.hero-dot-1 { animation-delay: 0s; }
.hero-dot-2 { animation-delay: 3.5s; }
.hero-dot-3 { animation-delay: 7s; }
.hero-dot-4 { animation-delay: 10.5s; }
@keyframes heroDot {
  0%, 2% { background: rgba(15, 23, 42, 0.15); transform: scale(1); }
  4%, 22% { background: var(--c-accent, #f59e0b); transform: scale(1.25); }
  25%, 100% { background: rgba(15, 23, 42, 0.15); transform: scale(1); }
}

/* ---------- Trio devices (Proche) : PC + mobile flottant ---------- */
.dmo-trio {
  position: relative;
  width: min(640px, 100%);
  margin: 0 auto;
}
.dmo-pc {
  width: 100%;
  border-radius: 14px;
  background: linear-gradient(160deg, #1f2937, #0f172a);
  padding: 10px;
  box-shadow:
    0 30px 70px -30px rgba(15, 23, 42, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.dmo-pc-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px 8px 0 0;
  background: #111827;
}
.dmo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dmo-dot.r { background: #ef4444; }
.dmo-dot.y { background: #f59e0b; }
.dmo-dot.g { background: #22c55e; }
.dmo-pc-url {
  flex: 1;
  margin-left: 12px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  font-size: 0.74rem;
  color: #cbd5e1;
  letter-spacing: 0.02em;
}
.dmo-pc-screen {
  display: grid;
  grid-template-columns: 150px 1fr;
  background: #fff;
  height: 380px;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  animation: dmoFade 0.45s ease both;
}
.dmo-pc-side {
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  padding: 14px 12px;
}
.dmo-pc-brand {
  font-weight: 800;
  color: var(--c-primary);
  font-size: 1rem;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
.dmo-pc-side ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dmo-pc-side li {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #475569;
  font-weight: 500;
  cursor: pointer;
}
.dmo-pc-side li.active {
  background: rgba(37, 99, 235, 0.10);
  color: var(--c-primary-dark);
  font-weight: 700;
}
.dmo-pc-main {
  padding: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dmo-pc-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.dmo-kpi {
  border-radius: 12px;
  padding: 12px;
  background: rgba(37, 99, 235, 0.08);
  display: flex;
  flex-direction: column;
}
.dmo-kpi span { font-size: 1.4rem; font-weight: 800; color: var(--c-primary-dark); }
.dmo-kpi small { font-size: 0.72rem; color: #64748b; font-weight: 500; }
.dmo-kpi-2 { background: rgba(34, 197, 94, 0.10); }
.dmo-kpi-2 span { color: #15803d; }
.dmo-kpi-3 { background: rgba(245, 158, 11, 0.14); }
.dmo-kpi-3 span { color: var(--c-accent-dark); }
.dmo-pc-h4 {
  margin: 4px 0 4px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dmo-pc-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dmo-pc-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.85rem;
  color: #1f2937;
}
.dmo-pc-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  flex-shrink: 0;
}
.dmo-pc-avatar-lg { width: 56px; height: 56px; }
.dmo-pc-list-row span { flex: 1; }
.dmo-chip {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
}
.dmo-chip-ok { background: rgba(34, 197, 94, 0.15); color: #15803d; }
.dmo-chip-warn { background: rgba(245, 158, 11, 0.18); color: var(--c-accent-dark); }
.dmo-pc-patient-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dmo-pc-patient-head h4 { margin: 0; font-size: 1.05rem; color: #111827; font-weight: 800; }
.dmo-pc-patient-head small { color: #64748b; font-size: 0.78rem; }
.dmo-pc-chart {
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dmo-pc-chart svg { width: 100%; height: 80px; }
.dmo-pc-chart small { color: #64748b; font-size: 0.78rem; }
.dmo-pc-meds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dmo-pc-input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  font-size: 0.88rem;
  color: #1f2937;
  font-weight: 600;
}
.dmo-pc-builder {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex: 1;
  overflow: hidden;
}
.dmo-pc-builder-col {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dmo-pc-builder-col strong {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}
.dmo-pc-builder-active {
  background: rgba(245, 158, 11, 0.10);
  border-color: var(--c-accent);
}
.dmo-pc-q {
  padding: 6px 10px;
  background: #fff;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #1f2937;
  border: 1px solid #e2e8f0;
}
.dmo-pc-q.is-picked {
  border-color: var(--c-accent);
  color: var(--c-accent-dark);
  font-weight: 600;
}
.dmo-pc-btn {
  margin-top: auto;
  padding: 11px 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-dark));
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}
.dmo-pc-reports {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.dmo-pc-report {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.dmo-pc-pdf-thumb {
  width: 100%;
  height: 60px;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
}
.dmo-pc-report strong { font-size: 0.85rem; color: #111827; }
.dmo-pc-report small { font-size: 0.72rem; color: #64748b; }
.dmo-pc-report button {
  margin-top: 4px;
  padding: 6px 10px;
  background: var(--c-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}
.dmo-pc-alerts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dmo-pc-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
}
.dmo-pc-alert > span { font-size: 1.2rem; }
.dmo-pc-alert strong { color: #1f2937; font-size: 0.88rem; font-weight: 700; display: block; }
.dmo-pc-alert small { color: #64748b; font-size: 0.74rem; }
.dmo-pc-alert-warn { background: rgba(245, 158, 11, 0.15); }
.dmo-pc-alert-info { background: rgba(37, 99, 235, 0.10); }
.dmo-pc-alert-ok { background: rgba(34, 197, 94, 0.10); }
.dmo-pc-sync {
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0;
}
.dmo-pc-sync-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.dmo-sync-pill {
  padding: 10px 16px;
  background: rgba(37, 99, 235, 0.10);
  color: var(--c-primary-dark);
  font-weight: 700;
  border-radius: 999px;
  font-size: 0.88rem;
}

/* Mobile flottant */
.dmo-mobile-float {
  position: absolute;
  right: -28px;
  bottom: -36px;
  width: 150px;
  aspect-ratio: 9 / 18;
  background: linear-gradient(160deg, #1f2937, #0f172a);
  border-radius: 24px;
  padding: 7px;
  box-shadow:
    0 24px 50px -20px rgba(15, 23, 42, 0.55),
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.05);
  z-index: 2;
}
.dmo-mobile-notch {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 12px;
  background: #0b1220;
  border-radius: 0 0 10px 10px;
  z-index: 3;
}
.dmo-m-screen {
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 18px;
  padding: 18px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  animation: dmoFade 0.45s ease both;
}
.dmo-m-bar {
  font-size: 0.6rem;
  font-weight: 700;
  color: #475569;
  text-align: center;
}
.dmo-m-screen strong {
  font-size: 0.78rem;
  color: #111827;
  margin: 4px 0;
}
.dmo-m-row {
  padding: 6px 8px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.7rem;
  color: #1f2937;
}
.dmo-m-alert {
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.66rem;
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
  font-weight: 600;
}
.dmo-m-alert.ok { background: rgba(34, 197, 94, 0.14); color: #15803d; }
.dmo-m-chart { width: 100%; height: 36px; margin: 4px 0; }

/* ---------- CTA banner (démo) ---------- */
.demo-cta-banner {
  margin: 0;
  padding: 56px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
  color: #fff;
}
.demo-cta-banner h2 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.demo-cta-banner p {
  margin: 0;
  opacity: 0.92;
  font-size: 1.02rem;
}
.demo-cta-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.demo-cta-warm {
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-dark));
}
.demo-cta-cool {
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
}

/* ---------- Responsive démo ---------- */
@media (max-width: 1024px) {
  .scrolly-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .scrolly-scenes {
    padding: 0;
    gap: 48px;
  }
  .scrolly-sticky {
    position: relative;
    top: auto;
    height: auto;
    margin-bottom: 24px;
    order: -1;
  }
  .dmo-pc-screen { height: 320px; }
  .proche-screen { height: 360px; }
  .dmo-mobile-float {
    right: -10px;
    bottom: -24px;
    width: 120px;
  }
}
@media (max-width: 720px) {
  .demo-choice-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .demo-pick-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .demo-pick-hero { padding: 40px 18px 60px; }
  .demo-pick-card { padding: 28px 22px 26px; }
  .demo-pick-card-title { font-size: 1.4rem; }
  .demo-pick-laptop { width: 280px; }
  .demo-pick-tablet { width: 180px; }
  .demo-choice-card { padding: 30px 24px; }
  .demo-choice-bullets { grid-template-columns: 1fr; }
  .demo-choice-hero { padding: 48px 18px 80px; }
  .demo-hero { padding: 40px 18px 48px; }
  .scrolly-section { padding: 24px 18px 80px; }
  .dmo-tablet { width: 100%; max-width: 360px; }
  .dmo-pc-screen { grid-template-columns: 110px 1fr; height: 280px; }
  .dmo-pc-side { padding: 10px 8px; }
  .dmo-pc-side li { font-size: 0.74rem; padding: 6px 8px; }
  .dmo-pc-main { padding: 12px; gap: 8px; }
  .dmo-pc-kpis { gap: 6px; }
  .dmo-pc-reports { grid-template-columns: 1fr; }
  .proche-screen { height: 340px; padding: 10px 12px; }
  .proche-hero-row { grid-template-columns: 1fr; }
  .proche-cols-3 { grid-template-columns: 1fr; overflow-y: auto; }
  .dmo-mobile-float {
    width: 90px;
    right: -4px;
    bottom: -14px;
  }
}

/* =========================================================================
   === Login admin (style LinkedIn) — KAN-39 ===
   Page /connexion : email + mot de passe (avec œil), mot de passe oublié,
   bouton Se connecter, séparateur "ou", bouton Continuer avec Google.
   Réutilisé par /mot-de-passe-oublie et /reset-password (KAN-42).
   ========================================================================= */

body.auth-page {
  margin: 0;
  min-height: 100vh;
  background: var(--gradient-soft);
  color: var(--c-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--font-size-base);
  display: flex;
  flex-direction: column;
}

.auth-logo {
  display: inline-block;
  margin: 28px 0 0 40px;
  align-self: flex-start;
}
.auth-logo img {
  display: block;
  height: 56px;
  width: auto;
}
@media (max-width: 480px) {
  .auth-logo {
    margin: 18px 0 0 20px;
  }
  .auth-logo img {
    height: 40px;
  }
}

.auth-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 48px;
  gap: 24px;
}

.auth-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 40px 32px;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
}

.auth-card__icon {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
.auth-card__icon svg {
  display: block;
}

.auth-card__title {
  margin: 0 0 6px 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1.2;
}

.auth-card__subtitle {
  margin: 0 0 24px 0;
  font-size: 15px;
  color: var(--c-muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.auth-field {
  display: flex;
  flex-direction: column;
}

.auth-field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 6px;
}

.auth-field__group {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-field__input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}
.auth-field__input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.auth-field__input::placeholder {
  color: var(--c-muted);
  opacity: 0.7;
}

.auth-field__input--with-toggle {
  padding-right: 44px;
}

/* Toggle œil — positionné dans le champ mot de passe, sans aucun effet
   visuel. On force l'annulation des styles globaux `button` du site-vitrine
   (gradient, ombre, min-height, hover lift) avec !important pour qu'aucune
   règle globale ne reprenne le dessus. */
button.auth-field__toggle,
button.auth-field__toggle:hover,
button.auth-field__toggle:focus,
button.auth-field__toggle:focus-visible,
button.auth-field__toggle:active {
  position: absolute !important;
  right: 10px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  background: transparent !important;
  background-size: auto !important;
  background-position: 0 0 !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  height: 28px !important;
  width: 28px !important;
  border-radius: 0 !important;
  cursor: pointer !important;
  color: var(--c-muted) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: none !important;
  outline: none !important;
  line-height: 0 !important;
  font-size: inherit !important;
  font-weight: normal !important;
  transition: none !important;
}

.auth-field__icon--hide {
  display: none;
}
.auth-field__toggle--shown .auth-field__icon--show {
  display: none;
}
.auth-field__toggle--shown .auth-field__icon--hide {
  display: inline;
}

.auth-field__hint {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-primary);
  text-decoration: none;
  align-self: flex-start;
}
.auth-field__hint:hover {
  text-decoration: underline;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}
.auth-btn:active {
  transform: translateY(1px);
}

.auth-btn--primary {
  background: var(--c-primary);
  color: #fff;
  margin-top: 4px;
  border-color: var(--c-primary);
}
.auth-btn--primary:hover {
  background: var(--c-primary-dark);
  border-color: var(--c-primary-dark);
}
.auth-btn--primary:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.auth-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  color: var(--c-muted);
  font-size: 13px;
}
.auth-separator::before,
.auth-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--c-border);
}

.auth-btn--google {
  background: var(--c-surface);
  color: var(--c-text);
  border-color: var(--c-border);
}
.auth-btn--google:hover {
  background: var(--c-tint-cool);
  border-color: var(--c-tint-cool-3);
}
.auth-btn--google:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}
.auth-btn__google-icon,
.auth-btn__login-icon {
  flex-shrink: 0;
}
/* En état "busy", l'icône login disparaît pour laisser place au spinner. */
.auth-btn--busy .auth-btn__login-icon { display: none; }

.auth-footer-link {
  margin: 0;
  font-size: 15px;
  color: var(--c-text);
  text-align: center;
}
.auth-footer-link a {
  color: var(--c-primary);
  font-weight: 600;
  text-decoration: none;
}
.auth-footer-link a:hover {
  text-decoration: underline;
}

/* Responsive : sur mobile, le cadre passe pleine largeur (avec padding latéral). */
@media (max-width: 480px) {
  .auth-shell {
    padding: 16px 12px 32px;
    justify-content: flex-start;
  }
  .auth-card {
    padding: 28px 20px 24px;
    max-width: 100%;
    border-radius: var(--radius-sm);
  }
  .auth-card__icon img {
    width: 60px;
    height: 60px;
  }
  .auth-card__title {
    font-size: 24px;
  }
}

/* Alerte (erreurs serveur, message d'info Google). */
.auth-alert {
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--c-error-bg);
  color: var(--c-danger);
  font-size: 14px;
  line-height: 1.4;
  border: 1px solid rgba(220, 38, 38, 0.25);
  text-align: left;
}

/* État "busy" du bouton primaire pendant un appel réseau — KAN-40. */
.auth-btn__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}
.auth-btn--busy .auth-btn__spinner { display: inline-block; }
.auth-btn--busy .auth-btn__label    { opacity: 0.7; }
.auth-btn:disabled                  { cursor: not-allowed; opacity: 0.8; }
@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

/* Bouton-lien (← Utiliser un autre compte) — section 2FA. */
.auth-link-btn {
  background: transparent;
  border: 0;
  color: var(--c-primary);
  font: 600 14px/1.4 inherit;
  cursor: pointer;
  padding: 8px 4px;
  align-self: center;
  margin-top: 4px;
}
.auth-link-btn:hover { text-decoration: underline; }
.auth-link-btn:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Mode sombre — les variables existantes prennent déjà en charge la plupart
   des couleurs. On ajuste juste le focus ring qui utilise la couleur claire. */
[data-theme="dark"] .auth-field__input:focus {
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25);
}
[data-theme="dark"] .auth-btn--google {
  background: var(--c-tint-cool);
}
[data-theme="dark"] .auth-btn--google:hover {
  background: var(--c-tint-cool-2);
}
[data-theme="dark"] .auth-alert {
  border-color: rgba(248, 113, 113, 0.35);
}

/* =========================================================================
   === Admin shell — KAN-46 ===
   Coquille des pages admin/master/premium portées en HTML statique :
   sidebar fixée 240px à gauche (drawer < 1024px), topbar simple en mobile,
   contenu principal avec gutters. Composants partagés (badges, cards,
   tables, paginateur) sont reposés ici aussi.
   ========================================================================= */

body.admin-page {
  margin: 0;
  min-height: 100vh;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

/* ----- Sidebar ----- */
.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  background: var(--gradient-brand);
  color: #fff;
  padding: 24px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 40;
  box-shadow: 0 0 24px rgba(15, 23, 42, 0.18);
  overflow-y: auto;
}

.admin-sidebar__brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  padding: 6px 8px;
  border-radius: 12px;
}
.admin-sidebar__brand-link img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  padding: 2px;
}
.admin-sidebar__brand-link span {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.admin-sidebar__nav {
  flex: 1;
}
.admin-sidebar__nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease;
}
.admin-sidebar__link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.admin-sidebar__link.is-active {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-weight: 600;
}
.admin-sidebar__link-icon,
.admin-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}
.admin-sidebar__link-label {
  flex: 1;
}

.admin-sidebar__footer {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-sidebar__user-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 4px;
  word-break: break-word;
}
.admin-sidebar__logout {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 10px !important;
  padding: 8px 12px !important;
  color: #fff !important;
  font-weight: 500 !important;
  font-size: 14px !important;
  min-height: 0 !important;
  box-shadow: none !important;
  cursor: pointer !important;
  transition: background 0.12s ease !important;
}
.admin-sidebar__logout:hover {
  background: rgba(255, 255, 255, 0.22) !important;
  transform: none !important;
}

/* ----- Topbar (mobile + comme bouton menu seulement sur desktop) ----- */
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}
.admin-topbar__menu {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border: 0 !important;
  padding: 6px !important;
  margin: 0 !important;
  min-height: 0 !important;
  width: 36px;
  height: 36px;
  color: var(--c-text) !important;
  cursor: pointer !important;
  box-shadow: none !important;
  border-radius: 8px !important;
}
.admin-topbar__menu:hover {
  background: var(--c-tint-cool-2) !important;
  transform: none !important;
}
.admin-topbar__logo img {
  height: 28px;
  width: auto;
  display: block;
}
.admin-topbar__role {
  margin-left: auto;
}

/* ----- Contenu principal ----- */
[data-admin-content] {
  margin-left: 248px;
  padding: 28px 32px 40px;
  min-height: 100vh;
}

/* ----- Badges de rôle (réutilisables) ----- */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  line-height: 1.6;
  letter-spacing: 0.2px;
}
.role-badge--standard {
  background: var(--c-primary-light);
  color: var(--c-primary-dark);
}
.role-badge--premium {
  background: linear-gradient(135deg, #fde68a 0%, #f59e0b 100%);
  color: #78350f;
}
.role-badge--master {
  background: linear-gradient(135deg, #fef3c7 0%, #d97706 100%);
  color: #7c2d12;
}

/* ----- Cards admin réutilisables ----- */
.admin-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}
.admin-card + .admin-card { margin-top: 20px; }

.admin-page-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: var(--c-text);
}
.admin-page-subtitle {
  margin: 0 0 24px 0;
  color: var(--c-muted);
  font-size: 15px;
}

/* ----- Boutons admin (utilisés dans le contenu) ----- */
.admin-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 10px 18px !important;
  border-radius: 999px !important;
  border: 1px solid var(--c-border) !important;
  background: var(--c-surface) !important;
  color: var(--c-text) !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  min-height: 0 !important;
  box-shadow: none !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: background 0.12s ease, border-color 0.12s ease !important;
}
.admin-btn:hover { background: var(--c-tint-cool) !important; transform: none !important; }
.admin-btn--primary {
  background: var(--c-primary) !important;
  border-color: var(--c-primary) !important;
  color: #fff !important;
}
.admin-btn--primary:hover { background: var(--c-primary-dark) !important; border-color: var(--c-primary-dark) !important; }

/* ----- Recherche (input texte) ----- */
.admin-search {
  margin-bottom: 16px;
}
.admin-search input[type="search"] {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  outline: none;
  box-sizing: border-box;
}
.admin-search input[type="search"]:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ----- Liste de patients (cards) ----- */
.admin-patients {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.patient-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--c-tint-cool);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s ease, transform 0.05s ease, box-shadow 0.12s ease;
}
.patient-card:hover {
  border-color: var(--c-primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}
.patient-card__avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
}
.patient-card__info {
  flex: 1;
  min-width: 0;
}
.patient-card__name {
  font-weight: 600;
  font-size: 15px;
  color: var(--c-text);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.patient-card__meta {
  font-size: 12px;
  color: var(--c-muted);
  line-height: 1.4;
}
.patient-card__chevron {
  color: var(--c-muted);
  font-size: 22px;
  font-weight: 300;
}
.admin-empty {
  color: var(--c-muted);
  font-style: italic;
  margin: 0;
  padding: 20px;
  text-align: center;
}
.admin-error {
  color: var(--c-danger);
  margin: 0;
  padding: 16px;
  text-align: center;
  background: var(--c-error-bg);
  border-radius: var(--radius-sm);
}

/* ----- Responsive : sidebar en drawer < 1024px ----- */
@media (max-width: 1023px) {
  .admin-topbar { display: flex; }
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .admin-sidebar.is-open {
    transform: translateX(0);
  }
  [data-admin-content] {
    margin-left: 0;
    padding: 20px 16px 32px;
  }
}

/* ----- Mode sombre : la sidebar utilise déjà le gradient brand, on adoucit
   les overlays pour ne pas être agressif sur fond noir. ----- */
[data-theme="dark"] body.admin-page { background: var(--c-bg); }
[data-theme="dark"] .admin-card {
  border-color: rgba(148, 163, 184, 0.18);
}
[data-theme="dark"] .admin-topbar {
  background: var(--c-surface);
  border-bottom-color: var(--c-border);
}

