/* NABWORK mobile 17 — owner-approved compact one-row header.
   Visual-only responsive layer: preserve IDs, auth/logout/menu handlers,
   actual hero artwork, published metrics and unchanged desktop layout. */
@media (max-width:600px) {
  .nab-header {
    isolation:isolate;
    overflow:visible!important;
  }
  .nab-header .nab30-header-inner {
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto auto!important;
    grid-template-areas:"brand tools account"!important;
    align-items:center!important;
    gap:6px!important;
    min-height:64px!important;
    padding:9px 58px 9px 14px!important;
  }
  .nab-header .nab30-leading {
    grid-area:brand!important;
    display:flex!important;
    justify-self:start!important;
    min-width:0!important;
    width:auto!important;
    max-width:100%!important;
    gap:0!important;
  }
  .nab-header .nab30-leading > button:first-child {
    min-width:0!important;
    gap:0!important;
  }
  .nab-header .nab30-leading > button:first-child::after {
    font-size:clamp(18px,5.75vw,23px)!important;
    letter-spacing:-.065em!important;
    line-height:1.15!important;
  }
  .nab-header .nab30-controls {
    grid-area:tools!important;
    display:flex!important;
    justify-self:end!important;
    gap:0!important;
    width:auto!important;
    min-width:0!important;
  }
  .nab-header .nab30-controls #langBtn {
    display:inline-flex!important;
    justify-content:center!important;
    align-items:center!important;
    width:48px!important;
    min-width:48px!important;
    max-width:48px!important;
    flex:0 0 48px!important;
    height:38px!important;
    border-radius:12px!important;
    border:1px solid #d9eafa!important;
    background:#f6fbff!important;
    font-size:10px!important;
    letter-spacing:-.045em!important;
    padding:0!important;
  }
  .nab-header #userNavArea {
    grid-area:account!important;
    display:flex!important;
    justify-self:end!important;
    justify-content:flex-end!important;
    align-items:center!important;
    min-width:0!important;
    width:auto!important;
    max-width:100%!important;
    min-height:0!important;
    padding:0!important;
    border:0!important;
  }
  .nab-header #userNavArea:empty {display:none!important;}
  .nab-header #userNavArea > button {
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    height:38px!important;
    min-height:38px!important;
    padding:0 10px!important;
    white-space:nowrap!important;
    border-radius:11px!important;
    background:#0d213f!important;
    color:#fff!important;
    font-size:11px!important;
    font-weight:850!important;
  }
  /* Signed-in visitors see their functional dashboard avatar;
     the sign-out control remains reachable through the mobile dropdown. */
  .nab-header #userNavArea > div {
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    gap:0!important;
    min-width:0!important;
  }
  .nab-header #userNavArea > div > button:first-child {
    display:inline-flex!important;
    justify-content:center!important;
    align-items:center!important;
    gap:0!important;
    height:38px!important;
    min-height:38px!important;
    padding:5px 6px!important;
    border-radius:11px!important;
  }
  .nab-header #userNavArea > div > button:first-child > span:nth-child(3) {
    display:none!important;
  }
  .nab-header #userNavArea > div > button:last-child {
    display:none!important;
  }
  /* Collapse the legacy second-row mobile navigation and position the real,
     unchanged toggle in the reserved upper-right area of the same header. */
  .nab-header .nab-mobile-navigation {
    position:static!important;
    display:block!important;
    height:0!important;
    min-height:0!important;
    overflow:visible!important;
    padding:0!important;
    margin:0!important;
    border:0!important;
    background:transparent!important;
  }
  .nab-header #nab29MobileToggle {
    position:absolute!important;
    top:13px!important;
    right:12px!important;
    z-index:5!important;
    display:grid!important;
    place-items:center!important;
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    padding:0!important;
    margin:0!important;
    border:1px solid #d5e8fa!important;
    border-radius:12px!important;
    background:#eef7ff!important;
    box-shadow:none!important;
    color:#0b315d!important;
    font-size:0!important;
    line-height:1!important;
  }
  .nab-header #nab29MobileToggle::before {
    content:"☰";
    font-family:Arial,sans-serif!important;
    font-size:21px!important;
    font-weight:600!important;
    line-height:1!important;
  }
  .nab-header #nab29MobileToggle[aria-expanded="true"]::before {content:"×";font-size:26px!important;}
  .nab-header #mobileMenu:not(.hidden) {
    position:absolute!important;
    z-index:6!important;
    top:100%!important;
    left:0!important;
    right:0!important;
    width:100%!important;
    max-height:min(72dvh,560px)!important;
    overflow-y:auto!important;
    background:#fff!important;
    border-top:1px solid #e4eef7!important;
    border-bottom:1px solid #d4e6f7!important;
    box-shadow:0 18px 35px rgba(13,42,79,.16)!important;
    padding:14px!important;
  }
  #nabMobileLogout {display:none!important;}
  body:has(#userNavArea > div) #nabMobileLogout {
    display:block!important;
  }
  /* Keep the real approved illustration intact; just rebalance mobile
     whitespace and control shapes like the selected first concept. */
  #homeView .nw-v6-hero .nw-v6-hero-grid {
    padding:18px 0 22px!important;
  }
  #homeView .nw-v6-hero #heroTitle {
    margin:0 0 10px!important;
    font-size:clamp(26px,7.4vw,36px)!important;
    line-height:1.22!important;
  }
  #homeView .nw-v6-hero #heroSubtitle {
    margin:0 0 12px!important;
    line-height:1.65!important;
  }
  #homeView .nw-v6-hero .nw-v6-hero-art.nab82-photo-hero {
    border-radius:18px!important;
    margin-bottom:13px!important;
    box-shadow:0 10px 26px rgba(10,69,119,.12)!important;
  }
  #homeView .nw-v6-hero .nab-premium-search {
    border-radius:15px!important;
    box-shadow:0 8px 24px rgba(9,69,125,.07)!important;
  }
  #homeView .nw-v6-hero .nw-v6-hero-actions {
    margin-top:10px!important;
  }
  #homeView .nw-v6-hero .nw-v6-hero-actions button {
    border-radius:12px!important;
  }
  #homeView .nw-v6-metrics-grid {
    padding:13px 0!important;
  }
  #homeView .nw-v6-metric {
    gap:8px!important;
  }
  body.dark-mode .nab-header #langBtn,
  body.dark-mode .nab-header #nab29MobileToggle {
    background:#18304d!important;
    border-color:#385474!important;
    color:#f1f7ff!important;
  }
  body.dark-mode .nab-header #mobileMenu:not(.hidden) {
    background:#172b42!important;
    border-color:#385474!important;
  }
}
@media(max-width:365px) {
  .nab-header .nab30-header-inner {
    gap:4px!important;
    padding-right:50px!important;
    padding-left:10px!important;
  }
  .nab-header .nab30-leading > button:first-child::after {
    font-size:clamp(16px,5.35vw,19px)!important;
  }
  .nab-header .nab30-controls #langBtn {
    width:42px!important;
    min-width:42px!important;
    max-width:42px!important;
    flex-basis:42px!important;
    font-size:9px!important;
  }
  .nab-header #userNavArea > button {
    padding:0 6px!important;
    font-size:10px!important;
  }
  .nab-header #nab29MobileToggle {right:8px!important;width:34px!important;min-width:34px!important;}
}
@media(min-width:601px) {
  #nabMobileLogout {display:none!important;}
}

