/* ============================================================================
   Automaitic — feuille de style unique (design system)
   « slate éditorial » : en-tête ardoise, accent ambre, titres serif Georgia.
   Éditeur : 10gital / Beewine. Aucune police externe, aucun CDN (CSP stricte).
   Toutes les valeurs passent par des variables CSS -> transposables en Jinja.
   ============================================================================ */

/* ---------- 1. TOKENS ---------------------------------------------------- */
:root {
  /* Neutres chauds (fond, panneaux, encres) */
  --bg:            #f4f4f1;   /* fond application */
  --bg-sunk:       #edece7;   /* zones creusées, alt de tableau */
  --panel:         #ffffff;   /* cartes / panneaux */
  --panel-2:       #fbfaf7;   /* en-têtes de carte, sous-panneaux */
  --ink:           #23262d;   /* texte principal */
  --ink-2:         #4a4d55;   /* texte courant secondaire */
  --muted:         #7d7c73;   /* texte discret / labels */
  --faint:         #a8a79c;   /* texte très discret / méta */

  /* Bordures */
  --border:        #e7e6df;   /* fine */
  --border-strong: #d9d8cf;   /* forte */
  --border-soft:   #eceae2;   /* séparateurs internes */

  /* Ardoise (slate) */
  --slate:         #1e2533;
  --slate-2:       #2b3445;
  --slate-line:    #3a4356;
  --on-slate:      #eceef4;
  --on-slate-mut:  #aab2c2;

  /* Accent ambre */
  --accent:        #c2700f;
  --accent-dark:   #834a08;
  --accent-bright: #e89a3c;
  --accent-soft:   #f6e7d3;
  --accent-wash:   #fdf6ee;   /* fond très léger pour zones accentuées */

  /* Sémantique (sourds, éditoriaux) */
  --ok:            #4f7355;  --ok-ink:   #35563b;  --ok-soft:   #e4ede2;  --ok-border:#bcd0bd;
  --warn:          #b07d13;  --warn-ink: #7a5a12;  --warn-soft: #f6e7d3;  --warn-border:#e3c58f;
  --danger:        #a6462c;  --danger-ink:#8c2f22; --danger-soft:#f5ddd6; --danger-border:#ddb9aa;
  --info:          #3f6079;  --info-ink: #2f4a5e;  --info-soft: #e3ebf1;  --info-border:#c2d2dd;
  --diverge:       #6b5b8a;  --diverge-ink:#4f4269;--diverge-soft:#efecf4;--diverge-border:#d8d1e6;

  /* Typo */
  --serif: Georgia, "Times New Roman", serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:  ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Échelle typo */
  --fs-xs: 11px; --fs-sm: 12px; --fs-base: 13.5px; --fs-md: 15px;
  --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 28px; --fs-3xl: 34px;
  --lh: 1.55;

  /* Rayons */
  --r-sm: 6px; --r: 8px; --r-lg: 12px; --r-pill: 999px;

  /* Ombres (très discrètes) */
  --sh-1: 0 1px 2px rgba(30,37,51,.05);
  --sh-2: 0 1px 3px rgba(30,37,51,.07);
  --sh-3: 0 4px 20px rgba(30,37,51,.09);
  --sh-pop: 0 10px 34px rgba(30,37,51,.16);

  /* Espacements (base 4) — densité 70 : compact mais lisible */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px; --s8: 44px;

  /* Focus */
  --focus: 0 0 0 3px rgba(194,112,15,.35);

  --container: 1180px;
}

