/* P3B — la couche de l'éditeur. Jetons de la charte, aucune couleur en clair, rien de
   distant. C'est ICI que la mise en page vit : ce fichier est chargé après `styles.css` et ses
   sélecteurs portent `#drawing-form`. Écrite ailleurs, une règle y est juste et SANS EFFET.

   MESURER LE CONTENEUR FLATTAIT LE RÉSULTAT : l'écran annonçait « terrain = 1303 px », vrai du
   CADRE, quand la pelouse faisait 492. Le zoom suit la plus petite dimension, donc ce qu'on
   prend au terrain en hauteur, il le perd en largeur. */
#drawing-dialog { width: min(1840px, 98vw); max-width: 98vw; padding: 0; overflow: hidden; }
#drawing-form { box-sizing: border-box; width: 100%; max-width: none; height: 94vh; max-height: 94vh; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; background: var(--surface-elevee); }
#drawing-form.is-expanded { height: 98vh; max-height: 98vh; }
#drawing-form .eyebrow { color: var(--section-session); }

/* --- La barre haute : sept éléments, pas vingt-sept ------------------------------------- */
#drawing-form > .editor-barre-haute { flex: none; display: flex; align-items: center; gap: 14px; margin: 0; padding: 0 0 8px; border-bottom: 1px solid var(--line); }
#drawing-form .editor-barre-gauche { display: flex; align-items: center; gap: 12px; min-width: 0; }
#drawing-form .editor-barre-droite { display: flex; align-items: center; gap: 6px; margin-left: auto; }
#drawing-form > .editor-barre-haute > .editor-vue { margin: 0 auto; }
#drawing-form .editor-titre { min-width: 0; }
#drawing-form .editor-titre .eyebrow { margin: 0; font-size: .56rem; }
#drawing-title { margin: 0; font-size: 1.04rem; letter-spacing: -.02em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* La flèche porte l'action principale : c'est le seul `button-primary` du dialogue, et deux
   gardes l'exigent. Elle ne dit donc pas « Retour » seulement — un coach qui clique une flèche
   sans savoir si son travail part avec lui ne cliquera pas. */
#drawing-form .editor-retour { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; white-space: nowrap; }
#drawing-form .editor-retour-court { display: none; }
#drawing-form .editor-retour svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* La barre d'outils ne porte plus que le menu compact. */
#drawing-form .editor-toolbar { flex: none; display: flex; justify-content: flex-end; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
#drawing-form .schema-terrain { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
#drawing-form .editor-field { min-width: 118px; gap: 2px; }
#drawing-form .editor-field > span { color: var(--muted); font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
#drawing-form .editor-field select { min-height: 38px; border-radius: 10px; font-weight: 700; color: var(--navy); }
#drawing-form .schema-cmd { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border-color: transparent; border-radius: 9px; background: transparent; }
#drawing-form .schema-cmd svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#drawing-form .schema-cmd:not(:disabled):hover { background: var(--surface); box-shadow: var(--ombre-1); }
#drawing-form .schema-cmd-supprimer:not(:disabled):hover { color: var(--red); background: var(--red-soft); }
#drawing-form button:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }
#drawing-form .editor-menu > summary { min-height: 36px; padding: 6px 12px; font-size: .8rem; }
#drawing-form .editor-menu .menu-secondaire-panneau { z-index: 90; max-height: 62vh; overflow: auto; }

/* ==========================================================================================
   LES TROIS COLONNES
   ========================================================================================== */
/* TROIS ZONES : éléments, terrain, propriétés. La troisième colonne prenait 272 px que le
   terrain ne récupérait jamais ; elle devient une SURCOUCHE. 840 × 560 → 1032 × 688. */
#drawing-form .editor-layout { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: stretch; gap: 10px; overflow: hidden; }
#drawing-form .editor-palette { grid-column: 1; min-height: 0; height: auto; max-height: none; overflow: auto; padding: 10px 8px; }
#drawing-form .editor-stage { position: relative; grid-column: 2; min-width: 0; min-height: 0; overflow: hidden; }

