/* Climfix — givre, encre et cuivre (tuyauterie frigorifique). */
:root {
  --ground: #F2F6F7; --surface: #FFFFFF; --sunken: #E8EFF1;
  --ink: #0E2230; --muted: #51626C; --line: #D3DDE1;
  --copper: #AE5A26; --copper-ink: #FFFFFF; --copper-soft: #F5E6DB;
  --cold: #1D6A86; --cold-soft: #E0EEF3;
  --ok: #2F7D4F; --ok-soft: #E1F2E8; --warn: #9A6A00; --warn-soft: #FBF0D5; --bad: #B03A2E; --bad-soft: #F8E1DE;
  --panel: #0E2230; --panel-ink: #E8F1F4; --panel-muted: #8FA8B4;
  --display: "Rubik", "Heebo", system-ui, sans-serif;
  --body: "Heebo", "Rubik", system-ui, sans-serif;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0A161D; --surface: #11212A; --sunken: #0D1B22;
    --ink: #E4EDF0; --muted: #94A7B1; --line: #23363F;
    --copper: #DB8C55; --copper-ink: #1A0E06; --copper-soft: #33231A;
    --cold: #63B5D1; --cold-soft: #142D38;
    --ok: #6CC58F; --ok-soft: #14301F; --warn: #E3B64A; --warn-soft: #33290F; --bad: #EE8175; --bad-soft: #3A1A16;
    --panel: #050E13; --panel-ink: #E8F1F4; --panel-muted: #7F99A5;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 16px/1.55 var(--body); padding-inline: 16px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0; }
a { color: var(--cold); }
img, video { max-width: 100%; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 8px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.spread { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- En-têtes ---------- */
.wrap { max-width: 1120px; margin-inline: auto; }
.wrap-narrow { max-width: 680px; margin-inline: auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px; }
.logo { font-family: var(--display); font-weight: 800; font-size: 1.35rem; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.logo span { color: var(--copper); }
.langs { display: flex; flex-wrap: wrap; gap: 4px; }
.langs a, .langs button { font: 600 .82rem var(--body); color: var(--muted); text-decoration: none; padding: 5px 10px; border-radius: 999px; border: 1px solid transparent; background: none; cursor: pointer; }
.langs [aria-current="true"] { color: var(--ink); border-color: var(--line); background: var(--surface); }

.appbar { background: var(--panel); color: var(--panel-ink); margin-inline: -16px; padding: 10px 16px; position: sticky; top: 0; z-index: 10; }
.appbar .logo { color: var(--panel-ink); }
.appbar nav { display: flex; flex-wrap: wrap; gap: 4px; }
.appbar nav a { color: var(--panel-muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-weight: 500; font-size: .95rem; }
.appbar nav a[aria-current="page"] { color: var(--panel-ink); background: rgba(143,168,180,.18); }
.appbar .langs button { color: var(--panel-muted); }
.appbar .langs [aria-current="true"] { color: var(--panel-ink); background: rgba(143,168,180,.18); border-color: transparent; }
.main { padding-block: 24px 64px; }

/* ---------- Boutons & champs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 1rem var(--body); padding: 11px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; cursor: pointer; min-height: 44px; }
.btn-primary { background: var(--copper); border-color: var(--copper); color: var(--copper-ink); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.btn-danger { color: var(--bad); border-color: var(--bad-soft); }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .9rem; }
.linkish { background: none; border: 0; padding: 0; color: var(--cold); font: inherit; cursor: pointer; text-decoration: underline; }

label.lbl, .lbl { display: block; font-weight: 600; font-size: .93rem; margin-bottom: 6px; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; min-height: 46px;
}
textarea { min-height: 96px; resize: vertical; }
input[type=tel], input[type=email] { direction: ltr; }
[dir=rtl] input[type=tel], [dir=rtl] input[type=email] { text-align: right; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--copper); flex: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

.alert { border-radius: 10px; padding: 12px 14px; font-size: .95rem; }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-bad { background: var(--bad-soft); color: var(--bad); }
.alert-bad ul { margin: 0; padding-inline-start: 18px; }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.section-title { font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
[dir=rtl] .section-title { letter-spacing: 0; }

.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--sunken); color: var(--muted); white-space: nowrap; }
.badge-cold { background: var(--cold-soft); color: var(--cold); }
.badge-copper { background: var(--copper-soft); color: var(--copper); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- Site public : sobre, grande typographie, un seul accent cuivre ---------- */
.public { background: var(--surface); overflow-x: clip; }
.p-hero { overflow-x: clip; }
.lg-short { display: none; }
@media (max-width: 520px) { .lg-long { display: none; } .lg-short { display: inline; } }
.public .topbar { padding-block: 22px; }
.public .logo { font-weight: 900; font-size: 1.4rem; }
.public .main { padding-block: 8px 40px; }

.p-hero { position: relative; padding-block: clamp(32px, 7vw, 88px) 40px; display: grid; gap: 22px; }
.p-hero > * { position: relative; }
.p-air { position: absolute; inset-block-start: -40px; inset-inline-end: -120px; width: min(620px, 80vw); height: auto; color: var(--line); pointer-events: none; }
[dir=rtl] .p-air { transform: scaleX(-1); }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--copper); }
[dir=rtl] .eyebrow { letter-spacing: 0; }
.p-hero h1 { font-size: clamp(2.5rem, 7.2vw, 5.4rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.02; max-width: 13ch; }
.p-hero h1 .l2 { display: block; color: var(--muted); font-weight: 700; }
.p-hero .lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--muted); max-width: 34em; }

.p-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
@media (max-width: 700px) { .p-choice { grid-template-columns: 1fr; } }
.p-panel { display: grid; gap: 6px; align-content: start; text-decoration: none; color: var(--ink); background: var(--ground); border: 1px solid transparent; border-radius: 22px; padding: clamp(22px, 3vw, 32px); transition: background .2s, border-color .2s, transform .2s; }
a.p-panel:hover { background: var(--ink); color: var(--ground); transform: translateY(-2px); }
a.p-panel:hover .p-desc { color: var(--ground); opacity: .75; }
a.p-panel:hover .p-go { background: var(--copper); color: #fff; }
.p-panel .p-title { font-family: var(--display); font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 800; letter-spacing: -.02em; }
.p-desc { color: var(--muted); }
.p-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.p-go { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--ink); font-size: 1.2rem; transition: background .2s, color .2s; }
.p-sub { display: grid; gap: 8px; margin-top: 14px; }
.p-sub a { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); background: var(--surface); border-radius: 14px; padding: 15px 18px; font-weight: 600; transition: background .2s, color .2s; }
.p-sub a:hover { background: var(--ink); color: var(--ground); }
.p-sub a span:last-child { color: var(--copper); }

.p-trust { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 28px; color: var(--muted); font-size: .95rem; }
.p-trust li { display: flex; align-items: center; gap: 8px; }
.p-trust li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--copper); }

