:root {
  --st-bg: #edeef0;
  --st-card: #fff;
  --st-text: #222;
  --st-muted: #818c99;
  --st-accent: #4a76a8;
  --st-accent-dark: #3d6390;
  --st-line: #e3e4e8;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--st-bg); color: var(--st-text);
  font: 14px/1.5 -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; }
a { color: var(--st-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }

/* Шапка */
.st-header { position: sticky; top: 0; z-index: 10; background: var(--st-card); border-bottom: 1px solid var(--st-line); }
.st-header__row { max-width: 1000px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 16px; }
.st-back { display: inline-flex; align-items: center; gap: 4px; color: var(--st-muted); font-weight: 600; }
.st-brand { display: flex; align-items: center; gap: 10px; }
.st-brand img { display: block; }
.st-brand__slogan { color: var(--st-muted); font-size: 13px; }
.st-search { flex: 1; min-width: 0; }
.st-search__input { width: 100%; height: 34px; border: 0; border-radius: 8px; background: var(--st-bg);
  padding: 0 12px; font: inherit; color: var(--st-text); }
.st-search__input:disabled { cursor: not-allowed; }
.st-auth { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.st-auth__name { font-weight: 600; }
.st-inline-form { margin: 0; }
.st-link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--st-accent); cursor: pointer; }
.st-link-btn:hover { text-decoration: underline; }

/* Каркас */
.st-main { max-width: 1000px; margin: 0 auto; padding: 16px; }
.st-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.st-col { display: grid; gap: 16px; min-width: 0; }
.st-card { background: var(--st-card); border-radius: 12px; box-shadow: 0 1px 0 rgba(0,0,0,.04); overflow: hidden; }
.st-muted { color: var(--st-muted); }
.st-badge { color: var(--st-muted); font-weight: 400; margin-left: 2px; }
.st-name { color: var(--st-text); font-weight: 600; }

