@font-face { font-family: 'DM Sans'; font-weight: 100 1000; font-display: swap; src: url('../fonts/dm-sans-latin-wght-normal.woff2') format('woff2'); }
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 200 800; font-display: swap; src: url('../fonts/bricolage-grotesque-latin-opsz-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Mono'; font-weight: 400; font-display: swap; src: url('../fonts/dm-mono-latin-400-normal.woff2') format('woff2'); }

/* Les six couleurs de la planche. La scène les relit depuis ces variables (palette.js). */
:root, :root[data-theme="clair"] {
  --papier: #f3eee2;
  --encre: #24221d;
  --sauge: #66805a;
  --ocre: #a87a2c;
  --brique: #a9563a;
  --ardoise: #4a7a8c;
  --trait: rgba(36, 34, 29, .2);
  --voile: rgba(36, 34, 29, .06);
  --sourdine: rgba(36, 34, 29, .72);
  color-scheme: light;
}
:root[data-theme="sombre"] {
  --papier: #1c1e1b;
  --encre: #eae5d7;
  --sauge: #8fa67f;
  --ocre: #d2a95c;
  --brique: #d98a6c;
  --ardoise: #7aa8b8;
  --trait: rgba(234, 229, 215, .22);
  --voile: rgba(234, 229, 215, .08);
  --sourdine: rgba(234, 229, 215, .74);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body, #app { height: 100%; margin: 0; }
body { background: var(--papier); color: var(--encre); font: 15px/1.45 'DM Sans', system-ui, sans-serif; }
h1, h2, h3 { font-family: 'Bricolage Grotesque', 'DM Sans', sans-serif; margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .42; }
:focus-visible { outline: 2px solid var(--brique); outline-offset: 2px; }

/* Écran de recherche */
.accueil { min-height: 100%; max-width: 640px; margin: 0 auto; padding: clamp(24px, 9vh, 140px) 16px 32px; display: flex; flex-direction: column; }
.marque { font-size: clamp(56px, 13vw, 92px); font-weight: 700; letter-spacing: -.035em; line-height: .95; }
.invite { font-size: 20px; margin: 18px 0 14px; }
.boite-recherche { position: relative; }
#recherche-adresse { width: 100%; font-size: 18px; padding: 15px 16px; background: transparent; border: 2px solid var(--encre); border-radius: 2px; }
.suggestions { position: absolute; z-index: 5; left: 0; right: 0; margin: 0; padding: 0; list-style: none; background: var(--papier); border: 2px solid var(--encre); border-top: 0; }
.suggestions li { padding: 11px 16px; cursor: pointer; border-top: 1px solid var(--trait); }
.suggestions li:hover, .suggestions li[aria-selected="true"] { background: var(--voile); }
.resultat { margin-top: 26px; }
.choix-parcelle { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.choix-parcelle > div:last-child { flex: 1 1 260px; min-width: 0; }
.apercu-parcelle { position: relative; flex: 0 1 280px; width: 280px; max-width: 100%; aspect-ratio: 1; background: var(--voile); border: 1px solid var(--trait); }
.apercu-parcelle img, .apercu-parcelle svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.apercu-parcelle polygon { fill: none; stroke: #fff; stroke-width: 2.5; paint-order: stroke; }
.fiche-parcelle { margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 14px 36px; }
.fiche-parcelle dt { font-size: 13px; color: var(--sourdine); }
.fiche-parcelle dd { margin: 0; font: 19px 'DM Mono', monospace; }
.bouton-principal { display: inline-block; background: var(--encre); color: var(--papier); border: 0; border-radius: 2px; padding: 14px 22px; font-size: 16px; font-weight: 600; text-decoration: none; }
.bouton-secondaire { background: transparent; border: 1px solid var(--encre); border-radius: 2px; padding: 8px 14px; }
.bouton-secondaire:hover:not(:disabled) { background: var(--voile); }
.message { margin: 14px 0; }
.message-erreur { margin: 0 0 14px; color: var(--brique); font-weight: 600; }
.chargement { color: var(--sourdine); padding: 16px; margin: 0; }
.reprises { margin-top: 44px; }
.erreur-page { padding: 40px 16px; text-align: center; }

/* Connexion */
.formulaire-compte { display: grid; gap: 4px; max-width: 420px; }
.formulaire-compte input { font-size: 16px; padding: 10px 11px; border-color: var(--encre); }
.formulaire-compte .bouton-principal, .formulaire-compte .bouton-secondaire { justify-self: start; margin-top: 12px; }
.formulaire-compte .message-erreur { margin: 10px 0 0; }
.lien-simple { align-self: flex-start; margin-top: 18px; padding: 4px 0; background: none; border: 0; text-decoration: underline; }

/* Mes terrains */
.page-accueil { max-width: 1080px; margin: 0 auto; padding: 14px 16px 48px; }
.entete-accueil { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 2px solid var(--encre); }
.entete-accueil .compte-courant { margin: 0 0 0 auto; overflow-wrap: anywhere; }
.titre-accueil { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 26px 0 18px; }
.titre-accueil h1 { font-size: 32px; letter-spacing: -.02em; }
.actions-accueil { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.actions-accueil .bouton-principal { padding: 9px 16px; font-size: 15px; }
.fichier-cache { position: absolute; width: 1px; height: 1px; opacity: 0; }
.grille-projets { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.ligne-projet { display: grid; gap: 2px; align-content: start; }
.actions-projet { display: flex; justify-content: flex-end; gap: 14px; }
.supprimer-projet { margin: 0; font-size: 13px; color: var(--sourdine); }
.carte-projet { display: grid; gap: 6px; padding: 8px; height: 100%; align-content: start; border: 1px solid var(--trait); border-radius: 2px; text-decoration: none; overflow-wrap: anywhere; }
.carte-projet:hover { border-color: var(--encre); background: var(--voile); }
.carte-projet img { display: block; width: 100%; height: auto; border: 1px solid var(--trait); }
.carte-projet .deduit { margin: 0; }
.bloc-compte { margin-top: 36px; padding-top: 12px; border-top: 1px solid var(--trait); }
.bloc-compte summary { cursor: pointer; }

/* Atelier */
.atelier { height: 100%; display: grid; grid-template: "entete" auto "plateau" minmax(0, 1fr) "frise" auto / minmax(0, 1fr); }
.plateau { grid-area: plateau; position: relative; min-height: 0; overflow: hidden; }
.entete-atelier { grid-area: entete; display: flex; align-items: center; gap: 12px; padding: 7px 12px; border-bottom: 2px solid var(--encre); flex-wrap: wrap; }
.marque-petite { font: 700 21px 'Bricolage Grotesque', sans-serif; letter-spacing: -.02em; }
a.marque-petite { text-decoration: none; }
.lien-terrains { font-size: 13px; white-space: nowrap; }
.nom-partage { flex: 1 1 140px; min-width: 100px; overflow-wrap: anywhere; }
.centre-partage { font: 12.5px 'DM Mono', monospace; color: var(--sourdine); }
.badge-lecture { font-size: 13px; padding: 3px 9px; border: 1px solid var(--encre); border-radius: 2px; white-space: nowrap; }
.nom-projet { flex: 1 1 90px; min-width: 80px; padding: 5px 7px; border: 1px solid transparent; background: transparent; border-radius: 2px; }
.nom-projet:hover { border-color: var(--trait); }
.groupe-boutons { display: flex; }
.groupe-boutons button { background: transparent; border: 1px solid var(--trait); padding: 5px 11px; margin-left: -1px; }
.groupe-boutons button:hover:not(:disabled):not([aria-pressed="true"]) { background: var(--voile); }
.groupe-boutons button[aria-pressed="true"] { background: var(--encre); color: var(--papier); border-color: var(--encre); }
.entete-atelier > button { background: transparent; border: 1px solid var(--trait); padding: 5px 11px; }
.temoin { font-size: 13px; color: var(--sourdine); min-width: 5em; }
.temoin-erreur { color: var(--brique); font-weight: 600; }

.outils { position: absolute; z-index: 3; left: 0; top: 0; bottom: 0; width: 130px; display: flex; flex-direction: column; gap: 1px; padding: 8px 6px; background: var(--papier); border-right: 1px solid var(--trait); overflow-y: auto; }
.outils .ranger-outils { margin-top: auto; color: var(--sourdine); font-size: 13px; }
.sortir-outils { position: absolute; z-index: 3; left: 8px; top: 8px; max-width: 45%; padding: 5px 11px; background: var(--papier); border: 1px solid var(--encre); border-radius: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.commandes-marche { position: absolute; z-index: 4; right: 14px; bottom: 14px; display: grid; gap: 8px; justify-items: center; }
.pave-marche { display: grid; grid-template: ". a ." "b c d" / 44px 44px 44px; gap: 3px; }
.pave-marche button { width: 44px; height: 44px; font-size: 15px; color: var(--encre); background: color-mix(in srgb, var(--papier) 86%, transparent); border: 1px solid var(--encre); border-radius: 2px; touch-action: none; }
.pave-marche button:nth-child(1) { grid-area: a; }
.pave-marche button:nth-child(2) { grid-area: b; }
.pave-marche button:nth-child(3) { grid-area: c; }
.pave-marche button:nth-child(4) { grid-area: d; }
.quitter-marche { background: var(--papier); }
.en-promenade .outils, .en-promenade .sortir-outils, .en-promenade .barre-onglets, .en-promenade .panneau, .en-promenade .infos-gauche, .en-promenade .mention-source { display: none !important; }
.en-promenade .toile-encre { cursor: grab; }
.bouton-film { width: 100%; margin-top: 8px; }
.consigne { position: absolute; z-index: 2; left: 50%; bottom: 58px; transform: translateX(-50%); width: max-content; max-width: min(62%, 560px); margin: 0; padding: 5px 12px; font-size: 13px; text-align: center; color: var(--papier); background: var(--encre); border-radius: 2px; pointer-events: none; }
.barre-onglets { position: absolute; z-index: 4; right: 8px; top: 8px; display: flex; gap: 6px; }
.barre-onglets .onglets button { background: var(--papier); }
.barre-onglets .onglets button[aria-pressed="true"] { background: var(--encre); }
.barre-onglets .onglets button:hover:not([aria-pressed="true"]) { background: var(--papier); box-shadow: inset 0 0 0 1px var(--encre); }
.avec-panneau .barre-onglets { top: 0; right: 0; width: 300px; padding: 8px 8px 6px 12px; background: var(--papier); justify-content: space-between; }
.ranger-panneau { padding: 2px 7px; font-size: 18px; line-height: 1; background: var(--papier); border: 1px solid var(--trait); }
.outils button { text-align: left; background: transparent; border: 0; border-radius: 2px; padding: 6px 8px; font-size: 14px; line-height: 1.2; }
.outils button:hover:not(:disabled):not([aria-pressed="true"]) { background: var(--voile); }
.outils button[aria-pressed="true"] { background: var(--encre); color: var(--papier); }
.outils hr { width: 100%; border: 0; border-top: 1px solid var(--trait); margin: 6px 0; }

.scene { position: absolute; inset: 0; overflow: hidden; background: var(--papier); display: flex; }
.volet { position: relative; flex: 1 1 0; min-width: 0; overflow: hidden; }
.volet-compare { border-left: 2px solid var(--encre); }
.etiquette-annee { display: none; position: absolute; z-index: 1; top: 8px; left: 8px; padding: 2px 9px; font: 700 18px 'Bricolage Grotesque', sans-serif; background: var(--encre); color: var(--papier); pointer-events: none; }
.en-comparaison .etiquette-annee { display: block; }
.toile-scene, .toile-encre { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.toile-encre { touch-action: none; cursor: grab; outline: none; }
.scene:not([data-outil="selection"]) .toile-encre { cursor: crosshair; }
.volet-compare .toile-encre, .toile-encre:active { cursor: grabbing; }
.infos-gauche { position: absolute; left: 10px; bottom: 8px; pointer-events: none; font: 12px 'DM Mono', monospace; background: color-mix(in srgb, var(--papier) 88%, transparent); padding: 5px 8px; }
.echelle { display: flex; align-items: flex-end; gap: 7px; }
.barre-echelle { display: block; height: 7px; border: 2px solid var(--encre); border-top: 0; }
.mesures-vue { display: flex; gap: 14px; margin-top: 3px; white-space: pre; }
.mention-source { position: absolute; right: 8px; bottom: 8px; pointer-events: none; font-size: 12px; background: color-mix(in srgb, var(--papier) 88%, transparent); padding: 3px 7px; }
.message-fond { position: absolute; z-index: 2; top: 10px; left: 50%; transform: translateX(-50%); margin: 0; padding: 5px 11px; font-size: 13px; background: var(--papier); border: 1px solid var(--trait); max-width: 92%; }

.panneau { position: absolute; z-index: 3; right: 0; top: 0; bottom: 0; width: 300px; background: var(--papier); border-left: 1px solid var(--trait); overflow: hidden auto; padding: 44px 12px 18px; display: flex; flex-direction: column; gap: 12px; }
.onglets { padding-left: 1px; }
.onglets button { flex: 0 1 auto; min-width: 0; padding: 5px 5px; font-size: 12.5px; white-space: nowrap; }
/* Les repères de la carte ne passent pas sous les volets. */
.avec-outils .volet:first-child .infos-gauche, .avec-outils .volet:first-child .etiquette-annee { left: 140px; }
.avec-panneau .scene:not(.en-comparaison) .mention-source, .avec-panneau .volet-compare .mention-source { right: 308px; }
.onglet h3 { font-size: 13px; font-weight: 600; margin: 14px 0 4px; }
.onglet ul { list-style: none; margin: 0; padding: 0; }
.titre-section { margin: 12px 0 2px; }
.onglet h3.titre-section { margin: 12px 0 2px; }
.titre-section button { width: 100%; padding: 3px 0; text-align: left; font: inherit; font-weight: 600; background: none; border: 0; }
.titre-section button:hover { background: var(--voile); }
.titre-section .compte { font-weight: 400; color: var(--sourdine); }
.fleche { display: inline-block; width: 1em; color: var(--sourdine); }
.ligne-choisie { scroll-margin-top: 48px; }
.ligne-choisie .fiche-element { padding: 2px 4px 14px 8px; border-bottom: 0; box-shadow: inset 3px 0 var(--brique); }
.ligne-groupe b { font: 12.5px 'DM Mono', monospace; color: var(--sourdine); }
.ligne-membre { padding-left: 18px; font-size: 14px; }
.reste-groupe { padding: 4px 4px 4px 18px; }
.recherche-element { margin-top: 0; }
.ligne-element { width: 100%; display: flex; justify-content: space-between; gap: 8px; text-align: left; background: transparent; border: 0; border-top: 1px solid var(--trait); padding: 5px 4px; }
.ligne-element:hover { background: var(--voile); }
.ligne-element.est-choisi { background: var(--voile); box-shadow: inset 3px 0 var(--brique); padding-left: 8px; }
.ligne-element.est-absent { color: var(--sourdine); font-style: italic; }
.mesure { font: 12.5px 'DM Mono', monospace; white-space: nowrap; }
.aide-vide { color: var(--sourdine); margin: 12px 0; }
.fiche-element { border-bottom: 2px solid var(--encre); padding-bottom: 12px; }
.fiche-element:empty { display: none; }
.champ { display: grid; gap: 3px; margin-top: 9px; }
.champ label, .champ-curseur label, .champ-case label { font-size: 13px; color: var(--sourdine); }
.champ input, .champ select, .champ textarea { width: 100%; padding: 6px 7px; background: transparent; border: 1px solid var(--trait); border-radius: 2px; }
.champ select option { background: var(--papier); }
.champ-curseur { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; margin-top: 9px; }
.champ-curseur output { font: 12.5px 'DM Mono', monospace; }
.champ-curseur input { grid-column: 1 / -1; width: 100%; accent-color: var(--encre); }
.champ-case { display: flex; gap: 7px; align-items: center; margin-top: 9px; }
.champ-case input { accent-color: var(--encre); }
.deduit { font-size: 13px; color: var(--sourdine); margin: 10px 0 4px; }
.alerte { font-size: 13px; margin: 8px 0; padding: 7px 9px; border-left: 3px solid var(--brique); background: var(--voile); }
.bloc-rangee { margin-top: 12px; border-top: 1px solid var(--trait); padding-top: 8px; }
.bloc-rangee summary { cursor: pointer; font-size: 13px; }
.titre-verif { margin: 14px 0 4px; font-size: 13px; }
.liste-verif { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ligne-verif { display: grid; gap: 2px; width: 100%; padding: 6px 8px; text-align: left; background: transparent; border: 1px solid var(--trait); border-radius: 3px; font-size: 13px; }
.ligne-verif:hover, .ligne-verif:focus-visible { background: var(--voile); }
.ligne-verif .deduit { margin: 0; }
.bloc-froid { margin-top: 14px; border-top: 1px solid var(--trait); }
.liste-versions ul, ul.liste-versions, .liste-reprise { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.liste-reprise { max-height: 44vh; overflow-y: auto; }
.ligne-version { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--trait); }
.ligne-version > span { display: grid; gap: 2px; }
.actions-fiche { display: flex; gap: 6px; margin-top: 12px; }
.actions-fiche button { flex: 1; background: transparent; border: 1px solid var(--trait); padding: 6px; border-radius: 2px; }
.actions-fiche button:hover { background: var(--voile); }
.chiffres-terrain dl, .volumes dl { margin: 0; }
.chiffres-terrain dl > div, .volumes dl > div { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--trait); padding: 4px 0; }
.chiffres-terrain dt, .volumes dt { font-size: 13px; color: var(--sourdine); }
.chiffres-terrain dd, .volumes dd { margin: 0; font: 13px 'DM Mono', monospace; }
.volumes { margin-top: 8px; }
.modes-pinceau { margin-top: 8px; padding-left: 1px; }
.modes-pinceau button { flex: 1 1 0; min-width: 0; padding: 5px 2px; font-size: 13px; }

/* Soleil */
.dates-soleil { margin-top: 8px; padding-left: 1px; }
.dates-soleil button { flex: 1 1 auto; min-width: 0; padding: 5px 2px; font-size: 13px; }
.barre-soleil { width: 100%; height: 8px; margin-top: 8px; accent-color: var(--encre); }
.legende-soleil { margin-top: 8px; }
.degrade-soleil { height: 10px; background: linear-gradient(to right, var(--ardoise), var(--sauge), var(--ocre)); }
.bornes-soleil { display: flex; justify-content: space-between; margin-top: 2px; font: 12.5px 'DM Mono', monospace; }

/* Quantités */
.calendrier-ligne { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; }
.case-mois { padding: 2px 0; text-align: center; font: 11px 'DM Mono', monospace; color: var(--sourdine); background: var(--voile); }
.mois-fleurs { color: #fff; background: var(--brique); }
.mois-fruits { color: #fff; background: var(--sauge); }
.legende-calendrier { margin: 8px 0 2px; }
.liste-objectifs li { display: grid; gap: 1px; padding: 6px 0; border-top: 1px solid var(--trait); font-size: 13px; }
.liste-objectifs .deduit { margin: 0; }
.objectif-atteint strong { color: var(--sauge); }
.onglet h3.titre-bilan { margin-top: 18px; padding-top: 10px; border-top: 2px solid var(--encre); }
.ligne-quantite { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--trait); padding: 5px 4px; }
.ligne-quantite:hover, .ligne-quantite:focus { background: var(--voile); box-shadow: inset 3px 0 var(--brique); outline: none; }
.bouton-export { width: 100%; margin-top: 14px; background: transparent; border: 1px solid var(--trait); padding: 6px; border-radius: 2px; }
.bouton-export:hover { background: var(--voile); }

/* Partager et exporter */
.dialogue { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; padding: 16px 18px 18px; color: var(--encre); background: var(--papier); border: 2px solid var(--encre); border-radius: 2px; }
.dialogue::backdrop { background: rgba(0, 0, 0, .45); }
.dialogue h2 { font-size: 21px; }
.dialogue h3 { font-size: 14px; font-weight: 600; margin: 18px 0 2px; }
.dialogue .deduit { margin: 4px 0 8px; }
.dialogue .titre-detail button { background: transparent; border: 1px solid var(--trait); border-radius: 2px; padding: 3px 9px; font-size: 13px; }
.bloc-lien input { width: 100%; padding: 7px 8px; font: 13px 'DM Mono', monospace; background: transparent; border: 1px solid var(--encre); border-radius: 2px; }
.actions-lien { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.actions-lien .deduit { margin: 0; }
.grille-exports { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }

/* Frise du temps */
.frise.est-rangee { grid-template-columns: auto minmax(0, 1fr); }
.frise.est-rangee .piste-frise, .frise.est-rangee .surfaces-frise, .frise.est-rangee .actions-frise > button:not(.ranger-frise) { display: none; }
.frise.est-rangee .actions-frise { justify-content: flex-end; }
.frise { grid-area: frise; position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 6px 12px; border-top: 2px solid var(--encre); }
.commandes-frise, .actions-frise { display: flex; align-items: center; gap: 6px; }
.commandes-frise button, .actions-frise button, .commandes-frise select { background: transparent; border: 1px solid var(--trait); border-radius: 2px; padding: 4px 9px; font-size: 13px; }
.commandes-frise button:not(.lecture):hover:not(:disabled), .actions-frise button:not([aria-pressed="true"]):hover { background: var(--voile); }
.commandes-frise .lecture { background: var(--encre); color: var(--papier); border-color: var(--encre); min-width: 68px; }
.commandes-frise select option { background: var(--papier); }
.actions-frise button[aria-pressed="true"] { background: var(--encre); color: var(--papier); border-color: var(--encre); }
.annee-frise { font: 700 20px 'Bricolage Grotesque', sans-serif; min-width: 3em; text-align: center; }
.surfaces-frise { font: 12px 'DM Mono', monospace; color: var(--sourdine); white-space: nowrap; }
.piste-frise { position: relative; height: 50px; margin: 0 16px; cursor: pointer; touch-action: none; }
.graduations { position: absolute; inset: auto 0 0; height: 18px; border-top: 1px solid var(--encre); }
.graduation { position: absolute; top: 0; width: 1px; height: 3px; background: var(--trait); }
.graduation.majeure { height: 6px; background: var(--encre); }
.graduation b { position: absolute; top: 5px; left: 0; transform: translateX(-50%); font: 400 11px 'DM Mono', monospace; }
.marques-frise { position: absolute; inset: 0 0 18px; }
.marque-jalon { position: absolute; width: 9px; height: 9px; margin-left: -4.5px; padding: 0; border: 1px solid var(--papier); border-radius: 50%; }
.marque-jalon:hover, .marque-jalon:focus-visible { transform: scale(1.6); z-index: 2; }
.jalon-recolte { background: var(--ocre); }
.jalon-haie { background: var(--sauge); }
.jalon-couronnes { background: var(--brique); }
.jalon-limite { background: var(--brique); border-radius: 0; }
.jalon-libre { background: var(--encre); border-radius: 0; transform: rotate(45deg); }
.tete-frise { position: absolute; top: 0; bottom: 14px; width: 18px; margin-left: -9px; cursor: ew-resize; z-index: 3; touch-action: none; }
.tete-frise::after { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--brique); }
.tete-frise::before { content: ""; position: absolute; left: 3px; bottom: -5px; width: 12px; height: 12px; background: var(--brique); transform: rotate(45deg); }
.tete-comparee::after, .tete-comparee::before { background: var(--ardoise); }
.detail-frise { position: absolute; z-index: 5; bottom: 100%; left: 50%; transform: translateX(-50%); width: min(520px, 92vw); max-height: 45vh; overflow-y: auto; padding: 10px 12px; background: var(--papier); border: 2px solid var(--encre); border-bottom: 0; }
.detail-frise ul { list-style: none; margin: 6px 0 0; padding: 0; font-size: 14px; }
.detail-frise li { padding: 5px 0; border-top: 1px solid var(--trait); }
.titre-detail { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.titre-detail button, .actions-jalon button, .lien { background: transparent; border: 1px solid var(--trait); border-radius: 2px; padding: 3px 9px; font-size: 13px; }
.lien { margin-top: 4px; display: block; }
.formulaire-jalon { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 0 10px; }
.champ-note, .actions-jalon { grid-column: 1 / -1; }
.actions-jalon { display: flex; gap: 6px; margin-top: 10px; }
.actions-jalon .lien-principal { background: var(--encre); color: var(--papier); border-color: var(--encre); }

/* Sélecteur de plantation */
.selecteur-plante { margin-top: 6px; }
.vignette { display: block; object-fit: contain; background: var(--voile); border-radius: 2px; }
.plante-choisie { display: flex; gap: 10px; align-items: flex-start; }
.plante-choisie > div { display: grid; gap: 2px; min-width: 0; }
.plante-choisie em { font-size: 13px; color: var(--sourdine); }
.etiquette-type { font-size: 12px; color: var(--sourdine); }
.changer-plante { width: 100%; margin-top: 8px; background: transparent; border: 1px solid var(--trait); padding: 6px; border-radius: 2px; }
.changer-plante:hover { background: var(--voile); }
.recherche-plante { width: 100%; margin-top: 8px; padding: 6px 7px; background: transparent; border: 1px solid var(--trait); border-radius: 2px; }
.grille-plantes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-top: 8px; max-height: 340px; overflow-y: auto; padding: 1px; }
.carte-plante { display: grid; gap: 3px; justify-items: center; align-content: start; background: transparent; border: 1px solid var(--trait); border-radius: 2px; padding: 4px 2px; font-size: 12px; line-height: 1.2; }
.carte-plante:hover { background: var(--voile); }
.carte-plante.est-choisie { border-color: var(--encre); box-shadow: inset 0 0 0 1px var(--encre); }
.carte-plante span { overflow-wrap: anywhere; }
.liste-gabarits { display: grid; gap: 6px; margin-top: 8px; }
.carte-gabarit { display: grid; gap: 2px; padding: 7px 9px; text-align: left; background: transparent; border: 1px solid var(--trait); border-radius: 2px; }
.carte-gabarit:hover { background: var(--voile); }
.carte-gabarit.est-choisie { border-color: var(--encre); box-shadow: inset 0 0 0 1px var(--encre); }
.carte-gabarit .deduit { margin: 2px 0 0; }

/* Page du référentiel */
.page-referentiel { max-width: 1040px; margin: 0 auto; padding: 18px 16px 48px; }
.page-referentiel > header { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 2px solid var(--encre); }
.barre-cle { margin: 10px 0 14px; }
.formulaire-cle { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.formulaire-cle .deduit { margin: 0; }
.formulaire-cle input { padding: 6px 7px; background: transparent; border: 1px solid var(--trait); border-radius: 2px; }
.formulaire-cle button { background: transparent; border: 1px solid var(--trait); padding: 6px 12px; border-radius: 2px; }
.formulaire-cle .message-erreur { margin: 0; }
.filtres-referentiel { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.filtres-referentiel input, .filtres-referentiel select { padding: 6px 7px; background: transparent; border: 1px solid var(--trait); border-radius: 2px; }
.filtres-referentiel select option { background: var(--papier); }
.table-referentiel { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-referentiel th { text-align: left; font-size: 13px; font-weight: 600; padding: 5px 8px; border-bottom: 1px solid var(--encre); }
.table-referentiel td { padding: 6px 8px; border-top: 1px solid var(--trait); vertical-align: top; }
.table-referentiel tbody tr[tabindex] { cursor: pointer; }
.table-referentiel tbody tr[tabindex]:hover { background: var(--voile); }
.table-referentiel tr.est-ouverte { background: var(--voile); font-weight: 600; }
.formulaire-fiche { padding: 6px 0 12px; cursor: default; }
.grille-champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 14px; margin-bottom: 14px; }
.grille-champs input[type="color"] { padding: 2px; height: 32px; }

@media (max-width: 760px) {
  .entete-atelier { gap: 6px; padding: 5px 8px; }
  .entete-atelier .marque-petite, .entete-atelier .temoin:not(.temoin-erreur), .bouton-theme, .seulement-large { display: none; }
  .nom-projet { flex: 1 1 100%; order: -1; padding: 2px 4px; }
  .lien-terrains { order: -2; }
  .entete-atelier { row-gap: 3px; }
  .entete-atelier button, .groupe-boutons button { padding: 4px 8px; font-size: 13px; }
  .outils { z-index: 5; width: 150px; box-shadow: 2px 0 8px rgba(0, 0, 0, .18); }
  .panneau { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 45%; padding-top: 12px; border-left: 0; border-top: 2px solid var(--encre); }
  .barre-onglets { left: 8px; right: 8px; top: auto; bottom: 8px; justify-content: center; }
  .avec-panneau .barre-onglets { top: auto; right: 8px; width: auto; padding: 0; background: none; justify-content: center; bottom: calc(45% + 6px); }
  .consigne { max-width: 92%; bottom: auto; top: 44px; }
  .en-promenade .consigne { top: 8px; }
  .mention-source { font-size: 11px; padding: 2px 5px; }
  .frise.est-rangee { grid-template-columns: auto auto; justify-content: space-between; }
  .frise.est-rangee .commandes-frise select { display: none; }
  .avec-outils .volet:first-child .infos-gauche, .avec-outils .volet:first-child .etiquette-annee { left: 10px; }
  .avec-panneau .scene:not(.en-comparaison) .mention-source, .avec-panneau .volet-compare .mention-source { right: 8px; }
  .infos-gauche { bottom: 46px; }
  .mention-source { bottom: 46px; }
  .frise { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .actions-frise { flex-wrap: wrap; }
}
