/* =============================================================================
   OC³ Logements — styles. Direction « carte plein écran » : la carte occupe toute la page,
   recherche, filtres, liste et fiche flottent par-dessus.
   Couleurs reprises du panneau de l'extension SketchUp (accent bleu #1f6feb).
   ============================================================================= */
:root {
  --bg: #fff; --fg: #111827; --fg2: #374151; --mut: #6b7280; --line: #e1e5ea; --line2: #edf0f3; --soft: #f5f7f9; --card: #fff;
  --acc: #1f6feb; --accd: #174ea6; --accs: #eef4ff; --sel: #eff5ff;
  --ok: #146c2e; --oks: #e6f4ea; --warn: #8a4b00; --warns: #fff1db; --bad: #b42318; --bads: #fde8e6;
  --float: 0 2px 10px rgba(15, 23, 42, .14); --float-lg: 0 6px 22px rgba(15, 23, 42, .18); --float-border: transparent;
  --st-adapte: #16a34a; --st-travaux: #f59e0b; --st-projet: #7c3aed; --st-non_adapte: #64748b;
  --chip-adapte: #146c2e; --chips-adapte: #e6f4ea;
  --chip-travaux: #8a4b00; --chips-travaux: #fff1db;
  --chip-projet: #5b21b6; --chips-projet: #f1eafe;
  --chip-non_adapte: #475569; --chips-non_adapte: #eef2f6;
  --v3d-bg: #eef0f3;
  --gap: 12px; --bar: 46px; --side: 300px; --panel: 410px; --r: 6px; --rf: 10px;
  --top-off: calc(var(--gap) * 2 + var(--bar));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1f1f22; --fg: #eceef1; --fg2: #d1d5db; --mut: #a3a9b3; --line: #3a3c42; --line2: #2f3136; --soft: #2a2b30; --card: #26272b;
    --acc: #4b8ff7; --accd: #9cc0ff; --accs: #1c2a42; --sel: #1c2a42;
    --ok: #6fcf8a; --oks: #173524; --warn: #f0b35a; --warns: #3a2c12; --bad: #f28b82; --bads: #3d1d1b;
    --float: 0 2px 12px rgba(0, 0, 0, .45); --float-lg: 0 8px 26px rgba(0, 0, 0, .55); --float-border: #3a3c42;
    --chip-adapte: #6fcf8a; --chips-adapte: #173524; --chip-travaux: #f0b35a; --chips-travaux: #3a2c12;
    --chip-projet: #c4a7ff; --chips-projet: #2b1f45; --chip-non_adapte: #b4bfcc; --chips-non_adapte: #2c3138;
    --v3d-bg: #2a2b30;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1f1f22; --fg: #eceef1; --fg2: #d1d5db; --mut: #a3a9b3; --line: #3a3c42; --line2: #2f3136; --soft: #2a2b30; --card: #26272b;
  --acc: #4b8ff7; --accd: #9cc0ff; --accs: #1c2a42; --sel: #1c2a42;
  --ok: #6fcf8a; --oks: #173524; --warn: #f0b35a; --warns: #3a2c12; --bad: #f28b82; --bads: #3d1d1b;
  --float: 0 2px 12px rgba(0, 0, 0, .45); --float-lg: 0 8px 26px rgba(0, 0, 0, .55); --float-border: #3a3c42;
  --chip-adapte: #6fcf8a; --chips-adapte: #173524; --chip-travaux: #f0b35a; --chips-travaux: #3a2c12;
  --chip-projet: #c4a7ff; --chips-projet: #2b1f45; --chip-non_adapte: #b4bfcc; --chips-non_adapte: #2c3138;
  --v3d-bg: #2a2b30;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font: 13.5px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; background: var(--soft); color: var(--fg);
  height: 100dvh; overflow: hidden; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accd); text-decoration: none; }
