:root {
  --font: "Source Sans 3", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --line: #e3ded4;
  --text: #22272b;
  --muted: #646b70;
  --accent: #1f4e5a;
  --accent-ink: #ffffff;
  --accent-soft: #e4eef0;
  --accent-2: #c8902f;
  --good: #2f6b3f; --good-bg: #e5f1e6;
  --warn: #8a5a00; --warn-bg: #fbefd6;
  --danger: #a33a2c; --danger-bg: #f8e3df;
  --info: #2b5a8a; --info-bg: #e3edf8;
  --neutral: #3d4a52; --neutral-bg: #eceae5;
  --muted-bg: #f0eee9;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(30, 30, 20, .05), 0 4px 16px rgba(30, 30, 20, .04);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #15191b; --surface: #1d2326; --surface-2: #192022; --line: #2f383c;
  --text: #e6e8e6; --muted: #9aa3a6; --accent: #7fb7c3; --accent-ink: #0f1a1d; --accent-soft: #22363b; --accent-2: #e3b25a;
  --good: #8fcf9c; --good-bg: #1f3325; --warn: #e8c070; --warn-bg: #3a2f17; --danger: #f09a8c; --danger-bg: #3d2420;
  --info: #9ec3ec; --info-bg: #1f2e40; --neutral: #c6ced2; --neutral-bg: #2a3236; --muted-bg: #242b2e;
  --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-family: var(--serif); font-size: 1.75rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--surface); padding: 8px 12px; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* Barre latérale */
.side { position: sticky; top: 0; height: 100vh; overflow: auto; background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; }
.brand { display: flex; gap: 10px; align-items: center; color: var(--accent); padding: 4px 6px; }
.brand:hover { text-decoration: none; }
.brand span { display: flex; flex-direction: column; color: var(--text); line-height: 1.2; }
.brand b { font-family: var(--serif); font-size: 1.08rem; }
.brand small { color: var(--muted); font-size: .78rem; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__group { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 8px 4px; font-weight: 600; }
.nav a { color: var(--text); padding: 7px 10px; border-radius: 7px; font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side__note { margin-top: auto; font-size: .8rem; color: var(--muted); padding: 10px; border-top: 1px solid var(--line); }

/* Zone principale */
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 10px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.role { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; min-width: 0; }
.role label { font-size: .85rem; color: var(--muted); }
.role label { white-space: nowrap; }
.role select { width: auto; min-width: 260px; max-width: 420px; }
#role-info { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
#menu { display: none; }
main { padding: 28px; max-width: 1280px; outline: none; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .lede { color: var(--muted); max-width: 70ch; margin: 6px 0 0; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-block; margin-bottom: 10px; font-size: .9rem; }

/* Boutons et champs */
.btn { font: inherit; font-weight: 600; font-size: .9rem; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover:not(:disabled) { border-color: var(--accent); text-decoration: none; }
.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn--primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn--ghost { background: transparent; }
.btn--danger { color: var(--danger); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { background: transparent; border: 1px solid transparent; color: var(--text); width: 36px; height: 36px; border-radius: 8px; cursor: pointer; display: inline-grid; place-items: center; font-size: 1.4rem; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); }
.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; font-weight: 600; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; width: 100%; }
select { cursor: pointer; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }
label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--muted); }
label.inline { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
label.inline input { width: auto; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
legend { font-size: .85rem; font-weight: 600; color: var(--muted); padding: 0 4px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; word-break: break-all; }

/* Badges */
.badge { display: inline-block; font-size: .76rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; line-height: 1.5; }
.badge--good { color: var(--good); background: var(--good-bg); }
.badge--warn { color: var(--warn); background: var(--warn-bg); }
.badge--danger { color: var(--danger); background: var(--danger-bg); }
.badge--info { color: var(--info); background: var(--info-bg); }
.badge--neutral { color: var(--neutral); background: var(--neutral-bg); }
.badge--muted { color: var(--muted); background: var(--muted-bg); }
.tag { font-size: .72rem; font-weight: 600; padding: 1px 7px; border-radius: 5px; background: var(--muted-bg); color: var(--muted); }
.tag--role { background: var(--accent-soft); color: var(--accent); }
.count { display: inline-block; min-width: 22px; text-align: center; font-size: .78rem; padding: 0 6px; border-radius: 999px; background: var(--muted-bg); color: var(--muted); margin-left: 6px; vertical-align: 2px; }
.sub { color: var(--muted); font-size: .84rem; font-weight: 400; }
.eyebrow { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-2); font-weight: 700; margin-bottom: 2px; }
.empty { color: var(--muted); font-style: normal; padding: 6px 0; }

/* Cartes et panneaux */
.panel, .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 18px 20px; margin-bottom: 18px; }
.panel > h2 { margin-bottom: 12px; }
.card { padding: 16px 18px; }
.card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.card h3 a { color: var(--text); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-bottom: 18px; }
.grid2--meta { grid-template-columns: minmax(300px, 1.2fr) minmax(280px, 1fr); }

.demo { display: flex; gap: 20px; align-items: center; justify-content: space-between; padding: 18px 20px; margin-bottom: 18px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); flex-wrap: wrap; }
.demo h2 { color: var(--accent); margin-bottom: 4px; }
.demo p { margin: 0; max-width: 78ch; }

