.map-legend{--legend-road:#f6f0da;--legend-building:#c6b9a8;--legend-park:#a6d596;--legend-water:#9bc9e6;max-width:min(290px,calc(100vw - 32px));margin:0 0 48px 12px!important;border:1px solid var(--border);border-radius:10px;background:var(--raised,#f8f3e9);color:var(--fg,#252e36);box-shadow:0 3px 12px #17202b35;font:inherit;font-size:.78rem}
.map-legend[hidden],.locked .map-legend{display:none!important}
.map-legend summary{padding:7px 11px;cursor:pointer;font-weight:700;line-height:1.3}
.map-legend-content{max-height:min(42dvh,280px);padding:2px 11px 9px;overflow:auto;overscroll-behavior:contain}
.map-legend-content strong{display:block;margin-bottom:4px}
.map-legend-content ul{margin:0;padding:0;list-style:none}
.map-legend-content li{display:flex;align-items:center;gap:8px;min-height:22px;line-height:1.25}
.map-legend-symbol{display:grid;place-items:center;flex:none;box-sizing:border-box;width:18px;height:15px;font-size:.72rem;font-weight:800;color:#fff;background:#184161;border:1px solid #667c88;border-radius:3px}
.map-legend-symbol[data-symbol=road]{background:var(--legend-road)}
.map-legend-symbol[data-symbol=building]{background:var(--legend-building)}
.map-legend-symbol[data-symbol=park]{background:var(--legend-park)}
.map-legend-symbol[data-symbol=water]{background:var(--legend-water)}
.map-legend-symbol[data-symbol=satellite]{background:linear-gradient(140deg,#2d4c31 38%,#697557 39% 61%,#a88765 62%)}
.map-legend-symbol[data-symbol=cluster],.map-legend-symbol[data-symbol=offered]{width:17px;height:17px;border-radius:50%}
.map-legend-symbol[data-symbol=offered]{background:radial-gradient(#ffe67c 20%,#76b8eb 72%);color:#183953}
.map-legend-symbol[data-symbol=center]{background:#6b5932;border-color:#d2ab48}
.map-legend-symbol[data-symbol=market]{background:#704966}
.map-legend-symbol[data-symbol=address]{background:var(--surface,#fff);color:var(--fg,#222)}
.map-legend-symbol[data-symbol=underpass],.map-legend-symbol[data-symbol=metro],.map-legend-symbol[data-symbol=stairs],.map-legend-symbol[data-symbol=transit]{height:0;border:0;border-top:3px solid #81e4d8}
.map-legend-symbol[data-symbol=metro]{border-color:#cba8ff}
.map-legend-symbol[data-symbol=stairs]{border-top-style:dashed;border-color:#c08736}
.map-legend-symbol[data-symbol=transit]{border-color:#3569ad}
.map-legend-symbol[data-symbol=depth-a]{background:#13695f}
.map-legend-symbol[data-symbol=depth-m]{background:#69339a}
.map-legend-symbol[data-symbol=boundary]{background:#9fbcc277;border-style:dashed}
.map-workspace[data-map-theme=light] .map-legend{--legend-road:#fff;--legend-building:#dce1e4;--legend-park:#e9edee;--legend-water:#e6ebed}
.map-workspace[data-map-theme=warm] .map-legend{--legend-road:#fff;--legend-building:#ded4c6;--legend-park:#e9e4cc;--legend-water:#91c8d8}
.map-workspace[data-map-night=true] .map-legend{--legend-road:#58697f;--legend-building:#303846;--legend-park:#19392f;--legend-water:#29434b}
@media(max-width:900px){.map-legend{margin-bottom:70px!important}.map-legend-content{max-height:30dvh}}


/* One compact component; the application's theme and setting handlers remain shared. */
.map-settings-backdrop{position:absolute;inset:0;z-index:99999;background:#151c2429}.map-settings-backdrop[hidden]{display:none}
.map-layers-panel.map-settings-responsive{position:absolute;inset:12px 12px auto auto;z-index:100000;width:min(1080px,calc(100% - 24px));height:auto;max-height:calc(100% - 24px);min-height:0;box-sizing:border-box;padding:0;overflow:hidden;display:flex;flex-direction:column;border:1px solid var(--border);border-radius:14px;background:var(--raised);color:var(--fg);box-shadow:0 12px 34px #13242b38}
.map-settings-responsive[hidden],.map-settings-responsive [hidden]{display:none!important}
.map-settings-responsive .map-layers-head{display:flex;align-items:center;justify-content:space-between;flex:none;gap:10px;padding:11px 14px;border-bottom:1px solid var(--border);background:var(--raised)}
.map-settings-heading{display:flex;align-items:center;gap:9px;min-width:0}.map-settings-heading-icon{display:grid;place-items:center;flex:none;width:34px;height:34px;font-size:1.5rem;color:var(--accent)}.map-settings-heading strong{font-size:1.08rem;line-height:1.3}.map-settings-heading small{display:block;margin-top:3px;color:var(--sub);font-size:.8rem;line-height:1.3}
.map-settings-responsive #map-layers-close{flex:none;min-width:40px;min-height:40px;padding:5px;border:1px solid var(--border);border-radius:8px;background:var(--raised);color:var(--fg);font-size:1.25rem;cursor:pointer}
.map-settings-responsive .map-settings-body{display:grid;grid-template-columns:175px minmax(300px,340px) minmax(380px,1fr);align-items:start;gap:10px;flex:0 1 auto;min-height:0;padding:12px;overflow:hidden;box-sizing:content-box}
.map-settings-rail{min-width:0;min-height:0;max-height:100%;overflow:auto;scrollbar-width:thin}
.map-settings-responsive .map-settings-navigation{display:flex;flex-direction:column;gap:4px;min-width:0;margin:0;padding:0;overflow:visible;background:transparent}
.map-settings-responsive .map-settings-rail .map-settings-navigation button{display:flex;flex:none;align-items:center;gap:8px;min-width:0;width:100%;max-width:none;min-height:43px;margin:0;padding:7px 9px;border:0;border-radius:5px;box-shadow:none;text-align:left;font:inherit;font-size:.86rem;line-height:1.3;overflow-wrap:anywhere;background:transparent;color:var(--fg);cursor:pointer}
.map-settings-responsive .map-settings-navigation button span{display:block;flex:none;width:21px;text-align:center;font-size:1.15rem}
.map-layers-panel.map-settings-responsive .map-settings-rail .map-settings-navigation button[aria-selected="true"]{background:color-mix(in srgb,var(--accent) 12%,var(--raised));color:var(--fg);border:0;box-shadow:inset 3px 0 var(--accent);font-weight:750}
.map-settings-reset-global{margin-top:12px;padding-top:9px;border-top:1px solid var(--border)}
.map-settings-responsive :is(.map-settings-reset-global button,.map-settings-reset){min-height:36px;max-width:100%;padding:6px 4px;border:0;border-radius:4px;background:transparent;color:var(--sub);font:inherit;font-size:.78rem;line-height:1.3;text-align:left;cursor:pointer}
.map-settings-responsive .map-settings-reset{margin:8px 0 0}.map-settings-responsive :is(.map-settings-reset-global button,.map-settings-reset):hover{color:var(--fg);text-decoration:underline}
.map-settings-responsive :is(button,input,select,a):focus-visible{outline:3px solid var(--accent);outline-offset:2px}.map-settings-responsive button:hover{border-color:var(--accent)}
.map-settings-responsive :is(input,select){max-width:100%;box-sizing:border-box}.map-settings-responsive :is(input[type="radio"],input[type="checkbox"],input[type="range"]){accent-color:var(--accent)}
.map-settings-responsive :is(input[type="radio"],input[type="checkbox"]){flex:none;width:18px;height:18px;margin:0}
.map-settings-responsive .map-settings-scroll{min-width:0;min-height:0;height:100%;padding:0 3px 0 0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-gutter:stable}
.map-settings-responsive .map-settings-section-content{display:flow-root;min-width:0}.map-settings-responsive .map-settings-scroll h3{font-size:1.04rem;line-height:1.3;margin:0 0 10px}
.map-settings-responsive .map-settings-accordion,.map-settings-responsive .map-settings-collapsed-close{display:none}
.map-settings-responsive .map-layer-option{display:flex;align-items:center;gap:8px;min-height:36px;margin:0;padding:4px 2px;box-sizing:border-box;font-size:.86rem;line-height:1.35;color:var(--fg)}
.map-settings-responsive .map-layer-option:has(input:checked){padding-left:2px;background:transparent;border-radius:0}.map-settings-responsive .map-layer-option strong{font-size:inherit}.map-settings-responsive small{display:block;color:var(--sub);font-size:.78rem;line-height:1.35}
.map-settings-responsive hr{border:0;border-top:1px solid var(--border);margin:10px 0}
.map-settings-responsive :is(.map-settings-card,.map-display-options,.jurisdiction-control,.map-quick-settings,.map-night-modes){min-width:0;margin:10px 0 0;padding:10px 0 0;border:0;border-top:1px solid var(--border);border-radius:0;background:transparent;box-shadow:none}
.map-settings-responsive :is(.map-settings-card label,legend){font-weight:650}.map-settings-responsive legend{padding:0;margin-bottom:7px;font-size:.9rem}.map-settings-responsive :is(.map-settings-card,.jurisdiction-opacity-control) input[type="range"]{display:block;width:100%;margin:7px 0;accent-color:var(--accent)}
.map-settings-responsive .map-settings-card small{margin-top:5px}.map-settings-responsive .map-settings-card output{font-variant-numeric:tabular-nums}.map-settings-color{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.map-settings-color input[type="color"]{width:48px;height:36px;padding:2px}.map-settings-color>span{width:28px;height:28px;border-radius:50%;border:1px solid var(--border)}
.map-settings-responsive .map-settings-color button,.map-settings-responsive #unified-type-reset{min-height:34px;padding:5px 8px;border:1px solid var(--border);border-radius:5px;background:var(--raised);color:var(--fg);font:inherit;font-size:.8rem}
.map-settings-base-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:8px 0 10px}
.map-settings-responsive .map-settings-base-grid>.map-layer-option{position:relative;display:flex;align-items:stretch;flex-direction:column;justify-content:flex-end;gap:6px;min-height:76px;padding:7px;border:2px solid var(--border);border-radius:7px;--map-preview-background:linear-gradient(145deg,#d8e8d8 0 24%,#f9f2da 25% 44%,#b7d7e5 45% 52%,#e8e8d5 53% 75%,#d1dcc7 76%);overflow:hidden;background:var(--map-preview-background)}
.map-settings-base-grid .map-layer-option input{position:absolute;top:6px;left:6px}.map-settings-base-grid .map-layer-option>span{margin-top:18px;overflow-wrap:anywhere}
.map-settings-responsive .map-settings-base-grid>.map-layer-option:has([value="warm"]){--map-preview-background:linear-gradient(140deg,#e1cfbf,#f4e6d0 48%,#c7dcb9 49%,#f0e8dd)}
.map-settings-responsive .map-settings-base-grid>.map-layer-option:has([value="light"]){--map-preview-background:linear-gradient(140deg,#e3e8e8,#f7f8f4 48%,#d2dde1 49%,#f8f8f5)}
.map-settings-responsive .map-settings-base-grid>.map-layer-option:has([value="bright"]){--map-preview-background:linear-gradient(140deg,#c9e8b2,#e9d7bc 48%,#a9cbd9 49%,#f2eccc)}
.map-settings-responsive .map-settings-base-grid>.map-layer-option:has([value="satellite"]){--map-preview-background:linear-gradient(135deg,#335333 0 27%,#857b59 27% 40%,#354d59 40% 56%,#999d75 56% 72%,#435b37 72%)}
.map-settings-responsive .map-settings-base-grid>.map-layer-option:has([value="underground"]){--map-preview-background:repeating-linear-gradient(135deg,#273641 0 24%,#81d2c7 25% 27%,#273641 28% 48%,#b59ddb 49% 51%,#34414e 52% 75%)}
.map-settings-responsive .map-settings-base-grid>.map-layer-option:has(input:checked){border-color:var(--accent);background:var(--map-preview-background);box-shadow:none}.map-settings-base-grid .map-layer-option>span{min-width:0;max-width:100%;box-sizing:border-box;padding:2px 3px;border-radius:3px;background:#fffdf1e8}.map-settings-base-grid .map-layer-option strong{font-size:.82rem;color:#26333a}.map-settings-base-grid .map-layer-option small{display:none}
.map-settings-responsive .map-night-modes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 10px}.map-settings-responsive .map-night-modes .map-layer-option{align-items:flex-start;min-height:45px;padding:5px 2px}.map-settings-responsive .map-night-modes input{margin-top:2px}.map-settings-responsive .map-night-modes small{display:block;font-size:.76rem;margin-top:3px}.map-settings-responsive #map-night-status{grid-column:1/-1;margin:4px 0 0}
.map-settings-responsive .map-display-options legend,.map-settings-responsive .map-night-modes legend{margin-bottom:5px}.map-settings-responsive #map-layers-appearance>p:first-child{margin:0 0 7px}
.map-settings-responsive .jurisdiction-control{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 10px}.map-settings-responsive .jurisdiction-control>:is(legend,small,div,p){grid-column:1/-1}.map-settings-responsive .jurisdiction-control .map-layer-option{padding:4px 2px}.map-settings-responsive .jurisdiction-opacity-control{margin:5px 0}.map-settings-responsive #jurisdiction-status{margin:5px 0}
.map-settings-responsive .map-quick-settings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 10px}.map-settings-responsive .map-quick-settings>:is(legend,small){grid-column:1/-1}.map-settings-responsive .map-quick-settings label{display:flex;align-items:center;gap:8px;min-height:36px;font-size:.86rem}
.map-settings-responsive .map-settings-preview{position:relative;align-self:start;min-width:0;margin:0;padding:0;background:transparent;border:0;border-radius:0;overflow:hidden}
.map-settings-preview-head{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:31px;margin:0 0 5px}.map-settings-preview-head strong{font-size:.88rem}.map-settings-preview-head button{min-height:30px;max-width:63%;padding:4px 7px;border:1px solid var(--border);border-radius:5px;background:var(--raised);color:var(--fg);font:inherit;font-size:.74rem;cursor:pointer}
.map-settings-preview-map{position:relative;height:var(--settings-preview-height,280px);min-height:0;overflow:hidden;border:1px solid var(--border);border-radius:7px;background:var(--surface)}.map-settings-preview-map>#map{display:block;width:100%;height:100%;min-height:0;visibility:visible}
.map-settings-responsive:not(.map-settings-preview-expanded) .map-settings-preview-map .leaflet-control:not(.leaflet-control-attribution):not(.leaflet-control-scale){display:none}
.map-settings-preview-map .leaflet-control-attribution{max-width:100%;box-sizing:border-box;font-size:9px;line-height:1.2}.map-settings-preview-zoom{position:absolute;z-index:450;left:9px;bottom:29px;display:flex;gap:3px}.map-settings-preview-zoom button{width:34px;height:34px;padding:0;border:1px solid var(--border);border-radius:5px;background:var(--raised);color:var(--fg);font-size:1.3rem;cursor:pointer}
.map-settings-responsive.map-settings-preview-expanded .map-settings-body{grid-template-columns:1fr}.map-settings-responsive.map-settings-preview-expanded :is(.map-settings-rail,.map-settings-scroll){display:none!important}
.map-settings-responsive[data-settings-layout="tablet"] .map-settings-body{grid-template-columns:175px minmax(0,1fr)}
.map-settings-responsive[data-settings-layout="mobile"]{inset:8px 6px auto;width:calc(100% - 12px);max-width:none;max-height:calc(100% - 16px);border-radius:12px}
.map-settings-responsive[data-settings-layout="mobile"] .map-layers-head{gap:7px;padding:8px 10px}.map-settings-responsive[data-settings-layout="mobile"] .map-settings-heading{gap:6px}.map-settings-responsive[data-settings-layout="mobile"] .map-settings-heading strong{font-size:1rem}.map-settings-responsive[data-settings-layout="mobile"] .map-settings-heading small{display:none}.map-settings-responsive[data-settings-layout="mobile"] .map-settings-heading-icon{width:28px;height:28px;font-size:1.25rem}.map-settings-responsive[data-settings-layout="mobile"] #map-layers-close{min-width:44px;min-height:44px}
.map-settings-responsive[data-settings-layout="mobile"] .map-settings-body{display:block;padding:9px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.map-settings-responsive[data-settings-layout="mobile"] .map-settings-scroll{height:auto;padding:0;overflow:visible;scrollbar-gutter:auto}
.map-settings-responsive[data-settings-layout="mobile"] [data-map-settings-section]{margin:0 0 5px;border:0;border-bottom:1px solid var(--border);border-radius:0;background:transparent;overflow:hidden}
.map-settings-responsive[data-settings-layout="mobile"] .map-settings-accordion{display:flex;align-items:center;gap:8px;width:100%;min-height:49px;padding:10px 9px;margin:0;border:0;border-radius:5px;background:transparent;color:var(--fg);text-align:left;font:inherit;font-size:.9rem;line-height:1.3;font-weight:650}
.map-layers-panel.map-settings-responsive .map-settings-accordion[aria-expanded="true"]{background:color-mix(in srgb,var(--accent) 12%,var(--raised));color:var(--fg);box-shadow:inset 3px 0 var(--accent)}.map-settings-chevron{margin-left:auto;flex:none;font-size:1.1rem}.map-settings-accordion[aria-expanded="true"] .map-settings-chevron{transform:rotate(180deg)}
.map-settings-responsive[data-settings-layout="mobile"] .map-settings-section-content{padding:10px 4px}.map-settings-responsive[data-settings-layout="mobile"] .map-settings-section-content>h3{display:none}.map-settings-responsive[data-settings-layout="mobile"] .map-settings-base-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.map-settings-responsive[data-settings-layout="mobile"] .map-layer-option,.map-settings-responsive[data-settings-layout="mobile"] .map-quick-settings label{min-height:44px}.map-settings-responsive[data-settings-layout="mobile"] :is(.map-settings-reset-global button,.map-settings-reset){min-height:44px}.map-settings-responsive[data-settings-layout="mobile"] .map-settings-reset-global{margin:9px 0 0}
@media(max-width:900px){.map-workspace #map-layers-panel.map-settings-responsive.mobile-map-sheet:not([hidden]):not(.mobile-map-sheet-collapsed):not(.mobile-map-sheet-dragging){inset:8px 6px auto!important;width:calc(100% - 12px)!important;max-width:none!important;height:var(--settings-modal-height,calc(100% - 16px))!important;max-height:calc(100% - 16px)!important;padding:0!important;overflow:hidden!important;border-radius:12px!important}.map-settings-responsive>.mobile-map-grip{flex:none}.map-workspace #map-layers-panel.map-settings-responsive.mobile-map-sheet-collapsed>.map-settings-collapsed-close{display:grid!important;place-items:center;position:absolute;right:6px;top:6px;z-index:8;width:44px;height:44px;border:1px solid var(--border);border-radius:8px;background:var(--raised);color:var(--fg);font-size:1.4rem}}