.p-section { padding-block: clamp(48px, 7vw, 84px); border-top: 1px solid var(--line); display: grid; gap: 28px; }
.p-section h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; }
.p-cols { display: grid; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .p-cols { grid-template-columns: 1fr; } }
.p-col { padding: 4px 28px 4px 0; display: grid; gap: 8px; align-content: start; }
.p-col + .p-col { border-inline-start: 1px solid var(--line); padding-inline-start: 28px; }
@media (max-width: 760px) { .p-col, .p-col + .p-col { border: 0; padding: 18px 0; border-top: 1px solid var(--line); } .p-col:first-child { border-top: 0; } }
.p-big { font-family: var(--display); font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.p-col p { color: var(--muted); }
.p-step { font-family: var(--display); font-weight: 700; color: var(--copper); font-size: .95rem; }
.p-note { color: var(--muted); border-inline-start: 3px solid var(--copper); padding-inline-start: 14px; max-width: 46em; }

/* Formulaire de demande */
.steps { counter-reset: step; display: grid; gap: 0; }
.step { padding-block: 28px; border-top: 1px solid var(--line); display: grid; gap: 16px; }
.step:first-of-type { border-top: 0; padding-top: 8px; }
.step > h2 { display: flex; gap: 12px; align-items: center; font-size: 1.3rem; font-weight: 800; }
.step > h2::before { counter-increment: step; content: counter(step); flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--ground); font-size: .85rem; }