/* ---------- 2. RESET / BASE --------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,h2,h3,h4 { font-family: var(--serif); font-weight: 600; color: var(--ink); margin: 0; line-height: 1.2; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
p { margin: 0 0 var(--s3); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
small { font-size: var(--fs-sm); }
code, kbd, .mono { font-family: var(--mono); font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s5) 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
img { max-width: 100%; display: block; }

/* Layout helpers */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--s5); }
.stack > * + * { margin-top: var(--s4); }
.stack-lg > * + * { margin-top: var(--s6); }
.row { display: flex; gap: var(--s3); align-items: center; }
.row-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.right { margin-left: auto; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* Titre de section interne (label majuscule) */
.eyebrow {
  font: 600 var(--fs-xs)/1.4 var(--sans);
  letter-spacing: .07em; text-transform: uppercase; color: var(--faint);
  margin: 0 0 var(--s3);
}

/* ---------- 3. EN-TÊTE + NAV (BACK-OFFICE) ------------------------------ */
.app-header {
  background: var(--slate); color: var(--on-slate); position: relative;
  height: 56px; display: flex; align-items: center;
  padding: 0 var(--s5); gap: var(--s6);
}
.brand { display: inline-flex; align-items: baseline; gap: var(--s2); text-decoration: none; }
.brand:hover { text-decoration: none; }
.logotype {
  font: 700 19px/1 var(--sans); letter-spacing: -.02em; color: var(--on-slate);
  display: inline-flex; align-items: baseline;
}
.logotype .ai { color: var(--accent-bright); font-weight: 800; }
.brand .tag { font: 500 var(--fs-xs)/1 var(--sans); color: var(--on-slate-mut); letter-spacing: .04em; }

.app-nav { display: flex; gap: var(--s5); align-items: center; }
.app-nav a {
  color: var(--on-slate-mut); font: 500 var(--fs-base)/1 var(--sans);
  padding: 6px 0; position: relative; text-decoration: none;
}
.app-nav a:hover { color: var(--on-slate); text-decoration: none; }
.app-nav a.is-active { color: var(--on-slate); font-weight: 600; }
.app-nav a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -18px; height: 2px; background: var(--accent-bright);
}
.app-header .userbox { margin-left: auto; display: flex; align-items: center; gap: var(--s3); }
.user-chip {
  display: inline-flex; align-items: center; gap: var(--s2);
  background: var(--slate-2); border: 1px solid var(--slate-line); border-radius: var(--r-pill);
  padding: 5px 12px; font: 500 var(--fs-sm)/1 var(--sans); color: var(--on-slate);
}
.user-chip .role { color: var(--on-slate-mut); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--slate-2);
  border: 1px solid var(--slate-line); color: var(--on-slate);
  font: 600 var(--fs-xs)/1 var(--sans); display: inline-flex; align-items: center; justify-content: center; flex: none;
}

/* Menu mobile (CSS-only, checkbox hack) */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.nav-burger { display: none; background: transparent; border: 0; color: var(--on-slate); cursor: pointer; padding: 6px; margin-left: auto; }
.nav-burger svg { width: 24px; height: 24px; }
.mobile-drawer { display: none; }

/* ---------- 4. NAV PROJET (onglets) ------------------------------------- */
.project-tabs {
  display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap;
  padding: var(--s4) 0; border-bottom: 1px solid var(--border); margin-bottom: var(--s5);
}
.project-tabs .back {
  color: var(--muted); font: 500 var(--fs-base)/1 var(--sans);
  display: inline-flex; align-items: center; gap: 5px; margin-right: var(--s2);
}
.tab {
  font: 500 var(--fs-base)/1 var(--sans); color: var(--ink-2);
  padding: 7px 14px; border-radius: var(--r-pill); text-decoration: none;
}
.tab:hover { background: var(--bg-sunk); color: var(--ink); text-decoration: none; }
.tab.is-active { background: var(--slate); color: var(--on-slate); font-weight: 600; }
.tab.is-active:hover { background: var(--slate); color: var(--on-slate); }

/* ---------- 5. CARTES --------------------------------------------------- */
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
}
.card > .card-body { padding: var(--s5) var(--s6); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s4) var(--s6); border-bottom: 1px solid var(--border-soft); background: var(--panel-2);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.card-head h2, .card-head h3 { font-size: var(--fs-md); }
.card-title-sub { font-family: var(--sans); font-weight: 400; color: var(--muted); font-size: var(--fs-base); }

