/* Dispatch World — feuille de style unique.
   Console CAD de nuit : bleu ardoise profond, services en couleurs franches,
   typographie Barlow (signalétique de véhicules d'urgence). */

:root {
  --bg: #0F1B26;
  --bg-2: #132230;
  --panel: #162837;
  --panel-2: #1C3243;
  --line: #2A4458;
  --line-2: #36546B;
  --text: #E4EDF3;
  --muted: #8FA6B8;
  --dim: #5F7A8E;
  --hi: #EEF3F7;
  --ok: #5AD08A;
  --warn: #F2B33D;
  --err: #F0524A;
  --police: #3E8BFF;
  --ems: #F2C230;
  --fire: #FF4D3D;
  --gcsr: #2BC4A9;
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --f: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fc: 'Barlow Semi Condensed', 'Barlow', system-ui, sans-serif;
  --top: 56px;
  --nav: 58px;
  --panel-w: 400px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font: 16px/1.45 var(--f);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: #9CC9FF; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid #9CC9FF; outline-offset: 2px; }
.noscript { padding: 2rem; }
h1 { font: 700 1.6rem/1.2 var(--fc); letter-spacing: .01em; margin: 0 0 1rem; }
.h3 { font: 600 1.05rem/1.3 var(--fc); margin: 0 0 .75rem; color: var(--hi); }
.hint { color: var(--muted); font-size: .92rem; margin: .25rem 0 .75rem; }
.empty { color: var(--muted); text-align: center; padding: 1.5rem 1rem; }
.na { color: var(--dim); font-style: italic; font-weight: 400; font-size: .9em; }
.ok-text { color: var(--ok); } .warn-text { color: var(--warn); }
.err-box { background: rgba(240, 82, 74, .12); border: 1px solid rgba(240, 82, 74, .5); color: #FFC9C5; padding: .75rem 1rem; border-radius: var(--r-sm); margin: .5rem 0; }
.err-box ul { margin: 0; padding-left: 1.2rem; }
.stack > * + * { margin-top: .9rem; }
.inline { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .9rem; margin-bottom: .75rem; }

/* ----------------------------------------------------------- contrôles */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .55rem 1.1rem; border-radius: var(--r-sm);
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text);
  font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s;
}
.btn:hover:not(:disabled) { background: #24405A; border-color: #4A6A83; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary { background: var(--hi); border-color: var(--hi); color: #0F1B26; }
.btn--primary:hover:not(:disabled) { background: #fff; border-color: #fff; }
.btn--ghost { background: transparent; }
.btn--danger { color: #FF9B94; border-color: rgba(240, 82, 74, .55); }
.btn--sm { min-height: 34px; padding: .3rem .7rem; font-size: .9rem; }
.btn--block { width: 100%; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--muted) transparent var(--muted) transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; font-size: 1rem; }
.icon-btn:hover { background: var(--panel-2); }

.field { display: flex; flex-direction: column; gap: .35rem; }
.field > span { color: var(--muted); font-size: .88rem; font-weight: 500; }
.field input, .field select, .inline input, .inline select, .loan__pay input, .mgmt select {
  min-height: 44px; padding: .5rem .75rem; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm);
}
.field--big input { font: 600 1.4rem var(--fc); min-height: 54px; }
.field input:focus, .field select:focus, .inline input:focus { border-color: #9CC9FF; outline: none; }
.check, .switch { display: flex; align-items: center; gap: .6rem; cursor: pointer; min-height: 36px; }
.check input, .switch input, .pick input { width: 20px; height: 20px; accent-color: var(--hi); }
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .4rem 1rem; }
input[type=range] { flex: 1; min-width: 160px; accent-color: var(--hi); }

.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: .45rem .9rem; border-radius: 4px; cursor: pointer; color: var(--muted); font-weight: 600; min-height: 38px; }
.seg button.is-on, .seg button[aria-selected=true] { background: var(--panel-2); color: var(--hi); }
.seg--block { display: flex; width: 100%; }
.seg--block > * { flex: 1; }
fieldset.seg { flex-direction: column; padding: .5rem; border-color: var(--line); }
fieldset.seg label { display: flex; gap: .6rem; align-items: center; padding: .4rem .3rem; cursor: pointer; }
fieldset.seg small { margin-left: auto; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .25rem 0 .75rem; }
.fchip { border: 1px solid var(--line-2); background: transparent; color: var(--muted); border-radius: 999px; padding: .3rem .8rem; min-height: 34px; cursor: pointer; font: 600 .85rem var(--fc); }
.fchip.is-on { color: var(--hi); border-color: var(--svc, var(--hi)); background: color-mix(in srgb, var(--svc, #fff) 18%, transparent); }

.box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.1rem; margin: 0 0 1rem; }
fieldset.box { min-width: 0; }
fieldset.box > legend { padding: 0 .4rem; }
.actions { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.kpis, .bank__top { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: .8rem 1rem; display: flex; flex-direction: column; gap: .15rem; }
.kpi b { font: 700 1.35rem/1.2 var(--fc); color: var(--hi); }
.kpi small { color: var(--muted); }
.k { color: var(--muted); font-size: .82rem; font-weight: 500; }
.code { letter-spacing: .08em; }

.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: .82rem; padding: .5rem .6rem; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: #FF9B94; } .pos { color: var(--ok); }
.pager { display: flex; gap: .75rem; align-items: center; justify-content: flex-end; margin-top: .75rem; color: var(--muted); }
.svcdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--svc); margin-right: .45rem; vertical-align: middle; }

/* ----------------------------------------------------------- marque */
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--hi); }
.brand__mark { width: 22px; height: 22px; border-radius: 5px; background: conic-gradient(from 225deg, var(--police) 0 50%, var(--fire) 50% 100%); box-shadow: inset 0 0 0 3px var(--bg); outline: 1px solid var(--line-2); }
.brand__name { font: 700 1.15rem var(--fc); letter-spacing: .02em; }
.brand--lg .brand__mark { width: 30px; height: 30px; }
.brand--lg .brand__name { font-size: 1.5rem; }

/* ----------------------------------------------------------- toasts */
.toasts { position: fixed; z-index: 3000; right: 1rem; bottom: calc(var(--nav) + 1rem + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: .5rem; max-width: min(380px, calc(100vw - 2rem)); pointer-events: none; }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); border-left: 4px solid var(--muted); border-radius: var(--r-sm); padding: .65rem .9rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); transition: opacity .35s, transform .35s; font-size: .93rem; }
.toast--ok { border-left-color: var(--ok); } .toast--warn { border-left-color: var(--warn); } .toast--err { border-left-color: var(--err); }
.toast.is-out { opacity: 0; transform: translateY(6px); }

