/* =========================================================
   4HE / USERINFO
   Profile page, profile activity, cover editor and settings
   ========================================================= */

/* =========================
   PROFILE PAGE
   ========================= */

.subsite-card.profile-page {
  display: grid;
  gap: 0;
  margin-bottom: 18px;
}

.subsite-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.subsite-card__body {
  padding: 0 20px 20px;
}

/* =========================
   COVER
   ========================= */

.subsite-cover-wrap {
  position: relative;
}

.subsite-cover {
  position: relative;
  min-height: 168px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 14% 22%, rgba(45, 123, 255, 0.22), transparent 26%),
    radial-gradient(circle at 82% 18%, rgba(155, 234, 60, 0.12), transparent 22%),
    radial-gradient(circle at 72% 82%, rgba(255, 138, 31, 0.12), transparent 24%),
    linear-gradient(135deg, var(--surface-2), var(--surface));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.theme-dark .subsite-cover {
  background:
    radial-gradient(circle at 14% 22%, rgba(45, 123, 255, 0.20), transparent 26%),
    radial-gradient(circle at 82% 18%, rgba(155, 234, 60, 0.08), transparent 22%),
    radial-gradient(circle at 72% 82%, rgba(255, 138, 31, 0.08), transparent 24%),
    linear-gradient(135deg, #273142, #20242b);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.subsite-cover__image {
  width: 100%;
  min-height: 168px;
  height: 100%;
}

.subsite-cover__actions {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
}

.subsite-cover__edit-btn {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.24);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    opacity 0.18s ease;
}

.subsite-cover__edit-btn:hover {
  background: rgba(17, 24, 39, 0.38);
}

.subsite-cover__edit-btn:active {
  transform: scale(0.985);
}

.subsite-cover__edit-btn--icon {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 14px;
}

.subsite-cover__edit-btn .i-svg {
  width: 17px;
  height: 17px;
}

/* =========================
   PROFILE HEADER
   ========================= */

.subsite-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-top: -52px;
}

.subsite-profile-main {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.subsite-avatar {
  flex: 0 0 auto;
}

.subsite-card__avatar {
  position: relative;
}

.subsite-avatar__frame {
  position: relative;
  width: 90px;
  height: 90px;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.subsite-avatar__image {
  width: 90px;
  height: 90px;
  display: block;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  border: 4px solid var(--surface) !important;
  background: var(--surface-2);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  outline: 0 !important;
}

.theme-dark .subsite-avatar__image {
  border-color: var(--surface) !important;
}

.subsite-profile-text {
  width: 100%;
  min-width: 0;
  margin-top: 14px;
}

.subsite-header-controls {
  flex: 0 0 auto;
  margin-top: 56px;
}

.subsite-header-controls__inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

/* =========================
   PROFILE ACTIONS
   ========================= */

.profile-action-wrap,
.profile-action-wrap .pm_button,
.profile-action-wrap .pm_link,
.profile-action-wrap a {
  min-height: 40px;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  line-height: 1;
}

.subsite-action-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 14px;
  flex: 0 0 auto;
}

.subsite-action-btn .i-svg {
  width: 16px;
  height: 16px;
}

.subsite-action-btn--pm {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
}

.subsite-action-btn--pm,
.subsite-action-btn--pm .pm_button,
.subsite-action-btn--pm .pm_link,
.subsite-action-btn--pm a {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 14px;
  font-size: 0 !important;
  line-height: 0;
}

.subsite-action-btn--pm .pm_button,
.subsite-action-btn--pm .pm_link,
.subsite-action-btn--pm a {
  position: relative;
  background: transparent;
  border: 0;
  color: transparent !important;
}

.subsite-action-btn--pm .pm_button::before,
.subsite-action-btn--pm .pm_link::before,
.subsite-action-btn--pm a::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 12px;
  border: 2px solid var(--text);
  border-radius: 4px;
  transform: translate(-50%, -50%);
}

.subsite-action-btn--pm .pm_button::after,
.subsite-action-btn--pm .pm_link::after,
.subsite-action-btn--pm a::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  border-left: 2px solid var(--text);
  border-bottom: 2px solid var(--text);
  transform: translate(-50%, -58%) rotate(-45deg);
}

/* =========================
   NAME / META
   ========================= */

