:root {
  --ink: #18242c;
  --muted: #4f5d63;
  --paper: #f6f3ed;
  --panel: #fffdf9;
  --line: #dedbd3;
  --accent: #3a5ba7;
  --accent-soft: #edf1f9;
  --green: #5ea62b;
  --green-dark: #3f741d;
  --green-soft: #eff7e9;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; min-width: 320px; font-size: 16px; }
body.map-view { overflow: hidden; }
body.adding-place #map { cursor: crosshair; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.ph-icon { width: 18px; height: 18px; fill: currentColor; display: block; }
.topbar { height: 68px; flex: 0 0 auto; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: rgba(255,253,249,.96); border-bottom: 1px solid var(--line); position: relative; z-index: 1000; }
.brand { color: var(--ink); text-decoration: none; display: flex; gap: 10px; align-items: center; letter-spacing: -.02em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-top: 2px; }
.brand-logo { height: 38px; width: auto; display: block; }
.topbar-tools { display: flex; align-items: center; gap: 9px; min-width: 0; }
#top-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.help-button { width: 40px; height: 40px; min-height: 40px; border-radius: 50%; padding: 0; font-size: 16px; font-weight: 800; }
.shell { min-height: calc(100vh - 112px); }
.landing { max-width: 1180px; margin: 0 auto; padding: 64px 28px 90px; display: grid; grid-template-columns: .9fr 1.1fr; gap: 64px; align-items: start; }
.landing-logo { height: 76px; width: auto; display: block; margin-bottom: 24px; }
.eyebrow { color: var(--green-dark); text-transform: uppercase; letter-spacing: .16em; font-size: 11px; font-weight: 750; }
h1 { font-family: Georgia, serif; font-size: clamp(38px, 5vw, 64px); line-height: .98; font-weight: 500; letter-spacing: -.055em; margin: 18px 0 22px; max-width: 620px; }
.landing p { color: var(--muted); line-height: 1.7; max-width: 540px; }
.landing-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.landing-facts span { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 10px; font-size: 12px; color: var(--muted); }
.local-maps-section { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.local-maps-section h2 { font-family: Georgia, serif; font-size: 24px; font-weight: 500; margin: 0 0 10px; }
.local-map { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #e8e3da; }
.local-map-copy { min-width: 0; }
.local-map-copy strong { display: block; font-size: 14px; }
.local-map-copy small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.local-map-actions { display: flex; gap: 5px; align-items: center; flex: 0 0 auto; }
.local-map-actions .button { min-height: 36px; padding: 6px 10px; font-size: 12px; }
.local-map-actions .text-button { padding: 4px; font-size: 11px; }
.loading-note { margin-top: 22px; }
.selection-card { background: var(--panel); border: 1px solid var(--line); box-shadow: 14px 14px 0 #ddd7cc; padding: 26px; border-radius: 4px; }
.selection-card h2 { font-family: Georgia, serif; font-size: 29px; font-weight: 400; margin: 0 0 18px; }
.picker-controls { display: grid; grid-template-columns: 1.3fr .7fr; gap: 12px; }
.parish-results { max-height: 43vh; min-height: 160px; overflow-y: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 8px; padding: 6px 0; scrollbar-width: thin; }
.parish-group h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 14px 0 5px; }
.region-code { display: inline-block; min-width: 26px; color: var(--accent); font-weight: 800; letter-spacing: .04em; }
.parish-option { display: flex; gap: 10px; align-items: flex-start; padding: 9px 8px; border-radius: 3px; cursor: pointer; }
.parish-option:hover { background: var(--accent-soft); }
.parish-option.selected { background: var(--green-soft); }
.parish-option input { margin-top: 3px; accent-color: var(--accent); }
.parish-copy strong { display: block; font-size: 13px; line-height: 1.35; }
.parish-copy small { display: block; color: var(--muted); font-size: 11px; line-height: 1.4; margin-top: 2px; }
.selection-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.selection-count { color: var(--muted); font-size: 12px; }
.text-button { border: 0; background: transparent; color: var(--accent); padding: 10px 0 0; font-size: 12px; text-decoration: underline; }
.button { border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 11px 16px; border-radius: 3px; font-weight: 650; font-size: 14px; min-height: 44px; transition: .15s ease; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.button:hover { border-color: var(--accent); transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.button.subtle { background: transparent; }
.button.danger { color: #9c4739; }
.button.active { background: var(--green-soft); border-color: var(--green); color: #3f741d; }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.button.needs-save { border-color: #d08a1d; box-shadow: inset 0 0 0 1px #d08a1d; }
.map-layout { height: calc(100vh - 112px); height: calc(100dvh - 112px); display: grid; grid-template-columns: minmax(300px, 370px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); overflow: hidden; }
.map-layout.preview-layout { grid-template-columns: minmax(0, 1fr); }
.sidebar { min-height: 0; height: 100%; background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; z-index: 500; scrollbar-width: thin; scrollbar-color: #c8c2b7 transparent; }
.sidebar::-webkit-scrollbar { width: 10px; }
.sidebar::-webkit-scrollbar-thumb { background: #c8c2b7; border: 3px solid var(--panel); border-radius: 10px; }
.sidebar-inner { padding: 24px 22px 42px; }
.kicker { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .13em; font-weight: 750; }
.sidebar h1 { font-size: 33px; line-height: 1; margin: 8px 0 22px; }
.section { border-top: 1px solid var(--line); padding: 19px 0; }
.section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 12px; color: var(--muted); }
.field { display: grid; gap: 6px; margin: 8px 0; }
.field > span, .field label { font-size: 14px; color: var(--muted); }
.field input, .field select, .field textarea { border: 1px solid var(--line); background: #fff; border-radius: 3px; color: var(--ink); padding: 10px 11px; width: 100%; font-size: 15px; min-height: 44px; }
.field textarea { resize: vertical; min-height: 72px; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; margin: 9px 0; min-height: 32px; }
.check input { accent-color: var(--accent); }
.subfilters { margin: -3px 0 10px 23px; padding-left: 10px; border-left: 1px solid #e5e1d8; }
.check.sub { margin: 6px 0; font-size: 12px; color: var(--muted); }
.parish-list { display: grid; gap: 7px; }
.parish-line { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; align-items: baseline; }
.parish-line small { color: #8a5a12; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.legend { display: grid; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.legend-icon { width: 23px; height: 23px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; flex: 0 0 auto; border: 2px solid rgba(255,255,255,.85); box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.legend-icon .ph-icon { width: 13px; height: 13px; }
.place-list { display: grid; gap: 2px; }
.place-row { border: 0; border-bottom: 1px solid #eeeae2; background: transparent; padding: 12px 2px; text-align: left; display: flex; gap: 9px; align-items: center; color: var(--ink); width: 100%; min-height: 48px; }
.place-row:hover { background: var(--accent-soft); }
.place-row strong { display: block; font-size: 14px; font-weight: 650; }
.place-row small { color: var(--muted); font-size: 12px; }
.hidden-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid #eeeae2; font-size: 12px; color: var(--muted); }
.hidden-row .button { padding: 6px 8px; font-size: 11px; }
.map-wrap { position: relative; min-width: 0; height: 100%; overflow: hidden; }
#map { position: absolute; inset: 0; height: 100%; width: 100%; background: #e6e5df; }
.map-hover-label { position: absolute; z-index: 520; left: 13px; bottom: 42px; max-width: min(360px, calc(100% - 26px)); display: none; background: rgba(255,253,249,.96); border: 1px solid var(--line); border-radius: 3px; padding: 7px 10px; box-shadow: 0 3px 12px rgba(0,0,0,.12); font-size: 11px; }
.map-hover-label.visible { display: grid; gap: 2px; }
.map-hover-label strong { font-size: 12px; }
.map-hover-label span { color: var(--muted); }
.map-note { position: absolute; z-index: 400; left: 13px; bottom: 12px; padding: 7px 10px; background: rgba(255,253,249,.9); color: #536168; font-size: 10px; border: 1px solid rgba(205,201,190,.85); border-radius: 3px; }
.share-box { display: grid; gap: 8px; background: #f0eee8; padding: 13px; font-size: 13px; line-height: 1.5; word-break: break-all; border-left: 4px solid var(--line); }
.share-box.public { border-left-color: var(--green); }
.share-box.edit { border-left-color: #9a5b4d; }
.share-box span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.share-box code { color: var(--accent); font-size: 12px; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.55; margin: 10px 0 0; }
.empty { max-width: 680px; margin: 100px auto; padding: 30px; text-align: center; }
.empty h1 { margin-left: auto; margin-right: auto; }
.empty p { color: var(--muted); line-height: 1.7; }
.popup-form { min-width: 220px; display: grid; gap: 7px; }
.popup-form label { font-size: 11px; color: var(--muted); }
.popup-form input, .popup-form select, .popup-form textarea { padding: 6px; border: 1px solid var(--line); width: 100%; }
.popup-form textarea { min-height: 62px; resize: vertical; }
.popup-actions { display: flex; gap: 6px; margin-top: 3px; }
.popup-actions .button { flex: 1; padding: 8px 9px; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #fffdf9; }
.leaflet-control-recenter button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: #fffdf9; color: var(--ink); padding: 9px 11px; font-size: 12px; min-height: 40px; cursor: pointer; }
.leaflet-control-recenter .ph-icon { width: 14px; height: 14px; color: var(--accent); }
.leaflet-marker-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.marker { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 3px solid rgba(255,255,255,.92); box-shadow: 0 1px 5px rgba(0,0,0,.3); }
.marker .ph-icon { width: 16px; height: 16px; color: #fff; fill: #fff; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.marker.ghost { opacity: .42; border-style: dashed; filter: grayscale(.5); }
.cluster-marker { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800; border: 3px solid rgba(255,255,255,.92); box-shadow: 0 2px 8px rgba(0,0,0,.28); }
.osm-light { filter: saturate(.68) brightness(1.06) contrast(.93); }
body.preview-view { overflow: auto; }
body.preview-view #map { background: #fbfaf6; }
.preview-workspace { min-height: calc(100dvh - 112px); display: flex; align-items: center; justify-content: center; padding: 24px; background: #e8e4dc; overflow: auto; }
.paper-sheet { width: min(calc(100vw - 48px), calc((100dvh - 160px) * 1.41421356), 1180px); aspect-ratio: 420 / 297; background: #fff; padding: 10mm; box-shadow: 0 12px 36px rgba(24,36,44,.18); flex: 0 0 auto; }
.paper-map { position: relative; width: 100%; height: 100%; overflow: hidden; background: #fbfaf6; container-type: inline-size; }
.commune-label { color: #52616a; font-size: 11px; font-weight: 700; text-shadow: 0 1px 3px #fff, 1px 0 3px #fff; }
.share-actions { display: grid; gap: 8px; }
.status { color: var(--muted); font-size: 12px; margin-top: 10px; min-height: 15px; }
.process-steps { height: 44px; display: flex; align-items: center; gap: 7px; padding: 0 28px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; white-space: nowrap; font-size: 12px; z-index: 900; }
.process-step { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); text-decoration: none; padding: 5px 3px; background: transparent; border: 0; font: inherit; cursor: pointer; font-size: 13px; }
.process-step .num { width: 25px; height: 25px; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: inline-grid; place-items: center; font-size: 10px; font-weight: 750; }
.process-step.done { color: var(--green-dark); }
.process-step.done .num { background: var(--green-soft); border-color: var(--green); }
.process-step.active { color: var(--accent); font-weight: 700; }
.process-step.active .num { background: var(--accent); border-color: var(--accent); color: #fff; }
.process-step.disabled { opacity: .4; pointer-events: none; }
.process-sep { color: #c3bdb2; }
.process-button { appearance: none; }
.preview-loading { position: absolute; inset: 0; z-index: 800; display: grid; place-items: center; background: rgba(251,250,246,.78); color: var(--muted); font-size: 13px; transition: opacity .3s ease; }
.preview-loading span::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -3px; border: 2px solid #d9d5cb; border-top-color: var(--accent); border-radius: 50%; animation: preview-spin .8s linear infinite; }
.preview-loading.done { opacity: 0; pointer-events: none; }
@keyframes preview-spin { to { transform: rotate(360deg); } }
.preview-settings-dialog { width: min(520px, 92vw); }
.preview-settings-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.preview-controls { display: grid; gap: 6px; }
.preview-controls-head { display: grid; gap: 2px; margin-bottom: 7px; }
.preview-controls-head strong { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.preview-controls-head span { color: var(--muted); font-size: 10px; }
.preview-controls .check { font-size: 14px; margin: 5px 0; }
.preview-controls .subfilters { margin: 0 0 6px 19px; }
.preview-controls .hint { font-size: 13px; }
body.exporting-png .preview-controls,
body.exporting-png .legend-handle,
body.exporting-png .map-note,
body.exporting-png .leaflet-control-zoom,
body.exporting-png .leaflet-control-recenter,
body.exporting-png .leaflet-control-attribution { display: none !important; }
.print-card { display: none; }
.print-card.visible { display: block; position: absolute; z-index: 450; top: 1.2cqw; left: 1.2cqw; width: 30%; background: rgba(255,253,249,.94); border: 1px solid var(--line); border-radius: .35cqw; padding: 1.2cqw; box-shadow: 0 .5cqw 2cqw rgba(0,0,0,.12); user-select: none; }
.legend-handle { cursor: grab; touch-action: none; display: inline-flex; align-items: center; justify-content: center; width: 2cqw; height: 2cqw; color: var(--muted); font-size: 1.6cqw; line-height: 1; user-select: none; margin-bottom: .5cqw; }
.print-card.dragging .legend-handle { cursor: grabbing; }
.print-brand { display: flex; gap: 12px; align-items: flex-start; }
.print-brand img { height: 50px; width: auto; }
.print-brand h2 { font-family: Georgia, serif; font-size: 22px; line-height: 1.05; margin: 5px 0 3px; font-weight: 500; }
.print-brand p { margin: 0; color: var(--muted); font-size: 12px; }
.print-legend { display: flex; flex-wrap: wrap; gap: .7cqw 1.15cqw; margin: 0 0 .5cqw; }
.print-legend span { display: inline-flex; align-items: center; gap: .4cqw; font-size: 1.05cqw; }
.print-legend .ph-icon { width: 1.4cqw; height: 1.4cqw; color: var(--accent); }
.print-legend .legend-line { width: 2.2cqw; border-top-width: .25cqw; }
.print-legend .legend-dot { width: 1cqw; height: 1cqw; }
.print-warning { color: #8a5a12; font-size: .68cqw; line-height: 1.3; display: block; margin-top: .35cqw; }
.print-attribution { color: var(--muted); font-size: .72cqw; line-height: 1.35; display: block; margin-top: .3cqw; }
.legend-line { width: 19px; height: 0; border-top: 3px solid #a6654a; display: inline-block; }
.legend-line.road-motorway { border-color: #9a5b4d; border-top-width: 4px; }
.legend-line.road-primary { border-color: #a6654a; }
.legend-line.road-secondary { border-color: #c79b7d; border-top-width: 2px; }
.legend-line.road-tertiary { border-color: #b07a55; border-top-width: 2px; }
.legend-line.road-local { border-color: #c7a88f; border-top-width: 1px; }
.legend-line.rail { border-color: #6d5a8a; }
.legend-line.ferry { border-color: #2d7f9d; border-top-style: dashed; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; border: 2px solid #6d5a8a; background: #fff; display: inline-block; }
.village-label { background: transparent; border: 0; box-shadow: none; color: #58666a; font-size: 11px; font-weight: 600; padding: 0; text-shadow: 0 1px 2px #fff, 0 0 3px #fff; }
.village-label::before { display: none; }
.print-card small { color: var(--muted); font-size: 9px; line-height: 1.4; display: block; }
.icon-dialog { border: 0; border-radius: 6px; padding: 18px; width: min(540px, 92vw); box-shadow: 0 18px 50px rgba(24,36,44,.28); }
.icon-dialog::backdrop { background: rgba(24,36,44,.45); }
.icon-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.icon-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-height: 58vh; overflow: auto; }
.icon-choice { border: 1px solid var(--line); background: #fff; border-radius: 4px; padding: 8px 4px; display: grid; gap: 4px; justify-items: center; font-size: 10px; color: var(--muted); cursor: pointer; }
.icon-choice .ph-icon { width: 22px; height: 22px; color: var(--accent); }
.icon-choice.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.icon-select-button { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 3px; padding: 8px 9px; cursor: pointer; text-align: left; max-width: 100%; }
.icon-select-button .ph-icon { width: 20px; height: 20px; color: var(--accent); flex: 0 0 auto; }
.category-editor-list { display: grid; gap: 7px; margin: 10px 0; }
.category-editor { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 7px; align-items: center; }
.category-editor .icon-select-button { padding: 5px; }
.category-editor .icon-select-button .ph-icon { width: 18px; height: 18px; }
.category-editor .category-label { border: 1px solid var(--line); padding: 6px 7px; border-radius: 3px; min-width: 0; width: 100%; }
.category-editor input[type=color] { width: 32px; height: 32px; padding: 2px; border: 1px solid var(--line); background: #fff; border-radius: 3px; }
.category-details summary { cursor: pointer; font-size: 12px; color: var(--muted); }
@media (max-width: 600px) { .icon-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.advanced-options { border-top: 1px solid var(--line); padding: 19px 0; }
.advanced-options > summary { cursor: pointer; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); }
.advanced-options[open] > summary { margin-bottom: 10px; }
.selected-list { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; margin: 10px 0 4px; }
.selected-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--green-soft); border: 1px solid var(--green); border-radius: 999px; padding: 5px 8px; font-size: 12px; }
.selected-chip button { border: 0; background: transparent; color: var(--green-dark); font-weight: 800; cursor: pointer; padding: 0 2px; }
.selection-hint { color: #8a5a12; font-size: 12px; margin: 4px 0 0; }
.save-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.save-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.save-state.dirty { color: #8a5a12; }
.save-state.dirty::before { background: #d08a1d; }
.info-dialog { border: 0; border-radius: 8px; padding: 22px; width: min(620px, 92vw); box-shadow: 0 20px 60px rgba(24,36,44,.32); }
.info-dialog::backdrop { background: rgba(24,36,44,.5); }
.info-dialog h2 { font-family: Georgia, serif; font-weight: 500; font-size: 28px; margin: 0 0 8px; }
.info-dialog h3 { font-size: 15px; margin: 18px 0 6px; }
.info-dialog p, .info-dialog li { color: var(--muted); line-height: 1.55; font-size: 14px; }
.info-dialog ol { padding-left: 20px; margin: 6px 0; }
.mobile-only { display: none; }
@media (max-width: 800px) { .mobile-only { display: block; } }
.info-dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.dialog-links { display: grid; gap: 12px; margin-top: 14px; }
.dialog-link { display: grid; gap: 7px; }
.dialog-link code { display: block; word-break: break-all; background: #f0eee8; padding: 9px; border-radius: 3px; font-size: 12px; color: var(--accent); }
.dialog-link small { color: var(--muted); font-size: 13px; }
.confirm-check { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: 14px; }
.confirm-check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); }
.print-help { background: var(--accent-soft); border-left: 4px solid var(--accent); padding: 9px 10px; font-size: 12px; line-height: 1.5; color: var(--ink); }
#toast { position: fixed; z-index: 2000; left: 50%; bottom: 24px; transform: translate(-50%, 15px); opacity: 0; pointer-events: none; background: var(--ink); color: white; padding: 11px 15px; border-radius: 3px; font-size: 13px; box-shadow: 0 5px 20px rgba(0,0,0,.18); transition: .2s ease; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 900px) {
  .landing { grid-template-columns: 1fr; gap: 38px; }
}
@media (max-width: 800px) {
  body.map-view { overflow: auto; }
  .topbar { padding: 0 16px; height: 60px; }
  .process-steps { height: 42px; padding: 0 12px; font-size: 11px; }
  .map-layout { height: auto; min-height: calc(100dvh - 102px); display: flex; flex-direction: column-reverse; overflow: visible; }
  .map-wrap { height: 58vh; min-height: 400px; }
  body.preview-view .map-wrap { height: calc(100dvh - 60px); min-height: 0; }
  .preview-workspace { min-height: calc(100dvh - 102px); padding: 12px; align-items: flex-start; }
  .paper-sheet { width: min(calc(100vw - 24px), calc((100dvh - 126px) * 1.41421356), 1180px); padding: 6mm; }
  body.preview-view .help-button { display: none; }
  .sidebar { height: auto; border-right: 0; border-top: 1px solid var(--line); max-height: none; overflow: visible; }
  .sidebar-inner { padding: 20px 16px 36px; }
  .landing { display: block; padding: 45px 20px; }
  .landing-logo { height: 64px; margin-bottom: 22px; }
  .selection-card { margin-top: 34px; padding: 18px; box-shadow: none; }
  .picker-controls { grid-template-columns: 1fr; }
  .parish-results { max-height: 45vh; }
  .brand-logo { height: 34px; }
  .brand strong, .brand small { display: none; }
  .brand { gap: 0; }
  #top-actions { gap: 6px; flex-wrap: nowrap; }
  #top-actions .button { padding: 8px 10px; font-size: 12px; white-space: nowrap; }
}
@page { size: A3 landscape; margin: 0; }
@media print {
  body.map-view { overflow: visible; }
  .topbar, .process-steps, .sidebar, .map-note, .map-hover-label, .leaflet-control-zoom, .leaflet-control-layers, .preview-controls, .preview-loading { display: none !important; }
  .leaflet-control-recenter { display: none !important; }
  .leaflet-control-attribution { display: block !important; background: #fff !important; font-size: 8px; }
  .map-layout, .map-wrap, #map { height: 100vh; display: block; }
  .preview-workspace { display: block !important; min-height: 0 !important; height: auto !important; padding: 0 !important; background: #fff !important; overflow: visible !important; }
  .paper-sheet { width: 420mm !important; height: 297mm !important; padding: 10mm !important; aspect-ratio: auto !important; box-shadow: none !important; }
  .paper-map { width: 100% !important; height: 100% !important; }
  .preview-view #map, .preview-workspace #map { height: 100% !important; }
  .legend-handle { display: none !important; }
  .print-card { display: block !important; position: absolute; top: 0; left: 0; width: 30% !important; background: #fff; border: 1px solid #ccc; padding: 1.2cqw !important; box-shadow: none; z-index: 2000; }
}
