/* Écran Personnalisation de l'Administration (parametrage.js) : Identité et Paramétrage des calculs, interface 2.5.
   Propriété de l'agent PARAMÉTRAGE ÉCRAN. Uniquement les jetons de app.css (docs/INTERFACE.md, points 8 et 9) : aucune
   couleur en dur, aucun attribut style dans le HTML produit ; la largeur du volet (--prm-w) et les couleurs d'aperçu de
   l'identité (--apercu-*) sont posées par le CSSOM. Densité Studio : texte 12 px, lignes 24 px, rayons 2 à 4 px.
   Les natures ne se lisent jamais par la couleur seule : chaque pastille porte sa lettre (R, P, O, S, ƒ) et sa forme. */

/* ===================== Ossature ===================== */
.prm { flex: 1 1 0; min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--e3); }
.prm .espace { flex: 1; }
.prm mark { background: var(--warn-bg); color: var(--ink); border-radius: var(--r1); padding: 0 1px; }
.prm .nd { color: var(--ink-2); font-style: italic; }
.prm-panneau { flex: 1 1 0; min-height: 0; min-width: 0; display: flex; flex-direction: column; }

/* Bande des deux parties (onglets à deux lignes, façon ruban de Studio). */
.prm-parties { flex: none; height: 36px; display: flex; align-items: stretch; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r1); overflow: hidden; }
.prm-partie { display: inline-flex; align-items: center; gap: var(--e4); padding: 0 var(--e5); border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--ink-2); text-align: left; }
.prm-partie > span { display: flex; flex-direction: column; line-height: 1.2; }
.prm-partie strong { font-size: var(--fs-m); font-weight: 600; }
.prm-partie small { font-size: var(--fs-xs); }
.prm-partie .ic { width: 18px; height: 18px; }
.prm-partie:hover { background: var(--bg-3); color: var(--ink); }
.prm-partie[aria-selected="true"] { background: var(--grid-bg); color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.prm-partie[aria-selected="true"] .ic { color: var(--accent-texte); }
.prm-partie:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.prm-parties-note { align-self: center; padding: 0 var(--e5); color: var(--ink-2); font-size: var(--fs-s); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }

/* ===================== Identité ===================== */
.prm-identite > .panneau { flex: 1 1 0; }

/* ===================== Atelier du paramétrage ===================== */
.prm-studio { display: grid; grid-template-columns: var(--prm-w, 264px) 5px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--r1); background: var(--grid-bg); overflow: hidden; }
.prm-studio[hidden] { display: none; }
.prm-studio.redim { cursor: col-resize; user-select: none; }
.prm-studio.redim * { cursor: col-resize; }

