.profile-container {
  width: min(var(--shell-width), calc(100% - var(--shell-gutter)));
  margin-inline: auto;
}

.site-section {
  padding-block: 36px;
}

.section-heading {
  margin: 0 0 18px;
  font-size: 1.35rem;
}

.profile-hero {
  position: relative;
  overflow: hidden;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent-soft) 65%, transparent 35%), transparent 36%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, white 4%), color-mix(in srgb, var(--surface) 90%, black 10%));
  box-shadow: var(--shadow);
}

.profile-hero--has-banner {
  padding-top: 170px;
}

.profile-banner {
  position: absolute;
  inset: 0 0 auto;
  height: 260px;
  overflow: hidden;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent 28%);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent-strong) 24%, transparent 76%), transparent 72%),
    color-mix(in srgb, var(--surface) 84%, var(--accent) 16%);
  pointer-events: auto;
}

.profile-banner__link,
.profile-avatar__link {
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.profile-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.96;
  filter: saturate(0.9) contrast(1.05);
}

.profile-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding-block: 44px;
}

.profile-avatar {
  display: grid;
  width: 104px;
  height: 104px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--accent-strong), var(--accent));
  color: #fff7ef;
  font-size: 44px;
  font-weight: 700;
}

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

.profile-heading h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
}

.profile-check {
  display: inline-grid;
  width: 0.78em;
  height: 0.78em;
  place-items: center;
  vertical-align: 0.08em;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 0.48em;
  line-height: 1;
}

.profile-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, var(--accent) 12%);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.profile-badge--verified {
  border-color: color-mix(in srgb, #2563eb 55%, var(--border) 45%);
  background: color-mix(in srgb, #2563eb 18%, var(--surface) 82%);
}

.profile-badge--premium {
  border-color: color-mix(in srgb, #b45309 55%, var(--border) 45%);
  background: color-mix(in srgb, #f59e0b 20%, var(--surface) 80%);
}

.profile-status {
  max-width: 680px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--surface) 88%, var(--accent) 12%);
  color: var(--ink);
  font-weight: 700;
}

.profile-bio {
  max-width: 680px;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 1.05rem;
}

.profile-headline {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
}

.profile-pronouns {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 600;
}

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

.profile-stats div {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 92%, white 8%);
}

.profile-stats dt {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.profile-stats dd {
  margin: 6px 0 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 18px;
  color: var(--muted);
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.profile-directory-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 24px;
  align-items: start;
}

.profile-search {
  display: grid;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, white 8%);
}

.profile-search__row {
  display: flex;
  gap: 10px;
}

.profile-search input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

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

.profile-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, white 6%);
  color: inherit;
  text-decoration: none;
}

.profile-card:hover {
  border-color: var(--accent-soft);
}

.profile-card__avatar {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--accent-strong), var(--accent));
  color: #fff7ef;
  font-size: 28px;
  font-weight: 700;
}

.profile-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-card__body {
  display: grid;
  gap: 4px;
}

.profile-card__body span,
.profile-card__headline,
.profile-card__stats {
  color: var(--muted);
  font-size: 0.95rem;
}

.profile-card__pronouns {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.profile-card__skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--accent-soft) 55%, var(--border) 45%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, white 12%);
  color: var(--ink);
  font-size: 0.8rem;
  line-height: 1.2;
}

.activity-list {
  display: grid;
  gap: 12px;
}

.activity-link {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: inherit;
  text-decoration: none;
}

.activity-link:hover {
  border-color: var(--accent-soft);
}

.activity-link__source {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: capitalize;
}

.activity-link__title {
  font-weight: 700;
}

.activity-link__excerpt,
.empty-state {
  color: var(--muted);
}

.edit-shell {
  max-width: 1120px;
}

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

.profile-form label {
  font-weight: 700;
}

.profile-form textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.profile-form input,
.profile-form select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.form-error {
  padding: 12px;
  border: 1px solid #b42318;
  border-radius: var(--radius);
  color: #b42318;
}

.profile-media-shell {
  gap: 18px;
}

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

.media-upload-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--surface) 94%, white 6%), color-mix(in srgb, var(--surface) 88%, var(--accent-soft) 12%));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.media-upload-card__preview {
  display: grid;
  place-items: center;
  min-height: 180px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 80%, var(--accent-soft) 20%);
  border-radius: calc(var(--radius) - 6px);
  background:
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--accent-soft) 45%, transparent 55%), transparent 40%),
    color-mix(in srgb, var(--surface) 92%, white 8%);
}