/* Профиль */
.st-profile__cover { height: 200px; background-size: cover; background-position: center; background-color: #b9c8d6; }
.st-profile__body { display: flex; gap: 16px; padding: 0 20px 12px; }
.st-profile__avatar { width: 112px; height: 112px; border-radius: 50%; border: 4px solid var(--st-card);
  margin-top: -40px; flex: none; object-fit: cover; background: #ccc; }
.st-profile__info { padding-top: 10px; min-width: 0; }
.st-profile__name { margin: 0; font-size: 22px; line-height: 1.2; }
.st-profile__status { margin: 4px 0; }
.st-profile__city { margin: 0; color: var(--st-muted); display: flex; align-items: center; gap: 4px; }
.st-details { margin-top: 8px; }
.st-details summary { cursor: pointer; color: var(--st-accent); font-weight: 600; list-style: none; }
.st-details summary::-webkit-details-marker { display: none; }
.st-details[open] .st-details__chev { display: inline-block; transform: rotate(180deg); }
.st-details dl { margin: 8px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }
.st-details dt { color: var(--st-muted); }
.st-details dd { margin: 0; }
.st-counters { list-style: none; margin: 0; padding: 12px 20px; border-top: 1px solid var(--st-line); display: flex; gap: 28px; }
.st-counters b { font-size: 16px; }
.st-counters span { color: var(--st-muted); }

/* Фото */
.st-photos { padding: 16px 20px; }
.st-photos__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.st-photos__head h2 { margin: 0; font-size: 15px; }
.st-photos__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.st-photos__grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }

/* Вкладки */
.st-tabs { display: flex; gap: 4px; background: var(--st-card); border-radius: 12px; padding: 4px; }
.st-tab { flex: 1; border: 0; background: none; padding: 9px 12px; border-radius: 8px; font: inherit; font-weight: 600;
  color: var(--st-muted); cursor: pointer; }
.st-tab.is-active { background: #e8eef5; color: var(--st-accent); }

/* Пост */
.st-post { padding: 16px 20px; }
.st-post__head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.st-post__avatars { display: flex; }
.st-post__avatars .st-ava + .st-ava { margin-left: -12px; border: 2px solid var(--st-card); }
.st-ava { width: 44px; height: 44px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; flex: none; }
.st-ava--sm { width: 32px; height: 32px; font-size: 11px; }
.st-post__text { margin: 0 0 12px; font-size: 15px; }
.st-post__image { width: 100%; max-height: 420px; object-fit: cover; border-radius: 10px; display: block; margin-bottom: 12px; }
.st-repost { border: 1px solid var(--st-line); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.st-repost__title { font-weight: 700; }
.st-post__stats { display: flex; gap: 20px; color: var(--st-muted); }
.st-post__likedby { margin: 4px 0 12px; }
.st-comments { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--st-line); display: grid; gap: 12px; }
.st-comment { display: flex; gap: 10px; align-items: flex-start; }
.st-comment > div { flex: 1; min-width: 0; }
.st-comment__likes { color: var(--st-muted); font-size: 13px; }
.st-comment-login { margin-top: 14px; padding: 10px 14px; background: var(--st-bg); border-radius: 8px; text-align: center; }
.st-comment-form { margin-top: 14px; display: flex; gap: 8px; }
.st-comment-form input { flex: 1; min-width: 0; height: 36px; border: 1px solid var(--st-line); border-radius: 8px; padding: 0 12px; font: inherit; }

/* Правая колонка */
.st-aside { position: sticky; top: 64px; display: grid; gap: 12px; }
.st-aside__card { padding: 18px; display: grid; gap: 10px; }
.st-aside__card h2 { margin: 0; font-size: 17px; }
.st-aside__card p { margin: 0 0 4px; }
.st-copy { text-align: center; color: var(--st-muted); font-size: 12px; }

/* Кнопки и формы */
.st-btn { display: block; width: 100%; text-align: center; border: 0; border-radius: 8px; padding: 10px 16px; font: inherit;
  font-weight: 600; background: var(--st-accent); color: #fff; cursor: pointer; }
.st-btn:hover { background: var(--st-accent-dark); text-decoration: none; }
.st-btn--ghost { background: #e8eef5; color: var(--st-accent); }
.st-btn--ghost:hover { background: #dbe5f0; }
.st-btn--small { width: auto; padding: 8px 14px; }
.st-narrow { max-width: 420px; margin: 24px auto; }
.st-form-card { padding: 24px; }
.st-form-card h1 { margin: 0 0 16px; font-size: 21px; }
.st-form-card form { display: grid; gap: 14px; }
.st-form-card label { display: grid; gap: 4px; font-weight: 600; }
.st-form-card input { height: 40px; border: 1px solid #d3d9de; border-radius: 8px; padding: 0 12px; font: inherit; font-weight: 400; }
.st-form-card input:focus, .st-comment-form input:focus { outline: 2px solid #b5cbe3; border-color: var(--st-accent); }
.st-form-card__alt { margin: 16px 0 0; text-align: center; }
.st-error { background: #fdecea; color: #b3261e; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }

/* Телефон */
@media (max-width: 760px) {
  .st-header__row { flex-wrap: wrap; gap: 8px 12px; padding: 8px 12px; }
  .st-back span, .st-brand__slogan { display: none; }
  .st-search { order: 3; flex-basis: 100%; }
  .st-auth { margin-left: auto; }
  .st-main { padding: 12px; }
  .st-layout { grid-template-columns: minmax(0, 1fr); }
  .st-aside { position: static; order: -1; }
  .st-profile__cover { height: 140px; }
  .st-profile__body { flex-direction: column; gap: 0; padding: 0 16px 12px; }
  .st-profile__avatar { width: 92px; height: 92px; }
  .st-counters { gap: 18px; padding: 12px 16px; flex-wrap: wrap; }
  .st-photos { padding: 14px 16px; }
  .st-photos__grid { grid-template-columns: repeat(3, 1fr); }
  .st-post { padding: 14px 16px; }
  .st-narrow { margin: 12px auto; }
}

/* --- Живая соцсеть: навигация, списки, закрытые страницы --- */
.st-header { position: sticky; }
.st-nav { max-width: 1000px; margin: 0 auto; padding: 0 16px 8px; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-weight: 600; }
.st-nav__mode { margin-left: auto; }
.st-nav__mode .is-on { color: #2e7d32; }
.st-flash { background: #e8f0e6; color: #2e5d2e; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; }
.st-search { position: relative; }
.st-suggest { position: absolute; left: 0; right: 0; top: 38px; background: var(--st-card); border: 1px solid var(--st-line);
  border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.12); display: grid; z-index: 20; overflow: hidden; }
.st-suggest a { padding: 8px 12px; color: var(--st-text); }
.st-suggest a:hover { background: var(--st-bg); text-decoration: none; }
.st-text { white-space: pre-line; overflow-wrap: anywhere; }
.st-empty { padding: 20px; text-align: center; color: var(--st-muted); }
.st-locked { padding: 32px 20px; text-align: center; }
.st-locked__icon { font-size: 40px; }
.st-locked h2 { margin: 8px 0 4px; }
.st-profile__avatar--stub { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 34px; font-weight: 700; }
.st-profile__tg { margin: 4px 0 0; }
.st-counters a { color: inherit; }
.st-ava--md { width: 36px; height: 36px; font-size: 12px; object-fit: cover; }
img.st-ava { object-fit: cover; }
.st-post__images { display: grid; gap: 4px; margin-bottom: 12px; }
.st-post__images--2, .st-post__images--4 { grid-template-columns: 1fr 1fr; }
.st-post__images--3 { grid-template-columns: 1fr 1fr 1fr; }
.st-post__images img { width: 100%; max-height: 420px; object-fit: cover; border-radius: 10px; display: block; }
.st-repost__text { margin: 4px 0 8px; color: #444; }
.st-comment--d1 { margin-left: 42px; }
.st-comment--d2 { margin-left: 84px; }
.st-comment__when { font-size: 12px; }
.st-comment-form select { max-width: 160px; border: 1px solid var(--st-line); border-radius: 8px; padding: 0 6px; font: inherit; }
.st-mini-list { padding: 14px 16px; }
.st-mini-list h2 { margin: 0 0 10px; font-size: 15px; }
.st-mini-list__items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.st-mini-list__item { display: grid; justify-items: center; gap: 4px; text-align: center; font-size: 12px; color: var(--st-text); }
.st-mini-list__item span:last-child { overflow-wrap: anywhere; }
.st-list { padding: 18px 20px; }
.st-list h1 { margin: 0 0 12px; font-size: 21px; }
.st-list__sub { font-size: 15px; margin: 14px 0 6px; }
.st-list__items { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.st-list__items a { display: flex; gap: 12px; align-items: center; padding: 6px; border-radius: 8px; color: var(--st-text); }
.st-list__items a:hover { background: var(--st-bg); text-decoration: none; }
.st-narrow--wide { max-width: 720px; display: grid; gap: 16px; }
.st-albums { display: flex; gap: 12px; flex-wrap: wrap; }
.st-albums .is-active { font-weight: 700; color: var(--st-text); }
.st-photos__grid--big { grid-template-columns: repeat(4, 1fr); }
.st-photo { margin: 0; display: grid; gap: 4px; }

/* Админка в странице */
.st-admin-panel, .st-admin-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.st-admin-panel { padding: 10px 20px 14px; border-top: 1px dashed var(--st-line); background: #f6f9fc; }
.st-admin-row { margin: 6px 0; }
.st-mini { display: inline-block; border: 1px solid #c9d6e4; background: #fff; color: var(--st-accent); border-radius: 6px;
  padding: 3px 9px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.st-mini:hover { background: #eef3f9; text-decoration: none; }
.st-mini--danger { color: #b3261e; border-color: #e6b9b5; }
.st-btn--danger { background: #b3261e; margin-top: 8px; }
.st-btn--danger:hover { background: #8f1d17; }
.st-admin-details { width: 100%; }
.st-admin-details summary { list-style: none; display: inline-block; }
.st-admin-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.st-admin-form input[type=text], .st-admin-form input[type=search], .st-admin-form select { height: 34px; border: 1px solid var(--st-line);
  border-radius: 8px; padding: 0 10px; font: inherit; }
.st-admin-form-block { padding-top: 6px; }
.st-form-card textarea, .st-form-card select { border: 1px solid #d3d9de; border-radius: 8px; padding: 8px 12px; font: inherit; font-weight: 400; }
.st-form-card input[type=checkbox] { height: auto; }
.st-check { display: flex !important; align-items: center; gap: 8px; font-weight: 400 !important; }
.st-checks { border: 1px solid var(--st-line); border-radius: 8px; max-height: 360px; overflow: auto; display: grid; gap: 4px; padding: 8px 12px; }
.st-manage { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; }
.st-manage li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--st-line); }
.st-manage__acts { margin-left: auto; display: flex; gap: 6px; }

@media (max-width: 760px) {
  .st-nav { padding: 0 12px 8px; gap: 12px; }
  .st-nav__mode { margin-left: 0; }
  .st-photos__grid--big { grid-template-columns: repeat(2, 1fr); }
  .st-comment--d1 { margin-left: 24px; }
  .st-comment--d2 { margin-left: 40px; }
  .st-comment-form { flex-wrap: wrap; }
  .st-comment-form select { max-width: none; flex-basis: 100%; height: 36px; }
  .st-admin-panel { padding: 10px 16px 14px; }
}
