.bmt-results .carte-cadre table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  font-size: 13px;
}
.bmt-results .carte-cadre :is(th, td) {
  min-width: 0;
  padding: clamp(3px, .55vh, 6px) 3px;
  line-height: 1.2;
}
.bmt-results .carte-cadre thead tr:first-child th:first-child {
  width: 34%;
  text-align: start;
}
.bmt-results .carte-cadre thead th { overflow-wrap: anywhere; }
/* Dix-sept modèles : le titre du dossier cède de la place, les sous-titres tiennent sur une ligne et les noms
   abrégés coiffent les colonnes (le nom complet reste lu par les lecteurs d'écran et s'affiche au survol). */
.bmt-results #dossiers .carte-cadre thead tr:first-child th:first-child { width: 24%; }
.bmt-results #domaines .carte-cadre thead tr:first-child th:first-child { width: 30%; }
.bmt-results .carte-cadre thead tr:first-child th:not(:first-child) { padding-inline: 0; font-size: 11px; overflow-wrap: normal; }
.bmt-results .carte-cadre thead th:not(:first-child) .carte-libelle {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.bmt-results #dossiers .carte-cadre thead tr:nth-child(2) th { padding-inline: 0; font-size: 9px; overflow-wrap: normal; white-space: nowrap; }
.bmt-results #dossiers .carte-cadre td { padding-inline: 0; font-size: 12px; letter-spacing: -.02em; }
.bmt-results .carte-cadre tbody th { padding-inline: 7px; }
.bmt-results .carte-notes { margin-top: 8px; border-top: 1px solid var(--bmt-rule); }
.bmt-results .carte-notes summary {
  padding: 6px 0;
  font: 550 14px/1.4 var(--bmt-sans);
  color: var(--bmt-forest);
  cursor: pointer;
}
.bmt-results .carte-notes p { margin: .55em 0; }
.bmt-results .carte-notes ul { margin: .4em 0 1em; padding-left: 1.4em; }
.bmt-results :is(#dossiers, #domaines) .bmt-scale {
  max-width: none;
  margin: 6px 0 9px;
  font: 400 13px/1.4 var(--bmt-sans);
}
.carte-ordre, .carte-abrege, .carte-cle { display: none; }
.carte-cadre thead th:not(:first-child) .carte-abrege { display: inline; }
.carte-cadre thead th:not(:first-child) .carte-abrege::before { content: attr(data-nom); }

@media screen and (max-width: 1139px) and (min-height: 641px),
       screen and (max-width: 539px) {
  .bmt-results :is(#dossiers, #domaines) .carte-cadre {
    --colonnes: 2.4em repeat(17, minmax(0, 1fr));
    font: 500 12px/1.15 var(--bmt-sans);
  }
  .bmt-results #domaines .carte-cadre { --colonnes: minmax(5.4em, 20%) repeat(17, minmax(0, 1fr)); }
  .carte-cadre table, .carte-cadre thead, .carte-cadre tbody { display: block; }
  .carte-cadre tr { display: grid; grid-template-columns: var(--colonnes); }
  #dossiers .carte-cadre tbody tr { grid-auto-flow: column; grid-template-rows: repeat(2, auto); }
  #dossiers .carte-cadre tbody th { grid-row: span 2; }
  .bmt-results .carte-cadre :is(th, td) {
    display: grid;
    align-content: center;
    justify-content: center;
    padding: 2px 1px;
    border-width: 0 1px 1px 0;
    font-size: 12px;
    line-height: 1.15;
  }
  .bmt-results .carte-cadre th:first-child { border-left-width: 1px; }
  .bmt-results .carte-cadre thead tr:first-child th { border-top-width: 1px; min-height: 24px; }
  .bmt-results .carte-cadre thead tr:first-child th:first-child { width: auto; text-align: center; }
  .bmt-results #dossiers .carte-cadre thead tr:first-child th:first-child { width: auto; }
  .bmt-results .carte-cadre thead th {
    padding: 2px 0;
    font-size: clamp(10px, 2.9vw, 12px);
  }
  .bmt-results #domaines .carte-cadre tbody th {
    justify-content: start;
    padding-left: 3px;
    font-size: 11.5px;
    text-align: start;
  }
  .bmt-results #domaines .carte-cadre tbody td { min-height: 28px; font-size: clamp(8.5px, 2.2vw, 12px); letter-spacing: -.03em; }
  .bmt-results #domaines .carte-cadre thead tr:first-child th:first-child { font-size: 11px; overflow-wrap: normal; }
  .bmt-results #dossiers .carte-cadre tbody td { font-size: clamp(9px, 2.5vw, 12px); letter-spacing: -.03em; }
  .bmt-results .carte-cadre .carte-libelle, #dossiers .carte-cadre thead tr:nth-child(2) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .carte-ordre, .carte-abrege, .carte-cle { display: inline; }
  .carte-notes div.carte-cle { display: block; }
  .carte-abrege::before { content: attr(data-nom); }
  /* Neuf colonnes : les noms abrégés se lisent de bas en haut pour tenir sans césure. */
  .bmt-results .carte-cadre thead tr:first-child th:not(:first-child) { align-content: end; padding: 4px 0; }
  .bmt-results .carte-cadre thead tr:first-child th:not(:first-child) .carte-abrege {
    display: inline-block;
    writing-mode: vertical-rl;
    -webkit-writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    font-size: 12px;
  }
  .bmt-results #dossiers .bmt-scale { flex-wrap: wrap; gap: 2px 6px; }
  .bmt-results #dossiers .bmt-scale i { width: 60px; }
}