/* Volet gauche : recherche, arbre, pied. */
.prm-volet { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--bg-1); }
.prm-recherche { flex: none; height: 28px; display: flex; align-items: center; gap: var(--e2); padding: 0 var(--e3); border-bottom: 1px solid var(--line); color: var(--ink-2); }
.prm-recherche .champ { flex: 1; min-width: 0; height: 20px; }
.prm-arbre { flex: 1 1 0; min-height: 0; overflow: auto; margin: 0; padding: 0; list-style: none; scrollbar-width: thin; scrollbar-color: var(--line-fort) transparent; }
.prm-arbre ul { margin: 0; padding: 0; list-style: none; }
.prm-arbre-vide { padding: var(--e4); color: var(--ink-2); font-size: var(--fs-s); line-height: 1.45; }
.prm-sec { outline: none; }
.prm-sec-tete { position: sticky; top: 0; z-index: 1; height: 22px; display: flex; align-items: center; gap: var(--e2); padding: 0 var(--e4) 0 var(--e3); background: var(--bg-2); border-bottom: 1px solid var(--line); color: var(--ink); font-size: var(--fs-s); font-weight: 600; cursor: pointer; white-space: nowrap; }
.prm-sec-tete .ic { color: var(--ink-2); transition: transform var(--duree); }
.prm-sec[aria-expanded="true"] > .prm-sec-tete .ic { transform: rotate(90deg); }
.prm-sec[aria-expanded="false"] > ul { display: none; }
.prm-sec-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* 2.36.0, L12.18 : titre d'un sous-groupe (groupe « Geodata ») dans l'arbre des sections. */
.prm-sous-groupe { padding: var(--e2) var(--e4) var(--e1) var(--e5, var(--e4)); color: var(--ink-2); font-size: var(--fs-s); font-weight: 600; }
.prm-sec-tete .nb, .prm-el .nb { flex: none; color: var(--ink-2); font-size: var(--fs-s); font-weight: 400; font-variant-numeric: tabular-nums; }
.prm-sec:focus-visible > .prm-sec-tete { outline: 2px solid var(--focus); outline-offset: -2px; }
.prm-el { height: var(--h-ligne); display: flex; align-items: center; gap: var(--e3); padding: 0 var(--e4) 0 22px; border-bottom: 1px solid var(--grid-line); font-size: var(--fs-m); cursor: pointer; white-space: nowrap; }
.prm-el:hover { background: var(--survol); }
.prm-el[aria-selected="true"] { background: var(--choisi-panneau); box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
.prm-el:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.prm-el-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.prm-el-verrou { flex: none; display: inline-flex; color: var(--ink-2); }
.prm-el .nb.nd { font-style: italic; }
.prm-volet-pied { flex: none; height: 22px; display: flex; align-items: center; padding: 0 var(--e4); border-top: 1px solid var(--line); color: var(--ink-2); font-size: var(--fs-s); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Séparateur réglable. */
.prm-sep { min-height: 0; background: var(--bg-1); border-left: 1px solid var(--line); border-right: 1px solid var(--line); cursor: col-resize; touch-action: none; }
.prm-sep:hover, .prm-studio.redim .prm-sep { background: var(--accent); }
.prm-sep:focus-visible { outline: 2px solid var(--focus); outline-offset: -1px; background: var(--accent); }

/* Pastilles de nature : lettre + forme + teinte (jamais la teinte seule). */
.prm-nat { flex: none; width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid currentColor; border-radius: var(--r1); font: 700 var(--fs-xs)/1 var(--font); }
.prm-nat.p { width: 14px; height: 14px; font-size: var(--fs-xxs); }
.prm-nat[data-nat="referentiel"] { color: var(--info); background: var(--info-bg); }
.prm-nat[data-nat="parametre"], .prm-nat[data-nat="element"] { color: var(--accent-texte); border-radius: 50%; }
.prm-nat[data-nat="ouverture"] { color: var(--ok); background: var(--ok-bg); border-width: 2px; }
.prm-nat[data-nat="champ"] { color: var(--ink-2); border-style: dashed; }
.prm-nat[data-nat="calcul"] { color: var(--serie-1); font-style: italic; border-radius: var(--r3); }

/* Zone principale : onglets des vues, vues. */
.prm-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.prm-vues { flex: none; height: var(--h-onglets); display: flex; align-items: stretch; background: var(--bg-1); border-bottom: 1px solid var(--line); }
.prm-vue-onglet { display: inline-flex; align-items: center; gap: var(--e3); padding: 0 var(--e5); border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--ink-2); font-size: var(--fs-m); white-space: nowrap; }
.prm-vue-onglet:hover { background: var(--bg-3); color: var(--ink); }
.prm-vue-onglet[aria-selected="true"] { background: var(--grid-bg); color: var(--ink); font-weight: 600; box-shadow: inset 0 2px 0 var(--accent); }
.prm-vue-onglet:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.prm-droits { align-self: center; display: inline-flex; align-items: center; gap: var(--e2); min-width: 0; padding: 0 var(--e4); color: var(--ink-2); font-size: var(--fs-s); white-space: nowrap; overflow: hidden; }
.prm-droits span { overflow: hidden; text-overflow: ellipsis; }
.prm-vue { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.prm-vue[hidden] { display: none; }
.prm-indispo { padding: var(--e4); display: grid; align-content: start; gap: var(--e4); max-width: 820px; }
.prm-defile { flex: 1 1 0; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-fort) transparent; }
.prm-note { padding: var(--e2) var(--e4); color: var(--ink-2); font-size: var(--fs-s); line-height: 1.45; }
.prm-bandeau { flex: none; padding: var(--e2) var(--e4); background: var(--bg-1); border-bottom: 1px solid var(--line); }
.prm-coche { display: inline-flex; align-items: center; gap: var(--e3); font-size: var(--fs-m); }
.prm-kv { display: inline-block; margin-right: var(--e3); white-space: nowrap; }
.prm-kv b { color: var(--ink-2); font-weight: 600; }

/* ===================== Vue Élément ===================== */
.prm-fiche { flex: none; background: var(--bg-1); border-bottom: 1px solid var(--line); }
.prm-fiche-l1 { height: 28px; display: flex; align-items: center; gap: var(--e3); padding: 0 var(--e4); }
.prm-fiche-l1 h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-l); }
.prm-ecriture { flex: none; display: inline-flex; align-items: center; gap: var(--e2); padding: 0 var(--e3); height: 18px; border: 1px solid var(--line-fort); border-radius: var(--r1); font-size: var(--fs-s); color: var(--ink-2); }
.prm-ecriture[data-ok="true"] { color: var(--ok); border-color: currentColor; }
.prm-props { display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--grid-line); }
.prm-props > div { min-width: 96px; display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: var(--e2) var(--e4); border-right: 1px solid var(--grid-line); }
.prm-props > div.large { flex: 1 1 240px; }
.prm-props dt { color: var(--ink-2); font-size: var(--fs-xs); white-space: nowrap; }
.prm-props dd { margin: 0; font-size: var(--fs-m); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prm-source { font: var(--fs-s)/1.3 var(--mono); color: var(--ink); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r1); padding: 0 var(--e2); }
/* Raison de la lecture seule : bulle (i) à côté de l'état « Lecture seule » de la fiche (bulles.js, 04/11/2026). */

