:root {
  --bg: #e4eefa;          /* fond de page : bleu clair */
  --card: #ffffff;
  --ink: #13243b;
  --muted: #53637a;
  --line: #bdd0e6;
  --brand: #1a4f91;       /* boutons principaux */
  --brand-ink: #ffffff;
  --head: #17407a;        /* en-tête : bleu un peu foncé */
  --nav: #3b8fdc;         /* options du menu : bleu moyen */
  --nav-hover: #2e7fcb;
  --nav-active: #0d5aa8;
  --accent: #f2b632;
  --danger: #b3382c;
  --ok: #2f8a57;
  --radius: 12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
a { color: inherit; }

/* ---------- Mise en page : en-tête, menu, espace de travail ---------- */
#shell { min-height: 100vh; display: flex; flex-direction: column; }
#head {
  display: grid; grid-template-columns: 1fr minmax(240px, 300px); gap: 16px; align-items: stretch;
  padding: 14px 20px; padding-top: calc(14px + env(safe-area-inset-top));
  background: var(--head); color: #fff; border-bottom: 3px solid var(--nav);
}
.box { border: 1.5px solid rgba(255,255,255,.55); border-radius: 12px; padding: 10px 14px; background: rgba(255,255,255,.08); color: #fff; min-width: 0; }
.box.brand { display: flex; align-items: center; gap: 16px; }
.brand .logo { flex: none; display: flex; align-items: center; justify-content: center; width: 96px; min-height: 72px; padding-right: 16px; border-right: 1.5px solid rgba(255,255,255,.45); font-weight: 800; font-size: 1.3rem; }
.brand .logo img { max-width: 100%; max-height: 72px; object-fit: contain; }
.brand .org { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; }
.org .o1 { font-weight: 800; font-size: 1rem; line-height: 1.25; }
.org .o2 { font-weight: 700; font-size: .95rem; }
.org .o3 { font-weight: 700; font-size: .8rem; color: #cfe2f8; }
.box.acct { font-size: .85rem; display: flex; flex-direction: column; gap: 1px; }
.acct .lab { font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .72rem; color: #cfe2f8; }
.acct .mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct .nm { font-weight: 800; text-transform: uppercase; }
.acct .rl { font-weight: 600; }
.acct-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; }
.sync { display: flex; align-items: center; gap: 6px; background: transparent; border: 0; color: #fff; font: inherit; font-size: .78rem; cursor: pointer; padding: 4px 0; text-align: left; }
.link-btn { background: transparent; border: 0; color: #ffd6d0; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; padding: 4px 0; text-decoration: underline; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #b5c3d4; flex: none; }
.dot.ok { background: #5fd38d; } .dot.busy { background: var(--accent); animation: pulse 1s infinite; }
.dot.off { background: #b5c3d4; } .dot.err { background: #d0452f; }
@keyframes pulse { 50% { opacity: .35; } }
.menu-btn { display: none; }

.body { flex: 1; display: grid; grid-template-columns: 240px 1fr; align-items: start; }
#nav { position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; gap: 10px; padding: 18px 16px; max-height: 100vh; overflow-y: auto; }
.navitem {
  display: flex; align-items: center; justify-content: flex-start; gap: 12px; text-align: left; min-height: 52px; padding: 8px 14px;
  border: 1.5px solid var(--nav-hover); border-radius: 14px; background: var(--nav); color: #fff;
  font-weight: 800; font-size: .8rem; letter-spacing: .02em; text-transform: uppercase; text-decoration: none; line-height: 1.2;
  box-shadow: 0 1px 2px rgba(13,60,110,.25);
}
.navitem:hover { background: var(--nav-hover); }
.navitem.active { background: var(--nav-active); border-color: #fff; box-shadow: 0 0 0 3px var(--nav), 0 2px 6px rgba(13,60,110,.35); }
.navitem:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.navitem .ico { font-size: 1.15rem; flex: 0 0 28px; width: 28px; text-align: center; line-height: 1; }
.scrim { display: none; }
body.auth-mode #head, body.auth-mode #nav { display: none; }
body.auth-mode .body { grid-template-columns: 1fr; }

@media (max-width: 860px) {
  #head { grid-template-columns: auto 1fr; gap: 10px; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top)); }
  .menu-btn { display: flex; align-items: center; justify-content: center; width: 44px; border: 1.5px solid rgba(255,255,255,.55); border-radius: 12px; background: rgba(255,255,255,.08); color: #fff; font-size: 1.3rem; cursor: pointer; }
  .box { padding: 8px 10px; }
  .box.brand { gap: 10px; }
  .brand .logo { width: 56px; min-height: 48px; padding-right: 10px; font-size: .85rem; }
  .brand .logo img { max-height: 44px; }
  .org .o1 { font-size: .72rem; } .org .o2 { font-size: .7rem; } .org .o3 { font-size: .65rem; }
  .box.acct { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px 12px; }
  .acct .lab, .acct .mail { display: none; }
  .acct-actions { margin: 0 0 0 auto; gap: 14px; }
  .body { grid-template-columns: 1fr; }
  #nav {
    position: fixed; z-index: 40; top: 0; left: 0; bottom: 0; height: 100dvh; width: min(82vw, 300px); max-height: none; align-self: auto;
    background: var(--bg); padding-top: calc(18px + env(safe-area-inset-top)); box-shadow: 4px 0 24px rgba(0,0,0,.25);
    transform: translateX(-105%); transition: transform .22s ease; visibility: hidden;
  }
  body.menu-open #nav { transform: none; visibility: visible; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.45); }
}
@media (prefers-reduced-motion: reduce) { #nav { transition: none; } .dot.busy { animation: none; } }

main { width: 100%; max-width: 1040px; min-width: 0; padding: 20px 20px 32px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
  padding: 0 16px; border-radius: 10px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.small { min-height: 34px; padding: 0 10px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: default; }

input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
textarea { resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
label { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); }
label > input, label > select, label > textarea { margin-top: 4px; font-weight: 400; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; margin-top: 16px; }
.muted { color: var(--muted); font-size: .9rem; }
.grow { flex: 1; min-width: 0; }

.crumbs { display: flex; flex-wrap: wrap; gap: 4px; font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.crumbs span.sep { opacity: .6; }

.list { list-style: none; margin: 0; padding: 0; }
.list li a {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line);
  text-decoration: none; min-height: 52px;
}
.list li:last-child a { border-bottom: 0; }
.list .ico { font-size: 1.4rem; width: 32px; text-align: center; flex: none; }
.list .t { font-weight: 600; overflow-wrap: anywhere; }
.list .s { color: var(--muted); font-size: .85rem; }
.list .chev { color: var(--muted); margin-left: auto; }
.empty { color: var(--muted); padding: 8px 0; }

.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.types button {
  display: flex; align-items: center; gap: 10px; text-align: left; min-height: 52px; padding: 8px 12px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; font: inherit; color: var(--ink); cursor: pointer;
}
.types button:hover { border-color: var(--brand); }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form .full { grid-column: 1 / -1; }
.form h3.sec { margin: 12px 0 0; padding-bottom: 4px; border-bottom: 2px solid var(--accent); grid-column: 1 / -1; }
@media (max-width: 640px) { .form { grid-template-columns: 1fr; } main { padding: 12px 12px 28px; } }

.title-input { font-size: 1.25rem; font-weight: 700; }
.tag { font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.saved { font-size: .8rem; color: var(--ok); min-height: 1.2em; }

.lines { width: 100%; border-collapse: collapse; font-size: .9rem; }
.lines th { text-align: left; font-size: .75rem; color: var(--muted); padding: 4px; }
.lines td { padding: 3px; vertical-align: top; }
.lines input { min-height: 38px; padding: 6px 8px; }
.lines .num { text-align: right; }
.lines td.tot { text-align: right; white-space: nowrap; padding-top: 12px; }
.totals { margin-top: 8px; margin-left: auto; max-width: 300px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.totals .ttc { font-weight: 700; border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 6px; }
@media (max-width: 640px) {
  .lines thead { display: none; }
  .lines tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .lines td:first-child { grid-column: 1 / -1; }
  .lines td.tot, .lines td.del { padding-top: 0; }
}

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 8px; }
.photo { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
.photo img { display: block; width: 100%; height: 120px; object-fit: cover; }
.photo input { border: 0; border-top: 1px solid var(--line); border-radius: 0; min-height: 36px; font-size: .85rem; }
.photo button { width: 100%; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--danger); min-height: 34px; font: inherit; font-size: .8rem; cursor: pointer; }

.auth { max-width: 420px; margin: 8vh auto 0; }
.auth h1 { text-align: center; }
.tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.tabs button { flex: 1; min-height: 44px; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.notice { background: #fff6dc; color: #5b4300; border: 1px solid #ecd48a; border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin-bottom: 12px; }
.error { color: var(--danger); font-size: .9rem; min-height: 1.3em; }

dialog.dlg { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); width: min(92vw, 420px); padding: 20px; }
dialog.dlg::backdrop { background: rgba(0,0,0,.45); }

#toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: #13243b; color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none;
  transition: .25s; max-width: 90vw; z-index: 50; font-size: .9rem;
}
#toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------- Impression / PDF ---------- */
#print { display: none; }
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  #shell, #toast, dialog { display: none !important; }
  #print { display: block; }
  .p-head { display: flex; justify-content: space-between; border-bottom: 3px solid #1f3a4d; padding-bottom: 8px; margin-bottom: 14px; }
  .p-head .co { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #1f3a4d; font-size: 9.5pt; line-height: 1.35; }
  .p-head .co img { height: 52px; width: auto; max-width: 90px; object-fit: contain; }
  .p-head .meta { text-align: right; font-size: 9.5pt; color: #444; }
  #print h1 { font-size: 18pt; margin: 0 0 4px; }
  #print .kind { text-transform: uppercase; letter-spacing: .08em; font-size: 9pt; color: #666; }
  #print .path { font-size: 9.5pt; color: #444; margin-bottom: 12px; }
  #print h2 { font-size: 12pt; background: #eceff1; padding: 4px 8px; margin: 14px 0 6px; break-after: avoid; }
  #print table.kv { width: 100%; border-collapse: collapse; }
  #print table.kv td { padding: 4px 6px; border-bottom: 1px solid #ddd; vertical-align: top; }
  #print table.kv td:first-child { width: 36%; color: #444; font-weight: 600; }
  #print .pre { white-space: pre-wrap; }
  #print table.items { width: 100%; border-collapse: collapse; margin-top: 4px; }
  #print table.items th, #print table.items td { border: 1px solid #999; padding: 4px 6px; font-size: 10pt; }
  #print table.items th { background: #eceff1; }
  #print .r { text-align: right; }
  #print .tot { margin-left: auto; width: 55%; margin-top: 8px; }
  #print .tot div { display: flex; justify-content: space-between; padding: 2px 0; }
  #print .tot .ttc { font-weight: 700; border-top: 2px solid #000; }
  #print .pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  #print .pgrid figure { margin: 0; break-inside: avoid; }
  #print .pgrid img { width: 100%; max-height: 7cm; object-fit: contain; border: 1px solid #ccc; }
  #print .pgrid figcaption { font-size: 9pt; color: #444; }
  #print .sign { margin-top: 36px; display: flex; justify-content: flex-end; }
  #print .sign div { width: 50%; min-height: 64px; border-top: 1px solid #000; padding-top: 4px; text-align: center; font-size: 9.5pt; }
}

/* ---------- Paramètre ---------- */
.logo-edit { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-prev { width: 110px; height: 84px; border: 1.5px dashed var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; font-weight: 800; color: var(--muted); }
.logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- Avis technique (ODP) ---------- */
.choices { display: grid; gap: 8px; margin: 12px 0; }
.choices .btn { height: auto; min-height: 56px; padding: 10px 14px; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }
.choices .btn small { font-weight: 400; opacity: .85; font-size: .8rem; }
details.fold { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
details.fold summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.stepper { list-style: none; display: flex; gap: 8px; flex-wrap: wrap; padding: 0; margin: 0 0 14px; }
.stepper .st { flex: 1 1 150px; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); font-weight: 700; font-size: .85rem; min-width: 0; }
.stepper .n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--bg); border: 1.5px solid var(--line); font-size: .8rem; }
.stepper .st.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.stepper .st.on .n { background: #fff; color: var(--brand); border-color: #fff; }
.stepper .st.done .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.q { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 10px; }
.q-t { font-weight: 600; }
.yn { display: flex; gap: 8px; flex-wrap: wrap; }
.yn-b { min-height: 44px; min-width: 96px; padding: 0 20px; border: 1.5px solid var(--brand); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.yn-b.on { background: var(--brand); color: #fff; }
.yn-b:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ro { border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; background: var(--bg); }
.ro .lab { font-size: .8rem; font-weight: 600; color: var(--muted); }

.odp-view { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; align-items: start; }
.odp-actions { position: sticky; top: 12px; display: grid; gap: 10px; }
.odp-actions .btn { justify-content: flex-start; min-height: 52px; }
.odp-main { min-width: 0; }
.odp-wrap { width: 100%; overflow: hidden; }
@media (max-width: 860px) {
  .odp-view { grid-template-columns: 1fr; }
  .odp-actions { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; top: auto; grid-template-columns: repeat(3, 1fr); gap: 6px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); background: var(--card); border-top: 2px solid var(--nav); }
  .odp-actions .btn { flex-direction: column; justify-content: center; gap: 2px; min-height: 56px; padding: 4px; font-size: .72rem; text-align: center; line-height: 1.15; }
  main { padding-bottom: 96px; }
}

/* Feuille A4 : aperçu et impression */
.odp-sheet { position: relative; box-sizing: border-box; width: 794px; min-height: 1123px; padding: 38px 76px 96px; background: #fff; color: #000;
  font: 12pt/1.28 "Times New Roman", Times, "Liberation Serif", serif; box-shadow: 0 2px 14px rgba(13, 60, 110, .25); }
.odp-sheet b { font-weight: 700; }
.odp-top { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: center; font-size: 10.5pt; line-height: 1.2; }
.odp-logo { width: 4.6cm; max-width: 100%; display: block; margin: 0 auto 4px; }
.odp-arm { width: 3.2cm; max-width: 100%; display: block; margin: 8px auto; }
.odp-right { padding-top: 0; }
.odp-sheet .dash { line-height: 1; }
.odp-ref { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0 26px; }
.odp-ref .red { color: #e00000; }
.odp-dest { margin-left: 9.5cm; margin-bottom: 18px; line-height: 1.3; }
.odp-objet { margin: 0 0 10px 1.25cm; }
.odp-p { margin: 0 0 9px; text-align: justify; text-indent: 1.25cm; }
.odp-list { list-style: none; margin: 0 0 9px; padding: 0 0 0 1.5cm; text-align: justify; }
.odp-list li { position: relative; padding-left: .5cm; }
.odp-list li::before { content: "-"; position: absolute; left: 0; }
.odp-sign { margin: 36px 0 0 9.5cm; width: 7.8cm; text-align: center; }
.odp-sign .role { font-weight: 700; font-style: italic; }
.odp-sign .gap { height: 25mm; }
.odp-sign .name { font-weight: 700; text-decoration: underline; }
.odp-sign .ttl { font-weight: 700; font-style: italic; }
.odp-foot { position: absolute; left: 76px; right: 76px; bottom: 26px; border-top: 1px solid #000; padding-top: 5px; text-align: center; font-style: italic; font-size: 10pt; }
@media print {
  #print .odp-sheet { width: auto; min-height: 0; padding: 0; box-shadow: none; transform: none !important; }
  #print .odp-foot { position: fixed; left: 0; right: 0; bottom: 0; }
}

/* ---------- Expertise bail administratif ---------- */
.form h4.sub { grid-column: 1 / -1; margin: 10px 0 2px; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.stepper.five .st { flex: 1 1 130px; }
.bl-e { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .bl-e { grid-template-columns: 1fr; } }
.bl-e .sub { margin-top: 0; }
.pts { display: grid; }
.pt-row { display: grid; grid-template-columns: 1fr 110px; align-items: center; gap: 10px; padding: 3px 0; border-bottom: 1px solid var(--line); font-size: .92rem; font-weight: 600; color: var(--ink); }
.pt-row input { margin: 0; min-height: 38px; text-align: right; padding: 4px 10px; }
.pt-total { display: flex; justify-content: space-between; padding: 8px 0 0; margin-top: 2px; border-top: 2px solid var(--ink); font-weight: 800; }
.warn { color: var(--danger); font-size: .82rem; font-weight: 600; min-height: 1.1em; }
.res { display: grid; gap: 2px; padding: 10px 14px 14px; background: var(--card); border: 1.5px solid var(--nav); border-radius: 12px; }
.res .row-r { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.res .row-r b { white-space: nowrap; }
.res-main { margin-top: 10px; padding: 12px; text-align: center; background: #ebf1de; border: 2px solid var(--brand); border-radius: 12px; display: grid; gap: 4px; }
.res-lab { font-size: .78rem; font-weight: 800; letter-spacing: .04em; color: var(--muted); }
.res-big { font-size: 2rem; font-weight: 800; color: var(--brand); line-height: 1.15; }
@media (max-width: 860px) { .odp-actions.two { grid-template-columns: repeat(2, 1fr); } }

/* Feuilles A4 de l'expertise (aperçu et impression) */
.bl-doc { width: 794px; display: grid; gap: 18px; font: 12pt/1.28 "Times New Roman", Times, "Liberation Serif", serif; color: #000; }
.bl-page { position: relative; box-sizing: border-box; width: 794px; min-height: 1123px; padding: 38px 76px 56px; background: #fff; box-shadow: 0 2px 14px rgba(13, 60, 110, .25); }
.bl-page b { font-weight: 700; }
.bl-top { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: center; font-size: 10.5pt; line-height: 1.2; }
.bl-logo img { width: 4.6cm; max-width: 100%; display: block; margin: 0 auto 4px; }
.bl-arm { width: 3.2cm; max-width: 100%; display: block; margin: 8px auto; }
.bl-page .dash { line-height: 1; }
.bl-page .s9 { font-size: 9pt; }
.bl-ref { display: flex; justify-content: space-between; gap: 12px; margin: 22px 0 14px; }
.bl-ref .red { color: #e00000; }
.bl-title { text-align: center; font-size: 15pt; margin: 20px 0 8px; font-weight: 700; }
.bl-intro { margin: 0 0 14px; text-align: center; font-style: italic; font-size: 13.5pt; }
.bl-h { display: flex; gap: 8px; margin: 16px 0 6px; font-size: 11.5pt; font-weight: 700; }
.bl-h .n { font-style: italic; }
.bl-grp { margin: 6px 0 2px 1.2cm; }
.bl-ul { list-style: none; margin: 0 0 4px; padding: 0 0 0 .3cm; }
.bl-ul li { position: relative; padding-left: .5cm; }
.bl-ul li::before { content: "-"; position: absolute; left: 0; }
.bl-desc { margin: 4px 0 0 1.2cm; }
.bl-h2 { margin: 14px 0 6px; font-size: 10.5pt; }
.bl-t { width: 100%; border-collapse: collapse; border: 2px solid #000; font-size: 10pt; }
.bl-t td { border: 1px solid #000; padding: 2px 6px; }
.bl-t .c { text-align: center; } .bl-t .r { text-align: right; } .bl-t .ind { padding-left: .35cm; }
.bl-t .grey, .bl-t.bl-vl td { background: #d9d9d9; }
.bl-t.bl-vlr td { background: #ebf1de; } .bl-t .big { font-size: 13pt; }
.bl-vl, .bl-vlr { margin-top: 10px; }
.bl-f { display: flex; align-items: center; gap: 10px; margin: 8px 0 6px 5.4cm; font-size: 10.5pt; }
.bl-f.f2 { margin-left: 4.2cm; }
.bl-f .fr { display: inline-flex; flex-direction: column; text-align: center; min-width: 2.6cm; }
.bl-f .fr .num { border-bottom: 1px solid #000; padding: 0 6px; }
.bl-am { margin: 6px 0; font-size: 10.5pt; }
.bl-sent { margin: 16px 0 12px; font-size: 10.5pt; }
.bl-sign { margin: 18px 0 0 9.5cm; width: 7.8cm; text-align: center; }
.bl-sign .role { font-weight: 700; }
.bl-sign .gap { height: 25mm; }
.bl-sign .name { font-weight: 700; text-decoration: underline; }
.bl-sign .ttl { font-style: italic; }
@media print {
  #print .bl-doc { width: auto; display: block; transform: none !important; }
  #print .bl-page { width: auto; min-height: 0; padding: 0; box-shadow: none; break-after: page; page-break-after: always; }
  #print .bl-page:last-child { break-after: auto; page-break-after: auto; }
}

/* ---------- Certificat d'urbanisme ---------- */
.stepper.three .st { flex: 1 1 170px; }
.choices:has(.choice) { grid-template-columns: 1fr 1fr; margin: 6px 0 0; }
.choice { min-height: 56px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font: inherit; font-weight: 800; letter-spacing: .03em; cursor: pointer; padding: 10px; }
.choice.ok.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.choice.no.on { background: var(--danger); border-color: var(--danger); color: #fff; }
.checks { display: grid; gap: 6px; margin-top: 6px; }
label.chk { display: flex; align-items: center; gap: 10px; font-weight: 600; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); }
label.chk input { width: 20px; height: 20px; margin: 0; flex: none; }
.cu-sheet .odp-ref { margin: 14px 0 14px; }
.cu-title { text-align: center; font-size: 16pt; font-weight: 700; text-decoration: underline; margin: 0 0 14px; font-family: "Comic Sans MS", "Segoe UI", Arial, sans-serif; }
.cu-box { border: 1.5px solid #000; margin: 0 0 14px; }
.cu-bh { background: #bdd6ee; font-weight: 700; padding: 0 4px; border-bottom: 1px solid #000; }
.cu-box ul { list-style: square; margin: 0; padding: 2px 6px 2px 26px; }
.cu-l { margin: 0 0 5px; }
.cu-hang { padding-left: 3.2cm; text-indent: -3.2cm; }
.cu-h { margin: 14px 0 5px; font-size: 12pt; }
.cu-sub { margin: 7px 0 1px; font-size: 11pt; }
.cu-sv { margin-left: 20px; font-size: 11pt; line-height: 1.3; }
.cu-sign { margin: 22px 0 0 9.5cm; width: 7.8cm; text-align: center; }
.cu-sign .gap { height: 20mm; }
.cu-sign .name { font-weight: 700; text-decoration: underline; }
.cu-sign .ttl { font-weight: 700; font-style: italic; }
@media print { #print .cu-sheet { min-height: 0; } }

/* ---------- Registre (accueil), présentation du modèle ---------- */
.reg-title { text-align: center; font: 700 clamp(1.3rem, 4.2vw, 2.1rem)/1.2 "Times New Roman", Times, serif; color: #000; margin: 2px 0 14px; letter-spacing: .01em; }
.reg-search { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "t b" "f b"; gap: 10px 16px; align-items: center; border: 2px solid #1f3864; border-radius: 16px; padding: 12px 16px; background: #dae3f3; }
.rs-title { grid-area: t; font-weight: 800; font-size: .9rem; }
.rs-fields { grid-area: f; display: grid; grid-template-columns: 1fr 1.2fr 2.2fr; gap: 12px 18px; }
.reg-search label { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: .85rem; color: #000; margin: 0; }
.reg-search label.wide { min-width: 0; }
.reg-search input { margin: 0; min-height: 34px; flex: 1; min-width: 0; width: 100%; text-align: center; background: #4472c4; color: #fff; border: 1.5px solid #2f528f; border-radius: 8px; font-size: .95rem; }
.rs-combo { position: relative; flex: 1; min-width: 0; display: flex; flex-wrap: wrap; }
.rs-combo input { flex: 1 1 100%; }
.rs-combo input { padding-right: 34px; }
.rs-drop { position: absolute; right: 0; top: 0; bottom: 0; width: 34px; margin: 0; padding: 0; background: transparent; border: 0; color: #fff; font-size: 1rem; cursor: pointer; }
.rs-list { flex: 0 0 100%; margin-top: 4px; max-height: 180px; overflow-y: auto; background: #fff; border: 1.5px solid #2f528f; border-radius: 8px; }
.rs-opt { display: block; width: 100%; text-align: left; margin: 0; padding: 10px 12px; background: #fff; color: #000; border: 0; border-bottom: 1px solid #e3e8f2; border-radius: 0; font-size: .95rem; min-height: 40px; }
.rs-opt:hover, .rs-opt:active { background: #dae3f3; }
.reg-search input::placeholder { color: #d9e2f3; font-size: .8rem; }
.rs-btn { grid-area: b; min-width: 140px; min-height: 76px; background: #4472c4; color: #e9efff; border: 2.5px solid #2f528f; border-radius: 14px; font: inherit; font-size: .85rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px 14px; }
.rs-btn:hover { background: #3a62ab; }
.rs-btn .ico { font-size: 1.3rem; }
@media (max-width: 860px) { .reg-search { grid-template-columns: 1fr; grid-template-areas: "t" "f" "b"; } .rs-fields { grid-template-columns: 1fr; } .rs-btn { min-height: 52px; flex-direction: row; gap: 10px; } }
.reg-card { padding: 10px; }
.reg-wrap { overflow-x: auto; background: #fff; }
.reg-count { margin-top: 6px; font-size: .8rem; }
table.reg { border-collapse: collapse; width: 100%; min-width: 1000px; font: 400 .88rem/1.3 Calibri, "Segoe UI", system-ui, sans-serif; color: #000; }
table.reg th, table.reg td { border: 1px solid #fff; padding: 5px 8px; vertical-align: middle; }
table.reg th { background: #b4c6e7; font-weight: 400; font-size: .95rem; text-align: center; border: 1px solid #fff; }
table.reg td { border: 1px solid #d9d9d9; }
table.reg td.c { text-align: center; }
table.reg td.empty { text-align: center; color: var(--muted); padding: 18px; }
table.reg a { color: #000; text-decoration: none; }
table.reg a:hover { text-decoration: underline; }
table.reg td.ordc { white-space: nowrap; }
table.reg td input { margin: 0; min-height: 28px; width: 100%; padding: 2px 6px; font: inherit; border: 1px solid transparent; background: transparent; border-radius: 4px; }
table.reg td input:hover, table.reg td input:focus { border-color: var(--nav); background: #fff; }
table.reg td input.ord { width: 4.2em; text-align: center; display: inline-block; padding: 2px; }

/* ---------- Certificat de conformité ---------- */
.cc-sheet { font-family: "Century Gothic", "Segoe UI", Arial, sans-serif; }
.cc-title { width: 9.8cm; margin: 18px auto 22px; text-align: center; font-weight: 700; font-size: 13pt; border: 1px solid #000; border-radius: 8px; padding: 6px 4px; }
.cc-p { margin: 0 0 10px; text-align: justify; line-height: 1.7; text-indent: 8mm; font-size: 11pt; }
.cc-list { margin: 0 0 12px; padding: 0; list-style: none; font-size: 11pt; line-height: 1.7; text-align: justify; }
.cc-list li { padding-left: 10mm; text-indent: -6mm; margin: 0; }
.cc-list li::before { content: "- "; font-weight: 700; display: inline-block; width: 6mm; text-indent: 0; }
.cc-sign { margin: 18px 0 0 9.5cm; width: 7.8cm; }
.cc-sign .gap { height: 22mm; }
.cc-sign .ttl2 { font-weight: 400; font-style: normal; }
.elems { display: grid; gap: 8px; margin: 6px 0 10px; }
.elem { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: start; }
.elem .n { font-weight: 800; color: var(--nav); padding-top: 12px; text-align: center; }
.elem textarea { margin: 0; }

/* ---------- Agents et accès ---------- */
.pill-warn { display: inline-block; background: #fff3cd; color: #7a5b00; border: 1px solid #f0d78c; border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: .85rem; margin: 0 0 8px; }
.users .u-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 8px 4px; }
.reg-top .error:empty { display: none; }
