.storm-location-picker {
  margin: 0 0 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 0;
}
.storm-location-picker label {
  display: block;
  margin: 14px 0 6px;
}
.storm-location-picker input[type="checkbox"] {
  width: auto;
  margin-right: 10px;
}
.storm-location-picker .map-confirm {
  display: flex;
  align-items: center;
}
.place-results {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.place-results p {
  width: 100%;
}
.place-results button {
  text-align: left;
  min-height: 44px;
}
.storm-route-map {
  height: 360px;
  position: relative;
  background: #0a1b22;
  border: 1px solid var(--line);
  margin: 12px 0;
  overflow: hidden;
}
.storm-route-map svg {
  width: 100%;
  height: 100%;
  touch-action: none;
}
.map-tools {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 6px;
  z-index: 1;
}
.map-tools button {
  padding: 8px 12px;
  min-height: 44px;
  background: #14323e;
}
.rail-path {
  fill: none;
  stroke: #547881;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.station-dot {
  fill: #b3c5cc;
}
.station-label {
  font-size: 9px;
  fill: #d4e2e7;
  paint-order: stroke;
  stroke: #0a1b22;
  stroke-width: 3px;
}
.storm-map-marker {
  cursor: pointer;
}
.storm-map-marker circle {
  fill: currentColor;
  stroke: #061014;
  stroke-width: calc(3px * var(--k, 1));
}
.storm-map-marker text {
  fill: #061014;
  font-size: 14px;
  font-weight: 800;
}
.storm-map-marker:focus {
  outline: none;
}
.storm-map-marker:focus circle {
  stroke: #fff;
  stroke-width: calc(5px * var(--k, 1));
}
.map-selected {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
#stormWallMap {
  height: 450px;
  position: relative;
  background: #0a1b22;
}
#stormWallMap svg {
  width: 100%;
  height: 100%;
  touch-action: none;
}
#mapStatus {
  font-size: 14px;
  margin: 10px 0;
}
#chosenPlace {
  margin: 14px 0;
  color: var(--warn);
}
@media (min-width: 1000px) {
  .wall-mode.storm-map-wall #board {
    grid-template-columns: minmax(0, 1.2fr) minmax(400px, 1fr);
    grid-template-rows: auto minmax(0, 1fr) minmax(150px, 34%);
    gap: 12px 16px;
  }
  .wall-mode #stormMapPanel {
    grid-column: 1;
    grid-row: 2 / 4;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .wall-mode.storm-map-wall .incident-section {
    grid-column: 2;
    grid-row: 2;
  }
  .wall-mode.storm-map-wall .team-section {
    grid-column: 2;
    grid-row: 3;
  }
  .wall-mode #stormWallMap {
    flex: 1;
    min-height: 0;
    height: auto;
  }
  .wall-mode #mapStatus {
    flex: none;
  }
  .wall-mode.storm-map-wall .team-section {
    grid-column: 2;
  }
  .wall-mode.storm-map-wall .board-table,
  .wall-mode.storm-map-wall tbody,
  .wall-mode.storm-map-wall tr,
  .wall-mode.storm-map-wall td {
    display: block;
    width: 100% !important;
  }
  .wall-mode.storm-map-wall thead {
    display: none;
  }
  .wall-mode.storm-map-wall td {
    padding: 7px 12px;
    border: 0;
  }
  .wall-mode.storm-map-wall tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }
  .wall-mode.storm-map-wall .location {
    font-size: 24px;
  }
  .wall-mode.storm-map-wall .timer {
    font-size: 26px;
  }
  .wall-mode.storm-map-wall .train strong {
    font-size: 24px;
  }
  .wall-mode.storm-map-wall .team-section .location {
    font-size: 20px;
  }
  .wall-mode.storm-map-wall .row-meta {
    font-size: 12px;
  }
}
@media (min-width: 1000px) {
  .wall-mode.storm-map-wall h1 {
    font-size: 32px;
  }
  .wall-mode.storm-map-wall #board > section > .section-head {
    padding: 6px 0;
  }
  .wall-mode.storm-map-wall .section-head p {
    margin: 4px 0 8px;
  }
  .wall-mode.storm-map-wall #incidents tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 12px;
    padding: 12px 0;
  }
  .wall-mode.storm-map-wall #incidents td:first-child {
    grid-column: 1/-1;
  }
  .wall-mode.storm-map-wall #incidents td {
    padding: 4px 10px;
  }
  .wall-mode.storm-map-wall .row-meta {
    display: none;
  }
  .wall-mode.storm-map-wall .location {
    font-size: 22px;
  }
  .wall-mode.storm-map-wall .line,
  .wall-mode.storm-map-wall .eta-detail {
    font-size: 15px;
  }
  .wall-mode.storm-map-wall .timer {
    font-size: 23px;
  }
  .wall-mode.storm-map-wall .team-section tr {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    padding: 8px;
  }
  .wall-mode.storm-map-wall .team-section td[data-label]:before {
    display: none;
  }
}
.map-group-list {
  position: absolute;
  top: 60px;
  left: 12px;
  right: 12px;
  max-height: 70%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  z-index: 3;
}
.map-group-list button {
  text-align: left;
  min-height: 44px;
}

/* 28 Oct 2026: line states on the track, train pins, legend */
.rail-path,
.station-dot,
.station-label {
  pointer-events: none;
}
.line-state-path {
  fill: none;
  stroke-width: 7px;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  opacity: 0.95;
  pointer-events: none;
}
.line-state-path.block { stroke: #ff5a73; }
.line-state-path.caution { stroke: #f4cf68; stroke-dasharray: 10 7; }
.line-state-path.normal { stroke: #78e1b1; }
.storm-map-marker.train-marker circle { fill: #0d1c23; stroke: currentColor; stroke-width: calc(3px * var(--k, 1)); }
.storm-map-marker.train-marker text { fill: currentColor; font-weight: 800; }
.map-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 15px;
  color: var(--txt);
}
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.leg-pin {
  width: 16px; height: 16px; border-radius: 50%; display: inline-block;
}
.leg-pin.confirmed { background: #ff8393; }
.leg-pin.unconfirmed { background: #f4cf68; }
.leg-pin.train { background: #0d1c23; border: 3px solid #f4cf68; box-sizing: border-box; }
.leg-pin.team { background: #78e1b1; }
.leg-line { width: 28px; height: 0; border-top: 5px solid; display: inline-block; }
.leg-line.block { border-color: #ff5a73; }
.leg-line.caution { border-color: #f4cf68; border-top-style: dashed; }
.leg-line.normal { border-color: #78e1b1; }
.wall-mode .map-legend { font-size: 17px; }
/* widths keyed by state, whichever other states share the stretch: Blocked underneath and
   widest, Caution inside it, Normal narrowest; the legend shows the same three widths */
.line-state-path.block { stroke-width: 9px; }
.line-state-path.caution { stroke-width: 4px; }
.line-state-path.normal { stroke-width: 3px; }
.leg-line.block { border-top-width: 7px; }
.leg-line.caution { border-top-width: 4px; }
.leg-line.normal { border-top-width: 3px; }
.line-state-path.unconfirmed { opacity: 0.55; }
#stormWallMap, #pickerMap { user-select: none; -webkit-user-select: none; }
.line-state-halo { fill: none; stroke: #061014; stroke-width: 13px; stroke-linecap: round; vector-effect: non-scaling-stroke; pointer-events: none; }