/* Les deux surcouches de droite partagent exactement la même place : ouvrir le placement
   remplace les propriétés au lieu de creuser une colonne de plus. */
#drawing-form .editor-properties,
#drawing-form .placement-colonne {
  /* LA ZONE DE GRILLE, pas la grille : un absolu enfant d'une grille se repère sur SA zone.
     `grid-row: 2` le posait dans une rangée implicite, à y = 873 — rendu, invisible. */
  grid-area: 1 / 1 / -1 / -1;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
  width: min(300px, 34%);
  max-height: calc(100% - 24px);
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--navy) 12%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--ombre-3);
}
#drawing-form .placement-colonne { width: min(340px, 40%); border-top: 3px solid var(--section-session); }
/* Le placement l'emporte quand il est ouvert : deux cartes au même endroit se chevaucheraient. */
/* LES ONGLETS RESTENT VISIBLES : masquer tout le panneau enfermait le coach dans le
   placement — la carte recouvrait ses propres onglets. Seul le CONTENU est masqué. */
#drawing-form .editor-layout:has(.placement-colonne:not([hidden])) .editor-properties {
  height: auto;
  max-height: none;
  padding-bottom: 9px;
}
#drawing-form .editor-layout:has(.placement-colonne:not([hidden])) .editor-properties > :not(.editor-onglets) { display: none; }
#drawing-form .editor-layout:has(.placement-colonne:not([hidden])) .placement-colonne { top: 66px; max-height: calc(100% - 78px); }

/* RIEN DE CHOISI : une petite carte, et le terrain garde toute la scène. */
#drawing-form .editor-properties.est-vide { width: 206px; padding: 9px 11px; }
#drawing-form .editor-properties.est-vide .editor-properties-body { gap: 0; }
#drawing-form .editor-properties.est-vide #drawing-objects { display: none; }

/* **LE TERRAIN NE BOUGE PAS.** J'avais recalé le cadre à gauche du panneau pour qu'il ne
   recouvre rien : le dessin changeait donc de taille à chaque sélection, et le zoom se
   recalculait sous les doigts. Jérôme l'a tranché — un éditeur dont la pelouse rétrécit quand
   on clique dessus se bat contre son utilisateur. Le panneau FLOTTE, point : la boîte du
   terrain est identique avant et après la sélection, et une garde la mesure aux deux
   instants. Ce qu'il recouvre se retrouve en le fermant. */
#drawing-form .editor-properties-body { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 8px; }
#drawing-form .editor-properties-body > .colour-picker { grid-column: 1 / -1; }
/* Tant que rien n'est choisi, la colonne le dit en une phrase. Un formulaire vide donnerait à
   l'éditeur l'air d'une fiche administrative, et c'est le reproche qui l'avait fait fermer. */
#drawing-form .editor-properties-vide { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }
#drawing-form .editor-properties .editor-barre-objet { position: static; display: block; margin: 0 0 10px; padding: 0; border: 0; background: none; box-shadow: none; }
#drawing-form .editor-properties .editor-barre-nom { display: block; margin-bottom: 6px; color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
#drawing-form .editor-properties .colour-swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-bottom: 8px; }
#drawing-form .editor-properties .editor-barre-gestes { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
#drawing-form .editor-object-list { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }

/* LA BIBLIOTHÈQUE, EN COLONNE. Une entrée par ligne : pictogramme, puis nom. L'œil descend
   une colonne ; il ne zigzague pas entre trois bandes horizontales. */
