/* Synaptane — « Papier » le jour (Instrument Sans, Newsreader pour lire, accent sarcelle),
   « Ardoise » la nuit (Geist, accent citron). Jetons communs clair/sombre ; la préférence
   système est le défaut. Une seule action pleine par écran (--primary), l'accent est réservé
   aux liens et aux états actifs. */
@font-face{font-family:"Instrument Sans";font-style:normal;font-weight:400 700;font-display:swap;src:url(/fonts/InstrumentSans-latin.woff2) format("woff2")}
@font-face{font-family:"Newsreader";font-style:normal;font-weight:400 600;font-display:swap;src:url(/fonts/Newsreader-latin.woff2) format("woff2")}
@font-face{font-family:"Newsreader";font-style:italic;font-weight:400;font-display:swap;src:url(/fonts/Newsreader-italic-latin.woff2) format("woff2")}
@font-face{font-family:"JetBrains Mono";font-style:normal;font-weight:400 500;font-display:swap;src:url(/fonts/JetBrainsMono-latin.woff2) format("woff2")}
@font-face{font-family:"Geist";font-style:normal;font-weight:400 700;font-display:swap;src:url(/fonts/Geist-latin.woff2) format("woff2")}
@font-face{font-family:"Geist Mono";font-style:normal;font-weight:400 500;font-display:swap;src:url(/fonts/GeistMono-latin.woff2) format("woff2")}

:root{
  --font-body:"Instrument Sans",system-ui,-apple-system,"Segoe UI",sans-serif;--font-display:var(--font-body);
  --font-read:"Newsreader",Georgia,"Times New Roman",serif;
  --font-mono:"JetBrains Mono",ui-monospace,SFMono-Regular,Consolas,monospace;--read-size:18px;--read-lh:1.7;
  --radius:8px;--radius-lg:12px;--display-ls:-0.025em;--display-weight:600;
  --sidebar-width:264px;--topbar-height:52px;--sheet-gap:8px;
  --bg:#F6F6F4;--bg-2:#EFEFEB;--surface:#fff;--border:#E6E6E1;
  --ink:#18191B;--ink-2:#3F4247;--ink-3:#676B73;--hover:#F1F1ED;
  --accent:#1F6F6A;--accent-hover:#185955;--on-accent:#fff;--accent-soft:rgb(31 111 106 / .12);
  --primary:#18191B;--primary-hover:#2E3034;--on-primary:#fff;
  --warn-bg:rgb(148 96 10 / .08);--warn-ink:#7A4F08;--ok:#2B7349;--ok-bg:rgb(43 115 73 / .1);
  --danger:#B42318;--danger-bg:rgb(180 35 24 / .08);--shadow:0 16px 48px rgb(24 25 27 / .14),0 2px 6px rgb(24 25 27 / .05);
  --field-border:#868990;
  color-scheme:light;
}
:root[data-theme=dark]{
  --font-body:"Geist",system-ui,-apple-system,"Segoe UI",sans-serif;--font-display:var(--font-body);--font-read:var(--font-body);
  --font-mono:"Geist Mono",ui-monospace,SFMono-Regular,Consolas,monospace;--read-size:16.5px;--read-lh:1.7;
  --bg:#0E1116;--bg-2:#0B0E12;--surface:#161B22;--border:#262C36;
  --ink:#E6EAF0;--ink-2:#C9D1DC;--ink-3:#8B95A5;--hover:#1C222B;
  --accent:#B6F36A;--accent-hover:#C9F78F;--on-accent:#0E1116;--accent-soft:rgb(182 243 106 / .14);
  --primary:#B6F36A;--primary-hover:#C9F78F;--on-primary:#0E1116;
  --warn-bg:rgb(245 184 92 / .1);--warn-ink:#F5B85C;--ok:#B6F36A;--ok-bg:rgb(182 243 106 / .12);
  --danger:#FF7B72;--danger-bg:rgb(255 123 114 / .12);--shadow:0 16px 48px rgb(0 0 0 / .5),0 2px 6px rgb(0 0 0 / .3);
  --field-border:#5C6573;
  color-scheme:dark;
}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){
  --font-body:"Geist",system-ui,-apple-system,"Segoe UI",sans-serif;--font-display:var(--font-body);--font-read:var(--font-body);
  --font-mono:"Geist Mono",ui-monospace,SFMono-Regular,Consolas,monospace;--read-size:16.5px;--read-lh:1.7;
  --bg:#0E1116;--bg-2:#0B0E12;--surface:#161B22;--border:#262C36;
  --ink:#E6EAF0;--ink-2:#C9D1DC;--ink-3:#8B95A5;--hover:#1C222B;
  --accent:#B6F36A;--accent-hover:#C9F78F;--on-accent:#0E1116;--accent-soft:rgb(182 243 106 / .14);
  --primary:#B6F36A;--primary-hover:#C9F78F;--on-primary:#0E1116;
  --warn-bg:rgb(245 184 92 / .1);--warn-ink:#F5B85C;--ok:#B6F36A;--ok-bg:rgb(182 243 106 / .12);
  --danger:#FF7B72;--danger-bg:rgb(255 123 114 / .12);--shadow:0 16px 48px rgb(0 0 0 / .5),0 2px 6px rgb(0 0 0 / .3);
  --field-border:#5C6573;
  color-scheme:dark;
}}

/* ---------- Base ---------- */
*{box-sizing:border-box}
html{font:14px/1.5 var(--font-body);color:var(--ink);background:var(--bg);-webkit-text-size-adjust:100%}
body{margin:0;min-height:100vh;background:var(--bg);color:var(--ink);transition:background .2s,color .2s}
a{color:var(--accent);text-decoration:none}a:hover{text-decoration:underline}
/* Liens dans le texte : soulignés (la couleur seule ne suffit pas, surtout en sombre). */
.markdown a{text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1px}
button,input,select,textarea{font:inherit;color:inherit}
button,a,input,select,textarea{touch-action:manipulation}
button{cursor:pointer}button:disabled{cursor:default;opacity:.6}
img,svg{max-width:100%}svg{flex:none}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
code,kbd,pre,.mono{font-family:var(--font-mono)}
code{font-size:.92em;overflow-wrap:anywhere}
pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12.5px;line-height:1.6;padding:14px 16px;border-radius:var(--radius);background:var(--bg-2);border:1px solid var(--border);margin:12px 0}
kbd{font-size:11px;padding:1px 5px;border:1px solid var(--border);border-radius:4px;color:var(--ink-3);background:var(--surface)}
h1,h2,h3{font-family:var(--font-display);font-weight:var(--display-weight);letter-spacing:var(--display-ls);line-height:1.15;margin:0;overflow-wrap:anywhere}
h1{font-size:30px}h2{font-size:18px}h3{font-size:15px}
p{margin:0 0 12px}p:last-child{margin-bottom:0}
dl{margin:0}dd{margin:0}
ul,ol{padding-left:20px;margin:8px 0}
details>summary{cursor:pointer;font-weight:500;color:var(--ink-2)}
mark{background:var(--accent-soft);color:var(--ink);border-radius:2px;padding:0;box-decoration-break:clone;-webkit-box-decoration-break:clone}
time{font-variant-numeric:tabular-nums}
[hidden]{display:none!important}
.muted{color:var(--ink-3);font-size:12.5px}
.mono{font-size:12.5px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.skip-link{position:absolute;left:16px;top:8px;transform:translateY(-150%);background:var(--surface);color:var(--accent);padding:10px 14px;border-radius:var(--radius);border:1px solid var(--border);z-index:40}
.skip-link:focus{transform:translateY(0)}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* ---------- Brand ---------- */
.brand{display:inline-flex;align-items:center;gap:10px;color:var(--ink);text-decoration:none;font-family:var(--font-display);font-weight:var(--display-weight);font-size:17px;letter-spacing:var(--display-ls);min-width:0}
.brand:hover{text-decoration:none}
.brand-mark{width:26px;height:26px;color:var(--ink);display:grid;place-items:center;flex:none}
.brand-mark svg{width:26px;height:26px}
.brand-mark .mark-spark{fill:var(--accent)}
.brand small{display:block;font-family:var(--font-body);font-weight:400;font-size:11px;letter-spacing:0;color:var(--ink-3);margin-top:1px}

/* ---------- Controls ---------- */
.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:38px;padding:0 14px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);color:var(--ink);font-weight:500;font-size:13.5px;text-decoration:none;white-space:nowrap;transition:background .15s,border-color .15s}
.button:hover{background:var(--hover);text-decoration:none}
.button-primary{border-color:transparent;background:var(--primary);color:var(--on-primary);font-weight:600;padding:0 16px}
.button-primary:hover{background:var(--primary-hover)}
.button-quiet{background:var(--surface)}
.button-danger{color:var(--danger)}.button-danger:hover{background:var(--danger-bg)}
.button-wide{width:100%}
.button-small{height:30px;padding:0 10px;font-size:12.5px}
.button-link{border:0;background:none;padding:0 6px;height:auto;color:var(--accent);font-weight:500}
.button-link:hover{background:none;text-decoration:underline}
.icon-button{display:inline-flex;align-items:center;justify-content:center;flex:none;width:30px;height:30px;padding:0;border:0;border-radius:var(--radius);background:none;color:var(--ink-3)}
.icon-button:hover{background:var(--hover);color:var(--ink)}
.icon-button svg{width:16px;height:16px}
.actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.actions form{margin:0}
/* Texte d'aide sous un bouton ou une rangée d'actions : détaché du bouton. */
:is(.button,.actions)+p{margin-top:12px}
.actions.actions-links a:not(.button){padding:0 4px;font-weight:500}

input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea{display:block;width:100%;min-height:40px;padding:0 12px;border:1px solid var(--field-border);border-radius:var(--radius);background:var(--bg);color:var(--ink);outline:none;font-size:14px;transition:border-color .15s,box-shadow .15s}
textarea{padding:10px 12px;line-height:1.5;resize:vertical;min-height:96px}
select{padding-right:32px;appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;background-size:14px}
input:focus-visible,select:focus-visible,textarea:focus-visible{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
input[readonly],input:disabled,select:disabled,textarea[readonly]{background:var(--bg-2);color:var(--ink-2)}
input::placeholder,textarea::placeholder{color:var(--ink-3)}
input[type=file]{display:block;width:100%;padding:10px 12px;border:1px dashed var(--field-border);border-radius:var(--radius);background:var(--bg);font-size:13px;color:var(--ink-2)}
input[type=checkbox],input[type=radio]{width:16px;height:16px;margin:0;accent-color:var(--accent);flex:none}
.field{display:flex;flex-direction:column;gap:6px;margin-bottom:18px}
.field label,fieldset legend,.field-label{font-size:13px;font-weight:500;color:var(--ink-2)}
.field .muted{margin:0}
.form-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 18px}
.form-columns>.field{min-width:0}
/* Dernier champ d'une rangée, mais pas du formulaire : il garde sa marge (sinon il touche le
   champ ou le bouton qui suit, cf. `.card .field:last-child`). */
