/* Les composants communs de l'application, à leur valeur D2 (étude de cohérence graphique du 28/10/2026, lots 2 et 3 ;
 * Henri : « je veux une app clean, homogène »). Chargée en dernier (scripts/modules.json).
 *
 * Deux dessins seulement pour une rangée de choix :
 *   - l'ONGLET SOULIGNÉ change de vue (Explorer, Projets, Dossiers, fenêtres foncières, Adresse | Parcelle cadastrale) :
 *     texte 13 px atténué, le choisi à l'encre, graisse 500, trait de 1,5 px ; rangée de 34 px sur un filet ;
 *   - le SEGMENT choisit une valeur (Liste | Tableau, Terrain | Maisons, thème) : piste « champ » de 30 px, 2 px de jeu,
 *     boutons de 26 px arrondis 6, le choisi en panneau (clair) ou voile (sombre).
 * Les onglets étaient dessinés par quatre générations de règles (instrument.css, style.css, onglets.css, d2-chercher.css),
 * jusqu'à la spécificité (0,9,1) : la règle commune porte un poids d'identifiant (:not(#…)) pour l'emporter une fois pour
 * toutes, sans « !important » ; les règles battues sont retirées au fil du désendettement (lot 5). */

/* ── onglet souligné ── */
html body :is(.segment-large, .ent-onglets, .ds-onglets, .segment-rech):not(#onglet-commun) {
  display: flex; align-items: stretch; gap: 2px; height: auto; min-width: 0; padding: 0; overflow-x: auto; scrollbar-width: none;
  border: 0; border-bottom: 1px solid var(--filet); border-radius: 0; background: none; box-shadow: none;
}
html body :is(.segment-large, .ent-onglets, .ds-onglets, .segment-rech):not(#onglet-commun) > button {
  position: relative; flex: none; height: var(--h-onglet); min-height: var(--h-onglet); margin: 0; padding: 0 9px; border: 0; border-radius: 0;
  background: none; box-shadow: none; color: var(--attenue); font-family: inherit; font-size: var(--t-13); font-weight: 400; line-height: 1; white-space: nowrap; cursor: pointer;
}
html body :is(.segment-large, .ent-onglets, .ds-onglets, .segment-rech):not(#onglet-commun) > button:hover { background: none; color: var(--encre); }
html body :is(.segment-large, .ent-onglets, .ds-onglets, .segment-rech):not(#onglet-commun) > button:is([aria-selected="true"], [aria-checked="true"], [aria-pressed="true"], [aria-current="page"], .actif) {
  background: none; box-shadow: none; color: var(--encre); font-weight: 500;
}
html body :is(.segment-large, .ent-onglets, .ds-onglets, .segment-rech):not(#onglet-commun) > button:is([aria-selected="true"], [aria-checked="true"], [aria-pressed="true"], [aria-current="page"], .actif)::after {
  content: ""; position: absolute; left: 9px; right: 9px; bottom: -1px; height: 1.5px; border-radius: 1px; background: var(--encre);
}
html body :is(.segment-large, .ent-onglets, .ds-onglets, .segment-rech):not(#onglet-commun) > button:focus-visible { outline: 2px solid var(--attenue); outline-offset: -2px; }
@media (pointer: coarse), (max-width: 899px) {
  html body :is(.segment-large, .ent-onglets, .ds-onglets, .segment-rech):not(#onglet-commun) > button { height: 44px; min-height: 44px; }
}

/* ── segment : un seul dessin pour .d2-seg (fiche, légende des ventes) et .coq-seg (menus de la coquille) ── */
html body :is(.d2-seg, .coq-seg):not(#segment-commun) { display: flex; gap: 2px; padding: 2px; border-radius: var(--r-bouton); background: var(--champ); box-shadow: none; }
html body :is(.d2-seg, .coq-seg):not(#segment-commun) > button {
  flex: 1; height: auto; min-height: 26px; padding: 0 8px; border: 0; border-radius: var(--r-pastille); background: none; box-shadow: none;
  color: var(--attenue); font-size: var(--t-12); font-weight: 400; white-space: nowrap; cursor: pointer;
}
html body :is(.d2-seg, .coq-seg):not(#segment-commun) > button:hover { color: var(--encre); }
html body :is(.d2-seg, .coq-seg):not(#segment-commun) > button:is([aria-pressed="true"], [aria-checked="true"]) { background: var(--panneau); color: var(--encre); font-weight: 500; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
:is([data-theme="sombre"], [data-theme="dark"]) body :is(.d2-seg, .coq-seg):not(#segment-commun) > button:is([aria-pressed="true"], [aria-checked="true"]) { background: rgba(255, 255, 255, .14); box-shadow: none; }
/* un choix sur deux lignes (Terrain / non bâti, légende des ventes) */
html body :is(.d2-seg, .coq-seg):not(#segment-commun) > button:has(small) { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: var(--h-onglet); padding: 3px 4px; line-height: 1.15; } /* deux lignes : la hauteur d’une rangée d’onglets */
@media (pointer: coarse), (max-width: 899px) {
  html body :is(.d2-seg, .coq-seg):not(#segment-commun) > button { min-height: 44px; }
}

/* ── champ : 30 px au bureau, arrondi 7, fond « champ », filet ; au doigt 44 px et 16 px de texte (sans quoi iOS
   agrandit la page au focus). Les champs des fenêtres (instrument.css, .pg-champ) et du Rechercher lisent déjà ces valeurs. ── */
@media (pointer: coarse), (max-width: 899px) {
  html body.page-app :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"]), select, textarea):not(#champ-commun) { font-size: 16px; }
}
