/* Table, accueil et papier : téléphone d'abord, ordinateur ensuite.
   Charte Morad Houmir : blanc, béton, encre, graphite. L'orange est un aplat (segment de l'étape courante,
   bouton principal), jamais un texte. Angles droits, aucune ombre. Une ligne ne se coupe qu'entre deux groupes de sens. */
body.t-page { min-height: 100dvh; font-size: 17px; }
.saut { position: absolute; left: -9999px; top: 8px; z-index: 20; background: var(--encre); color: var(--fond); padding: 10px 14px; font-weight: 600; }
.saut:focus { left: 8px; }
.copie-cache { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }
main:focus { outline: none; }
.t-note, .t-aide { margin: 0; color: var(--graphite); font-size: 16px; line-height: 1.45; }
.t-aide { font-size: 15px; }
.t-para { margin: 0 0 14px; font-size: 17px; line-height: 1.5; max-width: 62ch; }
.t-sur { margin: 0 0 8px; font-weight: 600; font-size: 15px; color: var(--graphite); }
.t-large { width: 100%; min-height: 56px; font-size: 18px; }
.t-label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: 15px; }
.mh-lien { font-size: 16px; }
.erreur { margin-top: 10px; }

/* Titres : Anybody italique, phrase étroite sur téléphone. */
.t-titre, .t-h2, .t-copie-titre { font-family: var(--mh-titrage); font-style: italic; font-weight: 800; font-synthesis: none; letter-spacing: -.01em; }
.t-titre { margin: 0 0 16px; font-size: clamp(30px, 8.4vw, 44px); line-height: 1.06; font-stretch: 92%; font-variation-settings: "wdth" 92, "wght" 800; text-wrap: balance; }
.t-titre:focus { outline: none; }
.t-h2 { margin: 0 0 12px; font-size: 24px; line-height: 1.1; font-stretch: 92%; font-variation-settings: "wdth" 92, "wght" 800; text-wrap: balance; }
.t-copie-titre { margin: 0 0 4px; font-size: 21px; line-height: 1.15; font-stretch: 92%; font-variation-settings: "wdth" 92, "wght" 800; }
@media (min-width: 700px) {
  .t-titre { font-stretch: 108%; font-variation-settings: "wdth" 108, "wght" 800; }
  .t-h2, .t-copie-titre { font-stretch: 108%; font-variation-settings: "wdth" 108, "wght" 800; }
}

