.user-profile {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1rem 0 3rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.user-profile > article {
  margin-bottom: 0;
}

.user-profile__nav,
.user-profile__toolbar,
.user-profile__toolbar-group,
.user-profile__toolbar-actions,
.user-profile__card-actions,
.user-profile__portfolio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.user-profile__nav,
.user-profile__toolbar {
  gap: 0.75rem;
  justify-content: space-between;
  align-items: flex-end;
}

.user-profile__toolbar-group {
  gap: 0.75rem 1.25rem;
}

.user-profile__identity {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.user-profile__identity-text {
  min-width: 0;
  flex: 1 1 auto;
}

.user-profile__avatar-fallback {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--pico-primary-background);
  color: var(--pico-primary-inverse);
  flex: 0 0 auto;
  overflow: hidden;
}

.user-profile__avatar-fallback svg {
  width: 48%;
  height: 48%;
  display: block;
}

.user-profile__avatar-fallback svg path {
  fill: currentColor;
}

.user-profile__identity-text > h1 {
  margin: 0 0 0.35rem;
}

.user-profile__identity-text > p,
.user-profile__identity-text > small {
  margin: 0;
  opacity: 0.85;
}

.user-profile__identity-text > kbd {
  display: inline-block;
  margin-top: 0.5rem;
}

.user-profile__identity-text > kbd[data-muted] {
  opacity: 0.7;
}

.user-profile article.is-dimmed,
.user-profile .is-dimmed {
  opacity: 0.38;
}

.user-profile article > header {
  margin-bottom: 0.75rem;
}

.user-profile article > header h2 {
  margin: 0;
  flex: 1 1 auto;
  font-size: 1.15rem;
  white-space: normal;
  line-height: 1.3;
  height: auto;
}

.user-profile article > header form.button_to,
.user-profile article > header a[role="button"],
.user-profile article > header a.secondary,
.user-profile article > header button {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0.25rem 0.6rem;
  font-size: 0.85rem;
}

.user-profile article > header form.button_to button {
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 0;
  padding: 0.25rem 0.6rem;
  font-size: 0.85rem;
}

.user-profile__row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.user-profile__row:first-child {
  padding-top: 0;
}

.user-profile__row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.user-profile__row-main {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 auto;
}

.user-profile__row-main > div {
  min-width: 0;
}

.user-profile__row-main strong {
  display: block;
}

.user-profile__row-main .flag-list {
  margin-top: 0.4rem;
}

.user-profile__row-main > form,
.user-profile__row > form {
  flex: 0 0 auto;
  margin: 0;
}

.user-profile__row > form button,
.user-profile__row-main + form button {
  margin: 0;
  padding: 0.25rem 0.6rem;
  font-size: 0.85rem;
}

.user-profile__course-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0 0;
}

.user-profile__course-meta .flag-list {
  display: inline-flex;
  width: auto;
  margin: 0;
}

.user-profile__course-meta small {
  opacity: 0.85;
}

.user-profile__gig-view {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.user-profile__gig-view > div > p {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  opacity: 0.85;
}

.user-profile__gig-view .flag-list {
  margin: 0;
}

.user-profile__gig-form fieldset {
  margin: 0.75rem 0;
}

.user-profile [aria-label][data-balloon-pos]::after,
.user-profile [aria-label][data-balloon-pos]::before {
  max-width: min(18rem, calc(100vw - 2rem));
  white-space: normal;
  line-height: 1.35;
  text-align: left;
}

.user-profile__restricted {
  text-align: center;
  padding: 3rem 1rem;
}

.user-profile__contact-details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
}

.user-profile__contact-details dt {
  opacity: 0.75;
}

.user-profile__inline-form {
  margin-top: 0.5rem;
}

.user-profile__portfolio {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.user-profile__portfolio > li {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.user-profile__portfolio > li:last-child {
  border-bottom: 0;
}

.user-profile__portfolio-link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  text-decoration: none;
}

.user-profile__portfolio-link i {
  font-size: 1.25rem;
  width: 1.5rem;
  text-align: center;
}

.user-profile__portfolio-link strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.user-profile__portfolio-link small {
  opacity: 0.75;
}

.user-profile__portfolio-add {
  margin-top: 1rem;
}

.user-profile__portfolio-add h3 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

@media (max-width: 640px) {
  .user-profile__toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .user-profile__portfolio-link {
    grid-template-columns: auto 1fr;
  }

  .user-profile__portfolio-link small {
    grid-column: 2;
  }

  .user-profile [aria-label][data-balloon-pos][data-balloon-length="large"]::after {
    max-width: calc(100vw - 1.5rem);
  }
}
