/* Ouvratech — éléments ajoutés par le runtime autour de la maquette : pastille de synchronisation,
   menu du compte, bandeau d'abonnement, boîte de confirmation. Variables de la maquette (p1_head.html). */
#dp-chrome { position: fixed; z-index: 45; left: 10px; bottom: calc(68px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: flex-end; gap: 6px;
  max-width: calc(100% - 20px); pointer-events: none; font-family: var(--f-body, system-ui, sans-serif); }
#dp-chrome > * { pointer-events: auto; }
/* Ordinateur : la pastille devient le pied du menu de gauche, qui s'arrête au-dessus : aucun élément du menu caché dessous */
@media (min-width: 960px) { #dp-chrome { left: 0; bottom: 0; width: 228px; max-width: none; padding: 12px; background: var(--side, var(--surface, #fff));
  border-right: 1px solid var(--line, #D8DDE3); border-top: 1px solid var(--line, #D8DDE3); } #side { bottom: 65px; } }
@media (max-width: 959px) { #main { padding-bottom: calc(124px + env(safe-area-inset-bottom, 0px)); } }
body.onbm #dp-chrome { display: none; }
.dp-acct { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--line, #D8DDE3); background: var(--surface, #fff); color: var(--ink, #1B232C);
  font: inherit; font-weight: 700; font-size: 14px; letter-spacing: .02em; cursor: pointer; box-shadow: var(--shadow); padding: 0; }
.dp-acct[aria-expanded=true] { background: var(--brand, #232C36); color: var(--onbrand, #fff); border-color: var(--brand, #232C36); }
.dp-acct:focus-visible, .dp-mbtn:focus-visible { outline: 3px solid var(--tape, #F2C200); outline-offset: 2px; }
.dp-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; min-width: 32px; padding: 6px 12px 6px 11px; border-radius: 16px; background: var(--surface, #fff);
  border: 1px solid var(--line, #D8DDE3); box-shadow: var(--shadow); color: var(--muted, #47525E); font-size: 13px; font-weight: 600; line-height: 1.25; cursor: default; }
.dp-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--ok, #1D8A4C); }
.dp-pill[data-state=pending] .dp-dot { background: var(--warn, #A86F12); }
.dp-pill[data-state=offline] { color: var(--ink, #1B232C); background: var(--surface2, #F5F6F8); }
.dp-pill[data-state=offline] .dp-dot { background: transparent; box-shadow: inset 0 0 0 2px var(--muted, #47525E); }
.dp-pill[data-state=error] .dp-dot, .dp-pill[data-state=auth] .dp-dot { background: var(--bad, #C53A3A); }
@media (prefers-reduced-motion: no-preference) { .dp-pill[data-busy=true] .dp-dot { animation: dppulse 1s ease-in-out infinite; } }
@keyframes dppulse { 50% { opacity: .35; } }
/* Sur téléphone, « Synchronisé » se réduit au point vert : le texte reste lu par les lecteurs d'écran */
@media (max-width: 959px) {
  .dp-pill[data-state=synced] { padding: 6px; justify-content: center; }
  .dp-pill[data-state=synced] .dp-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.dp-menu { position: absolute; left: 0; bottom: calc(100% + 8px); width: min(300px, calc(100vw - 20px)); background: var(--surface, #fff); color: var(--ink, #1B232C);
  border: 1px solid var(--line, #D8DDE3); border-radius: 12px; box-shadow: 0 10px 30px rgba(10, 14, 18, .22); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.dp-menu[hidden] { display: none; }
.dp-mh b { display: block; font-size: 16px; overflow-wrap: anywhere; }
.dp-mh span, .dp-mc, .dp-ms { font-size: 14px; color: var(--muted, #47525E); overflow-wrap: anywhere; }
.dp-mc { border-top: 1px solid var(--line, #D8DDE3); padding-top: 10px; }
.dp-mc b { color: var(--ink, #1B232C); }
.dp-ms { margin: 0; }
.dp-mbtn { min-height: 44px; width: 100%; border: 1px solid var(--line, #D8DDE3); background: var(--surface, #fff); color: var(--ink, #1B232C); border-radius: 9px;
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; text-align: left; padding: 8px 12px; }
.dp-mbtn:hover { background: var(--surface2, #F5F6F8); }
.dp-mbtn.dp-danger { color: var(--bad, #C53A3A); border-color: var(--bad, #C53A3A); }
.dp-mbtn.dp-main { background: var(--brand, #232C36); color: var(--onbrand, #fff); border-color: var(--brand, #232C36); text-align: center; }
/* Bandeau : essai terminé */
#dp-banner { display: flex; gap: 10px; align-items: flex-start; background: var(--warnsoft, #FAEFD6); color: var(--ink, #1B232C); border-bottom: 1px solid var(--line, #D8DDE3);
  padding: 10px 16px; font-weight: 600; font-size: 14.5px; line-height: 1.4; }
#dp-banner::before { content: ""; width: 18px; height: 18px; flex: none; margin-top: 1px; border-radius: 4px;
  background: repeating-linear-gradient(135deg, var(--tape, #F2C200) 0 4px, var(--brand, #232C36) 4px 8px); }
@media (min-width: 960px) { #dp-banner { padding-inline: 32px; } }
/* Boîte de confirmation */
.dp-dialog { border: 1px solid var(--line, #D8DDE3); border-radius: 12px; background: var(--surface, #fff); color: var(--ink, #1B232C); padding: 18px; width: min(440px, calc(100vw - 32px));
  box-shadow: 0 10px 40px rgba(10, 14, 18, .3); font-family: var(--f-body, system-ui, sans-serif); }
.dp-dialog::backdrop { background: rgba(10, 14, 18, .45); }
.dp-dialog h2 { margin: 0 0 8px; font-family: var(--f-display, "Arial Narrow", sans-serif); font-size: 22px; }
.dp-dialog p { margin: 0 0 14px; }
.dp-dialog .dp-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.dp-dialog .dp-mbtn { width: auto; text-align: center; padding-inline: 16px; }
/* Message bref avant le chargement de l'application */
#dp-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 110; background: var(--brand, #232C36);
  color: var(--onbrand, #fff); padding: 10px 16px; border-radius: 8px; font-weight: 600; max-width: calc(100% - 32px); box-shadow: var(--shadow); }

/* Outils du serveur : équipe, lien de paiement, facture électronique */
.dp-dialog.dp-wide { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; }
.dp-dialog .dp-xbar { position: sticky; top: -18px; z-index: 3; display: flex; justify-content: flex-end; height: 52px; margin: -18px -18px -34px; padding: 8px 8px 0; pointer-events: none; }
.dp-dialog.dp-scrolled .dp-xbar { background: var(--surface, #fff); box-shadow: 0 1px 0 var(--line, #D8DDE3); pointer-events: auto; }
.dp-dialog .dp-xbar + h2 { padding-right: 48px; }
.dp-dialog .dp-x { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; pointer-events: auto;
  border: 1px solid var(--line, #D8DDE3); border-radius: 8px; background: var(--surface, #fff); color: inherit; cursor: pointer; }
.dp-dialog .dp-x:focus-visible { outline: 3px solid var(--tape, #F2C200); outline-offset: 2px; }
.dp-st-body p { margin: 0 0 12px; }
.dp-st-body ul { margin: 0 0 12px; padding-left: 20px; }
.dp-st-note { font-size: 14px; color: var(--muted, #47525E); }
.dp-st-url { width: 100%; box-sizing: border-box; min-height: 44px; padding: 0 12px; border: 1px solid var(--line, #D8DDE3); border-radius: 10px; font: inherit; background: var(--surface2, #F5F6F8); color: inherit; margin-bottom: 10px; }
.dp-acts.dp-left { justify-content: flex-start; margin-bottom: 8px; }
a.dp-mbtn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: inherit; }
.dp-team { list-style: none; margin: 0 0 12px; padding: 0; }
.dp-team li { display: flex; flex-wrap: wrap; gap: 8px 12px; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line, #D8DDE3); }
.dp-team li span { font-size: 14px; color: var(--muted, #47525E); }
.dp-team-ctl { display: flex; gap: 8px; flex-wrap: wrap; }
.dp-team select, .dp-invite select, .dp-invite input { min-height: 44px; border: 1px solid var(--line, #D8DDE3); border-radius: 10px; padding: 0 10px; font: inherit; background: var(--surface, #fff); color: inherit; }
.dp-tag { font-size: 12px; background: var(--warnsoft, #FAEFD6); color: var(--warn, #A86F12); border-radius: 999px; padding: 2px 8px; }
.dp-invite { display: grid; gap: 6px; margin-top: 8px; }
.dp-invite h3 { margin: 6px 0; font-family: var(--f-display, "Arial Narrow", sans-serif); font-size: 19px; }
.dp-invite label { font-weight: 600; font-size: 15px; }
#dp-banner { flex-wrap: wrap; }
#dp-banner .dp-banner-btn { width: auto; padding: 6px 14px; margin: 0; }
/* Bandeau : adresse e-mail à confirmer (rien ne part au nom de l'entreprise avant) */
#dp-verify { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; background: var(--surface2, #F5F6F8); color: var(--ink, #1B232C);
  border-bottom: 1px solid var(--line, #D8DDE3); padding: 10px 16px; font-size: 14.5px; line-height: 1.4; }
#dp-verify b { overflow-wrap: anywhere; }
#dp-verify .dp-banner-btn { width: auto; padding: 6px 14px; margin: 0; min-height: 44px; }
@media (min-width: 960px) { #dp-verify { padding-inline: 32px; } }

/* Téléphone : le compte et la synchronisation en haut à droite, comme dans les applis courantes (plus rien ne cache
   le bas des listes) ; « Synchronisé » = petit point sur la pastille du compte, les autres états restent en toutes lettres dessous */
@media (max-width: 959px) {
  #dp-chrome { left: auto; right: 12px; bottom: auto; top: calc(12px + env(safe-area-inset-top, 0px)); flex-direction: column; align-items: flex-end; gap: 6px; }
  #top { padding-right: 62px; }
  #main { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .dp-acct { width: 38px; height: 38px; font-size: 13px; }
  .dp-pill[data-state=synced] { position: absolute; top: 27px; right: -2px; min-width: 0; min-height: 0; width: 15px; height: 15px; padding: 0; box-shadow: none; border-width: 2px; border-color: var(--bg, #ECEEF1); }
  .dp-pill[data-state=synced] .dp-dot { width: 11px; height: 11px; }
  .dp-menu { bottom: auto; top: calc(100% + 8px); left: auto; right: 0; }
}

/* Fenêtres (catalogues, relances, clôtures, compte…) : ruban de chantier en haut, titre plus présent, bouton principal arrondi */
.dp-dialog{border-top:0;padding-top:24px;box-shadow:0 18px 50px rgba(10,14,18,.28);border-radius:16px;background-image:repeating-linear-gradient(135deg,var(--tape,#F2C200) 0 10px,var(--brand,#232C36) 10px 20px);background-size:100% 6px;background-repeat:no-repeat;background-color:var(--surface,#fff)}
.dp-dialog h2{font-size:24px;letter-spacing:.2px}
.dp-mbtn{border-radius:10px}
.dp-mbtn.dp-main{box-shadow:0 4px 12px color-mix(in srgb,var(--brand,#232C36) 28%,transparent)}

/* Longues listes (devis, factures, clients, catalogue) : le navigateur ne dessine que les lignes visibles à l'écran.
   Avec quelques centaines de devis, l'écran mettait plusieurs dixièmes de seconde à s'afficher (mise en page de toutes les lignes).
   Le cadre de focus passe à l'intérieur de la ligne (sinon coupé par la retenue de dessin). */
#dvlist .list > .item, #falist .list > .item, #cllist .list > .item, #catl .list > .item { content-visibility: auto; contain-intrinsic-size: auto 64px; }
#dvlist .list > .item:focus-visible, #falist .list > .item:focus-visible, #cllist .list > .item:focus-visible { outline-offset: -3px; }
