:root {
  --profile-bg: #06100b;
  --profile-surface: #0b1911;
  --profile-surface-soft: #0f2117;
  --profile-border: rgba(178, 230, 197, 0.12);
  --profile-border-strong: rgba(178, 230, 197, 0.2);
  --profile-text: #eff7f1;
  --profile-muted: #82978a;
  --profile-green: #72e2a0;
  --profile-gold: #d9b96f;
  --profile-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.profile-page [hidden],
.members-page [hidden] {
  display: none !important;
}

[data-theme="light"] {
  --profile-bg: #f5f7f2;
  --profile-surface: #fffefa;
  --profile-surface-soft: #edf4ed;
  --profile-border: rgba(24, 82, 51, 0.11);
  --profile-border-strong: rgba(24, 82, 51, 0.19);
  --profile-text: #14271c;
  --profile-muted: #65776c;
  --profile-green: #0f7447;
  --profile-gold: #8f6717;
  --profile-shadow: 0 28px 70px rgba(27, 67, 44, 0.1);
}

.profile-page,
.members-page {
  min-height: 100vh;
  color: var(--profile-text);
  background:
    radial-gradient(circle at 87% 8%, rgba(67, 202, 124, 0.075), transparent 30rem),
    var(--profile-bg);
}

.profile-hero {
  position: relative;
  overflow: hidden;
  padding: 148px 0 0;
  border-bottom: 1px solid var(--profile-border);
  background:
    radial-gradient(circle at 78% 22%, rgba(73, 211, 131, 0.12), transparent 27rem),
    radial-gradient(circle at 7% 100%, rgba(218, 184, 106, 0.065), transparent 25rem),
    linear-gradient(135deg, #06100b, #09170f 56%, #07120c);
}

.profile-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(143, 216, 169, 0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 216, 169, 0.075) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(circle at 72% 30%, #000, transparent 67%);
}

.profile-hero-mesh {
  position: absolute;
  width: 620px;
  aspect-ratio: 1;
  right: -7%;
  top: -34%;
  border: 1px solid rgba(113, 223, 157, 0.08);
  border-radius: 50%;
  box-shadow:
    0 0 0 100px rgba(113, 223, 157, 0.023),
    0 0 0 210px rgba(113, 223, 157, 0.016);
  pointer-events: none;
}

.profile-hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr) max-content;
  align-items: center;
  gap: 36px;
  padding-bottom: 46px;
}

.profile-avatar-wrap {
  position: relative;
  width: 142px;
  height: 142px;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(153, 230, 183, 0.22);
  border-radius: 35%;
  color: #effbf3;
  background:
    radial-gradient(circle at 35% 28%, rgba(131, 240, 174, 0.2), transparent 32%),
    linear-gradient(145deg, #153524, #09150e);
  box-shadow:
    0 24px 55px rgba(0, 0, 0, 0.3),
    0 0 0 8px rgba(119, 226, 161, 0.035),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-family: var(--font-display);
  font-size: 3.8rem;
  font-weight: 500;
  letter-spacing: -0.06em;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.profile-avatar img[hidden],
.avatar-preview img[hidden] {
  display: none !important;
}

.profile-presence {
  position: absolute;
  right: 3px;
  bottom: 7px;
  width: 18px;
  height: 18px;
  border: 4px solid #09150e;
  border-radius: 50%;
  background: #63df98;
  box-shadow: 0 0 15px rgba(99, 223, 152, 0.55);
}

.profile-identity {
  min-width: 0;
}

.profile-overline {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #759083;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.profile-level {
  padding: 5px 8px;
  border: 1px solid rgba(218, 185, 111, 0.2);
  border-radius: 999px;
  color: #d8ba78;
  background: rgba(218, 185, 111, 0.055);
  letter-spacing: 0.08em;
}

.profile-identity h1 {
  margin: 11px 0 4px;
  overflow-wrap: anywhere;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5.5vw, 5rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.065em;
}

.profile-occupation {
  margin: 0;
  color: var(--profile-green);
  font-size: 0.88rem;
  font-weight: 600;
}

.profile-bio {
  max-width: 690px;
  margin: 16px 0 0;
  color: #a4b5aa;
  font-size: 0.96rem;
  line-height: 1.72;
}

.profile-contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 19px;
}

.profile-contact {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--profile-border);
  border-radius: 9px;
  color: #879c8f;
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.67rem;
  font-style: normal;
  text-decoration: none;
}