.options { display: grid; gap: 10px; }
.option { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; }
.option:hover { border-color: var(--muted); }
.option input { width: 20px; height: 20px; accent-color: var(--ink); margin: 0; }
.option:has(input:checked) { border-color: var(--ink); background: var(--ground); box-shadow: inset 0 0 0 1px var(--ink); }
.option .t { font-weight: 700; }
.option .d { font-size: .88rem; color: var(--muted); }
.option .p { font-family: var(--display); font-weight: 700; white-space: nowrap; text-align: end; }
.promo { border: 1px solid var(--line); background: var(--ground); border-radius: 16px; padding: 16px 18px; }
.estimate { font-family: var(--display); font-weight: 800; font-size: 1.2rem; color: var(--ink); }

.drop { position: relative; display: grid; place-items: center; gap: 6px; text-align: center; border: 1.5px dashed var(--line); border-radius: 18px; padding: 30px 16px; cursor: pointer; background: var(--ground); transition: border-color .15s; }
.drop:hover { border-color: var(--ink); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop b { font-family: var(--display); font-size: 1.05rem; }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.previews:empty { display: none; }
.previews figure { margin: 0; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--sunken); display: grid; place-items: center; font-size: .75rem; color: var(--muted); max-width: 100%; }
.previews img, .previews video { width: 100%; height: 100%; object-fit: cover; }
.public .btn-primary { background: var(--ink); border-color: var(--ink); color: var(--ground); min-height: 56px; font-size: 1.05rem; border-radius: 14px; }
.public .btn-primary:hover { background: var(--copper); border-color: var(--copper); color: #fff; }

.done { text-align: center; padding-block: clamp(40px, 8vw, 90px); display: grid; gap: 16px; justify-items: center; }
.done h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; letter-spacing: -.03em; }
.ref { font-family: var(--display); font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; letter-spacing: .06em; direction: ltr; unicode-bidi: isolate; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 22px 1fr; gap: 14px; padding-bottom: 22px; position: relative; color: var(--muted); }
.timeline li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); margin-top: 5px; margin-inline-start: 4px; }
.timeline li.fait { color: var(--ink); }
.timeline li.fait::before { background: var(--ink); border-color: var(--ink); }
.timeline li:last-child { padding-bottom: 0; }
.footer { padding-block: 36px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }

