@font-face {
  font-family: "Inter";
  src: url("inter-var.woff2") format("woff2-variations"), url("inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --fond: #edf1f6;
  --surface: #ffffff;
  --surface-2: #f7fafc;
  --texte: #0f1a24;
  --doux: #58697a;
  --bord: #d9e2ec;
  --accent: #0d8b7f;
  --accent-2: #16b8a6;
  --accent-texte: #ffffff;
  --vert: #12965a;
  --rouge: #d62f42;
  --orange: #cf7a12;
  --bleu: #2f6fed;
  --touche: #e9eef4;
  --halo: rgba(13, 139, 127, .16);
  --ombre: 0 1px 2px rgba(15, 30, 45, .04), 0 14px 34px -16px rgba(15, 30, 45, .22);
  --ombre-forte: 0 2px 4px rgba(15, 30, 45, .05), 0 24px 50px -20px rgba(15, 30, 45, .3);
  /* échelle minimale : espacements, rayons, texte, transitions */
  --espace-1: 4px;
  --espace-2: 8px;
  --espace-3: 12px;
  --espace-4: 16px;
  --rayon-sm: 10px;
  --rayon-md: 13px;
  --rayon-lg: 22px;
  --texte-xs: .72rem;
  --texte-s: .85rem;
  --transition: .15s ease;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #070c11;
    --surface: #101a23;
    --surface-2: #142029;
    --texte: #e9f1f7;
    --doux: #93a6b6;
    --bord: #1f2d3a;
    --accent: #2dd4bf;
    --accent-2: #5eead4;
    --accent-texte: #04231f;
    --vert: #34d399;
    --rouge: #f26374;
    --orange: #f0a15a;
    --bleu: #6ea8ff;
    --touche: #1a2833;
    --halo: rgba(45, 212, 191, .14);
    --ombre: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 36px -18px rgba(0, 0, 0, .7);
    --ombre-forte: 0 2px 6px rgba(0, 0, 0, .45), 0 28px 60px -22px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
/* Fond : défini dans le bloc « Identité visuelle » plus bas. */

[hidden] { display: none !important; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.ecran {
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* ---------- cartes et formulaires ---------- */

#ecran-connexion { justify-content: center; }
#form-connexion { display: flex; flex-direction: column; gap: 14px; }

label.case { flex-direction: row; align-items: center; gap: 10px; color: var(--texte); padding: 4px 0; margin: 0; }
label.case input { flex: 0 0 auto; width: auto; }
input:not([type=checkbox]), select, textarea {
  font: inherit;
  color: var(--texte);
  background: var(--fond);
  border: 1px solid var(--bord);
  border-radius: 12px;
  padding: 11px 14px;
  width: 100%;
}
textarea { resize: vertical; }
input:focus-visible, button:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.erreur { color: var(--rouge); min-height: 1.2em; margin: 0; font-size: .9rem; }
.aide { color: var(--doux); font-size: .85rem; margin: 2px 0 10px 30px; }
.aide.plein { margin-left: 0; }
.groupe { margin-bottom: 6px; }
.lien-discret { color: var(--doux); font-size: .85rem; text-align: center; }

.btn.danger { background: transparent; color: var(--rouge); border: 1px solid var(--rouge); }
.btn.petit { padding: 7px 12px; font-size: .85rem; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.ligne-btn { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.ligne-btn.espace { justify-content: space-between; }
.icone-btn { background: none; border: 0; color: var(--doux); padding: 8px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.icone-btn.accent { background: var(--accent); color: var(--accent-texte); }

/* ---------- barre du haut ---------- */
.app { padding-bottom: 0; }
.barre { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.titre { font-weight: 700; font-size: 1.15rem; }

.point { width: 9px; height: 9px; border-radius: 50%; background: var(--doux); flex: none; }
.statut[data-etat=ok] .point, .point.ok { background: var(--vert); box-shadow: 0 0 0 3px color-mix(in srgb, var(--vert) 25%, transparent); }
.statut[data-etat=pause] .point, .point.pause { background: var(--orange); }
.statut[data-etat=erreur] .point, .point.erreur { background: var(--rouge); }
.point.occupe { background: var(--bleu); }

.bandeau { background: color-mix(in srgb, var(--orange) 15%, var(--surface)); border: 1px solid var(--orange); border-radius: 12px; padding: 10px 14px; font-size: .9rem; margin-bottom: 12px; }
.bandeau.info { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 50%, var(--bord)); }

.en-attente { align-self: flex-start; background: color-mix(in srgb, var(--bleu) 14%, var(--surface)); color: var(--texte); border-radius: 999px; padding: 4px 12px; font-size: .82rem; font-weight: 600; margin: -4px 0 10px; }
.en-attente::before { content: "⏳ "; }
.appel-prioritaire { display: inline-block; margin-top: 10px; background: color-mix(in srgb, var(--orange) 18%, var(--surface)); color: var(--texte); border: 1px solid var(--orange); border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: .85rem; }
.fiche-details { color: var(--doux); font-size: .92rem; display: grid; gap: 4px; margin-bottom: 14px; }
.fiche-details div:first-child { color: var(--texte); }
.fiche-enregistrement { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
/* numéro masqué : rappel discret + bouton de révélation */
.fiche-reveler { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.fiche-reveler p { margin: 0; font-size: .9rem; }
.fiche-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fiche-actions svg { width: 18px; height: 18px; }
main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.onglet { flex: 1; display: flex; flex-direction: column; padding-bottom: 12px; }

/* ---------- onglets du bas ---------- */

.onglets-bas button[aria-selected=true] { color: var(--accent); }
.badge {
  position: absolute; top: 2px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--rouge); color: #fff;
  font-size: .7rem; line-height: 18px; text-align: center;
}
.pastille { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--rouge); color: #fff; font-size: .7rem; line-height: 18px; }

/* ---------- clavier ---------- */
.saisie { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.saisie input { font-size: 1.6rem; text-align: center; letter-spacing: .04em; background: transparent; border: 0; border-bottom: 1px solid var(--bord); border-radius: 0; }
.saisie input:focus-visible { outline: none; border-bottom-color: var(--accent); }
.suggestion { text-align: center; color: var(--accent); font-weight: 600; font-size: .9rem; min-height: 1.3em; }
.pave { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 8px auto; width: 100%; max-width: 300px; }

.touche small { font-size: .62rem; color: var(--doux); letter-spacing: .12em; height: .9em; }

.actions { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: auto; padding-top: 12px; }
.actions .btn { font-size: .8rem; padding: 10px 6px; }

.rond svg { width: 30px; height: 30px; }
.rond.vert { background: var(--vert); }
.rond.rouge { background: var(--rouge); }
.raccroche { transform: rotate(135deg); }

/* ---------- listes (appels, messages, contacts) ---------- */
.segments { display: flex; background: var(--touche); border-radius: 12px; padding: 4px; margin-bottom: 10px; }
.segments button { flex: 1; border: 0; background: none; color: var(--doux); font: inherit; font-size: .88rem; font-weight: 600; padding: 7px 4px; border-radius: 9px; cursor: pointer; }

.recherche { display: flex; gap: 8px; margin-bottom: 10px; }
.liste { list-style: none; margin: 0; padding: 0; }
.liste .groupe-date { font-size: .78rem; font-weight: 700; color: var(--doux); text-transform: uppercase; letter-spacing: .04em; padding: 14px 4px 4px; border: 0; cursor: default; }

.liste .rond-icone svg { width: 18px; height: 18px; }
.liste .rouge { color: var(--rouge); }
.liste .vert { color: var(--vert); }
.liste .bleu { color: var(--bleu); }
.liste .infos { flex: 1; min-width: 0; }
.liste .qui { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.liste .detail { font-size: .8rem; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.liste .detail.rouge { color: var(--rouge); }
.liste .detail.bleu { color: var(--bleu); }
.liste .detail.vert { color: var(--vert); }
.liste .boutons { display: flex; gap: 6px; flex: none; }
.liste .boutons .icone-btn { background: var(--touche); color: var(--texte); width: 38px; height: 38px; border-radius: 50%; }
.liste .boutons .icone-btn.vert { background: var(--vert); color: #fff; }
.liste .boutons .icone-btn.suppr { background: transparent; color: var(--rouge); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rouge) 45%, transparent); }
.liste .boutons svg { width: 18px; height: 18px; }
.liste li.nouveau .qui::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bleu); margin-right: 6px; vertical-align: middle; }
.liste li.cliquable { cursor: pointer; }
/* compteur d'appels du même contact, même sens, dans la journée */
.liste .compteur { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 9px; background: var(--touche); color: var(--doux); font-size: .72rem; font-weight: 700; line-height: 18px; vertical-align: 1px; }
.pied-liste { margin: 18px 0 8px; text-align: center; }
.pied-liste .lien-discret { background: none; border: 0; padding: 6px 10px; cursor: pointer; }
.pied-liste .lien-discret:hover { color: var(--texte); text-decoration: underline; }
.progression { height: 3px; background: var(--touche); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.progression div { height: 100%; width: 0; background: var(--accent); }
.vide { color: var(--doux); text-align: center; margin-top: 40px; padding: 0 20px; }

/* ---------- écran d'appel ---------- */
.appel { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 18%, var(--fond)), var(--fond) 60%); max-width: none; }
.appel > * { width: 100%; max-width: 460px; margin-left: auto; margin-right: auto; }
.appel-haut { text-align: center; padding-top: 5vh; }
/* L'état est ce qui change et ce qu'on doit lire d'un coup d'œil : il passe en
   pastille, au-dessus de l'identité qui, elle, ne bouge pas pendant l'appel. */
.appel-etat {
  display: inline-flex; align-items: center; gap: 8px;
  max-width: 100%; margin: 0 auto;
  padding: 6px 14px; border-radius: 999px;
  background: color-mix(in srgb, var(--texte) 7%, transparent);
  color: var(--texte); font-size: .9rem; font-weight: 600;
  line-height: 1.3; text-wrap: balance;
}
.appel-etat::before {
  content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}
#ecran-appel.en-cours .appel-etat {
  background: color-mix(in srgb, var(--vert) 16%, transparent);
}
#ecran-appel.en-cours .appel-etat::before {
  background: var(--vert);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--vert) 25%, transparent);
}
#ecran-appel:not(.en-cours).sonne .appel-etat::before { animation: battement 1.2s ease-in-out infinite; }
@keyframes battement { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.appel-nom { font-size: 1.8rem; font-weight: 700; margin-top: 12px; word-break: break-word; }
.appel-numero { color: var(--doux); margin-top: 4px; font-size: 1.05rem; }
.appel-fiche { margin: 10px auto 0; max-width: 340px; color: var(--doux); font-size: .9rem; white-space: pre-line; }
.appel-code { display: inline-block; margin-top: 14px; background: var(--surface); border: 1px solid var(--accent); color: var(--texte); border-radius: 12px; padding: 8px 14px; font-weight: 600; letter-spacing: .05em; }
/* Le compteur est l'autre information vivante de l'écran : chiffres tabulaires,
   assez grands pour être lus sans fixer l'écran. Masqué tant qu'il est vide. */
.appel-duree {
  margin-top: 10px; font-variant-numeric: tabular-nums;
  font-size: 2rem; font-weight: 600; letter-spacing: .01em;
  color: var(--texte); line-height: 1.1;
}
.appel-duree:empty { display: none; }
.consultation { margin-top: 20px; background: var(--surface); border: 1px solid var(--bord); border-radius: 16px; padding: 14px 16px; }
.consultation .ligne-btn { margin-top: 10px; }
.controles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: auto; padding: 20px 0; }
.ctrl { background: var(--surface); border: 1px solid var(--bord); color: var(--texte); border-radius: 16px; padding: 10px 2px; display: flex; flex-direction: column; align-items: center; gap: 6px; font: inherit; font-size: .72rem; cursor: pointer; }
.ctrl[aria-pressed=true] { background: var(--accent); color: var(--accent-texte); border-color: var(--accent); }
.ctrl:disabled { opacity: .4; }
.pave-appel { margin-top: auto; }
.appel-bas { display: flex; justify-content: space-around; padding: 12px 0 8px; }
#ecran-appel:not(.en-cours) .appel-bas { margin-top: auto; }

@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.sonne #btn-decrocher { animation: pulse 1.2s ease-in-out infinite; }

/* ---------- dialogues ---------- */

.collegues { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.collegues button { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--bord); background: var(--fond); color: var(--texte); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .88rem; cursor: pointer; }
.collegues button:disabled { opacity: .45; cursor: default; }

/* ======================================================================
   Identité visuelle : profondeur, dégradés doux et typographie soignée.
   Ces règles affinent les composants définis plus haut sans changer
   leur structure (mêmes classes, mêmes variables).
   ====================================================================== */
body {
  color: var(--texte);
  font: 16px/1.5 "Inter", "Inter var", "Segoe UI Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  background:
  radial-gradient(1100px 520px at 8% -12%, var(--halo), transparent 62%),
  radial-gradient(900px 480px at 102% -4%, color-mix(in srgb, var(--bleu) 9%, transparent), transparent 58%),
  radial-gradient(700px 420px at 50% 115%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%),
  var(--fond);
  background-attachment: fixed;
  font-feature-settings: "ss01" 1, "cv01" 1;
  -webkit-font-smoothing: antialiased;
}
h1 {
  font-size: 1.35rem; margin: 4px 0 6px;
  font-weight: 700; letter-spacing: -.022em; line-height: 1.2;
}
h2 {
  font-size: 1.15rem; margin: 0 0 14px;
  font-weight: 700; letter-spacing: -.012em;
}
h3 { font-weight: 650; letter-spacing: -.005em; }

.carte {
  background: var(--surface);
  color: var(--texte);
  border: 1px solid var(--bord);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--ombre);
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--bord) 76%, transparent);
  box-shadow: var(--ombre);
}
#ecran-connexion .carte, #form-admin {
  border-radius: 26px;
  box-shadow: var(--ombre-forte);
}

