:root {
  --profile-bg: rgba(6, 12, 12, 0.72);
  --profile-panel: rgba(12, 20, 18, 0.9);
  --profile-panel-strong: rgba(18, 29, 26, 0.96);
  --profile-border: rgba(224, 190, 96, 0.34);
  --profile-border-soft: rgba(116, 216, 190, 0.18);
  --profile-gold: #e5c55c;
  --profile-mint: #74d8be;
  --profile-text: #f4f7ec;
  --profile-muted: rgba(226, 235, 222, 0.68);
}

#profileView .profile-panel:not(#profilePosts) {
  width: min(1460px, 100%);
  margin: 0 auto;
}

#profileView .profile-panel:not(#profilePosts) > .panel,
#profileView #profileWallet .wallet-page {
  position: relative;
}

#profileView .profile-panel:not(#profilePosts) > .panel::before,
#profileView #profileWallet .wallet-head::before,
#profileView #profileWallet .wallet-record-grid > .panel::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--profile-gold), var(--profile-mint));
  content: "";
  opacity: 0.9;
}

#profileView #profileBuys > .panel,
#profileView #profileVerify > .panel,
#profileView #profileWallet .wallet-head,
#profileView #profileWallet .wallet-record-grid > .panel {
  overflow: hidden;
  border: 1px solid var(--profile-border);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(229, 197, 92, 0.1), transparent 28%),
    linear-gradient(180deg, var(--profile-panel-strong), rgba(7, 13, 12, 0.94));
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.34);
}

#profileView #profileBuys .panel-header,
#profileView #profileVerify .panel-header,
#profileView #profileWallet .wallet-head {
  min-height: 86px;
  padding: 22px 26px;
  border-bottom: 1px solid rgba(224, 190, 96, 0.22);
  background:
    linear-gradient(90deg, rgba(34, 47, 40, 0.98), rgba(8, 15, 14, 0.96));
}

#profileView .profile-panel:not(#profilePosts) .panel-title {
  gap: 10px;
  font-size: 20px;
  letter-spacing: 0;
}

#profileView .profile-panel:not(#profilePosts) .panel-title svg {
  width: 22px;
  height: 22px;
  padding: 3px;
  border: 1px solid rgba(229, 197, 92, 0.38);
  border-radius: 6px;
  background: rgba(229, 197, 92, 0.12);
}

#profileView .profile-panel:not(#profilePosts) .profile-hint,
#profileView #profileWallet .wallet-head p,
#profileView .profile-panel:not(#profilePosts) .mini-note {
  max-width: 620px;
  margin: 6px 0 0;
  color: var(--profile-muted);
  font-size: 13px;
  line-height: 1.6;
}

#profileView #profileBuys .table-wrap,
#profileView #profileWallet .compact-wallet-table {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: rgba(5, 11, 11, 0.58);
}

#profileView #profileBuys table,
#profileView #profileWallet table {
  min-width: 860px;
}

#profileView #profileBuys th,
#profileView #profileWallet th {
  height: 44px;
  border-bottom: 1px solid rgba(116, 216, 190, 0.16);
  background: rgba(3, 9, 9, 0.78);
  color: #bff5e7;
  font-size: 12px;
}

#profileView #profileBuys td,
#profileView #profileWallet td {
  height: 56px;
  border-bottom: 1px solid rgba(224, 190, 96, 0.12);
}

#profileView #profileWallet .wallet-page {
  display: grid;
  gap: 16px;
}

#profileView #profileWallet .wallet-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
}

#profileView #profileWallet .wallet-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

#profileView #profileWallet .membership-pill {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(116, 216, 190, 0.28);
  border-radius: 999px;
  background: rgba(116, 216, 190, 0.12);
  color: #c8fff1;
}

#profileView #profileWallet .wallet-summary-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1.35fr) repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

#profileView #profileWallet .wallet-metric {
  position: relative;
  min-height: 138px;
  padding: 18px;
  border-color: var(--profile-border-soft);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(116, 216, 190, 0.11), transparent 42%),
    rgba(8, 15, 14, 0.88);
  box-shadow: none;
}

#profileView #profileWallet .wallet-metric::after {
  position: absolute;
  right: 14px;
  bottom: 12px;
  width: 42px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(229, 197, 92, 0.74));
  content: "";
}

#profileView #profileWallet .primary-metric {
  min-height: 288px;
  grid-row: span 2;
  border-color: rgba(229, 197, 92, 0.58);
  background:
    radial-gradient(circle at 82% 12%, rgba(229, 197, 92, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(39, 48, 36, 0.96), rgba(8, 14, 13, 0.96));
}

#profileView #profileWallet .wallet-metric span {
  color: rgba(226, 235, 222, 0.72);
  font-size: 12px;
  font-weight: 900;
}

