/* Milebs v0.5.9 — layout based on the approved route-planning reference. */
:root{--r-blue:#0866f5;--r-blue-2:#1479ff;--r-navy:#101f35;--r-navy-2:#172b46;--r-green:#10a86b;--r-ink:#17263b;--r-muted:#68798f;--r-line:#dfe6f0;--r-bg:#f3f6fb;--r-card:#fff}
.route-planning-heading{min-height:76px;padding:12px 22px;display:flex;align-items:center;justify-content:space-between;gap:16px;background:#fff;border-bottom:1px solid var(--r-line)}
.route-heading-title{display:flex;align-items:center;gap:12px;min-width:0}.route-heading-icon{width:40px;height:40px;display:grid;place-items:center;color:var(--r-blue);background:#edf4ff;border-radius:11px}.route-heading-icon svg{width:22px;height:22px}.route-heading-title h1{margin:0;color:var(--r-ink);font-size:21px;letter-spacing:-.35px}.route-heading-title p{margin:4px 0 0;color:var(--r-muted);font-size:11px}
.route-heading-actions{display:flex;align-items:center;gap:10px}.route-heading-actions label{display:grid;gap:3px;padding:5px 10px;border:1px solid var(--r-line);border-radius:8px;background:#fff}.route-heading-actions label small{font-size:9px;color:var(--r-muted)}.route-heading-actions input{border:0;background:transparent;color:var(--r-ink);font-weight:650;font-size:12px}.route-heading-actions>button{min-height:38px;border:1px solid var(--r-line);border-radius:8px;background:#fff;color:var(--r-ink);font-size:11px;font-weight:650}.route-heading-actions>button#route-saved-toggle{display:flex;align-items:center;gap:7px;padding:0 13px;background:var(--r-navy);border-color:var(--r-navy);color:#fff}.route-heading-actions svg{width:15px;height:15px}.route-heading-actions>#route-theme-toggle{width:38px;padding:0;font-size:18px}
.route-mobile-steps{display:none}
.route-workspace{display:grid;grid-template-columns:minmax(275px,305px) minmax(450px,1fr) minmax(265px,295px);align-items:stretch;gap:10px;padding:12px;min-height:480px}
.route-controls{grid-column:1;grid-row:1;display:flex;flex-direction:column;gap:10px;min-width:0;max-height:480px;overflow:auto;padding-right:2px;scrollbar-width:thin}
.route-control-block,.route-map-panel,.route-result-panel{border:1px solid var(--r-line);border-radius:12px;background:var(--r-card);box-shadow:0 4px 16px #2034510b}
.route-control-block{padding:13px}.route-step-label{display:flex;align-items:center;gap:9px;margin:0 0 10px;font-size:12px;font-weight:750;color:var(--r-ink)}.route-step-label>span{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:var(--r-blue);color:#fff;font-size:11px}
.route-operator-block>label,.route-compact-fields label{display:grid;gap:5px;color:#52647a;font-size:10px;font-weight:650}.route-operator-block>select,.route-compact-fields select,.route-compact-fields input{width:100%;min-height:37px;padding:8px 10px;border:1px solid var(--r-line);border-radius:8px;background:white;color:var(--r-ink);font-size:11px}
.route-origin-card{display:flex;align-items:flex-start;gap:9px;margin-top:9px;padding:10px;border:1px solid #e3eaf3;border-radius:9px;background:#f8fafc}.route-origin-symbol{display:grid;place-items:center;flex:0 0 24px;width:24px;height:24px;border-radius:50%;background:#e7f7ef;color:var(--r-green);font-size:17px}.route-origin-card small{color:var(--r-muted);font-size:9px}.route-origin-card p{margin:4px 0 0;color:var(--r-ink);font-size:10px;line-height:1.45;overflow-wrap:anywhere}.route-compact-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}.route-compact-fields input,.route-compact-fields select{min-height:34px;padding:6px;font-size:10px}.route-provider-status{margin:8px 0 0;color:#61758b;font-size:9px;line-height:1.45}.route-provider-status.located{color:#087f5b}.route-provider-status.error{color:#a3301d}.route-engine-retry{margin-top:6px;padding:6px 9px;font-size:10px}
.route-stops-heading{display:flex;align-items:center;justify-content:space-between;gap:6px}.route-stops-heading .route-step-label{margin-bottom:8px}.route-selected-count{padding:4px 7px;border-radius:20px;background:#eaf7f0;color:#28754e;font-size:9px;white-space:nowrap}.route-company-groups{display:grid;gap:8px}.route-company-groups>.route-operator-group{padding:0;border:0}.route-operator-group>header{display:none}.route-company-search{display:grid;gap:4px;margin:0 0 7px;color:var(--r-muted);font-size:9px}.route-company-search input{min-height:34px;padding:7px 9px;border:1px solid var(--r-line);border-radius:7px;font-size:10px}.route-select-all-control{display:flex;align-items:center;gap:7px;padding:6px 0;border-bottom:1px solid #edf1f6;color:var(--r-muted);font-size:9px}.route-selection-tools{display:flex;align-items:center;justify-content:space-between;gap:4px;margin:5px 0;color:var(--r-muted);font-size:9px}.route-selection-tools button{padding:3px 5px;border:0;background:transparent;color:#1762ce;font-size:9px}.route-company{display:flex;align-items:flex-start;gap:8px;padding:7px 6px;border-bottom:1px solid #eef2f7;background:transparent}.route-company:hover{background:#f7faff}.route-company>input,.route-select-all-control input{accent-color:var(--r-blue);margin-top:2px}.route-company>span{display:grid;gap:3px;min-width:0}.route-company strong{color:var(--r-ink);font-size:10px}.route-company small{color:var(--r-muted);font-size:9px;line-height:1.35;overflow-wrap:anywhere}.route-additional-companies{font-size:10px}.route-additional-group>h3{font-size:10px}.route-primary-action{position:static;margin-top:auto;padding:0}.route-primary-action button{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:44px;border:0;border-radius:8px;background:linear-gradient(100deg,#0874fa,#145bdb);color:white;font-weight:750;font-size:11px;box-shadow:0 5px 12px #0866f52e}.route-primary-action button svg{width:16px;height:16px}.route-primary-action small{display:block;margin-top:6px;color:var(--r-muted);font-size:9px;text-align:center}
.route-map-panel{grid-column:2;grid-row:1;position:relative;display:flex;flex-direction:column;min-width:0;min-height:480px;overflow:hidden}.route-map-header{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:54px;padding:9px 13px;border-bottom:1px solid #edf1f6}.route-map-header h2{margin:0;font-size:13px;color:var(--r-ink)}.route-map-header p{margin:4px 0 0;font-size:9px;color:var(--r-muted)}.route-map-toolbar{display:flex;gap:5px}.route-map-toolbar button{min-height:30px;padding:5px 8px;border:1px solid var(--r-line);border-radius:7px;background:#fff;color:#53667d;font-size:9px}.route-preview-operators{display:flex;gap:5px;padding:6px 10px}.route-preview-operators:empty{display:none}.route-preview-operators button{padding:5px 9px;border:1px solid var(--r-line);border-radius:20px;background:#fff;color:#55677b;font-size:9px}.route-preview-operators button[aria-selected=true]{border-color:var(--r-blue);background:#eaf2ff;color:#0759d5;font-weight:700}
#route-preview-map{height:auto;min-height:400px;flex:1 1 auto;z-index:0}.route-map-metrics{position:absolute;z-index:450;top:68px;left:10px;right:10px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;pointer-events:none}.route-map-metrics article{display:flex;align-items:center;gap:7px;min-width:0;min-height:52px;padding:7px 9px;border:1px solid #e5ebf3;border-radius:9px;background:#ffffffed;box-shadow:0 3px 12px #142d4612;backdrop-filter:blur(5px)}.route-map-metrics .metric-icon{display:grid;place-items:center;flex:0 0 26px;width:26px;height:26px;border-radius:8px;background:#edf4ff;color:var(--r-blue);font-size:16px}.route-map-metrics .metric-road{background:#eaf7f1;color:#149461}.route-map-metrics .metric-time{background:#fff6e4;color:#d28a09}.route-map-metrics .metric-saving{background:#e9f6ef;color:#109466}.route-map-metrics article div{display:grid;min-width:0}.route-map-metrics strong{color:var(--r-ink);font-size:13px;white-space:nowrap}.route-map-metrics small{margin-top:1px;color:var(--r-muted);font-size:8px;white-space:nowrap}.route-map-bottom{position:absolute;z-index:450;left:10px;right:10px;bottom:9px;display:flex;align-items:flex-end;justify-content:space-between;gap:8px;pointer-events:none}.route-preview-status{max-width:65%;margin:0;padding:7px 9px;border-radius:8px;background:#ffffffed;color:#53667d;font-size:9px;box-shadow:0 2px 10px #142d4610}.route-preview-status.is-error{color:#9a2d22}.route-preview-legend{display:flex;flex-wrap:wrap;gap:8px;max-width:45%;padding:7px 9px;border-radius:8px;background:#ffffffed;color:#3e536a;font-size:8px;box-shadow:0 2px 10px #142d4610}.route-marker-shell{background:transparent;border:0}.route-origin-marker{display:grid;place-items:center;width:35px;height:35px;border:3px solid white;border-radius:50%;background:#10a86b;color:#fff;font-size:17px;box-shadow:0 2px 8px #17324a50}.route-stop-marker{display:grid;place-items:center;width:29px;height:29px;border:3px solid white;border-radius:50%;background:var(--r-blue);color:white;font-size:12px;font-weight:800;box-shadow:0 2px 8px #17324a48}.route-leg-highlight{filter:drop-shadow(0 0 2px white)}
.route-result-panel{grid-column:3;grid-row:1;display:flex;flex-direction:column;min-width:0;max-height:480px;overflow:hidden}.route-result-heading{display:flex;align-items:center;justify-content:space-between;padding:13px 13px 10px;border-bottom:1px solid #edf1f6}.route-result-heading h2{margin:0;color:var(--r-ink);font-size:13px}.route-result-heading p{margin:4px 0 0;color:var(--r-muted);font-size:9px}.route-result-indicator{color:var(--r-green);font-size:20px}.route-result-panel>.route-results{display:flex;flex-direction:column;gap:8px;min-height:70px;margin:0;padding:9px;overflow:auto;background:#fff;scrollbar-width:thin}.route-result-empty{margin:0;padding:14px 10px;border:1px dashed #ccd8e6;border-radius:9px;color:#677a91;font-size:10px;line-height:1.5}.route-results-summary{display:grid;grid-template-columns:repeat(2,1fr);gap:5px}.route-results-summary article{padding:6px;border:1px solid #e8eef5;border-radius:7px;background:#f9fbfd}.route-results-summary article span{font-size:8px}.route-results-summary article strong{font-size:14px}.route-result-card{padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}.route-result-card>header{display:flex;align-items:center;gap:8px;padding:4px 4px 8px;border-bottom:1px solid #edf1f6}.route-result-card>header h3{margin:0;font-size:11px;color:var(--r-ink)}.route-result-card>header p{margin:3px 0 0;color:var(--r-muted);font-size:8px}.route-visit-sequence{position:relative;margin:0;padding:2px 0 2px 1px;list-style:none}.route-visit-sequence:before{position:absolute;top:16px;bottom:16px;left:14px;width:2px;background:#dce7f5;content:""}.route-visit-sequence li{position:relative;display:grid;grid-template-columns:minmax(0,1fr);gap:4px;padding:9px 4px 10px 35px;border-bottom:1px solid #eef2f6;background:transparent}.route-visit-sequence li:before{position:absolute;z-index:1;left:4px;top:11px;display:grid;place-items:center;width:22px;height:22px;border:2px solid #fff;border-radius:50%;background:var(--r-blue);color:#fff;font-size:9px;font-weight:800;box-shadow:0 0 0 1px #dbe6f4;content:attr(data-route-index)}.route-visit-sequence li:first-child{padding-left:35px}.route-visit-sequence li:first-child:before{background:var(--r-green);content:"⌂";font-size:12px}.route-visit-sequence li.is-map-active{border-radius:7px;background:#eef5ff;box-shadow:inset 3px 0 var(--r-blue)}.route-stop-focus{padding:0;border:0;background:transparent;color:var(--r-ink);font-size:10px;font-weight:750;text-align:left}.route-visit-sequence li>small,.route-visit-sequence li>span{width:auto!important;color:var(--r-muted);font-size:8px;line-height:1.4;overflow-wrap:anywhere}.route-leg-metrics{color:#496078!important}.route-instruction-field{display:none}.route-result-card .route-warning,.route-result-card .route-metrics,.route-result-card .route-comparison,.route-result-card .form-help{font-size:9px}.route-result-card>.actions{display:flex;flex-wrap:wrap;gap:5px;margin:7px 0}.route-result-card>.actions button{min-height:30px;padding:6px 8px;font-size:9px}.route-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:9px;border-top:1px solid #edf1f6}.route-actions button{min-height:35px;padding:6px;border:1px solid var(--r-line);border-radius:7px;background:white;color:#52647a;font-size:9px;font-weight:650}.route-actions button#route-save-button{border-color:#0a9e63;background:#109b62;color:#fff}.route-actions button#route-publish-button{border-color:var(--r-blue);background:var(--r-blue);color:#fff}.route-actions button:disabled{opacity:.45;cursor:not-allowed}.route-selected-stop{padding:10px;border-top:1px solid #edf1f6;background:#fbfcfe}.route-selected-stop h3{margin:0;font-size:11px}.route-selected-stop p{margin:4px 0;color:var(--r-muted);font-size:9px}
.saved-route-section{margin:0 12px 15px;padding:14px;border:1px solid var(--r-line);border-radius:11px;background:white}.saved-route-section>header{display:flex;justify-content:space-between;align-items:center}.saved-route-section h2{margin:0;font-size:14px}.saved-route-section .eyebrow{margin:0 0 4px}.saved-route-section[hidden]{display:none!important}
body.route-planning-active.theme-dark #route-planning-panel{--r-bg:#0c1728;--r-card:#14243a;--r-ink:#edf3fc;--r-muted:#a5b4c8;--r-line:#263c57;background:var(--r-bg);color:var(--r-ink)}body.route-planning-active.theme-dark .route-planning-heading,body.route-planning-active.theme-dark .route-control-block,body.route-planning-active.theme-dark .route-map-panel,body.route-planning-active.theme-dark .route-result-panel,body.route-planning-active.theme-dark .saved-route-section{background:var(--r-card);border-color:#263c57}body.route-planning-active.theme-dark .route-heading-title h1,body.route-planning-active.theme-dark .route-map-header h2,body.route-planning-active.theme-dark .route-result-heading h2,body.route-planning-active.theme-dark .route-step-label,body.route-planning-active.theme-dark .route-company strong,body.route-planning-active.theme-dark .route-stop-focus{color:#edf3fc}body.route-planning-active.theme-dark .route-heading-actions label,body.route-planning-active.theme-dark .route-heading-actions>button,body.route-planning-active.theme-dark .route-operator-block>select,body.route-planning-active.theme-dark .route-compact-fields select,body.route-planning-active.theme-dark .route-compact-fields input,body.route-planning-active.theme-dark .route-company-search input,body.route-planning-active.theme-dark .route-map-toolbar button,body.route-planning-active.theme-dark .route-actions button{background:#192c45;border-color:#334a65;color:#e8eff8}body.route-planning-active.theme-dark .route-origin-card,body.route-planning-active.theme-dark .route-results-summary article{background:#182b43;border-color:#2a415e}body.route-planning-active.theme-dark .route-company:hover,body.route-planning-active.theme-dark .route-visit-sequence li.is-map-active{background:#1d3657}body.route-planning-active.theme-dark .route-result-panel>.route-results{background:var(--r-card)}body.route-planning-active.theme-dark .route-heading-actions>button#route-saved-toggle{background:#0b64e9}
@media(max-width:1320px){.route-workspace{grid-template-columns:minmax(255px,285px) minmax(0,1fr);min-height:0}.route-controls{grid-column:1;grid-row:1/3;max-height:480px}.route-map-panel{grid-column:2;grid-row:1;min-height:calc(75vh - 70px)}.route-result-panel{grid-column:2;grid-row:2;max-height:620px}.route-map-metrics{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:900px){.route-workspace{grid-template-columns:minmax(0,1fr);gap:9px;padding:9px}.route-mobile-steps{position:sticky;top:0;z-index:900;display:grid;grid-template-columns:repeat(3,1fr);gap:5px;padding:7px 9px;background:#f3f6fb;border-bottom:1px solid var(--r-line)}.route-mobile-steps button{min-height:34px;border:1px solid var(--r-line);border-radius:7px;background:white;color:#53677f;font-size:10px}.route-mobile-steps button[aria-current=step]{border-color:var(--r-blue);background:#eaf2ff;color:#0759d5;font-weight:750}.route-controls,.route-map-panel,.route-result-panel{grid-column:1;grid-row:auto;max-height:none}.route-map-panel{min-height:520px;order:3}.route-controls{display:contents}.route-operator-block{order:1}.route-stops-block{order:2}.route-primary-action{order:2}.route-result-panel{order:4;max-height:700px}.route-map-metrics{top:64px}.route-mobile-steps[data-active-stage=operator]~.route-workspace .route-stops-block,.route-mobile-steps[data-active-stage=operator]~.route-workspace .route-map-panel,.route-mobile-steps[data-active-stage=operator]~.route-workspace .route-result-panel{display:none}.route-mobile-steps[data-active-stage=companies]~.route-workspace .route-operator-block,.route-mobile-steps[data-active-stage=companies]~.route-workspace .route-map-panel,.route-mobile-steps[data-active-stage=companies]~.route-workspace .route-result-panel{display:none}.route-mobile-steps[data-active-stage=results]~.route-workspace .route-operator-block,.route-mobile-steps[data-active-stage=results]~.route-workspace .route-stops-block,.route-mobile-steps[data-active-stage=results]~.route-workspace .route-primary-action{display:none}.route-mobile-steps[data-active-stage=results]~.route-workspace .route-map-panel{display:flex}.route-mobile-steps[data-active-stage=results]~.route-workspace .route-result-panel{display:flex}.route-planning-heading{padding:10px 13px}.route-heading-title h1{font-size:18px}}
@media(max-width:560px){.route-planning-heading{align-items:flex-start;flex-direction:column;gap:9px}.route-heading-title p{max-width:95%;font-size:10px}.route-heading-actions{width:100%;justify-content:flex-end}.route-heading-actions label{margin-right:auto}.route-map-panel{min-height:470px}.route-map-metrics{top:60px;left:6px;right:6px;gap:4px}.route-map-metrics article{min-height:43px;padding:5px;gap:4px}.route-map-metrics .metric-icon{display:none}.route-map-metrics strong{font-size:11px}.route-map-metrics small{font-size:7px}.route-map-header{align-items:flex-start;padding:9px}.route-map-toolbar button{font-size:8px;padding:4px}.route-map-bottom{left:6px;right:6px;bottom:6px;align-items:flex-start;flex-direction:column}.route-preview-status,.route-preview-legend{max-width:100%}#route-preview-map{min-height:340px}.route-result-panel>.route-results{max-height:48vh}}
@media(prefers-reduced-motion:reduce){body.route-planning-active *,body.route-planning-active *:before,body.route-planning-active *:after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
/* Keep the shared application shell intact; v0.5.9 styles only this workspace. */
body.route-planning-active #route-planning-panel{background:var(--r-bg)}
body.route-planning-active .route-workspace{grid-template-columns:minmax(220px,270px) minmax(300px,1fr) minmax(220px,250px)}
/* styles.css sizes every SVG as an icon; override it for Leaflet route/map geometry. */
#route-preview-map .leaflet-overlay-pane svg{width:auto!important;height:auto!important}
@media(min-width:1101px) and (max-width:1320px){body.route-planning-active .route-workspace{grid-template-columns:minmax(220px,250px) minmax(300px,1fr) minmax(220px,240px);gap:8px;padding:9px}.route-controls{grid-column:1;grid-row:1;max-height:470px}.route-map-panel{grid-column:2;grid-row:1;min-height:470px}.route-result-panel{grid-column:3;grid-row:1;max-height:470px}}
/* Keep the mobile single-column rules stronger than the desktop three-column grid. */
@media(max-width:900px){body.route-planning-active .route-workspace{grid-template-columns:minmax(0,1fr);min-width:0;gap:9px;padding:9px}body.route-planning-active .route-controls{grid-column:1;grid-row:auto;max-height:none;min-width:0}body.route-planning-active .route-map-panel{grid-column:1;grid-row:auto;min-width:0;min-height:520px}body.route-planning-active .route-result-panel{grid-column:1;grid-row:auto;max-height:700px;min-width:0}}
@media(max-width:560px){body.route-planning-active .route-planning-heading{align-items:flex-start;flex-direction:column;gap:9px;padding:10px 13px}body.route-planning-active .route-heading-actions{width:100%;flex-wrap:wrap}body.route-planning-active .route-map-panel{min-height:470px}body.route-planning-active #route-preview-map{min-height:340px}body.route-planning-active .route-map-metrics{top:60px;left:6px;right:6px;gap:4px}body.route-planning-active .route-map-metrics article{min-height:43px;padding:5px;gap:4px}body.route-planning-active .route-map-metrics .metric-icon{display:none}body.route-planning-active .route-map-metrics strong{font-size:11px}body.route-planning-active .route-map-metrics small{font-size:7px}body.route-planning-active .route-map-bottom{left:6px;right:6px;bottom:6px;align-items:flex-start;flex-direction:column}body.route-planning-active .route-preview-status,body.route-planning-active .route-preview-legend{max-width:100%}}

/* v0.5.10: o conteúdo cresce com a página, evitando painéis internos cortados. */
body.route-planning-active .route-controls{max-height:none;overflow:visible}
body.route-planning-active .route-result-panel{max-height:none;overflow:visible}
body.route-planning-active .route-result-panel>.route-results{max-height:none;overflow:visible}
@media(max-width:1320px){body.route-planning-active .route-controls{max-height:none}body.route-planning-active .route-result-panel{max-height:none}}
@media(max-width:900px){body.route-planning-active .route-result-panel{max-height:none}}