.btn {
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 13px;
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease, background-color .2s ease;
}
.btn.principal {
  background: var(--accent); color: var(--accent-texte);
  background-image: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--accent) 85%, transparent);
}
.btn.principal:hover { filter: brightness(1.07) saturate(1.05); box-shadow: 0 12px 26px -10px color-mix(in srgb, var(--accent) 90%, transparent); }
.btn.secondaire {
  background: var(--touche); color: var(--texte);
  background: color-mix(in srgb, var(--accent) 7%, var(--touche));
}
.btn.secondaire:hover { background: color-mix(in srgb, var(--accent) 14%, var(--touche)); }
.btn:active { transform: translateY(1px) scale(.995); }

input:not([type=checkbox]):not([type=radio]), select, textarea {
  background: var(--surface);
  border-radius: 13px;
  padding: 12px 14px;
  box-shadow: inset 0 1px 2px color-mix(in srgb, var(--texte) 5%, transparent);
  transition: border-color .15s ease, box-shadow .18s ease, background-color .15s ease;
}
input:not([type=checkbox]):not([type=radio]):hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--bord)); }
/* Lecture seule : sans ce repère, un champ readonly est indiscernable d'un champ
   éditable et on croit pouvoir y écrire. */
textarea[readonly], input[readonly] { background: color-mix(in srgb, var(--texte) 4%, transparent); cursor: default; }
textarea[readonly]:hover, input[readonly]:hover { border-color: var(--bord); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
label {
  display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--doux); margin-bottom: 10px;
  font-weight: 500;
}

