/* Console VOZitel — feuille de style unique, sans dépendance.
 * Thème : suit le système (prefers-color-scheme), surchargeable par
 * l'attribut data-theme="clair|sombre" posé sur <html>.
 */

:root {
  color-scheme: light;
  --fond: #f5f8fb;
  --fond-2: #eaf1f7;
  --surface: #ffffff;
  --surface-2: #f7fafc;
  --bord: #d6e0ea;
  --bord-fort: #b4c3d2;
  --texte: #10273b;
  --doux: #4f6478;
  --accent: #003c66;
  --accent-fond: #eaf4fb;
  --accent-txt: #ffffff;
  --ok: #17703c;
  --ok-fond: #e3f4ea;
  --alerte: #8a5a00;
  --alerte-fond: #fdf2d8;
  --danger: #b4261b;
  --danger-fond: #fbe6e4;
  --info: #0a4a7a;
  --info-fond: #eaf4fb;
  --neutre-fond: #edf0f4;
  --ombre: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --ombre-haute: 0 12px 32px rgba(16, 24, 40, .18);
  --focus: #00a9eb;
  --rayon: 10px;
  --lateral: 264px;
  --barre: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) {
    color-scheme: dark;
    --fond: #071624;
    --fond-2: #0b1d2e;
    --surface: #0e2335;
    --surface-2: #12293e;
    --bord: #1e3a54;
    --bord-fort: #2b4c69;
    --texte: #e7ecf2;
    --doux: #a2adba;
    --accent: #00a9eb;
    --accent-fond: #0a3150;
    --accent-txt: #04131f;
    --ok: #5fd08f;
    --ok-fond: #15301f;
    --alerte: #f0c060;
    --alerte-fond: #2f2512;
    --danger: #ff8a80;
    --danger-fond: #3a1a18;
    --info: #00a9eb;
    --info-fond: #0a3150;
    --neutre-fond: #16304a;
    --ombre: 0 1px 3px rgba(0, 0, 0, .45);
    --ombre-haute: 0 12px 32px rgba(0, 0, 0, .6);
    --focus: #5cc8f2;
  }
}
:root[data-theme="sombre"] {
  color-scheme: dark;
  --fond: #071624;
  --fond-2: #0b1d2e;
  --surface: #0e2335;
  --surface-2: #12293e;
  --bord: #1e3a54;
  --bord-fort: #2b4c69;
  --texte: #e7ecf2;
  --doux: #a2adba;
  --accent: #00a9eb;
  --accent-fond: #0a3150;
  --accent-txt: #04131f;
  --ok: #5fd08f;
  --ok-fond: #15301f;
  --alerte: #f0c060;
  --alerte-fond: #2f2512;
  --danger: #ff8a80;
  --danger-fond: #3a1a18;
  --info: #00a9eb;
  --info-fond: #0a3150;
  --neutre-fond: #16304a;
  --ombre: 0 1px 3px rgba(0, 0, 0, .45);
  --ombre-haute: 0 12px 32px rgba(0, 0, 0, .6);
  --focus: #5cc8f2;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}
a { color: var(--accent); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }
h1, h2, h3 { line-height: 1.25; }
[hidden], .cache { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.lien-evitement {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--surface); padding: .5rem .8rem; border-radius: 6px; box-shadow: var(--ombre-haute);
}
.lien-evitement:focus { left: 8px; }

/* ---------- Connexion ---------- */
.connexion {
  min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: linear-gradient(160deg, var(--accent-fond), var(--fond) 55%);
}
.connexion .carte { width: 100%; max-width: 400px; padding: 1.8rem; }
.marque { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.1rem; letter-spacing: .01em; }
.marque .logo { width: 36px; height: 36px; border-radius: 9px; display: block; flex: none; }
.marque .nom-marque, .connexion .marque span:last-child { color: #003c66; }
:root[data-theme="sombre"] .marque .nom-marque, :root[data-theme="sombre"] .connexion .marque span:last-child { color: #e7f3fb; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="clair"]) .marque .nom-marque,
  :root:not([data-theme="clair"]) .connexion .marque span:last-child { color: #e7f3fb; } }
.connexion h1 { font-size: 1.35rem; margin: 1.2rem 0 .3rem; }
.connexion p.doux { margin: 0 0 1.2rem; }
.connexion .bouton { width: 100%; justify-content: center; margin-top: .6rem; }

/* ---------- Structure ---------- */
.appli { display: grid; grid-template-columns: var(--lateral) minmax(0, 1fr); grid-template-rows: var(--barre) 1fr; min-height: 100vh; }
.barre {
  grid-column: 1 / -1; position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: .8rem; padding: 0 1rem;
  background: var(--surface); border-bottom: 1px solid var(--bord);
}
.barre .marque { min-width: calc(var(--lateral) - 2rem); color: var(--texte); text-decoration: none; }
.contexte { display: flex; align-items: center; gap: .5rem; flex-wrap: nowrap; min-width: 0; }
.contexte label { display: inline; font-size: .8rem; font-weight: 600; color: var(--doux); margin: 0; }
.contexte strong { font-size: .92rem; }
.contexte select { width: auto; min-width: 0; max-width: 15rem; padding: .35rem .5rem; min-height: 36px; }
.nowrap { white-space: nowrap; }
.barre .droite { margin-left: auto; display: flex; align-items: center; gap: .4rem; }
.qui { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; font-size: .85rem; }
.qui span:last-child { color: var(--doux); font-size: .75rem; }
.barre .burger { display: none; }

.lateral {
  background: var(--surface); border-right: 1px solid var(--bord);
  padding: .8rem .6rem 1.5rem; overflow-y: auto;
  position: sticky; top: var(--barre); height: calc(100vh - var(--barre));
}
.lateral .groupe { margin-bottom: .9rem; }
.lateral .groupe-titre {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--doux); padding: .35rem .7rem;
}
.lateral a {
  display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border-radius: 8px;
  color: var(--texte); text-decoration: none; font-size: .93rem;
}
.lateral a:hover { background: var(--fond-2); }
.lateral a[aria-current="page"] { background: var(--accent-fond); color: var(--accent); font-weight: 600; }
.lateral a .ico { width: 1.25rem; display: inline-flex; justify-content: center; flex: none; opacity: .85; }
.lateral a .icone:last-of-type { flex: none; }
.icone { display: inline-block; vertical-align: middle; }
.lateral a .pastille-nb {
  margin-left: auto; background: var(--alerte-fond); color: var(--alerte);
  border-radius: 20px; padding: 0 .45rem; font-size: .75rem; font-weight: 700;
}
.lateral .pied { border-top: 1px solid var(--bord); margin-top: 1rem; padding-top: .8rem; }
.lateral .pied-mobile { display: none; padding-left: .7rem; }
.lateral .pied-mobile .bouton { margin-top: .5rem; }

main.contenu { padding: 1.4rem 1.6rem 3rem; min-width: 0; }
.page { max-width: 1200px; margin: 0 auto; }
.entete-page { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.entete-page > div:first-child { flex: 1 1 26rem; min-width: 0; }
.entete-page h1 { font-size: 1.45rem; margin: 0; }
h1[tabindex="-1"]:focus { outline: none; }
.entete-page .aide-page { color: var(--doux); margin: .3rem 0 0; max-width: 60rem; }
.entete-page .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.fil { font-size: .85rem; margin-bottom: .4rem; }
.fil a { text-decoration: none; }

.voile { display: none; }

/* ---------- Cartes ---------- */
.carte {
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon);
  box-shadow: var(--ombre); padding: 1.1rem 1.2rem; margin-bottom: 1.1rem;
}
.carte > h2, .carte-titre h2 { font-size: 1.02rem; margin: 0 0 .8rem; }
.carte-titre { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: .8rem; }
.carte-titre h2 { margin: 0; }
.carte-titre .actions { margin-left: auto; display: flex; gap: .4rem; flex-wrap: wrap; }
.carte.plate { box-shadow: none; }
.grille { display: grid; gap: 1.1rem; margin-bottom: 1.1rem; }
.grille.deux { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grille > .carte { margin-bottom: 0; }
.doux { color: var(--doux); }
.petit { font-size: .85rem; }

/* ---------- Bandeau de contexte ---------- */
.bandeau {
  display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; align-items: center;
  background: var(--surface); border: 1px solid var(--bord); border-left: 4px solid var(--accent);
  border-radius: 8px; padding: .6rem .9rem; margin-bottom: 1.1rem; font-size: .88rem;
}
.bandeau strong { font-weight: 600; }

/* ---------- Tuiles ---------- */
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.1rem; }
.tuile {
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon);
  box-shadow: var(--ombre); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .2rem;
  text-decoration: none; color: inherit;
}
a.tuile:hover { border-color: var(--accent); }
.tuile .libelle { font-size: .82rem; color: var(--doux); font-weight: 600; }
.tuile .valeur { font-size: 1.8rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tuile .valeur small { font-size: 1rem; color: var(--doux); font-weight: 500; }
.tuile .detail { font-size: .82rem; color: var(--doux); }
.tuile.ok { border-top: 3px solid var(--ok); }
.tuile.alerte { border-top: 3px solid var(--alerte); }
.tuile.danger { border-top: 3px solid var(--danger); }
.tuile.neutre { border-top: 3px solid var(--bord-fort); }

/* ---------- Alertes ---------- */
.alertes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.alertes li {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border-radius: 8px;
  border: 1px solid transparent; flex-wrap: wrap;
}
.alertes li.danger { background: var(--danger-fond); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.alertes li.alerte { background: var(--alerte-fond); border-color: color-mix(in srgb, var(--alerte) 35%, transparent); }
.alertes li.info { background: var(--info-fond); }
.alertes li .texte { flex: 1 1 14rem; }
.alertes li .texte strong { display: block; }

.encart {
  padding: .7rem .9rem; border-radius: 8px; margin: 0 0 .9rem; font-size: .9rem;
  background: var(--info-fond); border: 1px solid color-mix(in srgb, var(--info) 30%, transparent);
}
.encart.alerte { background: var(--alerte-fond); border-color: color-mix(in srgb, var(--alerte) 40%, transparent); }
.encart.danger { background: var(--danger-fond); border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--texte); }
.encart.ok { background: var(--ok-fond); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.encart p { margin: .2rem 0; }

/* ---------- Boutons ---------- */
.bouton {
  display: inline-flex; align-items: center; gap: .4rem;
  font: inherit; font-size: .92rem; font-weight: 500; line-height: 1.2;
  padding: .5rem .9rem; border-radius: 8px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--bord-fort); background: var(--surface); color: var(--texte);
  min-height: 38px; white-space: nowrap;
}
.bouton:hover { border-color: var(--accent); }
.bouton.primaire { background: var(--accent); border-color: var(--accent); color: var(--accent-txt); }
.bouton.primaire:hover { filter: brightness(1.08); }
.bouton.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--bord)); }
.bouton.danger.plein { background: var(--danger); color: #fff; border-color: var(--danger); }
.bouton.fantome { border-color: transparent; background: transparent; }
.bouton.fantome:hover { background: var(--fond-2); }
.bouton.petit { padding: .3rem .6rem; min-height: 32px; font-size: .85rem; }
.bouton:disabled, .bouton[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.bouton .rouage { width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* Menu « Plus » des lignes */
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu .menu-liste {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 13rem;
  background: var(--surface); border: 1px solid var(--bord); border-radius: 8px; box-shadow: var(--ombre-haute);
  padding: .3rem; display: flex; flex-direction: column;
}
details.menu .menu-liste button {
  font: inherit; text-align: left; background: none; border: 0; padding: .5rem .7rem; border-radius: 6px;
  cursor: pointer; color: var(--texte);
}
details.menu .menu-liste button:hover, details.menu .menu-liste button:focus-visible { background: var(--fond-2); }
details.menu .menu-liste button.danger { color: var(--danger); }
details.menu .menu-liste button:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Formulaires ---------- */
label, .label { display: block; font-size: .86rem; font-weight: 600; margin-bottom: .3rem; }
.requis-marque { color: var(--danger); margin-left: .15rem; }
input, select, textarea {
  font: inherit; color: var(--texte); background: var(--surface);
  border: 1px solid var(--bord-fort); border-radius: 8px; padding: .5rem .65rem; width: 100%;
  min-height: 40px;
}
textarea { min-height: 7rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--accent); }
.champ { margin-bottom: .95rem; min-width: 0; }
.champ .aide { font-size: .8rem; color: var(--doux); margin-top: .25rem; }
.champ .erreur { font-size: .82rem; color: var(--danger); margin-top: .25rem; font-weight: 600; }
.champs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.champs > .large { grid-column: 1 / -1; }
.avec-bouton { display: flex; gap: .4rem; }
.avec-bouton input { flex: 1; min-width: 0; }
.section-form { grid-column: 1 / -1; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--doux); font-weight: 700; margin: .4rem 0 .6rem; padding-top: .6rem; border-top: 1px solid var(--bord); }
.section-form:first-child { border-top: 0; padding-top: 0; }

.interrupteur { display: flex; align-items: flex-start; gap: .6rem; cursor: pointer; font-weight: 500; }
.interrupteur input { margin-top: .25rem; width: 1.1rem; height: 1.1rem; flex: none; }
.interrupteur span small { display: block; color: var(--doux); font-weight: 400; font-size: .8rem; }

.puces { display: flex; flex-wrap: wrap; gap: .35rem; }
.puces label {
  display: inline-flex; align-items: center; gap: .3rem; margin: 0; font-weight: 500;
  border: 1px solid var(--bord-fort); border-radius: 20px; padding: .3rem .7rem; cursor: pointer;
}
.puces label:has(input:checked) { background: var(--accent-fond); border-color: var(--accent); color: var(--accent); }
.puces input { margin: 0; }

.cases { border: 1px solid var(--bord); border-radius: 8px; max-height: 15rem; overflow: auto; }
.cases .case { display: flex; align-items: center; gap: .6rem; padding: .45rem .7rem; border-bottom: 1px solid var(--bord); }
.cases .case:last-child { border-bottom: 0; }
.cases .case label { margin: 0; font-weight: 500; flex: 1; cursor: pointer; }
.cases .case .rang { font-size: .78rem; color: var(--doux); min-width: 1.4rem; text-align: right; }
.cases .case .ordre { display: flex; gap: .2rem; }
.cases .vide-cases { padding: .7rem; color: var(--doux); font-size: .9rem; }
.cases-filtre { margin-bottom: .4rem; }

.lignes-rep { display: flex; flex-direction: column; gap: .6rem; }
.ligne-rep {
  border: 1px solid var(--bord); border-radius: 8px; padding: .7rem .8rem .2rem; background: var(--surface-2);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 .8rem; position: relative;
}
.ligne-rep .retirer { position: absolute; top: .35rem; right: .35rem; }
.ligne-rep .champ { margin-bottom: .6rem; }
.ligne-rep .champ.large { grid-column: 1 / -1; }

.destination-champ { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: .5rem; }

/* ---------- Barre d'outils / recherche ---------- */
.outils { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .8rem; }
.outils .recherche { position: relative; flex: 1 1 16rem; max-width: 26rem; }
.outils .recherche input { padding-left: 2rem; }
.outils .recherche::before {
  content: ""; position: absolute; left: .7rem; top: 50%; width: .7rem; height: .7rem;
  border: 2px solid var(--doux); border-radius: 50%; transform: translateY(-60%);
}
.outils .recherche::after {
  content: ""; position: absolute; left: 1.32rem; top: 58%; width: .4rem; height: 2px;
  background: var(--doux); transform: rotate(45deg);
}
.outils select { width: auto; min-width: 10rem; }
.outils .compte { color: var(--doux); font-size: .85rem; margin-left: auto; }

/* ---------- Tableaux ---------- */
.tableau-env { overflow-x: auto; }
table.tableau { border-collapse: collapse; width: 100%; font-size: .9rem; }
.tableau th, .tableau td { text-align: left; padding: .6rem .65rem; border-bottom: 1px solid var(--bord); vertical-align: middle; }
.tableau th { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); font-weight: 700; background: var(--surface-2); }
.tableau tbody tr:hover { background: var(--surface-2); }
.tableau tr:last-child td { border-bottom: 0; }
.tableau td.actions { text-align: right; white-space: nowrap; }
.tableau td.actions .bouton { margin-left: .25rem; }
.tableau .principal-cell { font-weight: 600; }
.tableau .sous { display: block; font-size: .8rem; color: var(--doux); font-weight: 400; }
.tableau a.lien-ligne { color: inherit; text-decoration: none; font-weight: 600; }
.tableau a.lien-ligne:hover { color: var(--accent); text-decoration: underline; }
.aucun-resultat td { text-align: center; color: var(--doux); padding: 1.4rem; }

