.academy-header .brand-home { flex: 1 1 0; align-self: flex-start; }

.academy-header .brand-logo { max-width: 344px; }

.academy-header .account-panel {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: stretch;
  width: auto;
  max-width: none;
  gap: 4px;
}

.academy-header .header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.academy-header .account-panel :is(button, a):focus-visible {
  outline: 2px solid #df7b72;
  outline-offset: 2px;
}

@media (max-width: 600px) {
  html[data-theme] body[data-sequence-page] .academy-header { padding-block-start: 10px; }
  .academy-header .header-top { gap: 4px 10px; flex-wrap: nowrap; padding-bottom: 8px; }
  .academy-header + .page-shell { padding-top: 12px; }
}

.academy-header .header-actions:has(#adminAccount:not([hidden])) > .sequence-settings { display: contents; }
.academy-header .header-actions:has(#adminAccount:not([hidden])) > .sequence-settings .settings-trigger { display: none !important; }

/* Signed in: [person + initial] opens the profile, the door icon logs out (right corner). */
.academy-header .header-actions #adminAccount:not([hidden]) { display: flex; align-items: center; gap: 6px; }
.academy-header .account-identity[hidden] { display: none; }
html[data-theme] body[data-sequence-page] .academy-header .header-actions :is(#accountProfileLink, #signOut),
.academy-header .header-actions :is(#accountProfileLink, #signOut) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #3c3c3c;
  border-radius: 10px;
  background: #161616;
  color: #f5f5f5;
  font: inherit;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
html[data-theme] body[data-sequence-page] .academy-header .header-actions #signOut,
.academy-header .header-actions #signOut { flex: 0 0 44px; width: 44px; min-width: 44px; padding: 0; }
.academy-header .header-actions #accountProfileLink { min-width: 62px; }
.academy-header .header-actions #accountProfileLink svg { flex: none; }
html[data-theme] body[data-sequence-page] .academy-header .header-actions :is(#accountProfileLink, #signOut):hover,
.academy-header .header-actions :is(#accountProfileLink, #signOut):hover { border-color: #df7b72; background: #252525; }
html[data-theme] body[data-sequence-page] .academy-header .header-actions #accountProfileLink[aria-current="page"],
.academy-header .header-actions #accountProfileLink[aria-current="page"] { border-color: #7c3d37; background: #28110f; color: #ffb4ac; }
html[dir="rtl"] .academy-header .header-actions #signOut svg { transform: scaleX(-1); }


.academy-header .header-actions #openLogin {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #71302c;
  border-radius: 10px;
  background: #24110f;
  color: #fff;
}

/* Press feedback on header icon buttons (feedback, 160ms, strong ease-out). */
.academy-header .header-actions button,
.academy-header .header-actions .settings-trigger { transition: transform 160ms var(--ease-out, cubic-bezier(.23, 1, .32, 1)), background-color .15s ease, border-color .15s ease; }
.academy-header .header-actions button:active,
.academy-header .header-actions .settings-trigger:active { transform: scale(.94); }
@media (prefers-reduced-motion: reduce) {
  .academy-header .header-actions button:active,
  .academy-header .header-actions .settings-trigger:active { transform: none; }
}

.header-preferences, .header-languages { display: inline-flex; align-items: center; }
.header-preferences { gap: 6px; }
.header-languages, .header-preferences > button { border: 1px solid #3c3c3c; border-radius: 10px; background: #161616; }
.header-preferences button { display: grid; place-items: center; box-sizing: border-box; height: 42px; padding: 0; color: #f5f5f5; cursor: pointer; }
.header-languages button { width: 34px; border: 0; border-radius: 9px; background: transparent; font: 700 .8rem system-ui; }
.header-languages button[aria-pressed="true"] { background: #49201d; color: #ffd4d0; }
.header-preferences > button { width: 44px; height: 44px; font-size: 1.25rem; }
.header-preferences button:hover { background: #333; }
@media (max-width: 600px) {
  .academy-header .account-panel .header-actions { width: 120px; flex-wrap: wrap; }
  .academy-header .header-actions > .header-preferences {
    order: 1;
    flex-basis: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 600px) {
  .academy-header .header-actions #adminAccount:not([hidden]) { flex: 1 1 100%; min-width: 0; }
  .academy-header .header-actions #accountProfileLink { flex: 1 1 0; min-width: 0; }
}

.academy-header .sequence-admin-nav {
  box-sizing: border-box;
  display: flex;
  gap: 4px;
  width: 100%;
  margin: 8px auto 0;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}

.academy-header .sequence-admin-nav[hidden] { display: none; }

.academy-header .sequence-admin-nav :is(button, a) {
  box-sizing: border-box;
  flex: 1 0 0;
  min-inline-size: max-content;
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.academy-header .sequence-admin-nav :is(button, a):hover { background: var(--panel-hover); color: var(--text); }
.academy-header .sequence-admin-nav :is(button, a):focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.academy-header .sequence-admin-nav [aria-current="page"] {
  border-color: var(--accent);
  background: var(--panel-hover);
  color: var(--text);
}