.logo {
  width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: var(--accent-texte); display: grid; place-items: center;
  border-radius: 18px;
  background-image: linear-gradient(145deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--accent) 90%, transparent);
}
.statut {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--touche); color: var(--texte);
  border: 0; border-radius: 999px; padding: 4px 12px; margin-top: 4px;
  font: inherit; font-size: .85rem; cursor: pointer;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bord) 60%, transparent);
}

.onglets-bas {
  position: sticky; bottom: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--fond);
  border-top: 1px solid var(--bord);
  margin: 0 -16px;
  padding: 6px 4px max(6px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-top: 1px solid color-mix(in srgb, var(--bord) 70%, transparent);
}

.onglets-bas button[aria-selected=true]::before {
  content: "";
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 0 0 3px 3px;
  background-image: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.onglets-bas button:active { transform: scale(.96); }

.touche {
  aspect-ratio: 1.45;
  border: 0; border-radius: 16px;
  background: var(--touche); color: var(--texte);
  font: inherit; font-size: 1.6rem; font-weight: 500;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; user-select: none;
  background: linear-gradient(180deg, var(--surface), var(--touche));
  border: 1px solid color-mix(in srgb, var(--bord) 70%, transparent);
  box-shadow: 0 1px 1px color-mix(in srgb, var(--texte) 4%, transparent), 0 6px 14px -10px color-mix(in srgb, var(--texte) 45%, transparent);
  transition: transform .08s ease, box-shadow .12s ease, filter .12s ease;
}
.touche:active {
  filter: brightness(.9);
  transform: translateY(1px); box-shadow: none;
}
.rond {
  width: 68px; height: 68px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; cursor: pointer;
  box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--texte) 70%, transparent);
}