/* ---------- Étiquettes ---------- */
.etiq {
  display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .55rem; border-radius: 20px;
  font-size: .76rem; font-weight: 600; background: var(--neutre-fond); color: var(--doux); white-space: nowrap;
}
.etiq.ok { background: var(--ok-fond); color: var(--ok); }
.etiq.alerte { background: var(--alerte-fond); color: var(--alerte); }
.etiq.danger { background: var(--danger-fond); color: var(--danger); }
.etiq.info { background: var(--info-fond); color: var(--info); }
.etiq::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; opacity: .85; }
.etiq.sans-point::before { display: none; }
.etiquettes { display: flex; flex-wrap: wrap; gap: .25rem; }

.pastille { width: .6rem; height: .6rem; border-radius: 50%; display: inline-block; background: var(--doux); flex: none; }
.pastille.actif { background: var(--ok); }
.pastille.injoignable { background: var(--danger); }
.pastille.enrole, .pastille.declare { background: var(--alerte); }

/* ---------- États vides, chargement ---------- */
.vide {
  text-align: center; padding: 2.2rem 1rem; color: var(--doux);
}
.vide .vide-titre { font-weight: 700; color: var(--texte); font-size: 1.05rem; margin-bottom: .3rem; }
.vide p { margin: .2rem auto .9rem; max-width: 34rem; }
.chargement { display: flex; align-items: center; gap: .6rem; color: var(--doux); padding: 2rem 0; justify-content: center; }
.chargement .rouage { width: 1.2rem; height: 1.2rem; border: 3px solid var(--bord-fort); border-right-color: var(--accent); border-radius: 50%; animation: tourne .8s linear infinite; }
.squelette { height: 1rem; border-radius: 6px; background: linear-gradient(90deg, var(--fond-2), var(--surface-2), var(--fond-2)); background-size: 200% 100%; animation: luit 1.2s ease-in-out infinite; margin: .6rem 0; }
@keyframes luit { to { background-position: -200% 0; } }

