/* 2026-11-09 - v1.0.0 : alignement du formulaire Support et du menu. */
/* 2026-11-09 - v1.0.0 : formulaire Support. */
/* 2026-11-08 - v1.0.0 : position de l’œil désactivé. */
/* 2026-11-08 - v1.0.0 : espacement du manuel utilisateur. */
/* 2026-11-08 - v0.2.152 : attente lors du chargement des projets. */
/* 2026-11-08 - v0.2.144 : gris MayBulletin pour les champs de connexion désactivés. */
/* 2026-11-08 - v0.2.143 : texte d’aide à la connexion. */
/* 2026-11-08 - v0.2.142 : présentation de la page de connexion. */
/* 2026-11-08 - v0.2.140 : bouton de mesure à côté des outils du plan. */
/* 2026-11-07 - v0.2.138 : aide à droite du titre de configuration. */
/* 2026-11-07 - v0.2.134 : marge gauche des icônes du menu réduite. */
/* 2026-11-07 - v0.2.133 : largeur globale alignée sur MayBulletin. */
/* 2026-11-07 - v0.2.132 : hauteur des entrées du menu alignée sur MayBulletin. */
/* 2026-11-07 - v0.2.128 : alignement préservé avec la nouvelle taille de l’icône. */
/* 2026-11-07 - v0.2.127 : alignement des icônes et des libellés du menu. */
/* 2026-11-07 - v0.2.120 : signature compacte et plan agrandi dans l’aperçu. */
/* 2026-11-07 - v0.2.115 : commandes désactivées harmonisées et sans effet au survol. */
/* 2026-11-07 - v0.2.114 : blocs côte à côte et largeur minimale des segments. */
/* 2026-11-07 - v0.2.113 : largeur des réglages et du tableau des segments. */
/* 2026-11-07 - v0.2.110 : tirets simples dans les fichiers source. */
/* 2026-11-07 - v0.2.107 : trait discret sous le segment sélectionné. */
/* 2026-11-07 - v0.2.106 : repères de segments interactifs sur le plan. */
/* 2026-11-07 - v0.2.105 : retours à la ligne des avertissements du plan. */
/* 2026-11-07 - v0.2.103 : suppression du message provisoire. */
/* 2026-11-07 - v0.2.102 : séparation masquée en mode avancé. */
/* 2026-11-07 - v0.2.98 : visibilité de la commande du mode avancé. */
/* 2026-11-06 - v0.2.97 : commandes désactivées de la grille de piscine. */
/* 2026-11-06 - v0.2.96 : navigation et paramètres du mode avancé. */
/* 2026-11-06 - v0.2.91 : marges de création Margelle alignées sur Plage / terrasse. */
/* 2026-11-06 - v0.2.88 : affichage de la création de forme avancée. */
/* Journal des modifications
 * 2026-11-06 - v0.2.85 : commande du côté fixe de la case.
 * 2026-11-06 - v0.2.82 : réglages des margelles regroupés.
 * 2026-11-05 - v0.2.81 : compteurs compacts des margelles.
 * 2026-11-05 - v0.2.80 : libellés noirs et compteur du seuil vert à zéro.
 * 2026-11-05 - v0.2.79 : compteurs de terrasse compacts sur une ligne.
 * 2026-11-05 - v0.2.78 : flèche de rotation dans le bleu du titre.
 * 2026-11-05 - v0.2.77 : suppression du style du bouton Appliquer.
 * 2026-11-05 - v0.2.76 : flèche de rotation bleu foncé.
 * 2026-11-05 - v0.2.75 : icône de rotation agrandie.
 * 2026-11-05 - v0.2.73 : compteurs et réglages alignés sous les onglets.
 * 2026-11-05 - v0.2.72 : alignement des blocs de la terrasse.
 * 2026-11-05 - v0.2.71 : séparation avant la composition de la surface.
 * 2026-11-05 - v0.2.69 : manuel structuré comme MayBulletin.
 * 2026-11-05 - v0.2.67 : compteur de seuil rouge à l’impression.
 * 2026-11-05 - v0.2.65 : présentation du bloc de recherche des variantes.
 * 2026-11-05 - v0.2.64 : indicateur de seuil à la taille des commandes du plan.
 * 2026-11-05 - v0.2.63 : états visuels du seuil de découpe.
 * 2026-11-04 - v0.2.60 : tableaux de variantes et sélection multiple.
 * 2026-11-04 - v0.2.49 : plein écran dans Création de terrasse.
 * 2026-11-04 - v0.2.44 : états désactivés des commandes de création de terrasse.
 * 2026-11-04 - v0.2.34 : état sélectionné des onglets de terrasse toujours visible.
 * 2026-11-04 - v0.2.31 : onglets et contrôles de calage de la terrasse.
 * 2026-11-04 - v0.2.30 : styles MayBulletin et calepinage réunis dans leur ordre d’origine.
 */
/* Journal des modifications
 * 2026-11-02 - Copie autonome des styles MayBulletin pour la maquette Maycalepinage.
 * Reference : maybulletin/style.css, copie sans dependance vers les autres applications.
 */
/* Journal des modifications
 * 2026-06-12 - Recentrage du footer applicatif et alignement du rendu sur MayPlanning.
 * 2026-06-12 - Ajout du style du footer applicatif discret.
 */

:root {
  --layout-shell-width: min(900px, 96vw);
  --layout-shell-min-width: 0px;
  --blue: #005f9e;
  --blue-dark: #00497a;
  --bg: #f4f7f9;
  --card: #ffffff;
  --text: #333;
  --muted: #9aa6b2;
  --success: #27ae60;
  --success-dark: #1e874b;
  --warning: #f39c12;
  --danger: #e74c3c;
  --danger-hover: #a8322b;
  --warning-hover: #9a4608;
  --border: #e5e7eb;
  --border-soft: #d0d7de;
}

/* =========================================================
   BASE
   ========================================================= */

* { box-sizing: border-box; }

html, body { height: 100%; }

body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); }

/*a {
  color: var(--blue);
}*/

img { max-width: 100%; display: block; }

/* =========================================================
   TOPBAR
   ========================================================= */

.topbar {
  position: sticky; top: 0; z-index: 100; background: var(--blue);
  color: #fff; padding: .6rem 1rem; display: flex; align-items: center;
  gap: .8rem; box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
  width: var(--layout-shell-width);
  min-width: var(--layout-shell-min-width);
  margin-left: auto;
  margin-right: auto;
}

.topbar img {
  height: 40px; width: 40px; object-fit: contain; border-radius: 6px;
  background: transparent;
}

