/* Interface v0.2 — reprise de l'assistant de Maëlle (3 panneaux sur ordinateur, onglets sur téléphone).
   AUCUNE couleur ici : uniquement les variables --pc-* de marque.css (vérifié par les tests). */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.bureau-seulement { display: none; }
html, body { height: 100%; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
body { margin: 0; display: grid; grid-template-rows: auto 1fr; overflow: hidden; color: var(--pc-encre); background: var(--pc-fond);
  font: 14.5px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--pc-accent); }
svg.i { display: block; flex: 0 0 auto; }
button, a, #hlist div { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:is(a, button):focus-visible { outline: 2px solid var(--pc-accent); outline-offset: -2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- boutons ---------- */
.btn { background: var(--pc-panneau); border: 1px solid var(--pc-ligne); border-radius: 9px; padding: 6px 11px; cursor: pointer; color: var(--pc-encre);
  font-size: 13px; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--pc-panneau-2); border-color: var(--pc-accent-bord); }
.btn.ib { padding: 0; width: 32px; height: 32px; justify-content: center; }
.btn.on, .btn.primary { background: var(--pc-accent-fond); border-color: var(--pc-accent-bord); color: var(--pc-accent); }
.btn.plein { background: var(--pc-accent); border-color: var(--pc-accent); color: var(--pc-sur-accent); font-weight: 600; }
.btn.plein:hover { background: var(--pc-accent-fort); }
.btn.danger { color: var(--pc-danger); } .btn.danger:hover { background: var(--pc-danger-fond); }
.btn:disabled { opacity: .5; cursor: default; }
.btn:active, .card:active, .node:active, .sugg button:active, .chips button:active { filter: brightness(.95); transform: scale(.985); }
input, select, textarea { border: 1px solid var(--pc-ligne); background: var(--pc-panneau); border-radius: 9px; padding: 8px 10px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pc-accent-bord); box-shadow: var(--pc-anneau); }
:is(#q, #inp)::placeholder { color: var(--pc-doux); opacity: 1; }

/* ---------- en-tête ---------- */
header { display: flex; align-items: center; gap: 14px; padding: 8px 16px; background: var(--pc-panneau); box-shadow: 0 1px 0 var(--pc-ligne); position: relative; z-index: 3; }
header .sp { flex: 1; }
.brand { display: flex; gap: 11px; align-items: center; min-width: 0; text-decoration: none; color: inherit; cursor: pointer; }
.logo { display: block; width: 32px; height: 32px; flex: 0 0 32px; }
header h1 { font-size: 15px; margin: 0; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; }
header .sub { color: var(--pc-doux); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg { display: inline-flex; background: var(--pc-creux); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 8px; padding: 5px 12px; color: var(--pc-doux); font-size: 13px; cursor: pointer; }
.seg button.on { background: var(--pc-panneau); color: var(--pc-encre); box-shadow: var(--pc-ombre); font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; background: var(--pc-creux); border-radius: 20px; padding: 3px 10px 3px 3px; white-space: nowrap; }
.pill i { width: 22px; height: 22px; border-radius: 50%; background: var(--pc-accent-fond); color: var(--pc-accent); display: grid; place-items: center;
  font-style: normal; font-weight: 700; font-size: 11px; }
.pill:empty { display: none; }
.badge-demo { font-size: 10.5px; font-weight: 600; color: var(--pc-alerte); background: var(--pc-alerte-fond); border-radius: 10px; padding: 1px 7px;
  border: 0; cursor: pointer; letter-spacing: .02em; }

/* ---------- disposition : arbre | poignée | visionneuse | poignée | conversation ---------- */
main { display: grid; grid-template-columns: var(--w-arbre, 290px) 5px minmax(0, 1fr) 5px var(--w-chat, 460px); min-height: 0; }
.split { cursor: col-resize; position: relative; z-index: 2; }
.split:hover, .split.drag { background: var(--pc-accent-bord); }
body.glisse { user-select: none; cursor: col-resize; } body.glisse iframe { pointer-events: none; }
#tree { grid-column: 1; } #s1 { grid-column: 2; } #viewer { grid-column: 3; } #s2 { grid-column: 4; } #chat { grid-column: 5; }
body.mode-docs #chat, body.mode-docs #s2 { display: none; } body.mode-docs #viewer { grid-column: 3 / -1; }
body.mode-chat #tree, body.mode-chat #viewer, body.mode-chat .split { display: none; } body.mode-chat #chat { grid-column: 1 / -1; border-left: 0; }
body.sansarbre #tree, body.sansarbre #s1 { display: none; } body.sansarbre #viewer { grid-column: 1 / 4; } body.sansarbre.mode-docs #viewer { grid-column: 1 / -1; }

/* ---------- arbre ---------- */
#tree { background: var(--pc-panneau-2); border-right: 1px solid var(--pc-ligne); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.qwrap { position: relative; margin: 12px 12px 8px; } .qwrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--pc-pale); }
.qwrap input { width: 100%; padding: 8px 10px 8px 32px; }
.arbre-actions { display: flex; gap: 6px; margin: 0 12px 8px; } .arbre-actions .btn { flex: 1; justify-content: center; }
#files { overflow: auto; padding: 0 6px 24px; font-size: 13.4px; overscroll-behavior: contain; flex: 1; }
.node { padding: 4px 8px; border-radius: 7px; white-space: nowrap; display: flex; align-items: center; gap: 2px; }
a.node { color: inherit; text-decoration: none; }
.dir > .node { padding: 0; }
.node [data-tog] { display: flex; align-items: center; gap: 2px; padding: 4px 8px; flex: 1; min-width: 0; border: 0; border-radius: inherit; background: none; cursor: pointer; text-align: left; }
.node:hover { background: var(--pc-creux); } .node.sel { background: var(--pc-accent-fond); color: var(--pc-accent); font-weight: 600; }
.node .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.node .nact { border: 0; background: transparent; color: var(--pc-doux); padding: 0 8px; border-radius: 6px; cursor: pointer; font-size: 15px; line-height: 1; align-self: stretch; }
.dir > .node { font-weight: 600; } .kids { padding-left: 13px; border-left: 1px solid var(--pc-ligne-2); margin-left: 9px; }
.closed > .kids { display: none; } .ic { display: inline-block; width: 19px; color: var(--pc-pale); flex: 0 0 19px; text-align: center; }
.dir > .node .ic::before { content: "▾"; } .dir.closed > .node .ic::before { content: "▸"; }
.cnt { color: var(--pc-pale); font-weight: 400; font-size: 11.5px; margin-left: 4px; }
.fav { background: var(--pc-panneau); border: 1px solid var(--pc-ligne); box-shadow: var(--pc-ombre); border-radius: 10px; margin: 4px 6px 12px; padding: 8px 6px; }
.fav h3 { margin: 0; padding: 0 8px 2px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--pc-doux); }
#search-res { padding: 4px 8px 8px; border-bottom: 1px solid var(--pc-ligne); background: var(--pc-panneau); max-height: 45vh; overflow: auto; }
.sr { display: block; color: inherit; text-decoration: none; padding: 8px; border-radius: 8px; border-bottom: 1px solid var(--pc-ligne-2); } .sr:hover { background: var(--pc-creux); }
.sr b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr small { color: var(--pc-doux); font-size: 12px; display: block; margin-top: 2px; } .sr mark { background: var(--pc-surlignage); color: inherit; border-radius: 2px; }
.sr-h { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--pc-doux); padding: 6px 8px 2px; }

/* ---------- visionneuse ---------- */
#viewer { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
#vhead { padding: 8px 14px; background: var(--pc-panneau); border-bottom: 1px solid var(--pc-ligne); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 48px; }
#vhead .p { margin: 0; font-weight: 600; font-size: 14px; flex: 1 1 120px; min-width: 0; overflow-wrap: anywhere; }
.v-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
#vhead .p small { color: var(--pc-doux); font-weight: 400; margin-left: 4px; }
#vbody { flex: 1; overflow: auto; min-height: 0; background: var(--pc-fond); overscroll-behavior: contain; container-type: inline-size; }
#vbody iframe { width: 100%; height: 100%; border: 0; background: var(--pc-papier); display: block; }
.doc { max-width: 900px; margin: 0 auto; padding: 22px 28px; background: var(--pc-panneau); min-height: 100%; line-height: 1.65; overflow-wrap: anywhere; }
.doc h1, .doc h2, .doc h3 { letter-spacing: -.01em; line-height: 1.3; } .doc h2 { margin-top: 1.6em; padding-bottom: 6px; border-bottom: 1px solid var(--pc-ligne); }
.doc table, .md table { border-collapse: collapse; font-size: 13px; } .doc td, .doc th { border: 1px solid var(--pc-ligne); padding: 4px 7px; } .doc th { background: var(--pc-creux); }
.doc img { max-width: 100%; } .doc code { background: var(--pc-creux); padding: 1px 5px; border-radius: 5px; font-size: .92em; }
.doc blockquote { margin: 12px 0; padding: 6px 14px; border-left: 3px solid var(--pc-accent-bord); background: var(--pc-panneau-2); color: var(--pc-doux); }
pre.txt { white-space: pre-wrap; font: 12.5px/1.5 ui-monospace, monospace; margin: 0; }
.vue-image { padding: 16px; display: grid; place-items: center; } .vue-image img { max-width: 100%; border-radius: 8px; background: var(--pc-papier); box-shadow: var(--pc-ombre); }
.empty { color: var(--pc-doux); text-align: center; margin-top: 18vh; padding: 0 30px; font-size: 13.5px; }
.dots::after { content: "…"; animation: d 1s infinite; } @keyframes d { 50% { opacity: .2; } }
.pdfpages { background: var(--pc-pdf-fond); padding: 8px 0 30px; display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 100%; }
.pdfpages canvas { background: var(--pc-papier); box-shadow: var(--pc-ombre); max-width: calc(100% - 12px); height: auto; }
.pdfpages .pg { font-size: 11px; color: var(--pc-doux); }
/* tableaux */
.tablewrap { display: flex; flex-direction: column; height: 100%; }
.tabs { display: flex; gap: 4px; padding: 8px 12px 0; background: var(--pc-panneau); flex-wrap: wrap; }
.tabs button { border: 1px solid var(--pc-ligne); border-bottom: 0; background: var(--pc-creux); padding: 5px 10px; border-radius: 7px 7px 0 0; cursor: pointer; font-size: 12.5px; }
.tabs button.on { background: var(--pc-panneau); font-weight: 600; color: var(--pc-accent); }
.filter { padding: 6px 12px; background: var(--pc-panneau); display: flex; gap: 8px; align-items: center; } .filter input { width: 280px; padding: 5px 8px; }
.filter span { color: var(--pc-doux); font-size: 12px; }
.grid { overflow: auto; flex: 1; background: var(--pc-panneau); border-top: 1px solid var(--pc-ligne); overscroll-behavior: contain; }
.grid table { border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.grid th { position: sticky; top: 0; background: var(--pc-creux); z-index: 1; text-align: left; cursor: pointer; user-select: none; }
.grid th.asc::after { content: " ▲"; font-size: 9px; } .grid th.desc::after { content: " ▼"; font-size: 9px; }
.grid td, .grid th { border-right: 1px solid var(--pc-ligne-2); border-bottom: 1px solid var(--pc-ligne-2); padding: 4px 8px; vertical-align: top; }
.grid td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; cursor: pointer; }
.grid tr.open td { white-space: normal; max-width: 520px; } .grid tr:hover td { background: var(--pc-panneau-2); }
.rcards { padding: 8px; display: flex; flex-direction: column; gap: 8px; background: var(--pc-fond); }
.rcard { background: var(--pc-panneau); border: 1px solid var(--pc-ligne); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.rcard div { display: flex; gap: 10px; padding: 2px 0; border-bottom: 1px dashed var(--pc-ligne-2); } .rcard div:last-child { border: 0; }
.rcard .k { color: var(--pc-doux); flex: 0 0 42%; font-size: 12.5px; overflow-wrap: anywhere; } .rcard .v { flex: 1; overflow-wrap: anywhere; }
.more { margin: 6px auto 20px; display: block; }

/* ---------- accueil ---------- */
.home { max-width: 920px; margin: 0 auto; padding: 22px 24px 40px; }
.home h2 { font-size: 1em; margin: 20px 0 8px; }
.hero { margin-bottom: 10px; }
.hero h1 { font-size: 1.4em; margin: 0; letter-spacing: -.02em; overflow-wrap: anywhere; }
.hero p, .parcours p { color: var(--pc-doux); margin: 4px 0 0; max-width: 60ch; }
.parcours { background: var(--pc-panneau); border: 1px solid var(--pc-ligne); border-inline-start: 4px solid var(--pc-accent); border-radius: 0 10px 10px 0; padding: 14px 16px; }
.parcours h2 { font-size: 1.15em; margin: 0; }
.parcours-actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.parcours-actions .btn { min-height: 44px; font-size: 1em; white-space: normal; justify-content: center; }
#depotAccueilResultat:not(:empty) { margin-top: 10px; border-top: 1px solid var(--pc-ligne); padding-top: 6px; }
.depot-lien { display: block; align-content: center; min-height: 44px; padding: 6px 4px; overflow-wrap: anywhere; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(205px, 100%), 1fr)); gap: 10px; }
.card { background: var(--pc-panneau); border: 1px solid var(--pc-ligne); border-radius: 12px; padding: 13px 14px; cursor: pointer; text-align: left; color: inherit;
  display: flex; gap: 10px; align-items: flex-start; box-shadow: var(--pc-ombre); transition: box-shadow .15s, transform .15s; }
