/* Self-contained header styles: page-specific profile and portal CSS must not
   alter the global navigation. Match the established homepage header. */
header.site-header[data-shared-header] {
  position: sticky; top: 0; z-index: 100; display: block;
  width: 100%; height: auto; min-height: 78px; margin: 0;
  padding: 10px 0 0 !important; border: 0 !important; border-radius: 0;
  color: #3c4658; background: transparent !important;
  box-shadow: none !important; backdrop-filter: none !important;
  font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
}
[data-shared-header] *, [data-shared-header] *::before, [data-shared-header] *::after { box-sizing: border-box; }
[data-shared-header] .header-inner {
  position: relative; display: flex; align-items: center; flex-wrap: nowrap;
  gap: clamp(20px, 2vw, 32px); width: min(1500px, calc(100% - 48px)) !important;
  height: auto; min-height: 68px !important; margin: 0 auto;
  padding: 0 16px 0 12px !important; overflow: visible;
  border: 1px solid rgba(255,255,255,.96) !important; border-radius: 22px !important;
  background: rgba(255,255,255,.94) !important;
  box-shadow: 0 12px 30px rgba(87,103,126,.12), 0 -4px 16px rgba(255,255,255,.98) !important;
  backdrop-filter: blur(18px);
}
[data-shared-header] .brand {
  display: inline-flex; flex: 0 0 auto; align-items: center;
  width: 210px !important; height: 56px !important; margin: 0;
  padding: 0; overflow: hidden; border-radius: 12px;
}
[data-shared-header] .brand-logo { display: block; flex: 0 0 auto; width: 100%; max-width: 100%; height: auto; object-fit: contain; }
[data-shared-header] .primary-nav {
  position: static; display: flex; flex: 0 1 auto; align-items: center;
  flex-direction: row; gap: clamp(15px, 1.65vw, 25px); width: auto;
  max-height: none; margin: 0 0 0 auto; padding: 0;
  overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
[data-shared-header] .primary-nav > a,
[data-shared-header] .primary-nav > details > summary {
  position: relative; display: inline-flex; align-items: center; gap: 5px;
  margin: 0; padding: 26px 0; border: 0; border-radius: 0;
  color: #3c4658; background: transparent; box-shadow: none;
  font: 750 clamp(10px, .85vw, 12px)/1.4 Inter, "Segoe UI", Arial, Helvetica, sans-serif;
  letter-spacing: 0; text-decoration: none; text-transform: uppercase; white-space: nowrap;
  list-style: none; cursor: pointer;
}
[data-shared-header] summary::-webkit-details-marker { display: none; }
[data-shared-header] summary::marker { content: ''; }
[data-shared-header] .primary-nav > a::after,
[data-shared-header] .primary-nav > details > summary::after {
  content: ''; position: absolute; inset: auto 0 15px; height: 3px;
  border-radius: 99px; background: #ef1118; transform: scaleX(0);
  transform-origin: left; transition: transform .18s ease;
}
[data-shared-header] .primary-nav > a:hover,
[data-shared-header] .primary-nav > a.active,
[data-shared-header] .primary-nav > details.active > summary,
[data-shared-header] .primary-nav > details[open] > summary { color: #ef1118; }
[data-shared-header] .primary-nav > a:hover::after,
[data-shared-header] .primary-nav > a.active::after,
[data-shared-header] .primary-nav > details.active > summary::after,
[data-shared-header] .primary-nav > details[open] > summary::after { transform: scaleX(1); }
[data-shared-header] .primary-nav > details { position: relative; }
[data-shared-header] .primary-nav > details > summary svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; }
[data-shared-header] .primary-nav > details[open] > summary svg { transform: rotate(180deg); }
[data-shared-header] :is(.services-dropdown, .software-dropdown, .ai-dropdown) {
  position: absolute; inset: calc(100% - 1px) auto auto -12px; z-index: 110;
  width: min(265px, calc(100vw - 32px)); max-height: calc(100dvh - 104px);
  margin: 0; padding: 10px; overflow: auto; overscroll-behavior: contain;
  border: 1px solid #e3e8ef; border-top: 2px solid #ef1118; border-radius: 0 0 12px 12px;
  color: #202b40; background: #fff;
  box-shadow: 0 14px 35px rgba(20,20,25,.12);
}
[data-shared-header] .software-dropdown { left: -18px; width: min(370px, calc(100vw - 32px)); padding: 12px; }
[data-shared-header] :is(.services-dropdown, .software-dropdown, .ai-dropdown) ul { margin: 8px 0; padding: 0; list-style: none; }
[data-shared-header] :is(.services-dropdown, .software-dropdown, .ai-dropdown) a {
  position: relative; display: flex; align-items: center; gap: 8px;
  min-height: 36px; margin: 0; padding: 8px 10px; border: 0; border-radius: 8px;
  color: #202b40; background: transparent; box-shadow: none;
  font: 500 12px/1.45 Inter, "Segoe UI", Arial, Helvetica, sans-serif;
  letter-spacing: 0; text-decoration: none; text-transform: none; white-space: normal;
}
[data-shared-header] :is(.services-dropdown, .software-dropdown, .ai-dropdown) a::after { display: none; }
[data-shared-header] :is(.services-dropdown, .software-dropdown, .ai-dropdown) a:hover { color: #ef1118 !important; background: #fff3f3 !important; box-shadow: none !important; }
[data-shared-header] .software-menu-columns { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; margin-top: 8px; padding: 12px 0; border-block: 1px solid #e5e5e8; }
[data-shared-header] .software-menu-group + .software-menu-group { padding-left: 10px; border-left: 1px solid #e5e5e8; }
[data-shared-header] .software-menu-group p { margin: 0 9px 6px; color: #636368; font-size: 10px; font-weight: 750; letter-spacing: .7px; text-transform: uppercase; }
[data-shared-header] .software-menu-group ul { margin: 0; }
[data-shared-header] .software-menu-all { font-weight: 750 !important; }
[data-shared-header] :is(.services-menu-view, .software-menu-view, .ai-menu-explore) { justify-content: space-between; margin-top: 9px; color: #ef1118 !important; font-weight: 750 !important; }
[data-shared-header] :is(.services-menu-view, .ai-menu-explore) { border-top: 1px solid #e5e5e8; border-radius: 0; padding-top: 12px; }
[data-shared-header] .ai-menu-overview { border-bottom: 1px solid #e5e5e8; border-radius: 0; padding-bottom: 12px; font-weight: 750 !important; }
[data-shared-header] .site-account { display: flex; flex: 0 0 auto; align-items: center; margin: 0; }
[data-shared-header] .site-account > a.header-login {
  display: inline-flex; align-items: center; justify-content: center; min-height: 38px;
  margin: 0; padding: 0 17px; border: 0; border-radius: 999px;
  color: #fff; background: #ef1118; box-shadow: none;
  font: 750 clamp(10px, .85vw, 12px)/1 Inter, "Segoe UI", Arial, Helvetica, sans-serif;
  text-decoration: none; text-transform: uppercase; white-space: nowrap;
}
[data-shared-header] .site-account > a.header-login:hover { background: #ce0b12; }
[data-shared-header] .site-account > .shared-account-menu { position: relative; flex: 0 0 auto; }
[data-shared-header] .shared-account-menu > summary { min-height: 42px; margin: 0; font-family: inherit; }
[data-shared-header] .shared-account-menu-panel { left: auto; right: 0; font-family: inherit; }
[data-shared-header] .shared-account-menu-action { display: block; text-transform: none; line-height: 1.4; }
[data-shared-header] .menu-toggle { display: none; }
[data-shared-header] :is(a, button, summary):focus-visible { outline: 2px solid #ef1118; outline-offset: 3px; }
@media (max-width: 1023px) {
  [data-shared-header] .brand { margin-right: auto; }
  [data-shared-header] .menu-toggle {
    display: grid; flex: 0 0 auto; place-content: center; gap: 5px;
    width: 44px; height: 44px; margin: 0; padding: 0; order: 3;
    border: 1px solid #e2e8f0 !important; border-radius: 50%; background: #fff !important;
    box-shadow: none !important; cursor: pointer;
  }
  [data-shared-header] .menu-toggle span { display: block; width: 18px; height: 2px; background: #202b40; }
  [data-shared-header] .primary-nav {
    position: absolute; inset: calc(100% + 4px) 0 auto !important; display: none;
    flex-direction: column; align-items: stretch; gap: 0; width: 100%;
    max-height: calc(100dvh - 100px); margin: 0; padding: 15px 20px;
    overflow: auto; border: 1px solid #e3e8ef; border-radius: 18px;
    background: #fff !important; box-shadow: 0 18px 30px rgba(30,44,67,.12);
  }
  [data-shared-header]:has(.primary-nav.show)::before {
    content: ''; position: fixed; inset: 0; z-index: 0;
    background: rgba(15,23,42,.45); pointer-events: none;
  }
  [data-shared-header] .primary-nav.show { display: flex; }
  [data-shared-header] .primary-nav > a,
  [data-shared-header] .primary-nav > details > summary { display: flex; justify-content: space-between; padding: 12px 0; font-size: 12px; }
  [data-shared-header] .primary-nav > a::after,
  [data-shared-header] .primary-nav > details > summary::after { display: none; }
  [data-shared-header] :is(.services-dropdown, .software-dropdown, .ai-dropdown) { position: static; width: 100%; max-height: none; margin: 0 0 8px; overflow: visible; border-radius: 8px; box-shadow: none; }
  [data-shared-header] :is(.services-dropdown, .software-dropdown, .ai-dropdown) a { min-height: 42px; }
}
@media (max-width: 600px) {
  header.site-header[data-shared-header] { min-height: 69px; padding-top: 7px !important; }
  [data-shared-header] .header-inner { width: calc(100% - 16px) !important; min-height: 62px !important; gap: 10px; border-radius: 18px !important; }
  [data-shared-header] .brand { width: 150px !important; height: 46px !important; }
  [data-shared-header] .shared-account-name, [data-shared-header] .shared-account-chevron { display: none; }
  [data-shared-header] .shared-account-menu > summary { padding: 4px; border-radius: 50%; }
  [data-shared-header] .primary-nav { max-height: calc(100dvh - 86px); }
}
/* Narrow desktop band keeps the full nav; collapse the account menu to its avatar so a long signed-in name cannot overflow the header. */
@media (min-width: 1024px) and (max-width: 1099px) {
  [data-shared-header] .shared-account-name { display: none; }
}