a.profile-contact:hover {
  color: var(--profile-green);
  border-color: rgba(114, 226, 160, 0.26);
}

.profile-actions {
  align-self: start;
}

.owner-actions {
  display: flex;
  gap: 8px;
}

.owner-actions[hidden],
.profile-action[hidden] {
  display: none !important;
}

.profile-action,
.profile-section-heading > button {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid var(--profile-border-strong);
  border-radius: 11px;
  color: var(--profile-text);
  background: rgba(255, 255, 255, 0.03);
  font: 600 0.73rem/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.profile-action:hover,
.profile-section-heading > button:hover {
  transform: translateY(-2px);
  border-color: rgba(114, 226, 160, 0.3);
}

.profile-action.primary {
  border-color: #70dfa0;
  color: #07160d;
  background: linear-gradient(145deg, #8aedb1, #57d88c);
}

.profile-stat-rail {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--profile-border);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  background: rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(16px);
}

.profile-stat-rail > div {
  min-height: 92px;
  display: grid;
  align-content: center;
  padding: 18px 24px;
  border-right: 1px solid var(--profile-border);
}

.profile-stat-rail > div:last-child {
  border-right: 0;
}

.profile-stat-rail strong {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
}

.profile-stat-rail span {
  margin-top: 7px;
  color: var(--profile-muted);
  font-size: 0.63rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.68fr);
  align-items: start;
  gap: 28px;
  padding-top: 64px;
  padding-bottom: 100px;
}

.profile-ledger,
.profile-activity {
  min-width: 0;
}

.profile-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.profile-section-heading.compact {
  align-items: start;
}

.profile-kicker {
  color: var(--profile-green);
  font-size: 0.6rem;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.profile-section-heading h2,
.profile-modal h2 {
  margin: 7px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.5vw, 3rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.055em;
}

.profile-section-intro {
  max-width: 710px;
  margin: 13px 0 24px;
  color: var(--profile-muted);
  font-size: 0.76rem;
  line-height: 1.62;
}

.trade-list {
  display: grid;
  gap: 10px;
}

.trade-card {
  display: grid;
  grid-template-columns: 54px minmax(150px, 1fr) minmax(280px, 0.92fr) max-content;
  align-items: center;
  gap: 17px;
  padding: 17px;
  border: 1px solid var(--profile-border);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.03), transparent),
    var(--profile-surface);
  box-shadow: 0 9px 28px rgba(0, 0, 0, 0.09);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.trade-card:hover {
  transform: translateY(-2px);
  border-color: var(--profile-border-strong);
  box-shadow: var(--profile-shadow);
}

.trade-kind {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 0.63rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.trade-kind.buy {
  color: #87e7ac;
  background: rgba(64, 204, 119, 0.09);
  box-shadow: inset 0 0 0 1px rgba(91, 218, 141, 0.12);
}

.trade-kind.sell {
  color: #f0b08a;
  background: rgba(230, 126, 71, 0.085);
  box-shadow: inset 0 0 0 1px rgba(232, 142, 94, 0.12);
}

.trade-asset {
  min-width: 0;
}

.trade-asset > span {
  color: var(--profile-green);
  font-size: 0.59rem;
  font-weight: 750;
  letter-spacing: 0.1em;
}

.trade-asset strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  font-size: 0.84rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-asset p {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--profile-muted);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-numbers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin: 0;
}

