/* ── SantéFem Patiente — Mobile-First PWA ── */
:root {
  --rose: #b5446e;
  --rose-dark: #8c2f52;
  --rose-light: #f5dce6;
  --rose-pale: #fdf0f4;
  --teal: #1a7f6e;
  --teal-light: #e0f4f0;
  --amber: #d97706;
  --amber-light: #fef3c7;
  --ink: #1a1118;
  --ink-soft: #4a3d45;
  --ink-muted: #8c7a84;
  --line: #e8dde2;
  --surface: #fdf6f9;
  --white: #ffffff;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --success: #059669;
  --success-light: #ecfdf5;
  --nav-h: 64px;
  --header-h: 56px;
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}
#root { min-height: 100vh; display: flex; flex-direction: column; }

/* ── HEADER ── */
.app-header {
  background: var(--rose);
  height: var(--header-h);
  display: flex; align-items: center;
  padding: 0 18px;
  gap: 12px;
  position: sticky; top: 0; z-index: 100;
}
.header-back {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: none; color: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.header-title {
  font-family: var(--font-display);
  color: white; font-size: 17px; font-weight: 600;
  flex: 1;
}
.header-action {
  background: rgba(255,255,255,0.2);
  border: none; color: white; cursor: pointer;
  padding: 6px 12px; border-radius: 20px;
  font-size: 13px; font-weight: 500;
  font-family: var(--font-body);
}

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--white);
  border-top: 1px solid var(--line);
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex; align-items: center;
  z-index: 100;
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  padding: 8px 4px;
  border: none; background: none; cursor: pointer;
  color: var(--ink-muted);
  transition: color 0.15s;
}
.nav-btn.active { color: var(--rose); }
.nav-btn .nav-ico { font-size: 22px; line-height: 1; }
.nav-btn .nav-lbl { font-size: 10px; font-weight: 500; letter-spacing: 0.02em; }

/* ── PAGE ── */
.page {
  flex: 1;
  padding: 16px;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  overflow-y: auto;
}
.page-full { padding: 0; padding-bottom: calc(var(--nav-h) + var(--safe-bottom)); }

