.market-profile {
  --profile-border: var(--market-line, #d8e0e5);
  --profile-ink: var(--market-ink, #1d2935);
  --profile-muted: var(--market-muted, #667482);
  --profile-blue: var(--market-blue, #28627c);
  --profile-teal: var(--market-teal, #317d78);
  --profile-soft: var(--market-soft, #f1f5f7);
  color: var(--profile-ink);
}

.market-profile__hero {
  align-items: center;
  background: linear-gradient(120deg, #fff 0%, #f2f7f8 100%);
  border: 1px solid var(--profile-border);
  border-radius: 12px;
  box-shadow: var(--market-shadow, 0 8px 22px rgba(29, 41, 53, .06));
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  padding: clamp(1.1rem, 3vw, 1.7rem);
}

.market-profile__avatar {
  background: #e5eef1;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 12px rgba(29, 41, 53, .12);
  flex: 0 0 auto;
  height: 5.2rem;
  object-fit: cover;
  width: 5.2rem;
}

.market-profile__avatar--initials {
  align-items: center;
  color: var(--profile-blue);
  display: inline-flex;
  font-size: 1.8rem;
  font-weight: 700;
  justify-content: center;
}

.market-profile__hero-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.market-profile__report-actions {
  align-items: center;
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: flex-end;
  margin-left: auto;
}

.market-profile__report-actions .btn {
  white-space: normal;
}

.market-profile__hero h1,
.market-profile__edit-header h1 {
  color: var(--profile-ink);
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 .35rem;
}

.market-profile__hero-copy > p:last-child,
.market-profile__edit-header > p:last-child {
  color: var(--profile-muted);
  line-height: 1.55;
  margin: 0;
  max-width: 42rem;
}

.market-profile__eyebrow {
  color: var(--profile-blue);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .09em;
  margin: 0 0 .35rem;
  text-transform: uppercase;
}

.market-profile__sections {
  display: grid;
  gap: 1.1rem;
}

.market-profile__card {
  background: #fff;
  border: 1px solid var(--profile-border);
  border-radius: 10px;
  box-shadow: var(--market-shadow, 0 8px 22px rgba(29, 41, 53, .06));
  margin-bottom: 1.1rem;
  padding: clamp(1rem, 2.5vw, 1.45rem);
}

.market-profile__section-heading {
  align-items: center;
  border-bottom: 1px solid #e8edef;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: .9rem;
}

.market-profile__section-heading h2 {
  color: var(--profile-ink);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
}

.market-profile__badge {
  background: #eaf1f4;
  border-radius: 999px;
  color: var(--profile-blue);
  flex: 0 0 auto;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  padding: .32rem .65rem;
  text-transform: uppercase;
}

.market-profile__badge--public {
  background: #e9f4f1;
  color: var(--profile-teal);
}

.market-profile__details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.market-profile__details > div {
  border-bottom: 1px solid #edf1f3;
  padding: .85rem .7rem .85rem 0;
}

.market-profile__details dt,
.market-profile__detail-label {
  color: var(--profile-muted);
  display: block;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .045em;
  margin-bottom: .28rem;
  text-transform: uppercase;
}

.market-profile__details dd {
  color: var(--profile-ink);
  font-size: .95rem;
  font-weight: 600;
  margin: 0;
  overflow-wrap: anywhere;
}

.market-profile__actions,
.market-profile__form-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: 1rem;
}

.market-profile__quiet-link {
  color: var(--profile-blue);
  display: inline-flex;
  font-size: .86rem;
  font-weight: 700;
  gap: .4rem;
  margin-top: 1rem;
  text-decoration: none;
}

.market-profile__quiet-link:hover {
  color: var(--profile-teal);
  text-decoration: underline;
}

.market-profile__public-details {
  display: grid;
  gap: .75rem 1.2rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1.2rem;
}

.market-profile__public-detail {
  background: #f8fafb;
  border: 1px solid #edf1f3;
  border-radius: 7px;
  min-width: 0;
  padding: .8rem .9rem;
}

.market-profile__public-detail--wide {
  grid-column: 1 / -1;
}

.market-profile__detail-value {
  color: var(--profile-ink);
  display: block;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.market-profile__audio {
  display: block;
  max-width: 100%;
  width: 26rem;
}

.market-profile__gallery-heading {
  align-items: baseline;
  display: flex;
  gap: .6rem;
  margin: 1rem 0 .65rem;
}

.market-profile__gallery-heading h3 {
  color: var(--profile-ink);
  font-size: .98rem;
  font-weight: 700;
  margin: 0;
}

.market-profile__gallery-heading span {
  color: var(--profile-muted);
  font-size: .78rem;
}

.market-profile__gallery {
  display: grid;
  gap: .7rem;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.market-profile__gallery-item {
  background: var(--profile-soft);
  border: 1px solid var(--profile-border);
  border-radius: 7px;
  margin: 0;
  overflow: hidden;
  position: relative;
}

.market-profile__gallery-item > a {
  display: block;
  height: 132px;
}

.market-profile__gallery-item img {
  height: 100%;
  object-fit: cover;
  transition: transform .2s ease;
  width: 100%;
}

.market-profile__gallery-item:hover img {
  transform: scale(1.035);
}

.market-profile__remove-photo {
  background: rgba(29, 41, 53, .82);
  border: 0;
  border-radius: 4px;
  bottom: .45rem;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: .3rem .55rem;
  position: absolute;
  right: .45rem;
}

.market-profile__empty,
.market-profile__hint {
  color: var(--profile-muted);
  font-size: .88rem;
  line-height: 1.55;
}

.market-profile__public-links {
  border-top: 1px solid #e8edef;
  display: flex;
  flex-wrap: wrap;
  gap: .7rem 1.2rem;
  margin-top: 1.1rem;
  padding-top: .9rem;
}

.market-profile__public-links a {
  color: var(--profile-blue);
  display: inline-flex;
  font-size: .84rem;
  font-weight: 700;
  gap: .4rem;
  text-decoration: none;
}

.market-profile__edit-header {
  margin: .25rem 0 1.1rem;
}

.market-profile__edit-header h1 {
  margin-bottom: .45rem;
}

.market-profile__form .market-profile__card {
  margin-bottom: .9rem;
}

.market-profile__form .market-profile__card .form-group:last-child {
  margin-bottom: 0;
}

.market-profile__form fieldset {
  min-width: 0;
}

.market-profile__form .form-text {
  color: var(--profile-muted);
  font-size: .78rem;
}

.market-profile__form input[type="file"] {
  max-width: 100%;
}

.market-profile__form input:disabled {
  background: #f1f4f5;
  color: var(--profile-muted);
  cursor: not-allowed;
}

.market-profile--public {
  margin: 1rem auto 3rem;
  max-width: 920px;
  padding: 0 1rem;
}

.market-profile--public .market-profile__card {
  margin-bottom: 0;
}

@media (max-width: 767.98px) {
  .market-profile__hero {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .market-profile__avatar {
    height: 4.2rem;
    width: 4.2rem;
  }

  .market-profile__hero-copy {
    flex-basis: calc(100% - 5.5rem);
  }

  .market-profile__report-actions {
    margin-left: auto;
  }

  .market-profile__details,
  .market-profile__public-details {
    grid-template-columns: 1fr;
  }

  .market-profile__public-detail--wide {
    grid-column: auto;
  }

  .market-profile__form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .market-profile__form-actions .btn {
    width: 100%;
  }
}
