.me-menu .me-control [data-me-label] {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.me-menu .me-control [data-me-label]::after {
  content: "";
  width: 0.46rem;
  height: 0.46rem;
  flex: 0 0 auto;
  margin-top: -0.18rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  color: #8f8b82;
  transform: rotate(45deg);
  transition: transform 140ms ease, color 140ms ease;
}

.me-menu[open] .me-control [data-me-label]::after {
  margin-top: 0.18rem;
  transform: rotate(225deg);
}

.me-menu .me-control:hover [data-me-label]::after,
.me-menu .me-control:focus-visible [data-me-label]::after,
.me-menu[open] .me-control [data-me-label]::after {
  color: var(--theme-text-secondary);
}

.me-menu-panel {
  width: max-content;
  min-width: 15rem;
  max-width: min(18rem, calc(100vw - 2rem));
  padding: 0.45rem;
}

.me-menu-section {
  padding: 0.6rem;
}

.me-administration-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.5rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.55rem;
  color: var(--theme-accent);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.me-administration-link:hover,
.me-administration-link:focus-visible {
  background: rgba(232, 201, 134, 0.08);
  color: #f7dfaa;
}

.me-administration-link [aria-hidden="true"] {
  color: #8f8b82;
  font-size: 1rem;
}

.me-session-section {
  padding-bottom: 0.6rem;
}

.me-menu-panel .session-sign-out-action {
  width: auto;
  min-height: 0;
  justify-content: center;
  margin: 0;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--theme-text-secondary);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 650;
}

.me-menu-panel .session-sign-out-action:hover,
.me-menu-panel .session-sign-out-action:focus-visible {
  border-color: rgba(232, 201, 134, 0.24);
  background: rgba(255, 255, 255, 0.075);
  color: var(--theme-text);
}

.main-picker-sheet {
  padding-top: 1rem;
}

.main-picker-heading {
  align-items: center;
}

.main-picker-heading h2 {
  font-family: inherit;
  font-size: 1.15rem;
  letter-spacing: 0;
}

.main-picker-section {
  padding: 1rem 0;
}

.main-picker-section + .main-picker-section {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.main-picker-section h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.main-picker-section-copy {
  margin: 0.35rem 0 0.75rem;
  color: var(--theme-text-muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.main-picker-section .refresh-characters-action {
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
}

.main-picker-section-main {
  padding-bottom: 0;
}


.me-self-service {
  display: grid;
  gap: 1rem;
  width: min(100%, 52rem);
}

.me-self-service-card {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1.2rem, 4vw, 1.6rem);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  background: var(--theme-surface);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.18);
}

.me-self-service-card h2,
.me-self-service-card h3,
.me-self-service-card p {
  margin-top: 0;
}

.me-self-service-card h2 {
  margin-bottom: 0.45rem;
}

.me-self-service-card p:last-child {
  margin-bottom: 0;
}

.me-self-service-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
}

.me-self-service-avatar {
  width: 4.5rem;
  height: 4.5rem;
  border: 1px solid rgba(232, 201, 134, 0.35);
  border-radius: 50%;
  object-fit: cover;
}

.me-self-service-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.me-about-card {
  gap: 0;
}

.me-about-card .me-self-service-card-heading {
  padding-bottom: 1rem;
}

.me-about-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.me-about-field-copy h3 {
  margin-bottom: 0.2rem;
  font-size: 0.95rem;
}

.me-about-field-copy p {
  color: var(--theme-text-muted);
  font-size: 0.84rem;
}