@media screen and (min-width: 540px) and (max-height: 640px) {
  .bmt-results :is(#dossiers, #domaines) { padding: 5px 8px; }
  .bmt-results :is(#dossiers, #domaines) h3 { max-width: none; font-size: 20px; }
  .bmt-results :is(#dossiers, #domaines) .bmt-scale { margin: 2px 0; font-size: 12px; }
  .bmt-results :is(#dossiers, #domaines) .carte-cadre :is(th, td) {
    padding: 1px 2px;
    font-size: 12px;
    line-height: 1.05;
  }
  .bmt-results #dossiers .carte-cadre thead tr:first-child th:first-child { width: 8%; }
  .bmt-results #domaines .carte-cadre thead tr:first-child th:first-child { width: 16%; }
  .bmt-results #domaines .carte-cadre thead tr:first-child th:not(:first-child) { padding-inline: 0; font-size: clamp(7.5px, 1.1vw, 11px); letter-spacing: -.02em; }
  .bmt-results #dossiers .carte-cadre thead tr:first-child th:not(:first-child) { padding-inline: 0; font-size: 11px; overflow-wrap: normal; }
  .bmt-results #dossiers .carte-cadre thead tr:first-child th:not(:first-child) { font-size: clamp(8px, 1.2vw, 11px); }
  .bmt-results #dossiers .carte-cadre thead tr:nth-child(2) th { font-size: clamp(6.5px, .95vw, 9px); }
  .bmt-results #dossiers .carte-cadre td { padding-inline: 0; font-size: clamp(8.5px, 1.3vw, 12px); letter-spacing: -.03em; }
  .bmt-results .carte-cadre .carte-libelle {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .carte-abrege, .carte-cle { display: inline; }
  .carte-notes div.carte-cle { display: block; }
  .carte-abrege::before { content: attr(data-nom); }
  .bmt-results .carte-notes { margin-top: 2px; }
  .bmt-results .carte-notes summary { padding: 2px 0; font-size: 12px; }
}
@media screen and (min-width: 1140px) and (min-height: 641px) and (max-height: 800px) {
  .bmt-results #dossiers .carte-cadre thead tr:first-child th:first-child { width: 30%; }
  .bmt-results #dossiers .carte-cadre :is(th, td) { padding-block: 3px; }
}
/* Entre 700 et 1139 px, la disposition empilée garde la place d'afficher le titre des dossiers. */
@media screen and (min-width: 700px) and (max-width: 1139px) and (min-height: 641px) {
  .bmt-results #dossiers .carte-cadre { --colonnes: minmax(13em, 30%) repeat(17, minmax(0, 1fr)); }
  .bmt-results #dossiers .carte-cadre :is(thead, tbody) th:first-child { justify-content: start; padding-left: 7px; text-align: start; }
  .bmt-results #dossiers .carte-cadre th:first-child .carte-libelle {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
  }
  .bmt-results #dossiers .carte-cadre th:first-child .carte-abrege { display: none; }
  .bmt-results #dossiers .carte-cadre tbody td { font-size: 12px; }
}
@media screen and (max-width: 420px) and (max-height: 700px) {
  .bmt-results #dossiers .carte-cadre td { padding-block: 0; line-height: 1.02; }
  .bmt-results .carte-notes { margin-top: 4px; }
  .bmt-results .carte-notes summary { padding-block: 4px; }
  .bmt-results :is(#dossiers, #domaines) .bmt-scale { margin-block: 4px 6px; }
}
@media print {
  .carte-notes::details-content { content-visibility: visible; }
  .carte-notes > summary { display: none; }
}
