/* Final classic-page refinements: compact platform tabs and quieter section rhythm. */

@layer catalog-visual-system {
body.office-catalog-dle main.product-page #versions .product-choice-switch,
body.office-catalog-dle main.product-page #requirements .product-choice-switch {
  display: inline-flex !important;
  align-items: stretch !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 38px !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 2px !important;
  overflow: visible !important;
  border: 0 !important;
  border-bottom: 1px solid #d7e0e9 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.office-catalog-dle main.product-page #versions .filter-button,
body.office-catalog-dle main.product-page #requirements .requirements-platform-tab {
  position: relative !important;
  display: inline-flex !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0 !important;
  min-height: 38px !important;
  height: 38px !important;
  margin: 0 0 -1px !important;
  padding: 0 11px !important;
  gap: 7px !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #526274 !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

body.office-catalog-dle main.product-page #versions .filter-button:hover,
body.office-catalog-dle main.product-page #requirements .requirements-platform-tab:hover {
  background: rgba(29, 103, 184, .045) !important;
  color: #1c5f9e !important;
}

body.office-catalog-dle main.product-page #versions .filter-button.active,
body.office-catalog-dle main.product-page #versions .filter-button[aria-pressed="true"],
body.office-catalog-dle main.product-page #requirements .requirements-platform-tab.active,
body.office-catalog-dle main.product-page #requirements .requirements-platform-tab[aria-selected="true"] {
  border-bottom-color: #1f6fbe !important;
  background: rgba(29, 103, 184, .055) !important;
  color: #155a9e !important;
  font-weight: 600 !important;
}

body.office-catalog-dle main.product-page #versions .filter-button:focus-visible,
body.office-catalog-dle main.product-page #requirements .requirements-platform-tab:focus-visible {
  outline: 2px solid rgba(31, 111, 190, .62) !important;
  outline-offset: 2px !important;
  z-index: 1;
}

body.office-catalog-dle main.product-page #versions .filter-button :is(img, svg),
body.office-catalog-dle main.product-page #requirements .requirements-platform-tab img {
  flex: none !important;
  width: 14px !important;
  height: 14px !important;
  object-fit: contain !important;
}
}

body.office-catalog-dle main.product-page #faq .faq-head {
  margin-bottom: 14px !important;
}

body.office-catalog-dle main.product-page #faq .faq-layout--single .faq-content {
  padding-top: 8px !important;
}

body.office-catalog-dle > footer.footer .footer-grid > div:first-child > p {
  max-width: 250px;
  line-height: 1.55;
}

@media (max-width: 760px) {
  @layer catalog-visual-system {
    body.office-catalog-dle main.product-page #versions .product-choice-switch,
    body.office-catalog-dle main.product-page #requirements .product-choice-switch {
      display: flex !important;
      width: 100% !important;
      max-width: 100% !important;
      overflow-x: auto !important;
      overflow-y: hidden !important;
      scrollbar-width: none;
    }

    body.office-catalog-dle main.product-page #versions .product-choice-switch::-webkit-scrollbar,
    body.office-catalog-dle main.product-page #requirements .product-choice-switch::-webkit-scrollbar {
      display: none;
    }

    body.office-catalog-dle main.product-page #versions .filter-button,
    body.office-catalog-dle main.product-page #requirements .requirements-platform-tab {
      flex: 1 0 auto !important;
      min-height: 40px !important;
      height: 40px !important;
      padding-inline: 10px !important;
    }
  }

  body.office-catalog-dle main.product-page #faq .faq-head {
    margin-bottom: 10px !important;
  }

  body.office-catalog-dle main.product-page #faq .faq-layout--single .faq-content {
    padding-top: 4px !important;
  }
}

/* Keep all four platform choices visible on the narrowest product screens. */
@media (max-width: 350px) {
  @layer catalog-visual-system {
    body.office-catalog-dle main.product-page #versions .product-choice-switch {
      display: grid !important;
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      gap: 4px;
      overflow: visible !important;
    }
  }
}

/* Product capabilities read as open editorial entries, without a rule at every item. */
@layer inset-dividers {
  body.office-catalog-dle main#top.product-page #features .excel-capability {
    border-top: 0 !important;
  }
}

/* One text scale for the primary facts in every product version table. */
@layer catalog-visual-system {
  body.office-catalog-dle main#top.product-page #versions .release-row :is(.language-cell, .channel-cell, .platform-tag) {
    color: var(--cvs-ink, #27272e) !important;
    font-size: 14px !important;
    font-weight: 450 !important;
    line-height: 1.45 !important;
  }

  body.office-catalog-dle main#top.product-page #versions .release-row .platform-tag > span {
    color: inherit !important;
    font: inherit !important;
  }

  body.office-catalog-dle main#top.product-page #versions .release-row :is(.release-id p, .channel-cell small) {
    color: var(--cvs-muted, #616169) !important;
    font-size: 11.5px !important;
    font-weight: 400 !important;
    line-height: 1.45 !important;
  }

  @media (max-width: 760px) {
    body.office-catalog-dle main#top.product-page #versions .release-row :is(.language-cell, .channel-cell, .platform-tag) {
      font-size: 13px !important;
    }
  }
}

