/*
  QCELL Support v12: tablet/mobile-only safety improvements.
  The existing PC layout, header markup, QCELL grid internals and API stay intact.
  Based on the uploaded site snapshot (2026-11-18).
*/

/* Tablet / small laptop: replace the crowded horizontal global navigation
   with the mobile-menu control already wired by common/support-ui.js. */
@media (min-width: 761px) and (max-width: 1024px) {
  body.qcell-modern-page .main-top .navbar-default > .container-fluid {
    gap: 14px !important;
    padding: 0 18px !important;
  }
  body.qcell-modern-page .main-top .qcell-mobile-menu {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 15px;
    border: 1px solid #d8e5fa;
    border-radius: 9px;
    background: #eff4ff;
    color: #1b4dbb;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
  }
  body.qcell-modern-page .main-top .qcell-nav-links-container {
    display: none !important;
    position: absolute !important;
    top: 76px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    padding: 10px 16px 14px;
    border-bottom: 1px solid #dfe7f2;
    background: #fff;
    box-shadow: 0 12px 24px rgba(18, 40, 83, .11);
    z-index: 1060;
  }
  body.qcell-modern-page.qcell-global-menu-open .main-top .qcell-nav-links-container {
    display: block !important;
  }
  body.qcell-modern-page .main-top ul#qcell-global-nav.navbar-nav {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    width: 100% !important;
    gap: 2px !important;
  }
  body.qcell-modern-page .main-top ul#qcell-global-nav.navbar-nav > li {
    display: block !important;
    width: 100%;
  }
  body.qcell-modern-page .main-top ul#qcell-global-nav.navbar-nav > li > a {
    height: 44px !important;
    min-height: 44px !important;
    justify-content: flex-start !important;
    padding: 0 15px !important;
    border-radius: 8px;
    font-size: 13px !important;
  }
  body.qcell-modern-page .main-top ul#qcell-global-nav.navbar-nav > li.active > a {
    background: #eff5ff !important;
  }
  body.qcell-modern-page .main-top ul#qcell-global-nav.navbar-nav > li.active > a::after {
    display: none !important;
  }

  /* Keep the grid's content area flexible beside the existing sidebar. */
  body.qcell-support-page .main-panel > .content,
  body.qcell-support-page .main-panel > .content .card {
    min-width: 0;
  }
  body.qcell-support-page .main-panel .ttl > .btn-wrap {
    max-width: 100%;
    min-width: 0;
  }
}

/* Phones: navigation and left menu are already responsive in support-modern.css.
   Only tune touch targets, text wrapping and the action toolbars. */
@media (max-width: 760px) {
  body.qcell-support-page .main-panel .ttl {
    align-items: flex-start;
    gap: 10px;
  }
  body.qcell-support-page .main-panel .ttl > .con-title {
    flex: 0 0 100%;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  body.qcell-support-page .main-panel .ttl > .btn-wrap {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  body.qcell-support-page .main-panel .ttl > .btn-wrap > button {
    box-sizing: border-box;
    flex: 1 1 142px;
    min-width: 0;
    min-height: 43px;
    max-width: 100%;
    padding: 10px 12px !important;
    white-space: normal;
    line-height: 1.45;
    text-align: center;
  }
  body.qcell-support-page .main-panel .ttl > .btn-wrap input[type="file"] {
    max-width: 100% !important;
    min-width: 0;
  }
  body.qcell-support-page .main-panel .header-bottom .con-txt,
  body.qcell-support-page .main-panel .header-bottom .con-box .con-txt {
    word-break: keep-all;
    overflow-wrap: anywhere;
  }
  body.qcell-support-page .main-panel .tab-area .tab {
    max-width: 100%;
    min-width: 0;
    flex-wrap: wrap;
  }
  body.qcell-support-page #qcellRegionControls {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  body.qcell-support-page .qcell-p3-region {
    min-height: 36px;
  }
  body.qcell-support-page .qcell-excel-toolbar {
    padding: 14px 12px;
  }
  body.qcell-support-page .qcell-excel-btn {
    min-height: 44px !important;
    white-space: normal;
    text-align: center;
  }
  body.qcell-support-page .qcell-footer-contacts {
    align-items: flex-start;
  }
}

/* Narrow phones: prevent a single overly wide label from pushing an action
   button or contact row outside the viewport. */
@media (max-width: 440px) {
  body.qcell-support-page .main-panel .content-header {
    padding: 16px 13px !important;
  }
  body.qcell-support-page .main-panel > .content .card {
    padding: 12px 10px !important;
  }
  body.qcell-support-page .main-panel .ttl > .btn-wrap > button {
    flex-basis: 136px;
    font-size: 12px;
  }
  body.qcell-support-page .qcell-footer-inner,
  body.qcell-support-page .qcell-footer-contacts {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  body.qcell-support-page .qcell-footer-contacts > div {
    column-gap: 8px;
    row-gap: 3px;
  }
  body.qcell-support-page .qcell-footer-hours {
    overflow-wrap: anywhere;
  }
}