.media-upload-card__empty-preview {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.media-upload-card__canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.media-upload-card__body {
  display: grid;
  gap: 10px;
}

.media-upload-card__heading h3 {
  margin: 0;
}

.media-upload-card__heading .eyebrow {
  margin: 0 0 4px;
}

.field-label,
.field-toggle {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
}

.field-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.field-label input[type="file"],
.field-label input[type="range"],
.field-label select {
  width: 100%;
}

.field-toggle {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.media-upload-card__hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.profile-media-sections {
  display: grid;
  gap: 18px;
}

.profile-media-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, white 6%);
}

.profile-media-section__heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.profile-media-section__heading h3 {
  margin: 0;
}

.profile-media-section__copy {
  margin: 0;
  color: var(--muted);
}

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

.profile-media-tile {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, white 6%);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.profile-media-tile--pinned {
  border-color: var(--accent-soft);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.08);
}

.profile-media-tile__preview {
  display: block;
  overflow: hidden;
  border-radius: calc(var(--radius) - 8px);
  background: color-mix(in srgb, var(--surface) 88%, var(--accent-soft) 12%);
  aspect-ratio: 16 / 9;
}

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

.profile-media-tile--avatar .profile-media-tile__preview {
  aspect-ratio: 1 / 1;
}

.profile-media-tile--banner .profile-media-tile__preview {
  aspect-ratio: 3 / 1;
}

.profile-media-tile__body {
  display: grid;
  gap: 8px;
}

.profile-media-tile__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.media-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 90%, white 10%);
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.media-badge--state {
  color: var(--ink);
}

.media-badge--accent {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border) 60%);
  background: color-mix(in srgb, var(--accent-soft) 52%, var(--surface) 48%);
  color: var(--accent-strong);
}

.media-badge--size {
  text-transform: none;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.profile-media-tile__title {
  margin: 0;
  font-weight: 700;
}

.profile-media-tile__note {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.profile-media-tile__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.profile-media-tile__actions form {
  margin: 0;
}

.profile-media-crop-dialog {
  width: min(760px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.profile-media-crop-dialog::backdrop {
  background: rgba(15, 23, 42, 0.56);
}

.profile-media-crop-dialog .media-upload-card__preview {
  min-height: 260px;
}

.profile-media-crop-dialog form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.notification-settings {
  display: grid;
  gap: 14px;
  margin-top: 12px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, white 8%);
}

.notification-settings__row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.profile-form--compact {
  margin-top: 0;
}

.form-success {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, #15803d 45%, var(--border) 55%);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, #22c55e 14%, var(--surface) 86%);
  color: var(--ink);
  font-weight: 700;
}

.security-feedback {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 700;
}

.security-feedback--error {
  border-color: #7a1f1f;
  background: color-mix(in srgb, #7a1f1f 12%, var(--surface) 88%);
}

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

.security-method {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 94%, white 6%);
}

.security-method__copy {
  display: grid;
  gap: 6px;
}

.security-method h3,
.security-method p {
  margin: 0;
}

.security-method p,
.security-method__status {
  color: var(--muted);
}

.security-method__status {
  font-size: 0.9rem;
  font-weight: 700;
}

.security-method__status--muted {
  font-weight: 600;
}

.relationship-list {
  display: grid;
  gap: 12px;
}

.relationship-list__row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 94%, white 6%);
}

.relationship-list__copy {
  display: grid;
  gap: 4px;
}

.relationship-list__copy a {
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}

.relationship-list__copy a:hover {
  text-decoration: underline;
}

.relationship-list__copy span,
.relationship-list__copy p {
  color: var(--muted);
}

.relationship-list__copy p {
  margin: 0;
}

.reminders-shell {
  max-width: 1100px;
}

.reminders-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.reminder-list {
  display: grid;
  gap: 12px;
}

.reminder-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 94%, white 6%);
}

.reminder-row__copy {
  display: grid;
  gap: 6px;
}

.reminder-row__copy p {
  margin: 0;
  color: var(--muted);
}

.action-link--danger {
  background: #7a1f1f;
  border-color: #7a1f1f;
  color: #fff;
}

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

  .profile-directory-hero,
  .profile-grid,
  .reminders-grid {
    grid-template-columns: 1fr;
  }

  .profile-search__row {
    flex-direction: column;
  }

  .profile-stats {
    grid-template-columns: 1fr;
  }

  .profile-media-upload-grid,
  .profile-media-grid,
  .security-method-grid {
    grid-template-columns: 1fr;
  }

  .security-method {
    flex-direction: column;
  }

  .profile-media-section__heading {
    flex-direction: column;
  }

  .profile-hero--has-banner {
    padding-top: 120px;
  }

  .profile-banner {
    height: 180px;
  }
}
