/* Corrections shared by the DLE templates; preserve each page's design. */
/* Application and Office 2024 features share an open list without card surfaces. */
main#top:is([data-office-release="/office/2024/"], .app-detail-page:not(.app-detail-page--office, .microsoft-365-page), :is(.product-page, :has(> #excel-download-start))) #features {
  background: #fbfcfb !important;
}
main#top:is([data-office-release="/office/2024/"], .app-detail-page:not(.app-detail-page--office, .microsoft-365-page), :is(.product-page, :has(> #excel-download-start))) #features .excel-capabilities-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0 48px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
main#top:is([data-office-release="/office/2024/"], .app-detail-page:not(.app-detail-page--office, .microsoft-365-page), :is(.product-page, :has(> #excel-download-start))) #features .excel-capability {
  grid-template-columns: 36px minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 18px !important;
  min-height: 0 !important;
  padding: 24px 0 !important;
  border: 0 !important;
  border-top: 1px solid var(--cohesive-line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none;
}
main#top:is([data-office-release="/office/2024/"], .app-detail-page:not(.app-detail-page--office, .microsoft-365-page), :is(.product-page, :has(> #excel-download-start))) #features .excel-capability::before,
main#top:is([data-office-release="/office/2024/"], .app-detail-page:not(.app-detail-page--office, .microsoft-365-page), :is(.product-page, :has(> #excel-download-start))) #features .excel-capability::after { content: none !important; }
main#top:is([data-office-release="/office/2024/"], .app-detail-page:not(.app-detail-page--office, .microsoft-365-page), :is(.product-page, :has(> #excel-download-start))) #features .excel-capability-icon {
  width: 36px !important;
  height: 36px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
main#top:is([data-office-release="/office/2024/"], .app-detail-page:not(.app-detail-page--office, .microsoft-365-page), :is(.product-page, :has(> #excel-download-start))) #features .excel-capability h3 { margin: 0 0 7px; }
main#top:is([data-office-release="/office/2024/"], .app-detail-page:not(.app-detail-page--office, .microsoft-365-page), :is(.product-page, :has(> #excel-download-start))) #features .excel-capability p { margin: 0; }
@media (max-width: 700px) {
  main#top:is([data-office-release="/office/2024/"], .app-detail-page:not(.app-detail-page--office, .microsoft-365-page), :is(.product-page, :has(> #excel-download-start))) #features .excel-capabilities-grid { grid-template-columns: minmax(0, 1fr) !important; }
  main#top:is([data-office-release="/office/2024/"], .app-detail-page:not(.app-detail-page--office, .microsoft-365-page), :is(.product-page, :has(> #excel-download-start))) #features .excel-capability { padding: 20px 0 !important; gap: 14px !important; }
}

/* App FAQ: open rows and underlined topics, retaining native disclosure controls. */
main#top:is(.app-detail-page:not(.app-detail-page--office, .microsoft-365-page), :is(.product-page, :has(> #excel-download-start))) section#faq.faq-section :is(.faq-topic-nav, .faq-topic.active, .faq-topic, .faq-topic-panel .faq-item[open], .faq-item) {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  transform: none !important;
}
main#top:is(.app-detail-page:not(.app-detail-page--office, .microsoft-365-page), :is(.product-page, :has(> #excel-download-start))) section#faq.faq-section .faq-topic-nav {
  border: 0 !important;
  padding: 0 !important;
}
main#top:is(.app-detail-page:not(.app-detail-page--office, .microsoft-365-page), :is(.product-page, :has(> #excel-download-start))) section#faq.faq-section .faq-topic {
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  min-height: 44px;
}
main#top:is(.app-detail-page:not(.app-detail-page--office, .microsoft-365-page), :is(.product-page, :has(> #excel-download-start))) section#faq.faq-section .faq-topic.active {
  border-bottom-color: currentColor !important;
}
main#top:is(.app-detail-page:not(.app-detail-page--office, .microsoft-365-page), :is(.product-page, :has(> #excel-download-start))) section#faq.faq-section :is(.faq-list, .faq-topic-panel) { gap: 0 !important; }
main#top:is(.app-detail-page:not(.app-detail-page--office, .microsoft-365-page), :is(.product-page, :has(> #excel-download-start))) section#faq.faq-section .faq-topic-panel .faq-item {
  border: 0 !important;
  border-bottom: 1px solid var(--cohesive-line) !important;
  padding: 0 !important;
  margin: 0 !important;
}
main#top:is(.app-detail-page:not(.app-detail-page--office, .microsoft-365-page), :is(.product-page, :has(> #excel-download-start))) section#faq.faq-section .faq-item summary::after {
  background-color: transparent !important;
  box-shadow: none !important;
  border-color: transparent !important;
}
body.office-catalog-dle { min-width: 0; }
.catalog-editorial-page :is(h1, h2, h3, p, li),
.catalog-source-panel :is(h2, p),
.catalog-card :is(h3, p) { overflow-wrap: anywhere; }

