/* ============================================================
   SMPM 66 — Design system (mobile first, inspiration iOS)
   ============================================================ */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-round: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "SF Pro Text", "Segoe UI", Inter, Roboto, sans-serif;
  --mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 9px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --tabbar-h: 56px;
  --header-h: 52px;

  --dur: .22s;
  --ease: cubic-bezier(.32,.72,.32,1);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f2f7;
  --bg-elev: #ffffff;
  --bg-elev2: #f7f7fa;
  --bg-inset: #e9e9ee;
  --text: #1c1c1e;
  --text-2: #6e6e73;
  --text-3: #aeaeb2;
  --sep: rgba(60,60,67,.12);
  --accent: #e0392e;
  --accent-soft: rgba(224,57,46,.12);
  --accent-contrast: #ffffff;
  --blue: #007aff;
  --blue-soft: rgba(0,122,255,.12);
  --green: #34a853;
  --green-soft: rgba(52,168,83,.14);
  --orange: #f08c00;
  --orange-soft: rgba(240,140,0,.14);
  --purple: #7048e8;
  --card-shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 24px -12px rgba(0,0,0,.12);
  --blur-bg: rgba(249,249,251,.82);
  --chip-bg: #ffffff;
  --chip-border: rgba(60,60,67,.18);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-elev: #1c1c1e;
  --bg-elev2: #26262a;
  --bg-inset: #2c2c2e;
  --text: #f2f2f7;
  --text-2: #a1a1a8;
  --text-3: #636369;
  --sep: rgba(84,84,88,.5);
  --accent: #ff4d40;
  --accent-soft: rgba(255,77,64,.16);
  --accent-contrast: #ffffff;
  --blue: #0a84ff;
  --blue-soft: rgba(10,132,255,.18);
  --green: #30d158;
  --green-soft: rgba(48,209,88,.16);
  --orange: #ff9f0a;
  --orange-soft: rgba(255,159,10,.16);
  --purple: #9775fa;
  --card-shadow: 0 1px 2px rgba(0,0,0,.4);
  --blur-bg: rgba(18,18,20,.8);
  --chip-bg: #26262a;
  --chip-border: rgba(84,84,88,.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--blue); text-decoration: none; }
svg.icon { width: 20px; height: 20px; flex: none; display: block; }

/* ---------- Splash ---------- */
.boot-splash {
  height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 22px;
}
.boot-spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--sep); border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Structure ---------- */
#app { min-height: 100dvh; }
.shell { display: flex; min-height: 100dvh; }
.main {
  flex: 1; min-width: 0;
  padding-top: calc(var(--header-h) + var(--safe-top));
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 8px);
}
.page { max-width: 760px; margin: 0 auto; padding: 12px 14px 32px; }
.page.wide { max-width: 1100px; }
.page.full { max-width: none; padding: 0; }

/* ---------- Header ---------- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  height: calc(var(--header-h) + var(--safe-top));
  padding: var(--safe-top) 12px 0;
  display: flex; align-items: center; gap: 10px;
  background: var(--blur-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--sep);
}
.header .brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.02em; }
.header .brand svg { width: 30px; height: 30px; }
.header .brand .sub { display: block; font-size: 10.5px; font-weight: 500; color: var(--text-2); letter-spacing: 0; margin-top: -2px; }
.header .spacer { flex: 1; }
.hbtn {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); transition: background var(--dur);
}
.hbtn:active { background: var(--bg-inset); }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 11px 5px 6px; border-radius: 999px;
  background: var(--bg-elev); border: .5px solid var(--sep);
}
.user-chip .avatar {
  width: 27px; height: 27px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.user-chip .role { font-size: 12px; font-weight: 600; color: var(--text-2); }

/* ---------- Tab bar (mobile) ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 500;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex;
  background: var(--blur-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--sep);
}
.tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 10px; font-weight: 600; color: var(--text-3);
  transition: color var(--dur);
}
.tabbar button svg { width: 23px; height: 23px; }
.tabbar button.active { color: var(--accent); }
.tabbar button:disabled { opacity: .35; cursor: default; }

/* ---------- Sidebar (desktop) ---------- */
.sidebar { display: none; }
@media (min-width: 900px) {
  .tabbar { display: none; }
  .main { padding-bottom: 24px; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px;
    width: 216px; flex: none;
    padding: calc(var(--header-h) + var(--safe-top) + 14px) 10px 20px;
    border-right: .5px solid var(--sep);
    position: sticky; top: 0; height: 100dvh;
  }
  .sidebar button {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; border-radius: var(--radius-md);
    font-size: 14px; font-weight: 600; color: var(--text-2);
    transition: background var(--dur), color var(--dur);
    text-align: left;
  }
  .sidebar button:hover { background: var(--bg-inset); }
  .sidebar button.active { background: var(--accent-soft); color: var(--accent); }
  .sidebar button:disabled { opacity: .35; }
}