/* Section repliable (règle les écrans « murs ») */
details.section {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--sh-2); margin-bottom: var(--s4); overflow: hidden;
}
details.section > summary {
  list-style: none; cursor: pointer; padding: var(--s4) var(--s6);
  display: flex; align-items: center; gap: var(--s3);
  font: 600 var(--fs-xs)/1.4 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
}
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary .chev {
  transition: transform .15s ease; color: var(--faint); font-size: 11px;
}
details.section[open] > summary .chev { transform: rotate(90deg); }
details.section > summary:hover { color: var(--ink); }
details.section .section-body { padding: 0 var(--s6) var(--s5); }
details.section .count { margin-left: auto; color: var(--faint); font-weight: 500; letter-spacing: 0; text-transform: none; }

/* ---------- 6. BOUTONS -------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  font: 600 var(--fs-base)/1 var(--sans); border-radius: var(--r-sm);
  padding: 9px 15px; border: 1px solid transparent; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { text-decoration: none; }
.btn svg { width: 15px; height: 15px; flex: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(130,74,8,.28); }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-secondary { background: var(--panel); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg-sunk); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-dark); }
.btn-danger { background: var(--panel); color: var(--danger); border-color: var(--danger-border); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger-ink); }
.btn-slate { background: var(--slate); color: var(--on-slate); }
.btn-slate:hover { background: var(--slate-2); color: #fff; }
.btn-bright { background: var(--accent-bright); color: var(--slate); }
.btn-bright:hover { background: var(--accent); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: var(--fs-sm); }
.btn-sm svg { width: 13px; height: 13px; }
.btn-xs { padding: 4px 8px; font-size: var(--fs-xs); border-radius: 5px; }
.btn-xs svg { width: 12px; height: 12px; }
.btn[disabled], .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------- 7. FORMULAIRES ---------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .form-label {
  font: 600 var(--fs-sm)/1.3 var(--sans); color: var(--ink);
}
.field .hint { font: 400 var(--fs-xs)/1.4 var(--sans); color: var(--muted); }
.field .opt { color: var(--muted); font-weight: 400; }
.input, .select, .textarea, input[type=text], input[type=email], input[type=password],
input[type=number], input[type=search], select, textarea {
  font: 400 var(--fs-base)/1.4 var(--sans); color: var(--ink);
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  padding: 9px 11px; width: 100%; transition: border-color .12s, box-shadow .12s;
}
.input::placeholder, textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus,
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
textarea, .textarea { min-height: 84px; resize: vertical; }
select, .select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%237d7c73' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px;
}
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s4); }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
.form-grid .col-2 { grid-column: span 2; }
.form-actions { display: flex; gap: var(--s3); align-items: center; margin-top: var(--s2); }
.check { display: inline-flex; align-items: center; gap: var(--s2); font: 500 var(--fs-base)/1.3 var(--sans); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.lock { color: var(--warn); font-size: .9em; }

/* Zone de dépôt de fichiers */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--r); background: var(--panel-2);
  padding: var(--s7) var(--s5); text-align: center; color: var(--muted);
}
.dropzone .dz-icon { color: var(--accent); margin-bottom: var(--s2); display: inline-flex; }
.dropzone strong { color: var(--ink); display: block; margin-bottom: 2px; }