svg { flex: none; }
h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.01em; line-height: 1.25; }
h3 { margin: 0 0 8px; font-size: 16px; font-weight: 650; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
h2[tabindex="-1"]:focus { outline: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between, .between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.wrap, .wrap { flex-wrap: wrap; }
.ell { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { font-size: 12.5px; color: var(--mut); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.title { font-size: 14px; font-weight: 650; letter-spacing: -.005em; }
.lbl { font-size: 12.5px; font-weight: 500; color: var(--fg2); }
.empty { color: var(--mut); padding: 14px 0; text-align: center; font-size: 13px; }
.empty.big { padding: 60px 16px; font-size: 14px; }
.badge { display: inline-block; padding: 0 6px; border-radius: 3px; background: var(--soft); border: 1px solid var(--line2); font-size: 11px; color: var(--mut); white-space: nowrap; }

/* ---------------------------------------------------------------- boutons et contrôles */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--card); cursor: pointer; font-weight: 500; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--soft); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.primary { background: var(--acc); border-color: var(--acc); color: #fff; font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--accd); border-color: var(--accd); }
:root[data-theme="dark"] .btn.primary:hover:not(:disabled) { background: #2f6fd8; border-color: #2f6fd8; }
.btn .caret { display: flex; align-items: center; align-self: stretch; margin: 0 -4px 0 4px; padding-left: 8px; border-left: 1px solid rgba(255, 255, 255, .35); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 600; }
.btn.danger-ghost { color: var(--bad); border-color: transparent; background: none; padding: 0 8px; }
.btn.danger-ghost:hover { background: var(--bads) !important; }
.btn:disabled { opacity: .5; cursor: default; }
.link { border: 0; background: none; padding: 0; color: var(--accd); font-size: 12.5px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; }
.iconbtn {
  width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--mut); cursor: pointer; flex: none;
}
.iconbtn:hover { color: var(--fg); background: var(--soft); }
.iconbtn.sm { width: 30px; height: 30px; }
.iconbtn.ghost { border-color: transparent; background: none; }
.iconbtn.ghost:hover { background: var(--soft); }
.iconbtn.on { color: var(--acc); border-color: var(--acc); background: var(--accs); }
.seg { display: grid; grid-auto-flow: column; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; padding: 0 10px; border: 0; border-radius: 4px; background: none; color: var(--mut); cursor: pointer; font-size: 13px; white-space: nowrap; }
.seg button:hover { color: var(--fg); }
.seg button.on { background: var(--accs); color: var(--accd); font-weight: 600; }
.seg.sm button { height: 26px; font-size: 12.5px; }
select, .f input, .f textarea, .dyn input, .fsel input {
  height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--fg); min-width: 0; width: 100%;
}
.f textarea { height: auto; padding: 8px 10px; resize: vertical; }
select:focus, .f input:focus, .f textarea:focus, .dyn input:focus, .fsel input:focus { outline: 0; border-color: var(--acc); box-shadow: 0 0 0 3px rgba(31, 111, 235, .14); }
input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: var(--acc); flex: none; cursor: pointer; }

/* ---------------------------------------------------------------- statuts (badges) */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--soft); color: var(--mut); }
.chip i { width: 7px; height: 7px; border-radius: 2px; background: currentColor; }
.chip.sm { height: 20px; padding: 0 6px; font-size: 11.5px; }
.st-adapte { color: var(--chip-adapte); background: var(--chips-adapte); }
.st-adapte i { background: var(--st-adapte); }
.st-travaux { color: var(--chip-travaux); background: var(--chips-travaux); }
.st-travaux i { background: var(--st-travaux); }
.st-projet { color: var(--chip-projet); background: var(--chips-projet); }
.st-projet i { background: var(--st-projet); }
.st-non_adapte { color: var(--chip-non_adapte); background: var(--chips-non_adapte); }
.st-non_adapte i { background: var(--st-non_adapte); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sw-c { width: 10px; height: 10px; border-radius: 2px; flex: none; }

/* ---------------------------------------------------------------- carte plein écran + éléments flottants */
#map { position: fixed; inset: 0; background: var(--soft); }
.float { background: var(--card); border-radius: var(--rf); box-shadow: var(--float); border: 1px solid var(--float-border); }

header.top { position: fixed; top: var(--gap); left: var(--gap); right: var(--gap); height: var(--bar); display: flex; align-items: stretch; gap: 10px; z-index: 30; pointer-events: none; }
header.top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 9px; padding: 0 12px 0 9px; color: var(--fg); }
.logo { width: 32px; height: 32px; display: grid; place-items: center; flex: none; }
.brand b { font: 800 16px/1 "Manrope", "Segoe UI", system-ui, sans-serif; letter-spacing: -.02em; white-space: nowrap; color: var(--fg); }
.brand b sup { font-size: .58em; vertical-align: .72em; line-height: 0; margin-left: .03em; }
.env { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 0 5px; line-height: 17px; border-radius: 3px; border: 1px solid currentColor; color: var(--mut); }
.search { position: relative; display: flex; align-items: center; gap: 9px; width: 380px; min-width: 0; padding: 0 12px; color: var(--mut); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--fg); font-size: 14px; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search:focus-within { box-shadow: var(--float), 0 0 0 2px var(--acc); }
.search kbd { font: 11px "Segoe UI", sans-serif; border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; color: var(--mut); white-space: nowrap; }
.tabs { display: flex; align-items: center; gap: 2px; padding: 4px; }
.tabs button { height: 100%; padding: 0 16px; border: 0; border-radius: 7px; background: none; color: var(--mut); font-weight: 500; cursor: pointer; }
.tabs button:hover { color: var(--fg); background: var(--soft); }
.tabs button.on { background: var(--acc); color: #fff; font-weight: 600; }
.actions { margin-left: auto; display: flex; align-items: center; gap: 4px; padding: 0 6px; }

/* résultats de recherche */
.sr-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; max-height: min(460px, 70dvh); overflow: auto; padding: 6px; background: var(--card); border: 1px solid var(--float-border); border-radius: var(--rf); box-shadow: var(--float-lg); color: var(--fg); }
.sr-h { font-size: 11.5px; font-weight: 600; color: var(--mut); padding: 6px 8px 4px; }
.sr-it { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--r); cursor: pointer; }
.sr-it.on, .sr-it:hover { background: var(--soft); }
.sr-it > svg { color: var(--mut); }
.sr-it b { display: block; font-weight: 500; }
.sr-it .meta { display: block; font-size: 12px; }
.sr-msg { padding: 10px 8px; color: var(--mut); }

