:root {
  --ink: #1f2a2e; --ink2: #5b6770; --line: #dfe3e6; --bg: #f6f7f8; --card: #fff;
  --accent: #c8642b; --accent-soft: #fbeee6; --warn: #b4232a; --warn-soft: #fdecec;
  --r: 12px; --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.page { background: var(--bg); }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.btn, button[type=submit], .pill {
  display: inline-flex; align-items: center; gap: .4em; border: 0; border-radius: 999px;
  padding: .55em 1.1em; background: var(--ink); color: #fff; text-decoration: none; cursor: pointer; font-weight: 600;
}
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.pill { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); padding: .45em 1em; }
.pill[aria-pressed=true] { background: var(--ink); color: #fff; box-shadow: none; }

/* ---------- connexion */
.login { max-width: 340px; margin: 12vh auto 0; padding: 0 20px; text-align: center; }
.login h1 { font-size: 1.25rem; margin: .6em 0 1.4em; }
.login h1:has(+ .slogan) { margin-bottom: .2em; }
.login .slogan { color: var(--ink2); font-style: italic; margin: 0 0 1.6em; }
.login form { display: grid; gap: .6em; text-align: left; }
.login input { padding: .8em 1em; border: 1px solid var(--line); border-radius: var(--r); background: #fff; font-size: 1.05rem; }
.login button { justify-content: center; padding: .85em; margin-top: .4em; }
.err { color: var(--warn); margin: 0; }

/* ---------- liste des chantiers */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1em; padding: 14px 18px;
  background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 2; flex-wrap: wrap;
  /* v2.00 : sous l'encoche / Dynamic Island de l'iPhone (écran d'accueil) et sur les côtés en paysage */
  padding-top: max(14px, env(safe-area-inset-top)); padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
.top h1 { font-size: 1.05rem; margin: 0; }
.top nav { display: flex; gap: .5em; }
.top .btn { background: #fff; color: var(--ink); }
.top .btn.ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px #ffffff55; }
.list { max-width: 820px; margin: 0 auto; padding: 16px; }
.list input[type=search] { width: 100%; padding: .8em 1em; border: 1px solid var(--line); border-radius: var(--r); background: #fff; margin-bottom: 12px; }
.projects { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.projects li { display: flex; align-items: stretch; background: var(--card); border-radius: var(--r); box-shadow: 0 0 0 1px var(--line); }
.projects a { flex: 1; display: grid; grid-template-columns: 3.4em 1fr auto; gap: .8em; align-items: center; padding: 12px 14px; text-decoration: none; min-width: 0; }
.projects .num { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.projects .who { min-width: 0; }
.projects .who strong { display: block; }
.projects small { display: block; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.projects .when { color: var(--ink2); font-size: .85em; }
.projects .del { border: 0; background: none; color: var(--ink2); padding: 0 14px; cursor: pointer; }
.empty, .role { color: var(--ink2); }
.role { font-size: .85em; margin-top: 2em; text-align: center; }

/* ---------- visionneuse */
body.viewer { display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); height: 100dvh; overflow: hidden; background: #eef0f1; }
/* v2.00 (lot O) : la visionneuse occupe exactement la fenêtre, y compris installée sur l'écran d'accueil de l'iPhone
   (100dvh y comptait la barre d'état : la page dépassait et le haut partait sous l'encoche) */
body.viewer { position: fixed; inset: 0; height: auto; }
.vbar { position: relative; z-index: 6; display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--ink); color: #fff; z-index: 3;
  padding-top: max(8px, env(safe-area-inset-top)); padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
.vbar .icon { font-size: 1.8rem; line-height: 1; text-decoration: none; padding: 0 8px; }
.vtitle { flex: 1; min-width: 0; line-height: 1.2; }
.vtitle strong, .vtitle small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vtitle small { color: #ffffffbf; }
/* v1.65 : date de pose dans le titre, actions admin directes dans la barre */
.vtitle small:has(.pose-badge) { display: flex; align-items: center; }
.vtitle .vopt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pose-badge { flex: none; display: inline-block; margin-left: .4em; padding: 0 .5em; border-radius: 9px; background: #f5b942; color: #1f2a2e; font-weight: 700; font-size: .85em; }
.vactions { display: flex; align-items: center; gap: 4px; flex: none; }
.vact { position: relative; display: inline-flex; align-items: center; gap: .35em; color: #fff; text-decoration: none; font-size: 1.1rem; line-height: 1;
  padding: 7px 9px; border-radius: 8px; box-shadow: inset 0 0 0 1px #ffffff33; cursor: pointer; }
.vact span { font-size: .8rem; font-weight: 600; }
.vact:hover { background: #ffffff1a; }
details.vact { padding: 0; }
.vmenu summary { list-style: none; display: inline-flex; align-items: center; gap: .35em; padding: 7px 9px; cursor: pointer; }
.vmenu summary::-webkit-details-marker { display: none; }
.vmenu-liste { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: grid; min-width: 9em; background: #fff; border-radius: 10px;
  box-shadow: 0 6px 20px #0004; overflow: hidden; }
.vmenu-liste a { padding: .7em 1em; color: var(--ink); text-decoration: none; font-size: .95rem; white-space: nowrap; }
.vmenu-liste a + a { border-top: 1px solid var(--line); }
.vmenu-liste a:hover { background: #f2f4f5; }
@media (max-width: 700px) { .vact span { display: none; } .vact, .vmenu summary { padding: 7px 7px; } }
#panelBody .actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 2.2em .8em 0; }
#panelBody .actions .pill { text-decoration: none; font-size: .9rem; }
.pose-prevue { margin: .2em 0 .8em; padding: .6em .8em; border-radius: 10px; background: #fff4dc; border: 1px solid #f5b942; font-size: 1rem; }
.adresse a { display: flex; gap: .5em; align-items: baseline; color: var(--ink); text-decoration: none; padding: .55em .8em; border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--line); }
.adresse .go { margin-left: auto; color: #2a6fdb; font-weight: 600; white-space: nowrap; }
details.repli { margin: .9em 0 0; border-top: 1px solid var(--line); padding-top: .6em; }
details.repli > summary { cursor: pointer; font-weight: 600; padding: .3em 0; }
details.repli > summary b { margin-left: .4em; }
details.repli[open] > summary { margin-bottom: .4em; }
.vbar .pill { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px #ffffff66; }
.vbar .pill[aria-pressed=true] { background: #fff; color: var(--ink); }

#stage { position: relative; min-height: 0; }
#c { display: block; width: 100%; height: 100%; touch-action: none; }
#loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--ink2); background: #eef0f1; }
.spin { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: sp 0.9s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
#hint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); background: #1f2a2ecc; color: #fff; padding: 6px 14px;
  border-radius: 999px; font-size: .85rem; pointer-events: none; transition: opacity .8s; white-space: nowrap; }
#hint.fade { opacity: 0; }
/* témoin de calcul : premier passage en Rendu, en élévation… (préparation des programmes graphiques) */
#temoin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none;
  display: grid; justify-items: center; gap: 10px; min-width: 220px; padding: 18px 22px 16px; border-radius: 14px;
  background: #fffffff2; color: var(--ink); box-shadow: 0 6px 24px #0003; text-align: center;
  animation: temoinIn .2s ease-out .12s both; }
#temoin[hidden] { display: none; }
#temoin p { margin: 0; font-size: .95rem; }
#temoin .barre { width: 100%; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
#temoin .barre i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .15s linear; }
#temoin .barre.indet i { background: repeating-linear-gradient(-45deg, var(--accent) 0 8px, #e08a57 8px 16px);
  background-size: 23px 100%; animation: temoinDefile .6s linear infinite; transition: none; }
@keyframes temoinDefile { to { background-position: 23px 0; } }
@keyframes temoinIn { from { opacity: 0; transform: translate(-50%, -46%); } to { opacity: 1; transform: translate(-50%, -50%); } }
/* mesure : résumé en haut de l'écran (la barre des points de vue occupe le bas) */
#measureInfo { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); background: #fff; padding: 4px 6px 4px 16px;
  border-radius: 999px; box-shadow: 0 2px 10px #0002; white-space: nowrap; z-index: 3; display: flex; align-items: center; gap: 4px;
  max-width: calc(100% - 16px); min-height: 38px; box-sizing: border-box; }
#measureInfo[hidden] { display: none; }
#measureInfo > :first-child { overflow: hidden; text-overflow: ellipsis; padding-right: 6px; }
#measureInfo small { color: var(--ink2); margin-left: .5em; }
#measureInfo button { border: 0; background: var(--bg); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: .95rem; flex: none; color: var(--ink); }
body[data-vue=plan] #measureInfo, body[data-vue=elev] #measureInfo { top: 56px; }
#hint { z-index: 2; }
#cotes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
#cotes .cote3d { position: absolute; left: 0; top: 0; background: #d9480f; color: #fff; font-weight: 700; font-size: .8rem; padding: 2px 7px;
  border-radius: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; box-shadow: 0 1px 4px #0003; }
#cotes .poignee { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid #d9480f; box-sizing: border-box; }
#cotes .viseur { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; box-sizing: border-box; }
#cotes .viseur.sommet { background: #1a9f5c; border: 2px solid #fff; border-radius: 3px; box-shadow: 0 0 0 1px #1a9f5c; }
#cotes .viseur.milieu { background: #2f7fd8; border: 2px solid #fff; transform-origin: center; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
#cotes .viseur.arete { border: 3px solid #2f7fd8; border-radius: 50%; }
#cotes .viseur.face, #cotes .viseur.libre { width: 22px; height: 22px; left: -11px; top: -11px;
  background: linear-gradient(#d9480f, #d9480f) center / 2px 100% no-repeat, linear-gradient(#d9480f, #d9480f) center / 100% 2px no-repeat; }

.tools { display: flex; justify-content: space-around; background: #fff; border-top: 1px solid var(--line); padding-bottom: var(--safe-b); z-index: 3;
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.tools button { flex: 1; border: 0; background: none; padding: 8px 2px 6px; display: grid; justify-items: center; gap: 2px; font-size: 1.15rem; cursor: pointer; color: var(--ink); }
.tools button span { font-size: .68rem; color: var(--ink2); }
.tools button[aria-pressed=true] { color: var(--accent); }
.tools button[aria-pressed=true] span { color: var(--accent); font-weight: 600; }

/* panneau : feuille en bas sur téléphone, colonne à droite sur grand écran */
#panel { position: fixed; left: 0; right: 0; bottom: calc(52px + var(--safe-b)); max-height: 50dvh; background: var(--card); border-radius: 16px 16px 0 0;
  box-shadow: 0 -6px 24px #0002; z-index: 5; display: flex; flex-direction: column; }
#panel .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 8px auto 0; flex: none; }
#panel .close { position: absolute; right: 8px; top: 6px; z-index: 3; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #fffffff0; box-shadow: 0 1px 4px #0002; font-size: 1rem; cursor: pointer; color: var(--ink2); }
#panelBody { overflow-y: auto; padding: 4px 18px 18px; -webkit-overflow-scrolling: touch; }
@media (min-width: 900px) {
  body.viewer { grid-template-columns: 1fr; }
  #panel { left: auto; top: var(--hb, 52px); bottom: 0; width: 400px; max-height: none; border-radius: 0; box-shadow: -6px 0 24px #0002; padding-top: 8px; }
  #panel .grab { display: none; }
  body.viewer:has(#panel:not([hidden])) #stage, body.viewer:has(#panel:not([hidden])) .tools { margin-right: 400px; }
}

#panelBody h2 { font-size: 1.12rem; margin: .2em 2em .3em 0; line-height: 1.3; }
#panelBody h2 small { font-weight: 400; color: var(--ink2); }
#panelBody h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink2); margin: 1.3em 0 .5em; }
.kicker { margin: .6em 0 0; font-size: .82rem; color: var(--ink2); }
.ref { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--ink); }
.sub { margin: 0 0 .4em; color: var(--ink2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: .6em 0; }
.chip { padding: .3em .7em; border-radius: 8px; background: var(--bg); font-size: .88rem; }
.chip.strong { background: var(--accent-soft); color: #8a3c12; font-weight: 700; font-variant-numeric: tabular-nums; }
.note { background: var(--bg); padding: .6em .8em; border-radius: 8px; font-size: .9rem; }
.note.warn, li.warn { background: var(--warn-soft); color: var(--warn); }
.note.ok { background: #e9f4ec; color: #22603a; }
b.warn { color: var(--warn); }
/* prix d'achat (admin) : masqués par défaut */
.achat { font-variant-numeric: tabular-nums; white-space: nowrap; }
.achat.cache { color: var(--ink2); letter-spacing: .05em; cursor: pointer; background: var(--bg); border-radius: 4px; padding: 0 .3em; }
.achats-l { display: flex; flex-wrap: wrap; align-items: center; gap: .4em .8em; margin: .8em 0 0; font-size: .9rem; }
.pill.achats { font-size: .8rem; }
li.warn { padding: .5em .7em; border-radius: 8px; margin-bottom: 6px; font-size: .9rem; }
.kv { display: grid; grid-template-columns: minmax(8em, 42%) 1fr; gap: .35em 1em; margin: 0; font-size: .92rem; }
.kv dt { color: var(--ink2); }
.kv dd { margin: 0; }
.plain { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.plain li { padding: .25em 0; }
.prices { display: flex; flex-wrap: wrap; gap: .4em 1.2em; align-items: baseline; margin: 1.2em 0 0; padding: .8em 1em; background: var(--ink); color: #fff; border-radius: 10px; font-weight: 600; }
.prices small { opacity: .7; font-weight: 400; }
.price { color: var(--ink2); white-space: nowrap; }
.muted { color: var(--ink2); font-size: .88rem; }
#fq { width: 100%; padding: .6em .9em; border: 1px solid var(--line); border-radius: 10px; margin: .4em 0 .6em; }
.arts { list-style: none; padding: 0; margin: 0; }
.arts button { width: 100%; display: grid; grid-template-columns: 2.6em 1fr 1.4em; gap: .6em; align-items: center; text-align: left;
  border: 0; border-bottom: 1px solid var(--line); background: none; padding: .65em 0; cursor: pointer; }
.arts .pos { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.arts .what { min-width: 0; }
.arts small { display: block; color: var(--ink2); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arts .go { color: var(--accent); }
.arts .no3d .pos { color: var(--ink2); }

/* ---------- dépôt */
.depot { max-width: 760px; margin: 0 auto; padding: 18px; }
.drop { border: 2px dashed #b9c1c6; border-radius: 16px; padding: 40px 20px; text-align: center; background: #fff; cursor: pointer; transition: .15s; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { display: block; font-size: 1.1rem; margin-bottom: .3em; }
.drop p { margin: .3em 0; color: var(--ink2); }
.summary { margin-top: 16px; background: #fff; border-radius: 16px; padding: 16px; box-shadow: 0 0 0 1px var(--line); }
.summary input[type=text] { width: 100%; padding: .6em .8em; border: 1px solid var(--line); border-radius: 10px; }
.files { list-style: none; padding: 0; margin: .8em 0; max-height: 220px; overflow: auto; font-size: .88rem; }
.files li { display: flex; justify-content: space-between; gap: 1em; padding: .25em 0; border-bottom: 1px solid var(--bg); }
.files li.ok::after { content: '✓'; color: #2b8a3e; }
.files li.err { color: var(--warn); }
.bar { height: 6px; background: var(--bg); border-radius: 6px; overflow: hidden; margin: .8em 0; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.done { background: #ebfbee; color: #2b8a3e; padding: .8em 1em; border-radius: 10px; }

/* ---------- plan 2D */
#planLabels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.plabel { position: absolute; left: 0; top: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.plabel.rep { pointer-events: auto; cursor: pointer; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; box-shadow: 0 1px 3px #0004; }
.plabel.cote { font-size: 11px; font-weight: 700; color: var(--ink); background: #ffffffd9; padding: 1px 5px; border-radius: 4px; }
#planBar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; background: #fff; padding: 3px;
  border-radius: 999px; box-shadow: 0 2px 10px #0002; z-index: 2; }
#planBar button { white-space: nowrap; border: 0; background: none; padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--ink2); }
#planBar button[aria-pressed=true] { background: var(--ink); color: #fff; }

/* ---------- AR fournisseur & documents */
.carton { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2em .7em; margin: .5em 0; padding: .55em .8em; border-radius: 10px;
  background: #fff4e0; border: 2px solid #f0a020; }
.carton span { font-size: .8rem; color: #8a5a00; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.carton strong { font-size: 1.5rem; color: #5c3b00; font-variant-numeric: tabular-nums; }
.carton small { flex-basis: 100%; color: #8a5a00; }
.carton em { font-style: normal; opacity: .8; }
.docbtns { margin: .6em 0; }
.docbtns .pill { text-decoration: none; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: .4em 0 .8em; }
.thumbs a, .thumbs button { width: 100%; padding: 0; cursor: pointer; display: block; position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.thumbs img { display: block; width: 100%; aspect-ratio: 1.41; object-fit: contain; }
.thumbs span { position: absolute; right: 4px; bottom: 4px; font-size: .7rem; background: #1f2a2ecc; color: #fff; padding: 1px 6px; border-radius: 6px; }
.docs li { padding: .35em 0; border-bottom: 1px solid var(--bg); }
.docs a { text-decoration: none; font-weight: 600; }
.docs small { color: var(--ink2); }
.seg { display: inline-flex; background: var(--bg); padding: 3px; border-radius: 999px; gap: 2px; margin: .2em 0 .4em; }
.seg button { border: 0; background: none; padding: .35em .9em; border-radius: 999px; cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--ink2); }
.seg button[aria-pressed=true] { background: var(--ink); color: #fff; }
.plabel.rep.carton { background: #f0a020; color: #3d2600; }

/* ---------- documents */
.tools button { position: relative; }
.tools .badge { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: .65rem; font-weight: 700; line-height: 16px; }
.doclist { list-style: none; margin: .4em 0 0; padding: 0; }
.doclist button { width: 100%; display: grid; grid-template-columns: 2.2em 1fr auto; gap: 10px; align-items: center; text-align: left;
  border: 0; border-bottom: 1px solid var(--line); background: none; padding: .7em 0; cursor: pointer; color: var(--ink); font: inherit; }
.doclist .ico { font-size: 1.4rem; text-align: center; }
.doclist small { display: block; color: var(--ink2); font-size: .8rem; }
.doclist .go { color: var(--accent); font-size: 1.2rem; }
.docbtns { display: flex; flex-wrap: wrap; gap: 8px; }
/* v2.32 : onglet Dossier — cartes du dossier client (dossier cuisine, devis, plan technique) */
.dcartes { list-style: none; margin: .5em 0 .8em; padding: 0; display: grid; gap: 8px; }
.dcarte { width: 100%; display: grid; grid-template-columns: 2.6em 1fr auto auto; gap: 12px; align-items: center; text-align: left;
  border: 1px solid var(--line); border-radius: 10px; background: none; padding: .75em .8em; cursor: pointer; color: var(--ink); font: inherit; }
.dcarte:hover { border-color: var(--accent); }
.dcarte .ic { width: 2.2em; height: 2.2em; color: var(--accent); }
.dcarte b { display: block; font-size: 1rem; }
.dcarte small { display: block; color: var(--ink2); font-size: .8rem; }
.dcarte .go { color: var(--accent); font-size: 1.2rem; }
.dc-etat { font-style: normal; font-size: .72rem; padding: 2px 7px; border-radius: 9px; background: rgba(46,160,90,.14); color: #2e7d4f; white-space: nowrap; }
.dc-etat.lock { background: rgba(127,127,127,.15); color: var(--ink2); }
.dcommande { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; margin: 0 0 1em; padding: .7em .8em;
  border-radius: 10px; background: rgba(127,127,127,.08); cursor: pointer; }
.dcommande input { width: 1.2em; height: 1.2em; margin-top: .15em; accent-color: var(--accent); }
.dcommande small { display: block; color: var(--ink2); font-size: .8rem; }
/* v2.33 : « Ma sélection » par rubrique, une ligne par produit (fiche + dessin / notice + voir dans la 3D) */
.drub { margin: 0 0 .4em; }
.drub > summary { cursor: pointer; font-weight: 600; padding: .45em 0; list-style-position: inside; }
.drub > summary small { color: var(--ink2); font-weight: 400; }
.dprod { border-bottom: 1px solid var(--line); }
.dprod > button { border-bottom: 0 !important; }
.dp-btns { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 .7em calc(2.2em + 10px); }
.doclist .dp-btn, .dp-btn { width: auto; display: inline-block; text-align: center; border: 1px solid var(--line); background: none; color: var(--accent); border-radius: 14px; padding: 3px 10px; font: inherit; font-size: .8rem; cursor: pointer; }
.dp-btn:hover { border-color: var(--accent) !important; }
/* v2.34 : catalogues des partenaires */
.doclist .cat-logo { width: 2em; height: 2em; object-fit: contain; display: block; margin: auto; }
.doclist .dp-btn { border-bottom: 1px solid var(--line); }


button.pill { font: inherit; font-weight: 600; }

/* ---------- liseuse */
html.reading, html.reading body { overflow: hidden; }
#reader { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: #3a4246; }
#reader[hidden] { display: none; }
/* v2.32 : document non imprimable (client avant la commande) : rien à imprimer par le menu du navigateur */
@media print { html.reading:has(#reader.r-noprint) body { display: none; } }
#reader.r-nodl .rpages { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.rbar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--ink); color: #fff; }
.rclose { display: flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; background: #fff; color: var(--ink);
  padding: .5em 1em; font: inherit; font-weight: 700; cursor: pointer; flex: none; }
.rclose span { font-size: .9rem; }
.rtitle { min-width: 0; display: grid; }
.rtitle strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .95rem; }
.rtitle small { color: #ffffffb0; font-size: .78rem; font-variant-numeric: tabular-nums; }
.rscroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; position: relative; }
.rpages { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px; width: max-content; min-width: 100%; box-sizing: border-box; }
.rpage { background: #fff; box-shadow: 0 2px 8px #0005; flex: none; }
.rpage canvas { display: block; width: 100%; height: 100%; }
.rimg { display: block; max-width: none; background: #fff; }
.rmsg { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); color: #fff; text-align: center; max-width: 80%; pointer-events: none; }
.rmsg:empty { display: none; }
/* v2.41 : outils dans la barre de titre (à droite), plus de barre en bas : toute la hauteur pour le document */
.rbar { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
.rtitle { flex: 1; }
.rtools { display: flex; align-items: center; gap: 2px; flex: none; margin-left: auto; }
.rtools button, .rtools a { border: 0; border-radius: 10px; background: none; padding: 4px 10px; display: grid; justify-items: center; gap: 1px; font-size: 1.2rem; line-height: 1.1;
  cursor: pointer; color: #fff; text-decoration: none; min-width: 44px; min-height: 40px; align-content: center; font-family: inherit; }
.rtools button:hover, .rtools a:hover { background: #ffffff1f; }
.rtools [aria-pressed="true"] { background: #ffffff2a; }
.rtools [hidden] { display: none; }
.rtools span { font-size: .66rem; color: #ffffffb0; white-space: nowrap; }
/* téléphone : icônes seules, pour laisser de la place au titre */
@media (max-width: 640px) {
  .rtools span { display: none; }
  .rtools button, .rtools a { min-width: 38px; padding: 4px 6px; font-size: 1.3rem; }
  .rclose { padding: .5em .8em; }
  .rclose span { display: none; }
}
.rtools button:disabled { opacity: .35; }

/* ---------- liens de partage */
.projects .share { position: relative; border: 0; background: none; padding: 0 10px; cursor: pointer; font-size: 1.05rem; }
.projects .share .badge, .vbar .badge { position: absolute; top: 6px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: .65rem; line-height: 16px; text-align: center; }
.vlogo { flex: none; margin: 0 6px 0 4px; width: 36px; height: 36px; }   /* v2.53 : « 3D » blanc, haut comme les deux lignes du titre */
.muted { color: var(--ink2); }
#share { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 0; border-radius: 16px; padding: 16px 18px 18px;
  box-shadow: 0 10px 40px #0004; color: var(--ink); }
#share::backdrop { background: #1f2a2e88; }
#share .sh-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; }
#share h2 { font-size: 1.1rem; margin: 0; }
#share h2 span { color: var(--accent); }
#share .close { border: 0; background: none; font-size: 1.1rem; cursor: pointer; color: var(--ink2); padding: 6px; }
#share > p { margin: .4em 0 1em; font-size: .9rem; }
.sh-new { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; background: var(--bg); border-radius: var(--r); }
.sh-new label { display: grid; gap: 4px; font-size: .8rem; color: var(--ink2); }
.sh-new label:first-child { grid-column: 1 / -1; }
.sh-new select, .sh-new input { padding: .55em .7em; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-size: .95rem; }
.sh-new button { grid-column: 1 / -1; justify-content: center; }
.sh-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.sh-list li { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; display: grid; gap: 8px; }
.sh-list li.off { opacity: .55; }
.sh-list small { display: block; color: var(--ink2); margin-top: 2px; }
.sh-list input { width: 100%; padding: .45em .6em; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: .8rem; color: var(--ink2); }
.sh-list p { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.sh-list .pill { font-size: .85rem; padding: .35em .8em; text-decoration: none; }
.sh-list .pill.danger { color: var(--warn); }
.tag { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 2px 7px; border-radius: 6px; }
.tag.poseur { background: #e6eef1; color: var(--ink); }
.tag.client { background: var(--accent-soft); color: var(--accent); }
.tag.vitrine { background: #e9f5ec; color: #2e7d4f; }   /* v2.34 */
@media (max-width: 480px) { .sh-new { grid-template-columns: 1fr; } }

/* rendu soigné : barre des points de vue */
#vuesBar { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px;
  background: #1f2a2ee6; border-radius: 22px; padding: 3px; z-index: 2; box-shadow: 0 2px 10px #0003; }
#vuesBar[hidden] { display: none; }
#vuesBar button { border: 0; background: none; color: #fff; font: inherit; font-size: .9rem; cursor: pointer; padding: 8px 12px; border-radius: 18px; white-space: nowrap; }
#vuesBar { max-width: calc(100% - 16px); }
#vuesBar #vuePrev, #vuesBar #vueNext { font-size: 1.3rem; line-height: 1; padding: 6px 14px; }
#vuesBar button:active { background: #ffffff22; }
#vuesBar #btnVisite { border-left: 1px solid #ffffff33; padding: 6px 12px; font-size: 1rem; }
#vuesBar #btnVisite[aria-pressed="true"] { background: #ff5a00cc; }
#vuesBar #btnDecor { border-left: 1px solid #ffffff33; border-radius: 0 18px 18px 0; padding: 6px 12px; font-size: 1.05rem; }
#vuesBar #btnDecor[aria-expanded="true"] { background: #ffffff22; }
/* 📸 Photo HD (Blender sur le PC de bureau, lot N) */
#hdBar { position: absolute; left: 50%; top: 56px; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: 8px;
  background: #1f2a2ee6; color: #fff; padding: 5px 6px 5px 14px; border-radius: 20px; font-size: .9rem; max-width: calc(100% - 16px); }
#hdBar[hidden] { display: none; }
#hdBar .barre { width: 70px; height: 5px; border-radius: 3px; background: #ffffff33; overflow: hidden; flex: none; }
#hdBar .barre i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 1s linear; }
#hdBar button, #hdBar .bt { border: 0; background: #ffffff18; color: #fff; font: inherit; cursor: pointer; padding: 5px 9px; border-radius: 14px; text-decoration: none; }
#hdBar #hdVoir img { display: block; height: 54px; border-radius: 8px; }
#hdBar.fait { border-radius: 14px; }
#hdTxt { min-width: 9em; }
/* décor extérieur (decor.js) */
#decorMenu { position: absolute; left: 50%; bottom: 62px; transform: translateX(-50%); z-index: 3; background: #1f2a2ef2; color: #fff;
  border-radius: 14px; padding: 8px; min-width: 210px; box-shadow: 0 4px 16px #0004; }
#decorMenu[hidden] { display: none; }
#decorMenu .dm-titre { font-size: .78rem; opacity: .7; padding: 2px 8px 6px; }
#decorMenu button { border: 0; background: none; color: #fff; font: inherit; font-size: .92rem; cursor: pointer; border-radius: 10px; }
#decorListe button { display: block; width: 100%; text-align: left; padding: 8px 10px; }
#decorListe button[aria-checked="true"] { background: #ff5a0033; }
#decorListe button[aria-checked="true"]::after { content: " ✓"; color: #ffb48a; }
#decorMenu button:hover, #decorMenu button:active { background: #ffffff1f; }
#decorMenu .dm-rot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #ffffff26; margin-top: 6px; padding-top: 6px; font-size: .85rem; opacity: .95; }
#decorMenu .dm-rot[hidden] { display: none; }
#decorMenu .dm-rot button { font-size: 1.25rem; padding: 4px 14px; }

/* ---------- élévations */
#elevBar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; background: #fff; padding: 3px;
  border-radius: 999px; box-shadow: 0 2px 10px #0002; z-index: 2; max-width: calc(100% - 12px); }
#elevBar[hidden], #coupeBar[hidden] { display: none; }
#elevBar button { white-space: nowrap; border: 0; background: none; padding: 6px 10px; border-radius: 999px; cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--ink2); flex: none; }
#elevBar #elevNom { color: var(--ink); min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
#elevBar #elevPrev, #elevBar #elevNext { font-size: 1.2rem; line-height: 1; padding: 4px 10px; }
#elevBar button[aria-pressed=true] { background: var(--ink); color: #fff; }
#coupeBar { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: #fff;
  padding: 6px 14px; border-radius: 999px; box-shadow: 0 2px 10px #0002; z-index: 2; font-size: .85rem; font-weight: 600; color: var(--ink2);
  width: min(420px, calc(100% - 24px)); box-sizing: border-box; }
#coupeBar input { flex: 1; min-width: 0; accent-color: var(--accent); }
#coupeBar b { min-width: 4.2em; text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
#elevLabels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#elevLabels .plabel { position: absolute; left: 0; top: 0; }
#elevLabels .rep { pointer-events: auto; cursor: pointer; }
#elevLabels .ecote { background: #ffffffe6; color: #1f2a2e; font-size: .72rem; font-weight: 600; padding: 0 4px; border-radius: 4px; font-variant-numeric: tabular-nums; }
#elevLabels .ecote.total { font-weight: 800; }
#stage.tourne #c { cursor: ew-resize; }
@media (max-width: 420px) {
  .tools button span { font-size: .62rem; }
  #elevBar button { padding: 6px 7px; }
}

/* ---------- numéro de version */
.version { color: var(--ink2); opacity: .7; font-size: .72rem; text-align: center; margin: 18px 0 8px; font-variant-numeric: tabular-nums; }
/* retour à la liste depuis une fiche (reste visible en haut quand on fait défiler la fiche) */
.pill.retour { position: sticky; top: 0; z-index: 2; margin: 0 0 .7em; box-shadow: 0 2px 6px #0002; }

/* « Voir comme » : bandeau d'aperçu admin (poseur / client) */
body.viewer.apercu { grid-template-rows: auto auto 1fr auto; }
.apercu-bandeau { position: relative; z-index: 7; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  padding: 6px 10px; padding-top: max(6px, env(safe-area-inset-top)); background: #6b2fb3; color: #fff; font-size: .9rem; }
.apercu-bandeau span { flex: 1 1 auto; }
.apercu-bandeau a { color: #fff; white-space: nowrap; padding: 3px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1px #ffffffaa; text-decoration: none; }
.apercu-bandeau a.quitter { background: #fff; color: #6b2fb3; font-weight: 600; }
body.viewer.apercu .vbar { padding-top: 8px; }
.projects .voir { position: relative; display: flex; }
.projects .voir summary { list-style: none; display: flex; align-items: center; padding: 0 10px; cursor: pointer; font-size: 1.05rem; }
.projects .voir summary::-webkit-details-marker { display: none; }
.voir-menu { position: absolute; right: 0; top: 100%; z-index: 20; display: flex; flex-direction: column; gap: 4px; padding: 8px;
  background: #fff; border-radius: 10px; box-shadow: 0 6px 24px #0003; min-width: 180px; }
.voir-menu b { font-size: .8rem; color: #666; padding: 0 4px 2px; }
.voir-menu a { padding: 8px 10px; border-radius: 8px; text-decoration: none; color: inherit; }
.voir-menu a:hover, .voir-menu a:focus { background: #f0eaf8; }

/* ---------- pochette : accès depuis la liste, étape et alertes */
.projects .poch { flex: none; display: flex; align-items: center; padding: 0 8px; text-decoration: none; font-size: 1.05rem; grid-template-columns: none; }
.projects .chip { display: inline-block; margin-top: 4px; font-size: .72rem; font-weight: 700; padding: .15em .6em; border-radius: 999px; background: #eef0f2; }
.projects .chip.d-a_commander { background: #fdecec; color: var(--warn); } .projects .chip.d-commande { background: #fff3d6; color: #8a5a00; }
.projects .chip.d-ar { background: #e6effa; color: #1f4f8a; } .projects .chip.d-livre, .projects .chip.d-pose { background: #e3f4e6; color: #1d6b2e; }
.projects .chip.d-facture, .projects .chip.d-solde { background: #1d6b2e; color: #fff; }
.projects .chip.alerte { background: var(--warn-soft); color: var(--warn); }
.surveiller { background: var(--card); border-radius: var(--r); box-shadow: 0 0 0 1px var(--line); margin-bottom: 12px; padding: 4px 14px; }
.surveiller summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.surveiller summary b { background: var(--warn); color: #fff; border-radius: 999px; padding: 0 .55em; font-size: .8rem; margin-left: .3em; }
.surveiller ul { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.surveiller li a { display: block; padding: .45em .7em; border-radius: 8px; background: #e6effa; color: #1f4f8a; text-decoration: none; font-size: .9rem; }
.surveiller li.attention a { background: var(--warn-soft); color: var(--warn); }
/* v1.29 : navigateur sans accélération graphique (rendu logiciel, 3D très lente) */
.alerte-gpu { position: absolute; left: 50%; top: 52px; transform: translateX(-50%); z-index: 7; width: min(560px, calc(100% - 20px));
  background: #fff4e5; color: #6b3d00; border: 1px solid #f0b35c; border-radius: 10px; padding: 10px 36px 10px 12px; font-size: .85rem;
  line-height: 1.35; box-shadow: 0 4px 14px #0002; }
.alerte-gpu button { position: absolute; top: 6px; right: 6px; border: 0; background: none; font-size: 1rem; cursor: pointer; color: inherit; }

/* v1.48 — liste des chantiers sur téléphone : la date passe sous le nom (elle chevauchait le nom),
   icônes resserrées, nom long coupé proprement */
.projects .who strong { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .projects a { grid-template-columns: 2.6em 1fr; gap: 0 .6em; padding: 10px 8px 10px 12px; align-items: start; }
  .projects .num { grid-row: 1 / span 2; line-height: 1.35; }
  .projects .when { grid-column: 2; font-size: .78em; margin-top: 2px; }
  .projects .poch { padding: 0 5px; }
  .projects .voir summary { padding: 0 5px; }
  .projects .share { padding: 0 7px; }
  .projects .del { padding: 0 10px 0 6px; }
}

/* ---------- vue miroir de la télécommande (G4) : seulement la 3D, sans interface */
body.viewer.miroir { grid-template-rows: 1fr; background: #141c1e; }
body.miroir .vbar, body.miroir .tools, body.miroir #vuesBar, body.miroir #decorMenu, body.miroir #hint,
body.miroir #panel, body.miroir #planBar, body.miroir #elevBar, body.miroir #coupeBar, body.miroir .alerte-gpu { display: none !important; }
body.miroir #c { pointer-events: none; }

/* ---------- liste : un dossier = une ligne, ses options repliées dessous (v1.62) */
.projects li.groupe { display: block; }
.projects li.groupe > details > summary { list-style: none; display: grid; grid-template-columns: 3.4em minmax(0, 1fr) auto; gap: .8em; align-items: center;
  padding: 12px 14px; cursor: pointer; }
.projects li.groupe > details > summary::-webkit-details-marker { display: none; }
.projects li.groupe > details > summary .poch { padding: 0 4px; text-decoration: none; }
.projects li.groupe > details > summary .who strong { display: block; }
.projects li.groupe .nbopt { color: var(--accent); font-weight: 600; }
.projects li.groupe .nbopt::after { content: ' ▾'; }
.projects li.groupe > details[open] .nbopt::after { content: ' ▴'; }
.projects.options { gap: 0; padding: 0 0 6px; border-top: 1px solid var(--line); }
.projects.options > li { box-shadow: none; border-radius: 0; background: transparent; }
.projects.options > li + li { border-top: 1px dashed var(--line); }
.projects.options > li.opt:not(.validee) .who strong { font-weight: 500; color: var(--ink2); }
.projects li.opt .num { text-align: center; color: #c9a227; }
.chip.valide { background: #e7f6ec; color: #1f7a3f; font-weight: 600; }
details.showroom { margin-top: 18px; }
details.showroom > summary { cursor: pointer; padding: 10px 4px; font-weight: 600; color: var(--ink2); }
details.showroom > summary b { background: var(--line); border-radius: 999px; padding: 1px 8px; margin-left: 4px; font-size: .85em; }
details.showroom .projects { margin-top: 6px; }
details.showroom .projects > li { background: var(--card); }

/* ---------- « Mes réalisations » dans le lien client (v1.63) */
.real-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.real-carte { position: relative; border: 0; padding: 0; background: var(--card); border-radius: 10px; overflow: hidden; text-align: left; cursor: pointer;
  box-shadow: 0 0 0 1px var(--line); display: grid; }
.real-carte img, .real-vide { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--bg); }
.real-carte b { font-size: .85rem; padding: 6px 8px 8px; line-height: 1.25; }
.real-3d { position: absolute; top: 6px; right: 6px; background: #1f5f8b; color: #fff; font-style: normal; font-weight: 700; font-size: .7rem; padding: 2px 7px; border-radius: 999px; }
.real-photos { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 10px -4px 4px; padding: 0 4px; }
.real-photos a { flex: 0 0 88%; scroll-snap-align: center; }
.real-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; background: var(--bg); }
.real-aide { font-size: .8rem; margin: 0 0 8px; }
.real-texte { line-height: 1.5; }
.real-details { padding-left: 1.2em; }
.sh-list label.sh-opt { display: flex; flex-direction: row; justify-content: flex-start; gap: 8px; align-items: center; font-size: .9rem; margin: 6px 0 0; text-align: left; }
.sh-list label.sh-opt input { width: auto; flex: none; margin: 0; }
.ar-ligne { font-size: .9rem; margin: .1em 0 .5em; }

/* ---------- mode Présentation (v1.66) */
button.vact { border: 0; background: transparent; font: inherit; cursor: pointer; }
.vact.pres-live { background: #c8642b; border-radius: 999px; }
.vact.pres-live span { display: inline !important; }
.pres-fenetre { position: fixed; inset: 0; z-index: 60; background: #0008; display: grid; place-items: center; padding: 16px; }
.pres-boite { background: var(--card, #fff); color: var(--ink, #1f2a2e); border-radius: 16px; padding: 16px 18px; width: min(420px, 100%); display: grid; gap: 10px; box-shadow: 0 10px 40px #0005; }
.pres-tete { display: flex; justify-content: space-between; align-items: center; font-size: 1.1rem; }
.pres-x { border: 0; background: transparent; font-size: 1.2rem; cursor: pointer; }
.pres-aide { margin: 0; color: var(--ink2, #555); font-size: .9rem; line-height: 1.4; }
.pres-qr { width: 180px; justify-self: center; }
.pres-qr svg { width: 100%; height: auto; display: block; }
.pres-url { width: 100%; font-size: .9rem; padding: 8px 10px; border: 1px solid var(--line, #ddd); border-radius: 8px; }
.pres-actions { display: flex; gap: 8px; }
.pres-actions > * { flex: 1; text-align: center; border: 1px solid var(--line, #ccc); border-radius: 999px; padding: 8px; background: transparent; color: inherit; text-decoration: none; font: inherit; font-weight: 600; cursor: pointer; }
.pres-etat { margin: 0; font-size: .85rem; }
.pres-plus { border: 1px solid var(--line, #ccc); border-radius: 999px; padding: 8px; background: transparent; font: inherit; font-weight: 600; cursor: pointer; }
.pres-stop { border: 0; border-radius: 999px; padding: 10px; background: #b3261e; color: #fff; font-weight: 700; cursor: pointer; }
.pres-bandeau { position: fixed; z-index: 40; top: calc(var(--hb, 56px) + 8px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
  background: #1f2a2e; color: #fff; border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: .9rem; box-shadow: 0 2px 10px #0004; max-width: calc(100% - 20px); pointer-events: none; }
.pres-dot { width: 10px; height: 10px; border-radius: 50%; background: #f4b04a; flex: none; }
.pres-bandeau[data-etat=live] .pres-dot { background: #ff3b30; animation: presclign 1.2s infinite; }
.pres-bandeau[data-etat=fin] .pres-dot { background: #8a959c; }
@keyframes presclign { 50% { opacity: .3; } }
/* v2.16 : cadre de l'écran des spectateurs, chez Arnaud (comme le cadre de la caméra de Blender) */
#presCadres { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 3; }
#presCadres[hidden] { display: none; }
#presCadres .pres-cache { position: absolute; box-shadow: 0 0 0 4000px #1f2a2e40; }
#presCadres .pres-cadre { position: absolute; outline: 2px dashed #ff7a1a; outline-offset: -1px; }
#presCadres .pres-cadre span { position: absolute; left: 6px; background: #ff7a1ae6; color: #fff; font: 500 .72rem/1.2 system-ui, sans-serif;
  padding: 3px 7px; border-radius: 999px; white-space: nowrap; }
body.pres-cadres #hdCadre.compo { display: none; }
.pres-cad { display: flex; gap: 6px; align-items: center; font-size: .85rem; margin: 4px 0 8px; cursor: pointer; }
.pres-point { position: fixed; z-index: 35; left: 0; top: 0; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; pointer-events: none; }
.pres-ptr { background: #ff5a00; box-shadow: 0 0 0 4px #ff5a0055, 0 0 12px #ff5a00; transition: transform .1s linear; }
.pres-ici { background: #1f7ae0; box-shadow: 0 0 0 4px #1f7ae055; }
.pres-ici.pulse { animation: presici 1s ease-out 3; }
@keyframes presici { from { box-shadow: 0 0 0 0 #1f7ae0aa; } to { box-shadow: 0 0 0 26px #1f7ae000; } }
/* spectateur : il suit, ses commandes sont inactives (il peut toucher la 3D pour montrer un endroit) */
body.spectateur .tools button, body.spectateur #btnList, body.spectateur #vuesBar, body.spectateur #planBar, body.spectateur #elevBar,
body.spectateur #panel, body.spectateur #decorMenu, body.spectateur .vbar a, body.spectateur .vbar details { pointer-events: none; }
body.spectateur .tools, body.spectateur #btnList, body.spectateur #vuesBar, body.spectateur #hint { opacity: .45; }
body.spectateur #reader { pointer-events: none; }
body.spectateur #reader .rbar { opacity: .5; }

/* spectateur (v1.67) : la 3D prend toute la place — ses commandes ne servent pas pendant la présentation */
body.spectateur .tools, body.spectateur #vuesBar, body.spectateur #hint, body.spectateur #btnList, body.spectateur #planBar, body.spectateur #elevBar,
body.spectateur .alerte-gpu { display: none !important; }
body.viewer.spectateur { grid-template-rows: auto minmax(0, 1fr); }
@media (orientation: landscape) and (max-height: 540px) {
  body.spectateur .vbar { display: none !important; }
  body.viewer.spectateur { grid-template-rows: minmax(0, 1fr); }
  body.spectateur .pres-bandeau { top: 8px; font-size: .8rem; padding: 5px 12px; }
}
/* v1.70 : fin de présentation — garder ou couper le lien du client */
.pres-fin { display: grid; gap: 8px; }
.pres-fin p { margin: 4px 0 0; font-weight: 600; }
.pres-fin button { border: 0; border-radius: 999px; padding: 10px; font-weight: 700; cursor: pointer; }
.pres-garder { background: #1e7d3a; color: #fff; }
.pres-couper { background: #b3261e; color: #fff; }
.pres-annuler { background: transparent; color: inherit; text-decoration: underline; font-weight: 400 !important; }
/* v1.71 : état de la présentation dans la barre de titre du spectateur (point rouge clignotant) */
.pres-bandeau.en-barre { position: static; transform: none; box-shadow: none; flex: none; background: #ffffff14; padding: 5px 10px; font-size: .78rem; white-space: nowrap; }
/* v1.72 : choix du lien à présenter (lien déjà envoyé ou nouveau) */
.pres-fenetre.choix .pres-boite > :not(.pres-tete):not(.pres-choix) { display: none !important; }
.pres-fenetre.choix .pres-choix { display: grid !important; }
.pres-choix { gap: 8px; }
.pres-choix p { margin: 0; font-size: .9rem; }
.pres-choix button { display: grid; gap: 2px; text-align: left; border: 0; border-radius: 12px; padding: 10px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.pres-choix small { font-weight: 400; opacity: .75; }
.pres-sur { background: #c4501b; color: #fff; }
.pres-nouveau { background: transparent; border: 1px solid var(--line, #ccc) !important; color: inherit; }
.tag-live { font-size: .75rem; font-weight: 700; color: #c62828; white-space: nowrap; }
/* v1.73 : téléphone tourné — la 3D d'abord : en direct, juste un petit « ● Direct » discret dans le coin */
.pres-court { display: none; }
@media (orientation: landscape) and (max-height: 540px) {
  body.spectateur .pres-bandeau[data-etat=live] { top: 6px; left: 6px; transform: none; padding: 3px 9px 3px 7px; gap: 5px; font-size: .68rem;
    background: #1f2a2e99; box-shadow: none; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
  body.spectateur .pres-bandeau[data-etat=live] #presTxt { display: none; }
  body.spectateur .pres-bandeau[data-etat=live] .pres-court { display: inline; }
  body.spectateur .pres-bandeau[data-etat=live] .pres-dot { width: 7px; height: 7px; }
}
.pres-sur.poseur { background: #2f5d8a; }
/* v1.75 : présentateur — étiquette d'une ligne (Rep. · réf. · dimensions) au lieu de la grande fiche */
#presEtiq { position: fixed; z-index: 6; left: 50%; transform: translateX(-50%); bottom: calc(52px + var(--safe-b, 0px) + 10px);
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 16px); border: 0; border-radius: 999px; padding: 8px 8px 8px 16px;
  background: var(--ink, #1f2a2e); color: #fff; font: inherit; font-size: .88rem; font-weight: 600; box-shadow: 0 3px 12px #0004; cursor: pointer; }
#presEtiq span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#presEtiq b { flex: none; width: 26px; height: 26px; border-radius: 50%; background: #c4501b; display: grid; place-items: center; font-size: .9rem; }
@media (min-width: 900px) { #presEtiq { bottom: 76px; } }
@media (orientation: landscape) and (max-height: 540px) {
  #presEtiq { left: 8px; transform: none; max-width: 60vw; font-size: .75rem; padding: 4px 4px 4px 12px; background: #1f2a2ecc;
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
  #presEtiq b { width: 22px; height: 22px; }
  /* fiche complète : panneau étroit à droite, la 3D reste visible */
  body.presente #panel { left: auto; top: var(--hb, 52px); width: min(42vw, 380px); max-height: none; border-radius: 14px 0 0 0; box-shadow: -6px 0 24px #0003; }
  body.presente #panel .grab { display: none; }
}
/* v1.75 : fenêtre 📡 sur téléphone en paysage — défile et QR réduit (le bouton Arrêter restait hors écran) */
.pres-boite { max-height: calc(100dvh - 24px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
@media (max-height: 540px) { .pres-fenetre { padding: 8px; } .pres-qr { width: 110px; } .pres-aide { font-size: .8rem; margin: 0; } }
body:has(#presEtiq:not([hidden])) #vuesBar { visibility: hidden; }   /* l’étiquette prend sa place le temps de montrer un meuble */
/* v1.76 : téléphone en paysage — outils en colonne à gauche (icônes seules), barre de titre sur une ligne :
   toute la hauteur pour la 3D. Tablette et ordinateur : inchangés. */
@media (orientation: landscape) and (max-height: 540px) {
  body.viewer { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  body.viewer > .vbar { grid-column: 1 / -1; grid-row: 1; padding-top: 4px; padding-bottom: 4px; padding-left: max(10px, env(safe-area-inset-left)); }
  body.viewer > .vbar .vtitle small { display: none; }
  body.viewer > .vbar .vact { padding-top: 3px; padding-bottom: 3px; }
  body.viewer > #stage { grid-column: 2; grid-row: 2; }
  body.viewer > .tools { grid-column: 1; grid-row: 2; flex-direction: column; justify-content: space-evenly; width: calc(46px + env(safe-area-inset-left));
    padding: 2px 0 2px env(safe-area-inset-left); border-top: 0; border-right: 1px solid var(--line); overflow-y: auto; }
  body.viewer > .tools button { flex: 1 1 0; min-height: 30px; padding: 0; font-size: 1.05rem; align-content: center; }
  body.viewer > .tools button span { display: none; }
  #panel { left: calc(46px + env(safe-area-inset-left)); bottom: 0; max-height: 70dvh; }
  body.presente #panel { left: auto; bottom: 0; }
  #presEtiq { bottom: 8px; left: calc(54px + env(safe-area-inset-left)); }
  /* spectateur : ni barre ni outils, la 3D seule */
  body.viewer.spectateur > #stage { grid-column: 1 / -1; grid-row: 1 / -1; }
}
.tools-bulle { position: fixed; z-index: 70; background: var(--ink, #1f2a2e); color: #fff; font-size: .8rem; font-weight: 600; padding: 5px 10px; border-radius: 8px;
  pointer-events: none; white-space: nowrap; transform: translateY(-50%); box-shadow: 0 2px 8px #0004; }
/* v1.77 : téléphone en paysage — plus de barre de titre : outils à gauche (avec « ‹ » en haut), commandes à droite
   (Dossier, 📡, 🎮, 👁, Articles), titre du chantier en pastille qui s'efface. Toute la hauteur pour la 3D. */
.titre-flottant { display: none; }
@media (orientation: landscape) and (max-height: 540px) {
  body.viewer { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr); }
  body.viewer > .vbar { z-index: 5; grid-column: 3; grid-row: 1; flex-direction: column; justify-content: flex-start; align-items: center; gap: 4px;
    width: calc(50px + env(safe-area-inset-right)); box-sizing: border-box; padding: 6px env(safe-area-inset-right) 6px 0; overflow-y: auto; }
  body.viewer > .vbar .vtitle, body.viewer > .vbar .vlogo { display: none; }
  body.viewer > .vbar > a.icon { position: fixed; z-index: 4; left: env(safe-area-inset-left); top: 0; width: 46px; height: 38px; padding: 0;
    display: grid; place-items: center; color: var(--ink); font-size: 1.6rem; }
  body.viewer > .vbar .vactions { flex-direction: column; gap: 4px; }
  body.viewer > .vbar .vact { padding: 7px; justify-content: center; }
  body.viewer > .vbar .vact > span, body.viewer > .vbar .vmenu summary > span { display: none; }
  body.viewer > .vbar .vmenu summary { padding: 0; }
  body.viewer > .vbar .vmenu-liste { top: 0; right: calc(100% + 8px); }
  body.viewer > .vbar #btnList { font-size: 0; padding: 7px 10px; }
  body.viewer > .vbar #btnList::before { content: '☰'; font-size: 1.1rem; }
  body.viewer > #stage { grid-column: 2; grid-row: 1; }
  body.viewer > .tools { grid-column: 1; grid-row: 1; padding-top: 40px; }
  #panel { top: auto; right: calc(50px + env(safe-area-inset-right)); }
  body.presente #panel { top: 0; bottom: 0; right: calc(50px + env(safe-area-inset-right)); }
  body.viewer.spectateur > #stage { grid-column: 1 / -1; grid-row: 1; }
  .titre-flottant { display: block; position: fixed; z-index: 4; top: max(6px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); max-width: 55vw; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; background: #1f2a2ecc; color: #fff; font-size: .75rem; font-weight: 600; padding: 4px 12px; border-radius: 999px;
    pointer-events: none; transition: opacity .6s; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
  .titre-flottant.fade { opacity: 0; }
  body.spectateur .titre-flottant { display: none; }
  #hint { top: 34px; }
}
/* v1.77 : colonne de gauche sombre comme celle de droite (sur iPhone, la marge de l'encoche faisait une grande bande blanche) */
@media (orientation: landscape) and (max-height: 540px) {
  body.viewer > .tools { background: var(--ink, #1f2a2e); border-right: 0; }
  body.viewer > .tools button { color: #fff; }
  body.viewer > .tools button[aria-pressed=true] { color: var(--accent); }
  body.viewer > .vbar > a.icon { color: #fff; }
}
/* témoin de préparation de la 📷 Photo (v1.81) : même carte que #temoin */
#photoTemoin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none;
  background: var(--bg, #fff); color: var(--ink, #1f2a2e); border-radius: 14px; box-shadow: 0 6px 30px #0003; padding: 18px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(340px, calc(100% - 32px)); text-align: center; }
#photoTemoin[hidden] { display: none; }
#photoTemoin p { margin: 0; font-size: .95rem; }
#photoTemoin small { color: var(--muted, #6b7378); font-size: .78rem; line-height: 1.3; }
#photoTemoin .barre { width: 100%; height: 6px; border-radius: 3px; background: var(--line, #e3e6e8); overflow: hidden; }
#photoTemoin .barre i { display: block; height: 100%; width: 0; background: var(--accent, #ff5a00); border-radius: 3px; transition: width .3s linear; }

/* v1.87 — 📸 Photos HD du chantier : cadre du format, points de vue, série, galerie */
/* v2.43 : Photo HD posée sur la 3D (photo-vue.js) — sous le cadre, sans capter les touchers */
#photoVue { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; opacity: 0; }
#photoVue[hidden] { display: none; }
#panelBody .hdPhoto3d { display: flex; gap: 8px; align-items: baseline; font-size: .9rem; margin: .2em 0 .8em; cursor: pointer; }
#panelBody .hdPhoto3d small { color: var(--ink2); }
#panelBody .hdPhoto3d.hdSous { margin-left: 24px; margin-top: -.5em; }
#photoVue.visible { opacity: 1; }
#photoVue img { position: absolute; display: block; max-width: none; object-fit: fill; box-shadow: 0 0 0 1px #0002; }
#photoVue .pv-tag { position: absolute; padding: 4px 10px; border-radius: 999px; background: #1f2a2ecc; color: #fff; font-size: .8rem; white-space: nowrap;
  opacity: 0; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
#photoVue .pv-tag small { opacity: .8; font-size: .75rem; }
#photoVue.etiq.visible .pv-tag { animation: pvtag 4.5s ease .4s both; }
@keyframes pvtag { 0% { opacity: 0; } 12% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
#hdCadre { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }
#hdCadre[hidden] { display: none; }
#hdCadre i { position: absolute; box-shadow: 0 0 0 4000px #0007; outline: 2px dashed #fffc; outline-offset: -1px; border-radius: 2px; }
/* v2.04 : cadre de composition 16:9 (mode concepteur) — plus discret que celui de la Photo HD */
#hdCadre.compo i { box-shadow: 0 0 0 4000px #1f2a2e2e; outline: 1px solid #ffffffb3; border-radius: 0; }
#panelBody .hdInfo { color: var(--ink2); font-size: .9rem; margin: .3em 0 .8em; }
#panelBody .hdInfo .ok { color: #2e7d32; }
#panelBody .hdInfo .ko { color: #c62828; }
/* v2.21 : machine de calcul (onglet Rendu, panneau Photos HD) */
.calculSur { margin: .2em 0 1em; }
.calculSur .cs-lib { display: block; font-size: .82rem; color: var(--ink2); margin-bottom: .35em; }
.calculSur .cs-choix { display: flex; gap: 6px; flex-wrap: wrap; }
.calculSur .cs-choix button { flex: 1 1 140px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 6px; text-align: left;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; padding: 7px 10px; font: inherit; cursor: pointer; }
.calculSur .cs-choix button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.calculSur .cs-choix small { grid-column: 2 / 4; font-weight: 400; font-size: .76rem; color: var(--ink2); }
.calculSur .cs-rond { color: var(--accent); }
.calculSur .cs-t { width: 9px; height: 9px; border-radius: 50%; background: #9aa3a8; }
.calculSur .cs-t.ok { background: #2e7d32; }
.calculSur .cs-t.ko { background: #c62828; }
.calculSur .cs-t.occupe { background: var(--accent); animation: csPulse 1.2s ease-in-out infinite; }
@keyframes csPulse { 50% { opacity: .35; } }
.calculSur .cs-alerte { margin: .6em 0 0; padding: 8px 10px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: .88rem; }
.calculSur .cs-alerte .pill { margin-left: 4px; }
#panelBody h3 { font-size: 1rem; margin: 1.1em 0 .4em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#panelBody h3 small { font-weight: 400; color: var(--ink2); }
#panelBody h3 .pill { margin-left: auto; font-size: .85rem; text-decoration: none; }
.hdFormat { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 0 0 .8em; }
.hdFormat span { font-size: .9rem; color: var(--ink2); margin-right: 2px; }
.hdFormat button { border: 1px solid var(--line); background: var(--card); color: inherit; border-radius: 14px; padding: 4px 10px; font: inherit; font-size: .85rem; cursor: pointer; }
.hdFormat button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
/* v1.94 : ☀ soleil de la Photo HD */
.hdSoleil .hdFormat { margin-bottom: .4em; }
.hdSoleil .solTexte { margin: 0 0 .5em; }
.solReg { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 0 0 .8em; }
.solReg[hidden] { display: none; }
.solCadran { width: 150px; height: 150px; flex: none; touch-action: none; cursor: grab; user-select: none; }
.solCadran:active { cursor: grabbing; }
.solAnneau { fill: color-mix(in srgb, var(--accent) 6%, transparent); stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 3 4; }
.solPiece { fill: var(--card); stroke: var(--ink2); stroke-width: 1.5; }
.solVous { fill: var(--ink2); }
.solRepere { font-size: 10px; fill: var(--ink2); text-anchor: middle; }
.solRayon { stroke: #f2a93b; stroke-width: 2; stroke-dasharray: 4 3; }
.solPt { fill: #ffc23d; stroke: #e08a00; stroke-width: 2; filter: drop-shadow(0 0 4px rgba(255, 180, 40, .8)); }
.solReg { flex-wrap: nowrap; gap: 10px; }
/* v1.94 (Arnaud) : curseur de hauteur vertical à côté du cadran, haut = soleil haut */
.solHaut { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 92px; flex: none; font-size: .85rem; text-align: center; }
.solHaut span { color: var(--ink2); }
.solHaut input { writing-mode: vertical-lr; direction: rtl; width: 28px; height: 104px; margin: 2px 0; cursor: pointer; }
.solHaut small { color: var(--ink2); line-height: 1.2; }
#panelBody .pill.prim { background: var(--accent); color: #fff; border-color: var(--accent); }
#panelBody .pill:disabled { opacity: .45; cursor: default; }
.hdVues { list-style: none; margin: 0 0 .6em; padding: 0; }
.hdVues li { display: flex; align-items: center; gap: 6px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.hdVues label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hdVues li > span { flex: 1; }
.hdVues .tag { font-size: .7rem; background: #e8eef5; color: #35506e; border-radius: 6px; padding: 1px 5px; font-weight: 600; }
.hdVues select { font: inherit; font-size: .8rem; max-width: 92px; }
.hdVues button { border: 0; background: none; cursor: pointer; font-size: 1rem; padding: 4px; }
.hdVues button.remettre { font-size: .85rem; color: var(--accent); }
/* v2.37 : tri des points de vue (poignée ⠿) et vue d'ouverture (★) */
.hdVues li > span.poignee { flex: none; }
/* v2.40 : clic sur la ligne = afficher la vue ; ligne de la vue affichée en orange ; panneau étroit : les
   réglages passent sous le nom au lieu de l'écraser */
#hdListe li { cursor: pointer; flex-wrap: wrap; row-gap: 2px; border-radius: 6px; }
#hdListe li:hover { background: #0000000a; }
#hdListe li.courante { background: var(--accent-soft, #fff1e6); }
#hdListe li.courante .vnom { cursor: text; border-bottom-color: var(--ink2); }
#hdListe .lbl { flex: 1 1 150px; }
#hdListe .vnom { cursor: pointer; }
.hdVues .poignee { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; color: var(--ink2); font-size: 1.15rem; padding: 4px 2px; line-height: 1; }
.hdVues li.glisse { background: var(--accent-soft, #fff1e6); box-shadow: 0 2px 10px #0002; border-radius: 8px; position: relative; z-index: 2; }
.hdVues li.glisse .poignee { cursor: grabbing; color: var(--accent); }
.hdVues .lbl { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hdVues .vnom { cursor: text; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px dashed transparent; }
.hdVues .vnomEdit { flex: 1; min-width: 0; font: inherit; padding: 2px 6px; border: 1px solid var(--accent); border-radius: 6px; }
.hdVues button.effacer { font-size: .95rem; }
.hdVues .tag.auto { background: #eef3e8; color: #4b6a2d; }
.hdVues button.vdefaut { color: var(--ink2); }
.hdVues button.vdefaut[aria-pressed="true"] { color: var(--accent); }
.vmenu-haut-liste .etoile { color: var(--accent); }
.hdGalerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.hdGalerie figure { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f5f5f3; }
.hdGalerie img { display: block; width: 100%; aspect-ratio: 1.414; object-fit: cover; }
.hdGalerie .etat { aspect-ratio: 1.414; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .85rem; color: var(--ink2); text-align: center; padding: 4px; }
.hdGalerie figure.erreur .etat { color: #c62828; }
.hdGalerie figcaption { display: flex; align-items: center; gap: 4px; font-size: .8rem; padding: 4px 6px; }
.hdGalerie figcaption a.dl { margin-left: auto; text-decoration: none; }
.hdGalerie figcaption button { border: 0; background: none; cursor: pointer; padding: 0 2px; }
.hdGalerie figcaption button:only-of-type { margin-left: auto; }
/* réglage de la lumière précalculée (admin, v1.98–1.99) */
#rlOuvrir { position: absolute; left: 12px; bottom: 76px; z-index: 5; width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: #1f2a2ecc; color: #ffd27a; font-size: 1.2rem; cursor: pointer; }
#rlOuvrir[hidden] { display: none; }
#rlOuvrir { display: none; }   /* v2.20 : réglages dans l'onglet « Rendu » du panneau (bouton gardé comme cible) */
#reglageLumiere.dans-panneau { position: static; width: auto; background: transparent; color: inherit; padding: 0; font-size: .9rem; gap: 8px; }
#reglageLumiere.dans-panneau .rl-titre button { display: none; }
#reglageLumiere.dans-panneau button { background: #1f2a2e14; color: inherit; padding: 6px 10px; }
#reglageLumiere.dans-panneau .rl-modes button[aria-pressed="true"], #reglageLumiere.dans-panneau .rl-boutons .principal { background: #e8a33d; color: #1f2a2e; }
.rl-hors-photo { background: #fff4df; border-radius: 8px; padding: 8px 10px; font-size: .88rem; }
/* v2.20 : menu des styles du bouton Rendu */
#styleMenu { position: fixed; z-index: 60; background: #fff; color: #1f2a2e; border-radius: 12px; box-shadow: 0 8px 28px #0003; padding: 6px; min-width: 230px; }
#styleMenu[hidden] { display: none; }
#styleMenu button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; font: inherit; cursor: pointer; color: inherit; }
#styleMenu button:hover { background: #f1ede6; }
#styleMenu .coche { width: 14px; color: #e8a33d; font-weight: 700; }
#styleMenu .lib { display: flex; flex-direction: column; }
#styleMenu small { opacity: .65; font-size: .78rem; }
#styleMenu hr { border: 0; border-top: 1px solid #0001; margin: 4px 6px; }
#rlOuvrir.on { background: #ffd27a; color: #1f2a2e; }
#reglageLumiere { position: absolute; left: 12px; bottom: 122px; z-index: 5; background: #1f2a2ee6; color: #fff; padding: 10px 12px; border-radius: 12px;
  font-size: .82rem; display: flex; flex-direction: column; gap: 6px; width: 260px; }
#reglageLumiere[hidden] { display: none; }
#reglageLumiere .rl-titre { display: flex; justify-content: space-between; align-items: center; }
#reglageLumiere label { display: grid; grid-template-columns: 92px 1fr 34px; align-items: center; gap: 6px; }
#reglageLumiere label.rl-actif { display: flex; gap: 8px; cursor: pointer; }
#reglageLumiere input[type=range]:disabled { opacity: .35; }
#reglageLumiere #rlDefTous { flex: 1; }
#reglageLumiere .rl-modes { display: flex; gap: 4px; }
#reglageLumiere .rl-modes button { flex: 1; }
#reglageLumiere .rl-modes button[aria-pressed="true"] { background: #e8a33d; color: #1f2a2e; font-weight: 600; }
#reglageLumiere label[hidden] { display: none; }
#reglageLumiere span { text-align: right; font-variant-numeric: tabular-nums; }
#reglageLumiere small { opacity: .75; }
#reglageLumiere .rl-boutons { display: flex; gap: 6px; }
#reglageLumiere button { border: 0; background: #ffffff22; color: #fff; border-radius: 8px; padding: 4px 8px; font: inherit; cursor: pointer; }
#reglageLumiere .rl-boutons .principal { flex: 1; background: #e8a33d; color: #1f2a2e; font-weight: 600; }
#reglageLumiere button:disabled { opacity: .45; cursor: default; }
#reglageLumiere #rlCalcul { display: flex; align-items: center; gap: 6px; justify-content: space-between; font-size: .78rem; }
#reglageLumiere #rlCurseurs { display: flex; flex-direction: column; gap: 6px; }
#reglageLumiere [hidden] { display: none !important; }
#rlOuvrir.calcul { animation: rlPulse 1.6s ease-in-out infinite; }
@keyframes rlPulse { 50% { box-shadow: 0 0 0 6px #ffd27a55; } }

/* lot P (v2.02) : menu de la caméra à niveau (bouton ⊥) */
#niveauMenu { position: fixed; z-index: 30; background: #1f2a2ef2; color: #fff; border-radius: 14px; padding: 8px; width: 250px;
  box-shadow: 0 6px 24px #0005; display: grid; gap: 2px; font-size: .92rem; }
#niveauMenu[hidden] { display: none; }
#niveauMenu .nm-titre { font-size: .78rem; opacity: .7; padding: 2px 8px 4px; }
#niveauMenu button { border: 0; background: none; color: #fff; font: inherit; text-align: left; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
#niveauMenu button:hover:not(:disabled), #niveauMenu button:active:not(:disabled) { background: #ffffff1f; }
#niveauMenu button:disabled { opacity: .45; cursor: default; }
/* v2.68 : menu du bouton Murs (objets accrochés), même allure que celui de la caméra à niveau */
#mursMenu { position: fixed; z-index: 30; background: #1f2a2ef2; color: #fff; border-radius: 14px; padding: 8px; width: 270px;
  box-shadow: 0 6px 24px #0005; display: grid; gap: 2px; font-size: .92rem; }
#mursMenu[hidden] { display: none; }
#mursMenu .nm-titre { font-size: .78rem; opacity: .7; padding: 2px 8px 4px; }
#mursMenu button { border: 0; background: none; color: #fff; font: inherit; text-align: left; padding: 8px 10px; border-radius: 10px; cursor: pointer;
  display: grid; grid-template-columns: 18px 1fr; column-gap: 6px; align-items: start; }
#mursMenu button:hover, #mursMenu button:active { background: #ffffff1f; }
#mursMenu button small { display: block; font-size: .74rem; opacity: .7; line-height: 1.25; }
#mursMenu .coche { color: #ff8a3d; font-weight: 700; }
#niveauMenu .nm-aimant { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
#niveauMenu .nm-aimant small { grid-column: 2; font-size: .74rem; opacity: .7; line-height: 1.25; }
#niveauMenu .nm-aimant input { width: 18px; height: 18px; accent-color: #ff5a00; margin: 0; }

/* ---------- v2.03 (lot O, étape 2) : « mode concepteur » sur ordinateur et tablette en paysage
   Barre du haut avec menus classiques (Fichier, Affichage, Outils, Présentation, Aide — assets/menus.js),
   outils en colonne sombre à gauche, panneau à droite (inchangé). Téléphone : inchangé. */
.vmenus { display: none; }
@media (min-width: 1024px) and (min-height: 600px) {
  body.viewer { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  body.viewer.apercu { grid-template-rows: auto auto minmax(0, 1fr); }
  body.viewer > .apercu-bandeau { grid-column: 1 / -1; grid-row: 1; }
  body.viewer > .vbar { grid-column: 1 / -1; grid-row: 1; padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: 6px; z-index: 20; }
  body.viewer.apercu > .vbar { grid-row: 2; }
  body.viewer > #stage { grid-column: 2; grid-row: 2; }
  body.viewer > .tools { grid-column: 1; grid-row: 2; }
  body.viewer.apercu > #stage, body.viewer.apercu > .tools { grid-row: 3; }
  body.viewer:has(#panel:not([hidden])) .tools { margin-right: 0; }

  /* barre du haut : ‹  menus  titre  actions  Articles */
  .vmenus { display: flex; align-items: center; gap: 2px; flex: none; padding-right: 8px; margin-right: 2px; border-right: 1px solid #ffffff22; }
  .vmenu-haut { position: relative; }
  .vmenu-haut summary { list-style: none; cursor: pointer; padding: 6px 10px; border-radius: 6px; font-size: .9rem; color: #fff; user-select: none; }
  .vmenu-haut summary::-webkit-details-marker { display: none; }
  .vmenu-haut summary:hover, .vmenu-haut[open] summary { background: #ffffff1f; }
  .vmenu-haut-liste { position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; min-width: 270px; padding: 6px; background: #fff; white-space: nowrap; color: var(--ink);
    border-radius: 10px; box-shadow: 0 10px 30px #0003; display: grid; }
  .vmenu-haut-liste button { display: grid; grid-template-columns: 1.2em 1fr auto; align-items: center; gap: 6px; border: 0; background: none; font: inherit;
    font-size: .9rem; text-align: left; padding: 7px 10px; border-radius: 6px; color: var(--ink); cursor: pointer; }
  .vmenu-haut-liste button:hover, .vmenu-haut-liste button:focus-visible { background: var(--accent-soft); outline: none; }
  .vmenu-haut-liste .coche { color: var(--accent); font-weight: 700; }
  .vmenu-haut-liste kbd { font: inherit; font-size: .78rem; color: var(--ink2); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; min-width: 1.4em; text-align: center; }
  .vmenu-haut-liste kbd:empty { display: none; }
  .vmenu-haut-liste hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }
  .vmenu-haut-liste .vide { padding: 8px 10px; color: var(--ink2); font-size: .85rem; }

  /* outils : colonne sombre à gauche, icône + libellé court */
  body.viewer > .tools { flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 2px; width: calc(70px + env(safe-area-inset-left));
    padding: 8px 6px calc(8px + var(--safe-b)) calc(6px + env(safe-area-inset-left)); background: var(--ink); border-top: 0; overflow-y: auto; }
  body.viewer > .tools button { flex: none; color: #fff; padding: 8px 2px 6px; border-radius: 10px; font-size: 1.2rem; }
  body.viewer > .tools button span { color: #ffffffb3; font-size: .66rem; }
  body.viewer > .tools button:hover { background: #ffffff14; }
  body.viewer > .tools button[aria-pressed=true] { background: var(--accent); color: #fff; }
  body.viewer > .tools button[aria-pressed=true] span { color: #fff; }
  body.viewer > .tools button[hidden] { display: none; }

  /* ce qui se calait au-dessus de l'ancienne barre du bas */
  #presEtiq { bottom: 12px; }
}
#vmenusAide { border: 0; border-radius: 14px; padding: 18px 22px; box-shadow: 0 20px 60px #0005; }
#vmenusAide pre { font: .9rem/1.6 ui-monospace, Menlo, Consolas, monospace; margin: 0 0 12px; }
#vmenusAide button { font: inherit; border: 0; background: var(--ink); color: #fff; border-radius: 8px; padding: 7px 14px; cursor: pointer; }

/* ---------- v2.06 (lot O, étape 4) : panneau de droite à onglets, largeur réglable (mode concepteur) */
#panelOnglets, #panelPoignee, #btnPanneau { display: none; }
@media (min-width: 1024px) and (min-height: 600px) {
  #panel { width: var(--panel-w, 400px); padding-top: 0; box-shadow: -1px 0 0 var(--line), -6px 0 24px #0001; }
  body.viewer:has(#panel:not([hidden])) #stage { margin-right: var(--panel-w, 400px); }
  #panelOnglets { display: flex; flex: none; gap: 2px; padding: 0 48px 0 8px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  #panelOnglets button { flex: none; border: 0; background: none; font: inherit; font-size: .85rem; font-weight: 600; color: var(--ink2); cursor: pointer;
    padding: 13px 9px 10px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
  #panelOnglets button:hover { color: var(--ink); }
  #panelOnglets button[aria-selected=true] { color: var(--accent); border-bottom-color: var(--accent); }
  #panel .close { top: 5px; box-shadow: none; background: transparent; }
  #panel .close:hover { background: #f1f3f4; }
  #panelBody { padding-top: 12px; }
  #panelPoignee { display: block; position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 4; touch-action: none; }
  #panelPoignee:hover, body.panneau-glisse #panelPoignee { background: linear-gradient(90deg, transparent 3px, var(--accent) 3px 5px, transparent 5px); }
  body.panneau-glisse { cursor: col-resize; user-select: none; }
  #btnPanneau { display: inline-flex; background: none; border: 0; padding: 7px 9px; box-shadow: none; }
  #btnPanneau[aria-pressed=true] { background: #ffffff22; }
}

/* ---------- v2.07 (lot O, étape 5) : barre du haut = chantier · menus · points de vue · boutons (mode concepteur) */
@media (min-width: 1024px) and (min-height: 600px) {
  .vbar > a.icon, .vbar > .vlogo { order: 0; }
  /* v2.29 : logo (lien client) et ‹ (admin) centrés sur l'axe de la colonne d'outils (70 px) ;
     le titre commence au bord de la 3D */
  body.viewer > .vbar { padding-left: 10px; }
  body.viewer > .vbar > .vlogo { margin: 0 calc(19px - 10px) 0 calc(19px - 10px + env(safe-area-inset-left)); width: 36px; height: 36px; }
  body.viewer > .vbar > a.icon { flex: none; width: calc(70px + env(safe-area-inset-left)); margin: 0 -10px; padding: 0 0 0 env(safe-area-inset-left);
    text-align: center; }
  .vbar > .vtitle { order: 1; flex: 0 1 auto; max-width: 300px; }
  .vbar > .vmenus { order: 2; border-right: 0; border-left: 1px solid #ffffff22; padding: 0 0 0 8px; margin: 0 0 0 4px; }
  .vbar > #vuesBar { order: 3; }
  .vbar > .vactions { order: 4; margin-left: auto; }
  .vbar > #btnList { order: 5; }
  .vbar > #btnPanneau { order: 6; }
  .vbar > #vuesBar { position: relative; left: auto; bottom: auto; transform: none; max-width: none; flex: 0 1 auto; min-width: 0;
    margin-left: 4px; padding: 2px; border-radius: 9px; background: #ffffff12; box-shadow: none; z-index: auto; }
  .vbar > #vuesBar button { padding: 5px 10px; font-size: .85rem; border-radius: 7px; }
  .vbar > #vuesBar button:hover { background: #ffffff1a; }
  .vbar > #vuesBar #vuePrev, .vbar > #vuesBar #vueNext { padding: 3px 9px; font-size: 1.15rem; }
  .vbar > #vuesBar #vueNom { max-width: 280px; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .vbar > #vuesBar #vueNom::after { content: ' ▾'; opacity: .6; font-size: .75em; }
  .vbar > #vuesBar #btnVisite, .vbar > #vuesBar #btnDecor { border-radius: 7px; }
  #vuesListe { left: 0; max-height: min(60vh, 520px); overflow-y: auto; }
  #vuesListe[hidden] { display: none; }
  body:has(#presEtiq:not([hidden])) .vbar > #vuesBar { visibility: visible; }
  #decorMenu { bottom: auto; top: 10px; }
}
@media (min-width: 1024px) and (min-height: 600px) {
  .vbar > #vuesBar { flex: none; }
  .vbar > .vtitle { min-width: 90px; }
  .vbar > #vuesBar #vueNom { max-width: 220px; }
  .vbar > #vuesBar #vuesListe button { color: var(--ink); padding: 7px 10px; font-size: .9rem; border-radius: 6px; }
  .vbar > #vuesBar #vuesListe button:hover { background: var(--accent-soft); }
  .vbar > #btnList { display: none; }   /* l'onglet Articles du panneau, la touche A et ▥ le remplacent */
}
@media (min-width: 1024px) and (max-width: 1399px) and (min-height: 600px) {
  .vbar .vact > span, .vbar .vmenu summary > span { display: none; }   /* boutons de droite en icônes seules (nom au survol) */
}

/* ---------- v2.08 (lot O, étape 6) : palette Ctrl+K */
#btnPalette { display: none; }
#palette { width: min(600px, calc(100vw - 24px)); margin: 12vh auto auto; padding: 0; border: 0; border-radius: 14px; box-shadow: 0 20px 60px #0005; overflow: hidden; color: var(--ink); }
#palette::backdrop { background: #1f2a2e66; }
#palette input { width: 100%; box-sizing: border-box; border: 0; border-bottom: 1px solid var(--line); padding: 15px 18px; font: inherit; font-size: 1.05rem; outline: none; }
#palette .pal-liste { max-height: min(55vh, 460px); overflow-y: auto; padding: 6px; display: grid; }
#palette .pal-liste button { display: grid; grid-template-columns: 74px 1fr auto; align-items: center; gap: 10px; border: 0; background: none; font: inherit; font-size: .93rem;
  text-align: left; padding: 8px 10px; border-radius: 8px; color: var(--ink); cursor: pointer; }
#palette .pal-liste button[aria-selected=true] { background: var(--accent-soft); }
#palette .pal-liste .t { font-size: .74rem; color: var(--ink2); text-transform: uppercase; letter-spacing: .03em; }
#palette .pal-liste .l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#palette .pal-liste kbd { font: inherit; font-size: .76rem; color: var(--ink2); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#palette .vide { padding: 14px 10px; color: var(--ink2); }
#palette .pal-pied { border-top: 1px solid var(--line); padding: 7px 16px; font-size: .75rem; color: var(--ink2); }
@media (min-width: 1024px) and (min-height: 600px) {
  .vbar > #btnPalette { display: inline-flex; order: 4; margin-left: auto; box-shadow: none; background: #ffffff12; color: #ffffffcc; gap: 8px; padding: 6px 10px; }
  .vbar > #btnPalette:hover { background: #ffffff22; color: #fff; }
  .vbar > #btnPalette kbd { white-space: nowrap; font: inherit; font-size: .72rem; border: 1px solid #ffffff44; border-radius: 4px; padding: 0 5px; }
  .vbar > .vactions { order: 5; margin-left: 0; }
  .vbar > #btnList { order: 6; }
  .vbar > #btnPanneau { order: 7; }
}
@media (min-width: 1024px) and (max-width: 1599px) and (min-height: 600px) {
  .vbar > #btnPalette > span { display: none; }   /* loupe + raccourci seulement */
}
@media (min-width: 1024px) and (max-width: 1199px) and (min-height: 600px) {
  .vbar > #btnPalette kbd { display: none; }
  .vmenu-haut summary { padding: 6px 7px; }
  .vbar > .vtitle { max-width: 200px; }
  .vbar > #vuesBar #vueNom { max-width: 170px; }
}

/* ---------- v2.11 (lot O, étape 7) : téléphone en portrait — barre du bas sur deux lignes, « ⋯ Plus » */
.tools > .tel-seul, #plusFeuille { display: none; }
@media (orientation: portrait) and (max-width: 767px) {
  body.viewer > .tools { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); row-gap: 0; }
  body.viewer > .tools > button { padding: 7px 2px 5px; }
  body.viewer > .tools > button[hidden], body.viewer > .tools > button.en-plus { display: none; }
  body.viewer > .tools > .tel-seul:not([hidden]) { display: grid; }
  body.viewer > .tools > button span { font-size: .66rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .vbar > #btnList { display: none; }   /* descend dans la barre du bas */
  #panel { bottom: var(--tools-h, 110px); }
  #presEtiq { bottom: calc(var(--tools-h, 110px) + 10px); }
  #plusFeuille:not([hidden]) { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; position: fixed; z-index: 8; left: 0; right: 0;
    bottom: var(--tools-h, 110px); padding: 14px 12px; background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px #0003; }
  #plusFeuille button { border: 0; background: #f2f4f5; border-radius: 12px; min-height: 68px; display: grid; place-items: center; align-content: center; gap: 4px;
    font: inherit; color: var(--ink); cursor: pointer; padding: 6px 2px; }
  #plusFeuille button b { font-size: 1.25rem; font-weight: 400; line-height: 1; }
  #plusFeuille button span { font-size: .72rem; font-weight: 600; }
  #plusFeuille button[aria-pressed=true] { background: var(--accent-soft); color: var(--accent); }
}

/* ---------- v2.12 (lot O, étape 8) : icônes dessinées (trait, couleur du texte) au lieu des émojis */
svg.ic { width: 1.3em; height: 1.3em; display: block; flex: none; }
.tools button svg.ic { width: 1.45rem; height: 1.45rem; margin: 0 auto; }
.vact svg.ic, .vmenu summary svg.ic { width: 1.15rem; height: 1.15rem; display: inline-block; vertical-align: -3px; }
#plusFeuille button b svg.ic { width: 1.5rem; height: 1.5rem; }
@media (orientation: landscape) and (max-height: 540px) { body.viewer > .tools button svg.ic { width: 1.25rem; height: 1.25rem; } }

/* ---------- v2.13 (lot O, étape 9) : tablette en portrait (iPad 700 à 1023 px de large) — 3D en haut, outils en ligne,
   panneau à onglets rangé dessous (il ne recouvre plus la 3D ; la 3D se recadre quand il s'ouvre) */
@media (orientation: portrait) and (min-width: 700px) and (max-width: 1023px) {
  body.viewer { grid-template-rows: auto minmax(0, 1fr) auto auto; }
  body.viewer.apercu { grid-template-rows: auto auto minmax(0, 1fr) auto auto; }
  body.viewer > #panel { position: relative; left: auto; right: auto; top: auto; bottom: auto; width: auto; height: 44dvh; max-height: none;
    border-radius: 0; box-shadow: 0 -1px 0 var(--line); padding-top: 0; padding-bottom: var(--safe-b); z-index: 4; }
  body.viewer > #panel[hidden] { display: none; }
  body.viewer:has(#panel:not([hidden])) #stage, body.viewer:has(#panel:not([hidden])) .tools { margin-right: 0; }
  body.viewer:has(#panel:not([hidden])) > .tools { padding-bottom: 0; }
  #panel .grab { display: none; }
  #panelOnglets { display: flex; flex: none; gap: 2px; padding: 0 52px 0 10px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  #panelOnglets button { flex: none; border: 0; background: none; font: inherit; font-size: .9rem; font-weight: 600; color: var(--ink2); cursor: pointer;
    padding: 13px 10px 11px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
  #panelOnglets button[aria-selected=true] { color: var(--accent); border-bottom-color: var(--accent); }
  #panel .close { top: 5px; box-shadow: none; background: transparent; }
  #panelBody { padding-top: 12px; }
  #presEtiq { bottom: calc(var(--tools-h, 60px) + 12px); }
}

/* ---------- v2.14 (lot O) : épingler le panneau de droite (📌) */
#btnEpingle { display: none; }
@media (min-width: 1024px) and (min-height: 600px), (orientation: portrait) and (min-width: 700px) and (max-width: 1023px) {
  #btnEpingle { display: grid; place-items: center; position: absolute; top: 5px; right: 46px; z-index: 3; width: 36px; height: 36px; border: 0; border-radius: 50%;
    background: transparent; color: var(--ink2); cursor: pointer; }
  #btnEpingle:hover { background: #f1f3f4; }
  #btnEpingle svg.ic { width: 18px; height: 18px; transform: rotate(30deg); transition: transform .15s; }
  #btnEpingle[aria-pressed=true] { color: var(--accent); right: 8px; }
  #btnEpingle[aria-pressed=true] svg.ic { transform: none; fill: var(--accent-soft); }
  body.panneau-epingle #panel .close { display: none; }
  #panelOnglets { padding-right: 88px; }
}

/* ---------- v2.15 (lot O) : double écran — fenêtre « Écran client » : la 3D seule, plein cadre */
body.viewer.ecran-client { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); background: #000; }
body.ecran-client > .vbar, body.ecran-client > .tools, body.ecran-client > .apercu-bandeau, body.ecran-client #panel, body.ecran-client #rlOuvrir,
body.ecran-client #hint, body.ecran-client .titre-flottant, body.ecran-client #vuesBar, body.ecran-client #planBar, body.ecran-client #elevBar,
body.ecran-client #coupeBar, body.ecran-client #measureInfo, body.ecran-client #presEtiq, body.ecran-client #plusFeuille, body.ecran-client #hdCadre { display: none !important; }
body.viewer.ecran-client > #stage { grid-row: 1 / -1; grid-column: 1 / -1; margin: 0 !important; }
.ecran-plein { position: fixed; z-index: 30; right: 16px; bottom: 16px; border: 0; border-radius: 999px; padding: 9px 16px; background: #1f2a2ecc; color: #fff;
  font: inherit; font-size: .9rem; cursor: pointer; transition: opacity .6s; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.ecran-plein.fade { opacity: 0; pointer-events: none; }
.ecran-attente { position: fixed; z-index: 30; left: 50%; top: 16px; transform: translateX(-50%); background: #1f2a2ecc; color: #fff; border-radius: 999px;
  padding: 6px 14px; font-size: .85rem; }
.ecran-attente[hidden] { display: none; }

/* v2.23 : pictogrammes d'appareils, icônes au trait de la couleur du texte */
.picto { width: 1.15em; height: 1.15em; vertical-align: -0.22em; fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.doclist .ico .picto { width: 1.3em; height: 1.3em; }
.arts .what .picto { margin-right: .3em; opacity: .85; }
/* v2.27 : référence cliquable vers la page du fabricant */
.ref-lien { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.ref-lien .picto { width: .95em; height: .95em; margin-left: .25em; vertical-align: -.12em; opacity: .7; }

/* v2.31 : bouton Casque bien visible (navigateur du casque seulement) */
.tools #btnCasque { background: #ff5a00; color: #fff; border-radius: 10px; }
.tools #btnCasque span { color: #fff; font-weight: 700; }
body.viewer > .tools #btnCasque { min-height: 44px; font-size: 1.4rem; margin: 2px 0; }
#btnCasqueGros { position: fixed; z-index: 6; left: 50%; bottom: calc(24px + var(--safe-b, 0px)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; border: 0; border-radius: 999px; padding: 16px 30px 16px 24px; cursor: pointer;
  background: #ff5a00; color: #fff; font: 700 1.35rem/1 system-ui, sans-serif; box-shadow: 0 6px 24px #0006; }
#btnCasqueGros svg { width: 38px; height: 38px; }
#btnCasqueGros:hover { background: #ff7326; }
#btnCasqueGros:active { transform: translateX(-50%) scale(.97); }
#btnCasqueGros[hidden] { display: none; }

/* v2.34 : vitrine (« Partager ma cuisine ») et fenêtre de partage du client */
.vitrine-cta { background: var(--accent); color: #fff !important; border-color: var(--accent); text-decoration: none; white-space: nowrap; }
#partageDlg { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
#partageDlg[hidden] { display: none; }
.pdlg { position: relative; background: var(--card, #fff); color: var(--ink); border-radius: 14px; padding: 18px 18px 12px; width: min(460px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.pdlg h2 { margin: 0 0 .3em; font-size: 1.15rem; }
.pdlg h3 { font-size: .95rem; margin: 1em 0 .4em; }
.pdlg-x { position: absolute; top: 8px; right: 8px; border: 0; background: none; font-size: 1.1rem; cursor: pointer; color: var(--ink2); }
.pdlg-form { display: flex; gap: 8px; margin: .6em 0; }
.pdlg-form input { flex: 1; min-width: 0; padding: .5em .7em; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.pdlg input[readonly] { width: 100%; padding: .4em .6em; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: .85rem; box-sizing: border-box; }
.pdlg .primaire { background: var(--accent); color: #fff; border-color: var(--accent); }
.pdlg .err { color: #b3261e; }
.pliste { list-style: none; margin: 0; padding: 0; }
.pliste li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: .45em 0; border-bottom: 1px solid var(--line); }
.pliste li b { flex: 1; }
/* v2.34 : boutons du lien client / vitrine à droite de la barre, compacts sur téléphone */
.vbar > #btnPartager, .vbar > #btnImagePartage, .vbar > .vitrine-cta { order: 5; flex: none; }
.vbar > #btnPartager, .vbar > #btnImagePartage { margin-left: auto; }
.vbar > .vitrine-cta { margin-left: 0; }
.vbar > #btnImagePartage + .vitrine-cta { margin-left: 0; }
.vbar > #btnPartager ~ #btnPanneau, .vbar > .vitrine-cta ~ #btnPanneau { margin-left: 0; }
@media (max-width: 600px) {
  .vbar > #btnPartager, .vbar > #btnImagePartage, .vbar > .vitrine-cta { padding: .4em .7em; font-size: .85rem; }
  .vbar > #btnImagePartage { font-size: 0; }
  .vbar > #btnImagePartage::before { content: '🖼'; font-size: 1rem; }
}
/* v2.35 : onglet Dossier en cascade — la rubrique glisse depuis la droite, « ‹ Dossier » revient */
.dvue.glisse-g { animation: dGlisseG .22s ease-out; }
.dvue.glisse-d { animation: dGlisseD .22s ease-out; }
@keyframes dGlisseG { from { transform: translateX(45%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes dGlisseD { from { transform: translateX(-45%); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dvue.glisse-g, .dvue.glisse-d { animation: none; } }
.dretour { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; padding: .2em 0; margin: 0 0 .2em; cursor: pointer; }
#panelBody:has(.dvue) { overflow-x: hidden; }
/* v2.38 : QR code du lien partagé */
.pqr { width: 170px; margin: .2em auto .6em; }
.pqr[hidden] { display: none; }
.pqr svg { width: 100%; height: auto; display: block; }

/* ---------- v2.48 (lot R) : retouches du mode concepteur — déplacer, tourner, retirer, frise « Time Machine » */
#retBandeau { position: fixed; z-index: 25; bottom: calc(var(--safe-b, 0px) + 18px); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: .6em; padding: .35em .9em; border-radius: 999px; background: #2d3b41ee; color: #fff;
  font-size: .85rem; cursor: pointer; box-shadow: 0 2px 10px #0003; white-space: nowrap; max-width: 92vw; }
#retBandeau span { overflow: hidden; text-overflow: ellipsis; }
#retBandeau.apercu { background: #6b3fa0ee; cursor: default; }
#retBandeau.deplacer { background: #c8642bee; cursor: default; }
#retBandeau button { font: inherit; font-weight: 600; background: #ffffff22; color: #fff; border: 0; border-radius: 999px; padding: .2em .8em; cursor: pointer; }
#retBandeau button:hover { background: #ffffff44; }
#retEtiq { position: fixed; z-index: 30; pointer-events: none; padding: .3em .6em; border-radius: 6px; background: #1f2a2eee; color: #fff;
  font-size: .8rem; white-space: nowrap; }
#retEtiq b { color: #ff8a80; }
body.ret-deplacer #c { cursor: move; }
.ret-fiche { display: flex; flex-wrap: wrap; gap: .4em; margin: .8em 0 .3em; }
.ret-fiche kbd, .ret-actions kbd { font: inherit; font-size: .7em; opacity: .6; margin-left: .2em; }
.ret-note { margin-top: .8em; }
#panelBody .ret-capt { display: flex; gap: .4em; margin: .4em 0; }
#panelBody .ret-capt input { flex: 1; min-width: 0; padding: .45em .7em; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
#retFrise { width: 100%; accent-color: #6b3fa0; }
#panelBody .ret-objets, #panelBody .ret-histo, #panelBody .ret-capts { list-style: none; margin: .3em 0; padding: 0; }
#panelBody .ret-objets li, #panelBody .ret-capts li { padding: .25em 0; border-bottom: 1px solid var(--line); }
#panelBody .ret-objets li.orpheline { color: var(--warn); }
#panelBody .ret-histo { max-height: 40vh; overflow: auto; font-size: .85rem; }
#panelBody .ret-histo li { padding: .3em .4em; border-radius: 6px; cursor: pointer; }
#panelBody .ret-histo li:hover { background: var(--bg); }
#panelBody .ret-histo li.actif { background: #efe6fa; }
#panelBody .ret-histo li.capt { font-weight: 600; }
#panelBody .ret-histo time { color: var(--ink2); margin-right: .4em; font-variant-numeric: tabular-nums; }
#panelBody button.lien { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; cursor: pointer; font: inherit; }
#panelBody .pill.mini { padding: .1em .6em; font-size: .8rem; }
#retBandeau.remis { background: #2e7d4fee; }
#panelBody .ret-remises { list-style: none; margin: .3em 0; padding: 0; }
#panelBody .ret-remises li { padding: .35em 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: .35em; }
#panelBody .ret-remises li.annulee strong { text-decoration: line-through; color: var(--ink2); }
#panelBody .ret-remises .ok { color: #2e7d4f; font-weight: 600; }
#panelBody .ret-rem-act { margin-left: auto; display: flex; gap: .3em; }

#temoin .temoin-marque { font-weight: 700; letter-spacing: .02em; color: var(--ink); }   /* v2.53 */
#contactDlg { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
#contactDlg[hidden] { display: none; }
.ccarte { width: min(380px, 100%); text-align: center; }
.ccarte h2 { margin: .1em 0 0; }
.ccarte .cnom { margin: 0 0 .8em; color: var(--ink2); }
.ccarte .cboutons { display: grid; gap: 8px; }
.ccarte .pill { justify-content: center; }
.ccarte .cqr { display: grid; justify-items: center; gap: 6px; margin-top: .6em; }
.ccarte #cQr { width: 180px; }
.ccarte #cQr svg { display: block; width: 100%; height: auto; }
@media (pointer: coarse) and (max-width: 900px) { .ccarte .cqr { display: none; } }   /* sur téléphone : le bouton suffit */
@media (min-width: 1024px) and (min-height: 600px) { .tools > #btnContact { margin-top: auto; } }   /* v2.53 : en bas de la colonne d’outils */

/* v2.57 — barre de sélection (sélection multiple, objets masqués) et cadre de sélection */
#barreSel { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 4px;
  background: #1f2a2ef0; color: #fff; border-radius: 12px; padding: 4px 6px; box-shadow: 0 4px 16px #0004; max-width: calc(100% - 16px); flex-wrap: wrap; justify-content: center; }
#barreSel .bs-n { padding: 0 8px; font-size: 13px; opacity: .9; white-space: nowrap; }
#barreSel button { display: inline-flex; align-items: center; gap: 6px; background: transparent; color: inherit; border: 0; border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 13px; cursor: pointer; }
#barreSel button:hover { background: #ffffff1f; }
#barreSel button[aria-pressed="true"] { background: #e8743b; }
#barreSel .ic { width: 18px; height: 18px; }
#barreSel .bs-x { font-size: 18px; line-height: 1; padding: 4px 10px; }
#cadreSel { position: absolute; z-index: 7; border: 1.5px solid #ff5a00; background: #ff5a0022; pointer-events: none; }
.arts button.choisi { background: #ff5a0026; outline: 1.5px solid #ff5a00; }

/* ---------- accueil v2.61 : même squelette que la visionneuse (barre sombre + menus, colonne d'outils,
   liste au centre, panneau d'infos à droite). Comportement : assets/accueil.js */
body.accueil { position: fixed; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
  background: #eef0f1; overflow: hidden; }
.accueil .ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.accueil .vbar { grid-column: 1 / -1; grid-row: 1; flex-wrap: wrap; row-gap: 8px; }
.accueil .vbar .vlogo { width: 30px; height: 30px; flex: none; }
.accueil .vbar .vtitle { flex: 1 1 auto; }
.accueil .vact span { font-size: .8rem; }
.accueil .vmenu > summary { padding: 0; display: inline-flex; align-items: center; gap: .35em; }
.accueil .vmenu-liste a { display: block; padding: 10px 14px; color: var(--ink); text-decoration: none; font-size: .9rem; }
.accueil .vmenu-liste a:hover { background: var(--accent-soft); }
.accueil .vmenu-haut-liste a { display: grid; grid-template-columns: 1.2em 1fr auto; align-items: center; gap: 6px; font-size: .9rem; padding: 7px 10px;
  border-radius: 6px; color: var(--ink); text-decoration: none; }
.accueil .vmenu-haut-liste a:hover { background: var(--accent-soft); }
.acc-recherche { order: 10; flex: 1 1 100%; position: relative; display: flex; align-items: center; }
.acc-recherche .ic { position: absolute; left: 11px; color: #ffffffa0; pointer-events: none; }
.acc-recherche input { width: 100%; border: 0; border-radius: 9px; background: #ffffff1a; color: #fff; padding: 8px 12px 8px 36px; font-size: .95rem; outline: none; }
.acc-recherche input::placeholder { color: #ffffff99; }
.acc-recherche input:focus { background: #fff; color: var(--ink); }
.acc-recherche:focus-within .ic { color: var(--ink2); }
.acc-recherche kbd { display: none; }
#btnPanneau { display: none; }

/* colonne d'outils : barre du bas sur téléphone (deux lignes de 5, comme la visionneuse en portrait) */
.accueil > .tools { grid-row: 3; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: #fff; border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b); z-index: 4; }
.accueil:not(.admin) > .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.accueil > .tools .tools-ressort { display: none; }
.accueil > .tools button { position: relative; padding: 7px 2px 5px; }
.accueil > .tools button span { font-size: .66rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.accueil > .tools .badge { position: absolute; top: 2px; left: calc(50% + 7px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--warn); color: #fff; font-size: .66rem; font-weight: 700; line-height: 16px; text-align: center; }
.accueil > .tools .badge.gris { background: #8a959c; }
.accueil > .tools button[aria-pressed=true] .badge.gris { background: var(--accent); }

/* liste au centre */
.acc-centre { grid-row: 2; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 12px 24px; }
.acc-entete { display: flex; align-items: baseline; gap: 10px; margin: 2px 4px 10px; }
.acc-entete h1 { font-size: 1.15rem; margin: 0; }
.acc-entete span { color: var(--ink2); font-size: .85rem; }
.acc-liste { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--r); box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.acc-dos { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; border-top: 1px solid var(--line); }
.acc-dos:first-child { border-top: 0; }
.acc-ligne { display: grid; grid-template-columns: 2.8em minmax(0, 1fr) auto; grid-template-areas: "num nom etat" "num when proch"; align-items: center;
  column-gap: .7em; row-gap: 2px; padding: 10px 6px 10px 12px; text-decoration: none; color: inherit; min-width: 0; user-select: none; -webkit-user-select: none; }
.acc-ligne:hover { background: #f6f8f9; }
.acc-dos.sel > .acc-ligne { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.acc-ligne .num { grid-area: num; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; align-self: start; padding-top: 1px; }
.acc-ligne .nom { grid-area: nom; min-width: 0; }
.acc-ligne .nom strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-ligne .nom small { display: block; color: var(--ink2); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-ligne .nbopt { color: var(--accent); font-weight: 600; }
.acc-ligne .etat { grid-area: etat; display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.acc-ligne .proch { grid-area: proch; font-size: .8rem; font-weight: 600; color: #8a5a00; text-align: right; white-space: nowrap; }
.acc-ligne .when { grid-area: when; display: flex; gap: 10px; align-items: center; color: var(--ink2); font-size: .8rem; }
.acc-ligne .nliens { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); }
.acc-i { border: 0; background: none; color: var(--ink2); padding: 0 12px; cursor: pointer; font-size: 1.2rem; }
.acc-opts { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0 0 6px 2.8em; }
.acc-opts a { display: grid; grid-template-columns: 1.2em minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 8px 12px; text-decoration: none; color: inherit;
  border-top: 1px dashed var(--line); font-size: .92rem; }
.acc-opts small { color: var(--ink2); }
.etoile { color: #c9a227; }
.body-chips, .accueil .chip { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; font-size: .72rem; font-weight: 700; padding: .18em .6em;
  border-radius: 999px; background: #eef0f2; color: var(--ink2); }
.accueil .chip .ic { width: 1em; height: 1em; }
.accueil .chip.d-a_commander { background: #fdecec; color: var(--warn); }
.accueil .chip.d-commande { background: #fff3d6; color: #8a5a00; }
.accueil .chip.d-ar { background: #e6effa; color: #1f4f8a; }
.accueil .chip.d-livre, .accueil .chip.d-pose { background: #e3f4e6; color: #1d6b2e; }
.accueil .chip.d-facture, .accueil .chip.d-solde { background: #1d6b2e; color: #fff; }
.accueil .chip.d-ancien { background: #eef0f2; color: var(--ink2); }
.accueil .chip.alerte { background: var(--warn-soft); color: var(--warn); }
.accueil .chip.valide { background: #e7f6ec; color: #1f7a3f; }
.accueil .chip.f-a_commander { background: #fdecec; color: var(--warn); }
.accueil .chip.f-commande { background: #fff3d6; color: #8a5a00; }
.accueil .chip.f-ar, .accueil .chip.f-livraison { background: #e6effa; color: #1f4f8a; }
.accueil .chip.f-livre { background: #e3f4e6; color: #1d6b2e; }
.accueil .vide-filtre { color: var(--ink2); text-align: center; padding: 24px; }
.accueil .acc-centre .version { margin-top: 18px; }
body.accueil.compact .acc-ligne { padding-top: 5px; padding-bottom: 5px; }
body.accueil.compact .acc-ligne .nom strong { display: inline; }

/* panneau : feuille du bas sur téléphone */
.acc-panneau#panel { bottom: calc(var(--acc-tools-h, 104px) + var(--safe-b)); max-height: 70dvh; }
.acc-panneau h2 .num { color: var(--accent); }
.acc-panneau h3 small { font-weight: 600; letter-spacing: 0; }
.acc-adr { color: var(--ink2); margin: -.1em 0 .6em; font-size: .9rem; }
.acc-chips { margin: 0 0 .9em; display: flex; flex-wrap: wrap; gap: 6px; }
.acc-ouvrir { width: 100%; justify-content: center; padding: .75em 1em; font-size: 1rem; }
.acc-ouvrir small { font-weight: 400; opacity: .75; margin-left: .3em; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-retour { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--ink2); padding: 4px 0; margin: 0 0 4px; cursor: pointer; font-weight: 600; font-size: .85rem; }
.acc-retour:hover { color: var(--ink); }
.acc-o, .acc-f, .acc-dates { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.acc-o button, .acc-dates button { width: 100%; display: grid; grid-template-columns: 1.2em minmax(0, 1fr) auto; gap: 6px; align-items: center; text-align: left;
  border: 0; background: none; padding: 8px; border-radius: 8px; cursor: pointer; font: inherit; font-size: .92rem; color: inherit; }
.acc-o button:hover, .acc-dates button:hover { background: #f3f5f6; }
.acc-o li.on button { background: var(--accent-soft); }
.acc-o small { color: var(--ink2); font-size: .8rem; }
.acc-dates button { grid-template-columns: 6.5em minmax(0, 1fr); }
.acc-dates em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-dates button span { font-weight: 700; color: #8a5a00; font-size: .85rem; }
.acc-f li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 2px; border-bottom: 1px solid #f0f2f3; font-size: .92rem; }
.acc-al { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 5px; }
.acc-al li > button, .acc-al.fiche li { display: block; width: 100%; text-align: left; border: 0; border-radius: 9px; padding: .55em .75em; cursor: pointer; font: inherit;
  font-size: .9rem; background: #e6effa; color: #1f4f8a; }
.acc-al li.attention > button, .acc-al.fiche li.attention { background: var(--warn-soft); color: var(--warn); }
.acc-al li > button span { display: block; }
.acc-al li > button:hover { filter: brightness(.97); }
.acc-al .plus { font-style: normal; font-weight: 700; font-size: .78rem; background: #fff9; border-radius: 999px; padding: 0 .45em; }
.acc-calme { color: #1d6b2e; background: #e3f4e6; border-radius: 9px; padding: .6em .8em; }
.acc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.acc-actions .pill { font-size: .88rem; padding: .45em .9em; }
.acc-actions .muted { font-size: .82rem; color: var(--ink2); margin-right: 2px; }
.acc-actions.bas { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 12px; }
.acc-actions .danger { color: var(--warn); }
.acc-nb { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 .45em; font-size: .75rem; }
.acc-contact { display: grid; gap: 8px; justify-items: start; }
.acc-panneau .anciens { margin-top: 14px; border-top: 1px solid var(--line); }
.acc-panneau .anciens > summary { cursor: pointer; padding: 10px 2px; font-weight: 600; color: var(--ink2); }
.acc-panneau .anciens > summary b { background: var(--line); border-radius: 999px; padding: 1px 8px; margin-left: 4px; font-size: .85em; }
.acc-panneau .anciens ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.acc-panneau .anciens li { display: flex; align-items: center; gap: 8px; padding: .35em .5em; border-radius: 8px; background: var(--bg); }
.acc-panneau .anciens .lien { flex: 1; min-width: 0; text-align: left; border: 0; background: none; font: inherit; font-size: .9rem; cursor: pointer; color: inherit; padding: 2px; }
.acc-panneau .anciens small { display: block; color: var(--ink2); font-size: .8rem; }
.acc-panneau .anciens .pill { font-size: .8rem; padding: .35em .8em; flex: none; }
.acc-panneau .muted { color: var(--ink2); font-size: .88rem; }
#aideAccueil { border: 0; border-radius: 14px; padding: 18px 22px; box-shadow: 0 20px 60px #0005; }
#aideAccueil pre { font: .9rem/1.7 ui-monospace, Menlo, Consolas, monospace; margin: 0 0 12px; }
#aideAccueil button { font: inherit; border: 0; background: var(--ink); color: #fff; border-radius: 8px; padding: 7px 14px; cursor: pointer; }

/* grand écran (même seuil que le « mode concepteur » de la visionneuse) : outils à gauche, panneau à droite */
@media (min-width: 1024px) and (min-height: 600px) {
  body.accueil { grid-template-rows: auto minmax(0, 1fr); grid-template-columns: auto minmax(0, 1fr) auto; }
  .accueil .vbar { flex-wrap: nowrap; padding: max(6px, env(safe-area-inset-top)) 10px 6px 10px; z-index: 20; }
  .accueil .vbar .vlogo { margin: 0 9px; }
  .accueil .vbar .vtitle { flex: 0 1 auto; max-width: 230px; }
  .accueil .vbar > .vmenus { display: flex; border-right: 0; border-left: 1px solid #ffffff22; padding: 0 0 0 8px; margin: 0 0 0 4px; }
  .acc-recherche { order: 3; flex: 0 1 460px; margin: 0 auto 0 16px; }
  .acc-recherche input { padding-right: 34px; }
  .acc-recherche kbd { display: block; position: absolute; right: 9px; font: inherit; font-size: .72rem; color: #ffffffb0; border: 1px solid #ffffff44; border-radius: 4px; padding: 0 5px; }
  .acc-recherche:focus-within kbd { display: none; }
  .accueil .vactions { order: 4; }
  #btnPanneau { display: inline-flex; background: none; box-shadow: none; }
  #btnPanneau[aria-pressed=true] { background: #ffffff22; }
  .accueil > .tools { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; align-items: stretch; gap: 2px; width: calc(70px + env(safe-area-inset-left));
    padding: 8px 6px 8px calc(6px + env(safe-area-inset-left)); background: var(--ink); border-top: 0; overflow-y: auto; }
  .accueil > .tools .tools-ressort { display: block; flex: 1; }
  .accueil > .tools button { flex: none; color: #fff; padding: 8px 2px 6px; border-radius: 10px; font-size: 1.2rem; }
  .accueil > .tools button span { color: #ffffffb3; font-size: .66rem; }
  .accueil > .tools button:hover { background: #ffffff14; }
  .accueil > .tools button[aria-pressed=true] { background: var(--accent); color: #fff; }
  .accueil > .tools button[aria-pressed=true] span { color: #fff; }
  .accueil > .tools button[aria-pressed=true] .badge.gris { background: #fff; color: var(--accent); }
  .accueil > .tools .badge { top: 3px; left: calc(50% + 6px); }
  .acc-centre { grid-column: 2; grid-row: 2; padding: 16px 22px 30px; }
  .acc-panneau#panel { position: relative; inset: auto; grid-column: 3; grid-row: 2; width: var(--panel-w, 380px); max-height: none; border-radius: 0; z-index: 2;
    box-shadow: -1px 0 0 var(--line); padding-top: 6px; }
  .acc-panneau#panel[hidden] { display: none; }
  .acc-panneau .grab { display: none; }
  .acc-panneau .close { top: 6px; box-shadow: none; background: transparent; }
  .acc-i { display: none; }
  .acc-opts { display: none; }
  /* une ligne par dossier : n° | client + ville | étape | prochaine date | publié */
  .acc-ligne { grid-template-columns: 3.2em minmax(10em, 1.3fr) minmax(8em, 1fr) 7em 9.5em; grid-template-areas: "num nom etat proch when";
    padding: 9px 14px; column-gap: 1em; }
  .acc-ligne .num { align-self: center; padding: 0; }
  .acc-ligne .etat { justify-content: flex-start; }
  .acc-ligne .when { justify-content: flex-end; }
  .acc-dos { grid-template-columns: minmax(0, 1fr); }
  body.accueil.compact .acc-ligne .nom small { display: inline; margin-left: .6em; }
}
@media (min-width: 1024px) and (min-height: 600px) {
  .accueil > .tools button span { overflow: visible; max-width: none; letter-spacing: -.01em; }
}
/* accueil v2.61 : aperçus (Photos HD, perspective et plan Winner) et récapitulatif dans la fiche du panneau */
.acc-ap { margin: 4px 0 6px; }
.acc-ap-grand { display: block; width: 100%; aspect-ratio: 16 / 10; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: #f1f3f4;
  box-shadow: inset 0 0 0 1px var(--line); cursor: zoom-in; }
.acc-ap-grand img { width: 100%; height: 100%; object-fit: contain; display: block; }
.acc-ap figcaption { font-size: .82rem; color: var(--ink2); margin-top: 4px; display: flex; justify-content: space-between; }
.acc-ap.vide { display: grid; place-items: center; align-content: center; gap: 4px; aspect-ratio: 16 / 6; border-radius: 10px; background: #f1f3f4; color: var(--ink2);
  text-align: center; padding: 10px; font-size: .9rem; }
.acc-ap.vide small { font-size: .78rem; }
.acc-ap-mini { display: flex; gap: 6px; margin: 0 0 10px; overflow-x: auto; scrollbar-width: none; }
.acc-ap-mini button { flex: none; width: 74px; border: 0; padding: 0; background: none; cursor: pointer; font: inherit; color: var(--ink2); }
.acc-ap-mini img { width: 74px; height: 48px; object-fit: cover; border-radius: 6px; display: block; background: #f1f3f4; box-shadow: inset 0 0 0 1px var(--line); }
.acc-ap-mini span { display: block; font-size: .7rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-ap-mini button[aria-pressed=true] img { box-shadow: 0 0 0 2px var(--accent); }
.acc-ap-mini button[aria-pressed=true] span { color: var(--accent); font-weight: 600; }
.acc-recap { list-style: none; margin: 0 0 6px; padding: 0; }
.acc-recap li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 2px; font-size: .9rem; position: relative; }
.acc-recap li i { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 2px #c4cbd0; justify-self: center; }
.acc-recap li.ok i { background: #2e8b47; box-shadow: none; }
.acc-recap li.encours i { background: #f5b942; box-shadow: none; }
.acc-recap li + li::before { content: ''; position: absolute; left: 8px; top: -6px; height: 10px; border-left: 2px solid #e3e7ea; }
.acc-recap li.non span { color: var(--ink2); }
.acc-recap b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acc-recap li.non b { color: var(--ink2); font-weight: 400; }
#accZoom { border: 0; padding: 10px; border-radius: 12px; max-width: 96vw; max-height: 94vh; box-shadow: 0 20px 60px #0006; }
#accZoom::backdrop { background: #1f2a2ecc; }
#accZoom img { display: block; max-width: calc(96vw - 20px); max-height: calc(94vh - 80px); object-fit: contain; margin: 0 auto; }
#accZoom p { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; }
#accZoom p span { flex: 1; font-weight: 600; }
/* accueil v2.61 : panneau plus large par défaut (≈ un tiers de l'écran), réglable en glissant son bord gauche */
.acc-poignee { display: none; }
@media (min-width: 1024px) and (min-height: 600px) {
  .acc-panneau#panel { width: var(--panel-w, clamp(400px, 34vw, 660px)); }
  .acc-poignee { display: block; position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 4; touch-action: none; }
  .acc-poignee:hover, body.panneau-glisse .acc-poignee { background: linear-gradient(90deg, transparent 3px, var(--accent) 3px 5px, transparent 5px); }
  body.panneau-glisse { cursor: col-resize; user-select: none; }
  .acc-ligne { grid-template-columns: 3.2em minmax(9em, 1.3fr) minmax(7em, 1fr) 6.5em 8.5em; }
}
@media (min-width: 1024px) and (max-width: 1439px) and (min-height: 600px) {
  .acc-ligne { grid-template-columns: 3em minmax(8em, 1.4fr) minmax(6em, 1fr) 6em; grid-template-areas: "num nom etat proch"; }
  .acc-ligne .when { display: none; }
}

/* v2.67 : aperçus du tarif fournisseur dans la fiche article */
.ap-tarif { display: flex; flex-wrap: wrap; gap: .5em; margin: .4em 0 .8em; align-items: flex-end; }
.ap-tarif button { padding: 4px; border: 1px solid var(--line, rgba(0,0,0,.1)); border-radius: 8px; background: #fff; cursor: zoom-in; line-height: 0; }
.ap-tarif img { max-height: 110px; max-width: 150px; object-fit: contain; }
.ap-tarif .ap-co { flex-basis: 100%; }
.ap-tarif .ap-co img { max-width: 100%; max-height: 140px; }

/* ------------------------------------------------------------ Visionneuse de la galerie Photos HD (v2.69, assets/galerie-hd.js) */
.galx { position: fixed; inset: 0; z-index: 9000; display: flex; flex-direction: column; color: #fff;
  background: rgba(14, 14, 16, calc(.94 * var(--galx-fond, 1))); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .2s ease; user-select: none; -webkit-user-select: none; }
.galx.vu { opacity: 1; }
html.galx-ouverte, html.galx-ouverte body { overflow: hidden; }
.galx .ic { width: 22px; height: 22px; display: block; }
.galx-haut { display: flex; align-items: center; gap: 12px; padding: 10px 12px 6px 18px; padding-top: max(10px, env(safe-area-inset-top)); font-size: .95rem; }
.galx-num { font-variant-numeric: tabular-nums; opacity: .7; white-space: nowrap; }
.galx-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.galx-outils { display: flex; gap: 4px; }
.galx-b { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: transparent; color: #fff; cursor: pointer; text-decoration: none; transition: background .15s; }
.galx-b:hover, .galx-b:focus-visible { background: rgba(255,255,255,.14); outline: none; }
.galx-b.actif { background: #d35f2c; }
.galx-scene { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; cursor: grab; }
.galx.zoome .galx-scene { cursor: move; }
.galx-piste { display: flex; height: 100%; transform: translateX(-100%); transition: transform .32s cubic-bezier(.22,.8,.3,1); will-change: transform; }
.galx-piste figure { flex: 0 0 100%; height: 100%; margin: 0; display: flex; align-items: center; justify-content: center; padding: 6px 64px; box-sizing: border-box; position: relative; }
.galx-piste img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; box-shadow: 0 12px 40px rgba(0,0,0,.5);
  opacity: 0; transition: opacity .25s ease; transform-origin: center; -webkit-user-drag: none; }
.galx-piste figure.pret img { opacity: 1; }
.galx-charge { position: absolute; width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.2); border-top-color: #fff; border-radius: 50%; animation: galxTourne .8s linear infinite; }
.galx-piste figure.pret .galx-charge { display: none; }
@keyframes galxTourne { to { transform: rotate(360deg); } }
.galx-fl { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #fff; background: rgba(255,255,255,.12); transition: background .15s, opacity .2s; }
.galx-fl:hover { background: rgba(255,255,255,.26); }
.galx-fl .ic { width: 26px; height: 26px; }
.galx-g { left: 10px; } .galx-d { right: 10px; }
.galx.seule .galx-fl, .galx.seule .galx-vignettes, .galx.seule [data-a="diapo"] { display: none; }
.galx.zoome .galx-fl { opacity: 0; pointer-events: none; }
.galx-barre { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; opacity: 0; transition: opacity .2s; }
.galx.diapo .galx-barre { opacity: 1; }
.galx-barre i { display: block; height: 100%; width: 0; background: #d35f2c; }
.galx-vignettes { display: flex; gap: 8px; padding: 10px 14px; padding-bottom: max(10px, env(safe-area-inset-bottom)); overflow-x: auto; scrollbar-width: thin; justify-content: safe center; }
.galx-vignettes button { flex: 0 0 auto; padding: 0; border: 2px solid transparent; border-radius: 6px; background: none; cursor: pointer; opacity: .5; transition: opacity .15s, border-color .15s, transform .15s; }
.galx-vignettes button:hover { opacity: .85; }
.galx-vignettes button.actif { opacity: 1; border-color: #d35f2c; transform: translateY(-2px); }
.galx-vignettes img { display: block; height: 58px; width: auto; max-width: 110px; object-fit: cover; border-radius: 4px; }
@media (max-width: 700px) {
  .galx-piste figure { padding: 0; }
  .galx-piste img { border-radius: 0; box-shadow: none; }
  .galx-fl { width: 40px; height: 40px; background: rgba(0,0,0,.35); }
  .galx-g { left: 6px; } .galx-d { right: 6px; }
  .galx-vignettes img { height: 46px; }
  .galx [data-a="zoom"] { display: none; }
}
@media (hover: none) { .galx-fl { opacity: .75; } }
@media (prefers-reduced-motion: reduce) { .galx-piste { transition: none; } }
.hdGalerie figure.fait img { cursor: zoom-in; }