/* ── HERO CARD ── */
.hero {
  background: linear-gradient(135deg, var(--rose) 0%, var(--rose-dark) 100%);
  border-radius: var(--radius);
  padding: 20px;
  color: white;
  margin-bottom: 16px;
}
.hero-greeting { font-size: 13px; opacity: 0.85; margin-bottom: 2px; }
.hero-name { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.hero-sub { font-size: 12px; opacity: 0.8; margin-top: 4px; }
.hero-chips { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.hero-chip {
  background: rgba(255,255,255,0.2);
  border-radius: 20px; padding: 4px 12px;
  font-size: 12px; font-weight: 500;
}

/* ── ACTION GRID ── */
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.action-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.action-card:active { transform: scale(0.97); }
.action-card.wide { grid-column: 1/-1; }
.action-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.action-title { font-size: 13px; font-weight: 500; color: var(--ink); margin-bottom: 2px; }
.action-desc { font-size: 11px; color: var(--ink-muted); line-height: 1.4; }
.action-card.rose { border-color: var(--rose-light); background: var(--rose-pale); }
.action-card.teal { border-color: #b3e4da; background: var(--teal-light); }
.action-card.amber { border-color: #fcd34d; background: var(--amber-light); }

/* ── SECTION ── */
.section { margin-bottom: 20px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.section-title { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--ink); }
.section-link { font-size: 12px; color: var(--rose); font-weight: 500; background: none; border: none; cursor: pointer; }

/* ── CARDS ── */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.card + .card { margin-top: 10px; }

/* ── FILE D'ATTENTE ── */
.queue-big {
  background: var(--rose);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  color: white;
  margin-bottom: 14px;
}
.queue-label { font-size: 13px; opacity: 0.85; margin-bottom: 6px; }
.queue-number {
  font-family: var(--font-display);
  font-size: 80px; font-weight: 600; line-height: 1;
  margin-bottom: 6px;
}
.queue-sub { font-size: 14px; opacity: 0.85; }
.wait-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 10px;
}
.wait-time {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 600;
  color: var(--amber); line-height: 1;
}
.wait-unit { font-size: 14px; font-weight: 400; }

/* ── RDV ── */
.rdv-slot {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.rdv-slot:last-child { border-bottom: none; }
.rdv-time {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 600;
  color: var(--rose); min-width: 44px;
}
.rdv-info { flex: 1; }
.rdv-doc { font-size: 13px; font-weight: 500; }
.rdv-motif { font-size: 11px; color: var(--ink-muted); margin-top: 1px; }

/* ── DOSSIER ── */
.dossier-section { margin-bottom: 16px; }
.dossier-sec-title {
  font-size: 11px; font-weight: 500;
  color: var(--ink-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 8px; padding: 0 4px;
}
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.info-row:last-child { border-bottom: none; }
.info-label { font-size: 13px; color: var(--ink-muted); }
.info-value { font-size: 13px; font-weight: 500; color: var(--ink); text-align: right; max-width: 60%; }
.info-arrow { color: var(--ink-muted); font-size: 16px; margin-left: 8px; }

/* ── CHAT ── */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - var(--header-h) - var(--nav-h) - 32px); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.bubble-row { display: flex; gap: 8px; max-width: 85%; }
.bubble-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px; line-height: 1.5;
}
.bubble-row.bot .bubble { background: var(--white); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble-row.mine .bubble { background: var(--rose); color: white; border-bottom-right-radius: 4px; }
.bot-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--rose-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0; margin-top: 2px;
}
.chat-input-bar {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--white);
  display: flex; gap: 8px; align-items: center;
}
.chat-input {
  flex: 1; padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  font-family: var(--font-body);
  font-size: 14px; color: var(--ink);
  background: var(--surface);
  outline: none;
}
.chat-input:focus { border-color: var(--rose); }
.send-btn {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--rose); border: none;
  color: white; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.quick-chips { display: flex; gap: 7px; padding: 8px 14px; overflow-x: auto; border-top: 1px solid var(--line); }
.quick-chips::-webkit-scrollbar { display: none; }
.qchip {
  white-space: nowrap; padding: 6px 13px;
  border: 1px solid var(--rose-light);
  border-radius: 20px; background: var(--rose-pale);
  color: var(--rose); font-size: 12px; font-weight: 500;
  cursor: pointer; font-family: var(--font-body);
  flex-shrink: 0;
}

/* ── FORM ── */
.form-group { margin-bottom: 14px; }
.form-label { font-size: 12px; font-weight: 500; color: var(--ink-soft); margin-bottom: 5px; display: block; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 15px; color: var(--ink);
  background: var(--white); outline: none;
  transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus { border-color: var(--rose); }
.form-textarea { resize: none; min-height: 90px; }

/* ── BUTTONS ── */
.btn-full {
  width: 100%; padding: 14px;
  background: var(--rose); color: white;
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 16px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
  letter-spacing: 0.01em;
}
.btn-full:active { background: var(--rose-dark); }
.btn-full.ghost {
  background: transparent; color: var(--rose);
  border: 1.5px solid var(--rose-light);
}
.btn-full.teal { background: var(--teal); }

/* ── TAGS ── */
.tag {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 500;
}
.tag-rose { background: var(--rose-light); color: var(--rose-dark); }
.tag-teal { background: var(--teal-light); color: var(--teal); }
.tag-amber { background: var(--amber-light); color: var(--amber); }
.tag-success { background: var(--success-light); color: var(--success); }
.tag-danger { background: var(--danger-light); color: var(--danger); }

/* ── ALERTS ── */
.alert {
  padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.5; margin-bottom: 12px;
  display: flex; gap: 10px; align-items: flex-start;
}
.alert-warning { background: var(--amber-light); color: #92400e; border: 1px solid #fcd34d; }
.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #6ee7b7; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-danger { background: var(--danger-light); color: var(--danger); border: 1px solid #fca5a5; }

/* ── MISC ── */
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.stat-mini {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px;
  flex: 1; min-width: 0;
}
.stat-mini-val { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--rose); }
.stat-mini-lbl { font-size: 11px; color: var(--ink-muted); margin-top: 1px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--rose-light); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 600; color: var(--rose); font-family: var(--font-display); flex-shrink: 0; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); display: inline-block; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:0.5} }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-muted); display: inline-block; animation: bounce 1.2s infinite; margin: 0 2px; }
.typing span:nth-child(2){animation-delay:.2s}.typing span:nth-child(3){animation-delay:.4s}
@keyframes bounce{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-5px)}}
.fade-in { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)} }
.urgency-banner {
  background: var(--danger); color: white;
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}