/* ---------- 8. TABLEAUX (responsives) ----------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.table thead th {
  text-align: left; font: 600 var(--fs-xs)/1.4 var(--sans); letter-spacing: .06em;
  text-transform: uppercase; color: var(--faint); padding: 0 var(--s4) var(--s2); white-space: nowrap;
}
.table tbody td { padding: var(--s3) var(--s4); border-top: 1px solid var(--border-soft); vertical-align: middle; }
.table tbody tr:hover td { background: var(--panel-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions-cell { text-align: right; white-space: nowrap; }
.table .actions-cell .btn { margin-left: 6px; }
.table-key th { color: var(--muted); font: 600 var(--fs-xs)/1.4 var(--sans); letter-spacing: .06em;
  text-transform: uppercase; text-align: left; width: 1%; white-space: nowrap; padding: var(--s3) var(--s4) var(--s3) 0; vertical-align: top; }
.table-key td { padding: var(--s3) 0; border-top: 1px solid var(--border-soft); }

/* Tableau -> cartes empilées en mobile */
@media (max-width: 720px) {
  .table.stack-mobile thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table.stack-mobile tbody tr { display: block; border: 1px solid var(--border); border-radius: var(--r);
    margin-bottom: var(--s3); padding: var(--s2) var(--s3); }
  .table.stack-mobile tbody td { display: flex; justify-content: space-between; gap: var(--s4);
    border: 0; border-bottom: 1px solid var(--border-soft); padding: var(--s2) 0; }
  .table.stack-mobile tbody tr td:last-child { border-bottom: 0; }
  .table.stack-mobile tbody td::before { content: attr(data-label); font: 600 var(--fs-xs)/1.4 var(--sans);
    letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
  .table.stack-mobile .actions-cell { justify-content: flex-start; }
}

/* ---------- 9. BADGES / CHIPS / PILLS ----------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font: 600 var(--fs-xs)/1 var(--sans);
  padding: 4px 9px; border-radius: var(--r-pill); background: var(--bg-sunk); color: var(--ink-2);
}
.badge-ok      { background: var(--ok-soft);      color: var(--ok-ink); }
.badge-warn    { background: var(--warn-soft);    color: var(--warn-ink); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger-ink); }
.badge-info    { background: var(--info-soft);    color: var(--info-ink); }
.badge-accent  { background: var(--accent-soft);  color: var(--accent-dark); }
.badge-diverge { background: var(--diverge-soft); color: var(--diverge-ink); }
.badge-neutral { background: var(--bg-sunk);      color: var(--muted); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Chip = étiquette d'attribut (retenu du cadrage) */
.chip {
  display: inline-flex; align-items: center; gap: 5px; font: 500 var(--fs-sm)/1 var(--sans);
  padding: 5px 10px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-dark);
}
.chip-plain { background: var(--bg-sunk); color: var(--ink-2); border: 1px solid var(--border); }
.chip-ok { background: var(--ok-soft); color: var(--ok-ink); }
.chip-group { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ---------- 10. NOTICES ------------------------------------------------- */
.notice {
  display: flex; gap: var(--s3); align-items: flex-start;
  border: 1px solid var(--border); border-radius: var(--r); padding: var(--s3) var(--s4);
  background: var(--panel-2); color: var(--ink-2); font-size: var(--fs-base);
}
.notice .n-icon { flex: none; margin-top: 1px; display: inline-flex; }
.notice strong { color: var(--ink); }
.notice-ok     { background: var(--ok-soft);     border-color: var(--ok-border);     color: var(--ok-ink); }
.notice-error  { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger-ink); }
.notice-warn   { background: var(--warn-soft);   border-color: var(--warn-border);   color: var(--warn-ink); }
.notice-info   { background: var(--info-soft);   border-color: var(--info-border);   color: var(--info-ink); }
.notice-ok .n-icon, .notice-error .n-icon, .notice-warn .n-icon, .notice-info .n-icon { color: currentColor; }

