:root {
  --bg: #0b1020;
  --glass: rgba(15, 21, 38, .82);
  --glass-strong: rgba(15, 21, 38, .94);
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --fg: #e8ecf5;
  --muted: #8d97ad;
  --accent: #4f8cff;
  --accent-2: #22d3ee;
  --chip: rgba(255, 255, 255, .05);
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, .45);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
#map { position: fixed; inset: 0; background: #0b1020; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
button { font: inherit; color: inherit; }

.glass { background: var(--glass); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border: 1px solid var(--line); box-shadow: var(--shadow); }

/* Panneau */
#panel { position: fixed; top: 16px; left: 16px; bottom: 16px; width: 372px; border-radius: 18px; z-index: 1000; display: flex; flex-direction: column; overflow: hidden; transition: transform .35s cubic-bezier(.2,.8,.2,1); }
#panel.collapsed { transform: translateX(calc(-100% - 24px)); opacity: 0; pointer-events: none; }

/* Barre d'icônes (panneau replié) */
.rail { position: fixed; top: 16px; left: 16px; z-index: 1000; width: 60px; padding: 8px; border-radius: 18px; display: flex; flex-direction: column; align-items: center; gap: 4px; opacity: 0; transform: translateX(-16px); pointer-events: none; transition: opacity .3s .1s, transform .3s .1s; }
body.collapsed .rail { opacity: 1; transform: none; pointer-events: auto; }
.rail-btn { position: relative; width: 44px; height: 44px; border: 0; border-radius: 12px; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: .2s; }
.rail-btn:hover { background: rgba(255,255,255,.08); color: var(--fg); }
.rail-btn.on { background: rgba(79,140,255,.18); color: var(--accent); }
.rail-logo { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 18px rgba(79,140,255,.45); }
.rail-logo:hover { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); filter: brightness(1.1); }
.rail-sep { width: 28px; height: 1px; background: var(--line-strong); margin: 6px 0; }
.rail-btn::after { content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translate(-6px, -50%); white-space: nowrap; padding: 6px 10px; border-radius: 8px; background: var(--glass-strong); border: 1px solid var(--line-strong); color: var(--fg); font-size: 12.5px; font-weight: 600; opacity: 0; pointer-events: none; transition: .15s; box-shadow: var(--shadow); }
.rail-btn:hover::after { opacity: 1; transform: translate(0, -50%); }
body.collapsed .leaflet-control-container .leaflet-left { left: 88px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; }
.brand h1 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.brand p { margin: 1px 0 0; color: var(--muted); font-size: 12.5px; }
.brand #collapse { margin-left: auto; }
.logo { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 18px rgba(79,140,255,.45); flex: none; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 18px 14px; }
.kpi { background: var(--chip); border: 1px solid var(--line); border-radius: 12px; padding: 10px 10px 8px; }
.kpi-val { display: block; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi-lbl { font-size: 11px; color: var(--muted); }

.tabs { display: flex; gap: 4px; margin: 0 18px; padding: 4px; background: rgba(0,0,0,.25); border-radius: 11px; }
.tab { flex: 1; border: 0; background: none; padding: 8px 0; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; transition: .2s; }
.tab.active { background: rgba(255,255,255,.09); color: var(--fg); }
.tab:hover:not(.active) { color: var(--fg); }

.tab-body { flex: 1; overflow-y: auto; padding: 6px 18px 18px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.pane { display: none; animation: fade .25s ease; }
.pane.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
h2 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 20px 0 10px; }

.search { position: relative; margin-top: 14px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; padding: 11px 12px 11px 36px; background: rgba(0,0,0,.28); border: 1px solid var(--line); border-radius: 11px; color: var(--fg); font: inherit; outline: none; transition: .2s; }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,140,255,.2); }
.results { list-style: none; margin: 6px 0 0; padding: 0; max-height: 220px; overflow-y: auto; }
.results li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; font-size: 13px; }
.results li:hover { background: var(--chip); }
.results li small { margin-left: auto; color: var(--muted); }

.layer-list { display: grid; gap: 6px; }
.layer { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 11px; border: 1px solid var(--line); background: var(--chip); cursor: pointer; transition: .2s; user-select: none; }
.layer:hover { border-color: var(--line-strong); }
.layer.off { opacity: .45; }
.layer .sw { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; flex: none; }
.layer .name { font-weight: 500; }
.layer .count { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.layer .tgl { width: 30px; height: 18px; border-radius: 9px; background: rgba(255,255,255,.15); position: relative; flex: none; transition: .2s; }
.layer .tgl::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: .2s; }
.layer:not(.off) .tgl { background: var(--accent); }
.layer:not(.off) .tgl::after { left: 14px; }

