/* VIH horizontal overview: static RAC map, expandable sensor rails and extended chainage. */
body:has(#vih.active) #vih{
  max-width:none!important;
  padding:22px 24px 30px!important;
}
#vih .page-heading{
  margin:0 0 14px!important;
}
#vih .page-heading .subtitle,
#vih .page-heading .rac-context-strip{
  display:none!important;
}
#vih .vih-workspace{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:280px 38px 560px!important;
  gap:0!important;
  width:100%;
  height:auto!important;
  min-height:0!important;
  overflow:visible!important;
}

/* Fixed, full-width RAC network overview. */
#vih .vih-map-window{
  grid-column:1!important;
  grid-row:1!important;
  width:100%;
  height:280px;
  min-height:280px;
  position:relative;
  display:block!important;
  overflow:hidden;
  border:1px solid #d8e4f1!important;
  border-radius:13px!important;
  background:#eaf0f5!important;
  box-shadow:0 10px 28px rgba(19,54,93,.09)!important;
  cursor:default!important;
}
#vih .vih-map-window>.vih-window-head,
#vih .vih-map-window>.vih-layer-chips{
  display:none!important;
}
#vih .vih-map-window>.osm-map{
  position:absolute!important;
  inset:0;
  width:100%;
  height:100%!important;
  min-height:100%!important;
  border-radius:inherit!important;
  pointer-events:auto!important;
}
#vih .vih-map-window .leaflet-container,
#vih .vih-map-window .leaflet-pane,
#vih .vih-map-window .leaflet-control-container{
  pointer-events:auto!important;
}
#vih .vih-map-window .leaflet-container{
  cursor:grab!important;
}
#vih .vih-map-window .leaflet-container:active{
  cursor:grabbing!important;
}
#vih .vih-map-window .leaflet-top.leaflet-left{
  top:auto;
  bottom:38px;
  left:10px;
}
#vih .vih-map-window .leaflet-control-zoom{
  margin:0!important;
  overflow:hidden;
  border:1px solid #bfd0e3!important;
  border-radius:8px!important;
  box-shadow:0 4px 13px rgba(16,54,97,.14)!important;
}
#vih .vih-map-window .leaflet-control-zoom a{
  width:28px!important;
  height:28px!important;
  line-height:27px!important;
  color:#1769e0!important;
  font-size:16px!important;
}
#vih .vih-base-map{
  position:absolute;
  inset:0;
  background:#eaf0f5;
}
#vih .vih-base-map .leaflet-tile-pane{
  filter:saturate(.65) brightness(1.06) contrast(.9);
}
#vih .vih-base-map .leaflet-control-attribution{
  padding:1px 4px!important;
  background:rgba(255,255,255,.78)!important;
  color:#718097!important;
  font-size:6px!important;
}
#vih .vih-network-title{
  position:absolute;
  z-index:800;
  top:12px;
  left:14px;
  display:grid;
  grid-template-columns:auto auto;
  align-items:center;
  gap:2px 10px;
  width:auto;
  height:auto;
  padding:9px 12px;
  border:1px solid rgba(192,210,230,.9);
  border-radius:9px;
  background:rgba(255,255,255,.94);
  color:#0c5fcf;
  box-shadow:0 5px 16px rgba(16,54,97,.15);
  backdrop-filter:blur(6px);
}
#vih .vih-network-title span{
  grid-column:1/-1;
  color:#1263df;
  font:800 8px Inter,sans-serif;
  letter-spacing:.1em;
}
#vih .vih-network-title strong{
  color:#17365d;
  font:800 11px Manrope,sans-serif;
}
#vih .vih-network-title em{
  padding:4px 7px;
  border-radius:10px;
  background:#e8f2ff;
  color:#1263df;
  font:800 6px Inter,sans-serif;
  font-style:normal;
  letter-spacing:.06em;
}
#vih .vih-map-legend{
  position:absolute;
  z-index:800;
  right:14px;
  bottom:38px;
  display:flex!important;
  align-items:center;
  gap:12px;
  padding:7px 10px;
  border:1px solid rgba(192,210,230,.9);
  border-radius:8px;
  background:rgba(255,255,255,.94);
  color:#405875;
  box-shadow:0 4px 13px rgba(16,54,97,.12);
  font:700 7px Inter,sans-serif;
}
#vih .vih-map-legend span{
  display:flex;
  align-items:center;
  gap:5px;
}
#vih .vih-map-legend i{
  display:block;
  width:13px;
  height:4px;
  border-radius:3px;
  background:#1674e8;
}
#vih .vih-map-legend i.station{
  width:9px;
  height:9px;
  border:2px solid #fff;
  border-radius:50%;
  background:#7655e8;
  box-shadow:0 0 0 1px #7655e8;
}