.prm-corps { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
.prm-corps[data-usages="non"] { grid-template-columns: minmax(0, 1fr); }
.prm-corps[data-usages="non"] .prm-usages { display: none; }
.prm-feuilles { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.prm-feuille { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.prm-feuille[hidden] { display: none; }
.prm-feuille > * { flex: 1 1 0; min-height: 0; }
.prm-feuille > .chargement, .prm-feuille > .prm-indispo { flex: none; }

/* Encart « Utilisé dans » (lignage, façon vue Modèle). */
.prm-usages { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--bg-1); border-left: 1px solid var(--line); }
.prm-usages .panneau-tete h3 { display: inline-flex; align-items: center; gap: var(--e2); }
.prm-usages-corps { flex: 1 1 0; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-fort) transparent; }
.prm-usages-corps:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.prm-usages-liste { margin: 0; padding: 0; list-style: none; }
.prm-usage { display: grid; gap: var(--e2); padding: var(--e3) var(--e4); border-bottom: 1px solid var(--grid-line); }
.prm-usage:hover { background: var(--survol); }
.prm-usage-tete { display: flex; align-items: center; gap: var(--e3); min-width: 0; font-size: var(--fs-m); }
.prm-usage-tete strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prm-usage-puces { display: flex; flex-wrap: wrap; gap: var(--e2); }
.prm-formule { font: var(--fs-s)/1.5 var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.prm-formule .res { font-weight: 700; }
.prm-formule .op { color: var(--accent-texte); font-weight: 700; }
.prm-usage .prm-formule { padding: var(--e2) var(--e3); background: var(--grid-bg); border: 1px solid var(--grid-line); border-left: 2px solid var(--serie-1); border-radius: var(--r1); }

.prm-histo td { white-space: normal; vertical-align: top; height: auto; padding-top: 3px; padding-bottom: 3px; line-height: 1.4; }

/* ===================== Vue Carte des calculs ===================== */
.prm-carte-outils { gap: var(--e3); }
.prm-carte-outils .champ { height: 20px; max-width: 280px; }
.prm-champ-l { color: var(--ink-2); font-size: var(--fs-s); }
.prm-zoom { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.prm-legende { display: inline-flex; align-items: center; gap: var(--e4); color: var(--ink-2); font-size: var(--fs-s); }
.prm-legende > span { display: inline-flex; align-items: center; gap: var(--e2); }
/* Aides de la feuille Valeurs dans leur bulle « Aide » (bulles.js) : une aide par ligne, icône comprise. */
.prm-aide-liste { display: grid; gap: var(--e2); }
.prm-aide-liste > span { display: inline-flex; align-items: center; gap: var(--e2); }
.prm-carte-zone { flex: 1 1 0; min-height: 0; overflow: auto; display: flex; flex-direction: column; background-color: var(--grid-bg);
  background-image: radial-gradient(circle, var(--grid-line) 1px, transparent 1.2px); background-size: 16px 16px; scrollbar-width: thin; scrollbar-color: var(--line-fort) transparent; }
.prm-carte-zone > .prm-defile { background: var(--grid-bg); }
.prm-carte { display: block; flex: none; font-family: var(--font); }
.prm-c-col { fill: var(--ink-2); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.prm-c-groupe { fill: var(--ink-2); font-size: 10px; font-weight: 600; }
.prm-lien { fill: none; stroke: var(--line-fort); stroke-width: 1.3; transition: opacity var(--duree); }
.prm-lien[data-nat="element"] { stroke: var(--accent-texte); }
.prm-lien[data-nat="champ"] { stroke: var(--ink-2); stroke-dasharray: 3 3; }
.prm-lien[data-nat="calcul"] { stroke: var(--serie-1); }
.prm-fleche { fill: var(--ink-2); }
.prm-noeud { cursor: pointer; outline: none; transition: opacity var(--duree); }
.prm-n-fond { fill: var(--bg-1); stroke: var(--line-fort); stroke-width: 1; }
.prm-n-marque { stroke: none; }
.prm-n-lettre { font-size: 10px; font-weight: 700; text-anchor: middle; fill: var(--grid-bg); }
.prm-n-lib { font-size: 11px; fill: var(--ink); }
.prm-noeud[data-nat="referentiel"] .prm-n-marque { fill: var(--info); }
.prm-noeud[data-nat="parametre"] .prm-n-marque, .prm-noeud[data-nat="element"] .prm-n-marque { fill: var(--accent); }
.prm-noeud[data-nat="parametre"] .prm-n-lettre, .prm-noeud[data-nat="element"] .prm-n-lettre { fill: var(--accent-ink); }
.prm-noeud[data-nat="ouverture"] .prm-n-marque { fill: var(--ok); }
.prm-noeud[data-nat="champ"] .prm-n-marque { fill: var(--ink-2); }
.prm-noeud[data-nat="champ"] .prm-n-fond { stroke-dasharray: 3 2; }
.prm-noeud[data-nat="calcul"] .prm-n-marque { fill: var(--serie-1); }
.prm-noeud[data-nat="calcul"] .prm-n-lettre { font-style: italic; }
.prm-noeud[data-nat="calcul"] .prm-n-fond { fill: var(--bg-2); }
.prm-noeud:hover .prm-n-fond { stroke: var(--ink-2); }
.prm-noeud:focus-visible .prm-n-fond { stroke: var(--focus); stroke-width: 2; }
.prm-noeud.absent .prm-n-fond, .prm-noeud.autre .prm-n-fond { stroke-dasharray: 2 2; }
.prm-noeud.autre { opacity: .8; }
.prm-trace .prm-noeud:not(.actif) { opacity: .3; }
.prm-trace .prm-lien:not(.actif) { opacity: .1; }
.prm-trace .prm-lien.actif { stroke-width: 2; }
.prm-trace .prm-noeud.actif .prm-n-fond { stroke: var(--ink); }
.prm-carte-pied { flex: none; min-height: 28px; display: flex; align-items: center; flex-wrap: wrap; gap: var(--e3) var(--e4); padding: var(--e2) var(--e4); background: var(--bg-1); border-top: 1px solid var(--line); font-size: var(--fs-m); }
.prm-carte-pied .note { color: var(--ink-2); font-size: var(--fs-s); }
.prm-carte-pied .prm-formule { flex: 1 1 320px; min-width: 0; }
.prm-carte-table td, .prm-carte-table th[scope="row"] { white-space: normal; height: auto; padding-top: 3px; padding-bottom: 3px; vertical-align: top; }
.prm-entree { display: inline-flex; align-items: center; gap: var(--e2); margin: 1px var(--e2) 1px 0; padding: 0 var(--e2); border: 1px solid var(--line); border-radius: var(--r1); background: var(--bg-1); color: var(--ink); font-size: var(--fs-s); white-space: nowrap; }
button.prm-entree:hover { background: var(--bg-3); }

/* ===================== Vue Importer depuis la Librairy ===================== */
.prm-etapes { flex: none; height: 30px; display: flex; align-items: center; gap: 0; margin: 0; padding: 0 var(--e4); list-style: none; background: var(--bg-1); border-bottom: 1px solid var(--line); counter-reset: none; overflow-x: auto; scrollbar-width: none; }
.prm-etapes li { display: inline-flex; align-items: center; gap: var(--e3); padding-right: var(--e5); color: var(--ink-2); font-size: var(--fs-m); white-space: nowrap; }
.prm-etapes li + li::before { content: ""; width: 18px; height: 1px; margin-right: var(--e5); background: var(--line-fort); }
.prm-etape-n { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-fort); border-radius: 50%; font-size: var(--fs-xs); font-weight: 700; }
.prm-etapes li[aria-current="step"] { color: var(--ink); font-weight: 600; }
.prm-etapes li[aria-current="step"] .prm-etape-n { background: var(--accent-plein, var(--accent)); border-color: var(--accent); color: var(--accent-ink); }
.prm-etapes li[data-fait="true"] .prm-etape-n { color: var(--ok); border-color: var(--ok); }
.prm-import { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); }
.prm-imp-gauche { min-height: 0; overflow: auto; display: grid; align-content: start; gap: var(--e3); padding: var(--e4); background: var(--bg-1); border-right: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--line-fort) transparent; }
.prm-sous { margin-top: var(--e2); color: var(--ink-2); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
/* Sous-titre et sa bulle sur une ligne : la bulle n'est jamais dans le h3 (docs/INTERFACE.md, 26.3). */
.prm-sous-tete { display: flex; align-items: center; margin-top: var(--e2); }
.prm-sous-tete > .prm-sous { margin-top: 0; }
.prm-imp-table-desc .props { border: 1px solid var(--grid-line); border-radius: var(--r1); background: var(--grid-bg); }
.prm-imp-table-desc .prm-note { padding: var(--e2) 0; }
.prm-imp-table-desc .puce { margin: 1px 0; }
.puce.oblig { border-color: var(--accent); color: var(--ink); }
.prm-collage { min-height: 120px; resize: vertical; font: var(--fs-s)/1.4 var(--mono); white-space: pre; overflow: auto; }
.prm-imp-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e3); }
.prm-imp-actions { display: flex; flex-wrap: wrap; gap: var(--e3); padding-top: var(--e2); border-top: 1px solid var(--line); }
.prm-imp-droite { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 3fr) auto minmax(0, 2fr); }
.prm-imp-apercu, .prm-imp-resultat { min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-fort) transparent; }
.prm-imp-resultat { display: flex; flex-direction: column; gap: var(--e3); padding: var(--e3) var(--e4); }
.prm-imp-table th { font-weight: 600; }
.prm-col-l { display: inline-block; min-width: 16px; padding: 0 2px; border: 1px solid var(--line); border-radius: var(--r1); color: var(--ink-2); font: var(--fs-xxs)/12px var(--mono); text-align: center; }
.prm-imp-map td { padding: 1px 2px; background: var(--bg-2); }
.prm-imp-map .champ { width: 100%; min-width: 120px; height: 20px; }
.prm-imp-map .champ[data-ignore="oui"] { color: var(--ink-2); font-style: italic; }
.prm-imp-table td.ignore { color: var(--ink-2); text-decoration: line-through; }
.prm-tuiles { flex: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: var(--e3); }
.prm-tuile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; column-gap: var(--e3); padding: var(--e3) var(--e4); border: 1px solid var(--line); border-radius: var(--r2); background: var(--bg-1); color: var(--ink); text-align: left; }
.prm-tuile .ic { grid-row: 1 / span 2; color: var(--ink-2); }
.prm-tuile-lib { color: var(--ink-2); font-size: var(--fs-s); }
.prm-tuile-n { font-size: var(--fs-xl); font-weight: 600; font-variant-numeric: tabular-nums; }
.prm-tuile:hover { background: var(--bg-3); }
.prm-tuile[aria-selected="true"] { background: var(--choisi-panneau); box-shadow: inset 0 -2px 0 var(--accent); }
.prm-tuile[data-cat="rejets"]:not([data-zero="oui"]) .prm-tuile-n, .prm-tuile[data-cat="rejets"]:not([data-zero="oui"]) .ic { color: var(--bad); }
.prm-tuile[data-cat="suppressions"]:not([data-zero="oui"]) .prm-tuile-n { color: var(--warn); }
.prm-tuile[data-zero="oui"] .prm-tuile-n { color: var(--ink-2); }
.prm-tuile:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.prm-imp-liste { border: 1px solid var(--grid-line); border-radius: var(--r1); }