.segmented { display: flex; padding: 4px; gap: 4px; background: rgba(0,0,0,.25); border-radius: 11px; }
.segmented button { flex: 1; border: 0; background: none; padding: 8px 0; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 12.5px; cursor: pointer; }
.segmented button.on { background: linear-gradient(135deg, var(--accent), #6d5dfc); color: #fff; }

.slider-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.slider-row input { flex: 1; accent-color: var(--accent); }
.slider-row output { min-width: 56px; text-align: right; color: var(--fg); font-variant-numeric: tabular-nums; }

.basemaps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bm { border: 2px solid transparent; border-radius: 11px; padding: 0; overflow: hidden; cursor: pointer; background: none; text-align: center; }
.bm span { display: block; height: 46px; background-size: cover; background-position: center; }
.bm em { display: block; font-style: normal; font-size: 11px; padding: 5px 0; color: var(--muted); background: var(--chip); }
.bm.on { border-color: var(--accent); }
.bm.on em { color: var(--fg); }

.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--chip); cursor: pointer; font-weight: 600; font-size: 13px; transition: .2s; }
.tool .ti { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: rgba(79,140,255,.15); color: var(--accent); font-size: 15px; }
.tool:hover { border-color: var(--line-strong); }
.tool.on { border-color: var(--accent); background: rgba(79,140,255,.12); }
.hint { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }

