/* One scrollable map sheet carries both the pixel canvas and its interactive overlays. */
.rail-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 12px;
  border-bottom: 1px solid #bdc5ac;
  background: #edf0df;
  color: #3d5644;
}
.rail-map-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 3px 8px;
  border: 1px solid #819278;
  border-radius: 4px;
  box-shadow: inset 0 1px #ffffed, 0 1px #bac4a9;
  background: #faf9e9;
  color: inherit;
  font-weight: 750;
  line-height: 1.15;
}
.rail-map-toolbar button:hover:not(:disabled) {background: #fff2c5}
.rail-map-toolbar button:focus-visible {outline: 3px solid #b97937;outline-offset: 2px}
.rail-map-toolbar button:disabled {background: #e7eadb;border-color: #b7bea8;box-shadow: none;color: #818a78}
#map-focus-train {gap: 6px;font-size: 14px}
#map-focus-train svg {width: 17px;height: 17px}
.rail-map-where {
  padding-left: 6px;
  border-left: 1px solid #c5c9b2;
  color: #5c6c53;
  font: 700 14px/1.1 Consolas,"PingFang SC",sans-serif;
}
.rail-map-where:empty {display: none}
.rail-map-zoom {display: flex;align-items: center;gap: 5px}
.rail-map-zoom button {width: 38px;padding: 0;font: 800 18px/1 system-ui,sans-serif}
.rail-map-value {min-width: 42px;text-align: center;color: #4a5d4d;font: 700 14px/1 Consolas,monospace}
.rail-map-window {
  position: relative;
  flex: 0 1 100%;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  overflow-anchor: none;
}
.rail-map-window.is-zoomed {overflow: auto;cursor: grab;scrollbar-width: thin;scrollbar-color: #9ea98e #e5e9d8}
.rail-map-window:focus-visible {outline: 2px dashed #788967;outline-offset: 1px}
.rail-map-sheet {position: relative;min-width: 100%}
.rail-map-sheet>.board-axes {
  position: absolute;
  width: max-content;
  transform-origin: top left;
}
.rail-map-window.is-zoomed .rail-map-sheet {user-select: none;-webkit-user-select: none}
.rail-map-window.is-zoomed :is(.cell,.board-square,.edge-barrier) {touch-action: pan-x pan-y pinch-zoom}
.rail-map-window.is-panning,.rail-map-window.is-panning * {cursor: grabbing!important}
.rail-map-marker {
  position: absolute;
  z-index: 7;
  width: calc(87% / var(--board-size,4));
  height: calc(87% / var(--board-size,4));
  transform: translate(-50%,-50%);
  border: 3px solid #fbd770;
  border-radius: 22%;
  box-shadow: inset 0 0 0 1px #493d35,0 0 0 1px #664b34;
  pointer-events: none;
}
.rail-map-marker:not([hidden]),.dock.rail-map-dock-found {animation: rail-map-flash .65s ease-out 2}
.dock.rail-map-dock-found {outline: 3px solid #fbd770;outline-offset: 1px}
@keyframes rail-map-flash {
  0%,50% {box-shadow: inset 0 0 0 1px #523a30,0 0 0 2px #bd763a,0 0 0 5px #ffdf8296}
  100% {box-shadow: inset 0 0 0 1px #493d35,0 0 0 1px #664b34}
}
@media (prefers-reduced-motion: reduce) {
  .rail-map-marker:not([hidden]),.dock.rail-map-dock-found {animation: none}
}
body[data-world="moon"] .rail-map-toolbar {background: #e6eaea;color: #435b66;border-bottom-color: #b2bfc0}
body[data-world="moon"] .rail-map-toolbar button:not(:disabled) {border-color: #91a3a3;background: #f1f2e7}
@media (max-width: 650px) {
  .rail-map-toolbar {padding: 3px 8px}
  .rail-map-toolbar button {min-height: 44px}
  .rail-map-zoom button {width: 44px}
  .rail-map-marker {border-width: 2px}
}