.subsite-card__headline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.subsite-card__name-title {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.subsite-card__headline-icon {
  color: var(--accent-fire);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
}

.subsite-card__headline-status {
  color: var(--text-soft);
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 500;
}

.subsite-card__headline-status--online {
  color: var(--success);
}

.subsite-card__headline-status--offline {
  color: var(--text-soft);
}

.subsite-card__nickname {
  margin-top: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.45;
}

.subsite-card__nickname-copy {
  position: relative;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition:
    color 0.18s ease,
    opacity 0.18s ease;
}

.subsite-card__nickname-copy:hover {
  color: var(--text);
}

.subsite-card__nickname-copy .i-svg {
  width: 13px;
  height: 13px;
}

.subsite-card__nickname-toast {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  min-height: 30px;
  padding: 0 10px;
  white-space: nowrap;
  background: var(--text);
  color: #fff;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-4px);
  font-size: 12px;
  line-height: 30px;
  font-weight: 500;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.subsite-card__nickname-copy.is-copied {
  color: var(--accent-main);
}

.subsite-card__nickname-copy.is-copied .subsite-card__nickname-toast {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.subsite-card__info {
  margin-top: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.subsite-rating {
  min-height: 24px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

.subsite-rating--positive {
  color: var(--success);
}

.subsite-rating--negative {
  color: var(--danger);
}

.subsite-rating--plain {
  background: transparent !important;
}

.subsite-rating .i-svg {
  width: 15px;
  height: 15px;
}

.subsite-card__date,
.subsite-card__status {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

.subsite-card__status--online {
  color: var(--success);
}

.subsite-card__description {
  margin-top: 14px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.68;
  word-break: break-word;
}

.subsite-card__description p {
  margin: 0;
}

.subsite-card__description--profile {
  max-width: 620px;
  margin-top: 12px;
}

.subsite-card__description--empty {
  color: var(--text-soft);
}

.subsite-card__description--emptybox {
  padding: 14px 16px;
  background: var(--surface-2);
  border: 0;
  border-radius: 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.subsite-card__empty-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-fade);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.subsite-card__empty-icon .i-svg {
  width: 18px;
  height: 18px;
}

.subsite-card__empty-text {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
}

.subsite-card__inline-meta {
  margin-top: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

.subsite-card__inline-meta-item {
  white-space: nowrap;
}

.subsite-card__inline-meta-dot {
  width: 4px;
  height: 4px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--text-fade);
}

/* =========================
   PROFILE FEED CARD
   Карточки постов внутри профиля
   ========================= */

.profile-feed-card {
  position: relative;
  margin: 0 0 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-xs);
  overflow: visible;
}

.profile-feed-card:last-child {
  margin-bottom: 0;
}

.profile-feed-card__header {
  margin: 0 0 16px;
}

.profile-feed-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.profile-feed-card__meta {
  min-height: 34px;
  padding: 0 12px;
  background: var(--surface-2);
  border-radius: 999px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.profile-feed-card__title {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.24;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.profile-feed-card__title a {
  color: inherit;
  text-decoration: none;
}

.profile-feed-card__title a:hover {
  color: inherit;
  text-decoration: none;
}

.profile-feed-card__excerpt {
  margin: 0 0 14px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.58;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.profile-feed-card--video .profile-feed-card__excerpt {
  -webkit-line-clamp: 2;
}

.profile-feed-card__media {
  position: relative;
  min-height: 260px;
  max-height: var(--feed-media-max-h);
  margin: 0 0 14px;
  background: var(--surface-2);
  border-radius: 18px;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.profile-feed-card__media-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1.08);
  filter: blur(28px) saturate(1.05) brightness(0.9);
  opacity: 0.92;
  pointer-events: none;
}

.profile-feed-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.04),
      rgba(0, 0, 0, 0.10)
    );
  pointer-events: none;
}

.profile-feed-card__media-content {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-feed-card__image {
  width: auto;
  max-width: 100%;
  max-height: clamp(260px, 60vh, var(--feed-media-max-h));
  margin: 0 auto;
  display: block;
  object-fit: contain;
  box-shadow: none !important;
}

.profile-feed-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 0;
}

.profile-feed-card__stats,
.profile-feed-card__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-feed-card__actions {
  position: relative;
}

.profile-feed-card__action {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.profile-feed-card__action:hover {
  background: var(--surface-3);
  color: var(--text);
  text-decoration: none;
}

.profile-feed-card__action:active {
  transform: scale(0.98);
}

.profile-feed-card__action--icon,
.profile-feed-card__action--share {
  width: 34px;
  min-width: 34px;
  padding: 0;
}

.profile-feed-card__action.is-active,
.profile-feed-card__action[aria-label="В избранное"]:hover,
.profile-feed-card__action[aria-label="Убрать из избранного"]:hover {
  background: var(--accent-hot-soft);
  color: #6cae12;
  border-color: transparent;
}

.profile-feed-card__action--share:hover {
  color: var(--accent-main);
}

/* =========================
   PROFILE ACTIVITY
   ========================= */

.profile-activity-shell {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.profile-activity__control {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.profile-activity-nav {
  padding: 12px;
  overflow: visible;
}

.profile-activity__tabs {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
}

.profile-activity__tab {
  min-width: 0;
  flex: 1 1 0;
  min-height: 42px;
  padding: 0 14px;
  background: var(--surface-2);
  border: 0;
  border-radius: 14px;
  color: var(--text-soft);
  cursor: pointer;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  transition:
    background 0.26s ease,
    color 0.26s ease,
    transform 0.18s ease;
}

.profile-activity__tab:hover {
  background: var(--surface-3);
  color: var(--text);
}

.profile-activity__tab:active {
  transform: scale(0.985);
}

.profile-activity__tab .i-svg {
  width: 15px;
  height: 15px;
}

#profile-activity-posts:checked ~ .profile-activity-nav .profile-activity__tab--posts,
#profile-activity-comments:checked ~ .profile-activity-nav .profile-activity__tab--comments {
  background: var(--accent-main-soft);
  color: var(--accent-main);
}

.profile-activity-panels {
  position: relative;
  min-width: 0;
}

.profile-activity-panel {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    visibility 0.28s ease;
}

#profile-activity-posts:checked ~ .profile-activity-panels .profile-activity-panel--posts,
#profile-activity-comments:checked ~ .profile-activity-panels .profile-activity-panel--comments {
  position: relative;
  inset: auto;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.profile-activity-content {
  padding: 16px;
  overflow: hidden;
}

.profile-activity-action {
  display: flex;
}

.profile-activity__more-link {
  width: 100%;
}

.profile-activity__more-link a {
  position: relative;
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  background:
    radial-gradient(circle at top right, rgba(45, 123, 255, 0.10), transparent 42%),
    linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: 18px;
  color: transparent !important;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0 !important;
  line-height: 0 !important;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.profile-activity__more-link a:hover,
.profile-activity__more-link a:active {
  background:
    radial-gradient(circle at top right, rgba(45, 123, 255, 0.14), transparent 42%),
    linear-gradient(180deg, var(--surface), var(--surface-2));
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.profile-activity__more-link a::before {
  color: var(--text);
  display: inline-block;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.profile-activity__more-link a::after {
  content: "→";
  width: 28px;
  height: 28px;
  margin-left: 12px;
  background: var(--accent-main-soft);
  color: var(--accent-main);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
}

.profile-activity__more-link--posts a::before {
  content: "Все посты";
}

.profile-activity__more-link--comments a::before {
  content: "Все комментарии";
}

.profile-posts__list,
.profile-comments-list {
  display: grid;
  gap: 12px;
}

.profile-empty--activity {
  margin: 0;
  padding: 34px 24px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.profile-empty__title {
  margin: 0 0 6px;
  color: var(--text);
  text-align: center;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.profile-empty__text {
  max-width: 420px;
  margin: 0 auto;
  color: var(--text-soft);
  text-align: center;
  font-size: 14px;
  line-height: 1.55;
}

/* =========================
   PROFILE COVER MODAL
   ========================= */

.profile-cover-modal .auth-modal__panel {
  width: min(620px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 20px;
}

.profile-cover-modal .auth-modal__head {
  margin-bottom: 16px;
}

.profile-cover-editor {
  display: grid;
  gap: 16px;
}

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

.profile-cover-upload {
  min-height: 52px;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: 18px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 500;
  transition:
    background 0.18s ease,
    border-color 0.18s ease;
}

.profile-cover-upload:hover {
  background: var(--surface-3);
  border-color: var(--accent-main);
}

.profile-cover-preview {
  height: 220px;
  background: var(--surface-2);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.profile-cover-preview.has-image .profile-cover-preview__empty {
  display: none;
}

.profile-cover-preview__empty {
  padding: 16px;
  color: var(--text-fade);
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
}

.profile-cover-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-cover-save,
.profile-cover-remove {
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition:
    background 0.18s ease,
    transform 0.18s ease;
}

.profile-cover-save {
  background: var(--accent-main);
  color: #fff;
}

.profile-cover-save:hover {
  background: var(--accent-main-hover);
}

.profile-cover-remove {
  background: var(--surface-2);
  color: var(--danger);
}

.profile-cover-remove:hover {
  background: var(--danger-soft);
}

.profile-cover-save:active,
.profile-cover-remove:active {
  transform: scale(0.985);
}

.profile-cover-status {
  min-height: 20px;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
}

.profile-cover-status.is-error {
  color: var(--danger);
}

.profile-cover-status.is-success {
  color: var(--success);
}

.profile-cover-status.is-loading {
  color: var(--text-soft);
}

.profile-cover-upload-wrap {
  position: relative;
}

.profile-cover-input-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

/* =========================
   PROFILE SETTINGS MODAL
   ========================= */

.profile-settings-modal {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 12px;
}

.profile-settings-modal .auth-modal__panel {
  width: min(980px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 20px;
}

.profile-settings-modal .auth-modal__head {
  margin-bottom: 16px;
}

.profile-settings {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

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

.profile-settings__card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(45, 123, 255, 0.08), transparent 34%),
    linear-gradient(180deg, var(--surface), var(--surface));
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-xs);
}

.theme-dark .profile-settings__card {
  background:
    radial-gradient(circle at top right, rgba(45, 123, 255, 0.12), transparent 34%),
    linear-gradient(180deg, var(--surface), var(--surface));
}

.profile-settings__card-title {
  color: var(--text);
  font-size: 16px;
  line-height: 1.24;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

.profile-form-label {
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 600;
}

.profile-form-note {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

.profile-form-input,
.profile-form-file,
.profile-form-select-wrap select,
.profile-form-box {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.profile-form-input,
.profile-form-file,
.profile-form-select-wrap select {
  min-height: 50px;
  padding: 0 16px;
  border-radius: 16px;
  font-size: 15px;
}

.profile-form-input--textarea {
  min-height: 124px;
  padding: 14px 16px;
  border-radius: 18px;
  resize: vertical;
  line-height: 1.65;
}

.profile-form-input:focus,
.profile-form-file:focus,
.profile-form-select-wrap select:focus,
.profile-form-input--textarea:focus {
  background: var(--surface);
  border-color: var(--accent-main);
  box-shadow: 0 0 0 3px var(--accent-main-soft);
  outline: none;
}

.profile-form-file {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
}

.profile-form-select-wrap {
  position: relative;
}

.profile-form-select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 46px;
  cursor: pointer;
}

.profile-form-select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 18px;
  width: 10px;
  height: 10px;
  margin-top: -7px;
  border-right: 2px solid var(--text-soft);
  border-bottom: 2px solid var(--text-soft);
  transform: rotate(45deg);
  pointer-events: none;
}

.profile-form-box {
  min-height: 50px;
  padding: 14px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.6;
}

.profile-form-box a {
  color: var(--accent-main);
}

.profile-form-box--danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.16);
}

.profile-form-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  line-height: 1.55;
}

.profile-form-check input[type="checkbox"],
.profile-form-check input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 20px;
  min-width: 20px;
  height: 20px;
  margin: 1px 0 0;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  flex: 0 0 auto;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.profile-form-check input[type="checkbox"] {
  border-radius: 7px;
}

.profile-form-check input[type="radio"] {
  border-radius: 50%;
}

.profile-form-check input[type="checkbox"]:hover,
.profile-form-check input[type="radio"]:hover {
  border-color: var(--accent-main);
}

.profile-form-check input[type="checkbox"]:focus-visible,
.profile-form-check input[type="radio"]:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-main-soft);
}

.profile-form-check input[type="checkbox"]:checked,
.profile-form-check input[type="radio"]:checked {
  background: var(--accent-main);
  border-color: var(--accent-main);
}

.profile-form-check input[type="checkbox"]::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
  opacity: 0;
}

.profile-form-check input[type="checkbox"]:checked::after {
  opacity: 1;
}

.profile-form-check input[type="radio"]::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.profile-form-check input[type="radio"]:checked::after {
  opacity: 1;
}

/* =========================
   DLE XFIELDS INSIDE SETTINGS
   ========================= */

.profile-settings .xfieldsrow {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

.profile-settings .xfieldscolleft {
  float: none;
  width: auto;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 600;
}

.profile-settings .xfieldscolright {
  float: none;
  width: auto;
  margin: 0;
}

.profile-settings .xfieldscolright input[type="text"],
.profile-settings .xfieldscolright input[type="email"],
.profile-settings .xfieldscolright input[type="url"],
.profile-settings .xfieldscolright input[type="password"],
.profile-settings .xfieldscolright select,
.profile-settings .xfieldscolright textarea {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.profile-settings .xfieldscolright input[type="text"],
.profile-settings .xfieldscolright input[type="email"],
.profile-settings .xfieldscolright input[type="url"],
.profile-settings .xfieldscolright input[type="password"],
.profile-settings .xfieldscolright select {
  min-height: 50px;
  padding: 0 16px;
  border-radius: 16px;
}

.profile-settings .xfieldscolright textarea {
  min-height: 124px;
  padding: 14px 16px;
  border-radius: 18px;
  resize: vertical;
}

.profile-settings .xfieldscolright input[type="text"]:focus,
.profile-settings .xfieldscolright input[type="email"]:focus,
.profile-settings .xfieldscolright input[type="url"]:focus,
.profile-settings .xfieldscolright input[type="password"]:focus,
.profile-settings .xfieldscolright select:focus,
.profile-settings .xfieldscolright textarea:focus {
  background: var(--surface);
  border-color: var(--accent-main);
  box-shadow: 0 0 0 3px var(--accent-main-soft);
  outline: none;
}

.profile-settings__footer {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin-top: 16px;
  padding-top: 14px;
  background: linear-gradient(to top, var(--surface) 78%, rgba(255, 255, 255, 0));
}

.theme-dark .profile-settings__footer {
  background: linear-gradient(to top, var(--surface) 78%, rgba(32, 36, 43, 0));
}

.profile-save-btn {
  min-height: 50px;
  padding: 0 18px;
  background: var(--accent-main);
  color: #fff;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(45, 123, 255, 0.18);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.profile-save-btn:hover {
  background: var(--accent-main-hover);
}

.profile-save-btn:active {
  transform: scale(0.985);
}

/* =========================
   SMALL DLE FIXES
   ========================= */

.form-check-label,
.ui-dialog label {
  color: var(--text) !important;
}

/* =========================
   RESPONSIVE
   ========================= */

@media screen and (max-width: 925px) {
  .subsite-card__header {
    align-items: flex-start;
    gap: 14px;
  }

  .subsite-card__nickname,
  .subsite-card__info {
    justify-content: flex-start;
    text-align: left;
  }

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

@media screen and (max-width: 768px) {
  .subsite-card.profile-page {
    margin-bottom: 14px;
  }

  .profile-activity-shell {
    gap: 14px;
    margin-bottom: 14px;
  }

  .subsite-card {
    border-radius: 22px;
  }

  .subsite-cover,
  .subsite-cover__image {
    min-height: 132px;
  }

  .subsite-card__body {
    padding: 0 16px 16px;
  }

  .subsite-card__header {
    gap: 14px;
    margin-top: -48px;
  }

  .subsite-avatar__frame,
  .subsite-avatar__image {
    width: 84px;
    height: 84px;
  }

  .subsite-header-controls {
    margin-top: 48px;
  }

  .subsite-card__name-title {
    font-size: 24px;
  }

  .subsite-card__description--profile {
    max-width: none;
  }

  .subsite-card__nickname-toast {
    left: 0;
    top: calc(100% + 8px);
    transform: translateY(0);
  }

  .subsite-card__nickname-copy.is-copied .subsite-card__nickname-toast {
    transform: translateY(0);
  }

  .profile-feed-card {
    padding: 14px;
    border-radius: 18px;
  }

  .profile-feed-card__media {
    min-height: 220px;
    border-radius: 16px;
  }

  .profile-feed-card__image {
    max-height: clamp(220px, 52vh, var(--feed-media-max-h));
  }

  .profile-activity-nav {
    padding: 10px;
  }

  .profile-activity-content {
    padding: 14px;
  }

  .profile-activity__tabs {
    gap: 8px;
  }

  .profile-activity__tab {
    width: 100%;
    min-width: 0;
    padding: 0 12px;
  }

  .profile-activity__tab span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .profile-cover-modal {
    display: flex;
    align-items: flex-end;
  }

  .profile-cover-modal .auth-modal__panel {
    width: 100%;
    max-height: 92dvh;
    min-height: 56vh;
    margin: auto 0 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }

  .profile-cover-modal.is-open .auth-modal__panel {
    transform: translateY(0) scale(1);
  }

  .profile-cover-preview {
    height: 180px;
    border-radius: 16px;
  }

  .profile-cover-actions {
    flex-direction: column;
  }

  .profile-cover-save,
  .profile-cover-remove {
    width: 100%;
  }
}

@media screen and (max-width: 640px) {
  .subsite-card.profile-page {
    margin-bottom: 12px;
  }

  .profile-activity-shell {
    gap: 12px;
    margin-bottom: 12px;
  }

  .subsite-card {
    border-radius: 20px;
  }

  .subsite-cover,
  .subsite-cover__image {
    min-height: 112px;
  }

  .subsite-cover__actions {
    top: 10px;
    right: 10px;
  }

  .subsite-cover__edit-btn--icon {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
  }

  .subsite-card__body {
    padding: 0 12px 12px;
  }

  .subsite-card__header {
    gap: 12px;
    margin-top: -44px;
  }

  .subsite-avatar__frame,
  .subsite-avatar__image {
    width: 76px;
    height: 76px;
  }

  .subsite-header-controls {
    margin-top: 42px;
  }

  .subsite-card__name-title {
    font-size: 21px;
  }

  .subsite-card__headline {
    gap: 8px;
  }

  .subsite-card__headline-status {
    font-size: 13px;
  }

  .subsite-card__nickname {
    font-size: 14px;
  }

  .subsite-card__info {
    gap: 10px;
  }

  .subsite-header-controls__inner {
    width: auto;
    display: flex;
    gap: 8px;
  }

  .profile-action-wrap,
  .profile-action-wrap .pm_button,
  .profile-action-wrap .pm_link,
  .profile-action-wrap a {
    width: 100%;
  }

  .subsite-action-btn,
  .subsite-action-btn--pm,
  .subsite-action-btn--pm .pm_button,
  .subsite-action-btn--pm .pm_link,
  .subsite-action-btn--pm a {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }

  .profile-feed-card {
    padding: 13px;
    border-radius: 16px;
  }

  .profile-feed-card__title {
    font-size: 17px;
  }

  .profile-feed-card__media {
    min-height: 200px;
    border-radius: 14px;
  }

  .profile-feed-card__media-bg {
    filter: blur(22px) saturate(1.02) brightness(0.78);
  }

  .profile-feed-card__image {
    max-height: clamp(200px, 46vh, var(--feed-media-max-h));
  }

  .profile-feed-card__footer {
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .profile-feed-card__stats,
  .profile-feed-card__actions {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .profile-feed-card__stats {
    min-width: 0;
    flex: 1 1 auto;
  }

  .profile-feed-card__actions {
    flex: 0 0 auto;
    justify-content: flex-end;
  }

  .profile-feed-card__action {
    min-height: 34px;
    padding: 0 9px;
    font-size: 12px;
  }

  .profile-feed-card__action--icon,
  .profile-feed-card__action--share {
    width: 34px;
    min-width: 34px;
    padding: 0;
  }

  .profile-feed-card__action--share span {
    display: none;
  }

  .profile-activity-nav {
    padding: 10px;
  }

  .profile-activity-content {
    padding: 12px;
  }

  .profile-activity__tabs {
    display: flex;
    gap: 8px;
  }

  .profile-activity__tab {
    justify-content: center;
    padding: 0 10px;
    font-size: 13px;
  }

  .profile-activity__tab .i-svg {
    width: 13px;
    height: 13px;
  }

  .profile-activity__tab span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .profile-activity__more-link a {
    min-height: 50px;
    border-radius: 16px;
  }

  .profile-settings-modal {
    display: flex;
    align-items: flex-end;
    padding: 0;
  }

  .profile-settings-modal .auth-modal__panel {
    width: 100%;
    max-height: 92dvh;
    min-height: 72vh;
    margin: auto 0 0;
    padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
  }

  .profile-settings-modal.is-open .auth-modal__panel,
  .profile-cover-modal.is-open .auth-modal__panel {
    transform: translateY(0) scale(1);
  }

  .profile-settings__card {
    padding: 14px;
    border-radius: 18px;
  }

  .profile-form-input,
  .profile-form-file,
  .profile-form-select-wrap select {
    min-height: 48px;
    border-radius: 14px;
  }

  .profile-save-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .subsite-cover__edit-btn,
  .subsite-card__nickname-copy,
  .subsite-card__nickname-toast,
  .profile-feed-card__action,
  .profile-activity__tab,
  .profile-activity-panel,
  .profile-activity__more-link a,
  .profile-cover-upload,
  .profile-cover-save,
  .profile-cover-remove,
  .profile-form-input,
  .profile-form-file,
  .profile-form-select-wrap select,
  .profile-form-box,
  .profile-form-check input[type="checkbox"],
  .profile-form-check input[type="radio"],
  .profile-save-btn {
    transition: none !important;
  }
}