:root{font-family:"DM Sans",system-ui,sans-serif;color:#202e28;background:#f6f7f2;--green:#235641;--border:#d1d9cc;--paper:#fff}*{box-sizing:border-box}body{margin:0}header{height:76px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;padding:0 clamp(18px,5vw,80px);background:#fff}a{color:var(--green)}.brand{display:flex;align-items:center;gap:10px;font-size:25px;font-weight:800;text-decoration:none;letter-spacing:-1.2px}.brand i{width:21px;height:21px;border:6px solid var(--green);border-radius:50% 50% 50% 2px;transform:rotate(-45deg)}nav,.actions,.heading{display:flex;gap:16px;align-items:center}nav a,.text,.back{text-decoration:none;font-size:14px}.text{border:0;background:none;color:var(--green)}main{max-width:1450px;margin:auto;padding:clamp(24px,4vw,62px) clamp(18px,5vw,80px)}h1,h2,p{margin:0}h1{font-size:clamp(30px,4vw,50px);letter-spacing:-.055em;line-height:1.12}h2{font-size:21px;letter-spacing:-.03em}p,small,.back{color:#536258}p{margin-top:7px;line-height:1.5}.heading{justify-content:space-between;margin:16px 0 30px}.heading button{flex-shrink:0}button,select,input{font:inherit}button{cursor:pointer;border:1px solid var(--border);border-radius:9px;background:#fff;padding:10px 15px;color:#20392d;font-weight:600}.primary{background:var(--green);color:white;border-color:var(--green)}.account,dialog{width:min(420px,100%);padding:30px;border:1px solid var(--border);background:white;border-radius:16px}.account{margin:6vh auto}.account h1{font-size:35px}.account form,dialog form{display:grid;gap:14px}.account form{margin-top:24px}label{display:grid;gap:6px;font-size:14px;font-weight:600}input,select{width:100%;padding:11px;border-radius:7px;border:1px solid #adbaad;background:white;color:#202e28}.actions{justify-content:flex-end;margin-top:9px}dialog::backdrop{background:#14281e66}.error{background:#ffe4df;padding:14px;border-radius:8px}.empty,.card,.survey,.details{border:1px solid var(--border);border-radius:14px;background:var(--paper)}.empty{padding:clamp(25px,5vw,68px)}.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:18px}.card{display:block;padding:24px;color:inherit;text-decoration:none}.symbol{display:block;font-size:38px;color:var(--green);margin-bottom:18px}.open{display:block;color:var(--green);margin-top:24px;font-weight:650}.survey{overflow:hidden;display:grid;grid-template-columns:minmax(220px,28%) 1fr;min-height:440px}.survey aside{padding:24px;max-height:65vh;min-height:420px;overflow:auto}.survey aside h2{margin:0 0 14px;font-size:17px}.survey aside h2:nth-of-type(2){margin-top:32px}.layer{display:flex;align-items:center;gap:9px;padding:7px 0}.layer input{width:auto}.swatch{width:11px;height:11px;border-radius:50%;display:inline-block;flex:none}.point{display:flex;align-items:center;gap:9px;width:100%;border:0;text-align:left;padding:9px 0;overflow-wrap:anywhere}.mapbox{position:relative;min-width:0;background-color:#e6ece0;background-image:linear-gradient(#cfd8c450 1px,transparent 1px),linear-gradient(90deg,#cfd8c450 1px,transparent 1px);background-size:30px 30px}.map-info{position:absolute;bottom:12px;left:12px;background:white;color:#304535;padding:6px 10px;border-radius:5px;font-size:12px;pointer-events:none}.map-info:empty{display:none}#map{position:absolute;inset:0}canvas{display:block;width:100%;height:100%}.details{padding:20px;margin-top:16px}.details img{display:block;max-width:min(560px,100%);max-height:380px;object-fit:contain;margin-top:14px}.details p{white-space:pre-wrap}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #549b86;outline-offset:3px}@media(max-width:700px){.survey{grid-template-columns:1fr}.mapbox{grid-row:1;height:42vh;min-height:280px}.survey aside{max-height:340px;min-height:0}.heading{gap:8px}header{height:62px}}

#point-form textarea{font:inherit;padding:10px;border:1px solid #adbaad;border-radius:7px;resize:vertical}
#map-position{margin:0;padding:12px;border:1px solid var(--border);border-radius:9px}
#map-position label{margin-top:8px}
#point-error{color:#96372e}
.details button{margin-top:10px}
@media(max-width:600px){.heading:has(#add-map-point){align-items:flex-start;flex-direction:column}}

body.map-open { overflow: hidden; }
.point-entry { display: flex; align-items: center; gap: 10px; }
.point-entry input, .layer input { width: 17px; height: 17px; margin: 0; flex: none; accent-color: var(--green); }
.point-entry .point:disabled { opacity: .55; cursor: default; }
#map-expand, #legend-toggle, .map-zoom {
    position: absolute;
    z-index: 2;
    background: white;
    box-shadow: 0 2px 12px #12281a29;
}
#imagery-source {
    position: absolute;
    z-index: 2;
    left: 12px;
    top: 12px;
    width: auto;
    max-width: calc(100% - 140px);
    background-color: white;
    color: var(--green);
    box-shadow: 0 2px 12px #12281a29;
}
.survey.expanded #imagery-source { left: auto; right: 12px; top: auto; bottom: 134px; max-width: calc(100% - 24px); }
#map-expand { top: 12px; right: 12px; }
#legend-toggle { top: 12px; left: 12px; }
.map-zoom { bottom: 40px; right: 12px; display: grid; border: 1px solid var(--border); border-radius: 9px; }
.map-zoom button { width: 42px; height: 42px; padding: 0; border: 0; font-size: 24px; line-height: 1; }
.map-zoom button + button { border-top: 1px solid var(--border); border-radius: 0 0 9px 9px; }
.map-info { bottom: 34px; max-width: calc(100% - 85px); }
.survey.expanded {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: block;
    min-height: 0;
    border: 0;
    border-radius: 0;
}
.survey.expanded .mapbox { width: 100%; height: 100%; min-height: 0; }
.survey.expanded aside {
    position: absolute;
    z-index: 2;
    top: 66px;
    left: 12px;
    width: min(300px, calc(100% - 84px));
    min-height: 0;
    max-height: calc(100% - 128px);
    padding: 18px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 3px 18px #12281a30;
    overscroll-behavior: contain;
}
.survey.expanded #details { margin: 0 0 18px; padding: 0 0 16px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; overflow-wrap: anywhere; }
.survey.expanded #details h2 { margin-bottom: 4px; }
.survey.expanded #details img { max-height: 160px; }
@media (max-width: 700px) {
    .survey.expanded aside { max-height: min(44vh, calc(100% - 120px)); }
}

.legend-heading, .layer-header { display: flex; align-items: center; gap: 6px; }
.survey aside .legend-heading h2 { flex: 1; margin: 0; }
.legend-heading button { width: 34px; height: 34px; padding: 0; font-size: 22px; }
.legend-layer { border: 1px solid transparent; border-bottom-color: var(--border); padding: 6px 2px; border-radius: 5px; }
.layer-header .layer { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.layer-header .layer-icon { padding: 4px; width: 32px; height: 32px; line-height: 1; flex: none; }
.legend-layer.drop-target { background: #e0f1e8; border: 1px dashed var(--green); }
.legend-layer .point-entry { padding-left: 22px; }
.point[draggable=true]:enabled { cursor: grab; }
.point[draggable=true]:enabled:active { cursor: grabbing; }
#layer-status { font-size: 13px; overflow-wrap: anywhere; }
#layer-status:empty, #replacement-label[hidden] { display: none; }
.layer-error { color: #96372e; }

.expanded-import { display: none; }
.survey.expanded .expanded-import { display: inline-block; margin: 8px 0; }
#import-editor { max-height: 92vh; overflow: auto; }
#import-form textarea, #import-fields { font: inherit; padding: 9px; border: 1px solid var(--border); border-radius: 8px; }
#import-fields label { margin-top: 10px; }
#import-summary { white-space: pre-line; }
.details details { margin-top: 12px; }
.details summary { cursor: pointer; }
.details dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.details dd { margin: 0; overflow-wrap: anywhere; }

.address-matches { border: 1px solid #aab4ad; border-radius: .5rem; padding: .3rem; background: white; color: #1f1f1f; }
.address-options button { display: block; width: 100%; padding: .6rem; text-align: left; background: white; color: #1f1f1f; border: 0; }
.address-options button:hover, .address-options button:focus-visible { background: #edf4ef; }
.address-matches small { display: block; margin: 10px 10px 5px; font: 400 12px sans-serif; color: #5e5e5e; white-space: nowrap; }

#point-editor { width:min(620px,95vw); max-height:90vh; overflow:auto; }
#point-tools { display:flex; flex-wrap:wrap; gap:8px; }
#point-tools button { display:inline-flex; align-items:center; gap:6px; font-size:14px; padding:8px 10px; }
#point-tools svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
#point-tools[hidden], #point-note[hidden], #point-photos[hidden], #point-gps[hidden] { display:none; }
#pending-photo, #point-photos a { overflow-wrap:anywhere; }
#point-photos img { width:52px; height:52px; object-fit:cover; border-radius:6px; }
#point-photos a { display:flex; align-items:center; gap:10px; margin-top:8px; }
#point-gps { border-top:1px solid var(--border); padding-top:12px; }
#point-gps h3, #point-photos h3 { margin:0 0 8px; }
#point-gps h4 { margin:14px 0 5px; }
#point-gps dl { display:grid; grid-template-columns:minmax(95px,2fr) 3fr; gap:5px 12px; margin:0; font-size:14px; }
#point-gps dd { margin:0; overflow-wrap:anywhere; }
#point-gps dt { color:#536258; }
#point-gps pre { white-space:pre-wrap; overflow-wrap:anywhere; }

#point-depth { border:1px solid var(--border); border-radius:8px; padding:12px; }
#point-depth legend { font-weight:600; }
#point-depth label, #point-depth output:not(:empty) { margin-top:8px; }
#point-depth [hidden], #point-depth[hidden] { display:none; }
#depth-result:not(:empty) { display:block; }

#map-depth{position:absolute;bottom:32px;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 120px);padding:8px 12px;background:white;color:var(--green);border-radius:8px;box-shadow:0 2px 8px #0003;font-weight:600;pointer-events:none}

.segment-caption { display: block; font-weight: normal; }
.segment-length { background: #20392de6; border-radius: 4px; padding: 1px 4px; white-space: nowrap; }
.legend-line-row { margin-left: 22px; display: grid; grid-template-columns: 17px minmax(0, 1fr); align-items: start; gap: 8px; }
.legend-line-row > input { width: 17px; height: 17px; margin: 10px 0 0; accent-color: var(--green); }
.legend-line > summary { padding: 8px 2px; cursor: pointer; color: #20392d; overflow-wrap: anywhere; }
.legend-line > summary::marker { color: var(--green); }
.legend-line > summary:focus-visible { outline: 3px solid #549b86; outline-offset: 1px; }
.legend-line > summary .swatch { width: 16px; height: 3px; border-radius: 2px; margin: 0 7px 4px 2px; }
.legend-line > summary small { margin-left: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.legend-line > .point-entry { border-left: 1px solid var(--border); padding-left: 12px; }

.layer-header .layer-icon, #layer-icon-preview { display: inline-grid; place-items: center; padding: 0; }
.layer-icon-picker { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 8px; }

.property-card { position: relative; overflow-wrap: anywhere; }
.card-map { text-decoration: none; }
.card-map::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }
.card-rename { position: relative; margin-top: 12px; }
.card-name { display: flex; align-items: center; gap: 4px; }
.card-name h2 { min-width: 0; }
.card-name :is(.edit-name, .delete-property) { position: relative; z-index: 1; display: grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border: 0; background: transparent; color: var(--green); }
.edit-name:hover, .edit-name[aria-expanded="true"] { background: #edf3ed; }
.property-card .card-rename { z-index: 1; }
.card-rename .actions { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }

.card-rename label + label, .card-rename .address-matches { margin-top: 9px; }
.address-status:not(:empty) { display: block; margin-top: 5px; }

.card-name .delete-property { color: #934032; }
.card-name .delete-property:hover { background: #faedea; }
.delete-final { background: #94382f; color: white; border-color: #94382f; }
.delete-final:disabled { background: #eee; border-color: #ddd; color: #666; cursor: default; }
