/* Header account menu and dashboard async results. */

.topbar { position: relative; }

.topbar .profile-menu {
  position: relative;
  min-width: 0;
}

.topbar .profile-menu > .user-chip {
  display: inline-grid;
  justify-items: end;
  width: auto;
  min-width: 0;
  max-width: min(240px, 42vw);
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: #c8cfda;
  text-align: right;
  line-height: 1.25;
  cursor: pointer;
  list-style: none;
}

.topbar .profile-menu > .user-chip::-webkit-details-marker { display: none; }
.topbar .profile-menu > .user-chip::marker { content: ""; }
.topbar .profile-menu > .user-chip:hover { text-decoration: underline; text-underline-offset: 3px; }
.topbar .profile-menu > .user-chip:focus-visible { outline: 2px solid #fff; outline-offset: 4px; border-radius: 2px; }

.topbar .profile-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 80;
  box-sizing: border-box;
  width: min(240px, calc(100vw - 24px));
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--navy);
  box-shadow: var(--shadow);
}

.topbar nav .profile-menu-panel a,
.topbar nav .profile-menu-panel .profile-menu-logout button {
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #10233f;
  font: inherit;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.topbar nav .profile-menu-panel a:hover,
.topbar nav .profile-menu-panel .profile-menu-logout button:hover { background: #edf2f8; }

.topbar nav .profile-menu-panel a:focus-visible,
.topbar nav .profile-menu-panel .profile-menu-logout button:focus-visible {
  outline: 3px solid rgba(45, 113, 199, .4);
  outline-offset: -2px;
}

.topbar .profile-menu-logout {
  margin: 4px 0 0;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.dashboard-results-error {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #e4b3ae;
  border-radius: 8px;
  background: #fff2ef;
  color: #8d231b;
  font-weight: 700;
  line-height: 1.45;
}

.dashboard-results-error a { color: inherit; text-decoration: underline; }

@media (max-width: 700px) {
  .topbar {
    align-items: flex-start;
    gap: 10px;
    padding: 9px 12px;
  }

  .topbar .brand {
    flex: 0 0 85px;
    width: 85px;
    min-width: 0;
  }

  .topbar .brand-wordmark {
    width: 85px;
    max-width: 100%;
    height: auto;
  }

  .topbar .topbar-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "profile bell gear" "feedback feedback feedback";
    align-items: center;
    justify-content: end;
    gap: 6px;
    flex: 1 1 200px;
    width: auto;
    min-width: 0;
    max-width: 240px;
    margin-left: auto;
  }

  .topbar .feedback-nav-link {
    grid-area: feedback;
    justify-self: end;
    min-height: 32px;
    padding: 4px 9px;
    font-size: 12px;
    line-height: 1.2;
  }

  .topbar .profile-menu {
    grid-area: profile;
    position: static;
    justify-self: end;
    min-width: 0;
    max-width: 100%;
  }

  .topbar .profile-menu > .user-chip {
    width: auto;
    max-width: 100%;
    min-width: 0;
  }

  .topbar .nt-widget {
    grid-area: bell;
    align-self: center;
  }

  .topbar .settings-menu {
    grid-area: gear;
    position: static;
    align-self: center;
  }

  .topbar .profile-menu-panel {
    top: calc(100% + 8px);
    right: 12px;
    left: auto;
    width: min(260px, calc(100vw - 24px));
  }

  .topbar .settings-menu-panel {
    top: calc(100% + 8px);
    right: 12px;
  }
}
