/* Marbelink « Audits » — feuille de style (base : envois/app.css, mêmes jetons). Identité Marbelink : crème, encre, or ; fuchsia réservé aux actions d'envoi. */

:root {
  --black: #0E0C10; --black-2: #17141B;
  --gold: #D4AF37; --gold-bright: #F0D77B; --gold-dim: #8A6D1F;
  --cream: #FBF1E4; --cream-2: #FDF9F1;
  --surface: #FFFFFF; --border: #ECE2CC; --border-strong: #DCCDAA;
  --ink: #241F1A; --ink-2: #4A433A; --muted: #6F6759; /* --muted officiel #8B8375, assombri pour le contraste du texte */
  --muted-ui: #8B8375;
  --fuchsia: #E0187C; --fuchsia-dark: #B8115F; --fuchsia-tint: #FCEBF3;
  --good: #1F9254; --good-bg: #E3F3E9;
  --warn: #B7791F; --warn-ink: #8A5A12; --warn-bg: #FBF0DA;
  --bad: #C0392B; --bad-bg: #FAE4E1;
  --info: #0E8C8C; --info-ink: #0A6B6B; --info-bg: #DEF3F1;

  --f-title: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --f-text: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --r: 10px; --r-sm: 7px; --r-lg: 14px;
  --shadow-1: 0 1px 2px rgba(36, 31, 26, .05), 0 1px 1px rgba(36, 31, 26, .03);
  --shadow-2: 0 10px 30px rgba(14, 12, 16, .14), 0 2px 6px rgba(14, 12, 16, .08);
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--gold-dim);
  --gutter: 24px;
  --maxw: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font: 15px/1.5 var(--f-text);
  -webkit-font-smoothing: antialiased; min-height: 100vh;
  overflow-x: hidden;
}
body.has-modal { overflow: hidden; }
img, svg { max-width: 100%; }
a { color: var(--gold-dim); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: var(--f-mono); font-size: .88em; background: var(--cream-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
.ico { flex: none; vertical-align: -3px; }

.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--gold); color: var(--black); padding: 8px 12px; border-radius: var(--r-sm); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 8px; }

/* ---------------------------------------------------------------- Barre supérieure */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  height: 56px; padding: 0 var(--gutter);
  background: var(--black); color: var(--cream);
  border-bottom: 2px solid var(--gold);
}
.topbar__back { color: var(--gold-bright); text-decoration: none; font-weight: 500; font-size: 14px; white-space: nowrap; padding: 6px 8px; margin-left: -8px; border-radius: var(--r-sm); }
.topbar__back:hover { color: var(--cream); background: rgba(255, 255, 255, .06); }
.topbar__brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-title); font-size: 21px; font-weight: 600; letter-spacing: .3px; }
.topbar__mark { color: var(--gold); font-size: 18px; }
.topbar__user { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; color: rgba(251, 241, 228, .85); min-width: 0; }
.topbar__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.topbar__avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--black-2); color: var(--gold-bright); border: 1px solid var(--gold-dim); font-weight: 600; font-size: 13px; flex: none; }
/* Bouton « Aide » (procédure à la section de l'écran affiché) : bouton secondaire, version barre sombre */
.topbar .btn--ghost.topbar__help { margin-left: auto; flex: none; gap: 6px; background: transparent; color: var(--cream); border-color: rgba(240, 215, 123, .45); }
.topbar .btn--ghost.topbar__help:hover { background: rgba(255, 255, 255, .06); border-color: var(--gold); color: var(--gold-bright); }
.topbar__help + .topbar__user { margin-left: 0; }
.topbar__help-ico { display: inline-grid; place-items: center; width: 17px; height: 17px; border: 1.5px solid currentColor; border-radius: 50%; font-size: 11px; font-weight: 600; line-height: 1; flex: none; }
@media (max-width: 359px) {
  /* très petits écrans : « ? » seul, le libellé « Aide » reste lu par les lecteurs d'écran */
  .topbar .btn--ghost.topbar__help { padding: 6px 12px; }
  .topbar__help-txt { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}

/* ---------------------------------------------------------------- Onglets */
.tabs { position: sticky; top: 56px; z-index: 25; background: var(--cream-2); border-bottom: 1px solid var(--border); }
.tabs__inner { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs__inner::-webkit-scrollbar { display: none; }
.tabs__link {
  position: relative; padding: 13px 14px 12px; text-decoration: none; color: var(--ink-2);
  font-weight: 500; font-size: 14.5px; white-space: nowrap; border-radius: 0;
}
.tabs__link:hover { color: var(--ink); }
.tabs__link.is-active { color: var(--ink); }
.tabs__link.is-active::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--gold); }
.tabs__link:focus-visible { box-shadow: inset var(--focus); }

