/* Application header, account menu and notifications. */

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 68px;
  border-bottom: 2px solid var(--ink);
  background: var(--surface);
}

.app-header-inner {
  display: grid;
  width: min(var(--app-width), calc(100% - 40px));
  min-height: 68px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  margin: 0 auto;
  padding: 10px 0;
}

.primary-navigation {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
}

.primary-nav-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 7px 11px;
  border: 1.5px solid transparent;
  border-radius: 8px;
  color: var(--muted-ink);
  font-size: 13px;
  font-weight: 900;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.primary-nav-link:hover {
  color: var(--ink);
  background: var(--interactive-soft);
}

.primary-nav-link[aria-current="page"] {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--interactive-soft);
  box-shadow: 2px 2px 0 var(--ink);
}

.account-area {
  display: flex;
  min-width: 0;
  grid-column: 3;
  align-items: center;
  justify-self: end;
  gap: 10px;
}

.account-menu {
  position: relative;
}

.account-trigger {
  display: flex;
  min-height: 46px;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 6px 12px;
  border: 1.5px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  list-style: none;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

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

.account-trigger:hover,
.account-menu[open] .account-trigger {
  border-color: var(--ink);
  background: var(--interactive-soft);
  box-shadow: 2px 2px 0 var(--ink);
}

.account-context {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.2;
  text-align: right;
}

.account-context strong {
  max-width: 260px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-context small {
  max-width: 260px;
  overflow: hidden;
  color: var(--muted-ink);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-chevron {
  color: var(--primary-dark);
  font-size: 18px;
  font-weight: 950;
  transition: rotate 150ms ease;
}

.account-menu[open] .account-chevron {
  rotate: 180deg;
}

.account-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 9px);
  right: 0;
  display: grid;
  width: min(320px, calc(100vw - 28px));
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: 5px 5px 0 var(--ink);
}

.account-identity,
.account-access-summary {
  display: grid;
  gap: 3px;
  padding: 14px 15px;
  border-bottom: 1px solid var(--border);
}

.account-identity span,
.account-access-summary span {
  color: var(--muted-ink);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.account-identity strong,
.account-access-summary strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.account-identity small,
.account-access-summary small {
  color: var(--muted-ink);
  font-size: 11px;
  font-weight: 750;
}

.account-menu-action {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  padding: 9px 15px;
  border: 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
  font-weight: 900;
  text-align: left;
}

.account-menu-action:hover {
  color: var(--primary-dark);
  background: var(--interactive-soft);
}

.account-menu-form:last-child .account-menu-action {
  border-bottom: 0;
}

.account-menu-button {
  font-family: inherit;
}

.inline-form,
.resend-form,
.context-choice-form {
  margin: 0;
}

.flash-stack {
  position: fixed;
  z-index: 40;
  right: max(20px, calc((100vw - var(--app-width)) / 2));
  bottom: 20px;
  display: grid;
  width: min(520px, calc(100% - 32px));
  gap: 8px;
}

.flash-message {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 11px 14px;
  border: 1.5px solid currentcolor;
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 3px 3px 0 currentcolor;
  font-size: 13px;
  font-weight: 800;
}

.flash-success {
  color: oklch(0.42 0.14 148);
  background: var(--success-soft);
}

.flash-error {
  color: var(--danger);
  background: var(--danger-soft);
}

.flash-dismiss {
  min-height: 44px;
  padding: 4px 6px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  color: currentcolor;
  background: transparent;
  font-size: 11px;
  font-weight: 950;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.flash-dismiss:hover {
  background: oklch(1 0 0 / 0.55);
}