#drawing-form .editor-palette-grid { display: flex; flex-direction: column; gap: 2px; margin: 0; }
#drawing-form .schema-groupe { --famille: var(--section-team); display: block; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible; }
#drawing-form .schema-groupe[data-famille="Matériel"] { --famille: var(--orange); }
#drawing-form .schema-groupe[data-famille="Dessin"] { --famille: var(--teal); }
#drawing-form .schema-groupe + .schema-groupe { margin-top: 10px; }
#drawing-form .editor-palette-group { display: block; margin: 0 0 4px; padding: 0 0 4px; border: 0; border-bottom: 2px solid var(--famille); color: var(--famille); font-size: .6rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; writing-mode: horizontal-tb; transform: none; background: none; }
#drawing-form .schema-groupe > button { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 34px; padding: 4px 8px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--navy); font-size: .78rem; font-weight: 700; text-align: left; white-space: nowrap; cursor: grab; transition: transform var(--vitesse), background var(--vitesse), border-color var(--vitesse); }
#drawing-form .schema-groupe > button:hover { border-color: color-mix(in srgb, var(--famille) 45%, var(--line)); background: color-mix(in srgb, var(--famille) 9%, var(--surface)); transform: translateX(2px); }
#drawing-form .schema-groupe > button:active { transform: none; background: color-mix(in srgb, var(--famille) 18%, var(--surface)); }
#drawing-form .palette-icone { flex: none; width: 24px; height: 24px; overflow: visible; }

/* LE TERRAIN, HÉROS DE L'ÉCRAN. */
/* LE CADRE OCCUPE LA SCÈNE ENTIÈRE. Plus de colonne flex qui se partage la hauteur : tout ce
   qui n'est pas le terrain flotte par-dessus, dans la marge sombre qui ne servait à rien. */
#drawing-form .editor-stage > #drawing-canvas-wrap { position: absolute; inset: 0; max-height: none; display: flex; align-items: safe center; justify-content: safe center; border: 0; border-radius: 18px; background: radial-gradient(120% 90% at 50% 0%, var(--navy-soft), var(--navy)); box-shadow: inset 0 0 0 1px var(--navy-soft), var(--ombre-2); }
#drawing-form .editor-canvas { flex: none; border-radius: 6px; filter: drop-shadow(0 12px 22px rgb(0 0 0 / .35)); }

/* LE DOCK DU BAS. Camps, indication et comptes rendus vivaient SOUS le terrain et lui
   prenaient jusqu'à 124 px. Ils se posent sur le bord bas de la scène. */
#drawing-form .editor-stage > #drawing-slot-bar,
#drawing-form .editor-stage > #drawing-intention-bar { position: absolute; top: 10px; left: 12px; right: 12px; z-index: 15; margin: 0; }
/* UNE SEULE RANGÉE : repliée sur deux, elle recouvrait l'indication posée au-dessus. */
#drawing-form .editor-stage > #drawing-camps { position: absolute; left: 12px; bottom: 12px; z-index: 15; max-width: calc(100% - 350px); margin: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
#drawing-form .editor-stage > #drawing-camps .editor-camp { flex: none; }
/* Carte réduite : ancrée EN HAUT, le bandeau du bas prend toute la largeur. */
#drawing-form .editor-layout:has(.editor-properties.est-vide) .editor-stage > #drawing-camps,
#drawing-form .editor-layout:has(.editor-properties.est-vide) .editor-stage > .editor-hint { max-width: calc(100% - 24px); }
#drawing-form .editor-stage > .editor-hint { position: absolute; left: 12px; bottom: 52px; z-index: 15; max-width: calc(100% - 350px); margin: 0; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 92%, transparent); font-size: .72rem; }
#drawing-form .editor-stage > .placement-report { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 18; max-height: 46%; overflow: auto; margin: 0; }
#drawing-form .editor-stage > .editor-hint:empty { display: none; }
#drawing-form .editor-canvas:focus-visible { outline: 3px solid var(--accent-lime, var(--orange)); outline-offset: 4px; }
#drawing-canvas g[data-object] { cursor: grab; }
#drawing-canvas g[data-object][data-locked] { cursor: not-allowed; }
#drawing-canvas g[data-object]:hover { filter: drop-shadow(0 0 3px rgb(255 255 255 / .95)); }
#drawing-form .editor-hint { font-weight: 700; color: var(--navy); font-size: .76rem; }
#drawing-form .editor-camps .editor-camp { padding: 3px 9px; }
#drawing-form .menu-secondaire-panneau .schema-gestes { display: flex; width: 100%; flex-wrap: wrap; gap: 2px 10px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: .66rem; }
#drawing-form .schema-gestes kbd { padding: 1px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); color: var(--navy); font-family: inherit; font-size: .64rem; font-weight: 750; line-height: 1.4; }
/* Les comptes rendus ne poussent pas le terrain : ils défilent dans leur propre boîte. */
#drawing-form .editor-stage > .placement-report { max-height: 22vh; overflow: auto; }

