/* Shared responsive navigation and layouts for every resource page. */
:root { --site-nav-height: 56px; }

.unified-nav { flex-wrap: nowrap; }
.unified-nav .nav-hamburger { display: none; }
.unified-nav a.nav-home { align-self: center; }
.unified-nav .nav-links { min-width: 0; }
.unified-nav button:focus-visible,
.unified-nav a:focus-visible,
.table-scroll:focus-visible {
  outline: 3px solid #6366F1;
  outline-offset: -3px;
}
.unified-nav .nav-dropdown-toggle .caret {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.unified-nav .nav-dropdown.open .nav-dropdown-toggle .caret {
  transform: translateY(2px) rotate(225deg);
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-scroll-hint,
.mobile-tier-header { display: none; }
.compare-header { top: var(--site-nav-height); }
.info-card a,
.setup-note code,
.support-card code { overflow-wrap: anywhere; }
.chat-msgs { min-height: 0; }
#chatInput { min-width: 0; }
#chatPanel {
  max-height: calc(100vh - var(--site-nav-height) - 108px);
  max-height: calc(100dvh - var(--site-nav-height) - 108px);
}

/* Collapse before the desktop links can overflow on tablets and small laptops. */
@media (max-width: 1399px) {
  :root { --site-nav-height: 64px; }
  .unified-nav {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    height: var(--site-nav-height);
    padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  }
  .unified-nav .nav-divider { display: none; }
  .unified-nav a.nav-home { margin-right: 12px; }
  .unified-nav a.nav-home svg { width: 160px; height: auto; }
  .unified-nav .nav-hamburger {
    display: block;
    width: 44px;
    height: 44px;
    padding: 8px 11px;
    margin-left: auto;
  }
  .unified-nav .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: auto;
    flex: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    max-height: calc(100vh - var(--site-nav-height));
    max-height: calc(100dvh - var(--site-nav-height));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    padding: 8px max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    border-top: 1px solid #E5E7EB;
    border-bottom: 1px solid #E5E7EB;
    background: #fff;
    box-shadow: 0 8px 14px rgba(0, 0, 0, .12);
  }
  .unified-nav .nav-links::-webkit-scrollbar { display: block; width: 6px; }
  .unified-nav .nav-links.open { display: flex; }
  .unified-nav .nav-links a,
  .unified-nav .nav-dropdown-toggle {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.5;
    white-space: normal;
    border-radius: 8px;
  }
  .unified-nav .nav-dropdown { width: 100%; }
  .unified-nav .nav-dropdown-toggle { width: 100%; justify-content: space-between; }
  .unified-nav .nav-dropdown-menu {
    position: static;
    display: none;
    min-width: 0;
    width: 100%;
    margin: 2px 0 4px;
    padding: 4px 0 4px 12px;
    border: 0;
    border-left: 2px solid #E5E7EB;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
  }
  .unified-nav .nav-dropdown.open .nav-dropdown-menu { display: block; }
  .unified-nav .nav-links .nav-dropdown-menu a { display: flex; min-height: 44px; padding: 10px 14px; }
  .filter-bar { position: static; }
  #globalSearch,
  #chatInput { font-size: 16px; }
}

@media (max-width: 680px) {
  .compare-header { position: static; }
  .compare-header-inner { grid-template-columns: 1fr; }
  .section-title .st-e,
  .section-title .st-p { display: none; }
  .row-express::before,
  .row-pro::before {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
  }
  .row-express::before { content: "Express"; color: #1D4ED8; }
  .row-pro::before { content: "Pro"; color: #6D28D9; }
}

@media (max-width: 640px) {
  .table-scroll-hint { display: block; margin: 10px 0 6px; color: #64748B; font-size: 12px; }
  .table-scroll .step-table { min-width: 640px; }
  .table-scroll .sla-table,
  .table-scroll .reject-table,
  .table-scroll .qr-table,
  .table-scroll .comp-table { min-width: 560px; }
  .data-table { table-layout: fixed; }
  .data-table .name { white-space: normal; overflow-wrap: anywhere; }
  .data-table td,
  .data-table th { overflow-wrap: anywhere; padding-left: 10px; padding-right: 10px; }
  .section-header,
  .product-header,
  .pre-start-header,
  .filter-banner { flex-wrap: wrap; }
  .section-header h2,
  .product-header h3 { min-width: 0; }
  .download-btn { max-width: 100%; white-space: normal; }
  .product-header .badge { margin-left: 0; }
  .support-grid { grid-template-columns: minmax(0, 1fr); }
  .support-card { min-width: 0; }
  .tp-toggle,
  .fbtn,
  .quick-q { min-height: 44px; }
  .tier-header-row { display: none; }
  .col-body-row { border-top: 1.5px solid #E2E8F0; border-radius: 12px; }
  .mobile-tier-header { display: block; margin: -8px 0 16px; }
  #globalSearch,
  #chatInput { font-size: 16px; }
  .filter-sep { display: none; }
  #chatFab { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); }
  #chatPanel {
    right: 16px;
    bottom: max(80px, calc(env(safe-area-inset-bottom) + 72px));
    width: calc(100% - 32px);
    max-height: calc(100vh - var(--site-nav-height) - 96px);
    max-height: calc(100dvh - var(--site-nav-height) - max(96px, calc(env(safe-area-inset-bottom) + 88px)));
  }
  .chat-close { min-width: 44px; min-height: 44px; }
  .chat-inp-row { padding: 10px; }
  #chatSend { width: 44px; height: 44px; }
}

@media (max-height: 480px) {
  #chatPanel .quick-qs { display: none; }
  #chatPanel .chat-head { padding: 8px 12px; }
  #chatPanel .chat-msgs { padding: 8px 10px; }
  #chatPanel .chat-inp-row { padding: 8px 10px; }
}
