/* Identity selector v20: a measured flat-ink utility panel with static hover feedback. */

.user-menu .user-copy strong {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
}

.user-menu .user-copy small {
  color: #7f7f7f;
  font-size: 11px;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
}

.identity-dialog {
  position: fixed;
  top: calc(var(--nav-height) + 8px);
  right: 12px;
  bottom: auto;
  left: auto;
  width: min(420px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100vh - var(--nav-height) - 20px);
  margin: 0;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #393939;
  border-radius: 0;
  background: #0f0f0f;
  color: #eeeeee;
  box-shadow: 0 24px 72px rgb(0 0 0 / 68%);
  color-scheme: dark;
}

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

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

@keyframes identity-panel-enter {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.identity-dialog-shell {
  display: grid;
  min-width: 0;
}

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

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

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

.identity-dialog-heading h2 {
  color: #f0f0f0;
  font-family: var(--font-heading, "Instrument Sans", "PingFang SC", system-ui, sans-serif);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0;
}

.identity-dialog-heading p {
  overflow: hidden;
  color: #858585;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-dialog-close {
  display: grid;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid #3a3a3a;
  border-radius: 0;
  background: #171717;
  color: #a5a5a5;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

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

.identity-dialog-close:hover {
  border-color: #5a5a5a;
  background: #1b1b1b;
  color: #eeeeee;
}

.identity-dialog-close:focus-visible {
  border-color: #767676;
  color: #ffffff;
  outline: 1px solid #767676;
  outline-offset: -4px;
}

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

.identity-option {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 24px;
  gap: 14px;
  align-items: center;
  min-height: 76px;
  padding: 12px 18px 12px 20px;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid #272727;
  border-radius: 0;
  background: #101010;
  color: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transform: none;
  transition: none;
}

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

.identity-option::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 3px;
  background: var(--brand);
  content: "";
  opacity: 0;
  transform: none;
  transition: none;
}

.identity-option:hover {
  border-bottom-color: #2d2d2d;
  background: #161616;
  outline: 0;
  transform: none;
  transition: none;
}

.identity-option:focus-visible {
  z-index: 1;
  background: #171717;
  outline: 1px solid #666666;
  outline-offset: -4px;
  transform: none;
  transition: none;
}

.identity-option.active {
  border-bottom-color: #2d2929;
  background: linear-gradient(90deg, rgb(255 77 77 / 9%), transparent 78%), #151313;
  box-shadow: none;
}

.identity-option.active::before {
  opacity: 1;
  transform: none;
}

.identity-option-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #3d3d3d;
  border-radius: 0;
  background: #181818;
  color: var(--brand);
  font-size: 12px;
  font-weight: 720;
  line-height: 1;
}

.identity-option.active .identity-option-avatar {
  border-color: #683838;
  background: #211818;
}

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

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

.identity-option-topline strong {
  overflow: hidden;
  color: #ededed;
  font-family: var(--font-heading, "Instrument Sans", "PingFang SC", system-ui, sans-serif);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-option-topline small {
  flex: 0 0 auto;
  color: #929292;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.identity-option-copy p {
  overflow: hidden;
  margin: 0;
  color: #858585;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-option-state {
  position: static;
  display: grid;
  width: 24px;
  height: 24px;
  align-self: center;
  place-items: center;
  color: #555555;
}

.identity-option-state svg {
  display: block;
  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: #929292;
}

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

.identity-dialog-note {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 12px 20px;
  border-top: 1px solid #2d2d2d;
  background: #0c0c0c;
}

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

.identity-dialog-note p {
  margin: 0;
  color: #808080;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
}

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

  .identity-dialog-header {
    grid-template-columns: minmax(0, 1fr) 40px;
    gap: 14px;
    min-height: 78px;
    padding: 14px 14px 14px 16px;
  }

  .identity-dialog-heading h2 {
    font-size: 17px;
  }

  .identity-option {
    grid-template-columns: 38px minmax(0, 1fr) 22px;
    gap: 12px;
    min-height: 74px;
    padding: 11px 14px 11px 16px;
  }

  .identity-option-avatar {
    width: 38px;
    height: 38px;
  }

  .identity-option-topline strong {
    font-size: 14px;
  }

  .identity-dialog-note {
    min-height: 44px;
    padding: 11px 16px;
  }
}

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