:root {
  --blue-900: #0d2247;
  --blue-800: #133266;
  --blue-700: #17418c;
  --blue-600: #1a56b8;
  --blue-500: #2470dd;
  --blue-400: #4b8fe8;
  --blue-050: #eef4fc;
  --green-600: #2e8f3c;
  --green-500: #3aa74a;
  --green-050: #ecf7ee;
  --amber-600: #b26a00;
  --amber-050: #fdf3e3;
  --red-600: #c0392b;
  --red-050: #fdecea;
  --ink: #1c2536;
  --ink-soft: #5a6579;
  --line: #dde4ee;
  --bg: #f4f7fb;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(13, 34, 71, .08), 0 8px 24px rgba(13, 34, 71, .06);
  font-size: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Top bar ---------- */
.topbar {
  background: linear-gradient(90deg, var(--blue-900), var(--blue-800));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.brand-icon { height: 36px; width: 36px; object-fit: contain; }
.brand-logo { height: 52px; width: auto; filter: drop-shadow(0 2px 8px rgba(0,0,0,.45)); }
.brand-name { font-size: 1.25rem; font-weight: 800; letter-spacing: .2px; }
.brand-name span { color: var(--blue-400); }
.topnav { display: flex; gap: 6px; flex-wrap: wrap; }
.topnav a {
  color: #cfe0f7; text-decoration: none; font-size: .9rem; font-weight: 600;
  padding: 7px 12px; border-radius: 8px;
}
.topnav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.topnav a.active { background: rgba(255,255,255,.18); color: #fff; }

/* ---------- Layout ---------- */
main { flex: 1; width: 100%; max-width: 1020px; margin: 0 auto; padding: 24px 16px 60px; }
.footer {
  border-top: 1px solid var(--line); background: #fff; padding: 16px 20px;
  font-size: .78rem; color: var(--ink-soft); text-align: center;
}
.footer p { max-width: 860px; margin: 0 auto; }

h1 { font-size: 1.5rem; margin-bottom: 4px; }
h2 { font-size: 1.15rem; margin-bottom: 10px; }
.sub { color: var(--ink-soft); margin-bottom: 20px; font-size: .95rem; }
.section { margin-top: 26px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px;
}
.card h2 { display: flex; align-items: center; gap: 8px; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* ---------- Hero (accueil) ---------- */
.hero {
  background: radial-gradient(130% 170% at 25% -10%, #0d2144 0%, #060f21 52%, #02060e 100%);
  border-radius: var(--radius);
  color: #fff; text-align: center; padding: 42px 24px 36px; margin-bottom: 24px;
  border: 1px solid #12244a;
}
.hero img { height: 110px; width: auto; filter: drop-shadow(0 4px 14px rgba(0,0,0,.4)); }
.hero .hero-logo {
  height: auto; width: min(560px, 92%);
  filter: drop-shadow(0 6px 22px rgba(0, 0, 0, .55));
}
.hero .hero-name { font-size: 2.3rem; font-weight: 800; letter-spacing: .3px; margin-top: 12px; }
.hero .hero-name span { color: #5b9df0; }
.hero .tagline {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 8px;
  color: #9fb8dd; font-size: .82rem; font-weight: 700; letter-spacing: .35em; text-transform: uppercase;
}
.hero .tagline::before, .hero .tagline::after { content: ""; width: 42px; height: 3px; background: var(--green-500); border-radius: 2px; }
.hero p { color: #b9cdec; margin-top: 14px; font-size: 1.02rem; max-width: 640px; margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; cursor: pointer;
  font-size: .95rem; font-weight: 700; padding: 11px 20px; text-decoration: none;
  transition: filter .15s, background .15s;
}
.btn-primary { background: var(--blue-600); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-green { background: var(--green-500); color: #fff; }
.btn-green:hover { filter: brightness(1.08); }
.btn-outline { background: #fff; color: var(--blue-700); border-color: var(--blue-400); }
.btn-outline:hover { background: var(--blue-050); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--blue-050); color: var(--blue-700); }
.btn-danger { background: #fff; color: var(--red-600); border-color: #efc3bd; }
.btn-danger:hover { background: var(--red-050); }
.btn-sm { padding: 7px 13px; font-size: .85rem; }
.btn-lg { padding: 15px 28px; font-size: 1.05rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.btn-row.between { justify-content: space-between; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: .88rem; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--ink-soft); font-size: .8rem; margin-top: 4px; }
input[type=text], input[type=number], input[type=date], input[type=email], input[type=password], select, textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: .95rem; font-family: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(36,112,221,.15);
}
textarea { min-height: 130px; resize: vertical; line-height: 1.5; }

.choice-row { display: flex; gap: 10px; flex-wrap: wrap; }
.choice {
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  padding: 10px 18px; cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--ink);
}
.choice:hover { border-color: var(--blue-400); }
.choice.selected { border-color: var(--blue-600); background: var(--blue-050); color: var(--blue-700); }

/* type-of-project cards */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.type-card {
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer;
  padding: 16px 10px; text-align: center; transition: border-color .12s, background .12s;
}
.type-card .emoji { font-size: 1.7rem; display: block; margin-bottom: 8px; }
.type-card .ticon3d { display: block; margin: 0 auto 8px; width: 64px; height: 64px; object-fit: contain; }
.type-card .ticon { display: block; margin: 0 auto 8px; width: 36px; height: 36px; color: var(--blue-600); }
.type-card .ticon svg { width: 100%; height: 100%; display: block; }
.type-card.selected .ticon { color: var(--blue-700); }
.type-card .lbl { font-weight: 700; font-size: .86rem; }
.type-card:hover { border-color: var(--blue-400); }
.type-card.selected { border-color: var(--blue-600); background: var(--blue-050); }
.type-card.selected .lbl { color: var(--blue-700); }

/* ---------- Badges & status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px;
  font-size: .74rem; font-weight: 700; padding: 4px 11px; white-space: nowrap;
}
.badge.blue { background: var(--blue-050); color: var(--blue-700); }
.badge.green { background: var(--green-050); color: var(--green-600); }
.badge.amber { background: var(--amber-050); color: var(--amber-600); }
.badge.red { background: var(--red-050); color: var(--red-600); }
.badge.grey { background: #eef1f6; color: var(--ink-soft); }

/* ---------- Progress ---------- */
.progress { background: #e6ecf5; border-radius: 999px; height: 10px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--blue-500), var(--green-500)); border-radius: 999px; transition: width .3s; }
.progress-line { display: flex; align-items: center; gap: 12px; }
.progress-line .progress { flex: 1; }
.progress-line strong { font-size: .9rem; min-width: 44px; text-align: right; }

/* ---------- Lists ---------- */
.piece-list { display: flex; flex-direction: column; gap: 10px; }
.piece-item {
  display: flex; align-items: center; gap: 12px; border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 16px; background: #fff; cursor: pointer;
  text-decoration: none; color: var(--ink); transition: border-color .12s;
}
.piece-item:hover { border-color: var(--blue-400); }
.piece-item .dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.piece-item .info { flex: 1; min-width: 0; }
.piece-item .info .name { font-weight: 700; font-size: .93rem; }
.piece-item .info .meta { font-size: .78rem; color: var(--ink-soft); margin-top: 2px; }
.dot.termine { background: var(--green-500); }
.dot.encours { background: var(--blue-500); }
.dot.afaire { background: #c3ccd9; }
.dot.averifier { background: #e8a13c; }

.check-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; line-height: 1.45; }
.check-list li::before { content: "•"; color: var(--blue-500); font-weight: 900; }
.check-list.ok li::before { content: "✓"; color: var(--green-600); }
.check-list.warn li::before { content: "!"; color: var(--amber-600); }

/* ---------- Diagnostic ---------- */
.verdict {
  border-radius: var(--radius); padding: 22px; color: #fff; margin-bottom: 16px;
  background: linear-gradient(120deg, var(--blue-700), var(--blue-500));
}
.verdict.none { background: linear-gradient(120deg, var(--green-600), #4db85d); }
.verdict .regime { font-size: 1.45rem; font-weight: 800; margin: 4px 0; }
.verdict .lead { opacity: .85; font-size: .88rem; }
.hypo {
  border-left: 4px solid var(--blue-400); background: var(--blue-050);
  border-radius: 0 10px 10px 0; padding: 12px 14px; margin-bottom: 10px; font-size: .9rem;
}
.hypo .tag { float: right; margin-left: 10px; }
.hypo strong { display: block; margin-bottom: 3px; }

/* rule cards (diagnostic terrain) */
.rule-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; background: #fff; }
.rule-card .rc-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.rule-card .rc-head strong { font-size: .95rem; }
.rule-card .src { font-size: .78rem; color: var(--ink-soft); margin-top: 6px; }

/* ---------- Files ---------- */
.file-chip {
  display: flex; align-items: center; gap: 10px; background: var(--blue-050);
  border-radius: 10px; padding: 9px 13px; font-size: .87rem; margin-top: 8px;
}
.file-chip .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-chip button { background: none; border: none; color: var(--red-600); cursor: pointer; font-size: 1rem; }
.drop {
  border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center;
  color: var(--ink-soft); font-size: .9rem; cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--blue-500); background: var(--blue-050); color: var(--blue-700); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding-bottom: 18px; font-size: .92rem; }
.timeline li::before {
  content: ""; position: absolute; left: -24px; top: 4px; width: 12px; height: 12px;
  border-radius: 50%; background: #c3ccd9; border: 2px solid #fff; box-shadow: 0 0 0 2px #c3ccd9;
}
.timeline li.done::before { background: var(--green-500); box-shadow: 0 0 0 2px var(--green-500); }
.timeline li.current::before { background: var(--blue-500); box-shadow: 0 0 0 2px var(--blue-500); }
.timeline li strong { display: block; }
.timeline li .tmeta { color: var(--ink-soft); font-size: .8rem; }

/* ---------- Project rows (accueil / pro) ---------- */
.proj-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; text-decoration: none; color: var(--ink); margin-bottom: 10px;
  transition: border-color .12s;
}
.proj-row:hover { border-color: var(--blue-400); }
.proj-row .pr-main { flex: 1; min-width: 0; }
.proj-row .pr-main .pr-name { font-weight: 800; font-size: .98rem; }
.proj-row .pr-main .pr-meta { font-size: .8rem; color: var(--ink-soft); margin-top: 2px; }
.proj-row .pr-progress { width: 130px; }
.proj-row .pr-pct { font-size: .85rem; font-weight: 800; color: var(--blue-700); min-width: 40px; text-align: right; }

/* ---------- Stats ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center;
}
.stat .num { font-size: 1.5rem; font-weight: 800; color: var(--blue-700); }
.stat.green .num { color: var(--green-600); }
.stat.amber .num { color: var(--amber-600); }
.stat.red .num { color: var(--red-600); }
.stat .lbl { font-size: .76rem; color: var(--ink-soft); font-weight: 600; margin-top: 3px; }

/* ---------- Steps header ---------- */
.steps { display: flex; gap: 4px; margin-bottom: 22px; flex-wrap: wrap; }
.steps span {
  font-size: .74rem; font-weight: 700; padding: 6px 12px; border-radius: 999px;
  background: #e8edf5; color: var(--ink-soft);
}
.steps span.on { background: var(--blue-600); color: #fff; }
.steps span.done { background: var(--green-050); color: var(--green-600); }
.steps a {
  font-size: .74rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; text-decoration: none;
  background: #e8edf5; color: var(--ink-soft); border: 1px solid transparent; transition: border-color .12s, background .12s;
}
.steps a:hover { border-color: var(--blue-400); color: var(--blue-700); background: var(--blue-050); }
.steps a.on { background: var(--blue-600); color: #fff; }
.steps a.done { background: var(--green-050); color: var(--green-600); }
.steps a.miss { background: var(--amber-050); color: var(--amber-600); border-color: #f0ddb8; }
.notice-banner.cf-warn { border-color: #e8c98a; }
.notice-banner.cf-warn em { font-style: normal; font-weight: 700; }
.notice-banner.cf-warn .cf-back { display: inline-block; margin-left: 6px; font-weight: 700; color: var(--blue-700); }
.date-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.date-row input[type=date] { width: auto; min-width: 190px; font-size: 1rem; padding: 10px 12px; }
.date-row .hint { font-size: .8rem; color: var(--ink-soft); }

/* bulles d'information */
.tip {
  display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px;
  border-radius: 50%; background: var(--blue-050); color: var(--blue-700); border: 1px solid var(--blue-400);
  font-size: .68rem; font-weight: 800; cursor: help; position: relative; vertical-align: 1px; margin-left: 4px;
}
.tip::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  background: var(--blue-900); color: #fff; font-weight: 400; font-size: .78rem; line-height: 1.4;
  padding: 8px 11px; border-radius: 8px; width: max-content; max-width: 280px; white-space: normal;
  box-shadow: 0 6px 20px rgba(13,34,71,.25); opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 60;
}
.tip:hover::after, .tip:focus::after { opacity: 1; }
textarea#f-desc { min-height: 96px; }
.card.assistant { border-left: 4px solid #f3b53f; }
.asst-h { font-size: .92rem; margin: 14px 0 6px; color: var(--ink); }

/* ---------- Thème professionnel : couleurs inversées (vert dominant) ---------- */
body.pro {
  --blue-900: #0f3d1f; --blue-800: #145a2b; --blue-700: #1b7a39; --blue-600: #23904a;
  --blue-500: #2ea55a; --blue-400: #63c283; --blue-050: #ecf7ee;
  --green-600: #17418c; --green-500: #2470dd; --green-050: #eef4fc;
  --bg: #f3f8f4;
}
body.pro .topbar { background: linear-gradient(90deg, #0d3a1d, #176b33); }
body.pro .hero { background: radial-gradient(130% 170% at 25% -10%, #144a26 0%, #0a2a15 52%, #05130a 100%); border-color: #1d5a30; }
body.pro .verdict { background: linear-gradient(120deg, var(--blue-700), var(--blue-500)); }
body.pro .progress > div { background: linear-gradient(90deg, var(--blue-500), #1b7a39); }

.notice-banner {
  background: var(--amber-050); border: 1px solid #f0ddb8; color: #7a5410;
  border-radius: 10px; padding: 11px 14px; font-size: .85rem; margin-bottom: 16px; line-height: 1.5;
}

.ic3 { width: 28px; height: 28px; object-fit: contain; vertical-align: -6px; }
.ic3-lg { width: 36px; height: 36px; }
.ic3-sm { width: 22px; height: 22px; vertical-align: -5px; }
h1 .ic3 { margin-right: 4px; }
.tab-ic { width: 20px; height: 20px; object-fit: contain; vertical-align: -4px; margin-right: 7px; }

.empty { text-align: center; color: var(--ink-soft); padding: 30px 10px; font-size: .95rem; }

table.rules { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.rules th, table.rules td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.rules th { color: var(--ink-soft); font-size: .78rem; }

@media (max-width: 640px) {
  main { padding: 16px 12px 50px; }
  .card { padding: 16px; }
  .proj-row .pr-progress { display: none; }
  .brand-name { font-size: 1.1rem; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 14px; }
  .topnav { width: 100%; justify-content: flex-start; }
  .topnav a { padding: 5px 9px; font-size: .82rem; }
  .hero { padding: 26px 16px; }
  .hero img { height: 84px; }
  .hero .hero-name { font-size: 1.7rem; }
  .hero .tagline { letter-spacing: .2em; }
  .hero .tagline::before, .hero .tagline::after { width: 22px; }
}

/* ---------- Carte parcellaire ---------- */
.parcel-map { height: 440px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); margin: 12px 0; background: #eef2f7; }
.parcel-map.mini { height: 240px; }
.gpu-link a { display: inline-block; background: #fff; color: var(--blue-700); padding: 6px 10px; border-radius: 8px; font-size: .78rem; font-weight: 700; text-decoration: none; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.leaflet-container { font-family: inherit; }
.leaflet-popup-content { font-size: .85rem; line-height: 1.45; }
@media (max-width: 640px) { .parcel-map { height: 320px; } }

/* ---------- Suggestions de type de projet ---------- */
.type-card.suggested { border-color: #2e8f3c; background: #ecf7ee; box-shadow: 0 0 0 3px rgba(58,167,74,.18); position: relative; }
.type-card.suggested::after { content: "Suggéré"; position: absolute; top: 6px; right: 6px; background: #2e8f3c; color: #fff; font-size: .62rem; font-weight: 800; padding: 2px 7px; border-radius: 999px; }
.type-card.suggested.selected { background: #dff2e3; border-color: #1f7a2e; }
.notice-banner.sug { background: #ecf7ee; border-color: #bfe3c6; color: #1f6b2b; }

/* ---------- Assistant Cerfa / Mr Permis ---------- */
.mp-bubble { display: flex; gap: 12px; align-items: flex-start; background: #fff8e8; border: 1px solid #f3dca6; border-radius: 12px; padding: 12px 14px; margin-bottom: 18px; }
.mp-bubble img { width: 46px; height: 46px; object-fit: contain; flex-shrink: 0; }
.mp-bubble strong { font-size: .85rem; color: #8a5a00; }
.mp-bubble p { font-size: .92rem; line-height: 1.5; margin-top: 2px; }
.mp-help { display: flex; gap: 8px; align-items: flex-start; margin-top: 7px; font-size: .82rem; line-height: 1.45; color: #6b5420; background: #fffbf0; border-left: 3px solid #f3b53f; border-radius: 0 8px 8px 0; padding: 7px 10px; }
.mp-help img { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.cf-q { padding-bottom: 4px; }

#mp-fab { position: fixed; right: 18px; bottom: 18px; z-index: 900; display: flex; align-items: center; gap: 8px; border: none; cursor: pointer;
  background: linear-gradient(120deg, var(--blue-700), var(--blue-500)); color: #fff; font-weight: 800; font-size: .92rem; padding: 8px 18px 8px 8px; border-radius: 999px; box-shadow: 0 6px 22px rgba(13,34,71,.35); }
#mp-fab img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 50%; padding: 3px; }
#mp-panel { position: fixed; right: 18px; bottom: 80px; z-index: 901; width: min(400px, calc(100vw - 24px)); height: min(580px, calc(100vh - 110px)); background: #fff; border-radius: 16px; box-shadow: 0 12px 48px rgba(13,34,71,.35); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); }
.mp-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: linear-gradient(90deg, var(--blue-900), var(--blue-800)); color: #fff; }
.mp-head img { width: 38px; height: 38px; object-fit: contain; background: #fff; border-radius: 50%; padding: 3px; }
.mp-head div { flex: 1; min-width: 0; } .mp-head strong { display: block; font-size: .95rem; }
.mp-head span { font-size: .74rem; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.mp-head button { background: none; border: none; color: #fff; font-size: 1.1rem; cursor: pointer; }
.mp-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.mp-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: .88rem; line-height: 1.5; }
.mp-msg.bot { background: #fff; border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.mp-msg.user { background: var(--blue-600); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.mp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mp-chips .choice { padding: 5px 11px; font-size: .78rem; border-radius: 999px; }
.mp-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: #fff; }
.mp-input input { flex: 1; }

#mp-panel[hidden], #mp-fab[hidden] { display: none !important; }

/* ---- Plan de masse ---- */
.pm-wrap { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .pm-wrap { grid-template-columns: 1fr; } }
.pm-map { height: 520px; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; }
.pm-map.drawing { cursor: crosshair; }
.pm-map.drawing .leaflet-interactive { cursor: crosshair; }
.pm-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.pm-tools [hidden] { display: none !important; }
.pm-tools .hint { font-size: .8rem; color: var(--ink-soft); flex-basis: 100%; min-height: 1.2em; }
.pm-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 600; color: var(--ink-soft); }
.pm-toggle select { width: auto; padding: 5px 8px; font-size: .84rem; }
.pm-handle { background: #fff; border: 2px solid #c1121f; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.7); cursor: move; }
.pm-len { background: #fff; border: 1px solid #c1121f; color: #c1121f; font: 700 12px/1.2 -apple-system, sans-serif; padding: 2px 6px; border-radius: 6px; white-space: nowrap; width: auto !important; height: auto !important; }
.pm-lbl { background: rgba(255,255,255,.9); border: none; box-shadow: 0 1px 3px rgba(0,0,0,.25); font-size: 11px; line-height: 1.3; padding: 3px 6px; color: #111; }
.pm-lbl::before { display: none; }
.pm-svg { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f3f4f6; padding: 10px; }
.pm-svg svg { width: 100%; height: auto; display: block; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.cta-card { border: 1.5px solid var(--blue-400); background: linear-gradient(180deg, #fff, var(--blue-050)); }
.cs-mark { background: #1d4ed8; color: #fff; border: 2px solid #fff; border-radius: 50%; font: 800 13px/22px -apple-system, sans-serif; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.4); cursor: move; }
.cs-elem { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.cs-elem h3 { font-size: .95rem; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.fa-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.fa-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); padding: 4px 6px; }
.fa-table td { padding: 3px 4px; vertical-align: middle; }
.fa-table input, .fa-table select { padding: 6px 8px; font-size: .84rem; min-width: 70px; }
.pm-lbl-mk { width: auto !important; height: auto !important; background: none; border: none; }
.pm-lbl-in { transform: translate(-50%, -50%); background: rgba(255,255,255,.93); box-shadow: 0 1px 3px rgba(0,0,0,.3); border-radius: 4px; font: 11px/1.3 -apple-system, sans-serif; padding: 3px 7px; color: #111; white-space: nowrap; cursor: move; }
.pm-svg .pm-drag { cursor: move; touch-action: none; }
.pm-svg .pm-drag:hover rect { stroke: #1d4ed8; stroke-width: 0.25; }
.fa-noopen { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; margin: 6px 0 2px; cursor: pointer; }

/* ---- État de la sauvegarde serveur (créé par store.js, masqué quand tout est enregistré) ---- */
#bp-sync { position: fixed; left: 14px; bottom: 14px; z-index: 1100; max-width: min(440px, calc(100vw - 210px)); padding: 7px 12px; border-radius: 10px; border: 1px solid #e8c98a; background: var(--amber-050); color: var(--amber-600); font-size: .8rem; font-weight: 600; line-height: 1.4; box-shadow: 0 2px 10px rgba(13, 34, 71, .12); pointer-events: none; }
#bp-sync.error { background: var(--red-050); border-color: #efc3bd; color: var(--red-600); }
#bp-sync[hidden] { display: none; }
@media (max-width: 600px) { #bp-sync { right: 14px; bottom: 76px; max-width: none; } }
