/* One shared header for all public pages and authenticated dashboards. */
.site-header .nav-wrap {
  width: min(1680px, calc(100% - 48px)); min-height: 80px; padding-block: 12px;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px;
}
.site-header .brand { grid-column: 1; grid-row: 1; }
.site-header .primary-nav {
  position: static; grid-column: 2; grid-row: 1; display: flex; flex-direction: row; flex-wrap: wrap;
  align-items: center; justify-content: center; width: auto; margin: 0; padding: 0;
  gap: 0 14px; background: transparent; border: 0; box-shadow: none;
}
.site-header .primary-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 7px 0;
  font-size: .78rem; line-height: 1.4; font-weight: 650; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.site-header .primary-nav a[aria-current="page"] { border-bottom-color: var(--teal-700); color: var(--teal-700); }
.site-header .header-actions { grid-column: 3; grid-row: 1; display: flex; align-items: center; gap: 16px; margin: 0; }
.site-header .language-control select {
  width: 108px !important; min-width: 108px !important; max-width: 108px !important;
  height: 44px; min-height: 44px; padding: 0 24px 0 12px; font-size: .85rem; border-radius: 10px;
}
.site-header .sign-in-actions { display: flex; align-items: center; gap: 6px; padding-left: 16px; border-left: 1px solid var(--line); }
.site-header .header-auth {
  position: relative; display: inline-flex; flex: 0 0 144px; width: 144px; height: 44px;
  align-items: center; justify-content: center; gap: 7px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--navy-950);
  font-size: .8rem; line-height: 1; font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.site-header .header-auth:hover { background: #edf5f1; border-color: #90b8b1; }
.site-header .header-auth-primary { color: white; background: var(--teal-700); border-color: var(--teal-700); }
.site-header .header-auth-primary:hover { background: var(--teal-600); border-color: var(--teal-600); }
.site-header .header-auth svg { display: block; width: 20px; height: 20px; flex: 0 0 20px; }
.site-header .header-auth svg[hidden] { display: none; }
.site-header .header-auth[hidden] { display: none !important; }
.site-header .header-dashboard { flex-basis: auto; width: auto; min-width: 100px; }
.site-header .auth-tooltip {
  display: none; position: absolute; z-index: 70; top: calc(100% + 8px); right: 0;
  width: max-content; max-width: min(300px, calc(100vw - 28px)); white-space: normal;
  padding: 9px 12px; border-radius: 7px; background: var(--navy-950); color: white;
  font-size: .75rem; font-weight: 500; line-height: 1.4; box-shadow: var(--shadow);
  pointer-events: none;
}
.site-header:not(.dismiss-tooltips) .header-auth:hover .auth-tooltip,
.site-header:not(.dismiss-tooltips) .header-auth:focus-visible .auth-tooltip { display: block; }
.site-header .nav-toggle { display: none; margin: 0; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }

/* Give eight service links their own row before they can squeeze the access controls. */
@media (min-width: 1000px) and (max-width: 1699px) {
  .site-header .nav-wrap { grid-template-columns: auto 1fr auto; gap: 6px 20px; padding-block: 12px 0; }
  .site-header .primary-nav { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; border-top: 1px solid var(--line); gap: 0 18px; }
  .site-header .primary-nav a { font-size: .84rem; min-height: 46px; }
}
@media (max-width: 999px) {
  .site-header .nav-wrap { grid-template-columns: auto 1fr auto; gap: 14px; min-height: 76px; }
  .site-header .header-actions { grid-column: 2; justify-self: end; gap: 12px; }
  .site-header .nav-toggle { display: block; grid-column: 3; grid-row: 1; }
  .site-header .header-auth { width: 44px; flex-basis: 44px; padding: 0; }
  .site-header .auth-label { display: none; }
  .site-header .primary-nav {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 60; display: none;
    padding: 12px 24px 20px; flex-direction: column; align-items: stretch; flex-wrap: nowrap;
    max-height: min(70dvh, 520px); overflow-y: auto; background: var(--paper);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow); gap: 3px;
  }
  .site-header .primary-nav.open { display: flex; }
  .site-header .primary-nav a { font-size: .95rem; padding: 12px; border-radius: 7px; border-bottom: 0; }
  .site-header .primary-nav a[aria-current="page"] { background: #e8f2ee; }
}
/* Keep all three entry points visible on phones; no duplicate sign-in links inside the menu. */
@media (max-width: 600px) {
  .site-header .nav-wrap { width: calc(100% - 28px); grid-template-columns: 1fr auto 44px; gap: 8px 10px; padding-block: 10px; }
  .site-header .brand { gap: 7px; }
  .site-header .brand > span:last-child strong { font-size: 1.18rem; }
  .site-header .brand small { display: none; }
  .site-header .header-actions { display: contents; }
  .site-header .language-control { grid-column: 2; grid-row: 1; }
  .site-header .language-control select { width: 100px !important; min-width: 100px !important; max-width: 100px !important; }
  .site-header .sign-in-actions { grid-column: 1 / -1; grid-row: 2; border: 0; padding: 0; gap: 8px; }
  .site-header .header-auth { flex: 1 1 0; flex-direction: column; min-width: 0; width: auto; height: 64px; gap: 5px; padding: 6px 4px; }
  .site-header .auth-label { display: inline; font-size: .75rem; line-height: 1.3; }
  .site-header .header-auth:first-child .auth-tooltip { right: auto; left: 0; }
}
@media (prefers-reduced-motion: reduce) { .site-header .header-auth { transition: none; } }