/* Digital-twin zone. The globe remains fixed at its existing 500px size. */
#vih .vih-pano-window{
  grid-column:1!important;
  grid-row:3!important;
  position:relative;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:flex-start!important;
  min-height:560px;
  margin-top:0;
  padding:6px 20px 30px!important;
  border:1px solid #e0e8f2!important;
  border-radius:14px!important;
  background:linear-gradient(180deg,#fff 0%,#fbfdff 72%,#f3f8fe 100%)!important;
  box-shadow:0 12px 32px rgba(20,54,91,.08)!important;
  overflow:hidden!important;
}
#vih .vih-pano-window>.vih-window-head{
  position:absolute!important;
  z-index:30;
  top:12px;
  right:14px;
  display:flex!important;
  width:auto;
  height:28px!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
}
#vih .vih-pano-window>.vih-window-head>div:first-child{
  display:none!important;
}
#vih .vih-pano-window>.vih-window-head button{
  height:28px;
  margin-left:6px;
  padding:0 9px;
  border:1px solid #d7e3f0;
  border-radius:7px;
  background:#fff;
  box-shadow:0 3px 9px rgba(17,54,95,.08);
}
#vih .vih-core-title{
  display:none!important;
}
#vih .vih-pano-window:before,
#vih .vih-pano-window:after{
  display:none!important;
}
#vih .vih-pano-window .vih-pano-host{
  position:relative!important;
  z-index:12!important;
  flex:0 0 500px!important;
  width:500px!important;
  height:500px!important;
  max-width:none!important;
  margin:0!important;
}
#vih .vih-compass-label{
  display:none!important;
}
#vih .vih-core-meta{
  display:none!important;
}
#vih .vih-pano-thumbs{
  display:none!important;
}