.card .form-columns:not(:last-child)>.field{margin-bottom:18px}
@media(min-width:701px){.card .form-columns:last-child>.field{margin-bottom:0}}
.form-grid{display:grid;gap:14px;min-width:0}
.form-grid>label{display:grid;gap:6px;font-size:13px;font-weight:500;color:var(--ink-2);min-width:0}
.form-grid>label+select{margin-top:-8px}
.form-grid>label:has(>input[type=checkbox]),.form-grid>label:has(>input[type=radio]){display:flex;align-items:center;gap:8px;min-height:32px}
.form-grid>.button{justify-self:start;max-width:100%;height:auto;min-height:38px;padding-block:8px;white-space:normal}
.form-grid>fieldset{margin-bottom:0}
.form-grid+.form-grid{margin-top:20px}
fieldset{border:0;padding:0;margin:0 0 18px;min-width:0}
fieldset legend{padding:0;margin-bottom:6px;display:block}
.checkbox{display:flex;align-items:center;gap:10px;padding:8px 0;font-size:13.5px;cursor:pointer}
.choice-list .checkbox{padding:10px 12px}
/* Identifiant technique après le libellé (événements de webhook) : jamais coupé en deux. */
.checkbox>code{flex:none;overflow-wrap:normal}
fieldset .checkbox,fieldset>div{margin:0}
fieldset.choice-list{display:flex;flex-direction:column}
.choice-list>div,.choice-list>.checkbox{border:1px solid var(--border);background:var(--bg);margin-top:-1px}
.choice-list>div:first-of-type,.choice-list>.checkbox:first-of-type{border-radius:var(--radius) var(--radius) 0 0;margin-top:0}
.choice-list>div:last-child,.choice-list>.checkbox:last-child{border-radius:0 0 var(--radius) var(--radius)}
.choice-list>div:only-of-type{border-radius:var(--radius)}
.choice-list>div .checkbox{margin:0}
.choice-list .checkbox:hover,.choice-list>div:hover{background:var(--hover)}
.choice-list>p{padding:10px 12px;color:var(--ink-3);border:1px dashed var(--border);border-radius:var(--radius)}
.segmented{display:inline-flex;gap:2px;padding:3px;border:0;border-radius:var(--radius);background:var(--hover)}
.segmented button{width:28px;height:26px;border:0;border-radius:calc(var(--radius) - 2px);background:none;color:var(--ink-3);display:grid;place-items:center;padding:0}
.segmented button:hover{color:var(--ink)}
.segmented button[aria-pressed=true]{background:var(--surface);box-shadow:0 0 0 1px var(--border);color:var(--ink)}
.segmented button:disabled{opacity:.5}
.segmented-option{display:inline-flex;align-items:center;padding:4px 10px;border-radius:calc(var(--radius) - 2px);color:var(--ink-2);font-size:13px;text-decoration:none;white-space:nowrap}
.segmented-option:hover{color:var(--ink);text-decoration:none}
.segmented-option[aria-current=page]{background:var(--surface);box-shadow:0 0 0 1px var(--border);color:var(--ink)}
nav.segmented{flex-wrap:wrap;max-width:100%}
.activity{list-style:none;padding:0;margin-left:0;display:flex;flex-direction:column;gap:0}
.activity-item{padding:12px 0;border-bottom:1px solid var(--border)}
.activity-head{display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:13px}
.activity-subject{margin:4px 0 0}
.activity-pages{list-style:none;padding:0;margin:4px 0 0;display:flex;flex-wrap:wrap;gap:4px 14px;font-size:13px}
.theme-control{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12.5px;color:var(--ink-3)}

/* ---------- Surfaces ---------- */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:24px}
.card+.card,.card+form,.card+section,section+.card,form.card+form.card{margin-top:20px}
.card>h2,.card>h3{margin-bottom:12px}
.card>h2+p,.card>h3+p{margin-top:-4px}
.card>form{margin:0}
.card form+p,.card p+form{margin-top:14px}
.card .field:last-child{margin-bottom:0}
.card>.button,.card>form>.button,.card>a.button{margin-top:4px}
.card .checkbox+:is(.button,.actions){margin-top:12px}
/* Sous-partie d'un formulaire (fieldset) : filet et titre, comme une petite section. */
fieldset.form-section{margin:8px 0 18px;padding-top:20px;border-top:1px solid var(--border)}
fieldset.form-section>legend{float:left;width:100%;margin:0 0 14px;font-size:15px;font-weight:600;color:var(--ink)}
fieldset.form-section>legend+*{clear:both}
/* Titre de section au-dessus d'une carte ou d'une liste de cartes (hors carte). */
/* Spécificité basse (:where) : les règles propres (zone de danger, alertes…) l'emportent. */
:where(section:not(.card))>:is(h2,h3):first-child{margin-bottom:12px}
:where(section:not(.card)>:is(h2,h3):first-child)+p{margin-top:-4px}
.card>.notice:first-child{margin-top:0}
.card>details{margin-top:12px}
.section-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:14px}
.section-heading h2{margin:0}
.section-heading+p{margin-top:-6px}
.notice{padding:12px 14px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);margin:16px 0;font-size:13.5px;display:block}
.notice>*{margin:0}
.notice>*+*{margin-top:6px}
.notice-error,.notice-validation,.notice-denied{background:var(--danger-bg);border-color:transparent;color:var(--danger)}
.notice-warning{background:var(--warn-bg);border-color:transparent;color:var(--warn-ink)}
.notice-success{background:var(--ok-bg);border-color:transparent;color:var(--ink)}
.notice-empty,.notice-loading{border-style:dashed;color:var(--ink-3);background:transparent}
.notice-empty h2{font-size:15px;color:var(--ink);margin-bottom:4px}
.notice a{color:inherit;text-decoration:underline}
.notice-error a{color:var(--danger)}
.field-error{color:var(--danger);font-size:13px;margin:6px 0 0}
.empty{padding:40px 20px;border:1px dashed var(--border);border-radius:var(--radius-lg);text-align:center;color:var(--ink-3);font-size:13px}
.badge{display:inline-flex;align-items:center;gap:6px;padding:2px 8px;border-radius:999px;background:var(--accent-soft);color:var(--ink);font-size:12px;font-weight:500;white-space:nowrap}
.badge-quiet{background:var(--bg-2);color:var(--ink-2)}
.badges{display:flex;gap:6px;flex-wrap:wrap}
.status{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;color:var(--ink-2)}
.status::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--ink-3);flex:none}
.status-ok::before{background:var(--ok)}
.status-warn::before{background:var(--warn-ink)}
.status-error::before{background:var(--danger)}
.chip{display:inline-flex;align-items:center;height:30px;padding:0 12px;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--ink-2);font-size:12.5px;font-weight:500;text-decoration:none}
.chip:hover{border-color:var(--ink-3);text-decoration:none}
.chip[aria-current]{background:var(--accent-soft);border-color:var(--accent);color:var(--ink)}
.chips{display:flex;gap:8px;flex-wrap:wrap}
.overline{font-size:13px;font-weight:400;color:var(--ink-3);margin:0 0 6px}
.eyebrow{font-size:13px;font-weight:400;color:var(--ink-3);margin:0 0 6px}
.section-label{font-size:12.5px;font-weight:500;color:var(--ink-3);margin:0 0 12px}
.divider{flex:1;height:1px;background:var(--border)}
.metadata{display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px 14px;font-size:13px;margin:0}
.metadata>div{display:contents}
.metadata dt{color:var(--ink-3)}
.metadata dd{margin:0;min-width:0;overflow-wrap:anywhere}
.metadata code{font-size:12px}
/* Marge de 4 px de part et d'autre : le contour de focus des boutons en bord de tableau
   n'est pas rogné par le défilement horizontal. */