.segments, .onglets-admin { background: color-mix(in srgb, var(--touche) 80%, transparent); }
.segments button[aria-selected=true] {
  background: var(--surface); color: var(--texte); box-shadow: 0 1px 4px rgba(0,0,0,.08);
  background-image: linear-gradient(180deg, var(--surface), var(--surface-2));
}

.liste li.element {
  display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--bord);
  transition: background-color .15s ease;
}
.liste li.cliquable:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.liste .rond-icone {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--touche); color: var(--doux); flex: none; font-weight: 700;
  background: color-mix(in srgb, var(--touche) 85%, transparent);
}

dialog {
  max-width: min(440px, calc(100vw - 32px)); width: 100%; max-height: calc(100dvh - 32px); overflow: auto;
  border: 0;
  border-radius: 22px;
  box-shadow: var(--ombre-forte);
  background: var(--surface);
  color: var(--texte);
  padding: 22px;
}
dialog::backdrop {
  background: rgba(0, 0, 0, .45);
  background: rgba(6, 14, 20, .5); backdrop-filter: blur(3px);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--doux) 35%, transparent); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--doux) 55%, transparent); background-clip: content-box; }

/* Données sensibles d'une fiche : bloc distinct, jamais mélangé aux notes */
.bloc-sensible {
  border: 1px solid color-mix(in srgb, var(--rouge) 35%, var(--bord));
  border-radius: 12px; padding: 10px 12px; margin: 4px 0 12px;
  background: color-mix(in srgb, var(--rouge) 6%, var(--surface));
  font-size: .9rem; line-height: 1.45;
}
.bloc-sensible h3 { margin: 0 0 6px; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--rouge); }
.bloc-sensible > div > div + div { margin-top: 4px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- barre de contrôles et feuille d'actions de l'appel ---------- */
/* Barre : 4 gestes directs, grisés tant que l'appel n'est pas décroché. */
.controles .ctrl svg { width: 24px; height: 24px; }
.controles .ctrl:disabled { opacity: .45; cursor: default; }
#ecran-appel:not(.en-cours) .controles .ctrl { box-shadow: none; }

/* Feuille d'actions : panneau qui glisse du bas, au-dessus de l'écran d'appel. */
.feuille { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.feuille[hidden] { display: none; }
.feuille-voile {
  position: absolute; inset: 0; border: 0; padding: 0;
  background: rgba(6, 14, 20, .45);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  cursor: pointer;
}
.feuille-panneau {
  position: relative; width: min(460px, 100%);
  max-height: min(82dvh, 680px); overflow: auto;
  background: var(--surface); color: var(--texte);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--ombre-forte);
  padding: 8px 18px calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px;
  font: inherit; text-align: left;
  animation: feuille-monte .22s ease;
}
.feuille-poignee { width: 44px; height: 5px; border-radius: 3px; margin: 2px auto; background: color-mix(in srgb, var(--doux) 50%, transparent); flex: none; }
.feuille-titre { font-weight: 700; font-size: 1.02rem; text-align: center; }
.feuille-grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.feuille-grille .ctrl { padding: 9px 4px; gap: 4px; font-size: .72rem; min-height: 62px; justify-content: center; }
.feuille-grille .ctrl:disabled { opacity: .45; cursor: default; }
.feuille-grille .ctrl svg { width: 20px; height: 20px; }
.feuille-grille .ctrl span { text-align: center; line-height: 1.2; }

/* Sections de la feuille : un intitulé, une grille. L'intitulé porte le contexte,
   ce qui permet des libellés de boutons courts (« Carte » sous « Saisie sécurisée »). */
.feuille-sec { display: flex; flex-direction: column; gap: 6px; }
.feuille-sec + .feuille-sec { padding-top: var(--espace-2); border-top: 1px solid color-mix(in srgb, var(--bord) 70%, transparent); }
.feuille-sec-titre {
  margin: 0; font-size: var(--texte-xs); font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--doux);
}
/* Section repliable : ouverte d'un geste, fermée elle ne coûte qu'une ligne.
   Même mécanique dans la feuille d'appel et dans les sections de la console. */