/* ----------------------------------------------------------- modales */
.modal-backdrop { position: fixed; inset: 0; z-index: 2000; background: rgba(6, 12, 18, .66); display: flex; align-items: center; justify-content: center; padding: 1rem; overscroll-behavior: contain; }
.modal { width: min(560px, 100%); max-height: calc(100dvh - 2rem); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.modal--wide { width: min(880px, 100%); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.modal__title { font: 700 1.25rem var(--fc); margin: 0; }
.modal__body { padding: 1.1rem; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
body.has-modal { overflow: hidden; }

/* ----------------------------------------------------------- composant véhicule
   Partagé par la carte de jeu, l'aperçu du loading et les listes. */
.dwv-wrap { background: none; border: 0; }
.dwv { position: relative; width: 30px; height: 30px; --svc: var(--police); }
.dwv__body { display: block; transition: transform .12s linear; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
.dwv__disc { fill: var(--svc); stroke: #0B141C; stroke-width: 2; }
.dwv__arrow { fill: #0B141C; opacity: .85; }
.dwv__tag { position: absolute; right: -4px; bottom: -3px; min-width: 13px; height: 13px; border-radius: 3px; background: #0B141C; color: var(--svc); font: 700 9px/13px var(--fc); text-align: center; padding: 0 2px; }
.dwv.is-onscene .dwv__disc { stroke: #fff; }
.dwv.is-returning { opacity: .78; }
.dwv.is-route_pending::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px dashed var(--warn); animation: spin 3s linear infinite; }
.dwv.is-allied .dwv__disc { fill-opacity: .55; stroke: var(--svc); stroke-dasharray: 3 2; }
.dwv.is-deco .dwv__tag { display: none; }
.row__veh .dwv, .card-btn__veh .dwv, .tbl .dwv { display: inline-block; width: 24px; height: 24px; vertical-align: middle; }
.row__veh .dwv svg, .card-btn__veh .dwv svg, .tbl .dwv svg { width: 24px; height: 24px; }
.row__veh .dwv__tag, .tbl .dwv__tag, .card-btn__veh .dwv__tag { display: none; }

/* Tuiles : même rendu sombre pour la partie et l'aperçu */
.dw-tiles { filter: invert(1) hue-rotate(185deg) brightness(.92) contrast(.88) saturate(.55); }
.leaflet-container { background: #1A2A36; font-family: var(--f); }
.leaflet-control-attribution { background: rgba(15, 27, 38, .75) !important; color: var(--muted) !important; font-size: 11px; }
.leaflet-control-attribution a { color: #9CC9FF !important; }
.leaflet-bar a { background: var(--panel) !important; color: var(--text) !important; border-color: var(--line) !important; }

/* ===================================================================== AUTH */
.page-auth { min-height: 100%; background: radial-gradient(1200px 600px at 10% -10%, #1B3346 0%, transparent 60%), var(--bg); }
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr minmax(320px, 440px); gap: clamp(1.5rem, 5vw, 5rem); align-items: center; max-width: 1180px; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 3rem); }
.auth__title { font: 700 clamp(2rem, 4.6vw, 3.4rem)/1.05 var(--fc); margin: 2rem 0 1rem; color: var(--hi); max-width: 16ch; }
.auth__lead { color: var(--muted); font-size: 1.1rem; max-width: 52ch; }
.auth__svc { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; gap: .6rem; flex-wrap: wrap; }
.auth__svc li { font: 700 .95rem var(--fc); letter-spacing: .06em; padding: .45rem .9rem .45rem .75rem; border-radius: 4px; border: 1px solid var(--line-2); border-left: 6px solid var(--svc); background: var(--panel); }
.auth__card { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 1.4rem; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.auth__card form { margin-top: 1.2rem; }
.auth__fine { color: var(--dim); font-size: .82rem; margin: 1rem 0 0; }
.form-err { color: #FFB3AD; margin: 0; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth__title { margin-top: 1rem; } }

/* ===================================================================== LOADING */
.loading-root { position: fixed; inset: 0; z-index: 1500; background: var(--bg); transition: opacity .35s; }
.loading-root.is-leaving { opacity: 0; pointer-events: none; }
.ls { height: 100%; display: grid; grid-template-rows: auto 1fr auto; }
.ls-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem clamp(1rem, 3vw, 2rem); border-bottom: 1px solid var(--line); }
.ls-brand { display: flex; align-items: center; gap: .7rem; font: 700 1.25rem var(--fc); color: var(--hi); }
.ls-brand__mark { width: 26px; height: 26px; border-radius: 6px; background: conic-gradient(from 225deg, var(--police) 0 50%, var(--fire) 50% 100%); box-shadow: inset 0 0 0 4px var(--bg); outline: 1px solid var(--line-2); }
.ls-brand__ver { font: 500 .85rem var(--f); color: var(--muted); margin-left: .25rem; }
.ls-meta { display: flex; gap: 1rem; color: var(--muted); font: 600 1rem var(--fc); font-variant-numeric: tabular-nums; }
/* Gyrophare : fin liseré bleu/rouge qui balaie le bas de l'en-tête */
.ls-beacon { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, transparent 0%, var(--police) 20%, transparent 40%, transparent 60%, var(--fire) 80%, transparent 100%); background-size: 200% 100%; animation: sweep 2.4s linear infinite; opacity: .8; }
.ls.no-beacons .ls-beacon { display: none; }
@keyframes sweep { from { background-position: 0 0; } to { background-position: -200% 0; } }
.ls-main { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; min-height: 0; }
.ls-left { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--bg-2); }
.ls-steps { list-style: none; margin: 0; padding: .8rem 1rem; display: flex; flex-direction: column; gap: .15rem; }
.ls-step { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .38rem .2rem; font-size: .95rem; border-bottom: 1px dashed rgba(54, 84, 107, .5); }
.ls-step small { display: block; color: var(--dim); font-size: .78rem; }
.ls-step--optional { margin-top: .4rem; border-bottom: 0; }
.chip { flex: none; font: 600 .8rem var(--fc); padding: .15rem .55rem; border-radius: 4px; border: 1px solid var(--line-2); color: var(--muted); min-width: 78px; text-align: center; }
.chip--run { color: #9CC9FF; border-color: #3E6A93; animation: pulse 1.2s ease-in-out infinite; }
.chip--ok { color: var(--ok); border-color: rgba(90, 208, 138, .5); }
.chip--warn { color: var(--warn); border-color: rgba(242, 179, 61, .55); }
.chip--err { color: #FF9B94; border-color: rgba(240, 82, 74, .7); background: rgba(240, 82, 74, .12); }
.chip--off { color: var(--dim); }
@keyframes pulse { 50% { opacity: .45; } }
.ls-log { flex: 1; min-height: 120px; overflow-y: auto; padding: .6rem 1rem 1rem; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.ls-line { display: grid; grid-template-columns: 64px 1fr; gap: .5rem; padding: .12rem 0; }
.ls-line time { color: var(--dim); font-variant-numeric: tabular-nums; }
.ls-line--ok span { color: #BFE9CF; } .ls-line--warn span { color: #F7D59A; } .ls-line--err span { color: #FFB3AD; }
.ls-map-wrap { position: relative; min-height: 0; }
.ls-map { position: absolute; inset: 0; }
.ls-ticker { position: absolute; z-index: 500; top: .8rem; left: .8rem; display: flex; flex-direction: column; gap: .4rem; width: min(300px, calc(100% - 1.6rem)); pointer-events: none; }
.ls-tick { display: grid; grid-template-columns: auto 1fr; gap: 0 .6rem; background: rgba(19, 34, 48, .88); border: 1px solid var(--line); border-left: 4px solid var(--svc); border-radius: var(--r-sm); padding: .4rem .7rem; font-size: .85rem; animation: slidein .35s ease-out; }
.ls-tick b { font: 700 .8rem var(--fc); color: var(--svc); grid-row: span 2; align-self: center; }
.ls-tick small { color: var(--muted); }
@keyframes slidein { from { opacity: 0; transform: translateY(-6px); } }
.ls-map-note { position: absolute; z-index: 500; left: .8rem; right: .8rem; bottom: .8rem; background: rgba(19, 34, 48, .92); border: 1px solid rgba(242, 179, 61, .5); color: #F7D59A; padding: .5rem .8rem; border-radius: var(--r-sm); font-size: .88rem; }
.ls-foot { display: grid; grid-template-columns: 1fr auto; gap: 1.25rem; align-items: center; padding: .9rem clamp(1rem, 3vw, 2rem) calc(.9rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--bg-2); }
.ls-progress { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; min-width: 0; }
.ls-bar { height: 10px; background: var(--panel-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.ls-bar__fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--police), #8FB9FF); transition: width .4s ease; }
.ls.is-error .ls-bar__fill { background: var(--err); }
.ls-pct { display: flex; flex-direction: column; align-items: flex-end; min-width: 150px; }
.ls-pct strong { font: 700 1.6rem/1 var(--fc); font-variant-numeric: tabular-nums; color: var(--hi); }
.ls-pct__note { color: var(--muted); font-size: .82rem; max-width: 240px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-actions { display: flex; gap: .6rem; }
.btn--start { min-height: 52px; padding: .6rem 1.6rem; font: 700 1.1rem var(--fc); letter-spacing: .03em; }
.btn--start.is-ready { background: var(--hi); color: var(--bg); border-color: var(--hi); box-shadow: 0 0 0 4px rgba(238, 243, 247, .12); }
@media (max-width: 820px) {
  .ls-main { grid-template-columns: 1fr; grid-template-rows: 38vh 1fr; }
  .ls-map-wrap { grid-row: 1; }
  .ls-left { grid-row: 2; border-right: 0; border-top: 1px solid var(--line); overflow-y: auto; }
  .ls-log { min-height: 90px; }
  .ls-foot { grid-template-columns: 1fr; gap: .7rem; }
  .ls-actions { justify-content: stretch; }
  .ls-actions .btn { flex: 1; }
  .ls-meta .ls-weather, .ls-brand__ver { display: none; }
  .ls-brand { font-size: 1.05rem; white-space: nowrap; }
}

/* ===================================================================== JEU */
.page-play { overflow: hidden; }
.game { position: fixed; inset: 0; display: grid; grid-template-rows: var(--top) 1fr var(--nav); padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.topbar { display: flex; align-items: center; gap: 1rem; padding: 0 .9rem; background: var(--bg-2); border-bottom: 1px solid var(--line); min-width: 0; z-index: 1000; }
.topbar--page { height: var(--top); position: sticky; top: 0; justify-content: space-between; }
.topbar .brand__name { white-space: nowrap; }
.stats { display: flex; gap: .4rem; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.stat { display: flex; flex-direction: column; justify-content: center; padding: .15rem .7rem; border-left: 1px solid var(--line); background: none; border-top: 0; border-right: 0; border-bottom: 0; text-align: left; color: var(--text); white-space: nowrap; }
.stat b { font: 700 1.05rem/1.1 var(--fc); font-variant-numeric: tabular-nums; }
.stat__k { font-size: .72rem; color: var(--muted); }
.stat--money, .stat--level, .stat--rep { cursor: pointer; border-radius: var(--r-sm); }
.stat--money:hover, .stat--level:hover, .stat--rep:hover { background: var(--panel); }
.stat--money b { color: var(--hi); }
.stat--auto b { color: var(--ok); }
.stat--route b { color: var(--warn); }
.pend { display: block; color: var(--warn); font-size: .78rem; }
.pend-note { background: rgba(242, 179, 61, .1); border: 1px solid rgba(242, 179, 61, .45); color: #F7D59A; border-radius: var(--r-sm); padding: .55rem .7rem; font-size: .86rem; margin-bottom: .5rem; }
.xpbar { display: block; width: 72px; height: 4px; background: var(--panel-2); border-radius: 2px; margin-top: 4px; overflow: hidden; }
.xpbar i { display: block; height: 100%; background: var(--ems); }
.topbar__right { display: flex; align-items: center; gap: .5rem; }
.clock { font: 600 1rem var(--fc); font-variant-numeric: tabular-nums; color: var(--muted); }
.conn { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--muted); }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.conn.is-down i { background: var(--err); animation: pulse 1s infinite; }
.conn.is-down { color: #FFB3AD; }
body.is-paused .clock::after { content: ' · en pause'; color: var(--warn); }

.stage { position: relative; min-height: 0; display: grid; grid-template-columns: 1fr var(--panel-w); }
.map { position: relative; min-height: 0; z-index: 0; isolation: isolate; }
.map.is-placing, .map.is-placing .leaflet-interactive { cursor: crosshair !important; }
.build-banner { position: absolute; z-index: 900; top: .8rem; left: 50%; transform: translateX(-50%); display: flex; gap: .8rem; align-items: center; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: .5rem .6rem .5rem 1rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); max-width: calc(100% - 1.6rem); }

.panel { position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--bg-2); border-left: 1px solid var(--line); z-index: 950; }
.panel__grip { display: none; }
.panel__tabs { display: flex; border-bottom: 1px solid var(--line); }
.panel__tabs button { flex: 1; border: 0; background: none; padding: .8rem .5rem; color: var(--muted); font: 600 .98rem var(--fc); cursor: pointer; border-bottom: 2px solid transparent; min-height: 48px; }
.panel__tabs button[aria-selected=true] { color: var(--hi); border-bottom-color: var(--hi); }
.badge { display: inline-block; min-width: 22px; padding: 0 .35rem; border-radius: 999px; background: var(--fire); color: #fff; font-size: .78rem; margin-left: .25rem; }
.panel__body { flex: 1; overflow-y: auto; padding: .8rem; overscroll-behavior: contain; }

.call-item { display: block; width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--svc); border-radius: var(--r-sm); padding: .65rem .8rem; margin-bottom: .55rem; cursor: pointer; color: var(--text); }
.call-item:hover { border-color: var(--line-2); background: var(--panel-2); }
.call-item.is-working { opacity: .82; }
.call-item__top { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.call-item__top b { font-weight: 600; }
.call-item__addr { display: block; color: var(--muted); font-size: .86rem; margin: .1rem 0 .4rem; }
.call-item__req { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.reward { margin-left: auto; color: var(--ems); font: 600 .9rem var(--fc); }
.timer { font: 700 .95rem var(--fc); font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.timer.is-urgent { color: var(--err); }
.timer--work { color: var(--ok); font-size: .85rem; }
.req { font: 600 .75rem var(--fc); padding: .1rem .45rem; border-radius: 3px; border: 1px solid var(--svc); color: var(--svc); }
.req--full { background: var(--svc); color: #0B141C; }
.req--coming { background: color-mix(in srgb, var(--svc) 22%, transparent); }

.row { display: grid; grid-template-columns: 28px 1fr auto; gap: .6rem; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: .55rem .2rem; cursor: pointer; color: var(--text); }
.row:hover { background: var(--panel); }
.row__dot { width: 12px; height: 12px; border-radius: 3px; background: var(--svc); justify-self: center; }
.row__main { display: flex; flex-direction: column; min-width: 0; }
.row__main small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__side { text-align: right; font-size: .85rem; color: var(--muted); }
.st { font: 600 .78rem var(--fc); padding: .08rem .45rem; border-radius: 3px; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.st--available { color: var(--ok); }
.st--enroute { color: #9CC9FF; background: rgba(62, 139, 255, .15); }
.st--onscene { color: #fff; background: rgba(255, 255, 255, .12); }
.st--returning { color: var(--muted); }
.st--route_pending { color: var(--warn); background: rgba(242, 179, 61, .14); }
.counts { display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-size: .8rem; color: var(--muted); margin: 0 0 .5rem; }
.counts b { color: var(--text); }
.allied-note { color: var(--muted); font-size: .85rem; padding: .8rem .2rem; }
.radio { list-style: none; margin: 0; padding: 0; }
.radio__item { display: grid; grid-template-columns: 50px 1fr; gap: .5rem; padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.radio__item time { color: var(--dim); font-variant-numeric: tabular-nums; }
.radio--call span { color: #FFC9C5; } .radio--done span { color: #BFE9CF; } .radio--expired span { color: #F7D59A; } .radio--routing span { color: #F7D59A; }

.bottomnav { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--bg-2); border-top: 1px solid var(--line); z-index: 1000; }
.nav-btn { border: 0; background: none; color: var(--muted); font: 700 .92rem var(--fc); letter-spacing: .04em; cursor: pointer; border-top: 3px solid var(--svc, transparent); min-height: 44px; }
.nav-btn:hover { color: var(--hi); background: var(--panel); }
.nav-btn[data-nav=calls] { color: var(--fire); }

/* Marqueurs bâtiments / appels */
.bld-wrap, .call-wrap { background: none; border: 0; }
.bld { width: 34px; height: 34px; border-radius: 7px; background: #0B141C; border: 2px solid var(--svc); display: grid; place-items: center; position: relative; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.bld span { font: 700 14px var(--fc); color: var(--svc); }
.bld em { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); font: 600 10px/1 var(--fc); font-style: normal; background: var(--svc); color: #0B141C; padding: 2px 4px; border-radius: 3px; white-space: nowrap; }
.callpin { width: 30px; height: 38px; position: relative; }
.callpin::before { content: ''; position: absolute; left: 3px; top: 0; width: 24px; height: 24px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--svc); border: 2px solid #0B141C; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.callpin span { position: absolute; left: 0; right: 0; top: 3px; text-align: center; font: 800 14px var(--fc); color: #0B141C; }
.callpin.is-pending::after { content: ''; position: absolute; left: 3px; top: 0; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--svc); animation: ring 1.6s ease-out infinite; }
.callpin.is-working::before { background: #fff; border-color: var(--svc); }
@keyframes ring { from { transform: scale(1); opacity: .9; } to { transform: scale(2.2); opacity: 0; } }
.map.is-locked .leaflet-control-zoom { opacity: .4; pointer-events: none; }

/* Modale appel */
.callm__info { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: .8rem 1rem; margin-bottom: 1rem; }
.callm__info > div { display: flex; flex-direction: column; gap: .2rem; }
.callm__info b { font: 600 1.05rem var(--fc); }
.alist { list-style: none; margin: 0 0 1rem; padding: 0; }
.arow { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.arow .btn { margin-left: auto; }
.pickgroup { border: 1px solid var(--line); border-left: 4px solid var(--svc); border-radius: var(--r-sm); padding: .4rem .8rem .6rem; margin: 0 0 .8rem; }
.pickgroup legend { font: 700 .95rem var(--fc); color: var(--svc); padding: 0 .3rem; }
.pick { display: grid; grid-template-columns: 22px 26px auto 1fr auto; gap: .6rem; align-items: center; padding: .45rem .2rem; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick:last-child { border-bottom: 0; }
.pick small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dist { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .7rem; }
.card-btn { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; text-align: left; padding: .9rem; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); border-top: 4px solid var(--svc); cursor: pointer; color: var(--text); min-height: 120px; }
.card-btn:hover:not(:disabled) { background: var(--panel-2); }
.card-btn:disabled { opacity: .45; cursor: not-allowed; }
.card-btn b { font: 700 1.05rem var(--fc); }
.card-btn small { color: var(--muted); }
.menu { display: flex; flex-direction: column; }
.menu > * { display: block; text-align: left; padding: .9rem .4rem; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); font-size: 1.05rem; text-decoration: none; cursor: pointer; }
.menu > *:hover { background: var(--panel-2); }
.menu__danger { color: #FF9B94 !important; }
.price { margin: 0; border: 1px solid var(--line); border-radius: var(--r-sm); }
.price > div { display: flex; justify-content: space-between; padding: .5rem .8rem; border-bottom: 1px solid var(--line); }
.price > div:last-child { border-bottom: 0; }
.price dt { color: var(--muted); } .price dd { margin: 0; font-variant-numeric: tabular-nums; }
.price__total dd { font: 700 1.25rem var(--fc); color: var(--hi); }

/* Niveaux */
.lvl-head { display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; align-items: center; margin-bottom: 1rem; }
.lvl-badge { width: 92px; height: 92px; border-radius: 14px; border: 2px solid var(--ems); display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg-2); }
.lvl-badge span { font-size: .78rem; color: var(--muted); }
.lvl-badge b { font: 700 2.4rem/1 var(--fc); color: var(--ems); }
.lvl-prog__top { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .4rem; }
.lvl-prog__top span { color: var(--muted); }
.lvl-prog .obj__bar i { background: var(--ems); }
.box--next { border-color: rgba(242, 194, 48, .55); background: linear-gradient(180deg, rgba(242, 194, 48, .08), transparent 70%), var(--panel); }
.gains { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.gain { display: grid; grid-template-columns: 30px 1fr; gap: .6rem; align-items: center; }
.gain i { font: 700 .78rem var(--fc); font-style: normal; width: 30px; height: 24px; border-radius: 4px; display: grid; place-items: center; background: var(--panel-2); color: var(--muted); }
.gain--reward i { color: var(--ems); } .gain--discount i { color: var(--ok); } .gain--capacity i { color: #9CC9FF; }
.gain--calls i { color: var(--fire); } .gain--unlock i { color: var(--hi); } .gain--bank i { color: var(--gcsr); }
.kpis--tight { margin-bottom: 0; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.lvl-list { list-style: none; margin: 0; padding: 0; }
.lvl { display: grid; grid-template-columns: 70px 1fr; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.lvl:last-child { border-bottom: 0; }
.lvl__n { display: flex; flex-direction: column; }
.lvl__n b { font: 700 1.4rem/1 var(--fc); }
.lvl__n small { color: var(--dim); font-size: .78rem; }
.lvl--done { opacity: .55; }
.lvl--locked .gains { color: var(--muted); }
.lvl--current .lvl__n b { color: var(--ems); }
.lvl__tag { display: inline-block; font: 600 .75rem var(--fc); padding: .1rem .5rem; border-radius: 3px; background: var(--ems); color: #0B141C; margin-bottom: .4rem; }
.lvl__tag--next { background: transparent; color: var(--ems); border: 1px solid var(--ems); }
@media (max-width: 560px) { .lvl-head { grid-template-columns: 1fr; } .lvl-badge { width: 72px; height: 72px; } }

/* Banque */
.kpi--score b { font-size: 1.6rem; }
.kpi--good b { color: var(--ok); } .kpi--mid b { color: var(--warn); } .kpi--low b { color: var(--err); }
.gauge { height: 5px; background: var(--panel-2); border-radius: 3px; overflow: hidden; margin-top: .3rem; }
.gauge i { display: block; height: 100%; background: currentColor; }
.kpi--good .gauge i { background: var(--ok); } .kpi--mid .gauge i { background: var(--warn); } .kpi--low .gauge i { background: var(--err); }
.loanform { display: flex; flex-direction: column; gap: .7rem; }
.seg--terms button { flex: 1; min-width: 80px; }
.loanform__sum { margin: 0; font-size: 1.05rem; }
.loan { display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.loan > div { display: flex; flex-direction: column; }
.loan small { color: var(--muted); }
.loan--overdue b { color: var(--err); }
.loan__pay { flex-direction: row !important; gap: .4rem; align-items: center; }
.loan__pay input { width: 130px; }
@media (max-width: 640px) { .loan { grid-template-columns: 1fr; } }

/* Alliance */
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); margin: -.3rem 0 1rem; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; color: var(--muted); padding: .6rem .8rem; font: 600 .95rem var(--fc); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; min-height: 44px; }
.tabs button[aria-selected=true] { color: var(--hi); border-bottom-color: var(--hi); }
.slotgroup h4 { font: 600 .85rem var(--fc); color: var(--muted); margin: 1rem 0 .4rem; }
.city { border: 1px solid var(--line); border-radius: var(--r-sm); padding: .6rem .7rem; margin-bottom: .5rem; }
.city__head { display: flex; justify-content: space-between; margin-bottom: .4rem; }
.occ { color: var(--muted); font-variant-numeric: tabular-nums; }
.slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .35rem; }
.slot { border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); border-radius: 4px; padding: .45rem .5rem; font-size: .85rem; cursor: pointer; text-align: left; min-height: 38px; }
.slot:hover { border-color: var(--hi); }
.slot.is-taken { opacity: .45; cursor: default; display: flex; align-items: center; }
.trophy { margin-left: .2rem; }
.mgmt { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; min-width: 300px; }
.mgmt label { display: inline-flex; gap: .25rem; align-items: center; font-size: .85rem; }
.mgmt select { min-height: 34px; padding: .2rem .4rem; }
.obj { margin-bottom: 1rem; }
.obj__head { display: flex; justify-content: space-between; margin-bottom: .35rem; }
.obj__head span { color: var(--muted); font-variant-numeric: tabular-nums; }
.obj__bar { height: 10px; background: var(--panel-2); border-radius: 5px; overflow: hidden; }
.obj__bar i { display: block; height: 100%; background: var(--ok); }

/* Jeu : mobile — le panneau devient un tiroir */
@media (max-width: 900px) {
  :root { --top: 52px; --nav: 56px; }
  .stage { grid-template-columns: 1fr; }
  .panel { position: absolute; left: 0; right: 0; bottom: 0; height: 64%; border-left: 0; border-top: 1px solid var(--line-2); border-radius: var(--r-lg) var(--r-lg) 0 0; transform: translateY(calc(100% - 48px)); transition: transform .25s ease; box-shadow: 0 -10px 30px rgba(0, 0, 0, .4); }
  .panel.is-open { transform: none; }
  .panel__grip { display: block; position: absolute; top: -14px; left: 50%; transform: translateX(-50%); width: 80px; height: 28px; cursor: pointer; }
  .panel__grip::after { content: ''; position: absolute; left: 22px; right: 22px; top: 18px; height: 4px; border-radius: 2px; background: var(--line-2); }
  .brand__name, .clock, .conn span { display: none; }
  .stat { padding: .1rem .5rem; }
  .nav-btn { font-size: .78rem; letter-spacing: 0; }
  .xpbar { width: 48px; }
}

/* ===================================================================== PAGES */
.statspage, .admin { max-width: 1180px; margin: 0 auto; padding: 1.5rem clamp(1rem, 3vw, 2rem) 4rem; }
.statspage__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.statspage__head h1 { margin: 0; }
.pagenav { display: flex; gap: 1rem; }
.pagenav a { color: var(--muted); text-decoration: none; }
.pagenav a:hover { color: var(--hi); }
.chart svg { width: 100%; height: 180px; display: block; }
.chart .axis { fill: var(--dim); font: 10px var(--f); }
.legend { display: flex; gap: 1rem; font-size: .85rem; color: var(--muted); margin-top: .4rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; }
.admin { display: grid; grid-template-columns: 200px 1fr; gap: 2rem; }
.admin__sec { grid-column: 2; min-width: 0; }
.admin__nav { grid-column: 1; grid-row: 1 / span 2; position: sticky; top: calc(var(--top) + 1.5rem); align-self: start; display: flex; flex-direction: column; gap: .2rem; }
.admin__nav a { color: var(--muted); text-decoration: none; padding: .5rem .7rem; border-radius: var(--r-sm); }
.admin__nav a:hover { background: var(--panel); color: var(--hi); }
.admin__sec { scroll-margin-top: calc(var(--top) + 1rem); margin-bottom: 2.5rem; }
.total-line { margin: .25rem 0; }
.srv-list { margin: .5rem 0 0; padding-left: 1.1rem; }
.srv-list small { color: var(--muted); display: block; }
[data-routing-out] { flex-basis: 100%; }
.actions--sticky { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 35%); padding: 1.2rem 0 .8rem; }
@media (max-width: 760px) { .admin { grid-template-columns: 1fr; } .admin__nav { grid-row: auto; position: static; flex-direction: row; flex-wrap: wrap; } .admin__sec { grid-column: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ===================================================================== v3 : appels, vitesse, construction, menu */
.prio { flex: none; font: 700 .72rem/1 var(--fc); padding: .22rem .38rem; border-radius: 3px; margin-right: .45rem; background: var(--panel-2); color: var(--muted); }
.prio--1 { background: var(--err); color: #fff; }
.prio--2 { background: rgba(242, 179, 61, .2); color: var(--warn); }
.call-item__top { justify-content: flex-start; }
.call-item__top .timer { margin-left: auto; }
.call-item__addr.is-pending, .callm__addr small { color: var(--dim); font-style: italic; }
.reward.is-decaying { color: var(--warn); }
.reward.is-negative { color: var(--err); }
.tag { font: 600 .78rem var(--fc); padding: .15rem .55rem; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text); background: var(--panel-2); }
.callm__addr { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: .7rem; }
.callm__addr b { font: 600 1.15rem/1.25 var(--fc); }
.callm__addr small { display: block; }
.callm__addr .prio { margin-top: .2rem; }
.callm__desc { margin: 0 0 .7rem; padding: .7rem .9rem; border-left: 3px solid var(--line-2); background: var(--bg-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--text); font-size: .98rem; }
.lv { font: 600 .72rem var(--fc); color: var(--muted); border: 1px solid var(--line-2); border-radius: 3px; padding: 0 .3rem; margin-left: .25rem; }
.spd { color: #9CC9FF; font-variant-numeric: tabular-nums; }

/* Construction */
.steps3 { list-style: none; display: flex; gap: .4rem; padding: 0; margin: 0 0 .9rem; font: 600 .82rem var(--fc); color: var(--dim); }
.steps3 li { flex: 1; padding: .3rem .5rem; border-bottom: 2px solid var(--line); }
.steps3 li.is-on { color: var(--hi); border-bottom-color: var(--hi); }
.cards--build .card-btn { min-height: 0; gap: .35rem; }
.card-btn__top { display: flex; align-items: center; gap: .5rem; }
.card-btn__price { font: 700 1.2rem var(--fc); color: var(--hi); }
.placebar { position: absolute; z-index: 940; left: .8rem; bottom: .8rem; width: min(520px, calc(100% - var(--panel-w) - 1.6rem)); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: .9rem 1rem; box-shadow: 0 16px 40px rgba(0, 0, 0, .45); display: flex; flex-direction: column; gap: .6rem; }
.placebar .steps3 { margin: 0; }
.placebar__row { display: flex; gap: .6rem; align-items: center; }
.placebar__row input { flex: 1; min-height: 44px; padding: .5rem .75rem; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); min-width: 0; }
.placebar__row .btn { flex: 1; }
.placebar__what { display: flex; flex-direction: column; min-width: 140px; }
.placebar__what span { color: var(--muted); font-size: .9rem; }
.placebar__msg { margin: 0; color: var(--muted); font-size: .9rem; }
.placebar__msg.is-bad { color: #FFB3AD; }
.crosshair { position: absolute; z-index: 650; left: 50%; top: 50%; width: 44px; height: 44px; margin: -44px 0 0 -22px; pointer-events: none; }
.crosshair i { position: absolute; inset: 0; border-radius: 50% 50% 50% 0; transform: rotate(-45deg) scale(.82); background: #0B141C; border: 3px solid var(--svc); box-shadow: 0 4px 12px rgba(0, 0, 0, .5); }
.crosshair span { position: absolute; inset: 0; display: grid; place-items: center; font: 700 15px var(--fc); color: var(--svc); }
.crosshair::after { content: ''; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--svc); box-shadow: 0 0 0 4px rgba(11, 20, 28, .6); }
.crosshair.is-bad i { border-color: var(--err); }
.crosshair.is-bad span { color: var(--err); }
.bhead { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; padding: .8rem 1rem; background: var(--bg-2); border: 1px solid var(--line); border-top: 4px solid var(--svc); border-radius: var(--r); }
.bhead > div { display: flex; flex-direction: column; }
.bhead b { font: 700 1.25rem var(--fc); }
.actions--left { justify-content: flex-start; align-items: center; }
.upall { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: end; }
.upall p { margin: .2rem 0 .6rem; }
.upall .price { max-width: 420px; }

/* Menu */
.menu2__h { font: 600 .8rem var(--fc); color: var(--muted); letter-spacing: .04em; margin: 1rem 0 .5rem; }
.menu2__h:first-child { margin-top: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .6rem; }
.tile { display: flex; flex-direction: column; gap: .2rem; text-align: left; padding: .85rem .95rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); color: var(--text); text-decoration: none; cursor: pointer; min-height: 84px; }
.tile:hover { background: var(--panel-2); border-color: var(--line-2); }
.tile b { font: 700 1.05rem var(--fc); color: var(--hi); }
.tile span { color: var(--muted); font-size: .86rem; }
.tile em { font-style: normal; font: 600 .8rem var(--fc); color: var(--ems); margin-top: auto; }
.menu2__foot { display: flex; justify-content: space-between; gap: .6rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.lvl-badge--rep { border-color: var(--gcsr); }
.lvl-badge--rep b { color: var(--gcsr); font-size: 1.8rem; }
.obj__bar--rep i { background: var(--gcsr) !important; }

@media (max-width: 900px) {
  .placebar { left: .5rem; right: .5rem; width: auto; bottom: .5rem; }
  body.is-placing .panel { display: none; }
  .upall { grid-template-columns: 1fr; }
  .placebar__row { flex-wrap: wrap; }
}

/* ===================================================================== v4 : interface pro, mobile d'abord */
html { -webkit-text-size-adjust: 100%; }
button, a, [role=button] { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.page-play { overscroll-behavior: none; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Coquille */
.game { grid-template-rows: var(--top) 1fr; }
.bottomnav { display: none; }
.topbar { gap: .75rem; padding: 0 .75rem 0 .9rem; }
.hud { display: flex; align-items: center; gap: .25rem; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.hud::-webkit-scrollbar { display: none; }
.hud__item { display: flex; flex-direction: column; justify-content: center; gap: 1px; min-height: 44px; padding: .2rem .7rem; border: 0; background: none; border-radius: var(--r-sm); text-align: left; cursor: pointer; white-space: nowrap; color: var(--text); }
.hud__item:hover { background: var(--panel); }
.hud__item b { font: 700 1.05rem/1.1 var(--fc); font-variant-numeric: tabular-nums; }
.hud__money b { color: var(--hi); }
.hud__money.is-neg b { color: var(--err); }
.hud__k { font-size: .72rem; color: var(--muted); }
.hud__lvl { flex-direction: row; align-items: center; gap: .5rem; }
.ring { --p: 0; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--ems) calc(var(--p) * 1%), var(--panel-2) 0); }
.ring b { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-2); display: grid; place-items: center; font: 700 .95rem var(--fc); color: var(--hi); }
.pill { flex: none; font: 600 .78rem var(--fc); padding: .3rem .6rem; border-radius: 999px; white-space: nowrap; }
.pill--ok { background: rgba(90, 208, 138, .15); color: var(--ok); }
.pill--warn { background: rgba(242, 179, 61, .15); color: var(--warn); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; }
.stage { grid-template-columns: 1fr var(--panel-w); }

/* Boutons flottants sur la carte */
.fabs { position: absolute; z-index: 920; top: .8rem; right: calc(var(--panel-w) + .8rem); display: flex; flex-direction: column; gap: .5rem; }
.fab { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line-2); color: var(--text); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); cursor: pointer; }
.fab:hover { background: var(--panel-2); }
.paused-banner { position: absolute; z-index: 925; top: .8rem; left: 50%; transform: translateX(calc(-50% - var(--panel-w) / 2)); display: flex; align-items: center; gap: .7rem; background: rgba(242, 179, 61, .16); border: 1px solid rgba(242, 179, 61, .6); color: #F7D59A; border-radius: 999px; padding: .35rem .4rem .35rem 1rem; font-weight: 600; backdrop-filter: blur(6px); }

/* Panneau (ordinateur) */
.panel__grip { display: none; }
.panel__tabs button { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; }

/* Cartes d'appel */
.call-item { cursor: pointer; }
.call-item:focus-visible { outline: 2px solid #9CC9FF; }
.call-item__acts { display: flex; margin-top: .55rem; }
.btn--quick { width: 100%; min-height: 40px; gap: .4rem; background: color-mix(in srgb, var(--svc) 16%, var(--panel-2)); border-color: color-mix(in srgb, var(--svc) 55%, transparent); }
.btn--quick .ico { width: 18px; height: 18px; }
.btn--quick:disabled { background: transparent; }
.actions--foot { position: sticky; bottom: -1.1rem; margin: 1rem -1.1rem -1.1rem; padding: .8rem 1.1rem calc(.8rem + env(safe-area-inset-bottom, 0px)); background: linear-gradient(transparent, var(--panel) 30%); }

/* Modales : poignée visible seulement sur mobile */
.modal__grab { display: none; }
.modal { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }

/* ------------------------------------------------------------------ MOBILE */
@media (max-width: 900px) {
  :root { --top: 56px; --nav: 64px; }
  .game { grid-template-rows: calc(var(--top) + env(safe-area-inset-top, 0px)) 1fr calc(var(--nav) + env(safe-area-inset-bottom, 0px)); padding: 0; }
  .topbar { padding: env(safe-area-inset-top, 0px) .4rem 0 .5rem; gap: .25rem; }
  .brand, .clock, .icon-btn--desk, .conn span { display: none !important; }
  .hud { gap: 0; }
  .hud__item { padding: .2rem .5rem; }
  .hud__k--side { display: none; }
  .ring { width: 34px; height: 34px; }
  .conn { padding: 0 .4rem; }
  .conn i { width: 10px; height: 10px; }
  .stage { grid-template-columns: 1fr; }
  .fabs { right: .7rem; top: .7rem; }
  .paused-banner { transform: translateX(-50%); top: .7rem; max-width: calc(100% - 5rem); }

  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--bg-2); border-top: 1px solid var(--line); }
  .nav-btn { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; color: var(--muted); font: 600 .72rem var(--f); letter-spacing: 0; min-height: var(--nav); }
  .nav-btn.is-on { color: var(--hi); }
  .nav-btn.is-on::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--hi); }
  .nav-btn .badge { position: absolute; top: 7px; left: calc(50% + 6px); margin: 0; font: 700 .7rem/1.35 var(--fc); }
  .nav-btn[data-nav=calls] { color: var(--muted); }
  .nav-btn[data-nav=calls].is-on { color: var(--hi); }

  /* Tiroir à trois hauteurs */
  .panel, .panel[data-sheet] { position: absolute; top: 0; bottom: 0; left: 0; right: 0; height: auto; z-index: 950;
    border-left: 0; border-top: 1px solid var(--line-2); border-radius: 18px 18px 0 0; box-shadow: 0 -12px 34px rgba(0, 0, 0, .45);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1); will-change: transform; }
  .panel[data-sheet=peek] { transform: translateY(calc(100% - 104px)); }
  .panel[data-sheet=half] { transform: translateY(45%); }
  .panel[data-sheet=full] { transform: translateY(8px); }
  .panel.is-dragging { transition: none; }
  .panel__grip { display: grid; place-items: center; height: 24px; cursor: grab; touch-action: none; position: static; transform: none; width: auto; }
  .panel__grip::after { display: none; }
  .panel__grip span { width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); }
  .panel__tabs { touch-action: none; }
  .panel[data-sheet=half] .panel__body { padding-bottom: 45vh; }
  .panel__body { padding: .6rem .7rem 1.2rem; }
  body.is-placing .panel { display: none; }

  .call-item { padding: .75rem .85rem; border-radius: 10px; }
  .call-item__top b { font-size: 1rem; }
  .row { min-height: 56px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -.7rem; margin-right: -.7rem; padding: 0 .7rem; }
  .chips::-webkit-scrollbar { display: none; }
  .fchip { flex: none; min-height: 38px; }

  .placebar { bottom: .6rem; }
  .toasts { left: .6rem; right: .6rem; max-width: none; bottom: calc(var(--nav) + env(safe-area-inset-bottom, 0px) + .6rem); align-items: stretch; }
  input, select, textarea { font-size: 16px !important; } /* évite le zoom automatique d'iOS */
}

/* Modales en feuille plein écran sur téléphone */
@media (max-width: 640px) {
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal, .modal--wide { width: 100%; max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 12px); border-radius: 18px 18px 0 0; border-bottom: 0;
    animation: sheetin .26s cubic-bezier(.2, .8, .2, 1); transition: transform .2s; }
  @keyframes sheetin { from { transform: translateY(40%); opacity: .4; } }
  .modal__grab { display: grid; place-items: center; height: 20px; touch-action: none; }
  .modal__grab span { width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); }
  .modal__head { padding: .2rem .9rem .7rem; touch-action: none; }
  .modal__title { font-size: 1.15rem; }
  .modal__body { padding: .9rem .9rem calc(1rem + env(safe-area-inset-bottom, 0px)); }
  .actions--foot { margin: 1rem -.9rem calc(-1rem - env(safe-area-inset-bottom, 0px)); padding-left: .9rem; padding-right: .9rem; bottom: calc(-1rem - env(safe-area-inset-bottom, 0px)); }
  .btn--block-m { width: 100%; min-height: 52px; font-size: 1.05rem; }
  .actions { gap: .5rem; }
  .actions > .btn { flex: 1 1 auto; }
  .callm__info { grid-template-columns: 1fr 1fr; gap: .6rem; padding: .7rem .8rem; }
  .callm__info > div:last-child { grid-column: 1 / -1; }
  .pick { grid-template-columns: 24px 26px 1fr auto; min-height: 52px; }
  .pick small { display: none; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile { min-height: 96px; }
  .bank__top, .kpis { grid-template-columns: 1fr 1fr; }
  .tbl { font-size: .86rem; }
  .menu2__foot { flex-direction: column-reverse; }
  .menu2__foot .btn { width: 100%; }
  .lvl-head { grid-template-columns: auto 1fr; gap: .8rem; }
  .lvl-badge { width: 72px; height: 72px; }
  .lvl-badge b { font-size: 1.9rem; }
}

/* Écran de chargement : version téléphone plus compacte */
.ls-step__err { flex-basis: 100%; margin: .2rem 0 .1rem; color: #FFB3AD; font-size: .84rem; line-height: 1.35; }
.ls-step { flex-wrap: wrap; }
@media (max-width: 820px) {
  .ls-top { padding: calc(.6rem + env(safe-area-inset-top, 0px)) 1rem .6rem; }
  .ls-main { grid-template-rows: 34vh 1fr; }
  .ls-steps { padding: .5rem .9rem; }
  .ls-step { padding: .3rem 0; font-size: .9rem; }
  .chip { min-width: 70px; font-size: .74rem; }
  .ls-log { display: none; }
  .ls-foot { padding: .7rem 1rem calc(.8rem + env(safe-area-inset-bottom, 0px)); }
  .ls-progress { grid-template-columns: 1fr auto; }
  .ls-pct { min-width: 0; }
  .ls-pct strong { font-size: 1.35rem; }
  .ls-actions { flex-direction: column-reverse; }
  .ls-actions .btn { width: 100%; }
  .btn--start { min-height: 54px; }
}
@media (max-width: 900px) {
  .toasts { top: calc(var(--top) + env(safe-area-inset-top, 0px) + .6rem); bottom: auto; }
}
@media (max-width: 640px) {
  .cards--build { grid-template-columns: 1fr; }
  .cards--build .card-btn { display: grid; grid-template-columns: 1fr auto; column-gap: .8rem; }
  .cards--build .card-btn > small { grid-column: 1 / -1; }
  .cards--build .card-btn__price { grid-column: 2; grid-row: 1; align-self: center; font-size: 1.05rem; }
  .seg--terms { display: grid; grid-template-columns: repeat(4, 1fr); }
  .seg--terms button { min-width: 0; padding: .45rem .2rem; }
}
@media (max-width: 640px) {
  .seg--terms button { font-size: .86rem; white-space: nowrap; }
  .steps3 li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* Améliorations : onglets Bâtiments / Véhicules */
.badge--soft { background: var(--panel-2); color: var(--text); }
.ulist { list-style: none; margin: 0; padding: 0; }
.ugroup { font: 600 .8rem var(--fc); color: var(--muted); padding: .8rem 0 .3rem; border-bottom: 1px solid var(--line); }
.ugroup:first-child { padding-top: .2rem; }
.urow { display: grid; grid-template-columns: 30px 1fr auto; gap: .7rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.urow:last-child { border-bottom: 0; }
.urow__main { display: flex; flex-direction: column; min-width: 0; }
.urow__main b { font-weight: 600; }
.urow__main small { color: var(--muted); font-size: .84rem; }
.urow__icon { display: grid; place-items: center; }
.urow__icon .dwv { width: 26px; height: 26px; }
.urow__icon .dwv svg { width: 26px; height: 26px; }
.urow__icon .dwv__tag { display: none; }
.bldmini { width: 26px; height: 26px; border-radius: 6px; border: 2px solid var(--svc); color: var(--svc); font: 700 .8rem var(--fc); background: #0B141C; }
.urow .btn { white-space: nowrap; }
@media (max-width: 640px) {
  .urow { grid-template-columns: 28px 1fr; }
  .urow .btn { grid-column: 2; justify-self: start; }
}

.card-btn.is-locked { opacity: .55; border-top-color: var(--line-2); }

.upall__btns { display: flex; flex-direction: column; gap: .5rem; align-items: stretch; }
@media (max-width: 640px) { .upall__btns .btn { width: 100%; white-space: normal; } }

/* Flotte */
.linkbtn { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.linkbtn:hover b, button.linkbtn:hover { text-decoration: underline; }
.btn--fleet { width: 100%; margin-bottom: .6rem; }
.qty { display: inline-flex; align-items: center; gap: .4rem; }
.qty b { min-width: 1.6rem; text-align: center; font: 700 1.1rem var(--fc); }
.bhead small { color: var(--muted); font-size: .8rem; }
.fleet__filters .inline select { min-height: 40px; }
.fleet__h { font: 700 .9rem var(--fc); color: var(--svc); margin: 1rem 0 .2rem; border-bottom: 2px solid var(--svc); padding-bottom: .25rem; }
.fleet__h small { color: var(--muted); font-weight: 600; }
.frow { display: grid; grid-template-columns: 24px 30px 1fr auto; gap: .6rem; align-items: center; padding: .5rem .2rem; border-bottom: 1px solid var(--line); }
.frow.is-sel { background: color-mix(in srgb, var(--svc) 10%, transparent); }
.frow input { width: 20px; height: 20px; accent-color: var(--hi); }
.frow__main { display: flex; flex-direction: column; min-width: 0; }
.frow__main small { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frow__side { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; }
.frow__side small { color: var(--muted); font-size: .8rem; }
.fleet__bar { flex-wrap: wrap; align-items: center; justify-content: flex-start; background: var(--panel); border-top: 1px solid var(--line-2); }
.fleet__bar select { min-height: 40px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 0 .5rem; max-width: 200px; }
.vstats { margin: 1rem 0; }
.vacts select { min-height: 44px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 0 .5rem; }
/* Fenêtre compacte véhicule sur la carte */
.dw-popup .leaflet-popup-content-wrapper { background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.dw-popup .leaflet-popup-tip { background: var(--panel); }
.dw-popup .leaflet-popup-content { margin: .7rem .8rem; min-width: 220px; font: inherit; }
.dw-popup a.leaflet-popup-close-button { color: var(--muted); }
.vpop__head { display: flex; gap: .6rem; align-items: center; margin-bottom: .5rem; }
.vpop__head .dwv { width: 28px; height: 28px; } .vpop__head .dwv__tag { display: none; }
.vpop__head small { display: block; color: var(--muted); font-size: .78rem; }
.vpop__grid { display: grid; grid-template-columns: auto 1fr; gap: .25rem .8rem; font-size: .88rem; margin-bottom: .6rem; }
.vpop__acts { display: flex; flex-wrap: wrap; gap: .35rem; }
.vpop__acts .btn { min-height: 36px; padding: .25rem .6rem; }
@media (max-width: 640px) {
  .frow { grid-template-columns: 24px 26px 1fr; }
  .frow__side { grid-column: 3; flex-direction: row; justify-content: space-between; width: 100%; }
  .fleet__bar .btn, .fleet__bar select { flex: 1 1 auto; }
}

/* Logistique : carburant, pannes, garages */
.fuel { display: inline-block; width: 46px; height: 7px; border-radius: 4px; background: var(--panel-2); overflow: hidden; margin-right: .35rem; vertical-align: middle; }
.fuel i { display: block; height: 100%; background: var(--ok); }
.fuel.is-low i { background: var(--err); }
.st--broken { color: #fff; background: var(--err); }
.st--towed, .st--towing { color: var(--gcsr); background: rgba(43, 196, 169, .14); }
.st--refueling, .st--fueling { color: #C9D3DC; background: rgba(163, 177, 191, .16); }
.st--repairing, .st--to_garage { color: #D2BCFF; background: rgba(180, 140, 255, .16); }
.st--transferring { color: #9CC9FF; background: rgba(62, 139, 255, .12); }
.dwv.is-broken::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--err); animation: pulse 1s infinite; }
.dwv.is-towed { opacity: .7; }

/* Administration modulaire */
.admin__who { font-size: .85rem; color: var(--muted); padding: 0 .7rem .6rem; }
@media (min-width: 761px) { .admin__nav { grid-row: 1 / span 30; } }
.tbl--edit td.mgmt, .adm-player td.mgmt { display: table-cell; white-space: nowrap; }
.tbl--edit td.mgmt .btn, .adm-player td.mgmt .btn { margin: .15rem; }
.admin__nav a.is-on { background: var(--panel-2); color: var(--hi); }
.admin__nav a small { color: var(--dim); }
.admin [data-mod][hidden] { display: none !important; }
.clickrow { cursor: pointer; }
.clickrow:hover td { background: var(--panel); }
.tbl--edit input[type=number], .tbl--edit select { width: 100px; min-height: 36px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 0 .4rem; }
.tbl--edit input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--hi); }
.permgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .5rem; margin: .6rem 0; }
.permgrid > div { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .5rem .6rem; display: flex; flex-direction: column; gap: .2rem; font-size: .88rem; }
.permgrid label { display: flex; gap: .4rem; align-items: center; }
.logdiff small { font-family: ui-monospace, monospace; color: var(--muted); word-break: break-all; }
.adm-player .grid4 input { min-height: 40px; }
.maint-banner { position: absolute; z-index: 926; top: .8rem; left: .8rem; right: calc(var(--panel-w) + 4.5rem); background: rgba(240, 82, 74, .16); border: 1px solid rgba(240, 82, 74, .6); color: #FFC9C5; border-radius: var(--r); padding: .5rem .8rem; font-size: .9rem; }
@media (max-width: 900px) { .maint-banner { right: 4.5rem; left: .6rem; top: .6rem; } }

/* Complications radio, événements mondiaux, patrouille */
.cx-badge { display: block; margin: .35rem 0 .1rem; font: 600 .78rem var(--fc); color: #FFD69A; background: rgba(242, 179, 61, .14); border: 1px solid rgba(242, 179, 61, .5); border-radius: 4px; padding: .2rem .5rem; animation: pulse 1.6s infinite; }
.cxlist { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.cx { border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: var(--r-sm); padding: .5rem .7rem; font-size: .9rem; display: flex; flex-direction: column; gap: .25rem; }
.cx--met { border-left-color: var(--ok); } .cx--failed { border-left-color: var(--err); opacity: .8; }
.cx span { color: var(--muted); font-size: .84rem; }
.world-banner { position: absolute; z-index: 924; top: .8rem; left: .8rem; right: calc(var(--panel-w) + 4.6rem); display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; pointer-events: none; }
.wev { pointer-events: auto; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: .1rem; max-width: 100%;
  background: rgba(19, 34, 48, .9); border: 1px solid rgba(62, 139, 255, .6); color: var(--text); border-radius: 12px; padding: .45rem .8rem;
  backdrop-filter: blur(6px); box-shadow: 0 6px 18px rgba(0,0,0,.35); animation: wevin .5s ease-out, wevglow 3s ease-in-out infinite; }
.wev b { font: 700 .9rem var(--fc); color: #9CC9FF; }
.wev span { font-size: .8rem; color: var(--muted); }
@keyframes wevin { from { opacity: 0; transform: translateY(-8px); } }
@keyframes wevglow { 50% { box-shadow: 0 0 0 3px rgba(62, 139, 255, .25), 0 6px 18px rgba(0,0,0,.35); } }
.radio--world span { color: #9CC9FF; }
.radio__h { margin: .4rem 0 .4rem; font-size: .9rem; color: var(--muted); }
.wlist { list-style: none; margin: 0 0 .6rem; padding: 0; }
.wl { display: flex; justify-content: space-between; gap: .6rem; padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.wl small { color: var(--muted); }
.wl--active b { color: #9CC9FF; }
.st--patrolling { color: #9CC9FF; background: rgba(62, 139, 255, .12); }
.radio--complication span { color: #FFD69A; }
@media (max-width: 900px) { .world-banner { top: .6rem; left: .6rem; right: 4.6rem; } }
.maint-banner:not([hidden]) ~ .world-banner { top: 3.6rem; }

/* Alliance : chat */
.chat { display: flex; flex-direction: column; gap: .6rem; }
.chat__list { height: min(52vh, 420px); overflow-y: auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: .6rem; display: flex; flex-direction: column; gap: .45rem; overscroll-behavior: contain; }
.msg { max-width: 82%; background: var(--panel-2); border-radius: 10px 10px 10px 2px; padding: .4rem .65rem; }
.msg small { color: var(--muted); font-size: .74rem; }
.msg p { margin: .1rem 0 0; white-space: pre-wrap; word-break: break-word; }
.msg--me { align-self: flex-end; background: rgba(62, 139, 255, .22); border-radius: 10px 10px 2px 10px; }
.chat__form { display: flex; gap: .5rem; }
.chat__form input { flex: 1; min-height: 44px; padding: .5rem .75rem; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); }

/* ===================================================================== Thème clair */
html[data-theme=light] {
  --bg: #EEF2F6; --bg-2: #FFFFFF; --panel: #FFFFFF; --panel-2: #E9EEF3; --line: #D5DEE6; --line-2: #BCC9D4;
  --text: #17222D; --muted: #566676; --dim: #8292A1; --hi: #0F1B26;
  color-scheme: light;
}
html[data-theme=light] .dw-tiles { filter: saturate(.85) contrast(.96); }
html[data-theme=light] .leaflet-container { background: #E5E3DF; }
html[data-theme=light] .btn--primary, html[data-theme=light] .btn--start.is-ready { color: #fff; }
html[data-theme=light] .btn--primary:hover:not(:disabled) { background: #22384A; border-color: #22384A; }
html[data-theme=light] .modal-backdrop { background: rgba(20, 32, 44, .35); }
html[data-theme=light] .toast, html[data-theme=light] .fab, html[data-theme=light] .wev, html[data-theme=light] .placebar { box-shadow: 0 6px 18px rgba(20, 32, 44, .16); }
html[data-theme=light] .wev { background: rgba(255, 255, 255, .94); }
html[data-theme=light] .wev b { color: #1F5FBF; }
html[data-theme=light] .ls-tick, html[data-theme=light] .ls-map-note { background: rgba(255, 255, 255, .92); }
html[data-theme=light] .st--enroute, html[data-theme=light] .spd, html[data-theme=light] .st--transferring, html[data-theme=light] .st--patrolling { color: #1F5FBF; }
html[data-theme=light] .reward { color: #A87A00; }
html[data-theme=light] .err-box { color: #8A1F18; }
html[data-theme=light] .pend-note, html[data-theme=light] .cx-badge { color: #7A5200; }
html[data-theme=light] .ring b { background: #fff; }
html[data-theme=light] .msg--me { background: rgba(62, 139, 255, .16); }
html[data-theme=light] a { color: #1F5FBF; }

/* Centre de notifications */
.icon-btn--bell { position: relative; }
.icon-btn--bell .badge { position: absolute; top: 2px; right: 0; margin: 0; font: 700 .68rem/1.3 var(--fc); }
.nlist { list-style: none; margin: 0; padding: 0; }
.ni { display: grid; grid-template-columns: auto 1fr; gap: .1rem .6rem; padding: .55rem .2rem; border-bottom: 1px solid var(--line); font-size: .92rem; }
.ni time { grid-column: 2; color: var(--dim); font-size: .78rem; }
.ni__cat { grid-row: span 2; font: 600 .72rem var(--fc); color: var(--muted); background: var(--panel-2); border-radius: 4px; padding: .15rem .4rem; height: fit-content; }
.ni.is-new { background: color-mix(in srgb, var(--police) 8%, transparent); }
.ni.is-new .ni__cat { color: var(--hi); }
.vol .inline input[type=range] { flex: 1; }
.navpick { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .3rem; }
.navpick .ico { width: 18px; height: 18px; }
.navpick .pill { margin-left: auto; }
.box--danger { border-color: rgba(240, 82, 74, .6); background: linear-gradient(180deg, rgba(240, 82, 74, .08), transparent 70%), var(--panel); }
.hud__money.is-bankrupt b::after { content: ' · faillite'; font: 600 .7rem var(--fc); color: var(--err); }

/* Panneau flottant (ordinateur) */
.panel__detach { flex: 0 0 auto !important; width: 44px; display: grid !important; place-items: center; color: var(--muted); }
.panel__detach .ico { width: 18px; height: 18px; }
@media (min-width: 901px) {
  body.panel-floating .stage { grid-template-columns: 1fr; }
  body.panel-floating .panel { position: fixed; z-index: 1200; border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: 0 18px 50px rgba(0,0,0,.45);
    resize: both; overflow: hidden; min-width: 300px; min-height: 260px; max-width: 90vw; max-height: 88vh; }
  body.panel-floating .panel__grip { display: grid; place-items: center; height: 20px; cursor: move; touch-action: none; user-select: none; background: var(--panel-2); }
  body.panel-floating .panel__grip span { width: 44px; height: 4px; border-radius: 2px; background: var(--line-2); }
  body.panel-floating .fabs { right: .8rem; }
  body.panel-floating .world-banner { right: 4.6rem; }
  body.panel-floating .paused-banner { transform: translateX(-50%); }
  body.panel-floating .placebar { width: min(520px, calc(100% - 1.6rem)); }
}
@media (max-width: 900px) { .panel__detach { display: none !important; } }

/* Éditeur de scénarios, simulations, carte mondiale */
.reqin { display: flex; flex-wrap: wrap; gap: .5rem; }
.reqin label { display: flex; flex-direction: column; gap: .15rem; }
.reqin input { width: 70px; min-height: 38px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 0 .4rem; }
.sced textarea { width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: .5rem; color: var(--text); font: inherit; resize: vertical; }
.sced .inline { align-items: flex-start; margin-bottom: .4rem; }
.scrow { border: 1px solid var(--line); border-radius: var(--r-sm); padding: .6rem; margin-bottom: .6rem; background: var(--bg-2); }
.prevlist { margin: .4rem 0 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .5rem; }
.wmap { height: min(70vh, 620px); border-radius: var(--r); border: 1px solid var(--line); margin: .6rem 0; }

.rt-pill { font-size: .72rem; }
@media (max-width: 640px) { .rt-pill { display: none; } }

.tprev { height: 220px; border-radius: var(--r); border: 1px solid var(--line); margin: .6rem 0; }

/* Gyrophares selon l'état réel */
.dwv__bar { position: absolute; left: 50%; top: -3px; transform: translateX(-50%); display: none; gap: 2px; pointer-events: none; }
.dwv__bar i { display: block; width: 6px; height: 4px; border-radius: 2px; }
.dwv.is-enroute .dwv__bar, .dwv.is-patrolling .dwv__bar, .dwv.is-onscene .dwv__bar { display: flex; }
/* Patrouille : feux lents en alternance, halo doux, véhicule bien visible */
.dwv.is-patrolling::before { content: ''; position: absolute; inset: -7px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--svc) 38%, transparent), transparent 70%); animation: patrolHalo 2.4s ease-in-out infinite; will-change: transform, opacity; }
@keyframes gyroA { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .15; } }
.dwv__bar i { will-change: opacity; }
@keyframes gyroB { 0%, 49% { opacity: .15; } 50%, 100% { opacity: 1; } }
@keyframes patrolHalo { 50% { transform: scale(1.25); opacity: .55; } }

/* Événements mondiaux sur la carte */
.wev-wrap { background: none; border: 0; }
.wevpin { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; transform: translate(-50%, -50%); padding: .3rem .65rem .3rem .4rem;
  background: rgba(19, 34, 48, .92); border: 1px solid rgba(62, 139, 255, .7); border-radius: 999px; color: var(--text); font: 700 .8rem var(--fc);
  box-shadow: 0 6px 16px rgba(0,0,0,.4); cursor: pointer; animation: wevglow 2.6s ease-in-out infinite; }
.wevpin b { font-size: 1.15rem; line-height: 1; }
.wevpin--tempete { border-color: #9fd3ff; } .wevpin--canicule { border-color: #ff9a3c; } .wevpin--festival { border-color: #F2B33D; }
.wevpin--carburant { border-color: #A3B1BF; } .wevpin--patrouille { border-color: #3E8BFF; }
.crowd { font-size: 1.1rem; transform: translate(-50%, -50%); animation: crowd 1.8s ease-in-out infinite; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
.crowd:nth-child(odd) { animation-delay: -.6s; }
@keyframes crowd { 50% { transform: translate(-50%, -62%) scale(1.15); } }
@media (prefers-reduced-motion: reduce) {
  .dwv__bar i, .dwv.is-patrolling::before, .wevpin, .crowd, .evz-flood { animation: none !important; }
  .evfx-canvas { display: none; }
}
html[data-theme=light] .wevpin { background: rgba(255, 255, 255, .95); color: #17222D; }
#map.is-busy .dwv__bar i, #map.is-busy .dwv.is-patrolling::before { animation: none; }

/* Page d'accueil : statistiques publiques */
.pub { margin-top: 2rem; display: flex; flex-direction: column; gap: .8rem; max-width: 620px; }
.pub__h { display: flex; align-items: center; gap: .5rem; margin: .4rem 0 0; font: 700 .82rem var(--fc); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pub__live { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(53, 199, 122, .6); animation: live 2s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 8px rgba(53, 199, 122, 0); } 100% { box-shadow: 0 0 0 0 rgba(53, 199, 122, 0); } }
.pub__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.pub__kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: .8rem .9rem; display: flex; flex-direction: column; gap: .1rem; }
.pub__kpi b { font: 800 clamp(1.4rem, 3vw, 1.9rem)/1.1 var(--fc); color: var(--hi); font-variant-numeric: tabular-nums; }
.pub__kpi span { font-size: .9rem; color: var(--text); }
.pub__kpi small { font-size: .78rem; color: var(--muted); }
.podium { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.podium__row { display: grid; grid-template-columns: 2.2rem 1fr auto; align-items: center; gap: .7rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: .6rem .8rem; }
.podium__row--1 { border-color: rgba(242, 194, 48, .6); background: linear-gradient(90deg, rgba(242, 194, 48, .12), transparent 60%), var(--panel); }
.podium__medal { font-size: 1.5rem; text-align: center; }
.podium__name { display: flex; flex-direction: column; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.podium__name small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.podium__score { text-align: right; display: flex; flex-direction: column; }
.podium__score b { font: 800 1.1rem var(--fc); font-variant-numeric: tabular-nums; }
.podium__score small { color: var(--muted); font-size: .72rem; }
.pub__fine { color: var(--dim); font-size: .75rem; margin: 0; }
@media (max-width: 860px) { .pub { margin-top: 1.2rem; } }
@media (max-width: 420px) { .pub__grid { grid-template-columns: 1fr 1fr; } .pub__kpi { padding: .6rem; } }
@media (prefers-reduced-motion: reduce) { .pub__live { animation: none; } }

/* Accueil : le formulaire reste en haut sur téléphone, les chiffres en dessous */
body.page-auth { min-height: 100vh; background-color: var(--bg); }
html:has(body.page-auth) { background-color: var(--bg); }
@media (min-width: 861px) {
  .auth { grid-template-rows: auto auto; }
  .auth__intro { grid-column: 1; grid-row: 1; }
  .auth__card { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .auth > .pub { grid-column: 1; grid-row: 2; margin-top: 0; align-self: start; }
}

/* Événements v2 : calque de particules et zones */
.evfx-canvas { position: absolute; left: 0; top: 0; pointer-events: none; transition: opacity .15s; }
.evz-flood { animation: flood 2.4s linear infinite; }
@keyframes flood { to { stroke-dashoffset: -32; } }
.wevpin--snow { border-color: #9fd3ff; } .wevpin--heat { border-color: #ff9a3c; } .wevpin--festival { border-color: #F2B33D; }
.wevpin--fuel { border-color: #F0524A; } .wevpin--patrol { border-color: #3E8BFF; } .wevpin--flood { border-color: #2F8BFF; }
.wevpin--blackout { border-color: #8892a0; } .wevpin--congestion { border-color: #FF8A1E; } .wevpin--industrial { border-color: #F0524A; } .wevpin--fog { border-color: #b8c4cf; }
html[data-theme=light] .crowd { filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }

/* Administration : éditeur d'événements */
.tplhead { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.tplgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .7rem; margin-top: .6rem; }
.tpl { border: 1px solid var(--line); border-radius: var(--r); padding: .7rem .8rem; background: var(--bg-2); display: flex; flex-direction: column; gap: .3rem; }
.tpl.is-off { opacity: .55; }
.tpl header { display: flex; gap: .6rem; align-items: center; }
.tpl header small { display: block; color: var(--muted); font-size: .78rem; }
.tpl__ico { font-size: 1.6rem; }
.tpl__fx { font: 600 .82rem var(--fc); color: var(--text); margin: 0; }
.tpl p { margin: 0; }
.ztool .seg { margin-bottom: .5rem; }
.ztool__ctl { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; min-height: 38px; }
.ztool__ctl input[type=range] { width: 220px; }
.ztool__map { height: 320px; border-radius: var(--r); border: 1px solid var(--line); margin: .5rem 0; }
.svcbars { display: grid; gap: .3rem; margin-bottom: .5rem; }
.svcbars div { display: grid; grid-template-columns: 64px 1fr 52px; align-items: center; gap: .5rem; font-size: .85rem; }
.svcbars i { display: block; height: 8px; border-radius: 4px; background: var(--panel-2); position: relative; overflow: hidden; }
.svcbars i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--svc); border-radius: 4px; }
.lprev ul { margin: .2rem 0; padding-left: 1.1rem; }
.checks.themes { max-height: 220px; overflow-y: auto; }
@media (max-width: 640px) { .ztool__map { height: 260px; } .ztool__ctl input[type=range] { width: 140px; } }

/* ===================================================================== Gyrophares par service
   POLICE bleu-blanc-rouge · EMS et FIRE rouge-blanc · GCSR vert-jaune-blanc.
   Rapides en route vers un appel, lents en patrouille, doux sur les lieux, éteints sinon. */
.dwv__bar { gap: 1px; top: -4px; }
.dwv__bar i { width: 5px; height: 4px; border-radius: 2px; opacity: .15; }
.dwv[data-svc=POLICE] .dwv__bar i:nth-child(1) { background: #2f7bff; }
.dwv[data-svc=POLICE] .dwv__bar i:nth-child(2) { background: #ffffff; }
.dwv[data-svc=POLICE] .dwv__bar i:nth-child(3) { background: #ff2d2d; }
.dwv[data-svc=EMS] .dwv__bar i:nth-child(odd), .dwv[data-svc=FIRE] .dwv__bar i:nth-child(odd) { background: #ff2d2d; }
.dwv[data-svc=EMS] .dwv__bar i:nth-child(2), .dwv[data-svc=FIRE] .dwv__bar i:nth-child(2) { background: #ffffff; }
.dwv[data-svc=GCSR] .dwv__bar i:nth-child(1) { background: #22c55e; }
.dwv[data-svc=GCSR] .dwv__bar i:nth-child(2) { background: #ffd21f; }
.dwv[data-svc=GCSR] .dwv__bar i:nth-child(3) { background: #ffffff; }
html[data-theme=light] .dwv__bar i:nth-child(2) { box-shadow: 0 0 0 .5px rgba(0,0,0,.55); } /* blanc visible sur fond clair */
.dwv.is-enroute .dwv__bar i:nth-child(1) { animation: lbA .5s steps(1) infinite; }
.dwv.is-enroute .dwv__bar i:nth-child(2) { animation: lbW .5s steps(1) infinite; }
.dwv.is-enroute .dwv__bar i:nth-child(3) { animation: lbB .5s steps(1) infinite; }
.dwv.is-patrolling .dwv__bar i:nth-child(1) { animation: lbA 1.8s ease-in-out infinite; }
.dwv.is-patrolling .dwv__bar i:nth-child(2) { animation: lbW 1.8s ease-in-out infinite; }
.dwv.is-patrolling .dwv__bar i:nth-child(3) { animation: lbB 1.8s ease-in-out infinite; }
.dwv.is-onscene .dwv__bar i { animation: lbS 2.2s ease-in-out infinite; }
.dwv.is-onscene .dwv__bar i:nth-child(2) { animation-delay: -.7s; }
.dwv.is-onscene .dwv__bar i:nth-child(3) { animation-delay: -1.4s; }
@keyframes lbA { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .12; } }
@keyframes lbB { 0%, 49% { opacity: .12; } 50%, 100% { opacity: 1; } }
@keyframes lbW { 0%, 20%, 50%, 70%, 100% { opacity: .12; } 10%, 60% { opacity: 1; } }
@keyframes lbS { 50% { opacity: 1; } 0%, 100% { opacity: .3; } }
#map.is-busy .dwv__bar i { animation: none !important; opacity: .9; }
@media (prefers-reduced-motion: reduce) { .dwv__bar i { animation: none !important; opacity: .9; } }

/* ===================================================================== Barre du haut épurée */
.hud { gap: .35rem; }
.hchip { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: .2rem .65rem .2rem .3rem; border: 1px solid var(--line);
  background: var(--panel); border-radius: 999px; color: var(--text); cursor: pointer; white-space: nowrap; font: inherit; flex: none; }
.hchip:hover { border-color: var(--line-2); }
.hchip__ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 800 .9rem var(--fc); background: var(--panel-2); color: var(--hi); }
.hchip--money .hchip__ico { background: rgba(53, 199, 122, .16); color: #35c77a; }
.hchip--rep .hchip__ico { background: rgba(242, 179, 61, .16); color: #f2b33d; }
.hchip__ico--ai { background: rgba(62, 139, 255, .18) !important; color: #6aa7ff !important; font-size: .72rem !important; }
.hchip__txt { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.hchip__txt b { font: 700 .98rem var(--fc); font-variant-numeric: tabular-nums; }
.hchip__txt small { font-size: .7rem; color: var(--muted); }
.hchip--money.is-neg b { color: var(--err); }
.hchip--money.is-bankrupt b::after { content: ' · faillite'; font: 600 .68rem var(--fc); color: var(--err); }
.hchip--lvl { padding-left: .2rem; }
.hchip--lvl .ring { width: 32px; height: 32px; }
.hchip--lvl .ring b { width: 25px; height: 25px; font-size: .85rem; }
.hchip--ai { border-color: rgba(62, 139, 255, .5); }
.hchip--warn { color: #FFD69A; border-color: rgba(242, 179, 61, .5); padding: .2rem .6rem; cursor: default; }
.hud__item { display: none !important; }
@media (max-width: 640px) {
  .hud { gap: .25rem; }
  .hchip { min-height: 40px; padding: .15rem .5rem .15rem .2rem; gap: .3rem; } /* cible tactile ≥ 40 px */
  .hchip__ico { width: 26px; height: 26px; font-size: .8rem; }
  .hchip__txt small, .hchip__txt--side { display: none; }
  .hchip__txt b { font-size: .9rem; }
  .hchip--lvl { padding: .15rem; }
  .hchip--lvl .ring { width: 28px; height: 28px; } .hchip--lvl .ring b { width: 22px; height: 22px; font-size: .78rem; }
}
@media (max-width: 640px) {
  .hchip--money .hchip__ico, .hchip--rep .hchip__ico { display: none; }
  .hchip--money, .hchip--rep { padding-left: .6rem; }
  .hchip--rep .hchip__txt b::before { content: '★ '; color: #f2b33d; }
  .hchip__ico--ai { width: 24px !important; height: 24px !important; }
}

/* ===================================================================== Panneau : en-tête compact */
.panel__tabs { align-items: stretch; gap: 0; padding-right: .2rem; }
.panel__tabs button[role=tab] { gap: .35rem; min-height: 44px; padding: .55rem .4rem; font-size: .92rem; }
.panel__tabs button[role=tab] .ico { width: 17px; height: 17px; opacity: .8; }
.panel__filter { flex: 0 0 auto !important; align-self: center; display: inline-flex !important; align-items: center; gap: .35rem; height: 32px; min-height: 0 !important; border-bottom-width: 1px !important; margin: 0 .2rem;
  padding: 0 .65rem !important; border: 1px solid var(--line-2) !important; border-radius: 999px !important; background: var(--panel) !important; color: var(--muted);
  font: 700 .78rem var(--fc) !important; cursor: pointer; }
.panel__filter.is-on { color: var(--hi); border-color: var(--svc) !important; background: color-mix(in srgb, var(--svc) 16%, var(--panel)) !important; }
.pf-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--svc, transparent); border: 1.5px solid var(--svc, var(--muted)); display: inline-block; }
.pf-menu { position: absolute; z-index: 30; min-width: 190px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 12px 30px rgba(0,0,0,.35); padding: .3rem; display: flex; flex-direction: column; }
.pf-menu button { display: flex; align-items: center; gap: .55rem; min-height: 42px; padding: 0 .7rem; border: 0; background: none; color: var(--text); font: 600 .92rem var(--fc); border-radius: var(--r-sm); cursor: pointer; text-align: left; }
.pf-menu button:hover, .pf-menu button.is-on { background: var(--panel-2); }
.pf-menu button.is-on::after { content: '✓'; margin-left: auto; color: var(--hi); }
.nethead { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.seg--sm button { min-height: 34px; padding: 0 .8rem; font-size: .85rem; }
@media (max-width: 640px) {
  .panel__tabs button[role=tab] .ico { display: none; }
  .panel__tabs button[role=tab] { font-size: .9rem; padding: .5rem .25rem; }
  .panel__filter { height: 30px; padding: 0 .5rem !important; }
}

/* ===================================================================== Page d'accueil (visiteurs) */
.page-land { min-height: 100vh; background: radial-gradient(1200px 600px at 75% -10%, rgba(62, 139, 255, .16), transparent 60%), var(--bg); }
.land__nav { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem clamp(1rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.land__nav nav { display: flex; align-items: center; gap: .5rem; }
.land__link { color: var(--muted); text-decoration: none; font-weight: 600; margin-right: .4rem; }
.land__link:hover { color: var(--hi); }
.land { max-width: 1180px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 3rem) 3rem; }
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(1.5rem, 4vw, 4rem); align-items: center; padding: clamp(2rem, 6vw, 4.5rem) 0 2.5rem; }
.hero__kicker { display: inline-flex; align-items: center; gap: .5rem; font: 700 .78rem var(--fc); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 .8rem; }
.hero__title { font: 800 clamp(2rem, 4.6vw, 3.4rem)/1.05 var(--fc); margin: 0 0 1rem; color: var(--hi); letter-spacing: -.01em; }
.hero__title span { background: linear-gradient(90deg, #3E8BFF, #2BC4A9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__lead { font-size: clamp(1rem, 1.6vw, 1.15rem); line-height: 1.55; color: var(--muted); margin: 0 0 1.4rem; max-width: 34em; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .6rem; }
.btn--lg { min-height: 52px; padding: 0 1.4rem; font-size: 1.05rem; }
.hero__fine { color: var(--dim); font-size: .85rem; margin: .9rem 0 0; }
.hero__art { position: relative; }
.radar { width: 100%; height: auto; display: block; filter: drop-shadow(0 20px 50px rgba(0,0,0,.35)); }
.radar__bg { fill: #0f1b26; stroke: rgba(62, 139, 255, .35); }
html[data-theme=light] .radar__bg { fill: #eaf1f8; stroke: rgba(30, 80, 160, .25); }
.radar__grid path { stroke: rgba(160, 190, 220, .09); stroke-width: 10; fill: none; }
html[data-theme=light] .radar__grid path { stroke: rgba(30, 60, 90, .07); }
.radar__roads path { stroke: rgba(160, 200, 240, .22); stroke-width: 3; fill: none; stroke-dasharray: 2 6; stroke-linecap: round; }
html[data-theme=light] .radar__roads path { stroke: rgba(30, 80, 160, .25); }
.radar__callring { fill: none; stroke: #ff4d3d; stroke-width: 2; transform-origin: center; animation: callring 1.8s ease-out infinite; }
.radar__calldot { fill: #ff4d3d; }
.radar__call--b .radar__callring { animation-delay: -.9s; stroke: #F2C230; } .radar__call--b .radar__calldot { fill: #F2C230; }
@keyframes callring { 0% { transform: scale(.5); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }
.veh circle { stroke: #fff; stroke-width: 2; }
.veh--p circle { fill: #3E8BFF; } .veh--e circle { fill: #F2C230; } .veh--f circle { fill: #FF4D3D; } .veh--g circle { fill: #2BC4A9; }
.veh { offset-rotate: 0deg; animation: drive 9s linear infinite; }
.veh--p { offset-path: path('M30 70 H180 V150 H330 V250'); }
.veh--e { offset-path: path('M370 70 H250 V150 H120 V240'); animation-duration: 10s; animation-delay: -3s; }
.veh--f { offset-path: path('M60 260 V190 H220 V90 H330'); animation-duration: 11s; animation-delay: -6s; }
.veh--g { offset-path: path('M180 20 V150 H40'); animation-duration: 8s; animation-delay: -2s; }
@keyframes drive { 0% { offset-distance: 0%; opacity: 0; } 6% { opacity: 1; } 92% { opacity: 1; } 100% { offset-distance: 100%; opacity: 0; } }
.lb { animation: lbA .5s steps(1) infinite; } .lb--r, .lb--r2 { fill: #ff2d2d; } .lb--b { fill: #2f7bff; } .lb--w { fill: #fff; animation-name: lbW; } .lb--g { fill: #22c55e; } .lb--y { fill: #ffd21f; }
.lb--r2, .lb--r:last-child { animation-name: lbB; }
.veh--p .lb--r { animation-name: lbB; }
.hero__legend { list-style: none; display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; margin: .8rem 0 0; padding: 0; }
.hero__legend li { font: 700 .75rem var(--fc); padding: .25rem .6rem; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text); }
.hero__legend li::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--svc); margin-right: .35rem; }
.land__sec { margin: 2.5rem 0; }
.land__h { font: 800 clamp(1.35rem, 2.6vw, 1.9rem) var(--fc); color: var(--hi); margin: 0 0 1rem; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.steps li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.1rem 1.1rem 1rem; position: relative; }
.steps b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #3E8BFF, #2BC4A9); color: #fff; font: 800 1rem var(--fc); margin-bottom: .6rem; }
.steps h3, .feats h3 { margin: 0 0 .35rem; font: 700 1.05rem var(--fc); color: var(--hi); }
.steps p, .feats p { margin: 0; color: var(--muted); line-height: 1.5; font-size: .95rem; }
.feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.feats article { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1rem 1.1rem; }
.feats span { font-size: 1.6rem; display: block; margin-bottom: .4rem; }
.page-land .pub { max-width: none; }
.page-land .pub__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.land__join { display: grid; grid-template-columns: 1fr minmax(320px, 440px); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; padding: 2rem; border-radius: var(--r-lg);
  background: linear-gradient(135deg, rgba(62, 139, 255, .12), rgba(43, 196, 169, .08)); border: 1px solid var(--line); }
.land__jointxt p { color: var(--muted); line-height: 1.55; }
.land__checks { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .4rem; }
.land__checks li::before { content: '✓ '; color: var(--ok); font-weight: 800; }
.auth__cardh { margin: 0 0 .8rem; font: 800 1.2rem var(--fc); color: var(--hi); }
.land__foot { text-align: center; color: var(--dim); font-size: .82rem; padding: 2rem 1rem 2.5rem; border-top: 1px solid var(--line); }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 1.5rem; }
  .hero__art { order: -1; max-width: 520px; margin: 0 auto; width: 100%; }
  .steps, .feats { grid-template-columns: 1fr 1fr; }
  .page-land .pub__grid { grid-template-columns: 1fr 1fr; }
  .land__join { grid-template-columns: 1fr; padding: 1.2rem; }
}
@media (max-width: 560px) {
  .land__link { display: none; }
  .land__nav .btn--ghost { display: none; }
  .steps, .feats { grid-template-columns: 1fr; }
  .hero__cta .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { .veh, .lb, .radar__callring { animation: none !important; } .veh { offset-distance: 40%; } }

/* ===================================================================== Tutoriel */
.tuto { position: fixed; inset: 0; z-index: 3000; }
.tuto.is-center { background: rgba(5, 10, 16, .62); }
.tuto__hole { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(5, 10, 16, .62), 0 0 0 3px #3E8BFF; transition: all .25s ease; pointer-events: none; }
.tuto__card { position: fixed; width: min(360px, calc(100vw - 24px)); background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  padding: 1rem 1.1rem .9rem; box-shadow: 0 18px 50px rgba(0,0,0,.45); }
.tuto.is-center .tuto__card { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.tuto__card h3 { margin: .1rem 0 .4rem; font: 800 1.15rem var(--fc); color: var(--hi); }
.tuto__card p { margin: 0 0 .8rem; line-height: 1.5; color: var(--muted); }
.tuto__n { font: 700 .72rem var(--fc) !important; letter-spacing: .08em; color: var(--dim) !important; margin: 0 !important; }
.tuto__btns { display: flex; justify-content: space-between; align-items: center; gap: .4rem; }
.tuto__btns > span { display: flex; gap: .4rem; }
@media (prefers-reduced-motion: reduce) { .tuto__hole { transition: none; } }
.panel__filter[hidden] { display: none !important; }

.wev--title { padding: .4rem .75rem; }
.wev--title b { font-size: .88rem; }

.evcall { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .55rem .2rem; border-bottom: 1px solid var(--line); }
.evcall small { display: block; color: var(--muted); font-size: .8rem; }
.evcall > span { display: flex; gap: .3rem; flex: none; }

/* ===================================================================== Gyrophares v3 (bien visibles)
   Boîtier sombre posé sur le véhicule, trois feux et un halo lumineux qui clignote avec eux.
   Animations d'opacité uniquement (calculées par la carte graphique) : fluides même avec une grande flotte. */
.dwv__bar { top: -9px !important; gap: 2px !important; padding: 2px 3px; background: rgba(12, 16, 22, .92); border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.6); z-index: 2; }
.dwv__bar i { position: relative; width: 6px !important; height: 5px !important; border-radius: 1.5px !important; opacity: .18; }
.dwv__bar i::after { content: ''; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
  background: radial-gradient(circle, currentColor 0, transparent 68%); opacity: .75; pointer-events: none; }
.dwv[data-svc=POLICE] .dwv__bar i:nth-child(1) { color: #2f7bff; }
.dwv[data-svc=POLICE] .dwv__bar i:nth-child(2) { color: #ffffff; }
.dwv[data-svc=POLICE] .dwv__bar i:nth-child(3) { color: #ff2d2d; }
.dwv[data-svc=EMS] .dwv__bar i:nth-child(odd), .dwv[data-svc=FIRE] .dwv__bar i:nth-child(odd) { color: #ff2d2d; }
.dwv[data-svc=EMS] .dwv__bar i:nth-child(2), .dwv[data-svc=FIRE] .dwv__bar i:nth-child(2) { color: #ffffff; }
.dwv[data-svc=GCSR] .dwv__bar i:nth-child(1) { color: #22c55e; }
.dwv[data-svc=GCSR] .dwv__bar i:nth-child(2) { color: #ffd21f; }
.dwv[data-svc=GCSR] .dwv__bar i:nth-child(3) { color: #ffffff; }
.dwv__bar i::after { display: none; }
.dwv.is-enroute .dwv__bar i::after, .dwv.is-patrolling .dwv__bar i::after, .dwv.is-onscene .dwv__bar i::after { display: block; }
html[data-theme=light] .dwv__bar i:nth-child(2) { box-shadow: none !important; }
/* EMS / FIRE : les deux rouges en alternance, blanc en éclat ; GCSR : vert / jaune alternés, blanc en éclat */
.dwv[data-svc=EMS].is-enroute .dwv__bar i:nth-child(3), .dwv[data-svc=FIRE].is-enroute .dwv__bar i:nth-child(3) { animation-name: lbB; }
/* Grande flotte : on garde le clignotement (opacité seulement), on retire seulement le halo de patrouille */
#map.is-busy .dwv__bar i { animation-play-state: running !important; }
#map.is-busy .dwv.is-enroute .dwv__bar i:nth-child(1) { animation: lbA .5s steps(1) infinite !important; }
#map.is-busy .dwv.is-enroute .dwv__bar i:nth-child(2) { animation: lbW .5s steps(1) infinite !important; }
#map.is-busy .dwv.is-enroute .dwv__bar i:nth-child(3) { animation: lbB .5s steps(1) infinite !important; }
#map.is-busy .dwv.is-patrolling .dwv__bar i:nth-child(1) { animation: lbA 1.8s steps(1) infinite !important; }
#map.is-busy .dwv.is-patrolling .dwv__bar i:nth-child(3) { animation: lbB 1.8s steps(1) infinite !important; }
#map.is-busy .dwv__bar i::after { width: 14px; height: 14px; margin: -7px 0 0 -7px; }
@media (prefers-reduced-motion: reduce) { .dwv__bar i { animation: none !important; opacity: .95; } }

/* Demandes d'aide (pannes de vos véhicules) — distinctes des appels 911 */
.assist__h { margin: .2rem 0 .5rem; font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.assist__h small { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--dim); margin-left: .3rem; }
.assist-item { display: flex; flex-direction: column; gap: .35rem; padding: .7rem .8rem; margin-bottom: .55rem; border-radius: var(--r); cursor: pointer;
  border: 1px dashed rgba(43, 196, 169, .7); background: color-mix(in srgb, #2BC4A9 8%, var(--panel)); }
.assist-item__top { display: flex; align-items: center; gap: .5rem; }
.assist-item__top b { flex: 1; }
.assist__ico { font-size: 1.1rem; }
.assist-item .hint { font-size: .8rem; margin: 0; }
.callpin--assist span { font-size: .8rem; }
.callpin--assist { opacity: .92; }

/* ===================================================================== Cartes publiques en direct */
.land__map { height: clamp(320px, 52vh, 520px); border-radius: var(--r-lg); border: 1px solid var(--line); overflow: hidden; background: var(--panel); display: grid; place-items: center; }
.land__sub { color: var(--muted); margin: -.4rem 0 .8rem; }
.lm-wrap { background: none; border: 0; }
.lm-call { position: absolute; left: 3px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--svc); border: 2px solid #fff; box-shadow: 0 0 0 0 rgba(255, 45, 45, .6); animation: lmPulse 1.6s infinite; }
.lm-call--p1 { box-shadow: 0 0 0 0 rgba(255, 45, 45, .9); }
.lm-call.is-w { animation: none; opacity: .75; }
@keyframes lmPulse { 70% { box-shadow: 0 0 0 10px rgba(255, 45, 45, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 45, 45, 0); } }
.page-livemap { height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.lm-top { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .55rem clamp(.8rem, 3vw, 1.5rem); border-bottom: 1px solid var(--line); background: var(--bg-2); }
.lm-title { display: flex; align-items: center; gap: .5rem; font: 700 1rem var(--fc); color: var(--hi); min-width: 0; }
.lm-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lm-main { flex: 1; display: grid; grid-template-columns: 1fr 300px; min-height: 0; }
.lm-map { min-height: 0; }
.lm-side { border-left: 1px solid var(--line); background: var(--bg-2); padding: 1rem; overflow-y: auto; display: flex; flex-direction: column; gap: .9rem; }
.lm-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.lm-kpis div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: .6rem; display: flex; flex-direction: column; }
.lm-kpis b { font: 800 1.35rem var(--fc); color: var(--hi); font-variant-numeric: tabular-nums; }
.lm-kpis span { font-size: .78rem; color: var(--muted); }
.lm-legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; font-size: .85rem; }
.lm-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--c); border: 2px solid #fff; margin-right: .4rem; vertical-align: -1px; }
.lm-legend__call { background: #ff4d3d !important; box-shadow: 0 0 0 3px rgba(255, 77, 61, .35); }
.lm-legend__run { background: #3E8BFF !important; border-color: #ff2d2d !important; }
.lm-events { display: flex; flex-wrap: wrap; gap: .35rem; }
.lm-ev { font: 600 .8rem var(--fc); padding: .25rem .55rem; border-radius: 999px; border: 1px solid var(--line-2); }
.lm-err { padding: 2rem; display: grid; gap: 1rem; justify-items: start; }
.sharebox { display: flex; gap: .4rem; align-items: center; margin: .3rem 0; }
.sharebox input { flex: 1; min-width: 0; font-size: .85rem; }
@media (max-width: 760px) {
  .lm-main { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .lm-side { border-left: 0; border-top: 1px solid var(--line); max-height: 38vh; padding: .7rem; gap: .6rem; }
  .lm-kpis { grid-template-columns: repeat(4, 1fr); } .lm-kpis b { font-size: 1.05rem; } .lm-kpis span { font-size: .68rem; }
  .lm-top .brand__name { display: none; }
}
@media (prefers-reduced-motion: reduce) { .lm-call { animation: none; } }

/* MTQ (identifiant GCSR) : jaune et blanc */
.dwv[data-svc=GCSR] .dwv__bar i:nth-child(1), .dwv[data-svc=GCSR] .dwv__bar i:nth-child(3) { background: #ffcc00 !important; color: #ffcc00 !important; }
.dwv[data-svc=GCSR] .dwv__bar i:nth-child(2) { background: #ffffff !important; color: #ffffff !important; }
.dwv[data-svc=GCSR].is-enroute .dwv__bar i:nth-child(3) { animation-name: lbB; }

/* Administration : services */
.svcgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .8rem; margin-top: .8rem; }
.svccard { border: 1px solid var(--line); border-left: 4px solid var(--svc); border-radius: var(--r); padding: .8rem .9rem; background: var(--panel); }
.svccard.is-off { opacity: .6; border-left-style: dashed; }
.svccard header { display: flex; align-items: center; gap: .6rem; }
.svccard header > div { flex: 1; min-width: 0; }
.svccard header small { display: block; color: var(--muted); font-size: .8rem; }
.svccard__ico { position: relative; width: 34px; height: 34px; flex: none; }
.svccard__kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin: .7rem 0 0; }
.svccard__kpis div { text-align: center; } .svccard__kpis dt { font-size: .7rem; color: var(--muted); } .svccard__kpis dd { margin: 0; font: 700 1.05rem var(--fc); }
.box--danger { border-color: rgba(240, 82, 74, .45); }

/* Construction : regroupement par service */
.build__svc { grid-column: 1 / -1; flex: 0 0 100%; width: 100%; margin: .6rem 0 0; font: 700 .82rem var(--fc); text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  display: flex; align-items: center; gap: .45rem; }
.build__svc::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--svc, var(--muted)); }
.dwv__tag { min-width: 14px; }

.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .8rem; margin-top: .8rem; }
.lcard { border: 1px solid var(--line); border-radius: var(--r); padding: .8rem; background: var(--panel); }
.lcard header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.lprev { display: flex; gap: 1.6rem; padding: 12px 10px 2px; background: #1b2430; border-radius: var(--r-sm); }
.lprev__v { position: relative; width: 30px; height: 30px; }
.lcolors { display: flex; gap: .6rem; margin-bottom: .4rem; }
.lcolors label { display: flex; flex-direction: column; gap: .15rem; font-size: .75rem; color: var(--muted); }
.lcolors input[type=color] { width: 54px; height: 34px; padding: 0; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: none; }
.cards.cards--build { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
@media (max-width: 640px) { .cards.cards--build { grid-template-columns: minmax(0, 1fr); } }

pre.code { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .5rem .7rem; overflow-x: auto; font-size: .8rem; white-space: pre; }

/* ===================================================================== Accueil v3 : une seule page, épurée */
.page-land--v3 { overflow-x: hidden; }
.l3 { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; isolation: isolate; }
.l3__bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.l3__bg .radar--bg { width: 100%; height: 100%; opacity: .55; filter: none; }
.l3__bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 82%, transparent) 45%, color-mix(in srgb, var(--bg) 35%, transparent) 100%); }
.l3__bg .radar__bg { display: none; }
.l3__nav { display: flex; justify-content: space-between; align-items: center; padding: 1rem clamp(1rem, 5vw, 4rem); }
.l3__hero { flex: 1; display: grid; grid-template-columns: 1.1fr minmax(320px, 420px); gap: clamp(1.5rem, 5vw, 5rem); align-items: center;
  max-width: 1180px; width: 100%; margin: 0 auto; padding: 1rem clamp(1rem, 5vw, 4rem) 2rem; }
.l3__hero .hero__title { font-size: clamp(2.3rem, 5.4vw, 4rem); }
.l3__live { margin: 1.2rem 0 0; color: var(--muted); font-size: .92rem; }
.l3__live b { color: var(--hi); font-variant-numeric: tabular-nums; }
.l3__live a { color: var(--hi); }
.l3 .auth__card { background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(8px); }
.l3__foot { border-top: 0; padding: 1rem; }
@media (max-width: 900px) {
  .l3__hero { grid-template-columns: 1fr; padding-top: 0; }
  .l3__bg::after { background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 40%, transparent) 0%, var(--bg) 55%); }
  .l3 .auth__card { margin-bottom: 1rem; }
}
@media (max-width: 560px) { .l3__hero .hero__cta .btn { flex: 1 1 100%; } }

/* ===================================================================== Administration Premium++
   Barre latérale regroupée (rétractable / tiroir mobile), en-tête fixe avec recherche globale,
   contenu en cartes aérées. Toutes les sections existantes sont conservées. */
.ax-body { background: var(--bg); }
.ax { --axw: 256px; display: grid; grid-template-columns: var(--axw) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; transition: grid-template-columns .2s ease; }
.ax.is-mini { --axw: 72px; }
.ax__side { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--bg-2); border-right: 1px solid var(--line); overflow: hidden; z-index: 40; }
.ax__brand { display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: .9rem .9rem .7rem; min-height: 60px; }
.ax__brand .brand__name { white-space: nowrap; }
.ax__collapse { width: 32px; height: 32px; flex: none; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--muted); cursor: pointer; display: grid; place-items: center; transition: transform .2s; }
.ax.is-mini .ax__collapse { transform: rotate(180deg); }
.ax.is-mini .ax__brand { flex-direction: column; padding: .8rem .5rem; }
.ax.is-mini .brand__name, .ax.is-mini .ax__glbl, .ax.is-mini .ax__nav a span, .ax.is-mini .ax__nav a em, .ax.is-mini .ax__link span { display: none; }
.ax__nav { flex: 1; overflow-y: auto; padding: .2rem .6rem 1rem; display: block; position: static; }
.ax__grp { margin-bottom: .6rem; }
.ax__glbl { margin: .8rem .6rem .3rem; font: 700 .68rem var(--fc); letter-spacing: .09em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.ax__nav a, .ax__link { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; white-space: nowrap; position: relative; }
.ax__nav a svg, .ax__link svg { flex: none; opacity: .85; }
.ax__nav a:hover, .ax__link:hover { background: var(--panel); color: var(--hi); }
.ax__nav a.is-on { background: color-mix(in srgb, #3E8BFF 14%, var(--panel)); color: var(--hi); }
.ax__nav a.is-on::before { content: ''; position: absolute; left: -.6rem; top: 20%; bottom: 20%; width: 3px; border-radius: 0 3px 3px 0; background: #3E8BFF; }
.ax__nav a em { margin-left: auto; font: 600 .66rem var(--fc); font-style: normal; color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 0 .4rem; }
.ax.is-mini .ax__nav a, .ax.is-mini .ax__link { justify-content: center; padding: .6rem; }
.ax__foot { padding: .6rem; border-top: 1px solid var(--line); }
.ax__main { min-width: 0; display: flex; flex-direction: column; }
.ax__top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem; padding: .7rem clamp(1rem, 3vw, 2rem); min-height: 60px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.ax__burger { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); cursor: pointer; place-items: center; }
.ax__title { display: flex; flex-direction: column; min-width: 0; }
.ax__title small { font: 600 .7rem var(--fc); color: var(--dim); text-transform: uppercase; letter-spacing: .07em; }
.ax__title b { font: 800 1.1rem var(--fc); color: var(--hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax__search { position: relative; margin-left: auto; flex: 0 1 420px; display: flex; align-items: center; gap: .5rem; padding: 0 .8rem; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--muted); }
.ax__search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: inherit; outline: none; height: 100%; }
.ax__search:focus-within { border-color: #3E8BFF; box-shadow: 0 0 0 3px rgba(62, 139, 255, .18); }
.ax__results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.3); padding: .35rem; max-height: 60vh; overflow-y: auto; }
.ax__results button { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .55rem .6rem; border: 0; background: none; color: var(--text); border-radius: 8px; text-align: left; cursor: pointer; }
.ax__results button:hover, .ax__results button.is-sel { background: var(--panel-2); }
.ax__results span { display: flex; flex-direction: column; min-width: 0; }
.ax__results small { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax__who { display: flex; align-items: center; gap: .4rem; white-space: nowrap; font-size: .85rem; color: var(--muted); }
.ax-body .admin.ax__content { display: block; max-width: 1240px; width: 100%; margin: 0 auto; padding: 1.6rem clamp(1rem, 3vw, 2.2rem) 4rem; }
.ax-body .admin__sec { grid-column: auto; margin: 0; }
.ax-body .admin__sec > h1 { font: 800 clamp(1.4rem, 2.4vw, 1.8rem) var(--fc); color: var(--hi); margin: 0 0 .2rem; }
.ax__lead { color: var(--muted); margin: 0 0 1.3rem; }
/* cartes, tableaux et formulaires plus aérés */
.ax-body .box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem; margin: 0 0 1rem; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.ax-body .box .h3, .ax-body .box h2.h3, .ax-body .box h3.h3 { font: 700 1rem var(--fc); margin: 0 0 .6rem; color: var(--hi); }
.ax-body .kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.ax-body .kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem; }
.ax-body .kpi b { font-size: 1.45rem; }
.ax-body .table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: auto; }
.ax-body .tbl { width: 100%; border-collapse: collapse; }
.ax-body .tbl thead th { position: sticky; top: 0; background: var(--bg-2); font: 700 .74rem var(--fc); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .65rem .8rem; text-align: left; border-bottom: 1px solid var(--line); }
.ax-body .tbl td { padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ax-body .tbl tbody tr:hover td { background: color-mix(in srgb, var(--panel-2) 60%, transparent); }
.ax-body .tbl tbody tr:last-child td { border-bottom: 0; }
.ax-body .field input, .ax-body .field select, .ax-body .field textarea { border-radius: 10px; }
.ax-body .grid4 { gap: .8rem 1rem; }
.ax-body .actions { gap: .5rem; }
@media (max-width: 900px) {
  .ax, .ax.is-mini { grid-template-columns: minmax(0, 1fr); }
  .ax__side { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .ax.is-open .ax__side { transform: none; }
  .ax.is-mini .brand__name, .ax.is-mini .ax__glbl, .ax.is-mini .ax__nav a span, .ax.is-mini .ax__link span { display: initial; }
  .ax__collapse { display: none; }
  .ax__scrim { position: fixed; inset: 0; z-index: 35; background: rgba(5, 10, 16, .5); }
  .ax__burger { display: grid; }
  .ax__top { gap: .6rem; flex-wrap: wrap; }
  .ax__search { order: 3; flex: 1 1 100%; margin-left: 0; }
  .ax__who .ax__uname { display: none; }
  .ax-body .admin.ax__content { padding: 1rem .8rem 3rem; }
  .ax-body .box { padding: .9rem; }
}
@media (prefers-reduced-motion: reduce) { .ax, .ax__side, .ax__collapse { transition: none; } }

.ax-body .kpi--link { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: .15rem; transition: border-color .15s, transform .15s; }
.ax-body .kpi--link:hover { border-color: #3E8BFF; transform: translateY(-1px); }
.ax-body .kpi small { color: var(--muted); font-size: .78rem; }
.dashgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.dashgrid .box { margin: 0; }
.statlist { list-style: none; margin: 0 0 .4rem; padding: 0; display: grid; gap: .45rem; font-size: .9rem; }
.shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.shortcuts a { padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--text); font-weight: 600; font-size: .88rem; }
.shortcuts a:hover { border-color: #3E8BFF; color: var(--hi); }

/* Accueil : la vraie carte en direct en arrière-plan */
.l3__map { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; background: var(--bg); }
.l3__map.is-ready { opacity: 1; }
.l3__map, .l3__map * { pointer-events: none !important; }
.l3__map .leaflet-control-attribution { pointer-events: auto !important; font-size: 10px; opacity: .7; }
.l3__map .leaflet-control-container .leaflet-bottom.leaflet-right { pointer-events: auto !important; }
.l3__bg::after { pointer-events: none; z-index: 400; }
@media (prefers-reduced-motion: reduce) { .l3__map { transition: none; } }

/* Bonus des véhicules */
.perks { display: inline-flex; flex-wrap: wrap; gap: .25rem; margin-left: .3rem; }
.perks em { font: 600 .7rem var(--fc); font-style: normal; color: #1f9d5c; background: rgba(53, 199, 122, .12); border: 1px solid rgba(53, 199, 122, .35); border-radius: 999px; padding: .05rem .45rem; }
.pickgroup--cap { border-color: rgba(242, 179, 61, .6); }
.mbonus { display: flex; flex-wrap: wrap; gap: .3rem; margin: .1rem 0 .5rem; }
.vbonus dd { display: flex; flex-wrap: wrap; gap: .3rem; }
.bonuscell { min-width: 220px; } .bonuscell .tag { margin: 0 .2rem .2rem 0; display: inline-block; }

/* Séquences lumineuses : jusqu'à 6 feux (les feux inutilisés sont masqués par la séquence) */
.dwv__bar i:nth-child(n+4) { display: none; }
.dwv__bar { max-width: 46px; }

.lsw { display: flex; gap: 4px; margin: .2rem 0 .6rem; } .lsw i { width: 22px; height: 12px; border-radius: 3px; border: 1px solid var(--line-2); }
.lcard header > div { display: flex; flex-direction: column; }
.lcolors label { position: relative; }
.qframes { display: flex; flex-direction: column; gap: .3rem; }
.qframe { display: flex; align-items: center; gap: .3rem; } .qframe small { width: 18px; color: var(--muted); }
.qcell { width: 28px; height: 20px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; }
.qcell.is-on { background: var(--c); box-shadow: 0 0 8px var(--c); }
.qprev { display: flex; align-items: center; gap: 1.6rem; padding: 14px 12px 6px; background: #1b2430; border-radius: var(--r); }
.qprev .hint { color: #c9d4df; }
.zlib { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; margin-bottom: .5rem; } .zlib .field { flex: 1 1 260px; margin: 0; }

/* Mode Alliance sur la carte */
.fab--ally { width: auto; padding: 0 .8rem; gap: .4rem; display: inline-flex; align-items: center; font: 700 .82rem var(--fc); }
.fab--ally.is-on { background: #3E8BFF; color: #fff; border-color: #3E8BFF; }
.allyfilter { position: absolute; top: 70px; right: 14px; z-index: 900; width: min(320px, calc(100% - 28px)); max-height: 50vh; overflow-y: auto; background: var(--panel);
  border: 1px solid var(--line-2); border-radius: 14px; padding: .7rem .8rem; box-shadow: 0 10px 30px rgba(0,0,0,.3); display: flex; flex-direction: column; gap: .45rem; }
.af__row { display: flex; flex-wrap: wrap; gap: .3rem; }
.af__chip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .5rem; border: 1px solid var(--line); border-radius: 999px; font-size: .8rem; cursor: pointer; }
.af__chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.af__chip input { margin: 0; }
.ally-wrap { background: none; border: 0; }
.allyb { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font: 800 .66rem var(--fc); color: #fff; background: var(--svc); border: 3px solid var(--pc); box-shadow: 0 2px 6px rgba(0,0,0,.4); }
/* Renforts demandés */
.renforts { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 950; display: flex; flex-direction: column; gap: .4rem; width: min(440px, calc(100% - 24px)); pointer-events: none; }
.rcard { pointer-events: auto; background: var(--panel); border: 1px solid #f2b33d; border-radius: 12px; padding: .65rem .8rem; box-shadow: 0 10px 30px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: .2rem; }
.rcard__btns { display: flex; justify-content: flex-end; gap: .4rem; margin-top: .3rem; }
.rlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.rlist li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 10px; }
.rlist li span { display: flex; flex-direction: column; }
@media (max-width: 640px) { .fab--ally span { display: none; } .allyfilter { top: 60px; } }
/* Filtre d'alliance en bas à gauche de la carte : ne recouvre jamais le panneau de répartition */
.allyfilter { top: auto !important; right: auto !important; left: 56px; bottom: 16px; }
@media (max-width: 640px) { .allyfilter { left: 8px; right: 8px !important; width: auto; bottom: 110px; max-height: 38vh; } }


/* =====================================================================
   PALETTE PREMIUM++ — Noir #101114 · Anthracite #242831 · Gris #858D9B · Blanc #F7F8FA · Rouge #E3293E
   Base sombre noir/anthracite, accent rouge (actions, sélection, focus), couleurs des services
   conservées pour l'information. Le thème clair inverse noir et blanc avec le même rouge.
   ===================================================================== */
:root {
  --bg: #101114; --bg-2: #15171B; --panel: #1C1F25; --panel-2: #242831; --line: #2D313A; --line-2: #3B404B;
  --text: #E9EBEF; --muted: #9AA1AD; --dim: #6C7380; --hi: #F7F8FA;
  --accent: #E3293E; --accent-2: #FF5468; --accent-d: #B81C2F; --accent-soft: rgba(227, 41, 62, .14);
  --grad: linear-gradient(135deg, #FF4258 0%, #E3293E 45%, #B81C2F 100%);
}
html[data-theme=light] {
  --bg: #F7F8FA; --bg-2: #FFFFFF; --panel: #FFFFFF; --panel-2: #EEF0F3; --line: #E0E3E8; --line-2: #C9CED6;
  --text: #101114; --muted: #5C6370; --dim: #858D9B; --hi: #101114;
  --accent-soft: rgba(227, 41, 62, .10);
}
a { color: var(--accent-2); }
html[data-theme=light] a { color: var(--accent-d); }
:focus-visible { outline-color: var(--accent); }
::selection { background: rgba(227, 41, 62, .35); }

/* Boutons : l'action principale en dégradé rouge */
.btn--primary, html[data-theme=light] .btn--primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(227, 41, 62, .28); }
.btn--primary:hover:not(:disabled), html[data-theme=light] .btn--primary:hover:not(:disabled) { background: var(--grad); filter: brightness(1.08); border-color: transparent; box-shadow: 0 8px 24px rgba(227, 41, 62, .4); }
.btn--primary:disabled { filter: grayscale(.6); box-shadow: none; }
.btn { border-radius: 10px; transition: transform .12s, box-shadow .15s, filter .15s, border-color .15s, background .15s; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn--danger { color: var(--accent-2); }
.badge { background: var(--accent); color: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }

/* Barre du haut du jeu */
.topbar { background: linear-gradient(180deg, #17191E, #101114); border-bottom: 1px solid var(--line); box-shadow: inset 0 -2px 0 rgba(227, 41, 62, .55); }
html[data-theme=light] .topbar { background: linear-gradient(180deg, #FFFFFF, #F3F4F7); }
.hchip { background: var(--panel-2); border-color: var(--line-2); }
html[data-theme=light] .hchip { background: #fff; }
.hchip:hover { border-color: var(--accent); }
.brand__mark { background: var(--grad) !important; box-shadow: 0 0 14px rgba(227, 41, 62, .55); }

/* Panneau : onglet actif souligné de rouge */
.panel__tabs button[role=tab].is-on, .panel__tabs button[role=tab][aria-selected=true] { color: var(--hi); box-shadow: inset 0 -3px 0 var(--accent); }
.seg button.is-on { background: var(--accent); color: #fff; border-color: var(--accent); }
.box, .kpi, .card-btn { border-radius: 14px; }
.box { background: var(--panel); border-color: var(--line); }
.modal { border-top: 3px solid var(--accent); }

/* Accueil : titre en dégradé blanc → rouge */
.hero__title span { background: linear-gradient(90deg, #F7F8FA 0%, #FF5468 55%, #E3293E 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
html[data-theme=light] .hero__title span { background: linear-gradient(90deg, #101114 0%, #B81C2F 60%, #E3293E 100%); -webkit-background-clip: text; background-clip: text; }
.page-land { background: radial-gradient(900px 500px at 85% -10%, rgba(227, 41, 62, .18), transparent 60%), var(--bg); }
.l3__bg::after { background: linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 82%, transparent) 45%, color-mix(in srgb, var(--bg) 30%, transparent) 100%); }
.pub__live { background: var(--accent); box-shadow: 0 0 0 0 rgba(227, 41, 62, .6); animation-name: liveRed; }
@keyframes liveRed { 70% { box-shadow: 0 0 0 8px rgba(227, 41, 62, 0); } 100% { box-shadow: 0 0 0 0 rgba(227, 41, 62, 0); } }
.auth__card { border-color: var(--line-2); box-shadow: 0 30px 80px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .04); }
.tabs button.is-on, [data-tab].is-on { background: var(--accent) !important; color: #fff !important; }

/* ===================================================================== Administration : menu joyeux */
.ax__side { background: linear-gradient(180deg, #17191E 0%, #101114 60%, #0C0D10 100%); border-right: 1px solid var(--line); }
html[data-theme=light] .ax__side { background: linear-gradient(180deg, #FFFFFF 0%, #F7F8FA 100%); }
.ax__side::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 160px; pointer-events: none;
  background: radial-gradient(220px 120px at 30% 0%, rgba(227, 41, 62, .28), transparent 70%); }
.ax__brand { position: relative; }
.ax__brand .brand__name { color: var(--hi); font-weight: 800; letter-spacing: .01em; }
.ax__collapse:hover { border-color: var(--accent); color: var(--hi); }
.ax__glbl { display: flex; align-items: center; gap: .45rem; color: var(--muted); }
.ax__glbl i { width: 7px; height: 7px; border-radius: 50%; background: var(--ic); box-shadow: 0 0 8px var(--ic); }
.ax__nav a { gap: .65rem; padding: .42rem .55rem; margin: 2px 0; color: var(--text); font-weight: 600; transition: background .15s, transform .15s, color .15s; }
.ax__ico { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 10px;
  background: color-mix(in srgb, var(--ic) 16%, transparent); color: var(--ic); border: 1px solid color-mix(in srgb, var(--ic) 30%, transparent); transition: all .15s; }
.ax__ico svg { opacity: 1 !important; }
.ax__nav a:hover { background: color-mix(in srgb, var(--ic) 10%, transparent); transform: translateX(2px); }
.ax__nav a:hover .ax__ico { background: color-mix(in srgb, var(--ic) 26%, transparent); }
.ax__nav a.is-on { background: linear-gradient(90deg, rgba(227, 41, 62, .22), rgba(227, 41, 62, .04)); color: var(--hi); }
.ax__nav a.is-on .ax__ico { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(227, 41, 62, .45); }
.ax__nav a.is-on::before { background: var(--accent); width: 4px; left: -.6rem; box-shadow: 0 0 10px var(--accent); }
.ax.is-mini .ax__lbl { display: none; }
.ax__foot .ax__link { color: var(--muted); }
.ax__foot .ax__link:hover { color: var(--hi); background: var(--accent-soft); }
.ax__top { box-shadow: inset 0 -1px 0 var(--line); }
.ax__title small { color: var(--accent-2); }
html[data-theme=light] .ax__title small { color: var(--accent-d); }
.ax__search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ax__results button.is-sel, .ax__results button:hover { background: var(--accent-soft); }
.ax-body .admin__sec > h1 { background: linear-gradient(90deg, var(--hi), color-mix(in srgb, var(--hi) 60%, var(--accent))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ax-body .box { border-top: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }
.ax-body .tbl thead th { color: var(--muted); }
/* Tableau de bord : chaque indicateur a sa couleur */
.ax-body .kpis .kpi--link { position: relative; overflow: hidden; border-left: 4px solid var(--kc, var(--accent)); }
.ax-body .kpis .kpi--link::after { content: ''; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: var(--kc, var(--accent)); opacity: .1; }
.ax-body .kpis .kpi--link:nth-child(6n+1) { --kc: #E3293E; } .ax-body .kpis .kpi--link:nth-child(6n+2) { --kc: #3E8BFF; }
.ax-body .kpis .kpi--link:nth-child(6n+3) { --kc: #2BC4A9; } .ax-body .kpis .kpi--link:nth-child(6n+4) { --kc: #F2B33D; }
.ax-body .kpis .kpi--link:nth-child(6n+5) { --kc: #B48CFF; } .ax-body .kpis .kpi--link:nth-child(6n) { --kc: #858D9B; }
.ax-body .kpis .kpi--link b { color: var(--hi); }
.shortcuts a { background: var(--panel-2); position: relative; padding-left: 1.6rem; }
.shortcuts a::before { content: ''; position: absolute; left: .7rem; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--accent); }
.shortcuts a:hover { border-color: var(--accent); background: var(--accent-soft); }
.pill--warn { background: rgba(227, 41, 62, .16); color: #FF8A97; border-color: rgba(227, 41, 62, .4); }
html[data-theme=light] .pill--warn { color: var(--accent-d); }
@media (prefers-reduced-motion: reduce) { .ax__nav a, .ax__ico, .btn { transition: none; } .ax__nav a:hover { transform: none; } }
.ax.is-mini .ax__nav a span.ax__ico { display: grid !important; }
html[data-theme=light] .ax__nav a, html[data-theme=light] .shortcuts a, html[data-theme=light] .ax-body .kpi--link { color: var(--text); }
html[data-theme=light] .ax__nav a.is-on { color: var(--hi); }
html[data-theme=light] .ax__side::before { background: radial-gradient(220px 120px at 30% 0%, rgba(227, 41, 62, .14), transparent 70%); }

/* ===================================================================== Administration : respiration
   Espacements réguliers entre les blocs, les grilles et les champs (rien ne se touche). */
.ax-body .admin__sec > div > *:not(:last-child) { margin-bottom: 1.4rem; }
.ax-body .admin__sec > div > * + section, .ax-body .admin__sec > div > section + * { margin-top: 1.4rem; }
.ax-body .box { margin: 0 0 1.4rem; padding: 1.25rem 1.35rem 1.35rem; }
.ax-body .box > .h3, .ax-body .box > h2.h3, .ax-body .box > h3.h3 { margin-bottom: .9rem; }
.ax-body .box > .hint + * , .ax-body .box > p + .grid4 { margin-top: .6rem; }
.ax-body .tplhead { margin: .4rem 0 1rem; gap: 1rem; }
.ax-body .lgrid, .ax-body .tplgrid, .ax-body .svcgrid, .ax-body .dashgrid { gap: 1.1rem; margin: 0 0 1.6rem; }
.ax-body .lcard, .ax-body .tpl, .ax-body .svccard { padding: 1.05rem 1.1rem; display: flex; flex-direction: column; gap: .7rem; }
.ax-body .lcard .lsw, .ax-body .lcard header { margin: 0; }
.ax-body .lcard .actions, .ax-body .tpl .actions { margin-top: auto; padding-top: .3rem; gap: .5rem; justify-content: flex-start; }
.ax-body .grid4 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.1rem 1.25rem; align-items: end; margin-bottom: 1rem; }
.ax-body .field { gap: .45rem; min-width: 0; }
.ax-body .field > span { line-height: 1.3; }
.ax-body .field select, .ax-body .field input { min-height: 42px; }
.ax-body .checks { display: flex; flex-wrap: wrap; gap: .55rem .9rem; margin: .4rem 0 .9rem; }
.ax-body .actions { gap: .6rem; margin-top: 1.1rem; }
.ax-body .kpis { gap: 1rem; margin-bottom: 1.6rem; }
.ax-body .table-wrap { margin: .6rem 0 1rem; }
.ax-body .hint { margin: .35rem 0 .9rem; }
.ax-body .ax__lead { margin-bottom: 1.6rem; }
.ax-body .stack > * + * { margin-top: 1.1rem; }
.modal .grid4 { gap: 1rem 1.2rem; align-items: end; }
.modal .checks { display: flex; flex-wrap: wrap; gap: .55rem .9rem; }
.modal .box { margin-bottom: 1.1rem; }
@media (max-width: 640px) {
  .ax-body .grid4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .9rem; }
  .ax-body .box { padding: 1rem; }
}
.lmgrp { padding-top: .9rem; margin-top: .9rem; border-top: 1px solid var(--line); }
.lmgrp:first-of-type { border-top: 0; margin-top: .3rem; }
.lmgrp__h { display: flex; align-items: center; gap: .5rem; margin: 0 0 .8rem; font: 700 .9rem var(--fc); color: var(--hi); }
.lmgrp__h::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--svc); }

/* ===================================================================== Flotte : tableau compact */
.modal--fleet { width: min(1180px, 96vw); max-width: 1180px; }
.fl__top { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .7rem; }
.fl__search { flex: 1 1 280px; }
.fl__search input { width: 100%; min-height: 42px; padding: .5rem .8rem; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line-2); }
.fl__sel { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.fl__sel select { min-height: 42px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line-2); padding: 0 .6rem; }
.fl__toggle { display: inline-flex; gap: .4rem; align-items: center; font-size: .9rem; color: var(--muted); }
.fl__chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .6rem; }
.fl__chip { display: inline-flex; gap: .45rem; align-items: center; min-height: 36px; padding: 0 .75rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: 600 .85rem var(--fc); cursor: pointer; }
.fl__chip b { background: var(--bg-2); border-radius: 999px; padding: 0 .45rem; font-size: .78rem; color: var(--muted); }
.fl__chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.fl__chip.is-on b { background: rgba(255,255,255,.2); color: #fff; }
.fl__info { color: var(--muted); font-size: .88rem; margin: .2rem 0 .5rem; }
.fl__wrap { border: 1px solid var(--line); border-radius: 12px; overflow: auto; }
.fl__tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.fl__tbl th { position: sticky; top: 0; z-index: 1; background: var(--bg-2); text-align: left; padding: 0; border-bottom: 1px solid var(--line); }
.fl__sort { width: 100%; text-align: left; background: none; border: 0; padding: .55rem .6rem; color: var(--muted); font: 700 .74rem var(--fc); text-transform: uppercase; letter-spacing: .05em; cursor: pointer; white-space: nowrap; }
.fl__sort.is-on { color: var(--hi); }
.fl__tbl td { padding: .45rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.fl__tbl tbody tr { box-shadow: inset 3px 0 0 var(--svc); }
.fl__tbl tbody tr:hover td { background: color-mix(in srgb, var(--panel-2) 70%, transparent); }
.fl__tbl tr.is-sel td { background: var(--accent-soft); }
.fl__ck { width: 34px; text-align: center; }
.fl__ck input { width: 18px; height: 18px; }
.fl__name { min-width: 200px; }
.fl__name .linkbtn { display: inline-flex; align-items: center; gap: .45rem; color: var(--hi); }
.fl__name small { display: block; color: var(--muted); padding-left: 34px; font-size: .78rem; }
.fl__ico { position: relative; width: 26px; height: 26px; display: inline-block; }
.fl__ico .dwv { transform: scale(.78); transform-origin: top left; position: absolute; left: 0; top: 0; }
.wbar { display: inline-block; width: 46px; height: 6px; border-radius: 4px; background: var(--line-2); margin-right: .35rem; vertical-align: middle; overflow: hidden; }
.wbar i { display: block; height: 100%; background: var(--w); }
.fl__pager { display: flex; align-items: center; justify-content: center; gap: .8rem; margin: .8rem 0; color: var(--muted); }
.fl__grp { border: 1px solid var(--line); border-radius: 12px; margin-bottom: .5rem; overflow: hidden; }
.fl__gh { width: 100%; display: flex; align-items: center; gap: .6rem; padding: .65rem .8rem; background: var(--panel-2); border: 0; color: var(--text); cursor: pointer; text-align: left; box-shadow: inset 4px 0 0 var(--svc); }
.fl__gh small { color: var(--muted); }
.fl__chev { transition: transform .15s; } .fl__grp.is-open .fl__chev { transform: rotate(90deg); }
.fl__gsel { margin-left: auto; font: 600 .8rem var(--fc); color: var(--accent-2); padding: .2rem .5rem; border-radius: 6px; }
.fl__gsel:hover { background: var(--accent-soft); }
.fl__grp .fl__wrap { border: 0; border-radius: 0; }
.fl__bar { position: sticky; bottom: 0; z-index: 3; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .8rem; padding: .65rem .8rem;
  background: var(--panel); border: 1px solid var(--accent); border-radius: 12px; box-shadow: 0 -8px 24px rgba(0,0,0,.3); }
.fl__acts { display: flex; flex-wrap: wrap; gap: .4rem; margin-left: auto; align-items: center; }
.fl__acts select { min-height: 36px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line-2); }
/* Téléphone : lignes compactes en cartes, jamais de tableau qui déborde */
@media (max-width: 760px) {
  .fl__sel { width: 100%; } .fl__sel select { flex: 1 1 45%; min-width: 0; }
  .fl__wrap { border: 0; overflow: visible; }
  .fl__tbl thead { display: none; }
  .fl__tbl, .fl__tbl tbody { display: block; }
  .fl__tbl tbody tr { display: grid; grid-template-columns: 34px 1fr auto; grid-template-areas: "ck name st" "ck meta meta"; gap: .1rem .4rem; padding: .55rem .4rem;
    border: 1px solid var(--line); border-radius: 12px; margin-bottom: .45rem; background: var(--panel); }
  .fl__tbl td { border: 0; padding: 0; white-space: normal; }
  .fl__tbl td.fl__ck { grid-area: ck; align-self: center; }
  .fl__tbl td.fl__name { grid-area: name; min-width: 0; }
  .fl__tbl td:nth-child(4) { grid-area: st; }
  .fl__tbl td.fl__bld, .fl__tbl td.fl__fuel, .fl__tbl td.fl__wear, .fl__tbl td.fl__lvl, .fl__tbl td.fl__val { display: inline-block; font-size: .78rem; color: var(--muted); }
  .fl__tbl td.fl__bld { grid-area: meta; }
  .fl__tbl td.fl__fuel, .fl__tbl td.fl__wear, .fl__tbl td.fl__lvl, .fl__tbl td.fl__val { display: none; }
  .fl__bar { flex-direction: column; align-items: stretch; } .fl__acts { margin-left: 0; }
}

/* ===================================================================== Mode construction persistant */
.fab--build { width: auto; padding: 0 .9rem; gap: .4rem; display: inline-flex; align-items: center; font: 700 .85rem var(--fc); background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(227, 41, 62, .35); }
.fab--build.is-on { filter: brightness(1.1); box-shadow: 0 0 0 3px rgba(227, 41, 62, .35), 0 6px 18px rgba(227, 41, 62, .35); }
.buildpanel { position: absolute; left: 12px; top: 12px; bottom: 12px; z-index: 880; width: 340px; display: flex; flex-direction: column; gap: .55rem; padding: .8rem;
  background: color-mix(in srgb, var(--panel) 96%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 16px 40px rgba(0, 0, 0, .4); }
.bp__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.bp__head div { display: flex; flex-direction: column; } .bp__head b { font: 800 1.1rem var(--fc); color: var(--hi); } .bp__head small { color: var(--muted); }
.bp__q { width: 100%; min-height: 40px; padding: .45rem .7rem; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); }
.bp__cats { display: flex; gap: .3rem; overflow-x: auto; padding-bottom: .2rem; scrollbar-width: thin; }
.bp__cat { flex: none; min-height: 32px; padding: 0 .65rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: 600 .78rem var(--fc); cursor: pointer; box-shadow: inset 3px 0 0 var(--svc, transparent); }
.bp__cat.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.bp__list { flex: 1; overflow-y: auto; display: flex !important; flex-direction: column; gap: .35rem; padding-right: .15rem; }
.bp__item { display: grid !important; grid-template-columns: 34px 1fr auto; align-items: center; gap: .55rem; text-align: left; padding: .5rem .6rem !important; min-height: 0 !important;
  border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); box-shadow: inset 3px 0 0 var(--svc); cursor: pointer; }
.bp__item:hover:not(:disabled) { border-color: var(--accent); }
.bp__item.is-on { border-color: var(--accent); background: var(--accent-soft); }
.bp__item:disabled { opacity: .55; cursor: not-allowed; }
.bp__ico { position: relative; width: 30px; height: 30px; }
.bp__txt { display: flex; flex-direction: column; min-width: 0; } .bp__txt b { color: var(--hi); font-size: .92rem; } .bp__txt small { color: var(--muted); font-size: .76rem; }
.bp__price { font: 700 .85rem var(--fc); color: var(--hi); white-space: nowrap; }
@media (max-width: 760px) {
  .buildpanel { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 52vh; }
  body.is-placing .buildpanel { max-height: none; }
  body.is-placing .buildpanel .bp__list, body.is-placing .buildpanel .bp__cats, body.is-placing .buildpanel .bp__q { display: none !important; }
  .fab--build span { display: none; }
}
@media (max-width: 760px) { body.is-placing .buildpanel { display: none !important; } }
@media (min-width: 761px) { body.is-building #build-banner { left: 364px; width: min(460px, calc(100% - var(--panel-w) - 380px)); } }

/* ===================================================================== Recrutement */
.cvbtn { position: relative; display: inline-flex; align-items: center; gap: .4rem; min-height: 38px; padding: 0 .75rem; margin-left: .6rem; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--hi); font: 700 .82rem var(--fc); cursor: pointer; }
.cvbtn:hover { border-color: var(--accent); }
.cvbtn .ico { width: 18px; height: 18px; }
.cvbtn__n { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font: 800 .72rem/20px var(--fc); text-align: center; box-shadow: 0 0 0 2px var(--bg); }
@media (max-width: 760px) { .cvbtn span { display: none; } .cvbtn { margin-left: .3rem; padding: 0 .55rem; } }
.modal--staff { width: min(1100px, 96vw); max-width: 1100px; }
.staff__tabs { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.staff__tabs button { display: inline-flex; gap: .45rem; align-items: center; min-height: 40px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: 700 .88rem var(--fc); cursor: pointer; }
.staff__tabs button b { background: var(--bg-2); border-radius: 999px; padding: 0 .45rem; font-size: .76rem; }
.staff__tabs button.is-on { background: var(--accent); border-color: var(--accent); color: #fff; } .staff__tabs button.is-on b { background: rgba(255,255,255,.2); }
.cvs { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 1rem; min-height: 360px; }
.cvlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; max-height: 62vh; overflow-y: auto; }
.cvrow { width: 100%; display: grid; grid-template-columns: 42px 1fr auto; gap: .6rem; align-items: center; text-align: left; padding: .6rem .7rem; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; box-shadow: inset 3px 0 0 var(--svc); }
.cvrow:hover, .cvrow.is-on { border-color: var(--accent); } .cvrow.is-on { background: var(--accent-soft); }
.cvrow.is-new .cvrow__t b::after { content: 'Nouveau'; margin-left: .4rem; padding: 0 .4rem; border-radius: 999px; background: var(--accent); color: #fff; font: 700 .65rem/1.5 var(--fc); vertical-align: middle; }
.cvrow__av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--svc) 25%, var(--bg-2)); color: var(--hi); font: 800 .9rem var(--fc); border: 2px solid var(--svc); }
.cvrow__av--big { width: 60px; height: 60px; font-size: 1.15rem; }
.cvrow__t { display: flex; flex-direction: column; min-width: 0; } .cvrow__t small { color: var(--muted); font-size: .78rem; } .cvrow__q { color: #F2B33D !important; }
.cvrow__s { font: 700 .8rem var(--fc); color: var(--hi); white-space: nowrap; }
.cvdetail { border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem; background: var(--panel); }
.cvdetail__back { display: none; margin-bottom: .6rem; }
.cvhead { display: flex; gap: .9rem; align-items: center; margin-bottom: .8rem; } .cvhead h3 { margin: 0; font: 800 1.25rem var(--fc); color: var(--hi); } .cvhead p { margin: .15rem 0 0; color: var(--muted); }
.cvpitch { margin: 0 0 1rem; padding: .7rem .9rem; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; font-style: italic; }
.cvdl { display: grid; gap: .7rem; margin: 0 0 1rem; } .cvdl dt { color: var(--muted); font-size: .8rem; margin-bottom: .25rem; } .cvdl dd { margin: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.tag--q { border-color: rgba(242, 179, 61, .5); color: #F2B33D; } .tag--warn { border-color: rgba(227, 41, 62, .5); color: var(--accent-2); }
.cvact { border-top: 1px solid var(--line); padding-top: .9rem; }
.emplist { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.emp { display: flex; gap: .8rem; align-items: center; justify-content: space-between; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); box-shadow: inset 3px 0 0 var(--svc); flex-wrap: wrap; }
.emp__main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; } .emp__main small { color: var(--muted); } .emp__q { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .2rem; }
.emp__act { display: flex; gap: .35rem; flex-wrap: wrap; }
.crewlist { list-style: none; margin: 0; padding: .4rem .8rem .7rem; display: grid; gap: .3rem; }
.crewlist li { display: grid; grid-template-columns: 1fr auto auto; gap: .8rem; align-items: center; font-size: .88rem; padding: .25rem 0; border-bottom: 1px dashed var(--line); }
.crewgrp summary { list-style: none; } .crewgrp summary::-webkit-details-marker { display: none; }
@media (max-width: 760px) {
  .cvs { grid-template-columns: minmax(0, 1fr); } .cvs.has-open .cvlist { display: none; } .cvs:not(.has-open) .cvdetail { display: none; }
  .cvdetail__back { display: inline-block; } .emp__act { width: 100%; } .emp__act .btn { flex: 1; }
}

/* ===================================================================== Menu compact */
.modal--menu { width: min(620px, 96vw); max-width: 620px; }
.menu3 { display: flex; flex-direction: column; gap: .6rem; }
.mq__row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; }
.mq { position: relative; display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .75rem .3rem .65rem; border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--hi); font: 700 .78rem var(--fc); cursor: pointer; transition: border-color .15s, transform .15s; }
.mq:hover { border-color: var(--accent); transform: translateY(-1px); }
.mq__ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(227, 41, 62, .3); }
.mq__ico .ico { width: 20px; height: 20px; }
.mq__n { position: absolute; top: 6px; right: 8px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--hi); color: var(--bg); font: 800 .7rem/20px var(--fc); font-style: normal; }
.mstrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .4rem; }
.mstrip button { display: flex; flex-direction: column; align-items: flex-start; padding: .5rem .7rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); cursor: pointer; text-align: left; }
.mstrip small { color: var(--muted); font-size: .72rem; } .mstrip b { color: var(--hi); font: 700 .95rem var(--fc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mstrip button:hover { border-color: var(--accent); }
.menu3__h { margin: .5rem 0 0; font: 700 .7rem var(--fc); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.mlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel-2); }
.mrow { display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 54px; padding: .5rem .8rem; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); text-align: left; text-decoration: none; cursor: pointer; }
.mrow:last-child { border-bottom: 0; }
.mrow:hover { background: var(--accent-soft); }
.mrow__ico { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--bg-2); color: var(--accent-2); border: 1px solid var(--line-2); }
.mrow__ico .ico { width: 18px; height: 18px; }
.mrow__t { display: flex; flex-direction: column; min-width: 0; flex: 1; } .mrow__t b { color: var(--hi); font-size: .93rem; } .mrow__t small { color: var(--muted); font-size: .78rem; }
.mrow em { font-style: normal; font: 600 .76rem var(--fc); color: var(--muted); white-space: nowrap; }
.mrow__chev { color: var(--dim); font-size: 1.2rem; }
.mrow--txt { cursor: default; } .mrow--txt:hover { background: none; }
@media (max-width: 560px) {
  .mq__row { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .3rem; }
  .mq { padding: .6rem .1rem .5rem; font-size: .68rem; } .mq__ico { width: 36px; height: 36px; }
  .mrow { min-height: 56px; }
}

/* ===================================================================== Démonstration visiteurs */
.page-demo { margin: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.dm-top { display: flex; align-items: center; gap: .8rem; padding: .6rem 1rem; background: linear-gradient(180deg, #17191E, #101114); border-bottom: 1px solid var(--line); box-shadow: inset 0 -2px 0 rgba(227, 41, 62, .55); flex-wrap: wrap; }
.dm-badge { font: 700 .72rem var(--fc); color: #FF8A97; background: var(--accent-soft); border: 1px solid rgba(227, 41, 62, .4); padding: .2rem .55rem; border-radius: 999px; }
.dm-hud { display: flex; gap: 1rem; margin-left: auto; color: var(--muted); font-size: .85rem; } .dm-hud b { color: var(--hi); }
.dm-main { position: relative; flex: 1; min-height: 0; }
.dm-map { position: absolute; inset: 0; }
.dm-card { position: absolute; z-index: 900; left: 16px; bottom: 16px; width: min(420px, calc(100% - 32px)); padding: 1rem 1.1rem; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-2); border-top: 3px solid var(--accent); box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.dm-card h2 { margin: .1rem 0 .4rem; font: 800 1.15rem var(--fc); color: var(--hi); } .dm-card p { margin: 0 0 .6rem; }
.dm-n { color: var(--accent-2); font: 700 .72rem var(--fc); text-transform: uppercase; letter-spacing: .08em; }
.dm-foot { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; margin-top: .6rem; }
.dm-actions { position: absolute; z-index: 901; top: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.dm-act { min-height: 48px; padding: 0 1.2rem; font-size: 1rem; }
.dm-pulse { animation: dmPulse 1.6s ease-in-out infinite; }
@keyframes dmPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(227, 41, 62, .55); } 50% { box-shadow: 0 0 0 10px rgba(227, 41, 62, 0); } }
.dm-sheet { position: fixed; inset: 0; z-index: 1200; background: rgba(5, 8, 12, .55); display: grid; place-items: end center; }
.dm-sheet__in { width: min(520px, 100%); max-height: 80vh; overflow-y: auto; background: var(--panel); border-radius: 18px 18px 0 0; padding: 1.1rem 1.2rem 1.4rem; border-top: 3px solid var(--accent); display: flex; flex-direction: column; gap: .55rem; }
@media (min-width: 761px) { .dm-sheet { place-items: center; } .dm-sheet__in { border-radius: 18px; } }
.dm-sheet h3 { margin: 0; font: 800 1.15rem var(--fc); color: var(--hi); }
.dm-item { width: 100%; }
.dm-cv { display: flex; gap: .7rem; align-items: center; } .dm-cv div { display: flex; flex-direction: column; } .dm-cv small { color: var(--muted); }
.dm-bld { background: none; border: 0; } .dm-bld__in { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--svc); color: #fff; font: 800 .85rem var(--fc); border: 3px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.dm-call { background: none; border: 0; } .dm-call__d { position: absolute; inset: 6px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font: 800 .7rem var(--fc); border: 2px solid #fff; }
.dm-call__p { position: absolute; inset: 0; border-radius: 50%; background: rgba(227, 41, 62, .45); animation: dmRing 1.2s ease-out infinite; }
@keyframes dmRing { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }
.dm-toast { position: fixed; z-index: 1300; top: 70px; left: 50%; transform: translateX(-50%); padding: .6rem 1rem; border-radius: 12px; background: var(--panel); border: 1px solid #5AD08A; color: var(--hi); box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: calc(100% - 24px); }
.dm-prog { margin-top: .4rem; }
@media (max-width: 760px) { .dm-hud { display: none; } .dm-card { left: 8px; right: 8px; bottom: 8px; width: auto; } .dm-actions { top: 10px; width: calc(100% - 20px); } .dm-act { flex: 1; } .dm-badge { order: 3; } }
@media (prefers-reduced-motion: reduce) { .dm-pulse, .dm-call__p { animation: none; } }
.l3__demo { margin: .6rem 0 0; color: var(--muted); font-size: .86rem; }
@media (max-width: 760px) {
  .fl__chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .2rem; scrollbar-width: none; }
  .fl__chip { flex: none; }
  .fl__bar { gap: .35rem; padding: .5rem .6rem; }
  .fl__acts { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .fl__acts .btn, .fl__acts select { flex: none; }
  .fl__acts .hint { display: none; }
}
@media (max-width: 760px) {
  .topbar .brand__name { display: none; }
  .cvbtn { min-height: 34px; padding: 0 .45rem; margin-left: .25rem; }
}
@media (max-width: 420px) { .cvbtn { padding: 0 .3rem; margin-left: .1rem; min-height: 32px; } .cvbtn .ico { width: 16px; height: 16px; } .topbar .brand__mark { margin-right: 0; } }
/* Téléphone : le bouton CV reçus tient dans la barre du haut sans rien couper */
@media (max-width: 760px) {
  .cvbtn { width: 34px; min-height: 34px; padding: 0; margin-left: .2rem; justify-content: center; flex: none; }
  .topbar .brand__name { display: none; }
}
@media (max-width: 760px) {
  .topbar { gap: .25rem; padding-left: .4rem; padding-right: .4rem; }
  .hud { gap: .15rem; }
  .hchip { padding: .15rem .38rem .15rem .2rem; gap: .22rem; }
  .topbar .brand__mark { width: 22px; height: 22px; }
}

/* Patrouille hors appel : aucun gyrophare (rampe éteinte) */
.dwv.is-patrolling .dwv__bar i, #map.is-busy .dwv.is-patrolling .dwv__bar i { animation: none !important; opacity: .18 !important; box-shadow: none !important; }
.dwv.is-patrolling .dwv__halo, .dwv.is-patrolling::after { animation: none !important; opacity: 0 !important; }
.dwv.is-patrolling .dwv__bar { display: none !important; }
.dwv.is-patrolling::before { animation: none !important; opacity: .35; }

/* ===================================================================== Grades et Prestige */
.insig { display: inline-flex; gap: 1px; align-items: center; }
.insig img { width: 26px; height: 26px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
@media (max-width: 760px) { .insig img { width: 20px; height: 20px; } .insig img + img { display: none; } }
.modal--prs { width: min(980px, 96vw); max-width: 980px; }
.prs__hero { display: grid; grid-template-columns: 170px 170px 1fr; gap: 1rem; align-items: center; padding: 1rem; border-radius: 16px; background: radial-gradient(500px 160px at 20% 0%, rgba(227,41,62,.18), transparent 70%), var(--panel-2); border: 1px solid var(--line); margin-bottom: .6rem; }
.prs__ins { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .2rem; }
.prs__ins img { width: 104px; height: 104px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.45)); }
.prs__ins b { color: var(--hi); font: 800 1rem var(--fc); } .prs__ins small { color: var(--muted); }
.prs__none { width: 104px; height: 104px; display: grid; place-items: center; border-radius: 50%; border: 2px dashed var(--line-2); color: var(--dim); font-size: 2rem; }
.prs__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .5rem; margin-bottom: .6rem; }
.prs__g { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .15rem; padding: .6rem .4rem; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); }
.prs__g img { width: 58px; height: 58px; } .prs__g b { font-size: .8rem; color: var(--hi); } .prs__g small { font-size: .7rem; color: var(--muted); }
.prs__g.is-on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.prs__g.is-lock img { filter: grayscale(1) opacity(.45); }
@media (max-width: 760px) { .prs__hero { grid-template-columns: 1fr 1fr; } .prs__cta { grid-column: 1 / -1; } .prs__ins img, .prs__none { width: 80px; height: 80px; } }
/* Téléphone : l'insigne du grade remplace l'anneau de niveau (la barre du haut reste sur une ligne) */
@media (max-width: 760px) { #top-levelbtn .insig:not(:empty) ~ .hchip__txt b { display: none; } #top-levelbtn:has(.insig img) .ring { display: none; } }

/* Panneau de construction : chaque ligne garde sa hauteur naturelle (plus de chevauchement) */
.buildpanel .bp__list { display: flex !important; flex-direction: column; gap: .4rem; }
.buildpanel .bp__list > * { flex: 0 0 auto; }
.buildpanel .bp__item { min-height: 58px !important; height: auto; border-top-width: 1px; grid-template-columns: 36px minmax(0, 1fr) auto; grid-template-rows: auto;
  align-items: center; column-gap: .6rem; row-gap: 0; overflow: visible; line-height: 1.25; }
.buildpanel .bp__ico { width: 34px; height: 34px; flex: none; align-self: center; }
.buildpanel .bp__ico .dwv { position: absolute; left: 2px; top: 2px; }
.buildpanel .bp__txt { gap: .12rem; }
.buildpanel .bp__txt b { white-space: normal; overflow-wrap: anywhere; }
.buildpanel .bp__txt small { display: block; white-space: normal; line-height: 1.25; }
.buildpanel .bp__price { align-self: center; padding-left: .2rem; }
.buildpanel .bp__cats { flex: none; scrollbar-width: none; }
.buildpanel .bp__cats::-webkit-scrollbar { display: none; }
.buildpanel .bp__head, .buildpanel .bp__q { flex: none; }

/* Panneau de construction : lignes à hauteur naturelle (plus de chevauchement) */
.bp__list > .bp__item { flex: 0 0 auto !important; min-height: 56px !important; border-top-width: 1px !important; overflow: visible; }
.bp__txt b { line-height: 1.25; display: block; } .bp__txt small { line-height: 1.3; display: block; white-space: normal; }
.bp__ico { width: 30px; height: 30px; align-self: center; }
.bp__ico .dwv { transform: scale(.85); transform-origin: top left; }
.bp__cats { flex: none; padding-bottom: .35rem; }
.bp__head, .bp__q { flex: none; }
/* Chantiers de construction */
.bld--chantier { background: conic-gradient(var(--svc) calc(var(--p) * 1%), rgba(255,255,255,.15) 0) !important; border-style: dashed !important; }
.bld--chantier span { font-size: .8rem; }
.chantier__t { font: 600 1rem var(--fc); color: var(--hi); }
.chantier__bar { height: 12px; margin: .4rem 0 .8rem; }
.chantier__bar i { background: repeating-linear-gradient(45deg, #F2B33D 0 10px, #E3293E 10px 20px); transition: width 1s linear; }

/* Avis : jamais par-dessus le panneau des appels (ordinateur : au-dessus de la carte, à gauche du panneau) */
@media (min-width: 901px) {
  .page-play .toasts { right: calc(var(--panel-w) + 1rem); bottom: 1rem; max-width: min(380px, calc(100vw - var(--panel-w) - 2rem)); }
}
.toast__n { margin-left: .3rem; padding: 0 .4rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: .75rem; }
.callcancel { margin-top: 1rem; padding-top: .8rem; border-top: 1px dashed var(--line-2); display: flex; justify-content: flex-end; }

/* Bouton verrouillé (ex. contribution 24 h) : gris, inutilisable */
.btn.btn--locked, .btn.btn--locked:hover { background: var(--panel-2) !important; color: var(--dim) !important; border: 1px dashed var(--line-2) !important; filter: grayscale(1); opacity: .75; cursor: not-allowed; box-shadow: none !important; transform: none !important; }
input[type=range]:disabled { filter: grayscale(1); opacity: .45; cursor: not-allowed; }
/* Filtre d'alliance : en haut de la carte, à droite du panneau Construire (jamais par-dessus) */
@media (min-width: 761px) {
  .allyfilter { top: 12px !important; bottom: auto !important; left: 12px !important; right: auto !important; max-height: calc(100% - 24px); }
  body.is-building .allyfilter { left: 364px !important; }
}
/* Démonstration : étapes, chantier, grade */
.dm-prog-steps { display: flex; gap: 3px; margin-bottom: .5rem; }
.dm-prog-steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--line-2); }
.dm-prog-steps i.is-done { background: var(--accent); opacity: .55; } .dm-prog-steps i.is-on { background: var(--accent); }
.dm-bld__in--chantier { background: conic-gradient(#F2B33D calc(var(--p) * 1%), rgba(255,255,255,.2) 0) !important; border-style: dashed !important; color: #fff; }
.dm-item.is-locked { opacity: .55; }
.dm-rank { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: .4rem 0; }
.dm-rank figure { margin: 0; text-align: center; } .dm-rank img { width: 64px; height: 64px; } .dm-rank figcaption { font: 700 .8rem var(--fc); color: var(--hi); }
.dm-rank figure.is-new img { animation: dmPop .6s ease-out; filter: drop-shadow(0 0 10px rgba(242, 179, 61, .6)); }
.dm-rank__arrow { font-size: 1.6rem; color: var(--accent); }
@keyframes dmPop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
.dm-feats { list-style: none; padding: 0; margin: .3rem 0 .6rem; display: grid; gap: .35rem; font-size: .9rem; }
.dm-feats img { vertical-align: middle; }
@media (prefers-reduced-motion: reduce) { .dm-rank figure.is-new img { animation: none; } }
/* En-tête de la démonstration : toujours sombre, texte clair (lisible en thème clair comme sombre) */
.dm-top { color: #E9EBEF; }
.dm-top .brand__name { color: #F7F8FA; }
.dm-hud { color: #9AA1AD; } .dm-hud b { color: #F7F8FA; }
html[data-theme=light] .dm-top { background: linear-gradient(180deg, #17191E, #101114); }
.dm-toast { pointer-events: none; z-index: 950; }
.dm-actions { z-index: 960; }

/* ===================================================================== Accueil visiteurs (révision) */
.l3__nav { gap: 1rem; }
.l3__nav .brand { display: inline-flex !important; }
.l3__nav .brand__name { display: inline !important; color: var(--hi); font-weight: 800; }
.l3__links { display: flex; align-items: center; gap: 1.1rem; }
.l3__links a { color: var(--text); text-decoration: none; font: 600 .9rem var(--fc); display: inline-flex; align-items: center; gap: .4rem; opacity: .85; }
.l3__links a:hover { opacity: 1; color: var(--hi); }
.l3__links .pub__live { width: 7px; height: 7px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .6rem; }
.l3__demo-btn { background: color-mix(in srgb, var(--panel-2) 85%, transparent); border-color: var(--line-2); }
.l3__feats { list-style: none; margin: 1.4rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; max-width: 620px; }
.l3__feats li { display: flex; flex-direction: column; gap: .15rem; padding: .7rem .75rem; border-radius: 14px; border: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 78%, transparent); backdrop-filter: blur(6px); }
.l3__feats b { color: var(--hi); font: 700 .86rem var(--fc); } .l3__feats small { color: var(--muted); font-size: .75rem; line-height: 1.3; }
.l3__ico { font-size: 1.25rem; line-height: 1; margin-bottom: .2rem; height: 24px; display: flex; align-items: center; }
.l3__live { margin-top: 1rem; }
.l3__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem 1.2rem; max-width: 1180px; width: 100%; margin: 0 auto; padding: 1rem clamp(1rem, 5vw, 4rem) 1.2rem; color: var(--muted); font-size: .82rem; }
.l3__foot nav { display: flex; gap: 1rem; } .l3__foot a { color: var(--muted); text-decoration: none; } .l3__foot a:hover { color: var(--hi); }
@media (max-width: 1100px) { .l3__feats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .l3__links a { display: none; }
  .l3__hero .hero__cta .btn { flex: 1 1 100%; }
  .l3__feats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .l3__foot { justify-content: center; text-align: center; }
}
html[data-theme=light] .l3__links a, html[data-theme=light] .l3__foot a { color: var(--text); }
html[data-theme=light] .l3__foot a { color: var(--muted); }

/* Codes promo */
.rdm { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.rdm__card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 1.3rem; }
.rdm__card h1 { margin: 0 0 .3rem; font: 800 1.5rem var(--fc); color: var(--hi); }
.rdm__form { display: flex; gap: .5rem; margin: .8rem 0; }
.rdm__form input { flex: 1; min-height: 46px; padding: 0 .9rem; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); font: 700 1.05rem var(--fc); letter-spacing: .08em; text-transform: uppercase; }
.rdm__preview, .rdm__ok { border: 1px solid var(--line-2); border-radius: 12px; padding: .9rem 1rem; background: var(--panel-2); }
.rdm__ok { border-color: #5AD08A; }
.rdm__rewards { list-style: none; padding: 0; margin: .4rem 0; display: grid; gap: .3rem; }

/* Optimisation de flotte */
.modal--fopt { width: min(980px, 96vw); max-width: 980px; }
.fopt__bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: .6rem 0 .8rem; position: sticky; top: -1px; z-index: 2; background: var(--panel); padding: .5rem 0; border-bottom: 1px solid var(--line); }
.fopt__tot { margin-left: auto; font: 700 .9rem var(--fc); color: var(--hi); }
.fopt__b { border: 1px solid var(--line); border-radius: 14px; padding: .7rem .8rem; margin-bottom: .6rem; background: var(--panel-2); }
.fopt__b header { display: flex; flex-direction: column; margin-bottom: .4rem; }
.fopt__s { display: grid; grid-template-columns: auto 34px 1fr auto auto; gap: .6rem; align-items: center; padding: .45rem .3rem; border-top: 1px solid var(--line); cursor: pointer; }
.fopt__s input { width: 18px; height: 18px; }
.fopt__t small { display: block; color: var(--muted); font-size: .76rem; } .fopt__t b { color: var(--hi); }
.fopt__g { font-size: .76rem; color: #5AD08A; white-space: nowrap; } .fopt__c { white-space: nowrap; }
.upg__opt { margin-left: auto; }
@media (max-width: 760px) { .fopt__s { grid-template-columns: auto 30px 1fr; } .fopt__g, .fopt__c { grid-column: 3; } .fopt__tot { margin-left: 0; width: 100%; } }
/* ===================================================================== Tracker public */
.page-tracker { min-height: 100vh; background: var(--bg); }
.trk__top { gap: 1rem; }
.trk__search { position: relative; flex: 1; max-width: 460px; }
.trk__search input { width: 100%; min-height: 40px; padding: 0 .9rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); }
.trk__sugg { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; }
.trk__sugg a { display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; color: var(--text); text-decoration: none; }
.trk__sugg a:hover { background: var(--panel-2); } .trk__sugg small { color: var(--muted); margin-left: auto; } .trk__sugg .hint { padding: .6rem .8rem; margin: 0; }
.trk { max-width: 1100px; margin: 0 auto; padding: 1.2rem clamp(.8rem, 3vw, 2rem) 3rem; display: flex; flex-direction: column; gap: 1rem; }
.trk__hero h1 { font: 800 2rem var(--fc); color: var(--hi); margin: .4rem 0; } .trk__hero p { color: var(--muted); max-width: 640px; }
.trk__card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 1.1rem 1.2rem; position: relative; overflow: hidden; }
.trk__card h2 { font: 700 1.05rem var(--fc); color: var(--hi); margin: 0 0 .6rem; }
.trk__banner { height: 110px; margin: -1.1rem -1.2rem 0; background: linear-gradient(135deg, #101114, #242831 60%, #3a1018); }
.trk__id { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: end; margin-top: -42px; }
.trk__av { width: 92px; height: 92px; border-radius: 22px; display: grid; place-items: center; font: 900 2rem var(--fc); color: #fff; background: linear-gradient(135deg, #E3293E, #6b0d18); border: 4px solid var(--panel); }
.trk__who h1 { margin: 0; font: 900 1.9rem var(--fc); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.trk__name { color: var(--hi); } .trk__name--grad { background-clip: text; -webkit-background-clip: text; color: transparent; background-size: 200% 100%; }
.trk__name--grad.is-anim { animation: trkGrad 4s linear infinite; } @keyframes trkGrad { to { background-position: 200% 0; } }
.trk__on { width: 10px; height: 10px; border-radius: 50%; background: #5AD08A; box-shadow: 0 0 0 4px rgba(90, 208, 138, .2); }
.trk__who p { margin: .2rem 0; color: var(--text); } .trk__bio { color: var(--muted) !important; font-style: italic; }
.trk__ins { display: flex; gap: .3rem; align-items: center; } .trk__ins img { filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .4)); }
.trk__badges { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; } .trk__badge { padding: .25rem .6rem; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: .82rem; }
.trk__stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .5rem; margin: 1rem 0; }
.trk__stats div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: .7rem; text-align: center; }
.trk__stats b { display: block; font: 800 1.3rem var(--fc); color: var(--hi); } .trk__stats small { color: var(--muted); font-size: .74rem; }
.trk__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.trk__bar { display: grid; grid-template-columns: 120px 1fr auto; gap: .5rem; align-items: center; margin: .3rem 0; font-size: .85rem; }
.trk__bar i { height: 8px; border-radius: 4px; display: block; }
.trk__ach { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
.trk__a { position: relative; padding: .55rem .6rem .7rem; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); display: grid; grid-template-columns: auto 1fr; column-gap: .4rem; overflow: hidden; }
.trk__a span { grid-row: span 2; font-size: 1.3rem; } .trk__a b { font-size: .82rem; color: var(--hi); } .trk__a small { font-size: .72rem; color: var(--muted); }
.trk__a i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); }
.trk__a.t1 { border-color: #B87333; } .trk__a.t2 { border-color: #B9C2CC; } .trk__a.t3 { border-color: #E0A81C; } .trk__a.t4 { border-color: #7FC4FF; box-shadow: 0 0 0 1px #7FC4FF inset; }
.trk__actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .9rem; }
.trk__vs { display: flex; gap: .4rem; margin-right: auto; } .trk__vs input { min-height: 34px; padding: 0 .7rem; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); }
.trk__rank { list-style: none; margin: 0; padding: 0; } .trk__rank li { display: flex; align-items: center; gap: .5rem; padding: .45rem .2rem; border-top: 1px solid var(--line); }
.trk__rank a, .trk__an { color: var(--hi); font-weight: 700; text-decoration: none; } .trk__rank small { color: var(--muted); } .trk__rank li > b:last-child { margin-left: auto; }
.trk__pos { width: 28px; text-align: center; font: 800 .9rem var(--fc); color: var(--muted); }
.trk__cmp td.is-win { color: #5AD08A; font-weight: 700; } .trk__cmp th a { color: var(--hi); text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; }
@media (max-width: 860px) { .trk__stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .trk__grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .trk__top .pagenav { display: none; }
  .trk__id { grid-template-columns: auto 1fr; } .trk__ins { grid-column: 1 / -1; }
  .trk__av { width: 72px; height: 72px; font-size: 1.5rem; } .trk__who h1 { font-size: 1.4rem; }
  .trk__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .trk__ach { grid-template-columns: 1fr; } .trk__bar { grid-template-columns: 90px 1fr auto; }
  .trk__vs { width: 100%; margin-right: 0; } .trk__vs input { flex: 1; }
}
.pfl__prev { margin-bottom: .6rem; } .pfl__prev .trk__banner { height: 80px; }
.trk__id { align-items: start; }
.trk__who { padding-top: 50px; min-width: 0; }
.trk__ins { padding-top: 50px; }
.trk__av { position: relative; z-index: 1; }
@media (max-width: 560px) { .trk__who { padding-top: 48px; } .trk__ins { padding-top: 0; } }

/* Saisons, boutique Coins, tag de clan */
.ssn__hero { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: .5rem; align-items: stretch; margin-bottom: .6rem; }
.ssn__hero > div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: .7rem; text-align: center; }
.ssn__hero h2 { margin: .1rem 0; font: 900 2rem var(--fc); color: var(--hi); } .ssn__kpi b { display: block; font: 800 1.2rem var(--fc); color: var(--hi); } .ssn__kpi small, .ssn__hero small { color: var(--muted); font-size: .75rem; }
@media (max-width: 760px) { .ssn__hero { grid-template-columns: 1fr 1fr; } .ssn__hero > div:first-child { grid-column: 1 / -1; } }
.modal--shop { width: min(980px, 96vw); max-width: 980px; }
.shop__top { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; margin-bottom: .4rem; } .shop__coins { font: 900 1.3rem var(--fc); color: #F2B33D; }
.shop__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; margin-bottom: .6rem; }
.shop__it { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .7rem .5rem; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); text-align: center; }
.shop__it b { font-size: .84rem; color: var(--hi); } .shop__it.is-own { border-color: #5AD08A; }
.shop__pv { width: 100%; height: 46px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-2); font-size: 1.3rem; }
.trk__tag { color: var(--muted); font-weight: 800; }
.trk__season { display: flex; justify-content: space-between; gap: 1rem; margin-top: .8rem; padding: .7rem .9rem; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.trk__hist { margin-top: .8rem; }

/* Zones d'événements (admin) et suggestions */
.zpage { display: grid; grid-template-columns: 1fr 360px; gap: 1rem; }
.zpage__map { height: 620px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.zpage__side { display: flex; flex-direction: column; gap: .6rem; max-height: 620px; }
.zpage__tools { display: flex; flex-wrap: wrap; gap: .4rem; }
.zpage__draft { border: 1px dashed var(--line-2); border-radius: 12px; padding: .7rem; background: var(--panel-2); }
.zpage__list { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: flex; flex-direction: column; gap: .4rem; }
.zpage__list li { border: 1px solid var(--line); border-radius: 12px; padding: .55rem .6rem; display: flex; flex-direction: column; gap: .15rem; background: var(--panel); }
.zpage__list li.is-live { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.zpage__acts { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .2rem; }
.sgg header { display: flex; justify-content: space-between; gap: .5rem; align-items: center; } .sgg__map { height: 180px; border-radius: 10px; overflow: hidden; margin: .4rem 0; }
@media (max-width: 900px) { .zpage { grid-template-columns: 1fr; } .zpage__map { height: 380px; } .zpage__side { max-height: none; } }

/* Suggérer un événement */
.sgp { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.sgp__intro h1 { font: 800 1.6rem var(--fc); color: var(--hi); margin: .3rem 0; }
.sgp__grid { display: grid; grid-template-columns: 420px 1fr; gap: 1rem; }
.sgp__form { display: flex; flex-direction: column; gap: .6rem; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 1rem; }
.sgp__form textarea, .sgp__form input, .sgp__form select { width: 100%; }
.sgp__mapbox { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: .8rem; display: flex; flex-direction: column; gap: .5rem; }
.sgp__tools { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; } .sgp__r { display: inline-flex; gap: .4rem; align-items: center; font-size: .85rem; }
.sgp__map { height: 520px; border-radius: 12px; overflow: hidden; }
.sgp__mine { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 1rem; }
@media (max-width: 900px) { .sgp__grid { grid-template-columns: 1fr; } .sgp__map { height: 340px; } }
.sgp__form input[type=checkbox] { width: auto; }
.sgp__form fieldset { border: 1px solid var(--line); border-radius: 12px; padding: .5rem .7rem .7rem; margin: 0; }
.sgp__form fieldset legend { font-size: .85rem; color: var(--muted); padding: 0 .3rem; }
.sgp__form .checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem .6rem; }
.sgp__form .switch { display: flex; align-items: center; gap: .45rem; justify-content: flex-start; }
/* V2.3 : trois catégories séparées (mission, quartier, événement) */
.sgp__col, .sgp__pane { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.sgp__pane[hidden] { display: none; }
.sgp__mapbox { position: sticky; top: 1rem; align-self: start; }
.sgp .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.sgp__veh { list-style: none; margin: 0 0 .4rem; padding: 0; display: grid; gap: .35rem; }
.sgp__veh li { display: grid; grid-template-columns: minmax(0, 1fr) 72px 40px; gap: .35rem; align-items: center; }
.sgp__veh select, .sgp__veh input { min-height: 40px; }
.sgp__form .checks--wide { grid-template-columns: 1fr; }
.pill--err { background: rgba(227, 41, 62, .14); color: #E3293E; }
@media (max-width: 900px) { .sgp__mapbox { position: static; order: -1; } .sgp .sgp__modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; }
  .sgp .sgp__modes button { min-height: 52px; padding: .3rem .35rem; font-size: .76rem; line-height: 1.15; } }
@media (max-width: 480px) { .sgp .grid2, .sgp__form .checks { grid-template-columns: 1fr; } }

/* Quartiers et couverture */
.fab--cov.is-on { background: var(--accent); color: #fff; }
.covpanel { position: absolute; z-index: 650; top: 12px; right: 12px; width: 300px; max-height: calc(100% - 24px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; padding: .8rem; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: .5rem; }
.covpanel__head { display: flex; flex-direction: column; } .covpanel__head b { color: var(--hi); }
.covpanel__leg { font-size: .78rem; margin: 0; display: flex; gap: .6rem; flex-wrap: wrap; }
.c-g { color: #3FB950; } .c-o { color: #F2B33D; } .c-r { color: #E3293E; }
.covpanel__tips { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; font-size: .8rem; }
.covpanel__tips .linkbtn { text-align: left; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: .45rem .55rem; color: var(--text); cursor: pointer; width: 100%; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; } .seg button { flex: 1; padding: .35rem .7rem; background: transparent; border: 0; color: var(--text); cursor: pointer; } .seg button.is-on { background: var(--accent); color: #fff; }
.covpop { display: flex; flex-direction: column; gap: .25rem; min-width: 230px; }
.covpop__r { display: grid; grid-template-columns: 110px 1fr 28px; gap: .4rem; align-items: center; font-size: .78rem; }
.covpop__b { height: 7px; background: rgba(133, 141, 155, .25); border-radius: 4px; overflow: hidden; } .covpop__b i { display: block; height: 100%; }
.covpop__s { font-size: .78rem; display: flex; flex-direction: column; gap: .15rem; margin-top: .2rem; }
.lvl-good { color: #3FB950; } .lvl-fragile { color: #F2B33D; } .lvl-none { color: #E3293E; }
body.is-building .covpanel { top: auto; bottom: 12px; }
@media (max-width: 760px) { .covpanel { left: 8px; right: 8px; width: auto; top: auto; bottom: 8px; max-height: 50%; } }
@media (min-width: 761px) { .covpanel { right: 168px; } }
.fab--cov { width: auto; padding: 0 .8rem; gap: .4rem; display: inline-flex; align-items: center; font: 700 .82rem var(--fc); }
@media (max-width: 760px) { .fab--cov { width: 48px; padding: 0; justify-content: center; } .fab--cov span { display: none; } }
@media (max-width: 760px) { .covpanel { top: 8px; bottom: auto; left: 8px; right: 64px; width: auto; max-height: 52%; z-index: 930; } }
@media (min-width: 761px) { .covpanel { right: calc(var(--panel-w) + 160px); } body.panel-floating .covpanel { right: 160px; } }
.covseg { display: flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.covseg button { flex: 1; min-height: 34px; padding: .35rem .7rem; background: var(--panel-2); border: 0; color: var(--text); cursor: pointer; font: 700 .82rem var(--fc); }
.covseg button.is-on { background: var(--accent); color: #fff; }
.covpanel > * { flex: none; }

/* Contrats et rapports */
.modal--ctr { width: min(980px, 96vw); max-width: 980px; }
.ctr__c { border: 1px solid var(--line); border-radius: 14px; padding: .8rem .9rem; margin-bottom: .6rem; background: var(--panel-2); }
.ctr__c header { display: flex; justify-content: space-between; gap: .5rem; align-items: center; } .ctr__c header b { color: var(--hi); }
.ctr__c p { margin: .35rem 0; }
.ctr__act { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .4rem; } .ctr__act input { width: 150px; min-height: 34px; border-radius: 10px; border: 1px solid var(--line-2); padding: 0 .6rem; background: var(--bg-2); color: var(--text); }
.ctr__kpi { display: grid; gap: .3rem; font-size: .85rem; }
.ctr__bar { position: relative; display: inline-block; width: 120px; height: 8px; border-radius: 4px; background: rgba(133,141,155,.25); vertical-align: middle; margin: 0 .3rem; overflow: visible; }
.ctr__bar i { display: block; height: 100%; border-radius: 4px; } .ctr__bar em { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--hi); }
.rpt__list { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .6rem; }
.rpt__fin { display: grid; gap: .3rem; margin-bottom: .6rem; } .rpt__fin div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: .25rem 0; }

/* Planificateur, centre de crise, postes temporaires */
.bp__plan { width: 100%; justify-content: center; flex: none; }
.plan-pin span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #2F6FED; color: #fff; font: 800 .8rem var(--fc); box-shadow: 0 4px 10px rgba(0,0,0,.35); }
.plan-pin span::first-line { transform: rotate(45deg); }
.post-pin span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--panel); border: 2px solid #F2B33D; font-size: 1rem; box-shadow: 0 3px 8px rgba(0,0,0,.35); }
.crs__c { border: 1px solid var(--line); border-radius: 14px; padding: .8rem .9rem; margin-bottom: .7rem; background: var(--panel-2); }
.crs__c header { display: flex; justify-content: space-between; gap: .5rem; align-items: center; } .crs__c header b { color: var(--hi); }
.crs__obj { display: grid; gap: .3rem; margin: .5rem 0; font-size: .85rem; } .crs__obj div { display: grid; grid-template-columns: 1fr auto auto; gap: .5rem; align-items: center; }

/* Défis de la semaine, parrainage, suggestion compatible */
.wk__row { display: flex; align-items: center; gap: .6rem; margin-top: .4rem; } .wk__bar { flex: 1; width: auto; }
.ref__code { display: grid; grid-template-columns: auto auto 1fr auto; gap: .6rem; align-items: center; padding: .8rem; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); margin: .6rem 0; }
.ref__code b { font: 900 1.4rem var(--fc); color: var(--accent); letter-spacing: .1em; } .ref__code input { min-height: 36px; border-radius: 10px; border: 1px solid var(--line-2); padding: 0 .6rem; background: var(--bg-2); color: var(--text); min-width: 0; }
@media (max-width: 640px) { .ref__code { grid-template-columns: 1fr; } }
.sgu { margin-top: .8rem; padding: .7rem .8rem; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.sgu__l { list-style: none; margin: .3rem 0; padding: 0; display: grid; gap: .2rem; font-size: .85rem; }

/* ===================================================================== REFONTE MOBILE (V2.2) */
/* Carte prioritaire : tiroir replié réduit aux onglets, boutons d'action en bas à droite (zone du pouce),
   cibles tactiles ≥ 40 px, fenêtres plein écran, portrait et paysage. */
@media (max-width: 900px) {
  :root { --peek: 76px; }
  .panel[data-sheet=peek] { transform: translateY(calc(100% - var(--peek))); }
  .panel[data-sheet=peek] .panel__body { visibility: hidden; }
  .panel__tabs { min-height: 48px; }
  .fabs { top: auto !important; bottom: calc(var(--peek) + 12px); right: .7rem; flex-direction: column-reverse; gap: .45rem; z-index: 940; }
  .fabs #fab-build { order: -1; }
  .fab, .fab--cov, .fab--ally, .fab--build { width: 48px !important; height: 48px !important; padding: 0 !important; justify-content: center; border-radius: 16px; }
  .fab span, .fab--cov span, .fab--ally span, .fab--build span { display: none !important; }
  body.is-building .fabs, body.is-placing .fabs { display: none; }
  .leaflet-touch .leaflet-control-zoom { display: none; }   /* zoom au doigt (pincer) */
  .topbar .hchip, .topbar .cvbtn, .topbar .icon-btn { min-height: 40px; min-width: 40px; }
  .topbar .ring { width: 32px; height: 32px; }
  .paused-banner { top: .6rem; }
  .allyfilter, .covpanel { z-index: 945; }
  /* Fenêtres : tiroir du bas qui tient dans l'écran, en-tête toujours visible, défilement interne */
  .modal { width: 100% !important; max-width: 100% !important; max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 8px) !important; }
  .modal__head { flex: none; }
  .modal__body { overflow-y: auto; -webkit-overflow-scrolling: touch; min-height: 0; }
  .modal [data-close] { min-width: 44px; min-height: 44px; }
}
/* Paysage sur téléphone : barres compactes, icônes seules */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  :root { --top: 46px; --nav: 48px; --peek: 60px; }
  .nav-btn { flex-direction: row; gap: .35rem; font-size: .7rem; min-height: 48px; }
  .nav-btn span:not(.badge) { display: none; }
  .panel[data-sheet=half] { transform: translateY(30%); }
  .panel__grip { height: 14px; }
  .panel__tabs { min-height: 44px; }
  .fabs { bottom: calc(var(--peek) + 8px); flex-direction: row-reverse; right: .6rem; }
  .fab, .fab--cov, .fab--ally, .fab--build { width: 44px !important; height: 44px !important; }
  .covpanel, .allyfilter { max-height: calc(100% - var(--peek) - 70px) !important; }
}
@media (max-width: 900px) { .topbar .hchip { min-width: 0; } .topbar { gap: .15rem; } .hud { gap: .1rem; } .hchip { padding-right: .3rem; } }
@media (max-width: 900px) { .topbar .hchip { min-width: 40px; padding: .1rem .3rem .1rem .15rem; gap: .2rem; } .topbar .ring { width: 30px; height: 30px; } .topbar .cvbtn { margin-left: 0; } }
/* Audit économique */
.ecoaudit__a { list-style: none; margin: .4rem 0 .8rem; padding: 0; display: grid; gap: .35rem; }
.ecoaudit__a li { display: flex; flex-direction: column; padding: .5rem .7rem; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); }
.ecoaudit__a li.is-ok b { color: #3FB950; } .ecoaudit__a li.is-warn { border-color: #F2B33D; } .ecoaudit__a li.is-warn b { color: #F2B33D; }
.ecoaudit__a small { color: var(--muted); }
.ecoaudit__k { padding: .7rem; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); } .ecoaudit__k b { display: block; font: 800 1.1rem var(--fc); color: var(--hi); } .ecoaudit__k small { color: var(--muted); }

/* ===================================================================== V2.3 — Centre des agents IA */
.agp { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.agp__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.agp__head h1 { font: 800 1.6rem var(--fc); color: var(--hi); margin: .2rem 0; }
.agp__go { min-height: 46px; }
.agp__cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.agc { border-radius: 18px; padding: 1rem 1.1rem; background: var(--panel); border: 1px solid var(--line); position: relative; overflow: hidden; }
.agc::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; }
.agc--dispatch::before { background: linear-gradient(#E3293E, #F2B33D); } .agc--hr::before { background: linear-gradient(#2F6FED, #3FB950); }
.agc header { display: flex; align-items: center; gap: .7rem; } .agc header b { font: 800 1.1rem var(--fc); color: var(--hi); display: block; } .agc header small { color: var(--muted); }
.agc__ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; background: var(--panel-2); border: 1px solid var(--line-2); }
.agc__dot { margin-left: auto; width: 12px; height: 12px; border-radius: 50%; background: #3FB950; box-shadow: 0 0 0 4px rgba(63,185,80,.18); }
.agc__dot.is-auto { background: #F2B33D; box-shadow: 0 0 0 4px rgba(242,179,61,.2); } .agc__dot.is-off { background: #858D9B; box-shadow: none; }
.agc ul { list-style: none; margin: .7rem 0 0; padding: 0; display: grid; gap: .3rem; font-size: .88rem; }
.agp__tabs { overflow-x: auto; } .agp__body { min-height: 200px; }
.agp__acts { flex-wrap: wrap; gap: .5rem; align-items: center; }
.agk { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .5rem; margin-bottom: .6rem; }
.agk div { padding: .6rem; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); text-align: center; }
.agk b { display: block; font: 800 1.15rem var(--fc); color: var(--hi); } .agk small { color: var(--muted); font-size: .75rem; }
.agplan { border: 1px solid var(--line); border-left: 4px solid var(--svc); border-radius: 14px; padding: .8rem .9rem; margin-bottom: .7rem; background: var(--panel-2); }
.agplan header { display: flex; justify-content: space-between; gap: .5rem; align-items: center; } .agplan header b { color: var(--hi); }
.agplan__steps { margin: .5rem 0; padding-left: 1.2rem; display: grid; gap: .25rem; font-size: .9rem; }
.agrec, .agemp, .aglog { list-style: none; margin: .3rem 0 .8rem; padding: 0; display: grid; gap: .35rem; }
.agrec li { padding: .55rem .7rem; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: .15rem; }
.agrec small { color: var(--muted); }
.agdiag summary { cursor: pointer; font-weight: 700; padding: .4rem 0; } .agdiag ul { list-style: none; padding: 0; margin: .3rem 0; display: grid; gap: .3rem; }
.agdiag li { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: space-between; align-items: center; padding: .45rem .6rem; border-radius: 10px; border: 1px solid var(--line); }
.agdiag li.is-recommended { border-color: #3FB950; } .agdiag__why { flex-basis: 100%; }
.agf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.agf__bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0; position: sticky; top: 0; z-index: 2; background: var(--bg); padding: .4rem 0; }
.agf__bar select { min-height: 40px; max-width: 100%; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); padding: 0 .5rem; }
.agemp { max-height: 420px; overflow-y: auto; } .agemp li label { display: flex; gap: .5rem; align-items: center; padding: .35rem .5rem; border-radius: 10px; border: 1px solid var(--line); min-height: 40px; flex-wrap: wrap; }
.aglog li { display: flex; gap: .6rem; align-items: flex-start; padding: .5rem .6rem; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); }
.aglog li.is-action { border-left: 3px solid #3FB950; } .aglog li.is-refused, .aglog li.is-warning { border-left: 3px solid #F2B33D; } .aglog small { display: block; color: var(--muted); }
.agset { border: 1px solid var(--line); border-radius: 14px; padding: .8rem .9rem; margin-bottom: .8rem; background: var(--panel-2); }
.agset__modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-bottom: .6rem; }
.agset__m { display: flex; flex-direction: column; gap: .15rem; padding: .6rem .7rem; border-radius: 12px; border: 1px solid var(--line-2); cursor: pointer; min-height: 44px; }
.agset__m input { position: absolute; opacity: 0; } .agset__m.is-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); } .agset__m small { color: var(--muted); }
.agconf { padding-left: 1.1rem; }
@media (max-width: 760px) {
  .agp__cards, .agset__modes { grid-template-columns: 1fr; } .agk { grid-template-columns: repeat(3, minmax(0, 1fr)); } .agf { grid-template-columns: 1fr 1fr; }
  .agp__go { width: 100%; } .agp__acts .btn { flex: 1 1 100%; }
}

/* Admin › Quartiers : création (modèles, import, dessin, grille) et édition de forme */
.dq__opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-top: .5rem; }
.dq__opts article { border: 1px solid var(--line); border-radius: 12px; padding: .7rem; background: var(--panel-2); display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }
.dq__opts article .hint { margin: 0; font-size: .78rem; }
.dq__draw { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .7rem .8rem; border-radius: 12px; border: 1px dashed #2F6FED; background: var(--panel-2); margin-bottom: .6rem; }
.dq-h { background: #fff; border: 2px solid #2F6FED; border-radius: 50%; cursor: move; }
@media (max-width: 900px) { .dq__opts { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .dq__opts { grid-template-columns: 1fr; } }

/* ===================================================================== Éditeur cartographique commun (V2.3) */
.med { --side: clamp(280px, 25%, 400px); position: relative; display: grid; grid-template-columns: minmax(0, 1fr) var(--side); height: calc(100dvh - 190px); min-height: 520px;
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--panel); transition: grid-template-columns .25s ease; }
.med.is-collapsed { grid-template-columns: minmax(0, 1fr) 0; }
.med.is-collapsed .med__side { visibility: hidden; }
.med--compact { height: 520px; min-height: 0; }
.med__mapwrap { position: relative; min-width: 0; container-type: inline-size; }
.med__map { position: absolute; inset: 0; } .med__map.is-drawing { cursor: crosshair; }
.med__tools { position: absolute; z-index: 800; top: 10px; left: 56px; display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; gap: 4px; max-width: calc(100% - 180px);
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 4px; box-shadow: var(--shadow-lg); }
.med__t { display: inline-flex; align-items: center; gap: .3rem; min-height: 38px; padding: 0 .55rem; border: 0; border-radius: 9px; background: transparent; color: var(--text); cursor: pointer; font: 600 .78rem var(--fc); }
.med__t span { font-size: 1rem; } .med__t:hover { background: var(--panel-2); } .med__t.is-on { background: var(--accent); color: #fff; }
.med__float { position: absolute; z-index: 810; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(560px, calc(100% - 24px));
  background: var(--panel); border: 1px solid #2F6FED; border-radius: 14px; padding: .7rem .8rem; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: .5rem; font-size: .88rem; }
.med__float input[type=range] { width: 100%; } .med__fa { display: flex; gap: .4rem; }
.med__toggle { position: absolute; z-index: 800; top: 10px; right: 10px; min-height: 38px; padding: 0 .8rem; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font: 700 .8rem var(--fc); cursor: pointer; box-shadow: var(--shadow-lg); }
.med__side { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--panel); }
.med__sh { display: flex; align-items: center; gap: .5rem; padding: .7rem .8rem; border-bottom: 1px solid var(--line); } .med__sh b { color: var(--hi); } .med__sh small { color: var(--muted); margin-right: auto; }
.med__close { min-width: 36px; min-height: 36px; border: 0; background: transparent; color: var(--text); font-size: 1.3rem; cursor: pointer; }
.med__search { display: grid; gap: .35rem; padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
.med__search input, .med__search select { min-height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); padding: 0 .6rem; width: 100%; }
.med__list { list-style: none; margin: 0; padding: .3rem; overflow-y: auto; flex: 1 1 auto; min-height: 120px; }
.med__list li { display: flex; align-items: center; gap: .5rem; padding: .45rem .55rem; border-radius: 10px; cursor: pointer; min-height: 40px; }
.med__list li:hover { background: var(--panel-2); } .med__list li.is-sel { background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.med__list li b { display: block; color: var(--hi); font-size: .88rem; } .med__list li small { color: var(--muted); font-size: .74rem; } .med__list li > span:nth-child(2) { flex: 1; min-width: 0; }
.med__dot { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.med__detail { border-top: 1px solid var(--line); padding: .7rem .8rem; max-height: 48%; overflow-y: auto; flex: none; }
.med__dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem .7rem; margin: .3rem 0; font-size: .84rem; } .med__dl dt { color: var(--muted); } .med__dl dd { margin: 0; }
.med__acts { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.med__ev { margin: .2rem 0; padding-left: 1rem; font-size: .84rem; }
.med__risk { display: grid; gap: .25rem; font-size: .78rem; } .med__risk div { display: grid; grid-template-columns: 110px 1fr 26px; gap: .4rem; align-items: center; }
.med__risk i { display: block; height: 7px; border-radius: 4px; }
.med-h { background: #fff; border: 2px solid #E3293E; border-radius: 50%; cursor: grab; } .med-h--mid { opacity: .55; border-color: #2F6FED; }
.med-h--move { display: grid !important; place-items: center; background: #E3293E; color: #fff; border: 0; font-size: 16px; }
.dq2__bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: .6rem; } .dq2__bar .field { min-width: 240px; }
.dq2__grid summary { cursor: pointer; font-size: .84rem; color: var(--muted); }
@media (max-width: 760px) {
  .med { grid-template-columns: 1fr; height: calc(100dvh - 150px); min-height: 460px; }
  .med__tools { left: 8px; right: 8px; max-width: none; top: auto; bottom: 8px; flex-wrap: nowrap; overflow-x: auto; }
  .med__t em { display: none; } .med__t { min-width: 40px; justify-content: center; }
  .med__toggle { top: 8px; right: 8px; }
  .med__side { position: absolute; z-index: 900; left: 0; right: 0; bottom: 0; height: 70%; border-left: 0; border-top: 1px solid var(--line-2); border-radius: 16px 16px 0 0;
    transform: translateY(100%); transition: transform .25s ease; box-shadow: 0 -10px 30px rgba(0,0,0,.35); }
  .med.is-open .med__side { transform: translateY(0); }
  .med.is-collapsed { grid-template-columns: 1fr; } .med.is-collapsed .med__side { visibility: visible; }
  .med__float { bottom: 62px; }
}
.med__t em { font-style: normal; }
/* Barre d'outils sur une seule ligne : libellés seulement si la carte est large (jamais un bloc qui masque la carte) */
@container (max-width: 1100px) { .med__t em { display: none; } .med__t { min-width: 40px; justify-content: center; } }

.sgp__modes { display: flex; gap: .5rem; flex-wrap: wrap; }
.sgp__modes button { min-height: 46px; padding: 0 1rem; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font: 700 .92rem var(--fc); cursor: pointer; }
.sgp__modes button[aria-selected=true] { background: var(--accent); color: #fff; border-color: var(--accent); }
.sgp__alt { margin: -.4rem 0 0; } .linklike { background: none; border: 0; padding: .3rem 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; } .linklike[hidden] { display: none; }

/* Menu du jeu V2.3 : recherche, catégories, sections */
.menu4__top { position: sticky; top: -1px; z-index: 3; background: var(--panel); padding: .2rem 0 .5rem; display: flex; flex-direction: column; gap: .45rem; }
.menu4__q { min-height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); padding: 0 .8rem; font-size: 1rem; width: 100%; }
.menu4__cats { display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: none; } .menu4__cats::-webkit-scrollbar { display: none; }
.menu4__cats button { flex: none; display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; padding: 0 .75rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: 700 .82rem var(--fc); cursor: pointer; }
.menu4__cats button svg { width: 16px; height: 16px; } .menu4__cats button.is-on { background: var(--accent); color: #fff; border-color: var(--accent); }
.menu4__sec { scroll-margin-top: 110px; } .menu4__none { text-align: center; padding: 1rem; }
.modal--menu .modal__body { padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
/* Administration V2.3 : fil d'Ariane, favoris, actions rapides, indicateurs, filtres de tableaux */
.ax__crumb { display: flex; flex-wrap: wrap; gap: .3rem; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.ax__crumb a { color: var(--accent); text-decoration: none; } .ax__crumb [aria-current] { color: var(--text); }
.ax__favbtn { min-width: 40px; min-height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); color: #F2B33D; font-size: 1.2rem; cursor: pointer; flex: none; }
.ax__favbtn[aria-pressed=true] { background: rgba(242, 179, 61, .14); border-color: #F2B33D; }
.ax__quick { position: relative; flex: none; } .ax__quick > .btn { min-height: 40px; }
.ax__qmenu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 1200; min-width: 260px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-lg); padding: .3rem; display: grid; }
.ax__qmenu button { text-align: left; min-height: 40px; padding: 0 .7rem; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; font: 600 .86rem var(--fc); }
.ax__qmenu button:hover { background: var(--panel-2); }
.ax__badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font: 800 .7rem/20px var(--fc); text-align: center; }
.ax.is-mini .ax__badge { position: absolute; right: 6px; top: 4px; margin: 0; }
.tblf { width: 100%; max-width: 420px; min-height: 38px; margin: .4rem 0; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); padding: 0 .7rem; }
.ax__content { max-width: none; }
@media (max-width: 760px) { .ax__quick > .btn { padding: 0 .55rem; font-size: 0; } .ax__quick > .btn::before { content: '⚡'; font-size: 1.1rem; } .ax__crumb { display: none; } }

/* V2.3 — maintenance globale : bandeau (toutes les pages) et écran de maintenance bloquante (jeu, chargement) */
.dw-maint { position: sticky; top: 0; z-index: 2000; display: flex; align-items: flex-start; gap: .6rem; padding: .6rem 1rem; border-bottom: 1px solid rgba(240, 82, 74, .55);
  background: #3A1517; color: #FFE1DE; font-size: .9rem; line-height: 1.35; }
.dw-maint--soon { background: #3A2F12; border-bottom-color: rgba(242, 179, 61, .6); color: #FFEBC2; }
.dw-maint__ic { font-size: 1.1rem; line-height: 1.2; }
.dw-maint__txt { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: .15rem .5rem; }
.dw-maint__t { letter-spacing: .04em; font-family: var(--fc); }
.dw-maint__x { min-width: 36px; min-height: 36px; margin: -.3rem -.4rem -.3rem 0; border: 0; background: transparent; color: inherit; font-size: 1.3rem; cursor: pointer; }
.dw-maint--float { position: fixed; top: .5rem; left: 50%; transform: translateX(-50%); width: min(760px, calc(100% - 1.2rem)); border: 1px solid rgba(240, 82, 74, .6);
  border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.dw-maint--float.dw-maint--soon { border-color: rgba(242, 179, 61, .6); }
[data-theme="light"] .dw-maint { background: #FDE7E5; color: #6B1A14; }
[data-theme="light"] .dw-maint--soon { background: #FFF3D6; color: #5C4206; }
.dw-maint-screen { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 1rem; background: rgba(8, 12, 18, .92); overflow-y: auto; }
.dw-maint-screen__box { width: min(520px, 100%); background: var(--panel, #161B22); color: var(--text, #E6EDF3); border: 1px solid var(--line-2, #30363D); border-radius: 18px;
  padding: 1.4rem; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.dw-maint-screen__ic { font-size: 2.4rem; }
.dw-maint-screen h1 { font: 800 1.5rem var(--fc); color: var(--hi, #fff); margin: .3rem 0 .6rem; }
.dw-maint-screen__msg { padding: .6rem .8rem; border-radius: 10px; background: rgba(240, 82, 74, .12); }
.dw-maint-screen__svc { list-style: none; margin: .8rem 0; padding: 0; text-align: left; display: grid; gap: .3rem; }
.dw-maint-screen__svc li { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem .6rem; border-radius: 8px; background: rgba(127, 127, 127, .08); }
.dw-maint-screen__svc .is-ok { color: #3FB950; } .dw-maint-screen__svc .is-warn { color: #F2B33D; } .dw-maint-screen__svc .is-down { color: #F0524A; }
.dw-maint-screen__chk { font-size: .82rem; opacity: .75; }
.dw-maint-screen__acts { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-top: .6rem; }
@media (max-width: 600px) { .dw-maint { padding: .5rem .7rem; font-size: .84rem; } .dw-maint-screen__box { padding: 1.1rem; } }

/* V2.3 — pages cartographiques de l'administration en pleine largeur (aucune marge vide de chaque côté) */
.ax-body[data-axmod="worldmap"] .admin.ax__content, .ax-body[data-axmod="districts"] .admin.ax__content, .ax-body[data-axmod="zones"] .admin.ax__content,
.ax-body[data-axmod="searches"] .admin.ax__content, .ax-body[data-axmod="checkpoints"] .admin.ax__content {
  max-width: none; padding-left: clamp(.8rem, 1.6vw, 1.6rem); padding-right: clamp(.8rem, 1.6vw, 1.6rem); padding-bottom: 1rem; }
.ax-body[data-axmod="worldmap"] .wmap { height: calc(100dvh - 255px); min-height: 460px; max-height: none; }
.ax-body[data-axmod="zones"] .med { height: calc(100dvh - 215px); }
.ax-body[data-axmod="districts"] .med { height: calc(100dvh - 300px); min-height: 480px; }
.ax-body.has-maint[data-axmod="worldmap"] .wmap, .ax-body.has-maint[data-axmod="zones"] .med, .ax-body.has-maint[data-axmod="districts"] .med { max-height: calc(100dvh - 300px); }
.ax-body[data-axmod="districts"] .dq2__bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem 1rem; }
.ax-body[data-axmod="districts"] .dq2__bar > .hint { flex-basis: 100%; margin: 0; }
@media (max-width: 760px) { .ax-body[data-axmod="districts"] .med { height: calc(100dvh - 190px); } .ax-body[data-axmod="worldmap"] .wmap { height: calc(100dvh - 230px); } }
/* Maintenance : boutons « Créer un compte » neutralisés quand la création de compte est suspendue */
.is-maint-off { opacity: .55; text-decoration: line-through; }

/* ===================================================================== V2.3 — menu du jeu (refonte)
   Ordinateur : catégories à gauche, tuiles en grille à droite (aucun long défilement).
   Téléphone (≤ 900 px) : feuille plein écran, recherche et onglets collants, grandes cibles tactiles. */
.modal--menu { width: min(1080px, 96vw); max-width: 1080px; }
.modal--menu .modal__body { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.gm { --gc: var(--accent); display: grid; grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "search search" "tabs strip" "tabs panel" "foot foot"; height: min(640px, calc(100dvh - 7rem)); min-height: 0; }
.gm [data-gc="recent"] { --gc: #F2B33D; } .gm [data-gc="ops"] { --gc: #E3293E; } .gm [data-gc="gest"] { --gc: #3E8BFF; }
.gm [data-gc="ia"] { --gc: #9C6BFF; } .gm [data-gc="comm"] { --gc: #2BC4A9; } .gm [data-gc="acct"] { --gc: #F28C3D; }
.gm__top { display: contents; }
.gm__search, .gm__tabs, .gm__strip, .gm__panel, .gm__foot { min-width: 0; }   /* éléments de grille : jamais plus larges que la fenêtre (onglets défilants) */
.gm__search { grid-area: search; display: flex; align-items: center; gap: .55rem; margin: .8rem 1rem .4rem; padding: 0 .8rem; min-height: 46px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-2); color: var(--muted); }
.gm__search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.gm__search > span { font-size: 1.2rem; line-height: 1; }
.gm__search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font-size: 1rem; outline: none; min-height: 44px; }
.gm__kbd { font: 600 .7rem var(--fc); padding: .15rem .45rem; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.gm__tabs { grid-area: tabs; display: flex; flex-direction: column; gap: .2rem; padding: .4rem .6rem 1rem 1rem; overflow-y: auto; border-right: 1px solid var(--line); }
.gm__tabs button { display: flex; align-items: center; gap: .6rem; min-height: 44px; padding: 0 .7rem; border: 0; border-radius: 10px; background: transparent;
  color: var(--text); font: 600 .95rem var(--fc); cursor: pointer; text-align: left; transition: background .15s, color .15s; }
.gm__tabs button svg { width: 18px; height: 18px; color: var(--gc); flex: none; }
.gm__tabs button span { flex: 1; }
.gm__tabs button i { font: 700 .7rem var(--fc); font-style: normal; color: var(--muted); background: var(--panel-2); border-radius: 999px; padding: .1rem .45rem; }
.gm__tabs button:hover { background: var(--panel-2); }
.gm__tabs button.is-on { background: color-mix(in srgb, var(--gc) 16%, transparent); color: var(--hi); box-shadow: inset 3px 0 0 var(--gc); }
.gm__tabs button:focus-visible, .gt:focus-visible, .gm__strip button:focus-visible { outline: 2px solid var(--gc); outline-offset: 2px; }
.gm__strip { grid-area: strip; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .4rem; padding: .4rem 1rem .6rem; }
.gm__strip button { display: flex; flex-direction: column; align-items: flex-start; padding: .45rem .7rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); cursor: pointer; text-align: left; }
.gm__strip small { color: var(--muted); font-size: .72rem; } .gm__strip b { color: var(--hi); font: 700 .95rem var(--fc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.gm__strip button:hover { border-color: var(--accent); }
.gm.is-search .gm__strip { display: none; }
.gm__panel { grid-area: panel; overflow-y: auto; overscroll-behavior: contain; padding: .2rem 1rem 1rem; min-height: 0; }
.gm.is-search .gm__panel { grid-row: 2 / 4; }
.gm__panel.is-in { animation: gmIn .18s ease-out; }
@keyframes gmIn { from { opacity: 0; transform: translateY(4px); } }
.gm__h { margin: .6rem 0 .5rem; font: 700 .72rem var(--fc); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.gm__h small { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: .4rem; }
.gm__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .55rem; }
.gt { position: relative; display: flex; align-items: flex-start; gap: .7rem; min-height: 74px; padding: .75rem .8rem; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); text-align: left; text-decoration: none; cursor: pointer; transition: transform .12s, border-color .12s, background .12s; }
.gt:hover { border-color: color-mix(in srgb, var(--gc) 60%, var(--line)); background: color-mix(in srgb, var(--gc) 7%, var(--panel-2)); transform: translateY(-1px); }
.gt:active { transform: translateY(0) scale(.99); }
.gt__ico { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--gc);
  background: color-mix(in srgb, var(--gc) 14%, var(--bg-2)); border: 1px solid color-mix(in srgb, var(--gc) 35%, transparent); }
.gt__ico .ico, .gt__ico svg { width: 19px; height: 19px; }
.gt__t { display: flex; flex-direction: column; gap: .15rem; min-width: 0; flex: 1; }
.gt__t b { color: var(--hi); font-size: .95rem; line-height: 1.2; }
.gt__t small { color: var(--muted); font-size: .8rem; line-height: 1.3; }
.gt__meta { position: absolute; top: .45rem; right: .55rem; font: 700 .68rem var(--fc); font-style: normal; color: var(--gc);
  background: color-mix(in srgb, var(--gc) 12%, transparent); border-radius: 999px; padding: .1rem .45rem; max-width: 45%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gt:has(.gt__meta) .gt__t { padding-right: 3.2rem; }
.gm__none { text-align: center; padding: 2rem 1rem; }
.gm__foot { grid-area: foot; display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
.gm__hint { color: var(--dim); font-size: .76rem; text-align: center; }
@media (max-width: 900px) {
  .modal--menu { height: calc(100dvh - env(safe-area-inset-top, 0px) - 8px); }
  .gm { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr) auto; grid-template-areas: "search" "tabs" "strip" "panel" "foot"; height: 100%; }
  .gm.is-search .gm__panel { grid-row: 3 / 5; }
  .gm__search { margin: .6rem .8rem .3rem; }
  .gm__kbd, .gm__hint { display: none; }
  .gm__tabs { flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: .35rem; padding: .3rem .8rem .5rem; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; scroll-snap-type: x proximity; }
  .gm__tabs::-webkit-scrollbar { display: none; }
  .gm__tabs button { flex: none; min-height: 40px; padding: 0 .8rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel-2); font-size: .88rem; scroll-snap-align: start; }
  .gm__tabs button i { display: none; }
  .gm__tabs button.is-on { box-shadow: none; border-color: var(--gc); background: color-mix(in srgb, var(--gc) 22%, var(--panel-2)); }
  .gm__strip { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: .5rem .8rem; }
  .gm__panel { padding: 0 .8rem .8rem; -webkit-overflow-scrolling: touch; }
  .gm__grid { grid-template-columns: 1fr; gap: .4rem; }
  .gt { min-height: 60px; align-items: center; padding: .6rem .7rem; }
  .gt:hover { transform: none; }
  .gt__t small { font-size: .78rem; }
  .gm__foot .btn { min-height: 42px; }
}
@media (min-width: 520px) and (max-width: 900px) { .gm__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .gm__panel.is-in { animation: none; } .gt { transition: none; } }

/* ===================================================================== V2.3 — fenêtres du jeu : même identité que le menu
   En-tête : « ← Menu » (si ouverte depuis le menu), icône et couleur de la catégorie, sous-titre, ✕ rouge.
   Contenu : blocs communs (cartes, titres, onglets, puces, interrupteurs, tableaux, listes, états vides) teintés par la catégorie. */
.modal[data-gc="ops"] { --gc: #E3293E; } .modal[data-gc="gest"] { --gc: #3E8BFF; } .modal[data-gc="ia"] { --gc: #9C6BFF; }
.modal[data-gc="comm"] { --gc: #2BC4A9; } .modal[data-gc="acct"] { --gc: #F28C3D; } .modal[data-gc="recent"] { --gc: #F2B33D; }

/* ✕ rouge sur toutes les fenêtres */
.modal__x { width: 38px; height: 38px; min-width: 38px; border-radius: 10px; border: 1px solid rgba(227, 41, 62, .45); background: rgba(227, 41, 62, .12);
  color: #FF6B6B; font-size: 1rem; font-weight: 700; display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s, transform .1s; }
.modal__x:hover { background: #E3293E; color: #fff; border-color: #E3293E; }
.modal__x:active { transform: scale(.95); }
.modal__x:focus-visible { outline: 2px solid #FF6B6B; outline-offset: 2px; }

/* En-tête des fenêtres reconnues */
.modal.is-themed { border-top: 3px solid var(--gc); }
.modal.is-themed .modal__head { gap: .75rem; justify-content: flex-start;
  background: linear-gradient(100deg, color-mix(in srgb, var(--gc) 14%, transparent) 0%, transparent 55%); }
.modal__ttl { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.modal__ttl .modal__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal__sub { margin: .1rem 0 0; color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal__ico { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: var(--gc);
  background: color-mix(in srgb, var(--gc) 16%, var(--bg-2)); border: 1px solid color-mix(in srgb, var(--gc) 40%, transparent); }
.modal__ico svg, .modal__ico .ico { width: 20px; height: 20px; }
.modal__back { flex: none; display: inline-flex; align-items: center; gap: .35rem; min-height: 38px; padding: 0 .8rem 0 .65rem; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: 700 .85rem var(--fc); cursor: pointer; transition: border-color .15s, background .15s; }
.modal__back span { font-size: 1.05rem; line-height: 1; transition: transform .15s; }
.modal__back em { font-style: normal; }
.modal__back:hover { border-color: var(--gc); background: color-mix(in srgb, var(--gc) 12%, var(--panel-2)); }
.modal__back:hover span { transform: translateX(-2px); }
.modal__back:focus-visible { outline: 2px solid var(--gc); outline-offset: 2px; }

/* Contenu : blocs communs teintés par la catégorie */
.modal.is-themed .modal__body { scrollbar-color: color-mix(in srgb, var(--gc) 45%, var(--line-2)) transparent; }
.modal.is-themed .box { border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in srgb, var(--panel-2) 92%, var(--gc) 8%), var(--panel-2) 70%); }
.modal.is-themed .h3, .modal.is-themed .menu3__h { display: flex; align-items: center; gap: .5rem; }
.modal.is-themed .h3::before { content: ''; width: 4px; height: 1.05em; border-radius: 3px; background: var(--gc); flex: none; }
.modal.is-themed .menu3__h { color: var(--gc); }
.modal.is-themed .tabs [aria-selected="true"], .modal.is-themed .tabs .is-on, .modal.is-themed .staff__tabs .is-on { color: var(--hi); box-shadow: inset 0 -3px 0 var(--gc); }
.modal.is-themed .seg .is-on, .modal.is-themed .seg [aria-pressed="true"], .modal.is-themed .seg [aria-selected="true"] { background: var(--gc); border-color: var(--gc); color: #fff; }
.modal.is-themed .fchip.is-on, .modal.is-themed .chips .is-on { background: color-mix(in srgb, var(--gc) 22%, var(--panel-2)); border-color: var(--gc); color: var(--hi); }
.modal.is-themed input[type="checkbox"], .modal.is-themed input[type="radio"], .modal.is-themed input[type="range"] { accent-color: var(--gc); }
.modal.is-themed .field input:focus, .modal.is-themed .field select:focus, .modal.is-themed .field textarea:focus, .modal.is-themed input[type="search"]:focus {
  border-color: var(--gc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gc) 20%, transparent); outline: none; }
.modal.is-themed .tbl thead th { position: sticky; top: 0; z-index: 1; background: var(--panel); }
.modal.is-themed .tbl tbody tr { transition: background .12s; }
.modal.is-themed .tbl tbody tr:hover { background: color-mix(in srgb, var(--gc) 7%, transparent); }
.modal.is-themed .rlist > li { border-radius: 10px; transition: background .12s; }
.modal.is-themed .rlist > li:hover { background: color-mix(in srgb, var(--gc) 6%, transparent); }
.modal.is-themed .empty { display: flex; flex-direction: column; align-items: center; gap: .6rem; text-align: center; padding: 2rem 1.2rem; border-radius: 14px;
  border: 1px dashed color-mix(in srgb, var(--gc) 40%, var(--line-2)); background: color-mix(in srgb, var(--gc) 5%, transparent); color: var(--muted); }
.modal.is-themed .empty::before { content: '✦'; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; font-size: 1.3rem; color: var(--gc);
  background: color-mix(in srgb, var(--gc) 14%, var(--bg-2)); border: 1px solid color-mix(in srgb, var(--gc) 35%, transparent); }
.modal.is-themed .empty p { margin: 0; max-width: 46ch; }
.modal.is-themed .mrow__ico { color: var(--gc); }

@media (max-width: 640px) {
  .modal.is-themed .modal__head { gap: .5rem; padding: .7rem .8rem; }
  .modal__back { padding: 0 .55rem; min-height: 38px; }
  .modal__back em { display: none; }
  .modal__ico { width: 34px; height: 34px; border-radius: 9px; }
  .modal__sub { font-size: .76rem; }
}
@media (prefers-reduced-motion: reduce) { .modal__back span, .modal__x { transition: none; } }

/* V2.3 — Agents IA et Codes promotionnels dans une fenêtre du jeu (plus de pages séparées) */
.modal--agents { width: min(1180px, 96vw); max-width: 1180px; }
.agp--win { max-width: none; margin: 0; }
.agp--win .agp__head { align-items: center; }
.agp--win .agp__head .hint { margin: 0; max-width: 70ch; }
.rdm--win { max-width: none; margin: 0; gap: .9rem; }
.rdm--win .rdm__form input { color: var(--text); }

/* V2.3 — Administration dans le menu du jeu (administrateurs seulement) */
.gm [data-gc="adm"] { --gc: #D9488F; } .modal[data-gc="adm"] { --gc: #D9488F; }
.modal--adq { width: min(1000px, 96vw); max-width: 1000px; }
.adq { display: flex; flex-direction: column; gap: .9rem; }
.adq__alerts { display: grid; gap: .5rem; }
.adq__al { display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); }
.adq__al > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.adq__al b { color: var(--hi); } .adq__al small { color: var(--muted); }
.adq__dot { flex: none; width: 11px; height: 11px; border-radius: 50%; background: #3FB950; box-shadow: 0 0 0 4px rgba(63, 185, 80, .18); }
.adq__al.is-bad { border-color: rgba(227, 41, 62, .5); background: rgba(227, 41, 62, .08); } .adq__al.is-bad .adq__dot { background: #E3293E; box-shadow: 0 0 0 4px rgba(227, 41, 62, .2); }
.adq__al.is-warn { border-color: rgba(242, 179, 61, .45); background: rgba(242, 179, 61, .07); } .adq__al.is-warn .adq__dot { background: #F2B33D; box-shadow: 0 0 0 4px rgba(242, 179, 61, .2); }
.adq__al.is-info .adq__dot { background: #3E8BFF; box-shadow: 0 0 0 4px rgba(62, 139, 255, .2); }
.adq__al.is-ok { border-color: rgba(63, 185, 80, .4); }
.adq__kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; }
.adq__k { display: flex; flex-direction: column; gap: .1rem; padding: .7rem .8rem; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); }
.adq__k b { font: 800 1.35rem var(--fc); color: var(--hi); } .adq__k span { font-size: .82rem; color: var(--text); } .adq__k small { font-size: .74rem; color: var(--muted); }
.adq__links { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .5rem; }
.adq .h3 small { font-weight: 500; margin-left: .3rem; }
.adq__log li { display: flex; justify-content: space-between; gap: .6rem; padding: .35rem .4rem; }
.adq__foot { justify-content: flex-end; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 640px) {
  .adq__kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adq__links { grid-template-columns: 1fr; }
  .adq__al { flex-wrap: wrap; } .adq__al > .btn { margin-left: auto; }
  .adq__foot .btn { flex: 1 1 100%; }
}

/* V2.3 — Statistiques, Tracker et Propositions dans une fenêtre du jeu (plus de pages externes) */
.modal--pagewin { width: min(1120px, 96vw); max-width: 1120px; }
.modal--sgpwin { width: min(1240px, 97vw); max-width: 1240px; }
.statspage--win { max-width: none; margin: 0; padding: 0; }
.statspage--win .statspage__head .hint { margin: 0; }
.trk-win { display: flex; flex-direction: column; gap: .8rem; }
.trk__search--win { display: flex; gap: .45rem; align-items: center; max-width: none; position: sticky; top: -1px; z-index: 5; padding: .2rem 0 .5rem; background: var(--panel); }
.trk__search--win input { flex: 1; min-width: 0; }
.trk-win .trk { max-width: none; padding: 0; margin: 0; }
.sgp--win { max-width: none; margin: 0; padding: 0; }
.sgp--win .sgp__grid { grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); align-items: start; }
.sgp--win .sgp__mapbox { position: sticky; top: 0; }
.sgp--win .sgp__map { height: min(520px, 58vh); }
@media (max-width: 900px) {
  .sgp--win .sgp__grid { grid-template-columns: 1fr; }
  .sgp--win .sgp__mapbox { position: static; order: -1; }
  .sgp--win .sgp__map { height: 300px; }
  .trk__search--win .btn--ghost { display: none; }
}

/* V2.3 — Assistants IA payants : pass (1 h, 6 h, 24 h, 7 jours) */
.agc__pass { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin: .6rem 0 0; font-size: .85rem; color: var(--muted); }
.agc.is-locked { opacity: .92; border-style: dashed; }
.agpay { border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem; background: var(--panel-2); margin-bottom: .9rem; }
.agpay.is-focus { border-color: var(--gc, var(--accent)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gc, var(--accent)) 18%, transparent); }
.agpay header { display: flex; align-items: center; gap: .7rem; } .agpay header b { font: 800 1.1rem var(--fc); color: var(--hi); display: block; } .agpay header small { color: var(--muted); }
.agpay > p { margin: .7rem 0; }
.agpay__opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.agpay__o { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .7rem .5rem; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); cursor: pointer; transition: border-color .15s, transform .1s; }
.agpay__o b { font: 800 1rem var(--fc); color: var(--hi); } .agpay__o span { font: 700 .95rem var(--fc); color: #F2C230; } .agpay__o small { color: var(--muted); font-size: .72rem; }
.agpay__o:hover { border-color: var(--gc, var(--accent)); transform: translateY(-1px); }
@media (max-width: 640px) { .agpay__opts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* V2.3 — Assistants IA payants : état du pass sur les cartes, écran d'achat */
.agc__pass { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin: .6rem 0 0; font-size: .85rem; color: var(--muted); }
.agc__pass b { color: var(--text); }
.agc.is-locked { opacity: .92; border-style: dashed; }
.agpay { border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem; margin-bottom: .9rem; background: var(--panel-2); }
.agpay.is-focus { border-color: var(--gc, #9C6BFF); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gc, #9C6BFF) 20%, transparent); }
.agpay header { display: flex; align-items: center; gap: .7rem; } .agpay header b { font: 800 1.1rem var(--fc); color: var(--hi); display: block; } .agpay header small { color: var(--muted); }
.agpay > p { margin: .7rem 0; }
.agpay__opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.agpay__o { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; padding: .7rem .8rem; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); cursor: pointer; text-align: left; transition: border-color .15s, transform .1s; }
.agpay__o b { font: 800 1rem var(--fc); color: var(--hi); } .agpay__o span { font-weight: 700; color: #F2C230; } .agpay__o small { color: var(--muted); font-size: .74rem; }
.agpay__o:hover { border-color: var(--gc, #9C6BFF); transform: translateY(-1px); }
@media (max-width: 640px) { .agpay__opts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* V2.3 — Section d'administration affichée dans une fenêtre du jeu (admin/?embed=1) */
.ax-embed .ax { grid-template-columns: minmax(0, 1fr); }
.ax-embed .ax__side, .ax-embed .ax__scrim, .ax-embed .ax__top { display: none !important; }
.ax-embed .admin.ax__content { max-width: none; padding: 1rem clamp(.8rem, 2vw, 1.4rem) 2rem; }
.modal--adminwin { width: min(1400px, 98vw); max-width: 1400px; height: calc(100dvh - 2.5rem); }
.modal--adminwin .modal__body { padding: 0; overflow: hidden; display: flex; flex: 1 1 auto; min-height: 0; }
.adwin { flex: 1; display: flex; flex-direction: column; min-height: 0; width: 100%; }
.adwin__frame { flex: 1; width: 100%; border: 0; min-height: 0; background: var(--bg); }
.adwin__bar { display: flex; align-items: center; gap: .5rem; padding: .4rem .8rem; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.adwin__bar a { margin-left: auto; }
@media (max-width: 900px) { .modal--adminwin { height: calc(100dvh - env(safe-area-inset-top, 0px) - 8px); width: 100vw; } }

/* V2.3 — Couverture : barème du temps de réponse */
.covscale { list-style: none; margin: .5rem 0; padding: 0; display: grid; gap: .3rem; }
.covscale li { display: grid; grid-template-columns: 14px auto 1fr auto; align-items: center; gap: .5rem; font-size: .85rem; }
.covscale i { width: 14px; height: 14px; border-radius: 4px; }
.covscale b { color: var(--hi); } .covscale span { color: var(--muted); } .covscale em { font-style: normal; font-weight: 700; color: var(--text); }
.covpanel__lock { margin: .4rem 0 0; }

/* V2.3 — Bâtiment en cours d'amélioration : sablier animé + anneau de progression */
.bld--up { box-shadow: 0 0 0 3px #0B141C, 0 0 0 5px rgba(255,255,255,.12), 0 2px 6px rgba(0,0,0,.5); }
.bld--up::before { content: ''; position: absolute; inset: -6px; border-radius: 10px; padding: 3px; pointer-events: none;
  background: conic-gradient(#F2B33D calc(var(--p) * 1%), rgba(255,255,255,.12) 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.bld__hg { position: absolute; top: -11px; right: -11px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-style: normal;
  background: #F2B33D; box-shadow: 0 1px 4px rgba(0,0,0,.6); animation: bldHg 2s ease-in-out infinite; }
@keyframes bldHg { 0%, 40% { transform: rotate(0); } 50%, 90% { transform: rotate(180deg); } 100% { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .bld__hg { animation: none; } }

/* V2.3 — Admin : lancer une mission */
.adlaunch__row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) 90px auto; gap: .6rem; align-items: end; }
.adlaunch__row .field { margin: 0; } .adlaunch__row select, .adlaunch__row input { width: 100%; }
@media (max-width: 800px) { .adlaunch__row { grid-template-columns: 1fr; } }

/* V2.3 — Éditeur de missions : délai des complications à la réception */
.scrow__when { margin: 0 0 .5rem; font-size: .85rem; color: var(--muted); } .scrow__when b { color: #F2B33D; }
.scrow__delay { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .3rem 0 .6rem; font-size: .88rem; }
.scrow__delay > span { font-weight: 600; color: var(--text); }
.scrow__delay label { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); }
.scrow__delay input { width: 72px; }
.prevlist__later { display: inline-block; margin-top: .2rem; font-size: .82rem; color: #F2B33D; }

/* V2.3 — Démonstration : choix de la ville, placement du poste, reprise à l'inscription */
.dm-cross { position: absolute; z-index: 650; left: 50%; top: 50%; width: 44px; height: 44px; margin: -44px 0 0 -22px; pointer-events: none; }
.dm-cross i { position: absolute; left: 50%; bottom: 0; width: 2px; height: 14px; margin-left: -1px; background: #fff; box-shadow: 0 0 4px rgba(0,0,0,.8); }
.dm-cross span { position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  font: 800 .95rem var(--fc); color: #fff; background: #0B141C; border: 2px solid var(--svc-police, #3E8BFF); box-shadow: 0 4px 12px rgba(0,0,0,.6); }
.dm-cross.is-bad span { border-color: #E3293E; color: #FF6B6B; }
.dm-city { margin: .6rem 0 0; } .dm-city select { width: 100%; }
.dm-place { margin: .4rem 0 0; font-weight: 600; } .dm-place.is-bad { color: #FF6B6B; }
.dm-keep { border: 1px solid #3FB950; background: rgba(63,185,80,.08); border-radius: 12px; padding: .7rem .9rem; margin: .4rem 0 .8rem; }
.dm-keep ul { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; gap: .25rem; }
.lx-demo-keep { border: 1px solid #3FB950; background: rgba(63,185,80,.08); border-radius: 12px; padding: .6rem .8rem; font-size: .9rem; }
.lx-demo-keep button { margin-top: .3rem; }

/* V2.3 — Véhicules garés sur une intervention : de près, l'icône se rapproche de la taille réelle (places distinctes du serveur) */
#map[data-z="17"] .dwv.is-onscene { transform: scale(.82); }
#map[data-z="18"] .dwv.is-onscene { transform: scale(.66); }
#map[data-z="19"] .dwv.is-onscene { transform: scale(.6); }
#map[data-z="17"] .dwv.is-onscene .dwv__bar, #map[data-z="18"] .dwv.is-onscene .dwv__bar, #map[data-z="19"] .dwv.is-onscene .dwv__bar { display: none; }
.covpanel__build { margin: .3rem 0; color: #2BC4A9; }
.covpanel__mix { margin: .35rem 0 0; line-height: 1.5; }

/* Propositions v2 : pleine largeur, onglets en cartes, carte collante sur toute la hauteur, bouton d'envoi toujours visible */
.sgp { max-width: 1500px; padding: 1.2rem 1.25rem 2rem; }
.sgp .sgp__modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.sgp .sgp__modes button { display: flex; align-items: center; gap: .7rem; min-height: 64px; padding: .55rem .9rem; text-align: left; border-radius: 14px;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font: 600 .9rem var(--fc); cursor: pointer; transition: border-color .15s, background .15s; }
.sgp .sgp__modes button:hover { border-color: var(--accent); }
.sgp .sgp__modes button b { display: block; font-size: 1.02rem; color: var(--hi); }
.sgp .sgp__modes button small { display: block; color: var(--muted); font-weight: 500; font-size: .8rem; }
.sgp .sgp__modes button[aria-selected=true] { background: color-mix(in srgb, var(--accent) 16%, var(--panel)); border-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); color: var(--text); }
.sgp__ico { font-size: 1.6rem; line-height: 1; flex: none; }
.sgp .sgp__grid { grid-template-columns: minmax(440px, 600px) minmax(0, 1fr); align-items: start; gap: 1.2rem; }
.sgp .sgp__form .checks { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
.sgp .sgp__form > button[type=submit] { position: sticky; bottom: .8rem; z-index: 3; min-height: 48px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.sgp .sgp__mapbox { position: sticky; top: 1rem; }
.sgp .sgp__map { height: calc(100vh - 190px); min-height: 420px; }
.sgp__tools { justify-content: space-between; }
.sgp__tgroup { display: inline-flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.sgp__tlbl { font-size: .8rem; color: var(--muted); margin-right: .15rem; }
.sgp--win .sgp__grid { grid-template-columns: minmax(380px, 520px) minmax(0, 1fr); }
.sgp--win .sgp__map { height: calc(92vh - 260px); min-height: 360px; }
@media (max-width: 900px) {
  .sgp { padding: .8rem .75rem 1.5rem; }
  .sgp .sgp__grid, .sgp--win .sgp__grid { grid-template-columns: 1fr; }
  .sgp .sgp__mapbox { position: static; order: -1; }
  .sgp .sgp__map, .sgp--win .sgp__map { height: 320px; min-height: 0; }
  .sgp .sgp__modes button { flex-direction: column; justify-content: center; text-align: center; gap: .2rem; min-height: 64px; padding: .4rem .3rem; }
  .sgp .sgp__modes button small { display: none; }
  .sgp__ico { font-size: 1.3rem; }
}
.sgp.sgp--win { padding: 0; max-width: none; }
.covpanel__dead { display: flex; gap: .5rem; align-items: flex-start; margin: .2rem 0 .4rem; }
.covpanel__dead i { flex: none; width: 16px; height: 16px; margin-top: 2px; border-radius: 4px; border: 1px solid #2BC4A9; background: repeating-linear-gradient(135deg, #04060a 0 4px, #2a2f36 4px 6px); }

/* Couverture radio : diagnostic */
.covpanel__diagbox { margin-top: .5rem; border: 1px solid var(--line); border-radius: 10px; padding: .4rem .6rem; }
.covpanel__diagbox summary { cursor: pointer; font-weight: 700; font-size: .85rem; }
.covdiag { display: grid; grid-template-columns: 1fr auto; gap: .2rem .6rem; margin: .5rem 0 .3rem; font-size: .82rem; }
.covdiag dt { color: var(--muted); } .covdiag dd { margin: 0; text-align: right; font-weight: 700; }
.covpop__diag { margin-top: .4rem; padding-top: .4rem; border-top: 1px solid var(--line); font-size: .82rem; }
.covpop__diag .covpop__s div { margin: .15rem 0; }

/* Parrainage par démonstration */
.dm-invite { font: 700 .72rem var(--fc); color: #7FE7D6; background: rgba(43, 196, 169, .12); border: 1px solid rgba(43, 196, 169, .45); padding: .2rem .55rem; border-radius: 999px; white-space: nowrap; }
.dm-invited { margin: 0 0 .4rem; width: 100%; font-size: .85rem; color: #7FE7D6; }
[data-dm-signup] small { display: block; font-size: .72rem; font-weight: 600; opacity: .85; }
@media (max-width: 760px) { .dm-invite { order: 4; } }

/* Parrainage : deux façons d'inviter + suivi */
.ref__links { display: grid; gap: .7rem; margin: .8rem 0; }
.ref__mine { display: flex; align-items: baseline; gap: .6rem; } .ref__mine span { color: var(--muted); font-size: .85rem; }
.ref__mine b { font: 800 1.35rem var(--fc); letter-spacing: .12em; color: var(--hi); }
.ref__inv { background: var(--panel-2, rgba(255,255,255,.03)); border: 1px solid var(--line); border-radius: 12px; padding: .65rem .75rem; display: grid; gap: .45rem; min-width: 0; }
.ref__inv header { display: flex; flex-direction: column; gap: .1rem; } .ref__inv header small { color: var(--muted); font-size: .8rem; }
.ref__inv--demo { border-color: rgba(43, 196, 169, .45); box-shadow: inset 3px 0 0 #2BC4A9; }
.ref__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; align-items: center; }
.ref__row input { min-width: 0; width: 100%; font: 600 .82rem ui-monospace, monospace; }
.ref__stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin: .4rem 0 .8rem; }
.ref__stats > div { background: var(--panel-2, rgba(255,255,255,.03)); border: 1px solid var(--line); border-radius: 12px; padding: .55rem .6rem; display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.ref__stats b { font: 800 1.25rem var(--fc); color: #7FE7D6; } .ref__stats span { font-size: .8rem; } .ref__stats small { color: var(--muted); font-size: .72rem; }
.ref__stats .hint { grid-column: 1 / -1; margin: 0; }
@media (max-width: 640px) { .ref__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ref__row { grid-template-columns: 1fr; } .ref__row .btn { width: 100%; } }
.ref__row input { min-height: 38px; border-radius: 10px; border: 1px solid var(--line-2); padding: 0 .6rem; background: var(--bg-2); color: var(--text); }
.ref__mine b { color: var(--accent); }

/* Couverture : détail routier d'un point */
.covpop-wide .leaflet-popup-content { width: min(340px, 80vw) !important; }
.covpt { width: 100%; border-collapse: collapse; margin: .35rem 0; font-size: .76rem; }
.covpt th { text-align: left; color: var(--muted); font-weight: 600; padding: .15rem .25rem; border-bottom: 1px solid var(--line); }
.covpt td { padding: .25rem; vertical-align: top; border-bottom: 1px solid rgba(255,255,255,.05); }
.covpt td small { display: block; color: var(--muted); font-size: .68rem; }
.covpop__resp { margin-top: .35rem; }

/* Couverture : panneau développé / compact / masqué (la couche reste sur la carte dans les trois cas) */
.covpanel { transition: opacity .18s ease, transform .18s ease; }
.covpanel--full { max-height: min(calc(100% - 24px), 78vh); }
.covpanel__bar { display: flex; align-items: center; gap: .35rem; margin: -.15rem -.1rem 0; }
.covpanel__bar b { flex: 1; font: 800 1rem var(--fc); color: var(--hi); }
.covpanel__grip { display: none; }
.covc__btn { flex: none; width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); cursor: pointer; font: 700 .95rem/1 var(--fc); display: inline-grid; place-items: center; }
.covc__btn:hover { border-color: #2BC4A9; color: #7FE7D6; }
.covpanel--compact { width: auto; max-width: 360px; padding: .45rem .5rem; overflow: visible; border-radius: 14px; }
body.is-building .covpanel--compact { top: 12px; bottom: auto; }
.covc { display: flex; align-items: center; gap: .5rem; }
.covc__ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(43, 196, 169, .14); color: #7FE7D6; flex: none; }
.covc__ico svg { width: 18px; height: 18px; }
.covc__txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.covc__txt b { font: 800 .86rem var(--fc); color: var(--hi); display: inline-flex; align-items: center; gap: .35rem; }
.covc__mode { background: none; border: 0; padding: 0; color: var(--muted); font: 600 .78rem var(--fc); cursor: pointer; text-align: left; white-space: nowrap; }
.covc__mode:hover { color: #7FE7D6; }
.covc__kpi { font: 800 .9rem var(--fc); color: #FF8A97; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; margin-left: .2rem; }
.covc__kpi small { font: 600 .62rem var(--fc); color: var(--muted); }
.covpanel:not([hidden]) { animation: covIn .18s ease; }
@keyframes covIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
/* Mobile : compact par défaut (petite carte en haut à gauche, les boutons du jeu restent libres à droite) ; développé = tiroir */
@media (max-width: 760px) {
  .covpanel--compact { top: calc(8px + env(safe-area-inset-top)); left: calc(8px + env(safe-area-inset-left)); right: auto; max-width: calc(100% - 80px); }
  .covpanel--full { top: calc(8px + env(safe-area-inset-top)); left: calc(8px + env(safe-area-inset-left)); right: 64px; border-radius: 0 0 16px 16px; padding-top: .35rem; }
  .covpanel--full .covpanel__grip { display: block; position: absolute; left: 50%; bottom: 5px; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: var(--line-2); }
  .covpanel--full:not([hidden]) { animation: covDrawer .22s ease; }
  .covc__kpi { display: none; }
}
@keyframes covDrawer { from { opacity: .4; transform: translateY(-24px); } to { opacity: 1; transform: none; } }

/* Couverture : options d'affichage regroupées dans le panneau ; bouton Couverture existant = rouvrir le panneau */
.covopts { border: 1px solid var(--line); border-radius: 12px; padding: .35rem .6rem .5rem; margin: 0; display: flex; flex-direction: column; gap: .3rem; }
.covopts legend { font: 700 .74rem var(--fc); color: var(--muted); padding: 0 .3rem; text-transform: uppercase; letter-spacing: .04em; }
.covopt { display: flex; align-items: center; gap: .5rem; font-size: .84rem; cursor: pointer; min-height: 32px; }
.covopt input { width: 18px; height: 18px; accent-color: #2BC4A9; flex: none; margin: 0; }
.covopt span { display: inline-flex; align-items: center; gap: .45rem; }
.covopt__sw { width: 16px; height: 12px; border-radius: 3px; display: inline-block; flex: none; }
.covopt__sw--dead { background: repeating-linear-gradient(135deg, #04060a 0 4px, #2a2f36 4px 6px); border: 1px solid rgba(255,255,255,.18); }
.covopt__sw--edge { border: 2px solid #2BC4A9; background: rgba(43, 196, 169, .12); }
.covc__off:hover { border-color: #E3293E; color: #FF8A97; }
.fab--cov.is-on.is-quiet { background: var(--panel); color: #7FE7D6; border: 1px solid rgba(43, 196, 169, .7); box-shadow: 0 0 0 3px rgba(43, 196, 169, .15); }
@media (max-width: 760px) { .covopt { min-height: 40px; } .covc__btn { width: 36px; height: 36px; } }
@media (prefers-reduced-motion: reduce) { .covpanel, .covpanel:not([hidden]) { animation: none; transition: none; } }

/* Boutique Prestige : achats effectués / maximum */
.prsshop small { display: block; } .prsshop__n { color: var(--text); font-size: .8rem; margin-top: .1rem; } .prsshop__full { color: #FF8A97; font-weight: 700; }
.prshop input[type=number] { width: 84px; }

/* Réparation au garage : clé à molette, compte à rebours, progression */
.rep { display: inline-flex; align-items: center; gap: .3rem; margin-left: .35rem; font-size: .74rem; color: #FFD27A; white-space: nowrap; }
.rep i { font-style: normal; display: inline-block; animation: repTurn 1.6s ease-in-out infinite; }
.rep__bar { display: inline-block; width: 42px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.14); overflow: hidden; }
.rep__bar span { display: block; height: 100%; width: 0; background: #F2B33D; transition: width .9s linear; }
.dwv__rep { position: absolute; left: 50%; top: -22px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 3px; padding: 1px 5px 1px 3px;
  border-radius: 999px; background: #F2B33D; color: #1A1206; font: 800 10px/1.4 var(--fc, system-ui); box-shadow: 0 1px 4px rgba(0,0,0,.6); white-space: nowrap; pointer-events: none; z-index: 2; }
.dwv__rep i { font-style: normal; display: inline-block; animation: repTurn 1.6s ease-in-out infinite; }
.dwv__rep .rep__bar { width: 26px; height: 3px; background: rgba(0,0,0,.25); } .dwv__rep .rep__bar span { background: #1A1206; }
@keyframes repTurn { 0%, 55% { transform: rotate(0); } 70% { transform: rotate(-35deg); } 85% { transform: rotate(20deg); } 100% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) { .rep i, .dwv__rep i { animation: none; } }

/* Constructeur AI */
.agc--build { --agc: #F2B33D; }
.agbld__sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-bottom: .6rem; }
.agbld__sum > div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: .5rem .6rem; display: flex; flex-direction: column; }
.agbld__sum b { font: 800 1.05rem var(--fc); color: var(--hi); } .agbld__sum span { font-size: .75rem; color: var(--muted); }
.agbld td small { display: block; color: var(--muted); font-size: .74rem; margin-top: .1rem; }
.agbld tr.is-busy, .agbld tr.is-max, .agbld tr.is-limit, .agbld tr.is-excluded { opacity: .62; }
.agbld input[type=checkbox] { width: 18px; height: 18px; accent-color: #F2B33D; }
.agbld__bar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: center; padding: .55rem .6rem; margin-top: .5rem;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 -6px 18px rgba(0,0,0,.25); }
.agbld__bar small { color: #FF8A97; }
.pill--warn { background: rgba(242, 179, 61, .16); color: #F2B33D; } .pill--muted { background: rgba(255,255,255,.06); color: var(--muted); }
@media (max-width: 640px) { .agbld__sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Notification du Constructeur AI (comme les demandes de renfort) */
.rcard--build { border-color: rgba(242, 179, 61, .55); }
.rcard--build b { color: #FFD27A; }

/* Recherches géographiques (V2.3) : encadré de l'appel, progression, repères sur la carte */
.srchbox { margin: 12px 0; padding: 12px 14px; border: 1px solid color-mix(in srgb, #2BC4A9 45%, transparent); border-radius: 12px; background: color-mix(in srgb, #2BC4A9 7%, transparent); }
.srchbox .h3 { margin: 0 0 4px; }
.srchbar { position: relative; height: 22px; border-radius: 11px; background: var(--line, rgba(255,255,255,.12)); overflow: hidden; margin: 8px 0; }
.srchbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #3FB950, #2BC4A9); transition: width .6s ease; }
.srchbar b { position: relative; display: block; text-align: center; font-size: 12px; line-height: 22px; }
.srchbar--sm { height: 8px; margin: 0; flex: 1; min-width: 60px; }
.srchsec { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 6px; }
.srchsec li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.srchsec li > span:first-child { min-width: 70px; }
.srchunits { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.srchunits li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.srchunits select { min-height: 32px; }
.srch-badge { display: inline-block; margin-top: 4px; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: color-mix(in srgb, #2BC4A9 18%, transparent); }
.srch-pin { font-size: 20px; line-height: 24px; text-align: center; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.srch-pin--found { font-size: 24px; }

/* Administration V2.3 (refonte) : modifications non enregistrées, cartes de diagnostic, actions rapides, aperçu des recherches */
.err-text { color: var(--err, #E3293E); }
.ax-dirty { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 3000; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  max-width: calc(100vw - 32px); padding: .55rem .9rem; border-radius: 12px; background: var(--panel); border: 1px solid var(--warn, #F2B33D); box-shadow: 0 8px 28px rgba(0,0,0,.35); font-size: .9rem; }
.ax-dirty span { color: var(--warn, #F2B33D); }
.ax-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .9rem; margin: .9rem 0; }
.ax-card { margin: 0; border-left: 3px solid var(--line); }
.ax-card--ok { border-left-color: var(--ok, #3FB950); } .ax-card--warn { border-left-color: var(--warn, #F2B33D); } .ax-card--err { border-left-color: var(--err, #E3293E); }
.ax-card .h3 { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ax-qa { display: flex; flex-wrap: wrap; gap: .5rem; }
.ax-qa .btn { min-height: 40px; }
.ax-mprev { border-radius: 10px; overflow: hidden; }
.ax-mprev .dw-maint { position: static; border-radius: 10px; }
.srch-tool { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: .9rem; align-items: start; }
.srch-tool__map { height: min(70vh, 640px); min-height: 360px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.srch-tool__side { max-height: min(70vh, 640px); overflow: auto; display: grid; gap: .6rem; align-content: start; }
.srch-tool__side.is-folded > :not(.srch-tool__fold) { display: none; }
.srch-tool:has(.is-folded) { grid-template-columns: minmax(0, 1fr) 170px; }
.sced__search [data-sxbody] { margin-top: .6rem; }
@media (max-width: 900px) {
  .srch-tool, .srch-tool:has(.is-folded) { grid-template-columns: 1fr; }
  .srch-tool__map { height: 55vh; }
  .srch-tool__side { max-height: none; }
  .ax-cards { grid-template-columns: 1fr; }
  .ax-dirty { bottom: 10px; font-size: .84rem; }
  .ax-body input, .ax-body select, .ax-body textarea { font-size: 16px; }   /* formulaires utilisables sans zoom sur téléphone */
}
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; }
.ax__nav { overflow-x: hidden; }
.ax__nav a .ax__lbl { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ax__nav a .ax__badge, .ax__nav a em { flex: 0 0 auto; }
.srch-tool__side { overflow-x: hidden; }
.srch-tool__side [data-sxbody] > p.hint { display: none; }
.srch-tool__side .reqin { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: .35rem; }
.srch-tool__side .reqin input { width: 100%; }
.srch-tool__side .checks { display: flex; flex-wrap: wrap; gap: .3rem .8rem; }
.srch-tool__side .grid4 { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (max-width: 600px) {
  /* Tableau de bord compact sur téléphone : deux cartes par ligne */
  .ax-body [data-overview].kpis { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .ax-body [data-overview] .kpi { margin: 0; padding: .6rem .7rem; }
  .ax-body [data-overview] .kpi b { font-size: 1.15rem; }
  .ax-body [data-overview] .kpi small { font-size: .72rem; }
  .ax-qa .btn { flex: 1 1 calc(50% - .5rem); justify-content: center; }
}
.ax-body .admin__sec > .kpis > .kpi { margin-bottom: 0; }   /* la grille gère l'espacement des cartes */

/* Travaux bloquants : bâtiment en attente du retour de ses véhicules */
.chantier--wait { border-color: color-mix(in srgb, #F2B33D 55%, transparent); }
.chantier--wait .chantier__bar i { background: #F2B33D; }
.bld__hg--wait { filter: drop-shadow(0 0 3px rgba(242, 179, 61, .9)); }
.chantier [data-wcancel] { margin-top: .5rem; }
.agpay__o s { display: block; font-size: .78rem; }
.agpay__o[disabled] { opacity: .5; cursor: not-allowed; }
.ok-box { background: rgba(63, 185, 80, .12); border: 1px solid rgba(63, 185, 80, .5); padding: .75rem 1rem; border-radius: var(--r-sm); margin: .5rem 0; }
.warn-box { background: rgba(242, 179, 61, .12); border: 1px solid rgba(242, 179, 61, .55); padding: .75rem 1rem; border-radius: var(--r-sm); margin: .5rem 0; }
/* Éditeur de barrage routier */
.sced__search [data-cxbody] { margin-top: .6rem; }
.cpmap { height: 420px; border-radius: var(--r); border: 1px solid var(--line); margin: .6rem 0; }
.cpmodes { flex-wrap: wrap; gap: .3rem; }
.cplanes { list-style: none; padding: 0; margin: .4rem 0; display: grid; gap: .3rem; }
.cplanes li { display: flex; align-items: center; gap: .5rem; }
.cplanes__sw { width: 18px; height: 6px; border-radius: 3px; display: inline-block; }
/* Barrages routiers et fourrières */
.cp-pin { font-size: 20px; line-height: 26px; text-align: center; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.cp-pin--sm { font-size: 14px; line-height: 20px; background: rgba(11,15,20,.75); border-radius: 4px; color: #F2B33D; }
.cpstats { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: .4rem 0; font-size: .9rem; }
.cpstats b { font-variant-numeric: tabular-nums; }
.cpbox select { max-width: 14rem; }
.yard { display: grid; grid-template-columns: repeat(auto-fill, minmax(18px, 1fr)); gap: 4px; padding: .6rem; margin: .6rem 0; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); }
.yard__c { height: 26px; border-radius: 3px; border: 1px dashed var(--line-2); }
.yard__c--held { background: #F2B33D; border: 1px solid #b07d16; }
.yard__c--reserved { background: repeating-linear-gradient(45deg, rgba(62,139,255,.45) 0 4px, transparent 4px 8px); border: 1px solid #3E8BFF; }
.accel { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; margin: .6rem 0; }

/* V2.3 — Recherches et disparitions : page pleine largeur, indicateurs, simulateur (carte ~70 %, panneau ~30 %) */
[data-searches] { min-width: 0; }
.srx-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin: 0 0 1rem; }
.srx-head > .hint { flex: 1 1 420px; margin: 0; }
.srx-head__acts { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.srx-chip { display: inline-flex; align-items: center; gap: .4rem; min-height: 32px; padding: 0 .7rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel-2); font: 600 .84rem var(--fc); color: var(--text); white-space: nowrap; }
.srx-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.srx-chip--ok i { background: var(--ok); }
.srx-chip--warn i { background: var(--warn); }
.srx-chip--err i { background: var(--err); }
.srx-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 0 0 1rem; }
.srx-kpi { display: grid; gap: .15rem; padding: 1rem 1.1rem; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); border-top: 3px solid var(--line-2); }
.srx-kpi span { color: var(--muted); font-size: .85rem; }
.srx-kpi b { font: 800 1.6rem/1.15 var(--fc); color: var(--hi); }
.srx-kpi small { color: var(--dim); }
.srx-kpi--ok { border-top-color: var(--ok); }
.srx-kpi--warn { border-top-color: var(--warn); }
.srx-kpi--err { border-top-color: var(--err); }
.srx-kpi:last-child b { font-size: 1.15rem; }
.srx-prog { display: inline-block; width: 64px; height: 6px; border-radius: 3px; background: var(--bg-2); vertical-align: middle; overflow: hidden; }
.srx-prog i { display: block; height: 100%; background: var(--ok); }
.srx-sim__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(320px, 3fr); gap: 1rem; align-items: start; }
.srx-map { position: sticky; top: 1rem; }
.srx-map__map { height: calc(100dvh - 180px); min-height: 520px; max-height: 900px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.srx-load { position: absolute; inset: 0; z-index: 800; display: grid; place-content: center; justify-items: center; gap: .5rem; background: color-mix(in srgb, var(--bg) 55%, transparent); border-radius: 12px; color: var(--hi); }
.srx-load[hidden] { display: none; }
.srx-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--gcsr); animation: srxspin .8s linear infinite; }
@keyframes srxspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .srx-spin { animation-duration: 3s; } }
.srx-panel { display: grid; gap: .8rem; align-content: start; min-width: 0; }
.srx-state { padding: .7rem .8rem; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); }
.srx-state p { margin: .3rem 0 0; color: var(--text); }
.srx-state--ok { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); background: color-mix(in srgb, var(--ok) 10%, var(--panel)); }
.srx-state--warn { border-color: color-mix(in srgb, var(--warn) 60%, var(--line)); background: color-mix(in srgb, var(--warn) 10%, var(--panel)); }
.srx-state--err { border-color: color-mix(in srgb, var(--err) 55%, var(--line)); background: color-mix(in srgb, var(--err) 9%, var(--panel)); }
.srx-state--info, .srx-state--idle { color: var(--muted); }
.srx-state__acts { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.srx-tech { margin-top: .5rem; font-size: .85rem; }
.srx-tech code { font-size: .8rem; }
.srx-sum { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .35rem .8rem; margin: 0; padding: .7rem .8rem; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.srx-sum dt { color: var(--muted); font-size: .85rem; }
.srx-sum dd { margin: 0; font-weight: 600; color: var(--hi); overflow-wrap: anywhere; }
.srx-sum input { width: 100%; min-height: 32px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); padding: 0 .5rem; }
.srx-btns { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; }
.srx-units { width: 92px; margin: 0; }
.srx-units input { width: 100%; }
.srx-simres { padding: .6rem .8rem; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.srx-det { border: 1px solid var(--line); border-radius: 10px; padding: .5rem .8rem; background: var(--panel); }
.srx-det > summary { cursor: pointer; font: 700 .92rem var(--fc); color: var(--hi); min-height: 32px; display: flex; align-items: center; }
.srx-det[open] > summary { margin-bottom: .5rem; }
.srx-det [data-sxbody] > p.hint { display: none; }
.srx-det .grid4 { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.srx-det .reqin { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: .35rem; }
.srx-det .reqin input { width: 100%; }
.srx-det .checks { display: flex; flex-wrap: wrap; gap: .3rem .8rem; }
.srx-stages { list-style: none; margin: 0 0 .6rem; padding: 0; display: grid; gap: .3rem; counter-reset: st; }
.srx-stages li { counter-increment: st; display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: .5rem; align-items: start; }
.srx-stages li::before { content: counter(st); grid-row: span 2; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 700 .75rem var(--fc); background: var(--line); color: var(--hi); }
.srx-stages li.is-ok::before { background: var(--ok); color: #0b1a10; }
.srx-stages li.is-warn::before { background: var(--warn); color: #241a05; }
.srx-stages li.is-fail::before { background: var(--err); color: #fff; }
.srx-stages li.is-skip { opacity: .6; }
.srx-stages small { color: var(--muted); overflow-wrap: anywhere; }
.srx-legend { display: grid; gap: .2rem; padding: .5rem .65rem; border-radius: 10px; background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line-2); color: var(--text); font-size: .78rem; max-width: 260px; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.srx-legend b { color: var(--hi); }
.srx-legend details > span { display: flex; align-items: center; gap: .3rem; margin-top: .15rem; }
.srx-legend span { display: flex; align-items: center; gap: .3rem; }
.srx-legend i { display: inline-block; width: 14px; height: 5px; border-radius: 3px; }
.srx-legend i.is-dash { height: 0; border-top: 3px dashed; border-radius: 0; }
.srx-legend i.is-ring { width: 12px; height: 12px; border-radius: 50%; border: 2px dashed var(--gcsr); }
.srx-legend__data { color: var(--muted); }
.srx-recenter { width: 34px; height: 34px; border-radius: 6px; border: 2px solid rgba(0, 0, 0, .2); background: var(--panel); color: var(--hi); font-size: 1.2rem; cursor: pointer; }
.srx-seclbl span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--c); color: #0b1218; font: 800 .8rem var(--fc); border: 2px solid var(--panel); box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
@media (max-width: 1400px) { .srx-sim__grid { grid-template-columns: minmax(0, 13fr) minmax(320px, 7fr); } }
@media (max-width: 1100px) { .srx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .srx-sim__grid { grid-template-columns: 1fr; }
  .srx-map { position: relative; top: 0; }
  .srx-map__map { height: 62vh; min-height: 380px; }
}
@media (max-width: 560px) {
  .srx-kpis { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .srx-kpi { padding: .7rem .8rem; }
  .srx-kpi b { font-size: 1.3rem; }
  .srx-map__map { height: 55vh; min-height: 320px; }
  .srx-head__acts { width: 100%; }
  .srx-head__acts .btn { flex: 1 1 auto; }
  .srx-legend { max-width: 200px; font-size: .72rem; }
}
.srx-legend details { display: grid; gap: .2rem; }
.srx-legend summary { cursor: pointer; font-weight: 700; color: var(--hi); list-style-position: inside; }
.srx-legend details[open] > summary { margin-bottom: .2rem; }

/* Éditeurs spécialisés : barrages routiers et recherches (carte ~70 %, panneau ~30 %) */
.pl-top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin: 0 0 .6rem; }
.pl-title { font: 800 1.15rem var(--fc); color: var(--hi); }
.pl-top__acts { display: flex; flex-wrap: wrap; gap: .35rem; margin-left: auto; }
.pl-user { min-height: 32px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); padding: 0 .5rem; width: 220px; }
.pl-steps { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 0 .8rem; }
.pl-steps button { display: inline-flex; align-items: center; gap: .4rem; min-height: 34px; padding: 0 .7rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); font: 600 .84rem var(--fc); cursor: pointer; }
.pl-steps button i { font-style: normal; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--line); color: var(--hi); font-size: .72rem; }
.pl-steps button.is-on { color: var(--hi); border-color: var(--accent, #E3293E); }
.pl-steps button.is-on i { background: var(--accent, #E3293E); color: #fff; }
.pl-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(320px, 3fr); gap: 1rem; align-items: start; }
.pl-mapwrap { position: sticky; top: 1rem; min-width: 0; }
.pl-map { height: calc(100dvh - 260px); min-height: 480px; max-height: 900px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.pl-tools { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; margin-bottom: .4rem; }
.pl-tools button { display: inline-flex; align-items: center; gap: .3rem; min-height: 34px; padding: 0 .55rem; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font: 600 .8rem var(--fc); cursor: pointer; }
.pl-tools button i { font-style: normal; font-weight: 800; min-width: 1.1em; text-align: center; }
.pl-tools button.is-on { background: var(--accent, #E3293E); border-color: var(--accent, #E3293E); color: #fff; }
.pl-tools__sep { width: 1px; height: 24px; background: var(--line-2); margin: 0 .2rem; }
.pl-mode select { min-height: 32px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); }
.pl-help { color: var(--muted); font-size: .85rem; margin: .1rem 0 .4rem; }
.pl-pending { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .45rem .6rem; margin-bottom: .4rem; border-radius: 10px; border: 1px dashed var(--line-2); background: var(--bg-2); }
.pl-pending[hidden] { display: none; }
.pl-simbar { display: flex; align-items: center; gap: .5rem; margin-top: .4rem; }
.pl-simbar[hidden] { display: none; }
.pl-simbar input[type=range] { flex: 1; }
.pl-panel { display: grid; gap: .8rem; align-content: start; min-width: 0; }
.pl-panel .grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.pl-panel .field input, .pl-panel .field select, .pl-panel .field textarea { width: 100%; }
.pl-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
.pl-kpis div { padding: .45rem .5rem; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); text-align: center; }
.pl-kpis b { display: block; font: 800 1.2rem var(--fc); color: var(--hi); }
.pl-kpis span { font-size: .75rem; color: var(--muted); }
.pl-list { list-style: none; margin: .3rem 0; padding: 0; display: grid; gap: .3rem; }
.pl-unit { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.pl-unit select { min-height: 30px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); }
.pl-sel { padding: .6rem .7rem; border-radius: 10px; border: 1px solid var(--accent, #E3293E); background: var(--panel); }
.pl-events { margin: .3rem 0; padding-left: 1.2rem; display: grid; gap: .15rem; font-size: .85rem; max-height: 320px; overflow: auto; }
.pl-report li.is-err { color: var(--err); }
.pl-report li.is-warn { color: var(--warn); }
.pl-badge span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; font: 800 .7rem var(--fc); color: #fff; border: 2px solid rgba(0, 0, 0, .45); box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.pl-badge--entry span { background: #3FB950; border-radius: 50%; }
.pl-badge--off span { background: #6C7380; border-radius: 50%; }
.pl-badge--exit span { background: #3E8BFF; border-radius: 50%; }
.pl-badge--police span, .pl-badge--police-sim span { background: #1F5FD6; }
.pl-badge--tow span, .pl-badge--tow-sim span { background: #E06A0F; }
.pl-badge--cp span { background: #fff; color: #000; font-size: .9rem; }
.pl-badge--access span { background: #F2B33D; color: #241a05; border-radius: 50%; }
.pl-badge--vertex span { width: 14px; height: 14px; border-radius: 50%; background: #fff; color: transparent; cursor: grab; }
.pl-badge.is-sel span { outline: 3px solid #fff; }
.pl-badge.is-unv span { border-style: dashed; }
@media (max-width: 1400px) { .pl-grid { grid-template-columns: minmax(0, 13fr) minmax(320px, 7fr); } }
@media (max-width: 1100px) { .pl-tools button span { display: none; } }
@media (max-width: 960px) {
  .pl-grid { grid-template-columns: 1fr; }
  .pl-mapwrap { position: relative; top: 0; }
  .pl-map { height: 60vh; min-height: 360px; }
}
@media (max-width: 560px) { .pl-top__acts { margin-left: 0; } .pl-steps button span { display: none; } .pl-map { height: 55vh; min-height: 300px; } .pl-user { width: 100%; } }

/* Éditeur de barrage : voies manuelles, zone de dégagement, checklist */
.cpbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .4rem 1rem; }
.cpbar .hint { flex: 1 1 320px; margin: .3rem 0; }
.cpradius { width: 220px; margin: 0; }
.cpradius input { width: 100%; }
.cpmanual { flex-wrap: wrap; align-items: center; gap: .4rem; padding: .5rem .6rem; border-radius: 10px; border: 1px dashed var(--line-2); background: var(--bg-2); }
.cplanes li { flex-wrap: wrap; }
.cplanes__acts { display: inline-flex; flex-wrap: wrap; gap: .25rem; margin-left: auto; }
.cp-vertex span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #fff; color: #0b1218; font: 800 .7rem var(--fc); border: 2px solid #E3293E; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); cursor: grab; }
.cp-arrow span { display: block; font-size: 12px; line-height: 14px; text-align: center; text-shadow: 0 0 3px #000; }
.cpcheckbox { margin-top: .6rem; }
.cpcheck { list-style: none; margin: .3rem 0; padding: 0; display: grid; gap: .25rem; }
.cpcheck li { display: grid; grid-template-columns: 22px minmax(0, auto) auto; column-gap: .5rem; align-items: baseline; }
.cpcheck li i { font-style: normal; font-weight: 800; text-align: center; }
.cpcheck li span { color: var(--muted); font-size: .85rem; }
.cpcheck li small { grid-column: 2 / -1; color: var(--muted); overflow-wrap: anywhere; }
.cpcheck li.is-ok i { color: var(--ok); }
.cpcheck li.is-warn i { color: var(--warn); }
.cpcheck li.is-err i { color: var(--err); }

/* Barrages : création simplifiée en trois étapes (correctif-45) */
.cp3-steps { align-items: center; }
.cp3-prog { flex: 1 1 140px; min-width: 120px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-left: .4rem; }
.cp3-prog span { display: block; height: 100%; background: var(--ok); transition: width .3s; }
.pl-tools .cp3-auto { background: color-mix(in srgb, var(--ok) 18%, var(--panel)); border-color: color-mix(in srgb, var(--ok) 60%, var(--line)); }
.cp3-adv { position: relative; }
.cp3-adv summary { list-style: none; display: inline-flex; align-items: center; min-height: 34px; padding: 0 .6rem; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font: 600 .8rem var(--fc); cursor: pointer; }
.cp3-adv summary::-webkit-details-marker { display: none; }
.cp3-adv summary::after { content: ' ▾'; }
.cp3-adv > div { position: absolute; z-index: 1001; top: calc(100% + 4px); left: 0; display: grid; gap: .25rem; padding: .4rem; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); box-shadow: 0 6px 20px rgba(0, 0, 0, .35); min-width: 240px; }
.cp3-adv > div button span { display: inline !important; }
.cp3-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cp3-val { margin: .4rem 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.cp3-step { display: grid; gap: .55rem; }
.cp3-step .h4 { margin: 0; }
.cp3-todo { margin: 0; padding: 0; list-style: none; display: grid; gap: .3rem; }
.cp3-todo li { display: flex; align-items: baseline; gap: .45rem; }
.cp3-todo small { color: var(--muted); }
.cp3-tick { font-style: normal; font-weight: 800; color: var(--muted); width: 1.1em; text-align: center; }
.cp3-tick.is-ok { color: var(--ok); }
.cp3-autobtn { justify-self: start; }
.cp3-det { border: 1px solid var(--line); border-radius: 10px; padding: .45rem .6rem; background: var(--bg-2); }
.cp3-det > summary { cursor: pointer; font-weight: 700; color: var(--hi); }
.cp3-diag { font-size: .85rem; }
.cp3-list { list-style: none; margin: .35rem 0 0; padding: 0; display: grid; gap: .25rem; font-size: .86rem; }
.cp3-list li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: .35rem; align-items: baseline; }
.cp3-list li i { font-style: normal; font-weight: 800; text-align: center; }
.cp3-list li span { overflow-wrap: anywhere; color: var(--muted); }
.cp3-list li b { color: var(--text); }
.cp3-list li.is-ok i { color: var(--ok); }
.cp3-list li.is-warn i { color: var(--warn); }
.cp3-list li.is-err i, .cp3-list li.is-err b { color: var(--err); }
.cp3-ctr { display: flex; align-items: center; gap: .5rem; }
.cp3-ctr span { min-width: 6.5rem; font-weight: 700; color: var(--hi); }
.cp3-ctr b { min-width: 2ch; text-align: center; font: 800 1.3rem var(--fc); color: var(--hi); }
.cp3-ctr .btn { min-width: 38px; font-size: 1.1rem; }
.cp3-test { display: grid; gap: .35rem; }
.cp3-test .h4 { margin: 0; display: flex; flex-wrap: wrap; gap: .2rem .6rem; align-items: baseline; }
.cp3-grp { border: 1px solid var(--line); border-radius: 10px; padding: .35rem .6rem; background: var(--panel); }
.cp3-grp > summary { cursor: pointer; font-weight: 700; color: var(--hi); }
.cp3-grp > summary i { font-style: normal; }
.cp3-grp > summary small { font-weight: 600; margin-left: .3rem; }
.cp3-grp.is-ok > summary i, .cp3-grp.is-ok > summary small { color: var(--ok); }
.cp3-grp.is-warn > summary i, .cp3-grp.is-warn > summary small { color: var(--warn); }
.cp3-grp.is-err { border-color: color-mix(in srgb, var(--err) 50%, var(--line)); }
.cp3-grp.is-err > summary i, .cp3-grp.is-err > summary small { color: var(--err); }
.pl-badge--load span { background: #FF8A1E; border-radius: 50%; }
.pl-badge--draw span { width: 20px; height: 20px; background: #3E8BFF; border-radius: 50%; font-size: .65rem; }
.cpdef > summary { cursor: pointer; }
@media (max-width: 560px) { .cp3-prog { flex-basis: 100%; margin: .2rem 0 0; } .cp3-adv > div { left: auto; right: 0; } }

/* ===================== Demander une intervention (request.php, correctif-46) ===================== */
.rqp { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.rqp__intro h1 { font: 800 1.6rem var(--fc); color: var(--hi); margin: .3rem 0; }
.rqp__modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.rqp__modes button { position: relative; display: flex; gap: .6rem; align-items: center; text-align: left; min-height: 62px; padding: .5rem .8rem; border-radius: 14px;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--text); cursor: pointer; font: inherit; }
.rqp__modes button b { display: block; font: 700 .95rem var(--fc); color: var(--hi); }
.rqp__modes button small { display: block; font-size: .78rem; color: var(--muted); }
.rqp__modes button[aria-selected=true] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft, rgba(227, 41, 62, .12)); }
.rqp__ico { font-size: 1.5rem; flex: none; }
.rqp__count { position: absolute; top: 6px; right: 8px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--accent); color: #fff; font: 700 .72rem/20px var(--fc); text-align: center; font-style: normal; padding: 0 5px; }
.rqp__body { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.rqp__card, .rqp__flow { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 1rem; min-width: 0; }
.rqp__lim { display: flex; flex-wrap: wrap; gap: .5rem; }
.rqp__chip { display: inline-flex; flex-direction: column; padding: .4rem .8rem; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: .9rem; color: var(--hi); }
.rqp__chip b { font: 600 .72rem var(--fc); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.rqp__block { border: 1px solid rgba(240, 82, 74, .45); background: rgba(240, 82, 74, .08); border-radius: 12px; padding: .6rem .8rem; }
.rqp__block b { color: var(--err); }
.rqp__issues { margin: .3rem 0 0; padding-left: 1.1rem; display: grid; gap: .2rem; font-size: .88rem; }
.rqp__issues li[data-code=routing] { color: var(--warn); }
.rqp__ok { color: var(--ok); font-weight: 600; margin: .4rem 0; }
.rqp__warn { color: var(--warn); }
.rqp__filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .6rem 0; }
.rqp__filters input[type=search] { flex: 1 1 220px; min-height: 40px; }
.rqp__filters select { min-height: 40px; }
.rqp__clist { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; max-height: 60vh; overflow: auto; }
.rqp__clist li { display: flex; gap: .6rem; align-items: center; justify-content: space-between; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 10px; }
.rqp__clist li small { display: block; }
.rqp__clist li.is-off { opacity: .6; }
.rqp__models { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; margin-top: .6rem; }
.rqp__model { display: flex; flex-direction: column; gap: .5rem; border: 1px solid var(--line); border-radius: 14px; padding: .8rem; background: var(--panel-2, var(--panel)); }
.rqp__model header { display: flex; gap: .5rem; align-items: flex-start; justify-content: space-between; }
.rqp__model header b { font: 700 1rem var(--fc); color: var(--hi); }
.rqp__model dl { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem .6rem; margin: 0; font-size: .85rem; }
.rqp__model dt { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; }
.rqp__model dd { margin: 0; color: var(--hi); }
.rqp__model.is-off { opacity: .75; }
.rqp__model .btn { margin-top: auto; }
.rqp__fhead { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; }
.rqp__fhead h2 { font: 800 1.15rem var(--fc); color: var(--hi); margin: 0; flex: 1 1 auto; }
.rqp__cost { font-weight: 700; color: var(--hi); }
.rqp__steps { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem; margin: .8rem 0; padding: 0; }
.rqp__steps button { width: 100%; display: flex; gap: .45rem; align-items: center; min-height: 42px; padding: .3rem .6rem; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font: 600 .85rem var(--fc); text-align: left; }
.rqp__steps i { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--line); color: var(--hi); font: 700 .75rem/22px var(--fc); text-align: center; font-style: normal; }
.rqp__steps button.is-on { border-color: var(--accent); color: var(--hi); }
.rqp__steps button.is-on i { background: var(--accent); color: #fff; }
.rqp__steps button.is-done i { background: var(--ok); color: #0b1a12; }
.rqp__grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 1rem; align-items: start; }
.rqp__mapbox { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.rqp__map { height: 560px; border-radius: 12px; overflow: hidden; }
.rqp__legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .78rem; color: var(--muted); }
.rqp__legend i { display: inline-block; width: 12px; height: 4px; border-radius: 2px; margin-right: .3rem; vertical-align: middle; }
.rqp__panel { display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.rqp__panel .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.rqp__panel .field input { width: 100%; }
.rqp__nav { display: flex; justify-content: space-between; gap: .5rem; border-top: 1px solid var(--line); padding-top: .6rem; }
.rqp__facts { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: .9rem; }
.rqp__facts li { padding-left: 1rem; position: relative; }
.rqp__facts li::before { content: "\2022"; position: absolute; left: 0; color: var(--muted); }
.rqp__box { border: 1px solid var(--line); border-radius: 12px; padding: .6rem .8rem; }
.rqp__row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.rqp__counter { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.rqp__counter > span { font-weight: 600; color: var(--hi); flex: 1 1 100%; }
.rqp__counter b { min-width: 2ch; text-align: center; font: 800 1.2rem var(--fc); color: var(--hi); }
.rqp__units { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; max-height: 240px; overflow: auto; }
.rqp__units label { display: flex; gap: .5rem; align-items: center; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.rqp__units input { width: auto; }
.rqp__units small { display: block; }
.rqp__sum { font-size: .85rem; color: var(--muted); margin: 0; }
.rqp__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; padding: .6rem .8rem; border-radius: 12px; background: var(--panel-2, rgba(255, 255, 255, .04)); }
.rqp__price b { font: 800 1.3rem var(--fc); color: var(--hi); margin-left: auto; }
.rqp__price small { flex: 1 1 100%; text-align: right; }
.rqp__mine { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .6rem; }
.rqp__mrow { border: 1px solid var(--line); border-radius: 12px; padding: .7rem .8rem; display: flex; flex-direction: column; gap: .35rem; }
.rqp__mtop { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.rqp__mtop b { color: var(--hi); flex: 1 1 auto; }
.rqp__mstate { font: 700 .78rem var(--fc); padding: .2rem .55rem; border-radius: 999px; background: var(--line); color: var(--hi); }
.rqp__mstate--working { background: rgba(62, 139, 255, .2); color: #6FA8FF; }
.rqp__mstate--pending { background: rgba(242, 179, 61, .18); color: var(--warn); }
.rqp__mstate--completed { background: rgba(90, 208, 138, .16); color: var(--ok); }
.rqp__mstate--expired, .rqp__mstate--cancelled { background: rgba(240, 82, 74, .14); color: var(--err); }
.rqp__bar { position: relative; height: 18px; border-radius: 9px; background: var(--line); overflow: hidden; }
.rqp__bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--accent), var(--ok)); }
.rqp__bar span { position: relative; display: block; text-align: center; font: 700 .72rem/18px var(--fc); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.rqp__goals { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .85rem; }
.rqp-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: middle; }
.rqp-pin span { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px; font: 700 .7rem var(--fc); color: #fff; border: 2px solid rgba(255, 255, 255, .85); box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.rqp-pin--entry span { background: #3FB950; } .rqp-pin--exit span { background: #3E8BFF; } .rqp-pin--bad span { background: #F0524A; }
.rqp-pin--cp span { background: #E3293E; border-radius: 50%; } .rqp-pin--police span { background: #1F5FD1; } .rqp-pin--tow span { background: #F2B33D; color: #1b1300; }
.rqp-pin--target span { background: #B07CFF; border-radius: 50%; }
.rqp__legend .rqp-dot { width: 10px; height: 10px; border-radius: 3px; }
.rqp-dot--entry { background: #3FB950; } .rqp-dot--exit { background: #3E8BFF; } .rqp-dot--police { background: #1F5FD1; } .rqp-dot--tow { background: #F2B33D; }
.rqp-arrow span { display: block; font-size: 16px; line-height: 18px; text-align: center; text-shadow: 0 0 3px rgba(0, 0, 0, .8); }
.rqp--win { padding: 0; }
.rqp--win .rqp__intro { display: none; }
.modal--rqpwin .modal__body { padding-top: .5rem; }
@media (max-width: 1000px) { .rqp__grid { grid-template-columns: 1fr; } .rqp__map { height: 380px; } }
@media (max-width: 760px) { .rqp__modes { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rqp__modes button { min-height: 56px; padding: .4rem .5rem; }
  .rqp__modes button b { font-size: .82rem; } .rqp__modes button small { display: none; } .rqp__ico { font-size: 1.2rem; }
  .rqp__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rqp__map { height: 320px; } .rqp__card, .rqp__flow { padding: .7rem; } }
@media (max-width: 480px) { .rqp__panel .grid2, .rqp__model dl { grid-template-columns: 1fr; } .rqp__clist li { flex-direction: column; align-items: stretch; } }
/* Administration : demandes des joueurs */
.rqa { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: .8rem; margin: .6rem 0; }
.rqa__card { border: 1px solid var(--line); border-radius: 14px; padding: .8rem; background: var(--panel); display: flex; flex-direction: column; gap: .5rem; }
.rqa__card .checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem .5rem; }
.cpreq { display: flex; flex-direction: column; gap: .4rem; }

/* ===================== Poursuites des barrages (correctif-48) ===================== */
.pursuit-banner { position: absolute; top: 10px; left: 12px; right: 84px; z-index: 820; max-width: 760px;
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; padding: .55rem .8rem; border-radius: 14px;
  background: rgba(120, 8, 22, .94); border: 1px solid #FF2D55; box-shadow: 0 6px 24px rgba(0, 0, 0, .45); color: #fff; animation: pb-pulse 1.6s ease-in-out infinite; }
.pursuit-banner[hidden] { display: none; }
.pursuit-banner.is-done { background: rgba(22, 40, 55, .95); border-color: var(--line-2); animation: none; }
@keyframes pb-pulse { 50% { box-shadow: 0 0 0 4px rgba(255, 45, 85, .35), 0 6px 24px rgba(0, 0, 0, .45); } }
@media (prefers-reduced-motion: reduce) { .pursuit-banner { animation: none; } }
.pb__main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 260px; }
.pb__title { font: 800 .92rem var(--fc); letter-spacing: .02em; }
.pb__meta { font-size: .8rem; opacity: .92; }
.pb__acts { display: flex; flex-wrap: wrap; gap: .35rem; }
.pb__sel { display: flex; gap: .25rem; }
.pb__sel button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .4); background: transparent; color: #fff; font-weight: 700; cursor: pointer; }
.pb__sel button.is-on { background: #fff; color: #78081a; }
@media (max-width: 640px) { .pursuit-banner { top: 6px; padding: .4rem .5rem; gap: .3rem; }
  .pb__title { font-size: .78rem; } .pb__meta { font-size: .72rem; } .pb__acts .btn { padding: .25rem .45rem; font-size: .7rem; } }
.bkp__list { list-style: none; margin: .4rem 0; padding: 0; display: grid; gap: .4rem; }
.bkp__list li { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 10px; }
.bkp__list small { display: block; }
.bkp__ctr { display: inline-flex; align-items: center; gap: .4rem; }
.bkp__ctr b { min-width: 2ch; text-align: center; }
.cp-sign span { display: block; background: #F2B33D; color: #1b1300; font: 800 9px/16px var(--fc); text-align: center; border-radius: 3px; border: 1px solid #7a5200; }
.cp3-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .4rem; }

/* ===================== Éditeur de barrage : sauvegarde et activation (hotfix 5.1) ===================== */
.pl-top.cp-top { position: sticky; top: var(--cp-top, 0px); z-index: 25; background: var(--bg); padding: .45rem 0; border-bottom: 1px solid var(--line); }
.cp-savestate { display: inline-flex; align-items: center; }
.cp-actconds { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .6rem; font-size: .8rem; }
.cp-actconds:empty { display: none; }
.cp-actconds__t { font-weight: 700; }
.cp-actconds ul { display: flex; flex-wrap: wrap; gap: .25rem .5rem; list-style: none; margin: 0; padding: 0; }
.cp-actconds li { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: .25rem; padding: .1rem .45rem; border-radius: 8px; border: 1px solid var(--line); }
.cp-actconds li.is-ok { color: var(--ok, #3FB950); }
.cp-actconds li.is-no { border-color: rgba(227, 41, 62, .55); }
.cp-actconds li.is-no i { color: #E3293E; font-style: normal; }
.cp-actconds li small { color: var(--muted); max-width: 46ch; }
.cp3-refacts { display: inline-flex; flex-wrap: wrap; gap: .2rem .6rem; margin-left: .4rem; }
.cp3-code { font: 600 .68rem var(--fc); color: var(--muted); letter-spacing: .03em; }
.cp3-why { margin: .2rem 0 .4rem; }
.cp3-pos { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-bottom: .4rem; }
.cp3-pos label { display: flex; flex-direction: column; font-size: .75rem; gap: .15rem; }
.cp3-pos input { width: 100%; min-width: 0; }
.cp3-posacts { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem; }
.pl-badge.is-bad span { border-color: #E3293E; box-shadow: 0 0 0 2px rgba(227, 41, 62, .55); }
@media (max-width: 640px) { .pl-top.cp-top { position: static; } .cp-actconds li small { max-width: none; } }

/* ---------- Hotfix V5.2 : moteur routier et cache des itinéraires (Diagnostics, SUPERADMIN) ---------- */
[data-rtpanel] .grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .9rem; margin-bottom: .75rem; }
[data-rtpanel] .rc-stats .stat { white-space: normal; border: 1px solid var(--line); border-radius: var(--r-sm); padding: .5rem .7rem; gap: .2rem; }
[data-rtpanel] .rc-stats .stat b { font-size: 1.25rem; }
[data-rtpanel] details { margin: .75rem 0; }
[data-rtpanel] details > summary { cursor: pointer; font-weight: 600; }
[data-rtpanel] code { white-space: normal; word-break: break-word; }
[data-rtpanel] progress { height: .8rem; }

/* ---------- Lancement administrateur : missions classiques, barrages, recherches ---------- */
.adl-kinds { margin: .25rem 0 .75rem; }
.seg__opt { position: relative; display: inline-flex; cursor: pointer; }
.seg__opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg__opt span { padding: .45rem .9rem; border-radius: 4px; color: var(--muted); font-weight: 600; min-height: 38px; display: inline-flex; align-items: center; }
.seg__opt input:checked + span { background: var(--panel-2); color: var(--hi); }
.seg__opt input:focus-visible + span { outline: 2px solid var(--hi); outline-offset: 1px; }
.adl-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: .75rem; align-items: start; }
.adl-who { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.adl-who legend { font-size: .85rem; color: var(--muted); margin-bottom: .25rem; }
.adl-who input { width: 100%; }
.adl-prev { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: .9rem; margin-top: .75rem; }
.adl-map { height: 340px; border-radius: var(--r-sm); border: 1px solid var(--line); }
.adl-map--modal { height: min(60vh, 460px); }
.adl-pin span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font: 700 .7rem/1 var(--fc, sans-serif); color: #fff; background: #3E8BFF; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.adl-pin--pol span { background: #2563eb; } .adl-pin--tow span { background: #F2B33D; color: #111; } .adl-pin--in span { background: #3FB950; }
.adl-pin--out span { background: #E5534B; } .adl-pin--cp span { background: #111; }
.adl-ko { margin: .5rem 0; } .adl-ko summary { cursor: pointer; color: var(--warn); font-weight: 600; }
.adl-track td { vertical-align: top; }
@media (max-width: 800px) {
  .adl-grid, .adl-prev { grid-template-columns: 1fr; }
  .adl-map { height: 260px; }
  .adl-kinds, .adl-who .seg { display: flex; width: 100%; }
  .adl-kinds .seg__opt, .adl-who .seg__opt { flex: 1 1 auto; } .seg__opt span { justify-content: center; width: 100%; text-align: center; }
}

/* ---------- correctif-52 : période de grâce des appels, accélération des travaux ---------- */
.timer.is-expiring { color: var(--err); font-weight: 700; white-space: normal; letter-spacing: .01em; }
.chantier__boost { margin: .2rem 0 .4rem; font-weight: 600; color: var(--ok); }
.prsshop__btns { display: inline-flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.prshop__boost td { background: var(--bg-2); }
@media (max-width: 640px) { .prsshop__btns { flex-direction: column; align-items: stretch; } }

/* ---------- hotfix V6.1 : suivi réel des recherches ---------- */
.srchlive { border: 1px solid var(--line); border-radius: var(--r-sm); padding: .5rem .6rem; margin: .4rem 0 .6rem; }
.srchlive__t { display: block; font: 700 .8rem/1.2 var(--fc, sans-serif); letter-spacing: .06em; color: #3E8BFF; margin-bottom: .3rem; }
.srchlive__kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .25rem .6rem; margin: 0; }
.srchlive__kv div { display: flex; justify-content: space-between; gap: .4rem; font-size: .82rem; }
.srchlive__kv dt { color: var(--muted); } .srchlive__kv dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.srchlive__u { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .2rem; font-size: .84rem; }
.srchlive__u li { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }

/* ---------- hotfix V6.2 : véhicules vus du dessus, orientés, gyrophares sur le toit ---------- */
/* Taille réglable (Apparence) : --veh-k ; zoom éloigné : pastille simplifiée ; zoom moyen : petite silhouette ; rapproché : détaillé */
.dwv__rot { position: absolute; inset: 0; transition: transform .25s linear; }
.dwv__car { display: none; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: calc(13px * var(--veh-k, 1)); height: calc(26px * var(--veh-k, 1)); }
.dwv__car svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 1px 1.4px rgba(0, 0, 0, .75)); }
.dwv[data-kind=truck] .dwv__car, .dwv[data-kind=tow] .dwv__car { width: calc(14px * var(--veh-k, 1)); height: calc(34px * var(--veh-k, 1)); }
.dwv[data-kind=van] .dwv__car, .dwv[data-kind=suv] .dwv__car, .dwv[data-kind=pickup] .dwv__car { height: calc(28px * var(--veh-k, 1)); }
.dwc__glass { fill: #1B2733; opacity: .92; } .dwc__roof { opacity: .95; } .dwc__bed { fill: rgba(0, 0, 0, .28); } .dwc__lamp { fill: #FFF6CC; opacity: .9; }
#map[data-vz=mid] .dwv__car, #map[data-vz=near] .dwv__car { display: block; }
#map[data-vz=mid] .dwv__body, #map[data-vz=near] .dwv__body { display: none; }
#map[data-vz=mid] .dwv__car { width: calc(9px * var(--veh-k, 1)); height: calc(18px * var(--veh-k, 1)); }
#map[data-vz=mid] .dwv[data-kind=truck] .dwv__car, #map[data-vz=mid] .dwv[data-kind=tow] .dwv__car { width: calc(10px * var(--veh-k, 1)); height: calc(24px * var(--veh-k, 1)); }
#map[data-vz=mid] .dwv__tag { display: none; }
/* Gyrophares : sur le toit, tournent avec le véhicule ; seulement selon l'état (en route, patrouille, sur les lieux) */
#map[data-vz=mid] .dwv__bar, #map[data-vz=near] .dwv__bar { top: calc(50% - 5px * var(--veh-k, 1)) !important; transform: translate(-50%, -50%) scale(calc(.55 * var(--veh-k, 1)));
  padding: 1px 2px; background: rgba(12, 16, 22, .85); }
#map[data-vz=mid] .dwv__bar { transform: translate(-50%, -50%) scale(calc(.4 * var(--veh-k, 1))); }
/* Halo et anneaux d'état adaptés à la silhouette */
#map[data-vz=mid] .dwv.is-patrolling::before, #map[data-vz=near] .dwv.is-patrolling::before { inset: 0; }
/* Civils : petits véhicules variés ; le véhicule en fuite est repérable sans marqueur géant */
.dwv--civ { width: 30px; height: 30px; }
.dwv--civ .dwv__car { display: block; width: calc(8px * var(--veh-k, 1)); height: calc(16px * var(--veh-k, 1)); }
#map[data-vz=near] .dwv--civ .dwv__car { width: calc(12px * var(--veh-k, 1)); height: calc(24px * var(--veh-k, 1)); }
.dwv--civ.is-fleeing .dwv__car svg { filter: drop-shadow(0 0 2.5px #FF2D55) drop-shadow(0 0 1px #FF2D55); }
.dwv--civ.is-fleeing::after { content: ''; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
  border: 1.5px solid rgba(255, 45, 85, .85); animation: civFlee 1.2s ease-out infinite; pointer-events: none; }
.dwv--civ.is-immobilized .dwv__car, .dwv--civ.is-await_tow .dwv__car { opacity: .85; }
@keyframes civFlee { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .dwv__rot { transition: none; } .dwv--civ.is-fleeing::after { animation: none; } }
html[data-motion=reduce] .dwv__bar i, html[data-motion=reduce] .dwv--civ.is-fleeing::after { animation: none !important; }
/* Barrage (hotfix V6.4) : minimum obligatoire et capacité maximale affichés séparément ; état de chaque emplacement */
.req--slots { background: transparent !important; border: 1px dashed var(--svc) !important; color: var(--svc) !important; }
.req--slots.req--full { border-style: solid; opacity: .8; }
.cpcap { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: .4rem 0; font-size: .9rem; color: var(--muted); }
.cpcap b { color: var(--hi); font-variant-numeric: tabular-nums; }
.cpslots summary { cursor: pointer; color: var(--muted); font-size: .88rem; margin: .2rem 0; }
.cpslots ul { list-style: none; margin: .3rem 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: .3rem; }
.cpslot { display: flex; align-items: baseline; gap: .45rem; padding: .3rem .5rem; border: 1px solid var(--line); border-radius: 8px; font-size: .84rem; }
.cpslot small { color: var(--muted); }
.cpslot span { margin-left: auto; text-align: right; }
.cpslot--onscene span { color: var(--ok); } .cpslot--enroute span, .cpslot--replacing span, .cpslot--reserved span { color: var(--warn); }
.cpslot--pursuit span, .cpslot--unavailable span { color: #FF9B94; } .cpslot--free span { color: var(--muted); }
/* Patrouille mondiale (V7) : gyrophares éteints en patrouille ordinaire, panneau de suivi, filtres de carte */
.dwv.is-patrolling .dwv__bar { display: none !important; }
.wp-banner { position: absolute; z-index: 815; left: 12px; bottom: 12px; max-width: min(520px, calc(100% - 24px)); background: rgba(14, 24, 34, .94); border: 1px solid var(--line-2);
  border-left: 4px solid #3E8BFF; border-radius: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, .45); color: var(--text); }
.wpb__head { display: flex; flex-wrap: wrap; gap: .2rem .8rem; align-items: baseline; width: 100%; padding: .5rem .75rem; border: 0; background: none; color: inherit; cursor: pointer; text-align: left; }
.wpb__head b { font: 800 .86rem var(--fc); letter-spacing: .03em; }
.wpb__head span { font-size: .8rem; color: var(--muted); }
.wpb__body { display: none; padding: 0 .75rem .6rem; }
.wp-banner.is-open .wpb__body { display: block; }
.wpb__k { display: flex; flex-wrap: wrap; gap: .25rem .8rem; font-size: .8rem; color: var(--muted); }
.wpb__k b { color: var(--hi); font-variant-numeric: tabular-nums; }
.wpb__f { display: flex; flex-wrap: wrap; gap: .1rem .9rem; margin-top: .35rem; font-size: .82rem; }
.wpb__f .switch { min-height: 30px; }
#map.wp-hide-pat .dwv-wrap:has(.dwv.is-patrolling) { display: none; }
#map.wp-hide-civ .wp-civ[data-wpst=drive] { display: none; }
#map.wp-hide-int .wp-civ[data-wpst=stopping], #map.wp-hide-int .wp-civ[data-wpst=control] { display: none; }
#map.wp-hide-pur .wp-civ[data-wpst=pursuit] { display: none; }
.dwv--civ.is-stopping .dwv__car svg, .dwv--civ.is-control .dwv__car svg { filter: drop-shadow(0 0 2.5px #3E8BFF) drop-shadow(0 0 1px #3E8BFF); }
@media (max-width: 900px) { .wp-banner { left: .5rem; right: auto; bottom: calc(var(--peek, 76px) + 10px); max-width: calc(100% - 5rem); } }
/* ====================================================================================================================
   Hotfix V7.2 — taille des véhicules : convention commune à tous les véhicules (civils, police, SQ, EMS, pompiers, TOP SPEED,
   MTQ, patrouilles, poursuites, recherches). Longueur de référence par zoom (--veh-n, fonction DW.vehLen), gabarit (--kmul),
   agrandissement des véhicules stationnés (--pmul). Sprites vus du dessus : carrosserie, pare-brise, toit, orientation, couleur.
   ==================================================================================================================== */
.dwv__car { --kmul: 1; --pmul: 1; --ar: .5; --L: calc(var(--veh-n, 26) * var(--kmul) * var(--pmul) * 1px);
  display: block; height: var(--L) !important; width: calc(var(--L) * var(--ar)) !important; }
#map[data-vz] .dwv__car { height: var(--L) !important; width: calc(var(--L) * var(--ar)) !important; }
#map[data-vz] .dwv--civ .dwv__car { height: var(--L) !important; width: calc(var(--L) * var(--ar)) !important; }
/* Gabarits (référence : berline) */
.dwv[data-kind=compact] .dwv__car { --kmul: .9; --ar: .59; }
.dwv[data-kind=sedan] .dwv__car { --kmul: 1; --ar: .5; }
.dwv[data-kind=suv] .dwv__car { --kmul: 1.1; --ar: .48; }
.dwv[data-kind=pickup] .dwv__car { --kmul: 1.15; --ar: .48; }
.dwv[data-kind=van] .dwv__car { --kmul: 1.15; --ar: .45; }
.dwv[data-svc=EMS][data-kind=van] .dwv__car { --kmul: 1.25; }
.dwv[data-kind=truck] .dwv__car { --kmul: 1.45; --ar: .39; }
.dwv[data-kind=tow] .dwv__car { --kmul: 1.35; --ar: .41; }
.dwv[data-kind=tow][data-heavy] .dwv__car { --kmul: 1.6; }
/* Véhicules stationnés ou immobilisés : légèrement agrandis (position réelle inchangée) */
.dwv.is-onscene .dwv__car, .dwv--civ.is-queued .dwv__car, .dwv--civ.is-control .dwv__car, .dwv--civ.is-pullover .dwv__car, .dwv--civ.is-immobilized .dwv__car,
.dwv--civ.is-await_tow .dwv__car, .dwv--civ.is-stopping .dwv__car { --pmul: var(--veh-park, 1.12); }
/* File d'attente et dégagement du barrage : jamais plus long que l'espace réel entre deux véhicules (aucun chevauchement) */
/* (lisibilité d'abord : jamais moins de 70 % de la taille de référence, la voiture de tête est dessinée par-dessus ; le véhicule
   contrôlé et ceux de la zone de dégagement gardent leur pleine taille) */
.dwv--civ.in-cp.is-approach .dwv__car, .dwv--civ.in-cp.is-slowing .dwv__car, .dwv--civ.in-cp.is-queued .dwv__car {
  --L: min(calc(var(--veh-n, 26) * var(--kmul) * var(--pmul) * 1px), max(calc(var(--veh-q, 26) * 1px), calc(var(--veh-n, 26) * .7 * var(--kmul) * 1px))); }
.dwv--civ.in-cp.is-pullover .dwv__car, .dwv--civ.in-cp.is-immobilized .dwv__car, .dwv--civ.in-cp.is-await_tow .dwv__car {
  --L: min(calc(var(--veh-n, 26) * var(--kmul) * var(--pmul) * 1px), max(calc(var(--veh-sl, 24) * 1px), calc(var(--veh-n, 26) * .8 * var(--kmul) * 1px))); }
/* Zoom éloigné : pastille compacte de 16 px pour les véhicules de service (repérage), silhouette pour les civils */
#map[data-vz=far] .dwv__body { width: 18px; height: 18px; margin: 6px; }
#map[data-vz=far] .dwv:not(.dwv--civ) .dwv__car { display: none; }
#map[data-vz=mid] .dwv__car, #map[data-vz=near] .dwv__car { display: block; }
/* Gyrophares et halos proportionnés au véhicule */
#map[data-vz=mid] .dwv__bar, #map[data-vz=near] .dwv__bar { transform: translate(-50%, -50%) scale(calc(.5 * var(--veh-sc, 1))) !important; top: 50% !important; }
#map[data-vz=mid] .dwv[data-kind=truck] .dwv__bar, #map[data-vz=near] .dwv[data-kind=truck] .dwv__bar { top: 40% !important; }
.dwv--civ.is-fleeing::after { width: calc(26px * var(--veh-sc, 1)); height: calc(26px * var(--veh-sc, 1)); margin: calc(-13px * var(--veh-sc, 1)) 0 0 calc(-13px * var(--veh-sc, 1)); }
#map.veh-nolabels .dwv__tag, #map.veh-nolights .dwv__bar { display: none !important; }
/* Marqueurs techniques en retrait (mode diagnostic : visibles comme avant) */
#map:not(.traj-debug) .cp-pin { opacity: .75; font-size: 14px; }
#map:not(.traj-debug) .cp-sign { opacity: .7; }
.dwv-wrap { z-index: auto; }

/* ====================================================================================================================
   REFONTE MOBILE PREMIUM++ V6 — couche commune (jeu, administration, demandes). Ordinateur inchangé : toutes les règles
   qui modifient l'apparence sont réservées aux petits écrans, sauf les corrections de débordement (min(…, 100%)).
   Repères : petit mobile 320–374, mobile 375–430, grand mobile 431–600, tablette 601–1024, ordinateur > 1024.
   ==================================================================================================================== */
:root {
  --sp-1: 4px; --sp-2: 6px; --sp-3: 8px; --sp-4: 12px; --sp-5: 16px; --sp-6: 24px;
  --fs-xs: .74rem; --fs-sm: .84rem; --fs-md: .94rem; --fs-lg: 1.08rem; --fs-xl: 1.3rem;
  --tap: 44px; --btn-h: 40px; --btn-h-sm: 34px;
}
/* Grilles : jamais plus larges que l'écran (iPhone SE 320 px) */
.two { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.checks { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
/* Bouton icône seule (Modifier, Supprimer, Voir… quand le contexte est clair) */
.btn--icon { width: var(--btn-h); min-width: var(--btn-h); padding: 0; }
.btn--icon.btn--sm { width: var(--btn-h-sm); min-width: var(--btn-h-sm); }
/* Alerte de poursuite : libellés courts réservés au téléphone */
.pb__short, .pb__clock { display: none; }
.modal__min { display: none; }

@media (max-width: 900px) {
  /* Boutons : apparence compacte, hauteur tactile confortable ; jamais pleine largeur par défaut */
  .btn { min-height: var(--btn-h); padding: .4rem .85rem; font-size: .92rem; }
  .btn--sm { min-height: var(--btn-h-sm); padding: .25rem .65rem; font-size: .84rem; }
  .box { padding: .8rem .85rem; margin-bottom: .75rem; }
  h1 { font-size: var(--fs-xl); margin-bottom: .6rem; }
  .stack > * + * { margin-top: .7rem; }
  .actions { margin-top: .75rem; gap: .5rem; }
  .kpi { padding: .55rem .7rem; } .kpi b { font-size: 1.15rem; }
  .hint { font-size: .86rem; }
  .seg button { min-height: 36px; padding: .35rem .7rem; }
}

@media (max-width: 640px) {
  /* Actions : la principale prend la place disponible, les secondaires restent compactes */
  .actions > .btn { flex: 0 1 auto; }
  .actions > .btn--primary, .actions > .btn--block-m { flex: 1 1 auto; }
  .modal__body { padding: .8rem .85rem calc(1rem + env(safe-area-inset-bottom, 0px)); }
  .modal__title { font-size: 1.08rem; }

  /* Tableaux simples en cartes (libellé de colonne à gauche, valeur à droite) */
  .tbl--cards, .tbl--cards tbody, .tbl--cards tr, .tbl--cards td { display: block; width: 100%; }
  .tbl--cards thead { display: none; }
  .tbl--cards tr { border: 1px solid var(--line); border-radius: 10px; padding: .45rem .7rem; margin-bottom: .5rem; background: rgba(255, 255, 255, .02); }
  .tbl--cards td { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; border: 0; padding: .2rem 0; text-align: right; min-width: 0; overflow-wrap: anywhere; }
  .tbl--cards td::before { content: attr(data-label); flex: none; max-width: 45%; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; text-align: left; }
  .tbl--cards td:not([data-label])::before { content: none; }
  .tbl--cards td:first-child { justify-content: flex-start; text-align: left; font-weight: 600; color: var(--hi); }
  .tbl--cards td:first-child::before { content: none; }
  .tbl--cards td:empty { display: none; }
  .tbl--cards td.td--full { display: block; text-align: center; }
  .tbl--cards td.num { white-space: normal; }
  .tbl--cards td .btn, .tbl--cards td .actions { margin-left: auto; }
  /* Tableaux complexes : défilement horizontal limité au tableau */
  .tbl--scroll { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl--scroll th, .tbl--scroll td { white-space: nowrap; }

  /* Fiches liées à la carte (appel, véhicule, bâtiment, renforts) : panneau inférieur réduit / mi-écran / plein écran */
  .modal-backdrop--map { background: transparent; pointer-events: none; top: calc(var(--top) + env(safe-area-inset-top, 0px));
    bottom: calc(var(--nav) + env(safe-area-inset-bottom, 0px)); z-index: 1500; overflow: hidden; }
  .modal--map { pointer-events: auto; height: 100%; max-height: 100% !important; border-bottom: 0; box-shadow: 0 -12px 34px rgba(0, 0, 0, .5);
    transition: transform .26s cubic-bezier(.2, .8, .2, 1); }
  .modal--map[data-pos=half] { transform: translateY(50%); }
  .modal--map[data-pos=half] .modal__body { padding-bottom: calc(50% + 1rem); }
  .modal--map[data-pos=reduced] { transform: translateY(calc(100% - 76px)); }
  .modal--map[data-pos=reduced] .modal__body { visibility: hidden; }
  .modal--map .modal__min { display: inline-grid; place-items: center; min-width: 40px; min-height: 40px; font-size: 1rem; }
  .modal--map .modal__head { gap: .4rem; }
  .modal--map .modal__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .modal--map .modal__ttl { min-width: 0; flex: 1; }

  /* Alerte de poursuite compacte : titre, temps restant, unités, Renforts, Suivre — sur une seule ligne */
  .pursuit-banner { left: .5rem; right: .5rem; flex-wrap: nowrap; padding: .4rem .45rem .4rem .6rem; gap: .4rem; border-radius: 12px; }
  .pb__main { flex: 1 1 auto; }
  .pb__title { font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pb__long, .pb__meta { display: none; }
  .pb__short { display: inline; }
  .pb__clock { display: block; font-size: .74rem; white-space: nowrap; opacity: .95; }
  .pb__acts { flex-wrap: nowrap; flex: none; gap: .3rem; }
  .pb__acts .btn { min-height: 34px; padding: .2rem .55rem; font-size: .76rem; }
  .pb__acts [data-pb=units] { display: none; }
  .pb__sel button { width: 26px; height: 26px; }
}
@media (max-width: 640px) and (prefers-reduced-motion: reduce) { .modal--map { transition: none; } }

/* Accueil (téléphone) : l'essentiel du centre */
.home { display: flex; flex-direction: column; gap: .85rem; }
.home__kpis { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.hk { display: flex; flex-direction: column; gap: 1px; min-height: 64px; padding: .5rem .7rem; text-align: left; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; color: var(--text); }
.hk span { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.hk b { font: 700 1.25rem/1.15 var(--fc); color: var(--hi); }
.hk b i { font-style: normal; font-size: .9rem; color: var(--muted); }
.hk small { font-size: var(--fs-xs); color: var(--muted); }
.hk--err { border-color: rgba(240, 82, 74, .55); }
.hk--err b { color: #FF9B94; }
.home__h { display: flex; align-items: center; gap: .4rem; margin: 0 0 .4rem; font: 700 .78rem var(--fc); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.home__h em { font-style: normal; padding: 0 .45rem; border-radius: 999px; background: var(--panel-2); color: var(--hi); font-size: .72rem; }
.home__sec { display: flex; flex-direction: column; }
.hrow { display: flex; align-items: center; gap: .6rem; min-height: 50px; padding: .45rem .6rem; margin-bottom: .4rem; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--svc); border-radius: 8px; }
.hrow__t { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.hrow__t b, .hrow__t small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hrow__t b { font-size: .92rem; }
.hrow__t small { font-size: .78rem; color: var(--muted); }
.home__pu { display: flex; align-items: center; gap: .4rem; padding: .45rem .55rem; margin-bottom: .4rem; border: 1px solid rgba(227, 41, 62, .6); border-radius: 8px; background: rgba(227, 41, 62, .1); }
.home__pu-t { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.home__pu-t small { font-size: .76rem; color: var(--muted); }
.home__links { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; }
.hl { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; min-height: 60px; padding: .5rem .3rem; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; color: var(--text); font: 600 .78rem var(--f); }
.hl .ico { width: 20px; height: 20px; }
.home__more { align-self: flex-start; }

/* Couches de la carte */
.lay-menu { position: absolute; z-index: 960; top: .8rem; right: calc(var(--panel-w) + 4.4rem); width: 250px; display: flex; flex-direction: column; gap: .15rem;
  padding: .7rem .8rem; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .45); }
.lay-menu__h { margin: .3rem 0 .1rem; font: 700 .74rem var(--fc); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.lay-menu__svc { display: flex; flex-wrap: wrap; gap: .3rem; }
.fab--layers.is-on { border-color: var(--warn); color: var(--warn); }
#map.hide-units .dwv-wrap:not(:has(.dwv--civ)), #map.hide-calls .call-wrap, #map.hide-blds .bld-wrap { display: none; }
@media (max-width: 900px) { .lay-menu { top: auto; right: 4.3rem; bottom: calc(var(--peek) + 12px); width: min(260px, calc(100% - 5.5rem)); } }
/* État de l'appel dans la liste : à affecter, unités manquantes, unités en route */
.cstate { display: inline-flex; align-items: center; height: 20px; padding: 0 .45rem; margin-right: .3rem; border-radius: 4px; font: 700 .7rem var(--fc); letter-spacing: .03em; text-transform: uppercase; }
.cstate--wait { background: rgba(240, 82, 74, .16); color: #FF9B94; }
.cstate--part { background: rgba(242, 179, 61, .16); color: var(--warn); }
.cstate--go { background: rgba(90, 208, 138, .14); color: var(--ok); }
@media (max-width: 640px) {
  /* Fenêtres : aucun glissement latéral ; les rangées d'onglets défilent seules */
  .modal__body { overflow-x: hidden; }
  .rdm__form input { min-width: 0; flex: 1 1 auto; }
  .upg__opt { max-width: 78vw; }
}
/* Notifications sur téléphone : compactes, deux au plus à l'écran, jamais sur l'alerte de poursuite (historique : cloche) */
@media (max-width: 640px) {
  .toast { padding: .45rem .7rem; font-size: .84rem; border-radius: 10px; }
  .toasts .toast:nth-last-child(n+3):not(.is-out) { display: none; }
  body:has(#pursuit-banner:not([hidden])) .toasts { top: calc(var(--top) + env(safe-area-inset-top, 0px) + 66px); }
}
@media (max-width: 640px) {
  /* Cartes de tableau : denses, sans les filets et marges des tableaux de l'administration */
  .tbl.tbl--cards td, .tbl.tbl--cards th { border: 0 !important; padding: .14rem 0 !important; min-height: 0 !important; height: auto !important; background: none !important; }
  .tbl.tbl--cards tr { box-shadow: none !important; }
  .tbl.tbl--cards tr:hover td { background: none !important; }
  .tbl.tbl--cards td:first-child { padding-bottom: .3rem !important; }
}
@media (max-width: 640px) { .srx-chip { white-space: normal; max-width: 100%; min-height: 28px; padding: .2rem .6rem; } }
/* Administration sur téléphone : en-tête compact (le contenu garde l'écran), rôle visible dans le menu latéral */
@media (max-width: 640px) {
  .ax__top { padding: .4rem .7rem; gap: .4rem; min-height: 0; }
  .ax__who { display: none; }
  .ax__search { height: 36px; }
  .ax__title b { font-size: 1rem; }
  .ax__favbtn, .ax__burger, .ax__quick .btn { min-height: 38px; min-width: 38px; }
  .ax__quick .btn { padding: 0 .55rem; }
  .ax__content { padding-left: .75rem !important; padding-right: .75rem !important; }
}
/* Refonte mobile V6 — lot 2 : bandeaux du haut empilés sous l'alerte de poursuite (hauteur publiée en --pb-h) */
@media (max-width: 900px) {
  .covpanel--compact, .covpanel--full { top: calc(8px + env(safe-area-inset-top, 0px) + var(--pb-h, 0px)) !important; }
  .world-banner, .maint-banner { top: calc(.6rem + var(--pb-h, 0px)); }
  .maint-banner:not([hidden]) ~ .world-banner { top: calc(3.6rem + var(--pb-h, 0px)); }
  .pursuit-banner { z-index: 935; }
}
/* Compteurs − / + (achat de véhicules, renforts) : cible tactile confortable sur téléphone */
@media (max-width: 900px) { .qty .btn, .bkp__ctr .btn { min-width: 40px; min-height: 40px; padding: 0; font-size: 1.1rem; } }
/* Éditeurs (barrages, zones, recherches) au doigt : outils à 40 px, poignées de points avec zone de saisie élargie (dessin inchangé) */
@media (max-width: 640px) {
  .pl-tools button, .pl-steps button, .pl-top .btn--sm { min-width: 40px; min-height: 40px; }
  .pl-tools { gap: .3rem; }
}
.leaflet-touch .pl-badge::after, .leaflet-touch .med-h::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; }
/* Lien « Temps de réponse ⇄ » de la couverture : zone tactile de 32 px sans changer la mise en page */
.covc__mode { padding: 8px 4px; margin: -8px -4px; }
/* Hotfix V7.4 : présence / équipement / personnel qualifié, véhicules non admissibles expliqués, catalogue des formations */
.ready { margin: .5rem 0; padding: .55rem .7rem; border: 1px solid rgba(242, 179, 61, .35); border-radius: 10px; background: rgba(242, 179, 61, .07); font-size: .88rem; }
.ready.is-ready { border-color: rgba(90, 208, 138, .4); background: rgba(90, 208, 138, .07); }
.ready p { margin: .1rem 0; }
.ready ul { margin: .25rem 0; padding-left: 1.1rem; }
.qok { color: var(--ok); }
.qko { color: var(--warn); }
small.qko { display: block; }
.pick.is-off { opacity: .62; }
.pick.is-off .linkbtn { pointer-events: auto; }
.tcat { list-style: none; margin: .5rem 0 .8rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .45rem; }
.tcat__i { display: flex; flex-direction: column; gap: .15rem; padding: .5rem .65rem; border: 1px solid var(--line, rgba(255, 255, 255, .08)); border-radius: 10px; background: rgba(255, 255, 255, .025); }
.tcat__i.is-off { opacity: .55; }
.emp__act { display: flex; align-items: center; }
@media (max-width: 640px) { .tcat { grid-template-columns: 1fr; } .ready { font-size: .84rem; } }
/* Refonte RH V7.5 : offres d'emploi dans « CV reçus » (formulaire, cartes d'offres, origine des CV) */
.staff__head { display: flex; justify-content: flex-end; margin-bottom: .45rem; }
.cvrow__src { color: var(--muted, #8b95a5); font-size: .74rem; }
.cvrow__src.is-offer { color: #FF9B94; }
.cvfilt { margin: 0 0 .5rem; font-size: .88rem; }
.jobf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem .8rem; align-items: end; }
.jobf__wide { grid-column: 1 / -1; }
.jobf__chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chipck { display: inline-flex; align-items: center; gap: .3rem; min-height: 34px; padding: 0 .65rem; border: 1px solid rgba(255, 255, 255, .12); border-radius: 999px; cursor: pointer; font-size: .84rem; }
.chipck input { width: 15px; height: 15px; margin: 0; accent-color: var(--red, #E3293E); }
.chipck:has(input:checked) { border-color: rgba(227, 41, 62, .7); background: rgba(227, 41, 62, .12); }
.chipck:has(input:disabled) { opacity: .5; }
.jobf__sum { padding: .6rem .75rem; border-radius: 10px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .08); }
.jobf__sum p { margin: 0 0 .35rem; }
.jobcards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .55rem; }
.jobc { padding: .6rem .75rem; border: 1px solid rgba(255, 255, 255, .09); border-radius: 12px; background: rgba(255, 255, 255, .025); display: flex; flex-direction: column; gap: .35rem; }
.jobc--active { border-color: rgba(227, 41, 62, .35); }
.jobc__h { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.jobc__dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .25rem .6rem; margin: 0; }
.jobc__dl div { min-width: 0; }
.jobc__dl dt { font-size: .7rem; color: var(--muted, #8b95a5); text-transform: uppercase; letter-spacing: .03em; }
.jobc__dl dd { margin: 0; font-size: .85rem; overflow-wrap: anywhere; }
.jobc__a { display: flex; flex-wrap: wrap; gap: .35rem; }
.jobf .qty { display: inline-flex; align-items: center; gap: .3rem; }
.jobf .qty button { width: 40px; height: 40px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .06); color: inherit; font-size: 1.1rem; cursor: pointer; }
.jobf .qty input { width: 64px; height: 40px; text-align: center; }
.jobs__top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
@media (max-width: 640px) {
  .jobf { grid-template-columns: 1fr; }
  .jobcards { grid-template-columns: 1fr; }
  .jobc__dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .staff__head .btn { width: auto; }
  /* 7 onglets : une seule rangée qui défile (jamais la page) */
  .modal--staff .staff__tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .modal--staff .staff__tabs::-webkit-scrollbar { display: none; }
  .modal--staff .staff__tabs button { flex: 0 0 auto; white-space: nowrap; }
}
/* Hotfix V7.6 : suivi des remorquages d'un barrage (prise en charge automatique, affectation manuelle repliée) */
.towrow { display: flex; flex-direction: column; gap: .15rem; }
.towman summary { cursor: pointer; font-size: .82rem; color: var(--muted, #8b95a5); }
.towman[open] { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
/* Hotfix V7.7 : zone de Patrouille mondiale (polygone réel, couleur distincte des rayons de couverture) */
.evz-wplabel { background: rgba(26, 18, 46, .85); border: 1px solid #B07CFF; color: #E6D9FF; font: 700 .72rem var(--fc, sans-serif); letter-spacing: .04em; box-shadow: none; }
.evz-wplabel::before { display: none; }
.wplegend { display: inline-block; width: 18px; height: 10px; border: 2px dashed #B07CFF; background: rgba(176, 124, 255, .12); border-radius: 2px; vertical-align: middle; }
/* Refonte V8.0 : Centre de routage (moteurs, actions par moteur, essai d'itinéraire, liste éditable) */
[data-rtpanel] .rc-stats { align-items: stretch; }
[data-rtpanel] .rc-stats .stat { justify-content: flex-start; }
[data-rtpanel] .rc-stats .stat small { white-space: normal; }
[data-rtpanel] tr.is-off td { opacity: .6; }
[data-rtpanel] td.nowrap { white-space: normal; min-width: 15rem; }
[data-rtpanel] td.nowrap .btn { margin: 0 .15rem .2rem 0; }
[data-rtpanel] .rp-row { flex-wrap: wrap; gap: .4rem; align-items: center; padding: .4rem 0; border-bottom: 1px solid var(--line); }
[data-rtpanel] .rp-row select, [data-rtpanel] .rp-row input { min-height: 36px; }
[data-rtpanel] .rt-test { flex-wrap: wrap; gap: .6rem; align-items: end; margin-bottom: .6rem; }
[data-rtpanel] .rt-test label { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; }
[data-rtpanel] .rt-test input { width: 12rem; }
@media (max-width: 640px) {
  [data-rtpanel] .rp-row > * { flex: 1 1 100%; width: auto !important; min-width: 0 !important; }
  [data-rtpanel] .rt-test label, [data-rtpanel] .rt-test input, [data-rtpanel] .rt-test select { width: 100%; }
  [data-rtpanel] td.nowrap { white-space: normal; }
}