/* ---------------------------------------------------------------- Mise en page */
.main, .main:focus, .main:focus-visible { outline: none; box-shadow: none; }
.page { max-width: var(--maxw); margin: 0 auto; padding: 28px var(--gutter) 64px; }
.page--editor { padding-bottom: 120px; }
.page__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page__head--editor { align-items: center; }
.page__title { font-family: var(--f-title); font-weight: 600; font-size: 32px; line-height: 1.15; margin: 0; letter-spacing: .2px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; overflow-wrap: anywhere; }
.page__title .badge { font-family: var(--f-text); letter-spacing: 0; }
.page__sub { margin: 6px 0 0; color: var(--muted); }
.page__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.backlink { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 6px; margin-left: -4px; padding: 2px 4px; border-radius: 4px; }
.backlink:hover { color: var(--ink); }
.h3 { font-size: 15px; font-weight: 600; margin: 18px 0 8px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--shadow-1); min-width: 0; }
.card + .card { margin-top: 16px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card__title { font-family: var(--f-title); font-weight: 600; font-size: 19px; margin: 0; display: flex; align-items: center; gap: 8px; }
.card__title .ico { color: var(--gold-dim); }
.card__head .card__title { margin: 0; }
.link { font-size: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; align-items: start; }
.grid-2 > .card + .card { margin-top: 0; }

/* ---------------------------------------------------------------- Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: transparent; cursor: pointer;
  font-weight: 500; font-size: 14.5px; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--black); color: var(--cream); border-color: var(--black); }
.btn--primary:hover:not(:disabled) { background: var(--black-2); color: var(--gold-bright); }
.btn--accent { background: var(--fuchsia); color: #fff; border-color: var(--fuchsia); }
.btn--accent:hover:not(:disabled) { background: var(--fuchsia-dark); border-color: var(--fuchsia-dark); color: #fff; }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn--ghost:hover:not(:disabled) { background: var(--cream-2); border-color: var(--gold); color: var(--ink); }
.btn--danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn--danger:hover:not(:disabled) { background: #a32e22; }
.btn--link { background: none; border: none; color: var(--gold-dim); padding: 4px 6px; min-height: 0; }
.btn--link:hover:not(:disabled) { color: var(--ink); background: var(--cream-2); }
.btn--sm { min-height: 34px; padding: 6px 11px; font-size: 13.5px; }
.btn--block { width: 100%; }
.btn.is-busy { cursor: progress; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--cream-2); border-color: var(--border); color: var(--ink); }
.chip-btn { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--ink-2); line-height: 1.3; display: inline-flex; align-items: center; gap: 6px; }
.chip-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--ink); background: var(--cream-2); }
.chip-btn:disabled { opacity: .55; cursor: progress; }
.chip-btn--sm { padding: 3px 9px; font-size: 12.5px; }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } * { transition: none !important; } }

/* ---------------------------------------------------------------- Formulaires */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { margin-bottom: 16px; min-width: 0; }
.field--narrow { max-width: 420px; }
.field--inline { display: flex; align-items: center; gap: 8px; margin: 0; }
.field--inline label { margin: 0; font-size: 14px; color: var(--muted); }
.field label, .field__label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 6px; color: var(--ink); }
.field__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.field__row label { margin-bottom: 2px; }
.field__tools { display: flex; gap: 2px; flex-wrap: wrap; }
.req { color: var(--fuchsia); }
input[type=text], input[type=email], input[type=search], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
textarea { line-height: 1.55; resize: vertical; min-height: 120px; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; 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 d='M1 1.5l5 5 5-5' fill='none' stroke='%238A6D1F' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; text-overflow: ellipsis; }
input:hover, select:hover, textarea:hover { border-color: var(--gold-dim); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: var(--focus); }
input[aria-invalid=true] { border-color: var(--bad); }
input::placeholder, textarea::placeholder { color: #A79F90; }
.hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.field__err { margin: 6px 0 0; color: var(--bad); font-size: 13px; font-weight: 500; }
.field__warn { color: var(--warn-ink); font-size: 13.5px; margin: 6px 0 0; display: inline-flex; gap: 6px; align-items: baseline; }
.input-suffix { display: flex; align-items: center; gap: 8px; }
.input-suffix input { max-width: 90px; }
.fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.card.fieldset { padding: 20px 22px; border: 1px solid var(--border); }
.fieldset > legend { padding: 0; margin-bottom: 14px; float: left; width: 100%; }
.fieldset > legend + * { clear: both; }

.radio-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.radio { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 10px; align-items: start; cursor: pointer; }
.check > input { grid-row: 1 / span 2; }
.radio { border: 1px solid var(--border-strong); border-radius: 999px; padding: 7px 14px 7px 10px; background: var(--surface); }
.radio:has(input:checked) { border-color: var(--gold); background: var(--cream-2); box-shadow: inset 0 0 0 1px var(--gold); }
input[type=radio], input[type=checkbox] { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--black); flex: none; }
.check { padding: 8px 10px; border-radius: var(--r-sm); }
.check:hover { background: var(--cream-2); }
.check__main { min-width: 0; overflow-wrap: anywhere; }
.check__sub { grid-column: 2; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.check__sub.is-zero { color: #A79F90; }
.check--strong .check__main { font-weight: 600; }
.check--inline { display: inline-grid; padding: 6px 8px; }
.checks-row { display: flex; gap: 8px 18px; flex-wrap: wrap; margin-bottom: 12px; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px 8px; }
.checklist--scroll { max-height: 270px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--r); padding: 6px; background: var(--cream-2); }
.checklist--team { margin-top: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips--suggest { margin-top: 8px; }
.chip-toggle { position: relative; cursor: pointer; }
.chip-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-toggle > span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); font-size: 14px; }
.chip-toggle input:checked + span { background: var(--black); color: var(--cream); border-color: var(--black); }
.chip-toggle input:focus-visible + span { box-shadow: var(--focus); }
.chip-toggle__n { font-family: var(--f-mono); font-size: 12px; opacity: .7; }

.search { position: relative; display: flex; align-items: center; min-width: 0; flex: 1 1 220px; max-width: 340px; }
.search .ico { position: absolute; left: 11px; color: var(--muted-ui); pointer-events: none; }
.search input { padding-left: 36px; }
.search--sm { flex: 0 1 220px; }
.search--sm input { min-height: 36px; font-size: 14px; }
.select-wrap { flex: 0 1 220px; min-width: 0; }

/* ---------------------------------------------------------------- Barres d'outils */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar__group { display: contents; }
.segmented { display: inline-flex; background: var(--cream-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented__btn { border: 0; background: transparent; padding: 6px 12px; border-radius: 5px; font-size: 14px; cursor: pointer; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; min-height: 32px; }
.segmented__btn:hover { color: var(--ink); background: rgba(212, 175, 55, .12); }
.segmented__btn.is-on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1), 0 0 0 1px var(--border); }
.segmented__n { font-family: var(--f-mono); font-size: 12px; color: var(--muted); font-weight: 400; }

