/* 11m-franco.org — feuille de style (aucun style inline : compatible CSP style-src 'self') */

:root {
    --accent: #27ae60;
    --accent-d: #1e8449;
    --bg-dark: #2c3e50;
    --tab-bg: #34495e;
    --clock-bg: #1a252f;
    --body-bg: #eeeeee;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --muted: #6c7a89;
    --border: #dddddd;
    --input-bg: #ffffff;
    --input-text: #2c3e50;
    --modal-bg: #ffffff;
    --soft: #f4f6f7;
    --danger: #e74c3c;
    --warn: #f1c40f;
    --orange: #e67e22;
    --sidebar-w: 350px;
    color-scheme: light;
}
body.dark-mode {
    --body-bg: #121212;
    --card-bg: #1e1e1e;
    --text: #e0e0e0;
    --muted: #9aa5ad;
    --border: #333333;
    --tab-bg: #000000;
    --clock-bg: #000000;
    --input-bg: #2a2a2a;
    --input-text: #e8e8e8;
    --modal-bg: #1e1e1e;
    --soft: #262626;
    color-scheme: dark;
}
/* Sombre : on n'inverse que les tuiles (les marqueurs gardent leurs vraies couleurs) */
body.dark-mode .leaflet-tile-pane { filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%); }

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; z-index: 10000; background: var(--accent); color: #fff; padding: 8px 12px; }
.skip-link:focus { left: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.accent { color: var(--accent); }
.center-text { text-align: center; }
.hp { position: absolute; left: -9999px; }
.noscript { padding: 20px; background: #fff3cd; color: #333; }

body {
    background: var(--body-bg);
    color: var(--text);
    display: flex;
    flex-direction: row;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- structure ---------- */
#sidebar {
    width: var(--sidebar-w);
    background: var(--bg-dark);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    order: 1;
    min-height: 0;
}
#map-container { flex: 1; position: relative; z-index: 1; order: 2; min-width: 0; }
#map { height: 100%; width: 100%; }

/* ---------- en-tête ---------- */
.header { padding: 10px 12px; background: var(--clock-bg); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.app-title { font-size: 1rem; font-weight: 700; color: #fff; letter-spacing: 0.5px; }
.clock { font-family: ui-monospace, Consolas, monospace; font-size: 1.1em; color: var(--accent); }
.chat-trigger {
    position: relative; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border: 1.5px solid var(--accent); border-radius: 50%; background: transparent; color: var(--accent);
    font-size: 15px; transition: transform 0.15s, background 0.15s;
}
.chat-trigger:hover { background: var(--accent); color: #fff; transform: scale(1.08); }
.badge {
    position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
    background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* ---------- sélecteur de bandes ---------- */
.band-layer {
    position: absolute; top: 12px; right: 12px; z-index: 1000; background: rgba(33, 47, 61, 0.95);
    padding: 8px; border-radius: 10px; display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 70px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}
.b-chip {
    padding: 6px 10px; min-height: 30px; background: #455a64; border-radius: 6px; font-size: 12px; font-weight: 700; cursor: pointer;
    color: #fff; border: 1px solid transparent; text-align: center;
}
.b-chip:hover { background: #5b7480; }
.b-chip.active { background: var(--accent); border-color: #fff; }
.offline { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 1000; background: #c0392b; color: #fff; padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.4); }

/* ---------- formulaire ---------- */
.form-wrap { background: var(--tab-bg); flex: none; }
.form-wrap > summary { padding: 9px 12px; cursor: pointer; font-weight: 700; font-size: 13px; color: #fff; background: var(--tab-bg); user-select: none; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.form-wrap:not([open]) > summary { border-bottom: none; }
.form-container { padding: 10px 12px 12px; background: var(--tab-bg); overflow-y: auto; max-height: 52vh; }
.loc-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.loc-status { flex: 1; font-size: 11px; font-weight: 700; text-align: center; color: var(--warn); }
.loc-status.ok { color: #58d68d; }
.row { display: flex; gap: 6px; margin-bottom: 8px; align-items: stretch; }
.row.center { align-items: center; }
.row > * { flex: 1; min-width: 0; margin-bottom: 0; }
.inline-label { flex: none !important; font-size: 12px; color: #b4c0c8; white-space: nowrap; }
input[type="text"], input[type="number"], input[type="password"], select, textarea {
    width: 100%; margin-bottom: 8px; padding: 8px; border-radius: 4px; border: 1px solid #bdc3c7;
    background: var(--input-bg); color: var(--input-text); min-height: 36px;
}
.row input, .row select { margin-bottom: 0; }
textarea { resize: vertical; }
input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--accent); }
.check-box {
    display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 6px 8px;
    background: rgba(39, 174, 96, 0.12); border-radius: 5px; border: 1px solid rgba(39, 174, 96, 0.3);
}
.check-box label { color: #f1c40f; font-size: 13px; cursor: pointer; font-weight: 700; user-select: none; }
.check-box .muted { color: #b4c0c8; font-weight: 400; }
.btn-send, .btn-primary {
    width: 100%; padding: 10px; background: var(--accent); color: #fff; border: none; border-radius: 4px; font-weight: 700; cursor: pointer; min-height: 40px;
}
.btn-send:hover:not(:disabled), .btn-primary:hover:not(:disabled) { background: var(--accent-d); }
.btn-send:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { width: auto; padding: 10px 18px; }
.btn-cancel { width: 100%; padding: 8px; background: var(--danger); color: #fff; border: none; border-radius: 4px; font-size: 12px; cursor: pointer; margin-top: 6px; }
.btn-mini {
    padding: 6px 10px; background: rgba(255, 255, 255, 0.12); color: inherit; border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 5px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; min-height: 32px;
}
.modal-card .btn-mini { background: var(--soft); border-color: var(--border); color: var(--text); }
.btn-mini:hover { border-color: var(--accent); color: var(--accent); }
.form-msg { margin-bottom: 8px; padding: 6px 8px; border-radius: 4px; background: rgba(231, 76, 60, 0.15); color: #ff9c92; font-size: 12px; font-weight: 600; }
.form-msg.ok { background: rgba(39, 174, 96, 0.15); color: #58d68d; }
.modal-card .form-msg { color: var(--danger); }
.modal-card .form-msg.ok { color: var(--accent-d); }

/* ---------- filtres ---------- */
.filters { background: var(--clock-bg); border-top: 1px solid #000; font-size: 12px; }
.filters summary { padding: 8px 12px; cursor: pointer; color: #b4c0c8; font-weight: 700; user-select: none; }
.filters[open] summary { color: #fff; }
.filter-grid { padding: 0 12px 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.filter-grid input, .filter-grid select { margin-bottom: 0; }
.filter-grid #f-dist { grid-column: 1 / 3; }
.filter-actions { grid-column: 1 / 3; display: flex; gap: 6px; }
.filter-actions .btn-mini { flex: 1; }

/* ---------- onglets ---------- */
.tabs { display: flex; background: var(--clock-bg); position: sticky; top: 0; z-index: 1001; }
.tab-btn { flex: 1; padding: 12px; border: none; background: none; color: #aab7bf; cursor: pointer; font-weight: 700; border-bottom: 3px solid transparent; }
.tab-btn.active { color: #fff; border-bottom-color: var(--accent); }
.tab-btn.tab-icon { flex: none; width: 52px; }

/* ---------- cartes de spots ---------- */
[data-type="Fixe"], .mk-Fixe { --tc: #3498db; }
[data-type="Portable"], .mk-Portable { --tc: #f1c40f; }
[data-type="Mobile"], .mk-Mobile { --tc: #9b59b6; }
[data-type="POTA"], .mk-POTA { --tc: #27ae60; }
[data-type="SOTA"], .mk-SOTA { --tc: #e67e22; }
[data-band="11m"]   { --bc: #27ae60; }
[data-band="10m"]   { --bc: #e74c3c; }
[data-band="12m"]   { --bc: #c0392b; }
[data-band="pmr"]   { --bc: #e67e22; }
[data-band="vband"] { --bc: #7f8c8d; }
[data-band="hf"]    { --bc: #6c7a89; }

.content { flex: 1; overflow-y: auto; padding: 10px; background: var(--body-bg); color: var(--text); min-height: 120px; }
.empty { text-align: center; color: var(--muted); padding: 24px 8px; font-size: 14px; }
.st-card {
    background: var(--card-bg); color: var(--text); padding: 12px; border-radius: 8px; margin-bottom: 10px;
    border: 1px solid var(--border); border-left: 6px solid var(--tc, #888); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); cursor: pointer;
}
.st-card.selected { outline: 2px solid var(--orange); }
.st-card.mine { background: linear-gradient(0deg, rgba(231, 76, 60, 0.05), rgba(231, 76, 60, 0.05)), var(--card-bg); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.card-id { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.dx-call { font-weight: 700; color: var(--accent); font-size: 1.3em; word-break: break-all; }
.fav-btn { background: none; border: none; cursor: pointer; font-size: 17px; line-height: 1; color: var(--muted); padding: 2px 4px; }
.fav-btn.on { color: #f39c12; }
.dx-freq { color: var(--orange); font-weight: 700; font-size: 1.35em; }
.band-badge { background: var(--bc, #888); color: #fff; padding: 2px 6px; border-radius: 4px; font-size: 0.8em; font-weight: 700; }
.timer { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--soft); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border); white-space: nowrap; }
.timer.urgent { color: var(--danger); border-color: var(--danger); }
.geo { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 6px 0; align-items: center; background: rgba(39, 174, 96, 0.07); padding: 4px 8px; border-radius: 4px; font-size: 13px; font-weight: 700; }
.geo .d { color: var(--accent); }
.geo .b { color: var(--orange); }
.geo .lp { color: var(--muted); font-weight: 600; font-size: 12px; }
.geo .arrow { display: inline-block; }
.mine-tag { display: inline-block; color: var(--danger); font-size: 12px; font-weight: 700; margin: 6px 0; padding: 4px 8px; background: rgba(231, 76, 60, 0.1); border-radius: 4px; }
.card-mode { font-weight: 700; font-size: 13px; color: var(--text); margin-bottom: 2px; }
.card-msg { font-size: 13px; line-height: 1.4; margin-bottom: 4px; word-break: break-word; }
.card-meta { font-size: 10px; opacity: 0.7; text-transform: uppercase; }
.tglyph { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin-right: 3px; }
.tglyph path, .tglyph circle { fill: var(--tc, #888); stroke: rgba(0, 0, 0, 0.35); stroke-width: 1.5; }
.actions { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 12px; border-top: 1px solid var(--border); padding-top: 8px; }
.act { background: none; border: none; padding: 4px 0; cursor: pointer; font-size: 12px; font-weight: 700; text-decoration: underline; color: var(--accent); }
.act.warn { color: var(--orange); }
.act.grey { color: var(--muted); }
.act.danger { color: var(--danger); }
.act.urgent { color: var(--danger); }
.qsy-form { display: flex; gap: 6px; margin-top: 8px; }
.qsy-form input { margin: 0; min-height: 32px; }
.qsy-form .btn-mini { background: var(--soft); border-color: var(--border); color: var(--text); }
.comment-area { margin-top: 10px; background: var(--soft); padding: 8px; border-radius: 6px; border: 1px solid var(--border); cursor: default; }
.cmt { font-size: 12px; margin-bottom: 3px; padding-left: 6px; border-left: 2px solid var(--accent); word-break: break-word; }
.comment-input { display: flex; gap: 6px; margin-top: 6px; }
.comment-input input { margin: 0; font-size: 12px; min-height: 32px; padding: 5px; }
.comment-input button { background: var(--accent); color: #fff; border: none; padding: 0 12px; border-radius: 4px; cursor: pointer; font-size: 11px; font-weight: 700; }

.side-footer { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding: 8px 12px; background: var(--clock-bg); font-size: 11px; }
.link-btn { background: none; border: none; color: #aab7bf; cursor: pointer; text-decoration: underline; font-size: 11px; padding: 4px 0; }
.link-btn:hover { color: #fff; }
.side-footer .copy { width: 100%; color: #7f8c8d; }

/* ---------- marqueurs Leaflet ---------- */
.mk { background: none; border: none; }
.mk svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55)); }
.mk path, .mk circle { fill: var(--tc, #888); stroke: #fff; stroke-width: 2; }
.mk.mine svg { filter: drop-shadow(0 0 5px #e74c3c) drop-shadow(0 0 1px #e74c3c); }
.mk .star { position: absolute; right: -4px; top: -9px; font-size: 13px; color: #f39c12; text-shadow: 0 0 2px #000; line-height: 1; }
.mk.selected svg { transform: scale(1.3); transform-origin: center; }
.me-dot { background: none; border: none; }
.me-dot span { display: block; width: 18px; height: 18px; border-radius: 50%; background: var(--danger); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--danger), 0 1px 5px rgba(0, 0, 0, 0.5); }

/* contrôles Leaflet personnalisés */
.map-ctl a { cursor: pointer; font-size: 17px; font-weight: 700; text-align: center; color: #333; }
.tools-wrap { position: relative; }
.tools-menu {
    position: absolute; top: 0; left: 40px; min-width: 210px; background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 8px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3); z-index: 2000; padding: 4px; text-align: left;
}
.tools-menu a, .tools-menu button {
    display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; text-align: left; background: none; border: none;
    color: var(--text); font-size: 13px; text-decoration: none; font-weight: 600; cursor: pointer; border-radius: 5px; min-height: 36px;
}
.tools-menu a:hover, .tools-menu button:hover { background: var(--soft); color: var(--accent); }
.tools-menu hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.tools-menu [aria-pressed="true"]::after { content: '✓'; margin-left: auto; color: var(--accent); font-weight: 700; }
.leaflet-popup-content { color: #2c3e50; min-width: 160px; }
.pop { text-align: center; }
.pop .pcall { font-size: 1.25em; font-weight: 700; color: #2c3e50; }
.pop .pline { margin: 2px 0; font-size: 13px; }
.pop .pfreq { font-weight: 700; color: var(--accent-d); }
.pop .pgeo { margin-top: 6px; padding-top: 6px; border-top: 1px solid #eee; font-size: 13px; }
.pop .pgeo b { color: #e67e22; }
.pop .plink { margin-top: 6px; background: var(--accent); color: #fff; border: none; border-radius: 4px; padding: 5px 10px; cursor: pointer; font-size: 12px; font-weight: 700; }

/* ---------- modales ---------- */
.modal { position: fixed; inset: 0; z-index: 9999; background: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: center; padding: 12px; }
.modal-card {
    background: var(--modal-bg); color: var(--text); width: 100%; max-width: 560px; max-height: 90vh; max-height: 90dvh; overflow-y: auto;
    border-radius: 14px; padding: 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.modal-card input[type="text"], .modal-card input[type="number"], .modal-card input[type="password"], .modal-card select, .modal-card textarea { border-color: var(--border); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; position: sticky; top: -20px; background: var(--modal-bg); padding: 4px 0; z-index: 2; }
.modal-head h2 { font-size: 1.2rem; color: var(--accent); text-transform: uppercase; }
.modal-close { background: none; border: none; font-size: 30px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 6px; }
.modal-close:hover { color: var(--danger); }
.chat-card { height: 80vh; height: 80dvh; display: flex; flex-direction: column; }
.chat-box { flex: 1; overflow-y: auto; background: var(--soft); border: 1px solid var(--border); padding: 10px; border-radius: 8px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.chat-msg { background: var(--card-bg); padding: 8px; border-radius: 6px; border-left: 5px solid var(--uc, var(--accent)); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }
.chat-msg .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; gap: 6px; }
.chat-msg .who { color: var(--uc, var(--accent)); font-size: 13px; font-weight: 700; }
.chat-msg .when { color: var(--muted); font-size: 10px; font-family: ui-monospace, monospace; background: var(--soft); padding: 2px 5px; border-radius: 3px; }
.chat-msg .txt { font-size: 13px; word-wrap: break-word; overflow-wrap: anywhere; line-height: 1.4; }
.chat-msg .flag { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; opacity: 0.55; padding: 0 2px; }
.chat-msg .flag:hover { opacity: 1; color: var(--danger); }
.chat-form { display: flex; gap: 6px; }
.chat-form input { margin: 0; }
.chat-form .chat-call { flex: 0 0 110px; text-transform: uppercase; }
.chat-hint { margin-top: 8px; font-size: 11px; }
.intro-box { background: rgba(52, 152, 219, 0.12); padding: 12px; border-left: 4px solid #3498db; font-size: 0.9rem; margin: 12px 0; border-radius: 4px; }
.help-section { margin-bottom: 8px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; font-size: 0.88rem; }
.help-section summary { padding: 12px 14px; cursor: pointer; font-weight: 700; background: var(--soft); }
.help-section > div, .help-section > button { margin: 12px 14px; }
.help-section p { margin-bottom: 8px; line-height: 1.45; }
.help-section code, .prose code { background: var(--soft); padding: 1px 5px; border-radius: 3px; }
.help-ok { margin-top: 14px; }
.help-footer { text-align: center; margin-top: 16px; font-size: 0.7rem; color: var(--muted); }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.legend-item svg { width: 22px; height: 22px; flex: none; }
.legend-item path, .legend-item circle { fill: var(--tc); stroke: #fff; stroke-width: 2; }
.legend-item .me { width: 16px; height: 16px; border-radius: 50%; background: var(--danger); border: 3px solid #fff; box-shadow: 0 0 0 1px #999; flex: none; }
.btn-play-pulse {
    display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; font-size: 14px; font-weight: 700; color: #fff;
    background: var(--accent); border: none; border-radius: 50px; cursor: pointer; animation: pulse 2s infinite;
}
.btn-play-pulse:hover { background: var(--accent-d); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(39, 174, 96, 0); } 100% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0); } }
@media (prefers-reduced-motion: reduce) { .btn-play-pulse { animation: none; } * { transition: none !important; } }
.prose p { margin-bottom: 10px; line-height: 1.5; font-size: 0.9rem; }

/* réglages */
.set-group { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.set-group legend { padding: 0 6px; font-weight: 700; color: var(--accent); font-size: 0.9rem; }
.set-line { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.set-line.wrap { flex-wrap: wrap; gap: 6px 14px; }
.set-line select, .set-line input[type="number"] { width: auto; max-width: 140px; margin: 0 0 0 auto; }
.fav-list { list-style: none; margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.fav-list li { display: inline-flex; align-items: center; gap: 4px; background: var(--soft); border: 1px solid var(--border); border-radius: 14px; padding: 2px 4px 2px 10px; font-weight: 700; font-size: 12px; }
.fav-list button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 0 4px; }

/* stats */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.kpi { background: var(--soft); border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.kpi b { display: block; font-size: 1.6rem; color: var(--accent); line-height: 1.1; }
.kpi span { font-size: 11px; color: var(--muted); }
.stats-body h3 { font-size: 0.85rem; margin: 14px 0 6px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.bars { display: grid; grid-template-columns: 70px 1fr 34px; gap: 4px 8px; align-items: center; font-size: 12px; }
.bar-track { background: var(--soft); border-radius: 4px; height: 12px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 4px; }
.hours { width: 100%; height: 90px; }
.hours .hb { fill: var(--accent); }
.hours .hb.now { fill: var(--orange); }
.hours text { fill: var(--muted); font-size: 8px; }
.top-list { margin-left: 18px; font-size: 13px; }

/* toasts */
.toasts { position: fixed; z-index: 20000; right: 12px; bottom: 34px; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 24px)); }
.toast { background: #2c3e50; color: #fff; border-left: 5px solid var(--accent); padding: 10px 12px; border-radius: 6px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4); font-size: 13px; display: flex; gap: 10px; align-items: center; }
.toast.warn { border-left-color: var(--orange); }
.toast.err { border-left-color: var(--danger); }
.toast .msg { flex: 1; line-height: 1.35; }
.toast button { background: rgba(255, 255, 255, 0.15); color: #fff; border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 4px; padding: 4px 8px; cursor: pointer; font-size: 12px; font-weight: 700; }

/* ---------- mobile (≤768px) : carte plein écran + panneau coulissant (bottom sheet) ---------- */
.sheet-handle { display: none; }
.mobile-only { display: none; }
@media (max-width: 768px) {
    :root { --sheet-min: 58px; }
    body { display: block; overflow: hidden; height: 100dvh; }
    #map-container { position: fixed; inset: 0 0 var(--sheet-min) 0; width: auto; height: auto; z-index: 1; }
    #sidebar {
        position: fixed; left: 0; right: 0; bottom: 0; width: auto; z-index: 1000;
        height: 52dvh; border-radius: 16px 16px 0 0; box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.45);
        transition: height 0.22s ease; overflow: hidden; padding-bottom: env(safe-area-inset-bottom);
    }
    body[data-sheet="min"] #sidebar { height: calc(var(--sheet-min) + env(safe-area-inset-bottom)); }
    body[data-sheet="max"] #sidebar { height: 92dvh; }
    .sheet-handle {
        display: block; flex: none; width: 100%; height: 28px; background: transparent; border: none; cursor: pointer; position: relative; padding: 0;
    }
    .sheet-handle::before { content: ''; position: absolute; left: 50%; top: 11px; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: rgba(255, 255, 255, 0.45); }
    .header { padding-top: 0; min-height: 38px; }
    .sheet-handle, .header { touch-action: none; user-select: none; -webkit-user-select: none; }
    .form-container { max-height: none; overflow: visible; }
    #sidebar .content, #sidebar .form-wrap[open] { }
    #sidebar { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
    .content { overflow: visible; flex: none; }
    /* chips en haut de la carte, à droite des boutons Leaflet */
    .band-layer { top: 8px; bottom: auto; left: 54px; right: 8px; max-width: none; flex-wrap: nowrap; overflow-x: auto; padding: 6px; -webkit-overflow-scrolling: touch; }
    .band-layer { gap: 4px; }
    .b-chip { flex: 1 0 auto; min-height: 40px; padding: 6px 7px; font-size: 12px; }
    .offline { bottom: 10px; }
    .leaflet-control-zoom a, .map-ctl a { width: 40px !important; height: 40px !important; line-height: 40px !important; }
    .tools-menu { left: 46px; right: auto; top: 0; max-width: calc(100vw - 110px); }
    .tools-menu a, .tools-menu button { min-height: 44px; font-size: 14px; }
    .legend { grid-template-columns: 1fr; }
    .toasts { top: 62px; bottom: auto; left: 56px; right: 8px; max-width: none; }
    .mobile-only { display: inline-block; }
    .loc-row { flex-wrap: wrap; }
    .loc-row .loc-status { flex: 1 1 100%; text-align: center; }
    .loc-row .btn-mini { flex: 1 1 0; }
    .modal { padding: 0; align-items: flex-end; }
    .modal-card { max-width: none; max-height: 94dvh; border-radius: 16px 16px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
    .modal-head { top: -16px; }
    .modal-close { font-size: 34px; min-width: 44px; min-height: 44px; }
    .chat-card { height: 94dvh; }
    .chat-form { flex-wrap: wrap; }
    .chat-form .chat-call { flex: 1 1 100%; }
    .chat-form input[type="text"]:not(.chat-call) { flex: 1 1 0; min-width: 0; }
    input, select, textarea { font-size: 16px; }          /* évite le zoom automatique iOS */
    .btn-mini, .tab-btn, .b-chip, summary { min-height: 44px; }
}
@media (max-width: 768px) and (max-height: 480px) { body[data-sheet="mid"] #sidebar { height: 70dvh; } }