/* ===================== Calendrier et postes (régime des postes, semaine, formats de date) ===================== */
.prm-cal { overflow: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); align-content: start; align-items: start; gap: var(--e4); padding: var(--e4); scrollbar-width: thin; scrollbar-color: var(--line-fort) transparent; }
.prm-cal-cote { min-width: 0; display: grid; align-content: start; gap: var(--e4); }
.prm-cal-bloc { min-width: 0; border: 1px solid var(--line); border-radius: var(--r1); background: var(--bg-1); }
.prm-cal-corps { display: grid; gap: var(--e3); padding: var(--e3) var(--e4); min-width: 0; }
.prm-cal-outils { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--e3) var(--e4); }
.prm-cal-lib { align-self: center; color: var(--ink-2); font-size: var(--fs-s); }
.prm-cal-modeles { display: inline-flex; align-self: center; gap: var(--e2); }
.prm-cal-date { width: 128px; }
.prm-cal-actions { display: flex; align-items: center; gap: var(--e3); }
.prm-cal-msg:empty { display: none; }
.prm-cal .prm-sous { margin-top: var(--e3); }
.prm-cal .prm-note { padding: 0; }

/* Frise des 24 heures : une case par heure, teinte claire et filet coloré du poste, code écrit au début du poste
   (jamais la couleur seule : code, filet de début et titre de chaque case). */
