/* Map-first layout with familiar search, layers and detail panels. */
body{overflow:hidden;background:#fff;color:#26332c}header{height:58px;padding:0 20px;background:white}.brand{font-size:21px;gap:8px}.logo{font-size:31px}.brand small{font-size:8px;letter-spacing:1.4px}.header-title{display:block;font-size:13px;font-weight:600}.readonly{font-size:11px;border:0;background:#eef5ee;padding:7px 12px}.notice{height:29px;min-height:29px;font-size:10px;background:#f1f4f2;color:#59665e;padding:5px 12px}.notice b{font-size:8px}main{position:relative;height:calc(100dvh - 87px);min-height:0;display:block}.map-area{position:absolute;inset:0;width:100%;height:100%;min-height:0}.sidebar{position:absolute;z-index:650;left:16px;top:64px;bottom:42px;width:310px;padding:18px;background:white;border:1px solid #dce1de;border-radius:10px;box-shadow:0 3px 16px #162b2820;transition:opacity .15s,transform .15s}.intro h1{font-family:inherit;font-size:17px;font-weight:700;letter-spacing:0;margin:0 0 7px}.intro p{font-size:11px;margin:0 0 16px;line-height:1.4}.eyebrow{display:none}.search-label{font-size:10px}.search-wrap{border-radius:6px;padding:10px;background:#f8faf9}.search-wrap input{font-size:12px}.filter-heading{font-size:11px;margin:18px 0 10px}.filters{max-height:34vh;min-height:70px;overflow:auto;gap:5px;grid-template-columns:1fr 1fr}.filter{padding:8px 7px;font-size:10px;border-color:#e3e8e4}.filter.active{background:#e7f0e9;border-color:#367652}.filter small{font-size:9px}.results-heading{margin:16px 0 6px;font-size:11px}.results{min-height:50px;max-height:none;overflow:auto}.result{padding:10px 4px}.result b{font-size:11px}.result small{font-size:9px}footer{display:block;padding-top:10px;font-size:8px}footer span{font-size:9px}.panel-toggle{position:absolute;z-index:660;left:16px;top:16px;height:36px;border:1px solid #dce1de;border-radius:7px;background:white;color:#26332c;padding:0 14px;font-size:12px;box-shadow:0 2px 8px #162b281c;display:flex;align-items:center;gap:10px}.panel-toggle span{font-size:16px}.panel-closed .sidebar{visibility:hidden;opacity:0;transform:translateX(-20px);pointer-events:none}.map-title{left:auto;right:16px;top:145px;max-width:210px;background:#ffffffeb;padding:10px 12px;font-size:11px;border-radius:6px;box-shadow:0 2px 6px #0001}.map-title small{font-size:9px;margin:5px 0 0;max-width:190px}.background-picker{left:auto;right:16px;top:90px;width:210px;max-width:210px;padding:9px 12px;background:white;box-shadow:0 2px 8px #162b281c;border-radius:6px}.background-picker label{font-size:8px;margin-bottom:4px}.background-picker select{font-size:11px}.leaflet-control-zoom{margin:16px 16px 0 0!important;border-radius:7px!important;box-shadow:0 2px 8px #162b281c!important}.leaflet-control-zoom a{background:white;width:34px;height:30px;line-height:30px}.fit{left:auto;right:16px;bottom:55px;background:white;border-radius:7px;padding:10px 14px;font-size:11px;box-shadow:0 2px 8px #162b281c}.north{right:20px;bottom:105px;width:30px;font-size:23px;background:#ffffffe6;border-radius:20px;padding:5px}.north small{font-size:8px}.leaflet-control-scale{margin:0 0 18px 16px!important}.leaflet-control-attribution{max-width:70%;font-size:8px!important}.detail{z-index:700;right:16px;top:220px;width:285px;max-height:calc(100% - 265px);border-radius:9px;background:white;padding:20px;overflow:auto}.detail h2{font-family:inherit;font-size:24px;font-weight:600;margin-top:16px}.detail .species{font-size:11px;margin-bottom:14px}.detail dl{font-size:11px}.detail .note{font-size:10px}.harvest{padding:12px}.tree-symbol{width:16px;height:16px;border-radius:50%;border-width:1px}.filter .tree-symbol,.result .tree-symbol{width:11px;height:11px}
@media(max-width:900px){.header-title{display:none}.sidebar{width:275px;padding:15px}.map-title{max-width:180px}.background-picker{width:180px}.detail{width:260px}}
@media(max-width:650px), (max-width:950px) and (max-height:500px){header{height:52px;padding:0 12px}.brand{font-size:19px}.brand small{font-size:7px}.readonly{font-size:9px}.notice{height:34px;min-height:34px;font-size:9px;justify-content:flex-start;line-height:1.3}.notice b{display:none}main{height:calc(100dvh - 86px)}.sidebar{top:60px;left:10px;bottom:40px;width:min(300px,calc(100% - 68px));padding:15px}.panel-toggle{top:12px;left:10px;font-size:11px;height:36px}.filters{max-height:30vh;grid-template-columns:1fr 1fr}.filter small{display:block}.map-title{display:none}.background-picker{top:auto;bottom:45px;left:10px;right:auto;width:165px}.leaflet-control-zoom{margin:12px 10px 0 0!important}.fit{right:10px;bottom:45px;padding:12px 10px;font-size:10px}.north{right:12px;bottom:105px}.detail{top:auto;bottom:105px;right:10px;width:min(285px,calc(100% - 20px));max-height:calc(100% - 180px);padding:16px}.detail h2{font-size:22px}.leaflet-control-attribution{max-width:100%;font-size:7px!important}.leaflet-control-scale{margin-bottom:92px!important}.sidebar footer{display:block}}

.sidebar{overflow:hidden}.sidebar footer{display:none}.filters{flex-shrink:1}.intro,.search-label,.search-wrap,.filter-heading,.results-heading{flex-shrink:0}

.brand-image{display:block;width:210px;height:auto;max-height:50px;object-fit:contain}@media(max-width:650px), (max-width:950px) and (max-height:500px){.brand-image{width:175px;max-height:44px}.readonly{padding:5px 7px}}

.location-tools{position:absolute;z-index:640;right:16px;bottom:165px;max-width:210px;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:5px}.location-tools button{border:1px solid #dce1de;border-radius:7px;background:white;color:#26332c;padding:10px 12px;font:inherit;font-size:12px;box-shadow:0 2px 8px #162b281c;cursor:pointer}.location-tools button[aria-pressed="true"]{color:#145ab0;border-color:#1674df}.location-tools p{margin:0;background:#fff;padding:8px 10px;border-radius:6px;font-size:11px;line-height:1.4;box-shadow:0 2px 8px #162b281c}.location-tools [hidden]{display:none}@media(max-width:650px), (max-width:950px) and (max-height:500px){.location-tools{right:10px;bottom:155px;max-width:180px}}

svg.tree-symbol{background:none;border:0;border-radius:0;box-shadow:none;overflow:visible;fill:var(--tree-color);stroke:white;stroke-width:1.5;filter:drop-shadow(0 1px 1px #0005)}

/* Compact map controls and collapsible explorer. */
.map-title{display:none!important}.sidebar .background-picker{position:static;width:100%;max-width:none;margin-top:12px;box-shadow:none;border-top:1px solid #e3e8e4;border-radius:0;padding:10px 0 0;flex-shrink:0}.panel-close{position:absolute;right:10px;top:9px;width:32px;height:32px;border:0;border-radius:6px;background:#f1f5f2;font-size:24px;cursor:pointer}.intro h1{padding-right:32px}.rotation-controls{position:absolute;z-index:640;right:16px;top:94px;display:flex;align-items:center;background:white;border-radius:8px;box-shadow:0 2px 8px #0002}.rotation-controls button{border:0;background:transparent;min-width:38px;height:44px;cursor:pointer;font-size:23px;color:#26332c}.rotation-controls small{display:block;font-size:10px}.rotation-controls #north-reset{font-size:20px;line-height:20px;min-width:48px}.rotation-controls #compass-arrow{display:inline-block}.detail{top:160px;max-height:calc(100% - 205px)}.location-tools{bottom:110px}.panel-toggle{min-height:42px}.filter{min-height:35px}button:focus-visible,select:focus-visible{outline:3px solid #1674df;outline-offset:2px}@media(max-width:650px), (max-width:950px) and (max-height:500px){.rotation-controls{right:10px;top:88px}.rotation-controls button{min-width:35px}.detail{top:auto;bottom:100px;max-height:calc(100% - 180px)}.location-tools{bottom:105px}.sidebar .background-picker{position:static;width:100%}}

.tree-marker{display:flex;align-items:center;justify-content:center}.tree-marker svg.tree-symbol{width:var(--marker-size,16px);height:var(--marker-size,16px);flex:none}.notice{font-size:11px}.harvest dl{margin-bottom:0}

/* Keep map panes below controls and give zoom buttons complete touch targets. */
#map{position:absolute;inset:0;z-index:0;isolation:isolate}
.fit{z-index:640;left:16px;right:auto;bottom:52px;min-height:44px}
.leaflet-control-zoom{width:44px;border:0!important;overflow:hidden}
.leaflet-control-zoom a,.leaflet-touch .leaflet-control-zoom a{display:block;width:44px;height:44px;line-height:44px;background:#fff;color:#26332c;opacity:1;text-decoration:none}
.leaflet-control-zoom a.leaflet-disabled{color:#858b87;background:#f1f3f1}
.rotation-controls{top:116px;flex-wrap:wrap;max-width:200px}
.rotation-controls #phone-compass{font-size:12px;padding:0 10px}
.rotation-controls #phone-compass[aria-pressed="true"]{color:#145ab0;background:#eaf3ff}
#compass-status{width:100%;font-size:11px;line-height:1.4;margin:0;padding:8px 10px;border-top:1px solid #eee}
#compass-status[hidden]{display:none}
@media(max-width:650px), (max-width:950px) and (max-height:500px){.rotation-controls{top:112px;max-width:180px}.fit{left:10px;right:auto;bottom:45px}}

/* A quiet, scrollable legend when the explorer is tucked away. */
.map-key{position:absolute;z-index:640;left:16px;top:68px;max-height:calc(100% - 180px);width:max-content;max-width:170px;overflow-y:auto;overscroll-behavior:contain;background:#fffffff2;border:1px solid #dce1de;border-radius:8px;padding:8px 10px;box-shadow:0 2px 8px #162b281c}
.map-key[hidden]{display:none}.map-key ul{list-style:none;margin:0;padding:0}.map-key li{display:flex;align-items:center;gap:7px;min-height:22px;font-size:11px;line-height:1.25;color:#26332c}.map-key svg.tree-symbol{width:12px;height:12px;flex:0 0 12px}
@media(max-width:650px), (max-width:950px) and (max-height:500px){.map-key{left:10px;top:62px;max-width:142px;padding:7px 8px;max-height:calc(100% - 170px)}.map-key li{font-size:10px;min-height:21px}}

.key-type{display:flex;align-items:center;gap:7px;border:0;background:transparent;color:inherit;text-align:left;width:100%;min-height:28px;padding:4px 2px;font-size:inherit;border-radius:4px}
.key-type:hover,.key-type[aria-pressed="true"]{background:#e0eddf;color:#163f29}.key-type[aria-pressed="true"]{font-weight:700;box-shadow:inset 3px 0 #367652;padding-left:6px}
.key-toggle{display:none;position:absolute;z-index:650;top:62px;left:10px;min-height:40px;padding:8px 13px;background:white;border:1px solid #dce1de;border-radius:7px;color:#26332c}
.filter-summary{position:absolute;z-index:645;left:50%;top:16px;transform:translateX(-50%);display:flex;align-items:center;gap:10px;max-width:45%;padding:5px 7px 5px 12px;background:white;border-radius:8px;box-shadow:0 2px 8px #0002;font-size:12px}
.filter-summary[hidden],.map-message[hidden]{display:none}.filter-summary span{overflow-wrap:anywhere}.filter-summary button{flex-shrink:0;border:0;border-radius:5px;background:#e7f0e9;padding:10px;color:#234732;min-height:36px}
.map-message{position:absolute;z-index:645;bottom:12px;left:180px;background:white;padding:8px;border-radius:6px;font-size:12px}
.detail h2{margin-top:10px}.detail details{margin-top:18px}.detail summary{cursor:pointer;font-size:12px;padding:10px 0}.share-tree{min-height:44px;margin-top:14px;width:100%;border:1px solid #367652;border-radius:6px;background:#e7f0e9;color:#234732}.detail .close{width:40px;height:40px;right:4px;top:4px}.detail #share-status,.detail #share-fallback{font-size:12px}.detail #tree-link{border:1px solid #ccc;padding:8px;margin-top:6px;width:100%}
@media(max-width:650px), (max-width:950px) and (max-height:500px){.key-toggle:not([hidden]){display:block}.map-key{top:108px;max-height:calc(100% - 210px)}.key-collapsed .map-key{display:none}.key-type{min-height:36px}.filter-summary{top:auto;bottom:46px;left:auto;right:10px;transform:none;max-width:calc(100% - 145px);font-size:11px;gap:5px}.detail{bottom:100px;max-height:48%}.map-message{bottom:95px;left:10px;right:10px}}
/* Compact phone controls: retain readable text and browser pinch zoom. */
@media(max-width:650px), (max-width:950px) and (max-height:500px){
 header{height:40px;padding:0 8px}.brand-image{width:140px;max-height:34px}.readonly{font-size:8px;padding:4px 6px}
 .notice{height:28px;min-height:28px;font-size:9px;padding:3px 8px;line-height:1.2}main{height:calc(100dvh - 68px)}
 .panel-toggle{top:8px;left:8px;height:34px;min-height:34px;font-size:10px;padding:0 9px;gap:5px}
 .key-toggle{top:48px;left:8px;min-height:32px;padding:5px 9px;font-size:11px}
 .leaflet-control-zoom{width:34px;margin:8px 8px 0 0!important}.leaflet-control-zoom a,.leaflet-touch .leaflet-control-zoom a{width:34px;height:34px;line-height:34px;font-size:20px}
 .rotation-controls{top:84px;right:8px;max-width:148px}.rotation-controls button{height:34px;min-width:30px}.rotation-controls #phone-compass{font-size:10px;padding:0 7px}.rotation-controls #north-reset{min-width:32px;font-size:17px;line-height:16px}.rotation-controls small{font-size:8px}
 #compass-status{font-size:10px;padding:5px 7px;line-height:1.25;max-height:56px;overflow:auto}
 .location-tools{right:8px;bottom:88px;max-width:150px;gap:4px}.location-tools button{font-size:10px;padding:7px 8px;min-height:32px}.location-tools p{font-size:10px;padding:5px 7px;line-height:1.25;max-height:64px;overflow:auto}
 .fit{left:8px;bottom:40px;min-height:34px;padding:7px 8px;font-size:10px}
 .filter-summary{right:8px;bottom:40px;max-width:calc(100% - 125px);padding:3px 4px 3px 8px;font-size:10px;gap:5px}.filter-summary button{padding:6px;min-height:28px;font-size:10px}.filter-summary span{max-height:40px;overflow:auto}
 .map-key{top:86px;left:8px;max-width:130px;max-height:min(45dvh,calc(100% - 195px));padding:5px 7px}.map-key li{font-size:10px}.key-type{min-height:28px;padding:3px 1px;gap:5px}.map-key svg.tree-symbol{width:10px;height:10px;flex-basis:10px}
 .sidebar{left:8px;top:48px;bottom:40px;width:min(270px,calc(100% - 64px));padding:12px}.intro h1{font-size:16px}.intro p{font-size:10px;margin-bottom:10px}.filter-heading{margin:10px 0 6px}.filter{min-height:30px;padding:6px 5px}.results-heading{margin:10px 0 5px}
 .detail{right:8px;bottom:84px;width:min(260px,calc(100% - 16px));max-height:43%;padding:12px}.detail h2{font-size:19px;margin:5px 28px 6px 0}.detail .species{font-size:10px;margin-bottom:8px}.detail dl{font-size:10px;gap:7px 4px;padding-top:10px}.harvest{margin-top:10px;padding:9px}.harvest b{font-size:10px}.share-tree{min-height:34px;margin-top:9px;font-size:11px}.detail details{margin-top:8px}.detail summary{font-size:11px;padding:7px 0}.detail .close{width:32px;height:32px;font-size:20px}
 .leaflet-control-scale{margin-left:8px!important;margin-bottom:80px!important}
}

@media(max-width:950px) and (max-height:500px){header{height:32px}.brand-image{width:118px;max-height:28px}.notice{display:none}main{height:calc(100dvh - 32px)}.detail{bottom:44px;max-height:70%;width:240px}.sidebar{overflow-y:auto;bottom:8px}.sidebar .results{flex:none;max-height:100px}.map-key{max-height:calc(100% - 140px)}.location-tools{bottom:80px}}

.map-bottom-actions {
  position: absolute;
  z-index: 640;
  left: 16px;
  bottom: 26px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.map-bottom-actions .fit {
  position: static;
  white-space: nowrap;
}
.map-bottom-actions:has(.survey-layer-control[open]) {
  z-index: 710;
}
.survey-layer-control summary,
.survey-layer-options {
  background: #fff;
  color: #26332c;
  border-radius: 7px;
  box-shadow: 0 2px 8px #162b2826;
  font-size: 13px;
}
.survey-layer-control summary {
  min-height: 44px;
  padding: 12px;
  cursor: pointer;
  font-weight: 600;
}
.survey-layer-control summary:focus-visible {
  outline: 3px solid #c18f38;
  outline-offset: 3px;
}
.survey-layer-options {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: calc(100vw - 20px);
  padding: 4px 0;
}
.survey-layer-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 12px;
  cursor: pointer;
}
.survey-layer-options label + label {
  border-top: 1px solid #e3e8e4;
}
.survey-layer-options input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #254d35;
}
.survey-layer-swatch {
  width: 20px;
}
.survey-layer-swatch--fence-lines {
  border-top: 3px dashed var(--survey-layer-color);
}
.survey-layer-swatch--aoi {
  height: 14px;
  background: repeating-linear-gradient(45deg, var(--survey-layer-color) 0 3px, transparent 3px 7px);
  opacity: 0.5;
}
@media (max-width: 650px), (max-width: 950px) and (max-height: 500px) {
  .map-bottom-actions { left: 10px; }
  .survey-layer-control summary { font-size: 12px; }
}
@media (max-width: 480px) {
  .map-area .location-tools { max-width: min(205px, calc(100% - 216px)); }
}