/* ── GROSSESSE TRACKER ── */
.preg-circle {
  width: 120px; height: 120px; border-radius: 50%;
  border: 6px solid var(--rose-light);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  margin: 0 auto 16px;
  background: var(--rose-pale);
}
.preg-sa { font-family: var(--font-display); font-size: 36px; font-weight: 600; color: var(--rose); line-height: 1; }
.preg-sa-lbl { font-size: 12px; color: var(--ink-muted); }

/* ── Accessibilité : titres, cibles tactiles ≥ 44 px (v0.11.2) ── */
.header-title { margin: 0; }
.header-action { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
.section-link { min-height: 44px; padding: 0 4px; }
.qchip { min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; }
.send-btn { width: 44px; height: 44px; }
.chat-input { min-height: 44px; }
.pied-droits { padding: 18px 18px 96px; text-align: center; font-size: 10px; line-height: 1.5; color: var(--ink-muted); }
.pied-droits div + div { margin-top: 4px; }
main:focus { outline: none; }

/* ── Connexion patiente : même identité que celle du cabinet (v0.11.2) ── */
.plogin { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: #fff; }
.plogin-hero { position: relative; overflow: hidden; padding: 28px 24px 0; min-height: 270px; background: radial-gradient(ellipse 70% 60% at 80% 85%, #fff3f4 0%, rgba(255,243,244,0) 70%), linear-gradient(160deg, #fbe9ec 0%, #f6d9e0 100%); }
.plogin-marque { font-family: var(--font-display); font-size: 24px; font-weight: 500; color: #5c1238; }
.plogin-titre { font-family: var(--font-display); font-weight: 500; font-size: clamp(26px, 7vw, 40px); line-height: 1.1; color: #5c1238; margin: 22px 0 10px; max-width: 60%; position: relative; z-index: 2; }
.plogin-texte { font-size: 13.5px; line-height: 1.5; color: #5e4a54; max-width: 52%; margin: 0 0 22px; position: relative; z-index: 2; }
.plogin-photo { position: absolute; right: 0; bottom: 0; width: min(52%, 300px); height: auto; z-index: 1; -webkit-mask-image: linear-gradient(to right, transparent 0, #000 30%), linear-gradient(to bottom, transparent 0, #000 22%); -webkit-mask-composite: source-in; mask-image: linear-gradient(to right, transparent 0, #000 30%), linear-gradient(to bottom, transparent 0, #000 22%); mask-composite: intersect; }
.plogin-carte { position: relative; z-index: 3; flex: 1; background: #fff; border-radius: 26px 26px 0 0; margin-top: -22px; padding: 28px 24px 20px; }
.plogin-h2 { font-family: var(--font-display); font-size: 28px; font-weight: 500; color: #4a0f2e; margin: 0 0 4px; }
.plogin-sous { font-size: 14px; color: #6a5a62; margin: 0 0 20px; }
.plogin-erreur { font-size: 13px; color: #b91c1c; margin-bottom: 10px; }
.plogin-aide { text-align: center; margin: 14px 0 0; font-size: 12px; color: var(--ink-muted); }
.plogin-demo { margin-top: 16px; padding: 10px 12px; border-radius: 10px; background: #fbeff1; font-size: 12px; line-height: 1.5; }
.plogin .btn-full { min-height: 52px; background: #8a2a55; border-radius: 10px; box-shadow: 0 6px 16px rgba(138,42,85,0.25); }
.plogin .btn-full.ghost { background: transparent; color: #8a2a55; border: 1.5px solid #e3c3cf; box-shadow: none; }
.plogin .form-input { min-height: 50px; border-radius: 10px; }
.plogin-pied { padding: 12px 20px; background: #fbf3f5; border-top: 1px solid #f0dde2; text-align: center; font-size: 10px; line-height: 1.5; color: var(--ink-muted); }
.plogin-pied div + div { margin-top: 3px; }
@media (min-width: 860px) {
  .plogin { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); grid-template-rows: 1fr auto; }
  .plogin-hero { grid-row: 1; padding: 56px 56px 0; min-height: 0; }
  .plogin-titre { max-width: 340px; margin-top: 40px; }
  .plogin-texte { max-width: 300px; font-size: 15px; }
  .plogin-photo { width: min(64%, 480px); }
  .plogin-carte { grid-row: 1; border-radius: 0; margin: 0; padding: 64px clamp(32px, 6vw, 88px) 24px; max-width: 640px; width: 100%; justify-self: center; align-self: center; flex: none; }
  .plogin-pied { grid-column: 1 / -1; }
}
body:has(.plogin) { max-width: none; }

/* Bandeau de démonstration (v0.12) */
.bandeau-demo { background: #fff4d6; color: #6b4e00; border-bottom: 1px solid #f0dc9a; font-size: 12px; line-height: 1.4; padding: 6px 12px; text-align: center; }

/* ── Accueil patiente adaptatif (v0.12) — barre latérale PC, onglets du bas tablette/téléphone ── */
/* Le portail authentifié occupe toute la largeur disponible. */
body:has(.patient-layout) {
  max-width: none;
  background: #fbf6f0;
}
.patient-layout {
  --plum: #65143e;
  --deep-plum: #4b0d33;
  --coral: #ad3b36;
  --rose: var(--plum);
  --rose-dark: var(--deep-plum);
  --rose-light: #f7dedb;
  --rose-pale: #fff0eb;
  --ink-muted: #62555d;
  --line: #e8dedb;
  display: grid;
  grid-template-columns: clamp(172px, 18vw, 245px) minmax(0, 1fr);
  min-height: 100dvh;
}
.patient-main { min-width: 0; padding: clamp(16px, 3vw, 44px); }
.patient-main > .page { padding: 16px 0; overflow: visible; }
.patient-main > .app-header { border-radius: 14px; position: static; }
.patient-main > .patient-home { padding: 0; }
.patient-layout :focus-visible { outline: 3px solid #b56528; outline-offset: 3px; }
.patient-navigation {
  background: var(--deep-plum);
  color: white;
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.patient-brand { font: 700 clamp(23px, 3vw, 34px) var(--font-display); margin: 0 10px 32px; }
.patient-links { display: grid; gap: 6px; }
.patient-layout .nav-btn {
  color: inherit;
  font: inherit;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px;
  border-radius: 12px;
  text-align: left;
}
.patient-layout .nav-btn.active { background: #a73850; color: white; }
.patient-icon { width: 24px; height: 24px; flex: none; }
.patient-greeting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: clamp(18px, 3.4vw, 44px);
  color: white;
  border-radius: 22px;
  background: repeating-radial-gradient(circle at 105% 112%, transparent 0 31px, #ffffff16 32px 33px),
              linear-gradient(115deg, #561137, #831d4a);
}
.patient-greeting h1 { font: 700 clamp(25px, 4vw, 50px)/1.1 var(--font-display); overflow-wrap: anywhere; }
.patient-greeting p { margin-top: 8px; }
.patient-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.patient-chip { background: #ffffff24; padding: 6px 12px; border-radius: 30px; font-weight: 600; font-size: .9rem; }
.patient-bell {
  position: relative;
  display: grid;
  place-items: center;
  background: #ffffff24;
  color: white;
  border: 0;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
}
.patient-bell span { position: absolute; top: -5px; right: -4px; background: #a8332d; border: 1px solid white; color: white; border-radius: 20px; padding: 0 5px; font-weight: 700; }
.patient-cards { display: grid; grid-template-columns: minmax(0, 1.14fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.patient-tile { background: white; border: 1px solid var(--line); border-radius: 18px; padding: clamp(14px, 2vw, 25px); box-shadow: 0 4px 12px #4b0d330b; overflow-wrap: anywhere; }
.patient-tile h2, .patient-followup h2 { font: 700 clamp(19px, 2.2vw, 28px)/1.2 var(--font-display); color: var(--deep-plum); }
.patient-tile h2 { display: flex; align-items: center; gap: 8px; }
.patient-tile h3 { font: 700 1.1rem var(--font-display); color: var(--deep-plum); }
.patient-tile p { margin-top: 5px; color: #4e4549; }
.patient-queue { background: #e9f5ed; border-color: #c9e4d1; }
.patient-status { display: inline-block; color: #174f34; background: #d8f0e2; border-radius: 20px; padding: 4px 10px; font-weight: 700; margin-top: 8px; }
.patient-date, .patient-position { padding: 9px 12px; text-align: center; border-radius: 12px; background: #fcebe7; color: #681538; }
.patient-stat { display: block; color: var(--coral); font: 700 clamp(23px, 3vw, 38px)/1.1 var(--font-display); }
.patient-queue .patient-time { color: #17593a; }
.patient-card-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; margin-top: 14px; }
.patient-action { font: inherit; font-weight: 700; padding: 8px 0; min-height: 44px; color: var(--plum); border: 0; background: none; text-align: left; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.patient-followup { margin-top: 24px; }
.patient-note { background: #fff4e0; }
.patient-footer { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin-top: 18px; color: var(--ink-muted); font-size: .9rem; }
.patient-layout .chat-wrap { height: clamp(360px, 65dvh, 850px); }
@media (max-width: 900px) {
  .patient-layout { display: block; padding-bottom: calc(76px + var(--safe-bottom)); }
  .patient-navigation { position: fixed; z-index: 100; inset: auto 0 0; height: auto; padding: 5px 3px calc(5px + var(--safe-bottom)); background: white; color: var(--deep-plum); border-top: 1px solid var(--line); }
  .patient-brand { display: none; }
  .patient-links { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; }
  .patient-layout .nav-btn { flex-direction: column; justify-content: center; gap: 3px; padding: 5px 1px; font-size: clamp(9px, 2.45vw, 13px); text-align: center; white-space: nowrap; }
  .patient-layout .nav-btn.active { background: #fcebe7; color: #801f39; }
}
@media (max-width: 620px) {
  .patient-main { padding: 12px; }
  .patient-cards { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .patient-greeting { gap: 6px; }
}
@media print {
  .patient-layout { display: block; padding: 0; }
  .patient-navigation { display: none; }
}

/* Compléments SantéFem */
.patient-cards-auto { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.patient-alertes { display: grid; gap: 8px; margin-top: 12px; }
.patient-alertes .alert { margin: 0; }
.patient-followup h2 { margin-bottom: 0; }
.patient-main > .bandeau-demo { border-radius: 10px; border: 1px solid #f0dc9a; margin-bottom: 12px; }
.patient-main > .page-full { padding: 0; }
.patient-footer small { flex: 1 1 320px; font-size: 10px; line-height: 1.5; }
.patient-logout { flex: none; padding-inline: 4px; }
.patient-greeting { overflow-wrap: anywhere; }

/* Facture PDF et « Comment payer » */
.doc-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(26,17,24,.55); overflow-y: auto; padding: 16px; }
.doc-wrap { width: 100%; max-width: 760px; margin: 0 auto; }
.doc-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 12px 12px 0 0; padding: 10px 14px; }
.doc-btn { text-decoration: none; text-align: center; font-weight: 500; min-height: 44px; min-width: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; font-size: 13px; }
.doc-btn-primary { background: var(--rose); color: #fff; border-color: var(--rose); }
.doc-sheet { background: #fff; color: #1a1118; padding: 32px 36px; border: 1px solid var(--line); border-top: none; font-size: 13px; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 2px solid var(--rose); padding-bottom: 14px; margin-bottom: 18px; }
.doc-clinic { font-family: var(--font-display); font-size: 22px; color: var(--rose); }
.doc-title { font-family: var(--font-display); font-size: 22px; letter-spacing: 2px; }
.doc-num { font-family: monospace; font-size: 12px; color: var(--ink-muted); }
.doc-sub { font-size: 12px; color: var(--ink-muted); }
.doc-label { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-muted); }
.doc-meta { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.doc-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.doc-table th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-muted); border-bottom: 1px solid var(--line); padding: 8px 6px; }
.doc-table td { padding: 9px 6px; border-bottom: 1px solid var(--line); }
.doc-table tfoot td { border-bottom: none; padding-top: 14px; }
.doc-foot { border-top: 1px solid var(--line); padding-top: 12px; }
.doc-mention { margin-top: 24px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 9px; line-height: 1.5; color: var(--ink-muted); }
.pay-bloc { margin-top: 10px; padding: 12px 14px; border: 1px dashed var(--teal); border-radius: 10px; background: var(--teal-light); font-size: 13px; }
.pay-titre { font-weight: 600; margin-bottom: 6px; }
.pay-liste { margin: 0 0 8px; padding-left: 18px; line-height: 1.6; }
.pay-num { font-family: monospace; font-weight: 600; white-space: nowrap; }
.pay-ref { font-size: 12px; color: var(--ink-muted); }
@media (max-width: 600px) { .doc-sheet { padding: 20px 16px; } .doc-head, .doc-meta { flex-direction: column; } .doc-head > div:last-child, .doc-meta > div:last-child { text-align: left !important; } .doc-overlay { padding: 8px; } }
@media print {
  body.printing-doc > #root { display: none !important; }
  body.printing-doc .doc-overlay { position: static; background: none; padding: 0; overflow: visible; }
  body.printing-doc .doc-toolbar { display: none; }
  body.printing-doc .doc-sheet { border: none; padding: 0; }
  @page { size: A4; margin: 16mm; }
}

/* Vaccins et rappels de mon bébé — même langage visuel que l'accueil ; PC : deux colonnes, tablette : cartes en grille, téléphone : une colonne */
.vac-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.vac-principal { display: grid; gap: 16px; min-width: 0; }
.vac-cote { display: grid; gap: 16px; min-width: 0; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
@media (min-width: 1100px) {
  .vac-layout { grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; }
  .vac-cote { grid-template-columns: minmax(0, 1fr); position: sticky; top: 16px; }
}
.vac-liste { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.vac-carte { display: flex; flex-direction: column; gap: 12px; }
.vac-carte-tete { display: flex; align-items: center; gap: 12px; }
.vac-carte-tete h3 { font: 700 clamp(20px, 2vw, 26px)/1.1 var(--font-display); color: var(--deep-plum); margin: 0; }
.vac-carte-tete p { margin: 2px 0 0; }
.vac-avatar { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #fcebe7; color: #681538; font: 700 22px var(--font-display); }
.vac-age { font-size: 13px; color: var(--ink-muted); }
.vac-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); font-weight: 600; }
.vac-rdv { border-radius: 14px; padding: 14px 16px; background: #fcebe7; color: #681538; display: grid; gap: 4px; justify-items: start; }
.vac-rdv-passe { background: #fff4e0; color: #6b4a00; }
.vac-rdv-vide { background: #f6f1ee; color: #4e4549; }
.vac-date { font: 700 clamp(24px, 2.6vw, 32px)/1.1 var(--font-display); color: var(--coral); }
.vac-rdv-passe .vac-date { color: #8a5a00; }
.vac-lieu, .vac-info { font-size: 14px; color: var(--ink-muted); line-height: 1.45; }
.vac-info { margin: 4px 0; }
.vac-ok { color: #174f34; font-weight: 600; }
.vac-note { background: #f6f1ee; border-radius: 12px; padding: 10px 12px; }
.vac-alerte { margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid #f0dc9a; color: #6b4a00; font-size: 14px; font-weight: 600; }
.vac-appel { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 2px solid var(--plum); color: var(--plum); font-weight: 700; text-decoration: none; background: white; }
.vac-appel:hover { background: #fcebe7; }
.vac-form { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.vac-grille-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.vac-large { grid-column: 1 / -1; }
.vac-champ { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--deep-plum); }
.vac-champ .form-input { width: 100%; min-height: 46px; box-sizing: border-box; font-weight: 400; }
.vac-bouton { min-height: 48px; padding: 0 22px; border-radius: 12px; border: 0; background: var(--plum); color: white; font: 700 15px var(--font-body, inherit); cursor: pointer; justify-self: start; }
.vac-bouton:hover:not(:disabled) { background: var(--deep-plum); }
.vac-bouton:disabled { opacity: .45; cursor: not-allowed; }
.vac-hist { font-size: 14px; } .vac-hist summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--deep-plum); }
.vac-rappels, .vac-ajout { display: grid; gap: 12px; }
.vac-rappels h2, .vac-ajout h2, .vac-calendrier h2 { font: 700 clamp(19px, 2vw, 24px)/1.2 var(--font-display); color: var(--deep-plum); margin: 0; }
.vac-ligne-bascule { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; font-weight: 600; cursor: pointer; }
.vac-bascule { position: relative; flex: none; width: 56px; height: 32px; }
.vac-bascule input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
.vac-piste { position: absolute; inset: 0; border-radius: 32px; background: #cbbfc4; transition: background .15s; }
.vac-piste::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: white; box-shadow: 0 1px 3px #0003; transition: transform .15s; }
.vac-bascule input:checked + .vac-piste { background: #2f7d57; }
.vac-bascule input:checked + .vac-piste::after { transform: translateX(24px); }
.vac-bascule input:focus-visible + .vac-piste { outline: 3px solid #b56528; outline-offset: 3px; }
.vac-segment { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.vac-seg { position: relative; display: grid; place-items: center; min-height: 48px; border-radius: 12px; border: 2px solid var(--line); font-weight: 700; color: var(--deep-plum); cursor: pointer; background: white; }
.vac-seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.vac-seg.actif { border-color: var(--plum); background: #fcebe7; }
.vac-seg:focus-within { outline: 3px solid #b56528; outline-offset: 2px; }
.vac-calendrier { display: grid; gap: 12px; }
.vac-ages { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.vac-age-carte { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fbf6f0; }
.vac-age-carte strong { display: block; color: var(--coral); font: 700 16px var(--font-display); margin-bottom: 6px; }
.vac-age-carte ul { margin: 0; padding-left: 18px; font-size: 14px; color: #4e4549; line-height: 1.5; }
@media (max-width: 620px) { .vac-grille-form { grid-template-columns: minmax(0, 1fr); } .vac-bouton { justify-self: stretch; } .vac-appel { width: 100%; box-sizing: border-box; } .vac-ages { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Vaccins : sur téléphone et tablette, l'essentiel d'abord (enfants, rappels, ajout), le calendrier de référence en dernier. */
@media (max-width: 1099px) {
  .vac-layout { display: flex; flex-direction: column; align-items: stretch; }
  .vac-principal, .vac-cote { display: contents; }
  .vac-liste, .vac-principal > p { order: 1; }
  .vac-rappels { order: 2; }
  .vac-ajout { order: 3; }
  .vac-calendrier { order: 4; }
}
