/* Omnizgo mobile refinement — 2026-11-08
   UI-only: no display-state, form names, validation, routes, permissions, payment,
   message or role logic changed. Works with the existing platform styles.
   Breakpoints: tablet <=1024, phone <=767, compact phone <=420.
*/
@media (max-width: 1024px) {
  /* Allow grid and flex descendants to shrink instead of widening the viewport. */
  body :is(main, article, section, .container, .container-fluid, .row, .col,
      .professional-page, .pn-page-shell, .tb-workspace, .tb-discovery-content,
      .feed-shell, .store-shell, .events-shell, .community-sp-shell,
      .directory-shell, .directory-layout, .results-area,
      .chat-main, .chat-app-shell, .oa-page, .knowledge-page) {
    min-width: 0;
  }
  body :is(img, video, iframe, canvas) { max-width: 100%; }
  body :is(h1, h2, h3, h4, p, .card-title) { overflow-wrap: break-word; }
  /* Preserve table columns, allow deliberate swiping rather than page overflow. */
  :is(.table-responsive, .table-wrap, .table-scroll, .data-table-wrap,
    .orders-table-wrap, .admin-table-wrap, .tb-table-wrap) {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  :is(.tabs, .tab-list, .filter-tabs, .feed-filter-tabs,
    .tb-profile-tabs, .tb-network-tabs, .oa-tabs, .profile-tabs,
    .events-tabs, .community-sp-scope-tabs) {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
}

@media (max-width: 767.98px) {
  :root { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  html { min-width: 0; }
  body { min-width: 0; overflow-x: clip; }
  body :is(input, select, textarea, button) { max-width: 100%; }
  body :is(input, select, textarea) { min-width: 0; }
  /* 16px inputs prevent iOS Safari's unintended focus zoom. */
  body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
       select, textarea) { font-size: max(16px, 1em); }
  :is(.modal-dialog, .dialog-card, [role="dialog"]):not(.dropdown-menu) {
    max-width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }
  :is(.modal-body, .dialog-body) { max-height: calc(100dvh - 140px); overflow-y: auto; }
  :is(.tabs, .tab-list, .filter-tabs, .feed-filter-tabs,
    .tb-profile-tabs, .tb-network-tabs, .oa-tabs, .profile-tabs,
    .events-tabs, .community-sp-scope-tabs) {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
  }
  :is(.tabs, .tab-list, .filter-tabs, .feed-filter-tabs,
    .tb-profile-tabs, .tb-network-tabs, .oa-tabs, .profile-tabs,
    .events-tabs, .community-sp-scope-tabs) > :is(button, a) {
    flex-shrink: 0;
  }
  /* Long unbroken content (URLs, filenames, job names) never clips cards. */
  :is(.job-card, .business-card, .event-card, .community-card,
    .store-product-card, .product-card, .social-post,
    .tb-pro-card, .tb-job-detail-panel, .pn-surface) {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  /* Shared authentication: compact international dial code + usable phone field. */
  .auth-page .oz-auth-phone-row { gap: 8px; min-width: 0; }
  .auth-page .oz-auth-phone-row > select {
    flex: 0 0 118px; width: 118px; max-width: 38%;
    padding-inline: 7px; text-overflow: ellipsis;
  }
  .auth-page .oz-auth-phone-row > .oz-phone-input-wrap { flex: 1 1 0; min-width: 0; }
  .auth-page .oz-auth-phone-row input { width: 100%; min-width: 0; }
  .auth-page .auth-main { max-width: 100%; }
  .auth-page .auth-shell { max-width: calc(100% - 20px); }
  /* Scrollable chat panes use the visual viewport on mobile browsers. */
  .chat-page .chat-app-shell,
  .platform-chat-page .chat-app-shell {
    max-width: calc(100% - 8px);
    min-height: min(520px, calc(100dvh - 110px));
  }
  .chat-page .conversation-panel,
  .chat-page .thread-panel,
  .platform-chat-page .conversation-panel,
  .platform-chat-page .thread-panel { min-width: 0; }
  /* TalentBridge: keep application actions visible and the quick-start readable. */
  body.professional-network-page .professional-page .pn-page-shell {
    width: calc(100% - 20px) !important;
    max-width: 100% !important;
  }
  body.professional-network-page .tb-quick-guide {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 9px !important;
    padding: 16px !important;
  }
  body.professional-network-page .tb-quick-guide > :is(strong, span, .tb-quick-step, .tb-quick-intro) {
    white-space: normal !important;
    min-width: 0;
    overflow-wrap: anywhere;
    margin: 0 !important;
  }
  body.professional-network-page .tb-quick-guide > button {
    width: 100% !important;
    min-height: 42px !important;
    margin: 3px 0 0 !important;
    justify-content: center !important;
    white-space: normal !important;
  }
  body.professional-network-page .tb-seeker-hero .tb-hero-actions {
    display: flex !important;
    flex-wrap: wrap !important;
  }
  body.professional-network-page .tb-seeker-hero .tb-hero-actions > :is(button, a) {
    min-height: 44px;
  }
  body.professional-network-page .tb-seeker-summary,
  body.professional-network-page .tb-job-results-layout,
  body.professional-network-page .tb-discovery-shell,
  body.professional-network-page .tb-recruiter-columns {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  body.professional-network-page .tb-job-detail-panel { overflow-wrap: anywhere; }
  /* Common profile and discovery content: leave drawers and existing toggles intact. */
  .connect-page .connect-shell,
  .platform-matrimony .page-shell,
  .community-page .community-sp-shell,
  .events-management-page .events-shell,
  .su-directory-page .directory-shell,
  .store-page .store-shell,
  .feed-page .feed-shell {
    max-width: calc(100% - 20px);
    min-width: 0;
  }
  .su-directory-page .hero-search > *,
  .events-management-page .hero-search > * { min-width: 0; }
  .su-directory-page .results-head,
  .su-directory-page .result-tools,
  .events-management-page .events-toolbar {
    max-width: 100%;
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .su-directory-page .directory-business-scroll { max-width: 100%; }
  /* Checkout and account forms should be comfortable with the keyboard open. */
  .store-page :is(.checkout-form, .cart-summary, .order-summary,
    .product-detail-copy, .store-hero-grid),
  .oa-page :is(.oa-form, .oa-card, .oa-panel) { min-width: 0; max-width: 100%; }
  /* Embedded media fits phone cards without cropping sideways. */
  :is(.post-media, .video-player, .product-gallery, .profile-cover, .event-cover)
    :is(img, video, iframe) { max-width: 100%; }
}

@media (max-width: 420px) {
  .auth-page .oz-auth-phone-row > select {
    flex-basis: 108px; width: 108px; max-width: 38%; font-size: 13px;
  }
  body.professional-network-page .tb-seeker-hero.tb-welcome-hero {
    padding: 19px 15px !important;
  }
  body.professional-network-page .tb-seeker-summary .tb-summary-profile {
    padding: 14px !important;
  }
  body.professional-network-page .tb-summary-profile > img {
    width: 52px !important; height: 52px !important; flex-basis: 52px !important;
  }
  .store-page .store-shell,
  .events-management-page .events-shell,
  .community-page .community-sp-shell,
  .su-directory-page .directory-shell { max-width: calc(100% - 16px); }
  :is(.modal-dialog, .dialog-card, [role="dialog"]):not(.dropdown-menu) {
    max-width: calc(100vw - 12px);
  }
}

/* Accessibility: preserve keyboard visibility and reduce motion when requested. */
@media (max-width: 767.98px) {
  body :is(button, a, input, select, textarea):focus-visible {
    outline-offset: 2px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto; }
}
