.page-frame-profile-settings {
  width: min(1120px, 60vw, calc(100% - 32px));
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.profile-settings-page-redesign {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.profile-settings-page-redesign .profile-settings-sidebar {
  position: sticky;
  top: 104px;
  margin-top: 82px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.profile-settings-page-redesign .profile-settings-nav {
  display: grid;
  gap: 5px;
}

.profile-settings-page-redesign .profile-settings-nav-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.profile-settings-page-redesign .profile-settings-nav-item:hover,
.profile-settings-page-redesign .profile-settings-nav-item:focus-visible {
  color: var(--text);
  background: var(--hover-surface);
  outline: 0;
}

.profile-settings-page-redesign .profile-settings-nav-item.is-active {
  color: var(--accent-text);
}

.profile-settings-nav-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: currentColor;
  opacity: 0.62;
}

.profile-settings-nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-settings-page-redesign .profile-settings-nav-item.is-active .profile-settings-nav-icon {
  opacity: 1;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent) 36%, transparent));
}

.profile-settings-nav-copy {
  display: grid;
  gap: 4px;
}

.profile-settings-nav-copy strong {
  font-size: 0.96rem;
  line-height: 1.2;
}

.profile-settings-nav-copy small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.profile-settings-page-redesign .profile-settings-content {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.profile-settings-page-redesign .profile-settings-header {
  display: grid;
  gap: 6px;
  padding: 0 2px;
}

.profile-settings-page-redesign .profile-settings-header h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.profile-settings-page-redesign .profile-settings-header p {
  margin: 0;
  color: var(--muted);
}

.profile-settings-card {
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  padding: 24px;
}

body[data-theme="light"][data-page="profile-settings"] .profile-settings-card {
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: 0 16px 34px rgba(84, 64, 40, 0.08);
}

body[data-theme="light"][data-page="profile-settings"] .profile-settings-page-redesign .profile-settings-sidebar {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

body[data-theme="light"][data-page="profile-settings"] .profile-settings-card input,
body[data-theme="light"][data-page="profile-settings"] .profile-settings-card textarea,
body[data-theme="light"][data-page="profile-settings"] .profile-settings-card select,
body[data-theme="light"][data-page="profile-settings"] .profile-settings-static-field strong,
body[data-theme="light"][data-page="profile-settings"] .profile-settings-avatar-preview,
body[data-theme="light"][data-page="profile-settings"] .profile-upload-preview,
body[data-theme="light"][data-page="profile-settings"] .profile-language-card,
body[data-theme="light"][data-page="profile-settings"] .profile-password-toggle {
  background: var(--bg-soft);
  border-color: var(--border-color);
  color: var(--text);
}

body[data-theme="light"][data-page="profile-settings"] .profile-language-card:has(input:checked) {
  background: var(--bg-card);
  border-color: var(--accent);
}

body[data-theme="dark"][data-page="profile-settings"] .profile-settings-card,
body[data-theme="dark"][data-page="profile-settings"] .profile-settings-page-redesign .profile-settings-sidebar {
  background: var(--surface-panel);
  border-color: var(--panel-border);
}

body[data-theme="dark"][data-page="profile-settings"] .profile-settings-page-redesign .profile-settings-sidebar {
  background: transparent;
  border-color: transparent;
}

.profile-settings-card-flat {
  box-shadow: none;
}

.profile-settings-main-card {
  display: grid;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.profile-settings-section-block {
  display: grid;
  gap: 0;
}

.profile-settings-section-divider {
  margin-top: 26px;
  padding-top: 26px;
  border-top: 1px solid var(--panel-border);
}

.profile-settings-card-header {
  margin-bottom: 20px;
}

.profile-settings-card-header h3,
.profile-settings-media-row h4,
.profile-settings-choice-block h4 {
  margin: 0;
}

.profile-settings-media-row p,
.profile-settings-choice-block p {
  margin: 7px 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

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

.profile-settings-form-grid .field-shell-wide {
  grid-column: 1 / -1;
}

.profile-settings-static-field strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
  font-weight: 600;
}

.profile-settings-bio-field,
.profile-password-field {
  position: relative;
}

.profile-settings-bio-field small {
  position: absolute;
  right: 14px;
  bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.profile-password-field input {
  padding-right: 52px;
}

.profile-password-toggle {
  position: absolute;
  right: 10px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
  cursor: pointer;
}

.profile-password-toggle[aria-pressed="true"] {
  color: var(--text);
}

.profile-settings-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.profile-settings-list {
  display: grid;
  gap: 0;
}

.profile-settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 22px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--panel-border);
}

.profile-settings-row:last-child {
  border-bottom: 0;
}

.profile-settings-row span {
  display: grid;
  gap: 5px;
}

.profile-settings-row small {
  color: var(--muted);
  line-height: 1.4;
}

.profile-settings-row select {
  width: 100%;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: var(--bg-soft);
  color: var(--text);
  padding: 12px;
  font: inherit;
}

.profile-appearance-stack {
  display: grid;
  gap: 22px;
}

.profile-settings-media-row,
.profile-settings-choice-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 24px;
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--panel-border);
}

