.profile-page {
  margin: 20px 36px 60px;
  min-height: calc(100vh - 220px);
}

.profile-page #a-show {
  max-width: 100%;
}

.profile-registration-success {
  background: var(--emalm-ui-success-bg);
  border: 1px solid var(--emalm-ui-success-border);
  border-radius: 6px;
  color: var(--emalm-ui-success-text);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  line-height: 1.4;
  margin: 0 0 14px;
  max-width: 860px;
  padding: 10px 12px;
}

.profile-registration-success strong {
  font-weight: 700;
}

.profile-user-header {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  margin: 0 0 10px;
  max-width: 100%;
}

.profile-avatar {
  background: var(--emalm-ui-surface-1) center/cover no-repeat;
  border: 1px solid var(--emalm-ui-border);
  border-radius: 50%;
  flex: 0 0 auto;
  height: 64px;
  width: 64px;
}

.profile-avatar-link {
  border-radius: 50%;
  color: inherit;
  display: inline-flex;
  flex: 0 0 auto;
  text-decoration: none;
}

.profile-avatar-link:hover .profile-avatar {
  border-color: var(--emalm-ui-accent);
}

.profile-user-header-body {
  flex: 1 1 auto;
  max-width: 920px;
  min-width: 0;
  padding-top: 2px;
}

.profile-user-header h1 {
  font-size: 28px;
  line-height: 1.12;
  margin: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.profile-user-header h1 a {
  text-decoration: none;
}

.profile-description {
  line-height: 1.45;
  margin-top: 6px;
  max-width: 760px;
  overflow-wrap: anywhere;
}

.profile-bio {
  line-height: 1.45;
  margin-top: 8px;
  max-width: 760px;
  min-width: 0;
}

.profile-bio-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-bottom: 8px;
  min-width: 0;
}

.profile-bio-chip {
  align-items: baseline;
  background: color-mix(in srgb, var(--emalm-ui-surface-2) 74%, transparent);
  border: 1px solid var(--emalm-ui-border);
  border-radius: 999px;
  display: inline-flex;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  padding: 3px 9px;
}

.profile-bio-label {
  color: var(--emalm-ui-text-muted);
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.profile-bio-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-bio-about {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-bio-about :first-child {
  margin-top: 0;
}

.profile-bio-about :last-child {
  margin-bottom: 0;
}

.profile-summary-layout {
  align-items: start;
  display: grid;
  gap: 18px 24px;
  grid-template-columns: minmax(320px, max-content) minmax(420px, 1fr);
  margin: 0 0 12px;
  max-width: 1320px;
}

.profile-summary-layout-main,
.profile-summary-layout-side {
  min-width: 0;
}

.profile-summary-layout .profile-overview {
  margin: 0;
}

.profile-summary-layout .profile-overview-table {
  max-width: none;
}

.profile-summary-layout .emalm-profile-insights {
  --insights-bg: transparent;
  --insights-panel: transparent;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--emalm-ui-border);
  border-radius: 0;
  margin: 0;
  max-width: none;
  padding: 0 0 0 20px;
}

.profile-summary-layout .emalm-profile-insights .emalm-insights-header {
  margin-bottom: 8px;
}

.profile-summary-layout .emalm-profile-insights .emalm-insights-header h2 {
  font-size: 16px;
}

.profile-summary-layout .emalm-profile-insights .emalm-insights-header p,
.profile-summary-layout .emalm-profile-insights .emalm-insights-summary-label {
  color: var(--emalm-ui-text-muted);
}

.profile-summary-layout .emalm-profile-insights .emalm-insights-summary-grid {
  grid-template-columns: repeat(2, minmax(120px, 1fr));
}

.profile-summary-layout .emalm-profile-insights .emalm-insights-summary-card {
  border-color: var(--emalm-ui-border);
  border-radius: 0;
  min-height: 0;
  padding: 6px 0;
}

.profile-summary-layout .emalm-profile-insights .emalm-insights-summary-card:hover {
  border-color: var(--emalm-ui-accent);
}

.profile-summary-layout .emalm-profile-insights .emalm-insights-heatmap {
  max-width: 100%;
}

.profile-overview {
  background: transparent;
  border: 0;
  margin: 0 0 10px;
}

.profile-overview h2 {
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 2px;
  padding: 0;
}

.profile-overview-table {
  background: transparent;
  border-collapse: collapse;
  margin: 0;
  max-width: 860px;
  width: auto;
}

.profile-overview-table th,
.profile-overview-table td {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--emalm-ui-border);
  line-height: 1.35;
  padding: 3px 8px;
  vertical-align: top;
}

