/* Hallmark · checked: 2026-11-27 · shape: app screen · direction: B Instrument · modes: light+dark */
/* =====================================================================================================================
   Onglets « outils » : Journal (journal, état, tâches, réorientation), Fichiers (arborescence, lecteur), Système.
   Refonte « Instrument », 27/11/2026. Uniquement les jetons et composants de style.css ; listes et tableaux à filets au
   lieu de cartes empilées ; chiffres en mono (.num) ; aucune bordure latérale, aucune ombre, pas de capitales espacées.
   Composants propres à ces onglets (préfixés) : .sys-kv (clé-valeur à libellé gauche, valeur libre), .sys-line (voyant +
   texte), .sys-index (sommaire collant), .sys-quota-row (jauge .meter de quota avec libellé, valeur et remise à zéro),
   .file-tree, .dash-layout (colonne principale + colonne latérale), .key-row. Chaque onglet commence par son en-tête d'écran (.screen-head, style.css). Dans un panneau,
   listes et tableaux sont bord à bord, séparés par des filets : jamais de second cadre (carte dans une carte).
   Sous 960 px : lignes empilées, cibles de 44 px.
   ===================================================================================================================== */

/* ---------- Commun aux trois onglets ---------- */
#tab-journal .card-head, #tab-files .card-head, #tab-system .card-head { flex-wrap: wrap; }
#tab-journal .card-head h2, #tab-files .card-head h2, #tab-system .card-head h2 { margin-right: auto; }
#tab-system .card-head .pill { white-space: normal; height: auto; min-height: 20px; padding-block: 2px; }
#tab-system .dot { flex: none; width: 8px; height: 8px; margin: 0; border-radius: var(--r-round); }
.dot.busy { background: var(--accent); animation: lamp 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .dot.busy { animation: none; } }
.sys-line { display: flex; align-items: baseline; gap: var(--s2); margin: 0 0 var(--s2); min-width: 0; overflow-wrap: anywhere; }
.sys-line > .dot { transform: translateY(-1px); }
.sys-note { margin: 0 0 var(--s2); font-size: var(--t-small); overflow-wrap: anywhere; }
.sys-sub { margin: var(--s4) 0 var(--s2); font-size: var(--t-small); font-weight: 600; color: var(--ink-2); }
/* Clé-valeur : libellé à gauche (largeur fixe), valeur libre ; empilé sous 640 px. */
.sys-kv { margin: 0; display: grid; font-size: var(--t-small); }
.sys-kv-row { display: grid; grid-template-columns: minmax(9rem, 14rem) minmax(0, 1fr); gap: var(--s3); padding: var(--s2) 0; border-top: 1px solid var(--rule); }
.sys-kv-row:first-child { border-top: 0; padding-top: 0; }
.sys-kv dt { color: var(--ink-2); }
.sys-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.sys-kv code { font-size: var(--t-meta); }
#tab-system details > summary { cursor: pointer; }
.list-meta.journal-time { color: var(--ink-3); }