/* v17.1 — final phone-only polish, preserving the approved compact header
   and the original hero photo. No numbers, JS behavior or desktop changes. */
@media (max-width:600px) {
  #homeView .nw-v6-hero .nw-v6-hero-art.nab82-photo-hero {
    margin-bottom:10px!important;
  }
  #homeView .nw-v6-hero .nab-premium-search {
    display:flex!important;
    align-items:center!important;
    gap:6px!important;
    width:100%!important;
    min-width:0!important;
    min-height:55px!important;
    padding:5px!important;
    border-radius:15px!important;
  }
  #homeView .nw-v6-hero #searchInput {
    flex:1 1 auto!important;
    min-width:0!important;
    width:0!important;
    padding:10px 10px!important;
    line-height:1.4!important;
  }
  #homeView .nw-v6-hero #searchBtn {
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    flex:0 0 auto!important;
    min-width:79px!important;
    min-height:43px!important;
    padding:8px 12px!important;
    border-radius:11px!important;
    font-size:12px!important;
    line-height:1.35!important;
    white-space:nowrap!important;
  }
  #homeView .nw-v6-hero .nw-v6-hero-actions {
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:9px!important;
    margin:8px 0 0!important;
    align-items:stretch!important;
  }
  #homeView .nw-v6-hero .nw-v6-hero-actions button {
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    min-width:0!important;
    min-height:45px!important;
    padding:9px 7px!important;
    border-radius:12px!important;
    font-size:clamp(10px,2.95vw,11px)!important;
    line-height:1.35!important;
    text-align:center!important;
    white-space:normal!important;
  }
  #homeView .nw-v6-hero .nw-v6-chips {
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    gap:7px 8px!important;
    margin:13px 0 5px!important;
    padding:0 0 3px!important;
  }
  #homeView .nw-v6-hero .nw-v6-chips-label {
    display:block!important;
    flex:0 0 100%!important;
    width:100%!important;
    line-height:1.55!important;
    margin:0 0 1px!important;
  }
  #homeView .nw-v6-hero .nw-v6-chips button {
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    flex:0 0 auto!important;
    min-height:32px!important;
    max-width:100%!important;
    padding:6px 11px!important;
    border-radius:999px!important;
    font-size:10px!important;
    line-height:1.4!important;
    white-space:normal!important;
    text-align:center!important;
    overflow-wrap:anywhere!important;
  }
  /* Footer of the hero is intentionally brief; the chips are in normal
     scroll flow, so the Safari/Chrome bottom toolbar cannot trap them. */
  #homeView .nw-v6-hero .nw-v6-hero-grid {
    padding-bottom:17px!important;
  }
  #homeView .nw-v6-hero :is(#searchBtn,.nw-v6-hero-actions button,.nw-v6-chips button):focus-visible {
    outline:3px solid #137de4!important;
    outline-offset:2px!important;
  }
}
@media (max-width:365px) {
  #homeView .nw-v6-hero .nw-v6-hero-actions {
    gap:7px!important;
  }
  #homeView .nw-v6-hero .nw-v6-hero-actions button {
    font-size:10px!important;
    padding-inline:5px!important;
  }
  #homeView .nw-v6-hero #searchBtn {
    min-width:74px!important;
    padding-inline:9px!important;
  }
  #homeView .nw-v6-hero .nw-v6-chips button {
    padding-inline:9px!important;
  }
}

