/* =========================================================
   Pages Profil et Annuaire — PharmaX
   ========================================================= */

:root {
  --ui-primary: #007d50;
  --ui-primary-dark: #00663f;
  --ui-primary-soft: #e6f6f0;
  --ui-blue: #1565c0;
  --ui-blue-dark: #0b6fd8;
  --ui-red: #e11d48;
  --ui-line: #e6e9ef;
  --ui-bg: #f6f8f9;
  --ui-text: #0f172a;
  --ui-muted: #556274;
}

.ui-body {
  margin: 0;
  background: var(--ui-bg);
  color: var(--ui-text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.ui-body * { box-sizing: border-box; }
.ui-main { flex: 1; width: 100%; }

/* ---------------- EN-TÊTE DE PROFIL ---------------- */
.profile-hero {
  background: white;
  padding: 32px 20px 24px;
  text-align: center;
}

.profile-avatar {
  position: relative;
  width: 84px;
  height: 84px;
  margin: 0 auto 16px;
}

.profile-avatar .initials {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--ui-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .02em;
}

.profile-avatar .presence {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #34d399;
  border: 3px solid white;
}

.profile-hero h1 { margin: 0; font-size: 22px; font-weight: 700; }
.profile-hero .email { margin: 4px 0 0; font-size: 14px; color: var(--ui-muted); }

.profile-hero .status {
  margin: 8px 0 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ui-primary-dark);
}

.profile-hero .status::before {
  content: "•";
  margin-right: 5px;
  color: #34d399;
}

.ui-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 24px;
  border: 1px solid var(--ui-line);
  background: white;
  color: var(--ui-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}

.ui-btn-outline:hover { background: #f8fafc; }

/* ---------------- ONGLETS DE PROFIL ---------------- */
.profile-tabs {
  display: flex;
  background: white;
  border-top: 1px solid var(--ui-line);
  border-bottom: 1px solid var(--ui-line);
  overflow-x: auto;
  scrollbar-width: none;
}

.profile-tabs::-webkit-scrollbar { display: none; }

.profile-tab {
  flex: 1 0 auto;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 18px;
  border: none;
  background: none;
  color: var(--ui-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  white-space: nowrap;
}

.profile-tab.active { color: var(--ui-primary); border-bottom-color: var(--ui-primary); }

.tab-panel { display: none; padding: 18px 16px 32px; }
.tab-panel.active { display: block; }

/* ---------------- CARTES ---------------- */
.ui-card {
  background: white;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 14px;
}

.ui-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.ui-card-head strong { font-size: 15px; }

.ui-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}

.ui-badge::before { content: "•"; }
.ui-badge.on-duty { background: #ecfdf5; color: var(--ui-primary-dark); border-color: #bbf7d0; }
.ui-badge.off-duty { background: #fef2f2; color: #be123c; border-color: #fecdd3; }

.duty-band {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #f0fdf6;
  border: 1px solid #d3f0e2;
  font-size: 13px;
  color: var(--ui-primary-dark);
}

.duty-band b { color: var(--ui-text); }

/* ---------------- ANNUAIRE ---------------- */
.directory-search {
  background: white;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--ui-line);
}

.search-field { position: relative; }

.search-field i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #556274;
  font-size: 18px;
}

.search-field input {
  width: 100%;
  padding: 13px 16px 13px 44px;
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  background: #f8fafc;
  font-size: 14px;
  outline: none;
  color: var(--ui-text);
  font-family: inherit;
}

.search-field input:focus { border-color: var(--ui-primary); background: white; }

.directory-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--ui-line);
  background: white;
  color: var(--ui-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.filter-chip.active {
  background: var(--ui-primary);
  border-color: var(--ui-primary);
  color: white;
}

.result-count { font-size: 13px; color: var(--ui-muted); }

.pharmacy-list { padding: 16px; }

.pharmacy-item {
  background: white;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 14px;
}

.pharmacy-top { display: flex; align-items: flex-start; gap: 14px; }

.pharmacy-mark {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  background: var(--ui-primary-soft);
  color: var(--ui-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.pharmacy-info { flex: 1; min-width: 0; }
.pharmacy-info strong { display: block; font-size: 15px; }
.pharmacy-info .address { font-size: 13.5px; color: var(--ui-muted); margin-top: 3px; }
.pharmacy-info .phone { font-size: 13.5px; color: #556274; margin-top: 2px; }
.pharmacy-info .added { font-size: 12.5px; color: #556274; margin-top: 4px; }

.pharmacy-actions { display: flex; gap: 12px; margin-top: 14px; align-items: center; }

.ui-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 24px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}

.ui-btn.call { background: var(--ui-primary); color: white; }
.ui-btn.call:hover { background: var(--ui-primary-dark); }
.ui-btn.route { background: var(--ui-blue); color: white; }
.ui-btn.route:hover { background: var(--ui-blue-dark); }

.fav-toggle {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #cbd5e1;
  font-size: 19px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .18s ease;
}

.fav-toggle:hover { background: #fee2e2; color: var(--ui-red); }
.fav-toggle.is-fav { background: #ffe4e6; color: var(--ui-red); }

.ui-btn-link {
  border: 1px solid #fecdd3;
  background: white;
  color: var(--ui-red);
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.ui-btn-link:hover { background: #fef2f2; }

/* ---------------- HISTORIQUE DE RECHERCHE ---------------- */
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.history-head span { font-size: 14px; font-weight: 600; }

.history-table-wrap {
  background: white;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  overflow: hidden;
}

.history-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.history-table th {
  text-align: left;
  padding: 12px 18px;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ui-muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--ui-line);
}

.history-table th:nth-child(2), .history-table td:nth-child(2) { text-align: right; }
.history-table th:last-child, .history-table td:last-child { text-align: right; }

.history-table td { padding: 14px 18px; border-bottom: 1px solid var(--ui-line); }
.history-table tr:last-child td { border-bottom: none; }
.history-table .count { font-weight: 700; color: var(--ui-primary-dark); }
.history-table .count.zero { color: var(--ui-red); }
.history-table .date { color: #556274; font-size: 13px; }

/* ---------------- ÉTAT VIDE ---------------- */
.ui-empty { text-align: center; padding: 48px 20px; color: var(--ui-muted); }

.ui-empty .circle {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--ui-line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #cbd5e1;
}

.ui-empty p { margin: 0 0 16px; font-size: 14px; }

.ui-flash-stack { padding: 14px 16px 0; display: flex; flex-direction: column; gap: 8px; }

.ui-flash {
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  border: 1px solid var(--ui-line);
  background: white;
}

.ui-flash.success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.ui-flash.danger  { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.ui-flash.info    { background: #f0f9ff; border-color: #bae6fd; color: #0369a1; }
.ui-flash.warning { background: #fffbeb; border-color: #fde68a; color: #b45309; }

/* ---------------- ANNUAIRE : cartes modernes (scopé à .dir-grid) ---------------- */
.dir-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

@media (min-width: 720px) {
  .dir-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1100px) {
  .dir-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.dir-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--ui-line);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.dir-card:hover {
  transform: translateY(-2px);
  border-color: #d5dbe5;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
}

.dir-card.is-guard::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(var(--ui-primary), #34d399);
}

.dir-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.dir-avatar {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #047857, #065f46);   /* lettre blanche : 5,5:1 et plus */
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(5, 150, 105, .22);
}

.dir-title { flex: 1; min-width: 0; }

/* Nom de la pharmacie : lien vers sa fiche */
.dir-nom { color: inherit; text-decoration: none; }
.dir-nom:hover { color: var(--ui-primary-dark); text-decoration: underline; text-underline-offset: 3px; }
.dir-nom:focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 2px; border-radius: 4px; }
a.dir-avatar { text-decoration: none; }

.dir-title h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ui-text);
  overflow-wrap: anywhere;
}

.dir-place {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ui-muted);
  line-height: 1.4;
}

.dir-place i { flex: 0 0 auto; margin-top: 1px; font-size: 14px; color: #556274; }

.dir-fav {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  min-width: 38px;
  font-size: 18px;
}

.dir-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.dir-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.dir-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}

.dir-status.guard { background: #ecfdf5; color: var(--ui-primary-dark); }
.dir-status.guard::before {
  background: var(--ui-primary);
  box-shadow: 0 0 0 3px rgba(0, 168, 107, .18);
}

.dir-phone {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
}

.dir-phone:hover { color: var(--ui-primary-dark); }
.dir-phone i { color: #556274; }

.dir-duty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 9px 12px;
  border-radius: 12px;
  background: #f0fdf6;
  color: var(--ui-primary-dark);
  font-size: 12.5px;
  line-height: 1.4;
}

.dir-duty b { color: var(--ui-text); font-weight: 600; }

.dir-actions {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dir-actions .dir-btn:only-child { grid-column: 1 / -1; }

.dir-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  background: #fff;
  color: var(--ui-text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}

.dir-btn:hover { background: #f8fafc; border-color: #cbd5e1; }

.dir-btn.primary {
  background: var(--ui-primary);
  border-color: var(--ui-primary);
  color: #fff;
}

.dir-btn.primary:hover { background: var(--ui-primary-dark); border-color: var(--ui-primary-dark); }

.dir-card a:focus-visible,
.dir-card button:focus-visible {
  outline: 3px solid rgba(0, 168, 107, .35);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .dir-card, .dir-card:hover { transition: none; transform: none; }
}

/* ---------------- RESPONSIVE ---------------- */
@media (min-width: 900px) {
  .tab-panel, .pharmacy-list { max-width: 1180px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
  .directory-search { padding-left: 20px; padding-right: 20px; }
  .directory-search > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
  .ui-flash-stack { max-width: 1180px; margin: 0 auto; }
}

@media (max-width: 640px) {
  .profile-hero { padding: 26px 16px 20px; }
  .profile-avatar { width: 74px; height: 74px; }
  .profile-avatar .initials { font-size: 25px; }
  .profile-hero h1 { font-size: 20px; }

  .ui-card, .pharmacy-item { padding: 16px; }
  .pharmacy-actions { flex-wrap: wrap; }
  .ui-btn { flex: 1 1 40%; padding: 11px 14px; font-size: 13.5px; }
  .search-field input { font-size: 16px; }
  .profile-tab { min-width: 0; flex: 1 1 0; padding: 13px 8px; font-size: 13px; }

  /* Place pour la barre de navigation basse */
  .ui-body { padding-bottom: 64px; }
}

/* ---------------- SÉLECTEUR DE DATE (pharmacies de garde) ---------------- */
.date-picker {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-picker label { font-size: 13px; color: var(--ui-muted); font-weight: 600; }

.date-picker select {
  padding: 8px 14px;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  background: white;
  font-size: 13px;
  font-weight: 600;
  color: var(--ui-text);
  cursor: pointer;
  outline: none;
  font-family: inherit;
}

.date-picker select:focus { border-color: var(--ui-primary); }

.pharmacy-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--ui-muted);
}

.pharmacy-note i { color: #556274; }

@media (max-width: 640px) {
  .date-picker { margin-left: 0; width: 100%; }
  .date-picker select { flex: 1; font-size: 16px; }
}

/* Provenance de la garde (INAM, Ordre des pharmaciens…) : pages Gardes, Annuaire et Carte */
.garde-source { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 8px 0 0; font-size: 12.5px; color: #4b5563; line-height: 1.4; }
.garde-source i { color: #007d50; font-size: 15px; }
.garde-source-nom { font-weight: 600; color: #111827; }
a.garde-source-nom { text-decoration: underline; text-underline-offset: 2px; }
a.garde-source-nom:hover { color: #007d50; }
.garde-source-nom.is-unknown { font-weight: 400; font-style: italic; color: #9ca3af; }

/* ---------------- PARTAGE DEPUIS L'ANNUAIRE ---------------- */
.dir-actions:has(.dir-partager) { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.dir-actions:has(.dir-partager) .dir-btn { padding: 10px 8px; gap: 5px; white-space: nowrap; }
.dir-btn.dir-partager i { color: var(--ui-primary); }
.dir-btn.is-busy i { animation: partage-pulse 1s ease-in-out infinite; }
@keyframes partage-pulse { 50% { opacity: .3; } }

.partage-volet {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, .45);
  /* Variables attendues par affiches.css (messages) */
  --adm-line: var(--ui-line);
  --adm-muted: var(--ui-muted);
  --adm-text: var(--ui-text);
  --adm-primary-dark: var(--ui-primary-dark);
  --adm-primary-soft: var(--ui-primary-soft);
}
.partage-volet[hidden] { display: none; }
body.partage-volet-ouvert { overflow: hidden; }
body.partage-volet-ouvert .pwa-banner { display: none; }
.partage-volet-boite {
  width: min(440px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 18px 18px 14px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .25);
}
.partage-volet-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.partage-volet-tete small { color: var(--ui-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.partage-volet-tete h2 { margin: 2px 0 0; font-size: 17px; color: var(--ui-text); }
.partage-volet-fermer { flex: 0 0 36px; height: 36px; border: none; border-radius: 50%; background: #f1f5f9; color: var(--ui-text); font-size: 20px; cursor: pointer; }
.partage-volet-apercu { display: flex; justify-content: center; }
.partage-volet-apercu img { width: 100%; max-width: 300px; border-radius: 14px; border: 1px solid var(--ui-line); box-shadow: 0 10px 24px rgba(15, 23, 42, .12); }
.partage-volet-attente { display: flex; align-items: center; gap: 8px; margin: 28px 0; color: var(--ui-muted); font-size: 14px; }
.partage-volet-attente i { animation: partage-tourne 1s linear infinite; font-size: 18px; }
@keyframes partage-tourne { to { transform: rotate(360deg); } }
.partage-volet-texte { margin: 12px 0 0; padding: 10px 12px; max-height: 120px; overflow-y: auto; border-radius: 12px; background: var(--ui-bg); font-size: 13px; line-height: 1.5; white-space: pre-line; color: var(--ui-text); }
.partage-volet-texte:empty { display: none; }
.partage-volet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.partage-volet-actions .primary { grid-column: 1 / -1; }
.partage-volet-note { margin: 10px 0 0; color: var(--ui-muted); font-size: 12px; text-align: center; }

@media (max-width: 520px) {
  .partage-volet { align-items: flex-end; padding: 0; }
  .partage-volet-boite { width: 100%; border-radius: 22px 22px 0 0; max-height: 92vh; }
}

/* Choix du modèle d'image (fiche et annuaire) */
.partage-modeles-titre { margin: 4px 0 8px; font-size: 13px; font-weight: 700; color: var(--ui-text); }
.partage-modeles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.partage-modeles > p { grid-column: 1 / -1; }
.partage-modele {
  display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 2px solid var(--ui-line);
  border-radius: 14px; background: #fff; cursor: pointer; font: inherit; text-align: center;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.partage-modele img { width: 100%; height: auto; border-radius: 9px; display: block; }
.partage-modele-nom { display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ui-muted); }
.partage-modele-nom i { display: none; color: var(--ui-primary); }
.partage-modele.is-actif { border-color: var(--ui-primary); box-shadow: 0 0 0 3px rgba(0, 168, 107, .15); }
.partage-modele.is-actif .partage-modele-nom { color: var(--ui-primary-dark); }
.partage-modele.is-actif .partage-modele-nom i { display: inline; }
.partage-modele:disabled { opacity: .5; cursor: not-allowed; }
.partage-volet-large { grid-column: 1 / -1; }

/* ---------------- GARDES : FILTRES VILLE / QUARTIER / TRI ---------------- */
.gardes-selecteurs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.gardes-selecteur { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.gardes-selecteur span { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ui-muted); }
.gardes-selecteur select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--ui-line); border-radius: 12px;
  background: #fff; color: var(--ui-text); font: inherit; font-size: 14px; cursor: pointer;
}
.gardes-selecteur select:focus { outline: 2px solid rgba(0, 168, 107, .35); border-color: var(--ui-primary); }
.gardes-reinit { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--ui-primary-dark); font-size: 13px; font-weight: 600; text-decoration: none; }
.gardes-lieu { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; color: var(--ui-muted); font-size: 12.5px; }
@media (max-width: 720px) {
  .gardes-selecteurs { grid-template-columns: 1fr 1fr; }
}

/* Bouton « Partager » des cartes de gardes */
.ui-btn.partager { background: #fff; border: 1px solid var(--ui-line); color: var(--ui-text); }
.ui-btn.partager i { color: var(--ui-primary); }
.ui-btn.partager.is-busy i { animation: partage-pulse 1s ease-in-out infinite; }

/* ---------------- GARDES : AFFICHE DE LA SÉLECTION ---------------- */
.aff-gardes {
  margin: 0 0 16px; padding: 16px; border: 1px solid #d1fae5; border-radius: 18px;
  background: linear-gradient(135deg, #f0fdf6, #fff 60%);
  --adm-line: var(--ui-line); --adm-muted: var(--ui-muted); --adm-text: var(--ui-text);
  --adm-primary-dark: var(--ui-primary-dark); --adm-primary-soft: var(--ui-primary-soft);
}
.aff-gardes-tete { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.aff-gardes-icone { flex: 0 0 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--ui-primary); color: #fff; font-size: 21px; }
.aff-gardes-tete h2 { margin: 0; font-size: 16px; color: var(--ui-text); }
.aff-gardes-tete p { margin: 2px 0 0; font-size: 13px; color: var(--ui-muted); }
.aff-gardes-attente { display: inline-block; animation: partage-tourne 1s linear infinite; }
.aff-gardes-modeles { max-width: 340px; }
.aff-gardes-apercu { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--ui-line); box-shadow: 0 10px 26px rgba(15, 23, 42, .12); }
.aff-gardes-apercu img { display: block; width: 100%; height: auto; }
.aff-gardes-pages { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; }
.aff-gardes-pages:empty { display: none; }
.aff-gardes-page { flex: 0 0 72px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--ui-muted); font-size: 12px; text-decoration: none; }
.aff-gardes-page img { width: 72px; border-radius: 8px; border: 1px solid var(--ui-line); }
.aff-gardes-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.aff-gardes-actions .dir-btn { flex: 1 1 auto; }

/* ---------------- GUIDE « COLLER L'IMAGE » (navigateurs sans partage d'images) ---------------- */

/* Partage d'une pharmacie : aperçu de l'image (même modèle que l'affiche des gardes) */
.partage-apercu-zone { max-width: 300px; margin: 6px auto 12px; }
.partage-apercu { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--ui-line, #e6e9ef); box-shadow: 0 10px 26px rgba(15, 23, 42, .12); }
.partage-apercu img { display: block; width: 100%; height: auto; }

/* Petits liens des cartes (nom, téléphone, source de la garde) : 24 px de haut au moins. */
.dir-nom, .dir-phone, a.garde-source-nom { display: inline-flex; align-items: center; min-height: 28px; }
.garde-source-nom.is-unknown { color: #556274; }
