/* Additive main-menu panels. Account/payment modals and in-game HUD are unchanged. */
#setupBody > .setup-pane {min-width:0}
#routeList {max-height:285px;min-height:88px;flex:none}
#trainGrid {max-height:300px;flex:none}
#freightBuilder {max-height:310px;flex:none}
.menu-preview {margin-top:14px;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:var(--panel2);flex:none;min-width:0}
.preview-heading {padding:10px 12px;display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid var(--line2)}
.preview-heading h3 {margin:0;font-size:12px;font-weight:850}
.preview-tag {color:var(--accent);font-size:9px;font-weight:850;letter-spacing:.09em}
.preview-surface {position:relative;isolation:isolate;background:#0a1722;height:300px;overflow:hidden}
.preview-surface canvas {display:block;width:100%;height:100%;touch-action:none;outline:none}
.preview-surface canvas:focus-visible {outline:2px solid var(--accent2);outline-offset:-3px}
.preview-toolbar {position:absolute;z-index:2;top:8px;left:8px;right:8px;display:flex;align-items:center;gap:5px;pointer-events:none}
.preview-toolbar button {pointer-events:auto;background:rgba(8,18,26,.94);color:#f4f7fa;border:1px solid rgba(255,255,255,.24);min-height:32px;min-width:32px;padding:5px 9px;border-radius:6px;font-size:10px;font-weight:800}
.preview-toolbar button:hover,.preview-toolbar button[aria-pressed="true"] {border-color:var(--accent2);color:var(--accent2)}
.preview-toolbar .preview-spacer {flex:1}
.preview-status {font-size:10px;color:var(--muted);padding:9px 12px;line-height:1.45;min-height:33px;overflow-wrap:anywhere}
.preview-status[data-state="ready"] {color:var(--good)}
.preview-status[data-state="error"] {color:#ffb5a7}
.preview-route-name {padding:8px 12px 0;font-size:11px;font-weight:800;overflow-wrap:anywhere}
.preview-map-attribution {position:absolute;bottom:0;right:0;padding:4px 7px;font-size:8px;background:rgba(6,15,22,.88);color:#d4e2ee;z-index:2}
.preview-map-attribution a {color:inherit;text-decoration:underline;text-underline-offset:2px}
.preview-map-legend {position:absolute;bottom:24px;left:10px;color:#e8f1f9;background:rgba(6,15,22,.86);padding:4px 7px;font-size:9px;border-radius:4px;pointer-events:none}
.preview-map-legend::before {content:"";display:inline-block;width:20px;height:3px;background:#ffd523;vertical-align:middle;margin-right:5px;border:1px solid #06324a}
#trainPreviewSurface {height:248px;background:radial-gradient(ellipse at 50% 80%,#20384a,#09151e 80%)}
.preview-train-name {position:absolute;bottom:10px;left:12px;right:12px;pointer-events:none;color:#d6e4f0;font-size:10px;line-height:1.45;text-shadow:0 1px 3px #000;overflow-wrap:anywhere}
#routePreviewRetry {font-size:10px;color:var(--text);background:var(--input);border:1px solid var(--line);border-radius:5px;padding:6px 9px;margin:0 12px 9px}
@media(max-width:900px){#routeList{max-height:240px}#trainGrid{max-height:280px}.preview-surface{height:265px}#trainPreviewSurface{height:225px}.setup-pane{min-height:0!important}}
@media(pointer:coarse){.preview-toolbar button{min-height:44px;min-width:44px}.preview-map-attribution{font-size:9px}.menu-preview{backdrop-filter:none;-webkit-backdrop-filter:none}}
@media(max-height:600px) and (orientation:landscape){.preview-surface{height:235px}#trainPreviewSurface{height:210px}#routeList,#trainGrid{max-height:180px}.menu-preview{margin-top:9px}}
/* Keep list entries readable when the list is height-limited. */
#routeList > .route-option {flex-shrink:0;min-width:0}
#routeList .route-copy {min-width:0;overflow-wrap:anywhere}
#setupScreen .setup-foot {flex-wrap:wrap;min-width:0}
#setupScreen .summary {min-width:0;flex-wrap:wrap}
#setupScreen .summary-block {min-width:0}
#setupScreen .summary-value,#startRouteButton {overflow-wrap:anywhere}
#startRouteButton {max-width:100%;white-space:normal}
body:has(#setupScreen:not(.hidden)) .orientation-hint {display:none}
@media(max-width:600px){
  #setupScreen .setup-head {flex-wrap:wrap;gap:12px}
  #setupScreen .setup-version {width:100%;min-width:0}
  #setupScreen .setup-actions {flex-wrap:wrap;justify-content:flex-start}
  #setupScreen .summary {flex-basis:100%;gap:12px}
  #setupScreen .route-filters {grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  #setupScreen .route-filters select:last-child {grid-column:1/-1}
  #setupScreen .setup-logo .logo-main {font-size:42px}
  #setupScreen .train-grid {grid-template-columns:1fr}
}