/* ---------- Questions ---------- */
.question { border: 1px solid var(--bord); border-radius: 8px; padding: .9rem 1rem; margin-bottom: .8rem; }
.question .meta { font-size: .82rem; color: var(--doux); display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.question h3 { font-size: 1rem; margin: .4rem 0; }
.question .texte-libre { white-space: pre-wrap; margin: .4rem 0; overflow-wrap: anywhere; }
.question .reponse { margin-top: .7rem; padding: .6rem .8rem; border-left: 3px solid var(--ok); background: var(--ok-fond); border-radius: 0 6px 6px 0; }
.question .actions { display: flex; gap: .4rem; margin-top: .7rem; flex-wrap: wrap; }

/* ---------- Fiche ---------- */
.fiche-entete { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent-fond); color: var(--accent); font-weight: 700; font-size: 1.2rem;
}
dl.proprietes { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; font-size: .92rem; }
dl.proprietes dt { color: var(--doux); }
dl.proprietes dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Dialogue ---------- */
dialog.dlg {
  border: 1px solid var(--bord); border-radius: 12px; background: var(--surface); color: var(--texte);
  padding: 0; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: var(--ombre-haute);
}
dialog.dlg.large { width: min(860px, calc(100vw - 24px)); }
dialog.dlg::backdrop { background: rgba(8, 12, 20, .55); }
dialog.dlg form { display: flex; flex-direction: column; max-height: calc(100vh - 34px); }
.dlg-tete { padding: 1rem 1.2rem .6rem; border-bottom: 1px solid var(--bord); }
.dlg-tete h2 { margin: 0; font-size: 1.12rem; }
.dlg-tete p { margin: .3rem 0 0; color: var(--doux); font-size: .9rem; }
.dlg-corps { padding: 1rem 1.2rem .2rem; overflow-y: auto; }
.dlg-pied { padding: .8rem 1.2rem; border-top: 1px solid var(--bord); display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; background: var(--surface-2); border-radius: 0 0 12px 12px; }
.secret-affiche {
  display: flex; gap: .5rem; align-items: center; background: var(--surface-2); border: 1px dashed var(--bord-fort);
  border-radius: 8px; padding: .6rem .7rem; margin: .5rem 0 .8rem; overflow-wrap: anywhere;
}
.secret-affiche code { flex: 1; font-size: .95rem; }