.prm-frise-zone { display: grid; gap: 1px; }
.prm-frise { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); height: 24px; border: 1px solid var(--line-fort); border-radius: var(--r1); overflow: hidden; background: var(--grid-bg); }
.prm-frise-h { min-width: 0; display: flex; align-items: center; padding-left: 2px; border-top: 3px solid var(--line-fort); background: var(--bg-2); color: var(--ink); font: 700 var(--fs-xs)/1 var(--font); white-space: nowrap; overflow: visible; }
.prm-frise-h + .prm-frise-h { border-left: 1px solid var(--grid-line); }
.prm-frise-h.debut { border-left: 2px solid var(--ink); }
.prm-frise-h[data-p="0"] { background: var(--info-bg); border-top-color: var(--info); }
.prm-frise-h[data-p="1"] { background: var(--ok-bg); border-top-color: var(--ok); }
.prm-frise-h[data-p="2"] { background: var(--warn-bg); border-top-color: var(--warn); }
.prm-frise-h[data-p="3"] { background: var(--bad-bg); border-top-color: var(--bad); }
.prm-frise-h[data-p="4"] { background: var(--choisi-panneau); border-top-color: var(--accent); }
.prm-frise-h[data-p="5"] { background: var(--bg-3); border-top-color: var(--serie-1); }
.prm-frise-h[data-p="6"] { background: var(--bg-1); border-top-color: var(--serie-2); }
.prm-frise-h[data-p="7"] { background: var(--grid-bg); border-top-color: var(--ink-2); }
.prm-frise-h[data-p="vide"] { background: var(--grid-bg); border-top: 3px dashed var(--bad); }
.prm-frise-axe { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); color: var(--ink-2); font-size: var(--fs-xxs); font-variant-numeric: tabular-nums; }

