:root{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;color:#202735;background:#f2f4f7;font-size:16px;--accent:#a60c20;--line:#d9dfe7;--muted:#586271}*{box-sizing:border-box}body{margin:0;line-height:1.5}a{color:var(--accent)}button,input,select,textarea{font:inherit}button,a,input,select{touch-action:manipulation}button{cursor:pointer}button:disabled{cursor:default;opacity:.6}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #245fa9;outline-offset:3px}.app-header{position:sticky;top:0;z-index:5;display:flex;align-items:center;gap:14px;min-height:70px;padding:calc(10px + env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) 10px max(18px,env(safe-area-inset-left));background:white;border-bottom:1px solid var(--line)}.brand{font-weight:800;font-size:1.45rem;letter-spacing:-.055em;text-decoration:none;color:#202735}.brand span{color:var(--accent)}.environment{font-size:.65rem;letter-spacing:.03em;color:#7c5315;background:#fff6de;padding:4px 7px;border-radius:6px}.menu-button,.icon-button{min-width:44px;min-height:44px;border:0;background:#f2f4f7;border-radius:12px;font-size:1.35rem}.menu-button{margin-left:auto}.network-state{padding:6px 18px;font-size:.75rem;color:var(--muted);background:#f2f4f7}.network-state:empty{display:none}.page{max-width:1000px;margin:auto;padding:24px max(18px,env(safe-area-inset-right)) max(40px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left))}.page h1{font-size:1.7rem;line-height:1.2;letter-spacing:-.03em;margin:6px 0 20px}.eyebrow{font-weight:750;letter-spacing:.08em;text-transform:uppercase;color:var(--accent);font-size:.75rem}.small{font-size:.8rem;color:var(--muted)}.message{position:sticky;top:76px;z-index:8;padding:12px 18px;background:#fff0ee;border-bottom:1px solid #edc5c5;color:#872024;overflow-wrap:anywhere}.error{color:#9c1426;background:#fff1f1;padding:12px;border-radius:10px}.primary,.secondary,.text-button{min-height:46px;padding:10px 16px;border:1px solid var(--line);border-radius:12px;font-weight:650;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:8px}.primary{background:var(--accent);color:white;border-color:var(--accent)}.secondary{background:white;color:#202735}.text-button{background:transparent;border-color:transparent;color:var(--accent)}.actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}.actions>*{flex:1 1 140px}label{display:block;font-weight:650;font-size:.87rem;margin:16px 0 6px}input,select,textarea{width:100%;min-height:46px;max-width:100%;border:1px solid #b7c1cd;border-radius:10px;padding:10px 12px;background:white;color:inherit}textarea{min-height:90px}input[type=checkbox]{width:22px;min-height:22px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px}.wide{grid-column:1/-1}.card,.empty,.time-summary{background:white;border:1px solid var(--line);border-radius:16px;padding:20px;margin:14px 0}.card h2{margin:0 0 8px;font-size:1.05rem}.card p{margin:4px 0}.card-time{font-weight:750;color:var(--accent);font-size:.85rem}.status{font-size:.75rem;border-radius:20px;background:#f0f3f7;padding:3px 8px;display:inline-block}.card .status{margin-top:10px}.time-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.time-summary strong{display:block;font-size:1.35rem;letter-spacing:-.03em}.time-summary span{font-size:.8rem;color:var(--muted)}.timeline{list-style:none;padding:0}.timeline li{display:flex;gap:14px;padding:12px 0;border-bottom:1px solid var(--line)}.timeline time{font-weight:700;color:var(--accent);min-width:50px}.timeline span{font-size:.9rem}.empty p{color:var(--muted);margin:0}.day-controls{display:grid;gap:10px}.day-controls button{min-height:48px}.menu-dialog{position:fixed;inset:0 0 0 auto;margin:0;width:min(85vw,390px);max-width:none;height:100dvh;max-height:none;border:0;padding:calc(24px + env(safe-area-inset-top)) 24px max(24px,env(safe-area-inset-bottom));border-radius:24px 0 0 24px;color:inherit}.menu-dialog::backdrop,.details-dialog::backdrop{background:#0d152d66}.menu-dialog>.icon-button,.details-dialog>.icon-button{float:right}.menu-dialog nav{clear:both;display:grid;gap:8px;padding:24px 0}.menu-dialog nav a{padding:12px;border-radius:10px;color:inherit;text-decoration:none;font-weight:600}.menu-dialog nav a:hover{background:#f4f5f8}.menu-dialog>.secondary{width:100%;margin-top:10px}.details-dialog{width:min(94vw,650px);max-height:88dvh;overflow:auto;border:0;border-radius:20px;padding:24px;color:inherit}.details-dialog h2{padding-right:44px}.report-signatures{display:flex;flex-wrap:wrap;gap:16px}.report-signatures img{display:block;width:100%;max-width:240px;max-height:150px;object-fit:contain;border:1px solid var(--line);border-radius:10px}.report-signatures figure{margin:12px 0;flex:1 1 180px}.report-signatures figcaption{font-size:.8rem;color:var(--muted)}.preserve-lines{white-space:pre-wrap;overflow-wrap:anywhere}.login-page{min-height:100dvh;max-width:480px;margin:auto;padding:50px 22px 30px}.login-page>.brand{font-size:2rem;display:inline-block;margin-bottom:32px}.login-card{background:white;border:1px solid var(--line);border-radius:22px;padding:28px;box-shadow:0 14px 45px #20273506}.login-card h1{font-size:1.9rem;line-height:1.15;letter-spacing:-.04em}.login-card p{color:var(--muted);font-size:.9rem}.login-card .primary{width:100%;margin-top:24px}.login-foot{font-size:.8rem;text-align:center;color:var(--muted);margin-top:24px}.password-field{position:relative}.password-field input{padding-right:85px}.password-field button{position:absolute;right:4px;top:4px;bottom:4px;border:0;background:transparent;min-width:74px;font-size:.8rem;font-weight:650;color:var(--accent)}.check-row{display:flex;gap:10px;align-items:center}.check-row label{margin:8px 0;font-weight:450}.next-mission{max-width:1088px;margin:0 auto 20px;padding:0 18px}.next-mission .card{border-left:4px solid var(--accent)}@media(max-width:400px){.form-grid{grid-template-columns:minmax(0,1fr)}.login-card{padding:22px}.time-summary{padding:15px}.time-summary strong{font-size:1.1rem}}@media(prefers-reduced-motion:no-preference){button,a{transition:background-color .15s,border-color .15s}}

.page,.card,.empty,.details-dialog{min-width:0;overflow-wrap:anywhere}fieldset{min-width:0;border:1px solid var(--line);border-radius:10px;margin:18px 0;padding:12px}summary{min-height:44px;cursor:pointer;font-weight:650}

input[type=date],input[type=time]{min-width:0;min-inline-size:0;max-width:100%;max-inline-size:100%;width:100%;display:block;box-sizing:border-box;-webkit-appearance:none;appearance:none}input::-webkit-date-and-time-value{min-width:0;text-align:left;min-height:1.5em}.form-grid>*{min-width:0;max-width:100%}

/* Logo officiel de l'en-tête */
.app-header .brand-logo{display:inline-flex;align-items:center;line-height:1;flex-shrink:0}.app-header .brand-logo img{display:block;width:auto;max-width:170px;height:58px;object-fit:contain}

/**
 * Mobile technician forms: constrain every flex/grid descendant to the viewport.
 * A wide canvas or long label must never expand the iPhone layout.
 */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.app-header,
.page,
.page > *,
.card,
.card > *,
.actions,
.actions > *,
fieldset,
label {
  min-width: 0;
  max-width: 100%;
}

.page {
  width: 100%;
}

.card {
  overflow-wrap: anywhere;
}

.card input:not([type='checkbox']),
.card select,
.card textarea,
.signature-pad {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.signature-pad {
  height: 170px;
  background: #fff;
  border: 1px solid #b7c1cd;
  border-radius: 10px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: contain;
}

@media (max-width: 600px) {
  .page {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }

  .card {
    padding: 16px;
  }

  .card .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card .actions > :only-child {
    grid-column: 1 / -1;
  }

  .card .actions button,
  .card .actions a {
    min-width: 0;
    width: 100%;
    overflow-wrap: anywhere;
  }
}

/**
 * iPhone safety form: keep the signature inside the visible card.
 * The signature surface is deliberately shaded, like Memoric-Présence.
 */
#top-sign-pad {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 180px;
  background: #f5f7fa;
  border: 2px solid #94a3b8;
  border-radius: 12px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.page,
.card,
.card .actions,
.card label {
  min-width: 0;
}

.card {
  max-width: 100%;
}

@media (max-width: 600px) {
  .app-header {
    width: 100%;
    min-width: 0;
  }

  .page {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .card {
    width: 100%;
    min-width: 0;
    padding: 16px;
  }

  .card .actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/**
 * ACI maintenance wizard — iPhone-first presentation.
 * The original five-chapter visual language is retained while each control
 * remains an independently saved step.
 */
.aci-workflow {
  --aci-red: #ad0825;
  --aci-border: #d6dee8;
  width: 100%;
  min-width: 0;
  padding-bottom: 132px;
}
.aci-chapters {
  display: flex;
  gap: 20px;
  align-items: center;
  overflow-x: auto;
  padding: 12px 0 16px;
  scrollbar-width: none;
  white-space: nowrap;
}
.aci-chapters::-webkit-scrollbar { display: none; }
.aci-chapter { color: #6b778a; font-size: 14px; }
.aci-chapter.is-active { color: var(--aci-red); font-weight: 700; }
.aci-chapter.is-complete { color: #344256; }
.aci-progress {
  height: 5px;
  border-radius: 99px;
  background: #dce2e9;
  overflow: hidden;
  margin-bottom: 28px;
}
.aci-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--aci-red);
  transition: width 180ms ease;
}
.aci-kicker {
  color: var(--aci-red);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .05em;
}
.aci-intro { margin-bottom: 22px; }
.aci-intro h2 { margin: 8px 0 12px; font-size: clamp(24px, 5vw, 32px); line-height: 1.18; }
.aci-context { color: #657287; margin: 0; overflow-wrap: anywhere; }
.aci-control-card {
  box-sizing: border-box;
  min-width: 0;
  background: white;
  border: 1px solid var(--aci-border);
  border-radius: 20px;
  padding: 22px;
}
.aci-control-card fieldset { padding: 0; border: 0; margin: 0; min-width: 0; }
.aci-control-card legend { display: none; }
.aci-control-card label {
  display: block;
  font-weight: 650;
  margin-bottom: 22px;
  color: #202a3a;
}
.aci-control-card input,
.aci-control-card select,
.aci-control-card textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 10px;
  padding: 14px;
  font-size: 16px;
  border: 1px solid #becadb;
  border-radius: 12px;
  background: #fff;
  color: #202a3a;
}
.aci-control-card textarea { min-height: 130px; resize: vertical; }
.aci-control-card .signature-pad {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 180px;
  margin: 12px 0 24px;
  border: 1px solid #bfcbd9;
  border-radius: 12px;
  background: #f6f8fb;
  touch-action: none;
}
.aci-footer {
  position: fixed;
  z-index: 20;
  bottom: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 14px max(16px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  border-top: 1px solid var(--aci-border);
  background: #fff;
  box-shadow: 0 -5px 20px #1c2c4012;
}
.aci-counter { color: #64748b; font-size: 13px; }
.aci-footer button {
  min-width: 0;
  padding: 13px 15px;
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
}
.aci-back { background: #e8edf3; color: #344256; }
.aci-back:disabled { opacity: .45; }
.aci-next { background: var(--aci-red); color: #fff; }
.aci-saved { margin-top: 16px; font-size: 13px; color: #66758a; }
.aci-return { display: inline-block; margin-top: 14px; color: var(--aci-red); }
@media (max-width: 400px) {
  .aci-control-card { padding: 18px; }
  .aci-chapters { gap: 14px; }
  .aci-footer { gap: 7px; }
  .aci-footer button { padding: 12px 10px; font-size: 14px; }
  .aci-counter { font-size: 12px; }
}


/**
 * Memoric-inspired ACI wizard: spacious inspection tiles, clear radio options,
 * and a fixed action bar that stays accessible on iPhone Safari.
 */
.aci-wizard { width:100%; min-width:0; padding-bottom:110px; }
.aci-progress { margin:0 0 22px; }
.aci-stages { display:flex; justify-content:space-between; gap:6px; overflow-x:auto; font-size:12px; color:#657186; white-space:nowrap; padding:6px 0 15px; }
.aci-stages .active { color:#aa0922; font-weight:800; }
.aci-progress-track { height:5px; border-radius:20px; background:#dce1e8; overflow:hidden; }
.aci-progress-track > div { height:100%; background:#b20a25; transition:width .2s ease; }
.aci-panel { padding:24px 20px 30px; border-radius:20px; background:#fff; }
.aci-eyebrow { color:#ac0b24; font-weight:800; letter-spacing:.06em; font-size:14px; margin:0 0 14px; }
.aci-panel .aci-title { color:#202938; font-size:clamp(24px,5.5vw,34px); line-height:1.22; margin:0 0 28px; letter-spacing:-.025em; }
.aci-subtitle,.aci-note-label { display:block; font-size:16px; font-weight:750; margin:18px 0 12px; }
.aci-note-label span { color:#66748a; font-weight:500; }
.aci-options { display:grid; gap:12px; }
.aci-choice { display:flex!important; align-items:center; gap:14px; padding:18px; min-height:64px; border:1px solid #d4dce7; border-radius:12px; color:#0785ef; font-weight:700; cursor:pointer; background:#fff; }
.aci-choice input[type=radio] { width:25px; height:25px; margin:0; flex:0 0 25px; accent-color:#b20a25; }
.aci-choice.selected { border:1.5px solid #b20a25; background:#fff5f6; }
.aci-panel textarea { min-height:110px; resize:vertical; }
.aci-hint { color:#67748a; font-size:14px; line-height:1.6; margin:18px 0 0; }
.aci-time-row { margin:18px 0; }
.aci-time-row > label { display:block; margin-bottom:9px; font-weight:700; }
.aci-time-controls { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:center; }
.aci-time-controls button { min-height:48px; }
.aci-check { display:flex!important; align-items:center; gap:12px; margin:22px 0; }
.aci-check input { width:22px; height:22px; accent-color:#0785ef; }
.aci-signature { height:200px; border:2px dashed #b0bdce; background:#fff; margin-bottom:12px; }
.aci-panel [data-aci-clear] { margin-bottom:20px; }
.aci-error { color:#b20a25; padding:10px 2px; }
.aci-footer { position:fixed; bottom:0; left:0; right:0; z-index:25; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px max(16px,env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left)); background:#fff; border-top:1px solid #d8dfe9; box-shadow:0 -3px 16px #1722330b; color:#657186; font-size:13px; }
.aci-footer-actions { display:flex; gap:8px; }
.aci-footer-actions button { min-height:46px; border-radius:10px; padding:9px 15px; font-weight:700; }
@media(min-width:700px){ .aci-wizard {max-width:650px;margin:auto;} .aci-stages{font-size:14px;} .aci-panel{padding:30px;} .aci-footer{padding-left:max(24px,calc((100vw - 650px)/2));padding-right:max(24px,calc((100vw - 650px)/2));} }
@media(max-width:380px){.aci-footer-actions button{padding:9px 11px;}.aci-footer{font-size:11px;}.aci-stages{font-size:10px;}}

/* Pied de page fixe identique dans son comportement à Memoric-Présence :
   bandeau blanc au bas de l'écran, copyright toujours visible. */
:root{--orgasav-footer-height:48px}
body{padding-bottom:calc(var(--orgasav-footer-height) + env(safe-area-inset-bottom))!important}
.app-copyright{
 position:fixed;inset:auto 0 0;z-index:24;
 display:flex;align-items:center;justify-content:center;
 min-height:var(--orgasav-footer-height);
 padding:8px 12px calc(8px + env(safe-area-inset-bottom));
 background:#fff;border-top:1px solid #d9dfe7;
 color:#4283a1;font-size:12px;line-height:1.4;text-align:center;
}
body:has(.aci-wizard){padding-bottom:calc(130px + env(safe-area-inset-bottom))!important}
body:has(.aci-wizard) .aci-footer{bottom:calc(var(--orgasav-footer-height) + env(safe-area-inset-bottom));padding-bottom:12px}

/**
 * Pied de page permanent sur toutes les vues de l'application.
 * Le copyright et les raccourcis partagent un seul conteneur fixe.
 */
:root { --orgasav-footer-height: 112px; }

.app-copyright {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  padding: 8px max(12px, env(safe-area-inset-right))
    calc(8px + env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
}

.app-copyright .home-bottom-nav {
  position: static;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  gap: 8px;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.app-copyright .home-bottom-link {
  min-height: 60px;
}

.app-copyright .home-bottom-link.is-active {
  background: #fff2f4;
  color: #a60c20;
}

.app-copyright .app-copyright-text {
  display: block;
  margin-top: 4px;
  color: #4283a1;
  font-size: 11px;
  line-height: 1.4;
}

body:has(.aci-wizard) .aci-footer {
  bottom: calc(var(--orgasav-footer-height) + env(safe-area-inset-bottom));
}

body:has(.aci-wizard) {
  padding-bottom: calc(190px + env(safe-area-inset-bottom)) !important;
}

/**
 * Priorité mobile : le pied de page est ancré au viewport, pas au contenu.
 * Une hauteur réservée empêche les cartes de recouvrir les raccourcis.
 */
html { scroll-padding-bottom: calc(130px + env(safe-area-inset-bottom)); }
body { padding-bottom: calc(130px + env(safe-area-inset-bottom)) !important; }
body > .app-copyright {
  position: fixed !important;
  top: auto !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 100 !important;
  box-sizing: border-box;
  width: 100%;
  min-height: 112px;
  transform: none !important;
  visibility: visible !important;
  background: #fff;
}
body > .app-copyright > .home-bottom-nav {
  display: grid !important;
  visibility: visible !important;
}

/* iPhone ACI: compact action bar above the persistent shortcuts. */
body:has(.aci-wizard) { padding-bottom: calc(260px + env(safe-area-inset-bottom)) !important; }
body:has(.aci-wizard) .aci-wizard { padding-bottom: 150px; }
body:has(.aci-wizard) .aci-footer {
  bottom: calc(var(--orgasav-footer-height) + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr);
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.3;
  z-index: 90;
}
body:has(.aci-wizard) .aci-footer > span { min-width: 0; }
body:has(.aci-wizard) .aci-footer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  gap: 8px;
}
body:has(.aci-wizard) .aci-footer-actions button {
  min-width: 0;
  width: 100%;
  min-height: 48px;
  padding: 8px 6px;
  font-size: 13px;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: normal;
}

/* Compact client directory: expand a client to reveal its complete record. */
.client-directory { max-width: 820px; margin: 0 auto; display: grid; gap: 10px; }
.client-directory-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin:0 0 8px; }
.client-directory-heading p { color:#a70b26; font-size:12px; letter-spacing:.09em; font-weight:800; margin:0; }
.client-directory-heading span { font-size:13px; color:#657287; }
.client-entry { background:#fff; border:1px solid #dbe2eb; border-radius:16px; overflow:hidden; box-shadow:0 2px 8px #18253b08; }
.client-entry[open] { border-color:#c9d3e1; box-shadow:0 8px 24px #18253b0d; }
.client-entry-summary { list-style:none; display:flex; align-items:center; gap:12px; padding:16px; cursor:pointer; min-width:0; }
.client-entry-summary::-webkit-details-marker { display:none; }
.client-avatar { display:grid; place-items:center; width:46px; height:46px; flex:0 0 46px; border-radius:13px; background:#fff0f2; color:#ae0b29; font-size:20px; font-weight:800; }
.client-entry-label { display:grid; gap:4px; min-width:0; flex:1; }
.client-entry-label strong { color:#202938; font-size:16px; line-height:1.25; overflow-wrap:anywhere; }
.client-entry-label small { color:#64748b; font-size:12px; }
.client-entry-chevron { color:#8491a3; font-size:24px; transition:transform .2s; }
.client-entry[open] > summary .client-entry-chevron { transform:rotate(180deg); }
.client-entry-body { border-top:1px solid #e8edf3; padding:18px 16px 20px; display:grid; gap:20px; }
.client-detail-heading > span { color:#a70b26; font-size:11px; font-weight:800; letter-spacing:.09em; }
.client-detail-heading h3 { font-size:20px; margin:6px 0; color:#202938; }
.client-detail-heading p { font-size:14px; color:#64748b; margin:0; }
.client-detail-section { display:grid; gap:10px; }
.client-detail-section > h3 { display:flex; align-items:center; gap:8px; font-size:16px; margin:0 0 3px; }
.client-detail-section > h3 span { border-radius:99px; background:#edf1f6; color:#5c6c80; padding:2px 9px; font-size:12px; }
.client-machine { padding:15px; border:1px solid #dfe5ed; border-radius:14px; background:#fafbfc; display:grid; gap:14px; }
.client-machine-head { display:flex; align-items:center; gap:12px; min-width:0; }
.client-machine-icon { display:grid; place-items:center; width:38px; height:38px; flex:0 0 38px; border-radius:10px; background:#edf1f6; color:#34465c; font-size:24px; }
.client-machine-head h4 { font-size:15px; line-height:1.3; margin:0 0 4px; overflow-wrap:anywhere; }
.client-machine-meta { color:#66758a; font-size:12px; }
.client-machine-details { display:flex; justify-content:space-between; gap:12px; font-size:13px; }
.client-machine-details > span { color:#6b7789; }
.client-machine-details > strong { text-align:right; overflow-wrap:anywhere; }
.client-machine .machine-control-form { display:grid; gap:8px; margin:0; }
.client-machine .machine-control-form > label { font-size:13px; font-weight:700; margin:0; }
.client-machine-form-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; }
.client-machine-form-row select { min-width:0; width:100%; margin:0; padding:10px; font-size:14px; }
.client-machine-form-row button { padding:10px 12px; font-size:13px; border-radius:9px; }
.client-add-machine { border-top:1px solid #e8edf3; padding-top:16px; }
.client-add-machine > summary { color:#a70b26; font-weight:750; cursor:pointer; font-size:14px; }
.client-add-machine form { display:grid; gap:12px; padding-top:16px; }
.client-add-machine form label { display:grid; gap:5px; font-size:13px; font-weight:650; }
.client-add-machine form input,.client-add-machine form select { width:100%; min-width:0; }
@media(max-width:390px) { .client-entry-summary { padding:13px 12px; } .client-entry-body { padding:16px 12px; } .client-machine-form-row { grid-template-columns:1fr; } }

/* Intervention dossier: mobile-first, clear information hierarchy. */
.details-dialog:has(.mission-detail) { width:min(92vw,560px); padding:22px; border-radius:22px; }
.details-dialog:has(.mission-detail) > .icon-button { position:sticky; top:0; z-index:2; float:right; width:42px; height:42px; min-height:42px; margin:0 0 8px 10px; border-radius:12px; }
.mission-detail { display:grid; gap:18px; clear:none; min-width:0; }
.mission-detail-heading { padding:0 0 16px; border-bottom:1px solid #e6ebf1; }
.mission-detail-kicker { display:block; margin:0 0 10px; color:#aa0d29; font-size:11px; font-weight:800; letter-spacing:.1em; }
.mission-detail-heading h2 { margin:0 0 7px; padding-right:0; color:#202938; font-size:clamp(23px,6vw,29px); line-height:1.2; overflow-wrap:anywhere; }
.mission-detail-purpose { margin:0; font-size:15px; font-weight:650; color:#526276; }
.mission-detail-grid { display:grid; gap:8px; }
.mission-detail-item { display:grid; grid-template-columns:38px minmax(0,1fr); gap:12px; padding:13px; background:#f7f9fc; border:1px solid #e9eef4; border-radius:13px; }
.mission-detail-icon { display:grid; place-items:center; width:38px; height:38px; background:white; border:1px solid #e1e7ef; border-radius:10px; font-size:21px; color:#ad0b29; }
.mission-detail-item > div { min-width:0; display:grid; gap:4px; align-content:center; }
.mission-detail-label { font-size:10px; font-weight:800; letter-spacing:.08em; color:#738094; }
.mission-detail-item strong { font-size:15px; line-height:1.3; color:#202938; }
.mission-detail-value { font-size:14px; line-height:1.4; color:#364458; overflow-wrap:anywhere; }
.mission-detail-team h3 { display:flex; align-items:center; gap:8px; margin:0 0 10px; font-size:16px; color:#202938; }
.mission-detail-team h3 span { padding:2px 8px; border-radius:20px; background:#eef2f6; color:#5f6c7c; font-size:12px; }
.mission-person-list { display:grid; gap:8px; margin:0; padding:0; list-style:none; }
.mission-person { display:flex; align-items:center; gap:10px; padding:11px 12px; border:1px solid #e4eaf1; border-radius:12px; }
.mission-person-avatar { display:grid; place-items:center; width:35px; height:35px; flex:0 0 35px; background:#f0f3f7; border-radius:50%; color:#65758a; font-size:20px; }
.mission-person-info { display:grid; gap:5px; min-width:0; }
.mission-person-info strong { font-size:13px; font-weight:650; overflow-wrap:anywhere; color:#253247; }
.mission-person-info small { width:fit-content; padding:3px 8px; border-radius:7px; font-size:11px; font-weight:750; }
.mission-status-done { background:#e6f5ed; color:#1b7146; }
.mission-status-neutral { background:#eef2f6; color:#596a7d; }
.mission-detail-note { margin:0; padding-top:12px; border-top:1px solid #e6ebf1; color:#758297; font-size:11px; line-height:1.5; }
@media(max-width:400px) { .details-dialog:has(.mission-detail) { padding:16px; } .mission-detail { gap:14px; } .mission-detail-item { padding:10px; } }

/* Global space optimization: remove empty bands while retaining iPhone safe areas. */
:root { --orgasav-footer-height: 94px; }
.network-state { padding-top:4px; padding-bottom:4px; line-height:1.25; }
.page { padding-top:8px; padding-bottom:20px; }
.page > .eyebrow:first-child { margin:0 0 4px; line-height:1.25; }
.page > .eyebrow:first-child + h1 { margin:0 0 14px; }
body > .app-copyright {
  min-height:0;
  padding-top:5px;
  padding-bottom:calc(3px + env(safe-area-inset-bottom));
  gap:0;
}
.app-copyright .home-bottom-link { min-height:52px; }
.app-copyright .app-copyright-text { margin-top:1px; line-height:1.2; }
body { padding-bottom:calc(var(--orgasav-footer-height) + env(safe-area-inset-bottom)) !important; }
html { scroll-padding-bottom:calc(var(--orgasav-footer-height) + 8px + env(safe-area-inset-bottom)); }
body:has(.aci-wizard) { padding-bottom:calc(190px + env(safe-area-inset-bottom)) !important; }

/* Soft right-side navigation: sliding drawer + fading backdrop. */
@media (prefers-reduced-motion: no-preference) {
  .menu-dialog[open]:not(.nav-closing) {
    animation: orgasav-nav-enter 360ms cubic-bezier(.45, 0, .55, 1) both;
  }
  .menu-dialog[open].nav-closing {
    animation:none;
    pointer-events:none;
  }
  .menu-dialog[open].nav-closing::backdrop {
    animation: orgasav-backdrop-exit 400ms ease-in-out both;
  }
  @keyframes orgasav-nav-exit {
    from { transform:translate3d(0,0,0); opacity:1; }
    to { transform:translate3d(102%,0,0); opacity:1; }
  }
  @keyframes orgasav-backdrop-exit {
    from { background:#0d152d66; }
    to { background:transparent; }
  }
  .menu-dialog[open]::backdrop {
    animation: orgasav-backdrop-enter 360ms ease-in-out both;
  }
  @keyframes orgasav-nav-enter {
    from { transform:translate3d(102%,0,0); opacity:1; }
    to { transform:translate3d(0,0,0); opacity:1; }
  }
  @keyframes orgasav-backdrop-enter {
    from { background:transparent; }
    to { background:#0d152d66; }
  }
}

.menu-dialog { will-change:transform; backface-visibility:hidden; }

/* Lower only the copyright visually; preserve shortcut size and placement. */
body > .app-copyright > .app-copyright-text { position:relative; top:20px; }

/* Client creation: title action and centered mobile-friendly modal. */
.page-title-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:6px 0 20px}
.page-title-row h1{margin:0;min-width:0}
.client-create-button{position:relative;flex:0 0 42px;width:42px;height:42px;border:0;border-radius:50%;background:#a60c20;color:transparent;font-size:0;display:grid;place-items:center;cursor:pointer;box-shadow:0 3px 9px #a60c2029}
.client-create-button::before,.client-create-button::after{content:"";position:absolute;top:50%;left:50%;background:#fff;border-radius:2px;transform:translate(-50%,-50%);pointer-events:none}
.client-create-button::before{width:24px;height:3.5px}
.client-create-button::after{width:3.5px;height:24px}
.client-create-button:active{transform:scale(.96)}
.client-create-button:focus-visible{outline:3px solid #f29aab;outline-offset:3px}
.new-client-dialog{position:fixed;inset:0;margin:auto;width:min(92vw,560px);max-width:560px;max-height:min(82dvh,780px);overflow-y:auto;overscroll-behavior:contain;border:1px solid #dbe2eb;border-radius:20px;background:#fff;color:#202938;padding:20px;box-shadow:0 22px 65px #0005}
.new-client-dialog::backdrop{background:#0d152db3}
.new-client-dialog-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
.new-client-dialog-header h2{font-size:20px;line-height:1.2;margin:0}
.new-client-dialog form{display:grid;gap:16px}
.new-client-dialog .form-grid{display:grid;gap:12px}
.new-client-dialog form>.primary{width:100%}
@media(max-width:450px){.page-title-row h1{font-size:1.55rem}.new-client-dialog{padding:18px;max-height:82dvh}}

/* Developer preview is deliberately read-only and visibly distinct. */
.technician-preview-toggle[hidden]{display:none!important}
body.technician-preview #network-state::after{content:" · APERÇU TECHNICIEN (lecture seule)";color:#f17e92;font-weight:700}
body.technician-preview #root button:not(.icon-button){opacity:.8}

/* Keep sync running silently; remove redundant status strip from layout. */
#network-state{display:none!important}

/* iOS standalone PWA: pin the header to the visual viewport.
   Sticky headers can be pulled down by rubber-band overscroll. */
:root{--orgasav-header-height:calc(70px + env(safe-area-inset-top))}
.app-header{
  position:fixed!important;
  top:0;left:0;right:0;
  width:100%;
  z-index:30;
  height:var(--orgasav-header-height);
  min-height:var(--orgasav-header-height);
  box-sizing:border-box;
  padding-top:calc(6px + env(safe-area-inset-top));
  padding-bottom:6px;
}
body{padding-top:var(--orgasav-header-height)!important}
html{overscroll-behavior-y:none}
body{overscroll-behavior-y:none}

/* Heures : quatre indicateurs responsive */
.hours-stats-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0}
.hours-stat{display:flex;flex-direction:column;justify-content:space-between;min-height:112px;padding:18px 14px;border:1px solid var(--border,#dedee3);border-radius:16px;background:var(--card,#fff);box-sizing:border-box;gap:18px}
.hours-stat span{font-size:.83rem;opacity:.72}.hours-stat strong{font-size:clamp(1.35rem,5vw,2rem);font-variant-numeric:tabular-nums;letter-spacing:-.03em}
@media(min-width:900px){.hours-stats-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* Correctif contraste des tuiles heures : thèmes clair et sombre */
.hours-stat{background:var(--hours-tile-bg,#fff);color:var(--hours-tile-fg,#182334);border-color:var(--hours-tile-border,#d4dbe5)}
.hours-stat span,.hours-stat strong{color:inherit!important;opacity:1}
.hours-stat span{opacity:.72}
@media(prefers-color-scheme:dark){:root{--hours-tile-bg:#202e43;--hours-tile-fg:#f0f4fc;--hours-tile-border:#475a73}}
html[data-theme="dark"],body[data-theme="dark"],:root[data-theme="dark"],html.dark,body.dark{--hours-tile-bg:#202e43;--hours-tile-fg:#f0f4fc;--hours-tile-border:#475a73}
html[data-theme="light"],body[data-theme="light"],:root[data-theme="light"]{--hours-tile-bg:#fff;--hours-tile-fg:#182334;--hours-tile-border:#d4dbe5}

/* Planning mensuel des congés : compatible iPhone et thèmes sombre/clair */
.leave-nav{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;text-transform:capitalize}
.leave-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px}
.leave-weekday{text-align:center;font-size:.72rem;padding:6px 0;opacity:.7}
.leave-day,.leave-empty{min-height:65px;border-radius:8px;min-width:0}
.leave-day{background:var(--hours-tile-bg,var(--card,#f1f4f8));border:1px solid var(--hours-tile-border,#ccd3dc);padding:4px 2px;overflow:hidden}
.leave-day.is-today{outline:2px solid #4585dc;outline-offset:-2px}
.leave-number{font-size:.75rem;font-weight:700;display:block;padding-left:3px;color:var(--hours-tile-fg,inherit)}
.leave-marks{display:flex;flex-direction:column;gap:2px;margin-top:3px}
.leave-mark{display:block;font-size:.59rem;border-radius:3px;padding:2px;color:#fff;background:#3979b9;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.leave-conges{background:#297f70}.leave-absence{background:#c17b22}.leave-maladie{background:#a44d66}.leave-formation{background:#5b66b8}.leave-repos{background:#697688}
@media(max-width:420px){.leave-day{min-height:55px}.leave-mark{font-size:.53rem;padding:1px}.leave-grid{gap:2px}}

/* Bureau SAV: alertes lisibles, sans styles globaux .card sur les liens */
.bureau-priorities{display:grid;gap:10px;margin:24px 0;min-width:0}
.bureau-priorities h2{font-size:clamp(1.2rem,5vw,1.65rem);line-height:1.25;margin:0 0 5px}
.bureau-alert{display:flex!important;flex-direction:column;gap:8px;box-sizing:border-box;width:100%;min-width:0;max-width:100%;padding:15px 16px;border:1px solid var(--hours-tile-border,#475a73);border-radius:14px;background:var(--hours-tile-bg,#202e43);color:var(--hours-tile-fg,#f0f4fc)!important;text-decoration:none!important;overflow:hidden;line-height:1.35}
.bureau-alert-main{display:flex;align-items:center;gap:12px;min-width:0}
.bureau-alert-main strong{font-size:1rem;line-height:1.3;min-width:0;flex:1;overflow-wrap:break-word}
.bureau-alert-count{flex:0 0 auto;display:grid;place-items:center;min-width:36px;height:36px;padding:0 7px;box-sizing:border-box;border-radius:10px;background:#314963;color:#fff;font-size:1.05rem;font-weight:750;font-variant-numeric:tabular-nums}
.bureau-alert-arrow{font-size:1.65rem;line-height:1;opacity:.65;flex:0 0 auto}
.bureau-alert-detail{font-size:.84rem;line-height:1.45;opacity:.82;overflow-wrap:anywhere}
.bureau-ok{padding:10px 2px;font-size:.88rem;opacity:.82}
@media(max-width:430px){.bureau-alert{padding:13px 12px}.bureau-alert-main{gap:9px}.bureau-alert-main strong{font-size:.93rem}.bureau-alert-detail{font-size:.8rem}}

/* Bureau Responsable SAV — tuiles cliquables, style de la maquette validée */
.bureau-kpi-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0 22px;min-width:0}
.bureau-kpi,.bureau-kpi:link,.bureau-kpi:visited,.bureau-kpi:hover,.bureau-kpi:active{display:flex;flex-direction:column;align-items:stretch;justify-content:space-between;gap:12px;min-width:0;min-height:154px;box-sizing:border-box;padding:16px 14px;border:1px solid #4a5c77;border-radius:20px;background:#202e43;color:#f2f5fc!important;text-decoration:none!important;box-shadow:inset 0 0 0 1px #ffffff08}
.bureau-kpi:focus-visible{outline:3px solid #78a8e6;outline-offset:3px}
.bureau-kpi:active{transform:scale(.985)}
.bureau-kpi-top{display:flex;align-items:flex-start;justify-content:space-between;gap:6px;min-width:0}
.bureau-kpi-label{font-size:.88rem;line-height:1.3;font-weight:400;color:#c6d0df;overflow-wrap:break-word;min-width:0}
.bureau-kpi-icon{width:23px;height:23px;flex:0 0 23px;color:#b7c6da}
.bureau-kpi-icon svg{display:block;width:100%;height:100%}
.bureau-kpi-value{font-size:clamp(1.45rem,5vw,2rem);line-height:1.15;font-weight:750;letter-spacing:-.035em;color:#f6f8fc!important;font-variant-numeric:tabular-nums}
.bureau-kpi-detail{font-size:.8rem;line-height:1.35;color:#b5c3d5;overflow-wrap:break-word}
@media(min-width:850px){.bureau-kpi-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:390px){.bureau-kpi-grid{gap:9px}.bureau-kpi,.bureau-kpi:link,.bureau-kpi:visited{padding:13px 11px;min-height:145px}.bureau-kpi-label{font-size:.8rem}.bureau-kpi-detail{font-size:.74rem}}

/* Les deux compteurs d’entretien restent en deux colonnes sur tous les écrans. */
.bureau-kpi-grid.maintenance-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr));margin:12px 0 0}

/* Bureau SAV : panneau performance fidèle à la maquette */
.bureau-performance{margin:18px 0 28px;padding:20px;border:1px solid #344157;border-radius:24px;background:#111b2b;color:#f3f6fb;min-width:0}
.bureau-performance-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:27px}
.bureau-performance-head h2{margin:0;font-size:1.1rem;font-weight:700}
.bureau-performance-head>span{color:#b4bfcd;font-size:.84rem;white-space:nowrap}
.bureau-productivity-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.bureau-productivity-heading>strong:first-child{font-size:.9rem;font-weight:600}
.bureau-productivity-value{font-size:1.5rem;font-variant-numeric:tabular-nums;white-space:nowrap}
.bureau-productivity-track{height:9px;border-radius:99px;background:#3c414b;overflow:hidden}
.bureau-productivity-track>span{display:block;height:100%;border-radius:inherit;background:#299579;transition:width .25s ease}
.bureau-productivity-caption{font-size:.78rem;line-height:1.45;color:#adb9c8;margin:9px 0 23px}
.bureau-performance-bottom{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding-top:22px;border-top:1px solid #344157}
.bureau-performance-bottom>div{display:flex;flex-direction:column;gap:8px;min-width:0}
.bureau-performance-bottom span{font-size:.84rem;color:#b3bfce}
.bureau-performance-bottom strong{font-size:1.4rem;line-height:1.1;font-variant-numeric:tabular-nums}
.bureau-performance-bottom small{font-size:.75rem;line-height:1.35;color:#a5b3c5}
.bureau-performance-note{margin:20px 0 0;font-size:.75rem;color:#a5b3c5}
@media(max-width:390px){.bureau-performance{padding:16px}.bureau-performance-head{margin-bottom:22px}}

/* Bureau : liste prioritaire identique à la référence, sans fond parasite */
.bureau-priorities{display:block!important;box-sizing:border-box;margin:22px 0!important;padding:18px 16px 4px!important;border:1px solid #344157!important;border-radius:23px!important;background:#111b2b!important;color:#f3f6fb!important;box-shadow:none!important;overflow:hidden}
.bureau-priorities-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 8px}
.bureau-priorities-head h2{margin:0!important;font-size:1.13rem!important;line-height:1.3;color:#f3f6fb}
.bureau-priorities-head>span{font-size:.76rem;color:#9faabb;white-space:nowrap}
.bureau-priority-list{display:block!important;background:transparent!important;min-width:0}
.bureau-priority-row,.bureau-priority-row:link,.bureau-priority-row:visited,.bureau-priority-row:hover,.bureau-priority-row:active{display:flex!important;flex-direction:row;align-items:center;gap:14px;min-width:0;box-sizing:border-box;width:100%;padding:19px 0;border:0;border-bottom:1px solid #303a49;border-radius:0;background:transparent!important;color:#f1f4fa!important;text-decoration:none!important;box-shadow:none!important}
.bureau-priority-row:last-child{border-bottom:0}
.bureau-priority-row:focus-visible{outline:2px solid #7daae4;outline-offset:-2px}
.bureau-priority-icon{display:grid;place-items:center;flex:0 0 50px;width:50px;height:50px;border-radius:13px;background:#2a2f37}
.bureau-priority-icon svg{display:block;width:26px;height:26px}
.bureau-priority-copy{display:flex;flex:1;flex-direction:column;gap:5px;min-width:0}
.bureau-priority-copy strong{font-size:.94rem;line-height:1.35;font-weight:650;color:#f4f6fa}
.bureau-priority-copy small{font-size:.81rem;line-height:1.4;color:#aab5c4;overflow-wrap:break-word}
.bureau-priorities .bureau-ok{margin:0;padding:17px 0;color:#aab5c4;font-size:.82rem;border-bottom:1px solid #303a49}
@media(max-width:390px){.bureau-priorities{padding:16px 13px 3px!important}.bureau-priority-icon{flex-basis:44px;width:44px;height:44px}.bureau-priority-row{gap:11px!important}}

/* Respecter les états des boutons de notifications sur iPhone */
.push-settings button[hidden]{display:none!important}
.push-settings .actions{display:flex;flex-wrap:wrap;gap:10px}
.push-settings .actions button{max-width:100%;white-space:normal}

.profile-photo-card{display:flex;flex-direction:column;align-items:center;gap:14px}
.profile-photo-card h2{align-self:stretch;margin:0}
.profile-photo-preview{width:124px;height:124px;border-radius:50%;overflow:hidden;border:2px solid #54677e;background:#293b53;display:grid;place-items:center}
.profile-photo-preview img{width:100%;height:100%;object-fit:cover}
.profile-photo-preview img[hidden],.profile-photo-preview span[hidden],.profile-photo-actions button[hidden],.profile-photo-actions input[hidden]{display:none!important}
.profile-photo-preview span{font-size:3.4rem}
.profile-photo-actions{display:flex;justify-content:center;flex-wrap:wrap;gap:10px}
.profile-photo-actions label{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;text-align:center;padding:11px 14px;border-radius:12px;border:1px solid #52647e;background:#283a53;color:#f3f6fb;font-weight:600}
.profile-photo-actions button{white-space:normal}

/* Avatar cliquable : sélecteur natif iOS / Android / ordinateur */
.profile-avatar-wrap{position:relative;width:132px;height:132px;margin:0 auto}
.profile-avatar-picker{position:relative;display:block;width:124px;height:124px;border-radius:50%;cursor:pointer;-webkit-tap-highlight-color:transparent}
.profile-avatar-picker:focus-within{outline:2px solid #8bb7ef;outline-offset:4px}
.profile-avatar-picker .profile-photo-preview{display:grid;width:124px;height:124px;box-sizing:border-box}
.profile-avatar-edit{position:absolute;right:1px;bottom:5px;display:grid;place-items:center;width:27px;height:27px;border-radius:50%;background:#354c69;border:2px solid #111b2b;color:#fff;font-size:16px}
.profile-avatar-erase,.profile-avatar-erase:hover,.profile-avatar-erase:focus{position:absolute;right:1px;bottom:5px;display:grid;place-items:center;width:32px;height:32px;min-width:32px;padding:6px;border-radius:50%;background:#39485c;color:#fff;border:1px solid #68798e;cursor:pointer}
.profile-avatar-erase svg{width:17px;height:17px}
.profile-avatar-erase[hidden],.profile-avatar-edit[hidden],#profile-photo-file[hidden]{display:none!important}

/* Carte d'identité collaborateur */
.profile-identity-layout{display:flex;align-items:center;gap:22px;flex-wrap:wrap;margin:22px 0 10px}
.profile-identity-layout .profile-avatar-wrap{margin:0;flex:none}
.profile-identity-details{flex:1;min-width:170px}
.profile-identity-details h3{margin:3px 0 15px;font-size:1.35rem}
.profile-identity-details p{margin:4px 0 13px;overflow-wrap:anywhere}
.profile-identity-edit{margin-top:16px;border-top:1px solid #40516a;padding-top:14px}
.profile-identity-edit form{display:grid;gap:10px;margin-top:12px}
.member-identity-editor{display:grid;gap:8px;margin:12px 0 18px}
.member-identity-editor button{justify-self:start}
@media(max-width:420px){.profile-identity-layout{gap:16px}.profile-identity-details{min-width:145px}}

/* Carte d'identité professionnelle : format paysage compact */
.profile-identity-card{padding:18px 20px!important;max-width:740px;margin-inline:auto}
.profile-identity-card .profile-identity-layout{display:grid;grid-template-columns:104px minmax(0,1fr);align-items:center;gap:18px;margin:0;min-height:126px}
.profile-identity-card .profile-avatar-wrap{width:104px;height:104px;margin:0}
.profile-identity-card .profile-avatar-picker,.profile-identity-card .profile-photo-preview{width:100px;height:100px}
.profile-identity-card .profile-identity-details{min-width:0;display:flex;flex-direction:column;gap:7px}
.profile-identity-card .profile-identity-details h3{font-size:clamp(1.1rem,4.5vw,1.55rem);line-height:1.16;margin:0;overflow-wrap:anywhere}
.profile-identity-card .profile-identity-details p{margin:0;line-height:1.25;overflow-wrap:anywhere}
.profile-identity-card .profile-identity-company{font-weight:650;font-size:.98rem}
.profile-identity-card .profile-identity-role{font-size:.88rem;color:var(--muted,#aebdd0)}
.profile-identity-card .profile-photo-feedback[hidden]{display:none!important}
.profile-identity-card .profile-photo-feedback{margin:8px 0 0}
.profile-identity-card .profile-identity-edit{margin-top:10px}
@media(max-width:380px){.profile-identity-card{padding:14px!important}.profile-identity-card .profile-identity-layout{grid-template-columns:88px minmax(0,1fr);gap:12px;min-height:100px}.profile-identity-card .profile-avatar-wrap{width:88px;height:88px}.profile-identity-card .profile-avatar-picker,.profile-identity-card .profile-photo-preview{width:84px;height:84px}}

/* Alignement vertical de la photo et hiérarchie typographique de la carte */
.profile-identity-card .profile-identity-layout{grid-template-columns:112px minmax(0,1fr);align-items:center;gap:20px;min-height:178px}
.profile-identity-card .profile-avatar-wrap{width:112px;height:112px;align-self:center;justify-self:center}
.profile-identity-card .profile-avatar-picker,.profile-identity-card .profile-photo-preview{width:108px;height:108px}
.profile-identity-card .profile-identity-details{display:grid;gap:12px;align-content:center}
.profile-identity-card .profile-identity-field{display:grid;gap:3px;min-width:0}
.profile-identity-card .profile-identity-label{font-size:.73rem;font-weight:600;letter-spacing:.025em;color:#aebdd0;line-height:1.2}
.profile-identity-card .profile-identity-details h3{font-size:clamp(1.05rem,4.1vw,1.4rem);font-weight:750;line-height:1.2}
.profile-identity-card .profile-identity-company{font-size:clamp(.87rem,3.6vw,1rem);font-weight:650;line-height:1.25}
.profile-identity-card .profile-identity-role{font-size:clamp(.87rem,3.5vw,.98rem);font-weight:600;line-height:1.25;color:inherit}
@media(max-width:380px){.profile-identity-card .profile-identity-layout{grid-template-columns:88px minmax(0,1fr);gap:12px;min-height:166px}.profile-identity-card .profile-avatar-wrap{width:88px;height:88px}.profile-identity-card .profile-avatar-picker,.profile-identity-card .profile-photo-preview{width:84px;height:84px}.profile-identity-card .profile-identity-details{gap:10px}}

/* Carte profil v3 : alignement exact et étiquettes colorées, sans espaces superflus */
.profile-identity-card{padding:16px 18px!important}
.profile-identity-card .profile-identity-layout{
  display:flex!important;flex-flow:row nowrap!important;align-items:stretch!important;
  gap:16px!important;min-height:0!important;margin:0!important
}
.profile-identity-card .profile-avatar-wrap{
  position:relative;display:flex!important;align-items:center!important;justify-content:center!important;
  flex:0 0 104px!important;width:104px!important;height:auto!important;
  min-height:104px!important;margin:0!important;align-self:stretch!important
}
.profile-identity-card .profile-avatar-picker{width:100px!important;height:100px!important;flex:none}
.profile-identity-card .profile-photo-preview{width:100px!important;height:100px!important}
.profile-identity-card .profile-identity-details{
  display:flex!important;flex:1 1 0!important;flex-direction:column!important;
  justify-content:center!important;align-items:stretch!important;
  min-width:0!important;gap:8px!important;margin:0!important;padding:0!important
}
.profile-identity-card .profile-identity-field{
  display:flex!important;flex-direction:column!important;align-items:flex-start!important;
  gap:1px!important;margin:0!important;padding:0!important
}
.profile-identity-card .profile-identity-label{
  display:block!important;color:#79baf6!important;font-size:11px!important;
  font-weight:700!important;letter-spacing:.025em!important;line-height:1.15!important;
  margin:0!important;padding:0!important
}
.profile-identity-card .profile-identity-field h3,
.profile-identity-card .profile-identity-field p{
  margin:0!important;padding:0!important;line-height:1.17!important;
  color:inherit;overflow-wrap:anywhere
}
.profile-identity-card .profile-identity-field h3{font-size:clamp(16px,4.3vw,20px)!important;font-weight:750!important}
.profile-identity-card .profile-identity-company{font-size:clamp(14px,3.7vw,16px)!important;font-weight:650!important}
.profile-identity-card .profile-identity-role{font-size:clamp(13px,3.5vw,15px)!important;font-weight:600!important}
@media(max-width:380px){
 .profile-identity-card{padding:13px 12px!important}
 .profile-identity-card .profile-identity-layout{gap:11px!important}
 .profile-identity-card .profile-avatar-wrap{flex-basis:86px!important;width:86px!important;min-height:86px!important}
 .profile-identity-card .profile-avatar-picker,.profile-identity-card .profile-photo-preview{width:84px!important;height:84px!important}
 .profile-identity-card .profile-identity-details{gap:7px!important}
}

/* Uniformiser les valeurs de la carte d'identité */
.profile-identity-card .profile-identity-field h3,
.profile-identity-card .profile-identity-field .profile-identity-company,
.profile-identity-card .profile-identity-field .profile-identity-role{color:#edf2fa!important}

/* Bureau SAV — thème clair : mêmes tuiles et hiérarchie que le thème sombre. */
:root:not([data-theme="dark"]) .bureau-kpi,
:root:not([data-theme="dark"]) .bureau-kpi:link,
:root:not([data-theme="dark"]) .bureau-kpi:visited,
:root:not([data-theme="dark"]) .bureau-kpi:hover,
:root:not([data-theme="dark"]) .bureau-kpi:active{
  background:#ffffff!important;color:#202d40!important;border-color:#d4deeb!important;
  box-shadow:0 2px 8px #17283d0a!important
}
:root:not([data-theme="dark"]) .bureau-kpi-label{color:#52647b!important}
:root:not([data-theme="dark"]) .bureau-kpi-icon{color:#6a809c!important}
:root:not([data-theme="dark"]) .bureau-kpi-value{color:#17263a!important}
:root:not([data-theme="dark"]) .bureau-kpi-detail{color:#65758a!important}
:root:not([data-theme="dark"]) .bureau-performance{
  background:#ffffff!important;color:#1d2a3c!important;border-color:#d4deeb!important
}
:root:not([data-theme="dark"]) .bureau-performance-head h2,
:root:not([data-theme="dark"]) .bureau-productivity-heading,
:root:not([data-theme="dark"]) .bureau-performance-bottom strong{color:#1d2a3c!important}
:root:not([data-theme="dark"]) .bureau-performance-head>span,
:root:not([data-theme="dark"]) .bureau-productivity-caption,
:root:not([data-theme="dark"]) .bureau-performance-bottom span,
:root:not([data-theme="dark"]) .bureau-performance-bottom small,
:root:not([data-theme="dark"]) .bureau-performance-note{color:#617287!important}
:root:not([data-theme="dark"]) .bureau-performance-bottom{border-top-color:#dce4ee!important}
:root:not([data-theme="dark"]) .bureau-productivity-track{background:#e4ebf2!important}
:root:not([data-theme="dark"]) .bureau-priorities{
  background:#ffffff!important;color:#1d2a3c!important;border-color:#d4deeb!important
}
:root:not([data-theme="dark"]) .bureau-priorities-head h2,
:root:not([data-theme="dark"]) .bureau-priority-copy strong,
:root:not([data-theme="dark"]) .bureau-priority-row,
:root:not([data-theme="dark"]) .bureau-priority-row:link,
:root:not([data-theme="dark"]) .bureau-priority-row:visited{color:#1d2a3c!important}
:root:not([data-theme="dark"]) .bureau-priorities-head>span,
:root:not([data-theme="dark"]) .bureau-priority-copy small,
:root:not([data-theme="dark"]) .bureau-priorities .bureau-ok{color:#64748a!important}
:root:not([data-theme="dark"]) .bureau-priority-row,
:root:not([data-theme="dark"]) .bureau-priorities .bureau-ok{border-bottom-color:#e1e8f0!important}
:root:not([data-theme="dark"]) .bureau-priority-icon{background:#edf2f8!important;color:#60758d!important}

/* Accès terrain toujours visible pour les responsables SAV */
.bureau-terrain-shortcut{display:flex;flex-wrap:wrap;gap:10px;margin:8px 0 16px}
.bureau-terrain-shortcut>a{flex:1 1 210px;text-align:center}

/* Fiche matériel dépliable et modifiable — compatible thème clair/sombre. */
.client-machine-expand{display:block;padding:0;overflow:hidden}
.client-machine-expand>.client-machine-head{list-style:none;cursor:pointer;padding:15px;display:flex;align-items:center}
.client-machine-expand>.client-machine-head::-webkit-details-marker{display:none}
.client-machine-expand .client-machine-head>div{flex:1;min-width:0}
.client-machine-chevron{color:var(--muted,#8292a7);font-size:24px;transition:transform .2s}
.client-machine-expand[open] .client-machine-chevron{transform:rotate(180deg)}
.client-machine-expanded{padding:0 15px 15px;border-top:1px solid var(--line,#dfe5ed)}
.machine-edit-form{display:grid;gap:12px;padding-top:14px}
.machine-edit-form label{display:grid;gap:5px;font-size:13px;font-weight:650}
.machine-edit-form input,.machine-edit-form select{width:100%;min-width:0}
.client-machine-actions{display:flex;flex-wrap:wrap;gap:9px}
.client-machine-actions button{flex:1 1 190px;white-space:normal}
.danger-outline{color:#b91c37!important;border-color:#b91c37!important}
:root[data-theme="dark"] .client-machine-expand{background:#1b2535;border-color:#3b4c65;color:#edf2fa}
:root[data-theme="dark"] .client-machine-expanded{border-top-color:#3b4c65}
:root[data-theme="dark"] .client-machine-meta{color:#b3c2d5}
:root[data-theme="dark"] .client-machine-icon{background:#2c3b51;color:#d7e2f2}

/* Distances routières et repères GPS du suivi journalier */
.gps-color-dot{display:inline-block;width:12px;height:12px;border:2px solid #fff;border-radius:50%;vertical-align:middle;margin-right:8px;box-shadow:0 0 0 1px #758399}
.gps-leg-distance{display:block;margin:3px 0 9px 21px;font-size:.87rem;color:var(--muted,#64748b)}
.gps-distance-summary{font-weight:700;margin:12px 0;padding:10px 12px;border:1px solid var(--line,#64748b);border-radius:10px}

.gps-leg-alert{color:#f87171!important;font-weight:750}
.gps-leg-watch{color:#d97706!important;font-weight:650}

.gps-dashboard-alert{display:block;padding:12px 14px;margin-bottom:12px;border:1px solid #d97706;border-radius:12px;color:var(--accent,#a60c20)!important;font-weight:650;text-decoration:none;background:rgba(217,119,6,.12)}
.gps-dashboard-alert:visited,.gps-dashboard-alert:hover,.gps-dashboard-alert:focus-visible{color:var(--accent,#a60c20)!important}

/* Common compact tabs for team interventions and leave calendars. */
.planning-view-switch{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:4px 0 18px}
.planning-view-switch>a{display:flex;align-items:center;justify-content:center;min-width:0;min-height:44px;padding:10px 6px;border-radius:12px;text-align:center;font-size:clamp(.76rem,3.5vw,.95rem);font-weight:700;white-space:nowrap;line-height:1.15;text-decoration:none}
.planning-page>.eyebrow{margin-bottom:6px}
.planning-page>.page-title-row{margin-top:0;margin-bottom:14px}

/* App-wide native selection policy: only editable text fields retain selection. */
html,body,body *:not(input):not(textarea):not([contenteditable]):not([contenteditable="true"]){
 -webkit-user-select:none;
 user-select:none;
 -webkit-touch-callout:none;
}
input,textarea,[contenteditable],[contenteditable="true"],[role="textbox"]{
 -webkit-user-select:text!important;
 user-select:text!important;
 -webkit-touch-callout:default!important;
}


/* Top Sécurité: one-screen compact mobile steps, with scrolling only for expanded details. */
.top-wizard{display:flex;flex-direction:column;gap:6px;min-width:0}
.top-wizard>.eyebrow,.top-wizard>p,.top-wizard>h2{margin:0}
.top-wizard>.track{margin:3px 0}
.top-risk-list{display:grid;grid-template-columns:1fr;gap:2px;min-width:0}
.top-risk-list .check-row{display:flex;align-items:center;gap:12px;margin:0;padding:5px 0;min-height:38px;font-size:.94rem;line-height:1.22;font-weight:650}
.top-risk-list .check-row input{flex:0 0 24px;width:24px;height:24px;min-height:24px;margin:0}
.top-risk-list .check-row span{min-width:0}
.top-extra{margin:5px 0 0;border:1px solid var(--line);border-radius:10px;min-width:0}
.top-extra>summary{display:flex;align-items:center;min-height:42px;padding:8px 12px;font-size:.86rem;font-weight:700;list-style:none}
.top-extra>summary::-webkit-details-marker{display:none}
.top-extra>summary::after{content:'⌄';margin-left:auto;font-size:1.2rem}
.top-extra[open]>summary::after{transform:rotate(180deg)}
.top-extra-fields{padding:0 12px 12px}
.top-extra-fields label{margin:9px 0 4px;font-size:.83rem}
.top-extra-fields textarea{min-height:65px;resize:vertical}
.top-wizard>.actions{margin-top:auto;padding-top:8px}
.top-wizard>.actions button{min-height:44px}
.top-draft-note{font-size:.72rem!important;line-height:1.3;color:var(--muted)}
/* Signature stays legible in both themes: pale paper and dark ink. */
#top-sign-pad{background:#e8edf5!important;border:2px solid #71839d!important;box-shadow:inset 0 1px 3px #11182716}
:root[data-theme="dark"] #top-sign-pad{background:#dce5f0!important;border-color:#8498b4!important}
@media(max-width:600px){
  body:has(.top-wizard) .page{padding-top:8px;padding-bottom:8px}
  body:has(.top-wizard) .page>h1{margin:0 0 8px;font-size:1.35rem}
  .top-wizard{padding:12px!important;margin:6px 0!important;gap:4px}
  .top-wizard>.eyebrow{font-size:.68rem}
  .top-wizard>h2{font-size:1.05rem}
  .top-wizard>.actions{margin-top:6px;padding-top:0}
  .top-wizard .signature-pad{height:clamp(110px,19dvh,170px)!important}
}
@media(max-width:600px) and (min-height:700px){
  .top-wizard{max-height:calc(100dvh - 255px);overflow-y:auto;overscroll-behavior:contain}
}


/* Archived report PDF cards: follow the active theme inside the modal. */
:root[data-theme="dark"] #report-pdf-list .card{
  background:#243248!important;
  color:#eef3fb!important;
  border:1px solid #455872!important;
  box-shadow:none!important;
}
:root[data-theme="dark"] #report-pdf-list .card strong{color:#eef3fb!important}
:root[data-theme="dark"] #report-pdf-list .card .small{color:#b9c8db!important}
:root[data-theme="dark"] #report-pdf-list .card .secondary{
  background:#31425a!important;
  color:#f0f5fc!important;
  border-color:#526784!important;
}
:root:not([data-theme="dark"]) #report-pdf-list .card{
  background:#fff;color:#202735;border-color:#d9dfe7;
}
#report-pdf-list .card{padding:14px 16px;margin:10px 0;border-radius:14px}
#report-pdf-list .card strong{display:block;font-size:1rem}
#report-pdf-list .card .small{margin:5px 0 10px}
#report-pdf-list .card button{min-height:42px}


/* ACI signing: separate client/technician cards, themed signing surfaces. */
.aci-signature-sections{display:grid;gap:14px}
.aci-signature-party{min-width:0;padding:16px;border:1px solid var(--line);border-radius:16px;background:#f5f7fa}
.aci-signature-party h3{margin:0 0 10px;font-size:1.05rem}
.aci-signature-party label{margin:8px 0 6px}
.aci-signature-party .aci-note-label{margin:12px 0 7px}
.aci-signature-party [data-aci-clear]{margin:8px 0 0}
.aci-signature-party .aci-signature{display:block;width:100%;height:clamp(120px,22dvh,190px);border-radius:12px;touch-action:none}
:root[data-theme="dark"] .aci-signature-party{background:#202d40!important;border-color:#465a75!important;color:#edf2fa!important}
:root[data-theme="dark"] .aci-signature-party h3,
:root[data-theme="dark"] .aci-signature-party .aci-note-label{color:#edf2fa!important}
:root[data-theme="dark"] .aci-signature-party input{background:#26364c!important;color:#edf2fa!important;border-color:#60718a!important}
:root[data-theme="dark"] .aci-signature-party .aci-signature{
  background:#dce5f0!important;border:2px solid #8498b4!important;
  box-shadow:inset 0 1px 3px #11182716;
}
:root[data-theme="dark"] .aci-signature-party .secondary{background:#31425a!important;color:#f0f5fc!important;border-color:#526784!important}
:root:not([data-theme="dark"]) .aci-signature-party{background:#f5f7fa;color:#202938}
:root:not([data-theme="dark"]) .aci-signature-party .aci-signature{background:#fff;border:2px solid #b0bdce}
@media(max-width:600px){.aci-panel:has(.aci-signature-sections){padding:16px 12px 22px}.aci-signature-party{padding:12px}.aci-panel:has(.aci-signature-sections) .aci-title{margin-bottom:12px}}


/* ACI control status options inherit the selected theme, including radio controls. */
:root[data-theme="dark"] .aci-panel .aci-choice{
  background:#26364c!important;color:#eaf1fa!important;
  border:1px solid #50637e!important;
}
:root[data-theme="dark"] .aci-panel .aci-choice span{color:#eaf1fa!important}
:root[data-theme="dark"] .aci-panel .aci-choice.selected{
  background:#37455e!important;border:2px solid #d41a35!important;
}
:root[data-theme="dark"] .aci-panel .aci-choice input[type="radio"]{
  appearance:none;-webkit-appearance:none;background:#1c293b!important;
  border:2px solid #a9b9cc!important;border-radius:50%;
  width:24px;height:24px;flex:0 0 24px;position:relative;
}
:root[data-theme="dark"] .aci-panel .aci-choice input[type="radio"]:checked{
  border-color:#e33c54!important;background:#e33c54!important;
  box-shadow:inset 0 0 0 5px #26364c;
}
:root:not([data-theme="dark"]) .aci-panel .aci-choice{background:#fff;color:#0877d3}
:root:not([data-theme="dark"]) .aci-panel .aci-choice.selected{background:#fff1f3;border-color:#b20a25}


/* Signature pads: show white ink on a dark surface without changing saved ink pixels.
   The visual filter is CSS-only: PNG data remains original dark strokes for PDF. */
html[data-theme="dark"] #top-sign-pad,
html[data-theme="dark"] canvas[data-aci-sign]{
  background:#dce5f0!important;
  filter:invert(1) hue-rotate(180deg);
  border-color:#a8b8ce!important;
}
html[data-theme="light"] #top-sign-pad,
html[data-theme="light"] canvas[data-aci-sign]{
  filter:none!important;
}


/* ACI mobile control results: compact, aligned and theme-aware. */
.aci-panel .aci-options{gap:9px!important}
.aci-panel .aci-choice{
  display:flex!important;flex-direction:row!important;align-items:center!important;
  gap:12px!important;min-height:54px!important;padding:11px 14px!important;
  margin:0!important;border-radius:12px!important;
  font-size:15px!important;line-height:1.3!important;
}
.aci-panel .aci-choice input[type="radio"]{
  width:22px!important;height:22px!important;min-width:22px!important;
  flex:0 0 22px!important;margin:0!important;padding:0!important;
  border-radius:50%!important;aspect-ratio:1!important;
}
.aci-panel .aci-choice span{flex:1;min-width:0}
:root[data-theme="dark"] .aci-panel .aci-choice.selected{
  border-width:1px!important;border-color:#e33c54!important;
}
:root[data-theme="dark"] .aci-panel .aci-choice input[type="radio"]:checked{
  background:#e33c54!important;border-color:#e33c54!important;
  box-shadow:inset 0 0 0 5px #26364c!important;
}
/* Dock the control navigation directly against the persistent shortcut footer. */
body:has(.aci-wizard) .aci-footer{
  bottom:calc(75px + env(safe-area-inset-bottom))!important;
  margin:0!important;box-shadow:none!important;
}
:root[data-theme="dark"] body:has(.aci-wizard) .aci-footer{
  background:#1c293b!important;color:#c3d0e0!important;
  border-top:1px solid #40516b!important;
}
:root[data-theme="dark"] body:has(.aci-wizard) .aci-footer .aci-counter{color:#c3d0e0!important}
:root[data-theme="dark"] body:has(.aci-wizard) .aci-footer .aci-back{
  background:#304159!important;color:#eaf1fa!important;border:1px solid #51647f!important;
}
:root[data-theme="dark"] body:has(.aci-wizard) .aci-footer .aci-next{
  background:#b20a25!important;color:#fff!important;
}
:root:not([data-theme="dark"]) body:has(.aci-wizard) .aci-footer{
  background:#fff!important;color:#64748b!important;border-top:1px solid #d8dfe9!important;
}
@media(max-width:600px){
  .aci-panel .aci-options{gap:8px!important}
  .aci-panel .aci-choice{min-height:52px!important;padding:10px 12px!important}
}


/* Restore the original Memoric-Présence control geometry; theme only the palette.
   Native radio controls avoid iOS Safari's stretched custom radio rendering. */
.aci-panel .aci-choice{
  display:flex!important;flex-direction:row!important;align-items:center!important;
  gap:14px!important;min-height:64px!important;padding:14px 16px!important;
  font-size:16px!important;line-height:1.35!important;
}
.aci-panel .aci-choice input[type="radio"],
:root[data-theme="dark"] .aci-panel .aci-choice input[type="radio"]{
  -webkit-appearance:radio!important;appearance:auto!important;
  display:inline-block!important;box-sizing:border-box!important;
  width:25px!important;height:25px!important;
  min-width:25px!important;min-height:25px!important;
  max-width:25px!important;max-height:25px!important;
  flex:0 0 25px!important;aspect-ratio:1 / 1!important;
  margin:0!important;padding:0!important;
  border:0!important;border-radius:50%!important;
  background:transparent!important;box-shadow:none!important;
  accent-color:#b20a25!important;filter:none!important;
  vertical-align:middle!important;
}
.aci-panel .aci-choice span{display:block;flex:1;min-width:0}
:root[data-theme="dark"] .aci-panel .aci-choice{background:#26364c!important;color:#eaf1fa!important;border-color:#50637e!important}
:root[data-theme="dark"] .aci-panel .aci-choice.selected{background:#37455e!important;border:1.5px solid #e33c54!important}
@media(max-width:600px){
  .aci-panel .aci-options{gap:12px!important}
  .aci-panel .aci-choice{min-height:64px!important;padding:14px 16px!important}
}


/* ACI progress header: undo legacy 5px clipping on the wrapper.
   Keep chapter labels visible and only clip the actual progress track. */
.aci-wizard .aci-progress{
  display:block!important;height:auto!important;min-height:0!important;
  overflow:visible!important;background:transparent!important;
  border-radius:0!important;margin:0 0 20px!important;
}
.aci-wizard .aci-stages{
  display:flex!important;justify-content:space-between!important;
  align-items:center!important;gap:8px!important;
  width:100%!important;overflow-x:auto!important;
  padding:4px 0 12px!important;white-space:nowrap!important;
  scrollbar-width:none;
}
.aci-wizard .aci-stages::-webkit-scrollbar{display:none}
.aci-wizard .aci-stages span{font-size:clamp(10px,2.6vw,14px);line-height:1.3;flex:0 0 auto}
.aci-wizard .aci-stages .active{color:#b20a25!important;font-weight:800!important}
.aci-wizard .aci-progress-track{
  display:block!important;width:100%!important;height:5px!important;
  min-height:5px!important;overflow:hidden!important;
  border-radius:99px!important;background:#dce2e9!important;
}
.aci-wizard .aci-progress-track>div{
  display:block!important;height:100%!important;min-height:5px!important;
  background:#b20a25!important;border-radius:99px!important;
  transition:width 180ms ease;
}
:root[data-theme="dark"] .aci-wizard .aci-stages{color:#aabbd0!important}
:root[data-theme="dark"] .aci-wizard .aci-stages span{color:#aabbd0!important}
:root[data-theme="dark"] .aci-wizard .aci-stages .active{color:#f0445e!important}
:root[data-theme="dark"] .aci-wizard .aci-progress-track{background:#43546c!important}
:root[data-theme="dark"] .aci-wizard .aci-progress-track>div{background:#e22a46!important}
:root:not([data-theme="dark"]) .aci-wizard .aci-stages{color:#64748b!important}
:root:not([data-theme="dark"]) .aci-wizard .aci-progress-track{background:#dce2e9!important}
@media(max-width:380px){.aci-wizard .aci-stages{gap:5px!important}.aci-wizard .aci-stages span{font-size:10px}}


/* Content-sized pages: reserve the fixed footer once, not in both body and wizard.
   The action bar stays docked above shortcuts; short screens stop at their content. */
:root{--orgasav-aci-action-height:72px}
body:has(.aci-wizard){
  padding-bottom:calc(var(--orgasav-footer-height) + var(--orgasav-aci-action-height) + 12px + env(safe-area-inset-bottom))!important;
}
body:has(.aci-wizard) .aci-wizard{
  height:auto!important;min-height:0!important;max-height:none!important;
  padding-bottom:0!important;margin-bottom:0!important;
}
body:has(.aci-wizard) .aci-panel{
  height:auto!important;min-height:0!important;max-height:none!important;
  margin-bottom:0!important;
}
body:has(.aci-wizard) .page{
  height:auto!important;min-height:0!important;
  padding-bottom:0!important;
}
body:has(.aci-wizard) .aci-footer{
  bottom:calc(var(--orgasav-footer-height) + env(safe-area-inset-bottom))!important;
  min-height:var(--orgasav-aci-action-height);
}
@media(max-width:600px){
  body:has(.aci-wizard) .aci-wizard{padding-bottom:0!important}
  body:has(.aci-wizard) .aci-panel{padding-bottom:18px!important}
}

/* Responsive ACI docking: actual footer box height is measured in app.js. */
body:has(.aci-wizard) .aci-footer{
  bottom:var(--orgasav-measured-footer-height, var(--orgasav-footer-height))!important;
  margin:0!important;
}
body:has(.aci-wizard){
  padding-bottom:calc(var(--orgasav-measured-footer-height, var(--orgasav-footer-height)) + var(--orgasav-aci-action-height) + 12px)!important;
}

/* ACIForm : un seul signataire par écran, pad large et responsive. */
.aci-panel .aci-signature-party{width:100%;min-width:0}
.aci-panel canvas.aci-signature{display:block;width:100%;height:auto;aspect-ratio:650/360;max-height:55dvh;min-height:210px;box-sizing:border-box;touch-action:none}

/* Global feedback overlay: never occupies document flow or shifts the calendar. */
#message.orga-toast:not([hidden]){
 position:fixed!important;inset:auto!important;
 top:50%!important;left:50%!important;bottom:auto!important;right:auto!important;
 transform:translate(-50%,-50%)!important;
 z-index:2147483000!important;
 width:max-content!important;max-width:min(420px,calc(100vw - 40px))!important;
 box-sizing:border-box!important;
 display:flex!important;align-items:center!important;gap:12px!important;
 padding:16px 18px!important;margin:0!important;
 border-radius:18px!important;
 background:#ffffff!important;color:#1d293b!important;
 border:1px solid #d7e0eb!important;
 box-shadow:0 16px 48px rgba(0,0,0,.28)!important;
 font-size:15px!important;line-height:1.45!important;font-weight:600!important;
 text-align:left!important;white-space:normal!important;
 pointer-events:auto;
}
#message.orga-toast[hidden]{display:none!important}
#message .orga-toast-symbol{
 display:grid;place-items:center;flex:none;
 width:32px;height:32px;border-radius:50%;
 background:#e8f7ee;color:#16824b;font-weight:800;font-size:19px;
}
#message.orga-toast-warning .orga-toast-symbol{background:#fff3db;color:#9b650c}
#message.orga-toast-error .orga-toast-symbol{background:#ffeaec;color:#b20a25}
#message .orga-toast-label{min-width:0;overflow-wrap:anywhere}
#message .orga-toast-close{flex:none;border:0;background:transparent;color:inherit;font-size:24px;line-height:1;padding:4px;cursor:pointer}
:root[data-theme="dark"] #message.orga-toast:not([hidden]){
 background:#253348!important;color:#f0f4fb!important;
 border-color:#52637b!important;box-shadow:0 18px 54px rgba(0,0,0,.5)!important;
}
@media(prefers-reduced-motion:no-preference){
 #message.orga-toast:not([hidden]){animation:orga-toast-appear .18s ease-out both}
 @keyframes orga-toast-appear{from{opacity:0;transform:translate(-50%,-46%) scale(.97)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}
}


/* Hours export: one button fills the card; two buttons split the available width. */
.hours-export-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:16px}
.hours-export-actions>:only-child,.hours-export-actions>:last-child:nth-child(odd){grid-column:1/-1}
.hours-export-actions>button{width:100%;min-width:0;white-space:normal;overflow-wrap:anywhere;min-height:52px}
.hours-pdf-dialog,.hours-pdf-preview{position:fixed;inset:0;margin:auto;box-sizing:border-box;
  max-width:calc(100vw - 20px);background:var(--surface,#fff);color:var(--text,#202735);
  border:1px solid var(--line,#d9dfe7);border-radius:18px;box-shadow:0 20px 65px #0007;
  z-index:100;padding:18px;overscroll-behavior:contain}
.hours-pdf-dialog::backdrop,.hours-pdf-preview::backdrop{background:rgba(8,14,25,.78)}
.hours-pdf-dialog{width:min(94vw,460px);height:auto;max-height:85dvh;overflow:auto}
.hours-pdf-dialog-content h2{margin:0 0 10px}
.hours-pdf-dialog-content label{display:block;margin:14px 0 7px}
.hours-pdf-dialog-content input[type=date]{width:100%;max-width:100%;box-sizing:border-box}
.hours-pdf-choice-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:18px 0 12px}
.hours-pdf-choice-actions>button,.hours-pdf-dialog-content>[data-hours-pdf-close]{width:100%;min-width:0}
.hours-pdf-preview{width:min(96vw,920px);height:min(91dvh,1020px);max-height:91dvh;overflow:hidden;
  flex-direction:column;gap:12px}
.hours-pdf-preview[open]{display:flex}
.hours-pdf-preview>header{display:flex;align-items:center;justify-content:space-between;gap:8px}
.hours-pdf-preview>header strong{font-size:1rem;min-width:0}
.hours-pdf-preview>header button{flex-shrink:0}
.hours-pdf-pages{display:flex;flex:1;min-height:0;flex-direction:column;align-items:center;gap:12px;overflow:auto;padding:8px;border:1px solid var(--line,#d9dfe7);border-radius:8px;background:#e5e7eb;-webkit-overflow-scrolling:touch}\n.hours-pdf-pages canvas{display:block;max-width:100%;height:auto;background:#fff;box-shadow:0 2px 10px #0002}\n.hours-pdf-pages>.small{color:#334155;padding:16px;text-align:center}
.hours-pdf-preview-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.hours-pdf-preview-actions>*{display:flex;align-items:center;justify-content:center;min-height:42px;
  width:100%;min-width:0;text-align:center;text-decoration:none;overflow-wrap:anywhere}
.hours-pdf-preview-actions>[hidden]{display:none!important}
@media(max-width:420px){.hours-pdf-preview{padding:9px;width:98vw;height:91dvh}
  .hours-pdf-preview-actions{gap:5px}.hours-pdf-preview-actions>*{font-size:.84rem;padding:7px 4px}}

/* Intervention navigation: touch-friendly, responsive app choices. */
.mission-navigation{margin-top:.65rem;max-width:100%}
.mission-navigation summary{cursor:pointer;color:#a9d4ff;font-weight:700;line-height:1.5;list-style-position:inside}
.mission-navigation-choices{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.65rem}
.mission-navigation-choices a{display:inline-flex;align-items:center;justify-content:center;min-height:2.75rem;flex:1 1 7rem;padding:.55rem .7rem;border:1px solid #6386aa;border-radius:.75rem;background:#30435e;color:#fff;text-decoration:none;font-weight:700;text-align:center}
.mission-navigation-choices a:focus-visible{outline:3px solid #78b8ff;outline-offset:2px}

/* Client travel policy: authored label display must never override the hidden attribute. */
.client-travel-form [data-travel-option][hidden] { display: none !important; }

.client-travel-form [data-travel-save][hidden] { display: none !important; }

/* Wizard controls belong to the form card, never to the global app footer. */
.top-wizard {
  display:flex!important; flex-direction:column!important;
  height: min(720px, calc(100dvh - 235px))!important;
  min-height: 310px!important; max-height:none!important;
  overflow:hidden!important;
}
.top-wizard-scroll {flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:2px 3px 16px;}
.top-wizard-footer {
  flex:0 0 auto;position:relative;z-index:2;
  border-top:1px solid var(--border, #47566b);
  padding:12px 0 4px;
  background:inherit;
}
.top-wizard-footer .actions {display:flex;gap:12px;margin:0;}
.top-wizard-footer .actions button {flex:1;min-width:0;min-height:46px;}
@media(max-width:600px) {
  .top-wizard {height:calc(100dvh - 260px)!important;max-height:none!important;}
}
/* ACI navigation is pinned to the bottom of its own form tile. */
body:has(.aci-wizard) .aci-wizard {
  display:flex!important;flex-direction:column!important;
  height:calc(100dvh - 250px)!important;
  min-height:330px!important;max-height:740px!important;
  overflow:hidden!important;
}
body:has(.aci-wizard) .aci-panel {
  flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;
  overscroll-behavior:contain!important;
}
body:has(.aci-wizard) .aci-footer {
  position:relative!important;inset:auto!important;bottom:auto!important;
  left:auto!important;right:auto!important;width:100%!important;
  flex:0 0 auto!important;box-sizing:border-box!important;
  margin:0!important;padding:12px!important;z-index:2!important;
  box-shadow:none!important;
}
body:has(.aci-wizard) {padding-bottom:var(--orgasav-measured-footer-height, 110px)!important;}

/* Unified iPhone form viewport: fixed-size tile, independently scrolling body,
   and permanently anchored actions. 2 mm ~= 7.56 CSS pixels. */
:root { --orgasav-form-gap: 8px; --orgasav-form-top-gap: 92px; }
body:has(.top-wizard) .top-wizard,
body:has(.aci-wizard) .aci-wizard {
  position:fixed!important;
  top:calc(var(--orgasav-header-height) + var(--orgasav-form-top-gap))!important;
  bottom:calc(var(--orgasav-measured-footer-height, var(--orgasav-footer-height)) + var(--orgasav-form-gap))!important;
  left:max(12px, calc((100vw - 720px)/2))!important;
  right:max(12px, calc((100vw - 720px)/2))!important;
  width:auto!important;height:auto!important;min-height:0!important;max-height:none!important;
  margin:0!important;box-sizing:border-box!important;
  display:flex!important;flex-direction:column!important;overflow:hidden!important;
  z-index:10!important;
}
body:has(.top-wizard) .top-wizard-scroll,
body:has(.aci-wizard) .aci-panel {
  flex:1 1 0%!important;min-height:0!important;max-height:none!important;
  overflow-y:auto!important;overflow-x:hidden!important;
  -webkit-overflow-scrolling:touch;overscroll-behavior:contain;
}
body:has(.top-wizard) .top-wizard-footer,
body:has(.aci-wizard) .aci-footer {
  position:relative!important;inset:auto!important;bottom:auto!important;
  width:100%!important;flex:0 0 auto!important;
  margin:0!important;z-index:2!important;
}
body:has(.top-wizard) .top-draft-note {flex:0 0 auto;margin:4px 0 0;}
body:has(.aci-wizard) .aci-progress {flex:0 0 auto!important;}
/* Keep the form within the viewport on small landscape devices. */
@media(max-height:550px) {
  :root {--orgasav-form-top-gap:12px;}
  body:has(.top-wizard) .top-wizard>.eyebrow,
  body:has(.top-wizard) .top-wizard>p,
  body:has(.aci-wizard) .aci-stages {font-size:11px!important;}
}
/* The BI is a dialog, but uses exactly the same three fixed regions. */
#details:has(.bi-wizard) {
  position:fixed!important;
  inset:calc(var(--orgasav-header-height) + 8px) 12px
    calc(var(--orgasav-measured-footer-height, var(--orgasav-footer-height)) + 8px)!important;
  width:auto!important;height:auto!important;max-height:none!important;
  max-width:720px!important;margin-left:auto!important;margin-right:auto!important;
  padding:12px!important;overflow:hidden!important;
}
#details:has(.bi-wizard) #details-content,
#details:has(.bi-wizard) .bi-wizard,
#details:has(.bi-wizard) .bi-wizard-form {
  display:flex!important;flex-direction:column!important;
  flex:1 1 auto!important;min-height:0!important;overflow:hidden!important;
}
#details:has(.bi-wizard) #details-content {height:100%!important;}
.bi-wizard-header {flex:0 0 auto;padding-right:38px;}
.bi-wizard-header h2,.bi-wizard-header p {margin:0 0 8px;}
.bi-wizard-scroll {flex:1 1 0%;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;}
.bi-step[hidden],.bi-wizard-footer [hidden] {display:none!important;}
.bi-step label {display:block;margin:10px 0;}
.bi-step input,.bi-step textarea {width:100%;box-sizing:border-box;}
.bi-wizard-footer {display:flex;gap:12px;flex:0 0 auto;padding:12px 0 0;border-top:1px solid var(--line,#53647c);}
.bi-wizard-footer button {flex:1;min-width:0;}

/* Larger technician signature pad inside the independently scrollable Top Safety step. */
.top-wizard .top-wizard-scroll #top-sign-pad { height: 260px !important; min-height: 260px; }
@media (max-width: 600px) { .top-wizard .top-wizard-scroll #top-sign-pad { height: 240px !important; min-height: 240px; } }

/* Top Safety signature is drawn in a non-scrolling, full-screen modal. */
.top-signature-dialog {
  position:fixed; inset:0; margin:auto; padding:18px;
  width:min(94vw,640px); max-width:94vw; max-height:90dvh;
  box-sizing:border-box; border:1px solid #64748b; border-radius:18px;
  background:var(--card,#1e293b); color:var(--text,#f1f5f9);
  overflow:hidden; overscroll-behavior:none;
}
.top-signature-dialog::backdrop {background:rgba(0,0,0,.75)}
.top-signature-content {display:flex;flex-direction:column;gap:14px}
.top-signature-content h2 {margin:0;font-size:1.2rem}
.top-signature-dialog #top-sign-pad {
  display:block;box-sizing:border-box;width:100%;height:min(48dvh,340px)!important;
  min-height:200px!important;border:2px solid #8292a8;border-radius:12px;
  background:#e8edf5!important;touch-action:none;filter:none!important;
}
.top-signature-actions {display:grid;grid-template-columns:1fr 1fr;gap:12px}
.top-signature-actions button {min-width:0;min-height:50px}
@media(max-height:580px) {
  .top-signature-dialog #top-sign-pad {height:36dvh!important;min-height:110px!important}
}

/* Center the Top Safety signature step without affecting the full-screen signing pad. */
.top-wizard .top-signature-entry {display:flex;flex-direction:column;align-items:stretch;gap:10px;width:100%;text-align:center;}
.top-wizard .top-signature-entry p {margin:0;text-align:center;}
.top-wizard .top-signature-entry #top-open-signature {display:block;width:100%;max-width:none;box-sizing:border-box;min-height:48px;}

/* Consistent 2×2 Top Safety actions, including links added after PDF generation. */
.top-wizard .top-wizard-footer .actions,
.top-wizard #top-pdf-result {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  width:100%;
}
.top-wizard .top-wizard-footer .actions > button,
.top-wizard #top-pdf-result > a {
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  width:100%;
  min-width:0;
  height:78px;
  min-height:78px;
  max-height:78px;
  box-sizing:border-box;
  padding:8px 10px;
  margin:0!important;
  line-height:1.2;
  white-space:normal;
  overflow-wrap:break-word;
}
.top-wizard #top-pdf-result[hidden] {display:none!important;}

/* Top navigation matches the compact ACIForm buttons; PDF result actions remain unchanged. */
.top-wizard .top-wizard-footer .actions > button {
  height:56px;
  min-height:56px;
  max-height:56px;
  padding:9px 12px;
  font-size:.95rem;
  border-radius:10px;
}

/* ACI controls: same self-contained, fixed-height card architecture as Top Safety. */
body:has(.aci-wizard) {padding-bottom:0!important}
.aci-wizard {width:100%;max-width:100%;min-width:0;padding:0!important;margin:0!important}
.aci-wizard .aci-panel {
  display:flex!important;flex-direction:column!important;
  height:calc(100dvh - 260px)!important;
  max-height:calc(100dvh - 260px)!important;
  min-height:340px;overflow:hidden!important;
  box-sizing:border-box;
  border-radius:20px!important;
  padding:16px!important;
  gap:0!important;
}
.aci-modal-header {flex:0 0 auto;padding:0 0 12px}
.aci-modal-header .aci-stages {margin:0 0 12px}
.aci-modal-scroll {
  flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;
  overscroll-behavior:contain;-webkit-overflow-scrolling:touch;
  padding:10px 2px 16px;
}
.aci-wizard .aci-footer {
  position:static!important;inset:auto!important;
  flex:0 0 auto!important;
  display:grid!important;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;
  gap:12px!important;align-items:center!important;
  width:100%!important;max-width:100%!important;
  padding:12px 0 0!important;margin:0!important;
  background:transparent!important;box-shadow:none!important;
  border:0!important;border-top:1px solid var(--line,#53647c)!important;
}
.aci-wizard .aci-footer button {
  width:100%!important;min-width:0!important;max-width:none!important;
  min-height:58px!important;padding:10px 8px!important;
  display:flex!important;align-items:center!important;justify-content:center!important;
  text-align:center!important;font-size:1rem!important;
}
.aci-wizard .aci-footer .aci-counter {
  display:block!important;min-width:48px;text-align:center!important;
  white-space:nowrap;font-weight:700;font-size:.95rem!important;
  color:var(--muted,#94a3b8)!important;
}
.aci-wizard .aci-panel .aci-title {margin-top:0}
@media(max-width:600px) {
  .aci-wizard .aci-panel {height:calc(100dvh - 255px)!important;max-height:calc(100dvh - 255px)!important;padding:12px!important}
  .aci-wizard .aci-footer {gap:8px!important}
  .aci-wizard .aci-footer button {min-height:56px!important;font-size:.95rem!important}
  .aci-wizard .aci-footer .aci-counter {min-width:42px;font-size:.85rem!important}
}

/* ACI iPhone: raise the card, restore footer button height and give results room. */
@media(max-width:600px) {
  .aci-wizard {margin-top:-42px!important}
  .aci-wizard .aci-panel {
    height:calc(100dvh - 213px)!important;
    max-height:calc(100dvh - 213px)!important;
    padding:12px!important;
  }
  .aci-wizard .aci-modal-header {padding-bottom:8px!important}
  .aci-wizard .aci-modal-header .aci-stages {margin:0 0 8px!important}
  .aci-wizard .aci-modal-scroll {padding:6px 2px 8px!important}
  .aci-wizard .aci-modal-scroll .aci-title {
    font-size:clamp(21px,5.2vw,27px)!important;
    line-height:1.16!important;
    margin:0 0 12px!important;
  }
  .aci-wizard .aci-modal-scroll .aci-subtitle {
    margin:8px 0 12px!important;
    font-size:17px!important;
    line-height:1.25!important;
  }
  .aci-wizard .aci-modal-scroll .aci-options {gap:10px!important;margin:0!important}
  .aci-wizard .aci-modal-scroll .aci-choice {
    min-height:70px!important;
    padding:13px 15px!important;
    font-size:16px!important;
    line-height:1.2!important;
  }
  .aci-wizard .aci-footer {padding:10px 0 0!important;gap:8px!important}
  .aci-wizard .aci-footer button {
    min-height:56px!important;
    height:auto!important;
    padding:10px 8px!important;
  }
}

/* ACI footer: remove excess tinted band without resizing navigation buttons. */
@media(max-width:600px) {
  .aci-wizard .aci-footer {
    padding:4px 0 0!important;
    min-height:0!important;
    height:auto!important;
    margin:0!important;
    background:transparent!important;
  }
  .aci-wizard .aci-footer button {min-height:56px!important;height:auto!important;}
}

/* ACI: halve the gap below the unchanged page title; grow the card upwards. */
@media(max-width:600px) {
  .aci-wizard {margin-top:-82px!important;}
  .aci-wizard .aci-panel {
    height:calc(100dvh - 173px)!important;
    max-height:calc(100dvh - 173px)!important;
  }
}

/* ACI viewport correction: override the older fixed-position rule, not margins.
   Keep the page heading and bottom edge unchanged; give extra height to scrolling content. */
@media (max-width:600px) and (min-height:551px) {
  body:has(.aci-wizard) .aci-wizard {
    top:calc(var(--orgasav-header-height) + 46px)!important;
    margin:0!important;
    height:auto!important;
    max-height:none!important;
  }
  body:has(.aci-wizard) .aci-wizard .aci-panel {
    flex:1 1 auto!important;
    height:100%!important;
    max-height:none!important;
    min-height:0!important;
    overflow:hidden!important;
  }
}

/* ACI footer: neutralize legacy dark strip and inherited min-height, preserve buttons. */
body:has(.aci-wizard) .aci-wizard .aci-panel > .aci-footer {
  background:transparent!important;
  background-color:transparent!important;
  color:inherit!important;
  min-height:0!important;
  height:auto!important;
  padding:6px 0 0!important;
  margin:0!important;
  border:0!important;
  border-top:1px solid var(--line,#53647c)!important;
  border-radius:0!important;
  box-shadow:none!important;
  align-self:stretch!important;
}
body:has(.aci-wizard) .aci-wizard .aci-panel {
  padding-bottom:8px!important;
}
body:has(.aci-wizard) .aci-wizard .aci-panel > .aci-footer > button {
  min-height:56px!important;
}

/* ACI navigation: tighter relationship between four stage labels and progress. */
body:has(.aci-wizard) .aci-modal-header .aci-stages {margin-bottom:4px!important;}
body:has(.aci-wizard) .aci-modal-header {padding-bottom:6px!important;}
body:has(.aci-wizard) .aci-modal-header .aci-progress-track {margin-top:0!important;}

/* ACI: after removing the timeline, move the entire card 23px below the page heading. */
@media (max-width:600px) and (min-height:551px) {
  body:has(.aci-wizard) .aci-wizard {
    top:calc(var(--orgasav-header-height) + 69px)!important;
  }
}

/* Shared page identity: the company name and heading must be identical on
   manager home, ACIForm, Top Sécurité, planning and every other shell page. */
.page > .eyebrow:first-child {
  font-size:0.75rem!important;
  font-weight:750!important;
  letter-spacing:.08em!important;
  line-height:1.25!important;
  margin:0 0 4px!important;
}
.page > .page-title-row > h1 {
  font-size:1.7rem!important;
  font-weight:700!important;
  line-height:1.2!important;
  letter-spacing:-.03em!important;
  margin:0!important;
}

/* The radio's checked state is the source of truth for the selected outline. */
.aci-wizard .aci-panel .aci-choice:has(input[type="radio"]:checked) {
  border:2px solid #ef4760!important;
  background:#37455e!important;
}
.aci-wizard .aci-panel .aci-choice:not(:has(input[type="radio"]:checked)) {
  border:1px solid #50637e!important;
}

/* Day activity: control form action fills its intervention tile. */
.intervention-safety-step .control-form-action {
  display:flex!important;
  width:100%!important;
  max-width:100%!important;
  box-sizing:border-box!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
}

/* App-wide: hide scrollbar indicators without disabling touch, mouse or keyboard scrolling. */
html, body, * {
  scrollbar-width:none!important;
  -ms-overflow-style:none!important;
}
html::-webkit-scrollbar, body::-webkit-scrollbar, *::-webkit-scrollbar {
  display:none!important;
  width:0!important;
  height:0!important;
}

/* ACI: quieter secondary heading, without affecting the inspection title. */
body:has(.aci-wizard) .aci-wizard .aci-modal-scroll .aci-subtitle {
  font-size:15.5px!important;
  opacity:.78!important;
}

/* ACI: only the mandatory note qualifier turns red; optional remains muted. */
.aci-wizard .aci-panel .aci-note-label .aci-note-required {
  color:#ef4760!important;
  font-weight:700!important;
}

/* ACI final step: BI transition is available even when PDF rendering needs retry. */
.aci-wizard .aci-continue-bi {display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;width:100%!important;box-sizing:border-box!important;margin-top:16px!important;}

/* BI: fields fill the available width of the modal, matching its footer. */
#details:has(.bi-wizard) .bi-wizard,
#details:has(.bi-wizard) .bi-wizard-form,
#details:has(.bi-wizard) .bi-wizard-scroll,
#details:has(.bi-wizard) .bi-step,
#details:has(.bi-wizard) .bi-step label {
  width:100%;min-width:0;max-width:none;box-sizing:border-box;
}
#details:has(.bi-wizard) .bi-step input,
#details:has(.bi-wizard) .bi-step textarea {
  display:block;width:100%!important;min-width:0;max-width:none!important;
  box-sizing:border-box;margin-left:0;margin-right:0;
}

/* Keep the page company identity and title visible above the BI dialog. */
@media (max-width:600px) {
  #details:has(.bi-wizard) {
    top:calc(var(--orgasav-header-height) + 112px)!important;
    bottom:calc(var(--orgasav-measured-footer-height, var(--orgasav-footer-height)) + 8px)!important;
  }
}
.bi-parts {width:100%;min-width:0;display:grid;gap:12px;margin:12px 0;}
.bi-parts-help {margin:0;color:var(--muted);font-size:.9rem;line-height:1.4;}
.bi-part-row {width:100%;min-width:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px 12px;padding:12px;border:1px solid var(--line);border-radius:12px;}
.bi-part-row label {margin:0!important;min-width:0;max-width:none!important;}
.bi-part-row label:nth-child(2) {grid-column:1/-1;grid-row:2;}
.bi-part-row label:nth-child(3) {grid-column:2;grid-row:1;}
.bi-part-row .bi-remove-part {grid-column:1/-1;justify-self:end;min-height:40px;}
.bi-add-part {width:100%;min-height:48px;}

/* BI layout: eliminate the right-side empty column caused by the floated close
   button and intrinsic grid sizing. Preserve internal scrolling and footer. */
#details:has(.bi-wizard) {box-sizing:border-box!important;}
#details:has(.bi-wizard) > .icon-button {
  float:none!important;position:absolute!important;top:12px!important;right:12px!important;
  margin:0!important;z-index:5!important;
}
#details:has(.bi-wizard) #details-content {
  display:flex!important;flex-direction:column!important;
  clear:both!important;float:none!important;
  width:100%!important;max-width:100%!important;min-width:0!important;
  box-sizing:border-box!important;padding:0!important;margin:0!important;
}
#details:has(.bi-wizard) .bi-wizard,
#details:has(.bi-wizard) .bi-wizard-form,
#details:has(.bi-wizard) .bi-wizard-scroll,
#details:has(.bi-wizard) .bi-step {
  align-self:stretch!important;width:100%!important;max-width:100%!important;
  min-width:0!important;box-sizing:border-box!important;
}
#details:has(.bi-wizard) .bi-step {
  display:block;overflow-wrap:break-word;
}
#details:has(.bi-wizard) .bi-wizard-header {
  padding-right:62px!important;
}
#details:has(.bi-wizard) .bi-wizard-header h2,
#details:has(.bi-wizard) .bi-wizard-header p {max-width:100%;overflow-wrap:break-word;}
#details:has(.bi-wizard) .bi-wizard-scroll {padding-right:0!important;}
#details:has(.bi-wizard) .bi-step > label,
#details:has(.bi-wizard) .bi-step > label > input,
#details:has(.bi-wizard) .bi-step > label > textarea {
  width:100%!important;max-width:100%!important;min-width:0!important;
  box-sizing:border-box!important;
}
#details:has(.bi-wizard) .bi-wizard-footer {width:100%!important;box-sizing:border-box!important;}
#details:has(.bi-wizard) .bi-step h3 {margin-top:8px!important;}

/* BI occupies the form area immediately below the application navbar.
   Never expose ACIForm's title or control card behind this modal. */
@media (max-width:600px) {
  #details:has(.bi-wizard) {
    top:calc(var(--orgasav-header-height) + 8px)!important;
    bottom:calc(var(--orgasav-measured-footer-height, var(--orgasav-footer-height)) + 8px)!important;
    margin-top:0!important;
  }
}
#details:has(.bi-wizard)::backdrop {
  background:rgba(12,20,34,.96)!important;
}

/* Signed BI: planned versus actual intervention indicator. */
.bi-performance {margin:18px 0;padding:16px;border:1px solid var(--line,#43536b);border-radius:16px;box-sizing:border-box;width:100%}
.bi-performance h3 {margin:0 0 14px}
.bi-performance p {margin:12px 0 7px}
.bi-performance-track {height:12px;width:100%;overflow:hidden;border-radius:999px;background:rgba(128,140,160,.2)}
.bi-performance-track span {display:block;height:100%;border-radius:inherit}
.bi-performance strong {display:block;margin-top:12px}

/* BI signatures: fit the dialog content box, including the iPhone keyboard. */
.top-signature-dialog.bi-signature-dialog {
  inset: auto 0 auto; margin: 0 auto; width: min(94vw,720px);
  max-width: calc(100vw - 24px); max-height: calc(var(--bi-signature-height,100dvh) - 24px);
  padding:16px; overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain;
}
.bi-signature-dialog .top-signature-content {
  width:100%; max-width:100%; min-width:0; box-sizing:border-box; gap:12px;
}
.bi-signature-dialog .top-signature-content > * {max-width:100%;min-width:0;box-sizing:border-box;}
.bi-signature-dialog .bi-signer-label {display:block;font-weight:700;margin:0;overflow-wrap:anywhere;}
.bi-signature-dialog .bi-signer-label span {font-size:.85em;font-weight:400;}
.bi-signature-dialog #bi-signature-name {display:block;width:100%;min-height:48px;margin:0;font-size:16px;}
.bi-signature-dialog .signature-pad {
  display:block;width:100%;height:clamp(180px,32dvh,300px);min-width:0;
  border:2px solid #8292a8;border-radius:12px;background:#fff!important;
  touch-action:none;filter:none!important;flex-shrink:0;
}
.bi-signature-dialog .top-signature-actions {width:100%;}
.bi-signature-error,#bi-error {color:#f06576;font-weight:600;overflow-wrap:anywhere;margin:0;}
html[data-theme="light"] .bi-signature-error,html[data-theme="light"] #bi-error {color:#a60c20;}
#bi-error {padding:10px 0;}

/* Archived BI preview and editable intervention email. */
.bi-archive-preview iframe {
  display: block;
  width: 100%;
  height: min(55dvh, 650px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}
.bi-archive-preview .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}
.bi-archive-preview .actions button {
  flex: 1 1 150px;
}
.report-composer {
  width: 100%;
  min-width: 0;
  max-width: 900px;
  margin: auto;
}
.report-composer label {
  display: block;
  margin: 10px 0;
}
.report-composer input:not([type='checkbox']):not([type='file']),
.report-composer textarea {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
}
.report-composer .report-address {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.report-composer .report-attachment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.report-composer .report-attachment label {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.report-composer .report-attachment button {
  flex: 0 0 auto;
  min-width: 0;
  padding: 8px;
  font-size: 0.8rem;
}
.report-file-actions,
.report-mail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}
.report-file-actions button,
.report-mail-actions button {
  flex: 1 1 130px;
}
.report-mail-warning {
  color: #b30d2d !important;
  font-weight: 650;
}
.report-mail-history {
  margin-top: 20px;
}
#report-confirmation {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.report-file-preview {
  width: min(95vw, 950px);
  max-width: 95vw;
  max-height: 90dvh;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface, #fff);
  color: var(--text, #182433);
}
.report-file-preview header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}
.report-file-preview iframe {
  width: 100%;
  height: 65dvh;
  border: 0;
  background: white;
}
.report-file-preview img {
  display: block;
  max-width: 100%;
  max-height: 65dvh;
  margin: auto;
  object-fit: contain;
}
.report-file-preview::backdrop {
  background: #0009;
}


/* Collaborator signature settings and planning documents. */
.mail-signature-settings #mail-signature-editor{min-height:130px;padding:14px;background:#fff;color:#172b39;border:1px solid var(--line);border-radius:10px;overflow:auto;overflow-wrap:anywhere}
.mail-signature-settings #mail-signature-editor img{max-width:100%;height:auto}
.mail-signature-settings iframe,.report-signature-preview{display:block;box-sizing:border-box;width:100%;min-height:150px;max-height:350px;border:1px solid var(--line);border-radius:10px;background:#fff;margin:12px 0}
.mail-signature-settings textarea{width:100%;box-sizing:border-box;font-family:monospace}
.mail-signature-settings .actions{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
.mail-signature-settings .actions button{flex:1 1 150px}
.intervention-file{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:10px 0;border-bottom:1px solid var(--line)}
.intervention-file>span{flex:1 1 140px;min-width:0;overflow-wrap:anywhere}
.intervention-file small{display:block;color:var(--muted)}
.intervention-file button{min-width:0;font-size:.8rem;padding:8px}
.intervention-file-picker{display:block;margin-top:12px}
.intervention-file-picker input{display:block;max-width:100%;font:inherit;margin-top:8px}
[data-intervention-files]{margin:20px 0}

/* Imported signature text remains editable inside nested tables and spans. */
.mail-signature-settings [contenteditable] *{-webkit-user-select:text!important;user-select:text!important;-webkit-touch-callout:default}

/* Monthly BI performance is visible directly in the SAV card. */
.sav-perf-inline{margin-top:24px;padding-top:22px;border-top:1px solid var(--line,#354258);min-width:0}
.sav-perf-heading{display:flex;justify-content:space-between;align-items:baseline;flex-wrap:wrap;gap:8px;margin-bottom:16px}
.sav-perf-heading h3{margin:0;font-size:1.05rem}
.sav-perf-heading>span{font-size:.75rem;color:var(--muted,#aab8cb)}
.sav-perf-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.sav-perf-kpi{display:flex;flex-direction:column;min-width:0;padding:16px 13px;gap:14px;border:1px solid var(--line,#354258);border-radius:20px;background:var(--surface-secondary,#f3f6fa);color:var(--text,#172b39)}
.sav-perf-kpi-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;color:var(--muted,#617287);font-size:.82rem;line-height:1.3;min-height:2.6em}
.sav-perf-kpi-heading svg{width:22px;height:22px;flex:0 0 22px}
.sav-perf-kpi>strong{font-size:clamp(1.25rem,5.5vw,1.75rem);font-variant-numeric:tabular-nums;overflow-wrap:anywhere;line-height:1.15}
.sav-perf-kpi small{font-size:.72rem;color:var(--muted,#617287);line-height:1.4}
.sav-perf-inline .is-over{--sav-bar:#cc4056}.sav-perf-inline .is-under,.sav-perf-inline .is-on-time{--sav-bar:#248b73}.sav-perf-inline .is-planned{--sav-bar:#3b85bc}
.sav-perf-kpi.is-over>strong,.sav-perf-budget.is-over strong,.sav-perf-detail .is-over{color:#c9354e}
.sav-perf-kpi.is-under>strong,.sav-perf-kpi.is-on-time>strong{color:#168267}
[data-theme="dark"] .sav-perf-kpi.is-over>strong,[data-theme="dark"] .sav-perf-budget.is-over strong,[data-theme="dark"] .sav-perf-detail .is-over{color:#ff8192}
[data-theme="dark"] .sav-perf-kpi.is-under>strong,[data-theme="dark"] .sav-perf-kpi.is-on-time>strong{color:#62cfb0}
.sav-perf-budget{margin-top:22px}
.sav-perf-budget-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;font-size:.86rem}
.sav-perf-budget-heading strong{font-size:1.45rem;font-variant-numeric:tabular-nums}
.sav-perf-budget p{margin:8px 0;color:var(--muted,#617287);font-size:.73rem;line-height:1.5}
.sav-perf-budget p span{white-space:nowrap}
progress.sav-perf-progress,progress.sav-productivity{appearance:none;-webkit-appearance:none;display:block;width:100%;height:10px;border:0;border-radius:99px;overflow:hidden;background:var(--line,#dce4ee);color:var(--sav-bar,#248b73)}
progress.sav-perf-progress::-webkit-progress-bar,progress.sav-productivity::-webkit-progress-bar{background:var(--line,#dce4ee);border-radius:99px}
progress.sav-perf-progress::-webkit-progress-value,progress.sav-productivity::-webkit-progress-value{background:var(--sav-bar,#248b73);border-radius:99px}
progress.sav-perf-progress::-moz-progress-bar,progress.sav-productivity::-moz-progress-bar{background:var(--sav-bar,#248b73);border-radius:99px}
.sav-perf-comparison{margin:22px 0 16px;padding:16px;border:1px solid var(--line,#dce4ee);border-radius:16px}
.sav-perf-comparison figcaption{font-size:.82rem;font-weight:650;margin-bottom:16px}
.sav-perf-bar{margin:12px 0 0}.sav-perf-bar>div{display:flex;justify-content:space-between;gap:8px;font-size:.8rem;margin-bottom:7px}.sav-perf-bar strong{font-variant-numeric:tabular-nums;font-weight:650}
.sav-perf-outcomes{display:flex;flex-wrap:wrap;gap:7px;font-size:.72rem;color:var(--muted,#617287)}
.sav-perf-outcomes span{padding:6px 9px;border:1px solid var(--line,#dce4ee);border-radius:99px}
.sav-perf-details{margin-top:18px}.sav-perf-details>summary{cursor:pointer;font-size:.85rem;font-weight:650;padding:12px 0}
.sav-perf-detail{padding:14px 0;border-top:1px solid var(--line,#dce4ee);min-width:0}
.sav-perf-detail header{display:flex;justify-content:space-between;gap:10px;overflow-wrap:anywhere;font-size:.85rem}.sav-perf-detail header span{white-space:nowrap}
.sav-perf-detail p{font-size:.75rem;color:var(--muted,#617287);line-height:1.5;margin:6px 0}
.sav-perf-detail .sav-perf-dates{margin-top:12px;font-size:.69rem}
.sav-perf-empty{font-size:.8rem;color:var(--muted,#617287);margin-top:14px}
@media(min-width:1000px){.sav-perf-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* Actions compactes des rapports : deux boutons lisibles sur une même ligne. */
.actions.report-list-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.report-list-actions>button{min-width:0;padding:10px 8px;white-space:nowrap;font-size:.9rem}
.actions .report-email-button{background:#b30d2d;border-color:#b30d2d;color:#fff;white-space:nowrap}
