/* RC18 route, identity, and publication correction layer. */
body[data-page="routes"] .routes-app{
  position:relative;
  grid-template-columns:minmax(360px,400px) minmax(0,1fr);
  min-height:720px;
  overflow:hidden;
}
body[data-page="routes"] .routes-rail{
  position:relative;
  min-width:0;
  padding:30px 28px 28px;
  overflow:auto;
  transition:opacity .18s ease;
}
.route-rail-collapse{
  position:absolute;
  top:16px;
  right:14px;
  width:44px;
  height:44px;
  border:1px solid rgba(229,191,143,.32);
  border-radius:50%;
  color:#f4dfc2;
  background:#102633;
  font-size:24px;
  cursor:pointer;
}
.route-rail-restore{
  position:absolute;
  z-index:12;
  top:22px;
  left:22px;
  min-height:44px;
  padding:0 16px;
  border:1px solid rgba(229,191,143,.4);
  border-radius:999px;
  color:#f4dfc2;
  background:rgba(6,20,29,.94);
  box-shadow:0 10px 28px rgba(0,0,0,.34);
}
body[data-page="routes"] .routes-app.route-rail-collapsed{grid-template-columns:0 minmax(0,1fr)}
body[data-page="routes"] .routes-app.route-rail-collapsed .routes-rail{visibility:hidden;opacity:0;padding:0}
body[data-page="routes"] .route-option{min-width:0}
body[data-page="routes"] .route-option>span:last-child{min-width:0;text-align:left}
body[data-page="routes"] .route-option strong,
body[data-page="routes"] .route-option small{display:block;overflow-wrap:anywhere}
body[data-page="routes"] .route-duration{font-size:16px;line-height:1.05;text-align:center}
body[data-page="routes"] .route-stage{min-width:0;isolation:isolate}
body[data-page="routes"] .route-itinerary{
  width:min(410px,calc(100% - 52px));
  padding:24px;
  scrollbar-gutter:stable;
}
body[data-page="routes"] .route-itinerary-head,
body[data-page="routes"] .route-stop-sequence,
body[data-page="routes"] .itinerary-stop,
body[data-page="routes"] .itinerary-stop>div{min-width:0}
body[data-page="routes"] .route-itinerary-head h3{font:500 22px/1.25 var(--serif);overflow-wrap:anywhere}
body[data-page="routes"] .route-safety{margin:14px 0 0;padding:11px 12px;border-left:3px solid #4f958e;background:rgba(33,111,103,.14);font-size:12px;line-height:1.5}
body[data-page="routes"] .route-safety.warning{border-color:#c98c4b;background:rgba(173,102,42,.15)}
body[data-page="routes"] .itinerary-stop{
  grid-template-columns:40px minmax(0,1fr);
  gap:10px 12px;
  align-items:start;
  padding:14px 0;
}
body[data-page="routes"] .itinerary-stop>button,
body[data-page="routes"] .itinerary-stop>.route-item-menu{grid-column:2;justify-self:start}
body[data-page="routes"] .itinerary-stop strong{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:13px;line-height:1.35;overflow-wrap:anywhere}
body[data-page="routes"] .route-actions{display:flex;flex-wrap:wrap;gap:10px}
body[data-page="routes"] .route-actions>*{min-height:44px;max-width:100%;white-space:normal}
.route-mobile-mode{display:none}

body.route-execution-active[data-page="routes"] .routes-rail,
body.route-execution-active[data-page="routes"] .route-itinerary,
body.route-execution-active[data-page="routes"] .route-provider-note,
body.route-execution-active[data-page="routes"] .route-rail-restore{display:none!important}
body.route-execution-active[data-page="routes"] .routes-app{grid-template-columns:1fr}
body.route-execution-active[data-page="routes"] .route-stage .live-walk-panel{
  left:auto;
  right:22px;
  bottom:22px;
  width:min(390px,calc(100% - 44px));
  max-height:calc(100% - 92px);
  padding:22px;
  overflow:auto;
}

@media(min-width:901px){
  body.live-walk-active[data-page="stops"]{height:100dvh;overflow:hidden}
  body.live-walk-active[data-page="stops"] .site-footer,
  body.live-walk-active[data-page="stops"] .preview-mode-banner{display:none!important}
  body.live-walk-active[data-page="stops"] .app-main{position:fixed;inset:116px 0 0;min-height:0}
  body.live-walk-active[data-page="stops"] .map-layout{width:100%;height:100%;min-height:0;grid-template-columns:1fr}
  body.live-walk-active[data-page="stops"] .map-sidebar,
  body.live-walk-active[data-page="stops"] .map-toolbar,
  body.live-walk-active[data-page="stops"] .map-provider-note,
  body.live-walk-active[data-page="stops"] .map-key,
  body.live-walk-active[data-page="stops"] .map-floating-card{display:none!important}
  body.live-walk-active[data-page="stops"] .map-stage{height:100%;min-height:0}
  body.route-execution-active[data-page="routes"]{height:100dvh;overflow:hidden}
  body.route-execution-active[data-page="routes"] .app-hero,
  body.route-execution-active[data-page="routes"] .site-footer{display:none!important}
  body.route-execution-active[data-page="routes"] .app-main{
    position:fixed;
    inset:116px 0 0;
    min-height:0;
  }
  body.route-execution-active[data-page="routes"] .page-section{
    position:absolute;
    inset:0;
    padding:0;
  }
  body.route-execution-active[data-page="routes"] .page-section>.app-shell,
  body.route-execution-active[data-page="routes"] .routes-app{
    width:100%;
    height:100%;
    min-height:0;
    margin:0;
  }
  body.route-execution-active[data-page="routes"] .route-stage{
    position:absolute;
    inset:0;
    min-height:0;
  }
}

@media(max-width:900px){
  body[data-page="routes"] .page-section{padding:0}
  body[data-page="routes"] .page-section>.app-shell{width:100%}
  body[data-page="routes"] .routes-app{display:block;min-height:calc(100dvh - 70px);border-left:0;border-right:0}
  body.route-map-view[data-page="routes"]:not(.route-execution-active){height:100dvh;overflow:hidden}
  body.route-map-view[data-page="routes"]:not(.route-execution-active) .site-footer{display:none}
  body.route-map-view[data-page="routes"]:not(.route-execution-active) .app-main{
    position:fixed;
    inset:102px 0 calc(var(--mobile-nav-height,66px) + env(safe-area-inset-bottom,0px));
    min-height:0;
  }
  body.route-map-view[data-page="routes"]:not(.route-execution-active) .page-section,
  body.route-map-view[data-page="routes"]:not(.route-execution-active) .page-section>.app-shell,
  body.route-map-view[data-page="routes"]:not(.route-execution-active) .routes-app{height:100%;min-height:0}
  body[data-page="routes"] .route-mobile-mode{
    position:absolute;
    z-index:20;
    top:0;
    left:0;
    right:0;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:4px;
    padding:8px max(12px,env(safe-area-inset-left));
    background:rgba(5,17,25,.96);
    border-bottom:1px solid rgba(229,191,143,.18);
  }
  body[data-page="routes"] .route-mobile-mode button{min-height:44px;border:1px solid rgba(229,191,143,.2);border-radius:999px;color:#d9c9b2;background:#102633;font-weight:800;letter-spacing:.08em}
  body[data-page="routes"] .route-mobile-mode button[aria-pressed="true"]{color:#07131c;background:#f0d8b6;border-color:#f0d8b6}
  body.route-map-view[data-page="routes"] .routes-rail{display:none}
  body.route-map-view[data-page="routes"] .route-stage{position:absolute;inset:61px 0 0;height:auto;min-height:0}
  body.route-map-view[data-page="routes"] .route-itinerary{left:12px;right:12px;bottom:max(12px,env(safe-area-inset-bottom));max-height:43%;width:auto;padding:18px}
  body.route-plan-view[data-page="routes"] .routes-rail{display:block;max-height:none;padding:24px 18px}
  body.route-plan-view[data-page="routes"] .route-rail-collapse,
  body.route-plan-view[data-page="routes"] .route-rail-restore{display:none}
  body.route-plan-view[data-page="routes"] .route-stage{min-height:0;height:auto;background:#081923;overflow:visible}
  body.route-plan-view[data-page="routes"] .route-stage>img,
  body.route-plan-view[data-page="routes"] .route-stage>.route-path,
  body.route-plan-view[data-page="routes"] .route-stage>.gm-style,
  body.route-plan-view[data-page="routes"] .route-stage>.route-provider-note{display:none!important}
  body.route-plan-view[data-page="routes"] .route-itinerary{position:relative;inset:auto;width:auto;max-height:none;margin:0;padding:24px 18px 110px;border:0;box-shadow:none;background:#081923;overflow:visible}
  body.route-execution-active[data-page="routes"] .route-mobile-mode{display:none}
  body.route-execution-active[data-page="routes"]{height:100dvh;padding-top:0;overflow:hidden}
  body.route-execution-active[data-page="routes"] .site-header,
  body.route-execution-active[data-page="routes"] .event-live-bar,
  body.route-execution-active[data-page="routes"] .app-hero,
  body.route-execution-active[data-page="routes"] .site-footer{display:none!important}
  body.route-execution-active[data-page="routes"] .app-main,
  body.route-execution-active[data-page="routes"] .page-section,
  body.route-execution-active[data-page="routes"] .page-section>.app-shell,
  body.route-execution-active[data-page="routes"] .routes-app{width:100%;height:100dvh;min-height:0;margin:0;padding:0}
  body.route-execution-active[data-page="routes"] .page-section{position:fixed;z-index:30;inset:0}
  body.route-execution-active.route-map-view[data-page="routes"] .route-stage{position:absolute;inset:0;height:100dvh;min-height:0}
  body.route-execution-active[data-page="routes"] .route-stage .live-walk-panel{left:10px;right:10px;bottom:max(10px,env(safe-area-inset-bottom));width:auto;max-height:55%;padding:16px}
}

@media(max-width:430px){
  body[data-page="routes"] .app-hero{display:none}
  body[data-page="routes"] .itinerary-stop{grid-template-columns:36px minmax(0,1fr)}
  body[data-page="routes"] .route-actions>*{flex:1 1 100%}
}

@media(max-width:900px) and (max-height:520px) and (orientation:landscape){
  body[data-page="routes"] .app-hero{display:none}
  body.route-map-view[data-page="routes"]:not(.route-execution-active) .event-live-bar{display:none}
  body.route-map-view[data-page="routes"]:not(.route-execution-active) .app-main{top:70px}
  body.route-map-view[data-page="routes"] .route-itinerary{top:8px;right:8px;bottom:8px;left:auto;width:min(44vw,360px);max-height:none;padding:14px}
  body.route-execution-active[data-page="routes"] .route-stage .live-walk-panel[data-detent="half"],
  body.route-execution-active[data-page="routes"] .route-stage .live-walk-panel[data-detent="full"]{top:68px;right:8px;bottom:8px;left:auto;width:min(46vw,380px);max-height:none}
}

/* Player identity is a clear action surface, while recovery remains secondary. */
body[data-page="my-halloween"] .player-identity{align-items:center;gap:22px}
body[data-page="my-halloween"] .player-identity>div:nth-child(2){min-width:0;flex:1}
body[data-page="my-halloween"] .player-identity h2{overflow-wrap:anywhere}
body[data-page="my-halloween"] .player-name-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;max-width:430px}
body[data-page="my-halloween"] .player-name-actions>*{min-height:44px;white-space:normal}
.player-identity-form{display:grid;gap:16px}
.player-identity-form input{min-height:48px;font-size:16px}
.identity-check{min-height:24px;margin:0;color:#c7b69f}
.identity-check.is-available{color:#89c9b9}
.identity-check.is-unavailable{color:#f1ae8c}
.identity-sso{display:flex;width:100%;min-height:48px;align-items:center;justify-content:center;text-align:center}
.identity-divider{display:flex;align-items:center;gap:12px;margin:18px 0;color:#a9967c;font-size:12px;text-transform:uppercase;letter-spacing:.1em}
.identity-divider::before,.identity-divider::after{content:"";height:1px;flex:1;background:rgba(229,191,143,.2)}
.player-auth-copy{display:grid;gap:14px}
.player-auth-copy .notice{display:grid;gap:4px}
body[data-page="my-halloween"] .recovery-panel{margin-top:18px;border-style:dashed;background:rgba(8,25,35,.45)}

@media(max-width:700px){
  body[data-page="my-halloween"] .player-identity{align-items:flex-start}
  body[data-page="my-halloween"] .player-name-actions{width:100%;max-width:none;justify-content:stretch}
  body[data-page="my-halloween"] .player-name-actions>*{flex:1 1 calc(50% - 5px)}
}

@media(max-width:390px){
  body[data-page="my-halloween"] .player-name-actions>*{flex-basis:100%}
}

/* Household enrollment reuses the voting step across map, rating and profile views. */
.voting-address-check{padding:20px}
.voting-address-check form{display:grid;gap:14px}
.voting-address-check form>p{margin:0}
.voting-address-check .field,#household-profile .field{min-width:0;grid-template-columns:minmax(0,1fr)}
.voting-address-check .field input,#household-profile .field input{min-width:0;max-width:100%}
.voting-address-check .checkbox-label{display:flex;align-items:flex-start;gap:10px;min-height:44px}
.voting-address-check .checkbox-label input{width:20px;height:20px;flex-shrink:0;margin-top:4px}
#household-profile{margin-bottom:18px}
#household-profile details+details{margin-top:10px}
#household-profile li{line-height:1.6;margin-block:8px}
