/* SHIFT Audit — interface. Même langage que SHIFT : gris neutres, police Inter, traits fins,
   la couleur réservée au sens (verdicts, alertes). Tout part des jetons ci-dessous ; thème sombre
   selon le système ou le choix de l'utilisateur (data-theme sur <html>). */
@font-face {
  font-family: "InterVariable";
  src: url("/fonts/InterVariable.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 100 900;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --sidebar: #fafafa;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-3: #f4f4f5;
  --hover: #f4f4f5;
  --border: #e7e7e9;
  --border-strong: #d4d4d8;
  --text: #0a0a0b;
  --text-2: #3f3f46;
  --text-3: #71717a;
  --text-4: #a1a1aa;
  --primary: #18181b;
  --primary-hover: #27272a;
  --on-primary: #fafafa;
  --ring: #a1a1aa;
  --link: #18181b;
  --good: #15803d;
  --good-soft: #ecfdf3;
  --good-line: #16a34a;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --warn-line: #f59e0b;
  --bad: #dc2626;
  --bad-soft: #fef2f2;
  --bad-line: #ef4444;
  --info: #2563eb;
  --info-soft: #eff6ff;
  --shadow-xs: 0 1px 2px rgba(10, 10, 11, 0.05);
  --shadow-lg: 0 16px 48px -12px rgba(10, 10, 11, 0.25), 0 0 0 1px rgba(10, 10, 11, 0.06);
  --radius: 10px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --font: "InterVariable", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f10;
  --sidebar: #141415;
  --surface: #161617;
  --surface-2: #1b1b1d;
  --surface-3: #232326;
  --hover: #1f1f22;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #fafafa;
  --text-2: #d4d4d8;
  --text-3: #a1a1aa;
  --text-4: #71717a;
  --primary: #e4e4e7;
  --primary-hover: #fafafa;
  --on-primary: #18181b;
  --ring: #71717a;
  --link: #fafafa;
  --good: #4ade80;
  --good-soft: rgba(34, 197, 94, 0.12);
  --good-line: #22c55e;
  --warn: #fbbf24;
  --warn-soft: rgba(245, 158, 11, 0.12);
  --warn-line: #f59e0b;
  --bad: #f87171;
  --bad-soft: rgba(239, 68, 68, 0.13);
  --bad-line: #ef4444;
  --info: #60a5fa;
  --info-soft: rgba(59, 130, 246, 0.14);
  --shadow-xs: none;
  --shadow-lg: 0 16px 48px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f0f10;
    --sidebar: #141415;
    --surface: #161617;
    --surface-2: #1b1b1d;
    --surface-3: #232326;
    --hover: #1f1f22;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #fafafa;
    --text-2: #d4d4d8;
    --text-3: #a1a1aa;
    --text-4: #71717a;
    --primary: #e4e4e7;
    --primary-hover: #fafafa;
    --on-primary: #18181b;
    --ring: #71717a;
    --link: #fafafa;
    --good: #4ade80;
    --good-soft: rgba(34, 197, 94, 0.12);
    --good-line: #22c55e;
    --warn: #fbbf24;
    --warn-soft: rgba(245, 158, 11, 0.12);
    --warn-line: #f59e0b;
    --bad: #f87171;
    --bad-soft: rgba(239, 68, 68, 0.13);
    --bad-line: #ef4444;
    --info: #60a5fa;
    --info-soft: rgba(59, 130, 246, 0.14);
    --shadow-xs: none;
    --shadow-lg: 0 16px 48px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { flex: none; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--text-3); }
.soft { color: var(--text-2); }
.faint { color: var(--text-4); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.good { color: var(--good); }
.mid { color: var(--warn); }
.low { color: var(--bad); }
.strong { font-weight: 600; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack-v { display: flex; flex-direction: column; gap: 16px; }
.sep { color: var(--text-4); margin: 0 6px; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--info) 22%, transparent); }

/* ------------------------------------------------------------------ structure */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 18px; padding: 14px 10px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; }
.brand-name { display: block; font-weight: 620; font-size: 14px; letter-spacing: -0.01em; line-height: 1.2; }
.brand-sub { display: block; font-size: 12px; color: var(--text-3); line-height: 1.3; }
.demo-flag { margin-left: auto; font-size: 11px; font-weight: 560; color: var(--warn); background: var(--warn-soft); border-radius: 5px; padding: 1px 6px; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 9px; border-radius: var(--radius-xs);
  color: var(--text-2); font-weight: 500; white-space: nowrap; transition: background 0.1s, color 0.1s;
}
.nav-item svg { color: var(--text-3); }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: var(--surface-3); color: var(--text); }
.nav-item.active svg { color: var(--text); }
:root[data-theme="dark"] .nav-item.active, :root:not([data-theme="light"]) .nav-item.active { box-shadow: none; }
.nav-count { margin-left: auto; font-size: 12px; color: var(--text-4); font-variant-numeric: tabular-nums; }
.nav-section { display: flex; flex-direction: column; gap: 6px; }
.nav-label { font-size: 12px; color: var(--text-4); padding: 0 9px; font-weight: 500; }
.live-card { display: block; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); padding: 10px 11px; font-size: 12.5px; color: var(--text-2); }
.live-card:hover { border-color: var(--border-strong); }
.live-card .live-title { display: flex; align-items: center; gap: 7px; color: var(--text); font-weight: 560; font-size: 13px; }
.live-card .bar { margin: 8px 0 6px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--good-line); box-shadow: 0 0 0 0 color-mix(in srgb, var(--good-line) 55%, transparent); animation: pulse 1.8s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.sidebar-foot { margin-top: auto; padding: 10px 9px 2px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-3); display: flex; flex-direction: column; gap: 4px; }
.sidebar-foot .line { display: flex; align-items: center; gap: 7px; color: var(--text-2); font-weight: 500; }
.sidebar-foot b { color: var(--text); font-weight: 560; font-variant-numeric: tabular-nums; }
.sidebar-foot .foot-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.sidebar-foot button { background: transparent; border: 0; color: var(--text-3); cursor: pointer; padding: 3px 6px 3px 0; border-radius: var(--radius-xs); display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.sidebar-foot button:hover { color: var(--text); }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--text-4); }
.dot.ok { background: var(--good-line); } .dot.ko { background: var(--warn-line); } .dot.err { background: var(--bad-line); }

