/* Copyright (C) 2026 ACF Informatique et Entreprise
   Portail client ACF Support — feuille de style autonome, aucune dependance au
   theme Dolibarr. Un seul script (public/pwa/portal.js, application installable),
   seul autorise par la CSP ; tout le reste fonctionne sans lui.
   Charte ACF : ardoise #425b65, texte ardoise sombre, logo couleur sur entete claire. */

:root {
  --acf-ink:#233038;          /* texte principal */
  --acf-muted:#6b7c82;        /* texte secondaire */
  --acf-slate:#425b65;        /* couleur ACF (boutons, liens, accents) */
  --acf-slate-d:#35484f;      /* survol */
  --acf-slate-t:#eef3f5;      /* aplat ardoise tres clair */
  --acf-bg:#f3f6f7;           /* fond de page */
  --acf-card:#ffffff;
  --acf-line:#e5eaec;         /* filets */
  --acf-ring:rgba(66,91,101,.32);
  --acf-radius:14px;
  --acf-shadow:0 1px 2px rgba(16,32,39,.04), 0 10px 28px rgba(16,32,39,.06);
  --acf-shadow-sm:0 1px 2px rgba(16,32,39,.05);
}

* { box-sizing:border-box; }

html { -webkit-text-size-adjust:100%; }

body.acfticket-portal {
  margin:0;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  background:var(--acf-bg);
  color:var(--acf-ink);
  font:15px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
}

.acfticket-wrap { width:100%; max-width:820px; margin:0 auto; padding:0 20px; }