/* Placement : chaque mode dit ce qu'il fait. */
#drawing-form .placement-modes { position: sticky; top: -14px; z-index: 2; background: var(--surface-soft); }
#drawing-form .placement-mode { display: grid; align-content: center; gap: 1px; min-height: 52px; }
#drawing-form .placement-mode-aide { color: var(--muted); font-size: .66rem; font-weight: 650; }
#drawing-form .placement-mode.is-active { border-color: var(--section-session); background: var(--section-session-soft); color: var(--section-session); box-shadow: var(--ombre-1); }
#drawing-form .placement-carte.est-choisie { border-color: var(--section-session); background: var(--section-session-soft); }
#drawing-form [data-placement-verrou][aria-pressed="true"] { border-color: var(--amber); background: var(--amber-soft); color: var(--amber); }

#drawing-form > .creation-mode-message:empty { display: none; }
#drawing-form button:focus-visible, #drawing-form select:focus-visible, #drawing-form summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

@media (max-width: 1400px) and (min-width: 1181px) {
  /* La colonne de droite n existe plus : elle flotte sur la scene. Cette regle en gardait
     une TROISIEME piste de 248 px et volait au terrain, a 1366, la largeur qu on venait
     de lui rendre -- mesure : pelouse inchangee a 840 px apres la refonte. */
  #drawing-form .editor-layout { grid-template-columns: 170px minmax(0, 1fr); }
  #drawing-form .schema-groupe > button { gap: 6px; min-height: 30px; padding: 3px 6px; font-size: .72rem; }
  #drawing-form .palette-icone { width: 20px; height: 20px; }
}
@media (max-width: 1180px) {
  /* TABLETTE. Le terrain reste le produit : la bibliothèque se resserre, les propriétés
   deviennent une feuille posée sur le BAS de la scène — à 820, 34 % d'une scène de 650 ne
   feraient que 221 px, trop étroit pour un formulaire. */
  #drawing-form { padding: 10px 12px; }
  #drawing-form .editor-retour-long { display: none; }
  #drawing-form .editor-retour-court { display: inline; }
  #drawing-form .editor-titre .eyebrow { display: none; }
  #drawing-form > .editor-barre-haute > .editor-vue { margin: 0; }
  #drawing-form .editor-barre-gauche { flex: 1 1 auto; min-width: 0; }
  #drawing-form .editor-titre { min-width: 120px; }
  #drawing-form .editor-barre-droite .schema-cmd-mot { display: none; }
  #drawing-form .editor-barre-droite .schema-cmd { gap: 0; padding: 0 8px; }
  #drawing-form .editor-camps { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
  #drawing-form .editor-camps .editor-camp { flex: none; }
  #drawing-form .placement-modes { position: static; }
  #drawing-form .editor-layout { grid-template-columns: 150px minmax(0, 1fr); }
  #drawing-form .editor-properties,
  #drawing-form .placement-colonne {
    top: auto; left: 12px; right: 12px; bottom: 12px;
    width: auto; max-height: 46%;
  }
  #drawing-form .editor-properties-body { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  /* La feuille est en bas : c est la hauteur du cadre qu elle prend, pas sa largeur. */
  #drawing-form .editor-properties.est-vide { width: auto; right: 12px; left: auto; bottom: 12px; }
  /* Le dock du bas laisse la place a la feuille : les deux se poseraient l un sur l autre. */
  #drawing-form .editor-stage > #drawing-camps { max-width: calc(100% - 24px); bottom: auto; top: 12px; }
  #drawing-form .editor-stage > .editor-hint { display: none; }
}
@media (max-width: 760px) {
  /* TELEPHONE. Aucune colonne permanente : la bibliotheque devient un dock horizontal pose
     sur le bas de la scene, et les proprietes une feuille par-dessus. Le terrain prend la
     largeur entiere, ce qu une colonne de 150 px lui interdisait. */
  #drawing-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  #drawing-form { height: 100dvh; max-height: 100dvh; gap: 6px; padding: 8px; }
  #drawing-title { font-size: .94rem; }
  #drawing-form > .editor-barre-haute { flex-wrap: wrap; gap: 6px; }
  #drawing-form .editor-retour { min-height: 40px; font-size: .78rem; }
  #drawing-form .editor-layout { grid-template-columns: minmax(0, 1fr); }
  #drawing-form .editor-stage { grid-column: 1; }
  #drawing-form .editor-palette {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 22;
    grid-column: 1; height: auto; max-height: 92px; padding: 6px 8px;
    border-radius: 14px 14px 0 0;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    box-shadow: var(--ombre-3);
  }
  #drawing-form .editor-palette > .eyebrow { display: none; }
  #drawing-form .editor-palette-grid { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  #drawing-form .schema-groupe { flex: none; display: flex; gap: 2px; }
  #drawing-form .schema-groupe + .schema-groupe { margin: 0 0 0 10px; }
  #drawing-form .editor-palette-group { align-self: center; margin: 0 4px 0 0; padding: 0 6px 0 0; border-bottom: 0; border-right: 2px solid var(--famille); writing-mode: vertical-rl; transform: rotate(180deg); }
  #drawing-form .schema-groupe > button { width: auto; }
  #drawing-form .editor-properties,
  #drawing-form .placement-colonne { bottom: 100px; max-height: 42%; }
  #drawing-form .editor-stage > #drawing-camps { top: 10px; bottom: auto; max-width: calc(100% - 24px); }
  #drawing-form .schema-terrain { grid-template-columns: 1fr 1fr; }
  #drawing-form .editor-field { min-width: 0; }
  #drawing-form .editor-field select { width: 100%; min-width: 0; }
  #drawing-form .editor-menu .menu-secondaire-panneau { position: fixed; inset: auto 8px 12px; width: auto; max-width: none; max-height: 60vh; }
}
@media (pointer: coarse) {
  #drawing-form .schema-groupe > button, #drawing-form .schema-cmd { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  #drawing-form .schema-groupe > button { transition: none; }
}

