/* Shared page chrome and controls. Keep all header geometry in one place. */
:root {
  --header-height: 72px;
  --control-height: 44px;
  --control-radius: 4px;
  --control-inline: 18px;
  --header-border: #d7dde5;
  --page-gutter: 24px;
  --section-space: 78px;
}

html { scroll-padding-top: calc(var(--header-height) + 16px); }
body { padding-top: var(--header-height); }
[id] { scroll-margin-top: calc(var(--header-height) + 16px); }

body > header {
  position: fixed !important;
  inset: 0 0 auto 0 !important;
  z-index: 100 !important;
  width: 100%;
  height: var(--header-height) !important;
  background: #fff !important;
  border-bottom: 1px solid var(--header-border) !important;
  box-shadow: 0 1px 0 rgba(16, 58, 118, .04) !important;
}

body > header .head { height: 100%; }
body > header .head-actions > a:first-child { display: none !important; }

.btn,
.head-actions .btn,
button.btn {
  min-height: var(--control-height);
  padding-inline: var(--control-inline);
  border-radius: var(--control-radius);
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, opacity .18s ease;
}

.btn:hover,
.head-actions .btn:hover { transform: translateY(-1px); }
.btn:active,
.head-actions .btn:active { transform: translateY(0); }
.btn:focus-visible,
.head-actions .btn:focus-visible,
.menu:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(23, 100, 212, .34);
  outline-offset: 3px;
}

.btn:disabled,
.btn[aria-disabled="true"],
.btn[aria-busy="true"],
.btn.is-loading,
button:disabled {
  cursor: not-allowed;
  pointer-events: none;
  opacity: .52;
  transform: none;
}

.btn.is-loading::after,
.btn[aria-busy="true"]::after {
  width: 12px;
  height: 12px;
  margin-left: 8px;
  content: "";
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: button-spin .7s linear infinite;
}

@keyframes button-spin { to { transform: rotate(360deg); } }

.text-link { min-height: var(--control-height); padding-inline: 2px; border-radius: 2px; }
.text-link:hover { color: #124c9d; }
.text-link:active { color: #0d3d82; }

/* The editor is an illustration, not a group of non-functional controls. */
.office-name { display: block; }
.office-actions > * { display: inline-flex; align-items: center; justify-content: center; }
.office-toolbar .office-select {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 9px;
  border: 1px solid #d8e0ea;
  border-radius: 3px;
  background: #fff;
  color: #3d4d61;
  font: 10px Manrope, sans-serif;
}
body .process li { cursor: default !important; }

@media (min-width: 901px) {
  body > header .head { width: min(var(--shell), calc(100% - 32px)); gap: 24px; }
  body > header nav { margin-left: auto; gap: 24px; background: transparent; }
  body > header nav a { padding: 7px 0; text-decoration: none !important; }
  body > header nav a:hover { color: var(--blue); text-decoration: none !important; }
  body > header nav a::after { bottom: -3px !important; }
  body > header .head-actions { margin-left: 0; gap: 0; }
}

@media (max-width: 1280px) {
  :root { --page-gutter: 22px; --section-space: 72px; }
  body > header .head { width: min(var(--shell), calc(100% - 40px)); }
}

@media (max-width: 1024px) {
  :root { --page-gutter: 20px; --section-space: 64px; }
  body > header .head { gap: 16px; }
  body > header nav { gap: 17px; }
}

@media (max-width: 900px) {
  :root { --header-height: 68px; --section-space: 58px; }
  body > header .head { width: min(var(--shell), calc(100% - 36px)); gap: 12px; }
  body > header .brand { flex: 0 1 178px; min-width: 0; }
  body > header .brand img { display: block; width: min(178px,100%); height: auto; }
  body > header nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    right: 18px;
    left: 18px;
    z-index: 102;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 8px 16px;
    border: 1px solid var(--header-border);
    background: #fff;
    box-shadow: 0 14px 32px rgba(20, 40, 68, .12);
  }
  body > header nav.open { display: flex; }
  body > header nav a { min-height: 44px; display: flex; align-items: center; padding: 8px 0; }
  body > header .head-actions { margin-left: auto; }
  body > header .menu {
    position: relative;
    display: block !important;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    margin: 0 !important;
    border: 1px solid #c9d4e1;
    border-radius: var(--control-radius);
    background: #fff;
  }
  body > header .menu:hover { border-color: var(--blue); background: #f7faff; }
  body > header .menu:active { background: #edf4fd; }
}

@media (max-width: 680px) {
  :root { --header-height: 62px; --control-height: 40px; --control-inline: 13px; --page-gutter: 16px; --section-space: 54px; }
  body > header .head { width: min(100% - 32px, var(--shell)); gap: 10px; }
  body > header .head .brand { display: block !important; flex: 0 0 34px !important; line-height: 0 !important; }
  body > header .head .brand-logo,
  body > header .head .brand img { display: none !important; }
  body > header .head .brand::before {
    display: block;
    width: 32px;
    height: 32px;
    content: "";
    background: url("/word-mark.webp") center / contain no-repeat;
  }
  body > header .head-actions { display: flex !important; gap: 0; }
  body > header .head-actions .btn { display: inline-flex !important; font-size: 13px; }
  body > header .menu { display: block !important; margin: 0 -8px 0 0 !important; }
  body > header .menu::after { display: none !important; }
  body > header .menu b { right: 11px; left: 11px; width: auto !important; height: 1px; margin: 0 !important; }
  body > header .menu b:first-child { top: 15px; }
  body > header .menu b:last-child { bottom: 15px; }
  body > header .menu[aria-expanded="true"] b:first-child { top: 50%; transform: translateY(-50%) rotate(45deg); }
  body > header .menu[aria-expanded="true"] b:last-child { top: 50%; bottom: auto; transform: translateY(-50%) rotate(-45deg); }
  .office-toolbar .office-select { height: 23px; font-size: 8px; }
}

@media (max-width: 430px) {
  :root { --page-gutter: 16px; --section-space: 50px; }
  body > header .head { width: calc(100% - 28px); }
  body > header nav { right: 14px; left: 14px; }
}

@media (max-width: 390px) {
  :root { --page-gutter: 14px; --section-space: 46px; }
  body > header .head { width: calc(100% - 24px); gap: 8px; }
  body > header .head-actions .btn { padding-inline: 11px; }
}

@media (max-width: 360px) {
  :root { --control-inline: 11px; --page-gutter: 12px; --section-space: 44px; }
  body > header .head { width: calc(100% - 20px); gap: 7px; }
  body > header .head-actions .btn { font-size: 12px; }
  body > header .menu { flex-basis: 40px; width: 40px; height: 40px; }
}

@media (min-width: 1440px) {
  :root { --page-gutter: 24px; --section-space: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .head-actions .btn { transition: none; }
  .btn.is-loading::after { animation: none; }
}