.content { min-width: 0; }
.view { max-width: 1360px; margin: 0 auto; padding: 28px 36px 64px; }
.topbar-progress { position: fixed; top: 0; left: 236px; right: 0; height: 2px; z-index: 60; overflow: hidden; opacity: 0; transition: opacity 0.2s; }
.topbar-progress.on { opacity: 1; }
.topbar-progress i { display: block; height: 100%; width: 40%; background: var(--text-3); animation: slide 1.1s var(--ease) infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(350%); } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head > div:first-child { min-width: 0; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); margin-bottom: 6px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--text); }
.crumbs .slash { color: var(--text-4); }
.page-head h1 { font-size: 22px; font-weight: 620; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; line-height: 1.3; }
.page-sub { color: var(--text-3); margin-top: 4px; max-width: 80ch; }
.page-sub a { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.main-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.side-col { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.split { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 20px; align-items: start; }
.section-gap { margin-top: 20px; }

/* ---------------------------------------------------------------------- cartes */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; flex-wrap: wrap; }
.card-head + .table-wrap, .card-head + .claims, .card-head + .todo, .card-head + .wf-list { border-top: 1px solid var(--border); }
.card-head h2 { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.card-head p { color: var(--text-3); font-size: 13px; margin-top: 1px; }
.card-title { flex: 1; min-width: 160px; }
.card-body { padding: 16px 20px; }
.card-head + .card-body { padding-top: 0; }
.card-bar { padding: 0 20px 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.card-foot { padding: 11px 20px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.step-num { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border-strong); color: var(--text-2); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.step-num.done { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------------------------- contrôles */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 12px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 500; font-size: 13.5px; white-space: nowrap;
  box-shadow: var(--shadow-xs); transition: background 0.1s, border-color 0.1s, color 0.1s; user-select: none;
}
.btn svg { color: var(--text-3); }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary svg { color: currentColor; }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { color: var(--bad); }
.btn.danger svg { color: currentColor; }
.btn.danger:hover { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.block { width: 100%; height: 40px; font-size: 14px; }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; border-radius: var(--radius-xs); gap: 5px; }
.btn.icon { width: 34px; padding: 0; }
.btn.icon.sm { width: 28px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; box-shadow: none; }
.input, select.input {
  height: 34px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); padding: 0 10px; min-width: 0; font-size: 13.5px; box-shadow: var(--shadow-xs);
}
.input::placeholder { color: var(--text-4); }
.input:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent); }
.input:disabled { opacity: 0.5; }
.search-wrap { position: relative; display: inline-flex; }
.search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-4); pointer-events: none; }
.search-wrap .input { padding-left: 31px; width: 240px; }
.check { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; margin: 0; flex: none; }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-2); user-select: none; font-size: 13.5px; }
.switch { position: relative; width: 32px; height: 18px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch i { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; transition: background 0.15s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform 0.15s var(--ease); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(14px); }
:root[data-theme="dark"] .switch input:checked + i::after { background: #18181b; }
.switch input:focus-visible + i { outline: 2px solid var(--ring); outline-offset: 2px; }

/* Filtres : contrôle segmenté, l'élément choisi ressort en blanc. */
.chips { display: inline-flex; flex-wrap: wrap; gap: 2px; background: var(--surface-3); border-radius: var(--radius-sm); padding: 3px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--radius-xs);
  border: 0; background: transparent; color: var(--text-3); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.chip:hover { color: var(--text); }
.chip.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs), 0 0 0 1px var(--border); }
.chip .count { font-variant-numeric: tabular-nums; color: var(--text-4); font-weight: 500; }
.chip.on .count { color: var(--text-3); }
.seg { display: inline-flex; background: var(--surface-3); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 26px; padding: 0 10px; border-radius: var(--radius-xs); cursor: pointer; color: var(--text-3); font-size: 13px; font-weight: 500; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs), 0 0 0 1px var(--border); }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 4px 0 9px; border-radius: var(--radius-xs); border: 1px solid var(--border); background: var(--surface-2); font-size: 12.5px; max-width: 100%; }
.pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill button { border: 0; background: transparent; cursor: pointer; color: var(--text-4); width: 18px; height: 18px; border-radius: 4px; padding: 0; display: grid; place-items: center; }
.pill button:hover { background: var(--hover); color: var(--text); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px 24px; }
.field > label, .field > .label { display: block; font-weight: 550; margin-bottom: 7px; font-size: 13.5px; }
.field .help { color: var(--text-3); font-size: 12.5px; margin-top: 6px; line-height: 1.45; }
.field .input { width: 100%; }
.field .inline { display: flex; align-items: center; gap: 10px; min-height: 34px; }
.input.narrow { width: 72px; }