/* barre latérale (filtres + résultats) */
.sidebar { position: fixed; top: var(--top-off); left: var(--gap); bottom: var(--gap); width: var(--side); z-index: 20; display: flex; flex-direction: column; overflow: hidden; transition: transform .25s ease, visibility .25s; }
body.side-off .sidebar { transform: translateX(calc(-100% - 2 * var(--gap))); visibility: hidden; }
.sb-head { display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 16px; border-bottom: 1px solid var(--line2); }
.sb-head .title { flex: 1; }
.sb-scroll { flex: 1; overflow: auto; overscroll-behavior: contain; }
.sec { padding: 14px 16px; border-bottom: 1px solid var(--line2); }
.sec:last-child { border-bottom: 0; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 12.5px; color: var(--fg2); margin-bottom: 8px; }
.sec-h .n { color: var(--mut); font-weight: 500; }
.checklist { list-style: none; margin: 0; padding: 0; }
.chk { display: flex; align-items: center; gap: 9px; height: 30px; cursor: pointer; border-radius: 4px; }
.chk .n { margin-left: auto; color: var(--mut); font-variant-numeric: tabular-nums; }
.chk:hover .t { color: var(--fg); }
.sec-h .sw { display: flex; align-items: center; cursor: pointer; }
.checklist.off { opacity: .45; }
.poi-dot { display: inline-grid; place-items: center; border-radius: 50%; flex: none; box-shadow: 0 0 0 1.5px #fff, 0 1px 2px rgba(0, 0, 0, .2); }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fsel { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fsel > span { font-size: 12px; color: var(--mut); }
.fsel.full { grid-column: 1 / -1; }
.resultats { margin: 0 -16px -14px; }
.bcard { display: block; padding: 10px 16px; border-top: 1px solid var(--line2); color: var(--fg); }
.bcard:hover { background: var(--soft); }
.bcard.sel { background: var(--sel); box-shadow: inset 3px 0 var(--acc); }
.bcard b { display: block; font-weight: 600; }
.bcard .ad { display: block; font-size: 12px; color: var(--mut); }
.bcard .stackbar { height: 4px; margin: 7px 0 4px; }
.bcard .mt { display: block; font-size: 11.5px; color: var(--mut); }
.stackbar { display: flex; height: 8px; border-radius: 2px; overflow: hidden; gap: 2px; background: var(--line2); }
.stackbar i { display: block; }

/* bouton « Filtres » (barre latérale masquée, ou téléphone) */
.fab { display: none; position: fixed; z-index: 20; top: var(--top-off); left: var(--gap); height: 40px; padding: 0 14px; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; color: var(--fg); }
body.side-off .fab { display: inline-flex; }
.fab-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--acc); color: #fff; font-size: 12px; display: inline-grid; place-items: center; }

