/* style.css — Makerspace UTTOP, prototype v1 (08/10/2026) — direction « l'établi ».
   Un fond de tapis de découpe, des pièces posées (cartes à ombre franche), des étiquettes
   d'étiqueteuse, une règle aux couleurs des zones. Charte UTTOP (Pantone 301 U + complémentaires).
   Polices servies d'ici (assets/fonts, OFL) : Atkinson Hyperlegible pour lire, Instrument Serif
   pour les titres. Aucune ressource distante. Thème CLAIR par défaut ; le sombre ne vient que du
   bouton (data-theme="dark"), jamais du système. */
@import url('assets/fonts/fonts.css');

:root {
  --uttop: #005078;
  --vert-sapin: #129A7E;
  --vert-tendre: #45DB96;
  --jaune: #F5D836;
  --rose: #FF99D6;
  --lavande: #586DDD;

  --papier: #f6f3ea;
  --quadrillage: rgba(0, 80, 120, .065);
  --surface: #fffdf8;
  --surface-2: #efe9dc;
  --texte: #14232d;
  --texte-2: #3d4b56;
  --texte-3: #606b74;
  --bord: #dcd4c3;
  --contour: #1d2c36;
  --ombre-franche: rgba(0, 80, 120, .20);
  --accent: #005078;
  --accent-fonce: #003a58;
  --accent-texte: #ffffff;
  --accent-doux: #dcebf2;
  --lien: #005078;
  --ruban: #F5D836;
  --ruban-texte: #2b2400;

  --ok: #0b6a55;      --ok-fond: #d8f1e7;
  --attention: #6f5200; --attention-fond: #fff1b8;
  --alerte: #b42318;  --alerte-fond: #fde3df;
  --info: #3846a8;    --info-fond: #e4e7fb;

  /* zones : identité, toujours accompagnée de son nom */
  --z-ideation: #2fae74;
  --z-numerique: #0891B2;
  --z-impression: #129A7E;
  --z-electronique: #586DDD;
  --z-manuel: #005078;
  --z-electroportatif: #d9b400;

  --barre: #005078;
  --grille: #e4ddcd;

  --rayon: 14px;
  --ombre: 4px 4px 0 var(--ombre-franche);
  --police: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --titre: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;

  /* le widget de créneaux (sis-ui-widgets/slotbar) lit ses couleurs ici */
  --sb-tick: rgba(0, 80, 120, .16);
  --sb-border: #1d2c36;
  --sb-fill: rgba(18, 154, 126, .26);
  --sb-stroke: #0b6a55;
  --sb-ink: #0b3f33;
  --sb-grab: #005078;
  --sb-cut-fill: rgba(180, 35, 24, .16);
  --sb-cut-stroke: #b42318;
  --sb-tip-bg: #14232d;
  --sb-tip-border: #14232d;
  --sb-tip-ink: #fffdf8;
  --sb-height: 38px;
  --sb-radius: 10px;
}

:root[data-theme="dark"] {
  --papier: #0b1820;
  --quadrillage: rgba(108, 184, 224, .055);
  --surface: #12222c;
  --surface-2: #1a2d39;
  --texte: #e9eff3;
  --texte-2: #bac6cf;
  --texte-3: #8f9ca7;
  --bord: #2a3c48;
  --contour: #5d8ba6;
  --ombre-franche: rgba(0, 0, 0, .45);
  --accent: #6cb8e0;
  --accent-fonce: #9bd1ef;
  --accent-texte: #04202e;
  --accent-doux: #12303f;
  --lien: #8ccbec;
  --ok: #5fd3a8;      --ok-fond: #0f2e25;
  --attention: #f2d34f; --attention-fond: #2e2708;
  --alerte: #ff8a7d;  --alerte-fond: #3a1512;
  --info: #a3aeff;    --info-fond: #1c2147;
  --z-ideation: #45DB96;
  --z-numerique: #3cc0dd;
  --z-impression: #2fc49f;
  --z-electronique: #8796f0;
  --z-manuel: #5aa9d6;
  --z-electroportatif: #F5D836;
  --barre: #6cb8e0;
  --grille: #23343f;
  color-scheme: dark;
  --sb-tick: rgba(108, 184, 224, .18);
  --sb-border: #5d8ba6;
  --sb-fill: rgba(47, 196, 159, .28);
  --sb-stroke: #5fd3a8;
  --sb-ink: #d6fff0;
  --sb-grab: #6cb8e0;
  --sb-tip-bg: #e9eff3;
  --sb-tip-border: #e9eff3;
  --sb-tip-ink: #0b1820;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--texte);
  background-color: var(--papier);
  background-image:
    linear-gradient(var(--quadrillage) 1px, transparent 1px),
    linear-gradient(90deg, var(--quadrillage) 1px, transparent 1px);
  background-size: 24px 24px;
  font: 17px/1.55 var(--police);
  min-height: 100vh; display: flex; flex-direction: column;
}
img, svg { max-width: 100%; }
a { color: var(--lien); text-underline-offset: .18em; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5rem; }
h1 { font-family: var(--titre); font-weight: 400; font-size: 2.35rem; letter-spacing: -.01em; }
h2 { font-size: 1.12rem; letter-spacing: .005em; }
h3 { font-size: 1rem; }
p { margin: 0 0 .6rem; }
code { font-family: var(--mono); font-size: .86em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--jaune); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--jaune); color: #14232d; }

