.works-marker {
  display: grid !important;
  grid-template-columns: 30px 30px;
  align-items: center;
  justify-content: space-between;
  column-gap: 12px !important;
  min-width: 82px;
  min-height: 36px;
  padding: 3px 7px !important;
  background: #ffd84d;
  border: 1px solid #a87900;
  border-radius: 5px;
  box-shadow: 0 1px 3px #555;
  box-sizing: border-box;
  transform: scale(.68);
  transform-origin: center center;
}
.works-sign { width:30px;height:27px;display:flex;align-items:center;justify-content:center; }
.works-sign img { width:30px;height:27px;object-fit:contain;display:block; }
.works-roundel { width:30px!important;height:30px!important;border:3px solid #d71920!important;border-radius:50%;background:#fff;color:#111;font:700 11px/24px system-ui!important;text-align:center;box-sizing:border-box;justify-self:end; }

.speed-hit-icon { background:transparent!important;border:0!important; }
.speed-hit { width:82px;height:46px;display:flex;align-items:center;justify-content:center;cursor:pointer;pointer-events:auto; }
.speed-hit .speed-label { pointer-events:none; }
.speed-label { font:700 11px/1 system-ui;background:#111;color:#fff;padding:4px 6px;border-radius:4px;white-space:nowrap;border:1px solid #fff;box-shadow:0 1px 3px #0008; }
.speed-label.slow { background:#9b1c1c; }
.speed-label.medium { background:#9a6700; }

.layer-filter-control { background:rgba(255,255,255,.96);border-radius:5px;box-shadow:0 1px 5px rgba(0,0,0,.35);font:12px/1.35 system-ui,sans-serif;color:#222; }
.layer-filter-toggle { border:0;background:#fff;border-radius:5px;padding:7px 10px;font:700 12px system-ui;cursor:pointer; }
.layer-filter-panel { min-width:178px;padding:5px 9px 8px;border-top:1px solid #ddd; }
.layer-filter-panel label { display:block;padding:4px 0;white-space:nowrap;cursor:pointer; }
.layer-filter-panel input { margin:0 7px 0 0;vertical-align:-1px; }

.legacy-matrix { position:relative;display:flex;align-items:center;justify-content:center;min-width:43px;height:29px;padding:0 12px;background:#050505;border:2px solid #555;border-radius:3px;box-sizing:border-box;color:#ffb51b;font:800 15px/25px ui-monospace,monospace;letter-spacing:2px;box-shadow:0 1px 2px #555; }
.legacy-matrix .wigwam { position:absolute;top:50%;width:7px;height:7px;margin-top:-3.5px;border-radius:50%;background:#ffb51b;box-shadow:0 0 4px #ffb51b; }
.legacy-matrix .wigwam.left { left:2px; }
.legacy-matrix .wigwam.right { right:2px; }
.legacy-matrix.wigwams .wigwam { animation:ukroads-wigwam .9s steps(1,end) infinite; }
.legacy-matrix.wigwams .wigwam.right { animation-delay:.45s; }
@keyframes ukroads-wigwam { 0%,49%{opacity:1} 50%,100%{opacity:.18} }
.vms-message.attention { border-color:#ffcf33!important;box-shadow:0 0 0 1px #ffcf33; }

/* Popup lane/aspect cells must stay square.  The contents can vary, the cell geometry cannot. */
.states { display:flex;align-items:center;gap:6px;flex-wrap:wrap; }
.states > .signal,
.states > .vms-off,
.states > .vms-end,
.states > .legacy-matrix {
  width:46px!important;
  min-width:46px!important;
  height:46px!important;
  min-height:46px!important;
  flex:0 0 46px!important;
  box-sizing:border-box!important;
  padding:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
}
.states > .signal.speed {
  width:46px!important;
  height:46px!important;
  min-width:46px!important;
  min-height:46px!important;
  aspect-ratio:1 / 1;
  flex:0 0 46px!important;
  border-radius:50%!important;
  box-sizing:border-box!important;
}

/* Combined full-width VMS: message area on the left, speed aspect on the right. */
.combined-sign {
  display:grid;
  grid-template-columns:minmax(0,1fr) 58px;
  align-items:stretch;
  gap:0;
  width:100%;
  max-width:430px;
  background:#050505;
  border:2px solid #555;
  border-radius:4px;
  box-sizing:border-box;
  overflow:hidden;
}
.combined-sign .sign-board {
  margin:0!important;
  border:0!important;
  border-radius:0!important;
  min-height:68px;
  box-sizing:border-box;
}
.combined-sign .combined-speed {
  min-width:58px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-left:1px solid #444;
  background:#050505;
}
.combined-sign .combined-speed .signal.speed {
  width:44px!important;
  min-width:44px!important;
  height:44px!important;
  min-height:44px!important;
  aspect-ratio:1 / 1;
  flex:none!important;
  border-radius:50%!important;
  box-sizing:border-box!important;
}
.combined-sign .combined-blank {
  min-height:68px;
  background:#050505;
}

#gps-button,#gps-follow { display:none;position:absolute;z-index:1200;right:10px;border:2px solid rgba(0,0,0,.25);border-radius:5px;background:#fff;color:#222;box-shadow:0 1px 5px rgba(0,0,0,.35);cursor:pointer;font-family:system-ui,sans-serif; }
#gps-button { top:58px;width:42px;height:42px;padding:0;font-size:24px;font-weight:700;line-height:36px;text-align:center; }
#gps-follow { top:106px;height:32px;padding:0 9px;font-size:12px;font-weight:700; }
#gps-button.active,#gps-follow.active { background:#e8f2ff;color:#1264d1; }
#gps-button.error { background:#fff0f0;color:#b42318; }
.gps-dot { width:16px;height:16px;border-radius:50%;background:#1877f2;border:3px solid #fff;box-shadow:0 1px 5px #333;box-sizing:content-box; }

#feed-warning { position:fixed;z-index:1300;top:72px;left:50%;transform:translateX(-50%);max-width:min(820px,calc(100vw - 130px));box-sizing:border-box;background:#7a2e00;color:#fff;border:1px solid #a84a12;border-radius:6px;padding:8px 12px;font:600 13px/1.35 system-ui,sans-serif;box-shadow:0 2px 8px #555;text-align:center; }

@media (max-width:900px) and (pointer:coarse) {
  #gps-button { display:block;top:72px;right:8px;width:44px;height:44px; }
  #gps-follow:not([hidden]) { display:block;top:122px;right:8px; }
  .layer-filter-panel { font-size:13px;min-width:190px; }
  .layer-filter-panel label { padding:6px 0; }
}
@media (max-width:600px) {
  #feed-warning { top:64px;left:8px;right:8px;transform:none;max-width:none;text-align:left; }
  .combined-sign { grid-template-columns:minmax(0,1fr) 54px; }
  .combined-sign .combined-speed { min-width:54px; }
}