/* ---------- Espace de gestion ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.tabs a { white-space: nowrap; text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 500; }
.tabs a[aria-current="page"] { color: var(--ground); background: var(--ink); border-color: var(--ink); }
.tabs .n { font-variant-numeric: tabular-nums; margin-inline-start: 6px; font-weight: 700; }

.list { display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.item:hover { border-color: var(--cold); }
.item.urgent { border-inline-start: 4px solid var(--bad); }
.item .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.item .side { text-align: end; font-size: .88rem; color: var(--muted); }
.empty { padding: 32px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }

.layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: .92rem; }
.kv dd { margin: 0; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.gallery button { padding: 0; border: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--sunken); cursor: pointer; position: relative; max-width: 100%; }
.gallery img, .gallery video { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 1.8rem; background: rgba(0,0,0,.25); }

.sugg { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sugg:last-child { border-bottom: 0; }
.sugg.off { opacity: .6; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi b { display: block; font-family: var(--display); font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.kpi span { font-size: .82rem; color: var(--muted); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.data th { text-align: start; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data a { color: var(--ink); font-weight: 600; text-decoration: none; }

.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: .9rem; }
.history li { display: grid; gap: 2px; }
.history time { color: var(--muted); font-size: .8rem; }

.lightbox { position: fixed; inset: 0; background: rgba(5,14,19,.92); z-index: 50; display: grid; place-items: center; padding: 16px; }
.lightbox img, .lightbox video { max-height: 86vh; max-width: 100%; border-radius: 8px; }
.lightbox .lb-btn { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; width: 46px; height: 46px; border-radius: 50%; font-size: 1.4rem; cursor: pointer; }
.lightbox .lb-close { top: 16px; inset-inline-end: 16px; }
.lightbox .lb-prev { inset-inline-start: 16px; top: 50%; }
.lightbox .lb-next { inset-inline-end: 16px; top: 50%; }

details.fold > summary { cursor: pointer; font-weight: 600; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: " +"; color: var(--muted); }
details.fold[open] > summary::after { content: " −"; }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.estimate { unicode-bidi: isolate; direction: ltr; display: inline-block; }

/* Recherche et filtres des demandes */
.filters { display: grid; gap: 10px; }
.filters-main { display: flex; gap: 8px; }
.filters-main input { flex: 1; min-width: 0; font-size: 1.02rem; }
.filters-more { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.filters-more > summary { cursor: pointer; font-weight: 600; font-size: .93rem; color: var(--muted); }
.filters-more[open] > summary { margin-bottom: 12px; }
.filters-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 12px; margin-bottom: 12px; }
@media (max-width: 900px) { .filters-grid { grid-template-columns: 1fr 1fr; } }
.filters-grid .lbl { font-size: .8rem; margin-bottom: 4px; }
.filters-grid select, .filters-grid input { min-height: 40px; padding: 8px 10px; }
input[type=date] { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; font-size: .85rem; font-weight: 600; color: var(--ink); background: var(--copper-soft); border-radius: 999px; padding: 4px 10px; }
.chip span { color: var(--copper); }

