/* Compact account and permission menu. Loaded after the legacy theme layers. */
.identity-dialog {
  position: fixed;
  top: calc(var(--nav-height) + 8px);
  right: 12px;
  bottom: auto;
  left: auto;
  width: min(382px, calc(100vw - 24px));
  max-height: calc(100vh - var(--nav-height) - 20px);
  margin: 0;
  padding: 0;
  overflow: auto;
  border: 1px solid #3b3b3b;
  border-radius: 0;
  background: #111111;
  color: #e9e9e9;
  box-shadow: 0 22px 70px rgb(0 0 0 / 62%);
}

.identity-dialog::backdrop {
  background: rgb(0 0 0 / 32%);
  backdrop-filter: none;
}

.identity-dialog[open] {
  animation: access-menu-enter 180ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes access-menu-enter {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.identity-dialog-shell {
  display: grid;
}

.identity-dialog-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 16px;
  align-items: center;
  min-height: 66px;
  padding: 13px 14px 13px 16px;
  border-bottom: 1px solid #2d2d2d;
  background: #151515;
}

.identity-dialog-heading {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.identity-dialog-heading h2,
.identity-dialog-heading p {
  margin: 0;
}

.identity-dialog-heading h2 {
  color: #ededed;
  font-size: 14px;
  font-weight: 720;
  line-height: 1.2;
}

.identity-dialog-heading p {
  overflow: hidden;
  color: #707070;
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-dialog-close {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid #343434;
  border-radius: 0;
  background: #171717;
  color: #a4a4a4;
  cursor: pointer;
}

.identity-dialog-close svg {
  display: block;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-width: 1.8;
}

.identity-dialog-close:hover,
.identity-dialog-close:focus-visible {
  border-color: #595959;
  color: #f0f0f0;
  outline: 0;
}

.identity-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 5px 0;
}

.identity-option {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 20px;
  gap: 11px;
  align-items: center;
  min-height: 62px;
  padding: 10px 16px;
  border: 0;
  border-bottom: 1px solid #222222;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 150ms ease, color 150ms ease;
}

.identity-option:last-child {
  border-bottom: 0;
}

.identity-option:hover,
.identity-option:focus-visible {
  background: #181818;
  outline: none;
  transform: none;
}

.identity-option.active {
  background: #1c1717;
  box-shadow: inset 2px 0 0 var(--brand);
}

.identity-option-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #3d3d3d;
  background: #1a1a1a;
  color: var(--brand);
  font-size: 11px;
  font-weight: 750;
}

.identity-option.active .identity-option-avatar {
  border-color: #5d3333;
  background: #211919;
}

.identity-option-copy {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
}

.identity-option-topline {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}

.identity-option-topline strong {
  overflow: hidden;
  color: #e7e7e7;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-option-topline small {
  flex: 0 0 auto;
  color: #777777;
  font-size: 9px;
}

.identity-option-copy p {
  overflow: hidden;
  margin: 0;
  color: #707070;
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-option-state {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: #4f4f4f;
}

.identity-option-state svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 1.8;
}

.identity-option:hover .identity-option-state,
.identity-option:focus-visible .identity-option-state {
  color: #8b8b8b;
}

.identity-option.active .identity-option-state {
  color: var(--brand);
}

.identity-dialog-note {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 9px 16px;
  border-top: 1px solid #2d2d2d;
  background: #0d0d0d;
}

.identity-status-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #555555;
}

.identity-dialog-note p {
  margin: 0;
  color: #686868;
  font-size: 9px;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .identity-dialog {
    top: calc(var(--nav-height) + 6px);
    right: 8px;
    width: calc(100vw - 16px);
    max-height: calc(100vh - var(--nav-height) - 14px);
  }

  .identity-dialog-header {
    min-height: 62px;
    padding-right: 12px;
    padding-left: 14px;
  }

  .identity-option {
    min-height: 60px;
    padding: 9px 14px;
  }

  .identity-dialog-note {
    padding-right: 14px;
    padding-left: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .identity-dialog[open],
  .identity-option {
    animation: none;
    transition: none;
  }
}