/* ---------- Journal : colonne principale (journal) + colonne latérale (état, tâches, réorientation) ---------- */
.dash-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s5); align-items: start; }
.dash-main, .dash-side { display: grid; gap: var(--s5); min-width: 0; }
.dash-layout .card { margin: 0; }
.dash-card { padding: 0; }
.dash-card > .card-head { min-height: 48px; margin: 0; padding: var(--s2) var(--s4); border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.dash-card .empty-state { margin: var(--s4); width: auto; }
.dash-meta { font-size: var(--t-small); color: var(--ink-3); }
.dash-help { margin: var(--s3) var(--s4) 0; max-width: 72ch; font-size: var(--t-small); color: var(--ink-3); }
.journal-body { padding: 0 var(--s4) var(--s3); }
/* Tâches planifiées */
.dash-tasks { margin-top: var(--s2); }
.dash-tasks .task { align-items: center; padding: var(--s3) var(--s4); }
.task-instruction { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-meta { display: block; margin-top: 2px; font-size: var(--t-meta); color: var(--ink-3); overflow-wrap: anywhere; }
.task-due { color: var(--ink-2); }
.task-error { display: block; margin-top: var(--s1); font-size: var(--t-small); color: var(--ko); overflow-wrap: anywhere; }
.task.st-done .task-instruction, .task.st-failed .task-instruction, .task.st-cancelled .task-instruction { color: var(--ink-2); }
.task.st-cancelled .task-instruction { text-decoration: line-through; text-decoration-color: var(--ink-3); }
/* Ce sur quoi elle travaille (ETAT.md, texte de l'IA) ; réorientation. */
.state-meta { margin: var(--s3) var(--s4) 0; font-size: var(--t-meta); color: var(--ink-3); }
.state-text { padding: var(--s2) var(--s4) var(--s4); max-width: 80ch; font-size: var(--t-small); overflow-wrap: anywhere; }
.state-text h1, .state-text h2 { margin: var(--s4) 0 var(--s1); font-size: var(--t-body); }
.state-text h3 { margin: var(--s3) 0 var(--s1); font-size: var(--t-small); }
.state-text ul, .state-text ol { padding-left: 1.2rem; }
.redirect-form { display: grid; gap: var(--s2); padding: var(--s3) var(--s4) var(--s4); }
.redirect-form button { justify-self: start; }

/* ---------- Journal : entrées ---------- */
.journal-head .journal-count { font-size: var(--t-small); }
.journal-filters { display: flex; flex-wrap: wrap; gap: var(--s2); }
.journal-filters select { width: auto; min-width: 10rem; font-size: var(--t-small); }
.journal-day { position: sticky; top: calc(-1 * var(--s6)); z-index: 1; margin: var(--s4) 0 0; padding: var(--s2) 0; background: var(--panel); border-bottom: 1px solid var(--rule); font-size: var(--t-small); font-weight: 600; color: var(--ink-2); }
#journal > .journal-day:first-child { margin-top: 0; }
.journal-list .list-row { display: grid; grid-template-columns: 3.5rem 6.5rem minmax(0, 1fr); gap: var(--s3); }
.journal-list .list-row:first-child { border-top: 0; }
.journal-type .pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.journal-title { font-weight: 500; }
.journal-detail { margin-top: var(--s1); font-size: var(--t-small); color: var(--ink-2); max-width: 75ch; }
.journal-detail p, .journal-detail ul, .journal-detail ol { margin: var(--s1) 0; }
.journal-detail ul, .journal-detail ol { padding-left: var(--s5); }

/* ---------- Fichiers : arborescence et lecteur ---------- */
.files { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.files > .card { margin-bottom: 0; }
.files-nav { position: sticky; top: var(--s4); max-height: calc(100dvh - 2 * var(--s6)); overflow-y: auto; padding: var(--s3); }
.files-nav .card-head { padding: 0 var(--s1); margin-bottom: var(--s2); }
.file-tree, .file-tree ul { list-style: none; margin: 0; padding: 0; }
.file-tree ul { padding-left: var(--s4); margin-left: var(--s2); border-left: 1px solid var(--rule); }
.file-tree a, .file-dir summary { display: flex; align-items: center; gap: var(--s2); min-height: 28px; padding: 2px var(--s2); border-radius: var(--r-ctl); color: var(--ink); text-decoration: none; font-size: var(--t-small); min-width: 0; }
.file-tree a svg.i, .file-dir summary svg.i { color: var(--ink-3); }
.file-tree a:hover, .file-dir summary:hover { background: var(--hover); }
.file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-tree a.current { background: var(--accent-soft); color: var(--accent-text); font-weight: 500; }
.file-tree a.current svg.i { color: var(--accent-text); }
.file-dir summary { list-style: none; color: var(--ink-2); font-weight: 500; }
.file-dir summary::-webkit-details-marker { display: none; }
.file-dir summary::after { content: ""; width: 6px; height: 6px; margin-left: auto; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(-45deg); transition: transform .15s ease; flex: none; }
.file-dir details[open] > summary::after { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) { .file-dir summary::after { transition: none; } }
.file-dir-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-dir-count { color: var(--ink-3); font-size: var(--t-meta); }
.files-reader { padding: var(--s5) var(--s6) var(--s6); }
.files-reader-head { padding-bottom: var(--s3); border-bottom: 1px solid var(--rule); }
.file-title { font: 500 var(--t-small)/1.4 var(--font-num); color: var(--ink-2); overflow-wrap: anywhere; }
.files-reader:has(#file-empty) .files-reader-head { display: none; }
#file-empty { border: 0; padding: var(--s8) var(--s4); }
/* Lecture Markdown : colonne de 72 caractères, titres hiérarchisés, tableaux à filets, code en mono. */
.file-content.md { max-width: 72ch; font-size: var(--t-body); line-height: 1.65; overflow-wrap: anywhere; }
.file-content.md.is-raw { max-width: none; }
.file-content h1 { margin: var(--s2) 0 var(--s4); font-size: var(--t-screen); }
.file-content h2 { margin: var(--s7) 0 var(--s2); font-size: var(--t-title); }
.file-content h3 { margin: var(--s6) 0 var(--s2); font-size: var(--t-body); }
.file-content h4, .file-content h5, .file-content h6 { margin: var(--s4) 0 var(--s1); font-size: var(--t-small); color: var(--ink-2); }
.file-content p, .file-content ul, .file-content ol, .file-content blockquote, .file-content pre, .file-content .table-wrap { margin: 0 0 var(--s4); }
.file-content ul, .file-content ol { padding-left: var(--s6); }
.file-content li + li { margin-top: var(--s1); }
.file-content li > ul, .file-content li > ol { margin: var(--s1) 0 0; }
.file-content blockquote { padding: var(--s2) var(--s4); background: var(--sunk); border-radius: var(--r-ctl); color: var(--ink-2); }
.file-content blockquote > :last-child { margin-bottom: 0; }
.file-content hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s6) 0; }
.file-content img { max-width: 100%; height: auto; border-radius: var(--r-ctl); }
.file-content pre { padding: var(--s3) var(--s4); background: var(--sunk); border-radius: var(--r-ctl); font-size: var(--t-small); line-height: 1.5; white-space: pre-wrap; }
.file-content pre code { padding: 0; background: none; }
.file-content .table-wrap { border: 1px solid var(--rule); border-radius: var(--r-box); }
.file-content table { border-collapse: collapse; width: 100%; font-size: var(--t-small); line-height: 1.45; }
.file-content th, .file-content td { border: 0; border-bottom: 1px solid var(--rule); padding: var(--s2) var(--s3); }
.file-content tbody tr:last-child td { border-bottom: 0; }
.file-raw { margin: 0; font-size: var(--t-small); line-height: 1.55; }

/* ---------- Système ---------- */
.sys-index { position: sticky; top: calc(-1 * var(--s6)); z-index: 2; display: flex; gap: var(--s1); margin: 0 calc(-1 * var(--s2)) var(--s4); padding: var(--s3) var(--s2); background: var(--canvas); border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.sys-index::-webkit-scrollbar { display: none; }
.sys-index button { flex: none; }
#tab-system .card { scroll-margin-top: 64px; }
#tab-system .card h2:focus { outline: none; }
#tab-system .card h2:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Santé */
#health-card .card-head { margin-bottom: var(--s4); }
.health-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
#status-body { margin-bottom: var(--s3); }
#status-body .sys-kv { margin-top: var(--s3); }
#status-card .health-actions { align-items: center; }
#ia-login { display: flex; gap: var(--s2); align-items: flex-start; padding: var(--s2) var(--s3); background: var(--attn-soft); border-radius: var(--r-ctl); color: var(--ink); font-size: var(--t-small); overflow-wrap: anywhere; }
#ia-login svg.i { color: var(--attn); margin-top: 2px; }
.health-checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s6); border-top: 1px solid var(--rule); }
.health-check { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; column-gap: var(--s2); row-gap: 2px; padding: var(--s2) 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.health-check .hc-label { font-weight: 500; font-size: var(--t-small); }
.health-check .hc-level:not(.is-ok):not(.is-attn):not(.is-ko) { background: transparent; color: var(--ink-3); padding: 0; }
.health-check .hc-msg { grid-column: 2 / -1; font-size: var(--t-meta); color: var(--ink-3); overflow-wrap: anywhere; }
.health-check.lvl-crit .hc-msg, .health-check.lvl-warn .hc-msg { color: var(--ink-2); }
.health-checked { margin: var(--s2) 0 var(--s4); font-size: var(--t-meta); }
.health-alerts-zone h3 { display: flex; align-items: baseline; gap: var(--s2); margin: 0 0 var(--s1); font-size: var(--t-small); color: var(--ink-2); }
.health-alerts { list-style: none; margin: 0; padding: 0; font-size: var(--t-small); }
.health-alert { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) auto; column-gap: var(--s3); align-items: baseline; padding: var(--s2) 0; border-top: 1px solid var(--rule); }
.health-alert:first-child { border-top: 0; }
.health-alert .ha-when { color: var(--ink-3); font-size: var(--t-meta); }
.health-alert .ha-text { min-width: 0; overflow-wrap: anywhere; }
.health-alert .ha-text .dot { display: inline-block; margin-right: var(--s2); transform: translateY(-1px); }
.health-alert .ha-delivery { font-size: var(--t-meta); text-align: right; }
.health-alert-empty { padding: var(--s1) 0; }

/* Grilles de cartes, prochains passages */
.sys-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--s4); margin-bottom: var(--s4); align-items: start; }
.sys-grid > .card { margin-bottom: 0; }
.sys-jobs { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--rule); font-size: var(--t-small); }
.sys-jobs summary { color: var(--ink-2); font-weight: 500; }
.sys-jobs .list { margin-top: var(--s2); }
.sys-jobs .list-row { padding: var(--s1) 0; align-items: baseline; }
.sys-bullets { margin: var(--s2) 0 0; padding-left: var(--s5); font-size: var(--t-small); }
#theme-card fieldset.segmented { margin: 0 0 var(--s2); }
#notif-card .access-actions { margin: var(--s2) 0 0; }