/* ---------- Entete ---------- */
.acfticket-head {
  background:var(--acf-card);
  border-bottom:1px solid var(--acf-line);
  box-shadow:var(--acf-shadow-sm);
}
.acfticket-head .acfticket-wrap {
  display:flex; align-items:center; gap:16px;
  min-height:68px; padding-top:10px; padding-bottom:10px;
}
.acfticket-brand { display:flex; align-items:center; gap:12px; text-decoration:none; color:inherit; }
.acfticket-logo { height:38px; width:auto; display:block; }
.acfticket-brand-name {
  font-weight:600; font-size:15px; color:var(--acf-slate);
  padding-left:14px; margin-left:2px; border-left:1px solid var(--acf-line);
  letter-spacing:.2px;
}
.acfticket-session { margin-left:auto; display:flex; align-items:center; gap:14px; }
.acfticket-user { color:var(--acf-muted); font-size:13.5px; max-width:200px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.acfticket-logout { margin:0; }
.acfticket-logout-btn {
  background:none; border:0; color:var(--acf-muted); cursor:pointer;
  font:inherit; font-size:13.5px; padding:6px 4px; text-decoration:underline; text-underline-offset:3px;
}
.acfticket-logout-btn:hover { color:var(--acf-slate); }

/* ---------- Zone principale ---------- */
main.acfticket-wrap { flex:1 0 auto; padding-top:28px; padding-bottom:40px; }

.acfticket-card {
  background:var(--acf-card);
  border:1px solid var(--acf-line);
  border-radius:var(--acf-radius);
  box-shadow:var(--acf-shadow);
  padding:26px 28px;
}
.acfticket-card + .acfticket-card { margin-top:18px; }
.acfticket-card h1 { margin:0 0 6px; font-size:22px; font-weight:650; letter-spacing:-.2px; }

/* Fil d'Ariane / retour */
.acfticket-back {
  display:inline-flex; align-items:center; gap:6px;
  color:var(--acf-muted); text-decoration:none; font-size:14px; font-weight:500;
  margin-bottom:14px;
}
.acfticket-back:hover { color:var(--acf-slate); }

/* Barre d'outils (liste) */
.acfticket-toolbar { display:flex; align-items:center; gap:14px; margin-bottom:6px; }
.acfticket-toolbar h1 { margin:0; }
.acfticket-toolbar .acfticket-btn { margin-left:auto; }

/* ---------- Boutons ---------- */
.acfticket-btn, button {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  background:var(--acf-slate); color:#fff; border:0; border-radius:10px;
  padding:11px 18px; font:inherit; font-size:14.5px; font-weight:600; line-height:1;
  cursor:pointer; text-decoration:none; transition:background .15s, box-shadow .15s, transform .05s;
}
.acfticket-btn:hover, button:hover { background:var(--acf-slate-d); }
.acfticket-btn:active, button:active { transform:translateY(1px); }
.acfticket-btn svg, button svg { flex:0 0 auto; }
.acfticket-btn.secondary {
  background:#fff; color:var(--acf-slate); border:1px solid var(--acf-line);
}
.acfticket-btn.secondary:hover { background:var(--acf-slate-t); }
.acfticket-logout-btn, .acfticket-back { } /* exclus du style bouton ci-dessus (pas .acfticket-btn/button) */

/* ---------- Formulaires ---------- */
label { display:block; margin:16px 0 7px; font-weight:600; font-size:13.5px; color:#3a4850; }
input, textarea, select {
  width:100%; padding:11px 13px; border:1px solid #cfd8dc; border-radius:10px;
  font:inherit; color:var(--acf-ink); background:#fff; transition:border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color:#9aa7ac; }
input:focus, textarea:focus, select:focus {
  outline:none; border-color:var(--acf-slate); box-shadow:0 0 0 3px var(--acf-ring);
}
textarea { resize:vertical; min-height:96px; }
select {
  appearance:none; -webkit-appearance:none; padding-right:38px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7c82' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 14px center;
}
form button { margin-top:18px; }
form button.full { width:100%; }

/* Champ code a 6 chiffres : effet « cases » sans JS */
.acfticket-code {
  font-size:26px; font-weight:600; letter-spacing:14px; text-indent:14px;
  text-align:center; font-variant-numeric:tabular-nums; padding:14px 13px;
}

/* ---------- Ecran de connexion ---------- */
.acfticket-auth { max-width:430px; margin:14px auto; }
.acfticket-auth .acfticket-card { padding:30px 30px 34px; }
.acfticket-auth h1 { text-align:center; }
.acfticket-auth .acfticket-lead { text-align:center; color:var(--acf-muted); margin:0 0 18px; }
.acfticket-auth .acfticket-mark { display:flex; justify-content:center; margin-bottom:18px; }
.acfticket-auth .acfticket-mark img { height:46px; }

/* « Rester connecte sur cet appareil » (cochee d office) */
.acfticket-remember {
  display:flex; align-items:center; gap:9px; margin:16px 0 0;
  font-weight:500; font-size:14px; color:var(--acf-ink); cursor:pointer;
}
.acfticket-remember input {
  flex:none; width:18px; height:18px; margin:0; padding:0;
  accent-color:var(--acf-slate); box-shadow:none;
}
.acfticket-remember-hint { margin:4px 0 0 27px; font-size:12.5px; line-height:1.4; color:var(--acf-muted); }

/* ---------- Messages systeme ---------- */
.acfticket-err, .acfticket-info {
  padding:11px 14px; border-radius:10px; font-size:14px; margin:0 0 16px; border:1px solid transparent;
}
.acfticket-err { background:#fcebe9; border-color:#f3cfca; color:#9d2f22; }
.acfticket-info { background:var(--acf-slate-t); border-color:#d6e3e7; color:#2f5059; }
.acfticket-empty {
  color:var(--acf-muted); text-align:center; padding:34px 10px;
  border:1px dashed var(--acf-line); border-radius:12px; margin-top:16px;
}

.acfticket-meta { color:var(--acf-muted); font-size:14px; margin:2px 0 0; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.acfticket-meta .dot { color:#c3ccd0; }

/* ---------- Liste des tickets ---------- */
.acfticket-table { width:100%; border-collapse:separate; border-spacing:0; margin-top:14px; }
.acfticket-table th {
  text-align:left; padding:0 14px 10px; font-size:11.5px; font-weight:600;
  text-transform:uppercase; letter-spacing:.6px; color:var(--acf-muted); border-bottom:1px solid var(--acf-line);
}
.acfticket-table td { padding:14px; border-bottom:1px solid var(--acf-line); vertical-align:middle; }
.acfticket-table tbody tr { transition:background .12s; }
.acfticket-table tbody tr:hover { background:var(--acf-slate-t); }
.acfticket-table tbody tr:last-child td { border-bottom:0; }
.acfticket-table a { color:var(--acf-ink); text-decoration:none; font-weight:600; }
.acfticket-table a:hover { color:var(--acf-slate); }
.acfticket-table td.col-ref { white-space:nowrap; }
.acfticket-table .col-ref a { color:var(--acf-slate); font-variant-numeric:tabular-nums; font-size:13.5px; }
.acfticket-table .col-date { color:var(--acf-muted); font-size:13.5px; white-space:nowrap; }

/* ---------- Pastilles de statut ---------- */
.acfticket-status {
  display:inline-flex; align-items:center; gap:6px; white-space:nowrap;
  padding:3px 11px 3px 9px; border-radius:999px; font-size:12.5px; font-weight:600;
  background:#eef1f2; color:#566065;
}
.acfticket-status::before { content:""; width:7px; height:7px; border-radius:50%; background:currentColor; opacity:.9; }
.acfticket-status.s0, .acfticket-status.s1 { background:#fdf1d6; color:#8a6a16; }
.acfticket-status.s2, .acfticket-status.s3 { background:#e4eef4; color:#285a79; }
.acfticket-status.s5 { background:#fde3cf; color:#9a4f1c; }
.acfticket-status.s7 { background:#edf0f1; color:#586167; }
.acfticket-status.s8 { background:#e4efe1; color:#3e6b3f; }
.acfticket-status.s9 { background:#eceef0; color:#737a80; }

/* ---------- Fil de conversation ---------- */
.acfticket-thread { margin-top:20px; display:flex; flex-direction:column; gap:16px; }
.acfticket-msg { max-width:86%; }
.acfticket-msg.client { align-self:flex-start; }
.acfticket-msg.agent  { align-self:flex-end; }
.acfticket-msg-head { display:flex; align-items:center; gap:8px; margin-bottom:5px; font-size:12.5px; }
.acfticket-msg.agent .acfticket-msg-head { justify-content:flex-end; }
.acfticket-msg-who { font-weight:600; color:#44535b; }
.acfticket-msg.agent .acfticket-msg-who { color:var(--acf-slate); }
.acfticket-msg-date { color:var(--acf-muted); }
.acfticket-msg-body {
  padding:13px 16px; border-radius:16px; overflow-wrap:anywhere;
}
.acfticket-msg.client .acfticket-msg-body {
  background:var(--acf-slate-t); border:1px solid #dde8ea; border-bottom-left-radius:5px;
}
.acfticket-msg.agent .acfticket-msg-body {
  background:#fff; border:1px solid var(--acf-line); border-left:3px solid var(--acf-slate);
  border-bottom-right-radius:5px; box-shadow:var(--acf-shadow-sm);
}
.acfticket-msg-body p:first-child { margin-top:0; }
.acfticket-msg-body p:last-child { margin-bottom:0; }
/* Listes et citations des reponses redigees en texte enrichi */
.acfticket-msg-body ul, .acfticket-msg-body ol { margin:6px 0; padding-left:22px; }
/* Historique cite par un e-mail du client : replie (details/summary, sans script). */
.acfticket-quote { margin:6px 0 0; font-size:13px; color:var(--acf-muted); }
.acfticket-quote summary { cursor:pointer; }
.acfticket-quote-text { margin:6px 0 0; padding:2px 0 2px 10px; border-left:3px solid var(--acf-line); overflow-wrap:anywhere; }
.acfticket-msg-body blockquote {
  margin:8px 0; padding:2px 0 2px 12px; border-left:3px solid var(--acf-line); color:var(--acf-muted);
}

/* Pieces jointes d un message, sous la bulle */
.acfticket-msg-files { list-style:none; margin:8px 0 0; padding:0; display:flex; flex-wrap:wrap; gap:6px; }
.acfticket-msg.agent .acfticket-msg-files { justify-content:flex-end; }
.acfticket-msg-files li {
  display:flex; align-items:center; gap:8px; max-width:100%; padding:7px 11px;
  border:1px solid var(--acf-line); border-radius:10px; background:#fff; font-size:13.5px;
}
.acfticket-msg-files a { color:var(--acf-slate); text-decoration:none; font-weight:600; overflow-wrap:anywhere; }
.acfticket-msg-files a:hover { text-decoration:underline; text-underline-offset:3px; }
.acfticket-msg-files a::before {
  content:""; display:inline-block; width:14px; height:14px; margin-right:7px; vertical-align:-2px;
  background:no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23425b65' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48'/%3E%3C/svg%3E");
}
.acfticket-msg-files .acfticket-filemeta { margin-left:0; }

/* Demande initiale mise en avant */
.acfticket-first {
  margin-top:18px; padding:16px 18px; background:var(--acf-slate-t);
  border:1px solid #dde8ea; border-radius:12px;
}
.acfticket-first .acfticket-msg-head { margin-bottom:7px; }

/* Composer de reponse */
.acfticket-reply { margin-top:22px; border-top:1px solid var(--acf-line); padding-top:18px; }
.acfticket-reply label { margin-top:0; }
.acfticket-closed {
  margin-top:20px; text-align:center; color:var(--acf-muted); font-size:14px;
  background:var(--acf-slate-t); border:1px solid #dde8ea; border-radius:12px; padding:14px;
}

/* Aide a la creation */
.acfticket-help { margin:2px 0 18px; color:#55606b; font-size:14.5px; }

/* Qualification : listes cote a cote */
.acfticket-row { display:flex; flex-wrap:wrap; gap:14px; }
.acfticket-row > div { flex:1 1 170px; }
.acfticket-row label { margin-top:16px; }

/* ---------- Pied ---------- */
.acfticket-foot { flex-shrink:0; border-top:1px solid var(--acf-line); background:var(--acf-card); }
.acfticket-foot .acfticket-wrap {
  padding-top:16px; padding-bottom:16px; color:var(--acf-muted); font-size:13px;
  display:flex; align-items:center; gap:8px; justify-content:center; text-align:center;
}

/* ---------- Pieces jointes (telechargement) ---------- */
.acfticket-files { margin-top:22px; border-top:1px solid var(--acf-line); padding-top:18px; }
.acfticket-files-title { margin:0 0 10px; font-size:14px; font-weight:600; color:#3a4850; display:flex; align-items:center; gap:8px; }
.acfticket-files-count { background:var(--acf-slate-t); color:var(--acf-slate); border-radius:999px; font-size:12px; font-weight:600; padding:1px 9px; }
.acfticket-filelist { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.acfticket-fileitem { display:flex; align-items:center; gap:10px; padding:10px 13px; border:1px solid var(--acf-line); border-radius:10px; background:#fff; transition:background .12s; }
.acfticket-fileitem:hover { background:var(--acf-slate-t); }
.acfticket-fileitem a { color:var(--acf-slate); text-decoration:none; font-weight:600; font-size:14px; overflow-wrap:anywhere; }
.acfticket-fileitem a:hover { text-decoration:underline; text-underline-offset:3px; }
.acfticket-fileitem a::before {
  content:""; display:inline-block; width:15px; height:15px; margin-right:9px; vertical-align:-2px;
  background:no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23425b65' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48'/%3E%3C/svg%3E");
}
.acfticket-filemeta { margin-left:auto; color:var(--acf-muted); font-size:12.5px; white-space:nowrap; }

/* ---------- Depot de fichier ---------- */
.acfticket-upload { margin-top:16px; }
.acfticket-upload label { margin-top:0; }
.acfticket-opt { color:var(--acf-muted); font-weight:400; font-size:12.5px; }
.acfticket-uphint { color:var(--acf-muted); font-size:12.5px; margin:7px 0 0; }
input[type=file] { padding:9px 12px; background:#fff; cursor:pointer; font-size:14px; }
input[type=file]::file-selector-button {
  margin-right:12px; border:1px solid var(--acf-line); background:var(--acf-slate-t); color:var(--acf-slate);
  padding:8px 13px; border-radius:8px; font:inherit; font-size:13.5px; font-weight:600; cursor:pointer; transition:background .15s;
}
input[type=file]::file-selector-button:hover { background:#e2ecef; }

/* ---------- Utilitaires ---------- */
.full { width:100%; }
/* Elements que le script du portail montre ou masque : « hidden » l emporte
   sur les display:flex des composants. */
.acfticket-portal [hidden] { display:none !important; }

/* ---------- Application installable (0.5.5) ---------- */
/* Encart « Installer l application » (liste, nouvelle demande) */
.acft-install {
  display:flex; align-items:flex-start; gap:14px; margin-bottom:18px; padding:16px 18px;
  background:var(--acf-card); border:1px solid var(--acf-line); border-left:3px solid var(--acf-slate);
  border-radius:var(--acf-radius); box-shadow:var(--acf-shadow-sm);
}
.acft-install-icon { flex:none; width:52px; height:52px; border-radius:12px; box-shadow:0 1px 3px rgba(16,32,39,.14); }
.acft-install-main { flex:1 1 auto; min-width:0; }
.acft-install-title { margin:0; font-weight:650; font-size:15.5px; }
.acft-install-text { margin:2px 0 0; color:var(--acf-muted); font-size:14px; }
.acft-install-note { margin:8px 0 0; font-size:12.5px; line-height:1.45; color:var(--acf-muted); }
.acft-install-ok { margin:4px 0 0; color:#3e6b3f; font-size:14px; font-weight:500; }
.acft-install-actions { flex:none; display:flex; flex-direction:column; align-items:stretch; gap:4px; }
.acft-install-go { padding:10px 18px; }
.acft-install-link, .acft-install-link:hover {
  background:none; color:var(--acf-muted); padding:7px 6px; font-weight:500; font-size:13.5px;
  text-decoration:underline; text-underline-offset:3px;
}
.acft-install-link:hover { color:var(--acf-slate); }
.acft-steps { margin:10px 0 0; padding-left:20px; font-size:14px; }
.acft-steps li { margin:3px 0; }
.acft-ico-share { display:inline-block; vertical-align:-3px; color:#0a84ff; }

/* Astuce de l ecran de connexion (iPhone, iPad) */
.acft-install-hint {
  display:flex; align-items:flex-start; gap:10px; margin:18px 0 0; padding-top:14px;
  border-top:1px solid var(--acf-line); font-size:13px; line-height:1.45; color:var(--acf-muted);
}
.acft-install-hint img { flex:none; border-radius:5px; margin-top:1px; }
.acft-install-hint a { color:var(--acf-slate); font-weight:600; }

/* Saisie du code : changer d adresse */
.acfticket-restart { margin:14px 0 0; text-align:center; font-size:13.5px; }
.acfticket-restart a { color:var(--acf-muted); }
.acfticket-restart a:hover { color:var(--acf-slate); }

/* Dans l application installee seulement (ou jamais) */
.acft-refresh {
  display:none; align-items:center; justify-content:center; width:36px; height:36px;
  border:1px solid var(--acf-line); border-radius:10px; color:var(--acf-slate);
}
.acft-refresh:hover { background:var(--acf-slate-t); }
.acft-app-welcome { display:none; }
@media (display-mode: standalone) {
  .acft-refresh { display:inline-flex; }
  .acft-app-welcome { display:block; }
  .acft-foot-app { display:none; }
}
html.acft-standalone .acft-refresh { display:inline-flex; }
html.acft-standalone .acft-app-welcome { display:block; }
html.acft-standalone .acft-foot-app { display:none; }

/* Pied : lien vers la page d installation */
.acft-foot-app a { color:var(--acf-muted); }
.acft-foot-app a:hover { color:var(--acf-slate); }
.acft-foot-app .dot { color:#c3ccd0; margin-right:2px; }

/* Page « Installer l application » */
.acft-app-hero { display:flex; align-items:center; gap:18px; }
.acft-app-icon { flex:none; border-radius:18px; box-shadow:0 2px 8px rgba(16,32,39,.14); }
.acft-app-hero h1 { margin:0 0 4px; }
.acft-app-hero .acfticket-lead { margin:0; color:var(--acf-muted); }
.acft-app .acfticket-info { margin:18px 0 0; }
.acft-app-tabs { display:flex; gap:4px; margin:22px 0 4px; padding:4px; background:var(--acf-slate-t); border-radius:12px; }
.acft-app-tab, .acft-app-tab:hover {
  flex:1 1 0; background:none; color:var(--acf-slate); font-size:14px; font-weight:600;
  padding:10px 6px; border-radius:9px; box-shadow:none; white-space:nowrap;
}
.acft-app-tab.is-on { background:#fff; color:var(--acf-ink); box-shadow:var(--acf-shadow-sm); }
.acft-app-sec { margin-top:20px; }
.acft-app-sec h2 { margin:0 0 10px; font-size:16px; }
.acft-app-tabs:not([hidden]) ~ .acft-app-sec h2 { display:none; }
.acft-app-sec .acft-steps { font-size:15px; padding-left:22px; }
.acft-app-sec .acft-steps li { margin:8px 0; }
.acft-app-sec p { margin:10px 0 0; }
.acft-app-note { color:var(--acf-muted); font-size:13.5px; line-height:1.5; }
.acft-app-install { margin:2px 0 6px; }
.acft-app-browsers { margin:8px 0 0; padding-left:20px; }
.acft-app-browsers li { margin:8px 0; }
.acft-app-browsers:has(.is-current) li:not(.is-current) { color:var(--acf-muted); }
.acft-app-browsers li.is-current::marker { color:var(--acf-slate); }
.acft-app-qr {
  display:flex; align-items:center; gap:18px; margin-top:20px; padding:14px 16px;
  border:1px dashed var(--acf-line); border-radius:12px;
}
.acft-app-qr p { margin:0; color:var(--acf-muted); font-size:13.5px; }
.acft-qr { flex:none; width:132px; height:132px; }
.acft-app-foot { margin:26px 0 0; text-align:center; }

/* Cloche des notifications (entete, client connecte) */
.acft-bell, .acft-bell:hover {
  display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; padding:0;
  background:#fff; color:var(--acf-slate); border:1px solid var(--acf-line); border-radius:10px; box-shadow:none;
}
.acft-bell:hover { background:var(--acf-slate-t); }
.acft-bell.is-on, .acft-bell.is-on:hover { background:var(--acf-slate); color:#fff; border-color:var(--acf-slate); }
.acft-bell.is-on svg path { fill:currentColor; }

/* Encart « Etre prevenu de nos reponses » */
.acft-pushcard-icon {
  flex:none; display:inline-flex; align-items:center; justify-content:center; width:52px; height:52px;
  border-radius:12px; background:var(--acf-slate-t); color:var(--acf-slate);
}

/* Reponse pas encore vue (liste) */
.acft-new {
  display:inline-block; margin-left:6px; padding:1px 8px; border-radius:999px; vertical-align:1px;
  background:#e6f0fb; color:#1f5f9e; font-size:11.5px; font-weight:650; white-space:nowrap;
}
.acfticket-table tr.acft-unread .col-subject a { font-weight:700; }
.acfticket-table tr.acft-unread .col-ref a::before {
  content:""; display:inline-block; width:7px; height:7px; margin-right:6px; border-radius:50%; background:#2b7bd4; vertical-align:1px;
}

/* Partage en attente, fichiers partages repris */
.acft-share-pending a { color:var(--acf-slate); font-weight:650; }

/* Bandeau « incident en cours » / information (reglages du module) */
.acft-notice {
  margin:0 0 18px; padding:12px 16px; border-radius:12px; font-size:14.5px; line-height:1.5;
  border:1px solid transparent;
}
.acft-notice strong { margin-right:4px; }
.acft-notice-alert { background:#fdf1d6; border-color:#f0dca5; color:#6d5310; }
.acft-notice-info { background:var(--acf-slate-t); border-color:#d6e3e7; color:#2f5059; }

/* « Besoin d aide tout de suite ? » */
.acft-contact { margin-top:18px; padding:16px 18px; border:1px dashed var(--acf-line); border-radius:var(--acf-radius); background:var(--acf-card); }
.acft-contact-title { margin:0 0 10px; font-weight:650; font-size:14.5px; }
.acft-contact-actions { display:flex; flex-wrap:wrap; gap:10px; }
.acft-contact-actions .acfticket-btn { flex:1 1 260px; justify-content:flex-start; gap:7px; padding:11px 13px; font-size:14px; white-space:nowrap; }
.acft-contact-num { margin-left:auto; padding-left:6px; font-size:13.5px; white-space:nowrap; font-variant-numeric:tabular-nums; font-weight:500; color:var(--acf-muted); }
.acft-contact-hint { margin:10px 0 0; font-size:12.5px; line-height:1.45; color:var(--acf-muted); }
.acfticket-auth .acft-contact { margin-top:16px; }

/* Avis du client sur une demande resolue */
.acft-rate { margin:18px 0 0; padding:16px 18px; border-radius:12px; background:var(--acf-slate-t); border:1px solid #d6e3e7; }
.acft-rate-title, .acft-rate-done { margin:0 0 10px; font-weight:600; }
.acft-rate-label { margin:0 0 6px; font-weight:500; font-size:13px; color:var(--acf-muted); }
.acft-rate textarea { min-height:0; }
.acft-rate-buttons { display:flex; flex-wrap:wrap; gap:10px; margin-top:10px; }
.acft-rate-buttons button { margin-top:0; flex:1 1 150px; }
.acft-rate-good, .acft-rate-good:hover { background:#3e6b3f; }
.acft-rate-good:hover { background:#355c36; }
.acft-rate-bad, .acft-rate-bad:hover { background:#fff; color:#9d2f22; border:1px solid #f3cfca; }
.acft-rate-bad:hover { background:#fcebe9; }
.acft-rate-quote { margin:0 0 8px; padding:2px 0 2px 12px; border-left:3px solid var(--acf-line); color:var(--acf-muted); }
.acft-rate-change summary { cursor:pointer; color:var(--acf-slate); font-size:13.5px; }

/* Connexion par Face ID / empreinte */
.acft-passkey-login, .acft-passkey-login:hover { margin-top:12px; background:#fff; color:var(--acf-slate); border:1px solid var(--acf-line); }
.acft-passkey-login:hover { background:var(--acf-slate-t); }
.acft-passkey-status { margin:12px 0 0; font-size:13px; color:var(--acf-muted); text-align:center; }

/* Message court (notifications activees...) */
.acft-toast {
  position:fixed; left:50%; bottom:22px; transform:translateX(-50%); z-index:50;
  width:max-content; max-width:min(92vw, 460px); padding:11px 16px; border-radius:12px;
  background:var(--acf-ink); color:#fff; font-size:14px; line-height:1.45;
  box-shadow:0 8px 28px rgba(16,32,39,.28);
}

/* ---------- Accessibilite ---------- */
a:focus-visible, button:focus-visible, .acfticket-btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline:2px solid var(--acf-slate); outline-offset:2px;
}

/* ---------- Mobile ---------- */
@media (max-width:620px) {
  .acfticket-card { padding:20px 18px; }
  .acfticket-msg { max-width:100%; }
  .acfticket-brand-name { display:none; }
  .acfticket-user { max-width:120px; }
  .acfticket-toolbar { flex-wrap:wrap; }
  .acfticket-toolbar .acfticket-btn { margin-left:0; width:100%; }

  /* Tableau -> cartes empilees */
  .acfticket-table, .acfticket-table tbody, .acfticket-table tr, .acfticket-table td { display:block; width:100%; }
  .acfticket-table thead { display:none; }
  .acfticket-table tr {
    border:1px solid var(--acf-line); border-radius:12px; padding:12px 14px; margin-bottom:12px; background:#fff;
  }
  .acfticket-table td { border:0; padding:3px 0; }
  .acfticket-table .col-ref a { font-size:13px; }
  .acfticket-table .col-subject a { font-size:16px; }
  .acfticket-table .col-date { font-size:13px; }

  /* Application installable */
  .acft-install { flex-wrap:wrap; padding:14px 15px; }
  .acft-install-main { flex-basis:calc(100% - 66px); }
  .acft-install-actions { flex-direction:row; width:100%; justify-content:flex-end; align-items:center; }
  .acft-app-hero { flex-direction:column; text-align:center; }
  .acft-app-qr { display:none; } /* sur le telephone lui-meme, le code QR ne sert a rien */
  .acft-new { display:block; width:max-content; margin:4px 0 0; }
}

/* Petit ecran : la place va aux boutons (cloche, actualiser, deconnexion). */
@media (max-width:480px) {
  .acfticket-user { display:none; }
}

/* =========================================================================
   0.5.7 — conversation cote client : etat en clair, fil par jour (le client a
   droite, le support a gauche), prenom du technicien, saisie compacte,
   urgence, contact discret.
   ========================================================================= */

/* Application iPhone : l entete commence sous la barre d etat (viewport-fit=cover). */
.acfticket-head { padding-top:env(safe-area-inset-top, 0px); }

.acft-sr { position:absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; margin:0; padding:0; }

/* Pastilles sous le titre */
.acft-chips { display:flex; flex-wrap:wrap; gap:6px; margin:4px 0 14px; }
.acft-chip { font-size:12.5px; line-height:1.4; padding:3px 10px; border-radius:999px; background:#fff; border:1px solid var(--acf-line); color:var(--acf-muted); white-space:nowrap; }
.acft-chip-ref { color:var(--acf-ink); font-weight:600; font-variant-numeric:tabular-nums; }
.acft-chip-high { color:#9d2f22; border-color:#f1c9c2; background:#fcebe9; font-weight:600; }

/* Encart d etat */
.acft-state { border:1px solid var(--acf-line); border-radius:var(--acf-radius); padding:14px 16px 10px; margin:0 0 6px; background:#fff; }
.acft-state-head { display:flex; align-items:center; gap:12px; }
.acft-state-title { margin:0; font-weight:700; font-size:15.5px; }
.acft-state-line { margin:1px 0 0; color:var(--acf-muted); font-size:14px; line-height:1.4; }
.acft-state-dot { display:inline-block; width:8px; height:8px; border-radius:50%; background:#2f7fd1; margin-right:7px; vertical-align:1px; }
.acft-state.is-you { background:#fff7e8; border-color:#f3dcae; }
.acft-state.is-you .acft-state-dot { background:#c27c0e; }
.acft-state.is-you .acft-state-line { color:#7a4d06; font-weight:600; }
.acft-state.is-done .acft-state-dot { background:#3e6b3f; }
.acft-state.is-off .acft-state-dot { background:#9aa7ac; }
.acft-av { width:36px; height:36px; flex:0 0 36px; border-radius:50%; background:var(--acf-slate); color:#fff; display:grid; place-items:center; font-weight:700; font-size:13px; letter-spacing:.3px; }
.acft-av-sm { width:28px; height:28px; flex-basis:28px; font-size:10.5px; }

.acft-steps { list-style:none; display:flex; margin:14px 0 2px; padding:0; position:relative; }
.acft-steps::before, .acft-steps::after { content:""; position:absolute; left:12.5%; top:9px; height:2px; background:var(--acf-line); width:75%; }
.acft-steps::after { background:var(--acf-slate); width:calc(75% * var(--fill, 0)); }
.acft-steps li { flex:1; text-align:center; font-size:11.5px; line-height:1.3; color:var(--acf-muted); position:relative; z-index:1; }
.acft-step-dot { display:block; width:20px; height:20px; border-radius:50%; margin:0 auto 5px; background:#fff; border:2px solid var(--acf-line); }
.acft-steps li.is-done .acft-step-dot { background:var(--acf-slate); border-color:var(--acf-slate); }
.acft-steps li.is-current .acft-step-dot { border-color:var(--acf-slate); box-shadow:0 0 0 4px var(--acf-slate-t); }
.acft-steps li.is-done, .acft-steps li.is-current { color:var(--acf-ink); }
.acft-step-label { display:block; }
.acft-step-time { display:block; color:var(--acf-muted); font-size:10.5px; font-variant-numeric:tabular-nums; }

/* Fil */
.acft-conv { margin-top:4px; }
.acft-day { text-align:center; margin:16px 0 8px; font-size:12.5px; color:var(--acf-muted); }
.acft-row { display:flex; gap:8px; align-items:flex-end; margin:6px 0; }
.acft-row.me { justify-content:flex-end; }
.acft-col { max-width:82%; min-width:0; }
.acft-who { margin:8px 2px 3px; font-size:12px; color:var(--acf-muted); }
.acft-row.me .acft-who { text-align:right; }
.acft-bub { padding:9px 13px 6px; border-radius:18px; font-size:15px; line-height:1.45; overflow-wrap:anywhere; }
.acft-row.them .acft-bub { background:#fff; border:1px solid var(--acf-line); border-bottom-left-radius:6px; }
.acft-row.me .acft-bub { background:var(--acf-slate); color:#fff; border-bottom-right-radius:6px; }
.acft-row.me.first .acft-bub { background:#fff; color:var(--acf-ink); border:1.5px solid var(--acf-slate); }
.acft-bub-label { margin:0 0 3px; font-size:11px; font-weight:700; color:var(--acf-slate); text-transform:uppercase; letter-spacing:.05em; }
/* Messages de l editeur enrichi : pas de marges ni de blanc en trop en bas */
.acft-bub-body > :first-child { margin-top:0; }
.acft-bub-body > :last-child { margin-bottom:0; }
.acft-bub-body p { margin:0 0 .55em; }
.acft-bub-body br:last-child { display:none; }
.acft-bub-body img { max-width:100%; height:auto; }
.acft-row.me .acft-bub a { color:#fff; }
.acft-time { margin:3px 0 0; font-size:11px; text-align:right; opacity:.72; font-variant-numeric:tabular-nums; }
.acft-read { margin:3px 4px 0; font-size:11.5px; color:var(--acf-muted); text-align:right; }
.acft-row.me .acfticket-quote { color:rgba(255,255,255,.82); }
.acft-row.me .acfticket-quote-text { border-left-color:rgba(255,255,255,.35); }
.acft-row.me .acfticket-msg-files a, .acft-row.me .acfticket-files a { color:#fff; }

.acft-live-note { margin:10px 0 0; text-align:center; font-size:13.5px; }
.acft-flash { margin:0 0 12px; padding:10px 14px; border-radius:12px; background:#eaf3ea; border:1px solid #cfe3cf; color:#2f5530; font-weight:600; font-size:14px; }

/* Zone de reponse compacte */
.acft-composer { margin:18px 0 0; border:1px solid var(--acf-line); border-radius:16px; padding:10px 12px; background:#fff; }
.acft-composer:focus-within { border-color:var(--acf-slate); box-shadow:0 0 0 3px var(--acf-ring); }
.acft-composer textarea { border:0; box-shadow:none; padding:4px 2px; min-height:46px; resize:none; font-size:15.5px; }
.acft-composer textarea:focus { box-shadow:none; outline:0; }
.acft-composer-foot { display:flex; align-items:center; gap:8px; border-top:1px solid var(--acf-line); padding-top:8px; margin-top:4px; }
.acft-spacer { flex:1; }
.acft-clip { display:inline-flex; align-items:center; gap:6px; margin:0; padding:6px 4px; color:var(--acf-slate); font-weight:600; font-size:14px; cursor:pointer; }
.acft-js .acft-clip input[type=file] { position:absolute; width:1px; height:1px; opacity:0; overflow:hidden; }
.acft-clip:focus-within { outline:2px solid var(--acf-ring); border-radius:8px; }
form .acft-composer-foot button, .acft-composer-foot .acft-clip { margin:0; }
.acft-send-btn { padding:9px 18px; border-radius:12px; }
.acft-picked { list-style:none; margin:6px 0 2px; padding:0; display:flex; flex-wrap:wrap; gap:6px; }
.acft-picked li { font-size:12.5px; background:var(--acf-slate-t); border-radius:8px; padding:3px 8px; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.acft-uphint { margin:6px 2px 0; font-size:12px; color:var(--acf-muted); line-height:1.4; }

/* Urgence : bouton en deux gestes, telephone en petit apres */
.acft-urgent { margin-top:16px; padding:14px 16px; border:1px solid #f1d2cd; border-radius:var(--acf-radius); background:#fff; }
.acft-urgent-title { margin:0 0 4px; font-size:16px; color:#9d2f22; }
.acft-urgent p { margin:0 0 10px; font-size:14px; }
.acft-urgent-on { color:#7a2a1f; }
.acft-urgent-confirm summary { list-style:none; cursor:pointer; text-align:center; padding:11px; border-radius:12px; background:#fcebe9; color:#9d2f22; border:1px solid #f1c9c2; font-weight:700; font-size:15px; }
.acft-urgent-confirm summary::-webkit-details-marker { display:none; }
.acft-urgent-confirm[open] summary { border-bottom-left-radius:0; border-bottom-right-radius:0; }
.acft-urgent-confirm form { border:1px solid #f1c9c2; border-top:0; border-radius:0 0 12px 12px; padding:12px; }
.acft-urgent-confirm button { width:100%; background:#9d2f22; }
.acft-urgent-confirm button:hover { background:#86271c; }
.acft-urgent-tel { margin:10px 0 0 !important; font-size:13px !important; color:var(--acf-muted); }
.acft-urgent-tel a { color:var(--acf-slate); font-weight:600; white-space:nowrap; }

/* Contact discret (connexion, liste) */
.acft-contact { border-style:solid; padding:12px 16px; }
.acft-contact-line { margin:0; font-size:13.5px; color:var(--acf-ink); }
.acft-contact-line + .acft-contact-line { margin-top:6px; }
.acft-contact-tel { color:var(--acf-slate); font-weight:600; white-space:nowrap; }
.acft-contact-remote a { color:var(--acf-slate); font-weight:600; }

/* Urgence a la creation : trois niveaux expliques */
.acft-urgency { margin:16px 0 0; padding:0; border:0; }
.acft-urgency legend { font-weight:600; font-size:13.5px; color:#3a4850; margin-bottom:7px; padding:0; }
.acft-urgency-opt { display:flex; gap:10px; align-items:flex-start; margin:0 0 6px; padding:10px 12px; border:1px solid var(--acf-line); border-radius:12px; background:#fff; font-weight:400; cursor:pointer; }
.acft-urgency-opt input { width:auto; margin:3px 0 0; }
.acft-urgency-opt strong { display:block; font-size:14px; }
.acft-urgency-opt small { display:block; color:var(--acf-muted); font-size:12.5px; }
.acft-urgency-opt:has(input:checked) { border-color:var(--acf-slate); box-shadow:0 0 0 2px var(--acf-ring); }
.acft-urgency-tel { display:none; margin:4px 2px 0; font-size:13px; color:var(--acf-muted); }
.acft-urgency:has(input[value="blocked"]:checked) .acft-urgency-tel { display:block; }
.acft-urgency-tel a { color:var(--acf-slate); font-weight:600; white-space:nowrap; }

/* Page d avis ouverte depuis l e-mail */
.acft-ratepage-about { color:var(--acf-muted); margin:0 0 14px; }
.acft-ratepage-link { color:var(--acf-slate); font-weight:600; }
.acft-ratepage-foot { margin:18px 0 0; }
.acft-rate-buttons .is-picked { box-shadow:0 0 0 3px var(--acf-ring); }

/* ---------- Demande d acces (0.14.0) ---------- */
.acfticket-access { max-width:640px; margin:14px auto; }
.acfticket-access .acfticket-lead { color:var(--acf-muted); margin:0 0 6px; }
/* Champs empiles sur telephone : l espace vient du libelle seul, comme entre deux lignes. */
.acfticket-access .acfticket-row { row-gap:0; }
.acfticket-access .acft-contact { margin-top:16px; }
.acft-optional { font-weight:400; color:var(--acf-muted); }
.acft-privacy { margin:14px 0 0; font-size:12.5px; line-height:1.45; color:var(--acf-muted); }