.trade-numbers dt {
  color: var(--profile-muted);
  font-size: 0.53rem;
  font-weight: 650;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.trade-numbers dd {
  margin: 5px 0 0;
  font-size: 0.69rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.trade-card > time {
  color: var(--profile-muted);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
}

.trade-card-tail {
  display: grid;
  justify-items: end;
  gap: 7px;
  color: var(--profile-muted);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
}

.trade-delete {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(225, 107, 99, 0.16);
  border-radius: 8px;
  color: #d98b86;
  background: rgba(225, 107, 99, 0.05);
  font: 600 0.59rem/1 var(--font-body);
  cursor: pointer;
}

.trade-private {
  display: inline-flex;
  margin-left: 7px;
  padding: 3px 5px;
  border-radius: 5px;
  color: var(--profile-muted);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.48rem;
}

.profile-empty {
  min-height: 210px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 30px;
  border: 1px dashed var(--profile-border-strong);
  border-radius: 18px;
  color: var(--profile-muted);
  text-align: center;
}

.profile-empty > span {
  color: var(--profile-green);
  font-size: 2rem;
}

.profile-empty strong {
  color: var(--profile-text);
  font-size: 0.9rem;
}

.profile-empty p {
  max-width: 380px;
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.55;
}

.profile-empty.compact {
  min-height: 130px;
}

.profile-thread-list {
  display: grid;
  gap: 9px;
  margin-top: 21px;
}

.profile-thread {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--profile-border);
  border-radius: 14px;
  color: inherit;
  background: var(--profile-surface);
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease;
}

.profile-thread:hover {
  transform: translateX(3px);
  border-color: var(--profile-border-strong);
}

.profile-thread-index {
  color: #587064;
  font-family: var(--font-display);
  font-size: 0.68rem;
}

.profile-thread > span:nth-child(2) {
  min-width: 0;
}

.profile-thread small {
  display: block;
  color: var(--profile-green);
  font-size: 0.49rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.profile-thread strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-thread em {
  display: block;
  margin-top: 6px;
  color: var(--profile-muted);
  font-size: 0.56rem;
  font-style: normal;
}

.profile-thread > i {
  color: var(--profile-green);
  font-size: 0.68rem;
  font-style: normal;
}

.profile-trust-card {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid rgba(218, 185, 111, 0.13);
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0, rgba(218, 185, 111, 0.08), transparent 45%),
    var(--profile-surface);
}

.profile-trust-card .profile-kicker {
  color: var(--profile-gold);
}

.profile-trust-card p {
  margin: 11px 0 0;
  color: var(--profile-muted);
  font-size: 0.68rem;
  line-height: 1.62;
}

.profile-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 8, 5, 0.76);
  backdrop-filter: blur(12px);
}

.profile-modal-backdrop[hidden] {
  display: none;
}

.profile-modal {
  position: relative;
  width: min(680px, 100%);
  max-height: calc(100dvh - 40px);
  padding: 32px;
  overflow-y: auto;
  border: 1px solid var(--profile-border-strong);
  border-radius: 24px;
  color: var(--profile-text);
  background:
    radial-gradient(circle at 92% 5%, rgba(74, 210, 129, 0.11), transparent 18rem),
    var(--profile-surface);
  box-shadow: 0 45px 120px rgba(0, 0, 0, 0.48);
}

.profile-modal-close {
  position: absolute;
  top: 17px;
  right: 17px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--profile-border);
  border-radius: 10px;
  color: var(--profile-muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 1.25rem;
  cursor: pointer;
}

.profile-modal-intro {
  margin: 12px 0 24px;
  color: var(--profile-muted);
  font-size: 0.77rem;
  line-height: 1.6;
}

.profile-modal form {
  display: grid;
  gap: 15px;
}

.profile-modal label {
  position: relative;
  display: grid;
  gap: 7px;
  color: var(--profile-muted);
  font-size: 0.66rem;
  font-weight: 650;
}