/* Metadata must fit the download column, including long operating-system names. */
.hero.hero-second-screen .os-download-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
  min-width: 0;
  white-space: normal;
}
.hero.hero-second-screen .os-download-specs > span {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 5px;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Breadcrumbs outside a nested content frame still follow the site grid. */
main > .catalog-breadcrumbs.container,
.download-hub-hero > .catalog-breadcrumbs.container {
  width: min(var(--balanced-content-width), calc(100% - var(--balanced-content-gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--balanced-inner-inset);
}

/* Permit the large preview to extend only into available desktop gutters. */
@media (min-width: 1081px) {
  main .hero.hero-second-screen .hero-grid.container {
    --download-overhang: clamp(0px, calc((100vw - 1280px) / 2 - 28px), 110px);
    --excel-overhang: var(--download-overhang);
  }
}

/* Three distinct controls below the preview, rather than overlapping its UI. */
.hero.hero-second-screen .workbook-stage > .workbook-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  top: auto;
  bottom: -82px;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  transform: none;
}
.hero.hero-second-screen .workbook-stage > .workbook-nav.prev { left: calc(50% - 128px); right: auto; }
.hero.hero-second-screen .workbook-stage > .workbook-nav.next { left: calc(50% + 88px); right: auto; }
.hero.hero-second-screen .workbook-stage > .workbook-nav.autoplay {
  left: calc(50% - 76px);
  right: auto;
  width: 152px;
  gap: 8px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 630;
  white-space: nowrap;
}
.hero.hero-second-screen .workbook-nav svg { width: 18px; height: 18px; flex: 0 0 18px; }
.hero.hero-second-screen .workbook-nav.autoplay .autoplay-icon-pause,
.hero.hero-second-screen .workbook-nav.autoplay[aria-pressed="true"] .autoplay-icon-view { display: none; }
.hero.hero-second-screen .workbook-nav.autoplay[aria-pressed="true"] .autoplay-icon-pause { display: block; }
.hero.hero-second-screen .workbook-stage > .workbook-nav:focus-visible { outline: 2px solid var(--app-accent, #107c41); outline-offset: 3px; }
@media (max-width: 1080px) {
  .hero.hero-second-screen .workbook-stage { margin-bottom: 76px; }
}

/* Every main destination remains visible without horizontal menu scrolling. */
@media (min-width: 621px) and (max-width: 1100px) {
  body > header.office-header .header-catalog-brand {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  body > header.office-header .header-brand-identity { align-self: flex-start; }
  body > header.office-header .header-catalog-panel .header-brand-links {
    display: flex !important;
    justify-content: space-between;
    width: 100%;
    max-width: none;
    margin: 0;
    overflow: visible;
  }
  body > header.office-header .header-catalog-panel .header-brand-links a { min-height: 36px; }
}
@media (max-width: 620px) {
  .catalog-editorial-page h1 { font-size: clamp(25px, 7.4vw, 32px); line-height: 1.15; }
  .catalog-page-breadcrumbs { display: block; line-height: 1.6; }
  .catalog-page-breadcrumbs li { display: inline; }
  .catalog-page-breadcrumbs li + li::before { margin-inline: 7px; }
  main#top:not(.app-detail-page--apps) #versions .filter-list,
  main#top #faq .faq-topic-toolbar .faq-topic-nav {
    display: flex !important;
    flex-wrap: wrap;
    width: 100%;
    max-width: none;
    margin-inline: 0;
    padding: 3px;
    gap: 4px;
    overflow: visible;
  }
  main#top:not(.app-detail-page--apps) #versions .filter-button,
  main#top #faq .faq-topic {
    flex: 1 1 calc(33.333% - 8px);
    min-width: 0;
    min-height: 44px;
    padding: 6px;
    font-size: 11.5px;
    white-space: normal;
  }
  body > header.office-header .header-catalog-panel .header-brand-links {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    max-width: none;
    min-width: 0;
    margin-inline: 0;
    padding: 5px 0 0;
    gap: 4px;
    overflow: visible;
  }
  body > header.office-header .header-catalog-panel .header-brand-links a {
    display: inline-flex;
    justify-content: center;
    min-width: 0;
    min-height: 36px;
    padding: 6px 4px;
    gap: 5px;
    font-size: 11px;
    white-space: nowrap;
  }
  body > header.office-header .header-catalog-panel .header-brand-links a:last-child { grid-column: span 2; }
  body > header.office-header .header-catalog-panel .header-brand-links a svg { width: 13px; height: 13px; flex: 0 0 13px; }
}

body > header.office-header .header-brand-links a[aria-current] {
  color: var(--page-app-accent, #a3310d);
  text-decoration: none;
}

body > header.office-header .header-brand-links a:hover,
body > header.office-header .header-brand-links a:focus-visible {
  color: #d83b01 !important;
}

body > header.office-header .header-catalog-panel .header-version-grid a:hover,
body > header.office-header .header-catalog-panel .header-version-grid a:focus-visible,
body > header.office-header .header-catalog-panel .header-version-grid a.featured:hover,
body > header.office-header .header-catalog-panel .header-version-grid a.featured:focus-visible {
  color: #d83b01 !important;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body > header.office-header { animation: none; }
}

main#top:is(.app-detail-page:not(.app-detail-page--office, .microsoft-365-page), :is(.product-page, :has(> #excel-download-start))) section#faq.faq-section .faq-topic::before, main#top:is(.app-detail-page:not(.app-detail-page--office, .microsoft-365-page), :is(.product-page, :has(> #excel-download-start))) section#faq.faq-section .faq-topic::after, main#top:is(.app-detail-page:not(.app-detail-page--office, .microsoft-365-page), :is(.product-page, :has(> #excel-download-start))) section#faq.faq-section .faq-item::before { content: none !important; }

/* Excel trust icons match the unboxed icons on other application pages. */
main#top:is(.product-page, :has(> #excel-download-start)) > .trust-strip .trust-icon { border: 0 !important; background: transparent !important; box-shadow: none !important; }
/* Platform badges and Excel's final download invitation. */
main#top a.platform-tag, main#top a.platform-tag:hover { text-decoration: none !important; }
main#top:is(.product-page, :has(> #excel-download-start)) .download-return-panel {
  width: 100% !important;
  max-width: none !important;
  padding: 32px 0 !important;
  border: 0 !important;
  border-top: 1px solid var(--cohesive-line) !important;
  background: transparent !important;
  box-shadow: none !important;
}
main#top:is(.product-page, :has(> #excel-download-start)) .download-return-panel::before,
main#top:is(.product-page, :has(> #excel-download-start)) .download-return-panel::after { content: none !important; }
main#top:is(.product-page, :has(> #excel-download-start)) .download-return { background: #fbfcfb !important; }
main#top:is(.product-page, :has(> #excel-download-start)) .download-return-panel > h2 { font-size: clamp(25px, 2.4vw, 32px); font-weight: 600; }
main#top:is(.product-page, :has(> #excel-download-start)) .download-return-mark { border: 0 !important; background: transparent !important; box-shadow: none !important; }