/* ---------- Cards & sections ---------- */
.card {
  background: var(--bg-elev); border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  border: .5px solid var(--sep);
  overflow: hidden;
}
.card + .card { margin-top: 14px; }
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 4px;
}
.card-head .sec-icon {
  width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.card-head .sec-icon svg { width: 17px; height: 17px; }
.card-head h2 { font-size: 16.5px; font-weight: 700; letter-spacing: -.02em; flex: 1; }
.card-body { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 14px; }

.page-title { display: flex; align-items: center; gap: 10px; margin: 8px 2px 14px; }
.page-title h1 { font-size: 25px; font-weight: 800; letter-spacing: -.03em; flex: 1; }

/* ---------- Champs ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input, textarea.input {
  width: 100%; padding: 11px 13px;
  background: var(--bg-inset); border: 1px solid transparent;
  border-radius: var(--radius-md); font-size: 16px;
  outline: none; transition: border var(--dur), background var(--dur);
  color: var(--text);
}
.input:focus { border-color: var(--accent); background: var(--bg-elev); }
.input:disabled { opacity: .6; }
textarea.input { resize: vertical; min-height: 74px; }
.input-suffix { position: relative; }
.input-suffix .input { padding-right: 44px; }
.input-suffix .suffix {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); font-size: 14px; font-weight: 600; pointer-events: none;
}

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 15px; border-radius: 999px;
  background: var(--chip-bg); border: 1px solid var(--chip-border);
  font-size: 14.5px; font-weight: 600; color: var(--text);
  transition: all var(--dur) var(--ease);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip svg { width: 15px; height: 15px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.chip:disabled { cursor: default; opacity: .55; }
.chip.on:disabled { opacity: 1; }

/* Segmented oui/non */
.seg {
  display: inline-flex; background: var(--bg-inset);
  border-radius: 10px; padding: 2.5px; gap: 2px;
}
.seg button {
  padding: 6.5px 20px; border-radius: 8px;
  font-size: 14.5px; font-weight: 600; color: var(--text-2);
  transition: all var(--dur) var(--ease);
}
.seg button.on { background: var(--bg-elev); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.14); }
.seg button.on.yes { color: var(--green); }
.seg button.on.no { color: var(--accent); }
.seg button:disabled { cursor: default; }
.seg.lg button { padding: 8px 26px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--radius-md);
  font-size: 15.5px; font-weight: 650;
  transition: transform .12s var(--ease), opacity var(--dur), background var(--dur);
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-contrast); }
.btn.secondary { background: var(--accent-soft); color: var(--accent); }
.btn.tonal { background: var(--bg-inset); color: var(--text); }
.btn.blue { background: var(--blue-soft); color: var(--blue); }
.btn.ghost { color: var(--blue); padding: 8px 12px; }
.btn.danger { background: var(--accent-soft); color: var(--accent); }
.btn.sm { padding: 8px 14px; font-size: 14px; border-radius: var(--radius-sm); }
.btn.block { width: 100%; }
.btn.icon-only { padding: 10px; border-radius: var(--radius-md); }

