/* Region 9 Mobile UX 1.1.0
   CSS ONLY. No DOM movement, no JS, no observers, no 100vw breakout sizing. */

@media (max-width: 900px) {
  html,
  body.r9-mobile-ux-110 {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  body.r9-mobile-ux-110,
  body.r9-mobile-ux-110 * {
    box-sizing: border-box;
  }

  /* Kill the desktop full-bleed breakout that caused the iPhone blank canvas. */
  body.r9-mobile-ux-110.home .entry-content,
  body.r9-mobile-ux-110.front-page .entry-content,
  body.r9-mobile-ux-110.home .inside-article,
  body.r9-mobile-ux-110.front-page .inside-article,
  body.r9-mobile-ux-110.home #primary,
  body.r9-mobile-ux-110.front-page #primary,
  body.r9-mobile-ux-110.home .site-content,
  body.r9-mobile-ux-110.front-page .site-content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    transform: none !important;
    overflow-x: hidden !important;
  }

  body.r9-mobile-ux-110.home .entry-content > #r9ops-home-root,
  body.r9-mobile-ux-110.front-page .entry-content > #r9ops-home-root,
  body.r9-mobile-ux-110 #r9ops-home-root,
  body.r9-mobile-ux-110 .r9ops-home-shell {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 12px !important;
    padding: 0 !important;
    transform: none !important;
    left: auto !important;
    right: auto !important;
  }

  body.r9-mobile-ux-110 .r9ops-main,
  body.r9-mobile-ux-110 .r9ops-home-dashboard,
  body.r9-mobile-ux-110 .r9ops-primary-ops-grid,
  body.r9-mobile-ux-110 .r9ops-forecast-grid,
  body.r9-mobile-ux-110 .r9ops-secondary-grid,
  body.r9-mobile-ux-110 .r9ops-sidebar,
  body.r9-mobile-ux-110 .r9ops-top-panel,
  body.r9-mobile-ux-110 .r9ops-widget,
  body.r9-mobile-ux-110 .r9ops-product-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  /* Existing document order is already: main dashboard, then sidebar. Keep it that way. */
  body.r9-mobile-ux-110 .r9ops-home-shell {
    grid-template-columns: none !important;
  }
  body.r9-mobile-ux-110 .r9ops-primary-ops-grid,
  body.r9-mobile-ux-110 .r9ops-forecast-grid,
  body.r9-mobile-ux-110 .r9ops-secondary-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
  }
  body.r9-mobile-ux-110 .r9ops-sidebar {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    margin: 14px 0 0 !important;
    position: static !important;
  }

  /* Cards fit the viewport and never establish a desktop minimum width. */
  body.r9-mobile-ux-110 .r9ops-primary-ops-grid > .r9ops-top-panel {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
  }

  body.r9-mobile-ux-110 .r9ops-section-head {
    min-width: 0 !important;
    padding: 11px 12px !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
  }
  body.r9-mobile-ux-110 .r9ops-section-head h2 {
    min-width: 0 !important;
    max-width: 100% !important;
    font-size: 19px !important;
    line-height: 1.15 !important;
    overflow-wrap: anywhere !important;
  }

  /* WeatherFront: size only the iframe element; never touch its internal document. */
  body.r9-mobile-ux-110 .r9ops-radar-frame {
    width: 100% !important;
    height: 460px !important;
    min-height: 460px !important;
    overflow: hidden !important;
  }
  body.r9-mobile-ux-110 .r9ops-radar-frame iframe {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 460px !important;
    min-height: 460px !important;
    border: 0 !important;
  }

  /* Native nine-county map. Let its own renderer scale; do not move/reparent it. */
  body.r9-mobile-ux-110 .r9ops-map-shell,
  body.r9-mobile-ux-110 .r9ops-map-frame,
  body.r9-mobile-ux-110 .r9ops-map-stage,
  body.r9-mobile-ux-110 .r9ops-live-map,
  body.r9-mobile-ux-110 #r9ops-nine-county-map {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  body.r9-mobile-ux-110 .r9ops-map-shell {
    min-height: 0 !important;
    height: auto !important;
  }
  body.r9-mobile-ux-110 .r9ops-map-stage {
    min-height: 470px !important;
    height: auto !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
  body.r9-mobile-ux-110 .r9ops-live-map,
  body.r9-mobile-ux-110 #r9ops-nine-county-map {
    min-height: 470px !important;
    height: 470px !important;
    overflow: hidden !important;
  }
  body.r9-mobile-ux-110 #r9ops-nine-county-map > *,
  body.r9-mobile-ux-110 .r9ops-live-map > * {
    max-width: 100% !important;
    min-width: 0 !important;
  }
  body.r9-mobile-ux-110 #r9ops-nine-county-map svg,
  body.r9-mobile-ux-110 .r9ops-live-map svg,
  body.r9-mobile-ux-110 #r9ops-nine-county-map canvas,
  body.r9-mobile-ux-110 .r9ops-live-map canvas {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  body.r9-mobile-ux-110 .r9ops-map-topline,
  body.r9-mobile-ux-110 .r9ops-map-bottomline {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 8px 10px !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
  }
  body.r9-mobile-ux-110 .r9ops-map-legend-inline,
  body.r9-mobile-ux-110 .r9ops-map-actions {
    max-width: 100% !important;
    min-width: 0 !important;
    flex-wrap: wrap !important;
  }

  /* Passive county popup becomes a phone bottom sheet through CSS only. */
  body.r9-mobile-ux-110 #r9ops-nine-county-map .r9ux-county-popup {
    position: absolute !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 62% !important;
    border-radius: 16px 16px 0 0 !important;
    overflow: hidden !important;
  }
  body.r9-mobile-ux-110 #r9ops-nine-county-map .r9ux-popup-body {
    max-height: calc(62vh - 60px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Sidebar embeds and forecast graphics stay inside their cards. */
  body.r9-mobile-ux-110 .r9ops-widget-body,
  body.r9-mobile-ux-110 .r9ops-integrated,
  body.r9-mobile-ux-110 .r9ops-outage-embed,
  body.r9-mobile-ux-110 .r9ops-product-image {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  body.r9-mobile-ux-110 .r9ops-integrated iframe,
  body.r9-mobile-ux-110 .r9ops-outage-iframe {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    border: 0 !important;
  }
  body.r9-mobile-ux-110 .r9ops-outage-iframe {
    height: 380px !important;
  }
  body.r9-mobile-ux-110 .r9ops-product-image img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
  }

  /* Header command center: mobile-safe without increasing document width. */
  body.r9-mobile-ux-110 .r9cc-row,
  body.r9-mobile-ux-110 .r9cc-counties,
  body.r9-mobile-ux-110 .r9cc-update,
  body.r9-mobile-ux-110 .r9cc-alerts {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  body.r9-mobile-ux-110 .r9cc-title {
    text-align: center !important;
    justify-content: center !important;
    white-space: normal !important;
  }
  body.r9-mobile-ux-110 .r9cc-counties {
    display: block !important;
  }
  body.r9-mobile-ux-110 .r9cc-county-list {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 8px !important;
    gap: 8px !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x proximity !important;
  }
  body.r9-mobile-ux-110 .r9cc-county {
    flex: 0 0 145px !important;
    width: 145px !important;
    min-width: 145px !important;
    max-width: 145px !important;
    min-height: 48px !important;
    scroll-snap-align: start !important;
  }
  body.r9-mobile-ux-110 .r9cc-update,
  body.r9-mobile-ux-110 .r9cc-alerts {
    overflow: hidden !important;
  }
  body.r9-mobile-ux-110 .r9cc-scroll-cell,
  body.r9-mobile-ux-110 .r9cc-feed {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  /* Navigation: let GeneratePress own open/close behavior; only improve touch sizing. */
  body.r9-mobile-ux-110 .main-navigation,
  body.r9-mobile-ux-110 .main-navigation .inside-navigation,
  body.r9-mobile-ux-110 .main-navigation .main-nav,
  body.r9-mobile-ux-110 .main-navigation .main-nav > ul {
    max-width: 100% !important;
    min-width: 0 !important;
  }
  body.r9-mobile-ux-110 .main-navigation .menu-toggle {
    min-height: 52px !important;
    font-size: 16px !important;
    font-weight: 800 !important;
  }
  body.r9-mobile-ux-110 .main-navigation .main-nav ul li a {
    min-height: 46px !important;
  }

  /* General media containment. */
  body.r9-mobile-ux-110 img,
  body.r9-mobile-ux-110 video,
  body.r9-mobile-ux-110 canvas,
  body.r9-mobile-ux-110 svg,
  body.r9-mobile-ux-110 iframe {
    max-width: 100% !important;
  }
}

@media (max-width: 600px) {
  body.r9-mobile-ux-110.home .entry-content > #r9ops-home-root,
  body.r9-mobile-ux-110.front-page .entry-content > #r9ops-home-root,
  body.r9-mobile-ux-110 #r9ops-home-root,
  body.r9-mobile-ux-110 .r9ops-home-shell {
    margin: 8px !important;
  }

  body.r9-mobile-ux-110 .r9ops-radar-frame,
  body.r9-mobile-ux-110 .r9ops-radar-frame iframe {
    height: 430px !important;
    min-height: 430px !important;
  }

  body.r9-mobile-ux-110 .r9ops-map-stage,
  body.r9-mobile-ux-110 .r9ops-live-map,
  body.r9-mobile-ux-110 #r9ops-nine-county-map {
    min-height: 430px !important;
    height: 430px !important;
  }

  body.r9-mobile-ux-110 .r9ops-outage-iframe {
    height: 340px !important;
  }

  body.r9-mobile-ux-110 .r9ops-section-head h2 {
    font-size: 18px !important;
  }

  body.r9-mobile-ux-110 .r9cc-county {
    flex-basis: 138px !important;
    width: 138px !important;
    min-width: 138px !important;
    max-width: 138px !important;
  }
}
