.custom-drawing{--cd-ink:#183d45;--cd-muted:#647b80;--cd-line:#d9e4e5;--cd-bg:#f5f8f8;--cd-accent:#176e61;color:var(--cd-ink);border:1px solid var(--cd-line);border-radius:12px;overflow:hidden;background:#fff;margin:20px 0;min-width:0}
.custom-drawing button,.custom-drawing input,.custom-drawing select{font:inherit}
.custom-drawing button{font-size:12px;min-height:36px;padding:8px 11px;line-height:1.3}
.custom-drawing button[aria-pressed=true]{background:var(--cd-accent);color:#fff;border-color:var(--cd-accent)}
.custom-drawing .cd-toolbar{display:flex;flex-wrap:wrap;justify-content:space-between;gap:9px;padding:12px;background:#fff;border-bottom:1px solid var(--cd-line)}
.custom-drawing .cd-modes,.custom-drawing .cd-history{display:flex;gap:5px;flex-wrap:wrap}
.custom-drawing .cd-stage{position:relative;background:var(--cd-bg);min-width:0;overflow:hidden}
.custom-drawing .cd-canvas{display:block;width:100%;height:360px;touch-action:none;user-select:none;outline-offset:-3px}
.custom-drawing .cd-canvas[data-mode=draw]{cursor:crosshair}.custom-drawing .cd-canvas[data-mode=pan]{cursor:grab}
.custom-drawing .cd-grid{stroke:#e0e8e9;stroke-width:1;pointer-events:none}
.custom-drawing .cd-fill{fill:#e7f1ec;pointer-events:none}
.custom-drawing .cd-segment{stroke:var(--cd-accent);stroke-width:4;stroke-linecap:round;vector-effect:non-scaling-stroke}
.custom-drawing .cd-segment.cd-invalid{stroke:#b74535}.custom-drawing .cd-segment.cd-hover{stroke-width:7}
.custom-drawing .cd-corner{fill:#fff;stroke:var(--cd-accent);stroke-width:2;vector-effect:non-scaling-stroke}
.custom-drawing .cd-corner.cd-selected{fill:var(--cd-accent);stroke:#fff;stroke-width:3}
.custom-drawing .cd-corner.cd-start:not(.cd-selected){fill:#bfe5d6}
.custom-drawing .cd-preview{stroke:#63998d;stroke-width:2;stroke-dasharray:7 5;vector-effect:non-scaling-stroke}
.custom-drawing .cd-candidate{fill:#fff;stroke:#63998d;stroke-width:2}
.custom-drawing .cd-gate{stroke:#456f97;stroke-width:9;stroke-linecap:butt;vector-effect:non-scaling-stroke;pointer-events:none}
.custom-drawing .cd-gate-label{fill:#315a7d;paint-order:stroke;stroke:var(--cd-bg);stroke-width:5;stroke-linejoin:round;pointer-events:none;font-family:inherit}
.custom-drawing [hidden]{display:none!important}
.custom-drawing .cd-dimension,.custom-drawing .cd-corner-number{fill:var(--cd-ink);paint-order:stroke;stroke:var(--cd-bg);stroke-width:6;stroke-linejoin:round;pointer-events:none;font-family:inherit}
.custom-drawing .cd-preview-label{fill:#437e70}.custom-drawing .cd-empty{fill:var(--cd-muted);font-family:inherit}
.custom-drawing .cd-view-tools{position:absolute;right:12px;bottom:12px;display:flex;gap:5px}.custom-drawing .cd-view-tools button{background:#fff;box-shadow:0 2px 8px #163d4510}
.custom-drawing .cd-scale{position:absolute;left:14px;bottom:17px;font-size:11px;color:var(--cd-muted);background:#f5f8f8de;padding:3px 6px;border-radius:4px;pointer-events:none}
.custom-drawing .cd-instruction{padding:11px 14px;border-top:1px solid var(--cd-line);font-size:12px;background:#edf5f2;color:#335f54;min-height:39px}
.custom-drawing .cd-measurements{display:flex;gap:12px 22px;flex-wrap:wrap;padding:10px 14px;color:var(--cd-muted);font-size:12px;border-bottom:1px solid var(--cd-line);font-variant-numeric:tabular-nums}
.custom-drawing .cd-preferences{display:flex;gap:12px 20px;flex-wrap:wrap;padding:12px 14px}
.custom-drawing .cd-preferences label{display:flex;align-items:center;gap:7px;font-size:12px;margin:0;cursor:pointer;font-weight:400}
.custom-drawing .cd-preferences input{width:16px;height:16px;min-height:0;padding:0;margin:0;accent-color:var(--cd-accent)}
.custom-drawing .cd-numeric{border-top:1px solid var(--cd-line);padding:0 14px;margin:0}
.custom-drawing .cd-numeric summary{font-size:12px;padding:12px 0}
.custom-drawing .cd-numeric p{font-size:11px;color:var(--cd-muted);margin:0 0 14px}
.custom-drawing .cd-numeric-fields{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap;padding-bottom:12px}
.custom-drawing .cd-numeric-fields label{flex:1 1 100px;max-width:180px;margin:0;font-size:12px}
.custom-drawing input[type=text],.custom-drawing select{width:100%;min-height:38px;padding:8px;border:1px solid #c7d8da;background:#fff;border-radius:5px;font-size:13px;color:var(--cd-ink);margin:5px 0 0}
.custom-drawing .cd-edit-tools{display:flex;gap:9px;flex-wrap:wrap;align-items:flex-end;padding:0 14px 14px}.custom-drawing .cd-edit-tools[hidden]{display:none}
.custom-drawing .cd-edit-tools label{flex:1 1 90px;max-width:180px;margin:0;font-size:12px}.custom-drawing .cd-edit-tools label:first-child{flex-basis:130px}
.custom-drawing .cd-error{font-size:12px;line-height:1.5;color:#a53d30;background:#fff4f0;margin:0;padding:10px 14px}.custom-drawing .cd-error:empty{display:none}
.custom-drawing .cd-finish{display:flex;flex-wrap:wrap;gap:8px;padding:12px 14px;border-top:1px solid var(--cd-line);background:#fff}.custom-drawing .cd-finish>span{flex:1}.custom-drawing .cd-finish>button[hidden]{display:none}
@media(min-width:1100px){.custom-drawing .cd-canvas{height:420px}}
@media(max-width:540px){.custom-drawing .cd-toolbar{padding:9px}.custom-drawing .cd-modes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%}.custom-drawing .cd-modes button{padding:8px 6px;font-size:11px}.custom-drawing .cd-history{width:100%;justify-content:flex-end}.custom-drawing .cd-canvas{height:320px}.custom-drawing .cd-view-tools{right:9px;bottom:9px}.custom-drawing .cd-scale{bottom:54px;left:10px}.custom-drawing .cd-measurements{gap:6px 14px}.custom-drawing .cd-finish>span{display:none}.custom-drawing .cd-finish>button{flex:1 1 42%}.custom-drawing .cd-finish>button:first-child{flex-basis:100%;border-color:transparent}.custom-drawing .cd-edit-tools label{max-width:none}.custom-drawing .cd-numeric-fields label{max-width:none}.custom-drawing .cd-numeric-fields>button{width:100%}.custom-drawing input[type=text],.custom-drawing select{font-size:16px}}
@media(pointer:coarse){.custom-drawing button{min-height:44px}.custom-drawing .cd-preferences label{min-height:36px}.custom-drawing input[type=text],.custom-drawing select{min-height:44px;font-size:16px}}
.route-editor-dialog{width:min(1100px,calc(100% - 32px));max-height:92dvh;overflow:auto;border:1px solid #c8dbde;border-radius:14px;padding:0;color:#183d45;background:#fff;box-shadow:0 24px 100px #102f4540}
.route-editor-dialog::backdrop{background:#1535418c;backdrop-filter:blur(3px)}
.route-editor-dialog .re-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:22px 24px 12px}
.route-editor-dialog .re-heading h2{font-size:23px;line-height:1.2;margin:0 0 9px}
.route-editor-dialog .re-heading p{font-size:13px;line-height:1.6;color:#617a80;max-width:760px;margin:0}
.route-editor-dialog .re-heading button{border:0;background:transparent;font-size:25px;padding:0 5px;min-width:32px;min-height:32px}
.route-editor-dialog .re-summary{font-size:12px;color:#526e74;padding:0 24px 14px;font-variant-numeric:tabular-nums}
.route-editor-dialog .re-drawing{margin:0 20px 16px}
.route-editor-dialog .cd-canvas{height:340px}
.route-editor-dialog .re-error{font-size:13px;color:#a53d30;line-height:1.5;background:#fff4f0;padding:12px 24px;margin:0}
.route-editor-dialog .re-error:empty{display:none}
.route-editor-dialog .re-footer{position:sticky;bottom:0;display:flex;align-items:center;flex-wrap:wrap;gap:9px;padding:14px 20px;background:#fff;border-top:1px solid #d9e4e5;z-index:2}
.route-editor-dialog .re-history{display:flex;gap:7px}.route-editor-dialog .re-status{flex:1;font-size:11px;color:#617a80;padding:0 8px}
.route-editor-dialog .re-footer button{min-height:38px;font-size:12px;padding:9px 12px}
@media(max-width:600px){.route-editor-dialog{width:calc(100% - 16px);max-height:94dvh}.route-editor-dialog .re-heading{padding:17px 15px 10px}.route-editor-dialog .re-heading h2{font-size:20px}.route-editor-dialog .re-summary{padding:0 15px 12px}.route-editor-dialog .re-drawing{margin:0 10px 12px}.route-editor-dialog .cd-canvas{height:280px}.route-editor-dialog .re-footer{padding:12px}.route-editor-dialog .re-status{flex-basis:calc(100% - 200px)}.route-editor-dialog .re-footer>button{flex:1}.route-editor-dialog .cd-modes{display:flex}.route-editor-dialog .cd-modes>button{flex:1}.route-editor-dialog .re-error{padding:10px 15px}}