/* ------------------------------------------------------------ accueil */
.i-app { max-width: 520px; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) var(--mh-gouttiere) 40px; display: flex; flex-direction: column; gap: 16px; }
.i-signature { margin: 0 0 20px; }
.i-signature img { display: block; height: 32px; width: auto; margin-left: -6px; }
.i-titre { margin-bottom: 0; }
.i-join { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.i-code {
  width: 100%; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums;
  font-size: 56px; line-height: 1; letter-spacing: .32em; padding: 18px 0 18px .32em; margin-bottom: 8px;
  border: 2px solid var(--encre); border-radius: 0; background: var(--fond);
}
.i-code::placeholder { color: var(--graphite-clair); }

/* ------------------------------------------------------------ en-tête de table */
.t-tete { position: sticky; top: 0; z-index: 10; background: var(--fond); border-bottom: 2px solid var(--surface); padding-top: env(safe-area-inset-top); }
.t-tete-in { max-width: 1120px; margin: 0 auto; padding: 10px var(--mh-gouttiere) 8px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.t-logo { display: block; margin-left: -4px; }
.t-logo img { display: block; height: 28px; width: auto; }
.t-logo:focus-visible { outline: 3px solid var(--encre); outline-offset: 3px; }
.t-ident { min-width: 0; }
.t-section { margin: 0; font-weight: 700; font-size: 17px; line-height: 1.15; overflow-wrap: anywhere; }
.t-table { margin: 2px 0 0; color: var(--graphite); font-size: 14px; line-height: 1.2; }
.t-temps { margin: 0; font-weight: 700; font-size: 15px; text-align: right; line-height: 1.2; }
.t-temps.depasse { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.t-temps.depasse::before { content: '▲ '; }
.t-progres { list-style: none; margin: 0 auto; padding: 0 var(--mh-gouttiere) 10px; max-width: 1120px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.t-seg { position: relative; height: 26px; display: grid; place-items: center; isolation: isolate; font-weight: 700; font-size: 14px; }
.t-seg::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--surface); transform: skewX(-10deg); }
.t-seg.fait::before { background: var(--encre); }
.t-seg.fait { color: var(--fond); }
.t-seg.courante::before { background: var(--orange); }
.t-seg.courante { color: var(--mh-sur-aplat); }
.t-seg.avenir { color: var(--graphite); }

/* ------------------------------------------------------------ corps */
.t-main { max-width: 1120px; margin: 0 auto; padding: 22px var(--mh-gouttiere) 40px; }
.t-grille { display: grid; gap: 28px; }
.t-col-principale { min-width: 0; }
.t-col-aide { display: grid; gap: 22px; align-content: start; min-width: 0; }
@media (min-width: 980px) {
  .t-grille { grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; }
  .t-col-aide { position: sticky; top: 150px; }
  .t-main { padding-top: 34px; }
}
.t-vue { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; padding-top: 6vh; }

.t-questions { margin: 4px 0 18px; padding: 0; list-style: none; counter-reset: q; display: grid; gap: 10px; max-width: 62ch; }
.t-questions li { counter-increment: q; position: relative; padding: 12px 14px 12px 52px; background: var(--surface); font-weight: 600; line-height: 1.35; }
.t-questions li::before { content: counter(q); position: absolute; left: 14px; top: 10px; font-family: var(--mh-titrage); font-style: italic; font-weight: 800; font-size: 24px; line-height: 1.2; }
.t-pas li { font-weight: 400; }
.t-lien-note { margin-left: 8px; }

.t-secours { margin: 0 0 16px; padding: 12px 14px; border: 3px solid var(--encre); background: var(--fond); }

/* Texte à copier */
.t-copie { margin: 22px 0; padding-top: 18px; border-top: 2px solid var(--encre); }
.t-apercu {
  margin: 12px 0 6px; padding: 12px 14px; background: var(--surface); border-left: 4px solid var(--encre);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 14px; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 15rem; overflow: auto;
}
.t-apercu.defile { border-bottom: 4px double var(--encre); }
.t-defile-indice { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--graphite); }
.t-copie-pied { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.t-copier { min-width: 190px; }
.t-copie-etat { margin: 0; font-size: 15px; font-weight: 600; flex: 1 1 220px; }
.t-copie-etat:empty { display: none; }

/* Documents */
.t-docs-bloc { background: var(--surface); padding: 16px 16px 12px; }
.t-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.t-docs li { display: grid; gap: 4px 12px; padding: 12px 0; border-top: 2px solid var(--fond); }
.t-docs li:first-child { border-top: 0; padding-top: 2px; }
.t-doc-nom { font-weight: 600; line-height: 1.3; }
.t-doc-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; background: var(--encre); color: var(--fond); font-size: 13px; font-weight: 600; vertical-align: 1px; }
.t-doc-liens { display: flex; gap: 20px; flex-wrap: wrap; }
.t-doc-liens a { min-height: 44px; display: inline-flex; align-items: center; }
.t-roles { background: var(--fond); border: 2px solid var(--encre); padding: 12px 14px; }
.t-roles summary { font-weight: 700; cursor: pointer; min-height: 28px; }
.t-roles ul { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: 15px; }

/* Dépôt */
.t-depot { margin-top: 28px; padding-top: 20px; border-top: 2px solid var(--encre); }
.t-depot-zone {
  width: 100%; min-height: 15rem; padding: 12px 14px; border: 2px solid var(--encre); border-radius: 0; background: var(--fond);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 14px; line-height: 1.5; resize: vertical;
}
#depot-taille { text-align: right; margin-top: 4px; font-variant-numeric: tabular-nums; }
#depot-taille.depasse { font-weight: 700; text-decoration: underline; }
.t-depot-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.t-depot-actions .t-large { width: auto; flex: 1 1 240px; }
.t-depot-actions label.btn { flex: 0 1 auto; }
#depot-fichier:focus-visible + label { outline: 3px solid var(--encre); outline-offset: 3px; }
.t-depot-res { margin-top: 14px; }
.verdict { padding: 14px 16px; border: 3px solid var(--encre); background: var(--surface); }
.verdict-titre { margin: 0; display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 19px; line-height: 1.25; }
.verdict-signe { flex: none; width: 34px; height: 34px; display: grid; place-items: center; background: var(--encre); color: var(--fond); font-weight: 800; font-size: 20px; }
.verdict-meta { margin: 8px 0 0; font-size: 15px; color: var(--graphite); }
.verdict-sous { margin: 12px 0 4px; font-weight: 700; font-size: 15px; }
.verdict-raisons { margin: 0; padding-left: 20px; display: grid; gap: 6px; overflow-wrap: anywhere; }
.v-avert { border-style: dashed; background: var(--fond); }
.v-bloquant { background: var(--encre); color: var(--fond); }
.v-bloquant .verdict-signe { background: var(--fond); color: var(--encre); }
.v-bloquant .verdict-meta { color: var(--graphite-clair); }

/* Navigation d'étape, collée en bas */
.t-nav { position: sticky; bottom: 0; z-index: 10; background: var(--fond); border-top: 2px solid var(--encre); padding-bottom: env(safe-area-inset-bottom); }
.t-nav-in { max-width: 1120px; margin: 0 auto; padding: 10px var(--mh-gouttiere); display: grid; grid-template-columns: auto 1fr auto; gap: 8px 14px; align-items: center; }
.t-nav .btn { min-height: 52px; font-size: 17px; }
.t-nav-info { margin: 0; text-align: center; color: var(--graphite); font-size: 14px; line-height: 1.25; }
.t-nav-err { max-width: 1120px; margin: 0 auto 8px; }
@media (max-width: 520px) {
  .t-nav-in { grid-template-columns: 1fr 1fr; }
  .t-nav-info { grid-column: 1 / -1; grid-row: 1; text-align: left; }
  .t-nav .btn { padding: .6em .5em; }
  .t-tete-in { grid-template-columns: auto minmax(0, 1fr); }
  .t-temps { grid-column: 1 / -1; text-align: left; }
}
.t-nav-err:not(:empty) { margin: 0 var(--mh-gouttiere) 10px; }

/* ------------------------------------------------------------ mode papier */
.p-app { max-width: 880px; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) var(--mh-gouttiere) 60px; }
.p-etapes { list-style: none; margin: 22px 0 28px; padding: 0; display: grid; gap: 14px; counter-reset: e; }
.p-etapes > li { counter-increment: e; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 14px; padding: 14px 0; border-top: 2px solid var(--encre); break-inside: avoid; }
.p-etapes > li::before { content: counter(e); font-family: var(--mh-titrage); font-style: italic; font-weight: 800; font-size: 36px; line-height: 1; grid-row: 1 / span 3; }
.p-etapes h2 { margin: 0; font-size: 22px; }
.p-etapes p { margin: 0; }
.p-duree { font-weight: 600; font-size: 15px; color: var(--graphite); }
.p-bloc { background: var(--surface); padding: 16px 18px; margin: 18px 0; }
.p-bloc h2 { margin-top: 0; }
.p-bloc ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.p-docs li { list-style: none; margin-left: -20px; }
@media print {
  .t-nav, .saut, .p-hors-papier { display: none !important; }
  .p-app { padding: 0; }
  .p-bloc { background: none; border: 2px solid var(--encre); }
}

