/* THEOREMS - Outils › Feuilles de calculs (feuilles.js). Couleurs : encre de la page (currentColor), traits et accent du thème. */

.thr-feuille { --thr-f-ok: #16803d; --thr-f-ko: #d4183d; --thr-f-fond: color-mix(in srgb, currentColor 4%, transparent); }
.thr-feuille__chargement { opacity: .75; }
.thr-feuille__corps { grid-template-columns: minmax(0, 1.55fr) minmax(16rem, 1fr); }
@media (max-width: 900px) { .thr-feuille__corps { grid-template-columns: 1fr; } }
@media (min-width: 901px) { .thr-feuille__cote { position: sticky; top: 6.5rem; } }

/* formulaire */
.thr-feuille__saisie { display: grid; gap: 1rem; min-width: 0; }
.thr-feuille__options { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem 1rem; }
.thr-feuille__bascule { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .95rem; }
.thr-feuille__bascule input { width: 1.1rem; height: 1.1rem; margin: 0; }
.thr-feuille__raz, .thr-feuille__ajout { font: inherit; font-size: .9rem; padding: .35rem .85rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--thr-accent, #FF8A3D); background: transparent; color: inherit; }
.thr-feuille__raz:hover, .thr-feuille__raz:focus-visible, .thr-feuille__ajout:hover, .thr-feuille__ajout:focus-visible { background: var(--thr-accent, #FF8A3D); color: #10151f; }
.thr-feuille__ajout:disabled { opacity: .45; cursor: default; background: transparent; color: inherit; }
.thr-feuille__etape { min-width: 0; }
.thr-feuille__etape legend { font-size: 1.05rem; }
.thr-feuille__groupe + .thr-feuille__groupe { margin-top: .9rem; padding-top: .8rem; border-top: 1px dashed var(--thr-trait); }
.thr-feuille__groupe-titre { margin: 0 0 .5rem; font-weight: 600; font-size: .95rem; color: var(--thr-accent, #FF8A3D); }
.thr-feuille__champs { grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: .7rem .9rem; }
.thr-feuille__champ { display: grid; gap: .25rem; align-content: start; min-width: 0; font-size: .92rem; }
.thr-feuille__champ[hidden], .thr-feuille__groupe[hidden] { display: none; }
.thr-feuille__champ--expert { display: none; }
.thr-feuille--expert .thr-feuille__champ--expert:not([hidden]) { display: grid; }
.thr-feuille__champ input, .thr-feuille__champ select, .thr-feuille__derive { width: 100%; min-width: 0; box-sizing: border-box; }
.thr-feuille__derive { display: block; padding: .45rem .6rem; border-radius: .4rem; border: 1px dashed var(--thr-trait); font-variant-numeric: tabular-nums; opacity: .85; }
.thr-feuille__libelle { display: flex; align-items: flex-start; justify-content: space-between; gap: .4rem; }
.thr-feuille .thr-feuille__libelle label, .thr-feuille__libelle-texte { display: block; font-weight: 400; }
.thr-feuille__unite { opacity: .7; font-weight: 400; }
.thr-feuille__aide-bouton { flex: none; width: 1.35rem; height: 1.35rem; border-radius: 50%; border: 1px solid var(--thr-trait); background: transparent; color: inherit;
  font-size: .78rem; line-height: 1; cursor: pointer; padding: 0; opacity: .75; }
.thr-feuille__aide-bouton[aria-expanded="true"], .thr-feuille__aide-bouton:hover { opacity: 1; border-color: var(--thr-accent, #FF8A3D); }
.thr-feuille__aide { margin: 0; font-size: .84rem; opacity: .8; line-height: 1.4; }
.thr-feuille__erreur { margin: 0; font-size: .84rem; color: var(--thr-f-ko); font-weight: 600; }
.thr-feuille__champ input[aria-invalid="true"], .thr-feuille__tableau input[aria-invalid="true"] { border-color: var(--thr-f-ko); box-shadow: 0 0 0 1px var(--thr-f-ko); }

/* tableaux de saisie (lits, sommets) */
.thr-feuille__tableau { grid-column: 1 / -1; }
.thr-feuille__defile { overflow-x: auto; max-width: 100%; position: relative; }
.thr-feuille__tableau table { border-collapse: collapse; width: 100%; min-width: 24rem; }
.thr-feuille__tableau th { font-weight: 400; font-size: .85rem; opacity: .8; text-align: left; padding: .2rem .3rem; }
.thr-feuille__tableau td { padding: .2rem .3rem; }
.thr-feuille__tableau td:last-child { width: 2.2rem; text-align: center; }
.thr-feuille__tableau input, .thr-feuille__tableau select { font: inherit; width: 100%; min-width: 4.5rem; box-sizing: border-box; padding: .4rem .5rem; border-radius: .4rem;
  border: 1px solid var(--thr-trait); background: color-mix(in srgb, currentColor 5%, transparent); color: inherit; }
.thr-feuille__tableau select option { color: #10151d; }
.thr-feuille__suppr { border: 1px solid currentColor; background: transparent; color: inherit; border-radius: 50%; width: 1.7rem; height: 1.7rem; line-height: 1; cursor: pointer; opacity: .7; }
.thr-feuille__suppr:hover, .thr-feuille__suppr:focus-visible { opacity: 1; color: var(--thr-f-ko); }
.thr-feuille__ajout { justify-self: start; margin-top: .3rem; }

/* colonne de droite */
.thr-feuille__cote { display: grid; gap: .8rem; min-width: 0; }
.thr-feuille__svg svg { display: block; width: 100%; height: auto; max-height: 20rem; overflow: visible; }
.thr-feuille__vide { margin: 2rem 0; text-align: center; opacity: .7; }
.thr-feuille__barre { fill: currentColor; }
.thr-feuille__axe { stroke: #3b82f6; opacity: .9; }
.thr-feuille__axe-texte { fill: #3b82f6; }
.thr-feuille__calculer { width: 100%; cursor: pointer; }
.thr-feuille__calculer:disabled { opacity: .7; cursor: progress; }
.thr-feuille__resume { display: grid; gap: .7rem; }
.thr-feuille__resume:empty { display: none; }
.thr-feuille__perime { margin: 0; padding: .5rem .7rem; border-radius: .4rem; font-size: .9rem; border: 1px dashed var(--thr-accent, #FF8A3D); }
.thr-feuille--perime .thr-feuille__verdict, .thr-feuille--perime .thr-feuille__chiffres, .thr-feuille--perime .thr-feuille__resultats { opacity: .5; }
.thr-feuille__verdict { padding: .7rem .9rem; border-radius: .5rem; border-left: 4px solid; background: var(--thr-f-fond); }
.thr-feuille__verdict--ok { border-color: var(--thr-f-ok); }
.thr-feuille__verdict--ko { border-color: var(--thr-f-ko); }
.thr-feuille__etat { margin: 0; font-weight: 700; font-size: 1.1rem; }
.thr-feuille__verdict--ok .thr-feuille__etat { color: var(--thr-f-ok); }
.thr-feuille__verdict--ko .thr-feuille__etat { color: var(--thr-f-ko); }
.thr-feuille__taux { margin: .2rem 0 0; font-size: .92rem; }
.thr-feuille__chiffres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: 0; }
.thr-feuille__chiffres > div { border: 1px solid var(--thr-trait); border-radius: .45rem; padding: .45rem .6rem; }
.thr-feuille__chiffres dt { font-size: .8rem; opacity: .75; }
.thr-feuille__chiffres dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.thr-feuille__chiffres dd span { font-weight: 400; opacity: .75; font-size: .85rem; }

/* résultats */
.thr-feuille__resultats h3 { margin: 1.4rem 0 .4rem; font-size: 1.1rem; }
.thr-feuille__phrase { margin: .4rem 0 0; }
.thr-feuille__resultats table { margin-top: .3rem; }
.thr-feuille__resultats .thr-feuille__num { text-align: right; }
.thr-feuille__verifs th[scope="row"] { font-weight: 400; }
.thr-feuille__verifs td { font-weight: 600; }
.thr-feuille__verifs td:last-child { text-align: left; }
.thr-feuille__ok { color: var(--thr-f-ok); white-space: nowrap; }
.thr-feuille__ko { color: var(--thr-f-ko); white-space: nowrap; }
.thr-feuille__info { font-weight: 400; opacity: .75; }
.thr-feuille__pistes li + li { margin-top: .3rem; }
.thr-feuille__remarque { margin-top: 1rem; padding: .2rem 0 .2rem 1rem; border-left: 3px solid var(--thr-accent, #FF8A3D); }
.thr-feuille__remarque h3 { margin-top: .4rem; }
.thr-feuille__rapport { margin-top: 1.4rem; padding: 1rem 1.1rem; border: 1px solid var(--thr-trait); border-radius: .6rem; background: var(--thr-f-fond); }
.thr-feuille__rapport h3 { margin-top: 0; }
.thr-feuille__rapport .thr-feuille__champs { max-width: 40rem; }
.thr-feuille__pdf-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-top: .8rem; }
.thr-feuille__pdf { cursor: pointer; }
.thr-feuille__pdf:disabled { opacity: .7; cursor: progress; }
.thr-feuille__pdf-etat { margin: 0; font-size: .92rem; }
.thr-feuille__detail { margin-top: 1.4rem; }
.thr-feuille__detail details { border-top: 1px solid var(--thr-trait); }
.thr-feuille__detail details:last-child { border-bottom: 1px solid var(--thr-trait); }
.thr-feuille__detail summary { cursor: pointer; padding: .6rem 0; font-weight: 600; }
.thr-feuille__partie { padding: 0 0 1rem; }
.thr-feuille__partie h4 { margin: 1rem 0 .3rem; font-size: 1rem; }
.thr-feuille__partie td { white-space: normal; }
.thr-feuille__valeurs caption { caption-side: top; text-align: left; font-weight: 600; padding: .3rem 0; }
.thr-feuille__valeurs th { width: 60%; }
.thr-feuille__tab th { font-weight: 600; }
.thr-feuille__tab td { font-weight: 400; text-align: left; }
.thr-feuille__tab td.thr-feuille__num { text-align: right; }
.thr-feuille__discret { font-size: .88rem; opacity: .8; font-style: italic; }

/* feuilles à plusieurs cas (1.24.16) : choix du cas, cadres et ligne moyenne de la section creuse, lignes de calcul */
.thr-feuille__cas { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; margin: 0 0 1rem; }
.thr-feuille__cas-titre { font-weight: 600; margin-right: .3rem; }
.thr-feuille__cas button { font: inherit; font-size: .95rem; padding: .45rem .9rem; border-radius: 2rem; cursor: pointer; border: 1px solid var(--thr-trait); background: transparent; color: inherit; }
.thr-feuille__cas button[aria-checked="true"] { background: var(--thr-accent, #FF8A3D); border-color: var(--thr-accent, #FF8A3D); color: #10151d; font-weight: 600; }
.thr-feuille__cas button:hover, .thr-feuille__cas button:focus-visible { border-color: var(--thr-accent, #FF8A3D); }
.thr-feuille__cadre { fill: none; stroke: var(--thr-accent, #FF8A3D); stroke-linejoin: round; }
.thr-feuille__ligne { fill: none; stroke: #3b82f6; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; stroke-width: 1.4px; }
.thr-feuille__legende { margin: .3rem 0 0; font-size: .82rem; color: #3b82f6; text-align: center; }
.thr-feuille--perime .thr-feuille__svg { opacity: .5; }
.thr-feuille__formules { margin: .4rem 0 .8rem; padding: .5rem .8rem; border-left: 3px solid var(--thr-accent, #FF8A3D); background: var(--thr-f-fond); font-variant-numeric: tabular-nums; }
.thr-feuille__formules p { margin: .2rem 0; font-size: .92rem; line-height: 1.45; }

/* mur de soutènement (1.24.19) : terrain, écran fictif, nappe ; colonnes sans objet d'un tableau */
.thr-feuille__ligne--terrain { stroke: #a16207; stroke-dasharray: none; stroke-width: 1.6px; }
.thr-feuille__ligne--ecran { stroke: #64748b; stroke-dasharray: 3 3; }
.thr-feuille__ligne--eau { stroke: #0ea5e9; stroke-dasharray: 8 3; stroke-width: 1.6px; }
.thr-feuille__legende--terrain { color: #a16207; }
.thr-feuille__legende--ecran { color: #64748b; }
.thr-feuille__legende--eau { color: #0284c7; }
.thr-feuille__sans-objet { color: var(--thr-texte-discret, #8a94a6); text-align: center; }
