/* Appli BL terrain Flex d'Oc : charte orange #E87722, Sora pour les titres, DM Sans pour le texte. */

@font-face { font-family: 'Sora'; src: url('../fonts/sora-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Sora'; src: url('../fonts/sora-800.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('../fonts/dmsans-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('../fonts/dmsans-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('../fonts/dmsans-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --ink: #1A1A1A;
  --ink-2: #383838;
  --muted: #5F5F5F;
  --faint: #8C8C8C;
  --orange: #E87722;
  --orange-press: #CF6519;
  --orange-soft: #FFF2E4;
  --orange-line: #F2C597;
  --orange-text: #9C4A0B;
  --bg: #F4F4F4;
  --card: #FFFFFF;
  --line: #E4E4E4;
  --line-2: #CFCFCF;
  --red: #C0352A;
  --red-soft: #FDEFED;
  --amber: #8A5A00;
  --amber-ic: #D99A1E;
  --amber-soft: #FFF6E0;
  --green: #23744A;
  --green-soft: #E8F4EC;
  --font-ui: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Sora', 'DM Sans', system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.no-scroll, html.no-scroll body { overflow: hidden; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: #E7E7E7;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; opacity: 0; }

.ic { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Écran ---------- */

.screen {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  padding-bottom: 28px;
}
@media (min-width: 600px) {
  .screen { box-shadow: 0 0 0 1px #DADADA; }
}
.screen--form, .screen--sign { padding-bottom: 0; }
.pad { padding: 16px; }
.spacer { flex: 1; }

/* ---------- Barre du haut ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 64px;
  padding: calc(var(--safe-t) + 8px) 8px 8px 4px;
  background: var(--ink);
  color: #fff;
}
.bar__title { flex: 1; min-width: 0; padding: 0 4px; }
.bar__h { font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.2; letter-spacing: -0.01em; }
.bar__h--no { font-weight: 800; font-size: 19px; }
.bar__sub { font-size: 13.5px; color: #C9C9C9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.techs-btn { display: inline-flex; align-items: center; gap: 4px; color: #fff; font-weight: 500; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.35); text-underline-offset: 3px; min-height: 28px; }
.techs-btn .ic { width: 14px; height: 14px; }

.iconbtn {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  color: #fff;
  flex: none;
}
.iconbtn:active { background: rgba(255, 255, 255, 0.12); }
.iconbtn--light { color: var(--ink-2); }
.iconbtn--light:active { background: #ECECEC; }
.iconbtn--mic { background: #2C2C2C; color: var(--orange); }
.iconbtn--mic .ic { width: 24px; height: 24px; }

/* Manomètre des rubriques obligatoires */
.gauge { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 56px; height: 48px; border-radius: 10px; color: #fff; flex: none; }
.gauge:active { background: rgba(255, 255, 255, 0.1); }
.gauge svg { width: 46px; height: 26px; overflow: visible; }
.g-ticks line { stroke: #6A6A6A; stroke-width: 1.2; stroke-linecap: round; }
.g-bg { fill: none; stroke: #3D3D3D; stroke-width: 4; stroke-linecap: round; }
.g-fg { fill: none; stroke: var(--orange); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 0.45s var(--ease); }
.g-needle { stroke: #fff; stroke-width: 2.2; stroke-linecap: round; transform-origin: 24px 24px; transition: transform 0.45s var(--ease); }
.g-hub { fill: #fff; }
.gauge__txt { font-size: 11.5px; font-weight: 700; line-height: 1; margin-top: 2px; font-variant-numeric: tabular-nums; }
.gauge.is-full .gauge__txt { color: var(--orange); }

/* ---------- Démarrage ---------- */

.screen--dark { background: var(--ink); color: #fff; }
.onb { display: flex; flex-direction: column; padding: calc(var(--safe-t) + 40px) 24px calc(var(--safe-b) + 32px); }
.onb__brand { margin-bottom: 44px; }
.onb__logo { width: 210px; height: auto; }
.onb__app { margin: 12px 0 0; font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--orange); }
.onb__h { font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 8px; }
.onb__p { color: #C7C7C7; margin: 0 0 22px; max-width: 34ch; }
.onb__err { color: #FF8F84; font-weight: 500; min-height: 22px; margin: 8px 0 10px; font-size: 14.5px; }
.sheet .onb__err { color: var(--red); }
.onb__hint { color: #9A9A9A; font-size: 14px; margin-top: 18px; }
.code-input {
  width: 100%;
  max-width: 260px;
  height: 64px;
  border-radius: 14px;
  border: 2px solid #444;
  background: #262626;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 30px;
  letter-spacing: 0.4em;
  text-align: center;
  padding: 0 0 0 0.4em;
}
.code-input:focus { outline: none; border-color: var(--orange); }
.code-input.is-err { border-color: #FF8F84; }
.chips--onb .chip { background: #262626; border-color: #474747; color: #fff; }
.chips--onb .chip[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.field--onb { margin-top: 16px; }
.field--onb .field__label { color: #C7C7C7; }

/* ---------- Accueil ---------- */

.home-top { background: var(--ink); color: #fff; padding: calc(var(--safe-t) + 10px) 16px 20px; }
.home-top__row { display: flex; align-items: center; gap: 10px; margin-right: -8px; }
.home-top__logo { width: 128px; height: auto; }
.tag-test { font-size: 12px; font-weight: 700; color: var(--ink); background: #F5A623; border-radius: 6px; padding: 2px 7px; }
.home-top__h { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1.1; letter-spacing: -0.02em; margin: 26px 0 6px; }
.home-top__meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #BDBDBD; font-size: 14.5px; }
.net { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; border-radius: 999px; padding: 4px 10px 4px 8px; }
.net .ic { width: 16px; height: 16px; }
.net--on { background: rgba(70, 180, 110, 0.18); color: #8FDDAA; }
.net--off { background: rgba(245, 166, 35, 0.2); color: #F5C060; }

.cta-new {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-top: 20px;
  padding: 16px;
  border-radius: 16px;
  background: var(--orange);
  color: var(--ink);
  text-align: left;
}
.cta-new:active { background: var(--orange-press); }
.cta-new__ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--ink); color: var(--orange); flex: none; }
.cta-new__ic .ic { width: 28px; height: 28px; stroke-width: 2.6; }
.cta-new__txt { display: flex; flex-direction: column; }
.cta-new__txt strong { font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 1.15; letter-spacing: -0.01em; }
.cta-new__txt span { font-size: 14.5px; font-weight: 500; opacity: 0.85; }

.notice { display: flex; align-items: center; gap: 12px; margin: 14px 16px 0; padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.notice--warn { background: var(--amber-soft); border-color: #F1D9A0; }
.notice__ic { color: var(--orange-text); flex: none; }
.notice--warn .notice__ic { color: var(--amber); }
.notice__body { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14.5px; }
.notice__body strong { font-size: 15.5px; }
.notice__body span { color: var(--muted); }
.notice__btn { font-weight: 700; color: var(--ink); background: #fff; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 0 12px; min-height: 40px; flex: none; }
.notice__x { width: 40px; height: 40px; margin: -8px -8px 0 0; align-self: flex-start; }
.notice--install { align-items: flex-start; }
.notice--install .notice__ic { margin-top: 2px; }
.notice__link { align-self: flex-start; margin-top: 2px; min-height: 36px; }

.h-list { font-family: var(--font-display); font-weight: 700; font-size: 16px; margin: 0; padding: 26px 16px 10px; }
.list { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.list--text { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.list--text p { margin: 0; display: flex; gap: 8px; align-items: flex-start; }
.row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 66px; padding: 10px 8px 10px 16px; text-align: left; border-bottom: 1px solid var(--line); background: var(--card); }
.row:last-child { border-bottom: 0; }
.row--btn:active, .row__btn:active { background: #F7F7F7; }
.row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row__btn { text-align: left; align-self: stretch; justify-content: center; }
.row__title { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__sub { font-size: 14px; color: var(--muted); }
.row__chev { color: var(--faint); width: 20px; height: 20px; margin-right: 6px; }
.status { font-size: 12.5px; font-weight: 700; border-radius: 6px; padding: 3px 8px; white-space: nowrap; flex: none; }
.status--ok { background: var(--green-soft); color: var(--green); }
.status--warn { background: var(--amber-soft); color: var(--amber); }
.status--wait { background: #EDEDED; color: var(--muted); }
.empty-line { margin: 0; padding: 16px; color: var(--muted); font-size: 15px; background: var(--card); }
.list .empty-line { background: transparent; }
.foot-note { margin: 28px 16px 0; font-size: 13.5px; color: var(--muted); }

/* ---------- Choix de l'intervention ---------- */

.btn--left { justify-content: flex-start; text-align: left; padding: 12px 14px; min-height: 64px; }
.btn--left span { display: flex; flex-direction: column; font-family: var(--font-ui); }
.btn--left strong { font-family: var(--font-display); font-weight: 700; font-size: 16.5px; }
.btn--left small { font-size: 14px; font-weight: 400; color: var(--muted); }
.search { display: flex; align-items: center; gap: 10px; margin-top: 12px; height: 50px; padding: 0 14px; border-radius: 12px; background: var(--card); border: 1.5px solid var(--line-2); color: var(--faint); }
.search:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232, 119, 34, 0.2); }
.search input { flex: 1; border: 0; outline: none; min-width: 0; font-size: 16.5px; color: var(--ink); background: transparent; height: 100%; }
.iv { display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); background: var(--card); }
.iv:last-child { border-bottom: 0; }
.iv:active { background: #F7F7F7; }
.iv__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.iv__client { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.iv__motif { font-size: 15.5px; font-weight: 500; }
.iv__meta { font-size: 14px; color: var(--muted); }
.iv__when { font-size: 13.5px; color: var(--faint); }
.badge { font-size: 12.5px; font-weight: 700; border-radius: 6px; padding: 3px 8px; background: #EFEFEF; color: var(--ink-2); white-space: nowrap; flex: none; }
.badge--orange { background: var(--orange-soft); color: var(--orange-text); }

/* ---------- Formulaire ---------- */

.form { padding-bottom: 8px; }
.sec { background: var(--card); padding: 20px 16px 22px; margin-top: 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec__title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 14px; font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.sec__state { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-ui); font-weight: 700; font-size: 13.5px; color: var(--muted); }
.sec__state .ic { width: 16px; height: 16px; stroke-width: 2.6; }
.sec__state.is-ok { color: var(--green); }
.sec__state.is-bad { color: var(--red); }
.sec__note { display: flex; gap: 8px; margin: -4px 0 14px; padding: 10px 12px; border-radius: 10px; background: #F6F6F6; color: var(--ink-2); font-size: 14.5px; }
.sec__note .ic { width: 20px; height: 20px; color: var(--muted); margin-top: 1px; }
.sec__note--btn { align-items: center; width: 100%; min-height: 48px; text-align: left; }
.sec__note--btn span { flex: 1; }
.sec__note--btn strong { color: var(--orange-text); }
.sec__note--btn .ic:last-child { width: 18px; height: 18px; margin: 0 -4px 0 -4px; color: var(--orange-text); }
.sec__note--btn:active { background: #EDEDED; }
.fiche { display: grid; gap: 14px; }
.fiche span { white-space: pre-line; }
.fiche a { color: var(--orange-text); font-weight: 700; }
.sec__help { margin: -6px 0 12px; color: var(--muted); font-size: 14.5px; }

.field { margin-top: 18px; scroll-margin: 120px 0 140px; }
.sec > .field:first-of-type, .sec__note + .field, .sec__title + .field { margin-top: 0; }
.field__label { display: block; margin-bottom: 7px; font-size: 14.5px; font-weight: 700; color: var(--ink-2); }
.field__label--q { font-size: 16px; font-weight: 700; color: var(--ink); }
.req { color: var(--orange); font-weight: 800; margin-left: 2px; }
.field__hint { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.field__hint:empty { display: none; }
.field__err { display: none; margin-top: 6px; font-size: 13.5px; font-weight: 700; color: var(--red); }
.is-err > .field__err, .field__err--lines.show { display: block; }

input[type="text"], input[type="email"], input[type="search"], input:not([type]), textarea {
  width: 100%;
  min-height: 52px;
  padding: 13px 14px;
  border: 1.5px solid var(--line-2);
  border-radius: 10px;
  background: #fff;
  font-size: 17px;
  line-height: 1.35;
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.search input { min-height: 0; padding: 0; border: 0; box-shadow: none; }
textarea { min-height: 80px; resize: none; overflow: hidden; }
input::placeholder, textarea::placeholder { color: #9B9B9B; }
input:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232, 119, 34, 0.2); }
.is-err > input, .is-err > textarea, .is-err .combo input, .is-err .suffix-input input, input.is-err { border-color: var(--red); background: var(--red-soft); }
.is-ai > input, .is-ai > textarea, .is-ai .combo input, .is-ai .suffix-input input { background: var(--orange-soft); border-color: var(--orange-line); }
.tag-ai { display: inline-flex; vertical-align: 1px; margin-left: 8px; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; color: var(--orange-text); background: var(--orange-soft); border: 1px solid var(--orange-line); border-radius: 6px; padding: 1px 6px 1px 4px; }
.tag-ai .ic { width: 13px; height: 13px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 48px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line-2); background: #fff; font-size: 16px; font-weight: 500; color: var(--ink); transition: background-color 0.12s, border-color 0.12s, color 0.12s; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; }
.chips--grid { display: grid; gap: 8px; }
.chips--g2 { grid-template-columns: repeat(2, 1fr); }
.chips--g3 { grid-template-columns: repeat(3, 1fr); }
.chips--grid .chip { padding: 0 6px; border-radius: 12px; font-size: 15.5px; }
.is-err .chip { border-color: var(--red); }
.is-ai .chip[aria-pressed="true"] { background: var(--orange-soft); border-color: var(--orange); color: var(--orange-text); }

.combo { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 12; background: #fff; border: 1.5px solid var(--line-2); border-radius: 12px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14); overflow: hidden; }
.suggest__item { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 14px; text-align: left; font-weight: 500; border-bottom: 1px solid var(--line); }
.suggest__item:last-child { border-bottom: 0; }
.suggest__item:active { background: #F4F4F4; }
.suggest__item small { font-size: 12px; font-weight: 700; color: var(--orange-text); }
.suggest__note { padding: 10px 14px; font-size: 13.5px; color: var(--muted); background: #FAFAFA; }

.seg { display: flex; gap: 3px; padding: 3px; margin-bottom: 8px; border-radius: 11px; background: #ECECEC; }
.seg button { flex: 1; min-height: 42px; border-radius: 8px; font-weight: 500; color: var(--muted); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }
.suffix-input { position: relative; }
.suffix-input input { padding-right: 52px; }
.suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--muted); pointer-events: none; }
.suffix-input--sm input { min-height: 48px; padding-right: 40px; }
.suffix-input--sm .suffix { right: 12px; }

/* Lignes du BL */
.lines__empty { margin: 0; padding: 16px 0; color: var(--faint); font-size: 15px; border-bottom: 1px solid var(--line); }
.line { display: grid; grid-template-columns: 1fr 84px 44px; gap: 6px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); scroll-margin: 120px 0 140px; }
.line input { min-height: 50px; }
.line__del { width: 44px; height: 44px; color: var(--faint); }
.line__name { display: flex; flex-direction: column; font-weight: 700; font-size: 16px; }
.line__name small { font-size: 13px; font-weight: 400; color: var(--muted); }
.line__fixed { min-width: 84px; text-align: center; font-weight: 700; color: var(--muted); }
.line--hz .suffix-input { width: 112px; }
.line.is-ai { background: linear-gradient(90deg, var(--orange-soft), var(--orange-soft)) no-repeat; background-size: 100% 100%; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.line.is-ai input { background: #fff; }
/* Quantité : une seule case, le nombre à gauche et les deux petites flèches empilées à droite. */
.qty { display: flex; height: 52px; border: 1.5px solid var(--line-2); border-radius: 10px; background: #fff; overflow: hidden; }
.qty:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232, 119, 34, 0.2); }
.qty:has(input.is-err) { border-color: var(--red); }
.line .qty__input, .line .qty__input:focus { flex: 1; width: 100%; min-width: 0; height: 100%; min-height: 0; padding: 0 2px 0 4px; border: 0; border-radius: 0; box-shadow: none; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.qty__fleches { display: flex; flex-direction: column; flex: none; width: 32px; border-left: 1px solid var(--line); }
.qty__btn { display: grid; place-items: center; flex: 1; width: 100%; color: var(--ink-2); touch-action: manipulation; }
.qty__btn + .qty__btn { border-top: 1px solid var(--line); }
.qty__btn .ic { width: 15px; height: 15px; stroke-width: 2.5; }
.qty__btn:active { background: var(--orange-soft); }
.addline { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; margin-top: 14px; border: 1.5px dashed var(--orange); border-radius: 10px; color: var(--orange-text); font-weight: 700; font-size: 16px; background: #fff; }
.addline:active { background: var(--orange-soft); }
.quick__row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.quick__row button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 62px; padding: 6px 2px; border: 1.5px dashed var(--orange); border-radius: 10px; background: #fff; color: var(--orange-text); font-weight: 700; font-size: 14px; }
.quick__row button .ic { width: 20px; height: 20px; }
.quick__row button:active { background: var(--orange-soft); }
.is-err .quick__row [data-type="dep"] { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.quick__autre { display: block; margin: 6px auto 0; }

/* Le PDF du BL, affiché dans l'appli */
.pdf-pages { display: grid; gap: 10px; padding: 10px; }
.pdf-pages canvas { display: block; width: 100%; height: auto; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18); }
.pdf-msg { margin: 0; padding: 40px 16px; text-align: center; color: var(--muted); }

/* Photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #DDD; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph button { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(26, 26, 26, 0.78); color: #fff; }
.ph button .ic { width: 18px; height: 18px; }
.ph-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; aspect-ratio: 1; border: 1.5px dashed var(--line-2); border-radius: 10px; background: #FAFAFA; color: var(--muted); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.ph-add:active { background: #F0F0F0; }
.ph-add .ic { width: 26px; height: 26px; }
.flash { animation: flash 1.2s var(--ease); }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--orange); border-radius: 10px; } 100% { box-shadow: 0 0 0 3px transparent; } }

.ai-banner { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0 0; padding: 12px 8px 12px 16px; background: var(--orange-soft); border-top: 1px solid var(--orange-line); border-bottom: 1px solid var(--orange-line); }
.ai-banner__ic { color: var(--orange-text); margin-top: 2px; }
.ai-banner div { flex: 1; display: flex; flex-direction: column; font-size: 14.5px; }
.ai-banner strong { color: var(--orange-text); font-size: 15.5px; }
.ai-banner .iconbtn { width: 40px; height: 40px; margin-top: -6px; }

/* ---------- Boutons et barre d'action ---------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: background-color 0.12s, transform 0.08s;
}
.btn:active { transform: scale(0.99); }
.btn--primary { background: var(--orange); color: var(--ink); }
.btn--primary:active { background: var(--orange-press); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line-2); }
.btn--ghost:active { background: #F4F4F4; }
.btn--danger { background: #fff; color: var(--red); border: 1.5px solid #E7B4AE; }
.btn--text { background: transparent; color: var(--ink-2); font-family: var(--font-ui); font-weight: 700; font-size: 16px; min-height: 48px; }
.btn--sm { min-height: 44px; font-size: 15px; padding: 0 14px; border-radius: 10px; }
.btn--auto { width: auto; flex: none; }
.btn .ic { width: 22px; height: 22px; }
.btn-link { color: var(--orange-text); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; min-height: 40px; }

.actionbar {
  position: sticky;
  bottom: 0;
  z-index: 15;
  padding: 10px 16px calc(12px + var(--safe-b));
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.actionbar__note { margin: 0 0 8px; text-align: center; font-size: 12.5px; color: var(--faint); }
.actionbar--flow { position: static; margin-top: 24px; background: transparent; border: 0; display: flex; flex-direction: column; gap: 6px; backdrop-filter: none; }

/* ---------- Feuilles du bas ---------- */

.sheet-bg { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; background: rgba(20, 20, 20, 0.5); animation: fade 0.18s ease-out; }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow: auto; overscroll-behavior: contain; background: #fff; border-radius: 22px 22px 0 0; padding: 8px 18px calc(20px + var(--safe-b)); animation: up 0.24s var(--ease); }
.sheet__grip { width: 40px; height: 5px; border-radius: 3px; background: #D6D6D6; margin: 0 auto 6px; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 -10px 8px 0; }
.sheet__title { font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: -0.015em; margin: 0; }
.sheet__lead { margin: 0 0 16px; color: var(--muted); font-size: 15.5px; }
.sheet__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.sheet__fine { margin: 0; text-align: center; font-size: 13.5px; color: var(--muted); }
.sheet .field { margin-top: 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0.4; } }

.ck-h { margin: 14px 0 6px; font-family: var(--font-ui); font-size: 13.5px; font-weight: 700; }
.ck-h--b { color: var(--red); }
.ck-h--w { color: var(--amber); }
.ck-list { border-top: 1px solid var(--line); }
.ck { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.ck__ic { flex: none; }
.ck--b .ck__ic { color: var(--red); }
.ck--w .ck__ic { color: var(--amber-ic); }
.ck__txt { flex: 1; font-size: 15.5px; font-weight: 500; }
.ck__btn { flex: none; min-height: 40px; padding: 0 12px; border-radius: 9px; font-weight: 700; font-size: 14.5px; color: var(--orange-text); background: var(--orange-soft); }
.ck-ok { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-weight: 700; color: var(--green); }

.inline-add { display: flex; gap: 8px; }
.inline-add input { flex: 1; width: auto; min-width: 0; }

/* Dictée */
.mic-big { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; padding: 18px 0 16px; margin-bottom: 14px; border-radius: 16px; background: #F4F4F4; font-weight: 700; color: var(--ink-2); }
.mic-big .ic { width: 34px; height: 34px; padding: 18px; box-sizing: content-box; border-radius: 50%; background: var(--ink); color: var(--orange); }
.mic-big.is-on { background: var(--orange-soft); color: var(--orange-text); }
.mic-big.is-on .ic { background: var(--orange); color: var(--ink); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(232, 119, 34, 0.45); } 50% { box-shadow: 0 0 0 14px rgba(232, 119, 34, 0); } }
#dictee-text { min-height: 140px; overflow: auto; }
.demo-note { display: flex; gap: 8px; margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: #F6F6F6; color: var(--muted); font-size: 13.5px; }
.demo-note .ic { width: 18px; height: 18px; margin-top: 1px; }

/* ---------- Signature ---------- */

.handoff { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 16px; background: var(--orange-soft); color: var(--orange-text); font-weight: 700; font-size: 15px; border-bottom: 1px solid var(--orange-line); }
.doc { margin: 14px 12px 0; padding: 18px 16px 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.doc__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 2px solid var(--orange); }
.doc__logo { width: 112px; height: auto; margin-top: 4px; }
.doc__no { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-size: 13px; color: var(--muted); }
.doc__no strong { font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--ink); }
.doc__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.doc__cell { padding: 10px 12px; border-radius: 10px; background: #F6F6F6; min-width: 0; }
.doc__k { font-size: 12.5px; font-weight: 700; color: var(--orange-text); margin-bottom: 3px; }
.doc__v { display: flex; flex-direction: column; font-size: 14.5px; overflow-wrap: anywhere; }
.doc__v strong { font-size: 15.5px; }
.doc__v span { color: var(--ink-2); }
.doc__p { margin: 0 0 4px; font-size: 15.5px; }
.doc__cause { margin: 0 0 14px; font-size: 14.5px; font-weight: 700; }
.doc__lines { width: 100%; border-collapse: collapse; font-size: 15px; margin-bottom: 12px; }
.doc__lines th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 700; padding: 0 0 6px; border-bottom: 2px solid var(--orange); }
.doc__lines th:last-child, .doc__lines td:last-child { text-align: right; white-space: nowrap; padding-left: 12px; }
.doc__lines td { padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc__lines td:last-child { font-weight: 700; }
.doc__meta { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }

.sec--sign { margin-top: 14px; }
.sig { position: relative; height: 210px; border: 1.5px solid var(--line-2); border-radius: 12px; background: #fff; touch-action: none; overflow: hidden; }
.sig canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; z-index: 2; }
.sig__line { position: absolute; left: 18px; right: 18px; bottom: 46px; border-bottom: 1.5px dashed #D2D2D2; z-index: 1; pointer-events: none; }
.sig__ph { position: absolute; left: 0; right: 0; bottom: 56px; text-align: center; color: var(--faint); font-size: 16px; z-index: 1; pointer-events: none; }
.is-err .sig { border-color: var(--red); background: var(--red-soft); }
.sig__tools { display: flex; gap: 8px; margin-top: 8px; }
.tool { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 10px; background: #EFEFEF; font-weight: 700; font-size: 15px; }
.tool .ic { width: 18px; height: 18px; }
.sig--full { position: fixed; inset: 0; z-index: 70; height: auto; border: 0; border-radius: 0; }
.sig--full .sig__line { bottom: 22%; }
.sig--full .sig__ph { bottom: calc(22% + 12px); }
.sig__bar { position: absolute; left: 0; right: 0; top: 0; z-index: 3; display: flex; align-items: center; gap: 8px; padding: calc(var(--safe-t) + 10px) 12px 10px 16px; background: rgba(255, 255, 255, 0.94); border-bottom: 1px solid var(--line); }
.sig__bar-title { flex: 1; font-family: var(--font-display); font-weight: 700; }
.sig__bar .btn { width: auto; }
.legal { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.radios { display: flex; flex-direction: column; gap: 8px; }
.radio { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 14px; border: 1.5px solid var(--line-2); border-radius: 10px; background: #fff; font-weight: 500; overflow-wrap: anywhere; cursor: pointer; }
.radio input { width: 22px; height: 22px; accent-color: var(--orange); flex: none; margin: 0; }
.radio:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

/* ---------- Après signature ---------- */

.done { padding: calc(var(--safe-t) + 44px) 20px 22px; text-align: center; background: var(--ink); color: #fff; }
.done__badge { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 50%; background: var(--orange); color: var(--ink); animation: pop 0.5s var(--ease) both; }
.done__badge .ic { width: 42px; height: 42px; stroke-width: 2.8; }
.done__h { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 30px; letter-spacing: -0.02em; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } }
.detail-top { padding: 16px 16px 0; color: var(--muted); }
.detail-top p { margin: 0; }
.status-card { margin: 16px 12px 0; padding: 4px 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.st { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.st:last-child { border-bottom: 0; }
.st__ic { flex: none; margin-top: 1px; }
.st div { display: flex; flex-direction: column; font-size: 14.5px; }
.st strong { font-size: 15.5px; overflow-wrap: anywhere; }
.st span { color: var(--muted); }
.st--ok .st__ic { color: var(--green); }
.st--warn .st__ic { color: var(--amber-ic); }
.st--wait .st__ic { color: var(--muted); }
.st--wait .st__ic .ic { animation: spin 1s linear infinite; }
.st--muted .st__ic { color: var(--faint); }
.stack { display: flex; flex-direction: column; gap: 10px; margin: 16px 12px 0; }
.err-line { margin: 0; color: var(--red); font-weight: 700; }

/* ---------- Aperçu Notion ---------- */

.np-intro { margin: 0; padding: 14px 16px; font-size: 14.5px; color: var(--muted); }
.np { margin: 0 12px; padding: 22px 18px 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; color: #37352F; }
.np__title { margin: 0 0 14px; font-family: var(--font-ui); font-weight: 700; font-size: 28px; letter-spacing: -0.01em; color: #37352F; }
.np__props { display: flex; flex-direction: column; gap: 2px; padding-bottom: 14px; margin-bottom: 8px; border-bottom: 1px solid #ECECEA; }
.np__prop { display: grid; grid-template-columns: 132px 1fr; gap: 8px; align-items: start; min-height: 32px; padding: 5px 0; font-size: 14.5px; }
.np__k { display: flex; align-items: center; gap: 6px; color: #787774; }
.np__k .ic { width: 16px; height: 16px; }
.np__v { overflow-wrap: anywhere; }
.np__tag { display: inline-block; padding: 1px 7px; border-radius: 4px; background: #E9E8E5; font-size: 13.5px; }
.np__tag--done { background: #DBEDDB; color: #1C3829; }
.np__h2 { margin: 20px 0 8px; font-family: var(--font-ui); font-size: 18px; font-weight: 700; color: #37352F; }
.np__file { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; background: #F7F6F3; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.np__file .ic { width: 18px; height: 18px; color: #C0352A; }
.np__label { margin: 12px 0 6px; font-size: 13.5px; color: #787774; }
.np__text { white-space: pre-wrap; padding: 12px 14px; border-radius: 8px; background: #F7F6F3; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.np__photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.np__photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.np__none { margin: 0; color: #9B9A97; font-size: 14px; }

/* ---------- Réglages ---------- */

.switch { position: relative; width: 56px; height: 34px; border-radius: 999px; background: #CDCDCD; flex: none; margin-right: 8px; transition: background-color 0.15s; }
.switch__knob { position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.18s var(--ease); }
.switch[aria-checked="true"] { background: var(--orange); }
.switch[aria-checked="true"] .switch__knob { transform: translateX(22px); }
.ic--ok { color: var(--green); }

/* ---------- Toasts et attente ---------- */

#toast-root { position: fixed; left: 0; right: 0; bottom: calc(108px + var(--safe-b)); z-index: 80; display: flex; justify-content: center; pointer-events: none; padding: 0 16px; }
.toast { display: flex; align-items: center; gap: 14px; max-width: 520px; padding: 12px 14px 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 15px; font-weight: 500; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); pointer-events: auto; animation: up 0.2s var(--ease); }
.toast button { color: var(--orange); font-weight: 700; min-height: 32px; flex: none; }
.toast--out { opacity: 0; transition: opacity 0.2s; }
.spin .ic, .spin { display: inline-grid; }
.spin .ic { width: 22px; height: 22px; color: currentColor; animation: spin 0.9s linear infinite; }
.pdf-zone { display: contents; }
.btn:disabled { opacity: 0.7; cursor: default; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty { padding: 60px 24px; text-align: center; }
.empty__h { font-family: var(--font-display); font-weight: 800; font-size: 24px; margin: 0 0 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------- Saisie : lieux, dépôts et sorties ---------- */

.chips--g4 { grid-template-columns: repeat(4, 1fr); }
.chip--sm { min-height: 40px; padding: 0 14px; font-size: 14.5px; }
.sec__note a { color: var(--orange-text); font-weight: 700; white-space: nowrap; }
.notice--sec { margin: 12px 0 0; }
input:disabled { background: #F2F2F2; color: var(--faint); }
input:disabled::placeholder { color: var(--muted); }

/* Une sortie est toujours moins visible que le geste normal. */
.exit-link { display: inline-block; min-height: 36px; padding: 6px 0; font-size: 14px; font-weight: 400; color: var(--muted); text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.exit-note { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; padding: 6px 10px; border-radius: 10px; background: var(--amber-soft); color: var(--amber); font-size: 14px; }
.exit-note .ic { width: 18px; height: 18px; color: var(--amber-ic); }
.exit-note span { flex: 1; min-width: 0; }
.photo-exit { margin-top: 4px; }
.ck__exit { display: block; min-height: 30px; padding: 2px 0 0; }
.sig__absent-wrap { margin: 0; padding: 12px 16px calc(14px + var(--safe-b)); text-align: center; background: var(--card); }

/* ---------- Saisie : lignes du BL ---------- */

.lines-sub { margin: 20px 0 8px; font-family: var(--font-ui); font-size: 15px; font-weight: 700; color: var(--ink); }
.lines-sub:first-child { margin-top: 0; }
.line--libre { grid-template-columns: 26px 1fr 84px 44px; }
.line--libre input { padding-left: 10px; padding-right: 10px; }
.line__grip { display: grid; place-items: center; width: 26px; height: 50px; color: var(--faint); cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.line__grip:active { color: var(--ink); cursor: grabbing; }
.line.is-dragging { position: relative; z-index: 3; background: #fff; border-radius: 12px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16); }
.line__cause { grid-column: 2 / -1; display: flex; gap: 8px; }
.line--dep { display: block; }
.dep__top { display: grid; grid-template-columns: 1fr 84px 44px; gap: 6px; align-items: center; margin-bottom: 8px; }
.dep__km { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.dep__km .suffix-input { width: 112px; flex: none; }
.dep__offert { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; font-weight: 500; }

/* ---------- Guide de dictée ---------- */

.dg { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.dg__item { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px 5px 7px; border-radius: 8px; background: #EFEFEF; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.dg__item .ic { width: 17px; height: 17px; color: var(--faint); }
.dg__item.is-done { background: #F6F6F6; color: var(--faint); }
.dg__item.is-ok { background: var(--green-soft); color: var(--green); font-weight: 700; }
.dg__item.is-ok .ic { color: var(--green); }

/* ---------- Tous les BL signés ---------- */

.pad--search .search { margin-top: 0; }