/* ---------- Notifications ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: .5rem; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  background: var(--surface); border: 1px solid var(--bord); border-left: 4px solid var(--ok);
  border-radius: 8px; box-shadow: var(--ombre-haute); padding: .7rem .9rem; display: flex; gap: .6rem; align-items: flex-start;
  animation: entre .18s ease-out;
}
.toast.err { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--info); }
.toast .t-texte { flex: 1; font-size: .92rem; overflow-wrap: anywhere; }
.toast button { background: none; border: 0; color: var(--doux); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0 .2rem; }
@keyframes entre { from { transform: translateY(8px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Supervision ---------- */
.grille-postes { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .6rem; }
.poste-carte { border: 1px solid var(--bord); border-radius: 8px; padding: .6rem .7rem; background: var(--surface-2); }
.poste-carte .num { font-weight: 700; }
.poste-carte .qui-poste { font-size: .82rem; color: var(--doux); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poste-carte.en-appel { border-color: var(--info); background: var(--info-fond); }
.poste-carte.hors-ligne { opacity: .7; }

audio { width: 100%; max-width: 320px; height: 36px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .appli { grid-template-columns: minmax(0, 1fr); }
  .barre > * { min-width: 0; }
  .barre .burger { display: inline-flex; }
  .barre { padding: 0 .6rem; gap: .5rem; }
  .barre .marque { min-width: 0; }
  .barre .marque .nom-marque { display: none; }
  .qui { display: none; }
  .lateral {
    position: fixed; top: var(--barre); left: 0; bottom: 0; width: min(300px, 86vw); height: auto; z-index: 40;
    transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--ombre-haute);
  }
  body.menu-ouvert .lateral { transform: none; }
  body.menu-ouvert .voile { display: block; position: fixed; inset: var(--barre) 0 0 0; background: rgba(0,0,0,.4); z-index: 35; }
  main.contenu { padding: 1rem 16px 3rem; }
  .contexte label { display: none; }
  .contexte select { max-width: 9.5rem; }
}
@media (max-width: 680px) {
  #deconnexion { display: none; }
  .lateral .pied-mobile { display: block; }
  .champs { grid-template-columns: 1fr; }
  .destination-champ { grid-template-columns: 1fr; }
  .entete-page h1 { font-size: 1.25rem; }
  .entete-page .actions { margin-left: 0; width: 100%; }
  .entete-page .actions .bouton { flex: 1; justify-content: center; }
  /* Tableau → cartes empilées */
  table.tableau.empilable thead { display: none; }
  table.tableau.empilable, .tableau.empilable tbody, .tableau.empilable tr, .tableau.empilable td { display: block; width: 100%; }
  .tableau.empilable tr { border: 1px solid var(--bord); border-radius: 8px; margin-bottom: .6rem; padding: .3rem .2rem; background: var(--surface); }
  .tableau.empilable tr.aucun-resultat { border: 0; }
  .tableau.empilable td { border: 0; padding: .3rem .6rem; display: flex; gap: .6rem; justify-content: space-between; align-items: center; text-align: right; }
  .tableau.empilable td::before { content: attr(data-label); font-size: .76rem; color: var(--doux); font-weight: 700; text-transform: uppercase; text-align: left; flex: none; }
  .tableau.empilable td { overflow-wrap: anywhere; }
  .tableau.empilable td.principal-cell { font-size: 1rem; display: block; text-align: left; }
  .tableau.empilable td.principal-cell::before { display: none; }
  .tableau.empilable td.actions { justify-content: flex-end; flex-wrap: wrap; padding-top: .5rem; }
  .tableau.empilable td.actions::before { display: none; }
  .tableau.empilable td:empty { display: none; }
  .outils .recherche { max-width: none; }
  .outils .compte { margin-left: 0; }
  .dlg-pied .bouton { flex: 1; justify-content: center; }
  .tuile .valeur { font-size: 1.5rem; }
  .toasts { left: 16px; right: 16px; bottom: 12px; max-width: none; }
}