/* ---------- 11. TUILES KPI ---------------------------------------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3); }
.kpi {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r);
  padding: var(--s4); display: flex; flex-direction: column; gap: 2px;
}
.kpi .kpi-val { font: 700 var(--fs-2xl)/1 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .kpi-label { font: 500 var(--fs-sm)/1.35 var(--sans); color: var(--muted); }
.kpi.is-alert .kpi-val { color: var(--danger); }
.kpi.is-good .kpi-val { color: var(--ok); }

/* Jauge */
.gauge { display: flex; flex-direction: column; gap: 5px; min-width: 160px; }
.gauge-head { display: flex; justify-content: space-between; font: 500 var(--fs-xs)/1 var(--sans); color: var(--muted); }
.gauge-head strong { color: var(--ink); }
.gauge-track { height: 6px; background: var(--bg-sunk); border-radius: var(--r-pill); overflow: hidden; }
.gauge-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-bright)); border-radius: var(--r-pill); }
.gauge-fill.ok { background: var(--ok); }
.gauge-fill.low { background: var(--danger); }

/* ---------- 12. EMPTY STATES -------------------------------------------- */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: var(--s7) var(--s5); color: var(--muted); gap: var(--s3);
}
.empty .empty-icon {
  width: 44px; height: 44px; border-radius: 11px; background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
}
.empty h3 { font-size: var(--fs-lg); color: var(--ink); }
.empty p { max-width: 420px; margin: 0; }

/* ---------- 13. FIL D'ARIANE + PAGE HEAD -------------------------------- */
.breadcrumb { display: flex; gap: var(--s2); align-items: center; font-size: var(--fs-sm); color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--faint); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.page-head h1 .sub { font-family: var(--sans); font-weight: 400; font-size: var(--fs-md); color: var(--muted); }

/* ---------- 14. MODALES / CONFIRMATIONS --------------------------------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(30,37,51,.42); display: flex; align-items: center; justify-content: center; padding: var(--s5); z-index: 50; }
.modal { background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--sh-pop); width: 100%; max-width: 440px; overflow: hidden; }
.modal .modal-body { padding: var(--s6); }
.modal h3 { margin-bottom: var(--s2); }
.modal .modal-foot { display: flex; gap: var(--s3); justify-content: flex-end; padding: var(--s4) var(--s6); border-top: 1px solid var(--border-soft); background: var(--panel-2); }

/* ---------- 15. BULLES DE CHAT (assistant IA) --------------------------- */
.chat { display: flex; flex-direction: column; gap: var(--s3); }
.bubble { max-width: 76%; padding: var(--s3) var(--s4); border-radius: 14px; font-size: var(--fs-base); line-height: 1.5; }
.bubble-ai { align-self: flex-start; background: var(--panel); border: 1px solid var(--border); border-bottom-left-radius: 4px; color: var(--ink); box-shadow: var(--sh-1); }
.bubble-user { align-self: flex-end; background: var(--slate); color: var(--on-slate); border-bottom-right-radius: 4px; }
.bubble-meta { font: 500 var(--fs-xs)/1 var(--sans); color: var(--faint); margin-bottom: 3px; }
.typing { display: inline-flex; gap: 3px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--faint); animation: dot 1.1s infinite; }
.typing i:nth-child(2){ animation-delay: .15s; } .typing i:nth-child(3){ animation-delay: .3s; }
@keyframes dot { 0%,60%,100%{ opacity:.3; transform:translateY(0);} 30%{ opacity:1; transform:translateY(-2px);} }

/* ---------- 16. PIED DE PAGE -------------------------------------------- */
.app-footer { border-top: 1px solid var(--border); margin-top: var(--s8); padding: var(--s5) 0; }
.app-footer .foot-links { display: flex; gap: var(--s3); justify-content: center; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--muted); }