.profile-modal input,
.profile-modal textarea,
.profile-modal select {
  width: 100%;
  border: 1px solid var(--profile-border);
  border-radius: 11px;
  outline: none;
  color: var(--profile-text);
  background: rgba(255, 255, 255, 0.035);
  font: 500 0.82rem/1.45 var(--font-body);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.profile-modal input,
.profile-modal select {
  min-height: 45px;
  padding: 0 12px;
}

.profile-modal textarea {
  min-height: 100px;
  padding: 12px;
  resize: vertical;
}

.profile-modal input:focus,
.profile-modal textarea:focus,
.profile-modal select:focus {
  border-color: rgba(113, 223, 157, 0.45);
  box-shadow: 0 0 0 4px rgba(113, 223, 157, 0.07);
}

.profile-modal label > small {
  position: absolute;
  right: 9px;
  bottom: 8px;
  color: var(--profile-muted);
  font-size: 0.56rem;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.profile-form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.avatar-editor {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 15px;
  border: 1px solid var(--profile-border);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.025);
}

.avatar-editor-preview {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 31%;
  color: var(--profile-text);
  background: var(--profile-surface-soft);
  font-family: var(--font-display);
  font-size: 1.8rem;
}

.avatar-editor-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload-label {
  cursor: pointer;
}

.avatar-upload-label strong {
  color: var(--profile-text);
  font-size: 0.78rem;
}

.avatar-upload-label span {
  font-size: 0.61rem;
  font-weight: 500;
}

.avatar-upload-label input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.privacy-switch {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 11px !important;
  padding: 12px;
  border: 1px solid var(--profile-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.privacy-switch input {
  width: 18px;
  min-height: 18px;
}

.privacy-switch > span {
  display: grid;
  gap: 3px;
}

.privacy-switch strong {
  color: var(--profile-text);
  font-size: 0.71rem;
}

.privacy-switch small {
  color: var(--profile-muted);
  font-size: 0.58rem;
  font-weight: 500;
}

.profile-form-feedback {
  min-height: 18px;
  color: #e8948d;
  font-size: 0.68rem;
}

.profile-form-feedback.success {
  color: var(--profile-green);
}

.profile-submit {
  min-height: 47px;
  border: 1px solid #6edc9d;
  border-radius: 12px;
  color: #06150c;
  background: linear-gradient(145deg, #8cedb2, #55d78a);
  font: 700 0.78rem/1 var(--font-body);
  cursor: pointer;
  box-shadow: 0 13px 30px rgba(67, 207, 123, 0.14);
}

.profile-submit:disabled {
  opacity: 0.55;
  cursor: wait;
}

/* Member directory */
.members-hero {
  position: relative;
  overflow: hidden;
  padding: 158px 0 72px;
  border-bottom: 1px solid var(--profile-border);
  background:
    radial-gradient(circle at 75% 10%, rgba(74, 210, 129, 0.12), transparent 28rem),
    linear-gradient(135deg, #06100b, #09170f);
}

.members-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.17;
  background-image:
    linear-gradient(rgba(143, 216, 169, 0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 216, 169, 0.075) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: linear-gradient(to right, transparent, #000 60%, transparent);
}

.members-hero .container {
  position: relative;
  z-index: 1;
}

.members-hero h1 {
  margin: 14px 0 18px;
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 7vw, 6.5rem);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.065em;
}

.members-hero h1 span {
  color: var(--profile-green);
}

.members-hero p {
  max-width: 640px;
  color: #9bada2;
  font-size: 0.96rem;
  line-height: 1.65;
}

.member-search {
  max-width: 540px;
  min-height: 49px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 0 14px;
  border: 1px solid var(--profile-border-strong);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
}

.member-search > span {
  color: var(--profile-green);
}

.member-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--profile-text);
  background: transparent;
  font: 500 0.78rem/1 var(--font-body);
}

.member-directory {
  padding-top: 52px;
  padding-bottom: 100px;
}

.member-directory-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.member-directory-heading > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.member-directory-heading strong {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
}

.member-directory-heading span,
.member-directory-heading p {
  color: var(--profile-muted);
  font-size: 0.67rem;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.member-card {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 17px;
  border: 1px solid var(--profile-border);
  border-radius: 17px;
  color: inherit;
  background: var(--profile-surface);
  text-decoration: none;
  box-shadow: 0 7px 24px rgba(0, 0, 0, 0.075);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.member-card:hover {
  transform: translateY(-3px);
  border-color: var(--profile-border-strong);
  box-shadow: var(--profile-shadow);
}

.member-avatar {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 29%;
  color: var(--profile-text);
  background:
    radial-gradient(circle at 35% 28%, rgba(131, 240, 174, 0.18), transparent 33%),
    var(--profile-surface-soft);
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-card-copy {
  min-width: 0;
}

.member-level {
  color: var(--profile-green);
  font-size: 0.49rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.member-card h2 {
  margin: 4px 0 0;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-card p {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--profile-muted);
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-card-copy > div {
  display: flex;
  gap: 9px;
  margin-top: 9px;
  color: var(--profile-muted);
  font-size: 0.55rem;
}

.member-card > i {
  color: var(--profile-green);
  font-size: 0.7rem;
  font-style: normal;
}

[data-theme="light"] .profile-hero,
[data-theme="light"] .members-hero {
  background:
    radial-gradient(circle at 78% 18%, rgba(26, 149, 83, 0.09), transparent 27rem),
    radial-gradient(circle at 7% 100%, rgba(171, 120, 33, 0.055), transparent 25rem),
    linear-gradient(135deg, #fafbf7, #f1f6ef 58%, #f8f6ef);
}

[data-theme="light"] .profile-hero::before,
[data-theme="light"] .members-hero::before {
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(24, 92, 53, 0.065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 92, 53, 0.065) 1px, transparent 1px);
}

[data-theme="light"] .profile-avatar {
  color: #173023;
  border-color: rgba(24, 129, 72, 0.16);
  background:
    radial-gradient(circle at 35% 28%, rgba(38, 170, 95, 0.13), transparent 32%),
    #f7fbf5;
  box-shadow:
    0 23px 52px rgba(27, 67, 44, 0.13),
    0 0 0 8px rgba(22, 133, 73, 0.025);
}

[data-theme="light"] .profile-presence {
  border-color: #f5f8f2;
}

[data-theme="light"] .profile-bio,
[data-theme="light"] .members-hero p {
  color: #607469;
}

[data-theme="light"] .profile-contact {
  background: rgba(255, 255, 255, 0.58);
}

[data-theme="light"] .profile-action.primary,
[data-theme="light"] .profile-submit {
  border-color: #0e7547;
  color: #fff;
  background: linear-gradient(145deg, #198b57, #0c6b42);
}

[data-theme="light"] .profile-stat-rail {
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 17px 50px rgba(27, 67, 44, 0.065);
}

[data-theme="light"] .trade-card,
[data-theme="light"] .profile-thread,
[data-theme="light"] .profile-trust-card,
[data-theme="light"] .member-card {
  box-shadow: 0 8px 25px rgba(27, 67, 44, 0.045);
}

[data-theme="light"] .profile-modal-backdrop {
  background: rgba(18, 42, 28, 0.48);
}

[data-theme="light"] .profile-modal input,
[data-theme="light"] .profile-modal textarea,
[data-theme="light"] .profile-modal select,
[data-theme="light"] .privacy-switch,
[data-theme="light"] .avatar-editor {
  background: rgba(245, 249, 244, 0.86);
}

[data-theme="light"] .member-search {
  background: rgba(255, 255, 255, 0.66);
}

@media (max-width: 1050px) {
  .profile-hero-layout {
    grid-template-columns: 125px minmax(0, 1fr);
  }

  .profile-avatar-wrap {
    width: 125px;
    height: 125px;
  }

  .profile-actions {
    grid-column: 2;
  }

  .member-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .trade-card {
    grid-template-columns: 52px minmax(0, 1fr) max-content;
  }

  .trade-numbers {
    grid-column: 2 / -1;
  }

  .profile-activity {
    margin-top: 20px;
  }
}

@media (max-width: 680px) {
  .profile-hero {
    padding-top: 112px;
  }

  .profile-hero-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding-bottom: 32px;
  }

  .profile-avatar-wrap {
    width: 86px;
    height: 86px;
  }

  .profile-avatar {
    font-size: 2.6rem;
  }

  .profile-identity h1 {
    font-size: clamp(2rem, 9.5vw, 3rem);
    overflow-wrap: anywhere;
  }

  .profile-actions {
    grid-column: 1 / -1;
  }

  .owner-actions {
    width: 100%;
  }

  .profile-action {
    flex: 1;
  }

  .profile-stat-rail {
    grid-template-columns: repeat(2, 1fr);
  }

  .profile-stat-rail > div:nth-child(2) {
    border-right: 0;
  }

  .profile-stat-rail > div:nth-child(-n+2) {
    border-bottom: 1px solid var(--profile-border);
  }

  .profile-content-grid {
    padding-top: 46px;
  }

  .trade-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .trade-kind {
    width: 48px;
    height: 48px;
  }

  .trade-card > time {
    grid-column: 2;
  }

  .trade-card-tail {
    grid-column: 2;
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-items: start;
  }

  .trade-numbers {
    grid-column: 1 / -1;
    padding-top: 12px;
    border-top: 1px solid var(--profile-border);
  }

  .profile-form-grid,
  .profile-form-grid.three {
    grid-template-columns: 1fr;
  }

  .profile-modal {
    padding: 27px 19px 21px;
    border-radius: 20px;
  }

  .members-hero {
    padding: 126px 0 58px;
  }

  .members-hero h1 {
    font-size: clamp(3rem, 14vw, 4.5rem);
  }

  .member-grid {
    grid-template-columns: 1fr;
  }

  .member-directory-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .profile-hero-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .profile-avatar-wrap {
    width: 76px;
    height: 76px;
  }

  .profile-overline {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .profile-stat-rail > div {
    min-height: 82px;
    padding: 15px;
  }

  .profile-stat-rail strong {
    font-size: 1.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .trade-card,
  .profile-thread,
  .member-card,
  .profile-action {
    transition: none !important;
  }
}
