/* PASE · visor de casetas por unidad y periodo */
.toll-route-dialog{width:min(1320px,96vw);max-width:none;max-height:94vh;min-height:480px;border:1px solid var(--line);border-radius:20px;padding:0;background:var(--surface);color:var(--text);box-shadow:0 24px 90px #0007;overflow:hidden}
.toll-route-dialog::backdrop{background:#08152fc2;backdrop-filter:blur(5px)}
.toll-route-dialog .dialog-header{display:flex;justify-content:space-between;align-items:center;padding:23px 28px;border-bottom:1px solid var(--line)}
.toll-route-body{overflow:auto;max-height:calc(94vh - 166px);padding:22px 27px 30px}
.toll-route-body>.unit-summary{margin-bottom:18px;max-height:240px;overflow:auto}
.toll-route-summary{display:flex;gap:15px;flex-wrap:wrap;align-items:center;background:var(--soft-blue);border:1px solid var(--line);border-radius:14px;padding:18px 20px;margin-bottom:20px}
.toll-route-summary>span{font-size:12px;color:var(--muted);padding-left:14px;border-left:1px solid var(--line)}
.toll-route-map-layout{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(290px,.8fr);gap:20px}
#toll-route-map{height:490px;min-height:330px;border-radius:15px;border:1px solid var(--line);background:#dceafa;z-index:0}
.toll-route-map-layout>div:nth-child(2){min-width:0}
.toll-route-legend{overflow:auto;max-height:335px;border-radius:14px;border:1px solid var(--line);margin-top:12px}
.toll-route-legend-item{padding:11px 13px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:10px}
.toll-route-legend-item:last-child{border-bottom:0}
.toll-route-legend-item>div:nth-child(2){flex:1;min-width:0}
.toll-route-legend-item strong{display:block;font-size:12px;overflow-wrap:anywhere}
.toll-route-legend-item small{display:block;color:var(--muted);font-size:10px}
.toll-route-price{text-align:right;white-space:nowrap}
.toll-route-dot{width:11px;height:11px;flex-shrink:0;background:#287cde;border-radius:50%;box-shadow:0 0 0 3px #2884de25}
.toll-route-dot.unlocated{background:transparent;border:2px dashed #b98631;box-shadow:none}
.toll-route-location-editor{border:1px solid var(--line);border-radius:14px;margin-top:15px;padding:16px}
.toll-route-location-editor select{width:100%;margin:8px 0 12px}
.toll-route-location-editor .button{width:100%;margin-bottom:9px}
.toll-route-dialog .dialog-footer{display:flex;justify-content:flex-end;border-top:1px solid var(--line);padding:15px 25px}
#toll-route-open{white-space:nowrap;box-shadow:0 4px 15px #327bdf28}
@media(max-width:830px){.toll-route-map-layout{grid-template-columns:1fr}.toll-route-body{padding:16px}#toll-route-map{height:350px}.toll-route-legend{max-height:280px}}
@media(max-width:550px){.toll-route-dialog{width:98vw;max-height:96vh}.toll-route-dialog .dialog-header{padding:15px}.toll-route-summary{gap:10px}.toll-route-summary>span{border:0;padding:0}}

/* Modo degradado sin bibliotecas externas: no bloquea la simbología. */
.toll-route-offline{height:100%;display:flex;flex-direction:column;padding:24px;gap:10px;background:linear-gradient(135deg,#e2effe,#c5d9ed);color:#193753}
.toll-route-offline>strong{font-size:17px;color:#16365a}
.toll-route-offline p{font-size:12px;line-height:1.65;color:#375677;max-width:610px}
.toll-route-coordinate-grid{flex:1;min-height:195px;position:relative;border:1px solid #709bc25c;border-radius:13px;overflow:hidden;background:repeating-linear-gradient(0deg,transparent 0 42px,#709bc22d 43px 44px),repeating-linear-gradient(90deg,transparent 0 42px,#709bc22d 43px 44px),linear-gradient(145deg,#eef6fc,#b8d5e8)}
.toll-route-offline-dot{position:absolute;width:14px;height:14px;background:#2078d8;border:2px solid white;box-shadow:0 0 0 4px #2078d82e;border-radius:50%;transform:translate(-50%,-50%)}

/* Mosaicos OpenStreetMap sin librerías de terceros. */
#toll-route-map{position:relative;overflow:hidden;touch-action:pan-y;background:#cae0ee;cursor:crosshair}
.lamtra-native-tiles,.lamtra-native-pins{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.lamtra-native-tiles img{position:absolute;width:256px;height:256px;user-select:none;pointer-events:none;max-width:none}
.lamtra-native-toolbar{position:absolute;top:15px;left:15px;display:flex;flex-direction:column;gap:4px;z-index:2}
.lamtra-native-toolbar button{width:37px;height:37px;border:1px solid #a7c3d8;border-radius:8px;background:#fff;color:#183b60;font-size:23px;box-shadow:0 2px 8px #0002}
.lamtra-native-attribution{position:absolute;bottom:4px;right:5px;background:#ffffffe9;font-size:10px;padding:3px 5px;border-radius:4px;color:#284f6a}
.lamtra-native-pin{position:absolute;transform:translate(-50%,-50%);pointer-events:auto;min-width:30px;height:30px;padding:0 4px;border:2px solid #fff;border-radius:100%;background:#226dd0;color:#fff;font-size:12px;font-weight:800;box-shadow:0 2px 10px #0005;cursor:help}
.lamtra-map-tile-warning{position:absolute;left:12%;right:12%;top:40%;background:#fffffff2;border:1px solid #9db5cd;border-radius:12px;padding:15px;color:#234466;font-weight:600;text-align:center;z-index:1}

/* Identificación guiada y recorrido estimado. */
.toll-route-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:-3px 0 18px}
.toll-route-actions .button.primary{background:linear-gradient(110deg,#cb283c,#aa1732);color:#fff;border:1px solid #df5264}
.toll-route-actions .button.primary:hover{filter:brightness(1.08)}
.toll-route-actions #toll-route-info{flex:1 1 330px;font-size:11px;line-height:1.6}
.toll-route-candidates{display:grid;gap:6px;margin-top:9px;font-size:11px}
.toll-route-candidates button{text-align:left;white-space:normal;overflow-wrap:anywhere;line-height:1.35;padding:10px 12px;font-size:11px}
.lamtra-native-routes{position:absolute;inset:0;z-index:1;pointer-events:none;width:100%;height:100%;overflow:hidden}
.lamtra-native-pins{z-index:2}
.lamtra-native-pin{z-index:3}
@media(max-width:600px){.toll-route-actions{flex-direction:column;align-items:stretch}.toll-route-actions .button{width:100%}}

/* Marcadores legibles y agrupación dinámica Leaflet. */
.toll-map-marker-shell{border:0!important;background:transparent!important}
.toll-map-marker{width:34px;height:34px;display:flex;align-items:center;justify-content:center;border-radius:50%;color:#fff;font-size:12px;font-weight:800;background:linear-gradient(135deg,#318dff,#164bb6);border:2px solid #fff;box-shadow:0 3px 12px #061e4e99,0 0 0 3px #378eff3b}
.toll-map-marker-cluster{background:linear-gradient(135deg,#5d7cff,#203c85);border-color:#a6d4ff;box-shadow:0 3px 15px #061e4eb8,0 0 0 5px #4388fa39}
.toll-legend-controls{display:flex;gap:8px;margin-top:10px}
.toll-legend-controls .button{font-size:11px;padding:7px 12px}
.toll-route-legend-item{width:100%;border:0;border-bottom:1px solid var(--line);background:transparent;color:var(--text);text-align:left;cursor:pointer}
.toll-route-legend-item:hover,.toll-route-legend-item:focus-visible{background:var(--soft-blue);outline-offset:-2px}
.toll-route-legend-name{flex:1;min-width:0}
.toll-route-legend-name strong{display:block;font-size:12px}
.toll-route-legend-name small{display:block;color:var(--muted);font-size:10px}

/* Brochita para limpiar la ruta al lado del zoom. */
.toll-map-brush{margin-top:7px!important}
.toll-map-brush-button{width:34px;height:34px;display:flex;align-items:center;justify-content:center;border:0;background:#fff;color:#1b4472;font-size:18px;cursor:pointer;border-radius:3px}
.toll-map-brush-button:hover,.toll-map-brush-button:focus-visible{background:#eaf2ff}
.lamtra-native-toolbar [data-zoom="brush"]{font-size:18px}