/* -------------------------------------------------------------------- onglets */
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 0 1px 11px; color: var(--text-3); font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); border-bottom-color: var(--text); }
.tab-count { font-size: 12px; color: var(--text-4); font-variant-numeric: tabular-nums; font-weight: 500; }
.tab-count.alert { color: var(--bad); }

/* ------------------------------------------------------------------- tableaux */
.table-wrap { overflow: auto; }
.table-wrap.capped { max-height: 470px; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  position: sticky; top: 0; z-index: 1; background: var(--surface-2);
  text-align: left; font-size: 12.5px; font-weight: 500; color: var(--text-3);
  padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table th .sort { display: inline-block; width: 12px; margin-left: 2px; color: var(--text); font-size: 10px; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.link { cursor: pointer; }
.table tbody tr.link:hover, .table tbody tr.pick:hover { background: var(--surface-2); }
.table tbody tr.selected { background: var(--surface-2); }
.table tbody tr.selected td:first-child { box-shadow: inset 2px 0 0 var(--text); }
.table tbody tr.disabled { opacity: 0.5; }
.table td.center, .table th.center { text-align: center; }
.table .cell-main { font-weight: 520; white-space: nowrap; }
.table .cell-sub { color: var(--text-3); font-size: 12.5px; margin-top: 1px; white-space: nowrap; }
.table .wrap, .table .wrap .cell-sub { white-space: normal; }
.table td.clip { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table td.trunc { max-width: 0; }
.table td.trunc .cell-main, .table td.trunc .cell-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table.compact td { padding: 9px 12px; }
.table .chev { color: var(--text-4); width: 1%; }
.more-row { padding: 12px 20px; text-align: center; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: center; gap: 12px; }
.empty { padding: 44px 24px; text-align: center; color: var(--text-3); }
.empty .empty-icon { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); color: var(--text-3); display: grid; place-items: center; margin: 0 auto 14px; }
.empty b { color: var(--text); display: block; margin-bottom: 4px; font-size: 14.5px; font-weight: 600; }
.empty .btn { margin-top: 16px; }

/* ------------------------------------------------------------------ étiquettes */
/* État : un point de couleur et un libellé, sans fond. */
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-4); flex: none; }
.status.done::before, .status.good::before { background: var(--good-line); }
.status.running::before, .status.info::before { background: var(--info); animation: pulse-blue 1.8s infinite; }
.status.stopped::before, .status.interrupted::before, .status.warn::before { background: var(--warn-line); }
.status.error::before, .status.bad::before { background: var(--bad-line); }
.status.idle::before { background: var(--text-4); }
@keyframes pulse-blue { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--info) 50%, transparent); } 70% { box-shadow: 0 0 0 5px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 7px; border-radius: 5px; font-size: 12px; font-weight: 500; background: var(--surface-3); color: var(--text-2); white-space: nowrap; border: 1px solid transparent; }
.badge.outline { background: transparent; border-color: var(--border-strong); }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.tag { display: inline-flex; align-items: center; height: 18px; padding: 0 5px; border-radius: 4px; font-size: 11px; font-weight: 550; background: transparent; border: 1px solid var(--border); color: var(--text-3); white-space: nowrap; }
.tag.free { color: var(--good); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.tag.reco { color: var(--text); border-color: var(--border-strong); }

/* Verdict d'un modèle : pastille douce. */
.vd { display: inline-flex; align-items: center; justify-content: center; height: 20px; min-width: 56px; padding: 0 7px; border-radius: 5px; font-size: 12px; font-weight: 520; white-space: nowrap; }
.vd.juste { background: var(--good-soft); color: var(--good); }
.vd.partiel { background: var(--warn-soft); color: var(--warn); }
.vd.faux { background: var(--bad-soft); color: var(--bad); }
.vd.inv { background: var(--surface-3); color: var(--text-3); }
.vd.err { background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 45%, transparent); color: var(--bad); }
.vd.none { background: transparent; color: var(--text-4); min-width: 0; }
/* Les verdicts du panel en un coup d'œil : un carré par modèle. */
.vstrip { display: inline-flex; gap: 3px; align-items: center; }
.vstrip i { width: 9px; height: 9px; border-radius: 2.5px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border-strong); }
.vstrip i.juste { background: var(--good-line); box-shadow: none; }
.vstrip i.partiel { background: var(--warn-line); box-shadow: none; }
.vstrip i.faux { background: var(--bad-line); box-shadow: none; }
.vstrip i.inv { background: var(--text-4); box-shadow: none; }
.vstrip i.err { background: transparent; box-shadow: inset 0 0 0 1.5px var(--bad-line); }
.vstrip.lg i { width: 11px; height: 11px; border-radius: 3px; }
.gap { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 520; white-space: nowrap; }
.gap::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.gap.confirmed { color: var(--bad); } .gap.confirmed::before { background: var(--bad-line); }
.gap.contested { color: var(--warn); } .gap.contested::before { background: var(--warn-line); }
.gap.single { color: var(--text-3); } .gap.single::before { background: var(--text-4); }

