/* v0.5.8: planning workspace rebuild and route visibility corrections. */
.route-planning-heading{padding:22px 24px 0}
.route-planning-heading h2{font-size:25px;letter-spacing:-.45px}
.route-planning-heading>div>p:last-child{font-size:12px;line-height:1.55}
.route-workspace{display:grid;grid-template-columns:minmax(255px,.72fr) minmax(390px,1.45fr) minmax(280px,.88fr);align-items:start;gap:14px;padding:18px 18px 22px}
.route-controls{grid-column:1;grid-row:1;gap:12px;min-width:0}
.route-map-panel{grid-column:2;grid-row:1;position:sticky;top:12px;min-width:0;overflow:hidden;border:1px solid var(--route-border,#dfe8e9);border-radius:13px;background:#fff;box-shadow:0 8px 26px #193b4610}
.route-result-panel{grid-column:3;grid-row:1;position:sticky;top:12px;max-height:calc(100vh - 24px);min-width:0;overflow:auto;border:1px solid var(--route-border,#dfe8e9);border-radius:13px;background:#fff;box-shadow:0 8px 26px #193b4610;scrollbar-width:thin}
.route-result-panel>header{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:13px 14px;border-bottom:1px solid #e5ecec;background:#fff}
.route-result-panel>header .eyebrow{margin:0 0 5px;font-size:8px;color:#668078;letter-spacing:.12em}
.route-result-panel>header h3{margin:0;font-size:14px;color:#243b45}
.route-result-panel>header button{flex:0 0 auto;padding:7px 9px;font-size:10px}
.route-result-panel>.route-results{display:grid;gap:10px;min-height:160px;margin:0;padding:12px;background:#f7faf9}
.route-result-empty{margin:0;padding:13px;border:1px dashed #cbd9d6;border-radius:9px;color:#61747b;font-size:11px;line-height:1.65}
.route-results-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.route-results-summary article{min-width:0;min-height:62px;padding:9px;border:1px solid #e1eae8;border-radius:8px;background:white}
.route-results-summary span{font-size:8px;line-height:1.4}.route-results-summary strong{font-size:18px}
.route-result-card{min-width:0;padding:12px;border:1px solid #e0e9e7;border-radius:10px;background:white;box-shadow:none}
.route-result-card>header{gap:9px;align-items:center;padding-bottom:10px;border-bottom:1px solid #edf1f2}
.route-result-card>header h3{margin:0;font-size:12px}.route-result-card>header p{margin:4px 0 0;font-size:9px;color:#6a7c80}
.route-visit-sequence{margin:9px 0;padding:0;list-style:none}
.route-visit-sequence li{display:grid;grid-template-columns:minmax(0,1fr);gap:5px;padding:9px;border:1px solid #e7edec;border-radius:8px;background:#fff}
.route-visit-sequence li.is-map-active{border-color:#087f5b;background:#eef8f3;box-shadow:0 0 0 2px #087f5b19}
.route-visit-sequence li>small,.route-visit-sequence li>span{grid-column:auto;width:auto!important;overflow-wrap:anywhere;font-size:9px;line-height:1.5}
.route-stop-focus{font-size:11px}
.route-leg-metrics{display:block;color:#435b60;font-size:9px}
.route-result-card .route-metrics,.route-result-card .route-warning,.route-result-card .route-comparison,.route-result-card .form-help{font-size:9px;line-height:1.55}
.route-result-card .route-instruction-field{font-size:9px}
.route-result-card .route-instruction-field textarea{min-height:48px;font-size:10px}
.route-result-card>.actions{display:grid;gap:7px;margin-top:10px}
.route-result-card>.actions button{min-height:38px;font-size:10px}
#route-preview-map{height:min(70vh,680px);min-height:480px}
.route-map-header{min-height:72px;padding:14px 16px}
.route-map-header h3{font-size:15px}
.route-map-header>div>p:last-child{font-size:10px}
.route-preview-status{font-size:10px;line-height:1.55}
.route-preview-status.is-error{background:#fff1ed;color:#a3301d;font-weight:700}
.route-preview-legend{font-size:9px}
.route-primary-action{position:sticky;bottom:10px;z-index:2}
.route-primary-action button{min-height:48px}
.saved-route-section{margin:0 18px 20px}
.address-actions #clear-address{border-color:#cfdad8;background:#f7faf9;color:#38535a}
.address-actions #clear-address:hover{background:#eaf2ef}

@media(max-width:1240px){
  .route-workspace{grid-template-columns:minmax(270px,.78fr) minmax(0,1.38fr);gap:12px;padding:15px}
  .route-controls{grid-column:1;grid-row:1}
  .route-map-panel{grid-column:2;grid-row:1;position:sticky;top:10px}
  .route-result-panel{grid-column:1/-1;grid-row:2;position:static;max-height:none;overflow:visible}
  .route-result-panel>.route-results{grid-template-columns:repeat(2,minmax(0,1fr))}
  .route-result-panel .route-results-summary{grid-column:1/-1}
  #route-preview-map{height:clamp(440px,64vh,620px);min-height:390px}
}
@media(max-width:820px){
  .route-planning-heading{padding:19px 16px 0}
  .route-workspace{grid-template-columns:minmax(0,1fr);gap:11px;padding:12px}
  .route-map-panel{grid-column:1;grid-row:1;position:static}
  .route-controls{grid-column:1;grid-row:2}
  .route-result-panel{grid-column:1;grid-row:3}
  .route-result-panel>.route-results{grid-template-columns:minmax(0,1fr)}
  .route-result-panel .route-results-summary{grid-column:auto}
  #route-preview-map{height:clamp(360px,55vh,500px);min-height:320px}
  .route-primary-action{position:static}
  .saved-route-section{margin:0 12px 15px}
}
@media(max-width:560px){
  .route-planning-heading{align-items:flex-start;flex-direction:column;gap:10px;padding:15px 13px 0}
  .route-planning-heading h2{font-size:21px}
  .route-workspace{padding:10px;gap:10px}
  .route-control-block{padding:12px}
  .route-map-panel,.route-result-panel{border-radius:10px}
  .route-map-header{align-items:flex-start;gap:8px;padding:12px}
  .route-map-header h3{font-size:13px}
  .route-map-header button{max-width:118px;min-height:40px;padding:7px;font-size:9px;white-space:normal}
  #route-preview-map{height:clamp(330px,52vh,440px);min-height:300px}
  .route-result-panel>.route-results{padding:9px}
  .route-results-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
  .route-results-summary article{min-height:58px;padding:8px}
  .route-result-card{padding:10px}
  .route-visit-sequence li{grid-template-columns:minmax(0,1fr)}
  .route-primary-action{padding:10px}
  .saved-route-section{margin:0 10px 12px}
}
@media(max-width:360px){
  .route-form-grid{grid-template-columns:minmax(0,1fr)}
  .route-map-header{flex-direction:column}
  .route-map-header button{max-width:none}
  .route-result-panel>header{align-items:flex-start;flex-direction:column}
}