.pliable { display: block; }
.pliable > summary {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 2px; cursor: pointer; list-style: none;
  min-height: 40px; border-radius: var(--rayon-sm);
}
.pliable > summary::-webkit-details-marker { display: none; }
.pliable > summary::after {
  content: ""; margin-left: auto; flex: none;
  width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform var(--transition);
}
.pliable[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.pliable > summary:hover { color: var(--texte); }
.pliable > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pliable-corps { display: flex; flex-direction: column; gap: 6px; padding-bottom: var(--espace-1); }
.pliable-compte {
  font-size: var(--texte-xs); font-weight: 600; letter-spacing: 0; text-transform: none;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--texte); border-radius: 999px; padding: 2px 8px;
}
.feuille-puces { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.feuille-puces-titre { font-size: var(--texte-xs); color: var(--doux); margin-right: var(--espace-1); }
@keyframes feuille-monte { from { transform: translateY(48px); opacity: .35; } to { transform: none; opacity: 1; } }
@media (max-width: 380px) { .feuille-grille { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Justification (blocage, effacement d'un appel) ---------- */
.petit-texte { font-size: .82rem; margin: -4px 0 8px; }
#dialogue-motif textarea { min-height: 84px; resize: vertical; }
#motif-erreur:empty { display: none; }

/* ---------- Outils CALL365 (poste conseiller) ---------- */
.doux { color: var(--doux); }
.c365-titre { margin: var(--espace-2) 0 var(--espace-1); }
.c365-groupe { margin: var(--espace-3) 0 var(--espace-2); }
.c365-groupe-titre { margin: 0 0 var(--espace-2); font-size: var(--texte-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--doux); }
.c365-grille-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--espace-2); }
.c365-grille-actions .btn { width: 100%; min-height: 44px; }
.c365-ligne { flex-wrap: wrap; gap: var(--espace-2); margin: var(--espace-2) 0; align-items: center; }
.c365-ligne-serre { flex-wrap: wrap; gap: var(--espace-1); margin: var(--espace-1) 0; }
.c365-form-ligne { gap: var(--espace-2); align-items: stretch; }
#c365-conseiller .c365-code { width: 120px; }
#c365-conseiller .c365-msg-saisie { flex: 1; min-width: 0; }
.c365-sortie { white-space: pre-wrap; }
.c365-liste { margin-top: var(--espace-2); }
.c365-meta { margin-top: var(--espace-2); }
.c365-astuce { margin-top: var(--espace-3); }
.c365-nouveau { font-weight: 600; }
.c365-secure-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--espace-2); margin: var(--espace-2) 0; }
.c365-form { display: flex; flex-direction: column; gap: 10px; }
.c365-fil { margin: 6px 12px; font-size: var(--texte-s); }
.c365-chip { margin-left: var(--espace-2); vertical-align: middle; }
.c365-btn-remote { margin-left: var(--espace-2); }
/* Bascule Secure : un réglage, pas une action — puce compacte, état visible. */
.puce-bascule {
  font: inherit; font-size: var(--texte-s); font-weight: 500;
  background: var(--surface-2); color: var(--doux);
  border: 1px solid var(--bord); border-radius: 999px;
  padding: 5px 10px; min-height: 32px; cursor: pointer;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}