.profile-overview-table tr:nth-child(even) th,
.profile-overview-table tr:nth-child(even) td {
  background: transparent;
}

.profile-overview-table th {
  font-weight: 700;
  min-width: 170px;
  text-align: right;
  white-space: nowrap;
}

.profile-overview-table td {
  text-align: left;
}

.profile-overview-table tr.profile-stat-pending th,
.profile-overview-table tr.profile-stat-pending td {
  background: color-mix(in srgb, var(--emalm-ui-warning-bg) 58%, var(--card-background-color, var(--emalm-ui-surface-1)) 42%);
}

.profile-overview-table tr.profile-stat-pending th {
  box-shadow: inset 4px 0 var(--emalm-ui-accent);
}


.profile-overview .user-statistics {
  background: transparent;
  border-collapse: collapse;
  margin: 0;
  max-width: 860px;
  width: auto;
}

.profile-overview .user-statistics th,
.profile-overview .user-statistics td {
  background: transparent !important;
  border: 0;
  line-height: 1.35;
  padding: 3px 8px;
  vertical-align: top;
}

.profile-overview .user-statistics tr:nth-child(even) th,
.profile-overview .user-statistics tr:nth-child(even) td {
  background: transparent !important;
}

.profile-overview .user-statistics th {
  font-weight: 700;
  min-width: 170px;
  text-align: right;
  white-space: nowrap;
}

.profile-overview .user-statistics td {
  text-align: left;
}

.profile-pending-badge {
  background: var(--emalm-ui-accent);
  border-radius: 3px;
  color: var(--emalm-ui-accent-text);
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  margin-left: 6px;
  padding: 2px 5px;
  vertical-align: 1px;
}

.profile-muted {
  color: var(--emalm-ui-text-muted);
}

.profile-recent {
  clear: both;
  margin: 12px 0 24px;
}

.profile-recent h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px;
}

.profile-recent h2 a {
  text-decoration: none;
}

.profile-recent-gallery {
  max-width: 100%;
}

.profile-recent-posts-row {
  align-items: end;
  padding-bottom: 6px;
}

@media (max-width: 980px) {
  .profile-summary-layout {
    grid-template-columns: 1fr;
  }

  .profile-summary-layout .emalm-profile-insights {
    border-left: 0;
    border-top: 1px solid var(--emalm-ui-border);
    padding: 14px 0 0;
  }

  .profile-summary-layout .emalm-profile-insights .emalm-insights-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }
}

@media (max-width: 767px) {
  .profile-page {
    margin: 14px 12px 40px;
  }

  .profile-summary-layout .emalm-profile-insights .emalm-insights-summary-grid {
    grid-template-columns: 1fr;
  }

  .profile-user-header {
    align-items: center;
  }

  .profile-user-header-body {
    max-width: calc(100vw - 92px);
  }

  .profile-avatar {
    height: 52px;
    width: 52px;
  }

  .profile-user-header h1 {
    font-size: 24px;
  }

  .profile-overview-table {
    width: 100%;
  }

  .profile-overview-table th,
  .profile-overview-table td {
    display: block;
    padding-left: 0;
    padding-right: 0;
    width: auto;
  }

  .profile-overview-table th {
    min-width: 0;
    padding-bottom: 0;
    text-align: left;
  }

  .profile-overview-table td {
    padding-top: 0;
  }
}