.card:hover { box-shadow: var(--pc-ombre-2); transform: translateY(-1px); }
.card .ci { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--pc-accent-fond); font-size: 18px; flex: 0 0 36px; }
.card b { display: block; font-size: 13.5px; } .card small { color: var(--pc-doux); font-size: 12px; }
.recent { background: var(--pc-panneau); border: 1px solid var(--pc-ligne); border-radius: 12px; overflow: hidden; box-shadow: var(--pc-ombre); }
.recent a { border-bottom: 1px solid var(--pc-ligne-2); display: flex; padding: 8px 12px; min-height: 44px; gap: 10px; align-items: baseline; text-decoration: none; color: inherit; }
.recent a:last-child { border-bottom: 0; } .recent a:hover { background: var(--pc-panneau-2); }
.recent .nm { min-width: 0; overflow-wrap: anywhere; } .recent .nm small { display: block; color: var(--pc-doux); }
.recent a:hover b { text-decoration: underline; }
.note { background: var(--pc-accent-fond); border: 1px solid var(--pc-accent-bord); border-radius: 10px; padding: 10px 14px; font-size: 13px; }
.note.alerte { background: var(--pc-alerte-fond); border-color: transparent; }

/* ---------- vues (journal, analyses, montre, réglages…) ---------- */
.viz { max-width: 1100px; margin: 0 auto; padding: 16px 20px 40px; }
.viz h2 { font-size: 16px; margin: 0 0 4px; } .viz .lead { color: var(--pc-doux); font-size: 12.5px; margin: 0 0 12px; }
.viz h3.grp { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--pc-doux); margin: 18px 0 8px; }
.panel { background: var(--pc-panneau); border: 1px solid var(--pc-ligne); border-radius: 12px; padding: 14px 16px; box-shadow: var(--pc-ombre); margin-bottom: 12px; }
.panel h3 { margin: 0; font-size: 16px; } .panel .big { font-size: 26px; font-weight: 700; margin: 6px 0 2px; }
.panel .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.panel h2 { font-size: 15px; margin: 0 0 8px; }
.veille-journal { max-width: 800px; }
.veille-journal .lead { max-width: 65ch; font-size: 14px; margin-block-end: 18px; }
.veille-proposition, .veille-limite { padding: 12px 16px; margin: 0 0 16px; overflow-wrap: anywhere; }
.veille-proposition { background: var(--pc-accent-fond); border-inline-start: 3px solid var(--pc-accent); border-radius: 6px; }
.veille-limite { background: var(--pc-alerte-fond); border-radius: 6px; }
.veille-limite p { margin: 5px 0 0; }
.veille-proposition p { margin: 6px 0 10px; }
.veille-proposition button { min-height: 44px; }
.veille-mission { background: var(--pc-panneau); border: 1px solid var(--pc-ligne); border-radius: 10px; }
.veille-mission table { width: 100%; border-collapse: collapse; }
.veille-mission caption { padding: 14px 16px; text-align: start; font-size: 17px; font-weight: 650; }
.veille-mission :is(th, td) { text-align: start; vertical-align: top; padding: 8px 16px; border-block-start: 1px solid var(--pc-ligne); overflow-wrap: anywhere; }
.veille-mission th { width: 38%; color: var(--pc-doux); font-weight: 500; }
.veille-mission time { font-variant-numeric: tabular-nums; }
.veille-statut { font-weight: 650; }
.veille-statut[data-etat="planifiee"] { color: var(--pc-accent); }
.veille-statut:focus-visible { outline: 2px solid var(--pc-accent); outline-offset: 2px; }
.veille-aide, .veille-commandes { border-block-start: 1px solid var(--pc-ligne); margin: 0; padding: 12px 16px; }
.veille-aide p { margin: 0 0 8px; }
.veille-aide button { min-height: 44px; }
.veille-commandes p { margin: 6px 0 0; }
.veille-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.veille-actions select { max-width: 100%; }
.veille-actions :is(button, select, a) { min-height: 44px; }
.veille-actions a { display: inline-flex; align-items: center; }
.veille-resultats { margin-block-start: 24px; }
.veille-article { border-block-end: 1px solid var(--pc-ligne); padding: 12px 0; overflow-wrap: anywhere; }
.veille-article h3 { font-size: 15px; margin: 0; }
.veille-article p { margin: 3px 0; }
.veille-article a { display: inline-block; margin-block-start: 3px; }
@container (max-width: 460px) {
  .veille-actions { flex-direction: column; align-items: stretch; }
  .veille-actions a { justify-content: center; }
}
.labs { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
@container (max-width: 570px) { .labs { grid-template-columns: 1fr; } .labs .alist { position: static; } .labs .alist .ls { max-height: 32vh; } }
.alist { background: var(--pc-panneau); border: 1px solid var(--pc-ligne); border-radius: 12px; overflow: hidden; position: sticky; top: 0; box-shadow: var(--pc-ombre); }
.alist .tools2 { padding: 8px; border-bottom: 1px solid var(--pc-ligne); display: flex; flex-direction: column; gap: 6px; }
.alist input[type=search] { padding: 7px 9px; font-size: 13px; width: 100%; }
.alist .ls { max-height: calc(100vh - 240px); overflow: auto; }
.alist .cat { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--pc-doux); padding: 8px 10px 3px; background: var(--pc-panneau-2); }
.alist .an { width: 100%; min-height: 38px; padding: 6px 10px; background: none; border: 0; border-top: 1px solid var(--pc-ligne-2); cursor: pointer; display: flex; gap: 8px; align-items: center; font-size: 13px; text-align: left; }
.alist .an:hover { background: var(--pc-panneau-2); } .alist .an.on { background: var(--pc-accent-fond); color: var(--pc-accent); font-weight: 600; }
.alist .an span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alist .an small { color: var(--pc-doux); font-weight: 400; white-space: nowrap; }
#lpanel .big span { font-weight: normal; }
#lch { margin-top: 8px; }
svg.ch { width: 100%; display: block; touch-action: pan-y; } svg.ch text { font-size: 11px; fill: var(--pc-pale); }
svg.ch .g { stroke: var(--pc-ligne-2); } svg.ch .g2 { stroke: var(--pc-ligne-2); opacity: .6; }
svg.ch .cur { stroke: var(--pc-pale); }
.vt { border-collapse: collapse; font-size: 13px; width: 100%; margin-top: 10px; } .vt td, .vt th { border-bottom: 1px solid var(--pc-ligne-2); padding: 5px 6px; text-align: left; }
.vt td:first-child { white-space: nowrap; } .vt td a { display: inline-flex; align-items: center; min-height: 44px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.chips button { border: 1px solid var(--pc-ligne); background: var(--pc-panneau); border-radius: 14px; padding: 4px 10px; font-size: 12.5px; cursor: pointer;
  display: flex; gap: 6px; align-items: center; color: var(--pc-doux); }
.chips button.on { border-color: currentColor; font-weight: 600; color: var(--pc-encre); }
.chips i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.daybox { margin-top: 10px; background: var(--pc-creux); border-radius: 10px; padding: 10px 12px; font-size: 13px; min-height: 60px; }
.daybox b { font-size: 14px; } .daybox .sc { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0; }
.legende { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--pc-doux); margin-top: 4px; }
/* formulaires (journal, pages de l'agent) */
.champ { margin: 16px 0; min-width: 0; } .libelle-champ { font-weight: 600; display: block; margin-bottom: 6px; }
.champ .aide { color: var(--pc-doux); font-size: 12.5px; margin: -2px 0 6px; }
.echelle { display: grid; grid-template-columns: repeat(auto-fit, minmax(30px, 1fr)); gap: 4px; }
.echelle button, .oui-non button { border: 1px solid var(--pc-ligne); background: var(--pc-panneau); border-radius: 8px; padding: 9px 0; font-weight: 600; cursor: pointer; }
.oui-non { display: flex; gap: 8px; flex-wrap: wrap; } .oui-non button { padding: 8px 16px; }
.echelle button.choisi, .oui-non button.choisi { background: var(--pc-accent); color: var(--pc-sur-accent); border-color: var(--pc-accent); }
.champ input, .champ textarea { width: 100%; }
.formulaire-entete { justify-content: space-between; flex-wrap: wrap; }
.section-formulaire { margin-top: 16px; border-top: 1px solid var(--pc-ligne); padding-top: 10px; }
.section-formulaire h4 { margin: 0; }
.formulaire-colonnes .grille-formulaire { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, max(220px, calc((100% - 20px) / 2))), 1fr)); column-gap: 20px; }
.formulaire-compact .champ { margin: 8px 0; }
.bandeau-ebauche { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.bandeau-ebauche p { margin: 4px 0 0; }
.historique-extensions, .archives-formulaire, .formulaire-modele { margin-top: 14px; }
.apercu-extension { border-inline-start: 3px solid var(--pc-accent); }
.historique-extensions .apercu-extension { margin-top: 14px; padding-inline-start: 14px; }
.reponses-archivees { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 5px 12px; }
.reponses-archivees dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.pastille { display: inline-block; padding: 2px 9px; border-radius: 99px; background: var(--pc-accent-fond); color: var(--pc-accent); font-size: 12px; font-weight: 600; }
.pastille.alerte { background: var(--pc-alerte-fond); color: var(--pc-alerte); }
.ligne-boutons { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.reg label.t { font-weight: 600; display: block; margin: 12px 0 5px; } .reg input:not([type=checkbox]):not([type=radio]), .reg select, .reg textarea { width: 100%; }
.reg .doux, .doux { color: var(--pc-doux); } .petit { font-size: 12.5px; }
.choix-liberte label { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--pc-ligne); border-radius: 10px; padding: 10px 12px; margin: 8px 0; cursor: pointer; }
.choix-liberte input { margin-top: 4px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--pc-creux); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.diag > div { padding: 7px 0; border-bottom: 1px solid var(--pc-ligne-2); display: flex; gap: 10px; } .diag .etat { width: 26px; flex: 0 0 26px; }
.liste-simple { list-style: none; margin: 0; padding: 0; } .liste-simple li { display: flex; gap: 10px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--pc-ligne-2); }
.liste-simple li .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; } .liste-simple li small { display: block; color: var(--pc-doux); }