/* légende */
.legende { position: fixed; z-index: 10; bottom: var(--gap); left: calc(var(--side) + 2 * var(--gap)); padding: 8px 6px 6px; min-width: 190px; transition: left .25s ease; }
body.side-off .legende { left: var(--gap); }
.lg-t { font-size: 12px; font-weight: 600; padding: 0 6px 4px; }
.legende button { display: flex; align-items: center; gap: 8px; width: 100%; height: 24px; padding: 0 6px; border: 0; border-radius: 4px; background: none; cursor: pointer; font-size: 12.5px; text-align: left; }
.legende button:hover { background: var(--soft); }
.legende button b { margin-left: auto; padding-left: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.legende button.off { opacity: .4; }
body[data-vue="liste"] .legende { display: none; }

/* contrôles MapLibre */
.maplibregl-ctrl-top-right { top: calc(var(--bar) + var(--gap)); right: var(--gap); }
.maplibregl-ctrl-top-right .maplibregl-ctrl { margin: 10px 0 0 0; }
.maplibregl-ctrl-bottom-right { right: var(--gap); bottom: var(--gap); }
.maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin: 0 0 8px; }
.maplibregl-ctrl-top-right, .maplibregl-ctrl-bottom-right { transition: right .25s ease; }
body.panel-on .maplibregl-ctrl-top-right, body.panel-on .maplibregl-ctrl-bottom-right { right: calc(var(--panel) + 2 * var(--gap)); }
.maplibregl-ctrl-group { border-radius: 8px !important; box-shadow: var(--float) !important; }
.maplibregl-ctrl-group button.ctl-txt { font-size: 12px; font-weight: 700; color: #333; }
.maplibregl-ctrl-group button svg { margin: auto; color: #333; }
.maplibregl-ctrl-attrib { font-size: 11px; }
.maplibregl-ctrl-scale { border-radius: 2px; }

/* marqueurs */
.mk { border: 0; padding: 0; background: none; cursor: pointer; color: #111827; display: grid; place-items: center; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25)); }
.mk svg { display: block; transition: transform .15s; }
.mk:hover svg { transform: scale(1.08); }
.mk-label {
  position: absolute; top: 100%; left: 50%; transform: translate(-50%, 4px); white-space: nowrap; pointer-events: none;
  background: var(--card); color: var(--fg); border: 1px solid var(--line); border-radius: 5px; padding: 2px 8px; font-size: 12px; font-weight: 600;
  box-shadow: var(--float); opacity: 0; transition: opacity .15s;
}
.mk:hover .mk-label, .mk.sel .mk-label, .mk:focus-visible .mk-label { opacity: 1; }
.mk.sel { z-index: 5; }
.mk.sel::before { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2.5px solid var(--acc); }
.mk-pin { cursor: grab; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .3)); }
.maplibregl-popup-content { border-radius: 8px; padding: 10px 12px; box-shadow: var(--float-lg); font: 13px/1.4 "Segoe UI", system-ui, sans-serif; color: #111827; }
.pop-addr b { display: block; margin-bottom: 6px; }
.pop-poi b { display: block; font-weight: 600; }
.pop-poi span { display: block; color: #6b7280; font-size: 12px; }
.maplibregl-popup-close-button { font-size: 16px; padding: 0 6px; color: #6b7280; }

/* commerces et services à proximité (fiche bâtiment) */
.proxi { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.px-cat { display: flex; align-items: center; gap: 8px; padding: 7px 12px; background: var(--soft); border-top: 1px solid var(--line2); font-size: 12.5px; font-weight: 600; color: var(--fg2); }
.px-cat:first-child { border-top: 0; }
.px-it { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: baseline; width: 100%; padding: 7px 12px 7px 40px; border: 0; border-top: 1px solid var(--line2); background: none; color: var(--fg); text-align: left; cursor: pointer; }
.px-it:hover { background: var(--sel); }
.px-it b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.px-it .d { font-size: 12.5px; color: var(--mut); font-variant-numeric: tabular-nums; }
.px-it .meta { grid-column: 1 / -1; font-size: 12px; margin-top: -2px; }
.proxi-vide { padding: 12px; color: var(--mut); font-size: 13px; }

/* ---------------------------------------------------------------- panneau fiche / formulaire */
.panel {
  position: fixed; top: var(--top-off); right: var(--gap); bottom: var(--gap); width: var(--panel); z-index: 25; overflow: hidden;
  transform: translateX(calc(100% + 2 * var(--gap))); visibility: hidden; transition: transform .25s ease, visibility .25s;
}
.panel.on { transform: none; visibility: visible; box-shadow: var(--float-lg); }
.panel { transition: transform .25s ease, visibility .25s, width .25s ease; }
.panel.large { width: calc(100vw - var(--side) - 3 * var(--gap)); }
body.side-off .panel.large { width: calc(100vw - 2 * var(--gap)); }
body.resizing .panel, body.resizing .maplibregl-ctrl-top-right, body.resizing .maplibregl-ctrl-bottom-right, body.resizing .liste { transition: none; }
body.resizing { cursor: ew-resize; user-select: none; }
.panel-content { height: 100%; overflow: auto; overscroll-behavior: contain; }
/* poignée de redimensionnement (bord gauche) */
.panel-resize { position: absolute; left: 0; top: 0; bottom: 0; width: 10px; z-index: 6; cursor: ew-resize; touch-action: none; }
.panel-resize::after { content: ""; position: absolute; left: 3px; top: 50%; width: 4px; height: 44px; margin-top: -22px; border-radius: 2px; background: var(--line); opacity: 0; transition: opacity .15s, background .15s; }
.panel:hover .panel-resize::after { opacity: 1; }
.panel-resize:hover::after, .panel-resize:focus-visible::after, body.resizing .panel-resize::after { opacity: 1; background: var(--acc); }
.panel-resize:focus-visible { outline: none; }
.btn-agrandir svg + svg { display: none; }
.panel.large .btn-agrandir svg:first-child { display: none; }
.panel.large .btn-agrandir svg + svg { display: block; }
/* grand format : scan plus haut, photos plus grandes */
.v3d-stage { max-height: 70vh; }
.panel.large .v3d-stage { aspect-ratio: 16 / 9; max-height: 64vh; }
.panel.large .v3d-poster { aspect-ratio: 16 / 9; max-height: 64vh; }
.panel.large .gallery { grid-auto-columns: min(46%, 420px); }
.panel.large .ph { max-height: 300px; }
.ph-head { position: sticky; top: 0; z-index: 3; padding: 10px 12px 14px 18px; background: var(--card); border-bottom: 1px solid var(--line2); }
.crumbs { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; margin-bottom: 4px; font-size: 12.5px; color: var(--mut); }
.crumbs nav { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; }
.crumbs nav a { color: var(--accd); overflow: hidden; text-overflow: ellipsis; }
.crumbs nav span.sep { color: var(--line); }
.ph-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.ph-head h2 { padding-right: 6px; }
.ph-head .meta { margin-top: 1px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-bottom: 1px solid var(--line2); }
.facts > div { padding: 10px 8px 10px 18px; border-right: 1px solid var(--line2); min-width: 0; }
.facts > div:last-child { border-right: 0; }
.facts dt { font-size: 11.5px; color: var(--mut); }
.facts dd { margin: 0; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.facts dd .chip { margin-top: 2px; }
.ph-body { display: flex; flex-direction: column; gap: 20px; padding: 16px 18px 28px; }
.ph-body section { display: flex; flex-direction: column; gap: 8px; }
.sh { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; color: var(--fg); }
.sh .meta { font-weight: 400; }
.legend-inline { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--mut); }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.legend-inline b { color: var(--fg); }
.notes { margin: 0; white-space: pre-wrap; padding: 10px 12px; border: 1px solid var(--line2); border-radius: var(--r); background: var(--soft); font-size: 13.5px; }

/* étages */
.floors { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.floor { display: grid; grid-template-columns: 48px 1fr; border-top: 1px solid var(--line2); }
.floor:first-child { border-top: 0; }
.floor-lbl { display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--mut); background: var(--soft); border-right: 1px solid var(--line2); }
.floor-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 6px; padding: 6px; }
.unit { position: relative; display: flex; flex-direction: column; gap: 1px; padding: 6px 8px 6px 11px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--fg); overflow: hidden; }
.unit:hover { border-color: var(--acc); }
.ubar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.u-l1 { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.u-l1 b { font-weight: 600; }
.u-l2 { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--mut); white-space: nowrap; overflow: hidden; }
.u-l2 svg { color: var(--acc); }
.unit.dim { opacity: .4; }
.unit.ghost { border-style: dashed; background: none; justify-content: center; min-height: 38px; }
.empty-floor { padding: 8px 4px; }

/* galerie */
.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: min(72%, 300px); gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.gallery.one { grid-auto-columns: 100%; }
.ph { position: relative; border: 0; padding: 0; border-radius: 8px; overflow: hidden; cursor: zoom-in; aspect-ratio: 3 / 2; max-height: 240px; background: var(--soft); scroll-snap-align: start; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph span { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 7px; font-size: 12px; color: #fff; text-align: left; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }

/* infos, contacts, documents, historique */
.kvs { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.kv { display: grid; grid-template-columns: 40% 1fr; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line2); }
.kv:first-child { border-top: 0; }
.kv dt { color: var(--mut); font-size: 13px; }
.kv dd { margin: 0; font-weight: 500; }
.contacts, .docs { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.contact { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-top: 1px solid var(--line2); }
.contact:first-child, .doc:first-child { border-top: 0; }
.avatar { width: 32px; height: 32px; border-radius: 16px; display: grid; place-items: center; background: var(--soft); color: var(--mut); flex: none; }
.contact .iconbtn { color: var(--accd); }
.doc { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line2); color: var(--fg); }
.doc:hover { background: var(--soft); }
.doc > svg:first-child { color: var(--acc); }
.doc b { display: block; font-weight: 500; }
.doc .meta { display: block; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.timeline li { position: relative; display: flex; flex-direction: column; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 5px; background: var(--card); border: 2px solid var(--acc); }
.timeline time { font-size: 12px; color: var(--mut); }
.placeholder { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px dashed var(--line); border-radius: 8px; color: var(--mut); }
.placeholder b { color: var(--fg); font-weight: 600; }

/* visionneuse 3D */
.v3d { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--v3d-bg); }
.v3d-stage { position: relative; aspect-ratio: 4 / 3; min-height: 240px; }
.v3d-stage canvas { display: block; width: 100% !important; height: 100% !important; touch-action: none; }
.v3d-poster { aspect-ratio: 4 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.v3d-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--mut); padding: 20px; text-align: center; }
.v3d-bar { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; background: var(--card); border-top: 1px solid var(--line); }
.v3d-cut { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 150px; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--r); color: var(--mut); }
.v3d-cut input { flex: 1; min-width: 60px; accent-color: var(--acc); }
.v3d-cut output { font-size: 12px; width: 52px; text-align: right; font-variant-numeric: tabular-nums; color: var(--fg); }
.v3d-res { color: var(--accd); font-size: 14px; }
.v3d:fullscreen { border-radius: 0; border: 0; }
.v3d:fullscreen .v3d-stage { flex: 1; aspect-ratio: auto; }
.spin { width: 16px; height: 16px; border: 2px solid var(--acc); border-right-color: transparent; border-radius: 50%; animation: sp .8s linear infinite; flex: none; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- formulaires */
.form { display: flex; flex-direction: column; min-height: 100%; }
.form .ph-body { flex: 1; }
.f { display: flex; flex-direction: column; gap: 5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.ph-body section.grid2, .ph-body section.grid3 { display: grid; }
.ac { position: relative; }
.input-ic { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--mut); }
.input-ic:focus-within { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(31, 111, 235, .14); }
.input-ic input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--fg); height: 100%; }
.ac-list { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; margin: 0; padding: 4px; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--float-lg); max-height: 300px; overflow: auto; }
.ac-list.on { display: block; }
.ac-list li { display: flex; flex-direction: column; padding: 7px 10px; border-radius: var(--r); cursor: pointer; }
.ac-list li span { font-size: 12px; color: var(--mut); }
.ac-list li.on, .ac-list li:hover { background: var(--soft); }
.ac-list li.ac-msg { cursor: default; color: var(--mut); background: none; }
.minimap { height: 230px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.switch .sw { display: flex; align-items: center; gap: 10px; height: 32px; cursor: pointer; }
.sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw i { width: 36px; height: 20px; border-radius: 10px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.sw i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 8px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s; }
.sw input:checked + i { background: var(--acc); }
.sw input:checked + i::after { transform: translateX(16px); }
.sw input:focus-visible + i { outline: 2px solid var(--acc); outline-offset: 2px; }
.stpick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stpick label { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; font-weight: 500; }
.stpick label.on { border-color: var(--acc); background: var(--accs); box-shadow: inset 0 0 0 1px var(--acc); }
.stpick input { position: absolute; opacity: 0; }
.stpick label:focus-within { outline: 2px solid var(--acc); outline-offset: 1px; }
.stpick i { width: 10px; height: 10px; border-radius: 2px; }
.dropzone { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px dashed var(--line); border-radius: 8px; cursor: pointer; color: var(--acc); }
.dropzone:hover { border-color: var(--acc); background: var(--soft); }
.dropzone span { display: flex; flex-direction: column; color: var(--fg); }
.filebox { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--acc); }
.filebox b { color: var(--fg); word-break: break-all; font-weight: 600; }
.up-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.up-item { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.up-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--soft); }
.up-item input { border: 0; border-top: 1px solid var(--line2); height: 30px; padding: 0 8px; font-size: 12px; background: transparent; min-width: 0; }
.up-x { position: absolute; top: 4px; right: 4px; background: rgba(0, 0, 0, .55) !important; color: #fff !important; }
.up-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 112px; border: 1px dashed var(--line); border-radius: 8px; color: var(--acc); cursor: pointer; font-size: 12.5px; font-weight: 500; text-align: center; padding: 8px; }
.up-add:hover { border-color: var(--acc); background: var(--soft); }
.dyn { display: flex; flex-direction: column; gap: 6px; }
.dyn:empty { display: none; }
.dyn-row { display: grid; gap: 6px; align-items: center; }
.dyn-infos .dyn-row { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) 30px; }
.dyn-contacts .dyn-row { grid-template-columns: 1fr 1fr 30px; padding: 8px; border: 1px solid var(--line2); border-radius: 8px; }
.dyn-contacts .dyn-row button { grid-column: 3; grid-row: 1 / span 2; }
.dyn-documents .dyn-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 30px; }
.dyn-historique .dyn-row { grid-template-columns: 150px minmax(0, 1fr) 30px; }
.dyn + .link, .dyn + label.link { margin-top: 2px; align-self: flex-start; }
.err { padding: 10px 12px; border-radius: var(--r); background: var(--bads); color: var(--bad); font-weight: 500; }
.form-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); z-index: 3; }