.table-scroll{overflow-x:auto;overscroll-behavior-x:contain;margin-inline:-4px;padding-inline:4px}
.table-scroll table{width:100%;border-collapse:collapse;font-size:13px}
.table-scroll th,.table-scroll td{padding:10px 12px;text-align:left;vertical-align:middle;border-bottom:1px solid var(--border)}
.table-scroll th{font-weight:600;color:var(--ink-3)}
/* Bords du tableau alignés sur le contenu de la carte ; pas de filet sous la dernière ligne. */
.table-scroll :is(th,td):first-child{padding-left:0}
.table-scroll :is(th,td):last-child{padding-right:0}
.table-scroll tbody tr:last-child>*{border-bottom:0}
.card:has(>.table-scroll:only-child){padding-block:8px}
/* Colonne d'actions (dernière cellule, un bouton ou un formulaire) : serrée, à droite. */
.table-scroll td.cell-actions,.table-scroll td:last-child:has(>form:only-child,>.button:only-child){width:1%;white-space:nowrap;text-align:right}
.table-scroll td.cell-actions form{display:inline-block}
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--border);margin-bottom:20px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}
.tabs a{display:inline-flex;align-items:center;height:38px;padding:0 12px;margin-bottom:-1px;border-bottom:2px solid transparent;color:var(--ink-3);font-weight:500;font-size:13.5px;white-space:nowrap;text-decoration:none}
.tabs a:hover{color:var(--ink)}
.tabs a[aria-current]{color:var(--ink);border-bottom-color:var(--ink)}
/* Onglets qui débordent (preferences.js) : bord estompé du côté où il en reste. */
.tabs.more-after{-webkit-mask-image:linear-gradient(to right,#000 calc(100% - 40px),transparent);mask-image:linear-gradient(to right,#000 calc(100% - 40px),transparent)}
.tabs.more-before{-webkit-mask-image:linear-gradient(to left,#000 calc(100% - 40px),transparent);mask-image:linear-gradient(to left,#000 calc(100% - 40px),transparent)}
.tabs.more-before.more-after{-webkit-mask-image:linear-gradient(to right,transparent,#000 40px,#000 calc(100% - 40px),transparent);mask-image:linear-gradient(to right,transparent,#000 40px,#000 calc(100% - 40px),transparent)}
.danger-zone{max-width:640px;margin-top:40px;padding-top:28px;border-top:1px solid var(--border)}
.danger-zone h2{margin-bottom:6px}
.danger-zone p{color:var(--ink-2);font-size:13.5px}
.danger-zone .notice{margin:0 0 14px}
.danger-zone .button{color:var(--danger);font-weight:600}
.danger-zone .button:hover{background:var(--danger-bg)}
.danger-zone .inline-form .button{height:40px}
.warn-box{display:flex;align-items:center;gap:10px;padding:12px 14px;border-radius:var(--radius);background:var(--warn-bg);color:var(--warn-ink);font-size:13.5px}

/* ---------- Page structure ---------- */
.page-header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;flex-wrap:wrap;margin-bottom:28px}
.page-header>div{min-width:0;flex:1 1 320px}
.page-header h1{margin:0 0 8px}
.page-header .lede{margin:0;color:var(--ink-2);max-width:60ch;text-wrap:pretty}
.page-header .actions{flex:0 1 auto;max-width:100%;min-width:0}
.document-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;flex-wrap:wrap;margin-bottom:28px}
.document-heading>div{min-width:0}
.document-heading h1{margin-bottom:8px}
.document-heading p{color:var(--ink-2);max-width:60ch;text-wrap:pretty}
.document-heading .muted{color:var(--ink-3)}
.document-heading .badges{margin-top:10px}
.document-heading+.actions,.page-header+.actions{margin:-12px 0 24px}
.page-heading{margin-bottom:28px}
.page-heading h1{margin-bottom:8px}
.page-heading p:not(.eyebrow){color:var(--ink-2);max-width:60ch}
.content-narrow{max-width:640px}
.grid-2{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:24px;align-items:start}
.stack{display:flex;flex-direction:column;gap:10px}
/* Listes à espacement (gap) : pas de marge de carte en plus (sinon 30 px au lieu de 10). */
.stack>*,.stack>.card+.card,.search-results>.card+.card{margin:0}
.more-link{display:inline-flex;margin-top:14px}

/* ---------- Public layout (login, errors) ---------- */
.public-page .site-header{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;padding:20px 32px}
.public-page main{max-width:1104px;margin:0 auto;padding:40px 32px 80px}
.login-layout{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:48px;align-items:center;min-height:calc(100svh - 240px)}
.introduction{}
.introduction h1{font-size:clamp(34px,4.5vw,52px);line-height:1.08;margin:0 0 16px;text-wrap:balance;max-width:16ch}
.intro-copy{font-size:16px;color:var(--ink-2);max-width:42ch;text-wrap:pretty;margin:0}
.login-card{max-width:420px;width:100%;justify-self:end;padding:28px}
.login-card h2{font-size:20px;margin-bottom:16px}
.login-card .notice{margin:0 0 16px}
.login-card .field{margin-bottom:16px}
.login-card .button-primary{height:42px;justify-content:center;margin-top:4px}
.language-form{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:16px;padding-top:12px;border-top:1px solid var(--border);font-size:13px;color:var(--ink-3)}
.language-form label{flex:none}
.language-form select{margin-left:auto;width:auto;min-width:120px;min-height:34px;padding:0 30px 0 10px;font-size:13px}
.language-form .button{height:34px;padding:0 10px;font-size:12.5px}
.error-card{max-width:560px;margin:40px auto;padding:32px}
.error-card h1{font-size:26px;margin:6px 0 12px}
.error-card .button{margin-top:16px}

/* ---------- Workspace shell ---------- */
.workspace{padding-left:var(--sidebar-width)}
.workspace-sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar-width);display:flex;flex-direction:column;background:var(--bg);z-index:10;min-height:0}
/* Feuille : la barre du haut et le contenu posés sur le fond, à côté de la navigation. */
.workspace-sheet{margin:var(--sheet-gap) var(--sheet-gap) var(--sheet-gap) 0;min-height:calc(100vh - 2 * var(--sheet-gap));background:var(--surface);border:1px solid var(--border);border-radius:14px;display:flow-root;min-width:0}
.sidebar-brand{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px 12px 12px 16px}
.sidebar-brand .brand{font-size:17px}
.sidebar-tree{flex:1;min-height:0;overflow:auto;padding:8px 12px 12px;scrollbar-width:thin}
.tree-heading{display:flex;align-items:center;justify-content:space-between;padding:8px 10px 6px;font-size:12px;font-weight:400;color:var(--ink-3)}
.tree-heading a{color:inherit}.tree-heading a:hover{color:var(--ink);text-decoration:none}
.tree-heading .icon-button{width:24px;height:24px;font-size:0}
.tree-heading .icon-button svg{width:14px;height:14px}
.knowledge-tree{display:flex;flex-direction:column;gap:1px}
.tree-status{font-size:12px;color:var(--ink-3);margin:4px 8px 8px}
.tree-status:empty{display:none}
.tree-more{border:0;background:none;color:var(--accent);font-size:12.5px;font-weight:500;padding:6px 10px;text-align:left;border-radius:var(--radius)}
.tree-more:hover{background:var(--hover)}
.tree-node>summary{display:flex;align-items:center;gap:6px;cursor:pointer;list-style:none;height:32px;padding:0 4px 0 6px;border-radius:var(--radius);font-size:13px;font-weight:500;color:var(--ink-2)}
.tree-node>summary::-webkit-details-marker{display:none}
.tree-node>summary::before{content:"";flex:none;width:20px;height:20px;background:currentColor;color:var(--ink-3);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center/12px no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center/12px no-repeat;transition:transform .15s}
.tree-node[open]>summary::before{transform:rotate(90deg)}
.tree-node>summary:hover,.tree-document:hover{background:var(--hover);color:var(--ink);text-decoration:none}
.tree-organization{margin-bottom:6px}
.tree-org-link{display:flex;align-items:center;height:32px;padding:0 8px;border-radius:var(--radius);font-size:13px;font-weight:600;color:var(--ink);text-decoration:none}
.tree-org-link:hover{background:var(--hover);text-decoration:none}
.tree-org-link[aria-current],.tree-document[aria-current]{background:var(--surface);box-shadow:0 0 0 1px var(--border);color:var(--ink)}
.tree-organization>summary{font-weight:600;color:var(--ink)}
.tree-organization>summary .tree-icon{display:none}
.tree-children{margin-left:15px;padding-left:8px;border-left:1px solid var(--border);display:flex;flex-direction:column;gap:1px}
.tree-space>summary{height:32px;padding-left:8px}
.tree-space>summary::before{width:14px;-webkit-mask-size:10px;mask-size:10px}
.tree-folder>summary{height:28px;font-size:12.5px;font-weight:400;padding-left:8px}
.tree-folder>summary::before{width:14px;-webkit-mask-size:10px;mask-size:10px}
.tree-icon{display:inline-flex;width:14px;height:14px;flex:none;color:var(--ink-3)}
.tree-icon svg{width:14px;height:14px}
.tree-space>summary .tree-icon{color:var(--ink-2)}
.tree-label{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.tree-document{display:flex;align-items:center;gap:8px;height:28px;padding:0 8px;border-radius:var(--radius);color:var(--ink-2);font-size:12.5px;text-decoration:none}
.tree-document .tree-icon{width:13px;height:13px}
.tree-document[aria-current=page]{background:var(--surface);box-shadow:0 0 0 1px var(--border);color:var(--ink)}
.tree-node>summary .tree-space-link{display:inline-flex;align-items:center;justify-content:center;flex:0 0 24px;width:24px;height:24px;margin-left:auto;border-radius:var(--radius);color:var(--ink-3)}
.tree-node>summary .tree-space-link:hover{background:var(--hover);color:var(--ink);text-decoration:none}
.tree-node>summary .tree-space-link svg{width:15px;height:15px}
.sidebar-footer{padding:12px;display:flex;flex-direction:column;gap:10px}
.sidebar-account{display:flex;align-items:center;gap:4px;padding:4px 0 0}
.sidebar-account form{margin:0}
.avatar{width:30px;height:30px;border-radius:50%;background:var(--hover);color:var(--ink-2);display:grid;place-items:center;font-weight:600;font-size:13px;flex:none}
/* Compte : toute la ligne (avatar, nom, identifiant) est le lien, surlignée au survol. */
.account-label{display:flex;align-items:center;gap:10px;flex:1;min-width:0;padding:5px 6px;border-radius:var(--radius);color:var(--ink);line-height:1.25;text-decoration:none;transition:background .12s}
.account-label:hover{background:var(--hover);text-decoration:none}
.account-label[aria-current]{background:var(--surface);box-shadow:0 0 0 1px var(--border)}
.account-label[aria-current] .avatar{background:var(--surface)}
.account-label:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.account-label>span{min-width:0}
.account-label strong{display:block;font-size:13px;font-weight:600;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.account-label small{display:block;font-size:11.5px;color:var(--ink-3)}
.segmented-labels button{width:auto;height:30px;padding:0 12px;display:inline-flex;gap:6px;font-size:13px;color:var(--ink-2)}
.workspace-topbar{position:sticky;top:0;z-index:5;height:var(--topbar-height);display:flex;align-items:center;gap:6px;padding:0 24px;border-bottom:1px solid var(--border);border-radius:14px 14px 0 0;background:var(--surface);font-size:13px;color:var(--ink-3);min-width:0}
.topbar-crumbs{display:flex;align-items:center;gap:6px;flex:1;min-width:0;overflow:hidden;white-space:nowrap}
.topbar-crumbs>*{flex:none}
.topbar-crumbs>svg:first-child{display:none}
.topbar-crumbs a,.topbar-crumbs span{color:var(--ink-3);padding:2px 4px;border-radius:4px;text-decoration:none}
.topbar-crumbs a:hover{background:var(--hover);color:var(--ink)}
.topbar-crumbs [aria-current]{color:var(--ink);font-weight:500}
.topbar-crumbs svg{width:12px;height:12px;opacity:.6;flex:none}
.topbar-actions{margin-left:auto;display:flex;align-items:center;gap:4px;flex:none}
.workspace main{max-width:1104px;margin:0 auto;padding:36px 32px 120px;min-width:0}
:root[data-sidebar-collapsed=true] .workspace{padding-left:0}
:root[data-sidebar-collapsed=true] .workspace-sidebar{display:none}
:root[data-sidebar-collapsed=true] .workspace-sheet{margin-left:var(--sheet-gap)}
:root:not([data-enhanced]) #sidebar-toggle,:root:not([data-enhanced]) [data-sidebar-close]{display:none}
:root:not([data-enhanced]) #knowledge-tree>.tree-status{display:none}

/* ---------- Overview & organizations ---------- */
.org-sections{display:flex;flex-direction:column;gap:32px}
.org-section-heading{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.org-section-heading h2{font-size:14px;font-weight:600;color:var(--ink-2);margin:0}
.org-section-heading a{font-size:12.5px;color:var(--ink-3);padding:2px 6px;border-radius:4px}
.org-section-heading a:hover{color:var(--ink);background:var(--hover);text-decoration:none}
.space-grid,.document-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:14px}
.space-card{display:flex;flex-direction:column;gap:14px;padding:20px;transition:border-color .15s,transform .15s;position:relative}
.space-card:hover{border-color:var(--accent);transform:translateY(-1px)}
.space-card .card-icon{width:36px;height:36px;border-radius:var(--radius);background:var(--bg);color:var(--ink-3);display:grid;place-items:center}
.space-card :is(h2,h3){font-size:18px;margin-bottom:4px}
.space-card :is(h2,h3) a{color:var(--ink)}
.space-card :is(h2,h3) a::after{content:"";position:absolute;inset:0;border-radius:inherit}
.space-card :is(h2,h3) a:hover{text-decoration:none}
.space-card .card-copy{font-size:13px;color:var(--ink-2);margin:0}
.space-card .card-meta{display:flex;gap:14px;font-size:12.5px;color:var(--ink-3);font-family:var(--font-mono);margin-top:auto}
.space-card .card-link{position:relative;z-index:1;font-size:12.5px;align-self:flex-start}
.space-card>.eyebrow{margin:0}

/* ---------- Tokens & access ---------- */
.token-card{display:flex;flex-direction:column;gap:10px;padding:18px 24px}
.token-card .token-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.token-card .token-head h3{flex:1;font-size:15px}
.token-card code{font-size:12px;color:var(--ink-3)}
.token-card .token-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;padding-top:8px;border-top:1px solid var(--border);font-size:12.5px;color:var(--ink-3)}
.token-card .token-foot form{margin:0}
.token-card p{margin:0;font-size:13px;color:var(--ink-2)}

/* ---------- Forms & lists (v1) ---------- */
.notice-ok{background:var(--ok-bg);border-color:transparent;color:var(--ink)}
.section-gap{margin-top:32px}
.inline-form{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap;margin-top:16px}
.inline-form .field{margin:0;flex:1 1 160px}
.inline-form .checkbox{padding:6px 0}
td .inline-form{margin-top:0;align-items:center}
td .inline-form input:not([type=checkbox]){min-height:30px;flex:1 1 140px}
.space-grid>.card,.grid-2>.card,.grid-2>form.card+form.card{margin-top:0}
.section-gap-small{margin-top:14px}
.card>form+form,.card>form+.notice{margin-top:16px}
.sso-buttons{display:flex;flex-direction:column;gap:8px;margin-top:14px;text-align:center}
.plain-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px}

/* ---------- Wiki & search (v1) ---------- */
.space-header{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:16px}
.space-header h1 a{color:var(--ink)}.space-header h1 a:hover{text-decoration:none}
.space-search{flex:0 1 320px}
.workspace-sidebar .sidebar-search input[type=search]:not([type=hidden]):not([type=checkbox]){border:0;background:none;box-shadow:none;min-height:0;padding:0}
.wiki-layout{display:grid;grid-template-columns:240px minmax(0,1fr);gap:32px;align-items:start}
.wiki-tree{position:sticky;top:calc(var(--topbar-height) + 16px);max-height:calc(100vh - var(--topbar-height) - 32px);overflow:auto;font-size:13px;display:flex;flex-direction:column;gap:12px;scrollbar-width:thin}
.wiki-tree-list{list-style:none;margin:0;padding:0}
.wiki-tree-list .wiki-tree-list{padding-left:14px;border-left:1px solid var(--border);margin-left:7px}
.wiki-tree .icon-ref{flex:none}
.wiki-tree-more{color:var(--ink-3)!important;font-style:italic}
.wiki-tree a{display:flex;align-items:center;gap:6px;padding:4px 6px;border-radius:var(--radius);color:var(--ink-2);text-decoration:none;min-width:0}
.wiki-tree a span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wiki-tree a:hover{background:var(--hover);color:var(--ink)}
.wiki-tree a[aria-current]{background:var(--bg);color:var(--ink);font-weight:500}
.wiki-main{min-width:0}
.wiki-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:20px}
.wiki-more{position:relative}
.wiki-more>summary{list-style:none}
.wiki-more>summary::-webkit-details-marker{display:none}
.wiki-more>.card{position:absolute;z-index:4;top:36px;left:0;width:min(360px,80vw);padding:16px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:12px}
.upload-form{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.upload-form input[type=file]{width:auto;max-width:260px;padding:5px 8px}
.file-title{margin-bottom:16px;font-size:24px}
.file-list{list-style:none;margin:0;padding:0;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface)}
.file-list li{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 14px;border-top:1px solid var(--border)}
.file-list li:first-child{border-top:0}
.file-list a{display:flex;align-items:center;gap:8px;color:var(--ink);min-width:0}
.file-list a svg{color:var(--ink-3)}
.history-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}
.history-list li{display:flex;flex-direction:column;gap:2px;padding:10px 0;border-bottom:1px solid var(--border)}
.diff{font-size:12.5px;line-height:1.55;white-space:pre-wrap}
.diff-add{background:var(--ok-bg);display:block}
.diff-del{background:var(--danger-bg);display:block}
.diff-ctx{display:block;color:var(--ink-2)}
.pdf-frame{width:100%;height:80vh;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface)}
.wiki-image{max-height:80vh;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface)}
.editor{font-family:var(--font-mono);font-size:13px;line-height:1.6;min-height:420px}
.markdown{font-family:var(--font-read);font-size:var(--read-size);line-height:var(--read-lh);max-width:68ch;overflow-wrap:anywhere}
.markdown h1{font-size:40px;letter-spacing:-0.03em;line-height:1.08;margin:0 0 24px}
.markdown h2{font-size:21px;letter-spacing:-0.015em;margin:36px 0 10px}
.markdown h3{font-size:17px;margin:26px 0 8px}
/* Lecture en Newsreader ; titres, tableaux et légendes restent dans la police d'interface. */
.markdown :is(table,figcaption,.task-list-item input){font-family:var(--font-body);font-size:14px}
.markdown p,.markdown ul,.markdown ol,.markdown table,.markdown blockquote{margin:0 0 14px}
.markdown blockquote{padding:2px 18px;border-left:2px solid var(--border);color:var(--ink-2);font-style:italic}
.markdown table{border-collapse:collapse;display:block;overflow-x:auto}
/* Dans une page, un tableau peut dépasser la colonne de lecture (68ch) jusqu'à la largeur
du document (.doc-body, conteneur de requête) : il ne défile qu'au-delà. */
.doc-body .markdown table{width:max-content;max-width:100cqi}
/* break-word et non anywhere (hérité de .markdown) : anywhere ramène la largeur minimale
d'une cellule à un caractère, et une colonne voisine très remplie écrase alors les autres
lettre par lettre au lieu de faire défiler le tableau. */
.markdown th,.markdown td{border-bottom:1px solid var(--border);padding:9px 28px 9px 0;text-align:left;vertical-align:top;overflow-wrap:break-word}
.markdown th{font-weight:500;font-size:12.5px;color:var(--ink-3)}
.markdown :is(th,td):last-child{padding-right:0}
.markdown img{border-radius:var(--radius)}
.markdown hr{border:0;border-top:1px solid var(--border);margin:24px 0}
.markdown .task-list-item{list-style:none}
.markdown .contains-task-list{padding-left:4px}
/* Code dans le texte de lecture : plus petit que la police à empattements, sur une pastille. */
.markdown :not(pre)>code{font-size:.78em;padding:2px 5px;border-radius:5px;background:var(--bg-2)}
.markdown pre code{font-size:inherit}
.search-form{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr) auto auto;gap:12px;align-items:end}
.search-form .field{margin:0}
.search-results{list-style:none;padding:0;margin:12px 0 0;display:flex;flex-direction:column;gap:12px}
.search-hit{padding:16px 20px}
.search-hit .search-title{font-size:16px;font-weight:600;color:var(--ink)}
.search-hit p{margin:4px 0 8px}
@media (max-width:860px){.wiki-layout{grid-template-columns:1fr}.wiki-tree{position:static;max-height:none}.search-form{grid-template-columns:1fr}}

