/* Refonte D2 : la fiche de la parcelle, à droite de la carte (380 px), copiée de la maquette D2-bureau validée par Henri.
 * Surtitre, titre 17/600, carte de situation au 1:25 000, chiffres clés 22/500, répartition PLU et PPRN repliable, relevé,
 * onglets collants Analyse · Règles · Ventes · Documents, actions en pied. Jetons : src/jetons.css (.jt).
 */
.d2-fiche { position: absolute; right: var(--marge); top: var(--marge); bottom: var(--marge); width: var(--fiche); z-index: 6; display: flex; flex-direction: column; overflow: hidden; transition: transform .3s cubic-bezier(.32, .72, 0, 1), opacity .2s; }
.d2-fiche.cache { transform: translateX(calc(var(--fiche) + 20px)); opacity: 0; pointer-events: none; }
.d2-fiche-corps { flex: 1; overflow-y: auto; padding: 14px 16px 18px; scrollbar-width: thin; }
.d2-surt { display: flex; align-items: center; gap: 7px; font-size: var(--t-11); font-weight: 500; color: var(--attenue); }
.d2-surt .d2-btn-ic { margin-left: auto; width: 26px; height: 26px; }
.d2-titre-page { display: grid; grid-template-columns: 1fr 112px; gap: 14px; align-items: start; margin-top: 6px; padding-bottom: 14px; border-bottom: 1px solid var(--filet); }
.d2-titre-page h1 { margin: 0; font-size: var(--t-17); font-weight: 600; line-height: 1.25; letter-spacing: -.01em; color: var(--encre); }
.d2-titre-page .lieu { font-size: var(--t-13); color: var(--texte); margin-top: 2px; }
.d2-titre-page .idu { font-size: var(--t-12); color: var(--attenue); margin-top: 1px; font-variant-numeric: tabular-nums; }
.d2-titre-page .loc { font-size: var(--t-12); color: var(--attenue); margin-top: 8px; line-height: 1.4; }
.d2-titre-page .loc:empty { display: none; }
.d2-titre-page .prop { display: grid; gap: 3px; margin-top: 8px; font-size: var(--t-12); line-height: 1.35; }
.d2-titre-page .prop:empty { display: none; }
.d2-titre-page .prop i { font-style: normal; color: var(--attenue); }
.d2-titre-page .prop span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.d2-titre-page .prop b { font-weight: 500; color: var(--texte); }
.d2-titre-page .prop small { font-size: var(--t-12); color: var(--attenue); }
.d2-titre-page .prop .d2-ab { position: static; transform: none; }
.d2-pastille { display: inline-flex; line-height: 1.3; align-items: center; gap: 6px; margin-top: 8px; font-size: var(--t-11); font-weight: 500; color: var(--texte); background: var(--champ); border-radius: 20px; padding: 2px 8px 2px 7px; }
.d2-pastille i { width: 5px; height: 5px; border-radius: 50%; background: var(--alerte); }
.d2-pastille.mesure i { background: var(--discret); }
.d2-situ { width: 112px; height: 112px; border-radius: var(--r-moyen); position: relative; overflow: hidden; background: #E9E9EB; cursor: pointer; }
.d2-situ .carte-situ { position: absolute; inset: 0; }
.d2-situ-l { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; font-size: var(--t-10); color: #3a3a3c; background: rgba(255, 255, 255, .86); padding: 1px 6px; }
.d2-cles { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--filet); }
.d2-cle { padding: 11px 0; min-width: 0; }
.d2-cle:nth-child(1) { padding-right: 14px; border-right: 1px solid var(--filet); }
.d2-cle:nth-child(2) { padding-left: 16px; }
.d2-cle.large { grid-column: 1 / -1; border-top: 1px solid var(--filet); padding: 9px 0; }
.d2-cle .l { font-size: var(--t-11); font-weight: 500; color: var(--attenue); display: flex; justify-content: space-between; gap: 8px; }
.d2-cle .v { font-size: var(--t-22); font-weight: 500; line-height: 1.2; margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -.01em; color: var(--encre); }
.d2-cle .v small { font-size: var(--t-12); font-weight: 400; color: var(--attenue); margin-left: 3px; letter-spacing: 0; }
.d2-cle .p { font-size: var(--t-12); color: var(--attenue); margin-top: 1px; }
.d2-cle .nd { color: var(--discret); }
.d2-barre-rep { display: flex; height: 6px; border-radius: var(--r-fin); overflow: hidden; margin: 8px 0 7px; gap: 1px; }
.d2-barre-rep i { display: block; height: 100%; }
.d2-barre-rep.pprn i, .d2 .ech.pprn { box-shadow: inset 0 0 0 1px var(--filet-fort); }
.d2-rep { display: grid; grid-template-columns: auto 1fr auto auto; column-gap: 8px; row-gap: 2px; align-items: center; font-size: var(--t-12); font-variant-numeric: tabular-nums; }
.d2-rep .n { color: var(--texte); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d2-rep .s { text-align: right; color: var(--texte); white-space: nowrap; }
.d2-rep .c { text-align: right; color: var(--attenue); min-width: 34px; }
.d2-rep-tete { width: 100%; text-align: left; cursor: pointer; }
.d2-rep-tete .resume { display: inline-flex; align-items: center; gap: 4px; font-weight: 400; color: var(--texte); font-variant-numeric: tabular-nums; min-width: 0; overflow: hidden; white-space: nowrap; }
.d2-rep-tete .chev { width: 12px; height: 12px; color: var(--attenue); transition: transform .2s; }
.d2-rep-bloc:not(.plie) .d2-rep-tete .chev { transform: rotate(180deg); }
.d2-rep-bloc.plie .d2-rep { display: none; }
.d2-rep-bloc:not(.plie) .resume { color: var(--attenue); }
.d2-mesure { display: flex; align-items: center; gap: 10px; font-size: var(--t-11); color: var(--attenue); padding: 8px 0 10px; border-bottom: 1px solid var(--filet); line-height: 1.35; }
.d2-mesure > span { flex: 1; }
.d2-releve { display: flex; border-bottom: 1px solid var(--filet); }
.d2-releve div { flex: 1; padding: 10px 0; min-width: 0; }
.d2-releve div + div { border-left: 1px solid var(--filet); padding-left: 12px; }
.d2-releve b { display: block; font-size: var(--t-13); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--encre); }
.d2-releve span { font-size: var(--t-12); color: var(--attenue); }
/* onglets de fiche, collants */
.d2-f-onglets { position: sticky; top: -14px; z-index: 2; display: flex; gap: 2px; margin: 0 -16px; padding: 10px 16px 0; border-bottom: 1px solid var(--filet); }
.d2-f-onglets.colle { background: var(--verre-plein); }
.d2-f-onglet { position: relative; height: 34px; padding: 0 9px !important; font-size: var(--t-13) !important; color: var(--attenue) !important; }
.d2-f-onglet:hover { color: var(--encre) !important; }
.d2-f-onglet[aria-selected="true"] { color: var(--encre) !important; font-weight: 500; }
.d2-f-onglet[aria-selected="true"]::after { content: ""; position: absolute; left: 9px; right: 9px; bottom: -1px; height: 1.5px; background: var(--encre); border-radius: 1px; }
.d2-f-vue { display: none; padding-top: 12px; } .d2-f-vue.vu { display: block; }
/* analyse */
.d2-statut { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.d2-statut .ic { width: 15px; height: 15px; display: grid; place-items: center; color: var(--attenue); }
.d2-statut .txt { font-size: var(--t-13); color: var(--texte); flex: 1; min-width: 0; }
.d2-statut button { color: var(--attenue) !important; display: inline-flex; align-items: center; gap: 4px; padding: 3px 5px !important; border-radius: var(--r-pastille); font-size: var(--t-12) !important; }
.d2-statut button:hover { color: var(--encre) !important; background: var(--survol) !important; }
.d2-statut button[hidden] { display: none; }
.d2-analyse.repliee [data-an-plier] svg { transform: rotate(-90deg); }
.d2 .chat { color: transparent !important; -webkit-text-fill-color: transparent; background-image: linear-gradient(90deg, transparent calc(50% - var(--spread, 40px)), var(--encre), transparent calc(50% + var(--spread, 40px))), linear-gradient(var(--discret), var(--discret)); background-size: 250% 100%, auto; background-repeat: no-repeat; -webkit-background-clip: text; background-clip: text; animation: d2-chat var(--d, 1.4s) linear infinite; }
@keyframes d2-chat { from { background-position: 100% center, 0 0; } to { background-position: 0% center, 0 0; } }
.d2-etapes { list-style: none; margin: 6px 0 0; padding: 0; overflow: hidden; transition: max-height .35s cubic-bezier(.32, .72, 0, 1), opacity .25s; max-height: 700px; }
.d2-analyse.repliee .d2-etapes { max-height: 0; opacity: 0; }
.d2-etape { position: relative; display: grid; grid-template-columns: 15px 1fr; column-gap: 10px; padding: 4px 0; margin: 0; }
.d2-etape::before { content: ""; position: absolute; left: 7px; top: 22px; bottom: -4px; width: 1px; background: var(--filet-fort); }
.d2-etape:last-child::before { display: none; }
.d2-etape .pt { width: 15px; height: 15px; display: grid; place-items: center; margin-top: 1px; color: var(--encre); }
.d2-etape .pt i { width: 5px; height: 5px; border-radius: 50%; background: var(--filet-fort); }
.d2-etape.active .pt i { background: var(--encre); }
.d2-etape .ttl { font-size: var(--t-13); color: var(--discret); line-height: 1.4; }
.d2-etape.active .ttl { color: var(--encre); }
.d2-etape.faite .ttl { color: var(--texte); }
.d2-etape.manque .ttl { color: var(--attenue); }
.d2-etape .val { color: var(--encre); font-weight: 500; font-variant-numeric: tabular-nums; }
.d2-srcs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.d2-src, .d2-cite { display: inline-flex; align-items: center; height: 17px; padding: 0 6px; border-radius: var(--r-fin); background: var(--champ); color: var(--attenue); font-size: var(--t-11); white-space: nowrap; }
.d2-cite { margin: 0 1px; vertical-align: 1px; cursor: help; }
.d2-cite:hover { background: var(--actif); color: var(--encre); }
.d2 .apparait { animation: d2-apparait 150ms ease both; }
@keyframes d2-apparait { from { opacity: 0; } to { opacity: 1; } }
.d2-synthese { margin: 10px 0 0; font-size: var(--t-13); line-height: var(--interligne-texte); color: var(--encre); }
.d2-synthese:empty { display: none; }
.d2-synthese .mot { animation: d2-apparait 150ms ease both; }
.d2-sources-l { margin-top: 10px; font-size: var(--t-12); color: var(--attenue); }
/* règles : le contenu du volet Règles de l'app, à la typographie de la maquette */
.d2-regles { font-size: var(--t-13); color: var(--texte); }
.d2-regles :is(h3, .feuille-section) { margin: 14px 0 6px !important; padding: 0 !important; font-size: var(--t-13) !important; font-weight: 600 !important; color: var(--encre) !important; letter-spacing: 0 !important; border: 0 !important; text-transform: none !important; }
.d2-regles > :first-child, .d2-regles .feuille-section:first-child { margin-top: 0 !important; }
.d2-regles .feuille-section-note { font-weight: 400; font-size: var(--t-12); color: var(--attenue); }
.d2-regles .regle { padding: 10px 0 12px !important; margin: 0 !important; border: 0 !important; border-top: 1px solid var(--filet) !important; background: none !important; border-radius: 0 !important; box-shadow: none !important; }
.d2-regles .regle-titre { display: flex; align-items: center; gap: 7px; margin: 0 0 4px !important; font-size: var(--t-13) !important; font-weight: 600 !important; color: var(--encre) !important; line-height: 1.4 !important; }
.d2-regles .regle-titre i { display: inline-block; width: 8px; height: 8px; border-radius: var(--r-fin); flex: none; }
.d2-regles :is(p:not(.regle-titre), .note, li, td, th, dd, dt, summary) { font-size: var(--t-12) !important; line-height: 1.5 !important; color: var(--texte) !important; }
.d2-regles .note { color: var(--attenue) !important; margin: 4px 0 !important; }
.d2-regles :is(strong, b) { font-weight: 500 !important; color: var(--encre) !important; }
.d2-regles a { color: var(--encre) !important; text-decoration: none; }
.d2-regles a:hover { text-decoration: underline; }
.d2-regles table { width: 100%; border-collapse: collapse; margin: 6px 0; font-variant-numeric: tabular-nums; }
.d2-regles :is(th, td) { padding: 4px 0 !important; border: 0 !important; border-bottom: 1px solid var(--filet) !important; text-align: left; background: none !important; }
.d2-regles th { font-size: var(--t-11) !important; font-weight: 500 !important; color: var(--attenue) !important; }
.d2-regles :is(.bande, .estim, .encart, details) { background: none !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important; padding: 0 !important; margin: 6px 0 !important; }
.d2-regles details summary { cursor: pointer; color: var(--encre) !important; }
.d2-regles button { color: var(--encre); font-size: var(--t-12); text-decoration: underline; text-underline-offset: 2px; }
.d2-regles .bande-titre { font-size: var(--t-11) !important; font-weight: 500 !important; color: var(--attenue) !important; margin: 0 !important; }
.d2-regles .bande-valeur { font-size: var(--t-13) !important; font-weight: 500 !important; color: var(--encre) !important; margin: 0 !important; }
.d2-regles .bande { display: grid !important; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.d2-regles .regle-titre .feuille-section-note { margin-left: auto; font-weight: 400; font-size: var(--t-12); color: var(--attenue); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* chiffres de base : la liste compacte de la maquette (libellé à gauche, valeur à droite) */
.d2-regles dl.chiffres-plu { display: grid !important; grid-template-columns: auto 1fr; gap: 5px 14px !important; margin: 9px 0 0 !important; padding: 0 !important; background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; overflow: visible; }
.d2-regles dl.chiffres-plu > div { display: contents; }
.d2-regles dl.chiffres-plu dt { color: var(--attenue) !important; font-size: var(--t-12) !important; font-weight: 400 !important; margin: 0; padding: 0; background: none; }
.d2-regles dl.chiffres-plu dd { margin: 0 !important; color: var(--texte) !important; font-size: var(--t-12) !important; font-weight: 400 !important; text-align: right; font-variant-numeric: tabular-nums; background: none; padding: 0; }
.d2-regles .chiffre-relu { color: var(--attenue); font-size: var(--t-11); }
.d2-regles .section-plu { margin: 14px 0 4px !important; padding: 0 !important; font-size: var(--t-11) !important; font-weight: 500 !important; color: var(--attenue) !important; letter-spacing: 0 !important; text-transform: none !important; }
.d2-regles details.texte-regle { border-bottom: 1px solid var(--filet) !important; margin: 0 !important; }
.d2-regles details.texte-regle > summary { list-style: none; display: flex; align-items: baseline; gap: 6px; min-height: 30px; padding: 6px 0 !important; font-size: var(--t-13) !important; font-weight: 400 !important; color: var(--texte) !important; }
.d2-regles details.texte-regle > summary::-webkit-details-marker { display: none; }
.d2-regles details.texte-regle > summary::after, .d2-regles details.texte-regle > summary::before { display: none !important; }
.d2-regles details.texte-regle > summary > span { flex: 1; min-width: 0; }
.d2-regles details.texte-regle[open] > summary { color: var(--encre) !important; }
.d2-regles .art-n { min-width: 20px; color: var(--attenue); font-weight: 400; }
.d2-regles .art-nr { color: var(--discret); font-size: var(--t-11); }
.d2-regles .texte-corps { padding: 0 0 10px; }
.d2-regles .texte-corps :is(p, li) { font-size: var(--t-12) !important; line-height: var(--interligne-texte) !important; color: var(--texte) !important; margin: 0 0 6px !important; }
.d2-regles h4 { margin: 10px 0 4px; font-size: var(--t-12); font-weight: 500; color: var(--encre); }
.d2-regles .plu-remarque { color: var(--attenue) !important; }
.d2-regles :is([class^="rsum-"], [class*=" rsum-"]) { background: none !important; border-color: var(--filet) !important; box-shadow: none !important; }
.d2-regles .rsum-puce { min-height: 26px; padding: 0 10px !important; border-radius: var(--r-bouton); background: var(--champ) !important; color: var(--attenue) !important; font-size: var(--t-12) !important; text-decoration: none !important; border: 0 !important; }
.d2-regles .rsum-puce[aria-selected="true"] { background: var(--actif) !important; color: var(--encre) !important; }
.d2-regles .rsum-phrase { display: block; color: var(--attenue); font-size: var(--t-11); }
/* le récapitulatif des zones (fiche-parcelle.js) et les règles comparées (resume-plu.js), sans encadré ni gras */
.d2-regles .plu-remarque { margin: 0 0 8px !important; padding: 0 !important; border: 0 !important; background: none !important; border-radius: 0 !important; color: var(--texte) !important; font-size: var(--t-12) !important; }
.d2-regles .plu-remarque strong { font-weight: 500 !important; }
.d2-regles .rsum-regle { grid-template-columns: minmax(96px, 34%) 1fr; padding: 6px 0; box-shadow: 0 -1px 0 var(--filet); }
.d2-regles .rsum-regle dt { color: var(--attenue) !important; font-size: var(--t-12) !important; }
.d2-regles .rsum-regle dd { color: var(--texte) !important; font-size: var(--t-12) !important; }
.d2-regles .rsum-regle dd b { font-weight: 500 !important; color: var(--encre) !important; }
.d2-regles :is(.rsum-nv, small) { font-style: normal; color: var(--discret) !important; font-size: var(--t-11) !important; }
/* ventes */
.d2-zr-tete { display: flex; align-items: center; gap: 7px; font-size: var(--t-13); font-weight: 500; color: var(--encre); }
.d2-zr-tete small { font-weight: 400; color: var(--attenue); font-size: var(--t-12); margin-left: auto; font-variant-numeric: tabular-nums; }
.d2-v-histo svg { display: block; width: 100%; height: 52px; }
.d2-v-histo .ax { display: flex; justify-content: space-between; font-size: var(--t-11); color: var(--attenue); margin-top: 2px; font-variant-numeric: tabular-nums; }
.d2 table.d2-ventes { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: var(--t-12); font-variant-numeric: tabular-nums; }
.d2 table.d2-ventes th { text-align: right; font-weight: 500; font-size: var(--t-11); color: var(--attenue); padding: 0 0 5px; border-bottom: 1px solid var(--filet); background: none; }
.d2 table.d2-ventes th:first-child, .d2 table.d2-ventes td:first-child { text-align: left; }
.d2 table.d2-ventes td { text-align: right; padding: 5px 0; border-bottom: 1px solid var(--filet); color: var(--texte); white-space: nowrap; background: none; }
.d2 table.d2-ventes tr:hover td { background: var(--survol); }
.d2 table.d2-ventes td.pm { color: var(--encre); font-weight: 500; }
/* documents */
.d2-docs { border: 1px dashed var(--filet-fort); border-radius: var(--r-moyen); padding: 14px; text-align: center; color: var(--attenue); font-size: var(--t-12); line-height: 1.5; }
.d2-docs b { display: block; color: var(--encre); font-weight: 500; font-size: var(--t-13); margin-bottom: 4px; }
/* actions */
.d2-fiche-pied { flex: none; display: flex; align-items: center; gap: 4px; padding: 10px 12px 12px; border-top: 1px solid var(--filet); }
.d2-fiche-pied .esp { flex: 1; }
/* situation agrandie */
.d2-situ-grand { position: absolute; z-index: 9; right: calc(var(--fiche) + 2 * var(--marge)); top: var(--marge); width: 420px; height: 340px; overflow: hidden; display: none; }
.d2-situ-grand.ouvert { display: block; }
.d2-situ-grand .carte-situ { position: absolute; inset: 0; }
.d2-situ-grand .tete { position: absolute; left: 10px; top: 10px; right: 10px; z-index: 2; display: flex; align-items: center; gap: 8px; }
.d2-situ-grand .tete span { padding: 3px 8px; border-radius: var(--r-pastille); background: rgba(255, 255, 255, .9); color: #1d1d1f; font-size: var(--t-12); font-weight: 500; }
.d2-situ-grand .tete .d2-btn-ic { margin-left: auto; background: rgba(255, 255, 255, .9); color: #1d1d1f; }
.d2-situ-grand .pied-s { position: absolute; left: 10px; bottom: 10px; z-index: 2; padding: 3px 8px; border-radius: var(--r-pastille); background: rgba(255, 255, 255, .9); color: #3a3a3c; font-size: var(--t-11); }
.d2-situ-grand .d2-etq { background: rgba(255, 255, 255, .9); color: #1d1d1f; }
.d2-fiche .maplibregl-ctrl-attrib, .d2-situ-grand .maplibregl-ctrl-attrib { display: none; }
@media (prefers-reduced-motion: reduce) {
  .d2-fiche, .d2-etapes { transition: none !important; }
  .d2 .chat { animation: none; color: var(--attenue) !important; -webkit-text-fill-color: currentColor; background: none; }
}

/* la seconde estimation (avec le bâti existant), sous le terrain nu : même dessin, un cran plus discret */
.d2-releve .d2-val-2 { display: block; margin-top: 6px; font-size: var(--t-13) !important; font-weight: 500; }
.d2-ens-liste .est small { display: block; color: var(--discret); font-size: var(--t-11); }
.d2 .d2-histo-parcelle { margin-bottom: 14px; } .d2 .d2-histo-parcelle h3 small { font-weight: 400; color: var(--attenue); } .d2 .d2-histo-autour { margin-top: 18px; }
