/* Derkos — l'appli. Charte du logo : noir et blanc. La couleur ne sert qu'à dire la gravité. */
@font-face { font-family: "Plex"; src: url("../fonts/plex-sans-400.woff2") format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "Plex"; src: url("../fonts/plex-sans-500.woff2") format("woff2"); font-weight: 500; font-display: block; }
@font-face { font-family: "Plex"; src: url("../fonts/plex-sans-600.woff2") format("woff2"); font-weight: 600; font-display: block; }
@font-face { font-family: "Plex"; src: url("../fonts/plex-sans-700.woff2") format("woff2"); font-weight: 700; font-display: block; }
@font-face { font-family: "PlexMono"; src: url("../fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "PlexMono"; src: url("../fonts/plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: block; }

:root {
  --ink: #08090b;          /* fond */
  --deck: #0e1013;         /* barre latérale */
  --slab: #13161a;         /* surfaces */
  --slab-2: #191d22;
  --line: #23282f;
  --line-2: #2e343c;
  --chalk: #f2f3f1;        /* texte principal */
  --chalk-2: #b6bbc2;
  --chalk-3: #7c838d;
  --critique: #ff5a52;
  --haute: #ff9a3d;
  --moyenne: #f2cf4a;
  --basse: #7d8794;
  --ok: #4cc38a;
  --info: #7fb0ff;
  --r: 6px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--ink); color: var(--chalk);
  font: 400 14px/1.5 "Plex", system-ui, sans-serif;
  font-feature-settings: "tnum" 1, "ss02" 1;
  -webkit-font-smoothing: antialiased; overflow: hidden;
  user-select: none;
}
::selection { background: var(--chalk); color: var(--ink); }
input, textarea, select, button { font: inherit; color: inherit; }
.selectable, input, textarea, pre, code { user-select: text; }
:focus-visible { outline: 2px solid var(--chalk); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid var(--ink); }
::-webkit-scrollbar-track { background: transparent; }

/* ───────── démarrage ───────── */
#splash {
  position: fixed; inset: 0; z-index: 50; background: var(--ink);
  display: grid; place-items: center; transition: opacity .6s var(--ease), visibility .6s;
}
#splash canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#splash .tag {
  position: absolute; left: 0; right: 0; top: calc(50% + 92px); text-align: center;
  color: var(--chalk-3); letter-spacing: .02em; font-size: 13px; opacity: 0; transition: opacity .8s var(--ease);
}
#splash.tagged .tag { opacity: 1; }
#splash .skip { position: absolute; bottom: 28px; left: 0; right: 0; text-align: center; color: #3a414a; font-size: 12px; }
#splash.gone { opacity: 0; visibility: hidden; }

