*{box-sizing:border-box}body{margin:0;background:#f4f7f5;color:#1c3026;font:15px system-ui,Segoe UI,sans-serif}header{display:flex;align-items:center;justify-content:space-between;padding:18px 5%;background:white;border-bottom:1px solid #dce5df;gap:22px;flex-wrap:wrap}.brand{font-size:24px;font-weight:750;text-decoration:none;color:#05631d;display:flex;align-items:center;gap:10px}.logo{display:inline-grid;place-items:center;background:#05631d;color:white;width:36px;height:36px;border-radius:10px}nav{display:flex;gap:22px;flex-wrap:wrap}a{color:#05631d}nav a{text-decoration:none;font-weight:600}main{max-width:1400px;padding:28px;margin:auto}h1{font-size:27px;margin:0 0 22px}h2{font-size:18px;margin:0 0 20px}.card{background:white;border:1px solid #dce5df;border-radius:12px;padding:24px;margin-bottom:22px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:22px}.stat{padding:20px;background:white;border:1px solid #dce5df;border-radius:10px}.stat span{display:block;color:#66796d;font-size:13px}.stat strong{display:block;margin-top:10px;font-size:26px;color:#05631d}.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}.field{display:flex;flex-direction:column;gap:7px}.wide{grid-column:1/-1}label{font-size:13px;font-weight:650}input,select,textarea{font:inherit;width:100%;padding:10px 12px;border:1px solid #cbd8cf;border-radius:7px;background:white;color:#1c3026}input:focus,select:focus,textarea:focus{outline:2px solid #80b58c;outline-offset:1px}input[type=submit],button,.button{display:inline-block;width:auto;background:#05631d;color:white;padding:11px 19px;border:0;border-radius:7px;text-decoration:none;cursor:pointer;font-weight:650}input[type=checkbox],input[type=radio]{width:auto}.actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:20px}.message{display:block;color:#9b291f;margin:14px 0}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;white-space:nowrap}th{text-align:left;background:#f2f7f3;color:#516457;font-size:13px}th,td{padding:13px;border-bottom:1px solid #e4ebe6}td a{margin-right:10px}footer{padding:20px;text-align:center;color:#708276;font-size:12px}.login{max-width:420px;margin:9vh auto;padding:30px}.login .field{margin:18px 0}.note{color:#66796d;font-size:13px}.badge{background:#e6f3e9;padding:5px 9px;border-radius:6px}.split{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px;gap:12px;flex-wrap:wrap}.split h1{margin:0}@media(max-width:900px){.grid,.stats{grid-template-columns:repeat(2,minmax(0,1fr))}main{padding:18px}nav{gap:14px}}@media(max-width:520px){.grid{grid-template-columns:1fr}.stats{gap:10px}.stat{padding:14px}.stat strong{font-size:23px}.card{padding:18px}}
/* Map and import screens */
nav{align-items:center;gap:16px}input.logout{padding:8px 14px;font-size:13px}.table-button{font-size:12px;padding:8px 11px;white-space:nowrap}.secondary,button.secondary{background:#e7f1e9;color:#05631d;border:1px solid #bfd5c5}.map-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:20px}.map-card{padding:0;overflow:hidden}#plotMap{height:65vh;min-height:420px;background:#e9efeb;display:block}#plotMap>a{display:inline-block;margin:25px}.legend{display:flex;flex-wrap:wrap;gap:15px;padding:12px;font-size:12px}.legend span{display:flex;gap:6px;align-items:center}.legend i{width:14px;height:14px;border:1px solid #555;display:inline-block}#plotDetails dl{margin:0}#plotDetails dt{font-size:12px;color:#617365;margin-top:13px}#plotDetails dd{margin:4px 0;overflow-wrap:anywhere}#plotDetails .actions .button{font-size:12px;padding:8px 12px}#importStatus,#mapMessage{font-size:13px;color:#47634e}.field select{min-width:0}section[hidden]{display:none!important}#previewTable td{max-width:260px;white-space:normal;overflow-wrap:anywhere}@media(max-width:1000px){.map-layout{grid-template-columns:1fr}#plotMap{height:58vh;min-height:360px}}

.import-layout{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(340px,1fr);gap:22px;align-items:start}.import-layout .grid{grid-template-columns:repeat(2,minmax(0,1fr))}.import-main,.import-aside{min-width:0}.file-drop{border:1px dashed #a9cbb4;background:#f6fbf7;border-radius:8px;padding:18px}.file-drop input{margin-top:12px;background:#fff}.import-defaults{margin-top:20px}.import-defaults summary{cursor:pointer;font-weight:600}#importMap{height:340px;border-radius:8px;border:1px solid #dce5df;background:#eff4f0}#sourceAttributes table{font-size:12px}#sourceAttributes td,#selectedAttributes dd{white-space:normal;overflow-wrap:anywhere;max-width:240px}#selectedAttributes{margin-top:15px}#selectedAttributes dt{color:#65796d;font-size:12px;margin-top:10px}#selectedAttributes dd{margin:4px 0}.sample-links{display:flex;gap:16px;flex-wrap:wrap}.import-layout input[type=color]{padding:4px;max-width:80px;height:40px}@media(max-width:1000px){.import-layout{grid-template-columns:1fr}}@media(max-width:520px){.import-layout .grid{grid-template-columns:1fr}}

#plotMap{position:relative}.map-canvas{height:100%;width:100%;min-height:420px}.map-canvas[hidden]{display:none!important}.google-help{margin-top:28px;padding:18px;background:#f3f7f4;border-radius:8px}.google-help li{margin:9px 0}@media(max-width:1000px){.map-canvas{min-height:360px}}

/* Map-only layout: long attributes scroll in the sidebar without stretching the map. */
body.territory-map-page main{padding-bottom:12px}
body.territory-map-page footer:empty{display:none}
body.territory-map-page .map-layout{--territory-map-height:650px;align-items:start}
body.territory-map-page .map-layout>.card{align-self:start;margin-bottom:0;min-width:0}
body.territory-map-page #plotMap{height:var(--territory-map-height);min-height:0}
body.territory-map-page .map-canvas{min-height:0}
body.territory-map-page #plotDetails{max-height:calc(var(--territory-map-height) + 68px);overflow-y:auto;scrollbar-gutter:stable}
@media(max-width:1000px){body.territory-map-page .map-layout{--territory-map-height:650px}body.territory-map-page #plotDetails{max-height:55vh}}

.colour-picker{display:flex;align-items:center;gap:12px}.map-colour-input{width:62px;height:38px;padding:3px;cursor:pointer}.hex-code{font:13px ui-monospace,Consolas,monospace}.legend{max-height:110px;overflow-y:auto}.legend span{white-space:nowrap}

.map-provider-message{margin:0;padding:0 14px;color:#9b291f;font-size:13px}.map-provider-message:not(:empty){padding:10px 14px}.map-provider-message a{font-weight:600}#importMap{overflow:hidden}.google-map-canvas{height:100%;width:100%}

/* Import preview: keep text readable and feedback next to the submit action. */
.import-preview{max-height:440px;overflow:auto;overscroll-behavior:contain}
#previewTable{width:max-content;min-width:100%;table-layout:auto}
#previewTable th,#previewTable td{min-width:105px;max-width:320px;white-space:nowrap;overflow-wrap:normal;word-break:normal;vertical-align:top}
#previewTable th{position:sticky;top:0;z-index:1}
.import-submit-status{margin-top:18px;padding:13px 16px;border:1px solid #aad1b3;border-radius:8px;background:#edf8f0;color:#174d28;overflow-wrap:anywhere}
.import-submit-status.is-error{border-color:#e5a4a4;background:#fff0f0;color:#8f2020}
.import-submit-status[hidden]{display:none}
#ImportButton[aria-busy=true]{opacity:.75;cursor:wait}
#Message:not(:empty){padding:14px 16px;background:#fff8e8;border:1px solid #e7d4a8;border-radius:8px}