.fab {
  position: fixed; right: 18px; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 18px);
  z-index: 400;
  width: 56px; height: 56px; border-radius: 18px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px -6px rgba(224,57,46,.55);
  transition: transform .15s var(--ease);
}
.fab:active { transform: scale(.92); }
.fab svg { width: 26px; height: 26px; }
@media (min-width: 900px) { .fab { bottom: 26px; } }

/* ---------- Listes ---------- */
.rows { display: flex; flex-direction: column; }
.row-item {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 16px; width: 100%; text-align: left;
  border-bottom: .5px solid var(--sep);
  transition: background var(--dur);
}
.row-item:last-child { border-bottom: 0; }
.row-item:active { background: var(--bg-inset); }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .title { font-weight: 650; font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.row-item .sub { font-size: 13px; color: var(--text-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .chev { color: var(--text-3); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
  padding: 3px 9px; border-radius: 999px; text-transform: uppercase;
}
.badge.open { background: var(--green-soft); color: var(--green); }
.badge.closed { background: var(--bg-inset); color: var(--text-2); }
.badge.role { background: var(--blue-soft); color: var(--blue); }
.badge.role-ct { background: var(--accent-soft); color: var(--accent); }
.dot-live {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }

.empty {
  text-align: center; padding: 54px 24px; color: var(--text-2);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty svg { width: 44px; height: 44px; color: var(--text-3); }
.empty h3 { color: var(--text); font-size: 17px; }
.empty p { font-size: 14px; max-width: 300px; }

/* ---------- Toasts ---------- */
#toasts {
  position: fixed; top: calc(var(--safe-top) + 10px); left: 0; right: 0;
  z-index: 2000; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  background: var(--bg-elev); color: var(--text);
  border: .5px solid var(--sep);
  padding: 11px 18px; border-radius: 999px;
  box-shadow: 0 10px 34px -8px rgba(0,0,0,.3);
  font-size: 14px; font-weight: 600;
  animation: toast-in .3s var(--ease);
  max-width: min(92vw, 480px);
}
.toast svg { width: 17px; height: 17px; }
.toast.ok svg { color: var(--green); }
.toast.err svg { color: var(--accent); }
.toast.out { animation: toast-out .25s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.94); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px) scale(.96); } }

/* ---------- Modales / feuilles ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1500;
  background: rgba(0,0,0,.45);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade-in .2s ease;
}
@keyframes fade-in { from { opacity: 0; } }
.sheet {
  background: var(--bg-elev); width: 100%; max-height: 88dvh;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 10px 18px calc(18px + var(--safe-bottom));
  overflow-y: auto;
  animation: sheet-up .32s var(--ease);
  display: flex; flex-direction: column; gap: 14px;
}
.sheet .grab { width: 38px; height: 4.5px; border-radius: 3px; background: var(--sep); margin: 2px auto 2px; flex: none; }
.sheet h2 { font-size: 19px; font-weight: 750; letter-spacing: -.02em; }
@keyframes sheet-up { from { transform: translateY(60px); opacity: .4; } }
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 24px; }
  .sheet { max-width: 470px; border-radius: var(--radius-xl); padding-bottom: 20px; animation: pop-in .25s var(--ease); }
  .sheet .grab { display: none; }
  @keyframes pop-in { from { transform: scale(.94) translateY(12px); opacity: 0; } }
}

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1100px 500px at 85% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, var(--blue-soft), transparent 55%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 390px;
  background: var(--bg-elev); border-radius: 26px;
  border: .5px solid var(--sep);
  box-shadow: 0 24px 70px -24px rgba(0,0,0,.35);
  padding: 34px 28px 28px;
  display: flex; flex-direction: column; gap: 18px;
  animation: pop-in .4s var(--ease);
}
.login-card .logo-big { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 4px; }
.login-card .logo-big svg { width: 74px; height: 74px; }
.login-card h1 { font-size: 23px; font-weight: 800; letter-spacing: -.03em; text-align: center; }
.login-card .tagline { font-size: 13px; color: var(--text-2); text-align: center; margin-top: -12px; }

/* ---------- Fiche ---------- */
.fiche-topbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 6px 2px 14px;
}
.fiche-topbar .num { font-family: var(--font-round); font-weight: 800; font-size: 21px; letter-spacing: -.02em; }
.fiche-topbar .meta { font-size: 12.5px; color: var(--text-2); width: 100%; display: flex; gap: 12px; flex-wrap: wrap; }
.save-ind { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.save-ind.saving { color: var(--orange); }
.save-ind.saved { color: var(--green); }
.save-ind.error { color: var(--accent); }

.readonly-banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--blue-soft); color: var(--blue);
  border-radius: var(--radius-md); padding: 10px 14px;
  font-size: 13.5px; font-weight: 600; margin-bottom: 14px;
}
.closed-banner { background: var(--orange-soft); color: var(--orange); }