/* Encadré fixe de chaque étape : ce que l'on obtient, ce que l'on en fait, où il sert ensuite. */
.t-encadre { margin: 0 0 18px; padding: 0; max-width: 62ch; border-left: 4px solid var(--encre); background: var(--surface); }
.t-enc-ligne { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 10px 14px; border-top: 1px solid rgba(0, 0, 0, .12); }
.t-enc-ligne:first-child { border-top: 0; }
.t-encadre dt { font-weight: 800; font-size: 14px; letter-spacing: .02em; text-transform: uppercase; }
.t-encadre dd { margin: 0; font-size: 16px; line-height: 1.4; }
@media (min-width: 720px) {
  .t-enc-ligne { grid-template-columns: 190px 1fr; gap: 14px; align-items: baseline; }
}
.t-note-fiche { margin: 0 0 14px; padding: 12px 14px; max-width: 62ch; background: var(--surface); font-weight: 600; line-height: 1.45; }
.t-fiche { margin-top: 22px; max-width: 62ch; }
.t-fiche-zone { min-height: 180px; }

/* Avis courts (mode Web de Copilot, « ne fait pas partie de l'exercice ») */
.t-avis { margin: 0 0 14px; padding: 12px 14px; max-width: 62ch; border: 2px dashed var(--encre); background: var(--fond); line-height: 1.45; font-size: 16px; }
.verdict-infos { margin: 10px 0 0; padding-left: 20px; font-size: 15px; font-style: italic; overflow-wrap: anywhere; }
.verdict .t-depot-actions { margin-top: 12px; }

/* Cibles tactiles : logo et « Rappel des rôles » d'au moins 44 px. */
.t-roles summary { min-height: 44px; display: flex; align-items: center; }
.t-logo, a.t-logo, .t-haut a { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; }

/* Taille du texte à coller et conseil de découpage (au-dessus du bouton Copier) */
.t-taille-bloc { font-size: 14px; font-weight: 600; color: var(--graphite); white-space: nowrap; }
.t-conseil { margin: 0 0 10px; padding: 10px 12px; max-width: 62ch; border: 2px solid var(--encre); background: var(--surface); font-weight: 700; line-height: 1.4; }