/* Two independently scrollable sensor rails can absorb future modules. */
#vih .vih-floating-sensors{
  position:absolute!important;
  z-index:24!important;
  inset:0 20px 0!important;
  display:block!important;
  pointer-events:none;
}
#vih .vih-sensor-rail{
  position:absolute;
  top:0;
  bottom:auto;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  grid-template-rows:repeat(3,minmax(0,1fr));
  grid-auto-rows:minmax(94px,1fr);
  align-content:stretch;
  gap:10px;
  width:clamp(280px,32%,410px);
  min-width:280px;
  height:360px;
  padding:34px 6px 6px;
  overflow-x:hidden;
  overflow-y:auto;
  pointer-events:auto;
  scrollbar-width:thin;
  scrollbar-color:#bdd1e8 transparent;
}
#vih .vih-sensor-rail-left{left:0}
#vih .vih-sensor-rail-right{right:0}
#vih .vih-sensor-rail>header{
  position:absolute;
  z-index:4;
  top:0;
  left:8px;
  right:8px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  height:30px;
  padding:0 5px;
  background:linear-gradient(#fff 78%,transparent);
}
#vih .vih-sensor-rail>header span{
  color:#1263df;
  font:800 7px Inter,sans-serif;
  letter-spacing:.08em;
}
#vih .vih-sensor-rail>header small{
  color:#8392a7;
  font:600 6px Inter,sans-serif;
}
#vihFloatingSensors .vih-module,
#vihFloatingSensors .vih-module[data-workspace]{
  position:relative!important;
  inset:auto!important;
  left:auto!important;
  right:auto!important;
  top:auto!important;
  bottom:auto!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  margin:0!important;
  padding:12px 24px 11px 54px!important;
  border-radius:14px!important;
  background-color:#fff!important;
  background-image:none!important;
  text-align:left!important;
  overflow:hidden!important;
}
#vih #vihFloatingSensors .vih-module,
#vih #vihFloatingSensors .vih-module:hover,
#vih #vihFloatingSensors .vih-module.cross-highlight,
#vih #vihFloatingSensors .vih-module.gis-selected{
  background-color:#fff!important;
  background-image:none!important;
}
#vih #vihFloatingSensors .vih-module[data-workspace]:hover,
#vih #vihFloatingSensors .vih-module[data-workspace].cross-highlight,
#vih #vihFloatingSensors .vih-module[data-workspace].gis-selected{
  background-color:#fff!important;
  background-image:none!important;
}
#vihFloatingSensors .vih-module:before,
#vihFloatingSensors .vih-module:after{
  display:none!important;
}
#vihFloatingSensors .vih-module>*{
  visibility:visible!important;
}
#vihFloatingSensors .vih-module-expansion{
  height:100%!important;
  min-height:0!important;
}
#vihFloatingSensors .vih-module .module-number{
  top:7px!important;
  right:7px!important;
  left:auto!important;
  width:20px!important;
  height:20px!important;
  border-radius:6px!important;
  font-size:9px!important;
}
#vihFloatingSensors .vih-module .vih-sensor-logo{
  position:absolute;
  left:10px;
  top:50%;
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border:1px solid color-mix(in srgb,var(--sensor-color) 28%,#dce7f2);
  border-radius:10px;
  background:color-mix(in srgb,var(--sensor-color) 10%,#fff);
  color:var(--sensor-color);
  transform:translateY(-50%);
}
#vihFloatingSensors .vih-module .vih-sensor-logo svg{
  width:22px;
  height:22px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
#vihFloatingSensors .vih-module .module-heading{
  display:block!important;
  min-height:0!important;
  padding:0!important;
}
#vihFloatingSensors .vih-module .module-heading strong{
  display:block;
  padding-right:2px;
  color:#17365d!important;
  font-size:11px!important;
  line-height:1.25!important;
}
#vihFloatingSensors .vih-module .module-heading small{
  display:block;
  margin-bottom:4px;
  color:var(--module-glow)!important;
  font-size:8px!important;
  font-weight:800!important;
  letter-spacing:.03em;
}
#vihFloatingSensors .vih-module .vih-sensor-status{
  display:inline-flex;
  align-items:center;
  gap:4px;
  margin-top:7px;
  padding:3px 6px;
  border-radius:9px;
  background:#eef4fb;
  color:#60758f;
  font:800 6.5px Inter,sans-serif;
  letter-spacing:.08em;
}
#vihFloatingSensors .vih-module .vih-sensor-status:before{
  content:"";
  width:5px;
  height:5px;
  border-radius:50%;
  background:#94a3b8;
}
#vihFloatingSensors .vih-module .vih-sensor-status.live{
  background:#e8f8f0;
  color:#0d8156;
}
#vihFloatingSensors .vih-module .vih-sensor-status.live:before{
  background:#16a36d;
  box-shadow:0 0 0 3px rgba(22,163,109,.13);
}
#vihFloatingSensors .vih-module .module-icon,
#vihFloatingSensors .vih-module .module-reading,
#vihFloatingSensors .vih-module .module-spark,
#vihFloatingSensors .vih-module>b{
  display:none!important;
}