/* ---------------------------------------------------------------- Badges, pastilles */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.5; white-space: nowrap; border: 1px solid transparent; vertical-align: middle; }
.badge--neutral { background: var(--cream-2); color: var(--ink-2); border-color: var(--border-strong); }
.badge--good { background: var(--good-bg); color: #17703F; }
.badge--warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge--bad { background: var(--bad-bg); color: #A03024; }
.badge--info { background: var(--info-bg); color: var(--info-ink); }
.badge--muted { background: #F1ECE3; color: var(--muted); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 4px; background: var(--cream); border: 1px solid var(--border); font-size: 12.5px; color: var(--ink-2); }
.tag--mode { background: var(--black); color: var(--gold-bright); border-color: var(--black); font-weight: 500; }
.tags { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.pill { display: inline-grid; place-items: center; min-width: 30px; padding: 1px 7px; border-radius: 999px; font-family: var(--f-mono); font-size: 12.5px; font-weight: 500; }
.pill--good { background: var(--good-bg); color: #17703F; }
.pill--bad { background: var(--bad-bg); color: #A03024; }
.pill--muted { background: #F1ECE3; color: var(--muted); }
.pill.is-zero { opacity: .45; }

/* ---------------------------------------------------------------- Encadrés */
.callout { border-radius: var(--r); padding: 12px 14px; border: 1px solid; margin: 12px 0; font-size: 14px; }
.callout p { margin: 4px 0; }
.callout ul { margin: 6px 0 0; padding-left: 20px; }
.callout--warn { background: var(--warn-bg); border-color: #EBD3A4; color: #5E4111; }
.callout--bad { background: var(--bad-bg); border-color: #EFC2BC; color: #7A2219; }
.callout--info { background: var(--info-bg); border-color: #B7E1DD; color: #0A4F4F; }
.callout.small { font-size: 13px; padding: 8px 10px; }
.callout .btn { margin-top: 10px; }

.empty { text-align: center; padding: 44px 20px; border: 1px dashed var(--border-strong); border-radius: var(--r-lg); background: rgba(255, 255, 255, .5); }
.empty__mark { color: var(--gold); font-size: 20px; }
.empty__title { font-family: var(--f-title); font-size: 19px; margin: 6px 0 4px; }
.empty__text { color: var(--muted); margin: 0 auto 16px; max-width: 460px; }
.card .empty { border: 0; background: none; padding: 26px 10px; }

.loading { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); padding: 48px 16px; }
.loading .spinner { color: var(--gold-dim); }
.loading--page { min-height: 50vh; }

/* ---------------------------------------------------------------- Écrans d'état */
.gate { min-height: calc(100vh - 58px); display: grid; place-items: center; padding: 32px 16px; }
.gate__card { max-width: 460px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 36px 32px; box-shadow: var(--shadow-1); border-top: 3px solid var(--gold); }
.gate--warn .gate__card { border-top-color: var(--warn); }
.gate--bad .gate__card { border-top-color: var(--bad); }
.gate__mark { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%; background: var(--black); color: var(--gold); display: grid; place-items: center; font-size: 22px; }
.gate__title { font-family: var(--f-title); font-size: 27px; margin: 0 0 10px; }
.gate__text { color: var(--ink-2); margin: 0 0 22px; }
.gate__actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Tableau de bord */
.stats { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 16px; }
.stats--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 20px; box-shadow: var(--shadow-1); min-width: 0; }
.stat--meter { background: var(--black); color: var(--cream); border-color: var(--black); }
.stat--meter .stat__label, .stat--meter .stat__hint { color: rgba(251, 241, 228, .74); }
.stat--meter .stat__of { color: rgba(251, 241, 228, .6); }
.stat--meter a { color: var(--gold-bright); }
.stat--good .stat__value { color: var(--good); }
.stat--bad .stat__value { color: var(--bad); }
.stat__label { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; }
.stat__value { margin: 4px 0 6px; font-size: 32px; line-height: 1.1; }
.stat__value .num { font-weight: 500; }
.stat__of { font-family: var(--f-mono); font-size: 18px; color: var(--muted); }
.stat__hint { margin: 0; font-size: 13px; color: var(--muted); }
.meter { height: 7px; border-radius: 99px; background: rgba(251, 241, 228, .14); overflow: hidden; margin: 6px 0 10px; }
.meter span { display: block; height: 100%; background: var(--gold); border-radius: inherit; transition: width .4s; }
.meter--warn span { background: #E8A33A; }
.meter--bad span { background: var(--fuchsia); }

.card--alerts { margin-top: 16px; border-left: 3px solid var(--warn); }
.alerts { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.alert { padding: 8px 12px; border-radius: var(--r-sm); font-size: 14px; overflow-wrap: anywhere; }
.alert--warn { background: var(--warn-bg); }
.alert--bad { background: var(--bad-bg); }

.timeline, .runs { list-style: none; margin: 0; padding: 0; }
.timeline__item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--border); }
.timeline__item:first-child { border-top: 0; padding-top: 0; }
.timeline__when, .timeline__what { display: flex; flex-direction: column; min-width: 0; }
.timeline__date { font-weight: 500; font-size: 14px; }
.timeline__name { font-weight: 600; text-decoration: none; color: var(--ink); overflow-wrap: anywhere; }
.timeline__name:hover { color: var(--gold-dim); text-decoration: underline; }
.timeline__count { text-align: right; white-space: nowrap; }
.timeline__count .num { font-size: 18px; }
.timeline__count.is-zero { color: var(--bad); }
.runs__item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.runs__item:first-child { border-top: 0; padding-top: 0; }
.runs__link { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); min-width: 0; }
.runs__name { font-weight: 600; overflow-wrap: anywhere; }
.runs__link:hover .runs__name { color: var(--gold-dim); text-decoration: underline; }
.runs__counts { display: inline-flex; gap: 4px; }
.legend { margin: 12px 0 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Liste des envois */
.clist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.crow { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.4fr); grid-template-areas: "main facts" "actions actions"; gap: 12px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 20px; box-shadow: var(--shadow-1); border-left: 3px solid var(--border-strong); }
.crow--active { border-left-color: var(--good); }
.crow--paused { border-left-color: var(--warn); }
.crow--draft { border-left-color: var(--gold); }
.crow--archived { opacity: .8; }
.crow__main { grid-area: main; min-width: 0; }
.crow__title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.crow__name { font-family: var(--f-title); font-size: 19px; font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.crow__name:hover { color: var(--gold-dim); text-decoration: underline; }
.crow__subject { margin: 4px 0 8px; color: var(--ink-2); overflow-wrap: anywhere; }
.crow__meta { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.crow__facts { grid-area: facts; margin: 0; display: grid; grid-template-columns: 1.6fr .8fr 1fr; gap: 10px; align-content: start; }
.crow__facts dt { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.crow__facts dd { margin: 2px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.crow__actions { grid-area: actions; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; border-top: 1px solid var(--border); padding-top: 12px; }

/* ---------------------------------------------------------------- Éditeur */
.stepper { list-style: none; margin: 0 0 18px; padding: 0; display: flex; gap: 6px; counter-reset: s; }
.stepper__item { flex: 1 1 0; min-width: 0; }
.stepper__btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--r); cursor: pointer; text-align: left; color: var(--ink-2); }
.stepper__btn:hover { border-color: var(--gold); }
.stepper__n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--cream); border: 1px solid var(--border-strong); font-family: var(--f-mono); font-size: 13px; flex: none; }
.stepper__label { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.is-current .stepper__btn { border-color: var(--black); color: var(--ink); box-shadow: inset 0 -3px 0 var(--gold); }
.is-current .stepper__n { background: var(--black); color: var(--gold-bright); border-color: var(--black); }
.is-done .stepper__n { background: var(--good-bg); color: var(--good); border-color: #BFE3CC; }
.is-done .stepper__n .ico { width: 14px; height: 14px; }

.editor-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(253, 249, 241, .96); backdrop-filter: blur(6px); border-top: 1px solid var(--border); box-shadow: 0 -6px 20px rgba(14, 12, 16, .06); }
.editor-foot__inner, .modal__foot-inner { max-width: var(--maxw); margin: 0 auto; padding: 12px var(--gutter); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.modal__foot-inner { padding: 0; width: 100%; }
.editor-foot__spacer { flex: 1 1 auto; }

.ai-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 10px; background: var(--cream-2); border: 1px solid var(--border); border-bottom: 0; border-radius: var(--r-sm) var(--r-sm) 0 0; }
.ai-bar + .ai-undo + textarea, .ai-bar + textarea { border-top-left-radius: 0; border-top-right-radius: 0; }
.ai-bar__label { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-dim); margin-right: 4px; }
.ai-undo { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 10px; background: var(--fuchsia-tint); border: 1px solid #F5C6DD; border-bottom: 0; font-size: 14px; color: #6E0B3D; }
.ai-undo .ico { color: var(--fuchsia); }
.ai-undo__btns { display: flex; gap: 6px; }
.is-ai-busy textarea, .is-ai-busy input[data-ce-field] { opacity: .6; }

.aud { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.aud__main { display: grid; gap: 16px; min-width: 0; }
.aud__main > .card + .card { margin-top: 0; }
.aud__side { position: sticky; top: 120px; }
.aud-block { margin-top: 16px; }
.aud-block__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.aud-block__title { font-size: 14px; font-weight: 600; margin: 0; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.aud-summary { border-top: 3px solid var(--gold); }
.aud-summary__label { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.aud-summary__count { margin: 0; font-size: 46px; line-height: 1.1; }
.excluded { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.excluded__title { margin: 0 0 6px; font-weight: 600; font-size: 14px; color: var(--warn-ink); }
.excluded__list, .reclist ul { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow-y: auto; }
.excluded__list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; padding: 6px 0; border-top: 1px dashed var(--border); font-size: 13.5px; }
.excluded__list li:first-child { border-top: 0; }
.excluded__who { font-weight: 500; overflow-wrap: anywhere; }
.excluded__email { grid-column: 1; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.excluded__list .badge { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.reclist { margin-top: 12px; font-size: 14px; }
.reclist summary { cursor: pointer; color: var(--gold-dim); font-weight: 500; }
.reclist li { display: flex; flex-direction: column; padding: 5px 0; border-top: 1px dashed var(--border); overflow-wrap: anywhere; }

.mode-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mode-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 14px 14px 42px; border: 1px solid var(--border-strong); border-radius: var(--r); cursor: pointer; background: var(--surface); }
.mode-card input { position: absolute; left: 14px; top: 16px; }
.mode-card:has(input:checked) { border-color: var(--black); box-shadow: inset 0 0 0 1px var(--black); background: var(--cream-2); }
.mode-card__title { font-weight: 600; }
.mode-card__text { font-size: 13.5px; color: var(--muted); }
.when-detail { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.when-summary { margin: 4px 0 0; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.when-box { margin-top: 12px; background: var(--cream-2); border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: var(--r); padding: 14px 16px; }
.when-box__desc { margin: 0 0 8px; font-family: var(--f-title); font-size: 19px; }
.when-box__label { margin: 0 0 4px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.when-box__dates { margin: 0; padding-left: 20px; }
.when-box__dates li { padding: 1px 0; }

.review { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.review__side .card { position: sticky; top: 120px; }
.review__preview { margin-top: 0 !important; }
.facts { margin: 0 0 12px; display: grid; gap: 10px; }
.facts dt { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.review__warn:empty { display: none; }
.mailhead { border: 1px solid var(--border); border-bottom: 0; border-radius: var(--r) var(--r) 0 0; background: var(--cream-2); padding: 10px 14px; font-size: 14px; }
.mailhead p { margin: 2px 0; overflow-wrap: anywhere; }
.mailhead__k { display: inline-block; min-width: 54px; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; }
.mailframe { display: block; width: 100%; height: 560px; border: 1px solid var(--border); border-radius: 0 0 var(--r) var(--r); background: var(--cream); }
.errlist { padding-left: 20px; }

/* ---------------------------------------------------------------- Modèles */
.tgrid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tcard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow-1); min-width: 0; transition: border-color .15s; }
.tcard:hover { border-color: var(--gold); }
.tcard__link { text-decoration: none; color: var(--ink); }
.tcard__name { font-family: var(--f-title); font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.tcard__link:hover .tcard__name { color: var(--gold-dim); text-decoration: underline; }
.tcard__subject { margin: 6px 0 4px; font-weight: 500; font-size: 14px; overflow-wrap: anywhere; }
.tcard__body { margin: 0 0 12px; font-size: 13.5px; color: var(--muted); white-space: pre-line; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow-wrap: anywhere; flex: 1; }
.tcard__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--border); padding-top: 10px; flex-wrap: wrap; }
.tcard__actions { display: inline-flex; gap: 4px; align-items: center; }
.tedit { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tedit > .card + .card { margin-top: 0; }
.tedit__preview { position: sticky; top: 120px; }
.tedit__preview .mailframe { height: 480px; }

/* ---------------------------------------------------------------- Tableaux */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow-x: auto; box-shadow: var(--shadow-1); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 11px 14px; background: var(--cream-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 14px; border-top: 1px solid var(--border); vertical-align: top; overflow-wrap: break-word; }
.table th.t-num { text-align: right; }
.table tbody tr:first-child td { border-top: 0; }
.table tbody tr:hover td { background: #FFFCF6; }
.table tr.is-off td { color: var(--muted); }
.table--compact td, .table--compact th { padding: 8px 10px; }
.t-num { text-align: right; }
.t-bad { color: var(--bad); }
.cell-actions { white-space: nowrap; text-align: right; width: 1%; }
.cell-email { font-size: 13.5px; white-space: nowrap; }
.cell-detail { max-width: 340px; }
.table-wrap--modal { max-height: 46vh; overflow: auto; }

/* ---------------------------------------------------------------- Import */
.mini-steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 16px; flex-wrap: wrap; font-size: 13px; counter-reset: ms; }
.mini-steps li { counter-increment: ms; padding: 3px 10px 3px 6px; border-radius: 999px; background: var(--cream-2); border: 1px solid var(--border); color: var(--muted); }
.mini-steps li::before { content: counter(ms); display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); margin-right: 6px; font-family: var(--f-mono); font-size: 11px; }
.mini-steps .is-current { background: var(--black); color: var(--cream); border-color: var(--black); }
.mini-steps .is-current::before { background: var(--gold); color: var(--black); }
.mini-steps .is-done { color: var(--good); }
.dropzone { text-align: center; padding: 30px 20px; border: 2px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--cream-2); }
.dropzone .ico { width: 30px; height: 30px; color: var(--gold-dim); }
.dropzone p { margin: 6px auto; max-width: 480px; }
.dropzone.is-over { border-color: var(--gold); background: #FFF8E6; }
.btn--file { margin-top: 10px; }
.map-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.imp-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.imp-count { border-radius: var(--r); padding: 10px 14px; font-size: 14px; border: 1px solid var(--border); }
.imp-count .num { display: block; font-size: 24px; }
.imp-count--good { background: var(--good-bg); border-color: #C3E6D0; }
.imp-count--info { background: var(--info-bg); border-color: #BFE3DF; }
.imp-count--muted { background: #F4EFE6; }
.skiplist { list-style: none; padding: 0; margin: 0; max-height: 220px; overflow: auto; font-size: 13.5px; }
.skiplist li { padding: 4px 0; border-top: 1px dashed var(--border); overflow-wrap: anywhere; }
.skiplist .num { color: var(--muted); margin-right: 6px; }

/* ---------------------------------------------------------------- Modales */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(14, 12, 16, .5); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-2); width: 100%; max-height: calc(100vh - 40px); display: flex; flex-direction: column; border-top: 3px solid var(--gold); }
.modal--sm { max-width: 480px; }
.modal--md { max-width: 640px; }
.modal--lg { max-width: 920px; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 6px; }
.modal__title { font-family: var(--f-title); font-size: 22px; font-weight: 600; margin: 0; }
.modal__body { padding: 10px 20px 16px; overflow-y: auto; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--cream-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.confirm__msg { margin: 0 0 8px; }
.confirm-send__big { font-size: 17px; margin: 0 0 8px; overflow-wrap: anywhere; }
.confirm-send__big .num { font-size: 26px; color: var(--fuchsia); font-weight: 600; }

/* ---------------------------------------------------------------- Menus, toasts */
.popmenu { position: absolute; z-index: 80; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r); box-shadow: var(--shadow-2); padding: 5px; max-height: 340px; overflow-y: auto; }
.popmenu__item { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 14px; padding: 8px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer; text-align: left; font-size: 14px; }
.popmenu__item:hover, .popmenu__item:focus { background: var(--cream-2); outline: none; }
.popmenu__item:focus-visible { box-shadow: inset var(--focus); }
.popmenu__item code { font-size: 11.5px; color: var(--gold-dim); white-space: nowrap; }
.popmenu__item.is-danger { color: var(--bad); }
.popmenu__sep { height: 1px; background: var(--border); margin: 4px 2px; }

.toasts { position: fixed; z-index: 90; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; max-width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.page--editor ~ .toasts, body:has(.editor-foot) .toasts { bottom: 86px; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; background: var(--black); color: var(--cream); border-radius: var(--r); padding: 10px 8px 10px 14px; box-shadow: var(--shadow-2); font-size: 14px; border-left: 4px solid var(--gold); animation: toastIn .2s ease-out; max-width: 100%; }
.toast.is-out { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.toast--good { border-left-color: #3FBF7A; }
.toast--warn { border-left-color: #E8A33A; }
.toast--bad { border-left-color: var(--fuchsia); }
.toast__msg { flex: 1; overflow-wrap: anywhere; }
.toast__act { border: 1px solid var(--gold-dim); background: transparent; color: var(--gold-bright); border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 13px; }
.toast__close { border: 0; background: transparent; color: rgba(251, 241, 228, .7); cursor: pointer; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; }
.toast__close:hover { color: var(--cream); background: rgba(255, 255, 255, .08); }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1000px) {
  .aud, .review, .tedit { grid-template-columns: minmax(0, 1fr); }
  .aud__side, .review__side .card, .tedit__preview { position: static; }
  .aud__side { order: -1; }
  .crow { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "facts" "actions"; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .grid-2, .stats { grid-template-columns: minmax(0, 1fr); }
  .stats--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid, .form-grid--3, .map-grid, .mode-cards { grid-template-columns: minmax(0, 1fr); }
  .page { padding-top: 20px; }
  .page__title { font-size: 26px; }
  .stepper__label { display: none; }
  .stepper__item.is-current .stepper__label { display: inline; }
  .stepper__item.is-current { flex: 2.6 1 0; }
  .stepper__btn { justify-content: center; padding: 8px; }
  .crow__facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .crow__facts > div:first-child { grid-column: 1 / -1; }
  .crow__actions { justify-content: flex-start; }
  .search, .select-wrap { flex: 1 1 100%; max-width: none; }
  .toolbar__group { display: contents; }
  .timeline__item { grid-template-columns: minmax(0, 1fr) auto; }
  .timeline__when { grid-column: 1 / -1; flex-direction: row; gap: 8px; flex-wrap: wrap; }
  .mailframe { height: 460px; }
  .imp-counts { grid-template-columns: minmax(0, 1fr); }
  .checklist { grid-template-columns: minmax(0, 1fr); }

  /* tableaux en cartes */
  .table-wrap:not(.table-wrap--modal) { background: none; border: 0; box-shadow: none; overflow: visible; }
  .table-wrap:not(.table-wrap--modal) .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-wrap:not(.table-wrap--modal) .table, .table-wrap:not(.table-wrap--modal) .table tbody, .table-wrap:not(.table-wrap--modal) .table tr, .table-wrap:not(.table-wrap--modal) .table td { display: block; width: 100%; }
  .table-wrap:not(.table-wrap--modal) .table tr { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 10px 14px; margin-bottom: 10px; box-shadow: var(--shadow-1); }
  .table-wrap:not(.table-wrap--modal) .table td { border: 0; padding: 4px 0; display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 8px; text-align: left; justify-items: start; align-items: start; }
  .table-wrap:not(.table-wrap--modal) .table td::before { content: attr(data-label); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding-top: 2px; }
  .table-wrap:not(.table-wrap--modal) .table td.cell-actions { display: flex; justify-content: flex-end; width: 100%; padding-top: 6px; border-top: 1px dashed var(--border); margin-top: 6px; }
  .table-wrap:not(.table-wrap--modal) .table td.cell-actions::before { content: none; }
  .table-wrap:not(.table-wrap--modal) .table tbody tr:hover td { background: none; }

  .editor-foot__inner { padding: 10px var(--gutter); gap: 6px; }
  .editor-foot .btn { padding: 8px 12px; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { max-height: 92vh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .modal__foot { border-radius: 0; }
  .toasts { right: 12px; left: 12px; bottom: 12px; max-width: none; align-items: stretch; }
}
@media (max-width: 480px) {
  .topbar { gap: 10px; }
  .topbar__name { display: none; }
  .topbar__brand { font-size: 19px; }
  .stat__value { font-size: 28px; }
  .editor-foot__spacer { display: none; }
  .editor-foot__inner > .btn { flex: 1 1 auto; }
  .editor-foot [data-nav="prev"] span { display: none; }
  .crow { padding: 14px; }
  .crow__actions .btn { flex: 1 1 auto; }
  .radio-row .radio { flex: 1 1 auto; }
  .page__head > .btn, .page__actions { width: 100%; }
  .page__actions .btn { flex: 1 1 auto; }
  .page__head > .btn { justify-content: center; }
  .field--inline { flex-wrap: wrap; width: 100%; }
}

/* ---------------------------------------------------------------- Revue UX (compléments) */
input[type=radio]:focus-visible { border-radius: 50%; }
input[type=checkbox]:focus-visible { border-radius: 3px; }
.icon-btn[data-act="delete"]:hover { color: var(--bad); background: var(--bad-bg); border-color: #EFC2BC; }
.popmenu__item.is-danger:hover, .popmenu__item.is-danger:focus { background: var(--bad-bg); }
/* Action d'envoi secondaire : fuchsia en trait, le fuchsia plein reste réservé au moment d'envoyer */
.btn--accent-soft { background: var(--surface); color: var(--fuchsia-dark); border-color: #F0B5D1; }
.btn--accent-soft:hover:not(:disabled) { background: var(--fuchsia-tint); border-color: var(--fuchsia); color: var(--fuchsia-dark); }
.review .card__title, .review__side .card__title { margin-bottom: 14px; }
.confirm-send__warn { font-size: 13.5px; color: var(--ink-2); margin: 8px 0 0; }
.editor-foot__count { display: inline-flex; align-items: baseline; gap: 6px; font-size: 14px; color: var(--ink-2); }
.editor-foot__count .num { font-size: 18px; font-weight: 600; color: var(--ink); }

/* Premiers pas (tableau de bord) */
.onboard { margin-bottom: 16px; border-top: 3px solid var(--gold); }
.onboard__intro { margin: -6px 0 14px; color: var(--muted); }
.onboard__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.onboard__step { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--border); border-radius: var(--r); background: var(--cream-2); min-width: 0; }
.onboard__step.is-done { background: var(--surface); }
.onboard__n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--black); color: var(--gold-bright); font-family: var(--f-mono); font-size: 13px; }
.onboard__step.is-done .onboard__n { background: var(--good-bg); color: var(--good); }
.onboard__step.is-done .onboard__n .ico { width: 14px; height: 14px; }
.onboard__title { margin: 2px 0 0; font-weight: 600; }
.onboard__text { margin: 0 0 6px; font-size: 13.5px; color: var(--muted); flex: 1; }
.onboard__step .btn { align-self: flex-start; }

@media (max-width: 1000px) {
  .onboard__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .card, .card.fieldset { padding: 16px; }
  .onboard__steps { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stats .stat--meter { grid-column: 1 / -1; }
  .stats--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .runs__item { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .runs__link { grid-column: 1 / -1; }
  .imp-counts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .imp-count { padding: 8px 10px; font-size: 13px; }
  .imp-count .num { font-size: 20px; }

  /* onglets : plus compacts + indice de défilement */
  .tabs__inner { gap: 0; padding: 0 8px; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .tabs__link { padding: 13px 11px 12px; font-size: 14px; }

  /* cibles tactiles ≥ 40 px */
  .btn, .btn--sm, .btn--link { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .segmented__btn { min-height: 40px; }
  .chip-btn, .chip-btn--sm { min-height: 40px; padding: 6px 14px; }
  .chip-toggle > span { min-height: 40px; }
  .radio { min-height: 44px; align-items: center; }
  .radio input { margin-top: 0; }
  .topbar__back, .backlink { min-height: 40px; display: inline-flex; align-items: center; }
  .popmenu__item { min-height: 44px; }
  .toast__close { width: 40px; height: 40px; }
  .toast__act { min-height: 36px; }
  .reclist summary { padding: 10px 0; }
  .card__head .link { padding: 10px 0; }
  .field__tools .btn--link { padding: 4px 8px; }

  /* filtres segmentés : une seule ligne, largeur pleine */
  .segmented { flex-wrap: nowrap; width: 100%; overflow-x: auto; }
  .segmented__btn { flex: 1 0 auto; justify-content: center; }
  .select-wrap { flex: 1 1 calc(50% - 5px); }

  /* liste des envois : menu « ⋯ » dans le coin */
  .crow { position: relative; }
  .crow__title { padding-right: 40px; }
  .crow__actions [data-act="more"] { position: absolute; top: 8px; right: 8px; }

  /* destinataires : choix d'abord, résumé ensuite (compteur repris dans le pied) */
  .aud__side { order: 0; }
  .radio-row .radio { flex: 1 1 100%; }

  /* contacts en cartes compactes */
  .table--contacts td.is-empty { display: none !important; }
  .table-wrap:not(.table-wrap--modal) .table--contacts td[data-label="Nom"] { display: block; padding-right: 96px; font-size: 16px; }
  .table-wrap:not(.table-wrap--modal) .table--contacts td[data-label="Nom"]::before { content: none; }
  .table-wrap:not(.table-wrap--modal) .table--contacts td[data-label="État"] { position: absolute; top: 10px; right: 14px; width: auto; display: block; padding: 0; }
  .table-wrap:not(.table-wrap--modal) .table--contacts td[data-label="État"]::before { content: none; }
  .table-wrap:not(.table-wrap--modal) .table--contacts td[data-label="E-mail"] { display: block; padding-top: 0; color: var(--ink-2); white-space: normal; overflow-wrap: anywhere; }
  .table-wrap:not(.table-wrap--modal) .table--contacts td[data-label="E-mail"]::before { content: none; }
  .table-wrap:not(.table-wrap--modal) .table td.cell-actions { padding-top: 4px; margin-top: 4px; gap: 4px; }
  /* valeurs longues sans espace (nom de dossier, étiquette…) : jamais de défilement horizontal */
  .table-wrap:not(.table-wrap--modal) .table td { overflow-wrap: anywhere; min-width: 0; }
}
@media (max-width: 480px) {
  .editor-foot__inner > [data-nav="prev"] { flex: 0 0 44px; padding: 0; }
  .editor-foot__count { flex: 1 1 100%; justify-content: center; }
  .crow__actions .icon-btn { flex: none; }
}

/* ================================================================ Audits — compléments */
.page--narrow { max-width: 920px; }
.page__lead { min-width: 0; flex: 1 1 320px; }
.btn-row--end { justify-content: flex-end; margin-top: 8px; }
.field--full { grid-column: 1 / -1; }
.t-warn { color: var(--warn-ink); }
.stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 20px; }
.stat--warn { border-color: #EBD3A4; background: var(--warn-bg); }
.stat--warn .stat__value { color: var(--warn-ink); }
.stat__value--text { font-size: 17px; font-weight: 500; margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.stat__value--text .ico { color: var(--gold-dim); }
.row__name { font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.row__name:hover { color: var(--gold-dim); text-decoration: underline; }
.table tr.row--open td:first-child { box-shadow: inset 3px 0 0 var(--good); }
.table tr.row--draft td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.table tr.row--closed td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.table tr.row--reported td:first-child { box-shadow: inset 3px 0 0 var(--info); }
.table-wrap--flat { box-shadow: none; }
.badge--critical { background: #F3DADF; color: #7A0016; }
.mode-cards--auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* fiche campagne */
.facts--row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 20px; margin: 0 0 18px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.facts--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.facts--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-strong); margin: 0 0 16px; overflow-x: auto; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs__btn { position: relative; border: 0; background: none; padding: 10px 14px 11px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); cursor: pointer; white-space: nowrap; border-radius: 6px 6px 0 0; }
.subtabs__btn:hover { color: var(--ink); background: rgba(212, 175, 55, .1); }
.subtabs__btn.is-on { color: var(--ink); font-weight: 600; }
.subtabs__btn.is-on::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--gold); }
.subtabs__btn:focus-visible { box-shadow: inset var(--focus); }

/* liens */
.linkurl { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-width: 0; }
.linkurl__code { font-family: var(--f-mono); font-size: 12px; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; text-align: left; display: inline-block; vertical-align: middle; }
.table .linkurl__code { max-width: 260px; }

/* avancement */
.progress { height: 8px; border-radius: 99px; background: var(--cream); border: 1px solid var(--border); overflow: hidden; margin: 4px 0 4px; min-width: 120px; }
.progress span { display: block; height: 100%; background: var(--gold); border-radius: inherit; }

/* destinataires (puces) */
.chips-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 46px; padding: 6px 8px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-sm); cursor: text; }
.chips-input:focus-within { border-color: var(--gold); box-shadow: var(--focus); }
.chips-input__list { display: contents; }
.chips-input__field { flex: 1 1 160px; min-width: 120px; border: 0 !important; min-height: 30px !important; padding: 4px 6px !important; box-shadow: none !important; background: transparent !important; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 11px; border-radius: 999px; background: var(--black); color: var(--cream); font-size: 13.5px; max-width: 100%; }
.chip__x { border: 0; background: transparent; color: var(--gold-bright); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; padding: 0; }
.chip__x .ico { width: 14px; height: 14px; }
.chip__x:hover { background: rgba(255, 255, 255, .12); }

/* résumé du rapport */
.summary { min-width: 0; max-width: 100%; overflow: hidden; }
.summary details, .summary .sum__body, .summary .secs > .sec, .summary .table-wrap { min-width: 0; max-width: 100%; }
.sec > .table-wrap { overflow-x: auto; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; background: var(--cream-2); min-width: 0; border-top: 3px solid var(--border-strong); }
.kpi--good { border-top-color: var(--good); }
.kpi--warn { border-top-color: var(--warn); }
.kpi--bad { border-top-color: var(--bad); }
.kpi--critical { border-top-color: #7A0016; }
.kpi__label { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; }
.kpi__value { margin: 4px 0 2px; font-size: 28px; line-height: 1.1; }
.kpi__value .num { font-weight: 500; }
.kpi__of { font-family: var(--f-mono); font-size: 15px; color: var(--muted); }
.kpi__hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.sum-conclusion { margin: 0 0 14px; }
.sum-conclusion p { margin: 6px 0 0; }
.sum { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); margin-top: 10px; }
.sum__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.sum__head::-webkit-details-marker { display: none; }
.sum__head::before { content: '▸'; color: var(--gold-dim); margin-right: 8px; font-size: 12px; }
.sum[open] > .sum__head::before { content: '▾'; }
.sum__title { font-family: var(--f-title); font-size: 17px; font-weight: 600; flex: 1 1 auto; }
.sum__body { padding: 4px 14px 14px; }
.sum__body > .h3:first-child { margin-top: 4px; }
.sum__list { margin: 6px 0 0; padding-left: 20px; }
.sum__list li { margin: 3px 0; }
.sum .table-wrap--modal { max-height: none; box-shadow: none; }
.seg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.seg { border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; background: var(--cream-2); min-width: 0; }
.seg__title { margin: 0 0 6px; font-weight: 600; font-size: 14px; }
.seg__list { list-style: none; margin: 0; padding: 0; }
.seg__row { display: flex; flex-direction: column; gap: 4px; padding: 6px 0; border-top: 1px dashed var(--border); font-size: 13.5px; }
.seg__row:first-child { border-top: 0; }
.seg__row--kv { flex-direction: row; justify-content: space-between; align-items: center; gap: 10px; }
.seg__key { font-weight: 500; overflow-wrap: anywhere; }
.seg__worst { display: flex; flex-wrap: wrap; gap: 4px; }
.seg__w .badge { font-weight: 500; white-space: normal; }
.masked { display: inline-block; font-style: italic; color: var(--muted); background: #F1ECE3; border-radius: 4px; padding: 1px 8px; font-size: 12.5px; }
.actions { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 10px; }
.action { border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: var(--r); padding: 10px 14px; background: var(--cream-2); }
.action__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.action__prio { font-family: var(--f-mono); font-size: 12px; background: var(--black); color: var(--gold-bright); border-radius: 4px; padding: 1px 6px; }
.action .sum__list { margin-top: 4px; }
.verbatims { margin: 4px 0 10px; padding-left: 18px; color: var(--ink-2); }
.verbatims li { margin: 3px 0; font-style: italic; }
.secs { display: grid; gap: 8px; }
.sec { border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--cream-2); }
.sec--ok { opacity: .85; }
.sec__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; cursor: pointer; list-style: none; flex-wrap: wrap; font-size: 14px; }
.sec__head::-webkit-details-marker { display: none; }
.sec__title { font-weight: 600; flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.sec__meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.sec > .table-wrap, .sec__none { margin: 0 10px 10px; }
.scen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.scen { border: 1px solid var(--border); border-left: 3px solid var(--warn); border-radius: var(--r); padding: 10px 12px; background: var(--cream-2); min-width: 0; }
.scen--critical { border-left-color: #7A0016; }
.scen--bad { border-left-color: var(--bad); }
.scen--good { border-left-color: var(--good); }
.scen__title { margin: 0 0 6px; font-weight: 600; display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.scen__dl { margin: 0; font-size: 13.5px; }
.scen__dl dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 6px; }
.scen__dl dd { margin: 0; overflow-wrap: anywhere; }
.qa { margin: 0; padding-left: 0; list-style: none; counter-reset: qa; }
.qa__item { padding: 8px 0; border-top: 1px dashed var(--border); counter-increment: qa; display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 6px; }
.qa__item:first-child { border-top: 0; }
.qa__item::before { content: counter(qa); font-family: var(--f-mono); font-size: 12px; color: var(--muted); grid-row: 1 / span 3; padding-top: 3px; }
.qa__item.is-empty { opacity: .7; }
.qa__q { margin: 0; font-size: 14px; }
.qa__a { margin: 2px 0 0; font-size: 14px; }
.qa__det { margin: 4px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; font-size: 13px; }
.qa__det dt { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; }
.qa__det dd { margin: 0; overflow-wrap: anywhere; }

/* modèles */
.table--templates td:first-child { min-width: 220px; }
.table--templates .cell-actions { white-space: normal; }
.table--templates .cell-actions .btn { display: flex; width: 100%; justify-content: flex-start; }
.table--templates .cell-actions .btn + .btn { margin-top: 6px; }
.table--templates .check--inline, .table--access .check--inline { grid-template-columns: 18px auto; white-space: nowrap; }
/* éditeurs JSON (modèles) */
.json-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; align-items: start; }
.json-grid > .card + .card { margin-top: 0; }
.json-editor { font-family: var(--f-mono); font-size: 12.5px; line-height: 1.5; min-height: 460px; height: 60vh; white-space: pre; overflow: auto; tab-size: 2; resize: vertical; }
.json-editor[aria-invalid=true] { border-color: var(--bad); }
.json-status { font-size: 13px; font-weight: 500; }
.json-status.is-ok { color: var(--good); }
.json-status.is-bad { color: var(--bad); }
.json-view { font-family: var(--f-mono); font-size: 12.5px; background: var(--cream-2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px; overflow: auto; max-height: 60vh; }

/* chantier n° 2 — bien-être au travail : rapport, dossier de conformité, échéances */
.kpis--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi--info { border-top-color: var(--info); }
.company-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.company { border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; background: var(--cream-2); min-width: 0; }
.company__title { margin: 0 0 6px; font-weight: 600; font-size: 14px; }
.company .facts { margin: 0; gap: 8px; }
.company .facts dd { font-size: 14px; }
.pill--warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill--paa { background: #FBF3C9; color: #6E5516; }
.pill--info { background: var(--info-bg); color: var(--info-ink); }
.cell-legal { font-size: 13px; color: var(--ink-2); }
.table--flagged td:nth-child(2) { min-width: 220px; }
.obl--overdue td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.obl--due_soon td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.table-wrap--flat .table--obligations td:first-child { font-weight: 600; }
.toolbar--compact { margin-bottom: 8px; gap: 2px 4px; }
.table--documents .cell-check { width: 1%; padding-right: 0; }
.table--documents tr.is-needed td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.table--documents .doc-title { font-weight: 600; cursor: pointer; }
.table--documents .doc-title:hover { color: var(--gold-dim); text-decoration: underline; }
.table tr.is-bundle td { background: var(--cream-2); }
.attach { border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px 12px; margin: 0 0 14px; background: var(--cream-2); min-width: 0; }
.attach__legend { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 0 6px; }
.attach .check { padding: 6px 8px; }
.attach__ver { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.attach__ver select { min-height: 34px; padding: 4px 28px 4px 10px; font-size: 13.5px; width: auto; }
.attach__docs { margin-top: 8px; }
.attach__title { margin: 0 0 6px; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.attach .checklist { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.attach .checklist--scroll { max-height: 220px; background: var(--surface); }

@media (max-width: 1000px) {
  .json-grid { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .stats--3 { grid-template-columns: minmax(0, 1fr); }
  .stats--3 .stat--meter { grid-column: auto; }
  .facts--row { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 14px; }
  .facts--2, .facts--3 { grid-template-columns: minmax(0, 1fr); }
  .subtabs__btn { padding: 12px 12px; min-height: 44px; }
  .linkurl { width: 100%; }
  .linkurl__code, .table .linkurl__code { max-width: none; flex: 1 1 auto; }
  /* cellules en cartes : les sous-lignes (e-mail, détail) restent dans la colonne de valeur */
  .table-wrap:not(.table-wrap--modal) .table td > * { grid-column: 2; }
  .table-wrap:not(.table-wrap--modal) .table td > .sr-only { grid-column: auto; }
  .table-wrap:not(.table-wrap--modal) .table tr.row--open, .table-wrap:not(.table-wrap--modal) .table tr.row--draft, .table-wrap:not(.table-wrap--modal) .table tr.row--closed, .table-wrap:not(.table-wrap--modal) .table tr.row--reported { border-left-width: 3px; }
  .table-wrap:not(.table-wrap--modal) .table tr.row--open { border-left-color: var(--good); }
  .table-wrap:not(.table-wrap--modal) .table tr.row--draft { border-left-color: var(--gold); }
  .table-wrap:not(.table-wrap--modal) .table tr.row--closed { border-left-color: var(--warn); }
  .table-wrap:not(.table-wrap--modal) .table tr.row--reported { border-left-color: var(--info); }
  .table-wrap:not(.table-wrap--modal) .table tr[class*="row--"] td:first-child { box-shadow: none; }
  .table-wrap:not(.table-wrap--modal) .table--obligations tr.obl td:first-child { box-shadow: none; }
  .table-wrap:not(.table-wrap--modal) .table--obligations tr.obl--overdue { border-left: 3px solid var(--bad); }
  .table-wrap:not(.table-wrap--modal) .table--obligations tr.obl--due_soon { border-left: 3px solid var(--warn); }
  .table-wrap:not(.table-wrap--modal) .table--obligations td[data-label="Obligation"] { display: block; }
  .table-wrap:not(.table-wrap--modal) .table--obligations td[data-label="Obligation"]::before { content: none; }
  .subtabs { -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent); mask-image: linear-gradient(90deg, #000 90%, transparent); }
  .table-wrap:not(.table-wrap--modal) .table td.cell-actions { flex-wrap: wrap; gap: 6px; }
  .table-wrap:not(.table-wrap--modal) .table td.cell-actions .btn { flex: 1 1 auto; width: auto; justify-content: center; }
  .table--templates .cell-actions .btn + .btn { margin-top: 0; }
  .kpi__value { font-size: 24px; }
  .page__title { align-items: flex-start; }
  .json-editor { min-height: 320px; height: 50vh; }
  .sum .table-wrap--modal { overflow-x: auto; }
  .company-grid { grid-template-columns: minmax(0, 1fr); }
  .table-wrap:not(.table-wrap--modal) .table--documents td.cell-check { position: absolute; top: 12px; right: 14px; width: auto; display: block; padding: 0; }
  .table-wrap:not(.table-wrap--modal) .table--documents td.cell-check::before { content: none; }
  .table-wrap:not(.table-wrap--modal) .table--documents td.cell-check > input { grid-column: auto; width: 22px; height: 22px; }
  .table-wrap:not(.table-wrap--modal) .table--documents td[data-label="Document"] { display: block; padding-right: 36px; }
  .table-wrap:not(.table-wrap--modal) .table--documents td[data-label="Document"]::before { content: none; }
  .table-wrap:not(.table-wrap--modal) .table--documents td[data-label="Document"] > * { grid-column: auto; }
  .sum__head { padding: 10px 12px; }
  .sum__body { padding: 2px 12px 12px; }
  .qa__item { grid-template-columns: 24px minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .kpis { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .kpis--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page__actions { width: 100%; }
  .page__actions .btn { flex: 1 1 auto; }
  .page__actions .icon-btn { flex: none; }
}

/* QR code d'un lien */
.qr-box { display: grid; gap: 10px; justify-items: center; text-align: center; }
.qr-box__code { width: min(240px, 70vw); aspect-ratio: 1; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; background: #fff; }
.qr-box__code svg { width: 100%; height: 100%; display: block; }
.qr-box__url code { word-break: break-all; font-size: 11px; }

/* Logo des rapports (onglet Modèles) */
.brand-logo { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.brand-logo__preview { width: 180px; height: 84px; border: 1px dashed var(--border-strong); border-radius: 10px; display: grid; place-items: center; background: #1F2A44; padding: 10px; }
.brand-logo__tile { background: #fff; border-radius: 6px; padding: 6px; max-width: 100%; max-height: 100%; display: grid; place-items: center; }
.brand-logo__tile img { max-width: 140px; max-height: 52px; display: block; }
.brand-logo__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Identification de l'entreprise (campagne) */
.company-form .pgroup { margin-top: 18px; }
.company-form .pgroup__title { font: 600 12px/1.3 var(--f-text); text-transform: uppercase; letter-spacing: .08em; color: var(--gold-dim); margin: 0 0 8px; }
.bce-lookup { background: var(--cream-2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; }
.bce-lookup .field { margin: 0; }
.bce-lookup__row { display: flex; gap: 8px; flex-wrap: wrap; }
.bce-lookup__row input { flex: 1 1 200px; min-width: 0; }

/* Modes de lien / réponse retenue */
.radio--block, .field label.radio--block { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); margin-top: 6px; cursor: pointer; }
.radio--block input { margin-top: 3px; flex: none; }
.radio--block > span { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.45; }
.radio--block:has(input:checked) { border-color: var(--gold-dim); background: var(--cream-2); }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field legend { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.table tr.is-retained td { background: var(--info-bg); }

/* Photos de preuve (lecture des réponses) */
.qa__photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.qa__photo { width: 110px; height: 110px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); background: var(--cream-2); display: grid; place-items: center; }
.qa__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