/* -------------------------------------------------------------------- notices */
.notice { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--radius-sm); padding: 11px 14px; font-size: 13.5px; line-height: 1.5; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); }
.notice svg { margin-top: 2px; color: var(--text-3); }
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn-line) 30%, transparent); }
.notice.warn svg { color: var(--warn); }
.notice.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad-line) 28%, transparent); }
.notice.bad svg { color: var(--bad); }
.notice.good svg { color: var(--good); }
.notice.info svg { color: var(--info); }
.notice .notice-body { flex: 1; min-width: 0; }
.notice .notice-body b { font-weight: 600; color: var(--text); }
.notice .btn { flex: none; margin: -3px -4px -3px 0; }
.notices { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }

/* ----------------------------------------------------------------- indicateurs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0; margin-bottom: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.kpi { padding: 16px 20px; min-width: 0; border-left: 1px solid var(--border); margin-left: -1px; }
.kpi-label { font-size: 13px; color: var(--text-3); font-weight: 500; }
.kpi-label[title] { cursor: help; text-decoration: underline dotted var(--text-4); text-underline-offset: 3px; }
.kpi-value { font-size: 26px; font-weight: 600; letter-spacing: -0.025em; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-value small { font-size: 14px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.kpi-foot { font-size: 12.5px; color: var(--text-3); margin-top: 6px; line-height: 1.4; }
.kpi .stackbar { margin-top: 10px; }
.kpi .legend { margin-top: 7px; gap: 10px; font-size: 12px; }

.bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--text-2); border-radius: 999px; transition: width 0.5s var(--ease); }
.bar.thin { height: 4px; }
.bar.good i { background: var(--good-line); } .bar.mid i { background: var(--warn-line); } .bar.low i { background: var(--bad-line); }
.bar.info i { background: var(--info); }
.stackbar { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: var(--surface-3); gap: 1px; }
.stackbar i { display: block; height: 100%; transition: width 0.5s var(--ease); }
.stackbar .s-juste { background: var(--good-line); } .stackbar .s-partiel { background: var(--warn-line); } .stackbar .s-faux { background: var(--bad-line); } .stackbar .s-inv { background: var(--border-strong); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-3); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend i { display: inline-block; width: 7px; height: 7px; border-radius: 2px; }
.scorecell { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.scorecell .bar { width: 64px; flex: none; height: 5px; }
.scoreval { font-weight: 550; font-variant-numeric: tabular-nums; min-width: 54px; text-align: right; white-space: nowrap; }
.scorecell.progress .bar { width: 52px; }
.scorecell.progress .scoreval { font-weight: 450; color: var(--text-2); min-width: 72px; }
.scoreval.low { color: var(--bad); }
.delta { font-size: 12px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 13.5px; }
.kv > span:first-child { color: var(--text-3); }
.kv b { font-variant-numeric: tabular-nums; font-weight: 550; text-align: right; }
.histo { display: flex; flex-direction: column; gap: 10px; }
.histo-row { display: grid; grid-template-columns: 104px 1fr 28px; align-items: center; gap: 12px; font-size: 13px; color: var(--text-2); }
.histo-row .bar { height: 8px; }
.spark { display: block; }
.spark polyline { fill: none; stroke: var(--text-2); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.spark circle { fill: var(--text); }

/* ----------------------------------------------------------------- récapitulatif */
.summary-section { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.summary-section:last-child { border-bottom: 0; }
.summary-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.total { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.total .amount { font-size: 28px; font-weight: 600; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.check-row { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text-2); line-height: 1.45; }
.check-row svg { margin-top: 2px; }
.check-row.ok svg { color: var(--good); } .check-row.warn svg { color: var(--warn); } .check-row.bad svg { color: var(--bad); }

/* ------------------------------------------------------------------ dépôt d'export */
.dropzone { border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); padding: 16px 20px; display: flex; align-items: center; gap: 14px; transition: border-color 0.15s, background 0.15s; }
.dropzone.dragover { border-color: var(--text-2); background: var(--surface-2); }
.dropzone .dz-icon { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border); color: var(--text-2); display: grid; place-items: center; flex: none; background: var(--surface-2); }
.dropzone b { display: block; font-weight: 560; }
.dropzone p { color: var(--text-3); font-size: 13px; margin-top: 1px; }