/* Full-width extended chainage with original track/train visual weight. */
#vih .vih-track-stage{
  position:relative;
  z-index:900;
  grid-column:1;
  grid-row:2;
  left:auto;
  right:auto;
  bottom:auto;
  width:100%;
  height:38px;
  overflow:visible;
  border:0;
  border-top:1px solid rgba(190,209,229,.95);
  border-bottom:1px solid rgba(214,226,239,.95);
  border-radius:0;
  background:#fff;
  box-shadow:none;
}
#vih .vih-track-stage-title{
  position:absolute;
  z-index:4;
  top:auto;
  bottom:2px;
  left:50%;
  display:flex;
  align-items:center;
  gap:6px;
  padding:3px 9px;
  border:1px solid rgba(188,207,228,.9);
  border-radius:10px;
  background:rgba(255,255,255,.9);
  color:#536b88;
  font:700 7px Inter,sans-serif;
  letter-spacing:.02em;
  white-space:nowrap;
  transform:translateX(-50%);
  pointer-events:none;
}
#vih .vih-track-stage-title b{
  color:#1263df;
  font-size:7px;
}
#vih .vih-track-stage-title i{
  width:3px;
  height:3px;
  border-radius:50%;
  background:#9eb0c5;
}
#vih .vih-track-stage>strong{
  display:none;
}
#vihTrackStage .vih-planet-rail-crown.vih-planet-rail-elevation{
  position:absolute!important;
  z-index:1!important;
  left:2px!important;
  right:2px!important;
  top:-30px!important;
  bottom:auto!important;
  width:auto!important;
  height:50px!important;
  transform:none!important;
  filter:none!important;
  pointer-events:none;
}
#vihTrackStage .vih-planet-rail-elevation .planet-track-bed{
  stroke-width:1!important;
}
#vihTrackStage .vih-planet-rail-elevation .planet-rail-left,
#vihTrackStage .vih-planet-rail-elevation .planet-rail-right{
  stroke-width:3!important;
}
#vihTrackStage .vih-planet-rail-elevation .planet-rail-sleepers{
  stroke-width:11!important;
}
#vihTrackStage .vih-planet-rail-elevation .planet-km-marker path{
  stroke-width:1.4!important;
}
#vihTrackStage .vih-planet-rail-elevation .planet-km-marker circle{
  r:3.5px!important;
  stroke-width:1.6!important;
}
#vihTrackStage .vih-planet-rail-elevation .planet-km-marker text{
  font-size:20px!important;
  stroke-width:2px!important;
}
#vihTrackStage .vih-planet-rail-crown svg{
  width:100%!important;
  height:100%!important;
  overflow:visible!important;
}
#vihTrackStage .planet-km-marker{
  pointer-events:auto!important;
}
#vihTrackStage .planet-train{
  pointer-events:all!important;
  cursor:pointer;
  outline:none;
}
#vihTrackStage .planet-train:hover .train-body,
#vihTrackStage .planet-train:focus-visible .train-body{
  fill:#1263df;
  filter:drop-shadow(0 0 8px rgba(18,99,223,.55));
}
#vihTrackStage .planet-train:focus-visible .train-body{
  stroke:#ff9a2f;
  stroke-width:7px;
}
#vih .vih-sphere-controls{display:none!important}

@media(max-width:1250px){
  #vih .vih-workspace{grid-template-rows:250px 38px 600px!important}
  #vih .vih-map-window{height:250px;min-height:250px}
  #vih .vih-pano-window{min-height:600px;padding:6px 20px 30px!important}
  #vih .vih-floating-sensors{inset:0 10px 0!important}
  #vih .vih-sensor-rail{width:280px;min-width:280px}
}
@media(max-width:1040px){
  #vih .vih-workspace{grid-template-rows:235px 38px 600px!important}
  #vih .vih-map-window{height:235px;min-height:235px}
  #vih .vih-pano-window{min-height:600px;padding:6px 20px 30px!important}
  #vih .vih-sensor-rail{width:265px;min-width:265px}
  #vihFloatingSensors .vih-module{padding:10px 22px 9px 47px!important}
  #vihFloatingSensors .vih-module .vih-sensor-logo{left:8px;width:31px;height:31px}
  #vihFloatingSensors .vih-module .module-heading strong{font-size:10px!important}
}