/* Keep every version action visible when the product table becomes a mobile list. */
@media (max-width: 780px) {
  @layer catalog-visual-system {
    body.office-catalog-dle main#top.product-page #versions .release-row {
      grid-template-columns: minmax(0, 1fr) !important;
      grid-template-areas: "id" "platform" "channel" "language" "button" !important;
    }

    body.office-catalog-dle main#top.product-page #versions .release-row .language-cell {
      grid-area: language;
    }

    body.office-catalog-dle main#top.product-page #versions .release-row > .download {
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
      grid-area: button;
      justify-self: stretch !important;
      width: 100% !important;
      min-width: 0 !important;
      min-height: 44px !important;
      padding: 10px 16px !important;
      gap: 8px;
      border: 1px solid var(--cvs-accent-ink, #185abd) !important;
      background: var(--cvs-accent-ink, #185abd) !important;
      color: #fff !important;
      font-size: 14px !important;
      font-weight: 600 !important;
      line-height: 1.3 !important;
      text-decoration: none !important;
      text-align: center;
    }

    body.office-catalog-dle main#top.product-page #versions .release-row > a.download:is(:hover, :focus-visible) {
      background: color-mix(in srgb, var(--cvs-accent-ink, #185abd) 86%, #17232f) !important;
      border-color: color-mix(in srgb, var(--cvs-accent-ink, #185abd) 86%, #17232f) !important;
      color: #fff !important;
    }

    body.office-catalog-dle main#top.product-page #versions .release-row > a.download:focus-visible {
      outline: 2px solid var(--cvs-accent-ink, #185abd) !important;
      outline-offset: 3px !important;
    }
  }

  /* The earlier policy layer retains the unavailable file's separate grey style. */
  @layer local-link-policy {
    body.office-catalog-dle main#top.product-page #versions .release-row > button.download[data-external-unavailable] {
      height: 44px !important;
      min-height: 44px !important;
    }
  }
}

/* Give platform choices room for fingers on phones and touch tablets. */
@media (max-width: 1100px), (any-pointer: coarse) {
  @layer catalog-visual-system {
    body.office-catalog-dle main.product-page #versions .filter-button,
    body.office-catalog-dle main.product-page #requirements .requirements-platform-tab {
      min-height: 44px !important;
      height: auto !important;
      padding-block: 8px !important;
      font-size: 13px !important;
      line-height: 1.25 !important;
    }

    body.office-catalog-dle main.product-page .mobile-demo-teaser > button,
    body.office-catalog-dle main.product-page .product-platform-navigation .product-platform-link,
    body.office-catalog-dle main.product-page #versions .release-row > .download {
      min-height: 44px !important;
      height: auto !important;
    }

    body.office-catalog-dle main#top.product-page #versions .release-row > .download {
      border-color: var(--cvs-accent-ink, #185abd) !important;
      background: var(--cvs-accent-ink, #185abd) !important;
      color: #fff !important;
    }

    body.office-catalog-dle main#top.product-page #versions .release-row > a.download:is(:hover, :focus-visible) {
      border-color: color-mix(in srgb, var(--cvs-accent-ink, #185abd) 86%, #17232f) !important;
      background: color-mix(in srgb, var(--cvs-accent-ink, #185abd) 86%, #17232f) !important;
      color: #fff !important;
    }

    body.office-catalog-dle main#top.product-page #versions .release-row > a.download:focus-visible {
      outline: 2px solid var(--cvs-accent-ink, #185abd) !important;
      outline-offset: 3px !important;
    }
  }

  @layer local-link-policy {
    body.office-catalog-dle main#top.product-page #versions .release-row > button.download[data-external-unavailable] {
      min-height: 44px !important;
    }
  }
}

/* Secondary release facts stay legible when the table is stacked. */
@media (max-width: 780px) {
  @layer catalog-visual-system {
    body.office-catalog-dle main#top.product-page #versions .release-row :is(.release-id p, .channel-cell small) {
      font-size: 12.5px !important;
      line-height: 1.5 !important;
    }
  }
}

/* Balance the three-choice grid without shrinking a platform label. */
@media (max-width: 350px) {
  @layer catalog-visual-system {
    body.office-catalog-dle main.product-page #versions .filter-button {
      padding-inline: 6px !important;
    }

    body.office-catalog-dle main.product-page #versions .product-choice-switch > .filter-button:nth-child(3):last-child {
      grid-column: 1 / -1 !important;
    }
  }
}