/* --------------------------------------------------------------- suivi en direct */
.live { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.live > div { padding: 18px 20px; min-width: 0; }
.live > div + div { border-left: 1px solid var(--border); }
.live-headline { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.live-headline .big { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.live-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 12px; margin-top: 16px; }
.live-stat .label { font-size: 12.5px; color: var(--text-3); }
.live-stat .value { font-weight: 560; font-variant-numeric: tabular-nums; font-size: 14.5px; }
.lanes-wrap { overflow-x: auto; margin-top: 16px; }
.lanes { width: 100%; border-collapse: collapse; }
.lanes td { padding: 8px 10px 8px 0; border-top: 1px solid var(--border); vertical-align: middle; font-size: 13px; }
.lanes td:last-child { padding-right: 0; }
.lanes .lane-name { font-weight: 520; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lanes .lane-bar { width: 30%; min-width: 90px; }
.lanes.compact { table-layout: fixed; }
.lanes.compact td:first-child { width: auto; }
.lanes.compact .lane-name, .lanes.compact .lane-note { max-width: none; }
.lanes.compact td.lane-count { width: 64px; }
.lanes.compact td.lane-dot { width: 18px; text-align: right; }
.lanes.compact .status { font-size: 0; gap: 0; }
.lane-note { font-size: 12px; color: var(--text-3); margin-top: 1px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed { display: flex; flex-direction: column; max-height: 340px; overflow: auto; margin: 0 -6px; }
.feed-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 5px 6px; border-radius: var(--radius-xs); font-size: 13px; }
.feed-item:hover { background: var(--surface-2); }
.feed-item .who { color: var(--text-3); }
.feed-item .what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--good-line); }
.feed-dot.partiel { background: var(--warn-line); } .feed-dot.faux, .feed-dot.err { background: var(--bad-line); }
.mini-votes { display: inline-flex; gap: 8px; font-variant-numeric: tabular-nums; font-size: 12.5px; white-space: nowrap; color: var(--text-3); }

/* ------------------------------------------------------------- détail d'un projet */
.wf-list { max-height: calc(100vh - 180px); overflow: auto; }
.wf-item { display: block; width: 100%; text-align: left; padding: 10px 16px 10px 18px; border: 0; border-bottom: 1px solid var(--border); background: transparent; cursor: pointer; color: inherit; position: relative; }
.wf-item:last-child { border-bottom: 0; }
.wf-item:hover { background: var(--surface-2); }
.wf-item.on { background: var(--surface-3); }
.wf-item.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--text); }
.wf-item .wf-key { font-family: var(--mono); font-size: 12px; font-weight: 500; word-break: break-all; color: var(--text); }
.wf-item .wf-meta { display: flex; align-items: center; gap: 10px; margin-top: 5px; font-size: 12.5px; color: var(--text-3); flex-wrap: wrap; }
.claims { display: flex; flex-direction: column; }
.claim { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 20px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.claim:last-child { border-bottom: 0; }
.claim-text { font-size: 14px; line-height: 1.55; color: var(--text); }
.claim-context { font-size: 12.5px; color: var(--text-3); margin-bottom: 4px; }
.claim-context a:hover { color: var(--text); }
.claim-meta { display: flex; align-items: center; gap: 6px 10px; margin-top: 7px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); }
.loc { font-family: var(--mono); font-size: 12px; background: var(--surface-3); border: 0; border-radius: 5px; padding: 2px 7px; cursor: pointer; color: var(--text-2); display: inline-flex; align-items: center; gap: 5px; max-width: 100%; }
.loc svg { color: var(--text-3); }
.loc:hover, .loc.on { background: var(--primary); color: var(--on-primary); }
.loc:hover svg, .loc.on svg { color: currentColor; }
.loc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.claim-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding-top: 3px; }
.claim-tally { font-size: 12.5px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.claim-why { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; padding-left: 10px; border-left: 2px solid var(--border); }
.why { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: baseline; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.why .why-who { grid-column: 2; font-size: 12px; color: var(--text-4); }
.linkish { border: 0; background: transparent; padding: 0; color: var(--text-3); cursor: pointer; font-size: 12.5px; font-weight: 500; text-align: left; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.linkish:hover { color: var(--text); }
.code { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); overflow: auto; font-family: var(--mono); font-size: 12px; line-height: 1.6; max-height: 380px; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 12px; border-bottom: 1px solid var(--border); font-family: var(--font); font-size: 12px; color: var(--text-3); position: sticky; top: 0; left: 0; background: var(--surface-2); }
.code table { border-collapse: collapse; min-width: 100%; }
.code td { padding: 0 12px; white-space: pre; vertical-align: top; }
.code td.ln { text-align: right; color: var(--text-4); user-select: none; width: 1%; padding-right: 12px; }
.code tr.hit td { background: color-mix(in srgb, var(--warn-line) 16%, transparent); }
.code tr.hit td.ln { color: var(--text); font-weight: 600; box-shadow: inset 2px 0 0 var(--warn-line); }
.model-notes { display: flex; flex-direction: column; gap: 4px; padding: 0 20px 14px; font-size: 12.5px; color: var(--text-3); }
.model-notes b { font-weight: 520; color: var(--text-2); }

/* ---------------------------------------------------------------- fenêtres & avis */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 10, 11, 0.42); display: grid; place-items: center; z-index: 80; padding: 20px; animation: fade 0.12s; backdrop-filter: blur(1.5px); }
.modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); width: min(480px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop 0.16s var(--ease); }
.modal header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.modal h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.modal-body { padding: 10px 20px 4px; overflow: auto; color: var(--text-2); line-height: 1.55; font-size: 13.5px; }
.modal-body p + p { margin-top: 8px; }
.modal-body .kv { padding: 5px 0; border-bottom: 1px solid var(--border); }
.modal-body .kv:last-of-type { border-bottom: 0; }
.modal-body .field { margin-top: 16px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 18px 20px 20px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(0.99); } }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 90; max-width: min(420px, calc(100vw - 40px)); }
.toast { background: var(--surface); color: var(--text); border-radius: var(--radius-sm); padding: 11px 14px; font-size: 13.5px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; animation: pop 0.18s var(--ease); line-height: 1.45; }
.toast svg { margin-top: 2px; color: var(--text-3); }
.toast.bad svg { color: var(--bad); }
.toast.good svg { color: var(--good); }
.spinner { display: inline-block; width: 12px; height: 12px; border: 1.5px solid var(--border-strong); border-top-color: var(--text-2); border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: -1px; flex: none; }
.btn.primary .spinner { border-color: color-mix(in srgb, var(--on-primary) 35%, transparent); border-top-color: var(--on-primary); }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { border-radius: var(--radius-xs); background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%); background-size: 400% 100%; animation: shimmer 1.3s linear infinite; height: 14px; }
.skeleton.kpi-skel { height: 96px; border-radius: var(--radius); margin-bottom: 20px; }
.skeleton.block { height: 240px; border-radius: var(--radius); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ------------------------------------------------------------------------ étapes */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.step-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; background: var(--surface); }
.step-card h3 { font-size: 14.5px; font-weight: 600; margin: 12px 0 4px; }
.step-card p { color: var(--text-3); font-size: 13.5px; }
.todo { display: flex; flex-direction: column; }
.todo-item { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--border); }
.todo-item:last-child { border-bottom: 0; }
.todo-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; border: 1px solid var(--border); color: var(--text-2); background: var(--surface-2); }
.todo-icon.warn { color: var(--warn); } .todo-icon.bad { color: var(--bad); } .todo-icon.good { color: var(--good); }
.todo-item b { font-weight: 550; display: block; }
.todo-item .sub { color: var(--text-3); font-size: 13px; display: block; }