.profile-settings-choice-block:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.profile-settings-avatar-preview {
  justify-self: end;
  position: relative;
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  background: var(--bg-soft);
  color: var(--text);
  overflow: hidden;
  cursor: pointer;
}

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

.profile-settings-avatar-preview > span:last-child {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.profile-settings-media-row-banner .profile-upload-preview-banner {
  min-height: 150px;
}

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

.profile-language-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: var(--bg-soft);
  cursor: pointer;
}

.profile-language-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.profile-language-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--panel);
}

.profile-language-flag {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
}

.profile-language-card span:last-child {
  display: grid;
  gap: 2px;
}

.profile-language-card small,
.profile-settings-choice-block > small {
  color: var(--muted);
}

.profile-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.profile-meta-line span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.profile-meta-icon {
  flex: 0 0 auto;
}

body[data-page="profile-settings"] .profile-settings-page-redesign {
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 36px;
}

body[data-page="profile-settings"] .profile-settings-page-redesign .profile-settings-sidebar {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 0;
  margin-top: 82px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

body[data-page="profile-settings"] .profile-settings-page-redesign .profile-settings-nav {
  display: grid;
  gap: 5px;
}

body[data-page="profile-settings"] .profile-settings-page-redesign .profile-settings-nav-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
}

body[data-page="profile-settings"] .profile-settings-page-redesign .profile-settings-nav-item:hover,
body[data-page="profile-settings"] .profile-settings-page-redesign .profile-settings-nav-item:focus-visible {
  color: var(--text);
  background: var(--hover-surface);
}

body[data-page="profile-settings"] .profile-settings-page-redesign .profile-settings-nav-item.is-active {
  color: var(--accent-text);
}

body[data-page="profile-settings"] .profile-settings-page-redesign .profile-settings-nav-copy strong {
  color: currentColor;
}

body[data-page="profile-settings"] .profile-settings-page-redesign .profile-settings-nav-icon {
  color: currentColor;
}

body[data-page="profile-settings"] .profile-settings-page-redesign .profile-settings-main-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

@media (max-width: 980px) {
  .page-frame-profile-settings {
    width: min(100%, calc(100% - 20px));
  }

  .profile-settings-page-redesign,
  body[data-page="profile-settings"] .profile-settings-page-redesign {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .profile-settings-page-redesign .profile-settings-sidebar,
  body[data-page="profile-settings"] .profile-settings-page-redesign .profile-settings-sidebar {
    position: static;
    margin-top: 0;
  }

  body[data-page="profile-settings"] .profile-settings-page-redesign .profile-settings-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  body[data-page="profile-settings"] .profile-settings-page-redesign .profile-settings-nav::-webkit-scrollbar {
    display: none;
  }

  body[data-page="profile-settings"] .profile-settings-page-redesign .profile-settings-nav-item {
    flex: 0 0 auto;
    min-width: max-content;
    grid-template-columns: 18px auto;
  }

  .profile-settings-form-grid,
  .profile-settings-row,
  .profile-settings-media-row,
  .profile-settings-choice-block {
    grid-template-columns: 1fr;
  }

  .profile-settings-avatar-preview {
    justify-self: start;
  }

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