/* ---------- Responsive ---------- */
@media(max-width:1050px){
  :root{--sidebar-width:240px}
  .workspace main{padding:28px 24px 96px}
  .workspace-topbar{padding:0 16px}
}
@media(max-width:900px){
  .doc-table-head{display:none}
  .doc-row{grid-template-columns:minmax(0,1fr);gap:6px}
  .doc-date{padding-left:40px}
  .doc-state{padding-left:40px;flex-direction:row;gap:10px;flex-wrap:wrap}
}
@media(max-width:900px){
  /* Tiroir : fermé par défaut, par-dessus le contenu, fermé par le voile ou Échap. */
  .workspace{padding-left:0}
  /* Petit écran : la feuille occupe tout l'écran, sans marge ni coins. */
  .workspace-sheet,:root[data-sidebar-collapsed=true] .workspace-sheet{margin:0;border:0;border-radius:0;min-height:100vh}
  .workspace-topbar{border-radius:0}
  /* Ombre seulement tiroir ouvert : fermé, son flou débordait sur le bord gauche de la page. */
  :root[data-enhanced] .workspace-sidebar{display:flex;transform:translateX(-102%);transition:transform .2s ease,box-shadow .2s ease;z-index:30;width:min(86vw,320px)}
  :root[data-enhanced]:not([data-sidebar-collapsed=true]) .workspace-sidebar{transform:none;box-shadow:var(--shadow)}
  :root[data-enhanced]:not([data-sidebar-collapsed=true]) .sidebar-scrim{display:block}
  .sidebar-scrim{position:fixed;inset:0;background:rgb(14 17 22 / .45);z-index:29}
  :root:not([data-enhanced]) .workspace-sidebar{position:static;width:100%;height:auto;border-right:0;border-bottom:1px solid var(--border)}
  :root:not([data-enhanced]) .knowledge-tree{max-height:120px}
  .settings-layout{grid-template-columns:minmax(0,1fr)}
  .settings-nav{flex-direction:row;flex-wrap:wrap;position:static}
}
@media(max-width:700px){
  .workspace main{padding:24px 16px 80px}
  .workspace-topbar{padding:0 12px}
  .public-page .site-header{padding:16px 20px}
  .public-page main{padding:24px 16px 60px}
  .login-layout{gap:28px;min-height:0}
  .introduction h1{font-size:34px}
  .login-card{justify-self:stretch;max-width:none;padding:22px}
  .card{padding:18px}
  .form-columns{grid-template-columns:1fr}
  .page-header,.document-heading{margin-bottom:20px}
  .document-heading .actions .button,.page-header .actions .button{flex:1 1 auto}
  .error-card{margin:10px 0}
}

/* Groupes d’actions d’automatisation : cibles séparées au clavier et au toucher. */
.automation-actions{display:flex;flex-wrap:wrap;gap:8px 18px}
.automation-actions legend{width:100%}
.automation-actions label{display:inline-flex;align-items:center;gap:6px;min-height:32px}


/* ---------- Pages de réglages (une page par sujet) ---------- */
.sidebar-scrim{display:none}
.section-body{margin-top:4px}
.admin-version{margin-top:32px}
.space-title{font-family:var(--font-display);font-weight:var(--display-weight);letter-spacing:var(--display-ls);font-size:30px;line-height:1.15;margin:0}
.space-title a{color:var(--ink)}.space-title a:hover{text-decoration:none}
.settings-layout{display:grid;grid-template-columns:200px minmax(0,1fr);gap:32px;align-items:start}
.settings-nav{display:flex;flex-direction:column;gap:2px;position:sticky;top:calc(var(--topbar-height) + 16px)}
.settings-nav a{display:block;padding:7px 10px;border-radius:var(--radius);color:var(--ink-2);font-size:13.5px;text-decoration:none}
.settings-nav a:hover{background:var(--hover);color:var(--ink)}
.settings-nav a[aria-current]{background:var(--hover);color:var(--ink);font-weight:500}
/* Après la règle de base (même spécificité) : sinon la colonne de 200 px reste sur mobile. */
@media(max-width:900px){.settings-layout{grid-template-columns:minmax(0,1fr)}.settings-nav{flex-direction:row;flex-wrap:wrap;position:static}}
.settings-role{margin:12px 0 0;padding:0 10px}
.settings-title{font-size:22px;margin:0 0 16px}
.status-card{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.status-card>div>p{margin:4px 0 0}
.step{display:inline-grid;place-items:center;width:22px;height:22px;margin-right:8px;border-radius:50%;background:var(--accent-soft);color:var(--ink);font-size:12px;font-weight:600;vertical-align:2px}
.steps{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:10px}
.steps>li>.copyable-block{margin-top:8px}
.steps+:is(p,.notice,.actions){margin-top:16px}
.copyable{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap;max-width:100%}
.copyable code{overflow-wrap:anywhere}
.copyable-block{display:flex;flex-wrap:nowrap;justify-content:space-between;gap:12px;padding:8px 8px 8px 12px;background:var(--bg-2);border-radius:var(--radius)}
.copyable-block code{flex:1 1 auto;min-width:0}
details.help{font-size:13px;color:var(--ink-2)}
details.help>summary{cursor:pointer;color:var(--ink-2)}
details.help+details.help{margin-top:10px}
details.help>.steps,details.help>p{margin-top:6px}
.notice-compact{flex-direction:row;flex-wrap:wrap;gap:8px;align-items:center;margin:0 0 16px}
.wiki-tree-panel>summary{display:none;list-style:none}
.wiki-tree-panel>summary::-webkit-details-marker{display:none}
.wiki-more hr{border:0;border-top:1px solid var(--border);margin:12px 0}
button[aria-busy=true]{opacity:.7;cursor:progress}
input:invalid:not(:placeholder-shown):not(:focus){border-color:var(--danger)}
input[type=file]::file-selector-button{font:inherit;margin-right:10px;padding:4px 10px;border:1px solid var(--field-border);border-radius:var(--radius);background:var(--surface);color:var(--ink);cursor:pointer}
@media(max-width:900px){
  .wiki-tree-panel>summary{display:inline-flex;margin-bottom:12px}
}

/* Rôle modifiable dans un tableau : menu et bouton sur une ligne, à la hauteur du bouton. */
td .inline-form{display:flex;flex-wrap:nowrap;align-items:center;gap:8px;margin:0}
td .inline-form select,select.select-compact{width:auto;min-width:150px;min-height:32px;height:32px;padding-left:10px;font-size:13px}
td .inline-form .button-small{height:32px}
/* Tableau qui s'empile sur mobile : première cellule sur toute la ligne, les autres dessous,
   la dernière (actions) à droite. */
@media(max-width:600px){
  .table-stack thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
  .table-stack tr{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 12px;padding:12px 0;border-bottom:1px solid var(--border)}
  .table-stack tbody tr:last-child{border-bottom:0}
  .table-stack td{display:block;padding:0;border:0}
  .table-stack td:first-child{grid-column:1/-1}
  .table-stack td:only-child{grid-column:1/-1}
  .table-scroll .table-stack td.cell-actions{width:auto}
  .table-stack td .inline-form select{min-width:0;flex:1 1 auto}
}
.wiki-layout-single{grid-template-columns:minmax(0,1fr)}

/* ---------- Espace courant dans la barre de gauche ---------- */
:root{--sidebar-width:288px}
.sidebar-space{display:flex;flex-direction:column;gap:6px;margin:2px 0 8px}
.sidebar-space-row{display:flex;align-items:center;gap:2px;border-radius:var(--radius)}
.sidebar-space-row:hover{background:var(--hover)}
.sidebar-space-row.is-current{background:var(--surface);box-shadow:0 0 0 1px var(--border)}
.sidebar-space-name{display:flex;align-items:center;gap:8px;flex:1;min-width:0;height:30px;padding:0 8px;border-radius:var(--radius);color:var(--ink);font-size:13px;font-weight:600;text-decoration:none}
.sidebar-space-name:hover{text-decoration:none}
.sidebar-space-gear{display:grid;place-items:center;flex:none;width:28px;height:28px;margin-right:1px;border-radius:var(--radius);color:var(--ink-3);text-decoration:none}
.sidebar-space-gear:hover{background:var(--hover);color:var(--ink);text-decoration:none}
.sidebar-space-gear[aria-current]{color:var(--accent)}
.space-tree{font-size:12.5px}
.space-tree-list{list-style:none;margin:0;padding:0}
.space-tree-list .space-tree-list{margin-left:10px;padding-left:6px;border-left:1px solid var(--border)}
.space-tree-row{display:flex;align-items:center;min-width:0}
.tree-toggle,.tree-spacer{flex:none;width:24px;height:24px}
.tree-toggle{display:grid;place-items:center;padding:0;border:0;border-radius:4px;background:none;color:var(--ink-3);cursor:pointer}
.tree-toggle::before{content:"";width:12px;height:12px;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center/12px no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center/12px no-repeat;transition:transform .15s}
.tree-toggle[aria-expanded=true]::before{transform:rotate(90deg)}
.tree-toggle:hover{background:var(--hover);color:var(--ink)}
:root:not([data-enhanced]) .tree-toggle{visibility:hidden}
.space-tree-entry{display:flex;align-items:center;gap:6px;flex:1;min-width:0;height:26px;padding:0 6px;border-radius:var(--radius);color:var(--ink-2);text-decoration:none}
.space-tree-entry span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.space-tree-entry .icon-ref{flex:none;color:var(--ink-3)}
.space-tree-entry:hover{background:var(--hover);color:var(--ink);text-decoration:none}
.space-tree-entry[aria-current]{background:var(--surface);box-shadow:0 0 0 1px var(--border);color:var(--ink);font-weight:500}
.space-tree-more{font-style:italic;color:var(--ink-3)}

/* ---------- Document : barre d'informations et menu de configuration ---------- */
.wiki-main{max-width:920px}
.doc-bar{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:0 0 20px;margin:0 0 28px;border-bottom:1px solid var(--border)}
.doc-bar-main{display:flex;align-items:flex-start;gap:12px;min-width:0}
.doc-icon{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:var(--radius);background:var(--bg);color:var(--ink-3)}
.doc-title{font-size:22px;margin:0 0 4px}
.doc-meta{margin:0;font-size:12.5px;color:var(--ink-3);overflow-wrap:anywhere}
.doc-meta code{font-size:12px}
.doc-actions{display:flex;align-items:center;gap:8px;flex:none}
details.menu{position:relative}
details.menu>summary{list-style:none;cursor:pointer}
details.menu>summary::-webkit-details-marker{display:none}
details.menu[open]>summary{background:var(--hover)}
.menu-panel{position:absolute;right:0;top:calc(100% + 6px);z-index:20;width:300px;padding:8px;display:flex;flex-direction:column;gap:2px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow)}
.menu-panel .menu-item{display:flex;align-items:center;gap:8px;padding:7px 10px;border-radius:var(--radius);color:var(--ink);font-size:13px;text-decoration:none}
.menu-panel a.menu-item:hover{background:var(--hover);text-decoration:none}
.menu-item-static{color:var(--ink-3)!important}
.menu-panel hr{border:0;border-top:1px solid var(--border);margin:6px 0}
.menu-panel form{padding:4px 10px}
.menu-panel .field{margin-bottom:8px}
.menu-panel .muted{margin:6px 0 0;font-size:12px}
.menu-panel-wide{width:min(560px,calc(100vw - 32px))}
.wiki-actions details.menu .menu-panel{left:0;right:auto}
.inbox-filter{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0 0 14px}
.inbox-filter input[type=search]{flex:1 1 200px;width:auto;min-width:0}
.inbox-filter select{flex:0 1 auto;width:auto}
.pager{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:12px}
.doc-body{min-width:0;container-type:inline-size}
.markdown.title-in-bar>h1:first-child{display:none}
.doc-listing{padding:6px 10px}
@media(max-width:700px){
  .doc-bar{flex-direction:column}
  .doc-actions{align-self:stretch;justify-content:flex-end}
  .menu-panel{width:min(300px,86vw)}
}