/* ------------------------------------------------------------------------ rapport */
.report { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 48px 56px; max-width: 920px; margin: 0 auto; }
.report h1 { font-size: 26px; font-weight: 650; letter-spacing: -0.025em; }
.report h2 { font-size: 15.5px; font-weight: 650; margin: 32px 0 10px; letter-spacing: -0.01em; }
.report p { color: var(--text-2); line-height: 1.65; }
.report p + p { margin-top: 8px; }
.report .report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 1px solid var(--border); padding-bottom: 20px; margin-bottom: 22px; }
.report .report-brand { font-weight: 650; letter-spacing: 0.01em; white-space: nowrap; }
.report .figures { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 18px 0 6px; overflow: hidden; }
.report .figure { padding: 14px 16px; border-left: 1px solid var(--border); margin-left: -1px; }
.report .figure .v { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.report .figure .l { font-size: 12.5px; color: var(--text-3); }
.report table.table th { position: static; background: transparent; }
.report .table th:first-child, .report .table td:first-child { padding-left: 0; }
.report .table th:last-child, .report .table td:last-child { padding-right: 0; }
.report .gap-item { padding: 10px 0; border-bottom: 1px solid var(--border); break-inside: avoid; }
.report .gap-item:last-child { border-bottom: 0; }
.report ul { margin: 6px 0 0; padding-left: 20px; color: var(--text-2); line-height: 1.65; }

/* ---------------------------------------------------------------------- prompts */
.nav-dot { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--warn-line); flex: none; }
button.tab { background: none; border: 0; border-bottom: 2px solid transparent; font: inherit; cursor: pointer; }
button.tab.on { border-bottom-color: var(--text); }
.tab-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warn-line); }
.badge .mono { font-size: 11.5px; }
.prompt-calls { margin: -8px 0 16px; max-width: 90ch; }
.prompt-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.prompt-side { position: sticky; top: 20px; min-width: 0; }
textarea.input { height: auto; padding: 10px 12px; line-height: 1.6; resize: vertical; display: block; width: 100%; }
.prompt-text { font-family: var(--mono); font-size: 12.5px; min-height: 110px; tab-size: 2; }
.prompt-text[readonly] { background: var(--surface-2); color: var(--text-2); box-shadow: none; }
.field-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 7px; font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.prompt-problems { margin-top: 10px; }
.vars { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; }
.vars-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.vars-title .muted { font-weight: 400; font-size: 12.5px; }
.var { display: grid; grid-template-columns: 136px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 7px 0; font-size: 13px; color: var(--text-3); border-bottom: 1px solid var(--border); line-height: 1.45; }
.var:last-child { border-bottom: 0; padding-bottom: 0; }
.var b { font-weight: 550; color: var(--text); }
.var-chip { justify-self: start; font-family: var(--mono); font-size: 12px; height: 22px; padding: 0 7px; border-radius: 5px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); cursor: pointer; white-space: nowrap; }
.var-chip:hover:not(:disabled) { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.var-chip:disabled { cursor: default; opacity: 0.55; }
.var-state { font-size: 12px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.var-state svg { vertical-align: -2px; }
.prompt-fixed { margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-family: var(--mono); font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; color: var(--info); }
.preview-card { display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.preview-bar select.input { min-width: 0; max-width: 100%; }
.preview-bar select.input:first-child { flex: 0 1 200px; }
.preview-meta { padding: 0 20px 12px; }
.preview-meta .kv { padding: 3px 0; font-size: 13px; }
.preview-facts { display: flex; flex-direction: column; gap: 8px; padding: 0 20px 12px; }
.preview-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 10px 20px; border-top: 1px solid var(--border); }
.preview-tools .legend { gap: 12px; font-size: 12px; }
.preview-tools .toggle { font-size: 12.5px; }
.lg-t { background: var(--text); } .lg-v { background: var(--text-4); } .lg-f { background: var(--info); }
.preview-scroll { flex: 1; min-height: 160px; overflow: auto; border-top: 1px solid var(--border); padding: 14px 20px 20px; background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.preview-label { font-size: 12px; font-weight: 600; color: var(--text-3); margin: 18px 0 6px; font-family: var(--font); }
.preview-label:first-child { margin-top: 0; }
.prompt-preview { margin: 0; font-family: var(--mono); font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; color: var(--text); }
.prompt-preview .seg-t, .prompt-preview.seg-t { color: var(--text); }
.prompt-preview .seg-v { color: var(--text-3); }
.prompt-preview .seg-f { color: var(--info); }
.savebar { position: sticky; bottom: 16px; z-index: 30; margin-top: 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px 10px 16px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg); }

/* ------------------------------------------------------------------ comptes IA */
.cp-card { display: flex; flex-direction: column; }
.cp-card .card-body { flex: 1; }
.cp-test { font-size: 13px; display: flex; gap: 6px; align-items: flex-start; line-height: 1.45; }
.cp-test svg { margin-top: 2px; flex: none; }
.cp-models { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.cp-device { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.cp-code { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 20px; font-weight: 650; letter-spacing: 0.06em; }
.cp-code.mono { font-size: 13px; font-weight: 500; letter-spacing: 0; background: var(--surface-3); border-radius: var(--radius-xs); padding: 3px 3px 3px 10px; align-self: flex-start; }
.cp-link { text-decoration: underline; word-break: break-all; }
.cp-more summary { cursor: pointer; color: var(--text-3); font-size: 13px; }
.cp-more[open] summary { margin-bottom: 10px; }
.cp-more > * + * { margin-top: 10px; }

/* --------------------------------------------------------------- connexion & compte */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--sidebar); }
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-xs); }
.auth-card h1 { font-size: 20px; font-weight: 620; letter-spacing: -0.02em; }
.auth-card .field .input { width: 100%; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.me { padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.me-name { color: var(--text); font-weight: 560; }
.me-mail { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-actions { display: flex; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.us-link { margin-top: 6px; padding: 6px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xs); word-break: break-all; user-select: all; }

/* ---------------------------------------------------------------------- réactif */
@media (max-width: 1240px) {
  .layout { grid-template-columns: 1fr; } .side-col { position: static; }
  .grid-3 { grid-template-columns: 1fr; }
  .live { grid-template-columns: 1fr; } .live > div + div { border-left: 0; border-top: 1px solid var(--border); }
  .prompt-grid { grid-template-columns: 1fr; } .prompt-side { position: static; } .preview-card { max-height: 80vh; }
}
@media (max-width: 640px) {
  .var { grid-template-columns: 1fr auto; } .var .var-help { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 1000px) {
  .split { grid-template-columns: 1fr; } .wf-list { max-height: 320px; }
  .grid-2, .steps { grid-template-columns: 1fr; }
  .claim { grid-template-columns: 1fr; } .claim-side { align-items: flex-start; flex-direction: row; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand-sub, .nav-label, .sidebar-foot, .nav-count { display: none; }
  .nav { flex-direction: row; } .nav-section { flex-direction: row; }
  .live-card { width: 100%; }
  .view { padding: 20px 16px 44px; }
  .topbar-progress { left: 0; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .report { padding: 24px 18px; } .report .figures { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

@media print {
  :root, :root[data-theme="dark"] {
    color-scheme: light; --bg: #fff; --surface: #fff; --surface-2: #fafafa; --surface-3: #f4f4f5; --border: #e4e4e7; --border-strong: #d4d4d8;
    --text: #0a0a0b; --text-2: #3f3f46; --text-3: #71717a; --text-4: #a1a1aa; --good: #15803d; --good-soft: #ecfdf3; --good-line: #16a34a;
    --warn: #b45309; --warn-soft: #fffbeb; --warn-line: #f59e0b; --bad: #dc2626; --bad-soft: #fef2f2; --bad-line: #ef4444;
  }
  body { background: #fff; font-size: 11pt; }
  .sidebar, .no-print, .toasts, .topbar-progress, .modal-backdrop { display: none !important; }
  .app { display: block; } .view { padding: 0; max-width: none; }
  .report { border: 0; padding: 0; max-width: none; }
  .report h2 { break-after: avoid; } .report tr { break-inside: avoid; }
  @page { margin: 16mm 14mm; }
}