.puce-bascule[aria-pressed=true] {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  border-color: var(--accent); color: var(--texte);
}
.puce-bascule[aria-pressed=true]::before { content: "✓ "; color: var(--accent); font-weight: 700; }
.ctrl[data-c365-s][aria-pressed=true] { background: var(--accent); color: var(--accent-texte); border-color: var(--accent); }

/* ---------- Révélation d'un numéro masqué ---------- */
#dialogue-secret input { width: 100%; letter-spacing: .18em; font-variant-numeric: tabular-nums; }
#secret-erreur:empty { display: none; }

/* ---------- Droits des postes (administration) ---------- */
.droits-poste { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 6px; font-size: .84rem; }
.droits-poste .case.droit { display: inline-flex; flex-direction: row; align-items: center; gap: 5px; margin: 0; font-weight: 500; }

/* ---------- console d'appels ---------- */
.mur-titre { margin: 18px 0 8px; font-size: 1rem; }
.mur-meta { color: var(--doux); font-size: .82rem; margin: 4px 0 8px; }
.mur-vide { color: var(--doux); margin: 8px 0; }
.mur-compteurs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.mur-compteurs button { border: 1px solid var(--bord); background: var(--surface); color: var(--texte); border-radius: 12px; padding: 8px 6px; font: inherit; font-size: .82rem; cursor: pointer; }
.mur-compteurs button[aria-selected=true] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.mur-layout { display: grid; grid-template-columns: 1fr; gap: 10px; }
#mur-liste { max-height: min(46vh, 440px); overflow: auto; }
@media (max-width: 859px) { .mur-layout.ouvert #mur-detail { order: -1; } }
@media (min-width: 860px) { .mur-layout { grid-template-columns: 1fr 1fr; align-items: start; } }
.mur-carte { width: 100%; text-align: left; border: 1px solid var(--bord); background: var(--surface); color: var(--texte); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 3px; font: inherit; cursor: pointer; }
.mur-carte.statique { cursor: default; }
.mur-carte.sel, .mur-carte.live { border-color: var(--accent); }
.mur-nom { font-weight: 700; }
.mur-temps { font-variant-numeric: tabular-nums; color: var(--doux); font-size: .8rem; }
.mur-fil { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.mur-fil time { color: var(--doux); font-variant-numeric: tabular-nums; margin-right: 6px; }
.mur-transferts, .mur-note { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.mur-note input { flex: 1; min-width: 140px; }
.mur-jours { display: flex; align-items: flex-end; gap: 6px; height: 92px; margin: 8px 0 12px; }
.mur-jour { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 2px; font-size: .68rem; color: var(--doux); }
.mur-jour i { display: block; width: 100%; max-width: 28px; min-height: 2px; border-radius: 6px 6px 0 0; background: var(--accent); }

/* Sections secondaires de la console (campagnes, équipe, script). Repliées,
   elles laissent l'écran au mur d'appels au lieu de l'allonger de deux écrans. */
.mur-sec { margin-top: var(--espace-2); border-top: 1px solid var(--bord); }
.mur-sec > summary { font-size: 1rem; font-weight: 700; color: var(--texte); }
.mur-sec > summary:hover { background: color-mix(in srgb, var(--texte) 5%, transparent); }
.mur-sec > .pliable-corps { padding-bottom: var(--espace-3); }
.onglets-bas button {
  position: relative;
  background: none; border: 0; color: var(--doux);
  font: inherit; font-size: .72rem; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; cursor: pointer; border-radius: 10px;
  transition: color .15s ease, transform .15s ease;
  min-width: 0;
}
.onglets-bas button span { font-size: .68rem; }

.mur-script { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--bord); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.mur-quals { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.mur-quals .puce { min-height: 40px; }
.mur-quals .puce.sel { outline: 2px solid var(--accent); }
.mur-audio { width: 100%; margin: 8px 0; }

/* ---------- Détail d'un appel (console) ---------- */
/* L'état d'abord : c'est ce qui change et ce qu'on lit d'un coup d'œil. */
.mur-tete { margin-bottom: var(--espace-3); }
.mur-etat {
  display: inline-flex; align-items: center; gap: var(--espace-2);
  padding: 4px 11px; border-radius: 999px;
  background: color-mix(in srgb, var(--texte) 7%, transparent);
  color: var(--texte); font-size: var(--texte-s); font-weight: 600;
}
.mur-etat::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--doux); }
.mur-etat.direct { background: color-mix(in srgb, var(--vert) 16%, transparent); }
.mur-etat.direct::before { background: var(--vert); box-shadow: 0 0 0 3px color-mix(in srgb, var(--vert) 25%, transparent); }
.mur-etat.attente { background: color-mix(in srgb, var(--orange) 16%, transparent); }
.mur-etat.attente::before { background: var(--orange); }
.mur-tete-nom { font-size: 1.25rem; margin: var(--espace-2) 0 0; word-break: break-word; }
.mur-tete .mur-meta { margin: var(--espace-1) 0 0; }

/* Chaque groupe d'outils porte son intitulé : on sait ce qu'on clique. */
.mur-bloc { margin-top: var(--espace-3); }
.mur-bloc-titre {
  margin: 0 0 var(--espace-1); font-size: var(--texte-xs); font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--doux);
}
.mur-bloc > .mur-script, .mur-bloc > .mur-quals, .mur-bloc > .mur-fil,
.mur-bloc > .mur-transferts, .mur-bloc > .mur-note, .mur-bloc > .mur-audio { margin-top: 0; }
.mur-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* Puce : le bouton courant de la console et de la fin d'appel. Elle n'avait
   aucun style — les actions conséquentes et les étiquettes se ressemblaient. */
.puce {
  font: inherit; font-size: var(--texte-s); font-weight: 600;
  min-height: 36px; padding: 7px 13px;
  border: 1px solid var(--bord); border-radius: 999px;
  background: var(--surface); color: var(--texte);
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}
.puce:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 45%, var(--bord)); }
.puce:active:not(:disabled) { transform: translateY(1px); }
.puce:disabled { opacity: .45; cursor: default; }
.puce.primaire { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); }
.puce.primaire:hover:not(:disabled) { background: var(--accent); filter: brightness(1.07); }
.puce.sel { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border-color: var(--accent); }

.appel-script { white-space: pre-wrap; margin: 8px 16px 0; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid var(--bord); font-size: .98rem; line-height: 1.35; }
.appel-script::before { content: 'À dire'; display: block; margin-bottom: 4px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.appel-quals { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 16px; }
#rappel-fin-quals { margin: 8px 0 12px; }
.appel-quals .puce { min-height: 42px; }
.appel-quals .puce.sel { outline: 2px solid var(--accent); }
