/* Map controls outside the streets stay reachable while the selected map fills the viewport. */
.tw-secondary-tools { display:flex; justify-content:flex-end; margin:4px 0 8px; }
.tw-secondary-tools .btn, .tw-secondary-full .btn { min-height:44px; font:inherit; }
.tw-secondary-full {
  inset:0; margin:0; padding:0; width:100%; max-width:none; height:100vh; height:100dvh;
  max-height:none; border:0; border-radius:0; box-sizing:border-box;
  color:var(--ink,#172d38); background:var(--paper,#fff);
}
.tw-secondary-full[open] { display:flex; flex-direction:column; overflow:hidden; }
.tw-secondary-full::backdrop { background:#152b37; }
body:has(.tw-secondary-full[open]) { overflow:hidden; }
.tw-secondary-head {
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:6px;
  padding:max(6px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 6px max(12px,env(safe-area-inset-left));
  flex:none; border-bottom:1px solid var(--line,#ccc);
}
.tw-secondary-head strong { font-size:1rem; max-width:62%; }
.tw-secondary-host { min-height:0; flex:1; display:flex; flex-direction:column; }
.tw-secondary-host > :is(.transit-map-shell, #borough-map, #nearby-map20),
.tw-secondary-host .transit-map-shell #transit-map {
  flex:1; min-height:0; width:100%; height:100%; border:0; border-radius:0; margin:0; box-sizing:border-box;
}
.tw-secondary-host .transit-map-shell { display:flex; flex-direction:column; }
.tw-secondary-host .transit-map-shell #transit-map { flex:1; min-height:0; height:auto; }
#transit-map-error.transit-map-error { position:static; inset:auto; margin:0; border-radius:0; font-size:.875rem; }
#transit-map-error[hidden] { display:none; }
.tw-secondary-selection { flex:none; padding:0 12px env(safe-area-inset-bottom); border-top:1px solid var(--line,#ccc); }
.tw-secondary-selection summary { padding:10px 0; min-height:44px; cursor:pointer; font-weight:650; }
.tw-secondary-selection #nearby-map-detail20 { max-height:25dvh; overflow:auto; }
.tw-secondary-full .leaflet-container { position:relative; z-index:0; }
:is(#transit-map,#borough-map,#nearby-map20) .leaflet-popup-close-button { width:44px; height:44px; line-height:40px; text-align:center; }
:is(#transit-map,#borough-map,#nearby-map20) .leaflet-popup-content { margin-right:40px; }
@media (max-width: 760px), (max-height: 550px) {
  /* Long station narratives are already in the separately labelled station card.
     Keep its map link and the station name while leaving more of the route exposed. */
  #transit-map .subway-popup p:nth-of-type(n+2) { display:none; }
}
.tw-secondary-host .subway-popup p:nth-of-type(n+2) { display:none; }