/* ---------- conversation ---------- */
#chat { background: var(--pc-panneau); border-left: 1px solid var(--pc-ligne); display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; }
#chead { padding: 8px 12px; border-bottom: 1px solid var(--pc-ligne); display: flex; gap: 6px; align-items: center; min-height: 48px; }
.chead-identite, #chat-title { display: flex; align-items: center; gap: 7px; min-width: 0; }
.chead-identite { flex: 1; }
#chat-title { margin: 0; font-size: 14px; white-space: nowrap; }
#chat-title:focus-visible { outline: 2px solid var(--pc-accent); outline-offset: 2px; }
.chat-mobile, #chead .chat-mobile { display: none; }
#chead select { border-radius: 9px; padding: 6px 8px; font-size: 12.5px; background: var(--pc-creux); min-width: 0; max-width: 175px; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--pc-vivant); box-shadow: 0 0 0 3px var(--pc-accent-fond); }
#histbtn { position: relative; }
#histbtn[data-n]:not([data-n=""])::after { content: attr(data-n); position: absolute; top: -5px; right: -5px; background: var(--pc-alerte-fond); color: var(--pc-alerte);
  font-size: 10px; font-weight: 700; border-radius: 9px; min-width: 16px; height: 16px; line-height: 16px; text-align: center; padding: 0 3px; }
#msgs { flex: 1; overflow: auto; padding: 18px 18px 10px; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }
.m { padding: 10px 13px; border-radius: 14px; max-width: 100%; overflow-wrap: anywhere; position: relative; line-height: 1.6; }
.u { background: var(--pc-accent); color: var(--pc-sur-accent); align-self: flex-end; max-width: 88%; white-space: pre-wrap; border-bottom-right-radius: 5px; }
.a { background: var(--pc-panneau); border: 1px solid var(--pc-ligne); box-shadow: var(--pc-ombre); border-bottom-left-radius: 5px; padding: 12px 15px; }
.a p { margin: 6px 0; } .a ul, .a ol { margin: 6px 0; padding-left: 22px; } .a h1, .a h2, .a h3 { font-size: 15px; margin: 12px 0 6px; }
.a strong { color: var(--pc-encre-forte); } .a code { background: var(--pc-creux); padding: 1px 5px; border-radius: 5px; }
.a table { border-collapse: collapse; font-size: 12.5px; margin: 6px 0; display: block; overflow-x: auto; } .a td, .a th { border: 1px solid var(--pc-ligne); padding: 3px 6px; }
.a a[data-f] { text-decoration: none; border-bottom: 1px dotted currentColor; } .a a[data-f]:not([data-f^="::"])::before { content: "📎"; font-size: 11px; margin-right: 2px; }
.a blockquote { margin: 8px 0; padding: 4px 12px; border-left: 3px solid var(--pc-ligne); color: var(--pc-doux); }
details.tools { font-size: 12px; color: var(--pc-doux); background: var(--pc-creux); border-radius: 8px; padding: 5px 9px; margin-bottom: 8px; }
details.tools summary { cursor: pointer; } details.tools div { padding: 1px 0; } details.tools div::before { content: "› "; }
.meta { font-size: 11.5px; color: var(--pc-pale); margin-top: 6px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.meta button { border: 0; background: none; color: var(--pc-pale); cursor: pointer; font-size: 11.5px; padding: 0; } .meta button:hover { color: var(--pc-accent); }
.meta .modele { color: var(--pc-doux); }
.meta-actions { display: contents; }
.srcs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.srcs a { font-size: 12px; background: var(--pc-creux); border: 1px solid var(--pc-ligne); border-radius: 8px; padding: 3px 9px; text-decoration: none;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--pc-accent); }
.srcs a:hover { background: var(--pc-accent-fond); }
.modifs { background: var(--pc-accent-fond); border-radius: 10px; padding: 8px 12px; margin-top: 10px; font-size: 13px; }
.modifs a { overflow-wrap: anywhere; }
.annuler { margin-top: 8px; border: 1px solid var(--pc-accent-bord); background: var(--pc-panneau); border-radius: 9px; padding: 5px 10px; font-size: 12.5px; color: var(--pc-accent); cursor: pointer; }
.sugg { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sugg button { border: 1px solid var(--pc-ligne); background: var(--pc-panneau-2); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; cursor: pointer; text-align: left; }
.sugg button:hover { background: var(--pc-accent-fond); border-color: var(--pc-accent-bord); }
.intro-document { display: none; }
#chat:has(#questionDoc:not([hidden])) .intro-generique { display: none; }
#chat:has(#questionDoc:not([hidden])) .intro-document { display: block; }
.suivi { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.suivi button { border: 1px solid var(--pc-accent-bord); background: var(--pc-accent-fond); color: var(--pc-accent); border-radius: 12px; padding: 7px 11px; font-size: 13px; cursor: pointer; text-align: left; }
.retry { margin-top: 6px; border: 1px solid var(--pc-ligne); background: var(--pc-panneau); border-radius: 9px; padding: 6px 10px; font-size: 13px; color: var(--pc-accent); cursor: pointer; }
.retry.stopb { color: var(--pc-danger); margin-left: 6px; }
.erreur { color: var(--pc-danger); }
.bar { height: 3px; background: var(--pc-ligne); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--pc-accent); width: 0; transition: width 1s linear; border-radius: 2px; }
.step { display: inline-flex; align-items: center; gap: 8px; color: var(--pc-doux); }
.step::before, .spin { content: ""; width: 12px; height: 12px; border: 2px solid var(--pc-ligne); border-top-color: var(--pc-accent); border-radius: 50%; animation: sp .8s linear infinite; flex: 0 0 12px; display: inline-block; }
.spin { width: 11px; height: 11px; margin-right: 7px; vertical-align: -1px; } @keyframes sp { to { transform: rotate(360deg); } }
.bandeau-demo { background: var(--pc-alerte-fond); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; margin-top: 10px; }
/* cartes « pendant que je cherche » */
.attente { margin-top: 10px; border: 1px solid var(--pc-ligne); border-radius: 12px; background: var(--pc-panneau-2); padding: 10px 12px; animation: fadein .4s; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.at-head { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--pc-doux); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.at-head .at-type { text-transform: none; letter-spacing: 0; color: var(--pc-encre); background: var(--pc-panneau); border: 1px solid var(--pc-ligne); border-radius: 10px; padding: 1px 8px; }
.at-title { font-weight: 650; margin: 7px 0 3px; font-size: 14px; letter-spacing: -.01em; } .at-text { font-size: 13.5px; line-height: 1.5; }
.at-pert { font-size: 12px; color: var(--pc-doux); margin-top: 4px; font-style: italic; }
.at-foot { display: flex; gap: 12px; align-items: center; margin-top: 8px; font-size: 12.5px; } .at-foot a { color: var(--pc-accent); text-decoration: none; font-weight: 600; }
.at-foot button { margin-left: auto; border: 1px solid var(--pc-ligne); background: var(--pc-panneau); border-radius: 8px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; }
/* saisie */
#askwrap { border-top: 1px solid var(--pc-ligne); padding: 10px 12px 12px; background: var(--pc-panneau); }
#questionDoc { display: flex; align-items: stretch; justify-content: space-between; gap: 8px; padding: 4px 6px; margin-bottom: 8px; background: var(--pc-accent-fond); border-radius: 9px; }
#questionDocLien { min-width: 0; flex: 1; padding: 2px 4px; align-content: center; overflow-wrap: anywhere; }
#questionDocLien span { display: block; color: var(--pc-doux); font-size: .85em; text-decoration: none; }
#questionDoc .btn { align-self: center; flex: none; font-size: 20px; }
#ask { display: flex; gap: 6px; align-items: flex-end; background: var(--pc-creux); border: 1px solid var(--pc-ligne); border-radius: 14px; padding: 5px 5px 5px 4px; }
#ask:focus-within { border-color: var(--pc-accent-bord); box-shadow: var(--pc-anneau); background: var(--pc-panneau); }
#ask textarea { flex: 1; min-width: 0; resize: none; border: 0; background: transparent; outline: none; box-shadow: none; min-height: 40px; max-height: 40vh; padding: 9px 8px; line-height: 1.45; }
#go { min-width: 72px; width: auto; height: 40px; padding: 0 10px; border-radius: 11px; display: grid; place-items: center; background: var(--pc-accent); color: var(--pc-sur-accent); border: 0; cursor: pointer; flex: 0 0 auto; white-space: nowrap; }
#go:hover { background: var(--pc-accent-fort); }
.ib2 { border: 0; background: transparent; color: var(--pc-doux); width: 36px; height: 40px; display: grid; place-items: center; border-radius: 10px; cursor: pointer; flex: 0 0 36px; }
.ib2:hover { background: var(--pc-ligne-2); color: var(--pc-accent); } #mic.on { color: var(--pc-danger); animation: pulse 1s infinite; } @keyframes pulse { 50% { opacity: .4; } }
.hint { font-size: 11px; color: var(--pc-pale); margin: 6px 4px 0; }
#down { position: absolute; right: 16px; bottom: 84px; z-index: 4; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--pc-ligne); background: var(--pc-panneau);
  color: var(--pc-accent); box-shadow: var(--pc-ombre-2); display: grid; place-items: center; cursor: pointer; }
/* historique */
#hist { position: absolute; inset: 0; background: var(--pc-panneau-2); z-index: 5; display: flex; flex-direction: column; }
#hist .hh { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--pc-ligne); background: var(--pc-panneau); }
#hist-title { flex: 1; font-size: inherit; margin: 0; }
.hq { padding: 8px 12px; border-bottom: 1px solid var(--pc-ligne); background: var(--pc-panneau); } .hq input { width: 100%; }
#hist .hist-nouvelle { display: none; }
#hlist { overflow: auto; flex: 1; overscroll-behavior: contain; }
.hgrp { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--pc-doux); padding: 10px 14px 2px; }
#hlist .conv { display: flex; align-items: center; gap: 8px; border-radius: 10px; margin: 6px 10px; border: 1px solid var(--pc-ligne); background: var(--pc-panneau); padding-right: 12px; }
#hlist .conv:hover { background: var(--pc-panneau-2); } #hlist .conv.cur { border-color: var(--pc-accent-bord); background: var(--pc-accent-fond); }
#hlist .ct { flex: 1; min-width: 0; padding: 10px 12px; border: 0; border-radius: inherit; background: none; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
#hlist .ct small { display: block; color: var(--pc-doux); font-size: 12px; }
#hlist .hm { border: 1px solid var(--pc-ligne); background: transparent; border-radius: 8px; width: 34px; height: 34px; display: grid; place-items: center; color: var(--pc-doux); flex: 0 0 34px; cursor: pointer; }
#hlist .pin { color: var(--pc-alerte); font-size: 12px; margin-right: 4px; }
#hlist .vide { color: var(--pc-doux); padding: 12px 14px; cursor: default; }