.me-identity-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.me-identity-card-icon {
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(232, 201, 134, 0.32);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.me-identity-card-icon img,
.me-identity-card-icon .me-profile-icon-placeholder {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.me-identity-card-icon-edit {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: var(--theme-surface);
  color: var(--theme-accent);
  font-size: 0.7rem;
  font-weight: 800;
}

.me-identity-card-copy {
  min-width: 0;
  display: grid;
  gap: 0.25rem;
}

.me-identity-card-copy > [hidden] {
  display: none !important;
}

.me-identity-name-display {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.me-identity-name-display strong {
  overflow: hidden;
  font-size: 1.25rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-inline-edit {
  min-height: 0;
  padding: 0.2rem 0.4rem;
  border: 0;
  background: transparent;
  color: var(--theme-text-muted);
  font: inherit;
  font-size: 0.75rem;
  text-decoration: underline;
  cursor: pointer;
}

.me-inline-edit:hover,
.me-inline-edit:focus-visible {
  color: var(--theme-accent);
}

.me-identity-card-standing {
  color: var(--theme-text-muted);
  font-size: 0.84rem;
}

.me-display-name-form.me-display-name-form-inline {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 0.5rem;
}

.me-display-name-form-inline input {
  width: 100%;
}

.me-inline-edit-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.me-inline-edit-actions > button {
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0.5rem 0.7rem;
}

.me-display-name {
  color: var(--theme-text-secondary);
}

.me-display-name-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.me-display-name-form input {
  min-width: 0;
  width: 15rem;
}

.me-display-name-form .button-secondary {
  width: auto;
  flex: 0 0 auto;
}

.me-profile-icon-current,
.me-profile-icon-current img,
.me-profile-icon-placeholder {
  width: 3rem;
  height: 3rem;
  border-radius: 0.65rem;
}

.me-profile-icon-current {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.me-profile-icon-current img {
  display: block;
  object-fit: cover;
}

.me-profile-icon-placeholder {
  display: grid;
  place-items: center;
  color: var(--theme-text-muted);
}

.me-profile-icon-picker-sheet {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0;
}

.me-profile-icon-picker .main-picker-section-copy {
  margin-bottom: 1rem;
}

.me-profile-icon-form {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 1rem;
}

.me-profile-icon-choices {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.2rem 0.2rem 0.5rem;
}

.me-profile-icon-choice {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
}

.me-profile-icon-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.me-profile-icon-choice img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.me-profile-icon-choice:hover,
.me-profile-icon-choice:focus-within {
  border-color: rgba(232, 201, 134, 0.55);
}

.me-profile-icon-choice-selected,
.me-profile-icon-choice:has(input:checked) {
  border-color: var(--theme-accent);
  box-shadow: 0 0 0 2px rgba(232, 201, 134, 0.14);
}

.me-profile-icon-form > .button-primary {
  width: 100%;
  flex: 0 0 auto;
}


.me-default-character {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.me-default-character-avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  object-fit: cover;
}

.me-about-action {
  grid-column: 2;
  width: auto;
}

.me-characters-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.me-characters-heading > button {
  width: auto;
  flex: 0 0 auto;
}

.me-character-card-list {
  display: grid;
  gap: 0.65rem;
}

.me-character-card {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.025);
}

.me-character-card-main {
  border-color: rgba(124, 198, 141, 0.32);
  background: rgba(124, 198, 141, 0.055);
}

.me-character-card-portrait,
.me-character-card-placeholder {
  width: 3rem;
  height: 3rem;
  border-radius: 0.65rem;
}

.me-character-card-portrait {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.me-character-card-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.me-character-card-placeholder {
  display: grid;
  place-items: center;
  color: var(--theme-text-muted);
}

.me-character-card-copy {
  min-width: 0;
}

.me-character-card-heading {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.me-character-card-heading h3 {
  margin-bottom: 0.15rem;
  font-size: 1rem;
}

.me-character-card-copy p {
  margin-bottom: 0.1rem;
  color: var(--theme-text-secondary);
  font-size: 0.86rem;
}

.me-character-card-copy .me-character-card-context {
  color: var(--theme-text-muted);
  font-size: 0.78rem;
}

.me-character-card-badge {
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: rgba(124, 198, 141, 0.12);
  color: #a9dcb4;
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.me-self-service-destination {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.me-self-service-empty {
  color: var(--theme-text-muted);
}

@media (max-width: 36rem) {
  .me-identity-card {
    grid-template-columns: 4.5rem minmax(0, 1fr);
  }

  .me-display-name-form-inline {
    width: 100%;
  }

  .me-display-name-form-inline input {
    width: 100%;
  }

  .me-display-name-form:not(.me-display-name-form-inline) {
    align-items: stretch;
    flex-direction: column;
  }

  .me-display-name-form:not(.me-display-name-form-inline) input,
  .me-display-name-form:not(.me-display-name-form-inline) .button-secondary {
    width: 100%;
  }

  .me-about-field {
    grid-template-columns: 1fr;
  }

  .me-about-action {
    grid-column: 1;
    width: 100%;
  }

  .me-characters-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .me-characters-heading > button {
    width: 100%;
  }

  .me-self-service-summary {
    grid-template-columns: 1fr;
  }

  .me-self-service-actions {
    display: grid;
  }

  .me-self-service-actions > * {
    width: 100%;
  }

  .me-self-service-destination {
    grid-template-columns: 1fr;
  }

  .me-self-service-destination .button-secondary {
    width: 100%;
  }
}