/* Tableau des postes et historique des régimes. */
.prm-cal-postes .champ { width: 100%; height: 20px; }
.prm-cal-postes .prm-cal-code { min-width: 48px; }
.prm-cal-postes .prm-cal-duree { min-width: 44px; text-align: right; }
.prm-cal-postes td[data-k] { font-variant-numeric: tabular-nums; }
.prm-cal-postes tfoot th, .prm-cal-postes tfoot td { background: var(--bg-2); font-weight: 600; }
.prm-cal-total[data-ko="oui"] { color: var(--bad); }
.prm-cal-postes .prm-cal-ex { white-space: normal; height: auto; padding-top: 2px; padding-bottom: 2px; color: var(--ink-2); font-weight: 400; line-height: 1.4; }
.prm-cal-histo tr.prm-cal-vigueur td { font-weight: 600; }
.prm-cal-histo tr.prm-cal-vigueur .puce { border-color: var(--accent); color: var(--ink); }

/* Semaine affichée. */
.prm-cal-jours { display: flex; flex-wrap: wrap; gap: var(--e2); margin: 0; padding: 0; list-style: none; }
.prm-cal-jours li { padding: 0 var(--e3); border: 1px solid var(--line); border-radius: var(--r1); background: var(--grid-bg); font-size: var(--fs-s); line-height: 18px; }
.prm-cal-jours li.debut { border-color: var(--accent); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }

@media (max-width: 1180px) { .prm-cal { grid-template-columns: minmax(0, 1fr); } }

/* ===================== Fenêtre étroite ===================== */
@media (max-width: 900px) {
  .prm-studio { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(140px, 34%) minmax(0, 1fr); }
  .prm-sep { display: none; }
  .prm-volet { border-bottom: 1px solid var(--line); }
  .prm-corps { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(120px, 36%); }
  .prm-usages { border-left: 0; border-top: 1px solid var(--line); }
  .prm-import { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); overflow: auto; }
  .prm-imp-gauche { border-right: 0; border-bottom: 1px solid var(--line); }
  .prm-partie small, .prm-droits span { display: none; }
}
