/* One shared header/footer appearance for home, catalogs and publications. */
body.office-catalog-dle > :is(header.office-header, footer.footer) {
  --catalog-shell-background: #eef0f1;
  --divider-shade: rgba(35, 45, 40, .08);
  --divider-light: rgba(255, 255, 255, .9);
  --light-brand: var(--catalog-office-brand);
  --light-brand-hover: var(--catalog-office-brand-hover);
  --light-ink: #353b43;
  --light-muted: #66707b;
  --light-line: #dfe3e7;
}

/* Header and footer use the same full-width silver surface. */
body.office-catalog-dle > header.office-header {
  background: var(--catalog-shell-background) !important;
  border-bottom: 1px solid var(--divider-light) !important;
  box-shadow: inset 0 -1px 0 var(--divider-shade) !important;
  filter: none !important;
  backdrop-filter: none !important;
}
body.office-catalog-dle > header.office-header::before,
body.office-catalog-dle > header.office-header::after {
  content: none !important;
  display: none !important;
}
body.office-catalog-dle > header.office-header .header-brand-identity::before,
body.office-catalog-dle > header.office-header .header-brand-identity::after {
  content: none !important;
  display: none !important;
}
body.office-catalog-dle > header.office-header :is(.header-catalog-panel, .header-catalog-section, .global-header, .header-app-grid a, .header-version-grid a) {
  background: transparent !important;
  border-color: var(--light-line) !important;
  box-shadow: none !important;
}
body.office-catalog-dle > header.office-header .header-app-grid a:is([aria-current="page"], .current) {
  background: color-mix(in srgb, var(--nav-brand) 9%, #fff) !important;
  border-color: color-mix(in srgb, var(--nav-brand) 42%, #fff) !important;
  box-shadow: none !important;
  outline-color: color-mix(in srgb, var(--nav-brand) 42%, #fff) !important;
}
/* Mark the current product, including its nested platform/version routes. */
body.office-catalog-dle > header.office-header :is(.header-app-grid, .header-version-grid) a[data-catalog-route] {
  position: relative;
}
body.office-catalog-dle > header.office-header .header-app-grid a[data-catalog-route]:is(.current, [aria-current="page"], [aria-current="location"])::after {
  content: "" !important;
  display: block !important;
  position: absolute;
  inset: 8px 6px 8px auto;
  width: 3px;
  height: auto;
  margin: 0;
  border: 0 !important;
  border-radius: 2px;
  background: var(--catalog-current-brand, var(--nav-brand, var(--catalog-office-brand))) !important;
  box-shadow: none !important;
  opacity: 1 !important;
  transform: none !important;
  pointer-events: none;
}
body.office-catalog-dle > header.office-header :is(.header-app-grid, .header-version-grid) a[data-catalog-route]:not(.current):not([aria-current])::after {
  content: none !important;
  display: none !important;
}
body.office-catalog-dle > header.office-header .header-version-grid a[data-catalog-route]::after { content: none !important; display: none !important; }
body.office-catalog-dle > header.office-header .header-bottom-groove {
  /* The hero's brand stripe replaces the old two-tone header separator. */
  display: none !important;
}
body.office-catalog-dle > header.office-header :is(a, strong) { color: var(--light-ink); }
body.office-catalog-dle > header.office-header .header-version-grid a { color: var(--light-ink) !important; }
body.office-catalog-dle > header.office-header :is(small, .header-brand-copy p) { color: var(--light-muted) !important; }
body.office-catalog-dle > header.office-header .header-catalog-brand :is(a, strong, small) { color: #353b43 !important; }
body.office-catalog-dle > header.office-header .header-brand-identity strong { font-size: 21px !important; }
body.office-catalog-dle > header.office-header .header-brand-identity small { color: #66707b !important; font-size: 12px; }
body.office-catalog-dle > header.office-header .header-brand-links a { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; line-height: 20px; }
/* Keep the shared thin hover underline; discard legacy hub selection plates. */
body.office-catalog-dle > header.office-header .header-brand-links a {
  background: transparent !important;
  box-shadow: none !important;
}
body.office-catalog-dle > header.office-header .header-brand-links a > span { display: block; line-height: 20px; }
/* Match the visible glyph centre, including the font's descender space. */
body.office-catalog-dle > header.office-header .header-brand-links a > svg { display: block; flex: 0 0 16px; width: 16px; height: 16px; margin: 0; align-self: center; transform: translateY(1px); }
body.office-catalog-dle > header.office-header .header-brand-links a[aria-current] { color: #353b43 !important; }
body.office-catalog-dle > header.office-header .header-brand-identity strong,
body.office-catalog-dle > header.office-header .header-version-grid strong { color: inherit !important; }

/* Shared navigation stays neutral; the whole link responds in red. */
body.office-catalog-dle > header.office-header .header-catalog-brand a:is(:hover, :focus-visible, :active),
body.office-catalog-dle > header.office-header .header-catalog-panel .header-version-grid a:is(:hover, :focus-visible, :active) {
  color: var(--catalog-office-brand) !important;
}
body.office-catalog-dle > header.office-header :is(.header-brand-links a, .header-version-grid a) { transition: color .15s ease; }
@media (max-width: 620px) {
  body.office-catalog-dle > header.office-header .header-catalog-panel .header-brand-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.office-catalog-dle > header.office-header .header-catalog-panel .header-brand-links a { min-height:44px; padding-inline:2px; gap:5px; font-size:12px; }
  body.office-catalog-dle > header.office-header .header-catalog-panel .header-brand-links a > svg { width:13px; height:13px; flex-basis:13px; }
  body.office-catalog-dle > header.office-header .header-catalog-panel .header-brand-links a:last-child { grid-column: auto; }}
@media (max-width: 380px) {
  body.office-catalog-dle > header.office-header .header-catalog-panel .header-brand-links a { font-size:11px; }
}

body.office-catalog-dle > header.office-header :is(.header-brand-links a svg, .header-version-grid a svg, .header-catalog-panel .header-version-grid a svg) {
  color: currentColor !important;
  stroke: currentColor !important;
  fill: currentColor !important;
}
body.office-catalog-dle > header.office-header .header-app-grid a[href="/apps/word/"] { --nav-brand: #185abd; }
body.office-catalog-dle > header.office-header .header-app-grid a[href="/apps/excel/"] { --nav-brand: #107c41; }
body.office-catalog-dle > header.office-header .header-app-grid a[href="/apps/powerpoint/"] { --nav-brand: #bd492d; }
body.office-catalog-dle > header.office-header .header-app-grid a[href="/apps/outlook/"] { --nav-brand: #0078b9; }
body.office-catalog-dle > header.office-header .header-app-grid a[href="/apps/onenote/"] { --nav-brand: #8034ad; }
body.office-catalog-dle > header.office-header .header-app-grid a[href="/apps/teams/"] { --nav-brand: #5358a8; }
body.office-catalog-dle > header.office-header .header-app-grid a[href="/apps/onedrive/"] { --nav-brand: #0066b8; }
body.office-catalog-dle > header.office-header .header-app-grid a[href="/apps/access/"] { --nav-brand: #a52e46; }
body.office-catalog-dle > header.office-header .header-app-grid a[href] {
  background: color-mix(in srgb, var(--nav-brand) 8%, #fff) !important;
  border-color: color-mix(in srgb, var(--nav-brand) 26%, #fff) !important;
}
body.office-catalog-dle > header.office-header .header-app-grid a[href]:hover { background: color-mix(in srgb, var(--nav-brand) 14%, #fff) !important; }
body.office-catalog-dle > header.office-header .header-app-grid a strong { color: var(--nav-brand) !important; }
body.office-catalog-dle > header.office-header .header-version-grid strong {
  font-size: 15px !important;
  line-height: 1.35;
}
body.office-catalog-dle > header.office-header .header-version-grid img {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  object-fit: contain;
}
@media (max-width: 620px) {
  body.office-catalog-dle > header.office-header .header-version-grid strong { font-size: 14px !important; }}

.footer .footer-grid > div { min-width: 0; }
/* Keep current and archived Office releases side by side. */
body.office-catalog-dle > .footer .footer-office-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
  align-items: start;
}
body.office-catalog-dle > .footer .footer-office-columns > .footer-list {
  min-width: 0;
  padding-top: 0;
}
body.office-catalog-dle > .footer .footer-application-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(4, auto);
  grid-auto-flow: column;
  gap: 9px 20px;
}
body.office-catalog-dle > .footer .footer-grid {
  grid-template-columns: 280px minmax(0, 1fr) minmax(0, 1fr) minmax(0, .65fr);
  gap: 36px 32px;
}
body.office-catalog-dle > .footer .footer-grid > div { grid-column: auto; }
body.office-catalog-dle > .footer .footer-sections-group .footer-list { grid-template-columns: 1fr; }
@media (max-width: 1200px) and (min-width: 901px) {
  body.office-catalog-dle > .footer .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, .7fr); }
  body.office-catalog-dle > .footer .footer-grid > div:first-child { grid-column: 1 / -1; max-width: 280px; }
}
@media (max-width: 900px) {
  body.office-catalog-dle > .footer .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.office-catalog-dle > .footer .footer-grid > :is(div:first-child, .footer-sections-group) { grid-column: 1 / -1; }
  body.office-catalog-dle > .footer .footer-sections-group .footer-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  body.office-catalog-dle > .footer .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  body.office-catalog-dle > .footer .footer-grid > div { grid-column: 1; }
}
@media (max-width: 359px) {
  body.office-catalog-dle > .footer .footer-sections-group .footer-list { grid-template-columns: minmax(0, 1fr); }
}

/* Keep the two oldest header links in their own row and last in keyboard order. */
body.office-catalog-dle > header.office-header .header-version-archive { grid-column:1 / -1; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
@media (max-width:620px) { body.office-catalog-dle > header.office-header .header-version-archive { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:440px) { body.office-catalog-dle > header.office-header .header-version-archive { grid-template-columns:minmax(0,1fr); } }

/* Shared rows align the archive with Office 2024, including when text wraps. */
body.office-catalog-dle > .footer .footer-office-columns { grid-template-rows: repeat(6, auto); gap: 10px 20px; }
body.office-catalog-dle > .footer .footer-office-columns > .footer-list { display: grid; grid-template-rows: subgrid; row-gap: 10px; }
body.office-catalog-dle > .footer .footer-office-columns > .footer-list:first-child { grid-column: 1; grid-row: 1 / span 4; }
body.office-catalog-dle > .footer .footer-office-columns > .footer-list:last-child { grid-column: 2; grid-row: 2 / span 5; }

/* The shared shell background keeps the header and footer identical. */
body.office-catalog-dle > footer.footer {
  --light-ink: #303539;
  --light-muted: #60666b;
  --light-line: #dedfe0;
  background: var(--catalog-shell-background) !important;
  color: var(--light-muted) !important;
  border-top: 0 !important;
  box-shadow: none !important;
}
body.office-catalog-dle > footer.footer::before,
body.office-catalog-dle > footer.footer::after { content: none !important; display: none !important; }
body.office-catalog-dle > footer.footer :is(h3, .ms-brand) { color: var(--light-ink) !important; }
body.office-catalog-dle > footer.footer :is(p, a, .legal, .legal-link-sep) { color: var(--light-muted) !important; border-color: var(--light-line) !important; }
body.office-catalog-dle > footer.footer a:hover { color: var(--light-brand) !important; }

body.office-catalog-dle > :is(header.office-header, footer.footer) :is(a, button):focus-visible {
  outline: 2px solid var(--light-brand) !important;
  outline-offset: 3px;
}

/* Navigation cards share one flat treatment on every route. */
body.office-catalog-dle > header.office-header a { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
@layer inset-dividers {
  /* A quiet common page ending, lighter than the header's brand stripe. */
  body.office-catalog-dle > footer.footer {
    border-top-color:color-mix(in srgb,var(--catalog-office-brand) 18%,#ececf0)!important;
    border-image:none!important;
  }
  body.office-catalog-dle > .footer .legal { border-top-color: var(--divider-shade) !important; box-shadow: inset 0 1px 0 var(--divider-light) !important; }
}

/* The identity column follows the FAQ topic rail at each layout size. */
@media (min-width: 901px) { body.office-catalog-dle > .footer .footer-grid > div:first-child { width:280px; max-width:100%; } }
@media (min-width: 701px) and (max-width:900px) { body.office-catalog-dle > .footer .footer-grid > div:first-child { width:232px; max-width:100%; } }

/* Keep catalog links readable while the desktop header becomes narrower. */
@media (min-width: 901px) and (max-width: 1100px) {
  body.office-catalog-dle > header.office-header .header-catalog-columns {
    grid-template-columns: minmax(0, 1fr) 380px !important;
    gap: 24px !important;
  }
  body.office-catalog-dle > header.office-header .header-catalog-versions {
    padding-left: 0 !important;
  }
  body.office-catalog-dle > header.office-header .header-app-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
@media (min-width: 901px) and (max-width: 1200px) {
  body.office-catalog-dle > header.office-header .header-app-grid small {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
}

/* Leave room for content when a phone is turned sideways. */
@media (max-width: 1100px) and (max-height: 500px) {
  body.office-catalog-dle > header.office-header .header-catalog-columns {
    display: none !important;
  }
}

/* Give footer links their own touch area without enlarging the text. */
@media (max-width: 760px), (any-pointer: coarse) {
  body.office-catalog-dle > footer.footer .footer-list {
    gap: 0 !important;
  }
  body.office-catalog-dle > footer.footer .footer-application-links {
    gap: 0 20px !important;
  }
  body.office-catalog-dle > footer.footer .footer-office-columns {
    row-gap: 0 !important;
  }
  body.office-catalog-dle > footer.footer .footer-sections-group .footer-list {
    grid-template-rows: none !important;
    grid-auto-rows: minmax(44px, auto) !important;
  }
  body.office-catalog-dle > footer.footer .footer-app {
    min-height: 44px;
    align-items: center;
  }
  body.office-catalog-dle > footer.footer .legal-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 12px;
  }
  body.office-catalog-dle > footer.footer .legal-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  body.office-catalog-dle > footer.footer .legal-link-sep {
    display: none;
  }
}

/* Keep a focused skip link clickable while Safari updates pointer focus. */
:is(.catalog-skip-links a, .catalog-demo-skip):is(:focus, :hover, :active) {
  position: relative;
  z-index: 2;
  display: inline-block;
  width: auto;
  height: auto;
  padding: 12px 16px;
  margin: 4px;
  clip-path: none;
  background: #fff;
  color: #145b94;
  border: 2px solid #145b94;
  border-radius: 4px;
  white-space: normal;
}

/* Keep tablet first screens focused on the page and its download choices. */
@media (max-width: 900px) {
  body.office-catalog-dle > header.office-header .header-catalog-columns {
    display: none !important;
  }
}

@media (max-width: 1100px) and (max-height: 800px) {
  body.office-catalog-dle > header.office-header .header-catalog-columns {
    display: none !important;
  }
}

/* Larger tablet links keep the same compact labels and separate touch areas. */
@media (any-pointer: coarse) {
  body.office-catalog-dle > header.office-header :is(.header-brand-links a, .header-version-grid a) {
    min-height: 44px !important;
    box-sizing: border-box;
    display: flex;
    align-items: center;
  }
}