/* LES CONTROLES DE TAILLE : la selection, puis la famille entiere. */
#drawing-form .editor-taille { display: grid; gap: 4px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
#drawing-form .editor-taille-titre { color: var(--muted); font-size: .64rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
#drawing-form .editor-taille-ligne { display: grid; grid-template-columns: minmax(0, 1fr) 34px 34px; align-items: center; gap: 5px; font-size: .74rem; color: var(--navy); }
#drawing-form .editor-taille-ligne > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#drawing-form .editor-taille-ligne button { min-height: 30px; padding: 0; font-size: 1rem; font-weight: 800; line-height: 1; }
/* LES DEUX NUANCIERS : maillot et chasuble, cinq pastilles par rangee. */
#drawing-form .colour-picker-label { display: block; margin-bottom: 4px; color: var(--muted); font-size: .64rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
#drawing-form .editor-properties .colour-swatch { width: 100%; min-height: 26px; border-radius: 7px; }
#drawing-form .editor-properties .colour-swatch.is-active { outline: 2px solid var(--navy); outline-offset: 1px; }
/* LE PLACEMENT, EN ONGLET : il vivait a la 21e entree du menu << Options >>. */
#drawing-form .editor-onglets { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 9px; padding: 3px; border-radius: 10px; background: var(--surface-soft); }
#drawing-form .editor-onglet { min-height: 30px; border: 0; border-radius: 8px; background: none; color: var(--muted); font: inherit; font-size: .72rem; font-weight: 800; cursor: pointer; }
#drawing-form .editor-onglet[aria-selected="true"] { background: var(--surface); color: var(--navy); box-shadow: var(--ombre-1); }
/* La tete de la carte : le titre, et la croix qui la ferme. */
#drawing-form .editor-properties-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
#drawing-form .editor-properties-tete > .eyebrow { margin: 0; }
#drawing-form .editor-properties-tete .icon-close { flex: none; width: 26px; height: 26px; min-height: 0; line-height: 1; font-size: 1rem; }
#drawing-form .editor-properties.est-vide .editor-properties-tete .icon-close { display: none; }

