/* Shared masthead. Both rows are included in the offset used by sticky pages. */
#nav {
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) auto minmax(130px, 220px) 44px 44px;
  grid-template-areas: "brand links search support account";
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vw, 32px);
  height: var(--header-height);
  box-sizing: border-box;
  padding: 0 max(18px, calc((100% - 1200px) / 2));
  border-bottom: 1px solid var(--line);
  background: white;
}
.logo-link {
  grid-area: brand;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: #2c3e50;
  font-size: var(--text-subhead);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.logo-link::before {
  content: "";
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  background: url('/static/logo.svg') left center / auto 34px no-repeat;
}
.nav-links { grid-area: links; display: flex; align-items: center; gap: clamp(4px, 2vw, 30px); }
.nav-links a, .ft-nav a, .ft-meta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-height);
  min-width: var(--control-height);
  text-decoration: none;
}
#nav .nav-links a { font-size: var(--text-label); font-weight: 500; white-space: nowrap; color: var(--ink-2); }
#nav .nav-links a:hover, #nav .nav-links a.active { color: var(--action); }
#nav .nav-links [aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
#nav-search-wrap { grid-area: search; }
#search-input { min-height: 44px; width: 100%; }
.support-slot { grid-area: support; display: grid; place-items: center; min-width: 44px; min-height: 44px; }
.header-user { grid-area: account; position: relative; }
.header-user .user-trigger { width: 44px; height: 44px; display: grid; place-items: center; }
.user-menu { z-index: 2; }
.user-menu :is(a, button) { display: flex; align-items: center; min-height: 44px; }
.ft-brand span { font-size: var(--text-caption); }
.ft-nav { gap: 0 20px; }
.ft-nav a, .ft-policy a { font-size: var(--text-label); }
.ft-meta { align-items: center; justify-content: space-between; }
.ft-policy { display: flex; flex-wrap: wrap; gap: 0 16px; }
.ft-policy a { color: var(--ink-2); }
.ft-policy a:hover { text-decoration: underline; }
.ft-meta > span { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; }
@media (max-width: 768px) {
  :root, body:has(#route-explorer) { --header-height: 98px; }
  .nav-bar #nav, body:has(#route-explorer) .nav-bar #nav {
    grid-template-columns: auto minmax(0, 1fr) 44px 44px;
    grid-template-rows: 44px 44px;
    grid-template-areas: "brand search support account" "links links links links";
    gap: 2px 4px;
    padding: 4px 8px 3px;
  }
  .logo-link { gap: 3px; font-size: var(--text-body); }
  .logo-link::before { width: 26px; height: 26px; background-size: auto 26px; }
  .nav-links { justify-content: space-between; gap: 2px; }
  #nav-search-wrap { position: static; }
  #search-results { top: 100%; left: 8px; right: 8px; width: auto; }
  #search-input { padding-left: 28px; padding-right: 6px; background-position: 8px center; }
  .ft-nav { gap: 0 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-bar *, .page-main :is(.ap-btn, .el-button), .site-footer * { transition: none; }
}
.public-error { text-align: center; margin: clamp(32px, 10vh, 100px) auto; max-width: 32em; }
.public-error p { color: var(--ink-2); line-height: 1.65; }
.public-error p:first-child { color: var(--action); font-size: var(--text-label); font-weight: 600; }
.public-error .ap-btn { margin-top: 12px; }

/* Auth pages keep their full-height photograph; their footer follows the form. */
.page-main > .main-bg {
  position: relative;
  inset: auto;
  min-height: calc(100dvh - var(--header-height));
  display: flow-root;
  overflow: visible;
}
.page-main:has(> .main-bg) + .site-footer { margin-top: 0; }
.page-container h1 { font-size: var(--text-heading); }
.ap-input, .ap-select, .ap-step, .ap-seg label { min-height: var(--control-height); }
.ap-seg span { box-sizing: border-box; min-height: 44px; display: grid; align-items: center; }
.ap-step button { min-width: 44px; }
[data-support-open] { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