/* =====================================================================
 * Menus vocaux (SVI) : éditeur visuel
 * Une couleur par type de destination (--t), lisible en clair et en sombre.
 * ===================================================================== */
:root {
  --t-groupe: #6b3fb5; --t-file: #a85400; --t-poste: #0069a8; --t-messagerie: #13735a;
  --t-svi: #003c66; --t-horaire: #7d6200; --t-externe: #a8295f; --t-repeter: #4f6478; --t-raccrocher: #b4261b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) {
    --t-groupe: #b89cf0; --t-file: #f5a85a; --t-poste: #5cc8f2; --t-messagerie: #5fd0a8;
    --t-svi: #00a9eb; --t-horaire: #e8c252; --t-externe: #f08cb8; --t-repeter: #a2adba; --t-raccrocher: #ff8a80;
  }
}
:root[data-theme="sombre"] {
  --t-groupe: #b89cf0; --t-file: #f5a85a; --t-poste: #5cc8f2; --t-messagerie: #5fd0a8;
  --t-svi: #00a9eb; --t-horaire: #e8c252; --t-externe: #f08cb8; --t-repeter: #a2adba; --t-raccrocher: #ff8a80;
}
.t-groupe { --t: var(--t-groupe); } .t-file { --t: var(--t-file); } .t-poste { --t: var(--t-poste); }
.t-messagerie { --t: var(--t-messagerie); } .t-svi { --t: var(--t-svi); } .t-horaire { --t: var(--t-horaire); }
.t-externe { --t: var(--t-externe); } .t-repeter { --t: var(--t-repeter); } .t-raccrocher { --t: var(--t-raccrocher); }
.t-annonce { --t: var(--accent); } .t-vide { --t: var(--danger); }

button.lien { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.svi-ico { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--t, var(--accent)) 15%, transparent); color: var(--t, var(--accent)); }

