/* HSG UI Framework token aliases. The framework stylesheet loads before this app stylesheet. */
:root{--navy:var(--hsg-green,#243d37);--navy2:#2c4a45;--teal:var(--hsg-lime,#cdde66);--teal2:#b7ca4f;--cream:var(--hsg-cream,#f3ebd9);--bg:#edf1ec;--line:var(--hsg-mist,#d5ddd6);--text:var(--hsg-green,#243d37);--muted:var(--hsg-secondary-green,#718078);--white:var(--hsg-white,#fff);--danger:var(--hsg-warning,#c8463d)}
*{box-sizing:border-box}html,body{height:100%;margin:0;font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--text);overflow:hidden}button,.button,input,select{font:inherit}button,.button{border:1px solid var(--line);background:#fff;color:var(--text);border-radius:7px;padding:8px 11px;cursor:pointer;transition:.15s}button:hover,.button:hover{border-color:#9eb0b9;background:#f8fafb}button:disabled{opacity:.45;cursor:default}.primary{background:var(--teal);border-color:var(--teal);color:var(--navy);font-weight:750}.primary:hover{background:var(--teal2);border-color:var(--teal2);color:var(--navy)}
.topbar{height:64px;background:var(--navy);display:flex;align-items:center;gap:12px;justify-content:space-between;padding:0 18px;color:#fff;box-shadow:0 2px 10px #001a2733;position:relative;z-index:1100}
.brand{display:flex;align-items:center;gap:11px;min-width:245px}
.brand-logo-panel{flex:0 0 auto;width:96px;height:48px;display:flex;align-items:center;justify-content:center;overflow:hidden;padding:5px 8px;border:1px solid #4b665d;border-radius:9px;background:#1c332e;box-shadow:inset 0 1px 0 #ffffff10}
.brand-logo-panel img{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}
.brand-copy{display:flex;flex-direction:column;padding-left:11px;border-left:1px solid #4b665d}
.brand-copy strong{font-size:14px;line-height:1.1}
.brand-copy small{color:#c5d1c9;font-size:10px;margin-top:3px}
.search-wrap{position:relative;flex:1;max-width:340px;display:flex;gap:5px}
.search-wrap input{flex:1;min-width:0;height:38px;border-radius:7px;border:1px solid #49645e;background:#1c332e;color:#fff;padding:0 11px}
.search-wrap input::placeholder{color:#8fa79d}
.search-wrap button{flex:0 0 38px;width:38px;height:38px;padding:0;display:grid;place-items:center;background:var(--navy2);border-color:#49645e;color:#fff}
.search-results{left:0;right:auto;top:44px;width:min(420px,60vw);max-height:280px;overflow:auto}
.search-results button{display:block;width:100%;white-space:normal;text-align:left;font-size:12px;line-height:1.35;padding:7px 9px}
.file-actions{display:flex;align-items:center;gap:7px}
.file-actions button,.file-actions .button{background:var(--navy2);border-color:#49645e;color:#fff}
.file-actions .primary{background:var(--teal);border-color:var(--teal);color:var(--navy)}
.file-actions .primary:hover{background:var(--teal2);border-color:var(--teal2);color:var(--navy)}
.divider{height:26px;width:1px;background:#426073;margin:0 3px}
.export-wrap{position:relative}
.menu{position:absolute;right:0;top:42px;width:165px;background:#fff;border:1px solid var(--line);box-shadow:0 10px 30px #102c3d33;border-radius:8px;padding:5px;z-index:1200}
.menu button{width:100%;border:0;color:var(--text);background:#fff;text-align:left}
.hidden{display:none!important}
main{height:calc(100vh - 100px);display:grid;grid-template-columns:76px minmax(0,1fr) 258px}
.tools{background:#fff;border-right:1px solid var(--line);padding:10px 8px;display:flex;flex-direction:column;gap:5px;overflow-y:auto}
.tool{height:56px;padding:5px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2px;border-color:transparent;color:#46616e}
.tool span{font-size:20px;line-height:22px}
.tool small{font-size:10px}
.tool:hover,.tool.active{background:#eef3d5;color:var(--navy);border-color:#d5df96}
.tool-section{font-size:8px;font-weight:800;text-transform:uppercase;letter-spacing:.1em;color:#899991;text-align:center;border-top:1px solid var(--line);padding-top:7px;margin:3px 3px 0}
.select-group{border:1px solid transparent;border-radius:9px;padding:3px}
.select-group .select-main{width:100%;border:0}
.select-actions{display:grid;grid-template-columns:1fr 1fr;gap:3px}
.select-actions button{padding:5px 2px;border:0;border-radius:5px;background:#e8eee9;color:var(--navy);font-size:14px;font-weight:800}
.select-actions button:first-child{background:var(--teal)}
.select-actions button:last-child{background:#faecee;color:var(--danger)}
.select-actions button.confirm-delete{background:var(--danger);color:#fff;animation:selectionPulse .8s ease-in-out infinite}
.polygon-group{border:1px solid #dce4dd;border-radius:9px;padding:3px;background:#f7f9f6}
.polygon-group .polygon-main{width:100%;border:0}
.polygon-modes{display:grid;grid-template-columns:1fr 1fr;gap:3px}
.polygon-modes button{padding:5px 2px;border:0;border-radius:5px;background:#e8eee9;color:#40554f;font-size:9px}
.polygon-modes button:hover,.polygon-modes button.active{background:var(--teal);color:var(--navy)}

.workspace-shell{position:relative;overflow:hidden;background:#dfe7ea}
.map{position:absolute;inset:0;width:100%;height:100%;background:#e8ece7}
.drop-hint{position:absolute;inset:20px;border:3px dashed var(--teal);background:#e5fbf9df;z-index:1000;display:grid!important;place-items:center;font-size:22px;font-weight:700;color:var(--teal2);border-radius:16px}
.drop-hint.hidden{display:none!important}
.finish-draft{position:absolute;z-index:900;width:38px;height:38px;border-radius:50%;padding:0;background:var(--teal);color:var(--navy);font-size:20px;font-weight:800;border:3px solid #fff;box-shadow:0 3px 12px #243d3766}

/* Leaflet integration */
.leaflet-container{font:inherit;background:#e8ece7}
.leaflet-control-attribution{font-size:10px;background:#ffffffcc;color:#4a5f58}
.leaflet-control-attribution a{color:#2c4a45}
/* Leaflet forces pointer-events:none on every <path> inside a renderer SVG. Markup shapes declare their own hit areas. */
.leaflet-pane>svg [pointer-events="all"]{pointer-events:all}
.leaflet-pane>svg [pointer-events="none"]{pointer-events:none}
.object{cursor:pointer}
.selected-outline{filter:drop-shadow(0 0 2px #fff)}
.vertex{cursor:move}
.midpoint{cursor:copy}
.rotation-handle{cursor:grab}
.rotation-handle:active{cursor:grabbing}
.handle-label{font-size:9px;font-weight:700;fill:#fff;pointer-events:none;text-anchor:middle;dominant-baseline:central}
.text-object{paint-order:stroke;stroke-linejoin:round}
.pin-shape{filter:drop-shadow(0 1px 1px #0005)}
.pin-label,.annotation-label{paint-order:stroke;stroke:#fff;stroke-width:3px;font-weight:700}
.multi-selected{animation:selectionPulse 1.15s ease-in-out infinite;filter:drop-shadow(0 0 3px #cdde66) drop-shadow(0 0 7px #243d37)}
.multi-selected .pin-shape,.multi-selected circle{filter:drop-shadow(0 0 4px #cdde66)}
@keyframes selectionPulse{0%,100%{opacity:1}50%{opacity:.68}}

.properties{background:#fff;border-left:1px solid var(--line);padding:17px 16px;overflow-y:auto}
.panel-head{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);padding-bottom:12px;margin-bottom:15px}
.panel-head span{font-size:11px;color:var(--muted);background:#eef3f5;padding:4px 7px;border-radius:10px}
.properties label{display:block;font-size:12px;font-weight:650;margin:15px 0;color:#46616e}
.properties output{float:right;color:var(--muted);font-weight:500}
.properties input[type=range]{width:100%;accent-color:var(--teal);margin-top:10px}
.properties select{width:100%;height:36px;margin-top:7px;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--text);padding:0 8px}
.properties input[type=text]{width:100%;height:36px;border:1px solid var(--line);border-radius:7px;padding:0 9px;margin-top:7px;color:var(--text)}
.properties input[type=color]:not(#colour){width:100%;height:36px;margin-top:7px;border:1px solid var(--line);border-radius:7px;background:#fff;padding:3px}
.colour-row{display:flex;margin-top:8px}
.colour-row input[type=color]{width:42px;height:36px;border:1px solid var(--line);padding:3px;border-radius:7px 0 0 7px;background:#fff}
.colour-row input[type=text],#colourText{width:100%;height:36px;border:1px solid var(--line);border-left:0;border-radius:0 7px 7px 0;padding:0 9px;text-transform:uppercase;color:var(--text)}
.toggle-row{display:flex!important;align-items:center;justify-content:space-between}
.toggle-row input{accent-color:var(--navy);width:17px;height:17px}
.danger{width:100%;color:var(--danger);border-color:#e8bfc4;margin:13px 0}
.range-stepper{display:grid;grid-template-columns:30px 1fr 30px;align-items:center;gap:5px;margin-top:8px}
.range-stepper input{margin:0!important}
.range-stepper button{padding:3px 0;height:28px;font-weight:800}
.palette-toggle{width:100%;display:flex;align-items:center;justify-content:space-between;margin:-4px 0 8px;padding:7px 9px;background:#f5f7f3;border-color:#dde4de;font-size:11px;font-weight:700}
.palette-section{margin:10px 0}
.palette-section>span{display:block;font-size:10px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin-bottom:6px}
.swatches{display:flex;gap:6px;flex-wrap:wrap;min-height:25px}
.swatch{width:25px;height:25px;padding:0;border:2px solid #fff;border-radius:50%;box-shadow:0 0 0 1px #c7d1ca}
.swatch.active{box-shadow:0 0 0 2px var(--navy)}
.swatch.empty{background:repeating-linear-gradient(45deg,#edf1ec,#edf1ec 4px,#fff 4px,#fff 8px);cursor:default}
.swatch-menu{position:fixed;z-index:1300;background:#fff;border:1px solid var(--line);box-shadow:0 5px 20px #243d3744;padding:4px;border-radius:6px}
.swatch-menu button{border:0;color:var(--danger);font-size:11px}
.option-label{display:block;font-size:12px;font-weight:650;color:#46616e;margin:14px 0 7px}
.pin-types{display:grid;grid-template-columns:repeat(4,1fr);gap:5px}
.pin-types button{height:42px;padding:5px;color:#536b64}
.pin-types button.active{background:#eef3d5;border-color:var(--teal2);color:var(--navy)}
.pin-types svg{width:24px;height:28px;fill:currentColor;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.pin-types svg circle{fill:#fff}
.pin-types button[data-pin-type=flag] svg,.pin-types button[data-pin-type=target] svg{fill:none}
.pin-types button[data-pin-type=target] svg circle:first-child{fill:currentColor}
.pin-types button[data-pin-type=target] svg circle:nth-child(2){fill:#fff}
.properties>#selectionOptions{background:#f5f7ee;border:1px solid #dbe4ad;border-radius:8px;padding:0 10px 10px;margin-bottom:14px}
.properties>#selectionOptions label:first-child{margin-top:10px}
.name-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.properties>#selectionOptions .name-actions button{width:100%;font-size:16px;padding:5px}
.properties>#selectionOptions .name-actions button:first-child{background:var(--teal);border-color:var(--teal);color:var(--navy)}
.measure-card{display:block;background:#eef4f3;border-left:3px solid var(--navy);border-radius:6px;padding:10px 12px;margin-bottom:14px}
.measure-card strong{display:block;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:#7b8e98}
.measure-card span{display:block;font-size:13px;font-weight:700;margin-top:4px}
.object-actions{display:grid;grid-template-columns:1fr;gap:6px;margin-top:14px}
.map-panel{border-top:1px solid var(--line);padding-top:14px;margin-top:16px}
.map-panel .panel-head{margin-bottom:8px}
.quiet-button{width:100%;margin-top:4px;background:#f8faf7}
.layers-panel{border-top:1px solid var(--line);padding-top:14px;margin-top:16px}
.layers-panel .panel-head{margin-bottom:8px}
.layer-bulk-actions{display:grid;grid-template-columns:1fr repeat(4,30px);gap:4px;margin-bottom:7px}
.layer-bulk-actions button{height:29px;padding:2px;font-size:11px}
.layer-bulk-actions .danger{width:auto;margin:0;color:var(--danger)}
.layers-list{display:flex;flex-direction:column;gap:4px;max-height:260px;overflow:auto}
.layer-row{display:grid;grid-template-columns:22px minmax(54px,1fr) repeat(5,22px);gap:2px;align-items:center;border:1px solid var(--line);border-radius:6px;padding:4px 3px;background:#fff}
.layer-row.selected{background:#f2f6da;border-color:#c4d467}
.layer-row.grouped{border-left:4px solid var(--navy)}
.layer-row.layer-hidden{opacity:.55}
.layer-row.dragging{opacity:.45}
.layer-row.drop-target,.group-head.drop-target{outline:2px solid var(--teal);outline-offset:1px}
.layer-row.moved{animation:layerMoved .65s ease}
@keyframes layerMoved{0%{transform:translateY(-8px);background:#cdde66}100%{transform:translateY(0);background:#fff}}
.layer-style{display:grid;place-items:center;width:20px;height:20px;border:2px solid;border-radius:4px;box-shadow:0 0 0 1px #9eaaa3;color:#fff;font-size:11px;font-weight:800;text-shadow:0 1px 2px #000}
.layer-name{border:0;background:transparent;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:4px 2px;font-size:11px}
.layer-row>button:not(.layer-name){padding:2px 0;border:0;font-size:11px;background:transparent}
.layer-row .layer-delete{color:var(--danger);font-size:16px!important}
.layer-edit{display:grid;grid-template-columns:minmax(42px,1fr) 21px 21px;gap:2px;grid-column:2/-1}
.layer-edit input{width:100%;min-width:0;height:25px;border:1px solid var(--teal2);border-radius:4px;padding:2px 5px;font-size:11px}
.layer-edit button{border:0;padding:0;height:25px}
.layer-group{border:1px solid #bfcac2;border-radius:8px;background:#f5f7f3;padding:4px}
.group-head{display:grid;grid-template-columns:25px 1fr 25px;gap:3px;align-items:center;margin-bottom:4px}
.group-head button{border:0;padding:3px;background:transparent}
.group-head input{height:28px!important;margin:0!important;border:0!important;background:transparent!important;font-size:11px;font-weight:700}
.group-members{display:flex;flex-direction:column;gap:3px;padding-left:7px;border-left:3px solid var(--teal)}
.empty-layers{font-size:11px;color:var(--muted);text-align:center}
.help-card{background:#e8f7f6;border-left:3px solid var(--teal);border-radius:6px;padding:12px;margin-top:16px}
.help-card strong{font-size:12px}
.help-card p,.tips p{font-size:11px;line-height:1.5;margin:5px 0 0;color:#58717d}
.tips{margin-top:20px;border-top:1px solid var(--line);padding-top:15px}
.tips strong{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:#7b8e98}

footer{height:36px;background:#fff;border-top:1px solid var(--line);display:grid;grid-template-columns:1fr auto 1fr;align-items:center;padding:0 15px;font-size:11px;color:var(--muted)}
#mapInfo{text-align:right}
.zoom-controls{display:flex;align-items:center;gap:4px}
.zoom-controls button{padding:2px 8px;border:0}
.zoom-controls span{width:44px;text-align:center}
#toast{position:fixed;bottom:50px;left:50%;translate:-50% 20px;background:var(--navy);color:#fff;padding:9px 15px;border-radius:7px;font-size:12px;opacity:0;pointer-events:none;transition:.2s;z-index:1400}
#toast.show{opacity:1;translate:-50% 0}

.modal{position:fixed;inset:0 0 36px;z-index:1500;background:#152d2866;display:grid;place-items:center;padding:20px;backdrop-filter:blur(3px)}
.modal-card{width:min(430px,100%);max-height:calc(100vh - 76px);overflow:auto;background:#fff;border:1px solid var(--line);border-radius:13px;padding:18px;box-shadow:0 18px 55px #172f2966}
.modal-head{display:flex;justify-content:space-between;align-items:flex-start;border-bottom:1px solid var(--line);padding-bottom:13px;margin-bottom:14px}
.modal-head>div{display:flex;flex-direction:column;gap:3px}
.modal-head small,.settings-note,.settings-label span{font-size:11px;color:var(--muted)}
.modal-head button{border:0;padding:1px 7px;font-size:23px;line-height:1;background:transparent}
.modal-card>label{display:block;font-size:12px;font-weight:700;color:#46616e}
.modal-card input[type=text]{width:100%;height:36px;border:1px solid var(--line);border-radius:7px;padding:0 9px;margin-top:7px;color:var(--text)}
.settings-note{line-height:1.45;margin:7px 0 19px}
.settings-label{display:flex;align-items:center;justify-content:space-between;margin-bottom:9px;margin-top:6px;font-size:12px}
.favourite-editor{display:flex;flex-wrap:wrap;gap:8px;min-height:35px;padding:10px;background:#f5f7f3;border:1px solid var(--line);border-radius:8px}
.favourite-chip{position:relative;width:31px;height:31px}
.favourite-chip .swatch{width:31px;height:31px}
.favourite-chip .remove-favourite{position:absolute;right:-5px;top:-6px;width:16px;height:16px;border:0;border-radius:50%;padding:0;background:var(--navy);color:#fff;font-size:11px;line-height:16px}
.add-favourite{display:grid;grid-template-columns:44px 1fr;gap:7px;margin-top:10px}
.add-favourite input{width:44px;height:36px;padding:3px;border:1px solid var(--line);border-radius:7px;background:#fff}
.modal-actions{display:flex;justify-content:flex-end;gap:7px;border-top:1px solid var(--line);padding-top:14px;margin-top:18px}
.version-history{margin-top:20px;padding-top:16px;border-top:1px solid var(--line)}
.version-history ol{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.version-history li{display:grid;grid-template-columns:62px 1fr;gap:8px;align-items:baseline;padding:9px 10px;background:var(--hsg-app-surface-muted,#f5f7f3);border-radius:var(--hsg-app-radius-sm,8px);font-size:11px;line-height:1.35}
.version-history li strong{color:var(--navy);font-size:11px}
.version-history li span{color:var(--muted)}

/* Shared HSG icon sprite integration */
.framework-icon{display:block;width:1em;height:1em;color:currentColor;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.action-icon{width:18px;height:18px;flex:0 0 18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.settings-gear{width:20px;height:20px;flex:0 0 20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.tool-svg{width:23px;height:23px;display:grid!important;place-items:center}
.tool-svg .framework-icon{width:22px;height:22px;fill:currentColor;stroke:currentColor;stroke-width:1.4;stroke-linejoin:round}
.tool-svg circle{fill:#fff;stroke:none}
.polygon-tool-icon svg{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.polygon-tool-icon svg circle{fill:#fff;stroke:currentColor;stroke-width:1.5}
.outline-tool-icon svg{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.outline-tool-icon svg circle{fill:#fff;stroke:currentColor;stroke-width:1.7}
.point-tool-icon svg{fill:currentColor;stroke:none}
.icon-label{display:inline-flex;align-items:center;justify-content:center;gap:6px}
.action-control{display:inline-flex;align-items:center;justify-content:center;gap:6px}
#settingsBtn{display:inline-flex;align-items:center;gap:7px}
.layer-eye-icon{width:16px;height:16px;display:block;margin:auto;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.mobile-properties-head,.mobile-panel-bar,.mobile-panel-backdrop{display:none}

@media(max-width:1180px){.search-wrap{max-width:220px}}
@media(max-width:1040px){.brand-copy{display:none}.brand{min-width:auto}.brand-logo-panel{width:88px}}

@media(max-width:800px){
  :root{--mobile-top:106px;--mobile-tools:72px;--mobile-nav:48px;--mobile-footer:36px}
  button,.button{-webkit-tap-highlight-color:transparent}
  .topbar{height:var(--mobile-top);flex-wrap:wrap;align-content:center;padding:6px 7px;gap:6px}
  .brand{order:1;flex:0 0 58px;min-width:58px;gap:0}
  .brand-logo-panel{width:62px;height:42px;padding:5px;border-radius:7px}
  .search-wrap{order:3;flex:1 0 100%;max-width:none}
  .search-wrap input{height:38px}
  .search-wrap button{flex-basis:38px;width:38px;height:38px}
  .search-results{width:min(420px,92vw);top:44px}
  .file-actions{order:2;min-width:0;flex:1 1 auto;justify-content:flex-end;gap:5px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;padding:1px}
  .file-actions::-webkit-scrollbar{display:none}
  .file-actions button,.file-actions .button{display:inline-flex;flex:0 0 40px;width:40px;height:40px;padding:0;border-radius:9px}
  .file-actions .action-control>span:not(.desktop-only),.file-actions .icon-label>span,#settingsBtn>span{display:none}
  .file-actions .desktop-only,.divider{display:none!important}
  #settingsBtn{gap:0}
  .export-wrap{flex:0 0 40px}
  .menu{position:fixed;top:52px;right:7px;width:180px}

  main{height:calc(100dvh - var(--mobile-top) - var(--mobile-footer) - var(--mobile-nav));display:grid;grid-template-columns:1fr;grid-template-rows:var(--mobile-tools) minmax(0,1fr)}
  .tools{grid-column:1;grid-row:1;min-width:0;border:0;border-bottom:1px solid var(--line);padding:6px 7px;display:flex;flex-direction:row;align-items:stretch;gap:5px;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scrollbar-width:none;box-shadow:0 2px 8px #243d3712;z-index:4}
  .tools::-webkit-scrollbar{display:none}
  .tool,.select-group{flex:0 0 58px;scroll-snap-align:start}
  .tool{width:58px;height:58px;min-height:44px;padding:4px;border-radius:9px}
  .tool-section{display:none}
  .select-group{height:58px;padding:0;border:0}
  .select-group .tool{height:58px}
  .select-group:has(.select-actions:not(.hidden)){flex-basis:104px;display:grid;grid-template-columns:58px 42px;gap:4px}
  .select-actions{grid-template-columns:1fr;gap:2px}
  .select-actions button{min-height:27px;padding:0}
  .polygon-group{flex:0 0 106px;height:58px;padding:2px;display:grid;grid-template-columns:58px 42px;gap:2px;scroll-snap-align:start}
  .polygon-group .polygon-main{height:52px}
  .polygon-modes{grid-template-columns:1fr;gap:2px}
  .polygon-modes button{min-height:24px;padding:1px;font-size:9px}

  .workspace-shell{grid-column:1;grid-row:2;min-width:0;min-height:0}
  .drop-hint{inset:10px;font-size:17px}
  .finish-draft{width:46px;height:46px;font-size:23px}

  .mobile-panel-bar{position:fixed;display:grid;grid-template-columns:1fr 1fr;left:0;right:0;bottom:var(--mobile-footer);height:var(--mobile-nav);z-index:1050;background:#fff;border-top:1px solid var(--line);box-shadow:0 -4px 15px #243d3718;padding:4px 8px calc(4px + env(safe-area-inset-bottom,0px));gap:6px}
  .mobile-panel-bar button{position:relative;display:flex;align-items:center;justify-content:center;gap:7px;height:40px;padding:3px 10px;border:0;background:transparent;color:#536b64;font-size:11px;font-weight:750}
  .mobile-panel-bar button.active{background:#eef3d5;color:var(--navy)}
  .mobile-panel-bar svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
  .mobile-panel-bar b{min-width:17px;height:17px;padding:1px 4px;border-radius:9px;background:#e7ece8;font-size:9px;line-height:15px}
  .mobile-panel-backdrop{position:fixed;display:block;inset:var(--mobile-top) 0 var(--mobile-footer);z-index:1060;background:#152d2855;backdrop-filter:blur(2px)}
  .mobile-panel-backdrop.hidden{display:none!important}
  .properties{display:block;position:fixed;left:0;right:0;bottom:var(--mobile-footer);z-index:1070;width:100%;height:min(72dvh,640px);padding:0 16px 24px;border:0;border-radius:17px 17px 0 0;box-shadow:0 -12px 42px #172f2944;transform:translateY(calc(100% + 12px));transition:transform .22s ease;visibility:hidden;overscroll-behavior:contain}
  body.mobile-panel-open .properties{transform:translateY(0);visibility:visible}
  .mobile-properties-head{position:sticky;top:0;z-index:3;display:flex;align-items:center;justify-content:space-between;height:52px;margin:0 -16px 10px;padding:0 13px 0 18px;background:#fff;border-bottom:1px solid var(--line);border-radius:17px 17px 0 0}
  .mobile-properties-head::before{content:'';position:absolute;top:6px;left:50%;width:38px;height:4px;translate:-50% 0;border-radius:3px;background:#d5ddd6}
  .mobile-properties-head strong{font-size:14px}
  .mobile-properties-head button{width:38px;height:38px;padding:0;border:0;background:#f2f5f2;font-size:24px;line-height:1}
  body[data-mobile-panel="layers"] .properties>:not(.mobile-properties-head):not(.layers-panel){display:none!important}
  body[data-mobile-panel="appearance"] .properties>.layers-panel{display:none!important}
  .properties label{font-size:13px;margin:17px 0}
  .properties input[type=range]{height:24px;margin-top:7px}
  .range-stepper{grid-template-columns:40px 1fr 40px;gap:7px}
  .range-stepper button{height:38px;font-size:18px}
  .colour-row input[type=color]{width:52px;height:44px}
  .colour-row input[type=text],#colourText{height:44px}
  .properties select,.properties input[type=text],.properties input[type=color]:not(#colour){min-height:44px}
  .toggle-row input{width:22px;height:22px}
  .palette-toggle{min-height:42px}
  .swatch{width:34px;height:34px}
  .pin-types button{height:48px}
  .layers-panel{border:0;padding-top:0;margin:0}
  .layers-list{max-height:none;overflow:visible;gap:7px}
  .layer-row{grid-template-columns:28px minmax(70px,1fr) repeat(5,30px);min-height:47px;gap:2px;padding:5px}
  .layer-row>button:not(.layer-name){min-height:34px;font-size:13px}
  .layer-name{font-size:12px}

  footer{position:fixed;left:0;right:0;bottom:0;height:var(--mobile-footer);padding:0 8px;grid-template-columns:minmax(0,1fr) auto;z-index:1051}
  footer #status{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-right:5px}
  #mapInfo{display:none}
  .zoom-controls button{min-width:34px;height:30px;padding:2px 7px}
  #toast{bottom:calc(var(--mobile-footer) + var(--mobile-nav) + 12px);max-width:calc(100% - 28px);text-align:center}
  .modal{inset:0;align-items:end;padding:0}
  .modal-card{width:100%;max-height:88dvh;border-radius:17px 17px 0 0;padding:18px 16px calc(18px + env(safe-area-inset-bottom,0px))}
}

@media(max-width:420px){
  .file-actions{gap:4px}
  .file-actions button,.file-actions .button{flex-basis:38px;width:38px;height:38px}
  .brand{flex-basis:52px;min-width:52px}
  .brand-logo-panel{width:52px}
}
.map-north{position:absolute;top:12px;right:12px;z-index:450;display:grid;place-items:center;width:36px;padding:5px;border-radius:18px;background:#ffffffd9;color:var(--navy);box-shadow:0 1px 6px #243d3722;pointer-events:none;font-size:10px;font-weight:800}.map-north svg{width:19px;height:19px}.leaflet-control-scale-line{background:#ffffffdc;border-color:var(--navy);color:var(--navy);font-weight:650}.location-help{font-size:12px;line-height:1.5;color:var(--muted)}
@media(max-width:800px){.leaflet-bottom.leaflet-left{bottom:32px}}
/* High-contrast address search and readable result cards. */
.topbar .search-wrap{max-width:420px;min-width:200px;gap:6px}.topbar .search-wrap input{background:#fff;color:var(--navy);border:2px solid #cdde66;height:42px;padding:0 15px;font-size:14px;box-shadow:0 0 0 1px #ffffff20}.topbar .search-wrap input::placeholder{color:#5d7069}.topbar .search-wrap input:focus{outline:3px solid #cdde6655;outline-offset:2px}.topbar .search-wrap>button{background:var(--teal);color:var(--navy);border:0;height:42px;width:42px;flex-basis:42px}
.topbar .search-results{top:50px;left:0;right:auto;width:440px;max-width:calc(100vw - 24px);max-height:min(420px,60vh);padding:6px;border-radius:14px;background:rgba(255,255,255,.97);backdrop-filter:blur(18px);color:var(--navy);box-shadow:0 12px 36px #122c3655;overflow-y:auto}.topbar .search-results button{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:4px;min-height:60px;padding:12px;width:100%;white-space:normal;text-align:left;border-radius:8px;line-height:1.4;color:var(--navy);background:transparent}.topbar .search-results button+button{border-top:1px solid #e6ece7}.topbar .search-results button strong{font-size:14px;font-weight:750}.topbar .search-results button span{font-size:12px;color:#52685f}.topbar .search-results button:hover,.topbar .search-results button:focus-visible{background:#edf3d5;outline-offset:-3px}.topbar .search-results button:disabled{opacity:1;color:#52685f;cursor:default}
@media(max-width:800px){.topbar .search-wrap{max-width:none;min-width:0}.topbar .search-wrap input{font-size:16px}.topbar .search-results{width:100%;max-width:100%;top:48px}}
.markup-overlay{position:absolute;inset:0;z-index:450;pointer-events:none;overflow:hidden}.markup-overlay [pointer-events="all"]{pointer-events:all}.markup-overlay [pointer-events="none"]{pointer-events:none}
.map-rotation{position:absolute;top:12px;right:12px;z-index:850;display:flex;align-items:center;gap:3px;padding:4px;background:#ffffffed;backdrop-filter:blur(12px);border:1px solid #d5ddd6;border-radius:24px;box-shadow:0 2px 8px #243d3726}.map-rotation button{display:flex;align-items:center;justify-content:center;border:0;background:transparent;width:32px;height:34px;padding:6px}.map-rotation button:hover{background:#edf3d5}.map-rotation svg{width:19px;height:19px}.map-rotation #northReset{height:42px;flex-direction:column;gap:1px;width:36px;font-size:10px;font-weight:800}.map-rotation #northReset svg{transform-origin:center}

.map-zoom-buttons{position:absolute;right:12px;top:72px;z-index:850;display:grid;background:#fffffff0;border:1px solid #243d3720;border-radius:16px;box-shadow:0 3px 12px #243d3720;overflow:hidden}.map-zoom-buttons button{width:40px;height:40px;border:0;border-radius:0;padding:0;font-size:24px;display:grid;place-items:center;background:transparent}.map-zoom-buttons button+button{border-top:1px solid #243d3720}

/* Fractional zoom and rotation can expose antialiased tile edges. A subpixel
   overlap covers those seams; normal blending avoids bright overlap lines.
   Restrict this to opaque imagery, keeping labels and parcel lines unchanged. */
#map .hsg-basemap-tiles img.leaflet-tile{mix-blend-mode:normal;width:257px!important;height:257px!important;image-rendering:auto}