.victim-card {
  border: 1px solid var(--sep); border-radius: var(--radius-md);
  padding: 13px 14px; display: flex; flex-direction: column; gap: 11px;
  background: var(--bg-elev2);
}
.victim-card .vc-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14.5px; }
.victim-card .vc-head .n {
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 12.5px; display: flex; align-items: center; justify-content: center;
}
.vq { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vq .q { font-size: 14px; flex: 1; }
.counts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.count-box { display: flex; flex-direction: column; gap: 5px; }
.count-box label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.stepper { display: flex; align-items: center; background: var(--bg-inset); border-radius: var(--radius-sm); overflow: hidden; }
.stepper button { width: 38px; height: 40px; font-size: 20px; font-weight: 600; color: var(--blue); }
.stepper button:disabled { color: var(--text-3); }
.stepper .val { flex: 1; text-align: center; font-weight: 700; font-size: 16.5px; font-variant-numeric: tabular-nums; }

.gps-box { display: flex; flex-direction: column; gap: 10px; }
.gps-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gps-val {
  background: var(--bg-inset); border-radius: var(--radius-md);
  padding: 9px 13px; display: flex; flex-direction: column; gap: 1px;
}
.gps-val .k { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; color: var(--text-3); text-transform: uppercase; }
.gps-val .v { font-family: var(--mono); font-size: 14.5px; font-weight: 600; }

/* Journal */
.journal { display: flex; flex-direction: column; gap: 9px; }
.jentry { display: flex; gap: 10px; }
.jentry .jtime { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); padding-top: 3px; flex: none; width: 40px; }
.jentry .jbody { background: var(--bg-inset); border-radius: 4px 14px 14px 14px; padding: 8px 13px; font-size: 14px; flex: 1; }
.jentry .jbody .jwho { font-size: 11.5px; font-weight: 700; color: var(--accent); margin-bottom: 1px; }
.jentry.sys .jbody { background: none; padding: 2px 0; color: var(--text-2); font-size: 12.5px; font-style: italic; }
.journal-input { display: flex; gap: 9px; margin-top: 12px; }
.journal-input .input { flex: 1; }
.journal-input .btn { padding: 0 16px; }

/* ---------- Carte ---------- */
.map-page { position: relative; height: calc(100dvh - var(--header-h) - var(--safe-top) - var(--tabbar-h) - var(--safe-bottom)); }
@media (min-width: 900px) { .map-page { height: calc(100dvh - var(--header-h) - var(--safe-top)); } }
#map { position: absolute; inset: 0; background: #d9d9de; }
html[data-theme="dark"] #map { background: #1a1a1c; }