.card { margin-top: 14px; padding: 14px; border-radius: 13px; border: 1px solid var(--line); background: rgba(0,0,0,.22); }
.card-head { display: flex; align-items: center; }
.card-head .link { margin-left: auto; border: 0; background: none; color: var(--accent); cursor: pointer; font-size: 12.5px; }
.rows { display: grid; gap: 10px; margin-top: 12px; }
.prow { display: grid; grid-template-columns: 10px 1fr auto; gap: 4px 10px; align-items: center; font-size: 13px; }
.prow .dot { width: 10px; height: 10px; border-radius: 50%; }
.prow b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.prow b:hover { color: var(--accent); }
.prow .d { font-variant-numeric: tabular-nums; color: var(--fg); }
.prow small { grid-column: 2 / 4; color: var(--muted); }
.zone-meta { display: flex; gap: 16px; margin: 10px 0 4px; font-size: 12.5px; color: var(--muted); }
.zone-meta b { color: var(--fg); font-variant-numeric: tabular-nums; }
.measure-val { font-size: 28px; font-weight: 700; margin: 8px 0 0; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

.bars { display: grid; gap: 9px; margin-top: 10px; }
.bar { display: grid; grid-template-columns: 96px 1fr 44px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar .track { height: 8px; border-radius: 4px; background: rgba(255,255,255,.07); overflow: hidden; }
.bar .fill { height: 100%; border-radius: 4px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.bar .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 600; font-size: 13px; cursor: pointer; color: #fff; background: linear-gradient(135deg, var(--accent), #6d5dfc); }
.btn.ghost { background: var(--chip); border: 1px solid var(--line-strong); color: var(--fg); }
.source { color: var(--muted); font-size: 12px; margin: 0 0 6px; }

/* Outils carte */
.map-tools { position: fixed; top: 16px; right: 16px; z-index: 1000; border-radius: 14px; display: flex; flex-direction: column; padding: 5px; gap: 2px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 0; background: none; border-radius: 9px; cursor: pointer; color: var(--fg); font-size: 20px; line-height: 1; }
.icon-btn:hover { background: rgba(255,255,255,.08); }
.map-tools .sep { height: 1px; background: var(--line); margin: 3px 6px; }
#panel .icon-btn svg { transition: transform .3s; }

.legend { position: fixed; right: 16px; bottom: 44px; z-index: 1000; border-radius: 13px; padding: 12px 14px; min-width: 180px; font-size: 12.5px; }
.legend b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.legend .li { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.legend .li i { width: 10px; height: 10px; border-radius: 50%; }
.legend .ramp { height: 10px; border-radius: 5px; margin: 4px 0; }
.legend .ramp-lbl { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.coords { position: fixed; right: 16px; bottom: 12px; z-index: 1000; border-radius: 9px; padding: 4px 10px; font-size: 11.5px; color: var(--muted); }

/* Marqueurs */
.pin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.0), 0 2px 6px rgba(0,0,0,.5); transition: transform .15s; }
.pin:hover { transform: scale(1.35); }
.cluster { border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 0 5px rgba(255,255,255,.08), 0 6px 16px rgba(0,0,0,.5); transition: transform .15s; }
.cluster:hover { transform: scale(1.08); }
.cluster span { width: 68%; height: 68%; border-radius: 50%; background: #0f1526; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; }

/* Popups */
.leaflet-popup-content-wrapper { background: var(--glass-strong); color: var(--fg); border-radius: 14px; border: 1px solid var(--line-strong); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.leaflet-popup-tip { background: var(--glass-strong); }
.leaflet-popup-content { margin: 14px 16px; font: 13px/1.45 Inter, sans-serif; min-width: 220px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.pop-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; margin-bottom: 6px; }
.pop h3 { margin: 0 0 8px; font-size: 15px; }
.pop dl { display: grid; grid-template-columns: 70px 1fr; gap: 4px 8px; margin: 0 0 10px; font-size: 12.5px; }
.pop dt { color: var(--muted); }
.pop dd { margin: 0; }
.pop .acts { display: flex; gap: 6px; }
.pop .acts a, .pop .acts button { flex: 1; text-align: center; padding: 7px 0; border-radius: 8px; font-size: 12px; font-weight: 600; text-decoration: none; background: var(--chip); border: 1px solid var(--line-strong); color: var(--fg) !important; cursor: pointer; }
.leaflet-tooltip.measure-tip { background: var(--glass-strong); color: var(--fg); border: 1px solid var(--line-strong); border-radius: 8px; font: 600 12px Inter, sans-serif; box-shadow: var(--shadow); }
.leaflet-tooltip.measure-tip::before { display: none; }
.leaflet-control-attribution { background: rgba(11,16,32,.7) !important; color: var(--muted) !important; font-size: 10.5px; border-radius: 8px 0 0 0; }
.leaflet-control-attribution a { color: #9cb8ff !important; }
.leaflet-draw-tooltip { background: var(--glass-strong); border: 1px solid var(--line-strong); color: var(--fg); font-family: Inter, sans-serif; }
.leaflet-draw-tooltip::before { border-right-color: var(--glass-strong); }
.leaflet-control-container .leaflet-left { left: 404px; transition: left .35s; }

/* Chargement & toast */
.loader { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; background: rgba(11,16,32,.35); transition: opacity .4s; }
.loader.hidden { opacity: 0; pointer-events: none; }
.loader-card { display: flex; gap: 16px; align-items: center; padding: 18px 22px; border-radius: 16px; max-width: 420px; }
.loader-card p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--accent); animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 2100; padding: 10px 16px; border-radius: 10px; background: var(--glass-strong); border: 1px solid var(--line-strong); font-size: 13px; opacity: 0; transition: .3s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Mobile */
@media (max-width: 760px) {
  #panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: 52vh; }
  #panel.collapsed { transform: translateY(calc(100% + 16px)); }
  #collapse svg { transform: rotate(-90deg); }
  .rail { top: auto; bottom: 8px; left: 50%; width: auto; flex-direction: row; transform: translate(-50%, 16px); }
  body.collapsed .rail { transform: translateX(-50%); }
  .rail-sep { width: 1px; height: 28px; margin: 0 4px; }
  .rail-btn::after { display: none; }
  .rail { gap: 2px; padding: 6px; }
  .rail-btn { width: 38px; height: 38px; }
  body.collapsed .leaflet-control-container .leaflet-left { left: 0; }
  .map-tools { top: 8px; right: 8px; }
  .legend { display: none; }
  .coords { display: none; }
  .leaflet-control-container .leaflet-left { left: 0; }
}

/* Itinéraire */
.tool-wide { grid-column: 1 / -1; }
.segmented.small { margin-top: 12px; }
.segmented.small button { padding: 6px 0; font-size: 12px; }
.route-pts { margin: 12px 0 10px; display: grid; gap: 6px; position: relative; }
.rp { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid var(--line); font-size: 12.5px; min-width: 0; }
.rp i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 11px; color: #fff; flex: none; }
.rp span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn.sm { padding: 7px 10px; font-size: 12px; flex: 1; }
.route-sum { display: flex; align-items: baseline; gap: 10px; margin-top: 14px; }
.route-sum b { font-size: 26px; letter-spacing: -.02em; }
.route-sum span { color: var(--muted); font-size: 14px; }
.route-steps { list-style: none; margin: 10px 0 0; padding: 0; max-height: 260px; overflow-y: auto; border-top: 1px solid var(--line); }
.route-steps li { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 12.5px; cursor: pointer; }
.route-steps li:hover { background: rgba(255,255,255,.04); }
.route-steps .ri { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: rgba(79,140,255,.15); color: var(--accent); font-weight: 700; }
.route-steps small { color: var(--muted); white-space: nowrap; }
.route-pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 3px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,.45); display: grid; place-items: center; }
.route-pin span { transform: rotate(45deg); color: #fff; font: 700 12px Inter, sans-serif; }

/* Couverture */
.field { display: grid; gap: 6px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.field select { padding: 9px 10px; border-radius: 10px; background: rgba(0,0,0,.3); color: var(--fg); border: 1px solid var(--line-strong); font: inherit; }
.cov-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.cov-kpis div { background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; }
.cov-kpis b { display: block; font-size: 17px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.cov-kpis span { font-size: 11px; color: var(--muted); }
.cov-bar { height: 8px; border-radius: 4px; background: #ef4444; margin-top: 12px; overflow: hidden; }
.cov-bar i { display: block; height: 100%; background: #22c55e; }
.legend-sep { height: 1px; background: var(--line-strong); margin: 10px 0; }
.legend .li i.sq { border-radius: 3px; }

/* Arrondissements */
.dtable { font-size: 12.5px; }
.dt-head, .dt-row { display: grid; grid-template-columns: 1fr 52px 52px; gap: 8px; align-items: center; padding: 6px 4px; }
.dt-head { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.dt-head span:not(:first-child), .dt-row span:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.dt-row { border-top: 1px solid var(--line); cursor: pointer; border-radius: 6px; }
.dt-row:hover { background: rgba(255,255,255,.05); }
.dt-name { position: relative; padding-bottom: 5px; }
.dt-name i { position: absolute; left: 0; bottom: 0; height: 3px; border-radius: 2px; background: var(--accent); opacity: .7; }
[dir=rtl] .dt-name i { left: auto; right: 0; }
.dist-label { text-align: center; pointer-events: none; }
.dist-label span { display: block; font: 600 11px Inter, sans-serif; color: #111827; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; white-space: nowrap; }
.dist-label b { font: 700 12px Inter, sans-serif; color: #1e1b4b; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }

/* Boutons actifs */
.btn.ghost.on { border-color: var(--accent); color: var(--accent); }

/* Comparaison */
.swipe { position: absolute; inset: 0; z-index: 650; pointer-events: none; }
.swipe input { position: absolute; left: 0; right: 0; top: 50%; width: 100%; margin: 0; transform: translateY(-50%); appearance: none; -webkit-appearance: none; background: transparent; pointer-events: none; height: 0; }
.swipe input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 40px; height: 40px; border-radius: 50%; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%230b1020' d='M8 7 3 12l5 5V7Zm8 0v10l5-5-5-5Z'/%3E%3C/svg%3E") center/22px no-repeat; box-shadow: 0 4px 14px rgba(0,0,0,.45); cursor: ew-resize; }
.swipe input::-moz-range-thumb { pointer-events: auto; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.45); cursor: ew-resize; }
.swipe-line { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 8px rgba(0,0,0,.4); }
.swipe-tag { position: absolute; top: 76px; padding: 4px 10px; border-radius: 999px; background: rgba(11,16,32,.8); color: #fff; font-size: 12px; font-weight: 600; }
.swipe-tag.l { left: 420px; }
.swipe-tag.r { right: 70px; }
body.collapsed .swipe-tag.l { left: 96px; }

/* Méthodologie */
.modal { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; background: rgba(5,8,18,.6); padding: 16px; }
.modal[hidden] { display: none; }
.modal-card { position: relative; max-width: 640px; width: 100%; max-height: 85vh; overflow-y: auto; border-radius: 18px; padding: 26px 28px; }
.modal-close { position: absolute; top: 12px; right: 12px; font-size: 24px; }
[dir=rtl] .modal-close { right: auto; left: 12px; }
.about-body h2 { font-size: 20px; text-transform: none; letter-spacing: -.01em; color: var(--fg); margin: 0 0 14px; }
.about-body p { font-size: 13.5px; line-height: 1.6; margin: 0 0 12px; color: #c9d1e3; }
.about-body b { color: var(--fg); }
.about-body code { font-family: "JetBrains Mono", monospace; font-size: 12px; background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 4px; }
.about-body a { color: #9cb8ff; }

/* Impression */
.print-head { display: none; }
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  html, body { background: #fff !important; }
  #panel, #rail, .map-tools, .coords, .toast, .loader, .swipe, .modal, .leaflet-control-zoom { display: none !important; }
  #map { position: fixed; top: 16mm; left: 0; right: 0; bottom: 0; }
  .print-head { display: flex; justify-content: space-between; align-items: baseline; position: fixed; top: 0; left: 0; right: 0; height: 14mm; font: 12pt Inter, sans-serif; color: #111; border-bottom: 1px solid #999; }
  .print-head span { font-weight: 400; color: #444; font-size: 10pt; }
  .print-src { font-size: 8.5pt; color: #555; }
  .legend { display: block !important; background: #fff !important; color: #111 !important; border: 1px solid #999 !important; box-shadow: none !important; backdrop-filter: none !important; bottom: 8mm; right: 4mm; }
  .legend b { color: #333 !important; }
  .leaflet-control-container .leaflet-left { left: 4mm !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (max-width: 760px) { .swipe-tag.l { left: 12px; } .swipe-tag { top: 12px; } }