/* Clés des services : une ligne par clé (libellé, lien, champ masqué, actions) ; état à droite. */
#keys-card > p { margin: 0 0 var(--s2); max-width: 72ch; font-size: var(--t-small); }
.keys-list .key-row { align-items: flex-start; }
.key-form { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); max-width: 40rem; }
.key-form input { flex: 1 1 14rem; min-width: 0; font-family: var(--font-num); }
.key-actions { display: flex; gap: var(--s2); }

/* Sécurité : mot de passe, sessions */
#security-card h3 { margin: var(--s5) 0 var(--s2); font-size: var(--t-small); color: var(--ink-2); }
#security-card .password-form h3 { margin-top: 0; }
#security-card > p { margin: 0 0 var(--s3); max-width: 72ch; font-size: var(--t-small); }

/* Sauvegardes */
#backup-intro { margin: 0 0 var(--s4); max-width: 72ch; font-size: var(--t-small); }
.backup-summary { margin-bottom: var(--s4); }
.backup-summary .sys-kv { margin-top: var(--s3); }
.backup-tech { margin-top: var(--s2); font-size: var(--t-small); }
.backup-tech summary { color: var(--ink-2); width: fit-content; }
.backup-tech .sys-kv { margin-top: var(--s2); }
.backup-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin: 0 0 var(--s4); }
.backup-actions p { margin: 0; font-size: var(--t-small); }
.backup-list { list-style: none; margin: 0 0 var(--s5); padding: 0; border-block: 1px solid var(--rule); }
.backup-list:has(> .empty-state) { border: 0; }
.backup-item { display: grid; grid-template-columns: minmax(0, 1fr) 6rem auto; column-gap: var(--s4); align-items: center; padding: var(--s2) 0; border-top: 1px solid var(--rule); font-size: var(--t-small); }
.backup-item:first-child { border-top: 0; }
.backup-item .bk-when { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); white-space: normal; }
.backup-item .bk-when .pill { font-family: var(--font-ui); }
.backup-item .bk-name { flex-basis: 100%; font: 400 var(--t-meta) var(--font-num); color: var(--ink-3); overflow-wrap: anywhere; }
.backup-item .bk-size { text-align: right; color: var(--ink-2); }
.backup-item .bk-dl { display: inline-flex; align-items: center; gap: var(--s1); justify-self: end; white-space: nowrap; }
.passphrase-zone { padding-top: var(--s4); border-top: 1px solid var(--rule); }
.passphrase-zone h3 { margin: 0 0 var(--s2); font-size: var(--t-small); color: var(--ink-2); }
.passphrase-zone > p { margin: 0 0 var(--s3); font-size: var(--t-small); max-width: 72ch; }
.passphrase-warning { padding: var(--s2) var(--s3); background: var(--attn-soft); border-radius: var(--r-ctl); color: var(--ink) !important; }
.passphrase-warning svg.i { color: var(--attn); margin-right: var(--s1); }
.passphrase-form { display: grid; gap: var(--s3); max-width: 30rem; margin-top: var(--s2); }
.passphrase-form label > span { display: block; margin-bottom: var(--s1); font-size: var(--t-small); font-weight: 500; color: var(--ink-2); }
.passphrase-form .check-line { display: flex; gap: var(--s2); align-items: flex-start; }
.passphrase-form .check-line input { margin-top: var(--s1); }
.passphrase-form .check-line span { display: inline; margin: 0; font-size: var(--t-small); font-weight: 400; color: var(--ink); }
.passphrase-form-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.passphrase-form .error { margin: 0; font-size: var(--t-small); }
.passphrase-form .error:empty { display: none; }
.passphrase-reveal { margin-top: var(--s2); display: grid; gap: var(--s2); max-width: 40rem; }
.passphrase-value { display: block; padding: var(--s3); border: 1px dashed var(--accent); border-radius: var(--r-ctl); background: var(--sunk); font-size: var(--t-small); overflow-wrap: anywhere; word-break: break-all; user-select: all; }

