.team-profile-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  overflow: hidden;
  box-sizing: border-box;
}

.team-profile-modal.is-open {
  display: flex;
}

.team-profile-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(var(--procounsel-primary-rgb, 25, 34, 58), 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.team-profile-modal__dialog {
  position: relative;
  width: min(1120px, calc(100vw - 28px));
  max-width: 100%;
  max-height: calc(100vh - 28px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  background: var(--procounsel-gray2, #ededed);
  box-shadow: 0 30px 90px rgba(var(--procounsel-black3-rgb, 0, 0, 0), 0.45);
  border: 1px solid rgba(var(--procounsel-white-rgb, 255, 255, 255), 0.78);
  box-sizing: border-box;
  font-family: var(--procounsel-font, "Plus Jakarta Sans", sans-serif);
}

.team-profile-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--procounsel-white, #fff);
  color: var(--procounsel-primary, #19223a);
  font-size: 26px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  box-shadow: 0 8px 24px rgba(var(--procounsel-black3-rgb, 0, 0, 0), 0.18);
}

.team-profile-modal__hero {
  position: relative;
  min-height: 190px;
  flex: 0 0 auto;
  padding: 24px 82px 24px 50px;
  background:
    radial-gradient(circle at 22% 18%, rgba(var(--procounsel-base-rgb, 199, 149, 74), 0.2), transparent 30%),
    linear-gradient(135deg, var(--procounsel-black, #0e0b06) 0%, var(--procounsel-primary, #19223a) 44%, #24304f 100%);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 26px;
  overflow: hidden;
}

.team-profile-modal__hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(var(--procounsel-white-rgb, 255, 255, 255), 0.08), transparent 46%);
  pointer-events: none;
}

.team-profile-modal__avatar {
  position: relative;
  z-index: 2;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 5px solid var(--procounsel-white, #fff);
  object-fit: cover;
  object-position: center 20%;
  background: var(--procounsel-white, #fff);
  box-shadow: 0 16px 34px rgba(var(--procounsel-black3-rgb, 0, 0, 0), 0.22);
  flex: 0 0 auto;
}

.team-profile-modal__hero-content {
  position: relative;
  z-index: 2;
  min-width: 0;
  flex: 1 1 auto;
  max-width: 760px;
}

.team-profile-modal__body {
  padding: 22px 32px 28px;
  color: var(--procounsel-primary, #19223a);
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.team-profile-modal__badge-wrap {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 10px;
  position: relative;
  z-index: 2;
}

.team-profile-modal__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(var(--procounsel-base-rgb, 199, 149, 74), 0.16);
  color: var(--procounsel-base, #c7954a);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(var(--procounsel-base-rgb, 199, 149, 74), 0.26);
}

.team-profile-modal__header {
  text-align: left;
  margin: 0;
}

.team-profile-modal__name {
  margin: 0;
  font-family: var(--procounsel-heading-font, "Marcellus", serif);
  font-size: clamp(32px, 3.8vw, 46px);
  line-height: 1.1;
  color: var(--procounsel-base, #c7954a);
  overflow-wrap: normal;
}

.team-profile-modal__role {
  margin: 8px 0 0;
  color: var(--procounsel-white, #fff);
  font-size: 18px;
  font-weight: 700;
}

.team-profile-modal__location {
  margin: 6px 0 0;
  color: rgba(var(--procounsel-white-rgb, 255, 255, 255), 0.76);
  font-size: 15px;
}

.team-profile-modal__grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
  min-width: 0;
}

.team-profile-modal__panel {
  background: var(--procounsel-white, #fff);
  border: 1px solid var(--procounsel-border-color, #d9d9d9);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 16px 38px rgba(var(--procounsel-primary-rgb, 25, 34, 58), 0.08);
  min-width: 0;
  overflow: hidden;
  height: 100%;
}

.team-profile-modal__panel--about {
  grid-column: 1 / -1;
  padding: 18px 22px;
  background: var(--procounsel-white, #fff);
  height: auto;
}

.team-profile-modal__panel--contact .team-profile-modal__info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.team-profile-modal__section-title {
  margin: 0 0 10px;
  font-size: 17px;
  line-height: 1.2;
  color: var(--procounsel-base, #c7954a);
  font-weight: 700;
  font-family: var(--procounsel-heading-font, "Marcellus", serif);
}

.team-profile-modal__text {
  margin: 0;
  color: var(--procounsel-text-dark, #7782A0);
  line-height: 1.65;
  font-size: 15px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.team-profile-modal__list {
  margin: 0;
  padding-left: 18px;
  color: var(--procounsel-text-dark, #7782A0);
  line-height: 1.6;
  font-size: 14px;
}

.team-profile-modal__info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 0;
}

.team-profile-modal__info {
  background: rgba(var(--procounsel-primary-rgb, 25, 34, 58), 0.06);
  border-radius: 14px;
  padding: 10px 12px;
  min-width: 0;
}

.team-profile-modal__info-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--procounsel-text, #838790);
  margin-bottom: 6px;
}

.team-profile-modal__info-value {
  color: var(--procounsel-primary, #19223a);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.team-profile-modal__info-value a {
  color: inherit;
  text-decoration: none;
}

.team-profile-modal__info-value a:hover {
  color: var(--procounsel-base, #c7954a);
}

.team-card__profile-btn {
  margin-top: 14px;
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--procounsel-base, #c7954a);
  color: var(--procounsel-white, #fff);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@media (max-width: 1199px) {
  .team-profile-modal__panel--contact .team-profile-modal__info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991px) {
  .team-profile-modal__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-profile-modal__panel--contact {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .team-profile-modal__dialog {
    border-radius: 22px;
    max-height: calc(100vh - 24px);
  }

  .team-profile-modal__hero {
    min-height: auto;
    padding: 28px 22px 26px;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 16px;
  }

  .team-profile-modal__body {
    padding: 18px 16px 22px;
  }

  .team-profile-modal__badge-wrap,
  .team-profile-modal__header {
    justify-content: center;
    text-align: center;
  }

  .team-profile-modal__name {
    font-size: 28px;
  }

  .team-profile-modal__grid,
  .team-profile-modal__info-grid {
    grid-template-columns: 1fr;
  }

  .team-profile-modal__panel--about {
    grid-column: auto;
    padding: 18px;
  }

  .team-profile-modal__panel--contact .team-profile-modal__info-grid {
    grid-template-columns: 1fr;
  }

  .team-profile-modal__avatar {
    width: 118px;
    height: 118px;
  }
}