.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { display: flex; flex-direction: column; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); border-top: 3px solid var(--line); }
.kpi:hover { text-decoration: none; border-color: var(--accent); }
.kpi__value { font-family: var(--serif); font-size: 2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi__label { font-size: .85rem; color: var(--muted); }
.kpi--danger { border-top-color: var(--danger); } .kpi--danger .kpi__value { color: var(--danger); }
.kpi--warn { border-top-color: var(--accent-2); } .kpi--warn .kpi__value { color: var(--warn); }
.kpi--info { border-top-color: var(--info); }
.kpi--neutral { border-top-color: var(--accent); }

.prog { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.prog__row { display: grid; grid-template-columns: 62px 1fr 40px; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); }
.prog__row b { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.bar { height: 7px; background: var(--muted-bg); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.bar--alt i { background: var(--good); }

/* Tableaux */
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.row-click { cursor: pointer; }
.row-click:hover td { background: var(--surface-2); }
tr.is-late td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.pc { font-size: .84rem; line-height: 1.35; margin-bottom: 4px; }
.pc--stale { color: var(--warn); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); }

.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { font: inherit; font-size: .85rem; font-weight: 600; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.campmeta { display: flex; gap: 28px; flex-wrap: wrap; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px; }
.campmeta > div { display: flex; flex-direction: column; }

/* Fiche pièce */
.meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin: 0; }
.meta dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.meta dd { margin: 2px 0 0; }
.timeline { list-style: none; padding: 0; margin: 10px 0 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 12px 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline li:first-child::before { background: var(--accent-2); }
.usages { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin-top: 12px; }
.usage { border: 1px solid var(--line); border-radius: 9px; padding: 14px; background: var(--surface-2); }
.usage--stale { border-color: var(--accent-2); background: var(--warn-bg); }
.usage__att { margin: 6px 0; font-weight: 600; }
.usage__just { margin: 0 0 10px; font-family: var(--serif); font-size: .95rem; }
.usage__foot { display: flex; gap: 6px; flex-wrap: wrap; }

/* Modèles / écosystème */
.sec { margin: 14px 0 6px; font-size: .85rem; color: var(--accent); }
.items { list-style: none; margin: 0; padding: 0; }
.items li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.items li:last-child { border-bottom: 0; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 22px; border-left: 2px solid var(--line); padding-left: 16px; }
.tree > li + li { margin-top: 14px; }
.node { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); margin: 8px 0; }
.people { list-style: none; padding: 0; margin: 8px 0 0; font-size: .88rem; display: flex; flex-direction: column; gap: 4px; }

/* Modale */
.modal { position: fixed; inset: 0; background: rgba(15, 20, 22, .45); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal[hidden] { display: none; }
.modal__panel { background: var(--surface); border-radius: 12px; width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 20px 24px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal__panel--wide { width: min(820px, 100%); }
.modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 6px; position: sticky; top: -20px; background: var(--surface); padding-top: 4px; }
.modal__head h2 { font-family: var(--serif); font-size: 1.3rem; }
#modal-body > label, #modal-body > textarea { margin-top: 10px; }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.span2 { grid-column: span 2; }
.modal__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.mt { margin-top: 22px; }
.ratt { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 8px; background: var(--surface-2); }
.ratt--stale { border-color: var(--accent-2); }
.ratt__head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ratt__head .link { margin-left: auto; font-size: .85rem; color: var(--danger); }
.ratt__just { margin: 6px 0 4px; font-family: var(--serif); }
.alert { margin: 8px 0 0; padding: 8px 12px; border-radius: 7px; background: var(--warn-bg); color: var(--warn); font-size: .88rem; font-weight: 600; }
.picklist { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; margin: 10px 0; }
.pick { flex-direction: row; align-items: flex-start; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--text); font-weight: 400; cursor: pointer; }
.pick:hover { background: var(--surface-2); }
.pick input { width: auto; margin-top: 4px; }
.pick[hidden] { display: none; }

/* Document unique */
.doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 36px; box-shadow: var(--shadow); }
.doc__head { border-bottom: 2px solid var(--accent); padding-bottom: 14px; margin-bottom: 18px; }
.doc__head h2 { font-family: var(--serif); font-size: 1.5rem; margin: 4px 0; }
.doc__head p { margin: 2px 0; }
.doc h3 { font-family: var(--serif); font-size: 1.15rem; margin: 26px 0 10px; color: var(--accent); }
.doc h4 { margin: 16px 0 6px; font-size: .95rem; }
.just { margin-bottom: 6px; font-size: .86rem; }
.open { margin: 0; padding-left: 18px; }
.open li { margin-bottom: 6px; }
.prose p, .prose li { max-width: 78ch; }
.prose h2 { margin: 18px 0 6px; } .prose h2:first-child { margin-top: 0; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: .9rem; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, 1fr); } .filters { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  body { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; width: 270px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  body.nav-open .side { transform: none; }
  #menu { display: inline-grid; }
  main { padding: 18px 14px; }
  .topbar { padding: 8px 14px; }
  .role label, #role-info { display: none; }
  .role select { min-width: 0; max-width: 52vw; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .filters, .formgrid, .meta, .grid2--meta { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .panel { padding: 14px; overflow-x: auto; }
  .tbl { min-width: 640px; }
  .doc { padding: 18px; overflow-x: auto; }
  .btn--ghost { display: none; }
}
@media print {
  body { display: block; background: #fff; color: #000; font-size: 11px; }
  .side, .topbar, .page-head__actions, .no-print, #toast, .back { display: none !important; }
  main { padding: 0; max-width: none; }
  .doc { border: 0; box-shadow: none; padding: 0; }
  .tbl { font-size: 10px; } .tbl tr { break-inside: avoid; }
  .badge { border: 1px solid #999; background: none !important; color: #000 !important; }
}

/* ---------- Parcours ---------- */
.ico { vertical-align: -2px; }
.socle-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.socle-card { display: block; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent-2); border-radius: var(--radius); padding: 16px 18px; color: var(--text); box-shadow: var(--shadow); }
.socle-card:hover { text-decoration: none; border-color: var(--accent); border-left-color: var(--accent-2); }
.socle-card h3 { font-family: var(--serif); font-size: 1.2rem; margin: 4px 0; }
.socle-card p { margin: 4px 0; }
.socle-card__top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.socle-card__top .eyebrow { margin: 0 auto 0 0; }
.espaces { display: grid; gap: 14px; }
.espace-card { border: 1px solid var(--line); border-radius: 9px; padding: 14px 16px; background: var(--surface-2); }
.espace-card h3 a { color: var(--text); }
.espace-card p { margin: 6px 0 0; }
.prog__row--wide { grid-template-columns: 90px 1fr 48px; margin: 8px 0 4px; }

.frise { list-style: none; display: flex; margin: 12px 0 16px; padding: 0; gap: 0; overflow-x: auto; }
.frise__step { flex: 1; position: relative; display: flex; justify-content: center; min-width: 34px; }
.frise__step::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 2px; background: var(--line); z-index: 0; }
.frise__step:first-child::before { left: 50%; } .frise__step:last-child::before { right: 50%; }
.frise__step.is-termine::before { background: var(--good); }
.frise__step a { position: relative; z-index: 1; text-decoration: none; }
.frise__dot { position: relative; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: .78rem; font-weight: 700; background: var(--surface); border: 2px solid var(--line); color: var(--muted); font-variant-numeric: tabular-nums; }
.is-en_cours .frise__dot { border-color: var(--info); color: var(--info); background: var(--info-bg); }
.is-termine .frise__dot { border-color: var(--good); background: var(--good); color: #fff; }
.is-current .frise__dot { box-shadow: 0 0 0 3px var(--accent-2); }
.frise__lock { position: absolute; right: -5px; bottom: -4px; width: 11px; height: 11px; border-radius: 3px; background: var(--neutral); border: 2px solid var(--surface); }
.frise__alert { position: absolute; right: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }

.socle-band { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.socle-pill { display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: .88rem; }
.socle-pill:hover { text-decoration: none; border-color: var(--accent); }

.chemin { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 18px; }
.phase { display: flex; flex-direction: column; gap: 8px; }
.phase__title { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-2); margin: 0 0 2px 4px; }
.step { display: grid; grid-template-columns: 36px 1fr 18px; gap: 12px; align-items: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.step:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.step__num { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.step.is-en_cours .step__num { border-color: var(--info); color: var(--info); background: var(--info-bg); }
.step.is-termine .step__num { border-color: var(--good); background: var(--good); color: #fff; }
.step__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.step__title { font-weight: 700; }
.step__lock { color: var(--muted); }
.step__meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.step__go { color: var(--muted); align-self: center; }

.statebar { display: grid; grid-template-columns: 160px minmax(220px, 1fr) 170px auto; gap: 12px; align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.statebar__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn--lock { color: var(--neutral); }
.lockbanner { display: flex; gap: 8px; align-items: center; margin: 0 0 14px; padding: 10px 14px; border-radius: 8px; background: var(--neutral-bg); color: var(--neutral); font-weight: 600; font-size: .9rem; }
.lockbanner--soft { background: var(--muted-bg); color: var(--muted); font-weight: 500; }
.alerts { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.alerts .alert { margin: 0; }
.alert--retard { background: var(--danger-bg); color: var(--danger); }
.alert--maj { background: var(--warn-bg); color: var(--warn); }
.alert--info { background: var(--info-bg); color: var(--info); font-weight: 500; }
.alert--ok { background: var(--good-bg); color: var(--good); font-weight: 500; }
.zone-fs { border: 0; padding: 0; margin: 0; display: block; min-width: 0; }
.zone-fs > legend { display: none; }
.zone .formgrid { margin-top: 4px; }
.formgrid--4 { grid-template-columns: repeat(4, 1fr); }
.kpis--3 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpis--3 .kpi { cursor: default; }
.kpis--3 .kpi:hover { border-color: var(--line); }
.sugg { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 10px; background: var(--surface-2); }
.sugg__head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.sugg__row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--line); }
.msgprev { white-space: pre-wrap; font-family: var(--font); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.links { margin: 10px 0; }
.linkrow { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.stepnav { display: flex; justify-content: space-between; gap: 10px; margin: 6px 0 30px; flex-wrap: wrap; }
.schema { margin-top: 14px; }
.schema pre { max-height: 300px; overflow: auto; background: var(--surface-2); padding: 12px; border-radius: 8px; border: 1px solid var(--line); white-space: pre; }
.preuves { margin: 8px 0 4px; font-size: .9rem; }
.preuves summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.tag--site { background: var(--info-bg); color: var(--info); }
code { font-family: ui-monospace, Menlo, monospace; font-size: .85em; background: var(--muted-bg); padding: 1px 5px; border-radius: 4px; }

/* Cloche et notifications */
.topbar__right { position: relative; }
.bell { position: relative; }
.bell__count { position: absolute; top: 1px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; }
.bell__count[hidden] { display: none; }
.notif-panel { position: absolute; right: 0; top: 46px; width: min(420px, 92vw); max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.18); z-index: 30; padding: 6px 0; }
.np__head { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.np__sec { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; padding: 10px 14px 4px; }
.np__item { display: grid; grid-template-columns: 10px 1fr; gap: 10px; padding: 8px 14px; color: var(--text); font-size: .88rem; line-height: 1.35; }
.np__item:hover { background: var(--surface-2); text-decoration: none; }
.np__item .sub { display: block; font-size: .78rem; }
.np__item.is-read { opacity: .6; }
.np__dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; }
.np__dot--danger { background: var(--danger); } .np__dot--warn { background: var(--accent-2); } .np__dot--info { background: var(--info); }
.np__empty { padding: 4px 14px; margin: 0; }
.np__foot { padding: 8px 14px; margin: 4px 0 0; border-top: 1px solid var(--line); }

/* Albert */
.albert-fab { position: fixed; right: 22px; bottom: 22px; z-index: 45; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px 10px 12px; border-radius: 99px; border: 0; background: #000091; color: #fff; font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 145, .35); transition: transform .15s; }
.albert-fab:hover { transform: translateY(-2px); }
.albert-fab.is-open { background: var(--neutral); box-shadow: none; }
[data-theme="dark"] .albert-fab { background: #6a6af4; }
.albert { position: fixed; right: 22px; bottom: 80px; z-index: 44; width: min(460px, calc(100vw - 28px)); max-height: calc(100vh - 110px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.25); overflow: hidden; }
.albert[hidden] { display: none; }
.al-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.al-head b { display: block; font-family: var(--serif); font-size: 1.1rem; }
.al-head .sub { font-size: .78rem; }
.al-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; padding: 10px 16px; font-size: .86rem; font-weight: 600; }
.al-status--ko { color: var(--danger); font-weight: 500; }
.albert > .sub, .albert > .btn { margin: 0 16px 8px; }
.al-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.al-dot--ok { background: var(--good); } .al-dot--ko { background: var(--danger); } .al-dot--wait { background: var(--accent-2); }
.al-model { flex-direction: row; align-items: center; gap: 6px; margin-left: auto; font-size: .8rem; }
.al-model select { padding: 3px 6px; font-size: .8rem; width: auto; max-width: 190px; }
.al-tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.al-tab { font: inherit; font-size: .86rem; font-weight: 600; padding: 9px 10px; border: 0; background: none; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.al-tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.al-body { padding: 12px 16px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.al-body > p { margin: 0; }
.al-foot { padding: 8px 16px; border-top: 1px solid var(--line); font-size: .75rem; margin: 0; }
.al-busy { display: flex; gap: 10px; align-items: center; font-size: .88rem; color: var(--muted); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.al-chat { display: flex; flex-direction: column; gap: 8px; min-height: 160px; max-height: 44vh; overflow: auto; }
.al-msg { padding: 9px 12px; border-radius: 10px; font-size: .9rem; max-width: 92%; line-height: 1.45; }
.al-msg--user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); }
.al-msg--assistant { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); }
.al-input { display: flex; gap: 8px; align-items: flex-end; }
.al-input textarea { flex: 1; }

@media (max-width: 860px) {
  .socle-row, .statebar, .formgrid--4 { grid-template-columns: 1fr; }
  .statebar__actions { justify-content: flex-start; }
  .albert { right: 8px; bottom: 74px; }
  .albert-fab { right: 12px; bottom: 12px; }
  .frise__step { min-width: 26px; } .frise__dot { width: 24px; height: 24px; font-size: .7rem; }
}
@media print { .albert, .albert-fab, .notif-panel { display: none !important; } }
#view:focus, #view:focus-visible { outline: none; }
.step__meta .badge, .usage__foot .badge { white-space: normal; text-align: left; }
.albert > .btn { align-self: flex-start; }
.lede .sub { display: block; margin-top: 2px; }
.al-key { display: flex; gap: 8px; align-items: flex-end; margin: 0 16px 6px; }
.al-key label { flex: 1; }
.al-keynote { margin: 0 16px 10px; font-size: .76rem; }
.albert .linkbtn { background: none; border: 0; padding: 0; font: inherit; font-size: .78rem; color: var(--accent); cursor: pointer; text-decoration: underline; }
