/* Hiérarchie et alignement de la feuille de gauche et du menu du compte (Henri, 02/10/2026) */

/* ── Menu du compte : l'ESPACE ENTREPRISE ressort (carte pleine, encre), les outils sont des lignes
   à pictogramme, l'historique reste plat. Clair et sombre : la carte pleine prend l'encre du thème. ── */
html[data-theme] .page-app .compte-menu > button.cm-entreprise, html[data-theme] .page-app .compte-menu > .cm-ligne { display: grid; grid-template-columns: 22px 1fr; align-items: center; gap: 0 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: var(--r-moyen); font: inherit; text-align: left; cursor: pointer; }
html[data-theme] .page-app .compte-menu > button.cm-entreprise { margin: 2px 0 6px; background: var(--encre); color: var(--surface); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 6px 16px -8px rgba(0, 0, 0, 0.5); }
html[data-theme] .page-app .compte-menu > button.cm-entreprise:hover { background: var(--encre); filter: brightness(1.12); }
html[data-theme] .page-app .compte-menu > button.cm-entreprise small { color: inherit; opacity: 0.7; }
html[data-theme] .page-app .compte-menu > .cm-ligne { box-sizing: border-box; text-decoration: none; margin: 0 0 4px; background: var(--survol); box-shadow: inset 0 0 0 1px var(--filet-2); color: var(--encre); }
html[data-theme] .page-app .compte-menu > .cm-ligne:hover { background: var(--actif); }
.cm-entreprise svg, .cm-ligne svg { width: 20px; height: 20px; grid-row: 1; }
.cm-entreprise span, .cm-ligne span { display: grid; gap: 1px; min-width: 0; }
.cm-entreprise b, .cm-ligne b { font-size: var(--t-14); font-weight: 600; line-height: 1.25; }
.cm-entreprise small, .cm-ligne small { font-size: var(--t-12); line-height: 1.3; }
.cm-ligne small { color: var(--encre-3); }
/* l'historique : lignes plates, ni cadre ni fond, date à droite, bien distinctes des actions */
/* Le menu est une colonne bornée à l'écran : seul l'historique défile, la déconnexion reste en vue
   (Henri, 09/10/2026 : « l'historique couvre la déconnexion ») */
html[data-theme] .page-app .compte-menu { display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; }
.compte-menu > * { flex: none; }
.compte-menu .compte-historique { display: block; flex: 0 1 auto; min-height: 96px; max-height: 264px; overflow-y: auto; overscroll-behavior: contain; }
html[data-theme] .page-app .compte-menu .compte-historique button { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-width: 0; height: auto; min-height: 44px; padding: 6px 10px; border-radius: var(--r-pastille); background: none; box-shadow: none; color: var(--encre-2); font-size: var(--t-13); }
html[data-theme] .page-app .compte-menu .compte-historique button > span { display: grid; gap: 1px; min-width: 0; }
.compte-menu .compte-historique button > span > :is(b, small) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-theme] .page-app .compte-menu .compte-historique button b { color: var(--encre); font-weight: 500; font-variant-numeric: tabular-nums; }
html[data-theme] .page-app .compte-menu .compte-historique button small { flex: none; color: var(--encre-3); font-size: var(--t-12); }
.compte-menu .menu-titre { margin: 12px 10px 4px; }

/* ── En-tête d'une fiche : le titre, puis « replier » et « fermer » côte à côte, sans se chevaucher ── */
@media (min-width: 900px) {
  .feuille:has(.fiche-tete .fermer) .feuille-replier { right: 62px; top: 22px; }
  .feuille .fiche-tete { align-items: center; padding-right: 0; }
  .feuille .fiche-tete > div:first-child { padding-right: 84px; min-width: 0; }
  .feuille .fiche-tete .fermer { flex: none; display: grid; place-items: center; }
  .feuille .fiche-tete .fermer svg, .feuille-replier svg { width: 14px; height: 14px; display: block; position: static; }
}

/* ── Onglets d'Explorer : tous de la même largeur, sur une ligne (Classements, Transactions, Permis, Prédictions, Parcelle) ── */
.segment.segment-large { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
.segment.segment-large:has(button:nth-child(5)) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.segment.segment-large button { min-width: 0; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--t-12); }

/* ── Champ « Référence » de l'onglet Parcelle : menu de recherche sous le champ (src/recherche-visible.js) ── */
.rv-boite { position: relative; }
.rv-liste { top: calc(100% + 4px); left: 0; right: 0; max-height: 320px; overflow-y: auto; }
.rv-pt { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--encre); vertical-align: middle; }

/* ── Pied de la feuille d'accueil : une ligne de source, une ligne de liens ── */
.note.note-source { margin: 14px 0 2px; }
.note.note-liens { margin: 0 0 4px; }

/* ── Évolution par type (src/evolution-types.js) ── */
.evo-types { width: 100%; height: auto; display: block; margin: 6px 0 2px; overflow: visible; }
.evo-halo { fill: none; stroke: rgba(10, 11, 13, 0.45); stroke-width: 4.6; stroke-linecap: round; stroke-linejoin: round; }
.evo-ligne { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.evo-bout { stroke: #1B1F27; stroke-width: 1.2; }
.evo-grille { stroke: var(--filet); stroke-width: 1; }
.evo-tick { stroke: var(--encre-4); stroke-width: 1; }
.evo-base { stroke: var(--filet-2); stroke-width: 1; stroke-dasharray: 3 3; }
.evo-axe { fill: var(--encre-3); font-size: var(--t-11); }
.evo-etiq { font-size: var(--t-11); font-weight: 600; }
.evo-legende { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 0; }
.evo-legende li { display: grid; grid-template-columns: 10px 1fr auto; grid-template-rows: auto auto; gap: 0 8px; align-items: baseline; padding: 6px 0; box-shadow: 0 -1px 0 var(--filet); }
.evo-legende li:first-child { box-shadow: none; }
.evo-legende i { grid-row: 1 / 3; align-self: center; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(27, 31, 39, 0.9); }
.evo-legende span { font-size: var(--t-13); }
.evo-legende b { font-size: var(--t-13); font-weight: 600; text-align: right; }
.evo-legende small { grid-column: 2 / 4; color: var(--encre-3); font-size: var(--t-12); }
.evo-resume { margin: 10px 0 0; color: var(--encre-2); font-size: var(--t-13); line-height: 1.5; }

html[data-theme] .page-app .segment.segment-large button { padding: 0 1px; font-size: var(--t-12); letter-spacing: -0.01em; }

/* ── La fenêtre de consentement au téléphone : en bas de l'écran, comme une feuille ── */
@media (max-width: 899px) {
  .consentement { place-items: end center; padding: 8px 8px calc(env(safe-area-inset-bottom) + 8px); }
  .consentement .consentement-titre { padding-right: 0; margin-top: 4px; font-size: 1rem; }
  .consentement p { font-size: var(--t-13); line-height: 1.45; }
  .consentement-boite { padding: 18px 16px 14px; } .consentement-logo { width: 30px; height: 30px; margin-bottom: 10px; }
  .consentement-sans { top: 14px; right: 14px; }
}