/* ── bandeau, et la règle aux couleurs des zones ─────────────────────── */
.bandeau {
  display: flex; align-items: center; gap: .5rem .8rem; flex-wrap: wrap;
  padding: .55rem 1rem; background: var(--uttop); color: #fff; position: relative;
}
.bandeau::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 6px;
  background: linear-gradient(90deg,
    var(--jaune) 0 16.6%, var(--vert-tendre) 0 33.3%, var(--vert-sapin) 0 50%,
    var(--lavande) 0 66.6%, var(--rose) 0 83.3%, #0891B2 0 100%);
}
.marque { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; }
.marque img { width: 38px; height: 38px; border-radius: 10px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.marque span { font-family: var(--titre); font-size: 1.45rem; line-height: 1; }
.marque small { display: block; font-family: var(--mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; opacity: .85; margin-top: .2rem; }
.proto {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase;
  background: var(--jaune); color: #2b2400; padding: .2rem .55rem; border-radius: 3px; transform: rotate(-1.5deg);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, .25);
}
#qui-atelier { background: rgba(255, 255, 255, .16); color: #fff; transform: none; box-shadow: none; }
.bandeau .droite { margin-left: auto; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.qui { display: flex; align-items: center; gap: .4rem; font-size: .8rem; }
@media (max-width: 1240px) { #qui-atelier { display: none !important; } }
.qui select {
  background: rgba(255, 255, 255, .12); color: #fff; border: 1.5px solid rgba(255, 255, 255, .5);
  border-radius: 8px; padding: .3rem .45rem; max-width: 12.5rem;
}
.qui select option { color: #14232d; background: #fff; }
.horloge { font-family: var(--mono); font-size: .78rem; background: rgba(0, 0, 0, .22); padding: .25rem .55rem; border-radius: 6px; }
.theme-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .55);
  background: transparent; color: #fff; cursor: pointer; font-size: 1.05rem; line-height: 1; display: grid; place-items: center; flex: none;
}
.theme-btn:hover { background: rgba(255, 255, 255, .14); }
@media (max-width: 720px) {
  #qui-atelier { display: none !important; }
  .qui label { display: none; }
  .qui select { max-width: 11.5rem; }
  .marque span { font-size: 1.25rem; }
}

/* ── navigation : le râtelier d'outils ───────────────────────────────── */
.nav {
  display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none;
  padding: .9rem .9rem .55rem; position: sticky; top: 0; z-index: 15;
  background: linear-gradient(var(--papier) 82%, transparent);
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: none; text-decoration: none; color: var(--texte-2); font-weight: 700; font-size: .92rem;
  padding: .42rem .8rem; border-radius: 999px; white-space: nowrap; border: 1.5px solid transparent;
}
.nav a:hover { border-color: var(--bord); background: var(--surface); }
.nav a[aria-current="page"] { background: var(--texte); color: var(--papier); border-color: var(--texte); box-shadow: 3px 3px 0 var(--ombre-franche); }
.nav a .phase { font-family: var(--mono); font-size: .62rem; font-weight: 400; opacity: .7; margin-left: .3rem; vertical-align: .1em; }

main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: .6rem 1rem 1.5rem; }
.pied { text-align: center; font-size: .78rem; color: var(--texte-3); padding: 1.2rem 1rem 4.5rem; }

/* ── briques ─────────────────────────────────────────────────────────── */
.titre { margin: .4rem 0 1.2rem; }
.titre h1 { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .7rem; }
.titre p { color: var(--texte-2); max-width: 68ch; font-size: 1.02rem; }
.carte {
  background: var(--surface); border: 1.5px solid var(--contour); border-radius: var(--rayon);
  padding: 1.05rem 1.1rem; box-shadow: var(--ombre); margin-bottom: 1.1rem; min-width: 0;
}
.carte > h2:first-child, .carte > h3:first-child { margin-top: 0; }
.carte h2 { display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.grille { display: grid; gap: 1.1rem; grid-template-columns: 1fr; margin-bottom: 1.1rem; }
.grille > .carte { margin-bottom: 0; }
@media (min-width: 760px) {
  .grille.deux { grid-template-columns: 1fr 1fr; }
  .grille.trois { grid-template-columns: repeat(3, 1fr); }
  .grille.plan-liste { grid-template-columns: minmax(260px, 340px) 1fr; }
}
.grille.plan-liste > div > .carte { margin-bottom: 1.1rem; }
.aide { color: var(--texte-3); font-size: .88rem; }

/* l'étiqueteuse : pastilles en ruban */
.pastille {
  display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .05em; text-transform: uppercase;
  padding: .18rem .5rem; border-radius: 3px; background: var(--surface-2); color: var(--texte-2);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .12);
}
.pastille.ok { background: var(--ok-fond); color: var(--ok); }
.pastille.attention { background: var(--attention-fond); color: var(--attention); }
.pastille.alerte { background: var(--alerte-fond); color: var(--alerte); }
.pastille.info { background: var(--info-fond); color: var(--info); }
.zone-nom { display: inline-flex; align-items: center; gap: .4rem; }
.zone-nom::before { content: ""; width: .8rem; height: .8rem; border-radius: 3px; background: var(--zc, var(--texte-3)); flex: none; box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .18); }
.phase-tag {
  font-family: var(--mono); font-size: .68rem; font-weight: 400; letter-spacing: .06em; text-transform: uppercase;
  background: var(--ruban); color: var(--ruban-texte); padding: .22rem .6rem; border-radius: 2px;
  transform: rotate(-2deg); box-shadow: 1px 2px 0 rgba(0, 0, 0, .18); align-self: center;
}

.btn {
  display: inline-flex; align-items: center; gap: .4rem; justify-content: center;
  border: 2px solid var(--contour); background: var(--accent); color: var(--accent-texte);
  padding: .5rem .95rem; border-radius: 10px; cursor: pointer; font-weight: 700; text-decoration: none; min-height: 42px;
  box-shadow: 3px 3px 0 var(--ombre-franche); transition: transform .08s ease, box-shadow .08s ease, background .15s;
}
.btn:hover { background: var(--accent-fonce); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ombre-franche); }
.btn.secondaire { background: var(--surface); color: var(--accent); }
.btn.secondaire:hover { background: var(--accent-doux); }
.btn.discret { background: transparent; border-color: var(--bord); color: var(--texte-2); box-shadow: none; font-weight: 600; }
.btn.discret:hover { border-color: var(--contour); background: var(--surface); }
.btn.danger { background: var(--alerte); color: #fff; }
.btn.petit { padding: .25rem .65rem; min-height: 34px; font-size: .86rem; border-width: 1.5px; box-shadow: 2px 2px 0 var(--ombre-franche); }
.btn.discret.petit { box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.lien { background: none; border: 0; color: var(--lien); padding: .2rem; min-height: 0; box-shadow: none; font-weight: 600; text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .7rem; }

.alerte-bandeau {
  display: flex; gap: .7rem; align-items: flex-start; padding: .75rem .95rem; border-radius: 12px;
  margin-bottom: 1rem; border: 1.5px solid currentColor;
}
.alerte-bandeau.alerte { background: var(--alerte-fond); color: var(--alerte); }
.alerte-bandeau.attention { background: var(--attention-fond); color: var(--attention); }
.alerte-bandeau.ok { background: var(--ok-fond); color: var(--ok); }
.alerte-bandeau.info { background: var(--info-fond); color: var(--info); }
.alerte-bandeau > div > strong:first-child { display: block; }

/* listes */
.liste { list-style: none; margin: 0; padding: 0; }
.liste > li { display: flex; gap: .75rem; align-items: center; padding: .65rem 0; border-top: 1.5px dashed var(--bord); flex-wrap: wrap; }
.liste > li:first-child { border-top: 0; }
.liste .quoi { flex: 1 1 12rem; min-width: 0; }
.liste .quoi strong { display: block; }
.liste .quoi span { color: var(--texte-3); font-size: .88rem; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--jaune); color: #2b2400; font-weight: 700; font-size: .8rem; border: 1.5px solid var(--contour);
}
.liste > li:nth-child(4n+2) .avatar { background: var(--vert-tendre); }
.liste > li:nth-child(4n+3) .avatar { background: var(--rose); }
.liste > li:nth-child(4n+4) .avatar { background: #bfe3f2; }

/* tableaux */
.table-defile { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .5rem .55rem; border-bottom: 1px solid var(--bord); vertical-align: top; }
th { color: var(--texte-2); font-family: var(--mono); font-weight: 400; font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* formulaires */
.champ { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .8rem; }
.champ label, .champ .lib { font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--texte-2); }
.champ input, .champ select, .champ textarea {
  border: 1.5px solid var(--contour); border-radius: 10px; padding: .5rem .65rem; background: var(--surface); min-height: 42px; width: 100%;
}
.ligne-champs { display: grid; gap: .6rem; grid-template-columns: 1fr 1fr; }
.choix { display: flex; flex-wrap: wrap; gap: .4rem; }
.choix button { border: 1.5px solid var(--bord); background: var(--surface); border-radius: 999px; padding: .35rem .75rem; cursor: pointer; font-weight: 600; }
.choix button:hover { border-color: var(--contour); }
.choix button[aria-pressed="true"] { border-color: var(--contour); background: var(--texte); color: var(--papier); }

/* ── indicateurs ─────────────────────────────────────────────────────── */
.tuiles { display: grid; gap: .9rem; grid-template-columns: repeat(2, 1fr); margin-bottom: 1.1rem; }
@media (min-width: 760px) { .tuiles { grid-template-columns: repeat(4, 1fr); } }
.tuile {
  background: var(--surface); border: 1.5px solid var(--contour); border-radius: var(--rayon); padding: .85rem .95rem .8rem;
  box-shadow: var(--ombre); border-top: 7px solid var(--tc, var(--accent)); min-width: 0;
}
.tuile:nth-child(1) { --tc: var(--uttop); }
.tuile:nth-child(2) { --tc: var(--vert-sapin); }
.tuile:nth-child(3) { --tc: var(--lavande); }
.tuile:nth-child(4) { --tc: var(--jaune); }
.tuile .val { font-family: var(--titre); font-size: 2.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.tuile .lib { color: var(--texte-2); font-weight: 700; font-size: .9rem; margin-top: .2rem; }
.tuile .sous { color: var(--texte-3); font-size: .78rem; margin-top: .25rem; }

.graphe { position: relative; }
.graphe svg { display: block; width: 100%; height: auto; overflow: visible; }
.graphe .axe text, .graphe .etiq { fill: var(--texte-3); font-size: 11px; font-family: var(--police); }
.graphe .valeur { fill: var(--texte); font-size: 14px; font-family: var(--titre); }
.graphe .grille-l { stroke: var(--grille); stroke-width: 1; stroke-dasharray: 2 3; }
.graphe .barre { fill: var(--barre); }
.graphe .barre.courante { fill: url(#hachure); stroke: var(--barre); stroke-width: 1.5; }
.graphe .hachure-trait { stroke: var(--barre); stroke-width: 2; }
.graphe .cible { fill: transparent; cursor: default; }
.bulle {
  position: absolute; pointer-events: none; background: var(--texte); color: var(--surface);
  font-size: .8rem; padding: .3rem .55rem; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -110%);
}
.hbarres { display: grid; gap: .5rem; }
.hbarre { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr 3.4rem; gap: .6rem; align-items: center; font-size: .9rem; }
.hbarre .piste { height: 16px; background: var(--surface-2); border-radius: 0 4px 4px 0; overflow: hidden; }
.hbarre .rempli { height: 100%; background: var(--barre); border-radius: 0 4px 4px 0; }
.hbarre .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--texte-2); font-weight: 700; }
details.tableau { margin-top: .7rem; font-size: .88rem; }
details.tableau summary { cursor: pointer; color: var(--lien); font-weight: 600; }

/* ── postes, plan ────────────────────────────────────────────────────── */
.plan svg { width: 100%; height: auto; display: block; }
.plan .salle { fill: var(--papier); stroke: var(--contour); stroke-width: 2.5; }
.plan .salle-nom { fill: var(--texte-3); font-size: 10px; font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.plan .poste { cursor: pointer; }
.plan .poste rect { stroke: var(--contour); stroke-width: 1.5; }
.plan .poste text { fill: #fff; font-size: 10px; font-weight: 700; pointer-events: none; font-family: var(--mono); }
.plan .poste.clair text { fill: #14232d; }
.plan .poste:hover rect, .plan .poste:focus rect { stroke-width: 3; }
.plan .etat { stroke: var(--surface); stroke-width: 2; }
.plan .porte { stroke: var(--texte-3); stroke-width: 2; fill: none; }
.legende { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .8rem; color: var(--texte-2); margin-top: .6rem; }
.etat-point { width: .7rem; height: .7rem; border-radius: 50%; display: inline-block; vertical-align: middle; margin-right: .3rem; }

.fiche-poste .entete { display: flex; gap: .9rem; align-items: flex-start; flex-wrap: wrap; }
.fiche-poste .entete .quoi { flex: 1 1 14rem; }
.fiche-poste h1 { font-size: 2rem; }
.qr { background: #fff; padding: 9px; border-radius: 10px; border: 1.5px solid var(--contour); width: 138px; flex: none; transform: rotate(1.5deg); box-shadow: 3px 3px 0 var(--ombre-franche); }
.qr svg, .qr img { display: block; width: 100%; height: auto; }
.qr p { color: #3d4b56; font-size: .68rem; text-align: center; margin: .25rem 0 0; font-family: var(--mono); letter-spacing: .08em; }
.epi { display: flex; flex-wrap: wrap; gap: .35rem; margin: .35rem 0; }

/* impressions */
.progression { height: 9px; background: var(--surface-2); border-radius: 5px; overflow: hidden; margin-top: .35rem; border: 1px solid var(--bord); }
.progression > i {
  display: block; height: 100%; border-radius: 5px; background-size: 22.6px 22.6px;
  background-image: repeating-linear-gradient(-45deg, var(--z-impression) 0 8px, color-mix(in srgb, var(--z-impression) 72%, #fff) 8px 16px);
}
@media (prefers-reduced-motion: no-preference) {
  .progression > i { animation: avance 1.6s linear infinite; }
}
@keyframes avance { to { background-position: 22.6px 0; } }

/* ── la réservation au geste : le widget de créneaux ─────────────────── */
.resa-geste { margin: .3rem 0 .9rem; }
.resa-geste .regle { position: relative; height: 16px; margin: 0 0 .25rem; font-family: var(--mono); font-size: .66rem; color: var(--texte-3); }
.resa-geste .regle span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.resa-geste .regle span:first-child { transform: none; }
.resa-geste .regle span:last-child { transform: translateX(-100%); }
.resa-geste .pris { position: relative; height: 14px; margin: 0 0 .45rem; border-radius: 6px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--bord); }
.resa-geste .pris i {
  position: absolute; top: 0; bottom: 0; border-radius: 4px;
  background: repeating-linear-gradient(-45deg, var(--alerte) 0 4px, transparent 4px 8px); opacity: .6;
}
.resa-geste .pris i.machine { background: repeating-linear-gradient(-45deg, var(--info) 0 4px, transparent 4px 8px); }
.resa-geste .lib-pris { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .76rem; color: var(--texte-3); margin-top: .5rem; }
.resa-geste .lib-pris b { display: inline-block; width: 1.1rem; height: .6rem; border-radius: 2px; vertical-align: middle; margin-right: .3rem; background: repeating-linear-gradient(-45deg, var(--alerte) 0 3px, transparent 3px 6px); }
.resa-geste .lib-pris b.machine { background: repeating-linear-gradient(-45deg, var(--info) 0 3px, transparent 3px 6px); }
.resa-geste .lib-pris b.moi { background: var(--sb-fill); border: 1px solid var(--sb-stroke); }
.resa-geste .consigne { font-size: .84rem; color: var(--texte-2); margin: .55rem 0 0; }

/* ── frise : le cas des 7 heures ─────────────────────────────────────── */
.frise svg { width: 100%; height: auto; display: block; }
.frise .piste-f { fill: var(--surface-2); }
.frise .lib-f { fill: var(--texte-2); font-size: 11px; font-weight: 700; font-family: var(--police); }
.frise .heure-f { fill: var(--texte-3); font-size: 10px; font-family: var(--mono); }
.frise .trait-h { stroke: var(--grille); stroke-dasharray: 2 3; }
.frise .resa { fill: none; stroke: var(--info); stroke-width: 2; stroke-dasharray: 4 3; }
.frise .resa-t { fill: var(--info); font-size: 10px; font-weight: 600; }
.frise .job { fill: var(--z-impression); }
.frise .job.prevu { fill: var(--z-impression); opacity: .28; }
.frise .job.echec { fill: var(--alerte); }
.frise .presence { fill: var(--accent); }
.frise .conflit { fill: var(--alerte); opacity: .2; }
.frise .maintenant { stroke: var(--alerte); stroke-width: 2.5; }
.frise .job-t { fill: #fff; font-size: 10px; font-weight: 700; font-family: var(--police); }
.etapes { counter-reset: e; list-style: none; padding: 0; margin: .6rem 0 .4rem; display: grid; gap: .1rem; }
.etapes li { counter-increment: e; position: relative; padding: .3rem 0 .3rem 2.2rem; color: var(--texte-3); }
.etapes li::before { content: counter(e); position: absolute; left: 0; top: .25rem; width: 1.55rem; height: 1.55rem; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: .78rem; font-weight: 700; border: 1.5px solid var(--bord); }
.etapes li.fait, .etapes li.encours { color: var(--texte); }
.etapes li.encours { font-weight: 700; }
.etapes li.encours::before { background: var(--jaune); color: #2b2400; border-color: var(--contour); }
.etapes li.fait::before { background: var(--ok-fond); color: var(--ok); content: "✓"; border-color: var(--ok); }

/* habilitations : des badges cousus */
.badges { display: flex; flex-wrap: wrap; gap: .6rem; }
.badge-h {
  border: 1.5px solid var(--contour); border-left: 7px solid var(--zc, var(--accent)); border-radius: 10px;
  padding: .5rem .7rem; background: var(--surface); min-width: 11rem; flex: 1 1 11rem; box-shadow: 2px 2px 0 var(--ombre-franche);
}
.badge-h strong { display: block; font-size: .92rem; }
.badge-h span { font-size: .8rem; color: var(--texte-3); }
.badge-h.manque { border-style: dashed; border-left-style: solid; box-shadow: none; background: transparent; }
.matrice td, .matrice th { text-align: center; }
.matrice td:first-child, .matrice th:first-child { text-align: left; }

/* projets, annuaire */
.cartes-mini { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .cartes-mini { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .cartes-mini { grid-template-columns: repeat(3, 1fr); } }
.cartes-mini .carte { margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.cartes-mini .carte:nth-child(3n+2) { rotate: .35deg; }
.cartes-mini .carte:nth-child(3n) { rotate: -.3deg; }
.cartes-mini h3 { font-family: var(--titre); font-weight: 400; font-size: 1.45rem; line-height: 1.1; }
.etiquettes { display: flex; flex-wrap: wrap; gap: .3rem; }
.etiquette { font-size: .78rem; padding: .12rem .5rem; border-radius: 999px; background: var(--surface-2); color: var(--texte-2); border: 1px solid var(--bord); }
.etiquette.cherche { background: var(--jaune); color: #2b2400; border-color: transparent; font-weight: 700; }

/* annonces et affichage */
.annonce { border-left: 7px solid var(--accent); }
.annonce h3 { font-family: var(--titre); font-weight: 400; font-size: 1.5rem; }
.annonce.panne { border-left-color: var(--alerte); }
.annonce.formation { border-left-color: var(--z-impression); }
.annonce.fermeture { border-left-color: var(--z-electroportatif); }
.affichage {
  position: fixed; inset: 0; z-index: 60; color: #fff; padding: 2rem;
  background-color: #062b40;
  background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 32px 32px;
  display: grid; gap: 1.5rem; grid-template-columns: 1fr; overflow: auto;
}
@media (min-width: 900px) { .affichage { grid-template-columns: 1.1fr 1fr; grid-template-rows: auto 1fr; } }
.affichage h1 { font-size: 3rem; }
.affichage .bloc { background: rgba(255, 255, 255, .07); border: 1.5px solid rgba(255, 255, 255, .25); border-radius: 18px; padding: 1.2rem 1.4rem; }
.affichage .grand { font-family: var(--titre); font-size: 4.6rem; line-height: 1; color: var(--jaune); }
.affichage .postes-etat { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .6rem; }
.affichage .postes-etat div { background: rgba(255, 255, 255, .08); border-radius: 12px; padding: .6rem .8rem; font-size: 1rem; }
.affichage .fermer { position: absolute; top: 1rem; right: 1rem; }

/* toast, dialogue */
.toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 80;
  background: var(--texte); color: var(--papier); padding: .65rem 1.05rem; border-radius: 12px;
  box-shadow: 4px 4px 0 var(--ombre-franche); max-width: calc(100vw - 2rem); font-weight: 600;
}
.toast.erreur { background: var(--alerte); color: #fff; }
dialog {
  border: 2px solid var(--contour); border-radius: 18px; padding: 1.2rem; background: var(--surface); color: var(--texte);
  width: min(560px, calc(100vw - 2rem)); max-height: calc(100vh - 3rem); box-shadow: 6px 6px 0 var(--ombre-franche);
}
dialog h2 { font-family: var(--titre); font-weight: 400; font-size: 1.7rem; }
dialog::backdrop { background: rgba(10, 24, 32, .55); }

/* panneau Retour (repris de SAGIP v2, lui-même du carnet Tango) */
.ameliorer-poignee {
  position: fixed; right: 0; top: 46%; z-index: 40; writing-mode: vertical-rl; transform: rotate(180deg);
  background: var(--jaune); color: #2b2400; border: 1.5px solid var(--contour); border-left: 0; border-radius: 0 10px 10px 0;
  padding: .8rem .4rem; cursor: pointer; font-weight: 700; font-family: var(--mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
}
.ameliorer-tiroir {
  position: fixed; right: 0; top: 0; bottom: 0; width: min(380px, 100vw); z-index: 70; background: var(--surface);
  border-left: 2px solid var(--contour); padding: 1rem; overflow: auto; box-shadow: -6px 0 0 var(--ombre-franche);
}
.ameliorer-tiroir h2 { font-family: var(--titre); font-weight: 400; font-size: 1.5rem; }
.ameliorer-tiroir textarea { width: 100%; border: 1.5px solid var(--contour); border-radius: 10px; padding: .55rem; background: var(--surface); }
.ameliorer-natures { display: flex; flex-wrap: wrap; gap: .3rem; }
.ameliorer-natures .choisi { background: var(--texte); border-color: var(--texte); color: var(--papier); }
.ameliorer-cible { display: flex; gap: .4rem; align-items: center; background: var(--surface-2); border-radius: 8px; padding: .35rem .5rem; font-size: .85rem; }
.ameliorer-anonyme { display: flex; gap: .4rem; align-items: center; font-size: .86rem; margin-top: .5rem; }
.ameliorer-bandeau {
  position: fixed; left: 50%; top: .6rem; transform: translateX(-50%); z-index: 90; background: var(--texte); color: var(--papier);
  padding: .5rem .85rem; border-radius: 12px; display: flex; gap: .7rem; align-items: center;
}
.ameliorer-survol { outline: 3px dashed var(--alerte) !important; outline-offset: 2px; }
.boite-tete { display: flex; justify-content: space-between; align-items: center; }
.ancien { border-top: 1px dashed var(--bord); padding-top: .4rem; margin-top: .4rem; }

/* salle d'attente */
.etroite { max-width: 36rem; margin: 2.5rem auto; }
.etroite h1 { font-size: 2.2rem; }

/* l'entrée d'une page : les pièces se posent sur l'établi (une fois par changement de page) */
@media (prefers-reduced-motion: no-preference) {
  .entree > * { animation: poser .42s cubic-bezier(.2, .8, .2, 1) both; }
  .entree > :nth-child(2) { animation-delay: .05s; }
  .entree > :nth-child(3) { animation-delay: .1s; }
  .entree > :nth-child(4) { animation-delay: .15s; }
  .entree > :nth-child(5) { animation-delay: .2s; }
  .entree > :nth-child(n+6) { animation-delay: .25s; }
}
@keyframes poser { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

body.capture .ameliorer-poignee, body.capture .pied, body.capture #qui-atelier, body.capture .theme-btn { display: none !important; }

/* impression : l'app s'imprime proprement (les fiches papier ont leur propre page) */
@media print {
  .bandeau, .nav, .pied, .ameliorer-poignee, .actions, .toast, .theme-btn { display: none !important; }
  body { background: #fff; color: #000; }
  .carte, .tuile { box-shadow: none; break-inside: avoid; rotate: none !important; }
}
