:root {
  color-scheme: light dark;
  --bg: #fff;
  --fg: #111;
  --muted: #6b7280;
  --primary: #0D47A1;
  --border: #e5e7eb;
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#0b0b0d; --fg:#f3f4f6; --border:#1f2937; --muted:#9ca3af; }
}
* { box-sizing: border-box; }
html,body { margin:0; padding:0; height:100%; background:var(--bg); color:var(--fg);
  font-family: 'Roboto', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
header {
  position: sticky;
  top: 0;
  background: #e6f0fa;        /* bleu clair */
  border-bottom: 1px solid var(--border);
  padding: 32px 16px 24px;              /* un peu plus de marge */
  z-index: 10;
  text-align: center;         /* centre tout le contenu */
}

h1 {
  margin: 0 0 8px 0;
  font-size: 28px;           /* plus gros */
  font-weight: 700;
  color: #0D47A1;
}

.subtitle {
  margin: 0 0 20px 0;
  font-size: 16px;           /* un peu plus grand */
  font-weight: 400;
  color: #374151;            /* gris foncé (au lieu de var(--muted)) */
}

.subtitle strong {
  font-weight: 700;          /* met les initiales en gras */
  color: #111827;            /* et éventuellement en bleu institutionnel */
}

.search-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;   /* ⬅️ garde la recherche centrée sous le titre */
}
#q { flex:1; padding:10px 12px; border:1px solid var(--border); border-radius:10px; font-size:16px; }
.list { list-style:none; margin:0; padding:0; }
.item { padding:14px 16px; border-bottom:1px solid var(--border); }
.name { font-weight:700; font-size:16px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.phones { list-style:none; margin:6px 0 0 0; padding:0; }
.phone-line { display:flex; align-items:center; gap:8px; padding:3px 0; }
.phone {
  font-size: 15px;
  color: var(--fg);   /* adaptatif clair sombre */
  font-weight: 400;   /* normal (pas gras) */
}
a.btn, button { cursor:pointer; border:none; background:var(--primary); color:#fff; padding:8px 12px; border-radius:8px; font-weight:600; }
button.secondary { background:#64748b; }
button.ghost { background:transparent; color:var(--muted); border:1px solid var(--border); }
button.danger { background:#b91c1c; }
.small { font-size:12px; }
footer { position:sticky; bottom:0; background:var(--bg); border-top:1px solid var(--border);
  padding:10px 16px; display:flex; gap:10px; align-items:center; }
.link { background:transparent; color:var(--primary); border:none; padding:0; font-weight:700; }
.dot { color:var(--muted); }
.muted { color:var(--muted); }

.modal { position:fixed; inset:0; background:rgba(0,0,0,.35); display:flex; align-items:center; justify-content:center; }
.modal.hidden { display:none; }
.modal-box { width:min(560px, 92vw); background:var(--bg); border:1px solid var(--border); border-radius:12px; padding:16px; }
.modal input, .modal textarea { width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:8px; margin:6px 0; font-size:16px; }
#c-phones { min-height:120px; }
.row { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }

/* === HEADER avec image + overlay et titres lisibles === */
header {
  position: relative;
  text-align: center;
  padding: 32px 12px 24px;
  background: url("./icons/foie-band.jpg") center/cover no-repeat;
}

/* voile sombre pour la lisibilité du texte */
header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 0;
}

/* Tout le contenu du header au-dessus du voile */
header * { position: relative; z-index: 1; }

/* Forcer les couleurs des titres DANS le header */
header h1 {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 700;
  color: #fff;                 /* ⬅️ blanc */
}
header .subtitle {
  margin: 0 0 20px 0;
  font-size: 16px;
  font-weight: 400;
  color: #f1f5f9;              /* gris clair lisible sur fond sombre */
}
header .subtitle strong {
  font-weight: 700;
  color: #fff;                 /* initiales en blanc, bien visibles */
}

/* Recherche centrée + champ lisible sur image */
header .search-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
}
header .search-wrap input[type="search"] {
  background: rgba(255,255,255,0.92);
  color: #111;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 8px;
  padding: 10px 12px;
  width: min(520px, 92vw);
}

/* Lien "Signaler" en haut à droite, blanc */
header .report-actions { position: absolute; top: 12px; right: 12px; }
header .report-actions .link { color: #fff; text-decoration: underline; }

.search-wrap {
  position: relative;
}

.clear-x {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  cursor: pointer;
  color: #888;
  display: none;   /* cachée tant que champ vide */
  user-select: none;
}

#q {
  padding-right: 30px; /* pour laisser la place à la croix */
}

/* Masquer le bouton clear natif des navigateurs desktop */
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

input[type="search"]::-ms-clear {
  display: none;
}

input[type="search"]::-moz-search-clear {
  display: none;
}