/* Réglages : sections à filet, libellés au-dessus, unités à droite, erreurs sous le champ, barre d'actions collante. */
#settings-card > p { margin: 0 0 var(--s2); max-width: 72ch; font-size: var(--t-small); overflow-wrap: anywhere; }
#settings-form fieldset { min-width: 0; margin: var(--s5) 0 0; padding: var(--s4) 0 0; border: 0; border-top: 1px solid var(--rule); }
#settings-form legend { float: left; width: 100%; margin: 0 0 var(--s3); padding: 0; font-size: var(--t-body); font-weight: 600; }
#settings-form legend + * { clear: both; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: var(--s4) var(--s5); align-items: start; }
.settings-grid + .settings-grid, #settings-form fieldset > .field + .settings-grid { margin-top: var(--s4); }
#settings-form .field > label, #settings-form .field-label { color: var(--ink); }
#settings-form .field-help { max-width: 48ch; }
#settings-form .field-error:not([hidden]) { display: flex; gap: var(--s1); }
.field.has-error > label, .field.has-error .field-label { color: var(--ko); }
.input-unit { display: flex; align-items: center; gap: var(--s2); }
.input-unit input { flex: 1; min-width: 0; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.input-unit span { color: var(--ink-3); font-size: var(--t-small); white-space: nowrap; }
.switch { position: relative; display: flex; align-items: flex-start; gap: var(--s3); cursor: pointer; font-size: var(--t-small); color: var(--ink-2); }
.switch input { position: absolute; top: 0; left: 0; opacity: 0; width: 1px; height: 1px; margin: 0; }
.switch-track { position: relative; flex: none; width: 34px; height: 20px; border-radius: var(--r-round); background: var(--rule-2); transition: background .15s ease; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: var(--r-round); background: var(--panel); transition: transform .15s ease; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(14px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch input:disabled + .switch-track { background: var(--sunk); outline: 1px dashed var(--rule-2); }
@media (prefers-reduced-motion: reduce) { .switch-track, .switch-track::after { transition: none; } }
.field-wide { grid-column: 1 / -1; }
.cron-list { display: grid; gap: var(--s2); margin-bottom: var(--s2); }
.list-add { align-self: flex-start; }
.list-empty { margin: 0 0 var(--s2); font-size: var(--t-small); }
.wakeup-row { min-width: 0; }
.wakeup-fields { display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 14rem) auto; gap: var(--s2); align-items: center; }
.cron-fields { grid-template-columns: minmax(0, 14rem) auto; }
.wakeup-fields .wk-cron { font-family: var(--font-num); }
.wakeup-fields .wk-remove { width: var(--h-ctl); padding: 0; }
.wakeup-fields .wk-remove:hover { color: var(--ko); }
.wk-preview { margin: 2px 0 0; font-size: var(--t-meta); overflow-wrap: anywhere; }
.settings-actions { position: sticky; bottom: calc(-1 * var(--s6)); z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin: var(--s6) calc(-1 * var(--s4)) 0; padding: var(--s3) var(--s4); background: var(--panel); border-top: 1px solid var(--rule); }
.settings-status { flex: 1 1 16rem; margin: 0; font-size: var(--t-small); overflow-wrap: anywhere; }
.settings-status svg.i { margin-right: var(--s1); }
.settings-status.ok { color: var(--ok); } .settings-status.warn { color: var(--attn); } .settings-status.error { color: var(--ko); }
.settings-status code { word-break: break-all; }
/* Historique des sessions */
#runs-card .card-head .muted { font-size: var(--t-small); }
#runs { border-top: 1px solid var(--rule); }
.runs-table th:first-child, .runs-table td:first-child { padding-left: 0; }
.runs-table th:last-child, .runs-table td:last-child { padding-right: 0; }
#runs:has(> .empty-state) { border: 0; }
.runs-table td { vertical-align: baseline; }
.runs-table .runs-when { white-space: nowrap; }
.runs-model { font-size: var(--t-meta); background: none; padding: 0; }
.runs-state { min-width: 12rem; }
.runs-error { overflow-wrap: anywhere; }

/* Session et appareils */
.access-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ---------- Tablette et téléphone ---------- */
@media (max-width: 1180px) {
  .dash-layout { grid-template-columns: minmax(0, 1fr); }
  .dash-side { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); align-items: start; }
  .sys-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .files { grid-template-columns: minmax(0, 1fr); }
  .files-nav { position: static; max-height: none; }
  .file-tree a, .file-dir summary { min-height: 40px; }
  .files-reader { padding: var(--s4); }
  .health-checks { grid-template-columns: minmax(0, 1fr); }
  .sys-index { top: calc(-1 * var(--s4)); margin: 0 calc(-1 * var(--s4)) var(--s4); padding: var(--s2) var(--s4); }
  .journal-day { top: calc(-1 * var(--s4)); }
  .settings-actions { bottom: calc(-1 * var(--s4)); }
}
@media (max-width: 640px) {
  .journal-head .journal-filters { width: 100%; }
  .journal-filters select { flex: 1 1 9rem; min-width: 0; }
  .journal-list .list-row { grid-template-columns: 3rem minmax(0, 1fr); row-gap: var(--s1); }
  .journal-type { grid-column: 2; grid-row: 1; }
  .journal-list .list-main { grid-column: 2; }
  .keys-list .key-row { flex-direction: column; gap: var(--s2); }
  .keys-list .list-aside { order: -1; }
  .key-actions { width: 100%; }
  .key-actions button { flex: 1 1 auto; }
  .cron-fields { grid-template-columns: minmax(0, 1fr) auto; }
  .file-content.md { font-size: var(--t-body); line-height: 1.6; }
  .sys-kv-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .health-alert { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
  .health-alert .ha-delivery { text-align: left; }
  .health-actions, .access-actions, .backup-actions { width: 100%; }
  .health-actions button, .access-actions button { flex: 1 1 auto; }
  .backup-item { grid-template-columns: minmax(0, 1fr) auto; row-gap: var(--s1); padding: var(--s2) 0; }
  .backup-item .bk-size { grid-column: 1; grid-row: 2; text-align: left; }
  .backup-item .bk-dl { grid-column: 2; grid-row: 1 / span 2; }
  .wakeup-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; }
  .settings-actions button { flex: 1 1 auto; }
  /* Historique : une session par bloc, libellé de colonne devant chaque valeur. */
  #runs { border: 0; overflow: visible; }
  .runs-table, .runs-table tbody, .runs-table tr, .runs-table td { display: block; }
  .runs-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .runs-table tr { padding: var(--s2) 0; border-top: 1px solid var(--rule); }
  .runs-table tbody tr:first-child { border-top: 0; }
  .runs-table td { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: var(--s2); padding: 2px 0; border: 0; text-align: left; white-space: normal !important; }
  .runs-table td::before { content: attr(data-label); color: var(--ink-3); font-size: var(--t-meta); font-family: var(--font-ui); }
  .runs-state { min-width: 0; }
}