/* ---------- feuille d'actions, avis, dépôt ---------- */
#sheet { position: fixed; inset: 0; background: var(--pc-voile); color: var(--pc-sur-accent); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sh-box { background: var(--pc-panneau); color: var(--pc-encre); width: 100%; max-width: 520px; max-height: 88vh; overflow: auto; border-radius: 18px 18px 0 0;
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); box-shadow: var(--pc-ombre-3); animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }
.sh-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--pc-ligne); margin: 2px auto 10px; }
.sh-title { font-weight: 650; font-size: 14px; color: var(--pc-doux); padding: 0 6px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-item { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: transparent; padding: 12px 10px; font-size: 15.5px; color: var(--pc-encre);
  border-radius: 10px; text-align: left; cursor: pointer; }
.sh-item:hover, .sh-item:active { background: var(--pc-creux); } .sh-item.danger { color: var(--pc-danger); } .sh-item small { margin-left: auto; color: var(--pc-doux); font-size: 13px; }
.sh-item .ico { width: 26px; text-align: center; font-size: 18px; }
.sh-sep { height: 1px; background: var(--pc-ligne-2); margin: 6px 4px; }
.sh-cancel { width: 100%; margin-top: 6px; border: 0; background: var(--pc-creux); border-radius: 12px; padding: 13px; font-size: 16px; font-weight: 600; cursor: pointer; }
.sh-seg { display: flex; gap: 6px; padding: 4px 10px 10px; }
.sh-seg button { flex: 1; border: 1px solid var(--pc-ligne); background: var(--pc-panneau); border-radius: 10px; padding: 10px; font-size: 14px; cursor: pointer; }
.sh-seg button.on { background: var(--pc-accent-fond); border-color: var(--pc-accent-bord); color: var(--pc-accent); font-weight: 600; }
.sh-texte { padding: 4px 10px 10px; color: var(--pc-doux); font-size: 14px; }
.sh-champ { padding: 4px 10px 10px; } .sh-champ input { width: 100%; font-size: 16px; }
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; background: var(--pc-avis); color: var(--pc-sur-avis);
  padding: 10px 16px; border-radius: 12px; font-size: 13.5px; box-shadow: var(--pc-ombre-2); z-index: 70; cursor: pointer; transition: all .3s; max-width: 90vw; }
.toast.on { transform: translate(-50%, 0); opacity: 1; }
.upbar { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--pc-avis); color: var(--pc-sur-avis);
  padding: 10px 16px; border-radius: 12px; font-size: 13.5px; z-index: 70; min-width: 240px; max-width: 90vw; }
.upbar i { display: block; height: 4px; background: var(--pc-doux); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.upbar i b { display: block; height: 100%; background: var(--pc-accent-bord); width: 0; transition: width .2s; }
#depot-voile { position: fixed; inset: 0; background: var(--pc-voile); z-index: 80; display: grid; place-items: center; pointer-events: none; }
#depot-voile div { background: var(--pc-panneau); padding: 26px 34px; border-radius: 18px; border: 3px dashed var(--pc-accent); font-size: 17px; font-weight: 600; }
#backchat { display: none; }
#mnav { display: none; }

/* taille du texte (réglage) */
body[data-zoom="1"] :is(.a, .doc, .rcard, .attente, .u, .viz, .home) { font-size: 16.5px; }
body[data-zoom="2"] :is(.a, .doc, .rcard, .attente, .u, .viz, .home) { font-size: 18.5px; line-height: 1.65; }

/* ---------- bureau : index, table de lecture et conversation ---------- */
@media screen and (width > 900px) {
  .bureau-seulement { display: revert; }
  .mobile-seulement { display: none; }
  #tree, #viewer, #chat { --titre-bureau: Georgia, "Times New Roman", serif; }
  body > header { gap: 12px; min-height: 64px; padding: 8px 20px; color: var(--pc-sur-cadre); background: var(--pc-cadre); box-shadow: none; }
  header h1 { font-size: 17px; }
  header .logo { filter: none; }
  header .sub, .disposition > span { color: var(--pc-cadre-doux); }
  header .btn, header .pill, #modes { background: var(--pc-cadre-creux); color: var(--pc-sur-cadre); border-color: var(--pc-cadre-ligne); }
  header .btn:hover { background: var(--pc-cadre); border-color: var(--pc-sur-cadre); }
  header :is(a, button):focus-visible { outline-color: var(--pc-sur-cadre); }
  .disposition { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
  #modes { border: 1px solid var(--pc-cadre-ligne); border-radius: 7px; }
  #modes button { color: var(--pc-sur-cadre); border-radius: 4px; white-space: nowrap; }
  #modes button:hover:not(.on) { background: var(--pc-cadre); }
  #modes button.on { background: var(--pc-sur-cadre); color: var(--pc-cadre); box-shadow: none; }
  #modes button.on:focus-visible { outline-color: var(--pc-cadre); }
  main { grid-template-columns: clamp(180px, var(--w-arbre, 238px), 32vw) 5px minmax(0, 1fr) 5px clamp(320px, var(--w-chat, 390px), 40vw); }

  #tree { background: var(--pc-index); }
  .index-titre { margin: 18px 16px 0; font-size: 17px; font-weight: 680; line-height: 1.25; }
  .qwrap { margin: 13px 12px 9px; }
  #q { border-color: var(--pc-relief); }
  #q:focus-visible, #chead select:focus-visible, #ask:has(#inp:focus-visible) { outline: 2px solid var(--pc-accent); outline-offset: 2px; }
  .arbre-actions .btn { min-width: 0; min-height: 34px; padding-inline: 8px; white-space: normal; }
  .arbre-actions .btn:first-child { flex: 0 0 auto; }
  #files { padding: 4px 10px 24px; }
  #files .node { min-height: 32px; border-radius: 4px; }
  #files :is(a.node, .node [data-tog]) { gap: 5px; }
  #files .fav .ic { display: none; }
  .repere-fichier { display: inline-flex; vertical-align: middle; }
  #files .node.sel { position: relative; color: var(--pc-accent); background: var(--pc-accent-fond); box-shadow: inset 3px 0 var(--pc-accent); }
  #files .node.sel .ic { color: inherit; }
  #files .node.sel .nm { white-space: normal; overflow-wrap: anywhere; }
  .index-accueil { display: flex; margin-bottom: 6px; font-weight: 650; }
  .index-accueil .ic { font-size: 17px; }
  .index-documents, #files .fav { margin: 10px 0 0; padding: 9px 0 0; border: 0; border-top: 1px solid var(--pc-relief); background: none; box-shadow: none; border-radius: 0; }
  .index-documents h3, #files .fav h3 { margin: 0; padding: 0 8px 4px; font-size: 12.5px; color: var(--pc-doux); text-transform: none; letter-spacing: 0; }
  .index-documents > p { margin: 0 8px 6px; font-size: 13px; }
  #search-res .sr-h { text-transform: none; letter-spacing: 0; }

  body.athome #vhead, #vhead .accueil-lecture { display: none; }
  #vbody { background: var(--pc-atelier); }
  #vhead { display: block; padding: 15px clamp(14px, 2.2vw, 32px) 12px; }
  #vhead .p { font: 600 clamp(22px, 2vw, 34px)/1.14 var(--titre-bureau); }
  #vhead .p small { display: block; margin: 5px 0 0; font: 13px/1.4 system-ui, sans-serif; }
  #viewer-title:focus-visible { outline: 2px solid var(--pc-accent); outline-offset: 2px; }
  #vhead .v-actions { margin-top: 12px; }
  #vhead .v-actions .btn { min-height: 34px; border-radius: 6px; }
  #vhead .v-actions .primary { background: var(--pc-accent); border-color: var(--pc-accent); color: var(--pc-sur-accent); font-weight: 650; }
  #vhead .v-actions .primary:hover { background: var(--pc-accent-fort); }
  #vhead .v-actions .primary:focus-visible, .plein:focus-visible, #go:focus-visible { outline-color: var(--pc-sur-accent); outline-offset: -4px; }
  #source-repere { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: space-between; align-items: center; padding: 7px clamp(14px, 2.2vw, 32px);
    background: var(--pc-signet); color: var(--pc-accent); border-inline-start: 4px solid var(--pc-accent); border-bottom: 1px solid var(--pc-relief); font-size: 13px; }
  #source-repere > span { display: flex; flex-wrap: wrap; gap: 3px 10px; align-items: baseline; }
  #source-page { color: var(--pc-doux); }
  #source-repere .btn { border-color: var(--pc-relief); border-radius: 5px; color: var(--pc-accent); font-weight: 650; }
  .pdfpages { padding: 18px 0 30px; gap: 12px; }
  .pdfpages canvas { max-width: calc(100% - 52px); box-shadow: var(--pc-ombre-2); }
  .pdfpages .pg { font-size: 12px; margin-bottom: 4px; }

  .home { max-width: 850px; padding: clamp(24px, 4vw, 60px) clamp(20px, 3.1vw, 46px) 42px; }
  .home .hero { margin: 0; }
  .home .hero h1 { color: var(--pc-encre-forte); font: 500 clamp(34px, 4.2vw, 62px)/1.07 var(--titre-bureau); letter-spacing: -.035em; }
  .home .parcours { background: none; border: 0; padding: 0; margin-top: 10px; }
  .home .parcours p { max-width: 49ch; font-size: 1.04em; }
  .parcours-actions { margin-top: 16px; }
  .parcours-actions .btn { border-radius: 6px; border-color: var(--pc-relief); }
  .parcours-actions .plein { border-color: var(--pc-accent); }
  .home > h2 { font-size: 1.08em; margin: 30px 0 8px; }
  .home .recent { border: 0; border-radius: 0; border-block: 1px solid var(--pc-relief); box-shadow: none; }
  .home .recent a { padding: 10px 12px; gap: 12px; }
  .home .recent-icone { color: var(--pc-accent); }
  .home .cards { grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); column-gap: 14px; row-gap: 0; }
  .home .card { background: none; border: 0; border-top: 1px solid var(--pc-ligne); border-radius: 0; box-shadow: none; padding: 10px 5px; }
  .home .card:hover { background: var(--pc-panneau); transform: none; }
  .home .card .ci { display: none; }
  .home .note { background: none; border: 0; border-inline-start: 2px solid var(--pc-relief); border-radius: 0; color: var(--pc-doux); }

  #chat, #askwrap { background: var(--pc-echange); }
  #chead { flex-wrap: wrap; gap: 7px; padding: 12px 16px; background: var(--pc-panneau); }
  #chead .chead-identite { flex: 0 0 100%; }
  #chat-title { font: 600 24px/1.2 var(--titre-bureau); }
  #chead select { margin-right: auto; border-color: var(--pc-relief); border-radius: 5px; font-size: 13px; }
  #chead .btn { border-color: var(--pc-relief); border-radius: 5px; }
  #msgs { padding: 20px clamp(13px, 1.6vw, 22px) 14px; gap: 20px; }
  #msgs > * { flex-shrink: 0; }
  #msgs > .a { background: none; border: 0; border-inline-start: 2px solid var(--pc-relief); border-radius: 0; padding: 4px 0 2px 13px; box-shadow: none; }
  #msgs > .intro { border: 0; padding: 3px 0 0; align-self: stretch; }
  #msgs .intro-titre { margin: 0 0 8px; font: 600 22px/1.23 var(--titre-bureau); }
  #msgs .sugg { display: grid; gap: 0; border-top: 1px solid var(--pc-ligne); margin-top: 14px; }
  #msgs .sugg button { background: none; border: 0; border-radius: 0; border-bottom: 1px solid var(--pc-ligne); color: var(--pc-accent); font-size: 13.5px; }
  #msgs .sugg button:hover { background: var(--pc-panneau); }
  #msgs .u { background: var(--pc-accent-fond); color: var(--pc-encre-forte); border-radius: 10px 10px 0 10px; }
  #msgs .a a[data-f]:not([data-f^="::"])::before { content: none; }
  #msgs .srcs { display: grid; gap: 5px; padding: 8px 9px; margin-block: 12px 4px; background: var(--pc-signet); border-radius: 4px; }
  .srcs-titre { font-size: 12.5px; color: var(--pc-doux); font-weight: 650; }
  #msgs .srcs a { background: var(--pc-panneau); border-color: var(--pc-relief); border-radius: 4px; white-space: normal; min-height: 32px;
    align-content: center; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
  #msgs a[aria-current="location"] { box-shadow: inset 3px 0 var(--pc-accent); font-weight: 700; }
  #askwrap { padding: 12px 16px; }
  #ask { border-color: var(--pc-relief); background: var(--pc-panneau); border-radius: 8px; }
  #ask:focus-within { border-color: var(--pc-accent); }
  #go { display: flex; align-items: center; justify-content: center; flex: none; gap: 4px; width: auto; padding: 0 9px; border-radius: 5px; font-size: 13px; font-weight: 700; }
  body.mode-chat #chat {
    display: grid;
    grid-template: auto minmax(0, 1fr) auto / clamp(14rem, 23vw, 18rem) minmax(0, 1fr);
  }
  body.mode-chat #hist {
    position: static; z-index: auto; grid-area: 1 / 1 / -1 / 2; min-width: 0; min-height: 0;
    border-inline-end: 1px solid var(--pc-relief);
  }
  body.mode-chat #hist .hh { min-height: 54px; }
  body.mode-chat #hist-title { font: 600 18px/1.2 var(--titre-bureau); }
  body.mode-chat #hist .hist-nouvelle { display: block; width: 100%; margin-bottom: 8px; text-align: left; }
  body.mode-chat :is(#histbtn, #hist [data-action="historique-fermer"], #chead [data-action="nouvelle"]) { display: none; }
  body.mode-chat #chead { grid-area: 1 / 2; }
  body.mode-chat #chead .chead-identite { flex: 1; }
  body.mode-chat #chead select { margin-right: 6px; }
  body.mode-chat #msgs { grid-area: 2 / 2; width: min(100%, 52rem); justify-self: center; }
  body.mode-chat #msgs > .a:not(.intro) { max-width: 72ch; }
  body.mode-chat #askwrap { grid-area: 3 / 2; }
  body.mode-chat #askwrap > * { max-width: 50rem; margin-inline: auto; }
}