/* Carte du réseau */
.carte { display: grid; gap: 14px; }
.carte-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
@media (max-width: 860px) { .carte-grid { grid-template-columns: 1fr; } }
.carte-map { height: 520px; border-radius: 10px; overflow: hidden; background: var(--sunken); z-index: 0; }
@media (max-width: 860px) { .carte-map { height: 380px; } }
.carte-legende { display: grid; gap: 6px; align-content: start; max-height: 520px; overflow-y: auto; }
.carte-item { display: grid; grid-template-columns: 14px 1fr; gap: 10px; align-items: start; text-align: start; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.carte-item:hover { border-color: var(--muted); }
.carte-item[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.carte-item small { display: block; color: var(--muted); font-size: .8rem; }
.pastille { width: 14px; height: 14px; border-radius: 50%; margin-top: 4px; display: inline-block; flex: none; }
.pastille.libre { border: 2px dashed #7A8A93; margin-inline-end: 8px; vertical-align: -2px; }
.carte-libres { font-size: .85rem; color: var(--muted); margin-top: 6px; }
.leaflet-container { font: inherit; }

/* Rapport d'intervention (saisie technicien) */
.rapport-form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.rapport-form label { display: block; }
.rapport-form input[type=file] { font-size: .9rem; max-width: 100%; }
.point { display: grid; gap: 8px; padding-block: 12px; border-top: 1px solid var(--line); }
.point:first-of-type { border-top: 0; padding-top: 0; }
.avec-reformuler { display: grid; gap: 6px; justify-items: start; }
.avec-reformuler textarea { width: 100%; }
.etiquettes { display: flex; flex-wrap: wrap; gap: 8px; }
.etiquette { display: inline-flex !important; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer; font-weight: 600; min-height: 44px; }
.etiquette input { width: 18px; height: 18px; accent-color: var(--copper); }
.etiquette:has(input:checked) { border-color: var(--copper); background: var(--copper-soft); }
.vocal { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.envoi { border-color: var(--ink); }
.point-resume { display: grid; gap: 6px; padding-block: 8px; border-top: 1px solid var(--line); }
dialog.modal { width: min(640px, calc(100vw - 32px)); max-height: 86vh; border: 0; border-radius: 16px; padding: 20px; background: var(--surface); color: var(--ink); }
dialog.modal::backdrop { background: rgba(5, 14, 19, .6); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.pick { position: relative; display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; cursor: pointer; border: 3px solid transparent; }
.pick:has(input:checked) { border-color: var(--copper); }
.pick input { position: absolute; top: 6px; inset-inline-start: 6px; width: 20px; height: 20px; accent-color: var(--copper); z-index: 1; }
.pick img, .pick video { width: 100%; height: 100%; object-fit: cover; }

/* Rapport client (document) */
.doc { max-width: 820px; margin-inline: auto; display: grid; gap: 0; }
.doc-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; padding-bottom: 22px; border-bottom: 2px solid var(--ink); }
.doc-societe { font-family: var(--display); font-size: 1.5rem; font-weight: 800; }
.doc-titre { text-align: end; }
.doc-bloc { padding-block: 20px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.doc-bloc h2 { font-size: 1.1rem; font-weight: 800; }
.doc-cols { grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 560px) { .doc-cols { grid-template-columns: 1fr; } }
.doc-table { width: 100%; border-collapse: collapse; }
.doc-table td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.doc-table tr:last-child td { border-bottom: 0; }
.doc-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.doc-photos img, .doc-photos video { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; background: var(--sunken); }
.doc-pied { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding-top: 18px; }
@media print {
  .topbar, .footer, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .doc-bloc, .doc-photos img { break-inside: avoid; }
}
@media print {
  :root { --ink: #000; --muted: #444; --line: #ccc; --surface: #fff; --ground: #fff; --sunken: #f2f2f2; --ok: #1d6b3a; }
}

/* Devis */
.ligne { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; background: var(--surface); }
.ligne-titre { background: var(--sunken); }
.ligne-sous_total, .ligne-saut_page { border-style: dashed; }
.ligne.est-option { border-color: var(--copper); border-style: dashed; }
.ligne-barre { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ligne-champs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 700px) { .ligne-champs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ligne-champs .lbl { font-size: .75rem; margin-bottom: 2px; }
.ligne-champs input, .ligne-champs select, .ligne-options select { min-height: 38px; padding: 6px 8px; }
.ligne-options { align-items: end; }
.totaux { justify-content: end; }
.totaux dd { text-align: end; }
.total-devis { text-align: end; display: grid; }
.total-devis strong { font-family: var(--display); font-size: 1.6rem; }
.autocomplete { display: grid; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; max-height: 260px; overflow-y: auto; }
.autocomplete-item { text-align: start; font: inherit; color: var(--ink); background: var(--surface); border: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; cursor: pointer; }
.autocomplete-item:hover { background: var(--sunken); }
.suggestion { border-top: 1px solid var(--line); padding-top: 10px; }
.sugg-modele { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; }
.devis-ligne { gap: 8px; color: var(--ink); text-decoration: none; padding: 6px 0; border-bottom: 1px solid var(--line); }
.doc-lignes { display: grid; gap: 0; }
.doc-ligne { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.doc-ligne.est-option { opacity: .85; }
.doc-ligne-prix { white-space: nowrap; font-weight: 600; }
.doc-ligne-titre { font-size: 1.05rem; margin-top: 12px; }
.doc-sous-total { display: flex; justify-content: space-between; font-weight: 700; padding: 8px 0; border-bottom: 2px solid var(--line); }