#profileView #profileWallet .wallet-metric strong {
  margin-top: 12px;
  color: #fff8dc;
  font-size: 26px;
  line-height: 1;
}

#profileView #profileWallet .primary-metric strong {
  font-size: 44px;
}

#profileView #profileWallet .wallet-metric em {
  margin-top: auto;
  color: rgba(226, 235, 222, 0.58);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

#profileView #profileWallet .wallet-record-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

#profileView #profileWallet .wallet-record-grid > .panel {
  display: flex;
  min-width: 0;
  height: clamp(360px, 42vh, 500px);
  min-height: 0;
  flex-direction: column;
}

#profileView #profileWallet .wallet-record-grid > .panel .panel-header {
  flex: 0 0 auto;
}

#profileView #profileWallet .wallet-record-grid > .panel .compact-wallet-table {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
}

#profileView #profileWallet .wallet-record-grid > .panel table {
  min-width: 720px;
}

#profileView #profileWallet .wallet-withdrawal-panel {
  order: -1;
}

#profileView #profileWallet .coin-purchase-panel {
  grid-column: auto;
}

#profileView #profileVerify > .identity-bind-panel {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  min-height: 560px;
}

#profileView #profileVerify .panel-header {
  grid-row: span 2;
  align-content: start;
  border-right: 1px solid rgba(224, 190, 96, 0.22);
  border-bottom: 0;
  background:
    radial-gradient(circle at 28% 18%, rgba(116, 216, 190, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(31, 43, 38, 0.98), rgba(8, 15, 14, 0.96));
}

#profileView #profileVerify #identityStatusBadge {
  justify-self: start;
  margin-top: 18px;
}

#profileView #profileVerify #identityForm {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 22px;
  background: rgba(6, 12, 12, 0.44);
}

#profileView #profileVerify #identityForm .field,
#profileView #profileVerify #passwordForm .field,
#profileView #profileVerify .setting-row {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(116, 216, 190, 0.15);
  border-radius: 8px;
  background: rgba(3, 10, 10, 0.52);
}

#profileView #profileVerify #identityForm .field.full,
#profileView #profileVerify #identityForm button,
#profileView #profileVerify #identityForm .mini-note {
  grid-column: 1 / -1;
}

#profileView #profileVerify #identityForm input,
#profileView #profileVerify #passwordForm input {
  margin-top: 7px;
}

#profileView #profileVerify > .account-settings-panel {
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(360px, 0.95fr);
  margin-top: 16px;
}

#profileView #profileVerify .account-settings-panel .panel-header {
  grid-column: 1 / -1;
}

#profileView #profileVerify .settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 22px;
  border-right: 1px solid rgba(224, 190, 96, 0.18);
  background: rgba(5, 11, 11, 0.5);
}

#profileView #profileVerify .setting-row {
  display: grid;
  align-content: center;
  min-height: 86px;
}

#profileView #profileVerify .setting-row span {
  color: rgba(226, 235, 222, 0.62);
  font-size: 12px;
  font-weight: 900;
}

#profileView #profileVerify .setting-row strong {
  margin-top: 8px;
  color: #fff8dc;
  font-size: 15px;
  overflow-wrap: anywhere;
}

#profileView #profileVerify #passwordForm {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 22px;
  background: rgba(8, 15, 14, 0.68);
}

#profileView #profileVerify #passwordForm .field.full,
#profileView #profileVerify #passwordForm button,
#profileView #profileVerify #passwordForm .mini-note {
  grid-column: 1 / -1;
}

#profileView .profile-panel:not(#profilePosts) .button.primary {
  min-height: 42px;
}

@media (max-width: 1180px) {
  #profileView #profileWallet .wallet-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #profileView #profileWallet .primary-metric {
    min-height: 180px;
    grid-row: auto;
    grid-column: 1 / -1;
  }

  #profileView #profileVerify > .identity-bind-panel,
  #profileView #profileVerify > .account-settings-panel {
    grid-template-columns: 1fr;
  }

  #profileView #profileVerify .panel-header,
  #profileView #profileVerify .settings-grid {
    border-right: 0;
    border-bottom: 1px solid rgba(224, 190, 96, 0.18);
  }
}

@media (max-width: 760px) {
  #profileView .profile-panel:not(#profilePosts) {
    width: 100%;
  }

  #profileView #profileWallet .wallet-head,
  #profileView #profileWallet .wallet-summary-grid,
  #profileView #profileVerify #identityForm,
  #profileView #profileVerify .settings-grid {
    grid-template-columns: 1fr;
  }

  #profileView #profileWallet .wallet-record-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #profileView #profileWallet .wallet-head-actions {
    justify-content: stretch;
  }

  #profileView #profileWallet .wallet-head-actions > * {
    flex: 1 1 auto;
  }
}