/* ---------------------------------------------------------------- vue liste */
.liste { position: fixed; z-index: 15; top: var(--top-off); left: calc(var(--side) + 2 * var(--gap)); right: var(--gap); bottom: var(--gap); overflow: auto; padding: 18px 20px 24px; display: none; transition: left .25s ease, right .25s ease; }
body[data-vue="liste"] .liste { display: block; }
body.side-off .liste { left: var(--gap); }
body.panel-on .liste { right: calc(var(--panel) + 2 * var(--gap)); }
.list-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.list-head .title { font-size: 17px; }
.sortm { display: none; }
.tablewrap { border: 1px solid var(--line); border-radius: 8px; overflow: auto; background: var(--card); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { position: sticky; top: 0; z-index: 1; background: var(--soft); text-align: left; padding: 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th button { display: flex; align-items: center; gap: 4px; width: 100%; height: 36px; padding: 0 12px; border: 0; background: none; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--fg2); }
.tbl th button.on { color: var(--accd); }
.tbl th.num button { justify-content: flex-end; }
.arr { font-size: 9px; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover { background: var(--sel); }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td .ell { max-width: 260px; }
.yes { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-weight: 500; }

/* ---------------------------------------------------------------- toasts, dialogues, menus, visionneuse photo */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 100; display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 8px; background: #1b1f24; color: #fff; font-weight: 500; box-shadow: var(--float-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.ok svg { color: #6fcf8a; }
.toast.err svg { color: #f28b82; }
dialog.modal { border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; width: min(440px, calc(100% - 32px)); background: var(--card); color: var(--fg); box-shadow: var(--float-lg); }
dialog.modal.wide { width: min(560px, calc(100% - 32px)); }
dialog.modal p, dialog.modal ul { color: var(--fg2); margin: 0 0 14px; }
dialog.modal ul { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
dialog::backdrop { background: rgba(15, 18, 24, .45); }
.popmenu { position: fixed; z-index: 90; min-width: 250px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--float-lg); }
.popmenu .pm-h { font-size: 11.5px; font-weight: 600; color: var(--mut); padding: 4px 8px 4px; }
.popmenu button { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: var(--r); background: none; cursor: pointer; text-align: left; }
.popmenu button svg { color: var(--mut); margin-top: 1px; }
.popmenu button span b { display: block; font-weight: 500; }
.popmenu button span small { display: block; color: var(--mut); font-size: 12px; }
.popmenu button:hover, .popmenu button:focus-visible { background: var(--soft); outline: 0; }
.popmenu button.danger, .popmenu button.danger svg { color: var(--bad); }
.popmenu hr { border: 0; border-top: 1px solid var(--line2); margin: 5px 2px; }
dialog.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(10, 12, 16, .94); color: #fff; }
.lb-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 18px; z-index: 2; }
.lb-top .iconbtn { color: #fff; margin-left: auto; }
.lb-top .iconbtn:hover { background: rgba(255, 255, 255, .12); }
.lb-count { font-variant-numeric: tabular-nums; opacity: .7; font-size: 13px; }
.lb-stage { position: absolute; inset: 56px 0 20px; display: flex; align-items: center; justify-content: center; }
.lb-stage img { max-width: calc(100% - 120px); max-height: 100%; object-fit: contain; border-radius: 6px; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 23px; border: 0; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; display: grid; place-items: center; }
.lb-nav:hover { background: rgba(255, 255, 255, .22); }
.lb-nav.prev { left: 14px; }
.lb-nav.next { right: 14px; }

/* ---------------------------------------------------------------- écrans moyens */
@media (max-width: 1280px) {
  :root { --side: 280px; --panel: 390px; }
  .search { width: 300px; }
  .search kbd { display: none; }
}
@media (max-width: 1080px) {
  .brand b, .env { display: none; }
  .brand { padding: 0 9px; }
  .search { width: auto; flex: 1 1 0; }
  .actions { margin-left: 0; }
}

/* ---------------------------------------------------------------- téléphone */
@media (max-width: 899px) {
  :root { --gap: 10px; }
  header.top { gap: 8px; }
  .brand { padding: 0 9px; }
  .search { width: auto; flex: 1 1 0; padding: 0 10px; }
  .search input { font-size: 15px; }
  .actions { margin-left: 0; padding: 0 4px; }
  #btnAide { display: none; }
  #btnAjout { width: 36px; padding: 0; }
  #btnAjout .lbl-txt, #btnAjout .caret { display: none; }
  .tabs { position: fixed; left: 50%; bottom: calc(var(--gap) + env(safe-area-inset-bottom)); transform: translateX(-50%); height: 44px; z-index: 22; }
  .tabs button { padding: 0 18px; }

  .sidebar {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 86dvh; z-index: 50; border-radius: 16px 16px 0 0;
    transform: translateY(105%); visibility: hidden; box-shadow: var(--float-lg);
  }
  body.side-off .sidebar { transform: translateY(105%); }
  body.filtres-on .sidebar { transform: none; visibility: visible; }
  body.filtres-on::after { content: ""; position: fixed; inset: 0; background: rgba(15, 18, 24, .4); z-index: 45; }
  .sb-head { position: relative; padding-top: 16px; }
  .sb-head::before { content: ""; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line); }

  .fab, body.side-off .fab { display: inline-flex; top: auto; bottom: calc(var(--gap) + env(safe-area-inset-bottom)); height: 44px; }
  .legende, body.side-off .legende { left: var(--gap); top: calc(var(--bar) + 2 * var(--gap)); bottom: auto; min-width: 0; display: flex; padding: 3px; }
  .legende .lg-t { display: none; }
  .legende button { width: auto; height: 26px; padding: 0 7px; gap: 5px; }
  .legende button .lg-l { display: none; }
  .legende button b { padding-left: 0; }
  .maplibregl-ctrl-top-right { top: calc(var(--bar) + var(--gap)); }
  .maplibregl-ctrl-bottom-right { bottom: calc(var(--gap) + 52px + env(safe-area-inset-bottom)); }
  body.panel-on .maplibregl-ctrl-top-right, body.panel-on .maplibregl-ctrl-bottom-right { right: var(--gap); }

  .panel { top: 0; left: 0; right: 0; bottom: 0; width: auto; border-radius: 0; border: 0; z-index: 60; transform: translateY(102%); }
  .panel.on { transform: none; }
  .panel.large, body.side-off .panel.large { width: auto; }
  .panel-resize, .btn-agrandir { display: none !important; }

  .liste, body.side-off .liste, body.panel-on .liste { top: calc(var(--bar) + 2 * var(--gap)); left: 0; right: 0; bottom: 0; border-radius: 14px 14px 0 0; padding: 14px 12px 90px; }
  .sortm { display: block; }
  .sortm select { height: 32px; width: auto; }
  .tablewrap { border: 0; background: none; overflow: visible; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody { display: block; }
  .tbl tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
  .tbl td { display: flex; flex-direction: column; gap: 1px; padding: 3px 0; border: 0; }
  .tbl td::before { content: attr(data-label); font-size: 11px; font-weight: 600; color: var(--mut); }
  .tbl td[data-label="Statut"], .tbl td[data-label="Bâtiment"] { grid-column: 1 / -1; }
  .tbl td[data-label="Statut"]::before { display: none; }
  .tbl td.num { text-align: left; }
  .tbl td .ell { max-width: none; white-space: normal; }

  .gallery { grid-auto-columns: 85%; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .grid3 > :first-child { grid-column: 1 / -1; }
  .dyn-historique .dyn-row { grid-template-columns: 130px minmax(0, 1fr) 30px; }
  .facts > div { padding-left: 12px; }
  .lb-stage img { max-width: 100%; }
  .lb-nav { display: none; }
  .sr-list { position: fixed; left: var(--gap); right: var(--gap); top: calc(var(--bar) + var(--gap) + 6px); }
}
@media (max-width: 420px) {
  .stpick { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts > div:nth-child(2) { border-right: 0; }
  .facts > div:nth-child(n+3) { border-top: 1px solid var(--line2); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* =============================================================================
   Filtres : loyer (curseur à deux poignées), bouton et grand panneau « Tous les filtres »
   ============================================================================= */
.range { position: relative; height: 28px; margin: 2px 2px 0; }
.range-track, .range-fill { position: absolute; top: 12px; height: 4px; border-radius: 2px; }
.range-track { left: 0; right: 0; background: var(--line); }
.range-fill { background: var(--acc); }
.range input { position: absolute; left: 0; right: 0; top: 4px; width: 100%; height: 20px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.range input:focus { outline: none; }
.range input::-webkit-slider-runnable-track { background: none; }
.range input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 18px; height: 18px; border-radius: 50%; background: var(--card); border: 2px solid var(--acc); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); cursor: grab; }
.range input::-moz-range-thumb { pointer-events: auto; width: 15px; height: 15px; border-radius: 50%; background: var(--card); border: 2px solid var(--acc); cursor: grab; }
.range input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(31, 111, 235, .3); }
.range-v { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; font-variant-numeric: tabular-nums; margin-bottom: 2px; }

.tf-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--fg); text-align: left; cursor: pointer; }
.tf-btn:hover { border-color: var(--acc); background: var(--sel); }
.tf-btn > svg { color: var(--acc); }
.tf-btn b { display: block; font-weight: 600; }
.tf-btn .meta { display: block; font-size: 12px; }
.tf-n { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--acc); color: #fff; font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; }

dialog.dlg-filtres { width: min(1060px, calc(100vw - 48px)); height: min(860px, calc(100dvh - 48px)); max-width: none; max-height: none; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--fg); box-shadow: var(--float-lg); overflow: hidden; }
dialog.dlg-filtres[open] { display: flex; }
.pf { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.pf-h { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 22px; border-bottom: 1px solid var(--line2); }
.pf-h h2 { font-size: 18px; }
.pf-h .meta { flex: 1; }
.pf-b { flex: 1; overflow: auto; overscroll-behavior: contain; }
.pf h3 { margin: 0 0 10px; font-size: 12.5px; font-weight: 700; color: var(--mut); letter-spacing: .02em; }
.pf-gen { padding: 16px 22px 6px; }
.pf-grid { display: grid; grid-template-columns: 2fr repeat(4, minmax(0, 1fr)); gap: 10px 12px; }
.pf-legende { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 22px 12px; border-bottom: 1px solid var(--line2); }
.pf-legende .pf-chip { cursor: default; }
.pf-cols { display: grid; grid-template-columns: 1fr 1fr; }
.pf-col { padding: 16px 22px 22px; min-width: 0; }
.pf-col + .pf-col { border-left: 1px solid var(--line2); }
.pf-card { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.pf-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 9px 12px; background: var(--soft); }
.pf-card-h b { font-weight: 600; }
.pf-card-h .meta { font-weight: 400; font-size: 12px; }
.pf-sub { padding: 4px 12px 8px; border-top: 1px solid var(--line2); transition: opacity .15s; }
.pf-card.sans-oui .pf-sub { opacity: .4; }
.pf-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; padding: 2px 0; }
.pf-row > span:first-child { color: var(--fg2); }
.pf-row.eq { flex-wrap: wrap; }
.pf-grp { margin: 8px 0 0; font-size: 11.5px; font-weight: 700; color: var(--mut); }
.pf-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; flex: none; }
.pf-chip { height: 24px; padding: 0 9px; border: 1px solid transparent; border-radius: 5px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.pf-chip.oui { background: var(--oks); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.pf-chip.non { background: var(--bads); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.pf-chip.off { background: var(--soft); color: var(--mut); border-color: var(--line); font-weight: 500; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--mut) 60%, transparent); }
.pf-chip.oui::before, .pf-chip.non::before { content: "✓"; font-size: 10px; }
.pf-chip:not(.off):hover { filter: brightness(.96); }
.pf-chip.off:hover { border-color: var(--mut); }
.pf-f { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--line); }
@media (max-width: 899px) {
  dialog.dlg-filtres { width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .pf-grid { grid-template-columns: 1fr 1fr; }
  .pf-q { grid-column: 1 / -1; }
  .pf-cols { grid-template-columns: 1fr; }
  .pf-col + .pf-col { border-left: 0; border-top: 1px solid var(--line2); }
  .pf-h, .pf-gen, .pf-col, .pf-f, .pf-legende { padding-left: 14px; padding-right: 14px; }
}

/* =============================================================================
   Accessibilité : saisie (formulaires) et affichage (fiches)
   ============================================================================= */
.ae { display: flex; flex-direction: column; gap: 10px; }
.ae-card { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ae-h { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 9px 12px; background: var(--soft); }
.ae-h b { font-weight: 600; }
.ae-h .meta { font-weight: 400; font-size: 12px; }
.ae-seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); flex: none; }
.ae-seg button { height: 26px; padding: 0 9px; border: 0; border-radius: 4px; background: none; color: var(--mut); font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.ae-seg button:hover { color: var(--fg); }
.ae-seg button.on.oui { background: var(--oks); color: var(--ok); font-weight: 600; }
.ae-seg button.on.non { background: var(--bads); color: var(--bad); font-weight: 600; }
.ae-seg button.on.nr { background: var(--soft); color: var(--fg2); font-weight: 600; }
.ae-b { display: flex; flex-direction: column; }
.ae-row { padding: 7px 12px; border-top: 1px solid var(--line2); }
.ae-l1 { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; }
.ae-l1 > span:first-child { color: var(--fg2); }
.ae-act { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.ae-grp { padding: 8px 12px 2px; border-top: 1px solid var(--line2); font-size: 11.5px; font-weight: 700; color: var(--mut); }
.ae-grp + .ae-row { border-top: 0; }
.ae-eq { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 6px; }
.ae-perso { display: inline-flex; align-items: center; gap: 6px; }
.ae-perso input[type="text"] { height: 28px; width: 210px; max-width: 60vw; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--fg); }
.ae-rq { background: color-mix(in srgb, var(--soft) 50%, transparent); }
.ai { display: flex; flex-direction: column; gap: 5px; }
.ai:not(:empty) { margin-top: 6px; }
.ai-it { display: flex; gap: 6px; }
.ai-it input { flex: 1; min-width: 0; height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--fg); }
.ai-it input:focus, .ae-perso input:focus { outline: 0; border-color: var(--acc); box-shadow: 0 0 0 3px rgba(31, 111, 235, .14); }

.ax-liste { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ax-cat { border-top: 1px solid var(--line2); }
.ax-cat:first-child { border-top: 0; }
.ax-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; }
.ax-h b { font-weight: 600; }
.ax { font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 4px; white-space: nowrap; }
.ax-oui { background: var(--oks); color: var(--ok); }
.ax-non { background: var(--bads); color: var(--bad); }
.ax-nr { background: var(--soft); color: var(--mut); font-weight: 500; }
.ax-b { padding: 0 12px 8px 12px; display: flex; flex-direction: column; gap: 3px; }
.ax-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--fg2); }
.ax-grp { font-size: 11.5px; font-weight: 700; color: var(--mut); margin-top: 4px; }
.axm { width: 18px; height: 18px; border-radius: 4px; display: inline-grid; place-items: center; flex: none; font-style: normal; font-size: 12px; margin-top: 1px; }
.axm.oui { background: var(--oks); color: var(--ok); }
.axm.non { background: var(--bads); color: var(--bad); }
.axm.nr { background: var(--soft); color: var(--mut); }
.ax-info { margin: 2px 0 0; padding: 0 0 0 14px; font-size: 12.5px; color: var(--mut); }
.ax-b > .ax-info { padding-left: 14px; }
.ax-bat { margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; }
.ax-bat summary { padding: 9px 12px; cursor: pointer; font-weight: 600; }
.ax-bat summary .meta { font-weight: 400; }
.ax-bat .ax-liste { border: 0; border-top: 1px solid var(--line2); border-radius: 0; }

