/* Final compact layout contract shared by every route. */
:root {
  --compact-section-space: 27px;
  --compact-hero-space: 40px;
  --compact-inner-gap: 20px;
  --compact-card-gap: 16px;
}

main > section {
  min-height: auto !important;
  margin-block: 0 !important;
  padding-block: var(--compact-section-space) !important;
}

main > section + section {
  margin-top: 0 !important;
}

main > .hero,
main > .page-hero {
  min-height: auto !important;
  padding-block: var(--compact-hero-space) !important;
}

main > .hero + section {
  padding-top: 16px !important;
}
main > .page-hero + section {
  padding-top: 12px !important;
}

.hero .hero-grid,
.page-hero__grid {
  min-height: 0 !important;
  padding-block: 0 !important;
  gap: var(--compact-inner-gap) !important;
}

.hero .hero-grid > div:first-child {
  padding-top: 0 !important;
}
.hero .editor {
  margin-block: 0 !important;
}

.hero .line-label,
.page-hero .eyebrow,
.breadcrumbs {
  display: none !important;
}

main h1 {
  max-width: 760px;
  margin: 0 0 12px;
  font-size: clamp(32px, 4vw, 50px) !important;
  line-height: 1.08 !important;
  overflow-wrap: break-word;
  text-wrap: balance;
}

main h2 {
  margin: 0 0 10px;
  font-size: clamp(25px, 3vw, 36px) !important;
  line-height: 1.15 !important;
  overflow-wrap: break-word;
}

main h3 {
  margin: 0 0 8px;
  font-size: clamp(19px, 2vw, 24px) !important;
  line-height: 1.25 !important;
  overflow-wrap: break-word;
}

main p {
  font-size: 16px;
  line-height: 1.55;
  overflow-wrap: break-word;
}

.lead,
.intro,
.section-intro,
.topic-answer p,
.topic-detail__head > p {
  max-width: 760px !important;
}

.section-inner,
.capability,
.docx-grid,
.docs-intro,
.process-grid,
.composer-grid,
.help-grid,
.page-hero__grid,
.topic-answer,
.topic-layout,
.topic-example__grid,
.topic-context__grid,
.topic-detail__head,
.topic-detail__body,
.topic-detail__mistakes,
.topic-check,
.start-panel {
  gap: var(--compact-inner-gap) !important;
}

.section-header,
.docs-intro {
  margin-bottom: 20px !important;
}

.content-grid,
.card-grid,
.topic-detail__mistakes ul {
  gap: var(--compact-card-gap) !important;
}

.content-grid article,
.hero-note,
.topic-illustration,
.topic-side-visual,
.topic-context__visual,
.topic-detail__visual,
.topic-check__note {
  min-height: 0 !important;
  padding: 18px !important;
}

.service .shell,
.cap-list article,
.doc-rows a,
.process li,
.composer-actions > a,
.composer-actions > label,
.start-panel__actions > a,
.start-panel__actions > label,
.uploader label {
  min-height: 0 !important;
}

.service .shell {
  padding-block: 0 !important;
}

.content-grid h3,
.card-grid h3 {
  font-size: 20px !important;
}

/* Keep the miniature editor UI independent from the page type scale. */
.editor .e-work h2 {
  font-size: 17px !important;
  line-height: 1.2 !important;
}
.editor .e-work h3 {
  font-size: 9px !important;
  line-height: 1.25 !important;
}

.cap-list article,
.doc-rows a,
.process li,
.composer-actions > a,
.composer-actions > label,
.start-panel__actions > a,
.start-panel__actions > label {
  padding-block: 16px !important;
}

.uploader label {
  padding: 20px !important;
}

.topic-example__sheet,
.topic-detail__body,
.topic-detail__mistakes,
.topic-context ul {
  margin-top: 20px !important;
}

.topic-guide-list li,
.topic-detail dl div {
  gap: 16px !important;
  padding-block: 16px !important;
}

.btn,
.button,
button.btn,
.head-actions a {
  width: auto !important;
  min-height: 36px !important;
  padding: 8px 16px !important;
  border-radius: 6px !important;
  font-size: 14px !important;
  line-height: 1 !important;
  white-space: nowrap;
}

.cta,
.final-cta {
  position: relative;
  min-height: 0 !important;
  padding-block: 27px !important;
  border-block: 1px solid #d5e0eb;
}

.cta .shell,
.final-cta__content {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-rows: auto auto;
  column-gap: 32px !important;
  row-gap: 12px !important;
  align-items: center;
}
.cta .shell > div:first-child,
.final-cta__content > div:first-child {
  grid-column: 1;
  grid-row: 1;
}
.cta h2,
.final-cta h2 {
  margin-bottom: 8px !important;
}
.cta p,
.final-cta p {
  margin: 0 !important;
}
.cta .btn,
.final-cta .btn {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
  margin-top: 0 !important;
  flex: 0 0 auto;
}

.cta-visual {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: end;
  width: 300px;
  margin: -22px 0;
  pointer-events: none;
}

.cta-visual img {
  display: block;
  width: 100%;
  height: auto;
}

.faq {
  margin-block: 0 !important;
}
.faq summary {
  min-height: 52px !important;
  padding-block: 14px !important;
}
.faq summary span {
  flex: 0 0 24px;
  width: 24px;
  text-align: center;
  transform-origin: center;
}
.faq p {
  margin: 0 0 16px !important;
}

.site-footer {
  margin-top: 0 !important;
  padding-block: 32px 18px !important;
}

.grid,
.content-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}

.grid > *,
.content-grid > *,
.hero-grid > *,
.page-hero__grid > *,
.capability > *,
.docx-grid > *,
.process-grid > *,
.composer-grid > *,
.help-grid > *,
.topic-layout > *,
.topic-context__grid > *,
.topic-detail__body > *,
.topic-check > * {
  min-width: 0;
}

main img,
main video {
  display: block;
  max-width: 100%;
  height: auto;
}

@media (max-width: 768px) {
  :root {
    --compact-section-space: 19px;
    --compact-hero-space: 28px;
    --compact-inner-gap: 16px;
    --compact-card-gap: 12px;
  }
  main > .hero + section {
    padding-top: 12px !important;
  }
  main > .page-hero + section {
    padding-top: 8px !important;
  }
  main h1 {
    font-size: clamp(30px, 9vw, 36px) !important;
  }
  .section-header,
  .docs-intro {
    margin-bottom: 16px !important;
  }
  .cta .shell {
    grid-template-columns: minmax(0, 1fr) 120px;
    column-gap: 14px !important;
  }

  .cta-visual {
    width: 120px;
    margin: -8px 0;
  }

  .cta,
  .final-cta {
    padding-block: 19px !important;
  }

  body > header .menu {
    width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
  }
}

@media (max-width: 360px) {
  .cta .shell {
    grid-template-columns: minmax(0, 1fr) 84px;
  }

  .cta-visual {
    width: 84px;
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq summary span {
    transition: none !important;
  }
}