/* ---------- téléphone : un panneau à la fois + barre d'onglets ---------- */
@media screen and (max-width: 900px) {
  body[data-tab] { position: fixed; inset-inline: 0; top: var(--appTop, 0px); height: var(--appH, 100dvh); grid-template-rows: auto minmax(0, 1fr) auto; }
  header { padding: 6px 10px; gap: 8px; padding-top: max(6px, env(safe-area-inset-top)); }
  header h1 { font-size: 14px; } header .sub, #treebtn, #modes, .hint, #who { display: none; }
  .logo { width: 28px; height: 28px; flex-basis: 28px; }
  .brand { min-height: 44px; }
  main { grid-template-columns: 1fr !important; } #tree, #viewer, #chat { grid-column: 1 / -1 !important; border: 0; } .split { display: none !important; }
  #tree, #viewer, #chat { display: none !important; }
  body[data-tab="files"] #tree, body[data-tab="doc"] #viewer { display: flex !important; }
  body[data-tab="chat"] #chat { display: grid !important; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  body[data-tab="chat"], body[data-tab="doc"]:has(#backchat:not([hidden])) { grid-template-rows: minmax(0, 1fr) auto; }
  body[data-tab="chat"] > header, body[data-tab="doc"]:has(#backchat:not([hidden])) > header { display: none; }
  #mnav { display: flex; background: var(--pc-panneau); box-shadow: 0 -1px 0 var(--pc-ligne); padding-bottom: env(safe-area-inset-bottom); }
  #mnav button { flex: 1; min-height: 48px; border: 0; background: none; padding: 6px 2px; font-size: 13px; color: var(--pc-doux); display: flex; flex-direction: column; align-items: center; gap: 2px; position: relative; }
  #mnav button svg { opacity: .75; } #mnav button.on { color: var(--pc-accent); font-weight: 600; } #mnav button.on svg { opacity: 1; }
  #mnav button .nb { position: absolute; top: 4px; right: calc(50% - 22px); width: 9px; height: 9px; border-radius: 50%; background: var(--pc-pastille); display: none; }
  #mnav button.unread .nb { display: block; }
  body.kb[data-tab] { grid-template-rows: auto minmax(0, 1fr); }
  body.kb[data-tab="chat"] { grid-template-rows: minmax(0, 1fr); }
  body.kb #mnav { display: none; }
  input, select, textarea { font-size: 16px !important; }   /* évite le zoom automatique d'iOS */
  #files { font-size: 15px; } a.node, .node [data-tog], .sr { min-height: 44px; } .node .nact { min-width: 44px; font-size: 18px; }
  #vhead { padding: 6px 8px; gap: 6px; } #vhead .p small, #vhead .lg { display: none; } #vhead .btn { padding: 6px 10px; font-size: 14px; min-height: 44px; } #vhead .btn.ib { width: 44px; }
  body.athome #vhead { display: none; }
  .doc { padding: 14px; } .filter input { width: 100%; } .grid td { max-width: 220px; }
  .btn.ib { width: 44px; height: 44px; flex-shrink: 0; }
  #chead { grid-row: 1; gap: 4px; padding: max(4px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 4px max(10px, env(safe-area-inset-left)); }
  #chat-title { font-size: 17px; letter-spacing: -.025em; white-space: normal; }
  #chead .live, #chead #badgeDemo, #chead select, #histbtn .i, #printbtn, #expandbtn, #mic, .chat-bureau, #chead .chat-bureau { display: none; }
  #chead .chat-mobile, .chat-mobile { display: inline; }
  #chead #chatmenubtn { display: inline-flex; }
  #histbtn { width: auto; padding: 0 9px; font-size: 13px; font-weight: 600; }
  #hist .hh { padding-top: max(8px, env(safe-area-inset-top)); }
  #hist .hh .btn, #hlist .ct { min-height: 44px; }
  #hlist .hm { height: 44px; width: 44px; flex-basis: 44px; }
  .sh-champ label { display: block; margin-bottom: 4px; } #effort-mobile { width: 100%; }
  #msgs { grid-row: 2; grid-column: 1; min-height: 0; padding: 14px max(12px, env(safe-area-inset-right)) 14px max(12px, env(safe-area-inset-left)); font-size: 16px; }
  #msgs > * { flex-shrink: 0; }
  #chat #msgs > .m { width: auto; margin: 0; padding: 9px 12px; }
  #chat #msgs > .a { max-width: min(66ch, 100%); border: 0; border-inline-start: 2px solid var(--pc-ligne); border-radius: 0; box-shadow: none; }
  #chat #msgs > .u { max-width: min(52ch, 92%); background: var(--pc-accent-fond); color: var(--pc-encre-forte); }
  .m pre { max-width: 100%; overflow: auto; }
  .meta { gap: 0 8px; color: var(--pc-doux); }
  .meta-actions { display: flex; flex: 1 0 100%; flex-wrap: wrap; gap: 4px; }
  .meta button { min-height: 44px; padding: 4px 8px; font-size: 12.5px; color: var(--pc-doux); }
  #msgs .a a[data-f]::before { content: none; }
  .srcs { display: grid; gap: 5px; margin: 10px 0 2px; }
  .srcs-titre { font-size: 12px; font-weight: 650; color: var(--pc-doux); }
  #msgs .srcs a { min-height: 44px; align-content: center; padding: 6px 10px; white-space: normal; overflow-wrap: anywhere; font-size: 13.5px; font-weight: 600; }
  #askwrap { grid-row: 3; grid-column: 1; padding: 8px max(8px, env(safe-area-inset-right)) 8px max(8px, env(safe-area-inset-left)); }
  #ask textarea { min-height: 44px; }
  #questionDocLien b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #down { position: relative; grid-row: 2; grid-column: 1; align-self: end; justify-self: end; bottom: auto; right: auto; margin: 0 12px 8px 0; width: 44px; height: 44px; }
  .home { padding: 14px 12px 30px; }
  .parcours-actions .btn { flex: 1 1 140px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 8px; } .card { padding: 10px; flex-direction: column; gap: 4px; } .card small { display: none; } .card b { font-size: 13px; }
  .viz { padding: 10px 10px 30px; } .alist .an { min-height: 44px; }
  .panel { padding: 12px; } .chips button { padding: 7px 12px; }
  #backchat { display: block; align-self: stretch; flex-shrink: 0; color: var(--pc-accent); background: var(--pc-panneau); border: 0; border-bottom: 1px solid var(--pc-ligne);
    min-height: calc(44px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); text-align: left; font-weight: 650; cursor: pointer; }
  .arbre-actions .btn { padding: 9px; font-size: 14px; min-height: 44px; }
  #go { width: auto; min-width: 70px; height: 44px; flex-basis: auto; padding: 0 8px; font-size: 13px; font-weight: 700; }
  #go .i { display: none; }
  .ib2 { width: 44px; height: 44px; flex-basis: 44px; }
}