/* =============================================================================
   Fenêtre « Exporter un rapport PDF »
   ============================================================================= */
dialog.dlg-export { width: min(680px, calc(100vw - 32px)); padding: 0; }
.dlg-export form { display: flex; flex-direction: column; max-height: calc(100dvh - 48px); }
.ex-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 12px 22px; border-bottom: 1px solid var(--line2); }
.ex-h h3 { margin: 0 0 2px; }
.ex-b { overflow: auto; padding: 14px 22px; display: flex; flex-direction: column; gap: 16px; }
.ex-secs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.ex-secs .chk input:disabled + .t { color: var(--mut); }
.ex-mises { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ex-mise { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.ex-mise input { position: absolute; opacity: 0; }
.ex-mise.on { border-color: var(--acc); box-shadow: inset 0 0 0 1px var(--acc); background: var(--sel); }
.ex-mise:focus-within { outline: 2px solid var(--acc); outline-offset: 1px; }
.ex-mise .ap { display: block; width: 60px; height: 80px; margin: 0 auto; }
.ex-mise .ap svg { width: 100%; height: 100%; display: block; }
.ex-mise b { display: block; font-weight: 600; }
.ex-mise .meta { display: block; font-size: 12px; line-height: 1.35; }
.ex-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--line); }
@media (max-width: 600px) {
  .ex-secs, .ex-mises { grid-template-columns: 1fr; }
  .ex-mise { flex-direction: row; align-items: center; }
  .ex-mise .ap { width: 42px; height: 56px; margin: 0; flex: none; }
}
