/* Official-site responsive layer. Desktop visuals stay unchanged; phone and
   tablet layouts get readable navigation, touch targets and stacked content. */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body,
main,
section,
article,
nav,
header,
footer,
div {
  min-width: 0;
}

img,
video,
canvas,
svg {
  max-width: 100%;
}

button,
input,
select,
textarea {
  max-width: 100%;
}

p,
li,
dd,
td,
.file-name,
.post-file-title,
.account-row strong {
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .hero-grid,
  .info-grid,
  .two-col,
  .one-col,
  .updates-grid,
  .content-grid,
  .summary-grid,
  .pan-hero-grid,
  .post-dashboard {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .feat-grid,
  .data-grid,
  .process-grid,
  .portal-grid,
  .download-stack,
  .plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  table {
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  :root {
    --nav-height: 0px;
  }

  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
  }

  body {
    min-width: 0 !important;
    font-size: 16px;
    line-height: 1.65;
  }

  .site-nav,
  .home-download-page .site-nav,
  .download-page .site-nav,
  .partmaker-page .site-nav {
    position: relative !important;
    right: auto !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 10px 14px 8px !important;
  }

  .site-nav-inner,
  .home-download-page .site-nav-inner,
  .download-page .site-nav-inner {
    width: 100%;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 9px !important;
  }

  .site-nav .brand {
    width: 100%;
    min-height: 44px;
    gap: 10px;
  }

  .site-nav .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 11px;
  }

  .site-nav .brand-name,
  .home-download-page .brand-name,
  .download-page .brand-name {
    max-width: none !important;
    overflow: visible !important;
    font-size: 15px;
    line-height: 1.25;
    text-overflow: clip !important;
    white-space: normal !important;
  }

  .site-nav .brand-sub {
    display: none;
  }

  .site-nav .nav-links,
  .home-download-page .nav-links,
  .download-page .nav-links {
    width: calc(100% + 4px) !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    margin: 0 -2px;
    padding: 0 2px 3px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .site-nav .nav-links::-webkit-scrollbar {
    display: none;
  }

  .site-nav .nav-links a,
  .home-download-page .nav-links a,
  .download-page .nav-links a,
  .site-nav .nav-links a.nav-hide-sm {
    flex: 0 0 auto;
    min-width: max-content !important;
    min-height: 42px;
    height: 42px;
    display: inline-flex !important;
    align-items: center;
    padding: 0 14px !important;
    border-radius: 10px;
    font-size: 14px !important;
    line-height: 1;
    white-space: nowrap;
  }

  .site-body {
    padding-top: 0 !important;
  }

  .reveal,
  .reveal.is-visible,
  .reveal.in-view {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .hero,
  .hero-section,
  .page-header,
  .pan-hero,
  .post-wrap {
    min-height: 0 !important;
    padding-top: 28px !important;
  }

  .hero-title,
  .pan-title,
  .post-title,
  .section-title,
  .legal-card h1 {
    max-width: 100%;
    font-size: clamp(32px, 9vw, 42px) !important;
    line-height: 1.14 !important;
    letter-spacing: -.035em !important;
    word-break: normal;
  }

  .hero-lead,
  .section-lead,
  .post-lead,
  .dl-card p,
  .legal-card p,
  .legal-card li {
    font-size: 15px;
    line-height: 1.75;
  }

  .hero-actions,
  .post-links,
  .card-404 .actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
  }

  .hero-actions .btn,
  .post-links .btn,
  .card-404 .btn {
    width: 100%;
  }

  .btn,
  button,
  [role="button"] {
    min-height: 44px;
    font-size: 14px;
  }

  .feat-grid,
  .info-grid,
  .data-grid,
  .process-grid,
  .portal-grid,
  .download-stack,
  .plan-grid,
  .hero-stats,
  .metric-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .content-section,
  .page-body,
  .legal-section,
  .download-content,
  .section,
  .post-wrap {
    padding-right: 14px !important;
    padding-left: 14px !important;
  }

  .hero-panel,
  .feat-card,
  .info-card,
  .dl-card,
  .legal-card,
  .pan-stage,
  .post-hero,
  .post-panel,
  .post-note {
    padding: 20px 18px !important;
    border-radius: 20px !important;
  }

  .site-footer {
    align-items: stretch;
    padding: 24px 14px;
  }

  .footer-copy {
    font-size: 12px;
    line-height: 1.65;
  }

  .footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .footer-links a {
    min-height: 40px;
    height: auto;
    justify-content: center;
    padding: 7px 10px;
    font-size: 13px;
    text-align: center;
  }

  /* PDF library */
  .library-nav {
    min-height: 64px;
    height: 64px;
  }

  .library-nav nav {
    top: 64px !important;
    height: 48px !important;
  }

  .library-nav nav a {
    min-width: max-content;
    min-height: 48px;
    padding: 0 15px !important;
    font-size: 14px !important;
    white-space: nowrap;
  }

  .library-nav .brand strong {
    max-width: 190px;
    font-size: 14px;
  }

  .library-nav .account-button {
    min-width: 44px;
    min-height: 44px;
  }

  .library-nav + main,
  body > .library-nav ~ main {
    padding-top: 66px !important;
  }

  .heading-copy h1 {
    font-size: 30px !important;
  }

  .library-search input,
  .category-tabs button,
  .catalog-summary strong,
  .document-item strong,
  .detail-description p,
  .detail-facts,
  .download-gate strong {
    font-size: 14px;
  }

  .library-search input {
    min-height: 44px;
    font-size: 16px;
  }

  .document-item small,
  .document-item .file-meta,
  .catalog-summary span,
  .detail-topics li,
  .download-gate span,
  .device-note {
    font-size: 12px;
  }

  .document-item {
    min-height: 68px;
  }

  /* Member centre */
  .topbar {
    position: relative !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 10px 14px 8px !important;
    align-items: stretch !important;
    flex-wrap: wrap;
    gap: 8px;
  }

  .topbar .brand {
    min-height: 42px;
  }

  .topbar .logo {
    font-size: 16px;
    white-space: normal;
  }

  .topbar .breadcrumb {
    min-width: 0;
    flex-wrap: wrap;
  }

  .topbar .nav {
    width: 100%;
    display: flex;
    flex-wrap: nowrap !important;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .topbar .nav::-webkit-scrollbar {
    display: none;
  }

  .topbar .nav a {
    flex: 0 0 auto;
    min-width: max-content;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 0 13px;
    font-size: 14px;
    white-space: nowrap;
  }

  .topbar .breadcrumb,
  .topbar .breadcrumb a {
    font-size: 14px;
  }

  .shell,
  .layout,
  .wrap {
    width: 100%;
    margin: 0 auto !important;
    padding: 18px 14px 40px !important;
  }

  .shell .panel {
    padding: 18px !important;
    border-radius: 16px;
  }

  .field input,
  .coupon-row input,
  .search-input,
  .post-search,
  .drive-search {
    width: 100% !important;
    min-height: 46px;
    font-size: 16px !important;
  }

  .coupon-row,
  .search-row,
  .product-search-row,
  .drive-tools {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .account-row {
    align-items: flex-start;
  }

  .account-row strong {
    max-width: 62%;
    text-align: right;
    white-space: normal;
  }

  /* APK list: preserve the download action instead of hiding it. */
  .topbar + .layout {
    padding-top: 18px !important;
  }

  .layout .panel-head {
    align-items: stretch;
    flex-direction: column;
    padding: 16px !important;
  }

  .layout .toolbar,
  .layout .stats {
    width: 100%;
  }

  .layout .toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .file-table,
  .file-table tbody,
  .file-table tr,
  .file-table td {
    display: block;
    width: 100%;
  }

  .file-table thead {
    display: none;
  }

  .file-table tr {
    padding: 16px;
    border-bottom: 1px solid #eef1f4;
  }

  .file-table td {
    padding: 0 !important;
    border: 0 !important;
  }

  .file-table td:nth-child(2) {
    display: block !important;
    margin: 10px 0;
    font-size: 13px;
  }

  .file-table td:nth-child(3) {
    display: none !important;
  }

  .file-table td:nth-child(4) {
    display: block !important;
    text-align: left !important;
  }

  .file-table .btn-dl {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    font-size: 14px;
  }

  .file-name,
  .empty p,
  .panel-head h2 {
    font-size: 15px;
  }

  /* PartMaker */
  .post-panel-head,
  .post-item {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  .post-download {
    width: 100%;
    min-height: 46px;
    font-size: 14px;
  }

  .post-file-title,
  .post-note p,
  .post-note li {
    font-size: 15px;
  }

  /* Standalone utility pages */
  body > .wrap .card {
    padding: 18px 16px !important;
    border-radius: 14px;
  }

  body > .wrap h1 {
    font-size: 30px;
    line-height: 1.2;
  }

  body > .wrap h2 {
    font-size: 20px;
  }

  body > .wrap p,
  body > .wrap li,
  body > .wrap .path {
    font-size: 15px;
    line-height: 1.7;
  }

  body > .card {
    border-radius: 20px !important;
  }

  body > .card .hero,
  body > .card .body {
    padding: 22px 18px !important;
  }

  body > .card .brand {
    align-items: center;
    gap: 12px;
  }

  body > .card h1 {
    font-size: 23px !important;
  }

  body > .card .status {
    align-items: flex-start;
  }

  .page-404 {
    min-height: 100svh;
    padding: 20px 14px;
  }

  .card-404 {
    padding: 26px 20px;
    border-radius: 20px;
  }

  .card-404 h1 {
    font-size: clamp(58px, 22vw, 86px);
  }

  /* Long privacy copy */
  body > main:not(.shell):not(.wrap):not(.card) {
    max-width: 100%;
  }
}

@media (max-width: 420px) {
  .library-nav .brand strong {
    max-width: 175px;
  }

  .library-nav .account-button {
    min-width: 42px;
  }

  .layout .toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .layout .toolbar .btn-dl {
    width: 100%;
  }

  .footer-links {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