.map-ui { position: absolute; z-index: 900; }
.map-search {
  top: 12px; left: 12px; right: 12px; max-width: 430px;
  display: flex; flex-direction: column; gap: 6px;
}
.map-search .bar {
  display: flex; align-items: center; gap: 9px;
  background: var(--blur-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border: .5px solid var(--sep); border-radius: var(--radius-md);
  padding: 0 13px; box-shadow: var(--card-shadow);
}
.map-search input { flex: 1; background: none; border: 0; outline: none; padding: 12px 0; font-size: 15.5px; }
.map-search .results {
  background: var(--bg-elev); border-radius: var(--radius-md);
  border: .5px solid var(--sep); box-shadow: var(--card-shadow);
  overflow: hidden; max-height: 270px; overflow-y: auto;
}
.map-search .results button {
  display: flex; flex-direction: column; align-items: flex-start; width: 100%;
  padding: 10px 14px; border-bottom: .5px solid var(--sep); text-align: left;
}
.map-search .results button:last-child { border-bottom: 0; }
.map-search .results .r1 { font-size: 14.5px; font-weight: 600; }
.map-search .results .r2 { font-size: 12px; color: var(--text-2); }

.map-tools {
  right: 12px; top: 74px;
  display: flex; flex-direction: column; gap: 8px;
}
.map-tools button, .map-layerbtn {
  width: 42px; height: 42px; border-radius: var(--radius-md);
  background: var(--blur-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border: .5px solid var(--sep); box-shadow: var(--card-shadow);
  display: flex; align-items: center; justify-content: center; color: var(--text);
}
.map-tools button.on { background: var(--accent); color: #fff; border-color: var(--accent); }

.map-coords {
  left: 50%; transform: translateX(-50%);
  bottom: 14px;
  background: var(--blur-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border: .5px solid var(--sep); border-radius: 999px;
  padding: 7px 16px; font-family: var(--mono); font-size: 12px; font-weight: 600;
  box-shadow: var(--card-shadow); white-space: nowrap;
  display: flex; gap: 14px;
}
.map-confirm {
  left: 12px; right: 12px; bottom: 14px;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-elev); border: .5px solid var(--sep);
  border-radius: var(--radius-lg); padding: 12px 14px;
  box-shadow: 0 14px 40px -10px rgba(0,0,0,.4);
}
.map-confirm .txt { flex: 1; min-width: 0; }
.map-confirm .txt .t1 { font-weight: 700; font-size: 14.5px; }
.map-confirm .txt .t2 { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.crosshair {
  position: absolute; left: 50%; top: 50%; z-index: 800;
  transform: translate(-50%, -50%); pointer-events: none; color: var(--accent);
}

.iv-marker { background: none; border: none; }
.iv-marker .pin {
  width: 34px; height: 34px; border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg); transform-origin: center;
  background: var(--accent); border: 2.5px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
}
.iv-marker .pin svg { transform: rotate(45deg); width: 16px; height: 16px; color: #fff; }
.iv-marker.closed .pin { background: #8e8e93; }
.iv-marker.dz .pin { background: var(--blue); border-radius: 50%; transform: none; }
.iv-marker.dz .pin svg { transform: none; }

.leaflet-popup-content-wrapper { background: var(--bg-elev); color: var(--text); border-radius: 14px; box-shadow: var(--card-shadow); }
.leaflet-popup-tip { background: var(--bg-elev); }
.leaflet-container { font-family: var(--font); }
.pop-iv { min-width: 190px; }
.pop-iv .p1 { font-weight: 750; }
.pop-iv .p2 { font-size: 12.5px; color: var(--text-2); margin: 2px 0 8px; }

.layer-sheet .opt { display: flex; align-items: center; gap: 12px; padding: 11px 4px; width: 100%; text-align: left; border-bottom: .5px solid var(--sep); }
.layer-sheet .opt:last-child { border-bottom: 0; }
.layer-sheet .opt .name { flex: 1; font-weight: 600; font-size: 15px; }
.layer-sheet .opt svg.check { color: var(--accent); opacity: 0; }
.layer-sheet .opt.on svg.check { opacity: 1; }

/* ---------- Météo ---------- */
.wx-hero {
  border-radius: var(--radius-xl);
  padding: 22px 20px;
  color: #fff;
  background: linear-gradient(150deg, #2b6cb0, #1a4a80);
  position: relative; overflow: hidden;
  box-shadow: var(--card-shadow);
}
.wx-hero.night { background: linear-gradient(150deg, #2d3561, #131a3a); }
.wx-hero.storm { background: linear-gradient(150deg, #4a5568, #2d3748); }
.wx-hero.snow { background: linear-gradient(150deg, #7f9cf5, #4c6ef5); }
.wx-hero.clear { background: linear-gradient(150deg, #3d8bfd, #1c66d4); }
.wx-hero .wx-loc { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 650; opacity: .95; }
.wx-hero .wx-main { display: flex; align-items: center; gap: 18px; margin-top: 8px; }
.wx-hero .wx-t { font-size: 56px; font-weight: 250; letter-spacing: -.04em; line-height: 1; font-family: var(--font-round); }
.wx-hero .wx-main svg { width: 58px; height: 58px; }
.wx-hero .wx-desc { font-size: 15px; font-weight: 650; margin-top: 6px; }
.wx-hero .wx-sub { font-size: 12.5px; opacity: .85; margin-top: 2px; }
.wx-live {
  position: absolute; top: 16px; right: 16px;
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.18); border-radius: 999px;
  padding: 4px 11px; font-size: 11px; font-weight: 700; letter-spacing: .04em;
}
.wx-live .dot-live { background: #7CFC9A; }

.wx-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 10px; margin-top: 14px; }
.wx-stat {
  background: var(--bg-elev); border: .5px solid var(--sep); border-radius: var(--radius-md);
  padding: 11px 13px; display: flex; flex-direction: column; gap: 3px;
  box-shadow: var(--card-shadow);
}
.wx-stat .k { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--text-3); text-transform: uppercase; }
.wx-stat .k svg { width: 13px; height: 13px; }
.wx-stat .v { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wx-stat .v small { font-size: 12px; color: var(--text-2); font-weight: 600; }

.wx-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.wx-scroll::-webkit-scrollbar { display: none; }
.wx-slot {
  flex: none; width: 74px; scroll-snap-align: start;
  background: var(--bg-elev); border: .5px solid var(--sep);
  border-radius: var(--radius-md); padding: 10px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  box-shadow: var(--card-shadow);
}
.wx-slot.now { border-color: var(--accent); background: var(--accent-soft); }
.wx-slot .h { font-size: 11.5px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.wx-slot svg { width: 26px; height: 26px; }
.wx-slot .t { font-size: 15px; font-weight: 750; font-variant-numeric: tabular-nums; }
.wx-slot .p { font-size: 10.5px; color: var(--blue); font-weight: 700; min-height: 13px; }
.wx-slot .w { font-size: 10.5px; color: var(--text-2); font-weight: 600; display: flex; align-items: center; gap: 2px; }
.wx-slot .w svg { width: 10px; height: 10px; }

.wx-day { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: .5px solid var(--sep); }
.wx-day:last-child { border-bottom: 0; }
.wx-day .d { width: 84px; font-weight: 650; font-size: 14.5px; text-transform: capitalize; }
.wx-day svg { width: 26px; height: 26px; }
.wx-day .rng { flex: 1; display: flex; align-items: center; gap: 9px; font-variant-numeric: tabular-nums; font-size: 14.5px; }
.wx-day .rng .min { color: var(--text-2); width: 34px; text-align: right; }
.wx-day .rng .max { font-weight: 700; width: 34px; }
.wx-day .bar { flex: 1; height: 4.5px; border-radius: 3px; background: var(--bg-inset); position: relative; overflow: hidden; }
.wx-day .bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, #4dabf7, #ff922b); }
.wx-day .pp { font-size: 12px; color: var(--blue); font-weight: 700; width: 40px; text-align: right; }

.wx-refresh { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 12px; font-size: 12.5px; color: var(--text-2); }
.seg-loc { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; }
.seg-loc::-webkit-scrollbar { display: none; }

.h-label { font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--text-2); text-transform: uppercase; margin: 20px 4px 9px; display: flex; align-items: center; gap: 7px; }
.h-label svg { width: 15px; height: 15px; }

/* ---------- Réglages ---------- */
.set-row {
  display: flex; align-items: center; gap: 13px; width: 100%;
  padding: 13px 16px; text-align: left; border-bottom: .5px solid var(--sep);
}
.set-row:last-child { border-bottom: 0; }
.set-row .ic {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.set-row .ic svg { width: 17px; height: 17px; }
.set-row .grow { flex: 1; min-width: 0; }
.set-row .t { font-weight: 600; font-size: 15px; }
.set-row .s { font-size: 12.5px; color: var(--text-2); }
.theme-seg { display: flex; background: var(--bg-inset); border-radius: 10px; padding: 2.5px; gap: 2px; }
.theme-seg button {
  flex: 1; padding: 7px 6px; border-radius: 8px; font-size: 13px; font-weight: 650; color: var(--text-2);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.theme-seg button svg { width: 15px; height: 15px; }
.theme-seg button.on { background: var(--bg-elev); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.14); }

/* Éditeur de schéma */
.schema-ed .sec-block { border: 1px solid var(--sep); border-radius: var(--radius-md); margin-bottom: 12px; overflow: hidden; }
.schema-ed .sec-head { display: flex; align-items: center; gap: 10px; padding: 11px 13px; background: var(--bg-elev2); width: 100%; }
.schema-ed .sec-head .input { font-weight: 700; }
.schema-ed .fields { padding: 11px 13px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--sep); }
.schema-ed .f-block { display: flex; flex-direction: column; gap: 7px; padding: 10px; background: var(--bg-inset); border-radius: var(--radius-sm); }
.schema-ed .f-row { display: flex; gap: 8px; align-items: center; }
.schema-ed .f-row .input { flex: 1; padding: 8px 11px; font-size: 14px; background: var(--bg-elev); }
.schema-ed .f-type { font-size: 10.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.schema-ed .opts { display: flex; flex-direction: column; gap: 6px; padding-left: 12px; border-left: 2px solid var(--sep); }
.schema-ed .mini-btn { color: var(--accent); padding: 6px; border-radius: 7px; flex: none; }
.schema-ed .mini-btn:active { background: var(--accent-soft); }
.schema-ed .add-btn { color: var(--blue); font-size: 13.5px; font-weight: 650; display: inline-flex; align-items: center; gap: 6px; padding: 6px 2px; }

/* ---------- Impression ---------- */
.print-only { display: none; }
@media print {
  body > #app, body > #toasts, body > #modal-root { display: none !important; }
  .print-only { display: block !important; }
  body { background: #fff; color: #000; font-size: 11px; }
  .pf { max-width: 190mm; margin: 0 auto; }
  .pf-head { display: flex; border: 1.5px solid #000; margin-bottom: 5mm; }
  .pf-head .code { padding: 3mm; border-right: 1.5px solid #000; font-weight: 700; }
  .pf-head .titre { padding: 3mm; flex: 1; text-align: center; font-weight: 700; font-size: 13px; }
  .pf-sec { margin-bottom: 4mm; break-inside: avoid; }
  .pf-sec h3 { font-size: 11.5px; text-decoration: underline; margin-bottom: 1.5mm; text-transform: uppercase; }
  .pf-item { margin: .8mm 0; }
  .pf-item .lbl { font-weight: 600; }
  .pf-check { display: inline-block; margin-right: 4mm; }
  .pf-check .box { display: inline-block; width: 3mm; height: 3mm; border: 1px solid #000; vertical-align: -1px; margin-left: 1mm; text-align: center; line-height: 3mm; font-size: 9px; }
  .pf-meta { display: flex; justify-content: space-between; border-top: 1px solid #000; margin-top: 4mm; padding-top: 1.5mm; font-size: 9.5px; color: #333; }
}

/* ---------- Divers ---------- */
.hint { font-size: 12.5px; color: var(--text-3); }
.sep-line { height: .5px; background: var(--sep); margin: 4px 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 460px) { .grid-2.collapse { grid-template-columns: 1fr; } }
.skeleton { position: relative; overflow: hidden; background: var(--bg-inset); border-radius: var(--radius-md); }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
  animation: shimmer 1.3s infinite;
}
html[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