/* v17.2 — owner screenshot QA: align menu to the actual header center and
   keep the four existing real category filters on ONE horizontally pannable row.
   All rules are limited to phone widths. */
#homeView .nw-v17-chip-track {
  display:contents; /* On desktop retain the exact original flex-chip layout. */
}
@media (max-width:600px) {
  /* Anchor the hamburger to the header's center instead of a fixed top offset.
     Keep the existing menu click handler, expanded state and dropdown. */
  .nab-header #nab29MobileToggle {
    top:50%!important;
    transform:translateY(-50%)!important;
  }
  #homeView .nw-v6-hero .nw-v6-chips {
    display:block!important;
    width:100%!important;
    min-width:0!important;
    overflow:visible!important;
    margin:13px 0 5px!important;
  }
  #homeView .nw-v6-hero .nw-v6-chips-label {
    display:block!important;
    width:100%!important;
    margin:0 0 7px!important;
  }
  #homeView .nw-v6-hero .nw-v17-chip-track {
    display:flex!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    gap:6px!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    padding:1px 1px 6px!important;
    margin:0!important;
    scroll-padding-inline:4px;
    scrollbar-width:none;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-inline:contain;
    touch-action:pan-x;
  }
  #homeView .nw-v6-hero .nw-v17-chip-track::-webkit-scrollbar {
    display:none!important;
  }
  #homeView .nw-v6-hero .nw-v17-chip-track > button {
    flex:0 0 auto!important;
    width:auto!important;
    min-width:0!important;
    min-height:32px!important;
    max-width:none!important;
    padding:6px 9px!important;
    white-space:nowrap!important;
    line-height:1.35!important;
    font-size:10px!important;
    overflow-wrap:normal!important;
  }
}