/* ---------- 17. ESPACE INTERLOCUTEUR (ambiance client) ------------------ */
/* Plus doux, rassurant, mobile-first : fond crème, plus d'air, moins dense. */
.client { --container: 640px; }
.client-header {
  background: var(--slate); color: var(--on-slate);
  padding: var(--s4) var(--s5); display: flex; align-items: center; justify-content: center; gap: var(--s3);
}
.client-header .logotype { font-size: 18px; }
.client-main { padding: var(--s7) var(--s5) var(--s8); }
.client-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--sh-3); padding: var(--s7); max-width: 640px; margin: 0 auto;
}
.client-card h1 { font-size: var(--fs-2xl); margin-bottom: var(--s3); }
.client-card .lede { font-size: var(--fs-md); color: var(--ink-2); line-height: 1.6; }
.reassure { display: flex; gap: var(--s2); align-items: center; color: var(--muted); font-size: var(--fs-sm); }
.reassure svg { color: var(--ok); width: 15px; height: 15px; flex: none; }
.progress-steps { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); color: var(--muted); }
.progress-steps .step { display: inline-flex; align-items: center; gap: 6px; }
.progress-steps .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--bg-sunk); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; font: 700 var(--fs-xs)/1 var(--sans); }
.progress-steps .step.done .dot { background: var(--ok); color: #fff; }
.progress-steps .step.current .dot { background: var(--accent); color: #fff; }
.progress-steps .bar { flex: 1; height: 2px; background: var(--border-strong); min-width: 16px; }

/* Question de questionnaire (grande cible tactile) */
.q-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s6); box-shadow: var(--sh-2); }
.q-label { font-family: var(--serif); font-size: var(--fs-lg); color: var(--ink); margin-bottom: var(--s4); }
.q-help { font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--s4); }
.opt-list { display: flex; flex-direction: column; gap: var(--s2); }
.opt-item {
  display: flex; align-items: center; gap: var(--s3); padding: var(--s4);
  border: 1px solid var(--border-strong); border-radius: var(--r); cursor: pointer;
  min-height: 52px; transition: border-color .12s, background .12s; font-size: var(--fs-md);
}
.opt-item:hover { border-color: var(--accent); background: var(--accent-wash); }
.opt-item.is-selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--focus); }
.opt-item .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); flex: none; }
.opt-item.is-selected .radio { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px #fff; }

/* ---------- 18. DIVERS -------------------------------------------------- */
.divider-arrow { text-align: center; color: var(--faint); margin: var(--s3) 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

@media (max-width: 720px) {
  .app-nav, .app-header > span[aria-hidden] { display: none; }
  .app-header .userbox { display: none; }
  .nav-burger { display: inline-flex; }
  .nav-toggle:checked ~ .nav-burger { color: var(--accent-bright); }
  .nav-toggle:checked ~ .mobile-drawer { display: block; }
  .mobile-drawer { position: absolute; left: 0; right: 0; top: 56px; background: var(--slate);
    border-top: 1px solid var(--slate-line); padding: var(--s3) var(--s5) var(--s4); z-index: 40; box-shadow: var(--sh-3); }
  .mobile-drawer a { display: block; color: var(--on-slate-mut); padding: 11px 0; font: 500 var(--fs-md)/1 var(--sans);
    border-bottom: 1px solid var(--slate-line); text-decoration: none; }
  .mobile-drawer a:last-child { border-bottom: 0; }
  .mobile-drawer a.is-active { color: var(--on-slate); font-weight: 600; }
  .mobile-drawer .grp { font: 600 10px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase;
    color: var(--faint); padding: var(--s4) 0 4px; }
  .mobile-drawer .drawer-user { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) 0 var(--s2); }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .form-grid .col-2 { grid-column: auto; }
  .card > .card-body, .card-head { padding-left: var(--s4); padding-right: var(--s4); }
  .page-head { align-items: flex-start; }
}

/* Rendu markdown léger des synthèses IA (filtre `mdlight`) : titres/gras/puces lisibles. */
.md-body h4 { margin: var(--s3) 0 var(--s1); font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #555); }
.md-body h4:first-child { margin-top: 0; }
.md-body p { margin: 0 0 var(--s2); line-height: 1.55; }
.md-body ul { margin: 0 0 var(--s2); padding-left: 1.25em; }
.md-body li { margin: 2px 0; line-height: 1.5; }