/* ---------- Pages publiques : invitation, mot de passe oublié ---------- */
.public-card-layout{display:grid;place-items:center;min-height:60vh;padding:24px 0}
.public-card-layout .login-card{width:min(440px,100%);justify-self:center}
.card-title{font-size:24px;margin:0 0 8px}
.login-help{margin:14px 0 0;font-size:13px;text-align:center}
.access-list{list-style:none;margin:0;padding:0;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg)}
.access-list>li{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:6px 6px 6px 12px;border-top:1px solid var(--border);font-size:13.5px}
.access-list>li:first-child{border-top:0}
.access-list label{min-width:0;overflow-wrap:anywhere}
.file-picker{display:flex;align-items:center;gap:10px;flex-wrap:wrap;position:relative}
.file-input{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden}
.file-input:focus-visible+label{outline:2px solid var(--accent);outline-offset:2px}
.file-picker label{margin:0}
.key-help{font-size:13px;color:var(--ink-2);margin:4px 0 14px}
.key-help p{margin:0 0 6px}
/* Barre du haut d'un document : informations et actions à droite du fil d'Ariane. */
.topbar-doc{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex:none;margin-left:auto;padding-left:12px}
.topbar-doc>:not(.topbar-meta){flex:none}
.topbar-meta{font-size:12.5px;color:var(--ink-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.workspace-topbar:has(.topbar-doc) .topbar-crumbs{flex:0 1 auto}
/* Place insuffisante : d'abord le chemin se replie dans « … » (preferences.js), ensuite
   seulement les informations du document, puis le nom de la page, se raccourcissent. */
.workspace-topbar.crumbs-tight .topbar-doc{flex:1 1 0;min-width:0}
.workspace-topbar.crumbs-tight .topbar-crumbs>[aria-current]{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}
.crumb-more{position:relative;flex:none}
.crumb-more>button{min-width:28px;height:28px;padding:0 6px;font-size:15px;letter-spacing:.05em;color:var(--ink-2)}
.crumb-menu{display:none;position:absolute;left:0;top:100%;z-index:30;min-width:220px;max-width:min(420px,80vw);padding:6px;flex-direction:column;gap:1px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow)}
/* Menu ouvert par le bouton (aria-expanded) ; le survol ne vaut qu'à la souris : au doigt,
   un :hover collant empêchait de refermer. */
.crumb-more.open .crumb-menu{display:flex}
@media(hover:hover){.crumb-more:hover .crumb-menu{display:flex}}
.crumb-menu a{display:block;padding:6px 10px;border-radius:var(--radius);color:var(--ink);font-size:13px;text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.crumb-menu a:hover{background:var(--hover);text-decoration:none}
.topbar-doc .menu-panel{top:calc(100% + 10px)}
.menu-panel .narrow-only{display:none}
/* Vérification d'une page : badge dans la barre, marque dans les listes, panneau du menu ⋮.
   Vert discret quand elle est vérifiée, ambre quand elle est à revoir ; rien sinon. */
.verify-badge{display:inline-flex;align-items:center;gap:6px;height:26px;padding:0 10px 0 8px;border-radius:999px;font-size:12px;font-weight:500;line-height:1;white-space:nowrap;cursor:default}
.verify-badge.verify-ok{background:var(--ok-bg);color:var(--ink-2)}
.verify-badge.verify-ok svg{color:var(--ok)}
.verify-badge.verify-stale{background:var(--warn-bg);color:var(--warn-ink)}
.verify-mark{display:inline-flex;align-items:center;gap:4px;flex:none;font-size:12.5px;white-space:nowrap}
.verify-mark.verify-ok,.file-list a .verify-mark.verify-ok svg{color:var(--ok)}
.verify-mark.verify-stale,.file-list a .verify-mark.verify-stale svg{color:var(--warn-ink)}
.search-hit .verify-mark.verify-ok{color:var(--ink-2)}
.search-hit .verify-mark.verify-ok svg{color:var(--ok)}
.verify-panel{padding:6px 10px 4px}
.verify-state{display:flex;align-items:center;gap:8px;margin:0;font-size:13.5px;font-weight:600;color:var(--ink)}
.verify-state svg{flex:none;color:var(--ink-3)}
.verify-state.verify-never{color:var(--ink-2)}
.verify-state.verify-verified svg{color:var(--ok)}
.verify-state.verify-stale{color:var(--warn-ink)}
.verify-state.verify-stale svg{color:var(--warn-ink)}
.verify-details{margin:4px 0 10px 23px;font-size:12.5px;line-height:1.45;color:var(--ink-2)}
.verify-details strong{font-weight:600;color:var(--ink)}
.verify-details time{white-space:nowrap}
/* Panneau assez large pour les deux boutons côte à côte. */
@media(min-width:701px){.doc-menu .menu-panel:has(.verify-panel){width:340px}}
.menu-panel form.verify-form{padding:8px 0 2px;border-top:1px dashed var(--border)}
.verify-form .field{margin-bottom:8px}
.verify-form label{font-size:12px}
.verify-actions{display:flex;flex-wrap:wrap;gap:8px}
.verify-actions .button-primary svg{color:currentColor}
/* Document : contenu dès le haut de la page, sommaire collé à droite (Markdown). */
.workspace main:has(.wiki-wide){max-width:1320px}
.wiki-main.wiki-wide{max-width:none}
.doc-layout.with-toc{display:grid;grid-template-columns:minmax(0,1fr) 232px;gap:44px;align-items:start}
.doc-layout.with-toc .doc-body{max-width:820px}
.markdown :is(h1,h2,h3,h4){scroll-margin-top:calc(var(--topbar-height) + 16px)}
.doc-toc{position:sticky;top:calc(var(--topbar-height) + 28px);max-height:calc(100vh - var(--topbar-height) - 56px);overflow:auto;font-size:13px}
.doc-toc summary{list-style:none;margin:0 0 10px;font-size:12.5px;font-weight:500;color:var(--ink-3)}
.doc-toc summary::-webkit-details-marker{display:none}
.doc-toc ol{list-style:none;margin:0;padding:0;border-left:1px solid var(--border);display:flex;flex-direction:column;gap:1px}
.doc-toc a{display:block;margin-left:-1px;padding:4px 8px 4px 12px;border-left:2px solid transparent;color:var(--ink-2);text-decoration:none;line-height:1.35;overflow-wrap:anywhere}
.doc-toc a:hover{color:var(--ink);text-decoration:none}
.doc-toc a[aria-current]{color:var(--ink);border-left-color:var(--accent);font-weight:500}
.doc-toc .toc-1 a{font-weight:500;color:var(--ink)}
.doc-toc .toc-3 a{padding-left:24px}
.doc-toc .toc-4 a{padding-left:36px;font-size:12.5px}
/* Page HTML (cadre isolé) ou PDF : toute la hauteur disponible. */
/* Page HTML, PDF, image : tout l'espace sous la barre du haut, sans cadre ni marge. */
.doc-frame{display:block;width:100%;height:calc(100vh - var(--topbar-height));height:calc(100dvh - var(--topbar-height));border:0;background:#fff}
.workspace main:has(.full-bleed){max-width:none;padding:0}
.workspace main:has(.full-bleed) .wiki-main{max-width:none}
.workspace main:has(.full-bleed)>.notice,.full-bleed .doc-body>:not(.doc-frame):not(.image-stage){margin:16px 32px}
/* PDF : lien vers le lecteur du navigateur, là où le cadre reste vide (téléphones, tablettes). */
.doc-open{display:none}
@media (max-width:700px),(pointer:coarse){.workspace .full-bleed .doc-body>.doc-open{display:block;margin:12px 16px}}
.image-stage{display:grid;place-items:center;min-height:calc(100dvh - var(--topbar-height));padding:24px;background:var(--bg-2)}
.image-stage .wiki-image{max-width:100%;max-height:calc(100dvh - var(--topbar-height) - 48px);border:0;border-radius:0;background:transparent;object-fit:contain}
@media (max-width:1100px){
  .doc-layout.with-toc{grid-template-columns:minmax(0,1fr);gap:0}
  .doc-toc{position:static;order:-1;max-height:none;margin:0 0 24px;padding:10px 14px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface)}
  .doc-toc summary{cursor:pointer;margin:0;display:flex;justify-content:space-between;align-items:center}
  .doc-toc summary::after{content:"+";font-size:16px;font-weight:400;color:var(--ink-3)}
  .doc-toc[open] summary::after{content:"−"}
  .doc-toc[open] summary{margin-bottom:10px}
}
@media (max-width:720px){
  .topbar-meta{display:none}
  .topbar-doc{margin-left:auto;gap:6px}
  /* Sur petit écran, le badge se réduit à son pictogramme ; le détail est dans le menu ⋮. */
  .verify-badge{width:26px;padding:0;justify-content:center}
  .verify-badge .verify-text{display:none}
}
@media (max-width:560px){
  .topbar-doc > .button:not(.button-primary){display:none}
  .menu-panel .narrow-only{display:flex}
}
/* Pictogrammes des fichiers : une teinte par type, lisible en clair comme en sombre. */
:root{--ft-l:.55}
:root[data-theme=dark]{--ft-l:.74}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--ft-l:.74}}
.icon-ref.ft-md{color:oklch(var(--ft-l) .12 240)}
.icon-ref.ft-html{color:oklch(var(--ft-l) .15 50)}
.icon-ref.ft-pdf{color:oklch(calc(var(--ft-l) - .02) .19 25)}
.icon-ref.ft-image{color:oklch(var(--ft-l) .15 305)}
.icon-ref.ft-doc{color:oklch(calc(var(--ft-l) - .04) .16 265)}
.icon-ref.ft-sheet{color:oklch(var(--ft-l) .14 150)}
.icon-ref.ft-slides{color:oklch(calc(var(--ft-l) + .04) .14 75)}
.icon-ref.ft-code{color:oklch(var(--ft-l) .11 190)}
.icon-ref.ft-archive{color:oklch(var(--ft-l) .07 70)}
.icon-ref.ft-media{color:oklch(var(--ft-l) .16 350)}
.icon-ref.ft-text,.icon-ref.ft-file{color:var(--ink-3)}
/* Accueil et accueil d'un espace : la recherche en tête de page. */
.page-search{position:relative;margin:0 0 28px}
.page-search svg{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:var(--ink-3);pointer-events:none}
.page-search :is(#space-q,#home-q){height:44px;padding-left:40px;font-size:15px;background:var(--surface)}
/* Lien wiki vers une page qui n'existe pas encore : un clic propose de la créer. */
.markdown a.wikilink-missing{color:var(--ink-3);text-decoration:underline dashed;text-underline-offset:3px}
/* Dépôt : bouton en tête de la barre latérale ; fichiers choisis empilés, chacun retirable. */
/* Déposer : une entrée discrète de la navigation, pas un second bouton plein. */
.button.sidebar-deposit{display:flex;justify-content:flex-start;gap:10px;margin:0 12px 10px;height:36px;padding:0 10px;border-color:transparent;background:none;color:var(--ink-2);font-weight:500}
.button.sidebar-deposit:hover{background:var(--hover);color:var(--ink)}
.button.sidebar-deposit[aria-current]{background:var(--surface);box-shadow:0 0 0 1px var(--border);color:var(--ink)}
.file-picker{display:flex;flex-direction:column;align-items:stretch;gap:8px}
.file-picker-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.file-picked{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}
.file-picked li{display:flex;align-items:center;gap:10px;padding:4px 4px 4px 10px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);font-size:13px}
.file-picked-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.file-picked .icon-button{width:26px;height:26px;font-size:16px;line-height:1}
/* Journal du rangement : bandeau quand il échoue, cartes titrées par leur résultat, relances
   regroupées ; sur mobile, au-delà de trois passages, cartes compactes (preferences.js). */