/* --- Terrain et zones (Pack V2, 11/11/2026) : un panneau posé sur le terrain, à droite. ---- */
#drawing-form { position: relative; }
#drawing-form .zones-panneau { position: absolute; z-index: 30; top: 64px; right: 16px; width: min(420px, calc(100% - 32px)); max-height: calc(100% - 80px); overflow: auto; display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-elevee); box-shadow: 0 18px 40px rgb(16 38 63 / .22); }
#drawing-form .zones-panneau[hidden] { display: none; }
#drawing-form .zones-tete { display: flex; align-items: center; justify-content: space-between; }
#drawing-form .zones-tete h3 { margin: 0; font-size: 1rem; color: var(--navy); }
#drawing-form .zones-titre { margin: 4px 0 0; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
#drawing-form .zones-terrains { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 6px; }
#drawing-form .zones-terrains button { min-height: 40px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--navy); font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; }
#drawing-form .zones-terrains button.is-active { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); }
#drawing-form .zones-ligne { display: flex; flex-wrap: wrap; gap: 8px 12px; }
#drawing-form .zones-ligne label, #drawing-form .zones-systeme label, #drawing-form .zones-config { display: grid; gap: 3px; font-size: .78rem; font-weight: 700; color: var(--navy); }
#drawing-form .zones-unite { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--muted); }
#drawing-form .zones-unite input { width: 78px; }
#drawing-form .zones-cases { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: .86rem; font-weight: 650; color: var(--navy); }
#drawing-form .zones-cases label { display: flex; grid-template-columns: none; align-items: center; justify-content: flex-start; gap: 7px; text-align: left; }
#drawing-form .zones-cases input { flex: none; width: 18px; height: 18px; min-height: 0; margin: 0; }
#drawing-form .zones-systeme { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 10px; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
#drawing-form .zones-systeme legend { padding: 0 4px; font-size: .74rem; font-weight: 800; color: var(--muted); }
#drawing-form .zones-largeurs { display: grid; gap: 8px; }
#drawing-form .zones-apparence summary { cursor: pointer; font-size: .84rem; font-weight: 750; color: var(--navy); }
#drawing-form .zones-apparence .zones-ligne { margin-top: 8px; }
#drawing-form .zones-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
#drawing-form .zones-note { margin: 0; font-size: .78rem; color: var(--muted); }
@media (max-width: 640px) { #drawing-form .zones-panneau { top: auto; bottom: 8px; right: 8px; left: 8px; width: auto; max-height: 70vh; } #drawing-form .zones-cases { grid-template-columns: 1fr; } }

/* --- Demande de Jérôme (11/11/2026, 01 h 05) : plus rien POSÉ SUR le terrain sur ordinateur.
   Les propriétés passent en bande sous le terrain, sur toute sa largeur ; le placement des
   joueuses s'ouvre sur le côté. La place de la bande est réservée EN PERMANENCE : le terrain
   garde la même boîte qu'un objet soit choisi ou non (la règle « le terrain ne bouge pas à la
   sélection » tient). Seule l'ouverture du placement, geste explicite, lui reprend sa colonne. */
@media (min-width: 1181px) {
  #drawing-form .editor-stage { margin-bottom: 182px; }
  #drawing-form .editor-properties, #drawing-form .editor-properties.est-vide { top: auto; left: 200px; right: 0; bottom: 0; width: auto; height: 172px; max-height: 172px; display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(0, 260px); grid-template-rows: auto minmax(0, 1fr); gap: 4px 14px; padding: 10px 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--ombre-1); }
  #drawing-form .editor-properties > .editor-onglets { grid-column: 1; grid-row: 1 / -1; align-self: start; }
  #drawing-form .editor-properties > .editor-properties-tete { grid-column: 3; grid-row: 1; }
  #drawing-form .editor-properties > .editor-barre-objet { grid-column: 2; grid-row: 1; margin: 0; }
  #drawing-form .editor-properties > .editor-properties-body { grid-column: 2; grid-row: 2; min-height: 0; overflow: auto; }
  #drawing-form .editor-properties > #drawing-objects, #drawing-form .editor-properties.est-vide > #drawing-objects { display: block; grid-column: 3; grid-row: 2; min-height: 0; overflow: auto; margin: 0; padding: 0 0 0 12px; border-top: 0; border-left: 1px solid var(--line); }
  #drawing-form .editor-layout:has(.placement-colonne:not([hidden])) .editor-properties > .editor-properties-body { display: grid; }
  #drawing-form .editor-layout:has(.placement-colonne:not([hidden])) .editor-properties > .editor-properties-tete,
  #drawing-form .editor-layout:has(.placement-colonne:not([hidden])) .editor-properties > #drawing-objects { display: block; }
  #drawing-form .editor-layout:has(.placement-colonne:not([hidden])) .editor-properties { right: 350px; height: 172px; max-height: 172px; padding: 10px 14px; }
  #drawing-form .editor-properties .editor-barre-objet { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
  #drawing-form .editor-properties .editor-barre-nom { margin: 0; }
  #drawing-form .editor-properties .editor-barre-gestes { display: flex; gap: 5px; }
  #drawing-form .editor-properties .editor-barre-gestes .button { min-height: 32px; padding: 0 10px; font-size: .78rem; }
  #drawing-form .editor-properties .colour-swatches { grid-template-columns: repeat(10, 26px); margin: 0; }
  #drawing-form .editor-layout:has(.placement-colonne:not([hidden])) .editor-stage { margin-right: 350px; }
  #drawing-form .editor-layout:has(.placement-colonne:not([hidden])) .placement-colonne { top: 0; right: 0; bottom: 0; width: 340px; max-height: none; }
  #drawing-form .editor-stage > #drawing-camps, #drawing-form .editor-stage > .editor-hint { max-width: calc(100% - 24px); }
}

/* Jérôme, 11/11 : les propriétés tiennent sur deux lignes, sans défilement. */
@media (min-width: 1181px) {
  #drawing-form .editor-properties, #drawing-form .editor-properties.est-vide { grid-template-columns: 150px minmax(0, 1fr) minmax(0, 170px); }
  #drawing-form .editor-properties > .editor-properties-body.editor-properties-body { display: flex; flex-wrap: wrap; align-content: flex-start; align-items: flex-end; gap: 8px 12px; overflow: auto; }
  #drawing-form .editor-properties-body > .colour-picker { display: flex; align-items: center; gap: 6px; margin: 0; }
  #drawing-form .editor-properties-body .colour-picker-label { margin: 0; }
  #drawing-form .editor-properties-body .colour-swatches { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; margin: 0; }
  #drawing-form .editor-properties-body .colour-swatch { width: 20px; height: 20px; min-height: 0; padding: 0; border-radius: 6px; }
  #drawing-form .editor-properties-body .colour-other { display: inline-flex; margin: 0; }
  #drawing-form .editor-properties-body .colour-other > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  #drawing-form .editor-properties-body .colour-other input { width: 26px; height: 24px; min-height: 0; padding: 0; border-radius: 6px; }
  #drawing-form .editor-properties-body [data-colour-reset] { min-height: 28px; padding: 0 8px; font-size: .72rem; white-space: nowrap; }
  #drawing-form .editor-properties-body > .editor-taille { display: flex; align-items: center; gap: 6px; padding: 3px 8px; }
  #drawing-form .editor-properties-body .editor-taille-ligne { display: flex; gap: 3px; }
  #drawing-form .editor-properties-body .editor-taille-ligne > span { max-width: 96px; font-size: .72rem; }
  #drawing-form .editor-properties-body .editor-taille-ligne button { width: 26px; min-height: 26px; }
  #drawing-form .editor-properties-body > label { display: grid; gap: 1px; min-width: 0; margin: 0; }
  #drawing-form .editor-properties-body > label > span { color: var(--muted); font-size: .6rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
  #drawing-form .editor-properties-body > label > select,
  #drawing-form .editor-properties-body > label > input { min-height: 30px; height: 30px; padding: 2px 6px; font-size: .8rem; border-radius: 8px; }
  #drawing-form .editor-properties-body > label > select { width: 104px; }
  #drawing-form .editor-properties-body > label:has(> select) { order: 1; }
  #drawing-form .editor-properties-body > .editor-taille { order: 2; }
  #drawing-form .editor-properties-body > label:has(> input), #drawing-form .editor-properties-body > label:has(> textarea) { order: 3; }
  #drawing-form .editor-properties-body > :not(label):not(.colour-picker):not(.editor-taille) { order: 4; }
  #drawing-form .editor-properties-body > label > input[type="number"] { width: 58px; }
  #drawing-form .editor-properties-body > label > input[type="text"],
  #drawing-form .editor-properties-body > label > textarea { width: 130px; }
  #drawing-form .editor-properties-body > label:has(> input[type="checkbox"]) { display: flex; align-items: center; gap: 6px; }
  #drawing-form .editor-properties-body > :not(label):not(.colour-picker):not(.editor-taille) { flex: 1 1 100%; }
}

/* Jérôme, 11/11 : en 3D le terrain prend l'écran ; seul le choix du décor reste. */
#drawing-form .editor-ambiance-3d { display: none; align-items: center; gap: 6px; margin: 0; }
#drawing-form .editor-ambiance-3d > span { color: var(--muted); font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
#drawing-form .editor-ambiance-3d select { min-height: 34px; padding: 2px 8px; border-radius: 9px; font-weight: 700; color: var(--navy); }
#drawing-form.est-en-3d .editor-ambiance-3d { display: inline-flex; }
#drawing-form.est-en-3d > .editor-barre-haute > .editor-vue { margin: 0 0 0 auto; }
#drawing-form.est-en-3d .editor-palette,
#drawing-form.est-en-3d .editor-properties,
#drawing-form.est-en-3d .placement-colonne,
#drawing-form.est-en-3d .editor-toolbar,
#drawing-form.est-en-3d #drawing-zones-bouton,
#drawing-form.est-en-3d #drawing-undo,
#drawing-form.est-en-3d #drawing-redo,
#drawing-form.est-en-3d #drawing-camps,
#drawing-form.est-en-3d #drawing-hint { display: none !important; }
#drawing-form.est-en-3d .editor-layout { grid-template-columns: minmax(0, 1fr); }
#drawing-form.est-en-3d .editor-layout .editor-stage { grid-column: 1 / -1; margin: 0 !important; }
