/* SmartWaypoints — interface claire. Panneaux flottants sur la carte ; panneau de mission en bas d'écran sur mobile. */
:root {
  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e3e8ef;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --accent-text: #3730a3;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --warn: #b45309;
  --warn-soft: #fff4e5;
  --ok: #15803d;
  --pro: #d97706;
  --premium: #7c3aed;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(15, 23, 42, .12), 0 2px 6px rgba(15, 23, 42, .06);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, .10);
  --gap: 12px;
  --top: 72px;
  --right-w: 360px;
  --left-w: 300px;
  --sheet-h: 40vh;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; display: flex; gap: 6px; align-items: flex-start; }
.hint .ic { width: 16px; height: 16px; margin-top: 1px; }
.strong { font-weight: 600; }

#map { position: fixed; inset: 0; }
.maplibregl-ctrl-top-right { display: none; }
.maplibregl-ctrl-bottom-right { right: calc(var(--right-w) + var(--gap) * 2); }
.maplibregl-ctrl-attrib { font-size: 10px; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { background: #edf1f7; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .ic { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-soft { background: var(--accent-soft); color: var(--accent-text); }
.btn-soft:hover { background: #e2e5ff; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 48px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-link { border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; padding: 0; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text); cursor: pointer; text-decoration: none; transition: background .15s; }
.btn-icon:hover { background: var(--surface-2); }
.btn-icon.sm { width: 30px; height: 30px; }
.btn-icon.sm .ic { width: 16px; height: 16px; }
.btn-icon.danger:hover { background: var(--danger-soft); color: var(--danger); }
.badge { display: inline-block; padding: 1px 7px; border-radius: 99px; font-size: 10.5px; font-weight: 600; letter-spacing: .02em; vertical-align: middle; }
.badge-pro { background: #fff3dc; color: var(--pro); }
.badge-premium { background: #f3ecff; color: var(--premium); }

/* Barre du haut */
.topbar { position: fixed; z-index: 30; top: var(--gap); left: var(--gap); right: var(--gap); height: 48px; display: flex; align-items: center; gap: var(--gap); pointer-events: none; }
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px 0 8px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); color: var(--text); text-decoration: none; font-weight: 700; font-size: 16px; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; }
.brand-mark .ic { width: 20px; height: 20px; }
.search { position: relative; flex: 1; max-width: 480px; margin: 0 auto; }
.search .search-ic { position: absolute; left: 14px; top: 14px; color: var(--muted); }
#pac-input { width: 100%; height: 48px; padding: 0 16px 0 44px; border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); outline: none; font-size: 15px; }
#pac-input:focus { box-shadow: 0 0 0 3px rgba(79, 70, 229, .25), var(--shadow-sm); }
.search .autocomplete-items { left: 0 !important; right: 0; top: 54px !important; transform: none !important; max-width: none !important; border-radius: var(--radius) !important; box-shadow: var(--shadow) !important; }
.search .autocomplete-items div { padding: 10px 14px !important; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.top-actions { display: flex; align-items: center; gap: 4px; height: 48px; padding: 0 6px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.btn-lang { width: auto; padding: 0 8px; gap: 4px; font-size: 12px; font-weight: 600; }
.btn-user { height: 38px; border: 0; }

.dropdown { position: relative; }
.dropdown .menu { display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px; padding: 6px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 40; }
.dropdown.open .menu { display: block; }
.dropdown .menu a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.dropdown .menu a:hover { background: var(--surface-2); }
.dropdown .menu a.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.dropdown .menu a .ic { width: 18px; height: 18px; color: var(--muted); }

/* Cartes et panneaux */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 8px; margin-bottom: 10px; }
.card-head .btn { max-width: 100%; }
.card-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; }
.card-title .ic { color: var(--accent); }
.panel-left { overflow-x: hidden; position: fixed; z-index: 20; top: var(--top); left: var(--gap); width: var(--left-w); max-height: calc(100dvh - var(--top) - 100px); overflow-y: auto; display: flex; flex-direction: column; gap: var(--gap); scrollbar-width: thin; }
.panel-left .card { padding: 14px; }
.alert { padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 8px; }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.link-small { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; text-decoration: none; }
.link-small .ic { width: 16px; height: 16px; }

/* Liste des drones (rendue par GetDroneList.php) */
#DroneTab { display: flex; flex-direction: column; gap: 6px; }
.DroneTabDiv { width: 100% !important; float: none !important; }
.DroneTabDiv .DroneTab { display: flex !important; align-items: center; gap: 6px; flex-wrap: wrap; width: 100% !important; margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2) !important; color: var(--text) !important; cursor: pointer; text-align: left; font-size: 13.5px; border: 1px solid var(--line); }
.DroneTabDiv .DroneTab:hover { border-color: #c9d1de; }
.DroneTabDiv .DroneTab b.Serial_numbers { font-weight: 600; }
.DroneTabDiv .DroneTab i { font-style: normal; color: var(--muted); }
.DroneTabDiv [id^="TabDroneContent_"] { padding: 10px 12px 4px; font-size: 13px; color: var(--muted); line-height: 1.8; }
.DroneTabDiv [id^="TabDroneContent_"] b { color: var(--text); font-weight: 600; }
.DroneTabDiv [id^="Actions_"] { display: flex; gap: 6px; margin-top: 8px !important; }
.DroneTabDiv [id^="Actions_"] > div { display: flex; gap: 6px; width: 100% !important; float: none !important; }
.DroneTabDiv button { flex: 1; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 12.5px; cursor: pointer; }
.DroneTabDiv button:hover { background: var(--surface-2); }
.DroneTabDiv button.w3-red, .DroneTabDiv button[id^="Drone_Delete"] { color: var(--danger); }
.DroneTabDiv .glyphicon { display: none; }

.drone-details > div:not(.drone-actions) { display: flex; justify-content: space-between; gap: 8px; }
.drone-actions { display: flex; gap: 6px; margin: 8px 0 4px; }
.drone-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.drone-actions .ic { width: 15px; height: 15px; }
.drone-actions button.danger { color: var(--danger); }

/* Résultats */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.stats > div { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.stats small { display: block; color: var(--muted); font-size: 11.5px; }
.stats strong { font-size: 16px; font-weight: 600; }
.kmz-list { display: flex; flex-direction: column; gap: 8px; }
.kmz-row { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--accent); color: #fff; text-decoration: none; transition: background .15s; }
.kmz-row:hover { background: var(--accent-hover); }
.kmz-ic { grid-row: span 2; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: rgba(255, 255, 255, .18); }
.kmz-name strong { display: block; font-size: 14px; }
.kmz-name small { opacity: .8; font-size: 11.5px; word-break: break-all; }
.kmz-stats { grid-column: 2; font-size: 11.5px; opacity: .85; }

/* Panneau de mission */
.panel-right { position: fixed; z-index: 20; top: var(--top); right: var(--gap); bottom: var(--gap); width: var(--right-w); display: flex; flex-direction: column; overflow: hidden; }
.sheet-handle { display: none; }
.mission-head { display: flex; align-items: center; gap: 6px; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--line); }
#ScenarioName { flex: 1; min-width: 0; height: 36px; padding: 0 8px; margin-left: -8px; border: 1px solid transparent; border-radius: 8px; background: transparent; font-weight: 600; font-size: 15px; outline: none; }
#ScenarioName:hover { border-color: var(--line); }
#ScenarioName:focus { border-color: var(--accent); background: var(--surface); }
.mission-actions { display: flex; gap: 2px; }
.mission-actions .btn-icon { width: 34px; height: 34px; }
.mission-actions .ic { width: 18px; height: 18px; }
.mission-body { flex: 1; overflow-y: auto; padding: 12px; scrollbar-width: thin; }
.mission-foot { padding: 12px; border-top: 1px solid var(--line); background: var(--surface); }
.mission-foot .hint { margin: 0 0 10px; justify-content: center; text-align: center; }
#GenerateButton:not(:disabled) { box-shadow: 0 6px 16px rgba(79, 70, 229, .35); }
#sortableMarkerOrder { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.empty { text-align: center; padding: 28px 12px; }
.empty-art { display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: 22px; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; }
.empty-art .ic { width: 36px; height: 36px; }
.empty h2 { font-size: 17px; margin-bottom: 6px; }
.empty p { color: var(--muted); margin: 0 0 16px; }
.empty-actions { display: flex; gap: 8px; justify-content: center; }

/* Carte d'un élément */
.el-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.el-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
.el-card.is-avoid { background: #fff8f8; border-color: #f6d4d4; }
.el-head { display: flex; align-items: center; gap: 8px; }
.el-num { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 8px; border: 0; border-radius: 9px; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; font-size: 12.5px; cursor: pointer; flex: none; }
.el-num .ic { width: 16px; height: 16px; }
.is-avoid .el-num { background: var(--danger-soft); color: var(--danger); }
.el-type { flex: 1; min-width: 0; height: 34px; padding: 0 28px 0 8px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; font-size: 14px; cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 6px center; background-size: 16px; }
.el-type:hover { background-color: var(--surface-2); }
.el-tools { display: flex; gap: 0; flex: none; color: var(--muted); }
.el-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.el-field label, .field label, .el-label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; font-weight: 500; }
.el-label { margin: 12px 0 6px; }
select, .field input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background-color: var(--surface); outline: none; }
.el-field select, .field select { appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; cursor: pointer; }
select:focus, .field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
.el-sub { margin-top: 10px; padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); }
.el-sub .el-grid { margin-top: 6px; }
.el-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 6px; }
.el-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border: 2px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; text-align: center; transition: border-color .15s, background .15s; }
.el-tile input { position: absolute; opacity: 0; pointer-events: none; }
.el-tile img { width: 100%; max-width: 64px; height: 52px; object-fit: cover; border-radius: 6px; }
.el-tile:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.el-tile.locked { opacity: .55; cursor: not-allowed; }
.el-more { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 6px; }
.el-more summary { cursor: pointer; font-size: 12.5px; color: var(--accent-text); font-weight: 500; padding: 4px 0; list-style: none; display: flex; align-items: center; gap: 4px; }
.el-more summary::-webkit-details-marker { display: none; }
.el-more summary::before { content: ""; width: 14px; height: 14px; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat; transition: transform .15s; }
.el-more[open] summary::before { transform: rotate(90deg); }
.el-gimbal { margin: 6px 0; }
.el-gimbal .el-field { margin-top: 6px; }
.el-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-size: 12.5px; cursor: pointer; }
.chip .ic { width: 14px; height: 14px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Interrupteurs */
.el-toggle, .option-card { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; font-size: 13px; }
.el-toggle img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex: none; }
.el-toggle > span:first-of-type, .option-text { flex: 1; }
.el-toggle input, .option-card input { position: absolute; opacity: 0; pointer-events: none; }
.toggle { position: relative; flex: none; width: 38px; height: 22px; border-radius: 99px; background: #cbd5e1; transition: background .15s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s; }
input:checked ~ .toggle { background: var(--accent); }
input:checked ~ .toggle::after { transform: translateX(16px); }
input:focus-visible ~ .toggle { box-shadow: 0 0 0 3px rgba(79, 70, 229, .25); }
.el-toggle.locked, .option-card.locked { cursor: not-allowed; }
.el-toggle.locked .toggle, .option-card.locked .toggle { opacity: .45; }
.option-card { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 10px; }
.option-card img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; }
.option-text strong { display: block; font-weight: 600; }
.option-text small { color: var(--muted); font-size: 12px; }
.option-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.switch { display: flex; align-items: center; gap: 10px; padding: 8px 2px; cursor: pointer; font-size: 13px; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: relative; flex: none; width: 34px; height: 20px; border-radius: 99px; background: #cbd5e1; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(14px); }

/* Barre d'outils */
.dock { position: fixed; z-index: 25; bottom: 18px; left: calc(var(--left-w) + var(--gap) + (100vw - var(--left-w) - var(--right-w) - var(--gap) * 4) / 2 + var(--gap)); transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 6px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); }
.dock-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 64px; height: 56px; padding: 0 10px; border: 0; border-radius: 13px; background: transparent; color: var(--text); font-size: 11.5px; font-weight: 500; cursor: pointer; transition: background .15s, color .15s; }
.dock-btn:hover { background: var(--surface-2); }
.dock-btn .ic { width: 22px; height: 22px; }
.dock-btn.selected_button { background: var(--accent); color: #fff; }
.dock-sep { width: 1px; height: 32px; background: var(--line); margin: 0 4px; }
.draw-hint { position: fixed; z-index: 25; top: calc(var(--top) + 4px); left: calc(var(--left-w) + var(--gap) + (100vw - var(--left-w) - var(--right-w) - var(--gap) * 4) / 2 + var(--gap)); transform: translateX(-50%); max-width: min(440px, 90vw); padding: 8px 14px; border-radius: 99px; background: rgba(15, 23, 42, .85); color: #fff; font-size: 12.5px; text-align: center; pointer-events: none; }

/* Commandes de carte */
.mapctl { position: fixed; z-index: 25; right: calc(var(--right-w) + var(--gap) * 2); bottom: 18px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.ctl-btn { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; color: var(--text); }
.ctl-btn:hover, .ctl-btn.on { background: var(--accent-soft); color: var(--accent-text); }
.ctl-group { display: flex; flex-direction: column; border-radius: 12px; box-shadow: var(--shadow-sm); overflow: hidden; }
.ctl-group .ctl-btn { border-radius: 0; box-shadow: none; }
.ctl-group .ctl-btn + .ctl-btn { border-top: 1px solid var(--line); }
.dropdown.up .menu { top: auto; bottom: 0; right: calc(100% + 8px); }
#mapOptions.menu-pad { padding: 12px; width: 250px; }
.seg { display: flex; padding: 3px; border-radius: 10px; background: var(--surface-2); margin-bottom: 6px; }
.seg button { flex: 1; height: 32px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 13px; }
.seg button.on { background: var(--surface); box-shadow: var(--shadow-sm); font-weight: 600; }
.legend { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; }
.legend:empty { display: none; }
.legend > div { border-radius: 4px; padding: 2px 6px !important; }

/* Fenêtres */
.modal { position: fixed; inset: 0; z-index: 100; overflow-y: auto; background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); padding: 6vh 16px; }
.modal-box { position: relative; margin: 0 auto; width: 100%; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); animation: pop .18s ease-out; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-sm { max-width: 420px; }
.modal-md { max-width: 560px; }
.modal-lg { max-width: 940px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.modal-head h3 .ic { color: var(--accent); }
.modal-body { padding: 18px 22px; }
.modal-body h4 { font-size: 15px; margin: 8px 0 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px 18px; }
.modal-x { position: absolute; top: 12px; right: 12px; z-index: 2; }
.field { margin-bottom: 12px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field input { height: 42px; }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; font-size: 13px; padding: 6px; border-radius: 8px; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }
.check.invalid { background: var(--danger-soft); outline: 1px solid var(--danger); }
.form-error { color: var(--danger); font-size: 13px; margin-top: 10px; }
.form-error:empty { display: none; }
.form-ok { padding: 14px; border-radius: var(--radius-sm); background: #eafaf0; color: var(--ok); }
#connexion_div, #inscription_div { padding: 28px 26px 22px; }
.auth-head { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth-head .brand-mark { width: 48px; height: 48px; border-radius: 14px; }
.auth-head .brand-mark .ic { width: 28px; height: 28px; }
.auth-head h3 { font-size: 19px; }
.auth-switch { text-align: center; margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.prose { max-height: 70vh; overflow-y: auto; font-size: 13.5px; line-height: 1.65; }
.prose h3 { font-size: 15px; margin: 18px 0 6px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 24px; }

/* Mon compte */
.info-table { width: 100%; border-collapse: collapse; }
.info-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.info-table h5 { font-size: 14px; font-weight: 500; }
.info-table h5:empty::before { content: attr(placeholder); color: var(--muted); font-weight: 400; }
.info-table input { width: 100%; height: 34px; padding: 0 8px; border: 1px solid var(--accent); border-radius: 8px; }
.info-ic { width: 32px; color: var(--muted); }
.info-ic .ic { width: 18px; height: 18px; }
.info-edit { width: 40px; text-align: right; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.plan ul { list-style: none; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); height: 100%; display: flex; flex-direction: column; gap: 8px; }
.plan:has(.w3-blue) ul, .plan:not(.w3-section) ul { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.plan-name { font-weight: 700; font-size: 16px; }
.plan-pro .plan-name { color: var(--pro); }
.plan-premium .plan-name { color: var(--premium); }
.plan-price strong { font-size: 26px; font-weight: 700; margin-right: 4px; }
.plan-price span { color: var(--muted); font-size: 12px; }
.plan li.yes, .plan li.no { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.plan li .ic { width: 16px; height: 16px; margin-top: 2px; }
.plan li.yes .ic { color: var(--ok); }
.plan li.no { color: var(--muted); }
.plan-cta { margin-top: auto; padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.plan-current { text-align: center; padding: 8px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; font-size: 13px; }

/* Missions enregistrées (GetScenariosList.php) */
.scenario-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ScenarioVignette { position: relative; height: 200px; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.ScenarioVignette > img { width: 100%; height: 100% !important; max-height: none !important; object-fit: cover; left: 0 !important; transform: none !important; }
.ScenarioVignette > div:first-of-type { background: linear-gradient(rgba(255, 255, 255, .92), rgba(255, 255, 255, .7) 60%, transparent) !important; padding: 10px; text-align: left; }
.ScenarioVignette h3 { font-size: 15px; margin: 0 0 2px; }
.ScenarioVignette p { margin: 0; color: var(--muted); }
.ScenarioVignette > div:last-of-type { display: flex; gap: 6px; padding: 0 10px; }
.ScenarioVignette button { flex: 1; height: 34px; border: 0; border-radius: 9px; background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; font-size: 13px; }
.ScenarioVignette button.w3-red { color: var(--danger); }
.ScenarioVignette .glyphicon { display: none; }

.ScenarioVignette .sc-info { position: absolute; inset: 0 0 auto 0; padding: 10px 12px; background: linear-gradient(rgba(255, 255, 255, .95), rgba(255, 255, 255, .75) 70%, transparent); }
.ScenarioVignette .sc-date { font-size: 11.5px; }
.ScenarioVignette .sc-stats { font-size: 12px; color: var(--text); }
.ScenarioVignette .sc-actions { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; gap: 6px; }
.ScenarioVignette .sc-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.ScenarioVignette .sc-actions .ic { width: 15px; height: 15px; }
.ScenarioVignette .sc-actions button.danger { color: var(--danger); }
.ScenarioVignette > img { position: absolute; inset: 0; }

/* Tutoriel */
.modal-tuto { max-width: 860px; overflow: hidden; }
.tuto-step { display: none; grid-template-columns: 1.1fr 1fr; min-height: 380px; }
.tuto-step.on { display: grid; }
.tuto-art { background: linear-gradient(135deg, #eef0ff, #f6f8fb); display: flex; align-items: center; justify-content: center; padding: 24px; }
.tuto-art svg { width: 100%; max-width: 380px; height: auto; }
.tuto-text { padding: 36px 30px 20px; }
.tuto-count { margin: 0 0 8px; color: var(--accent); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.tuto-text h2 { display: flex; align-items: center; gap: 10px; font-size: 22px; margin-bottom: 12px; }
.tuto-ic { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.tuto-text > p { color: #334155; font-size: 14.5px; line-height: 1.6; }
.safety { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--warn-soft); font-size: 12.5px; }
.safety strong { display: flex; align-items: center; gap: 6px; color: var(--warn); }
.safety strong .ic { width: 16px; height: 16px; }
.safety ul { margin: 6px 0; padding-left: 18px; }
.safety small { color: var(--muted); }
.tuto-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line); }
.dots { display: flex; gap: 6px; }
.dot { width: 8px; height: 8px; border: 0; border-radius: 99px; background: #cbd5e1; cursor: pointer; padding: 0; transition: width .2s, background .2s; }
.dot.on { width: 22px; background: var(--accent); }
.tuto-buttons { display: flex; gap: 8px; }
.tuto-more { text-align: center; margin: 0; padding: 0 0 14px; font-size: 13px; }
.tuto-more a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.tuto-more .ic { width: 16px; height: 16px; }

/* Notifications, chargement */
.toast { position: fixed; z-index: 200; left: 50%; bottom: 96px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; max-width: min(560px, calc(100vw - 32px)); padding: 12px 14px 12px 18px; border-radius: var(--radius); background: #0f172a; color: #fff; box-shadow: var(--shadow); font-size: 13px; }
.toast p { margin: 0; }
.toast-msg { bottom: 150px; }
.toast-warn { background: var(--warn); }
#Waiting { position: fixed; inset: 0; z-index: 150; background: rgba(255, 255, 255, .35); display: flex; align-items: center; justify-content: center; }
#Waiting[style*="display: none"] { display: none !important; }
.spinner { width: 40px; height: 40px; border: 4px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 20px auto; }
.spinner-sm { width: 20px; height: 20px; border-width: 3px; margin: 6px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after { content: ''; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border: 3px solid currentColor; border-color: var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }

/* Tablette */
@media (max-width: 1100px) {
  :root { --right-w: 330px; --left-w: 260px; }
  .dock-btn span { display: none; }
  .dock-btn { min-width: 48px; height: 48px; }
}

/* Mobile : panneau de mission en bas */
@media (max-width: 760px) {
  :root { --gap: 8px; --top: 64px; }
  .brand { padding: 0 6px; }
  .brand-text, .hide-sm { display: none !important; }
  .topbar { height: 46px; }
  .search { max-width: none; }
  #pac-input, .brand, .top-actions { height: 46px; }
  .search .search-ic { top: 13px; }
  .panel-left { left: var(--gap); right: var(--gap); width: auto; max-height: 30vh; }
  .panel-left .card { padding: 10px 12px; }
  #MainInfos .hint { display: none; }
  body.has-results #MainInfos { display: none !important; }
  .panel-right { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: var(--sheet-h); border-radius: 20px 20px 0 0; transition: height .25s; }
  .panel-right.expanded { height: 82vh; }
  .sheet-handle { display: flex; justify-content: center; padding: 8px 0 0; cursor: pointer; }
  .sheet-handle span { width: 40px; height: 4px; border-radius: 99px; background: #cbd5e1; }
  .mission-head { padding-top: 4px; }
  .dock { left: 50%; bottom: calc(var(--sheet-h) + 10px); padding: 4px; }
  .draw-hint { left: 50%; top: auto; bottom: calc(var(--sheet-h) + 76px); }
  .mapctl { right: var(--gap); bottom: calc(var(--sheet-h) + 10px); }
  .mapctl .ctl-group { display: none; }
  .maplibregl-ctrl-bottom-right { display: none; }
  .modal { padding: 0; }
  .modal-box { border-radius: 0; min-height: 100%; }
  .tuto-step.on { grid-template-columns: 1fr; min-height: 0; }
  .tuto-art { padding: 14px; }
  .tuto-art svg { max-height: 170px; }
  .tuto-text { padding: 18px 20px 8px; }
  .plans { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .toast { bottom: calc(var(--sheet-h) + 80px); }
  .panel-left .card-head { margin-bottom: 6px; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 6px; }
  .stats > div { padding: 6px; }
  .stats small { font-size: 10px; }
  .stats strong { font-size: 12.5px; }
  .kmz-row { padding: 8px 10px; grid-template-columns: 32px 1fr; }
  .kmz-ic { width: 32px; height: 32px; }
  .kmz-stats, .panel-left .link-small { display: none; }
}

/* Mes missions : bouton mis en avant dans la barre du haut */
.btn-missions { height: 38px; margin: 0 4px; padding: 0 14px; border: 0; background: #fbbf24; color: #3b2300; font-weight: 600; box-shadow: 0 1px 0 rgba(0, 0, 0, .06); }
.btn-missions:hover { background: #f59e0b; }
.btn-missions .ic { width: 19px; height: 19px; }
@media (max-width: 480px) { .hide-xs { display: none !important; } .btn-missions { padding: 0 10px; } }

/* Connexion Google */
.btn-google { height: 44px; border: 1px solid var(--line); background: #fff; color: #1f1f1f; font-weight: 600; margin-bottom: 4px; }
.btn-google:hover { background: #f7f8fa; }
.btn-google .ic { width: 20px; height: 20px; }
.or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: 12.5px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.hint.center { text-align: center; margin: 0 0 4px; }

/* Guide ouvert dans une grande fenêtre */
#GuideModal { padding: 3vh 16px; }
.modal-guide { max-width: 1000px; height: 94vh; display: flex; flex-direction: column; overflow: hidden; }
.guide-bar { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
#GuideModalFrame { flex: 1; width: 100%; border: 0; background: #fff; }
@media (max-width: 760px) { #GuideModal { padding: 0; } .modal-guide { height: 100%; max-width: none; border-radius: 0; } }
.pay-waiver { margin: 14px 0 12px; font-size: 13px; line-height: 1.45; }
@media (max-width: 1100px) { .brand-text { display: none; } .brand { padding-right: 8px; } }

/* Fenêtres ouvertes par-dessus une autre : paiement (depuis Mon compte), puis CGV (depuis le paiement ou l'inscription) */
#PaymentModal { z-index: 110; }
#conditions_GV { z-index: 120; }