.tabs a .tab-alert{display:inline-block;width:7px;height:7px;margin-left:6px;border-radius:50%;background:var(--danger);flex:none}
.tidy-heading{align-items:flex-start}
.tidy-heading .settings-title{margin-bottom:4px}
.tidy-schedule{display:flex;flex-wrap:wrap;gap:2px 14px;margin:0}
.tidy-run-now{display:flex;flex-direction:column;align-items:flex-end;gap:6px;max-width:340px}
.tidy-run-now form{margin:0}
.tidy-caution{margin:0;font-size:12.5px;color:var(--warn-ink);text-align:right}
.tidy-caution a{color:inherit;text-decoration:underline}
.tidy-alert{gap:8px;padding:14px 16px}
.tidy-alert h3{margin:0;font-size:14.5px;color:var(--danger)}
.tidy-alert-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;margin-top:2px}
.tidy-alert-actions form{margin:0}
.tidy-detail{font-size:12px;color:var(--ink-3);overflow-wrap:anywhere}
.notice .tidy-detail{color:inherit;opacity:.85}
.tidy-journal{gap:12px}
.tidy-journal>.card+.card{margin-top:0}
.tidy-run{padding:16px 20px;display:flex;flex-direction:column;gap:10px}
.tidy-run-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.tidy-run-heading{min-width:0}
.tidy-run-title{display:flex;align-items:center;gap:8px;margin:0;font-size:15px;font-weight:600;overflow-wrap:anywhere}
.tidy-run-title::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--ink-3);flex:none}
.tidy-ok::before{background:var(--ok)}
.tidy-error::before{background:var(--danger)}
.tidy-warn::before{background:var(--warn-ink)}
.tidy-run-meta{margin:2px 0 0 16px}
.tidy-run-body{display:flex;flex-direction:column;gap:10px}
.tidy-run-body>*{margin:0}
.tidy-run-body .notice{margin:0}
.tidy-summary{font-size:13.5px;color:var(--ink-2)}
.tidy-attempts ol{margin:6px 0 0;padding-left:22px;font-size:12.5px;color:var(--ink-2)}
.tidy-ops ul{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:6px;font-size:13px}
.tidy-op{overflow-wrap:anywhere}
.tidy-op-label{font-weight:600;margin-right:4px}
.tidy-op-warn .tidy-op-label{color:var(--warn-ink)}
.tidy-op-pages{display:block;margin-top:2px;padding-left:12px;font-size:12.5px;color:var(--ink-2)}
.tidy-run-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;padding-top:10px;border-top:1px solid var(--border);font-size:12.5px;color:var(--ink-3)}
.tidy-run-foot form{margin:0}
.tidy-pending{border-style:dashed}
.tidy-run-toggle{flex:none}
@media (max-width:560px){
  .tidy-run-now{align-items:stretch;max-width:none;width:100%}
  .tidy-run-now .button{width:100%;justify-content:center}
  .tidy-caution{text-align:left}
  .tidy-run{padding:14px 16px}
  .tidy-journal[data-compact]{gap:8px}
  .tidy-journal[data-compact] .tidy-run{padding:10px 14px;gap:8px}
  .tidy-journal[data-compact] .tidy-run-title{font-size:14px}
}
/* Recherche : un seul extrait par résultat, en police de texte, sans syntaxe Markdown ; le
   lien « § section » mène à l'endroit trouvé. */
.search-excerpt{margin:8px 0 0;font-size:13.5px;line-height:1.55;color:var(--ink-2);overflow-wrap:anywhere}
.search-excerpt p{margin:0}
.search-excerpt .search-gap{display:block;color:var(--ink-3);line-height:1.2}
.search-hit .search-section{color:inherit;text-decoration:underline;text-decoration-color:var(--border);text-underline-offset:2px}

/* ========== Lot G4b : trouver depuis partout, inbox visible, clavier et mobile ==========
   Loupe et palette de recherche, ligne « Inbox · N », accueil « En attente / Modifié
   récemment », note qui vient d'arriver, jeton créé, identifiants sans capitales. */
.eyebrow .ident{text-transform:none;letter-spacing:0}
/* Croix d'effacement des champs de recherche, dans la palette de couleurs (la native est bleue). */
input[type=search]::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none;width:16px;height:16px;margin-left:6px;background:var(--ink-3);cursor:pointer;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center/14px no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center/14px no-repeat}
input[type=search]::-webkit-search-cancel-button:hover{background:var(--ink)}

/* Loupe de la barre du haut (toutes les pages). */
.topbar-search{display:inline-flex;align-items:center;gap:8px;flex:none;height:32px;margin-left:8px;padding:0 6px 0 10px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);color:var(--ink-3);font-size:13px;text-decoration:none;white-space:nowrap}
.topbar-search:hover{border-color:var(--ink-3);color:var(--ink);text-decoration:none}
.topbar-search kbd{font-size:11px}
.workspace-topbar:not(:has(.topbar-doc)) .topbar-search{margin-left:auto}
@media (max-width:1100px){
  .workspace-topbar:has(.topbar-doc) .topbar-search :is(.topbar-search-label,kbd){display:none}
  .workspace-topbar:has(.topbar-doc) .topbar-search{width:32px;padding:0;justify-content:center}
}
/* Mobile : la loupe seule, à côté du bouton du tiroir. */
@media (max-width:720px){
  #sidebar-toggle{order:-2}
  .topbar-search{order:-1;width:36px;height:36px;margin:0;padding:0;justify-content:center;border-color:transparent;background:none}
  .topbar-search :is(.topbar-search-label,kbd){display:none}
  .workspace-topbar:not(:has(.topbar-doc)) .topbar-search{margin-left:0}
}