/* ---------- Liste des menus ---------- */
.svi-fiches { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1rem; margin-bottom: 1.1rem; }
.svi-fiche { margin: 0; display: flex; flex-direction: column; gap: .55rem; }
.svi-fiche-tete { display: flex; align-items: center; gap: .6rem; }
.svi-fiche-tete h2 { margin: 0; font-size: 1.08rem; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.svi-fiche-tete h2 a { color: inherit; text-decoration: none; }
.svi-fiche-tete h2 a:hover { color: var(--accent); text-decoration: underline; }
.svi-fiche-annonce { margin: 0; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.svi-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.svi-mini li { display: flex; align-items: center; gap: .5rem; font-size: .9rem; border-left: 4px solid var(--t, var(--bord-fort)); padding-left: .5rem; }
.svi-mini li.manquante { border-left-color: var(--danger); color: var(--danger); }
.svi-fiche-arrivee { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.svi-puce { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; padding: .1rem .55rem; border-radius: 20px; background: var(--neutre-fond); }
.svi-puce .icone, .svi-legende .icone, .svi-flux-cible .icone { width: 14px; height: 14px; }
.svi-fiche-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: auto; padding-top: .3rem; }
.svi-titre-section { font-size: 1rem; margin: .5rem 0 .7rem; color: var(--doux); }
.svi-reprise { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* ---------- Éditeur : mise en page ---------- */
.svi-plan { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1.1rem; align-items: start; }
.svi-cote { position: sticky; top: calc(var(--barre) + 1rem); }
.svi-etat { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.svi-etat > span { flex: 1 1 18rem; }
.svi-arbre .carte-titre h2, .svi-entree .carte-titre h2, .svi-texte h2 { display: flex; align-items: center; gap: .45rem; }
.svi-entree:focus, .svi-verif:focus { outline: none; }

/* ---------- Entrée des appels ---------- */
.svi-flux-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.svi-flux { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .55rem .7rem; background: var(--surface-2); border: 1px solid var(--bord); border-radius: 8px; }
.svi-flux-h { flex-direction: column; align-items: stretch; }
.svi-flux-h > div:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.svi-flux.prevu { border-style: dashed; border-color: var(--info); }
.svi-flux-cible { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .6rem; border-radius: 20px; font-weight: 600; font-size: .88rem;
  background: color-mix(in srgb, var(--t, var(--accent)) 14%, transparent); color: var(--t, var(--accent)); }
.svi-fleche { color: var(--doux); font-weight: 700; }
.svi-aiguillage { display: flex; flex-direction: column; gap: .3rem; margin: .45rem 0 0 .9rem; padding-left: .8rem; border-left: 2px solid var(--bord-fort); }
.svi-aiguillage > div { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.svi-cond { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; min-width: 4.2rem; color: var(--doux); }
.svi-entree-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .7rem; }

/* ---------- Arbre ---------- */
.svi-menu-tete { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; flex-wrap: wrap; }
.svi-menu-ico { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-fond); color: var(--accent); }
.svi-menu-nom { flex: 1 1 12rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; min-width: 0; }
.svi-menu-nom strong { font-size: 1.05rem; overflow-wrap: anywhere; }
.svi-carte {
  display: flex; align-items: center; gap: .75rem; width: 100%; text-align: left; font: inherit; color: var(--texte);
  background: var(--surface); border: 1px solid var(--bord); border-left: 5px solid var(--t, var(--bord-fort));
  border-radius: 10px; padding: .6rem .75rem; min-height: 58px; position: relative;
}
button.svi-carte { cursor: pointer; }
button.svi-carte:hover { border-color: var(--t); border-left-width: 5px; box-shadow: var(--ombre); }
.svi-carte.a-corriger { border-style: dashed; border-left-style: solid; }
.svi-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.svi-sur { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--t, var(--doux)); }
.svi-titre { font-weight: 600; overflow-wrap: anywhere; }
.svi-ligne { font-size: .84rem; color: var(--doux); overflow-wrap: anywhere; }
.svi-type { font-weight: 600; color: var(--texte); }
.svi-modifier { color: var(--doux); flex: none; opacity: .75; }
button.svi-carte:hover .svi-modifier, button.svi-carte:focus-visible .svi-modifier { color: var(--accent); opacity: 1; }
.svi-alerte { flex: none; width: 1.4rem; height: 1.4rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem;
  background: var(--danger); color: var(--surface); }
.svi-branches { list-style: none; margin: .55rem 0 0 1.15rem; padding: 0 0 0 1.4rem; border-left: 2px solid var(--bord-fort); display: flex; flex-direction: column; gap: .55rem; }
.svi-branche { display: flex; gap: .6rem; align-items: flex-start; position: relative; }
.svi-branche::before { content: ""; position: absolute; left: -1.4rem; top: 1.45rem; width: 1.4rem; border-top: 2px solid var(--bord-fort); }
.svi-branche:last-child::after { content: ""; position: absolute; left: calc(-1.4rem - 2px); top: calc(1.45rem + 2px); bottom: 0; width: 2px; background: var(--surface); }
.svi-sous .svi-branche:last-child::after { background: var(--surface-2); }
.svi-touche {
  flex: none; width: 2.6rem; height: 2.6rem; margin-top: .4rem; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 1.15rem; background: var(--accent); color: var(--accent-txt); font-variant-numeric: tabular-nums;
}
.svi-touche.special { background: var(--neutre-fond); color: var(--doux); }
.svi-touche.plus { background: transparent; border: 2px dashed var(--bord-fort); color: var(--doux); }
.svi-touche.petite { width: 1.7rem; height: 1.7rem; margin-top: 0; font-size: .85rem; }
.svi-branche-corps { flex: 1; min-width: 0; }
.svi-sous { margin-top: .6rem; padding: .75rem .8rem .8rem; border: 1px dashed var(--bord-fort); border-radius: 12px; background: var(--surface-2); }
.svi-sous .svi-carte { background: var(--surface); }
.svi-bouton-ajout { width: 100%; justify-content: center; border-style: dashed; min-height: 46px; margin-top: .2rem; color: var(--accent); font-weight: 600; }
.svi-renvoi { margin: .4rem 0 0; display: flex; align-items: center; gap: .35rem; }

/* ---------- Colonne : vérification, texte, légende ---------- */
.svi-verif h2, .svi-texte h2, .svi-legende h2 { font-size: 1rem; }
.svi-verif-liste { list-style: none; padding: 0; margin: 0 0 .7rem; display: flex; flex-direction: column; gap: .4rem; }
.svi-verif-liste li { display: flex; gap: .5rem; font-size: .87rem; padding: .45rem .55rem; border-radius: 8px; align-items: flex-start; }
.svi-verif-liste li.erreur { background: var(--danger-fond); }
.svi-verif-liste li.conseil { background: var(--info-fond); }
.svi-verif-ico { flex: none; width: 1.3rem; height: 1.3rem; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; color: var(--surface); background: var(--danger); margin-top: .1rem; }
.conseil .svi-verif-ico { background: var(--info); }
.svi-ok { color: var(--ok); font-weight: 600; margin: 0 0 .5rem; }
.svi-citation { font-style: italic; border-left: 3px solid var(--accent); padding: .45rem .7rem; background: var(--surface-2); border-radius: 0 6px 6px 0; margin: 0 0 .6rem; overflow-wrap: anywhere; }
.svi-legende ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .35rem .6rem; font-size: .84rem; }
.svi-legende li { display: flex; align-items: center; gap: .45rem; }
.svi-legende .svi-ico { width: 26px; height: 26px; }

/* ---------- Dialogues de l'éditeur ---------- */
.svi-dlg .dlg-pied .svi-gauche { margin-right: auto; }
.dest-choix, .svi-clavier-champ, .svi-radios, .svi-modeles { border: 0; padding: 0; margin: 0 0 .8rem; min-width: 0; }
.dest-choix legend, .svi-clavier-champ legend, .svi-radios legend { font-weight: 600; font-size: .9rem; margin-bottom: .45rem; padding: 0; }
.svi-radios { display: flex; flex-direction: column; gap: .5rem; }
.dest-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: .45rem; margin-bottom: .8rem; }
.dest-type, .svi-modele { display: flex; align-items: center; gap: .55rem; margin: 0; padding: .5rem .6rem; border: 1px solid var(--bord-fort); border-radius: 10px; cursor: pointer; font-weight: 500; position: relative; }
.dest-type input, .svi-modele input, .svi-k input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.dest-type:has(input:checked) { border-color: var(--t); background: color-mix(in srgb, var(--t) 12%, var(--surface)); box-shadow: inset 0 0 0 1px var(--t); }
.dest-type:has(input:focus-visible), .svi-modele:has(input:focus-visible), .svi-k:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.dest-type .svi-ico { width: 30px; height: 30px; }
.dest-type strong, .svi-modele strong { display: block; font-size: .9rem; }
.dest-type small, .svi-modele small { display: block; color: var(--doux); font-size: .76rem; font-weight: 400; }
.dest-liste { display: flex; flex-direction: column; border: 1px solid var(--bord); border-radius: 8px; max-height: 16rem; overflow: auto; }
.dest-item { display: flex; gap: .6rem; align-items: flex-start; margin: 0; padding: .5rem .7rem; border-bottom: 1px solid var(--bord); cursor: pointer; font-weight: 400; }
.dest-item:last-child { border-bottom: 0; }
.dest-item:has(input:checked) { background: var(--accent-fond); }
.dest-item input { margin-top: .3rem; flex: none; }
.dest-item strong { display: block; font-weight: 600; }
.dest-item small { display: block; color: var(--doux); font-size: .8rem; }
.dest-item.desactive { opacity: .55; cursor: not-allowed; }
.dest-item.nouveau-sm strong { color: var(--accent); }
.dest-nom-sm { padding: .5rem .7rem .6rem; border-bottom: 1px solid var(--bord); margin: 0; background: var(--surface-2); }
.dest-filtre { margin-bottom: .4rem; }
.dest-cible p { margin: .2rem 0 .6rem; display: flex; align-items: center; gap: .4rem; }
.dest-cible p.encart { display: block; }

