:root{font-family:Inter,Arial,'Segoe UI',sans-serif;color:#172b40;background:#f6f8fb}*{box-sizing:border-box}body{margin:0}header{height:64px;display:flex;justify-content:space-between;align-items:center;padding:0 18px;background:#fff;border-bottom:1px solid #dfe6ee}.brand,.headright,.flex{display:flex;align-items:center;gap:10px}.headright{font-size:13px}.brand-logo{width:42px;height:42px;object-fit:contain}.layout{display:grid;grid-template-columns:370px minmax(0,1fr);height:calc(100dvh - 64px)}aside{overflow:auto;border-right:1px solid #dfe6ee;background:#fff}.tabs{display:flex;overflow:auto;border-bottom:1px solid #e2e8f0}.tab{border:0;background:#fff;padding:13px 10px;border-bottom:3px solid transparent;font-size:12px;font-weight:600;color:#58677a;cursor:pointer}.tab.active{color:#1363ae;border-color:#1363ae}.panel{padding:16px}.maparea{position:relative;min-width:0}.mapinfo{position:absolute;z-index:600;top:12px;left:50%;transform:translateX(-50%);padding:9px 14px;background:#fff;border-radius:20px;box-shadow:0 3px 14px #13274425;font-size:13px;max-width:80%;text-align:center;pointer-events:none}#map{height:100%;width:100%}h1{font-size:24px}h2{margin:2px 0;font-size:18px}h3{font-size:15px;margin:12px 0}.between{justify-content:space-between}.wrap{flex-wrap:wrap}button{border:0;border-radius:7px;background:#2166b1;color:#fff;padding:10px 14px;cursor:pointer;font-weight:600}button:hover{filter:brightness(.95)}button.secondary{background:#e7eef8;color:#194569}.small{padding:7px 10px;font-size:12px}.danger{background:#b6303b}input,select,textarea{width:100%;padding:10px;border:1px solid #cbd5e1;border-radius:7px;background:white;color:#20334a;font:inherit}input[type=color]{width:65px;height:42px;padding:3px}input[type=range]{min-width:120px}label{display:block;font-size:13px;font-weight:600;margin:12px 0 7px}label input,label select,label textarea{margin-top:5px}.hint,.muted{color:#697a8c;font-size:12px;line-height:1.5}.item-list{margin-top:12px;display:flex;flex-direction:column;gap:6px}.item{background:#f4f7fb;border:1px solid #e2eaf3;border-radius:8px;padding:10px;cursor:pointer;text-align:left;display:flex;align-items:center;gap:10px;color:#20334a}.item.selected{border-color:#2166b1;background:#eaf4ff}.swatch{height:16px;width:16px;border-radius:4px;flex-shrink:0}.item small{display:block;font-weight:400;color:#687a8c}.editor{margin-top:16px;border-top:1px solid #dde6ee;padding-top:10px}.hidden{display:none!important}.auth{min-height:100vh;display:grid;place-items:center;padding:24px}.auth-card{background:white;padding:28px;width:min(450px,100%);border-radius:12px;box-shadow:0 12px 50px #1e3a5f20}.auth-card button{width:100%;margin-top:16px}.error{background:#fce8e8;color:#8d2323;border-radius:7px;padding:10px;font-size:13px}#toast{position:absolute;z-index:900;bottom:20px;left:50%;transform:translateX(-50%);background:#173e61;color:#fff;border-radius:9px;padding:11px 18px;display:none;box-shadow:0 4px 18px #132c4855}.street-label{background:#ffffffdf;border:0;border-radius:4px;padding:2px 5px;color:#172a41;font-weight:bold;box-shadow:0 1px 4px #0002}.street-label:before{display:none}hr{border:0;border-top:1px solid #e2e8f0;margin:18px 0}@media(max-width:760px){header{height:56px}.layout{grid-template-columns:1fr;grid-template-rows:44vh 1fr;height:calc(100dvh - 56px)}aside{grid-row:2;grid-column:1}.maparea{grid-row:1;grid-column:1}.panel{padding:12px}.brand strong{font-size:13px}}
/* v0.2 */
.road-path-label{fill:#152c3a;font-size:13px;font-weight:700;stroke:#fff;stroke-width:3.5px;stroke-linejoin:round;paint-order:stroke fill;letter-spacing:.35px}
.style-group{border:1px solid #e0e8f1;border-radius:8px;padding:9px;margin:10px 0}
.style-group h4{margin:2px 0 7px;font-size:13px}
.style-row{display:grid;grid-template-columns:1fr 1fr 1.3fr;gap:7px;align-items:end}
.style-row label{margin:0;font-size:11px}.style-row input,.style-row select{min-width:0;padding:6px;margin-top:4px}
.style-row input[type=color]{width:100%}
#panel-shares .item,#panel-users .item{width:100%}
#panel-history .item{cursor:default}
button:disabled{opacity:.45;cursor:not-allowed}

/* v0.3 navigation and print dialog */
.top-tabs{height:50px;align-items:stretch;background:#fff;padding:0 12px;gap:4px;white-space:nowrap;overflow-x:auto;overflow-y:hidden;box-shadow:0 1px 5px #0001}
.top-tabs .tab{font-size:13px;padding:10px 15px;flex-shrink:0}.top-tabs .export-launch{margin-left:auto;color:#1165a8;font-weight:800}
.layout{height:calc(100dvh - 114px)}body.wide-panel .layout{grid-template-columns:minmax(370px,520px) minmax(0,1fr)}
body.wide-panel aside{background:#fbfcff}.top-tabs .tab:hover{background:#f0f5fb}
.export-modal{position:fixed;inset:0;z-index:2000;background:#07172acb;display:grid;place-items:center;padding:18px}
.export-dialog{width:min(1450px,100%);max-height:calc(100dvh - 36px);display:flex;flex-direction:column;background:#f8fafc;border-radius:16px;overflow:hidden;box-shadow:0 24px 85px #0006}
.export-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fff;padding:16px 20px;border-bottom:1px solid #e2e8f0}
.export-bar h2{margin:0 0 5px}.export-bar p{margin:0;color:#64748b;font-size:12px}
.export-body{display:grid;grid-template-columns:minmax(300px,355px) minmax(0,1fr);min-height:0;overflow:auto}
.export-options{overflow:auto;max-height:calc(100dvh - 140px);padding:16px 20px;background:white;border-right:1px solid #e0e8f1}
.export-options label{margin:8px 0;font-size:12px}.export-options label:has(input[type=checkbox]){display:flex;align-items:center;gap:8px;font-size:13px;font-weight:500}.export-options input[type=checkbox]{width:auto;margin:0}
.export-options input,.export-options textarea,.export-options select{padding:8px}.export-2col{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.export-preview-wrap{padding:14px;overflow:auto;display:flex;flex-direction:column;align-items:center;gap:10px;min-width:0}
.export-preview-header{display:flex;width:100%;align-items:center;justify-content:space-between;gap:10px;font-size:13px}
.export-card{background:#fff;width: min(100%,660px);height:660px;display:flex;flex-direction:column;border:1px solid #d9e1eb;box-shadow:0 5px 24px #0d294e26;overflow:hidden;position:relative;--head-height:90px}
.export-card-head{flex:0 0 90px;padding:16px 24px;display:flex;align-items:center;justify-content:space-between;gap:12px;color:#16283d}
.export-card-head strong{font-size:15px;letter-spacing:.4px}.export-card-head #prev-area{font-weight:700;margin-top:5px}.export-card-head #prev-description{color:#50657b}.prev-sector-number{font-weight:900;font-size:36px;white-space:nowrap}
#export-map{width:100%;flex:1;min-height:190px;background:#edf1f4;z-index:0}
.export-card-footer{flex:0 0 65px;display:flex;align-items:center;justify-content:center;text-align:center;padding:9px 25px;font-size:11px;color:#425067}
.export-actions{display:flex;justify-content:flex-end;width:100%}
#exp-status{min-height:30px;text-align:center;width:100%}
@media(max-width:900px){.export-body{grid-template-columns:1fr}.export-options{max-height:none;border-bottom:1px solid #e2e8f0}.export-card{max-width:640px}.export-dialog{height:calc(100dvh - 24px)}.export-modal{padding:12px}body.wide-panel .layout{grid-template-columns:370px minmax(0,1fr)}}
@media(max-width:760px){.layout,body.wide-panel .layout{height:calc(100dvh - 106px);grid-template-columns:1fr;grid-template-rows:43vh 1fr}.top-tabs{height:50px}.export-bar{padding:10px}.export-card-head{padding:8px 12px;flex-basis:75px}.export-card-head strong{font-size:12px}}

.prev-sector-right{display:flex;align-items:center;gap:10px}.prev-sector-right img{max-width:40px;max-height:40px;object-fit:contain}

/* v0.4 */
.export-zoom-actions{display:flex;gap:8px;margin:5px 0 12px}.export-zoom-actions button{min-width:54px}
.prev-qr{width:54px;height:54px;display:flex;align-items:center;justify-content:center;background:white}
.prev-qr canvas,.prev-qr img{width:54px!important;height:54px!important}
#exp-pick-nav.is-active{background:#d85d27;color:white}
#exp-status{line-height:1.55}

#export-map{transform-origin:50% 50%;transition:transform .12s linear}
.prev-qr canvas,.prev-qr img{display:block}
.prev-compass{position:absolute;right:18px;top:calc(var(--head-height) + 14px);width:48px;height:86px;background:#ffffffde;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;color:#263c4f;z-index:400;padding-top:8px;box-sizing:border-box}.prev-compass span{font-weight:700;font-size:26px;line-height:1}.prev-compass i{display:block;width:0;height:0;border-left:13px solid transparent;border-right:13px solid transparent;border-bottom:30px solid #263c4f;margin-top:8px;transform-origin:50% 75%}.prev-compass.hidden{display:none}

/* v0.5.1 — A canvas preview drawn from the same renderer as the PNG.
   The Leaflet map remains north-up, untransformed and draggable. */
#export-map{transform:none!important;transition:none!important;overflow:hidden}
#export-live-canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:650;display:none}
#export-live-canvas.ready{display:block}
.prev-qr,.prev-qr canvas,.prev-qr img{width:auto!important;height:auto!important;max-width:none!important;max-height:none!important}