/* Palette (dialogue modal) : champ, portée, titres trouvés. */
.palette{width:min(640px,calc(100vw - 24px));max-height:min(560px,calc(100dvh - 48px));margin:min(12vh,96px) auto auto;padding:0;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface);color:var(--ink);box-shadow:var(--shadow);overflow:hidden}
.palette[open]{display:flex;flex-direction:column}
.palette::backdrop{background:oklch(0.15 0.01 60 / 0.45)}
.palette-form{display:flex;flex-direction:column;flex:1;min-height:0}
.palette-field{display:flex;align-items:center;gap:10px;padding:0 8px 0 16px;border-bottom:1px solid var(--border);color:var(--ink-3)}
.palette #palette-q{flex:1;min-width:0;height:56px;min-height:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;font-size:16px;color:var(--ink)}
.palette #palette-q:focus-visible{box-shadow:none}
.palette #palette-q::-webkit-search-cancel-button{display:none}  /* la croix « Fermer » suffit */
.palette-field:focus-within{box-shadow:inset 0 -2px 0 var(--accent)}
.palette-close{width:36px;height:36px}
.palette-scope{display:flex;flex-wrap:wrap;gap:6px;margin:0;padding:10px 16px 0}
.palette-scope label{position:relative;display:inline-flex;align-items:center;cursor:pointer}
.palette-scope input{position:absolute;opacity:0;width:1px;height:1px}
.palette-scope span{display:inline-flex;align-items:center;height:30px;padding:0 12px;border:1px solid var(--border);border-radius:999px;color:var(--ink-2);font-size:12.5px;font-weight:500;max-width:60vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.palette-scope label:hover span{border-color:var(--ink-3);color:var(--ink)}
.palette-scope input:checked+span{background:var(--accent-soft);border-color:var(--accent);color:var(--ink)}
.palette-scope input:focus-visible+span{outline:2px solid var(--accent);outline-offset:2px}
.palette-results{list-style:none;margin:0;padding:8px;overflow:auto;flex:1;min-height:0}
.palette-results a{display:flex;flex-direction:column;gap:2px;padding:8px 12px;border-radius:var(--radius);color:var(--ink);text-decoration:none}
.palette-results [aria-selected=true] a{background:var(--hover)}
.palette-title{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.palette-where{font-size:12px;color:var(--ink-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.palette-status{margin:0;padding:8px 16px;font-size:12.5px;color:var(--ink-3)}
.palette-status:empty{display:none}
.palette-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:10px 16px;border-top:1px solid var(--border);background:var(--bg-2)}
.palette-keys{font-size:12px;color:var(--ink-3)}
.palette-keys kbd{margin-right:2px}
@media (max-width:720px){.palette{margin-top:12px;max-height:calc(100dvh - 24px)}.palette-keys{display:none}}

/* Barre de gauche : ligne « Inbox · N » sous l'espace courant ; la roue mène aux paramètres. */
.sidebar-inbox{display:flex;align-items:center;gap:8px;height:30px;margin:-4px 0 2px 14px;padding:0 8px;border-radius:var(--radius);color:var(--ink-2);font-size:13px;text-decoration:none}
.sidebar-inbox:hover{background:var(--hover);color:var(--ink);text-decoration:none}
.sidebar-inbox[aria-current]{background:var(--surface);box-shadow:0 0 0 1px var(--border);color:var(--ink);font-weight:500}
.sidebar-count{flex:none;min-width:22px;height:20px;padding:0 6px;border-radius:999px;background:var(--surface);border:1px solid var(--border);color:var(--ink);font-size:11.5px;font-weight:600;line-height:18px;text-align:center;font-variant-numeric:tabular-nums}
.sidebar-dot{flex:none;display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--warn-ink)}

/* Accueil : ce qui attend, ce qui vient de changer. */
.home-columns{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr));gap:16px;align-items:start;margin:0 0 36px}
.home-columns>.card{margin:0}
.home-panel{padding:18px 20px}
.home-item-title .status{font-size:inherit;color:var(--ink);font-weight:500}
.home-panel>h2{font-size:15px;margin-bottom:10px}
.home-list{list-style:none;margin:0 -8px;padding:0;display:flex;flex-direction:column;gap:2px}
.home-item{display:flex;align-items:center;gap:10px;min-width:0}
.home-item>a{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0;padding:8px;border-radius:var(--radius);color:var(--ink);text-decoration:none}
.home-item>a:hover{background:var(--hover);text-decoration:none}
.home-item-title{display:flex;align-items:center;gap:8px;min-width:0;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.home-item-title>span:last-child{overflow:hidden;text-overflow:ellipsis}
.home-item-meta{font-size:12.5px;color:var(--ink-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.home-left{color:var(--warn-ink);font-weight:500}
.home-count{flex:none;min-width:28px;height:24px;margin-right:8px;padding:0 8px;border-radius:999px;background:var(--accent-soft);color:var(--ink);font-size:12.5px;font-weight:600;line-height:24px;text-align:center;font-variant-numeric:tabular-nums}
.home-empty{margin:0;color:var(--ink-3);font-size:13px}
.home-more{padding:4px 8px;color:var(--ink-3);font-size:12.5px}
.home-deposit{display:none}
@media (max-width:900px){.home-deposit{display:inline-flex}}
.space-card .card-copy-empty{color:var(--ink-3);font-style:italic}
.space-card .card-meta{align-items:center;justify-content:space-between;flex-wrap:wrap}
.space-card .card-inbox{display:inline-flex;align-items:center;gap:6px;font-family:var(--font-body);font-weight:500}
.space-card .card-meta .status{font-family:var(--font-body)}

/* Inbox : la note qui vient d'arriver, en tête et surlignée. */
.file-list li.is-new{background:var(--accent-soft)}
.file-list li .badge{flex:none}

/* Jeton tout juste créé : en tête de la page. */
.token-revealed{margin-bottom:20px;border-color:var(--accent)}
.token-revealed .notice{margin:0 0 12px}

/* Arborescence au doigt : cibles d'au moins 32 px. */
@media (pointer:coarse){
  .tree-toggle,.tree-spacer{width:32px;height:32px}
  .space-tree-entry{height:32px}
}

/* ---------- Administration (super-admin) et pages publiques du compte ----------
   Règles propres à /admin, à la page d'erreur et aux cartes publiques (invitation,
   réinitialisation) ; les composants communs restent ceux du reste de l'interface. */
.admin-body>section+form,.admin-body>section+section{margin-top:32px}
.admin-count{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:22px;margin-left:6px;padding:0 7px;border-radius:999px;background:var(--bg-2);border:1px solid var(--border);color:var(--ink-2);font-size:12px;font-weight:600;letter-spacing:0;vertical-align:3px;font-variant-numeric:tabular-nums}
.admin-intro{margin:0 0 16px;max-width:62ch}
.section-heading+.admin-intro{margin-top:-6px}
.admin-row-title{display:block;font-weight:600;color:var(--ink);overflow-wrap:anywhere}
a.admin-row-title:hover{text-decoration:underline}
.admin-row-meta{display:block;margin:2px 0 0;font-size:12.5px;color:var(--ink-3);overflow-wrap:anywhere}
.admin-row-meta code{font-size:12px}
/* Listes et tableau dans une carte sans marge intérieure : lignes pleine largeur. */
.admin-list{list-style:none;margin:0;padding:0}
.admin-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 20px;border-top:1px solid var(--border)}
.admin-row:first-child{border-top:0}
.admin-row-main{min-width:0}
.admin-row .button{flex:none}
.admin-table-card{padding:0;overflow:hidden}
.admin-accounts{width:100%;border-collapse:collapse;font-size:13.5px}
.admin-accounts th{padding:10px 20px;text-align:left;font-size:12px;font-weight:600;color:var(--ink-3);background:var(--bg-2);border-bottom:1px solid var(--border)}
.admin-accounts td{padding:12px 20px;vertical-align:middle;border-top:1px solid var(--border)}
.admin-accounts tbody tr:first-child td{border-top:0}
.admin-accounts .admin-rights{white-space:nowrap}
.admin-accounts .admin-rights .badge+.badge{margin-left:6px}
.admin-accounts .admin-auth{color:var(--ink-2);white-space:nowrap}
.admin-accounts .admin-action{width:1%;text-align:right;white-space:nowrap}
.admin-accounts tr.is-inactive .admin-row-title{color:var(--ink-3)}
/* Case à cocher hors liste de choix : alignée sur les champs, aide sous le libellé. */
.admin-check{margin:0 0 18px}
.admin-check .checkbox,.admin-options .checkbox{padding:6px 0}
.admin-check .muted{margin:0 0 0 26px}
.admin-options{margin:0 0 18px}
.admin-options legend{margin-bottom:4px}
/* Fiche d'un compte. */
.admin-back{margin:0 0 14px;font-size:13px}
.admin-identity-head{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.admin-identity-head .avatar{width:40px;height:40px;font-size:16px}
.admin-identity-head h2{font-size:18px;margin:0}
.admin-identity-head .admin-row-meta{margin:0}
.admin-identity-head .badges{margin-left:auto}
.admin-body>.notice{margin:14px 0 0}
/* Carte d'action (désactiver) : texte à gauche, bouton à droite, empilés sur mobile. */
.admin-state{display:flex;align-items:center;justify-content:space-between;gap:12px 20px;flex-wrap:wrap}
.admin-state>div{flex:1 1 300px;min-width:0}
.admin-state h3{margin:0 0 4px}
.admin-state form{margin:0}
/* E-mail : port étroit à côté du serveur ; test d'envoi, champ et bouton sur une ligne. */
.admin-columns-port{display:grid;grid-template-columns:minmax(0,1fr) 112px;gap:0 18px}
.admin-columns-port>.field{min-width:0}
.admin-inline{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap}
.admin-inline .field{flex:1 1 220px;margin:0}
.admin-inline .button{flex:none}
/* SSO : adresse de retour en bloc copiable, état vide discret. */
.admin-callback{display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--ink-2)}
.admin-callback .copyable-block{justify-content:space-between}
.admin-empty{padding:24px 20px}
/* Cartes empilées : l'écart de `.stack` seul (sans la marge de `.card+.card`). */
.admin-body .stack>.card{margin-top:0}
/* Page d'erreur : même mise en page que les autres cartes publiques. */
.public-card-layout .error-card{width:min(560px,100%);margin:0}
.error-card .actions{margin-top:20px}
.error-card .actions .button{margin-top:0}
.login-card .notice+.button{margin-top:4px}
/* Connexion avec boutons SSO : `.card>form{margin:0}` collait le choix de langue au dernier. */
.login-card>.language-form{margin-top:20px}
@media(max-width:700px){
  .admin-row{padding:12px 16px}
  /* Tableau des comptes en fiches : nom et bouton sur la première ligne, droits dessous. */
  .admin-accounts thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
  .admin-accounts tr{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px 12px;padding:12px 16px;border-top:1px solid var(--border)}
  .admin-accounts tbody tr:first-child{border-top:0}
  .admin-accounts td{display:block;padding:0;border:0}
  .admin-accounts .admin-account{grid-column:1;grid-row:1}
  .admin-accounts .admin-action{grid-column:2;grid-row:1;width:auto}
  .admin-accounts .admin-rights,.admin-accounts .admin-auth{grid-column:1/-1;display:inline-flex;align-items:center;gap:6px;font-size:12.5px}
  .admin-accounts .admin-rights:empty{display:none}
  .admin-columns-port{grid-template-columns:minmax(0,1fr) 96px}
  .admin-identity-head .badges{margin-left:0;width:100%}
  .admin-state .button,.admin-state form,.admin-inline .button{width:100%}
}

/* ========== Mon compte : profil, sécurité, assistants IA, consentement OAuth ==========
   Règles propres à ces pages (classes account-* et consent-*) ; les composants communs
   (cartes, tableaux, étapes, champs) restent réglés plus haut. */
.account-body .card>h2{margin-bottom:16px}
.account-body .card>h2+p.muted{margin-top:-8px;margin-bottom:14px}
.account-body .stack>.card{margin-top:0}
/* Titre de section hors carte, avec son introduction : détaché de ce qui suit. */
.account-section>h2{margin-bottom:6px}
.account-section>h2+:not(p){margin-top:14px}
.account-section>p.muted{margin:0 0 14px}
.account-section .empty{padding:16px 18px;text-align:left}
.account-notice{margin:16px 0 0}
.account-body .card>.notice.account-notice:not(:last-child){margin-bottom:16px}
.account-note{margin:14px 0 0}
/* Profil : état de l'adresse sous le champ, renvoi du lien dans la même ligne. */
.account-email-state{display:flex;flex-direction:column;gap:2px;margin:0;font-size:12.5px}
.account-email-state p{margin:0}
.account-email-state .button-link{height:auto;padding:0;font-size:12.5px;vertical-align:baseline}
.account-checkbox{padding:6px 0;margin:0 0 14px}
/* Préférences : une ligne par réglage, sa portée sous le libellé, le contrôle à droite. */
.account-pref{display:flex;align-items:center;justify-content:space-between;gap:12px 24px;flex-wrap:wrap;margin:0;padding:14px 0;border-top:1px solid var(--border)}
.account-preferences>h2+.account-pref{border-top:0;padding-top:0}
.account-preferences .account-pref:last-child{padding-bottom:0}
.account-pref-text{flex:1 1 220px;min-width:0}
.account-pref-text label,.account-pref-text .field-label{display:block;font-size:13.5px;font-weight:500;color:var(--ink)}
.account-pref-text .muted{margin:2px 0 0}
.account-pref-control{display:flex;align-items:center;gap:8px;flex:none;max-width:100%}
.account-pref-control select{width:auto;min-width:150px;min-height:38px}
.account-note-warn{margin:0 0 6px}
.account-note-warn .status{align-items:baseline}
.account-note-warn .status::before{transform:translateY(-1px)}
.account-pref-control .segmented-labels{flex-wrap:wrap}
/* Sécurité : conséquence du changement juste avant le bouton ; mot de passe imposé. */
.account-consequence{margin:-4px 0 16px}
.account-forced{margin:0 auto;padding-top:8px}
.account-forced .page-heading{margin-bottom:24px}
.account-forced-logout{display:flex;align-items:center;flex-wrap:wrap;gap:4px 8px;margin-top:16px;font-size:13px}
.account-forced-logout .button-link{font-size:13px}
.account-link-sso{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:4px}
.account-link-sso form{margin:0}
/* Assistants : adresse copiable sur toute la largeur, guides avec le chevron de l'arbre. */
.account-address{margin:0 0 18px}
.account-address .field-label{margin:0 0 6px}
/* Court (adresse) : « Copier » à droite ; long (commande, sur mobile) : en dessous. */
.account-body .copyable-block{flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:8px 12px}
.account-body .copyable-block code{flex:1 1 240px;min-width:0;padding-top:5px;font-size:12.5px}
.account-body .copyable-block .button{flex:none}
.account-address .copyable-block{flex-wrap:nowrap}
.account-guides{border-top:1px solid var(--border)}
.account-guides details.help{margin:0;border-bottom:1px solid var(--border)}
.account-guides details.help:last-child{border-bottom:0}
.account-guides details.help:last-child>:not(summary){margin-bottom:4px}
.account-guides details.help>summary{display:flex;align-items:center;gap:6px;min-height:40px;padding:4px 0;list-style:none;font-size:13.5px;color:var(--ink)}
.account-guides details.help>summary::-webkit-details-marker{display:none}
.account-guides details.help>summary::before{content:"";flex:none;width:20px;height:20px;background:var(--ink-3);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center/12px no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center/12px no-repeat;transition:transform .15s}
.account-guides details.help[open]>summary::before{transform:rotate(90deg)}
.account-guides details.help>summary:hover{color:var(--accent)}
.account-guides details.help>:not(summary){margin:0 0 14px 26px}
/* Test de connexion : tableau calé sur le texte de la carte, nombres à droite. */
.account-calls{margin-top:14px}
.account-calls :is(th,td):first-child{padding-left:0}
.account-calls :is(th,td):last-child{padding-right:0}
.account-calls tbody tr:last-child td{border-bottom:0}
.account-calls .account-num{text-align:right;font-variant-numeric:tabular-nums}
.account-calls .account-when{white-space:nowrap}
.account-calls td .account-client{display:block;color:var(--ink);font-weight:500;overflow-wrap:anywhere}
.account-calls td .muted{display:block;font-size:12px}
.token-card .account-app-note{margin:-4px 0 0;font-size:12px;color:var(--ink-3)}
.account-new-token{margin-top:20px}
/* Jeton créé : le secret puis la commande, chacun avec « Copier » à droite. */
.token-revealed>h2{margin-bottom:12px}
.token-revealed .notice .copyable{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:8px 12px;width:100%}
.token-revealed .notice .copyable code{flex:1 1 240px;min-width:0;padding-top:5px}
.token-revealed>p.muted{margin:0 0 6px}

/* Consentement OAuth : carte centrée, application et retour en évidence, décision en pied. */
.consent-card{margin:8px auto 0}
.consent-card h1{font-size:26px;margin:0 0 16px;text-wrap:balance}
.consent-client{margin:0 0 16px;padding:12px 14px;border-radius:var(--radius);background:var(--bg-2)}
.consent-client dd strong{color:var(--ink);font-weight:600}
.consent-account{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 12px;margin:0 0 18px;padding:10px 0;border-block:1px solid var(--border)}
.consent-account .muted{font-size:13px}
.consent-card ul{margin:0 0 12px}
.consent-card form>.form-columns{margin-top:18px}
.consent-actions{margin-top:4px;padding-top:18px;border-top:1px solid var(--border)}
/* Message d'arrivée (« Bienvenue ! … ») aligné sur la colonne de la page, pas sur sa largeur. */
.public-page main:has(.account-forced,.consent-card)>.notice[data-flash]{max-width:640px;margin-inline:auto}
@media(max-width:700px){
  .consent-card h1,.account-forced h1{font-size:24px}
  .account-pref-control,.account-pref-control select{flex:1 1 auto}
}

/* ========== Pages d'espace : inbox, rangement, activité, santé, paramètres ==========
   Règles propres à ces pages ; les composants communs (cartes, tableaux, champs) sont plus
   haut. */
/* Inbox : le titre et « Ranger maintenant » sur une ligne ; filtre d'une seule hauteur. */
.inbox-heading{align-items:center;margin-bottom:16px}
.inbox-heading .settings-title{margin:0}
.inbox-heading form{margin:0}
/* (sélecteur aussi précis que la règle générale des champs, qu'il doit surcharger) */
.inbox-filter :is(input[type=search]:not([type=hidden]):not([type=checkbox]):not([type=radio]),select){min-height:36px;height:36px;font-size:13.5px}
.inbox-filter .button{height:36px}
/* Liste de l'inbox : la date se range sous le titre plutôt que de se couper. */
.inbox-list li{flex-wrap:wrap;row-gap:2px}
.inbox-list li>a{min-width:0}
.inbox-list li>.muted{margin-left:auto;white-space:nowrap}
/* Fiche d'une note : le contenu dans une carte, sous les actions. */
.inbox-note{padding:20px 24px}
.inbox-note .markdown{max-width:none}
/* Santé : tableaux alignés sur le titre de leur carte, bouton « Modifier » calé à droite. */
.health-table td{vertical-align:middle}
.health-table :is(th,td):first-child{padding-left:0}
.health-table :is(th,td):last-child{padding-right:0}
.health-table .row-action{width:1%;text-align:right;white-space:nowrap}
.health-table tbody tr:last-child td{border-bottom:0}
.health-table .cell-date{width:1%;white-space:nowrap}
.health-table td:first-child a{overflow-wrap:anywhere}
/* Dépôt Git : adresse large, branche étroite ; champs courts ; clés en police à chasse fixe. */
.repo-columns{grid-template-columns:minmax(0,1fr) 180px}
.field-short>input{max-width:240px}
.mono-field{font-family:var(--font-mono);font-size:12.5px}
.webhook-meta{align-items:baseline}
.git-scan{flex-direction:column;align-items:flex-start;gap:6px}
.git-scan+form{margin-top:22px}
/* Réglages du rangement : un groupe par déclenchement, séparés d'un filet. */
.settings-group{margin:20px 0 0;padding:18px 0 0;border:0;border-top:1px solid var(--border)}
.settings-group>legend{float:left;width:100%;padding:0;margin:0 0 4px;font-size:14px;font-weight:600;color:var(--ink)}
.settings-group>legend+*{clear:both}
@media(min-width:701px){.settings-group>.form-columns:last-child>.field{margin-bottom:0}}
.settings-group+.button{margin-top:22px}
/* Cases isolées (hors liste de choix) : alignées sur les champs, sans retrait. */
.semantic-form>.checkbox{padding-left:0;padding-right:0}
.tidy-settings-form .settings-group>.checkbox{padding:6px 0 12px}
/* Vocation et consignes : deux encarts qui disent la différence, puis un éditeur par fichier. */
.vocation-page{max-width:820px}
.vocation-intro{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-bottom:16px}
.vocation-explain{display:flex;flex-direction:column;gap:6px;padding:16px 18px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--bg-2);color:var(--ink-2);font-size:13.5px;text-decoration:none}
.vocation-explain:hover{border-color:var(--ink-3);text-decoration:none}
.vocation-explain>*{margin:0}
.vocation-explain .eyebrow{margin:0}
.vocation-explain-title{font-size:16px;font-weight:600;color:var(--ink)}
.vocation-explain code{margin-top:auto;padding-top:4px;font-size:12px;color:var(--ink-3)}
.vocation-git{margin:0 0 16px}
.vocation-page>.notice{margin:0 0 16px}
.vocation-card{scroll-margin-top:calc(var(--topbar-height) + 16px)}
.vocation-card+.vocation-card{margin-top:20px}
.vocation-template{margin:16px 0 4px;padding:14px 16px;border:1px dashed var(--border);border-radius:var(--radius)}
.vocation-template .field{margin:0}
.vocation-template-row{display:flex;gap:8px}
.vocation-template-row select{flex:1 1 auto;min-width:0}
.vocation-template-row .button{flex:0 0 auto;height:40px}
.vocation-form{margin-top:16px}
.vocation-editor{min-height:0}
.vocation-preview{margin-top:20px;padding:18px 20px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg)}
.vocation-preview .markdown{font-size:14px}
.vocation-preview .markdown h1{font-size:22px}
.vocation-preview .markdown h2{font-size:17px;margin-top:20px}
.vocation-history{margin-top:22px}
.vocation-history .section-label{margin-bottom:4px}
.vocation-history .history-list li{padding:8px 0}
.vocation-history .history-list li:last-child{border-bottom:0}
@media(max-width:700px){
  .vocation-intro{grid-template-columns:minmax(0,1fr)}
  .vocation-template-row{flex-direction:column}
}
@media(max-width:700px){
  .repo-columns{grid-template-columns:minmax(0,1fr)}
}
/* Dépôt Git : synchro demandée, en cours ou prochain essai, sous l'état. */
.git-state .sync-activity{display:flex;align-items:baseline;margin:12px 0 0;font-size:13px;color:var(--ink-2)}
.git-state .sync-activity::before{flex:none;transform:translateY(-1px)}
@media(max-width:560px){
  .inbox-list li{flex-direction:column;align-items:flex-start}
  .inbox-list li>.muted{margin-left:24px}
  .inbox-note{padding:16px}
  .git-state .metadata{grid-template-columns:minmax(0,1fr);gap:2px}
  .git-state .metadata dd{margin-bottom:8px}
}