.svi-choix-haut { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.2rem; align-items: start; margin-bottom: .4rem; }
.svi-clavier { display: grid; grid-template-columns: repeat(3, 4.3rem); gap: .4rem; }
.svi-k { position: relative; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 3.4rem;
  border: 1px solid var(--bord-fort); border-radius: 12px; cursor: pointer; background: var(--surface); font-weight: 700; }
.svi-k-chiffre { font-size: 1.35rem; line-height: 1; }
.svi-k small { font-size: .62rem; font-weight: 500; color: inherit; opacity: .8; max-width: 3.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svi-k:hover { border-color: var(--accent); }
.svi-k:has(input:checked) { background: var(--accent); color: var(--accent-txt); border-color: var(--accent); }
.svi-k.prise { background: var(--neutre-fond); color: var(--doux); cursor: not-allowed; border-style: dashed; }
.svi-k.prise:hover { border-color: var(--bord-fort); }
.svi-clavier-champ p { margin: .4rem 0 0; }
.svi-an-son, .svi-h-nouveau, [data-h-existant] { margin-left: 1.7rem; }
.svi-creneaux { display: flex; flex-wrap: wrap; gap: .3rem .7rem; align-items: flex-end; margin-top: .6rem; }
.svi-creneaux .champ { width: 8.2rem; margin-bottom: .4rem; }
.svi-pause { align-self: center; margin-bottom: .4rem; }

.svi-modeles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .6rem; }
.svi-modele { align-items: flex-start; padding: .8rem; border-radius: 12px; }
.svi-modele:has(input:checked) { border-color: var(--accent); background: var(--accent-fond); box-shadow: inset 0 0 0 1px var(--accent); }
.svi-modele-ico { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-fond); color: var(--accent); }
.svi-modele:has(input:checked) .svi-modele-ico { background: var(--accent); color: var(--accent-txt); }
.svi-modele-lignes { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .45rem; }
.svi-modele-lignes li { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.3fr); gap: .5rem; align-items: center; }
.svi-modele-lignes li.niveau-1 { margin-left: 2.2rem; }
.svi-modele-lignes .svi-flux-cible { justify-self: start; }

