/* R55: static, accessible first-snapshot scaffold; no late empty-story shelf. */
.social-profile [data-sp-avatar] {
  min-height: 90px;
  display: flex;
  align-items: center;
}
.social-profile .social-profile__identity h2 { min-height: 1.2em; }
.social-profile .social-profile__handle { display: block; min-height: 1.4em; }
.social-profile [data-sp-status] {
  display: block;
  min-height: 1.5em;
  margin: 10px 0 0;
}
.social-profile .social-profile__actions { min-height: 46px; }
.social-profile[data-profile-kind="peer"] .social-profile__actions { min-height: 100px; }
.social-profile .social-profile__actions button { overflow: hidden; }
.social-profile [data-profile-action="follow"] { white-space: nowrap; text-overflow: ellipsis; }
.social-profile__loading-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.social-profile .social-profile__skeleton {
  display: block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  animation: none;
}
.social-profile .social-profile__skeleton-name { width: 78%; height: 1.2em; border-radius: 7px; }
.social-profile .social-profile__skeleton-handle { width: 48%; height: 1.4em; border-radius: 5px; }
.social-profile .social-profile__action-placeholder {
  color: transparent;
  opacity: 1;
  background: var(--surface-2);
  cursor: default;
  pointer-events: none;
}
.social-profile[data-profile-kind="peer"] [data-loading-action="2"] { grid-column: 1 / -1; }
.social-profile .social-profile__video-placeholder { min-width: 0; aspect-ratio: 3 / 4; border-radius: 12px; }
.social-profile[data-profile-state="error"] .social-profile__skeleton { opacity: .45; }
.social-profile[data-profile-state="error"] .social-profile__actions button { grid-column: 1 / -1; align-self: start; }
@media (max-width: 600px) {
  .social-profile .social-profile__video-placeholder:nth-child(3) { display: none; }
}
@media (max-width: 360px) {
  .social-profile [data-sp-avatar] { min-height: 78px; }
}

.social-profile .social-profile__cover,
.social-profile-sheet__cover-preview {
  position: relative;
  aspect-ratio: 24 / 9;
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface-2);
}
.social-profile .social-profile__cover { margin-bottom: 20px; }
.social-profile__cover img,
.social-profile-sheet__cover-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.social-profile .social-profile__featured-label {
  position: absolute;
  top: 8px;
  left: 8px;
  max-width: calc(100% - 16px);
  padding: 4px 8px;
  border-radius: 8px;
  background: rgb(12 20 34 / .88);
  color: #fff;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
  pointer-events: none;
}
.social-profile-sheet {
  box-sizing: border-box;
  width: min(480px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  padding: 0;
  margin: auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 18px 64px rgb(0 0 0 / .28);
}
.social-profile-sheet[open] { display: flex; flex-direction: column; }
.social-profile-sheet:not([open]), .social-profile-sheet [hidden] { display: none !important; }
.social-profile-sheet * { box-sizing: border-box; }
.social-profile-sheet::backdrop { background: rgb(8 14 26 / .48); }
.social-profile-sheet__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px 10px 20px; border-bottom: 1px solid var(--border); }
.social-profile-sheet__bar h2 { margin: 0; font-size: 18px; line-height: 1.3; }
.social-profile-sheet__bar button { flex: 0 0 44px; padding: 10px; border: 0; background: transparent; }
.social-profile-sheet__body { display: grid; gap: 18px; padding: 20px; overflow: auto; overscroll-behavior: contain; min-height: 0; }
.social-profile-sheet__status { flex: 0 0 auto; min-height: 21px; margin: 0; padding: 0 20px max(18px, env(safe-area-inset-bottom)); color: var(--text-muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.social-profile-sheet__hint { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-muted); }
.social-profile-sheet__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: center; }
.social-profile-sheet :is(button, select) {
  min-height: 44px;
  min-width: 0;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.social-profile-sheet button { cursor: pointer; }
.social-profile-sheet button:disabled { opacity: .55; cursor: default; }
.social-profile-sheet .social-profile__primary { background: var(--accent); color: var(--accent-ink, #fff); border-color: transparent; font-weight: 600; }
.social-profile-sheet :is(button, a, input, select):focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.social-profile-sheet__field { display: grid; gap: 8px; min-width: 0; font-size: 13px; line-height: 1.4; }
.social-profile-sheet__field:has(input[type="range"]) { grid-column: 1 / -1; }
.social-profile-sheet__field input[type="range"] { width: 100%; min-width: 0; min-height: 44px; accent-color: var(--accent); }
.social-profile-sheet__field input[type="color"] { width: 100%; min-height: 44px; padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.social-profile-sheet select { width: 100%; font-size: 16px; }
.social-profile-sheet__cover-preview { display: grid; place-items: center; color: var(--text-muted); font-size: 13px; }
.social-profile-sheet__identity { display: grid; justify-items: center; gap: 8px; text-align: center; overflow-wrap: anywhere; }
.social-profile-sheet__identity .social-profile__portrait { width: 64px; height: 64px; margin: 0 0 4px; font-size: 25px; }
.social-profile-sheet__identity strong { font-size: 20px; line-height: 1.3; }
.social-profile-sheet__identity > span:last-child { color: var(--text-muted); font-size: 14px; }
.social-profile-sheet__qr { display: grid; place-items: center; min-height: 256px; width: min(256px, 100%); padding: 8px; justify-self: center; border-radius: 12px; background: #fff; color: #182436; text-align: center; }
.social-profile-sheet__qr img { width: 240px; max-width: 100%; height: auto; display: block; image-rendering: pixelated; }
.social-profile-sheet__url { display: block; min-width: 0; color: var(--accent); font-size: 14px; line-height: 1.5; text-align: center; overflow-wrap: anywhere; user-select: text; }
@media (max-width: 360px) {
  .social-profile-sheet__body { padding: 16px; }
  .social-profile-sheet__bar { padding-left: 16px; }
  .social-profile-sheet__actions { gap: 8px; }
  .social-profile-sheet__actions button { padding-inline: 8px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .social-profile-sheet *, .social-profile__cover { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* M12 (messenger-max w5): длинные однотокеновые имена (ник без пробелов,
   длинное слово кириллицей) не должны выталкивать колонку identity в hero.
   У handle/bio/status overflow-wrap:anywhere уже есть (profile-r52),
   у h2 имени — не было; сетка 88px+1fr рвалась на узких диалогах. */
.social-profile .social-profile__hero h2 {
  min-width: 0;
  overflow-wrap: anywhere;
}