/* ---------- impression de la conversation ---------- */
@media print {
  body { display: block; height: auto; overflow: visible; background: var(--pc-papier); }
  header, #tree, #viewer, .split, #chead, #askwrap, #mnav, #backchat, .meta button, .sugg, .suivi, #hist, #down, .annuler { display: none !important; }
  main { display: block; } #chat { display: block !important; border: 0; } #msgs { overflow: visible; display: block; padding: 0; }
  .m { break-inside: avoid; margin-bottom: 10px; border: 1px solid var(--pc-ligne); } .u { margin-left: 20%; } details.tools { display: none; }
  #msgs::before { content: attr(data-titre); display: block; font-weight: 700; font-size: 15px; margin-bottom: 12px; }
}

/* ---------- page de connexion ---------- */
body.page-connexion { display: grid; place-items: center; min-height: 100vh; padding: 16px; overflow: auto; }
.connexion { width: min(380px, 100%); padding: 28px; background: var(--pc-panneau); border: 1px solid var(--pc-ligne); border-radius: 16px; box-shadow: var(--pc-ombre-2); }
.connexion .logo { width: 48px; height: 48px; margin-bottom: 10px; }
.connexion h1 { margin: 0 0 2px; font-size: 22px; } .connexion p { margin: 0 0 14px; color: var(--pc-doux); font-size: 13px; }
.connexion label { font-weight: 600; display: block; margin: 12px 0 5px; } .connexion input { width: 100%; }
.connexion .btn { width: 100%; margin-top: 18px; padding: 11px; justify-content: center; font-size: 15px; }
.connexion .erreur { min-height: 1.2em; margin-top: 8px; font-size: 13px; }
.pied { color: var(--pc-doux); font-size: 12.5px; text-align: center; margin-top: 16px; }
/* connexion : champs confortables partout, présentation large sur ordinateur */
.connexion input { min-height: 48px; font-size: 16px; padding: 10px 14px; }
.connexion .btn { min-height: 50px; font-size: 16px; }
.connexion p { font-size: 15px; line-height: 1.5; }
.connexion h1 { font-size: 26px; }
.cx-presentation { display: none; }
@media (max-width: 899px) {
  body.page-connexion { min-height: 100dvh; padding: 16px; }
  body.page-connexion main.cx { min-height: calc(100dvh - 32px); align-content: center; }
}
@media (min-width: 900px) {
  html:has(body.page-connexion) { scrollbar-gutter: auto; }
  body.page-connexion { display: block; padding: 0; margin: 0; }
  main.cx { width: 100% !important; max-width: none; margin: 0 !important; display: grid; grid-template-columns: minmax(380px, 1.1fr) minmax(440px, 1fr); min-height: 100vh; }
  .cx-presentation { display: flex; flex-direction: column; justify-content: center; gap: 28px;
    padding: clamp(40px, 7vw, 110px); background: var(--pc-cadre); color: var(--pc-sur-cadre); }
  .cx-marque { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 20px; letter-spacing: .02em; }
  .cx-marque img { border-radius: 0; }
  .cx-titre { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(38px, 4.2vw, 60px); line-height: 1.08; color: var(--pc-sur-cadre); }
  .cx-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; max-width: 34em; font-size: 18px; line-height: 1.45; }
  .cx-points li { padding-left: 22px; position: relative; color: var(--pc-cadre-doux); }
  .cx-points li::before { content: ""; position: absolute; left: 0; top: .55em; width: 9px; height: 9px; border-radius: 50%; background: var(--pc-accent); }
  .cx-points strong { color: var(--pc-sur-cadre); }
  .cx-note { margin: 0; font-size: 14px; color: var(--pc-cadre-doux); max-width: 34em; }
  main.cx > .connexion { align-self: center; justify-self: center; width: min(460px, calc(100% - 64px)); padding: 44px 44px 32px; border-radius: 20px; }
  main.cx > .connexion .logo { display: none; }
  main.cx > .connexion h1 { font-size: 32px; font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
  main.cx > .connexion label { font-size: 16px; margin-top: 18px; }
}
@media (min-width: 900px) and (prefers-color-scheme: dark) { .cx-presentation { background: var(--pc-cadre); } }

/* ---------- v8 : socle d'accessibilité renforcé ---------- */
.skip-link {
  position: fixed; inset-inline-start: 12px; top: 8px; z-index: 100; transform: translateY(-160%);
  background: var(--pc-encre-forte); color: var(--pc-panneau); border: 3px solid var(--pc-accent);
  padding: 10px 14px; border-radius: 8px; font-weight: 700;
}
.skip-link:focus { transform: none; }
:is(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--pc-accent); outline-offset: 3px; box-shadow: var(--pc-anneau);
}
header :is(button, a):focus-visible { outline-color: var(--pc-sur-cadre); box-shadow: 0 0 0 4px var(--pc-cadre); }
body[data-spacing="1"] { letter-spacing: .12em; word-spacing: .16em; }
body[data-spacing="1"] :is(p, li, label, button, input, select, textarea, td, th) { line-height: 1.65; }
body[data-font="1"] { font-family: Verdana, Geneva, sans-serif; }
body[data-font="1"] :is(h1, h2, h3, h4) { letter-spacing: 0; }
body[data-contrast="1"] :is(button, input, select, textarea, .panel, .card, .recent, .fav, .srcs a) { border-width: 2px; }
.btn { min-height: 44px; padding: 9px 14px; font-size: 14px; }
.btn.ib { width: 44px; height: 44px; }
.seg button { min-height: 44px; }
input, select, textarea { min-height: 44px; }
textarea { min-height: 96px; }
.node, .node [data-tog], .sr { min-height: 44px; }
.node .nact { min-width: 44px; min-height: 44px; }
.chips button, .echelle button, .oui-non button, .alist .an { min-height: 44px; }
.chips button { padding: 8px 12px; }
.echelle { gap: 8px; }
.echelle button { min-width: 44px; }
.oui-non button { padding: 9px 18px; }
.srcs a, .meta button, .suivi button, .retry, .annuler { min-height: 44px; align-items: center; }
.sh-item { min-height: 52px; padding: 12px 10px; }
.sh-cancel { min-height: 52px; }
.pdfpages .pg { font-size: 13px; font-weight: 650; }
.formulaire-dates { align-items: flex-end; gap: 12px; }
.formulaire-dates .champ { flex: 1 1 220px; margin: 8px 0; }
.formulaire-dates label { display: block; font-weight: 650; margin-bottom: 5px; }
.chart-data { margin-top: 12px; border: 2px solid var(--pc-ligne); border-radius: 8px; background: var(--pc-panneau); }
.chart-data summary { cursor: pointer; min-height: 44px; padding: 10px 12px; font-weight: 700; }
.table-scroll { overflow: auto; max-width: 100%; }
.chart-data table { border-collapse: collapse; width: 100%; min-width: 520px; }
.chart-data caption { text-align: start; font-weight: 700; padding: 8px 12px; }
.chart-data th, .chart-data td { border: 1px solid var(--pc-ligne); padding: 8px 10px; text-align: start; }
.chart-data th { background: var(--pc-creux); }
.daybox:focus-visible { outline: 3px solid var(--pc-accent); outline-offset: 3px; }
#vbody, #files, #msgs, #hlist, .grid, .sh-box { scrollbar-color: var(--pc-ligne) var(--pc-creux); }
@media (forced-colors: active) {
  * { forced-color-adjust: auto; }
  :is(button, a, input, select, textarea):focus-visible { outline: 3px solid CanvasText; }
}
@media screen and (min-width: 901px) {
  .arbre-actions .btn, #files .node, #files :is(a.node, .node [data-tog]) { min-height: 44px; }
  .meta button { padding: 8px 10px; }
  .grid td, .grid th { padding-block: 9px; }
}
@media screen and (max-width: 900px) {
  body[data-spacing="1"] { letter-spacing: .08em; word-spacing: .12em; }
  .formulaire-dates { display: block; }
  .formulaire-dates .champ { width: 100%; }
  .chart-data table { min-width: 0; }
  .chart-data th, .chart-data td { padding: 7px 8px; }
}