/* ---------- Simulation ---------- */
.sim-corps { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 1rem; margin-bottom: .8rem; }
.sim-tel { background: linear-gradient(170deg, #003c66, #01263f); border-radius: 22px; padding: .9rem; color: #fff; display: flex; flex-direction: column; gap: .7rem; }
.sim-ecran { background: rgba(255, 255, 255, .1); border-radius: 12px; padding: .6rem .7rem; min-height: 4rem; display: flex; flex-direction: column; gap: .15rem; }
.sim-ecran span { font-size: .8rem; opacity: .88; }
.sim-clavier { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; }
.sim-k { font: inherit; height: 3.5rem; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .08); color: #fff;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; }
.sim-k span { font-size: 1.4rem; font-weight: 700; line-height: 1; }
.sim-k small { font-size: .62rem; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 .25rem; min-height: .85rem; }
.sim-k.prevue { background: #00a9eb; border-color: #00a9eb; color: #04131f; }
.sim-k:disabled { opacity: .4; cursor: not-allowed; }
.sim-k:hover:not(:disabled) { filter: brightness(1.15); }
.sim-k:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.sim-actions { display: flex; gap: .4rem; }
.sim-actions .bouton { flex: 1; justify-content: center; padding-left: .4rem; padding-right: .4rem; }
.sim-droite h3 { margin: 0 0 .5rem; text-transform: uppercase; letter-spacing: .05em; color: var(--doux); }
.sim-journal { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; max-height: 26rem; overflow: auto; }
.sim-journal li { padding: .45rem .6rem .45rem .7rem; border-left: 4px solid var(--t, var(--bord-fort)); background: var(--surface-2); border-radius: 0 6px 6px 0; font-size: .9rem; }
.sim-journal li.dernier { font-weight: 600; }
.sim-svi { --t: var(--t-svi); } .sim-groupe_appel { --t: var(--t-groupe); } .sim-file { --t: var(--t-file); } .sim-extension { --t: var(--t-poste); }
.sim-boite_vocale { --t: var(--t-messagerie); } .sim-plage_horaire { --t: var(--t-horaire); } .sim-numero_externe { --t: var(--t-externe); }
.sim-raccrocher { --t: var(--t-raccrocher); } .sim-repeter, .sim-attente, .sim-suite { --t: var(--t-repeter); } .sim-invalide { --t: var(--danger); }
.sim-touche, .sim-appel { --t: var(--accent); }

@media (max-width: 1180px) {
  .svi-plan { grid-template-columns: minmax(0, 1fr); }
  .svi-cote { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 1.1rem; }
}
@media (max-width: 760px) {
  .sim-corps { grid-template-columns: minmax(0, 1fr); }
  .sim-tel { max-width: 340px; width: 100%; margin: 0 auto; }
}
@media (max-width: 680px) {
  .svi-fiches { grid-template-columns: minmax(0, 1fr); }
  .svi-branches { margin-left: .55rem; padding-left: .8rem; gap: .5rem; }
  .svi-branche::before { left: -.8rem; width: .8rem; top: 1.25rem; }
  .svi-branche:last-child::after { left: calc(-.8rem - 2px); top: calc(1.25rem + 2px); }
  .svi-branche { gap: .4rem; }
  .svi-touche { width: 2.1rem; height: 2.1rem; font-size: 1rem; margin-top: .25rem; }
  .svi-touche .icone { width: 15px; height: 15px; }
  .svi-carte { padding: .5rem .55rem; gap: .5rem; }
  .svi-carte .svi-ico { width: 30px; height: 30px; }
  .svi-sous { padding: .6rem .5rem; margin-left: calc(-2.1rem - .4rem); }
  .svi-carte .svi-ico { display: none; }
  .svi-carte { border-left-width: 6px; }
  .svi-ligne .doux { display: none; }
  .svi-choix-haut { grid-template-columns: minmax(0, 1fr); }
  .svi-clavier { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 15rem; }
  .svi-modele-lignes li { grid-template-columns: auto minmax(0, 1fr); }
  .svi-modele-lignes li > :last-child { grid-column: 2; }
  .svi-modele-lignes li.niveau-1 { margin-left: 1rem; }
  .svi-an-son, .svi-h-nouveau, [data-h-existant] { margin-left: 0; }
  .svi-legende ul { grid-template-columns: 1fr 1fr; }
  .svi-dlg .dlg-pied .svi-gauche { margin-right: 0; }
}

/* =====================================================================
 * Annonces vocales (js/annonces.js) : onglets, dépôt, micro, aperçu
 * ===================================================================== */
.an-actuelle { margin: 0 0 .9rem; }
.an-actuelle-tete { display: flex; align-items: center; gap: .6rem; padding: .6rem .7rem; border: 1px solid var(--bord); border-radius: 10px; background: var(--surface-2); }
.an-actuelle-tete > div { flex: 1; min-width: 0; }
.an-actuelle-tete strong { display: block; overflow-wrap: anywhere; }
.an-actuelle-tete small { display: block; }
.an-etats { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .45rem 0 0; }
.an-actuelle audio, .an-apercu audio, [data-lecteur-liste], .an-fiche audio, [data-lecteur-sim] { width: 100%; margin-top: .5rem; }
.an-onglets { display: flex; flex-wrap: wrap; gap: .3rem; border-bottom: 2px solid var(--bord); margin-bottom: .8rem; }
.an-onglets [role=tab] { font: inherit; font-size: .9rem; font-weight: 600; display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem .8rem; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; background: none; color: var(--doux); cursor: pointer; border-radius: 8px 8px 0 0; }
.an-onglets [role=tab]:hover { color: var(--texte); background: var(--surface-2); }
.an-onglets [role=tab][aria-selected=true] { color: var(--accent); border-bottom-color: var(--accent); }
.an-onglets [role=tab]:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.an-panneau { margin-bottom: .6rem; }
.an-depot { border: 2px dashed var(--bord-fort); border-radius: 12px; padding: 1rem; text-align: center; }
.an-depot p { margin: .3rem 0 .7rem; }
.an-depot input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.an-depot.survol { border-color: var(--accent); background: var(--accent-fond); }
.an-depot.occupe { opacity: .6; pointer-events: none; }
.an-micro { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-bottom: .5rem; }
.an-rec.en-cours { background: var(--danger); border-color: var(--danger); }
.an-jauge { flex: 1 1 8rem; height: .6rem; border-radius: 99px; background: var(--neutre-fond); overflow: hidden; }
.an-jauge span { display: block; height: 100%; width: 0; background: var(--ok); transition: width .1s linear; }
.an-chrono { font-variant-numeric: tabular-nums; font-weight: 600; }
.an-apercu { border: 1px solid var(--bord); border-radius: 12px; padding: .7rem .8rem; margin: .4rem 0 .8rem; background: var(--surface-2); }
.an-apercu .label { margin-top: 0; }
.an-duree { display: flex; align-items: center; gap: .6rem; margin: .5rem 0 .7rem; flex-wrap: wrap; }
.an-duree-barre { flex: 1 1 8rem; height: .5rem; border-radius: 99px; background: var(--neutre-fond); overflow: hidden; }
.an-duree-barre span { display: block; height: 100%; width: 0; background: var(--accent); }
.an-duree-barre span.long { background: var(--alerte); }
.an-liste { display: flex; flex-direction: column; border: 1px solid var(--bord); border-radius: 8px; max-height: 18rem; overflow: auto; }
.an-item { align-items: center; }
.an-item-txt { flex: 1; min-width: 0; }
.an-item .bouton { flex: none; }
.an-avance { margin-top: .4rem; font-size: .9rem; }
.an-avance summary { cursor: pointer; color: var(--doux); }
.an-avance .champ { margin-top: .5rem; }
.svi-son { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .8rem; color: var(--doux); margin: .1rem 0 .15rem; }
.actions-ligne { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; }
.an-fiche { margin: 0; display: flex; flex-direction: column; gap: .45rem; }
.an-fiche .svi-fiche-tete { flex-wrap: wrap; }
.an-fiche p { margin: 0; }
@media (max-width: 680px) {
  .an-onglets [role=tab] { flex: 1 1 45%; justify-content: center; }
}
.an-fiche .svi-fiche-tete h2 { flex: 1 1 12rem; }
.an-fiche .svi-fiche-tete .etiq { flex: none; }
.an-fiche .svi-fiche-actions { margin-top: auto; }