/* ───────── écrans d'accès (activation, attente) ───────── */
.gate {
  position: fixed; inset: 0; display: grid; place-items: center; z-index: 10;
  background: radial-gradient(1200px 600px at 50% 120%, #15181d 0%, var(--ink) 60%);
}
.gate-box { width: min(440px, 90vw); text-align: center; animation: rise .7s var(--ease) both; }
.gate-box img { width: 220px; margin-bottom: 36px; filter: invert(1); }
.gate h1 { font-size: 22px; font-weight: 600; margin: 0 0 8px; letter-spacing: -.01em; }
.gate p { color: var(--chalk-2); margin: 0 0 24px; }
.code-input {
  width: 100%; text-align: center; font: 500 22px/1 "PlexMono", monospace; letter-spacing: .14em;
  background: var(--slab); border: 1px solid var(--line-2); border-radius: var(--r); padding: 16px 12px;
  text-transform: uppercase;
}
.code-input:focus { border-color: var(--chalk-2); outline: none; }
.code-input.nom { font-family: inherit; font-size: 16px; font-weight: 400; letter-spacing: 0; text-transform: none; padding: 12px; }
.champ-gate { display: block; text-align: left; font-size: 12px; color: var(--chalk-3); margin: 0 0 16px; }
.champ-gate .code-input { margin-top: 6px; }
.gate a.lien { color: var(--chalk-2); }
.gate .err { color: var(--critique); min-height: 22px; margin: 12px 0 0; font-size: 13px; }
.gate .small { color: var(--chalk-3); font-size: 12px; margin-top: 28px; }
.pulse { width: 64px; height: 64px; margin: 0 auto 28px; position: relative; }
.pulse::before, .pulse::after {
  content: ""; position: absolute; inset: 0; border: 1.5px solid var(--chalk); border-radius: 50%;
  animation: ring 2.4s var(--ease) infinite;
}
.pulse::after { animation-delay: 1.2s; }
.pulse img { position: absolute; inset: 18px; width: 28px; filter: invert(1); }
@keyframes ring { from { transform: scale(.5); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ───────── coque ───────── */
#shell { display: grid; grid-template-columns: 232px 1fr; height: 100vh; opacity: 0; }
#shell.visible { opacity: 1; transition: opacity .5s var(--ease); }
#shell.visible .rail { animation: slide-in .7s var(--ease) both; }
#shell.visible .main { animation: fade-up .7s .12s var(--ease) both; }
@keyframes slide-in { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-up { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.rail { background: var(--deck); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 22px 20px 18px; }
.brand img { height: 22px; filter: invert(1); }
.nav { padding: 6px 10px; overflow-y: auto; flex: 1; }
.nav-group { color: var(--chalk-3); font-size: 11.5px; font-weight: 500; padding: 16px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--r);
  color: var(--chalk-2); text-decoration: none; cursor: pointer; position: relative;
  transition: background .15s, color .15s;
}
.nav a svg { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; }
.nav a:hover { background: var(--slab); color: var(--chalk); }
.nav a.on { background: var(--slab-2); color: var(--chalk); }
.nav a.on::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--chalk); }
.nav a .count { margin-left: auto; font-size: 11.5px; color: var(--ink); background: var(--chalk); border-radius: 10px; padding: 0 7px; font-weight: 600; }
.who { border-top: 1px solid var(--line); padding: 14px 20px; display: flex; align-items: center; gap: 10px; }
.who .av { width: 30px; height: 30px; border-radius: 50%; background: var(--chalk); color: var(--ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.who .n { font-weight: 500; line-height: 1.2; }
.who .t { color: var(--chalk-3); font-size: 12px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  height: 56px; flex: none; display: flex; align-items: center; gap: 16px; padding: 0 28px;
  border-bottom: 1px solid var(--line);
}
.topbar .crumb { color: var(--chalk-3); }
.topbar .crumb b { color: var(--chalk); font-weight: 500; }
.topbar .spacer { flex: 1; }
.jobs-pill {
  display: none; align-items: center; gap: 8px; padding: 5px 12px 5px 10px; border: 1px solid var(--line-2);
  border-radius: 20px; color: var(--chalk-2); font-size: 12.5px; cursor: pointer; background: var(--slab);
}
.jobs-pill.on { display: flex; }
.jobs-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--chalk); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.conn { font-size: 12.5px; color: var(--chalk-3); display: flex; align-items: center; gap: 7px; }
.conn i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.conn.off i { background: var(--critique); }

.view { flex: 1; overflow-y: auto; padding: 28px 32px 48px; min-height: 0; }
.view.enter { animation: view-in .35s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.head h1 { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin: 0; line-height: 1.15; }
.head p { margin: 4px 0 0; color: var(--chalk-2); }
.head .actions { margin-left: auto; display: flex; gap: 8px; }

.maj {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 28px;
  background: var(--chalk); color: var(--ink); animation: fade-up .5s var(--ease) both;
}
.maj span { color: #3d434b; }
.maj .btn { border-color: #c9ccc8; background: #fff; color: var(--ink); }
.maj .btn.primary { background: var(--ink); color: var(--chalk); border-color: var(--ink); }

/* ───────── composants ───────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--slab); color: var(--chalk); cursor: pointer; font-weight: 500;
  transition: background .15s, border-color .15s, transform .1s; white-space: nowrap;
}
.btn:hover { background: var(--slab-2); border-color: #3a414b; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--chalk); color: var(--ink); border-color: var(--chalk); }
.btn.primary:hover { background: #fff; }
.btn.danger { color: var(--critique); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: default; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.btn.wide { width: 100%; justify-content: center; height: 44px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { color: var(--chalk-2); font-size: 12.5px; font-weight: 500; }
.in, select.in, textarea.in {
  height: 36px; background: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r); padding: 0 12px;
  transition: border-color .15s;
}
textarea.in { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.in:focus { border-color: var(--chalk-3); outline: none; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row .in { flex: 1; min-width: 180px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; margin-bottom: 26px; }
.tile { background: var(--slab); border: 1px solid var(--line); border-radius: 8px; padding: 18px 18px 16px; cursor: default; }
.tile.link { cursor: pointer; transition: border-color .15s, transform .15s; }
.tile.link:hover { border-color: var(--line-2); transform: translateY(-1px); }
.tile .k { color: var(--chalk-2); font-size: 13px; }
.tile .v { font-size: 34px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; margin-top: 6px; }
.tile .s { color: var(--chalk-3); font-size: 12.5px; margin-top: 2px; }
.tile.hot .v { color: var(--chalk); }
.tile.hot { border-color: #3d444e; background: linear-gradient(180deg, #1a1e24, var(--slab)); }

.panel { background: var(--slab); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 18px; }
.panel > header { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel > header h2 { font-size: 15px; font-weight: 600; margin: 0; }
.panel > header .meta { color: var(--chalk-3); font-size: 12.5px; }
.panel > header .actions { margin-left: auto; display: flex; gap: 8px; }
.panel .body { padding: 16px 18px; }
.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
@media (max-width: 1180px) { .two { grid-template-columns: 1fr; } }

table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-weight: 500; color: var(--chalk-3); font-size: 12.5px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
table.list td { padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
table.list td.wrap { white-space: normal; min-width: 220px; }
table.list td.fill { width: 100%; max-width: 0; }
table.list td.fill .ell { max-width: 100%; }
.panel.scroll { overflow-x: auto; }
.actions-cell { justify-content: flex-end; flex-wrap: wrap; gap: 6px; max-width: 360px; margin-left: auto; }
@media (max-width: 1150px) { .opt { display: none; } table.list th, table.list td { padding-left: 12px; padding-right: 12px; } .view { padding: 22px 20px 40px; } }
@media (max-width: 900px) { #shell { grid-template-columns: 64px 1fr; } .brand img { height: 18px; width: 30px; object-fit: cover; object-position: left; } .nav a { justify-content: center; padding: 10px; } .nav a > :not(svg) , .nav-group, .who > div:not(.av) { display: none; } .nav a { font-size: 0; } .who { justify-content: center; padding: 14px 0; } }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr { transition: background .12s; }
table.list tbody tr.click { cursor: pointer; }
table.list tbody tr.click:hover { background: var(--slab-2); }
table.list tbody tr.sel { background: var(--slab-2); box-shadow: inset 3px 0 0 var(--chalk); }
table.list td.num, table.list th.num { text-align: center; }
table.list td.act { text-align: right; width: 1%; }
table.list td.ctr, table.list th.ctr { text-align: center; }
select.in.sel { width: auto; min-width: 170px; padding-right: 28px; cursor: pointer; }
tr.group td { background: var(--slab-2); padding: 10px 18px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
tr.group:hover td { background: #1e2329; }
.group-head { display: flex; align-items: center; gap: 12px; }
.group-head .push { margin-left: auto; }
.group-head .chev { display: inline-block; width: 12px; font-size: 16px; color: var(--chalk-2); transform: rotate(90deg); transition: transform .2s var(--ease); }
tr.group.closed .chev { transform: none; }
tr.in-group td:first-child { box-shadow: inset 3px 0 0 var(--line-2); }
.strong { font-weight: 500; }
.dim { color: var(--chalk-3); }
.mono { font-family: "PlexMono", monospace; font-size: 12.5px; }
td .mono, td.mono { white-space: nowrap; }
.ell { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 20px; border: 1px solid var(--line-2); color: var(--chalk-2); white-space: nowrap; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sev-critique { color: var(--critique); border-color: #5b2724; }
.sev-haute { color: var(--haute); border-color: #5a3a1c; }
.sev-moyenne { color: var(--moyenne); border-color: #554a1c; }
.sev-basse { color: var(--basse); }
.st-nouvelle { color: var(--chalk-2); }
.st-plausible { color: var(--info); border-color: #263a59; }
.st-prouvee { color: var(--ok); border-color: #1f4a35; }
.st-fermee { color: var(--chalk-3); }
.score { display: inline-grid; place-items: center; width: 34px; height: 24px; border-radius: 5px; font-weight: 600; font-size: 13px; background: var(--slab-2); }
.score.s-high { background: var(--chalk); color: var(--ink); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line-2); background: transparent; color: var(--chalk-2); cursor: pointer; font-size: 13px; transition: all .15s; }
.chip:hover { color: var(--chalk); }
.chip.on { background: var(--chalk); color: var(--ink); border-color: var(--chalk); }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .in { width: 260px; }

.empty { text-align: center; padding: 56px 20px; color: var(--chalk-2); }
.empty b { display: block; color: var(--chalk); font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }
.loading { padding: 40px; text-align: center; color: var(--chalk-3); }
.loading::before { content: ""; display: block; width: 26px; height: 26px; margin: 0 auto 12px; border: 2px solid var(--line-2); border-top-color: var(--chalk); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.err-box { border: 1px solid #5b2724; background: #1d1212; color: #ffb4ae; border-radius: var(--r); padding: 12px 14px; margin-bottom: 14px; }

.bar { height: 6px; background: var(--slab-2); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--chalk); border-radius: 4px; transition: width .6s var(--ease); }
.bar.warn i { background: var(--haute); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.spark-col { flex: 1; height: 100%; display: flex; align-items: flex-end; border-radius: 3px; background: var(--slab-2); }
.spark-col i { display: block; width: 100%; background: var(--chalk); border-radius: 3px; transition: height .6s var(--ease); }
.spark-col:hover i { background: #fff; }
.bar.indet i { width: 35%; animation: indet 1.3s var(--ease) infinite; }
@keyframes indet { from { transform: translateX(-110%); } to { transform: translateX(320%); } }

/* ───────── panneau de détail ───────── */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 20; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 92vw); background: var(--deck); border-left: 1px solid var(--line-2);
  transform: translateX(102%); transition: transform .38s var(--ease); z-index: 21; display: flex; flex-direction: column;
}
.drawer.on { transform: none; box-shadow: -30px 0 60px rgba(0, 0, 0, .4); }
.drawer > header { display: flex; align-items: flex-start; gap: 12px; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.drawer > header h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.drawer > header .sub { color: var(--chalk-3); font-size: 12.5px; margin-top: 4px; }
.drawer > header .x { margin-left: auto; }
.drawer .content { padding: 20px 24px 32px; overflow-y: auto; flex: 1; }
.drawer footer { border-top: 1px solid var(--line); padding: 14px 24px; display: flex; gap: 8px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; margin-bottom: 20px; }
.kv dt { color: var(--chalk-3); }
.kv dd { margin: 0; }
pre.code {
  background: var(--ink); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin: 0 0 18px;
  font: 12.5px/1.6 "PlexMono", monospace; overflow-x: auto; white-space: pre; color: #d9dcd8;
}
.section-t { font-size: 12.5px; font-weight: 600; color: var(--chalk-2); margin: 0 0 8px; }
ul.reasons { margin: 0 0 18px; padding-left: 18px; color: var(--chalk-2); }
ul.reasons li { margin-bottom: 4px; }
.doc { font-size: 13.5px; line-height: 1.7; color: var(--chalk-2); white-space: pre-wrap; }

/* ───────── fenêtre ───────── */
.modal-wrap { position: fixed; inset: 0; display: grid; place-items: center; z-index: 30; background: rgba(0, 0, 0, .55); animation: fade .2s both; }
.modal { width: min(460px, 92vw); background: var(--deck); border: 1px solid var(--line-2); border-radius: 10px; padding: 22px 24px; animation: pop .28s var(--ease) both; }
.modal h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.modal p.lead { margin: 0 0 18px; color: var(--chalk-2); }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.toasts { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 40; }
.toast { background: var(--chalk); color: var(--ink); padding: 11px 16px; border-radius: var(--r); font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: toast-in .35s var(--ease) both; max-width: 380px; }
.toast.bad { background: #2a1513; color: #ffb4ae; border: 1px solid #5b2724; }
.toast.out { animation: toast-out .3s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ───────── rapport imprimable (Exporter en PDF) ───────── */
/* Sobre, façon rapport d'audit : noir sur blanc, filets fins, couleur réservée aux priorités critiques et importantes. */
#impression { display: none; }
@media print {
  @page { size: A4; margin: 16mm 16mm 18mm; @bottom-right { content: counter(page) " / " counter(pages); font: 8pt "Plex", sans-serif; color: #666; } }
  :root, html, body { background: #fff !important; color: #111 !important; color-scheme: light !important; height: auto; overflow: visible; }
  body > *:not(#impression) { display: none !important; }
  #impression { display: block !important; font: 10pt/1.55 "Plex", system-ui, sans-serif; color: #1a1a1a; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #impression * { color: inherit; background: transparent; border-color: #d4d4d0; }
  #impression .p-page > header, #impression .p-tete { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 10px; border-bottom: 1px solid #111; margin-bottom: 26px; }
  #impression .p-marque { font-size: 12pt; font-weight: 600; }
  #impression .p-droite { text-align: right; font-size: 9pt; color: #555; }
  #impression .p-dim { color: #5a5d63; font-size: 8.8pt; margin-top: 1px; }
  #impression .p-page h1 { font-size: 17pt; font-weight: 600; line-height: 1.25; margin: 0 0 14px; overflow-wrap: anywhere; }
  #impression .p-page h2 { font-size: 12pt; font-weight: 600; margin: 20px 0 8px; padding-bottom: 4px; border-bottom: 1px solid #d4d4d0; break-after: avoid; }
  #impression .p-page h3 { font-size: 10pt; font-weight: 600; margin: 16px 0 6px; break-after: avoid; }
  #impression .p-page p { margin: 0 0 8px; }
  #impression .p-saut { break-before: page; margin-top: 0 !important; }
  #impression .p-page table { width: 100%; border-collapse: collapse; font-size: 9pt; margin: 4px 0 6px; }
  #impression .p-page th, #impression .p-page td { text-align: left; vertical-align: top; border-bottom: 1px solid #e3e3df; padding: 6px 10px 6px 0; }
  #impression .p-page thead th { border-bottom: 1px solid #111; font-weight: 600; font-size: 8.5pt; }
  #impression .p-page tr { break-inside: avoid; }
  #impression .p-page td:first-child { overflow-wrap: anywhere; }
  #impression .p-infos th { width: 38mm; font-weight: 500; color: #5a5d63; }
  #impression .p-infos tr:last-child th, #impression .p-infos tr:last-child td { border-bottom: 0; }
  #impression .p-num { width: 9mm; text-align: right; padding-right: 12px !important; font-variant-numeric: tabular-nums; }
  #impression .p-actions td:nth-child(2) { width: auto; }
  #impression .p-prio { width: 24mm; white-space: nowrap; }
  #impression .p-delai { width: 28mm; white-space: nowrap; }
  #impression tr.p-s-critique .p-prio, #impression tr.p-s-critique .p-delai { color: #a1221b; font-weight: 600; }
  #impression tr.p-s-haute .p-prio, #impression tr.p-s-haute .p-delai { color: #a1221b; }
  #impression .p-cat { width: 34mm; color: #5a5d63; }
  #impression .p-ext { font-size: 8.8pt; }
  #impression .p-bareme th { width: 18mm; font-weight: 500; color: #5a5d63; }
  #impression .p-bareme td { font-size: 8.5pt; }
  #impression .p-tuiles { display: flex; gap: 12px; margin: 14px 0; }
  #impression .p-tuiles > div { flex: 1; border: 1px solid #d4d4d0; padding: 8px 10px; }
  #impression .p-tuiles b { font-size: 14pt; }
  #impression .p-page footer { break-before: avoid; margin-top: 12px; padding-top: 6px; border-top: 1px solid #d4d4d0; color: #5a5d63; font-size: 8pt; }
}

/* Doublons */
.dup-card { border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px 14px; margin: 10px 0; min-width: 0; }
.dup-card .wrap, .dup-list { overflow-wrap: anywhere; }
.dup-list { margin: 4px 0 0; padding-left: 18px; font-family: "PlexMono", monospace; font-size: 12.5px; }
a.lien { color: var(--chalk); text-decoration: underline; text-decoration-color: var(--chalk-3); }
.spark-bar { height: 8px; border-radius: 4px; background: var(--ok); opacity: .85; }

/* ───────── bascule Recherche / Défense ───────── */
.espace { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; margin: 0 14px 6px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--ink); }
.espace button { height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--chalk-3); font: inherit; font-size: 13px; cursor: pointer; transition: background .18s var(--ease), color .18s var(--ease); }
.espace button:hover { color: var(--chalk); }
.espace button[aria-selected="true"] { background: var(--slab-2); color: var(--chalk); }
.espace button:focus-visible { outline: 2px solid var(--chalk); outline-offset: 1px; }

/* ───────── outils d'analyse ───────── */
.form-col { display: flex; flex-direction: column; gap: 10px; }
.form-col .row .in { flex: 1; min-width: 0; }
.form-col .btn { align-self: flex-start; }
.ia-box { border: 1px solid var(--line-2); border-left: 3px solid var(--info); border-radius: var(--r); padding: 12px 14px; margin: 12px 0; background: var(--slab); }
.ia-box p { margin: 6px 0; }
.hunk { border: 1px solid var(--line); border-radius: var(--r); margin: 8px 0; background: var(--slab); }
.hunk.chaud { border-color: var(--haute); }
.hunk > summary { cursor: pointer; padding: 9px 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; list-style: none; }
.hunk > summary::-webkit-details-marker { display: none; }
.hunk > summary:hover { background: var(--slab-2); }
.hunk > .kv, .hunk > p { margin: 8px 12px; }
.diff { margin: 0; padding: 10px 12px; border-top: 1px solid var(--line); overflow-x: auto; font: 12px/1.5 ui-monospace, Consolas, monospace; color: var(--chalk-2); white-space: pre; max-height: 420px; }
.diff .add { color: var(--ok); background: rgba(76, 195, 138, .08); }
.diff .del { color: var(--critique); background: rgba(255, 90, 82, .08); }

/* ───────── contrôles de sécurité ───────── */
.badge.note b { font-weight: 700; margin-right: 2px; }
.ctl-cat { margin-bottom: 8px; }
.ctl { border: 1px solid var(--line); border-radius: var(--r); margin: 6px 0; background: var(--slab); }
.ctl > summary { cursor: pointer; padding: 9px 12px; display: flex; gap: 10px; align-items: center; list-style: none; }
.ctl > summary::-webkit-details-marker { display: none; }
.ctl > summary:hover { background: var(--slab-2); }
.ctl > summary .badge { flex: none; }
.ctl > p { margin: 4px 12px 10px; }
.tile .v small { font-size: 14px; font-weight: 400; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 54px; margin: 0 0 18px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--slab); }
.spark i { flex: 1; background: var(--ok); border-radius: 2px 2px 0 0; min-width: 4px; }
.spark i.bas { background: var(--haute); }
.liste-ctl { list-style: none; padding: 0; margin: 0 0 6px; }
.liste-ctl li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.menu-wrap { position: relative; }
.menu-plus { position: fixed; z-index: 1000; min-width: 250px; max-width: 320px; padding: 4px; background: var(--slab-2); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 12px 30px rgba(0,0,0,.45); animation: menuApparait .12s var(--ease); }
@keyframes menuApparait { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.menu-plus button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: transparent; color: var(--chalk); font: inherit; font-size: 13px; border-radius: 6px; cursor: pointer; }
.menu-plus button:hover, .menu-plus button:focus-visible { background: var(--slab); outline: none; }
.menu-plus button.danger { color: var(--critique); }
.rang-exploite td:first-child { box-shadow: inset 3px 0 0 var(--critique); }