.topbar h1 { font-size: 1.1rem; font-weight: 600; margin: 0; color: #fff; }

.topbar .topbar-actions { margin-left: auto; display: flex; gap: .5rem; }

/* =========================================================
   CONTAINER
   ========================================================= */

.container {
  width: var(--layout-shell-width); min-width: var(--layout-shell-min-width); margin: 1rem auto; padding: 2rem; background: var(--card);
  border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}

.app-footer {
  width: fit-content;
  max-width: min(900px, 96vw);
  min-width: 0;
  margin: -.35rem auto 1.2rem;
  padding: 0 .4rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
  color: #8a96a3;
  font-size: 1rem;
  text-align: center;
}

.app-footer a {
  color: #6f7d8b;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.app-footer a:hover {
  color: var(--blue);
  border-bottom-color: rgba(0, 95, 158, .35);
}

/* version large pour pages backoffice */
.container-wide {
  --layout-shell-width: min(1400px, 96vw);
  --layout-shell-min-width: 1200px;
}

/* =========================================================
   TYPO / FORMULAIRES
   ========================================================= */

h2 { margin-top: 0; color: var(--blue); text-align: left; }

h3 { margin-top: 0; color: var(--blue); }

label { display: block; font-weight: 600; margin-top: .8rem; }

input, select, textarea {
  width: 100%; padding: .45rem .65rem; margin-top: .35rem; border: 1px solid var(--border-soft);
  border-radius: 10px; background: #fff; color: var(--text); font: inherit;
}

input:focus, select:focus, textarea:focus { outline: 2px solid rgba(0, 95, 158, .15); border-color: var(--blue); }

input[type="password"]::-ms-reveal, input[type="password"]::-ms-clear { display: none; }

.password-toggle-wrap { position: relative; display: block; }

.password-toggle-wrap > input { padding-right: 2.8rem; }

.password-toggle-btn {
  position: absolute; right: .45rem; top: 50%; transform: translateY(-50%);
  width: 2rem; height: 2rem; padding: 0; border: 0;
  border-radius: 999px; background: transparent; color: #64748b; cursor: pointer;
  font-size: 1rem; line-height: 0; transition: none; display: inline-flex;
  align-items: center; justify-content: center;
}

.password-toggle-btn:hover, .password-toggle-btn:focus { background: transparent; color: #64748b; }

.password-toggle-btn:active { transform: translateY(-50%); }

.password-toggle-icon {
  width: 1.35rem; height: 1.35rem; display: block; fill: none;
  stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  pointer-events: none;
}

.password-toggle-btn.is-password-visible .password-toggle-slash { display: none; }

textarea { min-height: 120px; resize: vertical; }

.readonly { background: #f3f4f6; color: #6b7280; }

.row, .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 1rem; }

/* =========================================================
   ACTIONS / BOUTONS
   ========================================================= */

.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .3rem; }

button, .btn {
  appearance: none; border: 0; cursor: pointer; padding: .8rem 1.1rem;
  border-radius: 10px; background: var(--blue); color: #fff; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 1rem; font-weight: 600; line-height: 1.2; transition: transform .04s ease, background .2s ease;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
button:hover, .btn:hover { background: var(--blue-dark); color: #fff; }

button:active, .btn:active { transform: translateY(1px); }

.btn-light { background: #e6edf3; color: #0b2842; }

.btn-light:hover { background: #d9e4ec; color: #0b2842; }

.btn-danger { background: var(--danger); }

.btn-danger:hover { background: var(--danger-hover); }

.btn-warning { background: var(--warning); }

.btn-warning:hover { background: var(--warning-hover); }

.btn-success { background: var(--success); }

.btn-success:hover { background: var(--success-dark); }

.btn-compact { padding: .35rem .75rem; }
.btn-table { height: 30px; }

/* =========================================================
   ALERTES
   ========================================================= */

.alert { padding: .8rem 1rem; border-radius: 10px; margin: .8rem 0; }

.alert.error { background: #ffe6e3; color: #7a1f11; border: 1px solid #ffc9c2; }

.alert.warning { background: #fff7e6; border: 1px solid #ffd9a6; color: #7a4e00; }

.alert.success { background: #eaffef; color: #1b6c3b; border: 1px solid #bfe7cb; }

/* =========================================================
   TABLEAUX
   ========================================================= */

.table-wrap { width: 100%; overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; margin-top: 1rem; background: #fff; }

.table th, .table td { border: 1px solid var(--border); padding: .4rem .8rem; text-align: left; vertical-align: middle; }

.table thead th { background: #f8fafc; font-weight: 700; }

.table tbody tr:hover { background: #fafcfe; }

.table td.center, .table th.center { text-align: center; }

.table td.nowrap, .table th.nowrap { white-space: nowrap; }

/* =========================================================
   MENU TOPBAR
   ========================================================= */

.topbar .topbar-menu { position: relative; margin: 0; padding: 0 1rem; }

.topbar .menu-toggle {
  background: #fff; color: var(--blue); border: none; padding: .5rem .75rem;
  border-radius: .5rem; cursor: pointer;
}

.topbar .menu-toggle:hover { background: #f3f4f6; }

.topbar .menu-toggle:focus { outline: 2px solid rgba(255, 255, 255, .6); outline-offset: 2px; }

.topbar .menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); background: var(--card);
  border: 1px solid #e5e7eb; border-radius: .75rem; padding: .6rem; min-width: 220px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, .15); z-index: 1000;
}

.topbar .menu-panel .menu-item {
  display: flex; align-items: center; gap: .55rem; padding: .55rem .75rem;
  margin: .25rem 0; border: 1px solid #e5e7eb; border-radius: .65rem; background: #fff;
  text-decoration: none; font-weight: 600; color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  transition: background-color .15s ease, transform .06s ease, box-shadow .15s ease, border-color .15s ease;
}

.topbar .menu-panel .menu-item:hover { background: #f7f8fa; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0, 0, 0, .06); border-color: #dfe3e8; }

.topbar .menu-panel .menu-item:active { transform: translateY(0); }

.topbar .menu-panel .menu-item .icon { font-size: 1.05em; line-height: 1; }

.topbar .menu-panel .menu-item.is-danger { border-color: rgba(231, 76, 60, .25); color: var(--danger); }

.topbar .menu-panel .menu-item.is-danger:hover { background: #fff7f6; border-color: rgba(231, 76, 60, .4); box-shadow: 0 4px 10px rgba(231, 76, 60, .08); }

.topbar .menu-panel .menu-item:focus { outline: 2px solid rgba(0, 95, 158, .25); outline-offset: 2px; }

/* =========================================================
   SIDEBAR / MENU GAUCHE MAYBULLETIN
   ========================================================= */

.page-layout { display: grid; grid-template-columns: 240px 1fr; gap: 1.25rem; align-items: start; }

.sidebar { background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: .8rem; }

.sidebar-title { margin: 0 0 .7rem 0; font-size: 1rem; color: var(--blue); font-weight: 700; }

.sidebar-nav { display: flex; flex-direction: column; gap: .45rem; }

.sidebar-nav a {
  display: block; padding: .7rem .8rem; border-radius: 10px; text-decoration: none;
  color: var(--text); font-weight: 600; border: 1px solid transparent;
}

.sidebar-nav a:hover { background: #eef5fa; border-color: #d6e5f0; text-decoration: none; }

.sidebar-nav a.active { background: var(--blue); color: #fff; }

.page-main { min-width: 0; }

/* =========================================================
   BLOCS / CARTES
   ========================================================= */

.bo-card, .panel {
  margin-top: .8rem; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: .9rem;
}

.bo-card-title, .panel-title {
  margin: 0 0 .6rem; font-weight: 700; font-size: 1.25rem; text-align: center;
  color: var(--blue);
}

.card-title-left {
  margin: 0 0 .8rem; font-weight: 700; font-size: 1.05rem; color: var(--blue);
  text-align: left;
}

/* =========================================================
   BADGES / ETATS
   ========================================================= */

.badge {
  display: inline-block; padding: .25rem .6rem; border-radius: .6rem; font-weight: 700;
  border: 1px solid transparent;
}

.badge.success { background: #eaffef; color: #1b6c3b; border-color: #bfe7cb; }

.badge.warning { background: #fff7e6; color: #7a4e00; border-color: #ffd9a6; }

.badge.error { background: #ffe6e3; color: #7a1f11; border-color: #ffc9c2; }

.badge.info { background: #e8f1f8; color: var(--blue); border-color: #c9dceb; }
.badge.xs { padding: .15rem .45rem; border-radius: .45rem; font-size: .78rem; line-height: 1.15; }

/* =========================================================
   ZONES SPECIFIQUES MAYBULLETIN
   ========================================================= */

.upload-box { border: 2px dashed #cfd8e3; border-radius: 12px; padding: 1rem; background: #fbfdff; }

.file-info {
  margin-top: .7rem; padding: .7rem .9rem; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; font-weight: 600;
}

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; }

.summary-box { background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: .9rem; }

.summary-box .k { display: block; color: #6b7280; font-size: .92rem; margin-bottom: .3rem; }

.summary-box .v { display: block; font-size: 1.2rem; font-weight: 700; color: var(--blue); }

.preview-box {
  min-height: 420px; background: #fff; border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden;
}

.preview-box iframe, .preview-box object, .preview-box embed { width: 100%; min-height: 420px; border: 0; }

/* =========================================================
   DIALOG / MODALES
   ========================================================= */

.dlg-backdrop, .modal-backdrop, .hist-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .25); z-index: 9999; }

.dlg, .hist-dialog {
  max-width: min(680px, 92vw); margin: 6vh auto; background: #fff; border: 1px solid #e5e7eb;
  border-radius: 14px; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); display: flex; flex-direction: column;
  overflow: hidden; position: relative; z-index: 10000;
}

/* ===== Modales MayPlanning / MayBulletin ===== */

.modal { position: fixed; inset: 0; display: none; z-index: 1000; }

.modal:target { display: block; }

/* Overlay */
.modal__overlay {
  position: absolute; inset: 0; background: rgba(17, 24, 39, 0.35); backdrop-filter: blur(2px) saturate(108%);
  -webkit-backdrop-filter: blur(2px) saturate(108%); z-index: 1;
}

/* Boîte centrée */
.modal__dialog {
  position: relative; margin: 6vh auto; padding: 0 .6rem; max-width: min(1050px, 96vw); min-width: 800px; 
  z-index: 2;
}

/* Panneau */
.modal__panel {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; box-shadow: 0 15px 40px rgba(0, 0, 0, .18);
  overflow: hidden;
}

.modal__header {
  display: flex; align-items: center; justify-content: space-between; background: #f8fafc;
  padding: 10px 14px;
}

.modal__title { margin: 0; font-weight: 700; font-size: 1.05rem; color: #0b5ed7; }

.cal-popover-close {
  border: 0; background: transparent; color: var(--muted, #9aa6b2); font-size: 20px;
  font-weight: 700; line-height: 1; cursor: pointer; padding: 0 .25rem;
}
.cal-popover-close:hover { color: var(--blue, #005f9e); background: transparent; }

.modal__close {
  display: inline-block; text-decoration: none; border: 0; font-size: 1.4rem;
  line-height: 1; padding: 0 4px; cursor: pointer;
}

.modal__close:hover { color: var(--blue); }

.modal__body { padding: 12px 14px; max-height: 65vh; overflow: auto; -webkit-overflow-scrolling: touch; }

.modal__footer {
  display: flex; justify-content: flex-end; gap: 8px; background: #fafbfc;
  border-top: 1px solid #eef2f7; padding: 10px 14px;
}

.dlg-hd, .hist-hd {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .75rem 1rem; background: #f8fafc; border-bottom: 1px solid #eef2f7;
}

.dlg-hd, .hist-hd { font-weight: 600; color: #111827; }

.hist-hd h2 { margin: 0; }

.dlg-bd, .hist-bd { padding: 1rem; color: #111827; }

.hist-bd { max-height: 65vh; overflow: auto; }

.dlg-ft, .hist-ft {
  display: flex; gap: .5rem; justify-content: flex-end; padding: .75rem 1rem;
  background: #fafbfc; border-top: 1px solid #eef2f7;
}

.hist-close {
  background: transparent !important; color: #111827; display: inline-block; padding: 2px 6px;
  border: none; font-size: 22px; line-height: 1; cursor: pointer;
}

.hist-close:hover { color: var(--blue); }

.hist-btn {
  display: inline-flex; align-items: center; gap: .5rem; padding: 8px 12px;
  border-radius: 10px; border: 1px solid #d1d5db; cursor: pointer;
}

.hist-btn:hover { background: var(--blue-dark); color: #fff; }

.hist-list { display: grid; gap: 8px; margin: 0; padding-left: 18px; }

.hist-empty { color: var(--muted, #6b7280); }

/* =========================================================
   SWITCHS - Harmonisation MayBulletin sur MayPlanning
   - Taille : 44 x 24
   - Rond : 20 x 20
   - Différenciation claire enabled / disabled
   ========================================================= */

.switch {
  position: relative; display: inline-block; width: 44px; min-width: 44px;
  height: 24px; flex: 0 0 44px; vertical-align: middle; cursor: pointer;
  margin-top: 0rem;
}

.switch-input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch-slider {
  position: absolute; inset: 0; background: #e5e7eb; border: 1px solid #d0d7de;
  border-radius: 9999px; transition: background .2s, border-color .2s; cursor: pointer;
}

.switch-slider::before {
  content: ""; position: absolute; top: 1px; left: 2px;
  width: 20px; height: 20px; background: #fff; border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .2s, background .2s, box-shadow .2s;
}

/* ON + enabled */
.switch-input:checked + .switch-slider { background: var(--blue); border-color: var(--blue-dark); }

.switch-input:checked + .switch-slider::before { transform: translateX(20px); }

.switch-line {
  display: flex; align-items: center; gap: .6rem; margin-top: 1.1rem;
}

.switch-line .switch { margin: 0; }

.switch-line .label-text { margin: 0; line-height: 1; }

/* Disabled : attenuation coherente sur toute la ligne du switch */
.switch:has(.switch-input:disabled),
.switch:has(.switch-input:disabled) * { cursor: default; }

.switch-line:has(.switch-input:disabled) {
  opacity: .6;
  filter: grayscale(.4);
}

.label-text { color: #374151; font-weight: 500; }

/* =========================================================
   UTILITAIRES
   ========================================================= */

.text-center { text-align: center; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }


.muted { color: #64748b; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: .5rem !important; }
.mt-2 { margin-top: 1rem !important; }
.mt-3 { margin-top: 1.5rem !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: .5rem !important; }
.mb-2 { margin-bottom: 1rem !important; }
.mb-3 { margin-bottom: 1.5rem !important; }

/* Onglets generiques reutilisables */
.ui-tabs {
  display: flex; align-items: center; gap: .8rem; border-top: 3px solid #d1d5db;
  border-bottom: 1px solid #d1d5db; margin: .9rem 0 0; padding: .95rem 0 0; overflow: hidden;
}

.ui-tab {
  position: relative; display: inline-flex; align-items: center; gap: .45rem;
  padding: .75rem .95rem .8rem; border-radius: 10px 10px 0 0; color: #0b2842; font-weight: 700;
  text-decoration: none; white-space: nowrap;
}

.ui-tab:hover, .ui-tab.active { background: #eef6fc; color: var(--blue); }

.ui-tab.active::after {
  content: ""; position: absolute; left: 0; right: 0;
  bottom: -1px; height: 3px; background: var(--blue);
}

.ui-tab-panel { padding-top: .8rem; }

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {
  .page-layout { grid-template-columns: 1fr; }

  .summary-grid, .grid-4, .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  /*    .row,
      .grid-2,
      .grid-3,
      .grid-4,
      .summary-grid {
        grid-template-columns: 1fr;
      }

      .topbar .menu-toggle {
        width: 100%;
      }

    .actions {
        flex-direction: column;
        align-items: stretch;
      }

      .actions .btn,
      .actions button {
        width: 100%;
      }*/
}

/* Journal des modifications
 * 2026-11-02 - v0.1.1 : règles locales reprises à l’identique de MayBulletin.
 * Source : maybulletin/dashboard.php, bloc style après view_header.
 */

:root {
  --layout-shell-width: min(1400px, 96vw);
  --layout-shell-min-width: 1200px;
}

.page-head{
  display:grid;
  grid-template-columns: 1fr auto 1fr;
  align-items:center;
  gap:.75rem;
  margin-bottom:1rem;
}

.page-head-actions { justify-self:end; }

.page-title{
  margin:0;
  text-align:center;
  grid-column:2;
}

.dashboard-grid{
  display:grid;
  grid-template-columns:260px 1fr;
  gap:1rem;
  align-items:start;
}

.aside-card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:.6rem;
  box-shadow:0 6px 18px rgba(0,0,0,.06);
}

.aside-card .btn{
  justify-content:flex-start;
  text-align:left;
  gap:.5rem;
}

/* Même disposition que le style inline du menu MayBulletin. */
.domain-nav { display:flex; flex-direction:column; gap:.5rem; }
.domain-nav > .btn { height:calc(1.2em + 1.6rem); padding-block:0; padding-left:.675rem; }
.domain-nav .domain-icon { flex:0 0 41px; display:flex; align-items:center; justify-content:center; }

/* Journal des modifications
 * 2026-11-03 - v0.2.28 : grille de cases interactive et alertes du plan Terrasse.
 * 2026-11-03 - v0.2.23 : variantes et espace de travail partagés avec Plage / terrasse.
 * 2026-11-03 - v0.2.21 : badge et bouton de plein écran regroupés à droite du plan.
 * 2026-11-03 - v0.2.20 : plan agrandi et réglages à droite, bandeau supérieur conservé.
 * 2026-11-03 - v0.2.18 : détail harmonisé, légende à droite et plan imprimé agrandi.
 * 2026-11-03 - v0.2.17 : largeur habituelle des champs, limites sur leur contenu.
 * 2026-11-03 - v0.2.16 : champs compacts de trois chiffres et cinq caractères.
 * 2026-11-03 - v0.2.15 : découpe spécifique et zone date / signature à imprimer.
 * 2026-11-03 - v0.2.14 : liseré bleu uniforme de 2 pixels, peint au-dessus des pièces.
 * 2026-11-03 - v0.2.13 : couleur des pièces coupées et hachures croisées dans la légende.
 * 2026-11-03 - v0.2.12 : tableau Quantité permanent avec ligne Total en gras.
 * 2026-11-02 - v0.2.11 : espace réservé au zoom sous le dessin et cellules d’alerte orange.
 * 2026-11-02 - v0.2.9 : zoom et recentrage superposés en bas à droite, devant le SVG.
 * 2026-11-02 - v0.2.8 : dialogue Maybulletin et rendu des plans / impressions configurables.
 * 2026-11-02 - v0.2.7 : largeur réservée au pourcentage pour stabiliser le curseur à 100 %.
 * 2026-11-02 - v0.2.6 : pourcentage aligné à droite du curseur de répartition.
 * 2026-11-02 - v0.2.5 : bords coupés au premier plan, sans intercepter la sélection.
 * 2026-11-02 - v0.2.2 : petites flèches à droite du titre Détail d’une pièce.
 * 2026-11-02 - v0.2.1 : erreurs contextuelles et alignement des champs avec message.
 * 2026-11-02 - v0.2.0 : états, plan SVG sélectionnable, dialogue de variante.
 * 2026-11-02 - v0.1.9 : présentation du bouton Imprimer dans l’aperçu.
 * 2026-11-02 - v0.1.8 : bouton icône Actualiser à côté du titre du plan.
 * 2026-11-02 - v0.1.6 : alignement des champs de paramètres malgré les libellés sur deux lignes.
 * 2026-11-02 - v0.1.1 : retrait des surcharges de la présentation MayBulletin.
 * 2026-11-02 - v0.1.0 : disposition des domaines, plans et impression.
 * Les couleurs, formulaires et composants de base proviennent de MayBulletin.
 */
.brand { flex-shrink: 0; }
.domain-sidebar, .parameters, .plan-column { min-width: 0; }
.chantier-block { margin-top: 1.25rem; }
.chantier-block textarea { min-height: 85px; }
.sidebar-note { color: #64748b; font-size: .78rem; line-height: 1.6; margin: 1rem .2rem; }
.domain-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-hint { color: #64748b; font-size: .83rem; line-height: 1.5; margin: .25rem 0 .6rem; }
.editor-toolbar { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: .7rem; padding: .85rem 1rem; background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; }
.variant-picker { display: flex; gap: .65rem; align-items: center; min-width: 220px; }
.variant-picker label, .variant-picker select { margin: 0; }
.variant-picker select { width: 185px; font-size: .85rem; }
.editor-toolbar .actions { margin: 0; }
button:disabled { cursor: default; background: #e6edf3; color: #718294; transform: none; opacity: .8; }
#cancel-grid-changes:disabled, #advanced-cancel-grid:disabled { background: #e6edf3; color: #718294; }
#cell-largeur:disabled, #cell-hauteur:disabled, #advanced-cell-width:disabled, #advanced-cell-height:disabled { background: #e6edf3; color: #718294; cursor: default; }
.editor-toolbar button:disabled,
.editor-toolbar button:disabled:hover,
.editor-toolbar #preview-link[aria-disabled="true"],
.editor-toolbar #preview-link[aria-disabled="true"]:hover {
  background: #94b3c9; color: #fff; opacity: .8; cursor: default; transform: none; box-shadow: none;
}
.demo-notice { margin: .8rem 0 1rem; color: #64748b; font-size: .81rem; line-height: 1.5; }
.editor-grid { display: grid; grid-template-columns: 255px minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.parameters .panel:first-child { margin-top: 0; }
.step { display: inline-flex; width: 21px; height: 21px; justify-content: center; align-items: center; margin-right: .4rem; border-radius: 6px; background: #e6edf3; color: var(--blue); font-size: .75rem; vertical-align: middle; }
input, select, textarea { min-width: 0; }
#cut-index, #specific-cut-length { font-variant-numeric: tabular-nums; }
.compact-grid { gap: .65rem; }
.parameters .compact-grid { align-items: end; }
.compact-grid label { line-height: 1.4; }
.input-unit { position: relative; }
.input-unit:has(span) input { padding-right: 2.2rem; }
.input-unit > span { position: absolute; right: .6rem; top: 50%; transform: translateY(-36%); color: #64748b; font-size: .72rem; pointer-events: none; }
.input-unit input[type=number] { appearance: textfield; -moz-appearance: textfield; }
.input-unit input::-webkit-inner-spin-button, .input-unit input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=range] { accent-color: var(--blue); border: 0; padding: 0; cursor: pointer; background: transparent; }
.range-labels { display: flex; justify-content: space-between; font-size: .72rem; color: #64748b; }
.range-with-value { display: grid; grid-template-columns: minmax(0, 1fr) 2.75rem; gap: .2rem .55rem; align-items: center; }
.range-with-value input[type=range] { grid-column: 1; grid-row: 1; width: 100%; min-width: 0; margin: 0; }
.range-with-value output { grid-column: 2; grid-row: 1; min-width: 0; white-space: nowrap; text-align: right; font-size: .8rem; color: #64748b; font-variant-numeric: tabular-nums; }
.range-with-value .range-labels { grid-column: 1; grid-row: 2; }
.range-with-value .input-error { grid-column: 1 / -1; grid-row: 3; }
.field-note { font-size: .76rem; line-height: 1.5; color: #64748b; margin: .65rem 0 0; }
.reset-button { margin-top: .85rem; width: 100%; }
.summary-box .result-alert { color: #ba3b2c; }
.plan-panel { margin-top: .85rem; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.plan-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .9rem 1rem; border-bottom: 1px solid var(--border); }
.plan-header h3 { margin: 0; font-size: 1rem; }
.plan-header-actions { display: flex; align-items: center; gap: .55rem; flex-shrink: 0; margin-left: auto; }
.plan-title { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.plan-refresh { width: 32px; height: 32px; padding: 0; flex: 0 0 32px; }
.plan-refresh svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#rotate-plan { color: var(--blue); }
#rotate-plan svg { width: 22px; height: 22px; }
.plan-tools { grid-column: 1; grid-row: 2; align-self: end; justify-self: end; position: relative; z-index: 2; display: flex; align-items: center; margin: .75rem; padding: .35rem .45rem; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.96); box-shadow: 0 2px 8px rgba(0,0,0,.12); font-size: .76rem; }
.plan-tools.measure-toolbar { align-items:stretch; gap:.4rem; padding:0; border:0; background:none; box-shadow:none; }
.plan-zoom-group { display:flex; align-items:center; padding:.35rem .45rem; border:1px solid var(--border); border-radius:10px; background:rgba(255,255,255,.96); box-shadow:0 2px 8px rgba(0,0,0,.12); }
.measure-toggle { display:flex; align-items:center; justify-content:center; width:40px; min-height:38px; padding:0; border:1px solid var(--border); border-radius:10px; background:rgba(255,255,255,.96); color:#005f9e; box-shadow:0 2px 8px rgba(0,0,0,.12); }
.measure-toggle:hover { background:#eef6fc; color:#005f9e; }
.measure-toggle.active, .measure-toggle.active:hover { background:#005f9e; color:#fff; }
.plan-canvas .measure-toggle svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.measure-tools { grid-column:1; grid-row:2; align-self:end; justify-self:end; position:relative; z-index:2; margin:.75rem; }
#margelle-shape-editor #advanced-drawing { grid-column:1; grid-row:1; min-width:0; }
#margelle-shape-editor #advanced-contour-error { grid-column:1; grid-row:3; }
.plan-tools .actions { align-items: center; margin: 0; gap: .35rem; }
.plan-tools button { font-size: .75rem; }
.zoom-value { min-width: 45px; text-align: center; color: #64748b; }
.plan-canvas { display: grid; grid-template-columns: minmax(0, 1fr); isolation: isolate; background-color: #fbfdff; background-image: radial-gradient(#dce4ea .75px, transparent .75px); background-size: 16px 16px; padding: 1rem .25rem; }
.plan-canvas > #plan-drawing, .plan-canvas > svg, .plan-canvas > img { grid-column: 1; grid-row: 1; min-width: 0; overflow: hidden; }
.plan-canvas img { width: 100%; aspect-ratio: 720 / 470; object-fit: contain; max-height: 490px; }
.plan-legend { display: flex; flex-wrap: wrap; gap: .75rem 1rem; padding: .8rem 1rem; border-top: 1px solid var(--border); font-size: .73rem; color: #475569; }
.plan-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.plan-legend i { display: inline-block; width: 16px; height: 12px; border: 1px solid #abb6bf; background: #eee9df; flex-shrink: 0; }
.plan-legend .legend-cut { height: 0; border: 0; border-top: 3px solid #d44b3b; background: none; }
.plan-legend .legend-alert { border: 1px solid #d44b3b; background: repeating-linear-gradient(135deg,#ffe5df 0 3px,#d49b91 3px 4px,#ffe5df 4px 7px); }
.plan-legend .legend-selected { background: #e8f1f8; border: 2px solid var(--blue); }
.plan-bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.plan-bottom-grid .panel { margin-top: .85rem; }
.plan-bottom-grid .alert { font-size: .8rem; line-height: 1.6; margin-bottom: .65rem; padding: .65rem .8rem; }
.text-link, .manual-index a { color: var(--blue); font-size: .83rem; text-underline-offset: 3px; }
.piece-details { font-size: .8rem; margin: 0; }
.piece-details > div { padding: .55rem 0; border-bottom: 1px solid var(--border); }
.piece-details > div:last-child { border: 0; }
.piece-details dt { color: #64748b; margin-bottom: .2rem; }
.piece-details dd { margin: 0; font-weight: 600; }
.mini-label { font-size: .8rem; font-weight: 600; margin: 1rem 0 .55rem; }
.surface-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.surface-grid span { display: flex; height: 25px; align-items: center; justify-content: center; border: 1px solid #b9cbd9; border-radius: 3px; background: #e6edf3; color: var(--blue); font-size: .7rem; }
.surface-grid .inactive { border: 1px dashed #cbd5e1; background: #fff; }
.surface-grid .selected { background: var(--blue); color: #fff; }
.surface-composition { margin-top: .9rem; border-top: 1px solid var(--border); padding-top: .75rem; }
.surface-composition > .mini-label { margin-top: 0; }
.case-details { margin-top: .9rem; }
.case-details summary { cursor: pointer; color: var(--blue); font-size: .82rem; font-weight: 600; }
.configuration-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.configuration-grid .panel { margin-top: 0; }
.configuration-actions { margin-top: 1.25rem; }
.check-line { display: flex; gap: .6rem; align-items: center; font-weight: 400; }
.check-line input { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); }
.native-menu { position: relative; }
.native-menu summary {
  appearance: none; border: 0; cursor: pointer; padding: .8rem 1.1rem;
  border-radius: 10px; background: var(--blue); color: #fff; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 1rem; font-weight: 600; line-height: 1.2; transition: transform .04s ease, background .2s ease;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;

  list-style: none;
}
.native-menu summary::-webkit-details-marker { display: none; }
.native-menu:not([open]) > .menu-panel { display: none; }
.native-menu[open] > .menu-panel { display: block; }
.manual-index { display: flex; gap: 1.25rem; flex-wrap: wrap; padding: .7rem 0 1rem; }
.manual-section { scroll-margin-top: 80px; line-height: 1.65; }
.manual-section p { margin: .65rem 0 0; }
.manual-list { margin: .6rem 0; padding-left: 1.2rem; }
.print-actions { margin: 0; }
.print-actions button { gap: .4rem; }
.print-sheet { margin: 1rem 0; padding: 1.5rem; background: white; border: 1px solid var(--border); box-shadow: 0 3px 15px #00000008; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--blue); padding-bottom: .65rem; }
.sheet-header h2 { margin: 0; font-size: 1.15rem; }
.sheet-header p { font-size: .8rem; margin: .35rem 0 0; }
.sheet-client, .sheet-totals { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; font-size: .8rem; padding: .9rem 0; }
.sheet-parameters { font-size: .8rem; line-height: 1.7; padding: .5rem 0; }
.sheet-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 1rem; margin-bottom: .6rem; }
.sheet-summary-main { min-width: 0; }
.sheet-summary .sheet-totals { justify-content: flex-start; gap: .6rem 1.25rem; padding: .35rem 0 .5rem; }
.sheet-summary .sheet-legend { flex-direction: column; align-items: flex-start; gap: .4rem; border: 1px solid var(--border); border-radius: 7px; padding: .65rem .8rem; background: #f8fafc; }
.sheet-plan { width: 100%; height: 425px; object-fit: contain; }
.sheet-approval { display: grid; grid-template-columns: 1fr 2fr; gap: 1rem; margin: .4rem 0; padding: .4rem .8rem; border: 1px solid var(--border); border-radius: 6px; font-size: .8rem; break-inside: avoid; }
.sheet-approval > div { min-width: 0; }
.approval-date { display: block; margin-top: .35rem; }
.approval-signature { min-height: 10mm; }
.piece-cut-editor { border-top: 1px solid var(--border); padding-top: .65rem; margin-top: .65rem; font-size: .8rem; line-height: 1.45; }
.piece-cut-editor .check-line { margin-top: 0; }
.piece-cut-editor .check-line input { width: 14px; height: 14px; }
.piece-cut-editor .field > label { margin-top: .6rem; color: #64748b; font-weight: 400; }
.piece-cut-editor input[type=text] { padding-block: .35rem; font-weight: 600; }
.sheet-footer { font-size: .7rem; color: #64748b; border-top: 1px solid var(--border); padding-top: .7rem; }
.skip-link { position: absolute; top: -60px; left: 1rem; z-index: 200; background: white; color: var(--blue); padding: .8rem; }
.skip-link:focus { top: .5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
a:focus-visible, summary:focus-visible, button:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.topbar summary:focus-visible { outline-color: white; }
@media (max-width: 1250px) {
  .editor-grid { grid-template-columns: 225px minmax(0, 1fr); gap: .85rem; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .editor-grid { display: flex; flex-direction: column; }
  .parameters, .plan-column { width: 100%; }
  .plan-column { order: 2; }
  .plan-bottom-grid, .configuration-grid { grid-template-columns: 1fr; }
  .domain-heading { align-items: flex-start; }
  .domain-heading .btn { font-size: .75rem; }
  .editor-toolbar .actions { width: 100%; }
  .editor-toolbar .actions .btn, .editor-toolbar .actions button { flex: 1; font-size: .75rem; }
  .print-sheet { padding: .75rem; }
  .sheet-header { align-items: flex-start; }
  .sheet-plan { height: 275px; }
}
@page { size: A4 landscape; margin: 10mm; }
@media print {
  .dashboard-grid { display: block; }
  .page-head { display: none; }
  html, body { height: auto; background: white; font-size: 10pt; }
  .topbar, .domain-sidebar, .app-intro, .app-footer, .screen-only, .skip-link { display: none !important; }
  .container { width: 100%; min-width: 0; margin: 0; padding: 0; border: 0; box-shadow: none; }
  .print-sheet { margin: 0; padding: 0; border: 0; box-shadow: none; break-inside: avoid; }
  .sheet-plan { width: 100%; height: 105mm; }
  .sheet-header, .sheet-client, .sheet-totals, .sheet-parameters, .sheet-footer { font-size: 9pt; }
  .plan-legend { font-size: 8pt; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .plan-legend .legend-alert { border-style: dashed; }
}

/* Domaine Margelle fonctionnel */
.domain-editor .variant-picker { flex-wrap: wrap; max-width: 390px; }
.domain-editor .variant-picker .badge { font-size: .75rem; }
.domain-editor .editor-toolbar { align-items: center; }
/* En-tête, panneau, corps, pied et croix : classes Maybulletin de style.css. */
.variant-dialog { width: min(420px, 92vw); max-height: calc(100dvh - 32px); padding: 0; color: var(--text); font-size: .95rem; }
.variant-dialog::backdrop { background: rgba(17,24,39,.35); backdrop-filter: blur(2px) saturate(108%); -webkit-backdrop-filter: blur(2px) saturate(108%); }
.variant-dialog #variant-dialog-error:empty { display: none; }
.plan-canvas svg { width: 100%; height: 440px; display: block; touch-action: none; user-select: none; }
.plan-canvas [data-piece] { cursor: pointer; outline: none; }
.plan-canvas [data-segment] { cursor: pointer; outline: none; }
.plan-canvas .segment-selection-mark { display: none; }
.plan-canvas [data-segment][aria-pressed="true"] .segment-selection-mark { display: inline; }
.plan-canvas [data-segment]:focus-visible circle { stroke: #005f9e; stroke-width: 2; vector-effect: non-scaling-stroke; }
.plan-canvas [data-segment][aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
.plan-canvas .coping-outline { stroke: var(--blue); stroke-width: 2; }
.piece-link { background: transparent; color: var(--blue); padding: .2rem 0; font-size: .8rem; font-weight: 400; text-align: left; justify-content: flex-start; text-decoration: underline; }
.piece-link:hover { background: transparent; color: var(--blue-dark); }
.cut-alert-list { padding-left: 1.2rem; max-height: 190px; overflow-y: auto; font-size: .8rem; }
#side-quantities .table { font-size: .75rem; }
#side-quantities tfoot > tr > * { font-weight: 700; border-top: 2px solid var(--border); }
.dynamic-sheet-plan svg { width: 100%; height: 100%; display: block; }
[hidden] { display: none !important; }

/* Messages contextuels des paramètres et de la disposition */
.input-error { margin: .35rem 0 0; color: #b42318; font-size: .78rem; line-height: 1.4; }
.parameters [aria-invalid="true"], .configuration-grid [aria-invalid="true"] { border-color: #b42318; }
.plan-position-error { white-space: pre-line; grid-column: 1; grid-row: 3; margin: .25rem .75rem .75rem; font-size: .85rem; line-height: 1.5; }
@supports (grid-template-rows: subgrid) {
  .parameters .compact-grid { row-gap: 0; align-items: stretch; }
  .parameters .compact-grid > .field { display: grid; grid-template-rows: subgrid; grid-row: span 3; }
  .parameters .compact-grid > .field > label { grid-row: 1; }
  .parameters .compact-grid > .field > .input-unit { grid-row: 2; }
  .parameters .compact-grid > .field > .input-error { grid-row: 3; }
}

.piece-detail-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .8rem; }
.piece-detail-heading .card-title-left { margin: 0; }
.piece-navigation { display: flex; gap: .3rem; flex-shrink: 0; }
.piece-navigation button { width: 30px; height: 30px; padding: 0; }
.piece-navigation svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Préférences communes de présentation et d’impression */
.sheet-plan > svg { width: 100%; height: 100%; display: block; }
.print-sheet { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.print-sheet.is-grayscale { filter: grayscale(1); }

/* Même palette que le badge Maybulletin .badge.warning. */
.table td.quantity-alert { background: #fff7e6; color: #7a4e00; font-weight: 700; box-shadow: inset 0 0 0 1px #ffd9a6; }

/* Lecture du plan Margelle : coupe par couleur, alerte par hachures croisées. */
.plan-legend .legend-cut-piece { background: #fee2e2; }
.plan-legend .legend-short-piece { background: repeating-linear-gradient(45deg, transparent 0 3px, #c88c80 3px 4px, transparent 4px 7px), repeating-linear-gradient(-45deg, transparent 0 3px, #c88c80 3px 4px, transparent 4px 7px), #eee9df; }
.print-sheet.is-grayscale .coping-piece.is-cut:not(.is-alert), .print-sheet.is-grayscale #small-cut-piece rect { fill: #cbd5e1; }
.print-sheet.is-grayscale .legend-cut-piece { background: #cbd5e1; }

/* Plein écran de travail dans la page : bandeau supérieur conservé. */
.work-mode-toggle .work-icon-contract { display: none; }
.work-mode-toggle[aria-pressed="true"] .work-icon-expand { display: none; }
.work-mode-toggle[aria-pressed="true"] .work-icon-contract { display: inline; }
@media screen {
  body.work-mode { --layout-shell-width: calc(100% - 1.5rem); --layout-shell-min-width: 0px; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  body.work-mode .topbar { flex: 0 0 auto; }
  body.work-mode .app-container { flex: 1 1 0; min-height: 0; margin: .75rem auto; padding: .75rem; }
  body.work-mode .domain-sidebar, body.work-mode .page-head, body.work-mode .app-footer,
  body.work-mode .domain-editor > .editor-toolbar, body.work-mode #editor-notice,
  body.work-mode .parameters, body.work-mode .summary-grid, body.work-mode .plan-bottom-grid,
  body.work-mode .quantity-note { display: none; }
  body.work-mode .dashboard-grid { height: 100%; grid-template-columns: minmax(0, 1fr); }
  body.work-mode .page-main, body.work-mode .domain-editor { height: 100%; min-height: 0; }
  body.work-mode .domain-editor { display: flex; flex-direction: column; }
  body.work-mode #storage-error { flex: 0 0 auto; }
  body.work-mode .editor-grid { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) clamp(285px, 24vw, 340px); gap: .85rem; align-items: stretch; }
  body.work-mode .plan-column { min-height: 0; display: flex; order: 0; }
  body.work-mode .plan-panel { flex: 1 1 0; min-width: 0; min-height: 0; margin: 0; display: flex; flex-direction: column; }
  body.work-mode .plan-header, body.work-mode .plan-legend { flex: 0 0 auto; }
  body.work-mode .plan-canvas { flex: 1 1 0; min-height: 0; grid-template-rows: minmax(0, 1fr) auto auto; padding: .4rem .25rem; }
  body.work-mode #plan-drawing { min-height: 0; }
  body.work-mode .plan-canvas svg { height: 100%; }
  body.work-mode .plan-tools { margin: .4rem .6rem; }
  body.work-mode .work-controls { display: flex; flex-direction: column; gap: .85rem; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
  body.work-mode .work-controls > .panel { margin: 0; flex: 0 0 auto; }
  body.work-mode .work-controls [aria-invalid="true"] { border-color: #b42318; }
  body.work-mode .work-controls .step { display: none; }
}
@media screen and (max-width: 700px) {
  body.work-mode { height: auto; min-height: 100dvh; overflow: auto; }
  body.work-mode .app-container { flex: 0 0 auto; }
  body.work-mode .editor-grid { grid-template-columns: minmax(0, 1fr); }
  body.work-mode .plan-panel { flex-basis: auto; height: max(420px, 65dvh); }
  body.work-mode .work-controls { overflow: visible; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media screen and (max-width: 520px) {
  body.work-mode .work-controls { grid-template-columns: minmax(0, 1fr); }
  body.work-mode .plan-header { flex-wrap: wrap; padding: .65rem; }
  body.work-mode .plan-title { flex-wrap: wrap; }
}
@media screen and (min-width: 701px) and (max-height: 550px) {
  body.work-mode { height: auto; min-height: 100dvh; overflow: auto; }
  body.work-mode .app-container { flex: 0 0 auto; }
  body.work-mode .plan-panel { flex-basis: auto; height: 420px; }
  body.work-mode .work-controls { max-height: 420px; }
}

/* La pièce de la terrasse reste un exemple sélectionnable, sans moteur de pose. */
.terrace-example-piece { cursor: pointer; outline: none; }
.terrace-example-piece.is-selected rect, .terrace-example-piece:focus-visible rect { stroke: var(--blue); stroke-width: 2; vector-effect: non-scaling-stroke; }
.terrace-example-piece:focus-visible rect { stroke-dasharray: 3 2; }
.surface-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* Terrasse calculée : sélection des cases et avertissements sous le plan. */
.surface-grid { overflow: auto; max-height: 245px; }
.surface-grid .surface-cell { min-width: 0; height: 30px; padding: 0 .2rem; border: 1px solid #b9cbd9; border-radius: 3px; background: #e6edf3; color: var(--blue); font-size: .7rem; }
.surface-grid .surface-cell.inactive { border-style: dashed; background: #fff; color: #718294; }
.surface-grid .surface-cell.selected { outline: 2px solid var(--blue); outline-offset: -2px; font-weight: 700; }
.terrace-geometry-warning { grid-column: 1; grid-row: 4; margin: .25rem .75rem .75rem; font-size: .85rem; line-height: 1.5; }

/* Étapes de la terrasse : mêmes onglets que la facturation MayBulletin. */
#terrasse-editor[data-tab="creation"] #tile-settings,
#terrasse-editor[data-tab="creation"] #pose-settings,
#terrasse-editor[data-tab="creation"] .summary-grid,
#terrasse-editor[data-tab="creation"] .plan-bottom-grid,
#terrasse-editor[data-tab="creation"] .quantity-note,
#terrasse-editor[data-tab="creation"] .plan-legend,
#terrasse-editor[data-tab="creation"] #piece-inspector,
#terrasse-editor[data-tab="calepinage"] #surface-settings { display:none; }
#terrasse-editor[data-tab="creation"] .plan-panel { margin-top: 0; }
#terrasse-editor[data-tab="calepinage"] #tile-settings { margin-top: 0; }
.terrace-anchors { border:0; margin:.8rem 0 .35rem; padding:0; display:flex; gap:1rem; }
.terrace-anchors legend { font-weight:600; margin-bottom:.25rem; }
.terrace-anchors label { display:flex; align-items:center; gap:.35rem; margin:0; }
.terrace-anchors input { width:auto; margin:0; }
body.work-mode #terrasse-editor .ui-tabs { display:none; }

/* L’onglet courant utilise le même fond et soulignement dans les deux étapes. */
#terrasse-editor .ui-tab[aria-selected="true"] { background:#eef6fc; color:var(--blue); }
#terrasse-editor .ui-tab[aria-selected="true"]::after { content:""; position:absolute; left:0; right:0; bottom:0; height:3px; background:var(--blue); }

/* Gestion des variantes */
.variants-section { margin-top: 1rem; }
.variants-table input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); }
.variants-table th:first-child, .variants-table td:first-child { width: 42px; text-align: center; }
.variants-table td { overflow-wrap: anywhere; }
.variants-section > button { margin-top: .8rem; }

/* État des découpes du plan affiché. */
.threshold-ok { color: #1b6c3b; font-weight: 700; }
.threshold-warning { color: #a35300; font-weight: 700; }
.cut-indicator { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; font-size: 1.1rem; line-height: 1; font-weight: 700; }
.cut-indicator[hidden] { display: none; }
.cut-indicator.threshold-ok { background: #eaffef; border: 1px solid #bfe7cb; }
.cut-indicator.threshold-warning { background: #fff7e6; border: 1px solid #ffd9a6; }

/* Recherche des variantes, dans l’esprit des filtres MayBulletin. */
.variant-filter-query { display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; }
.variant-filter-query input { flex: 1; min-width: 0; }
.variant-filter-actions { margin-top: 10px; display: flex; justify-content: flex-end; }
.variants-section[hidden] { display: none; }

/* Nombre de pièces sous le seuil sur la fiche de pose. */
.sheet-totals .sheet-threshold-alert { color: #ba3b2c; font-weight: 700; }

/* Manuel : sommaire latéral et cartes MayBulletin. */
.manual-toc-card { margin-top: 0; }
.manual-toc ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .35rem; }
.manual-toc a { text-decoration: none; }
.manual-toc a:hover { text-decoration: underline; }
.manual-content .bo-card { margin-top: 1rem; scroll-margin-top: 80px; }
.manual-content .bo-card:first-child { margin-top: 0; }
.manual-content h4 { margin: 1rem 0 .1rem; text-decoration: underline; }
.manual-content p, .manual-content ul, .manual-content ol { margin-top: .1rem; margin-bottom: .5rem; }
.manual-content li { margin-bottom: .1rem; }

/* Compteurs compacts des deux domaines. */
:is(#terrasse-editor, #margelles-editor) .summary-box { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .35rem; min-width: 0; padding: .65rem .7rem; line-height: 1.25; }
:is(#terrasse-editor, #margelles-editor) .summary-box .k { display: inline; margin: 0; font-size: .76rem; color: #000; }
:is(#terrasse-editor, #margelles-editor) .summary-box .k::after { content: " :"; }
:is(#terrasse-editor, #margelles-editor) .summary-box .v { display: inline; font-size: .95rem; }

:is(#terrasse-editor, #margelles-editor) .summary-box .result-ok { color: #1b6c3b; }

/* Séparation des dimensions du bassin et du format dans le même bloc. */
.settings-subsection { border-top: 1px solid var(--border); padding-top: .85rem; margin-top: 1rem; }

#apply-dimensions:disabled, #cancel-dimensions:disabled { background: #e6edf3; color: #718294; }

.pose-controls { border: 0; margin: 0; padding: 0; min-width: 0; }
.pose-controls:disabled :is(input, select) { background: #e6edf3; color: #718294; cursor: default; }

.pose-controls:disabled button { background: #e6edf3; color: #718294; cursor: default; }

.cell-anchor-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .8rem; }
.cell-anchor-controls .field-note { margin: 0; }
#reverse-cell-anchor:disabled, #advanced-reverse:disabled { background: #e6edf3; color: #718294; }

#margelle-calepinage[hidden], #margelle-creation[hidden], #margelle-shape-editor[hidden] { display:none; }
#margelle-shape-editor #advanced-drawing svg { display:block; width:100%; height:auto; min-height:320px; max-height:70vh; }

#margelle-tab-creation[aria-disabled="true"] { opacity:.5; cursor:not-allowed; }
body.work-mode #margelles-editor .ui-tabs { display:none; }

#margelle-shape-editor > .editor-grid > .panel,
#margelle-shape-editor > .editor-grid > .plan-panel { margin-top: 0; }

#pool-dimensions[hidden], #enable-advanced-label[hidden], #margelle-plan-column[hidden] { display:none; }

#pool-dimensions[hidden] ~ .settings-subsection { border-top: 0; padding-top: 0; margin-top: 0; }

/* Margelles : libellés de réglage et de quantité lisibles sur une ligne. */
body:not(.work-mode) #margelle-calepinage.editor-grid { grid-template-columns: 270px minmax(0, 1fr); }
@media (min-width: 651px) {
  #margelle-calepinage .plan-bottom-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #margelle-calepinage .plan-bottom-grid > .panel { min-width: 0; }
}
#side-quantities .table :is(th, td) { padding-inline: .55rem; }
#side-quantities .table :is(th, td) { white-space: nowrap; }
#side-quantities .table :is(th, td):first-child { min-width: 82px; }

/* Connexion : mêmes dimensions que la page de connexion MayBulletin. */
body.login-page { --layout-shell-width:min(900px, 96vw); --layout-shell-min-width:0px; }
.login-help { max-width:600px; }
.login-form { max-width:600px; }
.login-form input:disabled { background:#f3f4f6; color:#6b7280; }
.login-form .actions button { margin-top:.8rem; }


/* Attente pendant la preparation des projets. */
.projects-loading[hidden] { display: none; }
.projects-loading { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.55); }
.projects-loading-card { display: flex; align-items: center; gap: .7rem; padding: .85rem 1.1rem; border: 1px solid #dce3ea; border-radius: 10px; background: #fff; color: #004f84; box-shadow: 0 3px 14px rgba(0,0,0,.14); }
.projects-loading-spinner { width: 18px; height: 18px; border: 2px solid #dce8ef; border-top-color: #005992; border-radius: 50%; animation: projects-loading-spin .8s linear infinite; }
.projects-loading.is-error .projects-loading-spinner { display: none; }
@keyframes projects-loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .projects-loading-spinner { animation: none; } }
@media print { .projects-loading { display: none !important; } }

/* Manuel utilisateur : rythme de lecture et listes. */
.manual-content .bo-card { line-height: 1.65; }
.manual-content h4 { margin: 1.35rem 0 .45rem; }
.manual-content p, .manual-content ul, .manual-content ol { margin: .55rem 0 .8rem; }
.manual-content ul, .manual-content ol { padding-left: 1.55rem; }
.manual-content li { margin: .4rem 0; padding-left: .12rem; }
.manual-content .alert.warning { margin: 1rem 0; }

.login-form .password-toggle-btn:disabled { transform: translateY(-50%); background: transparent; }


.support-form { margin-top: 0; background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.support-form .bo-card-title { margin: .1rem 0 .5rem; color: #0b2842; font-size: 1.05rem; text-align: left; }
.support-form .support-field { margin: .75rem 0; }
.support-form textarea { min-height: 160px; resize: vertical; }
.support-form .support-actions { justify-content: flex-end; margin-top: 1rem; }
