/* Load after site, premium, profile-navigation and admin-inline-editor CSS. */
/* Keep the account action rightmost without changing the sticky header layer. */
.header .header-in {
  flex-wrap: nowrap;
  overflow: visible;
}

.header .brand {
  order: 1;
  flex: 0 0 auto;
  min-height: 44px;
}

.header .nav {
  order: 2;
  flex: 1 1 auto;
  justify-content: flex-end;
  margin-left: auto;
  min-width: 0;
}

.header .mobile-nav-toggle {
  order: 3;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
}

.header .header-actions {
  order: 4;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  width: auto;
  min-width: 0;
  margin-left: auto;
  gap: 10px;
  overflow: visible;
}

.header .header-actions > .admin-edit-toggle {
  order: 1;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
}

.header .ccc-account-menu {
  --ccc-menu-accent: var(--blue-light, #4ac5ff);
  position: relative;
  order: 2;
  display: block;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border: 0;
  color: #e7f2fc;
  font-family: var(--font, 'Space Grotesk', Arial, sans-serif);
  text-align: left;
}

.header .ccc-account-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 5px 10px;
  border: 1px solid #39718e;
  border-radius: 8px;
  background: linear-gradient(135deg, #142c3b, #0c1b28);
  color: #e5f7ff;
  list-style: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: rgba(74, 197, 255, 0.18);
}

.header .ccc-account-trigger::marker {
  content: '';
}

.header .ccc-account-trigger::-webkit-details-marker {
  display: none;
}

.header .ccc-account-avatar {
  display: inline-flex;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  overflow: hidden;
  border: 1px solid rgba(74, 197, 255, 0.45);
  border-radius: 50%;
  background: #16384b;
  color: #d8f4ff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}

.header .ccc-account-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  border: 0;
  border-radius: inherit;
}

.header .ccc-account-trigger-label {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  white-space: nowrap;
}

.header .ccc-account-chevron {
  display: block;
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  color: var(--ccc-menu-accent);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

.header .ccc-account-menu[open] > .ccc-account-trigger,
.header .ccc-account-trigger:hover {
  border-color: #76d8ff;
  background: #163747;
  color: #fff;
}

.header .ccc-account-menu[open] .ccc-account-chevron {
  transform: rotate(180deg);
}

.header .ccc-account-panel {
  position: absolute;
  z-index: 100;
  top: calc(100% + 10px);
  right: 0;
  left: auto;
  display: none;
  width: min(288px, calc(100vw - 24px));
  max-height: calc(100vh - 180px);
  max-height: calc(100dvh - 180px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  border: 1px solid rgba(86, 164, 206, 0.38);
  border-radius: 12px;
  background: #0e151f;
  color: #dce7f3;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), inset 0 1px rgba(255, 255, 255, 0.04);
  scrollbar-width: thin;
  scrollbar-color: #365269 #0e151f;
}

/* Native details is the source of visibility; no JavaScript or hover required. */
.header .ccc-account-menu[open] > .ccc-account-panel {
  display: block;
}

.header .ccc-account-menu:not([open]) > .ccc-account-panel {
  display: none;
}

.header .ccc-account-identity {
  padding: 12px 12px 14px;
  overflow-wrap: anywhere;
}

.header .ccc-account-identity strong {
  display: block;
  margin: 0;
  color: #f1f7fd;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.header .ccc-account-identity > span {
  display: block;
  margin-top: 3px;
  color: #a2b7ca;
  font-size: 11px;
  line-height: 1.5;
}

.header .ccc-account-group {
  margin: 0;
  padding: 8px 0;
  border: 0;
  border-top: 1px solid rgba(201, 223, 248, 0.12);
  background: transparent;
}

.header .ccc-account-group > h2 {
  margin: 0;
  padding: 5px 12px 7px;
  color: #99afc3;
  font-family: var(--mono, 'DM Mono', monospace);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.header .ccc-account-panel .ccc-account-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #dce7f3;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
  text-align: left;
  text-decoration: none;
  text-transform: none;
  cursor: pointer;
}

.header .ccc-account-item > span {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.header .ccc-account-item > small {
  flex: 0 1 auto;
  max-width: 40%;
  margin-left: auto;
  color: #a6bdcf;
  font-size: 10px;
  line-height: 1.4;
  text-align: right;
  overflow-wrap: anywhere;
}

.header .ccc-menu-icon {
  display: block;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  color: var(--ccc-menu-accent);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header .ccc-account-panel .ccc-account-item:hover,
.header .ccc-account-panel .ccc-account-item:focus,
.header .ccc-account-panel .ccc-account-item[aria-current='page'] {
  background: rgba(0, 168, 255, 0.12);
  color: #fff;
}

.header .logout-form.ccc-account-logout {
  display: block;
  margin: 0;
  padding: 8px 0 0;
  border-top: 1px solid rgba(201, 223, 248, 0.12);
}

.header .ccc-account-logout .ccc-account-item {
  color: #d9e8f5;
}

.header .ccc-account-trigger:focus,
.header .header-actions > .admin-edit-toggle:focus,
.header .mobile-nav-toggle:focus {
  outline: 3px solid #9ce7ff;
  outline-offset: 3px;
}

.header .ccc-account-panel .ccc-account-item:focus {
  outline: 2px solid #9ce7ff;
  outline-offset: -2px;
}

@media (max-width: 1100px) {
  .header {
    height: auto;
  }

  .header .header-in {
    height: auto;
    min-height: 81px;
    flex-wrap: nowrap;
    gap: 12px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .header .header-actions {
    order: 4;
    flex: 0 0 auto;
    flex-wrap: wrap;
    width: auto;
    margin-left: auto;
    gap: 8px;
  }

  .header .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    order: 3;
    margin-left: auto;
  }

  .header .nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-left: 0;
    padding: 16px 24px 20px;
    border-bottom: 1px solid var(--line, rgba(201, 223, 248, 0.13));
    background: #0b121b;
    gap: 10px 24px;
  }

  .header .nav.open {
    display: flex;
  }

  .header .nav a,
  .header .nav-dropdown-toggle {
    min-height: 44px;
  }
}

@media (max-width: 820px) {
  .header .header-actions > .admin-edit-toggle {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    gap: 0;
    padding: 0;
  }

  /* The existing aria-label remains the accessible name of this icon button. */
  .header .header-actions > .admin-edit-toggle b {
    display: none;
  }

  .header .ccc-account-trigger {
    gap: 6px;
    padding: 5px 8px;
  }

  .header .ccc-account-avatar {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
  }

  .header .ccc-account-trigger-label {
    font-size: 11px;
  }
}

@media (max-width: 600px) {
  .header .header-in {
    min-height: 67px;
    gap: 8px;
    padding: 8px 12px;
  }

  .header .brand {
    min-width: 0;
    gap: 7px;
  }

  .header .header-actions {
    gap: 6px;
  }

  .header .ccc-account-trigger {
    gap: 5px;
    padding: 5px 6px;
  }

  .header .ccc-account-chevron {
    flex-basis: 10px;
    width: 10px;
    height: 10px;
  }
}

@media (max-width: 374px) {
  .header .brand-copy {
    display: none;
  }

  .header .ccc-account-avatar {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
  }

  .header .ccc-account-trigger-label {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .header .ccc-account-chevron {
    transition: none;
  }
}
