/* Toise, gabarit « Planche » : rail de navigation à gauche, règle graduée qui suit la lecture, bandes pleine largeur,
   angles droits, une seule couleur d'accent. Quatre couches, dans cet ordre. */
@layer socle, travees, situations, calculs;

/* ============================================================ socle : polices, jetons, éléments nus */
@layer socle {
  @font-face { font-family: "Sofia Sans Condensed"; src: url("/typo/sofia-cond-640.woff2") format("woff2"); font-weight: 640; font-style: normal; font-display: swap; }
  @font-face { font-family: "Literata"; src: url("/typo/literata-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

  :root {
    --tz-platre: #F2E9E3;
    --tz-enduit: #FBF8F5;
    --tz-vigne: #231F1E;
    --tz-ombre: #6A5A50;
    --tz-venise: #9A3B27;
    --tz-ciment: #B9ADA6;
    --tz-pas: 6px;
    --tz-portee: 62ch;
    --tz-joint: clamp(12px, 1.8vw, 24px);
    --tz-marge: clamp(18px, 4.5vw, 40px);
    --tz-linteau: 64px;
    --tz-rail: 296px;
    --tz-regle: 26px;
    --tz-police-titre: "Sofia Sans Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
    --tz-police-texte: "Literata", Georgia, "Times New Roman", serif;
    --tz-sortie: cubic-bezier(.2, .7, .2, 1);
    --tz-filigrane: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 60'%3E%3Cg fill='%23FBF8F5' fill-opacity='.075'%3E%3Crect x='3' y='2' width='42' height='10'/%3E%3Crect x='20' y='12' width='8' height='46'/%3E%3C/g%3E%3Cpath d='M20 20h-10M20 27h-6M20 34h-10M20 41h-6M20 48h-10' stroke='%23FBF8F5' stroke-opacity='.075' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    --tz-sigle-vide: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 60'%3E%3Cg fill='%236A5A50' fill-opacity='.16'%3E%3Crect x='3' y='2' width='42' height='10'/%3E%3Crect x='20' y='12' width='8' height='46'/%3E%3C/g%3E%3Cpath d='M20 20h-10M20 27h-6M20 34h-10M20 41h-6M20 48h-10' stroke='%236A5A50' stroke-opacity='.16' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    --tz-quadrillage: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M48 0v48M0 48h48' stroke='%236A5A50' stroke-opacity='.13' stroke-width='1' fill='none'/%3E%3C/svg%3E");
    color-scheme: light;
  }

  *, *::before, *::after { box-sizing: border-box; }

  html {
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
    overflow-x: clip;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--tz-linteau) + 20px);
  }
  body {
    margin: 0;
    padding-top: var(--tz-linteau);
    background: var(--tz-platre);
    color: var(--tz-vigne);
    font: 400 1.0625rem/1.62 var(--tz-police-texte);
    font-variant-numeric: oldstyle-nums proportional-nums;
    overflow-x: hidden;
    overflow-x: clip;
  }
  body[data-regle] { scroll-padding-top: calc(var(--tz-linteau) + 76px); }
  @media (min-width: 1100px) {
    body { padding-top: 0; padding-left: calc(var(--tz-rail) + var(--tz-regle)); }
    html, body[data-regle] { scroll-padding-top: 28px; }
  }

  [hidden] { display: none !important; }
  img, svg { display: block; max-width: 100%; }
  figure { margin: 0; }
  button, input, select, textarea { font: inherit; color: inherit; border-radius: 0; }
  button { font-weight: inherit; font-size: inherit; }
  p { margin: 0 0 1em; }
  ul, ol { margin: 0; padding: 0; }
  [role="list"] { list-style: none; }
  a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
  strong, b { font-weight: 650; }
  sup { font-size: .7em; line-height: 0; }
  .tz-appel { margin-left: 1px; }
  sup a { text-decoration: none; padding: 0 2px; color: var(--tz-venise); font-family: var(--tz-police-titre); font-weight: 640; font-variant-numeric: lining-nums; }
  ::selection { background: var(--tz-vigne); color: var(--tz-enduit); }
  :focus-visible { outline: 3px solid var(--tz-venise); outline-offset: 3px; }
  [data-ton="vigne"] :focus-visible, [data-ton="venise"] :focus-visible, .tz-rail :focus-visible { outline-color: var(--tz-enduit); }

  /* masquage visuel, sprite et pièges */
  .tz-sr { position: absolute !important; inline-size: 1px; block-size: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tz-sprite { position: absolute; }
  .tz-sigle-curseur { fill: var(--tz-curseur, #9A3B27); }
  .tz-evitement { position: absolute; left: 12px; top: -80px; z-index: 100; padding: 12px 16px; background: var(--tz-enduit); color: var(--tz-vigne); font: 520 1rem var(--tz-police-titre); }
  .tz-evitement:focus { top: 12px; }
  #contenu:focus { outline: 0; }

  /* titres : classes, jamais d'habillage sur les éléments seuls */
  .tz-h1, .tz-h2, .tz-h3, .tz-h4 { margin: 0; font-family: var(--tz-police-titre); font-weight: 640; font-variant-numeric: lining-nums; text-wrap: balance; }
  .tz-h1 { font-size: clamp(2.5rem, 1.5rem + 4.4vw, 5.2rem); line-height: .95; letter-spacing: -.012em; }
  .tz-h2 { font-size: clamp(2rem, 1.2rem + 2.6vw, 3.2rem); line-height: 1; letter-spacing: -.01em; }
  .tz-h3 { font-size: 1.7rem; line-height: 1.08; }
  .tz-h4 { font-size: 1.35rem; line-height: 1.12; }
  .tz-chapo { font-size: 1.1875rem; line-height: 1.5; max-width: var(--tz-portee); margin: 0; }

  /* boutons et liens d'action */
  .tz-bouton {
    display: inline-flex; align-items: center; justify-content: center; gap: 12px;
    min-height: 54px; padding: 0 26px;
    border: 0; background: var(--tz-venise); color: #fff;
    font: 520 1.15rem/1 var(--tz-police-titre); text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background-color .2s, color .2s;
  }
  .tz-bouton:hover { background: color-mix(in srgb, var(--tz-venise) 80%, #000); }
  .tz-bouton .tz-fleche { transition: transform .25s var(--tz-sortie); }
  .tz-bouton:hover .tz-fleche { transform: translateX(5px); }
  .tz-bouton-clair { background: var(--tz-enduit); color: var(--tz-vigne); }
  .tz-bouton-clair:hover { background: var(--tz-ciment); }
  .tz-bouton-sombre { background: var(--tz-vigne); color: var(--tz-enduit); }
  .tz-bouton-sombre:hover { background: var(--tz-venise); color: #fff; }
  .tz-lien { display: inline-flex; align-items: center; min-height: 44px; font: 520 1.1rem var(--tz-police-titre); color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: .28em; }
  .tz-lien:hover { color: var(--tz-venise); }
  [data-ton="vigne"] .tz-lien:hover, .tz-rail .tz-lien:hover { color: var(--tz-enduit); text-decoration-thickness: 3px; }
  .tz-fleche { flex: none; }
}

/* ============================================================ travées : rail, règle, bandes, texte, pied de page */
@layer travees {
  /* ----- Rail : barre haute sur mobile, colonne fixe à gauche dès 1100 px ----- */
  .tz-rail { position: fixed; inset: 0 0 auto 0; z-index: 60; height: var(--tz-linteau); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-inline: var(--tz-marge); background: var(--tz-vigne); color: var(--tz-enduit); }
  .tz-rail-signe { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: inherit; text-decoration: none; }
  .tz-rail-signe .tz-sigle { height: 32px; width: auto; color: var(--tz-enduit); --tz-curseur: var(--tz-enduit); }
  .tz-rail-marque { display: flex; flex-direction: column; gap: 5px; }
  .tz-rail-mot { height: 24px; width: auto; }
  .tz-rail-desc { display: none; font: 520 .82rem/1.1 var(--tz-police-titre); color: var(--tz-ciment); }
  .tz-rail-nav, .tz-rail-pied { display: none; }
  .tz-mobile { display: flex; align-items: center; gap: 8px; }
  .tz-bouton-court { min-height: 44px; padding: 0 13px; font-size: .98rem; }

  .tz-menu-m > summary { display: flex; align-items: center; min-height: 44px; padding: 0 14px; list-style: none; cursor: pointer; border: 1.5px solid var(--tz-enduit); font: 520 1rem var(--tz-police-titre); color: var(--tz-enduit); }
  .tz-menu-m > summary::-webkit-details-marker { display: none; }
  .tz-menu-m[open] > summary { background: var(--tz-enduit); color: var(--tz-vigne); }
  .tz-menu-m-panneau { position: fixed; inset: var(--tz-linteau) 0 0 0; z-index: 70; overflow: auto; background: var(--tz-vigne); color: var(--tz-enduit); padding: 12px var(--tz-marge) 56px; }
  body:has(.tz-menu-m[open]) { overflow: hidden; }
  .tz-m-rubrique summary { display: flex; align-items: center; justify-content: space-between; min-height: 66px; list-style: none; cursor: pointer; font: 640 2.2rem/1 var(--tz-police-titre); }
  .tz-m-rubrique summary::-webkit-details-marker { display: none; }
  .tz-m-rubrique summary::after { content: ""; width: 14px; height: 14px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-3px, -3px); transition: transform .25s; }
  .tz-m-rubrique[open] summary::after { transform: rotate(-135deg) translate(-3px, -3px); }
  .tz-m-rubrique ul { list-style: none; display: grid; gap: 2px; padding: 4px 0 18px; }
  .tz-m-rubrique li a { display: flex; align-items: center; min-height: 48px; padding: 0 16px; background: color-mix(in srgb, var(--tz-enduit) 8%, transparent); font: 520 1.25rem var(--tz-police-titre); text-decoration: none; }
  .tz-m-rubrique li a[aria-current="page"] { background: var(--tz-enduit); color: var(--tz-vigne); }
  .tz-menu-m-panneau > .tz-bouton { margin-top: 18px; width: 100%; }
  .tz-menu-m-mail { margin: 18px 0 0; font: 520 1rem var(--tz-police-titre); color: var(--tz-ciment); }

  /* au défilement, la barre haute se réduit au sigle et au bouton */
  @supports (animation-timeline: scroll()) {
    @media (max-width: 1099px) {
      .tz-rail-mot { animation: tz-reduit linear both; animation-timeline: scroll(root); animation-range: 0 160px; }
    }
  }
  @keyframes tz-reduit { to { width: 0; opacity: 0; } }

  @media (min-width: 1100px) {
    .tz-rail { inset: 0 auto 0 0; width: var(--tz-rail); height: 100dvh; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; padding: 30px 20px 22px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--tz-ombre) transparent; }
    .tz-mobile { display: none; }
    .tz-rail-signe { gap: 14px; padding-left: 4px; }
    .tz-rail-signe .tz-sigle { height: 44px; }
    .tz-rail-mot { height: 28px; }
    .tz-rail-desc { display: block; }
    .tz-rail-nav { display: grid; align-content: start; gap: 4px; margin-top: 36px; flex: 1; }
    .tz-rail-rubrique summary { display: flex; align-items: center; justify-content: space-between; min-height: 50px; padding: 0 14px; list-style: none; cursor: pointer; font: 640 1.5rem/1 var(--tz-police-titre); transition: background-color .2s; }
    .tz-rail-rubrique summary::-webkit-details-marker { display: none; }
    .tz-rail-rubrique summary::after { content: ""; width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .2s; }
    .tz-rail-rubrique summary:hover { background: color-mix(in srgb, var(--tz-enduit) 10%, transparent); }
    .tz-rail-rubrique[open] { background: var(--tz-enduit); color: var(--tz-vigne); }
    .tz-rail-rubrique[open] summary { background: none; }
    .tz-rail-rubrique[open] summary::after { transform: rotate(45deg); }
    .tz-rail-rubrique ul { list-style: none; padding: 0 8px 12px; display: grid; gap: 0; }
    .tz-rail-rubrique li a { display: flex; align-items: center; min-height: 40px; padding: 0 8px; font: 520 1.04rem/1.2 var(--tz-police-titre); text-decoration: none; color: var(--tz-ombre); }
    .tz-rail-rubrique li a:hover { color: var(--tz-vigne); background: var(--tz-platre); }
    .tz-rail-rubrique li a.tz-rail-hub { color: var(--tz-vigne); font-weight: 640; font-size: 1.12rem; }
    .tz-rail-rubrique li a[aria-current="page"] { color: var(--tz-venise); background: var(--tz-platre); }
    .tz-rail-pied { display: grid; gap: 4px; margin-top: 22px; }
    .tz-rail-pied .tz-bouton { width: 100%; }
    .tz-rail-pied .tz-lien { justify-content: center; }
    .tz-rail-mail { margin: 4px 0 0; text-align: center; font: 520 .92rem var(--tz-police-titre); color: var(--tz-ciment); }
  }

  /* ----- Règle : graduations d'une toise le long du texte ; le curseur rouge suit le défilement ----- */
  .tz-reglette { display: none; }
  @media (min-width: 1100px) {
    .tz-reglette { display: block; position: fixed; z-index: 30; left: var(--tz-rail); top: 0; bottom: 0; width: var(--tz-regle); background-color: var(--tz-platre);
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='60' viewBox='0 0 26 60'%3E%3Cpath d='M26 .75h-20M26 12.75h-9M26 24.75h-9M26 36.75h-9M26 48.75h-9' stroke='%236A5A50' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
      background-repeat: repeat-y; background-position: right top; }
    .tz-reglette-curseur { position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--tz-venise); }
    @supports (animation-timeline: scroll()) {
      .tz-reglette-curseur { animation: tz-curseur linear both; animation-timeline: scroll(root); }
    }
    body[data-regle] .tz-reglette-curseur { display: none; }
  }
  @keyframes tz-curseur { from { top: 0; } to { top: calc(100% - 5px); } }

  /* plan de lecture : bande collante sur mobile, règle graduée à gauche du texte sur ordinateur */
  .tz-regle { position: sticky; top: var(--tz-linteau); z-index: 40; background: var(--tz-enduit); color: var(--tz-vigne); }
  .tz-regle-plan > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; padding: 0 var(--tz-marge); list-style: none; cursor: pointer; font: 520 1.05rem/1.2 var(--tz-police-titre); }
  .tz-regle-plan > summary::-webkit-details-marker { display: none; }
  .tz-regle-plan > summary::after { content: ""; flex: none; width: 9px; height: 9px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
  .tz-regle-plan[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
  .tz-regle-actuel { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tz-regle-plan > ol { list-style: none; position: absolute; left: 0; right: 0; top: 100%; max-height: min(62vh, 460px); overflow-y: auto; background: var(--tz-enduit); padding: 4px 0 12px; }
  .tz-regle-plan li a { display: flex; align-items: center; min-height: 48px; padding: 6px var(--tz-marge); text-decoration: none; font: 520 1.1rem/1.2 var(--tz-police-titre); }
  .tz-regle-plan li a[aria-current="location"] { background: var(--tz-platre); color: var(--tz-venise); }
  .tz-regle-jauge { display: flex; gap: 2px; height: 4px; }
  .tz-regle-jauge i { flex: 1; background: color-mix(in srgb, var(--tz-ciment) 55%, transparent); transition: background-color .3s; }
  .tz-regle-jauge i[data-etat="lu"] { background: var(--tz-vigne); }
  .tz-regle-jauge i[data-etat="en-cours"] { background: var(--tz-venise); }
  @media (min-width: 1100px) {
    .tz-regle { position: fixed; z-index: 31; left: var(--tz-rail); top: 0; bottom: 0; width: var(--tz-regle); background: none; }
    .tz-regle-plan { display: block; block-size: 100%; }
    .tz-regle-plan::details-content { content-visibility: visible; }
    .tz-regle-plan > summary, .tz-regle-jauge { display: none; }
    .tz-regle-plan > ol { position: absolute; inset: 0; display: flex; flex-direction: column; max-height: none; overflow: visible; background: none; padding: 0; }
    .tz-regle-plan li { position: relative; flex: 1 1 0; min-height: 0; }
    .tz-regle-plan li::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--tz-vigne); }
    .tz-regle-plan li a { position: relative; display: block; height: 100%; padding: 0; min-height: 0; }
    .tz-regle-plan li a::after { content: ""; position: absolute; right: 0; top: 0; width: 5px; height: 100%; background: var(--tz-venise); transform-origin: top; transform: scaleY(var(--tz-lu, 0)); }
    .tz-regle-plan li a:hover, .tz-regle-plan li a[aria-current="location"] { background: color-mix(in srgb, var(--tz-venise) 12%, transparent); color: inherit; }
    .tz-regle-nom { position: absolute; left: calc(100% + 8px); top: 14px; z-index: 80; width: max-content; max-width: 340px; padding: 9px 13px; background: var(--tz-vigne); color: var(--tz-enduit); font: 520 1rem/1.25 var(--tz-police-titre); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s, visibility .15s; }
    .tz-regle-plan a:hover .tz-regle-nom, .tz-regle-plan a:focus-visible .tz-regle-nom { opacity: 1; visibility: visible; }
  }

  /* ----- Bandes ----- */
  .tz-cadre { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--tz-marge); position: relative; container: tz-cadre / inline-size; }
  .tz-travee { position: relative; padding-block: clamp(48px, 7vw, 96px); overflow: clip; }
  .tz-travee[data-ton="platre"] { background: var(--tz-platre); }
  .tz-travee[data-ton="enduit"] { background: var(--tz-enduit); }
  .tz-travee[data-ton="vigne"] { background: var(--tz-vigne); color: var(--tz-enduit); }
  .tz-travee[data-ton="venise"] { background: var(--tz-venise); color: #fff; }
  .tz-dossier { position: relative; z-index: 1; }

  /* titre d'une partie : une question du visiteur, en grand */
  .tz-jambage { margin: 0 0 clamp(22px, 3vw, 36px); }
  .tz-jambage .tz-h2 { max-width: 34ch; scroll-margin-top: 28px; }
  .tz-travee[data-forme="questions"] .tz-jambage .tz-h2, .tz-travee[data-forme="table"] .tz-jambage .tz-h2 { max-width: 40ch; }

  /* texte, renvois de marge, blocs pleine largeur */
  .tz-texte { display: flex; flex-direction: column; }
  .tz-marge { order: 2; margin-top: 28px; display: grid; gap: var(--tz-joint); }
  .tz-corps { min-width: 0; }
  .tz-corps > * { max-width: var(--tz-portee); }
  .tz-travee[data-forme="questions"] .tz-corps > * { max-width: none; }
  .tz-corps > table, .tz-corps > .tz-tableau-cadre, .tz-corps > figure:not(.tz-epreuve), .tz-corps > .tz-phasage, .tz-corps > .tz-compagnons, .tz-corps > .tz-cartes { max-width: none; }
  .tz-corps p { margin: 0 0 1.05em; }
  .tz-corps > p:last-child { margin-bottom: 0; }
  .tz-corps a { text-decoration-color: color-mix(in srgb, var(--tz-venise) 60%, transparent); text-decoration-thickness: 1.5px; }
  .tz-corps a:hover { color: var(--tz-venise); text-decoration-color: currentColor; }
  .tz-corps ul, .tz-corps ol { margin: 0 0 1.2em; padding-left: 1.3em; display: grid; gap: .45em; }
  .tz-corps ol { list-style: decimal; }
  .tz-corps ul { list-style: square; }
  .tz-corps li::marker { color: var(--tz-venise); font-family: var(--tz-police-titre); font-weight: 640; font-variant-numeric: lining-nums; }
  .tz-corps dl { margin: 0 0 1.2em; }
  .tz-pleine { margin-top: clamp(32px, 4vw, 56px); display: grid; gap: clamp(28px, 4vw, 48px); min-width: 0; }
  .tz-texte + .tz-pleine { margin-top: clamp(32px, 4vw, 56px); }
  .tz-jambage + .tz-pleine { margin-top: 0; }

  /* renvoi : conseil de métreuse, point à contrôler, petite photo cotée */
  .tz-renvoi { margin: 1.4em 0; max-width: var(--tz-portee); padding: 18px 20px 4px; background: var(--tz-platre); color: var(--tz-vigne); font-size: .98rem; line-height: 1.5; }
  .tz-travee[data-ton="platre"] .tz-renvoi { background: var(--tz-enduit); }
  .tz-renvoi p { margin: 0 0 .9em; }
  .tz-renvoi strong:first-child { display: block; margin-bottom: 4px; font: 640 1.3rem/1.1 var(--tz-police-titre); color: var(--tz-venise); font-variant-numeric: lining-nums; }
  .tz-renvoi[data-nature="photo"] { margin: 0; padding: 0; background: none; max-width: none; }
  @container tz-cadre (min-width: 900px) {
    .tz-texte { display: flow-root; }
    .tz-marge { order: 0; float: right; width: min(380px, 38%); margin: 0 0 28px 44px; }
    .tz-corps aside.tz-renvoi { float: right; clear: right; width: min(340px, 34%); margin: 4px 0 28px 44px; max-width: none; }
  }

  /* tableaux : défilants dans leur cadre, jamais plus larges que l'écran */
  .tz-tableau-cadre { margin: 0 0 1.7em; overflow-x: auto; max-width: 100%; scrollbar-width: thin; scrollbar-color: var(--tz-ombre) transparent; }
  .tz-tableau-cadre:focus-visible { outline-offset: -3px; }
  .tz-tableau { width: 100%; border-collapse: collapse; font-variant-numeric: lining-nums tabular-nums; }
  .tz-tableau caption { padding: 0 0 12px; text-align: left; font: 520 1.02rem/1.3 var(--tz-police-titre); color: var(--tz-ombre); }
  .tz-tableau th, .tz-tableau td { padding: 12px 14px; text-align: left; vertical-align: top; font: 520 1.04rem/1.35 var(--tz-police-titre); border: 0; }
  .tz-tableau thead th { background: var(--tz-vigne); color: var(--tz-enduit); font-size: .98rem; vertical-align: bottom; }
  .tz-tableau tbody td:first-child { font-weight: 640; }
  .tz-tableau tbody tr:nth-child(odd) > * { background: var(--tz-platre); }
  .tz-travee[data-ton="platre"] .tz-tableau tbody tr:nth-child(odd) > * { background: var(--tz-enduit); }
  .tz-tableau tbody tr:nth-child(even) > * { background: color-mix(in srgb, var(--tz-ciment) 14%, transparent); }
  .tz-tableau td a { text-decoration-thickness: 1.5px; }
  @container tz-cadre (max-width: 699px) {
    .tz-tableau th, .tz-tableau td { padding: 10px 10px; }
    .tz-tableau:is([data-colonnes="5"], [data-colonnes="6"], [data-colonnes="7"], [data-colonnes="8"], [data-colonnes="9"]) { display: block; }
    .tz-tableau:is([data-colonnes="5"], [data-colonnes="6"], [data-colonnes="7"], [data-colonnes="8"], [data-colonnes="9"]) :is(thead, tbody, tr) { display: block; }
    .tz-tableau:is([data-colonnes="5"], [data-colonnes="6"], [data-colonnes="7"], [data-colonnes="8"], [data-colonnes="9"]) caption { display: block; width: auto; }
    .tz-tableau:is([data-colonnes="5"], [data-colonnes="6"], [data-colonnes="7"], [data-colonnes="8"], [data-colonnes="9"]) thead { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
    .tz-tableau:is([data-colonnes="5"], [data-colonnes="6"], [data-colonnes="7"], [data-colonnes="8"], [data-colonnes="9"]) tbody tr { margin-bottom: 8px; padding: 6px 0; background: var(--tz-platre); }
    .tz-travee[data-ton="platre"] .tz-tableau:is([data-colonnes="5"], [data-colonnes="6"], [data-colonnes="7"], [data-colonnes="8"], [data-colonnes="9"]) tbody tr { background: var(--tz-enduit); }
    .tz-tableau:is([data-colonnes="5"], [data-colonnes="6"], [data-colonnes="7"], [data-colonnes="8"], [data-colonnes="9"]) tbody td { display: grid; grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr); gap: 10px; padding: 6px 14px; background: none !important; }
    .tz-tableau:is([data-colonnes="5"], [data-colonnes="6"], [data-colonnes="7"], [data-colonnes="8"], [data-colonnes="9"]) tbody td::before { content: attr(data-etiquette); font-weight: 520; color: var(--tz-ombre); }
    .tz-tableau:is([data-colonnes="5"], [data-colonnes="6"], [data-colonnes="7"], [data-colonnes="8"], [data-colonnes="9"]) tbody td:first-child { font-size: 1.2rem; padding-top: 8px; }
  }

  /* citations, plans */
  .tz-corps blockquote { margin: 1.6em 0; padding: 22px 26px 20px; background: var(--tz-platre); }
  .tz-travee[data-ton="platre"] .tz-corps blockquote { background: var(--tz-enduit); }
  .tz-corps blockquote p { margin: 0 0 .8em; font-style: italic; font-size: 1.12rem; line-height: 1.5; }
  .tz-corps blockquote footer { font: 520 1rem var(--tz-police-titre); color: var(--tz-ombre); font-style: normal; }
  .tz-corps figure:not(.tz-epreuve) { margin: 1.6em 0; padding: 18px 18px 14px; background: var(--tz-platre); }
  .tz-travee[data-ton="platre"] .tz-corps figure:not(.tz-epreuve) { background: var(--tz-enduit); }
  .tz-corps figure:not(.tz-epreuve) svg { width: 100%; max-width: 560px; height: auto; margin-inline: auto; }
  .tz-corps figure:not(.tz-epreuve) figcaption { margin-top: 10px; font: 520 .98rem/1.3 var(--tz-police-titre); color: var(--tz-ombre); text-align: center; }

  /* ----- Entête des pages de contenu ----- */
  .tz-entete { position: relative; z-index: 2; background: var(--tz-vigne); color: var(--tz-enduit); padding-block: clamp(34px, 5vw, 64px) clamp(34px, 4vw, 52px); }
  .tz-entete-grille { display: grid; gap: 28px; }
  .tz-chainage ol { list-style: none; display: flex; flex-wrap: wrap; gap: 2px 0; margin: 0 0 22px; font: 520 1rem var(--tz-police-titre); color: var(--tz-ciment); }
  .tz-chainage li { display: inline-flex; align-items: center; }
  .tz-chainage li + li::before { content: ""; width: 6px; height: 6px; margin: 0 14px 0 10px; border-top: 1.5px solid var(--tz-ciment); border-right: 1.5px solid var(--tz-ciment); transform: rotate(45deg); }
  .tz-chainage a { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
  .tz-chainage a:hover { color: var(--tz-enduit); text-decoration: underline; }
  .tz-chainage [aria-current] { color: var(--tz-enduit); }
  .tz-h1-page { font-size: clamp(2.1rem, 1.2rem + 3.1vw, 3.8rem); line-height: 1; max-width: 26ch; }
  .tz-entete .tz-chapo { margin-top: 22px; color: var(--tz-ciment); }
  .tz-signature { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 22px 0 0; font: 520 1rem/1.3 var(--tz-police-titre); color: var(--tz-ciment); }
  .tz-signature span + span::before { content: "·"; margin: 0 10px; color: var(--tz-ombre); }
  .tz-signature span:first-child { color: var(--tz-enduit); }
  @media (min-width: 1000px) {
    .tz-entete-grille { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); column-gap: clamp(32px, 5vw, 64px); align-items: end; }
    .tz-entete-titre { padding-bottom: 56px; }
    .tz-entete .tz-cartouche { margin-bottom: -56px; position: relative; z-index: 3; }
    .tz-entete { padding-bottom: 0; }
    .tz-entete ~ .tz-dossier > .tz-travee:first-child { padding-top: calc(clamp(48px, 7vw, 96px) + 56px); }
    .tz-bandeau ~ .tz-dossier > .tz-travee:first-child, .tz-bande ~ .tz-dossier > .tz-travee:first-child { padding-top: clamp(48px, 7vw, 96px); }
    .tz-entete + .tz-bandeau { padding-top: 56px; }
  }
  .tz-bandeau { background: var(--tz-platre); padding-top: clamp(24px, 3vw, 32px); padding-bottom: clamp(24px, 3vw, 32px); }
  @media (min-width: 900px) { .tz-bandeau .tz-epreuve { aspect-ratio: 2 / 1; } }

  /* ----- Notes, historique, signalement ----- */
  .tz-notes { padding-block: clamp(40px, 5vw, 72px); }
  .tz-notes-liste { list-style: none; counter-reset: note; display: grid; gap: 8px; margin: 18px 0 0; }
  .tz-notes-liste li { counter-increment: note; position: relative; padding: 16px 18px 16px 58px; background: var(--tz-platre); font-size: .95rem; line-height: 1.5; color: var(--tz-ombre); scroll-margin-top: 90px; }
  .tz-travee[data-ton="platre"] .tz-notes-liste li { background: var(--tz-enduit); }
  .tz-notes-liste li::before { content: counter(note); position: absolute; left: 18px; top: 10px; font: 640 1.9rem/1 var(--tz-police-titre); font-variant-numeric: lining-nums; color: var(--tz-venise); }
  .tz-notes-liste li:target { background: var(--tz-vigne); color: var(--tz-enduit); }
  .tz-note-retour { display: inline-block; margin-left: 6px; font: 520 .95rem var(--tz-police-titre); color: var(--tz-vigne); }
  .tz-notes-liste li:target .tz-note-retour { color: var(--tz-enduit); }
  @media (min-width: 900px) { .tz-notes-liste { grid-template-columns: repeat(2, 1fr); } }
  @media (min-width: 1250px) { .tz-notes-liste { grid-template-columns: repeat(3, 1fr); } }
  .tz-versions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 32px; margin-top: 28px; padding: 8px 20px; background: var(--tz-platre); }
  .tz-travee[data-ton="platre"] .tz-versions { background: var(--tz-enduit); }
  .tz-historique { flex: 1 1 18rem; }
  .tz-historique summary { display: flex; align-items: center; gap: 12px; min-height: 48px; list-style: none; cursor: pointer; font: 520 1.1rem var(--tz-police-titre); }
  .tz-historique summary::-webkit-details-marker { display: none; }
  .tz-historique summary::after { content: ""; width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
  .tz-historique[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
  .tz-historique ul { list-style: none; margin: 4px 0 12px; font-size: .95rem; line-height: 1.5; color: var(--tz-ombre); display: grid; gap: 6px; }
  .tz-historique b { font-family: var(--tz-police-titre); font-weight: 640; color: var(--tz-vigne); }

  /* ----- Pied de page ----- */
  .tz-pied { background: var(--tz-vigne); color: var(--tz-enduit); padding-block: clamp(48px, 6vw, 80px) 32px; }
  .tz-pied-mot { display: block; width: min(100%, 520px); margin-bottom: 36px; color: var(--tz-enduit); opacity: .12; }
  .tz-pied-mot svg { width: 100%; height: auto; }
  .tz-pied-haut { display: grid; gap: 16px; margin-bottom: 40px; }
  .tz-pied-desc { margin: 0; font: 520 1.1rem/1.4 var(--tz-police-titre); color: var(--tz-ciment); }
  .tz-pied-desc em { display: block; color: var(--tz-enduit); font-family: var(--tz-police-texte); font-weight: 400; margin-top: 4px; }
  .tz-pied-contact { display: flex; flex-wrap: wrap; gap: 0 26px; margin: 0; }
  .tz-pied a { color: inherit; text-decoration: none; }
  .tz-pied a:hover { text-decoration: underline; text-underline-offset: .25em; }
  .tz-pied-contact a { display: inline-flex; align-items: center; min-height: 44px; font: 520 1.1rem var(--tz-police-titre); }
  .tz-pied-liens { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .tz-pied-groupe { padding: 18px 18px 14px; background: color-mix(in srgb, var(--tz-enduit) 6%, transparent); }
  .tz-pied-groupe ul { list-style: none; }
  .tz-pied-titre { margin: 0 0 8px; font: 640 1.35rem/1.1 var(--tz-police-titre); }
  .tz-pied-groupe li a { display: inline-flex; align-items: center; min-height: 44px; font: 400 .98rem/1.3 var(--tz-police-texte); color: var(--tz-ciment); }
  .tz-pied-groupe li a:hover { color: var(--tz-enduit); }
  .tz-pied-bas { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; margin: 40px 0 0; font: 520 .95rem var(--tz-police-titre); color: var(--tz-ciment); }
  .tz-pied-bas a { min-height: 44px; display: inline-flex; align-items: center; }
  @media (min-width: 640px) { .tz-pied-liens { grid-template-columns: repeat(2, 1fr); } }
  @media (min-width: 900px) { .tz-pied-liens { grid-template-columns: repeat(3, 1fr); } .tz-pied-haut { grid-template-columns: 1fr auto; align-items: center; } }
  @media (min-width: 1500px) { .tz-pied-liens { grid-template-columns: repeat(6, 1fr); } }
}

/* ============================================================ situations : photos cotées, planche, cartouche, cartes, prix, phasage */
@layer situations {
  /* ----- Photos et panneaux de dessin ----- */
  .tz-epreuve { position: relative; background: color-mix(in srgb, var(--tz-ciment) 42%, var(--tz-platre)); overflow: hidden; }
  .tz-epreuve[data-format="16x10"] { aspect-ratio: 16 / 10; }
  .tz-epreuve[data-format="4x3"] { aspect-ratio: 4 / 3; }
  .tz-epreuve[data-format="3x4"] { aspect-ratio: 3 / 4; }
  .tz-epreuve-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .tz-epreuve-fond { position: absolute; inset: 0; background-image: var(--tz-sigle-vide), var(--tz-quadrillage); background-repeat: no-repeat, repeat; background-position: center, 0 0; background-size: auto 42%, 48px 48px; }
  .tz-epreuve-legende { position: absolute; right: 0; bottom: 0; max-width: 92%; padding: 7px 12px; background: var(--tz-enduit); color: var(--tz-vigne); font: 520 .92rem/1.2 var(--tz-police-titre); }

  /* cotes : un trait fin, deux taquets obliques, un nombre en chiffres tabulaires */
  .tz-cote { position: absolute; z-index: 2; color: #fff; pointer-events: none; }
  .tz-cote[data-sens="h"] { left: var(--tz-debut); right: calc(100% - var(--tz-fin)); top: var(--tz-decalage); height: 0; }
  .tz-cote[data-sens="v"] { top: var(--tz-debut); bottom: calc(100% - var(--tz-fin)); left: var(--tz-decalage); width: 0; }
  .tz-epreuve-fond ~ .tz-cote { color: var(--tz-ombre); }
  .tz-cote-trait { position: absolute; background: currentColor; }
  .tz-cote[data-sens="h"] .tz-cote-trait { left: 0; right: 0; top: -.75px; height: 1.5px; transform-origin: left center; }
  .tz-cote[data-sens="v"] .tz-cote-trait { top: 0; bottom: 0; left: -.75px; width: 1.5px; transform-origin: center top; }
  .tz-cote-taquet { position: absolute; width: 0; height: 0; }
  .tz-cote-taquet::before, .tz-cote-taquet::after { content: ""; position: absolute; background: currentColor; }
  .tz-cote[data-sens="h"] .tz-cote-taquet::before { width: 1.5px; height: 24px; left: -.75px; top: -12px; }
  .tz-cote[data-sens="h"] .tz-cote-taquet::after { width: 16px; height: 1.5px; left: -8px; top: -.75px; transform: rotate(-45deg); }
  .tz-cote[data-sens="v"] .tz-cote-taquet::before { width: 24px; height: 1.5px; left: -12px; top: -.75px; }
  .tz-cote[data-sens="v"] .tz-cote-taquet::after { width: 16px; height: 1.5px; left: -8px; top: -.75px; transform: rotate(-45deg); }
  .tz-cote[data-sens="h"] .tz-cote-taquet[data-bout="a"] { left: 0; top: 0; }
  .tz-cote[data-sens="h"] .tz-cote-taquet[data-bout="b"] { right: 0; top: 0; }
  .tz-cote[data-sens="v"] .tz-cote-taquet[data-bout="a"] { top: 0; left: 0; }
  .tz-cote[data-sens="v"] .tz-cote-taquet[data-bout="b"] { bottom: 0; left: 0; }
  .tz-cote-mesure { position: absolute; padding: 4px 10px; background: rgba(35, 31, 30, .9); color: #fff; font: 520 .98rem/1 var(--tz-police-titre); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
  .tz-cote[data-sens="h"] .tz-cote-mesure { left: 50%; top: 0; transform: translate(-50%, -50%); }
  .tz-cote[data-sens="v"] .tz-cote-mesure { top: 50%; left: 0; transform: translate(-50%, -50%); }
  .tz-epreuve-fond ~ .tz-cote .tz-cote-mesure { background: var(--tz-enduit); color: var(--tz-vigne); }
  /* tracé au premier défilement (états posés par mecanismes/rythme.js pour les cotes sous la ligne de flottaison) */
  .tz-cote[data-etat="attente"] .tz-cote-trait { transform: scaleX(0); }
  .tz-cote[data-etat="attente"][data-sens="v"] .tz-cote-trait { transform: scaleY(0); }
  .tz-cote[data-etat="attente"] .tz-cote-taquet, .tz-cote[data-etat="attente"] .tz-cote-mesure { opacity: 0; }
  .tz-cote[data-etat="trace"] .tz-cote-trait { transition: transform 1.1s var(--tz-sortie); }
  .tz-cote[data-etat="trace"] .tz-cote-taquet, .tz-cote[data-etat="trace"] .tz-cote-mesure { transition: opacity .45s .7s; }
  /* positions des cotes, par pas de 5 % */
  .tz-cote[data-debut="0"] { --tz-debut: 0%; } .tz-cote[data-debut="5"] { --tz-debut: 5%; } .tz-cote[data-debut="10"] { --tz-debut: 10%; } .tz-cote[data-debut="15"] { --tz-debut: 15%; } .tz-cote[data-debut="20"] { --tz-debut: 20%; } .tz-cote[data-debut="25"] { --tz-debut: 25%; } .tz-cote[data-debut="30"] { --tz-debut: 30%; } .tz-cote[data-debut="35"] { --tz-debut: 35%; } .tz-cote[data-debut="40"] { --tz-debut: 40%; } .tz-cote[data-debut="45"] { --tz-debut: 45%; } .tz-cote[data-debut="50"] { --tz-debut: 50%; }
  .tz-cote[data-fin="50"] { --tz-fin: 50%; } .tz-cote[data-fin="55"] { --tz-fin: 55%; } .tz-cote[data-fin="60"] { --tz-fin: 60%; } .tz-cote[data-fin="65"] { --tz-fin: 65%; } .tz-cote[data-fin="70"] { --tz-fin: 70%; } .tz-cote[data-fin="75"] { --tz-fin: 75%; } .tz-cote[data-fin="80"] { --tz-fin: 80%; } .tz-cote[data-fin="85"] { --tz-fin: 85%; } .tz-cote[data-fin="90"] { --tz-fin: 90%; } .tz-cote[data-fin="95"] { --tz-fin: 95%; } .tz-cote[data-fin="100"] { --tz-fin: 100%; }
  .tz-cote[data-decalage="5"] { --tz-decalage: 5%; } .tz-cote[data-decalage="10"] { --tz-decalage: 10%; } .tz-cote[data-decalage="15"] { --tz-decalage: 15%; } .tz-cote[data-decalage="20"] { --tz-decalage: 20%; } .tz-cote[data-decalage="25"] { --tz-decalage: 25%; } .tz-cote[data-decalage="30"] { --tz-decalage: 30%; } .tz-cote[data-decalage="35"] { --tz-decalage: 35%; } .tz-cote[data-decalage="40"] { --tz-decalage: 40%; } .tz-cote[data-decalage="45"] { --tz-decalage: 45%; } .tz-cote[data-decalage="50"] { --tz-decalage: 50%; } .tz-cote[data-decalage="55"] { --tz-decalage: 55%; } .tz-cote[data-decalage="60"] { --tz-decalage: 60%; } .tz-cote[data-decalage="65"] { --tz-decalage: 65%; } .tz-cote[data-decalage="70"] { --tz-decalage: 70%; } .tz-cote[data-decalage="75"] { --tz-decalage: 75%; } .tz-cote[data-decalage="80"] { --tz-decalage: 80%; } .tz-cote[data-decalage="85"] { --tz-decalage: 85%; } .tz-cote[data-decalage="90"] { --tz-decalage: 90%; } .tz-cote[data-decalage="95"] { --tz-decalage: 95%; }

  /* ----- Planche d'ouverture (accueil, situations) ----- */
  .tz-planche { position: relative; display: grid; background: var(--tz-vigne); color: var(--tz-enduit); }
  .tz-planche-photo { order: -1; width: 100%; }
  .tz-planche-texte { padding: 32px var(--tz-marge) 36px; }
  .tz-planche-lieu { margin: 0 0 18px; font: 520 1.05rem var(--tz-police-titre); color: var(--tz-ciment); }
  .tz-planche .tz-h1 { margin-bottom: 22px; font-size: clamp(2.3rem, 1.4rem + 3.6vw, 3.4rem); }
  .tz-planche .tz-chapo { color: var(--tz-ciment); }
  .tz-planche-gestes { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; margin: 28px 0 0; }
  .tz-planche .tz-signature { margin-top: 26px; }
  .tz-planche .tz-chainage ol { margin-bottom: 18px; }
  .tz-planche .tz-cartouche { margin: 0 var(--tz-marge) 36px; }
  @media (min-width: 1000px) {
    .tz-planche { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); min-height: min(100svh, 880px); }
    .tz-planche[data-forme="basse"] { min-height: min(76svh, 700px); }
    .tz-planche-photo { order: 0; aspect-ratio: auto !important; grid-column: 2; grid-row: 1; height: 100%; min-height: 560px; }
    .tz-planche-photo .tz-epreuve-legende { right: auto; left: 0; bottom: auto; top: 0; }
    .tz-planche-texte { grid-column: 1; grid-row: 1; align-self: center; padding: 56px clamp(24px, 3.4vw, 56px) 56px clamp(24px, 3.4vw, 56px); }
    .tz-planche .tz-h1 { font-size: clamp(2.6rem, 1rem + 3vw, 4.2rem); }
    .tz-planche[data-forme="basse"] .tz-h1 { font-size: clamp(2.2rem, 1rem + 2.3vw, 3.4rem); }
    .tz-planche .tz-cartouche-coin { position: absolute; right: 0; bottom: 0; width: min(440px, 46%); margin: 0; }
  }

  /* ----- Cartouche « réponse courte » ----- */
  .tz-cartouche { display: grid; align-self: start; background: var(--tz-enduit); color: var(--tz-vigne); }
  .tz-cartouche-q { padding: 20px 24px 18px; }
  .tz-cartouche-titre { margin: 0 0 8px; font: 520 1rem/1 var(--tz-police-titre); color: var(--tz-ombre); }
  .tz-cartouche-question { margin: 0; font: italic 400 1.15rem/1.3 var(--tz-police-texte); }
  .tz-cartouche-r { padding: 22px 24px 24px; background: var(--tz-vigne); color: var(--tz-enduit); }
  .tz-cartouche-reponse { margin: 0 0 14px; font: 640 clamp(1.9rem, 1.2rem + 2vw, 2.7rem)/1.02 var(--tz-police-titre); font-variant-numeric: lining-nums; text-wrap: balance; }
  .tz-cartouche[data-longueur="moyen"] .tz-cartouche-reponse { font-size: clamp(1.5rem, 1.1rem + 1.2vw, 1.95rem); line-height: 1.08; }
  .tz-cartouche[data-longueur="long"] .tz-cartouche-reponse { font-size: clamp(1.3rem, 1rem + .9vw, 1.6rem); line-height: 1.12; }
  .tz-cartouche-r p:last-child { margin: 0; font-size: 1rem; line-height: 1.5; color: var(--tz-ciment); }
  .tz-cartouche-r a { color: var(--tz-enduit); }
  .tz-cartouche-geste { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 62px; padding: 14px 24px; background: var(--tz-enduit); color: var(--tz-vigne); font: 640 1.4rem/1.1 var(--tz-police-titre); text-decoration: none; transition: background-color .2s, color .2s; }
  .tz-cartouche-geste .tz-fleche { transition: transform .25s var(--tz-sortie); }
  .tz-cartouche-geste:hover { background: var(--tz-ciment); }
  .tz-cartouche-geste:hover .tz-fleche { transform: translateX(6px); }
  .tz-entete .tz-cartouche { box-shadow: none; }
  .tz-entete .tz-cartouche-geste { border-top: 0; background: var(--tz-platre); }

  /* ----- Cartes : une page par carte ----- */
  .tz-cartes { list-style: none; display: grid; gap: var(--tz-joint); margin: 1.6em 0; padding: 0; }
  .tz-carte-lien { min-width: 0; }
  .tz-trumeau { position: relative; display: grid; grid-template-rows: auto 1fr; height: 100%; background: var(--tz-enduit); isolation: isolate; }
  .tz-travee[data-ton="enduit"] .tz-trumeau { background: var(--tz-platre); }
  .tz-trumeau-corps { padding: 20px 20px 92px; }
  .tz-trumeau-titre { margin: 0 0 8px; font: 640 1.55rem/1.05 var(--tz-police-titre); font-variant-numeric: lining-nums; text-wrap: balance; }
  .tz-trumeau-titre a { color: inherit; text-decoration: none; }
  .tz-trumeau-titre a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
  .tz-corps .tz-trumeau-titre a { text-decoration: none; }
  .tz-trumeau-corps p { margin: 0; font-size: .98rem; line-height: 1.5; color: var(--tz-ombre); }
  .tz-trumeau-cartouche { position: absolute; right: 0; bottom: 0; z-index: 2; display: grid; grid-template-columns: auto auto; align-items: end; padding: 12px 16px 12px 18px; background: var(--tz-vigne); color: var(--tz-enduit); transition: background-color .2s; max-width: 92%; }
  .tz-trumeau-cartouche small { grid-column: 1; font: 520 .86rem/1.1 var(--tz-police-titre); color: var(--tz-ciment); }
  .tz-trumeau-cartouche b { grid-column: 1; font: 640 1.55rem/1.05 var(--tz-police-titre); font-variant-numeric: lining-nums; }
  .tz-trumeau-cartouche .tz-fleche { grid-row: 1 / 3; grid-column: 2; align-self: center; width: 0; opacity: 0; overflow: hidden; transition: width .3s var(--tz-sortie), margin .3s var(--tz-sortie), opacity .2s; }
  .tz-trumeau:hover .tz-trumeau-cartouche, .tz-trumeau:focus-within .tz-trumeau-cartouche { background: var(--tz-venise); }
  .tz-trumeau:hover .tz-fleche, .tz-trumeau:focus-within .tz-fleche { width: 26px; opacity: 1; margin-left: 12px; }
  @media (hover: none) { .tz-trumeau-cartouche .tz-fleche { width: 26px; opacity: 1; margin-left: 12px; } }
  @container tz-cadre (min-width: 640px) { .tz-cartes { grid-template-columns: repeat(2, 1fr); } }
  @container tz-cadre (min-width: 960px) { .tz-cartes { grid-template-columns: repeat(3, 1fr); } }

  /* mosaïque : huit cartes en tuiles de tailles variées, titre posé sur la photo */
  @container tz-cadre (min-width: 900px) {
    .tz-cartes[data-n="8"] { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: 214px; }
    .tz-cartes[data-n="8"] > li { grid-column: span 3; }
    .tz-cartes[data-n="8"] > li:nth-child(1) { grid-column: 1 / 7; grid-row: 1 / 3; }
    .tz-cartes[data-n="8"] > li:nth-child(2) { grid-column: 7 / 10; grid-row: 1 / 2; }
    .tz-cartes[data-n="8"] > li:nth-child(3) { grid-column: 10 / 13; grid-row: 1 / 2; }
    .tz-cartes[data-n="8"] > li:nth-child(4) { grid-column: 7 / 13; grid-row: 2 / 3; }
    .tz-cartes[data-n="8"] > li:nth-child(5) { grid-column: 1 / 4; grid-row: 3 / 4; }
    .tz-cartes[data-n="8"] > li:nth-child(6) { grid-column: 7 / 13; grid-row: 3 / 5; }
    .tz-cartes[data-n="8"] > li:nth-child(7) { grid-column: 1 / 7; grid-row: 4 / 5; }
    .tz-cartes[data-n="8"] > li:nth-child(8) { grid-column: 4 / 7; grid-row: 3 / 4; }
    .tz-cartes[data-n="8"] .tz-trumeau { display: block; min-height: 0; background: var(--tz-ciment); }
    .tz-cartes[data-n="8"] .tz-epreuve { position: absolute; inset: 0; aspect-ratio: auto !important; }
    .tz-cartes[data-n="8"] .tz-trumeau-corps { position: absolute; left: 0; top: 0; z-index: 2; max-width: 80%; padding: 16px 18px; background: var(--tz-enduit); }
    .tz-cartes[data-n="8"] .tz-trumeau-corps p { display: none; margin-top: 8px; }
    .tz-cartes[data-n="8"] > li:is(:nth-child(1), :nth-child(4), :nth-child(6), :nth-child(7)) .tz-trumeau-corps p { display: block; }
    .tz-cartes[data-n="8"] > li:is(:nth-child(1), :nth-child(6)) .tz-trumeau-titre { font-size: 1.9rem; }
    .tz-cartes[data-n="8"] > li:is(:nth-child(1), :nth-child(6)) .tz-trumeau-corps { max-width: min(78%, 400px); }
  }

  /* ----- Prix unitaires : le prix en grand, le détail à côté ----- */
  .tz-serie-cadre { margin: 0; }
  .tz-serie-titre { margin: 0 0 6px; font: 640 1.7rem/1.08 var(--tz-police-titre); }
  .tz-serie-note { margin: 0 0 22px; max-width: var(--tz-portee); font-size: .98rem; line-height: 1.5; color: var(--tz-ombre); }
  .tz-serie { list-style: none; display: grid; gap: 6px; }
  .tz-serie li { display: grid; gap: 4px; padding: 16px 20px 18px; background: var(--tz-platre); }
  .tz-travee[data-ton="platre"] .tz-serie li { background: var(--tz-enduit); }
  .tz-serie-prix { font: 640 clamp(1.7rem, 1.3rem + 1.3vw, 2.3rem)/1.05 var(--tz-police-titre); font-variant-numeric: lining-nums; }
  .tz-serie-prix small { font: 520 .95rem var(--tz-police-titre); color: var(--tz-ombre); }
  .tz-serie-nom { font-size: .98rem; line-height: 1.45; color: var(--tz-ombre); }
  .tz-serie-nom b { display: block; font: 640 1.35rem/1.1 var(--tz-police-titre); color: var(--tz-vigne); margin-bottom: 2px; }
  .tz-serie-nom em { display: block; margin-top: 4px; font-style: normal; font: 520 .95rem var(--tz-police-titre); color: var(--tz-ombre); font-variant-numeric: lining-nums; }
  @media (min-width: 760px) { .tz-serie li { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: 28px; } }

  /* ----- Phasage : le déroulé d'un chantier ----- */
  .tz-phasage { list-style: none; display: grid; gap: 8px; margin: 1.6em 0; padding: 0; }
  .tz-phasage-temps { position: relative; padding: 22px 18px 18px; background: var(--tz-platre); }
  .tz-travee[data-ton="platre"] .tz-phasage-temps { background: var(--tz-enduit); }
  .tz-phasage-barre { position: absolute; left: 0; top: 0; width: 100%; height: 6px; background: var(--tz-vigne); transform-origin: left center; }
  .tz-phasage[data-etat="attente"] .tz-phasage-barre { transform: scaleX(0); }
  .tz-phasage[data-etat="trace"] .tz-phasage-barre { transition: transform .9s var(--tz-sortie); transition-delay: calc(var(--tz-rang, 0) * 110ms); }
  .tz-phasage-rang { display: block; margin-bottom: 10px; font: 640 1.7rem/1 var(--tz-police-titre); font-variant-numeric: lining-nums; }
  .tz-phasage dl { margin: 0; display: grid; gap: 8px; }
  .tz-phasage dt { font: 520 .88rem/1.2 var(--tz-police-titre); color: var(--tz-ombre); }
  .tz-phasage dd { margin: 0; font-size: .95rem; line-height: 1.42; }
  .tz-phasage li:nth-child(2) { --tz-rang: 1; } .tz-phasage li:nth-child(3) { --tz-rang: 2; } .tz-phasage li:nth-child(4) { --tz-rang: 3; } .tz-phasage li:nth-child(5) { --tz-rang: 4; } .tz-phasage li:nth-child(6) { --tz-rang: 5; } .tz-phasage li:nth-child(7) { --tz-rang: 6; }
  @container tz-cadre (min-width: 640px) { .tz-phasage { grid-template-columns: repeat(2, 1fr); } }
  @container tz-cadre (min-width: 1000px) {
    .tz-phasage { grid-template-columns: repeat(3, 1fr); }
    .tz-phasage[data-n="4"] { grid-template-columns: repeat(4, 1fr); }
    .tz-phasage[data-n="5"] { grid-template-columns: repeat(5, 1fr); }
    .tz-phasage[data-n="6"] { grid-template-columns: repeat(6, 1fr); }
    .tz-phasage[data-n="7"] { grid-template-columns: repeat(4, 1fr); }
  }

  /* ----- Compagnons : prénoms et gestes, jamais de portrait ----- */
  .tz-compagnons { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--tz-joint); margin: 1.6em 0; padding: 0; }
  .tz-compagnon { position: relative; display: grid; align-content: start; gap: 4px; padding: 44px 16px 18px; background: var(--tz-platre); min-width: 0; }
  .tz-travee[data-ton="platre"] .tz-compagnon { background: var(--tz-enduit); }
  .tz-compagnon-graduation { position: absolute; left: 0; top: 0; width: 100%; height: 22px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='22' viewBox='0 0 12 22'%3E%3Cpath d='M.75 0v14M6.75 0v8' stroke='%236A5A50' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: repeat-x; }
  .tz-compagnon-nom { font: 640 clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem)/1 var(--tz-police-titre); }
  .tz-compagnon-role { font: 520 1.05rem/1.2 var(--tz-police-titre); color: var(--tz-venise); }
  .tz-compagnon-gestes { margin-top: 6px; font-size: .95rem; line-height: 1.4; color: var(--tz-ombre); }
  @container tz-cadre (min-width: 760px) { .tz-compagnons { grid-template-columns: repeat(4, 1fr); } }

  /* ----- Photos par paires : avant, après ----- */
  .tz-paire-simple { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
  .tz-paire-simple .tz-epreuve-legende { right: auto; left: 0; font-size: .86rem; padding: 6px 9px; }
  .tz-paire { display: grid; gap: 0; }
  .tz-paire-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; align-content: start; }
  .tz-paire-photos .tz-epreuve-legende { right: auto; left: 0; font-size: .9rem; padding: 6px 10px; }
  .tz-paire-carte { padding: 24px 22px 8px; background: var(--tz-platre); min-width: 0; }
  .tz-travee[data-ton="platre"] .tz-paire-carte { background: var(--tz-enduit); }
  .tz-paire-carte p { font-size: .98rem; line-height: 1.5; color: var(--tz-ombre); max-width: none; }
  .tz-paire-carte a { color: var(--tz-vigne); }
  .tz-paire-carte dl { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 6px 22px; margin: 18px 0; }
  .tz-paire-carte dl div { display: grid; gap: 2px; }
  .tz-paire-carte dt { font: 520 .88rem var(--tz-police-titre); color: var(--tz-ombre); }
  .tz-paire-carte dd { margin: 0; font: 640 1.3rem/1.1 var(--tz-police-titre); font-variant-numeric: lining-nums; }
  .tz-paire-carte figure { margin: 6px 0 18px; padding: 0; background: none; }
  .tz-paire-carte figure svg { max-height: 250px; max-width: 100%; }
  .tz-paire-carte figcaption { text-align: left; }
  @container tz-cadre (min-width: 1000px) {
    .tz-paire { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
    .tz-travee:nth-of-type(even) .tz-paire { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
    .tz-travee:nth-of-type(even) .tz-paire-photos { order: 2; }
    .tz-paire-photos .tz-epreuve { aspect-ratio: auto !important; min-height: 440px; }
  }

  /* ----- Questions d'avant-chantier : la question à gauche, la réponse à droite ----- */
  .tz-questionnaire { margin: 0; display: grid; gap: var(--tz-joint); }
  .tz-question { display: grid; gap: 12px; padding: 22px 20px 24px; background: var(--tz-platre); }
  .tz-travee[data-ton="platre"] .tz-question { background: var(--tz-enduit); }
  .tz-question dt { font: 640 1.55rem/1.08 var(--tz-police-titre); font-variant-numeric: lining-nums; text-wrap: balance; }
  .tz-question dd { margin: 0; }
  .tz-question dd p { margin: 0; font-size: 1rem; line-height: 1.58; max-width: var(--tz-portee); }
  .tz-question dd p + p { margin-top: .8em; }
  .tz-question dd a { text-decoration-color: color-mix(in srgb, var(--tz-venise) 60%, transparent); text-decoration-thickness: 1.5px; }
  @container tz-cadre (min-width: 900px) {
    .tz-question { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; padding: 26px 30px 28px; }
  }

  /* ----- Bande d'un calcul ----- */
  .tz-bande-outil { padding-block: clamp(36px, 5vw, 72px); }
  .tz-outil { min-width: 0; }
}

/* ============================================================ calculs : champs, formulaire à deux gestes, cadre des outils */
@layer calculs {
  /* ----- Champs ----- */
  .tz-champ { display: grid; gap: 6px; min-width: 0; }
  .tz-champ > span { font: 520 1rem/1.2 var(--tz-police-titre); }
  .tz-champ input, .tz-champ select, .tz-champ textarea {
    width: 100%; min-height: 50px; padding: 10px 14px; border: 1.5px solid var(--tz-ombre); background: var(--tz-enduit); color: var(--tz-vigne);
    font: 400 1.0625rem/1.3 var(--tz-police-texte); font-variant-numeric: lining-nums tabular-nums; appearance: none; -webkit-appearance: none;
  }
  .tz-champ select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23231F1E' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
  .tz-champ textarea { resize: vertical; min-height: 96px; }
  .tz-champ input[type="file"] { padding: 9px 10px; min-height: 54px; font-size: .98rem; }
  .tz-champ input[type="file"]::file-selector-button { min-height: 36px; margin-right: 14px; padding: 0 16px; border: 0; background: var(--tz-vigne); color: var(--tz-enduit); font: 520 1rem var(--tz-police-titre); cursor: pointer; }
  .tz-champ input:focus-visible, .tz-champ select:focus-visible, .tz-champ textarea:focus-visible { outline: 3px solid var(--tz-venise); outline-offset: 1px; border-color: var(--tz-vigne); }
  .tz-champ input:user-invalid, .tz-champ select:user-invalid { border-color: var(--tz-venise); border-width: 2px; }
  .tz-piege { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
  .tz-case { position: relative; display: inline-flex; }
  .tz-case input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
  .tz-case span { display: flex; align-items: center; min-height: 48px; padding: 0 18px; border: 1.5px solid var(--tz-ombre); background: var(--tz-enduit); color: var(--tz-vigne); font: 520 1.05rem var(--tz-police-titre); transition: background-color .15s, color .15s; }
  .tz-case input:checked + span { background: var(--tz-vigne); color: var(--tz-enduit); border-color: var(--tz-vigne); }
  .tz-case input:focus-visible + span { outline: 3px solid var(--tz-venise); outline-offset: 2px; }
  .tz-cases { display: flex; flex-wrap: wrap; gap: 8px; }

  /* ----- Bande rouge : le déroulé d'une demande et le formulaire unique ----- */
  .tz-bande { padding-block: clamp(48px, 7vw, 88px); }
  .tz-feuillet { display: grid; gap: var(--tz-joint); }
  .tz-bande-carte { padding: 30px 24px 28px 70px; background-color: var(--tz-vigne); color: var(--tz-enduit); background-repeat: repeat-y; background-position: left top;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='60' viewBox='0 0 44 60'%3E%3Cg stroke='%23B9ADA6' stroke-opacity='.4' stroke-width='2'%3E%3Cpath d='M0 1h34M0 13h14M0 25h14M0 37h14M0 49h14'/%3E%3C/g%3E%3C/svg%3E"); }
  .tz-bande-carte .tz-h2 { font-size: clamp(1.9rem, 1.3rem + 2vw, 2.9rem); margin-bottom: 18px; }
  .tz-deroule { list-style: none; display: grid; gap: 4px; margin: 0; }
  .tz-deroule li { display: grid; grid-template-columns: 40px 1fr; align-items: baseline; gap: 6px; padding: 10px 0; font-size: 1.04rem; line-height: 1.45; }
  .tz-deroule-n { font: 640 2rem/1 var(--tz-police-titre); font-variant-numeric: lining-nums; color: var(--tz-ciment); }
  .tz-feuillet-panneau { display: grid; align-content: start; background: var(--tz-enduit); color: var(--tz-vigne); scroll-margin-top: calc(var(--tz-linteau) + 16px); }
  #feuillet { scroll-margin-top: calc(var(--tz-linteau) + 16px); }
  .tz-feuillet-gestes { display: grid; grid-template-columns: 1fr 1fr; }
  .tz-feuillet-gestes label { display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 8px 12px; text-align: center; background: var(--tz-platre); color: var(--tz-ombre); font: 640 1.3rem/1.1 var(--tz-police-titre); cursor: pointer; }
  .tz-feuillet-panneau:has(#tz-geste-metre:checked) label[for="tz-geste-metre"], .tz-feuillet-panneau:has(#tz-geste-appel:checked) label[for="tz-geste-appel"] { background: var(--tz-vigne); color: var(--tz-enduit); }
  .tz-feuillet-panneau:has(.tz-sr:focus-visible) .tz-feuillet-gestes { outline: 3px solid var(--tz-venise); outline-offset: 3px; }
  .tz-feuillet-panneau:has(#tz-geste-metre:checked) [data-geste="appel"], .tz-feuillet-panneau:has(#tz-geste-appel:checked) [data-geste="metre"] { display: none; }
  .tz-feuillet-champs { display: grid; gap: 18px; padding: 24px 22px 6px; }
  .tz-moment { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
  .tz-moment legend { padding: 0; margin-bottom: 10px; font: 520 1rem var(--tz-police-titre); }
  .tz-feuillet-note { margin: 4px 0 0; font-size: .95rem; color: var(--tz-ombre); }
  .tz-feuillet-alerte { margin: 0; padding: 16px 22px; background: var(--tz-venise); color: #fff; font: 520 1.08rem/1.35 var(--tz-police-titre); }
  .tz-feuillet-alerte[hidden] { display: none; }
  .tz-accord { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; margin: 0; padding: 18px 22px 4px; font-size: .9rem; line-height: 1.45; color: var(--tz-ombre); cursor: pointer; }
  .tz-accord input { width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--tz-venise); }
  .tz-feuillet-panneau > .tz-bouton { margin: 16px 22px 26px; justify-self: start; min-height: 56px; }
  @media (min-width: 640px) {
    .tz-feuillet-champs { grid-template-columns: 1fr 1fr; }
    .tz-feuillet-champs > .tz-champ-large, .tz-feuillet-champs > .tz-moment { grid-column: 1 / -1; }
  }
  @media (max-width: 999px) { body[data-gabarit="guichet"] .tz-feuillet-panneau { order: -1; } }
  @media (min-width: 1000px) { .tz-feuillet { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; } }

  /* ----- Cadre des outils de calcul : éléments personnalisés, résultats dans des <output> ----- */
  .tz-metre { display: block; }
  .tz-metre-titre { margin: 0 0 clamp(18px, 2.4vw, 30px); font: 640 clamp(1.9rem, 1.3rem + 2vw, 2.9rem)/1 var(--tz-police-titre); font-variant-numeric: lining-nums; text-wrap: balance; }
  [data-ton="vigne"] .tz-metre-titre { color: var(--tz-enduit); }
  .tz-metre-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: var(--tz-joint); align-items: start; min-width: 0; }
  .tz-metre-form > :is(p, .tz-metre-dessins, .tz-metre-resultat, .tz-metre-resultats, .tz-metre-liste-bloc, .tz-metre-pieces, .tz-metre-grille, .tz-metre-alerte, .tz-metre-alertes, .tz-metre-cartes, output) { grid-column: 1 / -1; }
  .tz-metre-form > * { min-width: 0; }
  .tz-metre-dessins { display: grid; gap: var(--tz-joint); max-width: 560px; }
  .tz-metre-figure { margin: 0; padding: 18px 16px 12px; background: var(--tz-vigne); color: var(--tz-enduit); }
  .tz-metre-figure figcaption { margin-top: 8px; font: 520 .95rem var(--tz-police-titre); color: var(--tz-ciment); }
  .tz-metre-resume { margin: 0; display: grid; gap: 2px; padding: 16px 14px 14px; background: var(--tz-enduit); color: var(--tz-vigne); }
  .tz-metre-resume .tz-metre-ligne { padding: 8px 10px; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; min-width: 0; }
  .tz-metre-resume .tz-metre-ligne:nth-child(odd) { background: none; }
  .tz-metre-resume .tz-metre-ligne dt { color: var(--tz-ombre); }
  .tz-metre-resume .tz-metre-ligne dd { flex: 1 1 auto; min-width: 0; font: 640 clamp(1.05rem, .9rem + .5vw, 1.3rem)/1.15 var(--tz-police-titre); font-variant-numeric: lining-nums; overflow-wrap: anywhere; }
  .tz-metre-resume .tz-metre-ligne:last-child { background: var(--tz-vigne); color: var(--tz-enduit); }
  .tz-metre-resume .tz-metre-ligne:last-child dt { color: var(--tz-ciment); }
  .tz-metre-resume .tz-metre-ligne:last-child dd { font-size: clamp(1.25rem, 1rem + .8vw, 1.55rem); }
  [data-ton="vigne"] .tz-metre-resume .tz-metre-ligne:last-child { background: var(--tz-venise); color: #fff; }
  [data-ton="vigne"] .tz-metre-resume .tz-metre-ligne:last-child dt { color: #fff; }
  .tz-metre-plus { grid-column: 1 / -1; background: var(--tz-platre); color: var(--tz-vigne); min-width: 0; }
  .tz-metre-plus > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 14px; list-style: none; cursor: pointer; font: 520 1.05rem/1.2 var(--tz-police-titre); }
  .tz-metre-plus > summary::-webkit-details-marker { display: none; }
  .tz-metre-plus > summary::after { content: ""; flex: none; width: 9px; height: 9px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
  .tz-metre-plus[open] > summary { background: var(--tz-vigne); color: var(--tz-enduit); }
  .tz-metre-plus[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
  .tz-metre-plus-corps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 14px; padding: 16px 14px 18px; }
  .tz-metre-plus-corps > :is(.tz-metre-case, .tz-metre-aide) { grid-column: 1 / -1; }
  .tz-metre-plus-corps > .tz-metre-champ { align-self: end; }
  .tz-metre-plus-groupe { background: var(--tz-enduit); }
  .tz-metre-plus-groupe > summary { min-height: 60px; padding: 0 20px; font: 640 1.3rem/1.1 var(--tz-police-titre); }
  .tz-metre-plus-groupe .tz-metre-plus-corps { padding: 18px 20px 22px; }
  .tz-metre-plus-groupe .tz-metre-case { background: var(--tz-platre); }
  .tz-metre-plus-groupe .tz-metre-case:has(input:checked) { background: var(--tz-vigne); }
  .tz-metre-plan, .tz-metre-developpe { --tz-trait: var(--tz-ciment); --tz-fond-plan: var(--tz-vigne); --tz-encre: var(--tz-enduit); --tz-note: var(--tz-ciment); width: 100%; height: auto; }
  .tz-metre-groupe { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 14px; margin: 0; padding: 20px 20px 22px; border: 0; min-width: 0; background: var(--tz-enduit); color: var(--tz-vigne); }
  .tz-metre-groupe > legend { float: left; grid-column: 1 / -1; width: 100%; margin: 0 0 2px; padding: 0; font: 640 1.3rem/1.1 var(--tz-police-titre); }
  .tz-metre-groupe > .tz-metre-champ { align-self: end; }
  .tz-metre-groupe > .tz-metre-champ:has(> select[name="retour"]) { grid-column: 1 / -1; }
  .tz-metre-groupe > :is(.tz-metre-groupe, .tz-metre-option, .tz-metre-case, .tz-metre-aide, .tz-metre-action, .tz-metre-alerte) { grid-column: 1 / -1; }
  .tz-metre-groupe .tz-metre-groupe { padding: 0; background: none; }
  /* sans colonne de dessins seulement : avec elle, tous les blocs restent dans la colonne de droite */
  .tz-metre-form:not(:has(> .tz-metre-dessins)) > .tz-metre-groupe:has(> .tz-metre-groupe) { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
  .tz-metre-form:not(:has(> .tz-metre-dessins)) > .tz-metre-groupe:has(> .tz-metre-groupe) > .tz-metre-groupe { grid-column: auto; }
  .tz-metre-champ { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 6px 8px; min-width: 0; }
  .tz-metre-champ > label { grid-column: 1 / -1; font: 520 1rem/1.25 var(--tz-police-titre); }
  .tz-metre-champ > input, .tz-metre-champ > select { grid-column: 1; width: 100%; min-width: 0; min-height: 50px; padding: 8px 12px; border: 1.5px solid var(--tz-ombre); background: var(--tz-platre); color: var(--tz-vigne); font: 640 1.3rem/1.2 var(--tz-police-titre); font-variant-numeric: lining-nums tabular-nums; appearance: none; -webkit-appearance: none; }
  .tz-metre-champ > input[type="number"] { -moz-appearance: textfield; }
  .tz-metre-champ > select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23231F1E' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; grid-column: 1 / -1; font-size: 1.1rem; font-weight: 520; }
  .tz-metre-champ > input:focus-visible, .tz-metre-champ > select:focus-visible { outline: 3px solid var(--tz-venise); outline-offset: 1px; border-color: var(--tz-vigne); }
  .tz-metre-unite { grid-column: 2; align-self: center; min-width: 2ch; font: 520 1.1rem var(--tz-police-titre); color: var(--tz-ombre); }
  .tz-metre-aide { grid-column: 1 / -1; font-size: .88rem; line-height: 1.4; color: var(--tz-ombre); }
  .tz-metre-option, .tz-metre-case { position: relative; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 14px; background: var(--tz-platre); cursor: pointer; font: 520 1.05rem/1.25 var(--tz-police-titre); }
  .tz-metre-option input, .tz-metre-case input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--tz-venise); }
  .tz-metre-option:has(input:checked), .tz-metre-case:has(input:checked) { background: var(--tz-vigne); color: var(--tz-enduit); }
  .tz-metre-option:has(input:focus-visible), .tz-metre-case:has(input:focus-visible) { outline: 3px solid var(--tz-venise); outline-offset: 2px; }
  .tz-metre-action { margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
  .tz-metre-bouton, .tz-metre-geste { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 24px; border: 0; cursor: pointer; font: 520 1.15rem/1 var(--tz-police-titre); transition: background-color .2s, color .2s; }
  .tz-metre-bouton { background: var(--tz-venise); color: #fff; }
  .tz-metre-bouton:hover { background: color-mix(in srgb, var(--tz-venise) 80%, #000); }
  .tz-metre-geste { background: var(--tz-vigne); color: var(--tz-enduit); }
  .tz-metre-geste:hover { background: var(--tz-venise); }
  [data-ton="vigne"] .tz-metre-geste { background: var(--tz-enduit); color: var(--tz-vigne); }
  [data-ton="vigne"] .tz-metre-geste:hover { background: var(--tz-ciment); color: var(--tz-vigne); }
  .tz-metre-geste[disabled] { background: var(--tz-vigne); color: var(--tz-ciment); cursor: not-allowed; outline: 1.5px dashed var(--tz-ciment); outline-offset: -6px; }
  [data-ton="vigne"] .tz-metre-geste[disabled] { background: var(--tz-enduit); color: var(--tz-ombre); outline-color: var(--tz-ombre); }
  .tz-metre-bouton[disabled] { opacity: .6; cursor: not-allowed; outline: 1.5px dashed currentColor; outline-offset: -6px; }
  .tz-metre-geste:hover[disabled] { background: var(--tz-vigne); }
  [data-ton="vigne"] .tz-metre-geste:hover[disabled] { background: var(--tz-enduit); }
  .tz-metre-geste-aide { display: none; flex-basis: 100%; align-self: center; font: 520 1rem/1.35 var(--tz-police-titre); color: var(--tz-ombre); }
  [data-ton="vigne"] .tz-metre-geste-aide { color: var(--tz-ciment); }
  .tz-metre-geste[disabled] ~ .tz-metre-geste-aide { display: block; }
  @media (min-width: 700px) { .tz-metre-geste-aide { flex-basis: auto; } }
  .tz-metre-sortie { font-variant-numeric: lining-nums tabular-nums; }
  .tz-metre-resultats { margin: 0; padding: 22px 20px 20px; background: var(--tz-vigne); color: var(--tz-enduit); display: grid; gap: 2px; }
  .tz-metre-ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 8px 12px; font: 520 1.05rem/1.25 var(--tz-police-titre); }
  .tz-metre-ligne:nth-child(odd) { background: color-mix(in srgb, var(--tz-enduit) 7%, transparent); }
  .tz-metre-ligne dt { color: var(--tz-ciment); }
  .tz-metre-ligne dd { margin: 0; font-weight: 640; text-align: right; }
  .tz-metre-total { font: 640 clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem)/1.05 var(--tz-police-titre); }
  .tz-metre-tarifs { margin: 14px 0 0; font: 520 .95rem/1.35 var(--tz-police-titre); color: var(--tz-ombre); }
  [data-ton="vigne"] .tz-metre-tarifs { color: var(--tz-ciment); }
  @container tz-cadre (min-width: 800px) {
    .tz-metre-form:has(> .tz-metre-dessins) { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: clamp(20px, 2.4vw, 32px); row-gap: 0; }
    .tz-metre-form:has(> .tz-metre-dessins) > :not(.tz-metre-dessins) { margin-bottom: var(--tz-joint); }
    .tz-metre-form:has(> .tz-metre-dessins) > * { grid-column: 2; }
    .tz-metre-form:has(> .tz-metre-dessins) > .tz-metre-dessins { max-width: none; grid-column: 1; grid-row: 1 / span 16; position: sticky; top: calc(var(--tz-linteau) + 24px); align-self: start; }
    body[data-regle] .tz-metre-form:has(> .tz-metre-dessins) > .tz-metre-dessins { top: calc(var(--tz-linteau) + 76px); }
    @media (min-width: 1100px) { .tz-metre-form:has(> .tz-metre-dessins) > .tz-metre-dessins, body[data-regle] .tz-metre-form:has(> .tz-metre-dessins) > .tz-metre-dessins { top: 24px; } }
  }

  /* ----- Résultats libres, gestes, alertes ----- */
  .tz-metre-resultat { display: grid; gap: 12px; padding: 24px 22px 22px; background: var(--tz-vigne); color: var(--tz-enduit); min-width: 0; }
  .tz-metre-resultat p { margin: 0; }
  .tz-metre-resultat .tz-metre-sortie { color: inherit; }
  .tz-metre-grand { font: 640 clamp(1.8rem, 1.3rem + 2vw, 2.9rem)/1.04 var(--tz-police-titre); font-variant-numeric: lining-nums; text-wrap: balance; }
  .tz-metre-grand .tz-metre-total { font: inherit; }
  .tz-metre-gestes { margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
  .tz-metre-alerte, .tz-metre-alertes { display: block; padding: 12px 16px; background: var(--tz-venise); color: #fff; font: 520 1.05rem/1.35 var(--tz-police-titre); }
  .tz-metre-alerte:empty, .tz-metre-alertes:empty { display: none; }
  .tz-metre-alertes-liste { list-style: none; display: grid; gap: 6px; }
  .tz-metre-note, .tz-metre-source { margin: 0; font-size: .95rem; line-height: 1.5; color: var(--tz-ombre); }
  [data-ton="vigne"] .tz-metre-note, [data-ton="vigne"] .tz-metre-source { color: var(--tz-ciment); }
  .tz-metre-source { margin-top: 12px; }

  /* ----- Pièces ajoutées au métré du logement ----- */
  .tz-metre-liste-bloc { padding: 20px; background: var(--tz-enduit); color: var(--tz-vigne); }
  .tz-metre-liste-bloc h3 { margin: 0 0 12px; font: 640 1.3rem/1.1 var(--tz-police-titre); }
  .tz-metre-liste { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; }
  .tz-metre-liste li { position: relative; display: grid; gap: 3px; padding: 14px 16px 56px; background: var(--tz-platre); }
  .tz-metre-liste-nom { font: 640 1.3rem/1.1 var(--tz-police-titre); }
  .tz-metre-liste-cotes, .tz-metre-liste-surfaces { font-size: .92rem; line-height: 1.4; color: var(--tz-ombre); font-variant-numeric: lining-nums; }
  .tz-metre-liste-prix { position: absolute; right: 0; bottom: 0; padding: 9px 14px; background: var(--tz-vigne); color: var(--tz-enduit); font: 640 1.1rem/1 var(--tz-police-titre); font-variant-numeric: lining-nums; }
  .tz-metre-retirer { position: absolute; left: 12px; bottom: 5px; min-height: 44px; padding: 0 6px; background: none; border: 0; cursor: pointer; font: 520 .98rem var(--tz-police-titre); text-decoration: underline; text-underline-offset: .22em; color: var(--tz-vigne); }
  .tz-metre-retirer:hover { color: var(--tz-venise); }

  /* ----- Ordre du chantier : une ligne par pièce, puis la liste ordonnée ----- */
  .tz-metre-pieces { gap: 8px; }
  .tz-metre-piece-ligne { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px 14px; align-items: end; padding: 10px; background: var(--tz-platre); }
  .tz-metre-piece-ligne > .tz-metre-case { grid-column: 1 / -1; background: none; padding-inline: 4px; }
  .tz-metre-piece-ligne > .tz-metre-case:has(input:checked) { background: none; color: inherit; }
  .tz-metre-ordre { display: block; }
  .tz-metre-ordre-liste { list-style: none; counter-reset: rang; display: grid; gap: 6px; margin: 0; padding: 0; }
  .tz-metre-ordre-liste li { counter-increment: rang; position: relative; display: grid; gap: 2px 14px; padding: 12px 14px 12px 58px; background: color-mix(in srgb, var(--tz-enduit) 8%, transparent); }
  .tz-metre-ordre-liste li::before { content: counter(rang); position: absolute; left: 14px; top: 8px; font: 640 2rem/1 var(--tz-police-titre); font-variant-numeric: lining-nums; color: var(--tz-ciment); }
  .tz-metre-ordre-nom { font: 640 1.3rem/1.1 var(--tz-police-titre); }
  .tz-metre-ordre-sol, .tz-metre-ordre-murs { font-size: .92rem; line-height: 1.35; color: var(--tz-ciment); }
  .tz-metre-ordre-prix { font: 640 1.1rem/1.2 var(--tz-police-titre); font-variant-numeric: lining-nums; }
  .tz-metre-ordre-role { font-size: .92rem; font-style: italic; color: var(--tz-ciment); }

  /* ----- Routeur de situations : neuf cartes qui ouvrent la page réglée ----- */
  .tz-metre-cartes { list-style: none; display: grid; gap: var(--tz-joint); margin: 0 0 var(--tz-joint); padding: 0; }
  .tz-metre-carte { display: grid; min-width: 0; }
  .tz-metre-carte a { position: relative; display: grid; align-content: start; gap: 6px; height: 100%; padding: 18px 18px 74px; background: var(--tz-enduit); color: var(--tz-vigne); text-decoration: none; transition: background-color .2s, color .2s; }
  .tz-metre-carte-titre { font: 640 1.5rem/1.05 var(--tz-police-titre); font-variant-numeric: lining-nums; }
  .tz-metre-carte-texte { font-size: .96rem; line-height: 1.45; color: var(--tz-ombre); }
  .tz-metre-carte-chiffre { position: absolute; right: 0; bottom: 0; max-width: 92%; padding: 11px 16px; background: var(--tz-vigne); color: var(--tz-enduit); font: 640 1.15rem/1.15 var(--tz-police-titre); font-variant-numeric: lining-nums; }
  .tz-metre-carte a:hover .tz-metre-carte-chiffre { background: var(--tz-venise); }
  .tz-metre-carte[data-etat="proposee"] a { background: var(--tz-vigne); color: var(--tz-enduit); }
  .tz-metre-carte[data-etat="proposee"] .tz-metre-carte-texte { color: var(--tz-ciment); }
  .tz-metre-carte[data-etat="proposee"] .tz-metre-carte-chiffre { background: var(--tz-venise); color: #fff; }
  .tz-metre-carte[data-etat="associee"] a { background: var(--tz-ciment); }
  .tz-metre-carte[data-etat="associee"] .tz-metre-carte-texte { color: var(--tz-vigne); }
  @container tz-cadre (min-width: 640px) { .tz-metre-cartes { grid-template-columns: repeat(2, 1fr); } }
  @container tz-cadre (min-width: 960px) { .tz-metre-cartes { grid-template-columns: repeat(3, 1fr); } }

  /* ----- Critères de saison, mention de TVA, grille de vétusté ----- */
  .tz-metre-criteres { display: block; }
  .tz-metre-criteres-liste { list-style: none; display: grid; gap: 6px; margin: 0; padding: 0; }
  .tz-metre-criteres-liste li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 9px 12px; background: color-mix(in srgb, var(--tz-enduit) 8%, transparent); font: 520 1.02rem/1.3 var(--tz-police-titre); }
  .tz-metre-critere-valeur { font-weight: 640; font-variant-numeric: lining-nums; }
  .tz-metre-critere-mot { order: -1; text-transform: none; padding: 1px 9px; background: var(--tz-ciment); color: var(--tz-vigne); font-weight: 640; }
  .tz-metre-criteres-liste li[data-etat="favorable"] .tz-metre-critere-mot { background: var(--tz-enduit); }
  .tz-metre-criteres-liste li[data-etat="bloquant"] .tz-metre-critere-mot { background: var(--tz-venise); color: #fff; }
  .tz-metre-critere-seuil { color: var(--tz-ciment); font-size: .95rem; }
  .tz-metre-mention-bloc { grid-template-columns: 1fr; background: var(--tz-enduit); color: var(--tz-vigne); }
  .tz-metre-resultat .tz-metre-mention-bloc { padding: 16px 18px; }
  .tz-metre-mention { display: block; padding: 14px 16px; background: var(--tz-platre); color: var(--tz-vigne); font-style: italic; line-height: 1.55; user-select: all; }
  .tz-metre-grille { display: block; min-width: 0; overflow-x: auto; }
  .tz-metre-tableau { width: 100%; border-collapse: collapse; font-variant-numeric: lining-nums tabular-nums; }
  .tz-metre-tableau caption { padding: 0 0 10px; text-align: left; font: 520 1rem/1.3 var(--tz-police-titre); color: var(--tz-ombre); }
  .tz-metre-tableau th, .tz-metre-tableau td { padding: 10px 12px; text-align: left; font: 520 1.02rem/1.3 var(--tz-police-titre); }
  .tz-metre-tableau thead th { background: var(--tz-vigne); color: var(--tz-enduit); }
  .tz-metre-tableau tbody tr:nth-child(odd) > * { background: var(--tz-enduit); }
  .tz-metre-tableau tbody tr:nth-child(even) > * { background: color-mix(in srgb, var(--tz-ciment) 18%, transparent); }
  .tz-metre-tableau tbody tr:is([aria-current], [data-etat="courante"]) > * { background: var(--tz-vigne); color: var(--tz-enduit); }

  /* ----- Dessins des outils (cotes en SVG : jamais la couleur des cotes sur photo) ----- */
  .tz-metre-annee, .tz-metre-silhouette, .tz-metre-developpe { color: var(--tz-enduit); width: 100%; height: auto; }
  .tz-metre-figure:has(.tz-metre-annee) { background: var(--tz-enduit); color: var(--tz-vigne); }
  .tz-metre-figure:has(.tz-metre-annee) figcaption { color: var(--tz-ombre); }
  .tz-annee-base { stroke: var(--tz-ombre); }
  .tz-annee-mois { fill: var(--tz-ombre); font-family: var(--tz-police-titre); font-weight: 520; }
  .tz-annee-colonne[aria-current] .tz-annee-mois { fill: var(--tz-vigne); font-weight: 640; }
  .tz-annee-repere { stroke: var(--tz-vigne); }
  .tz-annee-colonne[data-etat="favorable"] .tz-annee-barre, .tz-annee-legende li[data-etat="favorable"]::before { fill: var(--tz-vigne); background: var(--tz-vigne); fill-opacity: 1; }
  .tz-annee-colonne[data-etat="a-caler"] .tz-annee-barre, .tz-annee-legende li[data-etat="a-caler"]::before { fill: var(--tz-ciment); background: var(--tz-ciment); fill-opacity: 1; stroke: var(--tz-vigne); stroke-width: 1.5; }
  .tz-annee-colonne[data-etat="deconseille"] .tz-annee-barre, .tz-annee-legende li[data-etat="deconseille"]::before { fill: var(--tz-venise); background: var(--tz-venise); fill-opacity: 1; }
  .tz-annee-legende { list-style: none; display: grid; gap: 6px; margin: 12px 0 4px; padding: 0; font: 520 .98rem/1.3 var(--tz-police-titre); }
  .tz-annee-legende li { display: flex; align-items: baseline; gap: 10px; }
  .tz-annee-legende li::before { content: ""; flex: none; width: 14px; height: 14px; transform: translateY(2px); }
  .tz-annee-legende li[data-etat="a-caler"]::before { border: 1.5px solid var(--tz-vigne); }
  .tz-facade-face { color: var(--tz-enduit); }
  .tz-facade-face[data-etat="laissee"] { stroke-dasharray: 5 4; color: var(--tz-ciment); }
  .tz-facade-sol { stroke: var(--tz-ciment); }
  .tz-facade-surface, .tz-dev-surface { fill: var(--tz-enduit); font-family: var(--tz-police-titre); font-weight: 640; font-variant-numeric: lining-nums; }
  .tz-dev-mur { color: var(--tz-enduit); }
  .tz-dev-baie { color: var(--tz-ciment); }
  .tz-dev-nom { fill: var(--tz-ciment); font-family: var(--tz-police-titre); font-weight: 520; }

  /* dessins : plans, développés, cotes en SVG */
  .tz-plan-piece { fill: color-mix(in srgb, var(--tz-trait) 8%, var(--tz-fond-plan)); }
  .tz-plan-piece[data-traitee="oui"] { fill: color-mix(in srgb, var(--tz-venise) 15%, var(--tz-fond-plan)); }
  .tz-plan-mur { fill: none; stroke: var(--tz-trait); stroke-width: 7; stroke-linejoin: miter; }
  .tz-plan-cloison { fill: none; stroke: var(--tz-trait); stroke-width: 3.5; }
  .tz-plan-baie { stroke: color-mix(in srgb, var(--tz-trait) 8%, var(--tz-fond-plan)); stroke-width: 10; fill: none; }
  .tz-plan-vitre { stroke: var(--tz-trait); stroke-width: 1.4; fill: none; }
  .tz-plan-porte { stroke: var(--tz-trait); stroke-width: 1.2; fill: none; }
  .tz-plan-nom { fill: var(--tz-encre); font: 640 20px var(--tz-police-titre); }
  .tz-plan-surface { fill: var(--tz-note); font: 520 15px var(--tz-police-titre); font-variant-numeric: lining-nums tabular-nums; }
  .tz-cotesvg-ext, .tz-cotesvg-trait, .tz-cotesvg-taquet { fill: none; stroke: var(--tz-note); stroke-width: 1.25; }
  .tz-cotesvg-texte { fill: var(--tz-note); font: 520 15px var(--tz-police-titre); font-variant-numeric: lining-nums tabular-nums; }
}

/* ============================================================ mouvement réduit, impression */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .tz-rail, .tz-reglette, .tz-regle, .tz-bande, .tz-pied, .tz-bandeau { display: none !important; }
  body { padding: 0 !important; background: #fff; font-size: 11pt; }
  .tz-travee { padding-block: 16pt; background: #fff !important; color: #000 !important; }
  .tz-entete, .tz-planche { background: #fff; color: #000; }
}