/* La v8 ne réserve pas la lisibilité aux petits caractères d'interface. */
:is(small, .petit, .meta, .hint, .badge-demo, .cnt, .fav h3, .sr-h, .at-head, .at-pert, .at-foot, .pg, header .sub) { font-size: 13px; }
@media screen and (max-width: 900px) {
  body.mode-chat #chat { grid-template-columns: minmax(0, 1fr); }
  body.mode-chat #hist, body.mode-chat #chead, body.mode-chat #msgs, body.mode-chat #askwrap { grid-column: 1; }
  body.mode-chat #chead { grid-row: 1; }
  body.mode-chat #msgs { grid-row: 2; width: auto; }
  body.mode-chat #askwrap { grid-row: 3; }
}
.sh-box { animation: none; }
.formulaire-plus { margin-top: 16px; border-top: 2px solid var(--pc-ligne); padding-top: 8px; }
.formulaire-plus summary { cursor: pointer; min-height: 44px; padding: 10px 4px; font-weight: 700; }
@media screen and (max-width: 360px) {
  body[data-tab] { overflow-x: hidden; }
  #chat, #viewer, #tree, #msgs, #vbody, #files { min-width: 0; max-width: 100vw; }
  #askwrap { padding-inline: 6px; }
  #ask { gap: 3px; padding-inline: 3px; }
  #go { min-width: 64px; padding-inline: 6px; }
  #mnav button { padding-inline: 6px; }
  .sh-box { width: 100vw; max-width: 100vw; }
  .formulaire-actif { padding-inline: 10px; }
}
.modifs-apercu { border: 2px solid var(--pc-accent-bord); background: var(--pc-accent-fond); padding: 12px; }
.modifs-apercu h4 { margin: 0 0 8px; }
.modifs-apercu dl { display: grid; grid-template-columns: minmax(7rem, auto) 1fr; gap: 5px 12px; margin: 0; }
.modifs-apercu dt { font-weight: 700; }
.modifs-apercu dd { margin: 0; overflow-wrap: anywhere; }
.modifs-apercu h3 { margin: 0 0 8px; }
@media screen and (max-width: 900px) {
  main { grid-template-rows: minmax(0, 1fr); min-height: 0; }
  body[data-tab="chat"] #chat, body[data-tab="doc"] #viewer, body[data-tab="files"] #tree { min-height: 0; }
  body.athome #askwrap { pointer-events: none; }
  body.athome #askwrap #inp, body.athome #askwrap #go, body.athome #askwrap button { pointer-events: auto; }
}
/* v9 — fusion prune/lin, dossier actif et bureau respirable */
body { font-size: 16px; line-height: 1.6; }
.scope-note { margin: 0; padding: 8px 12px; color: var(--pc-doux); background: var(--pc-signet); border-top: 1px solid var(--pc-ligne-2); font-size: 13px; pointer-events: none; }
.scope-note strong { color: var(--pc-accent); }
.eyebrow { margin: 0 0 8px; color: var(--pc-accent); font-size: 13px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.active-dossier { border-inline-start-color: var(--pc-accent); box-shadow: var(--pc-ombre-2); }
.chemin-actif { margin-top: 14px; background: var(--pc-signet); border-color: var(--pc-ligne-2); }
.home-details { margin-top: 26px; border-block: 1px solid var(--pc-ligne); }
.home-details > summary { cursor: pointer; min-height: 52px; padding: 14px 4px; font-weight: 700; }
.home-details .cards { padding: 0 0 10px; }
.fav { border-block: 1px solid var(--pc-relief); border-inline: 0; border-radius: 0; margin: 10px 0 0; padding: 0; box-shadow: none; }
.fav > summary { cursor: pointer; min-height: 52px; padding: 13px 8px; font-size: 13px; font-weight: 750; color: var(--pc-doux); }
.fav[open] > summary { color: var(--pc-accent); }
.fav > .node { min-height: 44px; margin-inline: 0; }
.fav > .node:last-child { margin-bottom: 6px; }
.sr-h { font-size: 13px; padding: 10px 8px 6px; }
.sr-h b { color: var(--pc-accent); }
.meta, .hint, .petit { font-size: 13px; }
.a, .u { font-size: 16px; }
.sh-box { max-width: 560px; }
@media screen and (min-width: 901px) {
  main { grid-template-columns: clamp(240px, var(--w-arbre, 268px), 29vw) 5px minmax(0, 1fr) 5px clamp(360px, var(--w-chat, 430px), 36vw); }
  .home { max-width: 940px; padding: clamp(30px, 5vw, 72px) clamp(28px, 4vw, 64px) 48px; }
  .home .hero h1 { font-size: clamp(36px, 4vw, 60px); }
  .home .hero p { font-size: 1.12em; max-width: 54ch; }
  .parcours-actions .btn { min-height: 48px; }
  #files .node { min-height: 44px; }
  #files .index-documents { margin-top: 14px; }
  #files .fav { margin-top: 12px; }
  #msgs { font-size: 16px; }
  #askwrap { padding: 14px 16px 16px; }
}
@media screen and (max-width: 900px) {
  .scope-note { font-size: 13px; }
  .home { padding: 18px 14px 34px; }
  .home .hero h1 { font-size: clamp(32px, 10vw, 44px); }
  .home .hero p { font-size: 16px; }
  .parcours-actions { display: grid; grid-template-columns: 1fr; }
  .parcours-actions .btn { min-height: 52px; }
  .home-details > summary, .fav > summary { min-height: 52px; }
  .home-details .card { min-height: 60px; }
}
body[data-repos="1"] *, body[data-repos="1"] *::before, body[data-repos="1"] *::after {
  animation: none !important; transition: none !important; scroll-behavior: auto !important;
}
 .timeline { margin-top: 20px; padding: 16px; border: 1px solid var(--pc-ligne); border-radius: 12px; background: var(--pc-panneau); }
.timeline h2 { margin-top: 0; }
.timeline > p { margin: 0 0 12px; }
.timeline ol { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--pc-ligne-2); }
.timeline time { color: var(--pc-accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.timeline li div { display: grid; gap: 3px; }
.timeline li span { color: var(--pc-doux); font-size: 13px; }
@media screen and (max-width: 500px) { .timeline li { grid-template-columns: 1fr; gap: 4px; } }
.parcours-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.parcours-actions .btn { flex: 1 1 13rem; }
.active-dossier .btn.plein { box-shadow: 0 3px 0 color-mix(in srgb, var(--pc-accent) 28%, transparent); }
.timeline li:first-child { border-top: 0; padding-top: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
:focus-visible { outline: 3px solid var(--pc-accent); outline-offset: 3px; }
button, select, textarea, input { min-height: 44px; }
input[type="checkbox"], input[type="radio"] { inline-size: 44px; block-size: 44px; }
.viz a { min-height: 44px; display: inline-flex; align-items: center; }
#ask textarea { min-height: 44px; }
#go, .ib2 { width: 44px; height: 44px; flex-basis: 44px; }
#vbody a, #files a, #viewer a, #chat a { min-height: 44px; display: inline-flex; align-items: center; }
input { min-width: 44px; }
button:active, a:active { transform: none !important; }
#vhead .v-actions .btn, #source-repere .btn, #source-repere a { min-height: 48px !important; }
#msgs a { min-height: 44px !important; }
body.dark *, body.dark *::before, body.dark *::after { transition: none !important; }
html[data-theme="dark"] *, html[data-theme="dark"] *::before, html[data-theme="dark"] *::after { transition: none !important; }

.palette-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.palette-card { border: 1px solid var(--pc-ligne); border-radius: 12px; padding: 10px; background: var(--pc-panneau); text-align: left; }
.palette-card .swatches { display: flex; gap: 5px; margin: 8px 0; }
.palette-card .swatches i { display: block; width: 28px; height: 22px; border-radius: 5px; border: 1px solid var(--pc-ligne); }
.palette-card strong { display: block; }
.advanced-settings { margin-bottom: 12px; }
.advanced-settings > summary { cursor: pointer; min-height: 48px; padding: 12px 2px; font-weight: 700; }
.md-toolbar { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--pc-ligne); background: var(--pc-panneau); }
.md-toolbar button { min-width: 44px; }
.md-editor { max-width: 1100px; margin: 0 auto; padding: 12px; }
.md-editor textarea { width: 100%; min-height: min(60vh, 560px); resize: vertical; font: 15px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.md-editor .md-preview { min-height: 240px; margin-top: 12px; border: 1px solid var(--pc-ligne); border-radius: 10px; padding: 16px; background: var(--pc-panneau); }
.md-editor[data-mode="edit"] .md-preview { display: none; }
.md-editor[data-mode="preview"] textarea { display: none; }
.md-status { min-height: 1.5em; color: var(--pc-doux); margin: 6px 0; }
.md-conflict { color: var(--pc-danger); font-weight: 650; }
.palette-card[data-palette="neutral"] .swatches i:nth-child(1) { background: var(--pc-swatch-light); }
.palette-card[data-palette="neutral"] .swatches i:nth-child(2) { background: var(--pc-swatch-dark); }
.palette-card[data-palette="neutral"] .swatches i:nth-child(3) { background: var(--pc-swatch-accent); }
.palette-card[data-palette="blue"] .swatches i:nth-child(1) { background: var(--pc-swatch-light); }
.palette-card[data-palette="blue"] .swatches i:nth-child(2) { background: var(--pc-swatch-dark); }
.palette-card[data-palette="blue"] .swatches i:nth-child(3) { background: var(--pc-swatch-accent); }
.palette-card[data-palette="green"] .swatches i:nth-child(1) { background: var(--pc-swatch-light); }
.palette-card[data-palette="green"] .swatches i:nth-child(2) { background: var(--pc-swatch-dark); }
.palette-card[data-palette="green"] .swatches i:nth-child(3) { background: var(--pc-swatch-accent); }
.palette-card[data-palette="plum"] .swatches i:nth-child(1) { background: var(--pc-swatch-light); }
.palette-card[data-palette="plum"] .swatches i:nth-child(2) { background: var(--pc-swatch-dark); }
.palette-card[data-palette="plum"] .swatches i:nth-child(3) { background: var(--pc-swatch-accent); }
.palette-card[data-palette="contrast"] .swatches i { background: var(--pc-swatch-dark); }
/* ---------- module de conversation intégré (kernet-assistant) ---------- */
#ka-hote { display: none; }
body.ka-actif #chat > :not(#ka-hote) { display: none !important; }
body.ka-actif #ka-hote { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; overflow: hidden; }
body.ka-actif #chat { display: block; min-width: 0; min-height: 0; overflow: hidden; padding: 0; }
@media (min-width: 761px) {
  body.ka-actif.mode-split main {
    grid-template-columns: var(--w-arbre, 290px) 5px minmax(420px, 1fr) 5px minmax(320px, var(--split-chat, calc((100vw - var(--w-arbre, 290px) - 10px) / 2)));
  }
  body.ka-actif.mode-split.sansarbre main {
    grid-template-columns: 0 0 minmax(420px, 1fr) 5px minmax(320px, var(--split-chat, 50vw));
  }
  body.ka-actif.mode-split #s2 { display: block; }
}
.ka { --ka-accent: var(--pc-accent); --ka-fond: var(--pc-fond); --ka-texte: var(--pc-encre); --ka-bordure: var(--pc-ligne-2); }

/* ---------- Accueil : « À noter aujourd'hui » sans boîte (06/12, demande de Maxime) ---------- */
.home .parcours.active-dossier, body .home section.active-dossier {
  background: none !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important;
  outline: 0 !important; filter: none !important; backdrop-filter: none !important; padding: 0 !important; margin-inline: 0 !important;
}
.home .parcours.active-dossier::before, .home .parcours.active-dossier::after { content: none !important; display: none !important; }
.home .parcours.active-dossier .btn { box-shadow: none !important; }
/* ---------- Réglages d'affichage v12 : aperçu et application globale ---------- */
html { font-size: 100%; }
body { --ui-scale: 1; --ui-line: 1.55; --ui-letter: normal; --ui-paragraph: .45em; font-family: var(--ui-font, system-ui, sans-serif); line-height: var(--ui-line); letter-spacing: var(--ui-letter); font-size: 14.5px; }
body[data-text-size="90"] { --ui-scale: .9; font-size: 13.05px; }
body[data-text-size="100"] { --ui-scale: 1; font-size: 14.5px; }
body[data-text-size="115"] { --ui-scale: 1.15; font-size: 16.675px; }
body[data-text-size="130"] { --ui-scale: 1.3; font-size: 18.85px; }
body[data-font="reading"] { --ui-font: "Kernet Serif", Georgia, serif; }
body[data-font="local"] { --ui-font: "Kernet Sans", Arial, sans-serif; }
body[data-spacing="relaxed"] { --ui-line: 1.75; --ui-letter: .018em; --ui-paragraph: 1em; }
body[data-spacing="wide"] { --ui-line: 1.95; --ui-letter: .04em; --ui-paragraph: 1.35em; }
body[data-text-size] :is(button, input, select, textarea, .btn, .panel, .home, .viz, .doc, #chat, #tree, #viewer) { font-size: 1em; }
body[data-spacing="relaxed"] :is(.doc p, .a p, .home p, .panel p, .ka p) { margin-block: var(--ui-paragraph); }
body[data-spacing="wide"] :is(.doc p, .a p, .home p, .panel p, .ka p) { margin-block: var(--ui-paragraph); }
body[data-contrast="enhanced"] :is(.panel, .card, .recent, input, select, textarea, .btn) { border-width: 2px; }
body[data-contrast="max"] :is(.panel, .card, .recent, input, select, textarea, .btn) { border: 2px solid var(--pc-encre); box-shadow: none; }
.display-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.custom-colors { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.color-choice { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--pc-ligne); border-radius: 9px; padding: 8px 10px; cursor: pointer; }
.color-choice input[type="color"] { width: 42px; min-width: 42px; height: 36px; padding: 2px; }
.settings-preview { margin-top: 14px; padding: 14px; border: 2px solid var(--pc-accent-bord); border-radius: 10px; background: var(--pc-accent-fond); }
.settings-preview p { color: var(--pc-doux); max-width: 62ch; }
.ka { --ka-fond: var(--pc-fond); --ka-fond-lateral: var(--pc-panneau-2); --ka-surface: var(--pc-panneau-2); --ka-surface-forte: var(--pc-creux); --ka-texte: var(--pc-encre); --ka-texte-doux: var(--pc-doux); --ka-bordure: var(--pc-ligne-2); --ka-accent: var(--pc-accent); --ka-accent-texte: var(--pc-sur-accent); --ka-accent-doux: var(--pc-accent-fond); --ka-focus: var(--pc-accent); --ka-code-fond: var(--pc-creux); font-size: calc(15px * var(--ui-scale)); line-height: var(--ui-line); letter-spacing: var(--ui-letter); }
@media (max-width: 620px) { .display-grid { grid-template-columns: 1fr; } .palette-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sh-item .ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html[data-text-size="90"] body { --ui-scale: .9; } html[data-text-size="100"] body { --ui-scale: 1; } html[data-text-size="115"] body { --ui-scale: 1.15; } html[data-text-size="130"] body { --ui-scale: 1.3; }
html[data-font="reading"] body { --ui-font: "Kernet Serif", Georgia, serif; } html[data-font="local"] body { --ui-font: "Kernet Sans", Arial, sans-serif; }
html[data-spacing="relaxed"] body { --ui-line: 1.75; --ui-letter: .018em; --ui-paragraph: 1em; } html[data-spacing="wide"] body { --ui-line: 1.95; --ui-letter: .04em; --ui-paragraph: 1.35em; }
.palette-card[data-palette="slate"] .swatches i:nth-child(1) { background: var(--pc-swatch-light); }
.palette-card[data-palette="slate"] .swatches i:nth-child(2) { background: var(--pc-swatch-dark); }
.palette-card[data-palette="slate"] .swatches i:nth-child(3) { background: var(--pc-swatch-accent); }
.palette-card[data-palette="sage"] .swatches i:nth-child(1) { background: var(--pc-swatch-light); }
.palette-card[data-palette="sage"] .swatches i:nth-child(2) { background: var(--pc-swatch-dark); }
.palette-card[data-palette="sage"] .swatches i:nth-child(3) { background: var(--pc-swatch-accent); }
.palette-card[data-palette="sand"] .swatches i:nth-child(1) { background: var(--pc-swatch-light); }
.palette-card[data-palette="sand"] .swatches i:nth-child(2) { background: var(--pc-swatch-dark); }
.palette-card[data-palette="sand"] .swatches i:nth-child(3) { background: var(--pc-swatch-accent); }

/* ---------- Index des fichiers : rangée d'actions compacte (06/12) ---------- */
#arbreActions.arbre-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
#arbreActions .btn.ab { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; height: 40px;
  padding: 0 8px; font-size: .875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-radius: 8px; box-shadow: none; line-height: 1; }
#arbreActions .btn.ab svg { flex: 0 0 16px; }
#arbreActions .btn.ab span { overflow: hidden; text-overflow: ellipsis; }
#arbreActions .btn.ab { padding: 0 6px; gap: 5px; font-size: .8125rem; letter-spacing: 0; }
#arbreActions .btn.ab svg { width: 15px; height: 15px; flex-basis: 15px; }
#arbreActions.arbre-actions { display: flex; gap: 6px; }
#arbreActions .btn.ab { flex: 1 1 auto; min-width: max-content; }
#arbreActions.arbre-actions { flex-wrap: wrap; }
/* Lecture : la conversation est masquée (la règle .ka-actif ne doit pas la réafficher). */
@media (min-width: 761px) { body.ka-actif.mode-docs #chat, body.ka-actif.mode-docs #s2 { display: none !important; } }

/* Index des fichiers : hiérarchie légère, sans boîte lourde. */
#tree { border-inline-end: 0; background: var(--pc-fond); padding: 14px 12px 18px; }
#tree .index-titre { margin: 0 4px 12px; color: var(--pc-doux); font-size: .73rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
#tree .qwrap { margin: 0 2px 10px; padding: 0; border: 0; border-bottom: 1px solid var(--pc-ligne); border-radius: 0; background: transparent; }
#tree .qwrap:focus-within { border-bottom-color: var(--pc-accent); box-shadow: 0 2px 0 color-mix(in srgb, var(--pc-accent) 24%, transparent); }
#tree .qwrap input { min-height: 38px; border: 0; background: transparent; box-shadow: none; }
#arbreActions.arbre-actions { gap: 2px; margin: 4px 2px 12px; border-bottom: 1px solid var(--pc-ligne-2); padding-bottom: 8px; }
#arbreActions .btn.ab { min-height: 34px; height: 34px; border: 0; border-radius: 6px; background: transparent; color: var(--pc-doux); font-size: .78rem; }
#arbreActions .btn.ab:hover, #arbreActions .btn.ab:focus-visible { background: var(--pc-panneau); color: var(--pc-accent); }
#files .index-accueil { margin: 2px 0 8px; border: 0; border-inline-start: 2px solid transparent; border-radius: 0 7px 7px 0; background: transparent; color: var(--pc-doux); }
#files .index-accueil.sel { border-inline-start-color: var(--pc-accent); background: color-mix(in srgb, var(--pc-accent-fond) 72%, transparent); color: var(--pc-encre); font-weight: 700; }
.split { position: relative; z-index: 3; cursor: col-resize; background: transparent; }
.split::after { content: ""; position: absolute; inset: 0 1px; border-inline: 1px solid var(--pc-ligne-2); opacity: .8; }
.split:hover::after, .split:focus-visible::after, .split.drag::after { border-color: var(--pc-accent); background: color-mix(in srgb, var(--pc-accent) 10%, transparent); }
body.glisse, body.glisse * { cursor: col-resize !important; user-select: none !important; }
.palette-card { transition: border-color .15s, box-shadow .15s, transform .15s; }
.palette-card.selected { border-color: var(--pc-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--pc-accent) 20%, transparent); }
.palette-card.selected strong::after { content: " ✓"; color: var(--pc-accent); }

/* Barre Markdown : outils SVG, groupes lisibles et actions explicites. */
.md-toolbar { align-items: center; gap: 8px; padding: 8px 10px; background: var(--pc-fond); }
.md-toolbar-group { display: inline-flex; gap: 2px; align-items: center; }
.md-toolbar-sep { width: 1px; height: 24px; background: var(--pc-ligne); margin-inline: 2px; }
.md-toolbar .md-icon { min-width: 36px; width: 36px; height: 36px; min-height: 36px; padding: 7px; border: 0; border-radius: 6px; background: transparent; color: var(--pc-doux); }
.md-toolbar .md-icon:hover, .md-toolbar .md-icon:focus-visible, .md-toolbar .md-icon[aria-pressed="true"] { background: var(--pc-accent-fond); color: var(--pc-accent); }
.md-toolbar .md-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.md-toolbar .md-toggle { min-height: 36px; padding: 0 10px; border: 1px solid var(--pc-ligne); border-radius: 6px; background: transparent; color: var(--pc-doux); }
.md-toolbar .md-toggle[aria-pressed="true"] { border-color: var(--pc-accent); background: var(--pc-accent-fond); color: var(--pc-accent); }
.md-toolbar .md-save { min-height: 36px; padding-inline: 12px; }
.md-toolbar .secondaire { min-height: 36px; padding-inline: 12px; }
@media (max-width: 620px) {
  .md-toolbar { gap: 4px; overflow-x: auto; flex-wrap: nowrap; }
  .md-toolbar .md-save, .md-toolbar .secondaire { padding-inline: 9px; }
}

.form-builder-list { display: grid; gap: 8px; margin: 12px 0; }
.form-builder-row { display: grid; grid-template-columns: 24px minmax(110px, 1fr) minmax(110px, .8fr) minmax(0, 1fr) 30px 30px 30px 30px; gap: 6px; align-items: center; }
.form-builder-row input:not([type="checkbox"]) { min-width: 0; width: 100%; }
.partage-formulaire { display: grid; gap: 10px; margin-top: 12px; padding: 14px; border: 1px solid var(--pc-ligne); border-radius: 10px; background: var(--pc-panneau); }
.partage-formulaire code { overflow-wrap: anywhere; font-size: .82em; }
.qr-partage { display: grid; place-items: center; }
.qr-partage svg { width: min(230px, 72vw); height: auto; background: var(--pc-panneau); padding: 8px; border-radius: 8px; }
@media (max-width: 700px) { .form-builder-row { grid-template-columns: 24px minmax(0, 1fr) 44px 40px; } .form-builder-row select, .form-builder-row input:not([type="checkbox"]) { grid-column: 2 / -1; } }

/* ---------- Connexion sur téléphone : bandeau aux couleurs du thème, logo blanc (06/12) ---------- */
@media (max-width: 899.98px) {
  body.page-connexion { display: block; padding: 0; margin: 0; min-height: 100vh; background: var(--pc-fond); }
  main.cx { display: flex; flex-direction: column; min-height: 100vh; }
  .cx-presentation { display: flex; flex-direction: column; gap: 10px; padding: calc(22px + env(safe-area-inset-top)) 22px 26px;
    background: var(--pc-cadre); color: var(--pc-sur-cadre); }
  .cx-marque { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
  .cx-marque img { width: 36px; height: 32px; }
  .cx-titre { margin: 4px 0 0; font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 30px; line-height: 1.12; color: var(--pc-sur-cadre); }
  .cx-points, .cx-note { display: none; }
  main.cx > .connexion { width: auto; margin: -14px 16px 24px; padding: 24px 20px 20px; border-radius: 16px; box-shadow: none; }
  main.cx > .connexion .logo { display: none; }
  main.cx > .connexion h1 { font-size: 22px; }
}

/* ---------- En-tête sur téléphone : même bandeau que sur ordinateur, logo blanc lisible (06/12) ---------- */
@media (max-width: 760px) {
  body > header { color: var(--pc-sur-cadre); background: var(--pc-cadre); box-shadow: none; }
  header h1 { color: var(--pc-sur-cadre); }
  header .btn, header .pill { background: var(--pc-cadre-creux); color: var(--pc-sur-cadre); border-color: var(--pc-cadre-ligne); }
  header .logo { filter: none; }
}