/* ---------- Routines d'agent (paramètres de l'espace) ---------- */
.routines-intro{margin:0 0 16px;max-width:680px}
.routine-list{gap:12px}
.routine-card{padding:18px 22px;display:flex;flex-direction:column;gap:10px}
.routine-card>*{margin:0}
.routine-off{background:var(--bg)}
.routine-off .routine-heading h3 a{color:var(--ink-2)}
.routine-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.routine-heading{min-width:0}
.routine-heading h3{margin:0;font-size:15.5px;overflow-wrap:anywhere}
.routine-heading h3 a{color:inherit}
.routine-meta{display:flex;flex-wrap:wrap;gap:2px 14px;margin:2px 0 0}
.routine-outputs{list-style:none;display:flex;flex-wrap:wrap;gap:6px;margin:0;padding:0}
.routine-outputs code{font-size:11.5px}
.routine-state{font-size:12.5px;display:flex;flex-wrap:wrap;align-items:center;gap:4px 14px}
.routine-summary{font-size:13.5px;color:var(--ink-2)}
.routine-add{margin-top:36px;padding-top:24px;border-top:1px solid var(--border)}
.routine-add>h3{margin:0 0 14px;font-size:16px}
.routine-templates{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr));gap:14px}
.routine-templates>.card+.card{margin-top:0}
.routine-template{display:flex;flex-direction:column;gap:8px;padding:18px 20px}
.routine-template>*{margin:0}
.routine-template h4{font-size:14.5px;margin:0}
.routine-template .actions{margin-top:auto;padding-top:6px}
.routine-template-plan{font-size:12.5px;color:var(--ink-2);font-weight:500}
.routine-template-blank{border-style:dashed;background:transparent}
.routine-back{margin:0 0 12px;font-size:13px}
.routine-back a{display:inline-flex;align-items:center;gap:4px;color:var(--ink-2)}
.routine-title{align-items:flex-start;margin-bottom:10px}
.routine-title h3{margin:0;font-size:18px;overflow-wrap:anywhere}
.routine-actions{margin-bottom:18px}
.routine-instructions pre,.routine-report pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12.5px;line-height:1.55;color:var(--ink-2);margin:8px 0 0;padding:12px 14px;background:var(--bg);border:1px solid var(--border);border-radius:var(--radius);max-height:420px;overflow:auto}
.routine-journal-title{margin:28px 0 12px;font-size:16px}
.routine-produced{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px;font-size:13px;overflow-wrap:anywhere}
.routine-plan{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr));gap:0 14px}
.routine-form:has(#routine-frequency option[value=daily]:checked) :is(.routine-weekday,.routine-monthday){display:none}
.routine-form:has(#routine-frequency option[value=weekly]:checked) .routine-monthday{display:none}
.routine-form:has(#routine-frequency option[value=monthly]:checked) .routine-weekday{display:none}
.routine-form>h3{margin-bottom:16px}
.routine-form #routine-instructions{line-height:1.55}
.routine-form .settings-group .checkbox+.checkbox,.routine-form .settings-group .field+.checkbox,.routine-form .settings-group .checkbox+.field{margin-top:12px}
.routine-form-actions{margin-top:22px}
@media(max-width:700px){
  .routine-card{padding:14px 16px}
  .routine-head{flex-wrap:wrap}
}
.routine-outputs a{color:inherit}

/* ---------- Voir aussi : pages proches, sous « Pages qui pointent ici » (veille V2) ---------- */
.related-list{list-style:none;margin:0;padding:0;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface)}
.related-item{display:flex;align-items:center;justify-content:space-between;gap:6px 16px;padding:9px 14px;border-top:1px solid var(--border)}
.related-item:first-child{border-top:0}
.related-main{min-width:0;flex:1 1 auto}
.related-link{display:flex;align-items:center;gap:8px;color:var(--ink);font-weight:500;min-width:0}
.related-link svg{flex:none;color:var(--ink-3)}
.related-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.related-meta{display:flex;flex-wrap:wrap;gap:2px 8px;margin:2px 0 0 23px;font-size:12.5px;color:var(--ink-3);min-width:0}
.related-reason{color:var(--ink-2)}
.related-path{overflow-wrap:anywhere}
.related-side{display:flex;align-items:center;gap:10px;flex:none}
.related-propose{margin:0}
.related-propose .button-link{padding:0;color:var(--ink-2);font-size:12.5px;font-weight:500}
.related-propose .button-link:hover{color:var(--accent)}
@media(min-width:561px){.related-path::before{content:"·";margin-right:8px;color:var(--ink-3)}}
.related-proposed{font-size:12.5px;color:var(--ink-3)}
@media (pointer:coarse){.related-propose .button-link{min-height:32px}}
@media(max-width:560px){
  .related-item{flex-wrap:wrap;align-items:flex-start}
  .related-title{white-space:normal}
  .related-side{margin-left:23px}
}
