/**
 * Zibayab Mobile Shell V3 — Phase 5
 * One navigation dock or one contextual action dock. Never both.
 */
:root{
  --zy-mobile-safe-bottom:env(safe-area-inset-bottom,0px);
  --zy-mobile-nav-height:62px;
  --zy-mobile-action-height:66px;
  --zy-mobile-touch:48px;
}
.zy-mobile-conversion-dock{display:none}

@media(max-width:760px){
  html{scroll-padding-bottom:calc(var(--zy-mobile-action-height) + var(--zy-mobile-safe-bottom) + 16px)}
  body{--zy-mobile-bottom-space:0px;-webkit-tap-highlight-color:transparent}
  body.zy-has-mobile-nav,body:has([data-zy-mobile-nav]){--zy-mobile-bottom-space:calc(var(--zy-mobile-nav-height) + var(--zy-mobile-safe-bottom))}
  body.zy-has-mobile-conversion,body:has([data-zy-mobile-conversion]){--zy-mobile-bottom-space:calc(var(--zy-mobile-action-height) + var(--zy-mobile-safe-bottom) + 12px)}
  body{padding-bottom:var(--zy-mobile-bottom-space)!important}

  :where([id]){scroll-margin-top:calc(var(--zy-sticky-top) + 14px);scroll-margin-bottom:calc(var(--zy-mobile-bottom-space) + 14px)}
  :where(a,button,.button,[role="button"],summary){touch-action:manipulation}
  :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){font-size:16px!important}
  :where(.button,.icon-button,.header-mobile-menu,.header-mobile-actions .icon-button,.route-context-bar__actions a,.profile-dt-tabs a,.profile-tabs a,.article-toc__toggle,.share-row button){min-height:var(--zy-mobile-touch)}
  :where(.icon-button,.header-mobile-menu,.header-mobile-actions .icon-button){min-width:var(--zy-mobile-touch)}
  :where(.provider-result__actions .button,.provider-result__profile-link,.provider-result__portfolio-action){min-height:var(--zy-mobile-touch)!important}
  :where(.local-filter-bar button,.local-filter-bar a,.local-filter-bar select,.local-filter-chip,.local-filter-reset){min-height:44px}

  /* Discovery navigation: flat, quiet and brand-led. */
  .mobile-dock.zy-mobile-nav{
    z-index:930;
    height:calc(var(--zy-mobile-nav-height) + var(--zy-mobile-safe-bottom));
    padding:4px 8px calc(4px + var(--zy-mobile-safe-bottom));
    border-top:1px solid var(--zy-line);
    background:var(--zy-surface);
    box-shadow:0 -1px 0 color-mix(in srgb,var(--zy-line) 55%,transparent);
    backdrop-filter:none;-webkit-backdrop-filter:none;
    transition:transform var(--zy-medium),opacity var(--zy-fast);
  }
  .mobile-dock.zy-mobile-nav>a,.mobile-dock.zy-mobile-nav>button{
    min-width:0;min-height:52px;padding:4px 3px;border:0;border-radius:6px;
    background:transparent;color:var(--zy-muted);font-size:.69rem!important;font-weight:680;
  }
  .mobile-dock.zy-mobile-nav>a:hover,.mobile-dock.zy-mobile-nav>button:hover{background:var(--zy-shell-hover);color:var(--zy-ink)}
  .mobile-dock.zy-mobile-nav>a.is-active{background:var(--zy-brand-soft);color:var(--zy-brand);font-weight:780}
  .mobile-dock.zy-mobile-nav .zy-icon{width:20px;height:20px}
  .mobile-dock.zy-mobile-nav .mobile-dock__search{color:var(--zy-brand);font-weight:800}
  .mobile-dock.zy-mobile-nav .mobile-dock__search .zy-icon{
    width:30px;height:30px;padding:6px;border-radius:6px;background:var(--zy-action-primary);color:var(--zy-action-primary-ink)
  }

  /* Intent-heavy pages replace discovery navigation with one contextual surface. */
  .zy-mobile-conversion-dock{
    position:fixed;z-index:960;right:0;bottom:0;left:0;
    display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;align-items:stretch;
    min-height:calc(var(--zy-mobile-action-height) + var(--zy-mobile-safe-bottom));
    padding:7px 10px calc(7px + var(--zy-mobile-safe-bottom));
    border-top:1px solid var(--zy-line);border-radius:0;
    background:var(--zy-surface);box-shadow:0 -6px 20px color-mix(in srgb,var(--zy-ink) 8%,transparent);
    backdrop-filter:none;-webkit-backdrop-filter:none;
    transition:transform var(--zy-medium),opacity var(--zy-fast);
  }
  .js .zy-mobile-conversion-dock.is-reveal-gated:not(.is-revealed){transform:translateY(calc(100% + var(--zy-mobile-safe-bottom) + 8px));opacity:0;pointer-events:none}
  .zy-mobile-conversion-dock__action{
    min-width:0;min-height:52px;display:flex;align-items:center;justify-content:flex-start;gap:8px;
    margin:0;padding:7px 11px;border-radius:6px;font:inherit;text-align:right;text-decoration:none;touch-action:manipulation
  }
  .zy-mobile-conversion-dock__primary{border:1px solid var(--zy-action-primary);background:var(--zy-action-primary);color:var(--zy-action-primary-ink)}
  .zy-mobile-conversion-dock__secondary{width:68px;justify-content:center;flex-direction:column;gap:1px;padding-inline:5px;border:1px solid var(--zy-line);background:transparent;color:var(--zy-ink)}
  .zy-mobile-conversion-dock__icon{width:28px;height:28px;display:grid;place-items:center;flex:none;border-radius:5px;background:color-mix(in srgb,currentColor 9%,transparent)}
  .zy-mobile-conversion-dock__primary .zy-mobile-conversion-dock__icon{background:color-mix(in srgb,var(--zy-action-primary-ink) 12%,transparent)}
  .zy-mobile-conversion-dock__secondary .zy-mobile-conversion-dock__icon{width:25px;height:25px;background:transparent}
  .zy-mobile-conversion-dock__icon .zy-icon{width:18px;height:18px}
  .zy-mobile-conversion-dock__copy{display:grid;min-width:0;line-height:1.3}
  .zy-mobile-conversion-dock__copy strong{display:block;overflow:hidden;text-overflow:ellipsis;font-size:.79rem;font-weight:820;white-space:nowrap}
  .zy-mobile-conversion-dock__copy small{display:block;margin-top:1px;overflow:hidden;text-overflow:ellipsis;color:currentColor;font-size:.69rem!important;line-height:1.35!important;opacity:.76;white-space:nowrap}
  .zy-mobile-conversion-dock__secondary .zy-mobile-conversion-dock__copy{display:block;text-align:center}
  .zy-mobile-conversion-dock__secondary .zy-mobile-conversion-dock__copy strong{font-size:.69rem;white-space:nowrap}
  .zy-mobile-conversion-dock__secondary .zy-mobile-conversion-dock__copy small{display:none}
  .zy-mobile-conversion-dock__extensions:empty{display:none}
  .zy-mobile-conversion-dock__extensions{display:contents}

  /* Persistent controls disappear behind keyboard and overlays. */
  body.zy-mobile-keyboard-open :where(.zy-mobile-conversion-dock,.mobile-dock.zy-mobile-nav),
  html.is-modal-open :where(.zy-mobile-conversion-dock,.mobile-dock.zy-mobile-nav),
  html.is-contact-sheet-open :where(.zy-mobile-conversion-dock,.mobile-dock.zy-mobile-nav),
  html.has-filter-sheet :where(.zy-mobile-conversion-dock,.mobile-dock.zy-mobile-nav){transform:translateY(calc(100% + var(--zy-mobile-safe-bottom) + 10px));opacity:0;pointer-events:none}

  .market-dialog__panel{max-height:min(88dvh,760px);overflow-y:auto;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;padding-bottom:calc(16px + var(--zy-mobile-safe-bottom))}
  .zy-contact-sheet{max-height:92dvh;overflow:visible}
  .zy-contact-sheet__panel{position:relative;max-height:88dvh;overflow-y:auto;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;padding:18px 16px calc(18px + var(--zy-mobile-safe-bottom))!important}
  .zy-contact-sheet__panel:before{content:"";display:block;width:34px;height:3px;margin:-7px auto 12px;border-radius:999px;background:color-mix(in srgb,var(--zy-muted) 30%,transparent)}
  .zy-contact-sheet__close{width:var(--zy-mobile-touch)!important;height:var(--zy-mobile-touch)!important;min-width:var(--zy-mobile-touch);min-height:var(--zy-mobile-touch)}
  .zy-contact-sheet__action{min-height:62px!important;padding:9px 10px!important}
  .zy-contact-sheet__action-icon{width:38px!important;height:38px!important}

  :where(.profile-dt-tabs,.profile-tabs,.local-filter-form__controls,.local-filter-bar__controls,.home-search-modes,.route-context-bar__actions){scrollbar-width:none;-webkit-overflow-scrolling:touch;overscroll-behavior-inline:contain}
  :where(.profile-dt-tabs,.profile-tabs,.local-filter-form__controls,.local-filter-bar__controls,.home-search-modes,.route-context-bar__actions)::-webkit-scrollbar{display:none}
  :where(.profile-dt-tabs,.profile-tabs){scroll-snap-type:x proximity}
  :where(.profile-dt-tabs a,.profile-tabs a){scroll-snap-align:start;white-space:nowrap}
  .local-filter-bar{top:calc(var(--zy-sticky-top) + 4px)!important;max-width:100%}

  @media(hover:none) and (pointer:coarse){
    :where(.button,.provider-result,.route-item,.home-service-card,.home-need-card):hover{transform:none!important}
  }
}

@media(max-width:380px){
  .zy-mobile-conversion-dock{gap:5px;padding-inline:7px}
  .zy-mobile-conversion-dock__secondary{width:62px}
  .zy-mobile-conversion-dock__action{padding-inline:8px}
  .zy-mobile-conversion-dock__copy strong{font-size:.75rem}
  .mobile-dock.zy-mobile-nav>a,.mobile-dock.zy-mobile-nav>button{font-size:.66rem!important}
}

@media(prefers-reduced-motion:reduce){
  .zy-mobile-conversion-dock,.mobile-dock.zy-mobile-nav{transition:none!important}
}

@media print{
  .zy-mobile-conversion-dock,.mobile-dock.zy-mobile-nav{display:none!important}
  body{padding-bottom:0!important}
}
