.profile-header {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.profile-avatar {
  width: 144px;
  height: 144px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.profile-avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--secondary);
  color: var(--secondary-text);
  font-size: 3rem;
  font-weight: 700;
}

.profile-header__details h1 {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
}

.profile-location {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.profile-bio {
  margin: 0.5rem 0;
  color: var(--text);
  white-space: pre-wrap;
}

.instrument-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.4rem 0;
}

.instrument-badge {
  display: inline-flex;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--secondary-text);
  font-size: 0.8rem;
  font-weight: 600;
}

/* A role from a program ("Associate Conductor"), not an instrument. */
.instrument-badge--role {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--secondary-text);
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.5rem 0;
}

.profile-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.checkbox-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.4rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
}

/* One caption field per file chosen in a multi-photo upload — see
   multi_photo_captions_controller.js. */
.photo-caption-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.photo-caption-list__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.photo-caption-list__item span {
  flex: 0 0 auto;
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
  color: var(--muted);
}

.photo-caption-list__item input[type="text"] {
  flex: 1 1 auto;
}

.checkbox-list__item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 400;
  color: var(--text);
}

.checkbox-list__item input {
  width: auto;
}

.video-links {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.video-embed {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg);
}

.video-embed__frame {
  position: relative;
  aspect-ratio: 16 / 9;
}

.video-embed__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-embed__description {
  padding: 0.6rem 0.85rem;
}

/* The account page's Email addresses section (accounts/_email_addresses). */
.email-addresses__list {
  list-style: none;
  margin: 0.5rem 0 1rem;
  padding: 0;
}

.email-addresses__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.email-addresses__address {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.email-addresses__badge {
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--border);
  color: var(--muted);
  font-size: 0.75rem;
}

.email-addresses__item--pending .email-addresses__badge {
  background: #fdf1d8;
  color: #8a5a00;
}

.email-addresses__verify {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.email-addresses__notifications {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.email-addresses__notifications label {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  overflow-wrap: anywhere;
}

.email-addresses__notifications input[type="submit"] {
  align-self: flex-start;
}

.email-addresses__heading {
  margin: 0;
  font-weight: 600;
}

/* The profile editor (accounts/edit): as wide as the dashboard (it also
   carries .dashboard-shell), the big grey section buttons in a sticky
   column on the left, one card per category on the right. */
.profile-editor__header h1 {
  margin: 0 0 0.25rem;
}

.profile-editor__header {
  margin-bottom: 1.5rem;
}

.profile-editor__layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.profile-editor__nav {
  position: sticky;
  top: 1rem;
}

/* The selected tab (see profile_tabs_controller.js) is white, like the
   card it shows; an inset outline rather than a border, so it's the same
   size as the grey ones. */
.profile-editor__nav .secondary-link.is-active {
  background: #ffffff;
  box-shadow: inset 0 0 0 1px var(--border);
}

.profile-editor__nav-divider {
  width: 100%;
  margin: 0.25rem 0;
  border: none;
  border-top: 1px solid var(--border);
}

/* align-content: start: a short tab's card keeps its own height inside
   the min-height profile_tabs_controller.js holds the column at. */
.profile-editor__sections {
  display: grid;
  gap: 1.5rem;
  align-content: start;
}

/* scroll-margin-top: a jump from the nav lands with the card's top edge
   visible rather than flush against the window. */
.profile-editor__section {
  display: grid;
  gap: 1.25rem;
  padding: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  scroll-margin-top: 1rem;
}

/* Beats the card's own display: grid (see the [hidden] note at the top
   of application.css). */
.profile-editor__section[hidden] {
  display: none;
}

.profile-editor__section h2 {
  margin: 0;
}

.profile-editor__subsection {
  display: grid;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  scroll-margin-top: 1rem;
}

.profile-editor__subsection h3,
.profile-editor__section > h3,
.profile-editor__section .email-addresses legend {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.profile-editor__section .email-addresses {
  margin: 0;
  padding: 0;
  border: none;
  scroll-margin-top: 1rem;
}

/* Short fields side by side, sharing each row's whole width; a
   .profile-editor__wide one (bio, name, website) takes a row of its own. */
.profile-editor__fields {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.profile-editor__fields > * {
  flex: 1 1 240px;
  min-width: 0;
}

.profile-editor__fields > .profile-editor__wide {
  flex-basis: 100%;
}

.profile-editor textarea,
.profile-editor select {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  font-size: 0.98rem;
  background: #ffffff;
  color: var(--text);
}

.profile-editor__inline-form select {
  width: auto;
  padding: 0.4rem 0.6rem;
}

.profile-editor__photo {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.profile-editor__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

/* Only the nav's grey buttons run full width; the ones inside a card
   (Add email, Add name, Update photo...) fit their text. */
.profile-editor__section .secondary-link,
.profile-editor__section .primary-button {
  width: auto;
  justify-self: start;
}

.profile-editor__row-main,
.profile-editor__inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

@media (max-width: 800px) {
  .profile-editor__layout {
    grid-template-columns: 1fr;
  }

  .profile-editor__nav {
    position: static;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .profile-editor__photo {
    flex-direction: column;
    align-items: flex-start;
  }
}
