/* Meridian Protect — thème clair premium (maquette 01_design_reference) */
:root {
  --bg: #f4f7fc;
  --card: #ffffff;
  --ink: #0b1630;
  --ink-2: #4a5671;
  --muted: #7b869c;
  --line: #e6ebf3;
  --blue: #1f6bff;
  --blue-soft: #e8f0ff;
  --navy: #0b2a6b;
  --green: #18b33f;
  --red: #ef3b3b;
  --red-soft: #fdecec;
  --amber: #f59e0b;
  --map: #0c1a33;
  --radius: 22px;
  --radius-sm: 16px;
  --shadow: 0 8px 28px rgba(16, 38, 84, .08), 0 1px 3px rgba(16, 38, 84, .06);
  --shadow-press: 0 2px 8px rgba(16, 38, 84, .10);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --nav-h: 66px;
  --gutter: 16px;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font: 16px/1.35 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid rgba(31, 107, 255, .45); outline-offset: 2px; border-radius: 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; }

/* ---------- Icônes ---------- */
.ico { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 18px; height: 18px; }
.dot-red { position: absolute; top: 5px; right: 6px; width: 11px; height: 11px; border-radius: 50%; background: var(--red); border: 2px solid var(--bg); }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: var(--green); } .dot.moving { background: var(--green); } .dot.off { background: #9aa4b6; }

/* ---------- Boutons ---------- */
.btn-primary, .btn-danger, .btn-success, .btn-ghost { display: block; width: 100%; min-height: 50px; border-radius: 14px; font-weight: 650; font-size: 16px; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(31, 107, 255, .28); }
.btn-danger { background: var(--red); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-ghost { background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.btn-primary:active, .btn-danger:active, .btn-success:active, .btn-ghost:active { transform: scale(.985); }
button:disabled { opacity: .55; cursor: default; }
.danger-text { color: var(--red); }
.wide { margin-top: 22px; }
.link { color: var(--blue); font-weight: 650; display: inline-flex; align-items: center; gap: 2px; min-height: 40px; }
.icon-btn { position: relative; width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; color: var(--ink); }
.icon-btn .ico { width: 27px; height: 27px; }
.icon-btn.raised { background: var(--card); box-shadow: var(--shadow); }
.icon-btn:active { transform: scale(.96); }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px var(--gutter); }
.login-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 26px; padding: 30px 24px; box-shadow: var(--shadow); display: grid; gap: 16px; }
.login-logo { width: 220px; height: auto; margin: 0 auto 2px; display: block; }
.login-sub { text-align: center; color: var(--ink-2); margin: 0 0 6px; }
.login-card label { display: grid; gap: 6px; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.login-card input, .dialog input { border: 1px solid var(--line); background: var(--bg); border-radius: 14px; padding: 14px; font-size: 16px; outline: none; }
.login-card input:focus, .dialog input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31, 107, 255, .14); }
.error { color: #b42318; background: var(--red-soft); border-radius: 12px; padding: 10px 12px; margin: 0; font-size: 14px; }

/* ---------- Structure ---------- */
.app { min-height: 100vh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px); }
.topbar, .subbar, .screen { max-width: 640px; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: calc(env(safe-area-inset-top) + 12px) var(--gutter) 4px; }
.logo { height: 46px; width: auto; display: block; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.subbar { display: grid; grid-template-columns: 50px 1fr 50px; align-items: center; padding: calc(env(safe-area-inset-top) + 8px) 8px 4px; position: sticky; top: 0; z-index: 500; background: rgba(244, 247, 252, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.subbar h1 { margin: 0; text-align: center; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen { padding: 8px var(--gutter) 16px; }
.screen.sub { padding-top: 4px; }
.sync-warn { max-width: 608px; margin: 6px auto 0; background: #fff7e6; color: #8a5300; border-radius: 12px; padding: 9px 12px; font-size: 14px; text-align: center; }
.hello { font-size: 34px; font-weight: 800; letter-spacing: -.02em; margin: 10px 0 4px; }
.hello-sub { color: var(--ink-2); font-size: 17px; margin: 0 0 18px; max-width: 22em; }
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -.01em; margin: 10px 0 16px; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-title { font-size: 15px; font-weight: 700; color: var(--ink-2); margin: 24px 4px 10px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(230, 235, 243, .7); }
.card.pad { padding: 16px; display: grid; gap: 12px; }
.empty-big { color: var(--muted); text-align: center; padding: 30px 12px; }

/* ---------- Carte sombre ---------- */
.map-card { position: relative; border-radius: 26px; overflow: hidden; background: var(--map); box-shadow: 0 14px 34px rgba(11, 42, 107, .22); height: 300px; isolation: isolate; }
.map-card.short { height: 260px; margin-bottom: 14px; }
.map { width: 100%; height: 100%; background: var(--map); }
.map.dark .leaflet-tile-pane { filter: invert(1) hue-rotate(195deg) saturate(.75) brightness(.92) contrast(.92); }
.leaflet-container { font: inherit; background: var(--map); }
.leaflet-control-attribution { background: rgba(12, 26, 51, .7) !important; color: #9fb0cf !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: #cfe0ff !important; }
.map-badge { position: absolute; top: 14px; left: 14px; z-index: 600; display: inline-flex; align-items: center; gap: 9px; padding: 9px 14px; border-radius: 999px; background: rgba(12, 26, 51, .72); border: 1px solid rgba(255, 255, 255, .16); color: #fff; font-size: 16px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.bars i { width: 3px; border-radius: 1px; background: rgba(255, 255, 255, .3); }
.bars i.on { background: #fff; }
.bars i:nth-child(1) { height: 5px; } .bars i:nth-child(2) { height: 8px; } .bars i:nth-child(3) { height: 11px; } .bars i:nth-child(4) { height: 14px; }
.map-city { position: absolute; top: 64px; right: 84px; z-index: 600; color: #fff; font-weight: 700; font-size: 22px; text-shadow: 0 2px 8px rgba(0, 0, 0, .55); pointer-events: none; max-width: 52%; text-align: right; }
.map-empty { position: absolute; inset: 0; z-index: 550; display: grid; place-items: center; color: #cfe0ff; text-align: center; padding: 30px; background: rgba(12, 26, 51, .55); font-size: 15px; }
.map-ctrls { position: absolute; right: 12px; top: 12px; z-index: 600; display: grid; gap: 8px; }
.map-btn { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(12, 26, 51, .78); border: 1px solid rgba(255, 255, 255, .22); box-shadow: 0 4px 12px rgba(0, 0, 0, .25); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.map-btn[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); }
.map-btn:active { transform: scale(.94); }
.map-zoom { display: grid; border-radius: 26px; overflow: hidden; background: rgba(12, 26, 51, .78); border: 1px solid rgba(255, 255, 255, .22); }
.map-zoom .map-btn { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.map-zoom .map-btn + .map-btn { border-top: 1px solid rgba(255, 255, 255, .12); }

/* Marqueur véhicule (goutte bleue + halo) */
.vpin { position: relative; width: 74px; height: 90px; }
.vpin .halo { position: absolute; left: 50%; top: 38px; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; background: radial-gradient(circle, rgba(31, 107, 255, .34) 0%, rgba(31, 107, 255, .14) 45%, rgba(31, 107, 255, 0) 70%); pointer-events: none; }
.vpin .drop { position: absolute; left: 50%; top: 6px; width: 62px; height: 62px; margin-left: -31px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--blue); box-shadow: 0 8px 18px rgba(0, 0, 0, .35); }
.vpin .face { position: absolute; left: 50%; top: 13px; width: 48px; height: 48px; margin-left: -24px; border-radius: 50%; background: #0b1630; display: grid; place-items: center; color: #fff; }
.vpin .face .ico { width: 28px; height: 28px; }
.vpin.off .drop { background: #8b96ab; }
.vpin.off .halo { display: none; }
.vpin.sm { transform: scale(.72); transform-origin: 50% 100%; }
.vlabel { background: rgba(12, 26, 51, .85); color: #fff; border: 0; border-radius: 8px; font: 600 12px var(--font); padding: 4px 8px; box-shadow: none; }
.vlabel::before { display: none; }
.hmark { width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, .5); }
.hmark.start { background: var(--green); } .hmark.end { background: var(--red); }

/* ---------- Carte « Mon véhicule » ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)) 12px; padding: 2px var(--gutter) 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 9px 14px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); font-weight: 600; font-size: 14px; min-height: 40px; }
.chip.active { background: var(--blue); color: #fff; }
.vehicle-card { width: 100%; display: grid; grid-template-columns: 96px 1fr 28px; align-items: center; gap: 14px; padding: 14px 16px; margin-top: 16px; text-align: left; }
.vehicle-card.static { grid-template-columns: 96px 1fr; margin-top: 0; }
.vehicle-card:active:not(.static) { box-shadow: var(--shadow-press); transform: scale(.995); }
.vehicle-card.floating { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 14px; width: auto; z-index: 650; margin: 0; }
.vthumb { width: 96px; height: 72px; border-radius: 16px; background: linear-gradient(160deg, #eef3ff, #dde7fb); color: var(--navy); display: grid; place-items: center; }
.vthumb .ico { width: 46px; height: 46px; }
.vinfo { display: grid; gap: 5px; min-width: 0; }
.vname { font-size: 21px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vstatus { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; color: var(--muted); }
.vstatus.on, .vstatus.moving { color: var(--green); }
.vplace { display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 16px; min-width: 0; }
.vplace span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--ink-2); }

/* ---------- Raccourcis ---------- */
.shortcuts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0; }
.shortcut { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); border: 1px solid rgba(230, 235, 243, .7); min-height: 92px; display: grid; justify-items: center; align-content: center; gap: 8px; padding: 12px 4px; font-weight: 700; font-size: 15px; color: var(--ink); }
.shortcut .ico { width: 34px; height: 34px; }
.shortcut.active { background: linear-gradient(180deg, #dfeaff, #cfe0ff); color: var(--blue); border-color: #bcd3ff; box-shadow: 0 6px 16px rgba(31, 107, 255, .2), inset 0 -2px 0 var(--blue); }
.shortcut:active { transform: scale(.97); }

/* ---------- Dernières activités ---------- */
.activity-card { padding: 18px 14px 8px; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 8px; }
.card-head h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.activity { list-style: none; margin: 0; padding: 0 6px; }
.activity.card { padding: 6px 14px; }
.act { display: grid; grid-template-columns: 50px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; }
.act + .act { border-top: 1px solid var(--line); }
.act-ico { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.act-ico.start { background: #eef1f6; color: var(--navy); }
.act-ico.stop, .act-ico.alert { background: var(--red-soft); color: var(--red); }
.act-ico.warning { background: #fff4e0; color: var(--amber); }
.act-ico.engine { background: #eef1f6; color: var(--navy); }
.act-title { font-weight: 700; font-size: 16px; }
.act-sub { color: var(--ink-2); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-time { color: var(--ink-2); font-size: 16px; white-space: nowrap; }
.act-empty { color: var(--muted); padding: 14px 4px; }
.act-date { color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 14px 0 4px; }

/* ---------- Listes ---------- */
.vlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.vlist .vehicle-card { margin: 0; }
.list-card { list-style: none; margin: 0; padding: 4px 16px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; font-size: 15px; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv span { color: var(--ink-2); }
.kv b, .kv a { text-align: right; font-weight: 600; }
.kv a { color: var(--blue); text-decoration: none; }
.alert-row { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 13px 0; cursor: pointer; }
.alert-row + .alert-row { border-top: 1px solid var(--line); }
.alert-row .act-ico { width: 44px; height: 44px; }
.alert-row.unread .act-title::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-left: 8px; vertical-align: middle; }

/* ---------- Fiche ---------- */
.notice { background: #fff7e6; color: #8a5300; border-radius: 14px; padding: 11px 13px; font-size: 14px; margin-top: 12px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.info-grid div { background: var(--card); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 12px 14px; }
.info-grid dt { color: var(--muted); font-size: 13px; margin-bottom: 3px; }
.info-grid dd { margin: 0; font-weight: 700; font-size: 16px; }
.bad { color: var(--red); }
.action-list { margin: 14px 0; padding: 4px 0; }
.action-list button { width: 100%; display: grid; grid-template-columns: 28px 1fr 20px; gap: 12px; align-items: center; text-align: left; padding: 14px 16px; font-weight: 600; min-height: 54px; color: var(--ink); }
.action-list button + button { border-top: 1px solid var(--line); }
.action-list button > .ico:first-child { color: var(--blue); }
.action-list .chev { width: 18px; height: 18px; }
.engine h2 { margin: 0; font-size: 18px; }
.engine p { margin: 0; }
.cmd { border-radius: 14px; padding: 12px 14px; font-size: 15px; margin-top: 12px; background: var(--blue-soft); color: var(--navy); }
.cmd.ok { background: #e6f7ea; color: #0d6b28; } .cmd.bad { background: var(--red-soft); color: #9b1c1c; } .cmd.wait { background: #fff7e6; color: #8a5300; }

/* ---------- Trajets ---------- */
.datebar { display: grid; grid-template-columns: 50px 1fr 50px; gap: 10px; margin-bottom: 14px; align-items: center; }
.datebar input { height: 50px; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 0 12px; text-align: center; box-shadow: var(--shadow); font-weight: 600; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.summary div { background: var(--card); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 12px 8px; text-align: center; }
.summary b { display: block; font-size: 20px; font-weight: 800; }
.summary span { color: var(--muted); font-size: 13px; }
.trips { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.trip { background: var(--card); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 13px 14px; display: grid; grid-template-columns: 6px 1fr auto; gap: 12px; align-items: center; cursor: pointer; border: 2px solid transparent; }
.trip.selected { border-color: var(--blue); }
.trip .bar { width: 6px; align-self: stretch; border-radius: 3px; }
.trip-time { font-weight: 700; }
.trip-sub { color: var(--ink-2); font-size: 14px; }
.trip-km { font-weight: 800; white-space: nowrap; }

/* ---------- Paramètres ---------- */
.profile-card { display: flex; align-items: center; gap: 14px; padding: 16px; }
.avatar { width: 54px; height: 54px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; }
.prefs { padding: 2px 16px; }
.pref { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; font-size: 15px; cursor: pointer; min-height: 50px; }
.pref + .pref { border-top: 1px solid var(--line); }
.pref input { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 15px; background: #d7dde8; position: relative; flex: none; cursor: pointer; transition: background .2s; }
.pref input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.pref input:checked { background: var(--green); }
.pref input:checked::after { transform: translateX(20px); }
.lv { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.lv.critical { background: var(--red); } .lv.warning { background: var(--amber); } .lv.info { background: var(--blue); }

/* ---------- Bientôt disponible ---------- */
.soon { padding: 34px 22px; text-align: center; display: grid; justify-items: center; gap: 6px; margin-top: 12px; }
.soon-ico { width: 84px; height: 84px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; margin-bottom: 8px; }
.soon-ico .ico { width: 42px; height: 42px; }
.soon h2 { margin: 0; font-size: 22px; }
.soon p { margin: 0; max-width: 26em; }

/* ---------- Écran Carte (plein écran) ---------- */
.screen-map { max-width: none; padding: 0; position: fixed; left: 0; right: 0; top: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 1; }
.map.full { height: 100%; }
.full-ctrls { top: calc(env(safe-area-inset-top) + 84px); }
.app.on-map .topbar { position: fixed; left: 0; right: 0; z-index: 700; max-width: none; background: linear-gradient(180deg, rgba(244, 247, 252, .96), rgba(244, 247, 252, 0)); padding-bottom: 18px; }
.app.on-map .topbar .topbar-actions { margin-right: 66px; }

/* ---------- Navigation basse ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 800; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); padding: 6px max(6px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.tabbar a { display: grid; justify-items: center; gap: 3px; padding: 6px 0; text-decoration: none; color: #6b7690; font-size: 13px; font-weight: 600; min-height: 54px; }
.tabbar a .ico { width: 28px; height: 28px; }
.tabbar a.active { color: var(--blue); }
.tabbar a.active .ico svg { fill: rgba(31, 107, 255, .12); }
.tabbar a[data-tab="home"].active .ico svg { fill: var(--blue); }
.ico-wrap { position: relative; display: inline-grid; }
.ico-wrap .dot-red { top: -2px; right: -4px; border-color: #fff; }
@media (min-width: 700px) {
  .tabbar { left: 50%; right: auto; width: 640px; transform: translateX(-50%); border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; box-shadow: var(--shadow); }
}

/* ---------- Dialogue ---------- */
.dialog { border: 0; border-radius: 24px; background: var(--card); color: var(--ink); padding: 22px; width: min(420px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(11, 22, 48, .3); }
.dialog::backdrop { background: rgba(11, 22, 48, .45); }
.dialog h2 { margin: 0 0 8px; font-size: 19px; }
.dialog p { color: var(--ink-2); margin: 0 0 14px; }
.dialog label { display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.dialog .error { margin-top: 10px; }
.dialog-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

/* ---------- Écran de secours ---------- */
@keyframes fatal-in { to { opacity: 1; visibility: visible; } }
.fatal { opacity: 0; visibility: hidden; animation: fatal-in .3s 4s forwards; max-width: 420px; margin: 20vh auto 0; padding: 18px 20px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); text-align: center; }

/* ---------- Petits écrans ---------- */
@media (max-width: 380px) {
  .hello { font-size: 30px; }
  .vehicle-card { grid-template-columns: 76px 1fr 22px; gap: 10px; }
  .vthumb { width: 76px; height: 60px; }
  .vname { font-size: 19px; }
  .shortcut { font-size: 13px; min-height: 84px; }
  .shortcut .ico { width: 30px; height: 30px; }
  .map-card { height: 260px; }
}
body:not(.is-admin) .admin-only { display: none !important; }

/* ================= Blocage moteur (maintenir 3 s) ================= */
.lock { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 14px 18px; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); border: 1px solid rgba(230, 235, 243, .7); --lock: #9aa4b6; --lock-glow: rgba(154, 164, 182, .0); }
.lock[data-state="unlocked"] { --lock: var(--green); --lock-glow: rgba(24, 179, 63, .28); }
.lock[data-state="locked"] { --lock: var(--red); --lock-glow: rgba(239, 59, 59, .30); }
.lock[data-state="holding"].from-unlocked, .lock[data-state="pending_lock"] { --lock: var(--green); --lock-glow: rgba(24, 179, 63, .28); }
.lock[data-state="holding"].from-locked, .lock[data-state="pending_unlock"] { --lock: var(--red); --lock-glow: rgba(239, 59, 59, .30); }
.lock[data-state="error"].from-unlocked { --lock: var(--green); }
.lock[data-state="error"].from-locked { --lock: var(--red); }
.lock-btn { position: relative; width: 84px; height: 84px; flex: none; border-radius: 50%; display: grid; place-items: center; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.lock-btn:disabled { cursor: not-allowed; }
.lock-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.lock-track { fill: none; stroke: var(--line); stroke-width: 3.5; }
.lock-progress { fill: none; stroke: var(--blue); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 289.03; stroke-dashoffset: 289.03; filter: drop-shadow(0 0 3px rgba(31, 107, 255, .55)); }
.lock-core { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--lock) 78%, #fff), var(--lock) 70%); box-shadow: 0 6px 18px var(--lock-glow), 0 0 0 6px color-mix(in srgb, var(--lock) 12%, transparent); transition: background .6s ease, box-shadow .6s ease, transform .15s ease; }
.lock-core .ico { width: 30px; height: 30px; }
.lock-core .ico svg { stroke-width: 2.4; }
.lock[data-state="holding"] .lock-core { transform: scale(.94); }
.lock[data-state="pending_lock"] .lock-core, .lock[data-state="pending_unlock"] .lock-core { animation: lock-pulse 1.4s ease-in-out infinite; }
.lock[data-state="pending_lock"] .lock-progress, .lock[data-state="pending_unlock"] .lock-progress { stroke-dashoffset: 216; animation: lock-spin 1.1s linear infinite; transform-origin: 50% 50%; }
.lock[data-state="unknown"] .lock-core, .lock.disabled:not([data-state^="pending"]) .lock-core { filter: grayscale(.2); opacity: .75; }
.map-zoom { width: 50px; }
@keyframes lock-pulse { 50% { box-shadow: 0 6px 26px var(--lock-glow), 0 0 0 10px color-mix(in srgb, var(--lock) 18%, transparent); } }
@keyframes lock-spin { to { transform: rotate(360deg); } }
.lock-text { display: grid; gap: 2px; min-width: 0; }
.lock-text b { font-size: 18px; font-weight: 800; }
.lock-status { font-weight: 700; color: var(--muted); font-size: 16px; }
.lock[data-state="unlocked"] .lock-status { color: var(--green); }
.lock[data-state="locked"] .lock-status { color: var(--red); }
.lock[data-state="error"] .lock-status { color: var(--red); }
.lock[data-state^="pending"] .lock-status, .lock[data-state="holding"] .lock-status { color: var(--blue); }
.lock-hint { color: var(--ink-2); font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .lock-core, .lock-progress { animation: none !important; transition: none !important; } }

.toast { pointer-events: none; position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px); transform: translateX(-50%); z-index: 900; max-width: calc(100% - 32px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 15px; box-shadow: 0 10px 30px rgba(11, 22, 48, .3); }
.toast.ok { background: #0d6b28; } .toast.bad { background: #9b1c1c; }
