/* ============================ Компоненты ============================ */

/* ---- Разделы листа ----
   .card — блок с тонкой рамкой (группы настроек, панели админки, всплывающие формы).
   На листе ленты (узкие страницы) блоки верхнего уровня и публикации — без рамок: только
   тонкая линия снизу, лист остаётся одним листом. */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.shell:not(.wide) .main > .card, .shell:not(.wide) .main > section.card, .shell:not(.wide) .main .composer.card, .shell:not(.wide) .main .tabs.card, .post.card {
  background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
}
.shell:not(.wide) .main > .banner { margin: .75rem 1.25rem 0; }
.card.pad { padding: var(--s5); }
.card-head { display: flex; align-items: center; gap: var(--s2); padding: var(--s4) var(--s5) 0; }
.card-head h2, .card-head h3 { font-size: var(--fs-md); font-weight: 650; }
.card-body { padding: var(--s4) var(--s5) var(--s5); }
.section-title { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-xl); }
/* Шапка страницы: крупное название антиквой */
.page-head { display: flex; align-items: center; gap: var(--s2); min-height: 4.5rem; padding: 1.375rem 1.25rem .875rem; }
.shell.wide .main > .page-head, .settings-page > .page-head { padding: 1.625rem 0 .625rem; }
.page-head h1 { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-2xl); letter-spacing: -.01em; line-height: 1.1; }
.page-head .back { width: 2.375rem; height: 2.375rem; margin-left: -.5rem; border-radius: var(--r-full); display: grid; place-items: center; background: none; border: 0; color: var(--text); transition: background var(--t-fast), transform var(--t-fast) var(--ease); }
.page-head .back:hover { background: var(--surface-2); transform: translateX(-.125rem); }
/* Липкая шапка ленты: название + вкладки на матовом стекле */
.sheet-head { position: sticky; top: 0; z-index: 6; background: var(--glass); backdrop-filter: saturate(1.4) blur(.875rem); -webkit-backdrop-filter: saturate(1.4) blur(.875rem); border-bottom: 1px solid var(--line); }
.sheet-head .page-head { min-height: 0; padding: 1.25rem 1.25rem .25rem; }
.sheet-head .tabs { border-bottom: 0; padding: 0 .5rem; }

/* ---- Кнопки: чернильная «пилюля» — главное действие; контурная — второстепенное ---- */
.btn {
  --h: var(--control-h); display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: var(--h); padding: 0 1.125rem;
  border-radius: var(--r-md); border: 1px solid transparent; font-weight: 650; font-size: var(--fs-sm); white-space: nowrap; letter-spacing: .005em;
  box-shadow: var(--bevel);
  background: var(--btn-bg); color: var(--btn-fg); -webkit-tap-highlight-color: transparent; user-select: none;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease), box-shadow var(--t-fast);
}
.btn:hover { color: var(--btn-fg); background: color-mix(in srgb, var(--btn-bg) 84%, var(--accent)); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 .125rem 0 rgba(0, 0, 0, .2); }
.btn.secondary, .btn.ghost, .btn.provider { box-shadow: none; }
.btn[disabled], .btn[aria-busy="true"], .btn[aria-disabled="true"] { opacity: .38; pointer-events: none; }
.btn[aria-busy="true"] { cursor: progress; }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn.secondary:hover { border-color: var(--text); color: var(--text); background: transparent; }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 86%, #000); color: #fff; }
.btn.danger.secondary { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.danger-text { color: var(--danger); }
.btn.accent { background: var(--accent); color: var(--inverse); }
.btn.sm { --h: var(--control-h-sm); padding: 0 .875rem; font-size: var(--fs-xs); }
.btn.lg { --h: var(--control-h-lg); padding: 0 1.5rem; font-size: var(--fs-md); }
.btn.block { width: 100%; }
.btn.icon { width: var(--h); padding: 0; }
.iconbtn {
  width: 2.375rem; height: 2.375rem; border-radius: var(--r-full); display: inline-grid; place-items: center; border: 0; background: none; color: var(--muted);
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease); flex: none; -webkit-tap-highlight-color: transparent;
}
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.iconbtn:active { transform: scale(.92); }
.iconbtn[aria-pressed="true"] { color: var(--text); background: var(--surface-3); }
.iconbtn[disabled] { opacity: .38; pointer-events: none; }
.spinner { width: 1.125rem; height: 1.125rem; border-radius: 50%; border: .125rem solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Поля: «листок» на листе — заливка без рамки, рамка появляется при фокусе ---- */
.field { display: grid; gap: .375rem; }
.field > label, .label { font-weight: 600; font-size: var(--fs-sm); color: var(--text); }
.input, .textarea, .select {
  width: 100%; min-height: var(--control-h); padding: .5625rem .875rem; border-radius: var(--r-md); border: 1px solid transparent;
  background: var(--surface-2); color: var(--text); outline: none; font-size: var(--fs-md);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 1; }
.textarea { min-height: 6rem; resize: vertical; line-height: 1.5; }
/* Однострочные поля и списки выбора — ровно высоты элемента управления */
.input, .select { height: var(--control-h); }
.select.sm { height: var(--control-h-sm); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 1.125rem) 50%, calc(100% - .8125rem) 50%; background-size: .3125rem .3125rem; background-repeat: no-repeat; padding-right: 2.25rem; cursor: pointer; }
.select.sm { min-height: var(--control-h-sm); padding: .25rem 1.875rem .25rem .75rem; font-size: var(--fs-xs); font-weight: 600; width: auto; min-width: var(--field-w-sm); border-radius: var(--r-full); background-position: calc(100% - 1rem) 50%, calc(100% - .6875rem) 50%; }
.input:hover, .textarea:hover, .select:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
.input:focus, .textarea:focus, .select:focus { background-color: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 .1875rem var(--accent-soft); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 .1875rem var(--danger-soft); }
/* iOS увеличивает страницу при фокусе на поле с шрифтом < 16px */
@media (max-width: 759px) { .input, .textarea, .select:not(.sm) { font-size: 1rem; } }
.input.with-prefix { padding-left: 1.875rem; }
.prefix-wrap { position: relative; }
.prefix-wrap > .prefix { position: absolute; left: .875rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.hint { font-size: var(--fs-xs); color: var(--muted); }
.field-error { font-size: var(--fs-sm); color: var(--danger); }
.field-error:empty { display: none; }
.form { display: grid; gap: var(--s4); }
.form-actions { display: flex; gap: var(--s2); justify-content: flex-end; flex-wrap: wrap; }
input[type="checkbox"] { width: 1.125rem; height: 1.125rem; accent-color: var(--accent); flex: none; margin: .125rem 0 0; }

/* Переключатель: дорожка-«шов», бегунок — бумажная пуговица */
.switch { position: relative; display: inline-flex; align-items: center; gap: .75rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 2.625rem; height: 1.5rem; border-radius: var(--r-full); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-strong); position: relative; transition: background var(--t), box-shadow var(--t); flex: none; }
.switch .track::after { content: ""; position: absolute; top: .1875rem; left: .1875rem; width: 1.125rem; height: 1.125rem; border-radius: 50%; background: var(--surface); box-shadow: 0 1px .1875rem rgba(40, 30, 16, .3); transition: transform var(--t) var(--ease-out); }
.switch input:checked + .track { background: var(--accent); box-shadow: none; }
.switch input:checked + .track::after { transform: translateX(1.125rem); }
.switch input:focus-visible + .track { outline: .125rem solid var(--accent); outline-offset: .125rem; }
.setting-row { display: flex; align-items: center; gap: var(--s4); padding: var(--s3) 0; border-top: 1px solid var(--line); }
.setting-row:first-child { border-top: 0; }
.setting-row .text { flex: 1; min-width: 0; }
.setting-row .text b { display: block; font-weight: 600; }

/* Сегменты и вкладки: текст + тонкая линия под выбранным (растёт из центра) */
.segmented { display: inline-flex; padding: .1875rem; border-radius: var(--r-full); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); gap: .125rem; flex-wrap: wrap; }
.segmented button { border: 0; background: none; padding: .375rem .875rem; border-radius: var(--r-full); font-weight: 600; font-size: var(--fs-xs); color: var(--muted); transition: color var(--t-fast), background var(--t-fast); }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px .125rem rgba(40, 30, 16, .1), 0 0 0 1px var(--line); }
.tabs { display: flex; gap: .125rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a {
  flex: none; border: 0; background: none; padding: .875rem .75rem .8125rem; font-weight: 600; font-size: var(--fs-sm); color: var(--muted); position: relative; white-space: nowrap;
  transition: color var(--t-fast);
}
.tabs button:hover, .tabs a:hover { color: var(--text); }
.tabs [aria-selected="true"] { color: var(--text); }
.tabs [aria-selected="true"]::after { content: ""; position: absolute; left: .75rem; right: .75rem; bottom: -1px; height: .125rem; border-radius: .125rem; background: var(--text); animation: tab-in var(--t) var(--ease-out); }
@keyframes tab-in { from { transform: scaleX(.2); opacity: 0; } }
.shell:not(.wide) .main > .tabs { padding: 0 .5rem; }
.chip { display: inline-flex; align-items: center; gap: .375rem; height: var(--control-h-sm); padding: 0 .8125rem; border-radius: var(--r-full); background: transparent; color: var(--text-2); font-size: var(--fs-xs); font-weight: 600; border: 1px solid var(--line-strong); transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast); }
button.chip:hover { color: var(--text); border-color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--surface); }
button.chip { cursor: pointer; }
/* Плашка с аватаром (сообщества в профиле): круглый аватар внутри рамки с ровным отступом */
.chip.chip-ava { height: 2.125rem; padding: .1875rem .875rem .1875rem .1875rem; gap: .5rem; color: var(--text); text-decoration: none; }
.chip.chip-ava .avatar { --size: 1.625rem; border-radius: 50%; font-size: var(--fs-2xs); }
.chip.chip-ava .muted { font-weight: 500; }
a.chip:hover { color: var(--text); border-color: var(--text); background: color-mix(in srgb, var(--text) 5%, transparent); }
.pill { display: inline-flex; align-items: center; gap: .25rem; padding: .125rem .5625rem; border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: 600; background: var(--surface-2); color: var(--text-2); }
.pill.good { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good); }
.pill.warn { background: color-mix(in srgb, var(--warning) 14%, transparent); color: var(--warning); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill.info { background: var(--accent-soft); color: var(--accent-strong); }
/* ---- Аватары и бейджи ---- */
.avatar { --size: 2.75rem; width: var(--size); height: var(--size); border-radius: 50%; flex: none; overflow: hidden; background: var(--surface-3);
  display: grid; place-items: center; font-weight: 700; color: #fff; font-size: calc(var(--size) * .38); user-select: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sq { border-radius: 28%; }
.avatar.xs { --size: 1.75rem; } .avatar.sm { --size: 2.25rem; } .avatar.lg { --size: 4rem; } .avatar.xl { --size: 7rem; }
/* Аватар другого человека — ссылка на профиль (ui/avatar.js → avatarLink). Форма и размер — от аватара. */
.avatar-link { display: inline-flex; flex: none; border-radius: 50%; cursor: pointer; color: inherit; text-decoration: none; }
.avatar-link:has(.avatar.sq) { border-radius: 28%; }
.avatar-link .avatar { transition: filter var(--t-fast), box-shadow var(--t-fast); }
.avatar-link:hover .avatar { filter: brightness(1.08); box-shadow: 0 0 0 .125rem var(--line-strong); }
.avatar-link:focus-visible { outline: .125rem solid var(--accent); outline-offset: .125rem; border-radius: 50%; }
.avatar-link:has(.avatar.sq):focus-visible { border-radius: 28%; }
/* Бейдж у имени: 22px в ленте и списках, 20px в комментариях, 32px в шапке профиля и выборе бейджа. */
.ubadge { display: inline-flex; align-items: center; justify-content: center; flex: none; vertical-align: -.3125rem; margin-left: .3125rem; cursor: help; }
.ubadge img { width: 1.375rem; height: 1.375rem; object-fit: contain; }
.ubadge.custom { height: 1.375rem; min-width: 1.375rem; padding: 0 .4375rem; border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: 700; gap: .1875rem; line-height: 1; }
.ubadge.custom.circle { padding: 0; width: 1.375rem; }
.comment .ubadge img { width: 1.25rem; height: 1.25rem; }
.comment .ubadge.custom { height: 1.25rem; min-width: 1.25rem; font-size: var(--fs-2xs); padding: 0 .375rem; }
.comment .ubadge.custom.circle { width: 1.25rem; padding: 0; }
.ubadge.custom.square { border-radius: var(--r-md); }
.ubadge.lg img { width: 2rem; height: 2rem; }
.ubadge.lg { margin-left: .5rem; vertical-align: -.375rem; }
.ubadge[role="button"] { cursor: pointer; border-radius: var(--r-full); }
.ubadge[role="button"]:focus-visible { outline: .125rem solid var(--accent); outline-offset: .125rem; }
.badge-upload-preview { min-height: 4rem; display: flex; align-items: center; }
.badge-upload-preview img.big { width: 4rem; height: 4rem; object-fit: contain; border-radius: var(--r-md); background: var(--surface-2); padding: .375rem; border: 1px solid var(--line); }
.badge-tip { position: fixed; z-index: var(--z-pop); width: max-content; max-width: min(17.5rem, calc(100vw - 1rem)); padding: .75rem .875rem;
  border-radius: var(--r-md); background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-pop);
  display: grid; gap: .375rem; font-size: var(--fs-sm); line-height: 1.4; animation: tip-in .12s ease-out; }
.badge-tip .row { display: flex; align-items: center; gap: .5rem; }
.badge-tip .row .ubadge { margin: 0; }
.badge-tip p { margin: 0; }
.badge-tip .muted { color: var(--muted); }
@keyframes tip-in { from { opacity: 0; transform: translateY(-.1875rem); } }
@media (prefers-reduced-motion: reduce) { .badge-upload-preview { min-height: 4rem; display: flex; align-items: center; }
.badge-upload-preview img.big { width: 4rem; height: 4rem; object-fit: contain; border-radius: var(--r-md); background: var(--surface-2); padding: .375rem; border: 1px solid var(--line); }
.badge-tip { animation: none; } }
.ubadge.lg.custom { height: 2rem; min-width: 2rem; font-size: var(--fs-md); padding: 0 .6875rem; }
.ubadge.lg.custom.circle { width: 2rem; padding: 0; }
.ubadge.lg.custom.square { border-radius: var(--r-lg); }
.name-line { display: flex; align-items: center; min-width: 0; gap: 0; }
.name-line .name { font-weight: 700; color: var(--text); }
.name-line .handle { color: var(--muted); margin-left: .375rem; font-size: var(--fs-sm); }

/* ---- Всплывающие панели (ui/popover.js) ----
   Одна основа для меню действий, меню аккаунта, реакций и эмодзи, цвета и шрифта в редакторе:
   одинаковые фон, рамка, тень, скругление, отступы и появление. Меню — фиксированной ширины. */
.popover {
  position: fixed; z-index: var(--z-pop); max-width: calc(100vw - 1rem); padding: var(--pop-pad); border-radius: var(--pop-r);
  background: var(--surface); box-shadow: var(--shadow-pop); animation: pop var(--t) var(--ease-out);
}
/* Меню — по ширине самого длинного пункта (не уже --pop-w, не шире 320px и экрана); пункты не
   раздвигают меню: длинный текст обрезается многоточием внутри. */
.popover.menu { width: max-content; min-width: min(var(--pop-w), calc(100vw - 1rem)); max-width: min(20rem, calc(100vw - 1rem)); }
.popover:not(.menu) { width: var(--pop-w-lg); }
.menu-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; }
.menu-item {
  min-width: 0; display: flex; align-items: center; gap: .75rem; width: 100%; min-height: var(--pop-item-h); padding: 0 .75rem; border-radius: calc(var(--pop-r) - var(--pop-pad));
  border: 0; background: none; text-align: left; font-weight: 500; font-size: var(--fs-sm); color: var(--text);
}
.menu-item .icon { color: var(--muted); }
.menu-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); outline: none; color: var(--text); }
.menu-item:hover .icon, .menu-item:focus-visible .icon { color: var(--text); }
.menu-item.danger, .menu-item.danger .icon { color: var(--danger); }
.menu-list hr { border: 0; height: 1px; background: var(--line); margin: var(--pop-pad) calc(var(--pop-pad) * -1); }
@keyframes pop { from { opacity: 0; transform: translateY(-.25rem) scale(.97); } }
.popover[data-side="above"] { animation-name: pop-up; }
@keyframes pop-up { from { opacity: 0; transform: translateY(.25rem) scale(.97); } }
/* Подсказки (бейдж, графики) — те же поверхность и тень, скругление поменьше */
.badge-tip, .chart-tip { border-radius: var(--tip-r) !important; border: 0 !important; box-shadow: var(--shadow-pop) !important; }

/* ---- Модальные окна (на телефоне — нижний лист) ---- */
.modal-backdrop { position: fixed; inset: 0; z-index: var(--z-modal); background: var(--overlay); display: grid; place-items: center; padding: 1rem; animation: fade var(--t); }
.modal { width: 100%; max-width: var(--panel-w); max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); overflow: auto; overscroll-behavior: contain; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-pop); animation: modal-in var(--t-slow) var(--ease-out); }
.modal.wide { max-width: var(--panel-w-wide); }
.modal-head { display: flex; align-items: center; gap: var(--s2); padding: 1.25rem 1rem .375rem 1.5rem; position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-xl); flex: 1; letter-spacing: -.005em; }
.modal-body { padding: .375rem 1.5rem 1.5rem; display: grid; gap: var(--s4); }
@keyframes fade { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(.625rem) scale(.985); } }
@media (max-width: 759px) {
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal, .modal.wide { max-width: none; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92vh; max-height: 92dvh; animation: sheet-up .32s var(--ease-out); padding-bottom: env(safe-area-inset-bottom); }
  .modal::before { content: ""; display: block; width: 2.25rem; height: .25rem; margin: .5rem auto -.375rem; border-radius: var(--r-sm); background: var(--line-strong); }
  .modal-head { padding: .875rem .75rem .25rem 1.125rem; }
  .modal-body { padding: .375rem 1.125rem 1.125rem; }
  .modal-body > .form-actions { position: sticky; bottom: 0; z-index: 2; margin: 0 -1.125rem -1.125rem; padding: .75rem 1.125rem calc(.75rem + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .modal-body > .form-actions .btn { flex: 1; }
  @keyframes sheet-up { from { transform: translateY(100%); } }
}

/* ---- Уведомления (toast): чернильная плашка снизу ---- */
.toasts { position: fixed; left: 50%; bottom: 1.75rem; transform: translateX(-50%); z-index: var(--z-toast); display: grid; gap: .5rem; width: max-content; max-width: calc(100vw - 1.5rem); }
.toast { display: flex; align-items: center; gap: .625rem; padding: .6875rem 1.125rem; border-radius: var(--r-full); background: var(--btn-bg); color: var(--btn-fg); font-weight: 500; font-size: var(--fs-sm);
  box-shadow: var(--shadow-pop); animation: toast-in var(--t-slow) var(--ease-out); }
@keyframes toast-in { from { opacity: 0; transform: translateY(.75rem); } }
.toast.error { background: var(--danger); color: #fff; }
.toast button { background: none; border: 0; color: inherit; font-weight: 700; padding: 0 0 0 .5rem; text-decoration: underline; text-underline-offset: .1875rem; }
@media (max-width: 759px) { .toasts { bottom: calc(var(--tabbar-h) + .875rem + env(safe-area-inset-bottom)); } }

/* ---- Состояния: загрузка, пусто, ошибка ---- */
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--r-sm); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 60%, transparent), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-post { padding: 1.125rem 1.25rem; display: grid; gap: .75rem; }
.shell:not(.wide) .main .sk-post.card { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.sk-line { height: .6875rem; }
.state { display: grid; justify-items: center; gap: var(--s2); padding: 3.5rem var(--s5); text-align: center; color: var(--muted); }
.state .state-icon { width: 3.25rem; height: 3.25rem; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); margin-bottom: .5rem; box-shadow: inset 0 0 0 1px var(--line-strong); }
.state h3 { color: var(--text); font-family: var(--font-display); font-weight: 400; font-size: var(--fs-xl); }
.state p { max-width: 22.5rem; font-size: var(--fs-sm); }
.state .btn { margin-top: var(--s3); }
.state.compact { padding: var(--s6) var(--s4); }
.state.compact h3 { font-size: var(--fs-lg); }
.loading-row { display: flex; justify-content: center; padding: var(--s5); color: var(--muted); }
/* Объявление: тонкая линия слева вместо цветной плашки */
.banner { display: flex; gap: var(--s3); align-items: flex-start; padding: .75rem 1rem; border-radius: 0 var(--r-md) var(--r-md) 0; background: var(--surface-2); color: var(--text); font-size: var(--fs-sm); border-left: .125rem solid var(--text-2); }
.banner.warn { border-left-color: var(--warning); background: color-mix(in srgb, var(--warning) 7%, var(--surface)); }
.banner.bad { border-left-color: var(--danger); background: var(--danger-soft); }
.banner.good { border-left-color: var(--good); background: var(--accent-soft); }
.banner .icon { flex: none; margin-top: 1px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: var(--s2) 0; }
.or-sep { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: var(--fs-2xs); font-weight: 600; letter-spacing: var(--track-caps); text-transform: uppercase; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
/* Вход через Google: фирменный знак, кнопка в общем стиле */
.btn.provider { background: var(--surface); color: var(--text); border-color: var(--line-strong); gap: .625rem; font-size: var(--fs-md); font-weight: 600; }
.btn.provider:hover { border-color: var(--text); background: var(--surface); color: var(--text); }
.g-mark { width: 1.25rem; height: 1.25rem; flex: none; }

/* ---- Форматированный текст (публикации и комментарии) ---- */
.rt { overflow-wrap: anywhere; white-space: normal; line-height: 1.6; }
.rt > * + * { margin-top: .65em; }
.rt p { white-space: pre-wrap; }
.rt h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.45em; letter-spacing: -.01em; line-height: 1.25; }
.rt h3 { font-size: 1.12em; font-weight: 650; line-height: 1.35; }
.rt blockquote { margin: 0; padding: 0 0 0 1rem; border-left: .125rem solid var(--accent); color: var(--text-2); white-space: pre-wrap; font-family: var(--font-display); font-size: 1.04em; }
.rt pre { margin: 0; padding: .75rem .875rem; border-radius: var(--r-md); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); overflow-x: auto; font-family: var(--font-mono); font-size: .86em; white-space: pre; line-height: 1.55; }
.rt ul, .rt ol { margin: 0; padding-left: 1.5em; }
.rt li + li { margin-top: .2em; }
.rt li::marker { color: var(--muted); }
.rt code { font-family: var(--font-mono); font-size: .86em; padding: 1px .3125rem; border-radius: var(--r-sm); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.rt pre code { padding: 0; background: none; box-shadow: none; }
.rt a { color: var(--accent-strong); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-decoration-thickness: 1px; text-underline-offset: .1875rem; transition: text-decoration-color var(--t-fast); }
.rt a:hover { text-decoration-color: currentColor; }
.rt .spoiler { background: var(--text); color: transparent; border-radius: var(--r-sm); cursor: pointer; transition: background var(--t), color var(--t); }
.rt .spoiler.open { background: var(--surface-2); color: inherit; cursor: auto; }
.rt [data-font="poster"], .editor [data-font="poster"] { font-family: "Bebas Neue", var(--font); font-size: 1.25em; letter-spacing: .02em; }
.rt [data-font="hand"], .editor [data-font="hand"] { font-family: "Caveat", cursive; font-size: 1.3em; }
.rt [data-font="elegant"], .editor [data-font="elegant"] { font-family: "Playfair Display", Georgia, serif; font-style: italic; }

/* ---- Публикация: без рамки, на листе; действия проявляются цветом при наведении ---- */
.post { padding: 1.125rem 1.25rem .625rem; display: grid; gap: .625rem; animation: rise var(--t-slow) var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(.25rem); } }
.post-head { display: flex; gap: var(--s3); align-items: center; min-width: 0; }
.post-head .iconbtn { margin: -.375rem -.5rem -.375rem 0; }
.post-meta { min-width: 0; flex: 1; }
.post-meta .sub { display: flex; align-items: center; gap: .375rem; color: var(--muted); font-size: var(--fs-xs); flex-wrap: wrap; }
.post-meta .sub a:hover { color: var(--text); text-decoration: underline; text-underline-offset: .125rem; }
.post-note { display: flex; align-items: center; gap: .375rem; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; margin-bottom: -.125rem; }
.post .rt { font-size: var(--fs-md); }
.post-actions { display: flex; align-items: center; gap: .25rem; margin: 0 -.625rem; }
.act { display: inline-flex; align-items: center; gap: .375rem; height: 2.25rem; min-width: 2.25rem; padding: 0 .625rem; border-radius: var(--r-full); border: 0; background: none; color: var(--muted); font-weight: 500; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; transition: background var(--t-fast), color var(--t-fast); }
.act:hover { background: var(--surface-2); color: var(--text); }
.act:active .icon { transform: scale(.88); }
.act .icon { transition: transform var(--t-fast) var(--ease); }
.act.like[aria-pressed="true"] { color: var(--like); }
.act.like[aria-pressed="true"] .icon { fill: currentColor; animation: like-pop .42s var(--ease-out); }
@keyframes like-pop { 0% { transform: scale(.6); } 45% { transform: scale(1.28); } 100% { transform: scale(1); } }
.act.like:hover { background: var(--like-soft); color: var(--like); }
.act.repost[aria-pressed="true"], .act.repost:hover { color: var(--repost); }
.act.repost:hover { background: var(--repost-soft); }
.act.save[aria-pressed="true"] { color: var(--text); }
.act.save[aria-pressed="true"] .icon { fill: currentColor; }
.act .views { font-weight: 500; }
/* «Отправить в чат» — как соседние действия, со своим цветом при наведении (как лайк и репост). */
.act.share:hover { background: var(--accent-soft); color: var(--accent-strong); }
/* Фокус с клавиатуры повторяет форму кнопки (глобальный :focus-visible ставит радиус 6px). */
.act:focus-visible { border-radius: var(--r-full); outline-offset: 0; }
.post-hidden { font-size: var(--fs-sm); }
.embed { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3) var(--s4); display: grid; gap: var(--s2); transition: border-color var(--t-fast); }
.embed:hover { border-color: var(--line-strong); }
.embed.gone { color: var(--muted); font-size: var(--fs-sm); background: var(--surface-2); }
.imgrid { display: grid; gap: .125rem; border-radius: var(--r-md); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.imgrid.n1 { grid-template-columns: 1fr; }
.imgrid.n2 { grid-template-columns: 1fr 1fr; aspect-ratio: 2 / 1.1; }
.imgrid.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 3 / 2; }
.imgrid.n3 > :first-child { grid-row: span 2; }
.imgrid.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 4 / 3; }
.imgrid button { border: 0; padding: 0; background: var(--surface-2); min-height: 0; overflow: hidden; cursor: zoom-in; }
.imgrid img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease); }
.imgrid button:hover img { transform: scale(1.015); }
/* Одно фото — рамка в пропорциях фото (--ar из post.js, 4:5…2:1); не влезает по высоте — поля заполняет
   размытая копия этого же фото (--img), а не пустой серый фон */
.imgrid.n1 > button { position: relative; isolation: isolate; display: block; width: 100%; aspect-ratio: var(--ar, 4 / 3); max-height: 35rem; } /* место под фото резервируется заранее — лента не «прыгает», когда оно догрузится */
.imgrid.n1 > button::before {
  content: ""; position: absolute; inset: -1.5rem; z-index: -1; pointer-events: none;
  background: var(--img, none) center / cover no-repeat; filter: blur(1.375rem) saturate(1.15); opacity: .55;
}
.imgrid.n1 img { max-height: 35rem; object-fit: contain; background: transparent; }
.imgrid.n1 > button:hover img { transform: none; }
@media (max-width: 759px) { .imgrid.n1 > button, .imgrid.n1 img { max-height: 70vh; } }
/* Лента: публикации идут одна за другой, разделены линией */
.shell:not(.wide) .main .stack:has(> .post) { gap: 0; }

/* ---- Композер ---- */
.composer { padding: 1.125rem 1.25rem .75rem; display: grid; gap: var(--s3); min-width: 0; }
.composer-ava { flex: none; display: flex; }
.composer-foot { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; min-width: 0; padding-top: .625rem; border-top: 1px dashed var(--line-strong); }
.composer-foot > .btn { margin-left: .375rem; }
.modal-body > .composer { padding: 0; }
.composer-opts { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; flex: 1 1 0; min-width: 0; margin-left: .25rem; }
/* «Чипы» параметров публикации: от чьего имени, кто увидит, комментарии */
.cpick {
  display: inline-flex; align-items: center; gap: .375rem; max-width: 100%; height: var(--control-h-sm); padding: 0 .625rem 0 .5rem;
  border: 1px solid var(--line); border-radius: var(--r-full); background: none; color: var(--muted);
  font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; transition: background var(--t), color var(--t), border-color var(--t);
}
.cpick:hover:not(:disabled), .cpick[aria-expanded="true"] { color: var(--text); background: var(--surface-2); border-color: var(--line-strong); }
.cpick:disabled { opacity: .6; cursor: default; }
.cpick-ic { display: inline-flex; }
.cpick-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cpick-chev { flex: none; width: 0; height: 0; border: .25rem solid transparent; border-top: .3125rem solid currentColor; border-bottom: 0; opacity: .7; }
.menu-head { padding: .375rem .75rem .25rem; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.menu-item[role="menuitemradio"] .mi-check { flex: none; display: inline-flex; color: var(--accent-strong); visibility: hidden; }
.menu-item[role="menuitemradio"][aria-checked="true"] .mi-check { visibility: visible; }
.menu-item[role="menuitemradio"][aria-checked="true"] { color: var(--text); }
.counter { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; padding: 0 .375rem; }
.counter.over { color: var(--danger); font-weight: 700; }
.attachments { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: .5rem; }
.attachment { position: relative; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); animation: rise var(--t) var(--ease-out); }
.attachment img { width: 100%; height: 100%; object-fit: cover; }
.attachment .x { position: absolute; top: .25rem; right: .25rem; width: 1.625rem; height: 1.625rem; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; }
.attachment .progress { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: .25rem; background: rgba(0,0,0,.42); color: #fff; font-size: var(--fs-xs); font-weight: 700; transition: opacity var(--t); }
.attachment .progress .check { display: none; }
.attachment .tile-bar { position: absolute; left: 0; right: 0; bottom: 0; height: .25rem; background: rgba(255,255,255,.25); }
.attachment .tile-bar i { display: block; height: 100%; width: 0; background: #fff; transition: width .15s linear; }
/* Загрузилось: затемнение уходит, остаётся галочка в углу */
.attachment.done .progress { inset: auto auto .25rem .25rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--accent); }
.attachment.done .progress .pct, .attachment.done .progress .tile-bar { display: none; }
.attachment.done .progress .check { display: grid; place-items: center; }
/* Сводка: «Выбрано 3 · загружено 1 из 3» */
.attach-summary { display: grid; gap: .375rem; font-size: var(--fs-sm); color: var(--muted); }
.attach-summary.done { color: var(--text-2); }
.attach-summary-bar { display: block; height: .25rem; border-radius: var(--r-sm); background: var(--surface-2); overflow: hidden; }
.attach-summary-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s var(--ease-out); }
.attach-summary[hidden], .attachments[hidden] { display: none; }
/* Перетаскивание файлов на форму публикации */
.composer { position: relative; }
.composer-drop { position: absolute; inset: .375rem; z-index: 5; display: none; place-content: center; justify-items: center; gap: .5rem; border: .125rem dashed var(--accent); border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface) 90%, var(--accent)); color: var(--accent-strong); pointer-events: none; }
.composer.dropping .composer-drop { display: grid; animation: fade var(--t-fast); }

/* ---- Поле форматированного текста ----
   Разметка фиксированная (editor/engine.js): одна строка — один элемент с data-ln. */
.editor {
  position: relative; min-height: 4rem; max-height: 60vh; overflow-y: auto; outline: none; font-size: var(--fs-lg); line-height: 1.55; padding: .375rem 0;
  overflow-wrap: anywhere; white-space: pre-wrap; word-break: normal; caret-color: var(--accent);
}
.editor.small { font-size: var(--fs-md); min-height: 2.5rem; }
.editor.is-empty::before { content: attr(data-placeholder); position: absolute; color: var(--muted); pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.editor > p, .editor li, .editor h2, .editor h3, .editor blockquote, .editor pre { margin: 0; }
.editor > :is(h2, h3, ul, ol) { margin-top: .35em; }
.editor > :first-child { margin-top: 0; }
.editor h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.4em; letter-spacing: -.01em; line-height: 1.25; }
.editor h3 { font-size: 1.12em; font-weight: 650; }
.editor blockquote { padding-left: 1rem; border-left: .125rem solid var(--accent); color: var(--text-2); font-family: var(--font-display); }
.editor pre { padding: 0 .75rem; background: var(--surface-2); font-family: var(--font-mono); font-size: .86em; line-height: 1.6; white-space: pre-wrap; }
.editor pre:not(pre + pre) { padding-top: .5rem; border-top-left-radius: var(--r-md); border-top-right-radius: var(--r-md); margin-top: .35em; }
.editor pre:not(:has(+ pre)) { padding-bottom: .5rem; border-bottom-left-radius: var(--r-md); border-bottom-right-radius: var(--r-md); margin-bottom: .35em; }
.editor ul, .editor ol { margin: 0; padding-left: 1.5em; }
.editor li::marker { color: var(--muted); }
.editor code { font-family: var(--font-mono); font-size: .86em; padding: 1px .3125rem; border-radius: var(--r-sm); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.editor a { color: var(--accent-strong); text-decoration: underline; text-underline-offset: .1875rem; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.editor [data-spoiler] { background: repeating-linear-gradient(-45deg, var(--surface-3) 0 .25rem, var(--surface-2) .25rem .5rem); border-radius: var(--r-sm); }
.editor-box { display: grid; gap: .5rem; background: var(--surface-2); border-radius: var(--r-md); padding: .375rem .75rem .625rem; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow var(--t-fast), background var(--t-fast); }
.editor-box:focus-within { background: var(--surface); box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 .1875rem var(--accent-soft); }
.editor-box .editor-tools { margin: 0 -.375rem; }

/* Панель форматирования: группы значков, разделённые тонкими линиями */
.editor-tools { display: grid; gap: .375rem; }
.ed-bar { display: flex; align-items: center; gap: .125rem; flex-wrap: wrap; animation: rise var(--t) var(--ease-out); }
.ed-group { display: flex; align-items: center; gap: 1px; }
.ed-group + .ed-group { padding-left: .25rem; margin-left: .1875rem; border-left: 1px solid var(--line); }
.ed-group.end { margin-left: auto; border-left: 0; }
.ed-btn {
  position: relative; width: 2rem; height: 2rem; border-radius: var(--r-sm); border: 0; background: none; color: var(--text-2);
  display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm); transition: background var(--t-fast), color var(--t-fast);
}
.ed-btn:hover { background: var(--surface-3); color: var(--text); }
.ed-btn[aria-pressed="true"], .ed-btn[aria-expanded="true"] { background: var(--text); color: var(--surface); }
.ed-btn[disabled] { opacity: .32; pointer-events: none; }
.ed-btn.i span { font-style: italic; font-family: var(--font-display); font-weight: 400; font-size: 1rem; }
.ed-btn.u span { text-decoration: underline; text-underline-offset: .1875rem; }
.ed-btn.s span { text-decoration: line-through; }
.ed-btn.ed-style span { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-md); }
.ed-btn.ed-style.has-style::after { content: ""; position: absolute; left: .625rem; right: .625rem; bottom: .375rem; height: .125rem; border-radius: .125rem; background: var(--sw); }
.ed-pop { display: grid; gap: .625rem; padding: .25rem; }
.ed-pop-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ed-swatch { width: 1.625rem; height: 1.625rem; border-radius: 50%; border: 0; padding: 0; background: var(--sw); box-shadow: 0 0 0 1px rgba(0,0,0,.1) inset; transition: transform var(--t-fast) var(--ease); }
.ed-swatch:hover { transform: scale(1.12); }
.ed-swatch[aria-pressed="true"] { box-shadow: 0 0 0 .125rem var(--surface), 0 0 0 .25rem var(--sw); }
.ed-swatch.none { display: grid; place-items: center; background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); }
.ed-font { height: 2rem; padding: 0 .75rem; border-radius: var(--r-full); border: 1px solid var(--line-strong); background: none; color: var(--text); font-size: var(--fs-md); transition: border-color var(--t-fast), background var(--t-fast); }
.ed-font:hover { border-color: var(--text); }
.ed-font[aria-pressed="true"] { background: var(--text); color: var(--surface); border-color: var(--text); }
.ed-font.font-poster { font-family: "Bebas Neue", var(--font); font-size: var(--fs-lg); letter-spacing: .03em; }
.ed-font.font-hand { font-family: Caveat, cursive; font-size: var(--fs-xl); }
.ed-font.font-elegant { font-family: "Playfair Display", Georgia, serif; font-style: italic; }

/* ---- Комментарии: нить слева, без пузырей ---- */
.comments { display: grid; gap: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); }
.comment { display: grid; grid-template-columns: auto 1fr; gap: .625rem; animation: rise var(--t) var(--ease-out); }
.comment .bubble { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: .125rem; } /* колонка не шире пузыря: длинное имя или слово не раздвигает комментарий */
.comment .c-head { display: flex; align-items: baseline; gap: .375rem; flex-wrap: wrap; font-size: var(--fs-sm); min-width: 0; }
.comment .c-head .name-line { min-width: 0; max-width: 100%; }
.comment .c-text { font-size: var(--fs-md); }
.comment .c-actions { display: flex; align-items: center; gap: .125rem; margin-left: -.5rem; }
.comment .c-actions .act { height: 1.75rem; font-size: var(--fs-xs); padding: 0 .5rem; }
.comment.deleted .c-text, .comment.hidden .c-text { color: var(--muted); font-style: italic; }
.comment.pending { opacity: .72; }
.replies { display: grid; gap: var(--s3); margin-top: var(--s2); padding-left: .25rem; border-left: 1px solid var(--line-strong); }
.replies .comment { padding-left: .75rem; }
.reply-to { color: var(--accent-strong); font-weight: 600; }
.comment-form { display: grid; grid-template-columns: auto 1fr auto; gap: .625rem; align-items: end; }
.comment-form .editor, .comment-edit .editor { background: var(--surface-2); border-radius: var(--r-md); padding: .5625rem .75rem; min-height: var(--control-h); max-height: 12.5rem; font-size: var(--fs-md); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow var(--t-fast), background var(--t-fast); }
.comment-form .editor:focus, .comment-edit .editor:focus { background: var(--surface); box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 .1875rem var(--accent-soft); }
.comment-form .editor.is-empty::before, .comment-edit .editor.is-empty::before { left: .75rem; }
.comment-form .iconbtn:not([disabled]) { color: var(--accent); }
.comment .c-head time { color: var(--muted); }
.comment .c-text { line-height: 1.5; overflow-wrap: anywhere; }
.comment .c-actions .act { border-radius: var(--r-full); color: var(--muted); transition: color var(--t-fast), background var(--t-fast); }
.comment .c-actions .act:hover { color: var(--text); background: var(--surface-2); }
.comment .c-actions .act:focus-visible { outline: .125rem solid var(--accent); outline-offset: 1px; }
.comment .c-actions .act.like[aria-pressed="true"] { color: var(--like, var(--accent)); }
.comment .c-actions .act.like[aria-pressed="true"] .icon { fill: currentColor; }
.comment .c-actions .act[aria-busy="true"] { opacity: .6; }
.thread { display: grid; gap: var(--s2); }
.thread > .more-replies { justify-self: start; margin-left: 2.375rem; height: 1.75rem; font-size: var(--fs-xs); color: var(--accent-strong); }
.reply-slot:empty { display: none; }
.reply-slot { margin-left: 2.375rem; }
.comments-empty { padding: var(--s3) 0; }
/* Только что добавленный комментарий подсвечивается на секунду — видно, куда он встал. */
.comment.flash > .bubble { animation: comment-flash 1.8s var(--ease); border-radius: var(--r-lg); }
@keyframes comment-flash {
  0%, 30% { background: color-mix(in srgb, var(--accent) 9%, transparent); box-shadow: 0 0 0 .4375rem color-mix(in srgb, var(--accent) 9%, transparent); }
  100% { background: transparent; box-shadow: 0 0 0 .4375rem transparent; }
}
@media (prefers-reduced-motion: reduce) { .comment, .comment.flash > .bubble { animation: none; } }
/* Наведение на комментарий: та же «панель» с мягкой тенью и тонкой рамкой, что у подсказок на профиле (.stk-tip).
   Рисуется подложкой за строкой комментария (::before), поэтому раскладка не двигается и ничего не перекрывается. */
.comment { position: relative; isolation: isolate; }
.comment::before {
  content: ""; position: absolute; inset: -.5rem -.625rem; z-index: -1; pointer-events: none;
  border: 1px solid var(--line); border-radius: var(--tip-r, var(--r-lg)); background: color-mix(in srgb, var(--accent) 4%, var(--surface));
  box-shadow: var(--shadow-pop); opacity: 0; transform: scale(.985);
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.comment:focus-within::before { opacity: 1; transform: none; }
@media (hover: hover) and (pointer: fine) {
  .comment:hover::before { opacity: 1; transform: none; }
}
.comment.deleted::before, .comment.pending::before { box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .comment::before { transition: none; transform: none; } }

/* ---- Списки людей/сообществ ---- */
.list { display: grid; }
.list-row { display: flex; align-items: center; gap: var(--s3); padding: .75rem var(--s5); border-top: 1px solid var(--line); min-width: 0; }
.list-row:first-child { border-top: 0; }
.list-row .text { min-width: 0; flex: 1; }
.list-row .text .sub { color: var(--muted); font-size: var(--fs-sm); }
a.list-row { transition: background var(--t-fast); }
a.list-row:hover { background: var(--surface-2); color: inherit; }

/* ---- Правая колонка: разделы с подписью капителью, без карточек ---- */
.aside .card { background: transparent; border: 0; border-radius: 0; }
.aside .card-head { padding: 0 .125rem .375rem; }
.aside .card-head h3 { font-size: var(--fs-2xs); font-weight: 600; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--muted); }
.aside .list-row { padding: .5rem .375rem; border-top: 0; border-radius: var(--r-md); }
.aside a.list-row:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.aside .searchbox .input { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.legal-links { line-height: 1.8; }
.legal-links a:hover { color: var(--text); text-decoration: underline; }

/* ---- Шапка профиля/сообщества ---- */
.hero { overflow: hidden; }
/* Обложка (components/cover.js): одна пропорция для шапки профиля, сообщества и редактора профиля */
.cover {
  position: relative; width: 100%; aspect-ratio: var(--cover-aspect); background-color: var(--surface-3);
  background-image: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 16%, var(--surface-2)), var(--surface-3));
  background-size: cover; background-position: center;
}
.cover-btn {
  position: absolute; right: .75rem; bottom: .75rem; display: inline-flex; align-items: center; gap: .375rem; height: 2rem; padding: 0 .75rem;
  border: 0; border-radius: var(--r-full); background: rgba(20, 16, 12, .55); color: #fff; font-size: var(--fs-xs); font-weight: 600;
  backdrop-filter: blur(.5rem); -webkit-backdrop-filter: blur(.5rem); transition: background var(--t-fast);
}
.cover-btn:hover { background: rgba(20, 16, 12, .72); }
.hero-body { padding: 0 var(--s5) var(--s5); display: grid; gap: var(--s3); }
/* Аватар заходит на обложку: поднимаем строку над обложкой (у обложки своя кнопка с position). */
.hero-top { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: var(--s3); margin-top: -3rem; }
.hero-top { pointer-events: none; } /* пустая часть строки не перекрывает кнопку «Обложка» */
.hero-top > * { pointer-events: auto; }
.hero-top .avatar { border: .25rem solid var(--surface); }
.hero-top .actions { margin-left: auto; display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; }
.hero h1 { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-2xl); letter-spacing: -.01em; line-height: 1.15; display: flex; align-items: center; flex-wrap: wrap; }
.hero .handle { color: var(--muted); font-weight: 500; }
.stats-row { display: flex; gap: var(--s5); flex-wrap: wrap; }
.stats-row a, .stats-row span { color: var(--muted); }
.stats-row b { color: var(--text); font-weight: 650; margin-right: .25rem; font-variant-numeric: tabular-nums; }
@media (max-width: 759px) { .hero-top { margin-top: -2.5rem; } .hero-top .avatar { --size: 5.5rem; } }

/* ---- Аналитика ---- */
.filters { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.375rem, 1fr)); gap: var(--s3); }
.tile { padding: var(--s4); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); display: grid; gap: .25rem; }
.tile .k { letter-spacing: .01em; }
.tile .k { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.tile .v { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 400; letter-spacing: -.01em; font-variant-numeric: tabular-nums lining-nums; }
.tile .d { font-size: var(--fs-xs); font-weight: 700; }
.tile .d.up { color: var(--good); } .tile .d.down { color: var(--danger); }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: var(--fs-2xs); font-family: var(--font); }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: .12; }
.chart .hair { stroke: var(--line-strong); stroke-width: 1; }
.chart-tip { position: absolute; pointer-events: none; z-index: 2; min-width: 8.125rem; padding: .5rem .625rem; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-pop); font-size: var(--fs-xs); }
.chart-tip .t { color: var(--muted); margin-bottom: .25rem; }
.chart-tip .r { display: flex; align-items: center; gap: .375rem; }
.chart-tip .r b { font-size: var(--fs-sm); color: var(--text); font-variant-numeric: tabular-nums; }
.chart-tip .key { width: .75rem; height: .125rem; border-radius: .125rem; }
.legend { display: flex; gap: var(--s4); flex-wrap: wrap; font-size: var(--fs-xs); color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: .375rem; }
.legend i { width: .875rem; height: .125rem; border-radius: .125rem; display: inline-block; }

/* ---- Таблицы ---- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; font-weight: 600; font-size: var(--fs-2xs); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--muted); padding: .625rem .75rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .625rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.pager { display: flex; align-items: center; gap: var(--s2); justify-content: flex-end; padding: var(--s3) var(--s4); }

/* ---- Просмотр фото и кадрирование ---- */
.lightbox { position: fixed; inset: 0; z-index: var(--z-modal); background: rgba(0,0,0,.9); display: grid; place-items: center; animation: fade var(--t); }
.lightbox img { max-width: 94vw; max-height: 90vh; object-fit: contain; border-radius: var(--r-md); }
.lightbox .close { position: absolute; top: 1rem; right: 1rem; color: #fff; background: rgba(255,255,255,.12); }
.cropper { position: relative; width: 100%; overflow: hidden; border-radius: var(--r-md); background: #111; touch-action: none; cursor: grab; user-select: none; }
.cropper img { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.cropper .frame { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 .125rem rgba(255,255,255,.85); }
.cropper.round .frame { border-radius: 50%; box-shadow: 0 0 0 62.4375rem rgba(0,0,0,.45), inset 0 0 0 .125rem rgba(255,255,255,.85); }
input[type="range"] { width: 100%; accent-color: var(--accent); }

/* ---- Поиск ---- */
.searchbox { position: relative; }
.searchbox .icon { position: absolute; left: .875rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.searchbox .input { padding-left: 2.625rem; border-radius: var(--r-full); }

/* ---- Прочее ---- */
.divider { height: 1px; background: var(--line); }
.kbd { font-family: var(--font-mono); font-size: var(--fs-xs); padding: .125rem .375rem; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.qr { word-break: break-all; font-family: var(--font-mono); font-size: var(--fs-sm); padding: .625rem .75rem; border-radius: var(--r-md); background: var(--surface-2); }
.dot { width: .25rem; height: .25rem; border-radius: 50%; background: currentColor; opacity: .6; display: inline-block; }

/* ============================ Настройки ============================ */
/* Двухколоночный экран: список разделов + содержимое. На телефоне — список → раздел. */
.settings-page { width: 100%; max-width: var(--page-w); display: grid; gap: var(--s4); }
.settings { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.settings-nav {
  position: sticky; top: 1.5rem; max-height: calc(100vh - 3rem); overflow-y: auto; scrollbar-width: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; padding: .25rem 1.125rem .5rem 0;
  border-right: 1px solid var(--line);
}
.settings-me { display: flex; align-items: center; gap: .75rem; padding: .625rem; border-radius: var(--r-md); color: var(--text); }
.settings-me:hover { background: var(--surface-2); color: var(--text); }
.settings-me .text { flex: 1; min-width: 0; }
.settings-me .sub { font-size: var(--fs-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-me > .icon { color: var(--muted); }
.settings-group-title { padding: 1.125rem .75rem .375rem; font-size: var(--fs-2xs); font-weight: 600; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--muted); }
.settings-group { display: grid; grid-template-columns: minmax(0, 1fr); gap: .125rem; }
.settings-link { position: relative; display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem; border-radius: var(--r-md); color: var(--text-2); transition: background var(--t-fast), color var(--t-fast); }
.settings-link:hover { background: var(--surface-2); color: var(--text); }
.settings-link[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.settings-link[aria-current="page"] .text b { font-weight: 650; }
.settings-link .text { flex: 1; min-width: 0; display: grid; }
.settings-link .text b { font-weight: 550; line-height: 1.3; }
.settings-link .sub { font-size: var(--fs-xs); color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } /* пояснение до двух строк — понятно без открытия раздела */
.settings-link .chev { color: var(--muted); opacity: 0; transition: opacity var(--t-fast); }
.settings-link:hover .chev, .settings-link[aria-current="page"] .chev { opacity: 1; }
/* Цветные плитки иконок — семантические токены, по одному тону на раздел. */
[data-tone] { --tone: var(--text-2); }
[data-tone="accent"] { --tone: var(--accent); }
[data-tone="info"] { --tone: var(--series-1); }
[data-tone="good"] { --tone: var(--good); }
[data-tone="like"] { --tone: var(--like); }
[data-tone="warn"] { --tone: var(--warning); }
[data-tone="danger"] { --tone: var(--danger); }
/* Иконки разделов — спокойные, без цветных плашек; цвет остаётся только у опасных действий. */
.sl-ic, .srow-ic {
  width: 2.125rem; height: 2.125rem; border-radius: var(--r-lg); flex: none; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2);
}
.sl-ic { width: 1.375rem; background: none; color: inherit; }
[data-tone="danger"].srow-ic, .srow.danger .srow-ic { background: var(--danger-soft); color: var(--danger); }
.settings-body { display: grid; gap: 1.25rem; min-width: 0; max-width: var(--content-w); grid-template-columns: minmax(0, 1fr); }
.settings-head { display: flex; align-items: center; gap: var(--s3); min-height: 2.5rem; }
.settings-head h1 { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-2xl); letter-spacing: -.01em; line-height: 1.1; }
.settings-head .back { display: none; width: 2.375rem; height: 2.375rem; margin-left: -.5rem; border-radius: var(--r-full); place-items: center; background: none; border: 0; color: var(--text); }

/* Группа настроек: подпись над карточкой, строки внутри. */
.sgroup { display: grid; gap: .5rem; scroll-margin-top: 5.25rem; }
.sgroup-title { padding: 0 .25rem; font-size: var(--fs-2xs); font-weight: 600; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--muted); }
.sgroup-card { overflow: hidden; }
.sgroup-pad { padding: var(--s4); }
.sgroup-foot { margin-top: -.75rem; padding: 0 .25rem; font-size: var(--fs-xs); color: var(--muted); }
.srow { display: flex; flex-wrap: wrap; align-items: center; gap: .625rem .875rem; padding: .875rem 1rem; border-top: 1px solid var(--line); min-width: 0; }
.srow:first-child { border-top: 0; }
.srow > .text { flex: 1 1 13.75rem; min-width: 0; display: grid; gap: .125rem; }
.srow > .text b { font-weight: 600; }
.srow .sub { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; min-width: 0; font-size: var(--fs-sm); color: var(--muted); }
.srow-end { display: flex; align-items: center; gap: .5rem; margin-left: auto; flex: none; }
.srow.clickable { cursor: pointer; transition: background var(--t-fast); }
.srow.clickable:hover { background: var(--surface-2); }
.srow.danger > .text b { color: var(--danger); }
.srow-actions { justify-content: flex-end; }
.srow-foot { padding: 0 1rem .875rem; font-size: var(--fs-xs); color: var(--muted); }
.sgroup-list .list-row { padding: .875rem 1rem; }
.btn.danger-text { color: var(--danger); }
.srow .select.sm { min-width: var(--field-w-sm); }

/* Профиль: обложка + аватар как в шапке профиля — результат виден сразу. */
.pe { overflow: hidden; }
.pe { max-width: var(--main-w); }
/* На телефоне — во всю ширину, как шапка профиля: обложка совпадает и по размеру */
@media (max-width: 759px) { .pe { margin: 0 -1rem; border-radius: 0; border-left: 0; border-right: 0; } }
.pe .hero-body { padding-top: 0; }
.pe-avatar { position: relative; padding: 0; border: 0; background: none; border-radius: 50%; }
.pe-cam {
  position: absolute; right: .125rem; bottom: .125rem; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--btn-bg); color: var(--btn-fg); border: .1875rem solid var(--surface); transition: transform var(--t-fast);
}
.pe-avatar:hover .pe-cam { transform: scale(1.08); }
.pe-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--s2); flex-wrap: wrap; }
.pe-history { margin-right: auto; }
.pe-history summary { cursor: pointer; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); padding: .375rem 0; }
.pe-history summary:hover { color: var(--text); }
.pe-history[open] { flex-basis: 100%; order: 5; }
.pe-hlist { display: grid; gap: .25rem; margin-top: .375rem; padding: .625rem .75rem; border-radius: var(--r-md); background: var(--surface-2); }
.pe-hrow { display: flex; justify-content: space-between; gap: .75rem; font-size: var(--fs-sm); }

/* Бейдж у имени: предпросмотр + выбор одного. */
.badge-preview { display: grid; gap: .5rem; padding: .875rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.badge-preview .sub { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.badge-preview-line { display: flex; align-items: center; gap: .625rem; min-width: 0; }
.badge-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(14.375rem, 1fr)); gap: .5rem; }
.badge-opt {
  display: flex; align-items: center; gap: .75rem; min-width: 0; padding: .625rem .75rem; text-align: left; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.badge-opt:hover { border-color: var(--line-strong); }
.badge-opt[aria-busy="true"] { opacity: .6; }
.badge-opt .mark { width: 3rem; height: 3rem; flex: none; display: grid; place-items: center; border-radius: var(--r-xl); background: var(--surface-2); }
.badge-opt .mark .ubadge { margin: 0; }
.badge-opt .text { flex: 1; min-width: 0; display: grid; }
.badge-opt .text b { font-size: var(--fs-sm); }
.badge-opt .sub { font-size: var(--fs-xs); color: var(--muted); }
.badge-opt .check {
  width: 1.375rem; height: 1.375rem; flex: none; display: grid; place-items: center; border-radius: 50%;
  border: 1.5px solid var(--line-strong); color: transparent; transition: all var(--t-fast);
}
.badge-opt[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 .1875rem var(--accent-soft); }
.badge-opt[aria-checked="true"] .check { background: var(--accent); border-color: var(--accent); color: var(--inverse); }

/* Оформление: миниатюры тем. Цвета миниатюр фиксированы — это образцы, а не текущая тема. */
.theme-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.theme-opt { display: grid; gap: .625rem; padding: 0; border: 0; background: none; text-align: left; color: var(--text); }
.theme-mock {
  display: flex; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--r-md); border: 1px solid var(--line);
  outline: .125rem solid transparent; outline-offset: .1875rem; transition: outline-color var(--t-fast);
}
.theme-opt:hover .theme-mock { outline-color: var(--line-strong); }
.theme-opt[aria-checked="true"] .theme-mock { outline-color: var(--accent); }
.theme-mock .half { flex: 1; overflow: hidden; display: flex; }
.theme-mock .half .mock { flex: none; width: 200%; }
.theme-mock .half.dark .mock { margin-left: -100%; }
.mock { flex: 1; display: flex; gap: 6%; padding: 9%; background: var(--m-bg); }
.theme-mock.light, .theme-mock .light { --m-bg: #f4f0e8; --m-surface: #fffdf8; --m-line: #e2d9cb; --m-accent: #17684f; }
.theme-mock.dark, .theme-mock .dark { --m-bg: #12100e; --m-surface: #1f1b17; --m-line: #3d362f; --m-accent: #6cc7a3; }
.theme-mock.oled { --m-bg: #000000; --m-surface: #000000; --m-line: #332d27; --m-accent: #6cc7a3; }
.theme-mock.oled .mock-nav, .theme-mock.oled .mock-post { box-shadow: inset 0 0 0 1px #2a2520; }
.theme-desc { display: block; font-size: var(--fs-xs); font-weight: 400; color: var(--muted); }
.mock-nav { width: 22%; border-radius: var(--r-md); background: var(--m-surface); }
.mock-main { flex: 1; display: grid; gap: 8%; align-content: start; }
.mock-post { display: grid; gap: .3125rem; padding: 9%; border-radius: var(--r-md); background: var(--m-surface); }
.mock-post i { width: .75rem; height: .75rem; border-radius: 50%; background: var(--m-accent); }
.mock-post b { height: .25rem; width: 90%; border-radius: .125rem; background: var(--m-line); }
.mock-post b.s { width: 58%; }
.theme-label { display: flex; align-items: center; gap: .5rem; font-size: var(--fs-sm); font-weight: 600; }
.theme-label .radio { width: 1.125rem; height: 1.125rem; flex: none; border-radius: 50%; border: .125rem solid var(--line-strong); transition: all var(--t-fast); }
.theme-opt[aria-checked="true"] .radio { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 .1875rem var(--surface); }

.theme-mock { position: relative; }

  
  

@media (max-width: 759px) {
  .settings { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
  .settings[data-view="list"] .settings-body { display: none; }
  .settings[data-view="detail"] .settings-nav { display: none; }
  .settings-page:has(.settings[data-view="detail"]) > .page-head { display: none; }
  .settings-nav { position: static; padding: 0; border-right: 0; max-height: none; }
  .settings-link { padding: .6875rem .625rem; }
  .settings-link .chev { opacity: 1; }
  .settings[data-view="list"] .settings-link[aria-current="page"] { background: none; }
  /* Заголовок раздела с кнопкой «назад» не уезжает при прокрутке — вернуться к списку можно из любого места */
  .settings-head { position: sticky; top: calc(3.375rem + env(safe-area-inset-top)); z-index: 5; margin: 0 -1rem; padding: var(--s2) 1rem; background: var(--surface); border-bottom: 1px solid var(--line); }
  .settings-head h1 { font-size: var(--fs-xl); line-height: 1.15; }
  .settings-head .back { display: grid; }
  .settings-body { gap: 1rem; }
  .sgroup-foot { margin-top: -.5rem; }
  .srow { padding: .8125rem .875rem; gap: .625rem .75rem; }
  .srow > .text { flex-basis: 0; }
  .srow:has(.select) .srow-end { width: 100%; padding-left: 2.875rem; }
  .srow:has(.select) .select { width: 100%; }
  .pe-history { flex-basis: 100%; }
  .theme-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .875rem .625rem; }
  .theme-label { font-size: var(--fs-xs); gap: .375rem; }
}

/* ======================= Статистика профиля ======================= */
/* Не «панель аналитики», а короткий рассказ: итог фразой → показатели → график → детали. */
.ps { container-type: inline-size; display: grid; gap: .875rem; }
.ps-top { display: flex; align-items: center; justify-content: space-between; gap: .625rem 1rem; flex-wrap: wrap; }
.ps-note { display: inline-flex; align-items: center; gap: .375rem; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.ps-note:hover { color: var(--accent-strong); }
.ps-body-wrap { transition: opacity var(--t); }
.ps-body-wrap.loading { opacity: .55; pointer-events: none; }
.ps-body { display: grid; gap: .875rem; grid-template-columns: minmax(0, 1fr); }
.ps-dim { color: var(--muted); }

.ps-hero {
  position: relative; display: grid; gap: .625rem; padding: 1.5rem 1.5rem 1.375rem; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-xl);
  background:
    radial-gradient(110% 120% at 100% 0%, color-mix(in srgb, var(--series-1) 11%, transparent), transparent 55%),
    var(--surface);
}
.ps-eyebrow { font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ps-headline { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-3xl); line-height: 1.15; letter-spacing: -.01em; max-width: 22ch; text-wrap: balance; }
.ps-headline em { font-style: normal; color: var(--series-1); white-space: nowrap; }
.ps-heroline { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .75rem; font-size: var(--fs-sm); color: var(--text-2); }
.ps-delta {
  display: inline-flex; align-items: center; gap: .125rem; padding: .125rem .5rem; border-radius: var(--r-full);
  font-size: var(--fs-xs); font-weight: 700; font-variant-numeric: tabular-nums; background: var(--surface-2); color: var(--text-2);
}
.ps-delta.up { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.ps-delta.down { background: var(--danger-soft); color: var(--danger); }
.ps-delta i { font-style: normal; }

.ps-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .625rem; }
.ps-metric {
  --c: var(--accent); position: relative; display: grid; gap: .25rem; justify-items: start; min-width: 0; padding: .875rem .875rem .625rem;
  text-align: left; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.ps-metric:hover { border-color: var(--line-strong); }
.ps-metric:active { transform: scale(.985); }
.ps-metric[aria-selected="true"] { border-color: var(--c); box-shadow: 0 0 0 .1875rem color-mix(in srgb, var(--c) 16%, transparent); }
.ps-metric .k { display: flex; align-items: center; gap: .375rem; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.ps-key { width: .5rem; height: .5rem; border-radius: 50%; background: var(--c); }
.ps-metric .v { font-size: var(--fs-2xl); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ps-spark { width: 100%; height: 1.875rem; margin-top: .25rem; overflow: visible; }
.ps-spark path { stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.ps-metric[aria-selected="false"] .ps-spark path { opacity: .45; }

.ps-card { display: grid; gap: .75rem; padding: 1.125rem 1.125rem .875rem; }
.ps-card-head { display: flex; align-items: center; gap: .5rem .75rem; flex-wrap: wrap; }
.ps-card-head h3 { font-size: var(--fs-lg); }
.ps-card-head .btn.sm { --h: 1.875rem; margin: -.25rem -.375rem -.25rem 0; }
.ps-legend { display: flex; flex-wrap: wrap; margin-top: -.375rem; gap: .25rem .875rem; font-size: var(--fs-xs); color: var(--muted); }
.ps-legend span { display: inline-flex; align-items: center; gap: .375rem; }
.ps-legend i.solid { width: .875rem; height: .1875rem; border-radius: .125rem; }
.ps-legend i.dash { width: .875rem; border-top: .125rem dashed var(--muted); opacity: .8; }
.ps-plot { position: relative; }
.ps-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.ps-grid { stroke: var(--grid); stroke-width: 1; stroke-dasharray: 2 4; }
.ps-grid.zero { stroke: var(--line-strong); stroke-dasharray: none; }
.ps-axis { fill: var(--muted); font-size: var(--fs-2xs); font-family: var(--font); font-variant-numeric: tabular-nums; }
.ps-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.ps-prev { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .7; }
.ps-hair { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.ps-tip {
  position: absolute; top: 0; transform: translateX(-50%); z-index: 2; pointer-events: none; display: grid; gap: .125rem;
  min-width: 7rem; padding: .5rem .75rem; border-radius: var(--r-md); background: var(--btn-bg); color: var(--btn-fg);
  font-size: var(--fs-xs); box-shadow: var(--shadow-pop); white-space: nowrap;
}
.ps-tip .d, .ps-tip .p { opacity: .7; }
.ps-tip .v { display: flex; align-items: center; gap: .375rem; }
.ps-tip .v b { font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.ps-tip .v i { width: .5rem; height: .5rem; border-radius: 50%; }

.ps-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .875rem; }
.ps-small { align-content: start; }
.ps-small .ps-card-head { color: var(--muted); }
.ps-small .ps-card-head h3 { font-size: var(--fs-md); color: var(--text); }
.ps-big { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.ps-big b { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-3xl); line-height: 1; }
.ps-big span { color: var(--muted); }
.ps-balance { display: flex; gap: .1875rem; height: .625rem; }
.ps-balance span { border-radius: var(--r-full); }
.ps-balance .in { background: var(--repost); }
.ps-balance .out { flex: 1; background: color-mix(in srgb, var(--danger) 55%, transparent); }
.ps-balance-legend { display: flex; justify-content: space-between; gap: .5rem; font-size: var(--fs-sm); color: var(--text-2); }
.ps-balance-legend i { display: inline-block; width: .5rem; height: .5rem; margin-right: .375rem; border-radius: 50%; }
.ps-balance-legend i.in { background: var(--repost); }
.ps-balance-legend i.out { background: color-mix(in srgb, var(--danger) 55%, transparent); }
.ps-small > p { font-size: var(--fs-sm); }
.ps-rhythm { display: flex; align-items: center; gap: .875rem; }
.ps-ringbox { position: relative; width: 4rem; height: 4rem; flex: none; }
.ps-ring { width: 4rem; height: 4rem; }
.ps-ring circle { fill: none; stroke-width: 7; }
.ps-ring .track { stroke: var(--surface-3); }
.ps-ring .fill { stroke: var(--accent); stroke-linecap: round; }
.ps-ringbox > b { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--fs-lg); font-weight: 800; }
.ps-rhythm .ps-dim { font-size: var(--fs-sm); }
.ps-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .625rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.ps-facts > div { display: grid; gap: .125rem; }
.ps-facts span { font-size: var(--fs-xs); }
.stats-page { width: 100%; max-width: var(--page-w); }

/* Календарь публикаций (components/postCalendar.js) */
.pc-views button { padding: .375rem .75rem; }
.pc-nav { display: flex; align-items: center; gap: .25rem; margin-top: -.25rem; }
.pc-title { font-size: var(--fs-md); font-weight: 700; min-width: 0; text-align: center; padding: 0 .25rem; }
.pc-next svg { transform: scaleX(-1); }
.iconbtn:disabled { opacity: .35; pointer-events: none; }
.pc-summary { font-size: var(--fs-sm); margin-top: -.375rem; min-height: 1.4em; }
.pc-body { transition: opacity var(--t); min-height: 7.5rem; }
.pc-body.loading { opacity: .55; }
.pc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .25rem; }
.pc-wd { font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: center; padding-bottom: .125rem; }
.pc-cell {
  --heat: 0; position: relative; aspect-ratio: 1 / .82; min-height: 2.5rem; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--series-1) calc(var(--heat) * 34%), var(--surface)); color: var(--text);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: .375rem .4375rem; text-align: left;
  font-variant-numeric: tabular-nums; transition: border-color var(--t-fast), transform var(--t-fast);
}
.pc-cell:hover:not(:disabled) { border-color: var(--line-strong); }
.pc-cell:active:not(:disabled) { transform: scale(.97); }
.pc-cell:focus-visible { outline: .125rem solid var(--accent); outline-offset: 1px; }
.pc-cell.out { opacity: .45; }
.pc-cell:disabled { opacity: .3; cursor: default; }
.pc-cell.today { border-color: var(--series-1); box-shadow: inset 0 0 0 1px var(--series-1); }
.pc-num { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.pc-cell.has .pc-num { color: var(--text); }
.pc-count { align-self: flex-end; min-width: 1.25rem; padding: 0 .375rem; border-radius: var(--r-full); background: var(--surface); font-size: var(--fs-xs); line-height: 1.25rem; text-align: center; box-shadow: 0 0 0 1px var(--line); }
.pc-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .25rem; margin-bottom: .5rem; }
.pc-sday { display: grid; justify-items: center; gap: 1px; padding: .375rem .125rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--text-2); font-variant-numeric: tabular-nums; }
.pc-sday span { font-size: var(--fs-2xs); color: var(--muted); }
.pc-sday i { font-style: normal; font-size: var(--fs-xs); color: var(--muted); }
.pc-sday.has { background: color-mix(in srgb, var(--series-1) 12%, var(--surface)); }
.pc-sday.has i { color: var(--series-1); font-weight: 700; }
.pc-sday.today { border-color: var(--series-1); }
.pc-sday:disabled { opacity: .35; }
.pc-list { display: grid; }
.pc-dayhead { margin: .75rem 0 .125rem; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pc-dayhead:first-child { margin-top: 0; }
.pc-dayhead button { border: 0; background: none; padding: 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.pc-dayhead button:hover { color: var(--accent-strong); }
.pc-post { display: flex; gap: .75rem; align-items: flex-start; padding: .625rem .25rem; border-top: 1px solid var(--line); color: var(--text); min-width: 0; }
.pc-dayhead + .pc-post, .pc-list > .pc-post:first-child { border-top: 0; }
.pc-post:hover { background: var(--surface-2); border-radius: var(--r-sm); }
.pc-time { flex: none; width: 2.75rem; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 1px; }
.pc-post-main { flex: 1; min-width: 0; display: grid; gap: .25rem; }
.pc-text { font-size: var(--fs-sm); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.pc-tags { display: flex; flex-wrap: wrap; gap: .25rem; }
.pc-tags:empty { display: none; }
.pc-tag { display: inline-flex; align-items: center; gap: .25rem; padding: 1px .5rem; border-radius: var(--r-full); background: var(--surface-2); font-size: var(--fs-2xs); font-weight: 600; color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-tag.bad { background: var(--danger-soft); color: var(--danger); }
.pc-tag .icon.xs { width: .75rem; height: .75rem; }
.pc-nums { display: flex; flex-wrap: wrap; gap: .25rem .875rem; font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.pc-nums span { display: inline-flex; align-items: center; gap: .25rem; }
.pc-nums .icon.xs { width: .8125rem; height: .8125rem; }
.pc-thumb { flex: none; width: 3.5rem; height: 3.5rem; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-2); }
.pc-empty { padding: 1.5rem 0; text-align: center; color: var(--muted); font-size: var(--fs-sm); }
.pc-more { justify-self: center; margin-top: .5rem; }
.pc-body > .pc-more { display: flex; margin: .5rem auto 0; }
.pc-body > .pc-more[hidden] { display: none; }

@container (max-width: 640px) {
  .ps-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ps-pair { grid-template-columns: minmax(0, 1fr); }
  .ps-hero { padding: 1.25rem 1.125rem 1.125rem; border-radius: var(--r-lg); }
  .ps-headline { font-size: var(--fs-2xl); }
}
@container (max-width: 520px) {
  .pc .ps-card-head .spacer { display: none; }
  .pc-views { width: 100%; }
  .pc-views button { flex: 1; }
  .pc-cell { aspect-ratio: auto; min-height: 2.75rem; padding: .25rem .3125rem; }
  .pc-count { min-width: 1rem; padding: 0 .25rem; font-size: var(--fs-2xs); line-height: 1rem; }
  .pc-thumb { width: 2.75rem; height: 2.75rem; }
}
@container (max-width: 400px) {
  .ps-periods { width: 100%; }
  .ps-periods button { flex: 1; padding: .4375rem .5rem; }
  .ps-metric .v { font-size: var(--fs-xl); }
  .ps-card { padding: 1rem .875rem .75rem; }
}

/* ============================ Поддержка ============================ */
.support-page { width: 100%; max-width: var(--page-w); display: grid; gap: var(--s4); }
.support-lead { color: var(--muted); font-size: var(--fs-sm); margin-top: -.375rem; padding: 0 .25rem; }
.ticket-row { display: flex; align-items: center; gap: .75rem; padding: .875rem 1rem; border-top: 1px solid var(--line); color: var(--text); min-width: 0; }
.ticket-row:first-child { border-top: 0; }
.ticket-row:hover { background: var(--surface-2); color: var(--text); }
.ticket-row > .text { flex: 1; min-width: 0; display: grid; gap: .125rem; }
.ticket-row > .icon { color: var(--muted); }
.ticket-row .sub { font-size: var(--fs-sm); color: var(--muted); }
.ticket-row.closed b { color: var(--text-2); font-weight: 600; }
.ticket-row.unread b { font-weight: 800; }
.ticket-top { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: .125rem .625rem; font-size: var(--fs-xs); color: var(--muted); }
.ticket-meta span + span::before { content: "·"; margin-right: .625rem; opacity: .7; }
.dot-new { flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--like); }
.cat-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.875rem, 1fr)); gap: .5rem; }
.cat-opt { display: flex; align-items: center; gap: .625rem; padding: .6875rem .75rem; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: var(--fs-sm); text-align: left; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.cat-opt:hover { border-color: var(--line-strong); }
.cat-opt[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 .1875rem var(--accent-soft); color: var(--text); }
.cat-opt[aria-checked="true"] .icon { color: var(--accent-strong); }

/* Переписка */
.chat-card { display: flex; flex-direction: column; height: calc(100vh - 2.5rem); max-height: 53.75rem; min-height: 30rem; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); min-width: 0; }
.chat-head .text { flex: 1; min-width: 0; }
.chat-head h1 { font-size: var(--fs-lg); font-weight: 700; }
.chat-head .back, .sup-back { width: 2.375rem; height: 2.375rem; flex: none; border-radius: var(--r-full); display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem; background: var(--bg); }
.chat-log { display: grid; gap: .25rem; }
.chat-day { justify-self: center; margin: .625rem 0 .375rem; padding: .1875rem .625rem; border-radius: var(--r-full); background: var(--surface-2); color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.chat-sys { justify-self: center; display: flex; gap: .5rem; align-items: baseline; max-width: 90%; margin: .375rem 0; font-size: var(--fs-xs); color: var(--muted); text-align: center; }
.chat-sys time { opacity: .7; }
.chat-msg { display: flex; gap: .5rem; align-items: flex-end; max-width: min(78%, 35rem); margin-top: .5rem; }
.chat-msg.cont { margin-top: 0; }
.chat-msg.own { justify-self: end; flex-direction: row-reverse; }
.chat-ava { width: 2.25rem; flex: none; }
.chat-staff-ava { background: var(--accent-soft) !important; color: var(--accent-strong); }
.chat-col { display: grid; gap: .1875rem; min-width: 0; }
.chat-msg.own .chat-col { justify-items: end; }
.chat-who { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); padding: 0 .75rem; }
.chat-bubble { padding: .5625rem .8125rem .375rem; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.chat-msg.other .chat-bubble { border-bottom-left-radius: .375rem; }
.chat-msg.own .chat-bubble { background: var(--btn-bg); color: var(--btn-fg); border-color: transparent; border-bottom-right-radius: .375rem; }
.chat-msg.cont.other .chat-bubble { border-top-left-radius: .375rem; }
.chat-msg.cont.own .chat-bubble { border-top-right-radius: .375rem; }
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.chat-meta { display: flex; justify-content: flex-end; align-items: center; gap: .25rem; margin-top: .125rem; font-size: var(--fs-2xs); opacity: .6; }
.chat-hint { justify-self: center; margin-top: .75rem; padding: .5rem .875rem; border-radius: var(--r-md); background: var(--accent-soft); color: var(--text-2); font-size: var(--fs-sm); text-align: center; }
.chat-foot { position: relative; display: grid; gap: .5rem; padding: .75rem 1rem; border-top: 1px solid var(--line); background: var(--surface); }
.chat-closed { display: flex; align-items: center; gap: .5rem; font-size: var(--fs-sm); color: var(--muted); }
.chat-compose { display: flex; align-items: flex-end; gap: .5rem; }
.chat-input {
  flex: 1; min-height: var(--control-h); max-height: 13.75rem; resize: none; padding: .625rem .875rem; border-radius: calc(var(--control-h) / 2); line-height: 1.4;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); outline: none;
}
.chat-input:focus { border-color: var(--accent); box-shadow: 0 0 0 .1875rem var(--accent-soft); background: var(--surface); }
/* Браузер сам подгоняет высоту под текст (core/autosize.js добавляет класс): JS поле не трогает, автокоррекция телефона не сбивается. */
textarea.autosize-native { field-sizing: content; overflow-y: auto; }
.chat-send { --h: var(--control-h); width: var(--control-h); padding: 0; flex: none; border-radius: var(--r-xl); }
.chat-send .icon { stroke-width: 2.4; }
.chat-compose .iconbtn { width: var(--control-h); height: var(--control-h); flex: none; }

/* Админка: очередь + переписка + карточка пользователя */
.tab-count { margin-left: .25rem; min-width: 1.125rem; height: 1.125rem; padding: 0 .3125rem; border-radius: var(--r-full); background: var(--like); color: #fff; font-size: var(--fs-2xs); display: inline-grid; place-items: center; }
.tab-count:empty { display: none; }
.sup-layout { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); gap: 1rem; align-items: start; }
.sup-queue { position: sticky; top: 1.25rem; display: flex; flex-direction: column; max-height: calc(100vh - 2.5rem); overflow: hidden; }
.sup-filters { display: grid; gap: .625rem; padding: .75rem; border-bottom: 1px solid var(--line); }
.sup-seg { display: flex; flex-wrap: wrap; border-radius: var(--r-md); }
.sup-seg button { flex: 1 1 auto; border-radius: var(--r-lg); padding: .375rem .5rem; display: inline-flex; align-items: center; justify-content: center; gap: .3125rem; }
.sup-count { font-size: var(--fs-2xs); font-weight: 800; color: var(--accent-strong); }
.sup-count:empty { display: none; }
.sup-search { min-height: var(--control-h); }
.sup-filters .select.sm { flex: 1; min-width: 0; }
.sup-list { overflow-y: auto; }
.sup-row { position: relative; display: flex; gap: .625rem; align-items: flex-start; padding: .75rem; border-top: 1px solid var(--line); color: var(--text); min-width: 0; }
.sup-row:first-child { border-top: 0; }
.sup-row:hover { background: var(--surface-2); color: var(--text); }
.sup-row.on { background: var(--accent-soft); }
.sup-row .text { flex: 1; min-width: 0; display: grid; gap: .1875rem; }
.sup-row .sub { font-size: var(--fs-sm); color: var(--muted); }
.sup-row.unread b { font-weight: 800; }
.sup-row .dot-new { position: absolute; top: 1rem; right: .75rem; }
.sup-row-top { display: flex; align-items: baseline; gap: .5rem; min-width: 0; }
.sup-row-top b { flex: 1; }
.sup-row-top time { flex: none; font-size: var(--fs-xs); color: var(--muted); }
.sup-row.unread .sup-row-top time { margin-right: .875rem; }
.sup-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; font-size: var(--fs-xs); color: var(--muted); min-width: 0; }
.sup-pane { min-height: 35rem; display: flex; flex-direction: column; overflow: hidden; }
.sup-pane > .state { margin: auto; }
.sup-loading { padding: .75rem; }
.sup-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.sup-head .text { flex: 1 1 16.25rem; min-width: 0; display: grid; gap: .25rem; }
.sup-head h2 { font-size: var(--fs-lg); }
.sup-back { display: none; }
.sup-actions { display: flex; align-items: center; gap: .375rem; flex-wrap: wrap; }
.sup-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 15.625rem; min-height: 0; }
.sup-chat { display: flex; flex-direction: column; min-width: 0; height: calc(100vh - 9.375rem); max-height: 51.25rem; min-height: 30rem; }
.sup-foot-row { display: flex; align-items: center; gap: .5rem; }
.sup-foot-row .hint { flex: 1; }
.sup-info { border-left: 1px solid var(--line); padding: 1rem; display: grid; gap: .875rem; align-content: start; font-size: var(--fs-sm); overflow-y: auto; }
.sup-info .text { min-width: 0; }
.sup-info .sub { color: var(--muted); font-size: var(--fs-xs); }
.sup-facts { display: grid; gap: .25rem; color: var(--muted); }
.sup-facts b { color: var(--text); font-weight: 600; }
.sup-other { display: grid; gap: .125rem; }
.sup-other-title { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .25rem; }
.sup-other a { display: flex; align-items: center; gap: .5rem; padding: .375rem .5rem; margin: 0 -.5rem; border-radius: var(--r-sm); min-width: 0; }
.sup-other a:hover { background: var(--surface-2); }
.sup-other a span:first-child { flex: 1; min-width: 0; }

/* Быстрые ответы: панель над полем ввода */
.qr-panel {
  position: absolute; left: .75rem; right: .75rem; bottom: calc(100% - .25rem); z-index: 5; display: grid; gap: .5rem; padding: .625rem;
  max-height: min(26.25rem, 60vh); background: var(--surface); border-radius: var(--pop-r); box-shadow: var(--shadow-pop);
  grid-template-rows: auto auto minmax(0, 1fr) auto; animation: pop var(--t) var(--ease);
}
.qr-top { display: flex; gap: .375rem; }
.qr-top .input { min-height: var(--control-h); }
.qr-cats { display: flex; gap: .375rem; overflow-x: auto; scrollbar-width: none; }
.qr-cats .chip { flex: none; height: 1.75rem; }
.qr-list { overflow-y: auto; display: grid; gap: .125rem; align-content: start; }
.qr-item { display: grid; gap: .125rem; padding: .5rem .625rem; border: 0; border-radius: var(--r-sm); background: none; text-align: left; color: var(--text); }
.qr-item:hover, .qr-item:focus-visible { background: var(--surface-2); }
.qr-title { display: flex; align-items: baseline; gap: .5rem; }
.qr-title b { font-size: var(--fs-sm); }
.qr-cat { font-size: var(--fs-xs); color: var(--muted); }
.qr-body { font-size: var(--fs-xs); color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qr-manage { font-size: var(--fs-xs); font-weight: 600; color: var(--accent-strong); justify-self: end; }

/* Раздел «Быстрые ответы» */
.tpl-row { display: flex; gap: .75rem; align-items: flex-start; padding: .875rem 1rem; border-top: 1px solid var(--line); }
.tpl-row:first-child { border-top: 0; }
.tpl-row .text { flex: 1; min-width: 0; display: grid; gap: .25rem; }
.tpl-body { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); font-size: var(--fs-sm); }
.tpl-row .sub { font-size: var(--fs-xs); color: var(--muted); }

/* Карточка пользователя в админке: редактор аккаунта */
.acc-editor { gap: var(--s3); background: var(--surface-2); border-color: var(--line); }
.acc-editor h3 { font-size: var(--fs-md); }
.acc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); align-items: start; }
.acc-check { gap: .5rem; align-self: end; min-height: var(--control-h); cursor: pointer; font-weight: 600; font-size: var(--fs-sm); }
.acc-editor .input, .acc-editor .textarea { background: var(--surface); }

@media (max-width: 1339px) {
  .sup-body { grid-template-columns: minmax(0, 1fr); }
  .sup-info { border-left: 0; border-top: 1px solid var(--line); grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr)); }
}

@media (max-width: 959px) {
  .sup-layout { grid-template-columns: minmax(0, 1fr); }
  .sup-layout[data-view="list"] .sup-pane { display: none; }
  .sup-layout[data-view="detail"] .sup-queue { display: none; }
  .sup-queue { position: static; max-height: none; }
  .sup-back { display: grid; }
}
@media (max-width: 759px) {
  .chat-card { height: calc(100vh - 9.375rem - env(safe-area-inset-bottom)); max-height: none; min-height: 23.75rem; border-radius: var(--r-md); }
  .chat-msg { max-width: 88%; }
  .chat-scroll { padding: .75rem .625rem; }
  .chat-head, .chat-foot { padding: .625rem .75rem; }
  .sup-chat { height: calc(100vh - 14.375rem); }
  .acc-grid { grid-template-columns: minmax(0, 1fr); }
  .sup-foot-row .hint { display: none; }
}

/* ======================= Адаптивность: общие правила ======================= */
.theme-label { align-items: flex-start; }
.theme-label .radio { margin-top: .125rem; }
.table-wrap { -webkit-overflow-scrolling: touch; }
.filters > * { min-width: 0; }
.filters .input { width: var(--field-w); }
.filters .input.short { width: var(--field-w-sm); }
.filters .select { width: var(--field-w-sm); }
.input.tiny-field { width: var(--field-w-xs); }
.input.short-field { width: var(--field-w-sm); }
.select.inline { width: var(--field-w-sm); }
img, video { height: auto; }
.imgrid img { height: 100%; }

/* Телефон: лист во весь экран, поля по краям — 16px */
@media (max-width: 759px) {
  .post { padding: .875rem 1rem .5rem; }
  .post-actions { margin: 0 -.5rem; justify-content: space-between; }
  .post-actions .act { padding: 0 .5rem; }
  .composer { padding: .875rem 1rem .625rem; }
  .card.pad { padding: var(--s4); }
  .card-head { padding: var(--s4) var(--s4) 0; }
  .card-body { padding: var(--s3) var(--s4) var(--s4); }
  .list-row { padding: .75rem var(--s4); }
  .shell:not(.wide) .main > .banner { margin: .625rem 1rem 0; }
  .page-head { min-height: 0; padding: 1rem 1rem .625rem; }
  .shell.wide .main > .page-head, .settings-page > .page-head { padding: 1rem 0 .375rem; }
  .page-head h1 { font-size: var(--fs-xl); }
  .sheet-head { top: calc(3.375rem + env(safe-area-inset-top)); }
  .sheet-head .page-head { display: none; } /* на телефоне название — в верхней панели */
  .sheet-head .tabs { padding: 0 .25rem; }
  .tabs button, .tabs a { padding: .75rem .75rem .6875rem; }
  .hero h1 { font-size: var(--fs-xl); }
  .hero-body { padding: 0 var(--s4) var(--s4); }
  .hero-top .actions .btn { --h: 2.125rem; padding: 0 .875rem; }
  .stats-row { gap: var(--s4); font-size: var(--fs-sm); }
  .form-actions { justify-content: stretch; }
  .form-actions > .btn { flex: 1 1 auto; }
  .comment-form { gap: .5rem; }
  .composer-opts { order: 3; flex-basis: 100%; margin: .375rem -.25rem 0; padding: 0 .25rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .composer-opts::-webkit-scrollbar { display: none; }
  .composer-opts .cpick { flex: none; }
  .composer-foot > .counter { margin-left: auto; }
  .ed-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -.25rem; padding: 0 .25rem; }
  .ed-bar::-webkit-scrollbar { display: none; }
  .ed-group, .ed-btn { flex: none; }
  .ed-btn { width: 2.375rem; height: 2.375rem; }
  .ed-group.end { margin-left: .25rem; border-left: 1px solid var(--line); padding-left: .375rem; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
  .tile .v { font-size: var(--fs-xl); }
  .state { padding: 2.5rem var(--s4); }
}
@media (max-width: 340px) { .topbar .brand b { display: none; } .btn { padding: 0 .875rem; } .tabbar .fab { width: 2.875rem; } }
/* Сенсорные экраны: крупнее цели нажатия */
@media (hover: none) {
  .act { min-height: 2.5rem; }
  .iconbtn { width: 2.625rem; height: 2.625rem; }
}

/* Вход и способы входа */
.auth-box { gap: 1rem; padding: 1.75rem; border-radius: var(--r-xl); box-shadow: 0 1.875rem 3.75rem -2.5rem rgba(40, 30, 16, .35); }
.provider-ic { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.provider-ic .g-mark { width: 1.125rem; height: 1.125rem; }
@media (max-width: 759px) { .auth-box { padding: 1.375rem 1.125rem; } }
/* Планшет: список разделов настроек уже, без подписей — содержимому больше места */
@media (min-width: 760px) and (max-width: 1023px) {
  .settings { gap: 1rem; }
  .settings-link .sub, .settings-me .sub { display: none; }
  .settings-link { padding: .5625rem .5rem; }
}
/* Приветствие для гостя на главной — титульный лист */
.intro { gap: .75rem; padding: 2.5rem 1.5rem 2rem; }
.intro h1 { font-family: var(--font-display); font-weight: 400; font-size: 2.75rem; letter-spacing: -.015em; line-height: 1.05; }
.intro p { max-width: 40ch; color: var(--text-2); font-size: var(--fs-lg); }
.intro .row { margin-top: .5rem; }
@media (max-width: 759px) { .intro { padding: 1.75rem 1rem 1.5rem; } .intro h1 { font-size: var(--fs-3xl); } }

/* ===== Язык: флажки и переключатель RU · EN · UA (ui/lang.js) ===== */
.flag {
  width: 1.125rem; height: 1.125rem; flex: none; border-radius: 50%; overflow: hidden; display: block;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 14%, transparent), inset 0 0 0 1px rgba(0, 0, 0, .06);
}
.lang-switch {
  --pad: .1875rem; position: relative; isolation: isolate; display: inline-grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: var(--pad); border-radius: var(--r-full); background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.lang-thumb {
  position: absolute; z-index: -1; top: var(--pad); bottom: var(--pad); left: var(--pad); width: calc((100% - var(--pad) * 2) / 3);
  border-radius: var(--r-full); background: var(--surface);
  box-shadow: 0 1px .125rem rgba(40, 30, 16, .12), 0 0 0 1px var(--line-strong);
  transform: translateX(calc(var(--i, 0) * 100%)); transition: transform var(--t) var(--ease-out);
}
.lang-opt {
  display: inline-flex; align-items: center; justify-content: center; gap: .4375rem; height: var(--control-h-sm); padding: 0 .75rem;
  border: 0; border-radius: var(--r-full); background: none; color: var(--muted);
  font: 650 var(--fs-xs) / 1 var(--font); letter-spacing: .08em; cursor: pointer;
  transition: color var(--t-fast); -webkit-tap-highlight-color: transparent;
}
.lang-opt .flag { width: 1rem; height: 1rem; filter: saturate(.55); opacity: .8; transition: filter var(--t-fast), opacity var(--t-fast), transform var(--t) var(--ease); }
.lang-opt:hover { color: var(--text); }
.lang-opt:hover .flag { filter: none; opacity: 1; }
.lang-opt[aria-checked="true"] { color: var(--text); }
.lang-opt[aria-checked="true"] .flag { filter: none; opacity: 1; }
.lang-opt:focus-visible { outline: .125rem solid var(--accent); outline-offset: -.125rem; }
.lang-opt:active .flag { transform: scale(.88); }
.lang-switch.switching .lang-opt { pointer-events: none; }
.lang-switch.sm .lang-opt { padding: 0 .5rem; gap: .375rem; }
.lang-switch.lg { display: grid; width: 100%; max-width: 26.25rem; }
.lang-switch.lg .lang-opt { height: var(--control-h); font-size: var(--fs-sm); gap: .5625rem; }
.lang-switch.lg .lang-opt .flag { width: 1.25rem; height: 1.25rem; }
/* Список языков на всплывающей панели (меню аккаунта, флажок на рельсе) */
.lang-list .menu-item .flag { width: 1.25rem; height: 1.25rem; }
.lang-list .lang-code { font-size: var(--fs-xs); font-weight: 650; letter-spacing: .08em; color: var(--muted); }
.lang-list .menu-item[aria-checked="true"] { background: var(--accent-soft); }
.lang-list .menu-item[aria-checked="true"] .lang-code { color: var(--accent-strong); }
.menu-item > .flag { width: 1.125rem; height: 1.125rem; }
/* Низ боковой панели: переключатель на широком экране, флажок — на рельсе планшета */
.nav-lang { display: flex; justify-content: center; padding: .875rem .25rem 0; margin-top: .625rem; border-top: 1px solid var(--line); }
.nav-lang .lang-switch { width: 100%; }
.nav-lang .lang-btn { display: none; }
.lang-btn .flag { width: 1.375rem; height: 1.375rem; }
@media (max-width: 1199px) {
  .nav-lang { padding: .625rem 0 0; border-top: 0; }
  .nav-lang .lang-switch { display: none; }
  .nav-lang .lang-btn { display: inline-grid; }
  /* Панель раскрыта поверх страницы — снова полный переключатель языка */
  html.nav-open .nav-lang { padding: .875rem .25rem 0; border-top: 1px solid var(--line); }
  html.nav-open .nav-lang .lang-switch { display: inline-grid; }
  html.nav-open .nav-lang .lang-btn { display: none; }
}
@media (min-width: 1200px) {
  html.nav-rail .nav-lang { padding: .625rem 0 0; border-top: 0; }
  html.nav-rail .nav-lang .lang-switch { display: none; }
  html.nav-rail .nav-lang .lang-btn { display: inline-grid; }
}
/* Вход и регистрация */
.auth-foot { display: flex; align-items: center; justify-content: center; gap: .625rem; margin-top: 1.125rem; }

/* ===== Правовые документы (privacy / terms / recommendations, pages/legal.js) ===== */
.legal-page { min-height: 100vh; min-height: 100dvh; padding: max(1.75rem, env(safe-area-inset-top)) 1rem max(2.5rem, env(safe-area-inset-bottom)); }
.legal {
  max-width: 47.5rem; margin: 0 auto; padding: 2.25rem 2.75rem 1.75rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  color: var(--text-2); font-size: var(--fs-md); line-height: 1.65; animation: sheet-in var(--t-slow) var(--ease-out) both;
}
.legal-nav { display: flex; flex-wrap: wrap; gap: .375rem 1.125rem; margin-bottom: 1.625rem; font-size: var(--fs-sm); font-weight: 600; }
.legal-nav a { color: var(--muted); }
.legal-nav a:first-child { color: var(--text); margin-right: auto; }
.legal-nav a:hover { color: var(--accent-strong); }
.legal h1 { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-3xl); line-height: 1.12; letter-spacing: -.01em; color: var(--text); }
.legal-meta { margin: .625rem 0 .5rem; color: var(--muted); font-size: var(--fs-sm); }
.legal h2 {
  position: relative; margin: 2.125rem 0 .625rem; padding-left: 1.125rem; font-size: var(--fs-lg); font-weight: 700; line-height: 1.35; color: var(--text);
}
.legal h2::before {
  content: ""; position: absolute; left: 0; top: .6em; width: .4375rem; height: .4375rem; background: var(--accent); border-radius: 1.5px; transform: rotate(45deg);
}
.legal h3 { margin: 1.25rem 0 .375rem; font-size: var(--fs-md); font-weight: 700; color: var(--text); }
.legal p, .legal ul, .legal ol { margin: 0 0 .625rem; }
.legal ul, .legal ol { padding-left: 1.375rem; }
.legal li { margin: .25rem 0; }
.legal li::marker { color: var(--muted); }
.legal a { color: var(--accent-strong); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .1875rem; }
.legal .legal-nav a { color: var(--muted); text-decoration: none; }
.legal .legal-nav a:first-child { color: var(--text); }
.legal .legal-nav a:hover { color: var(--accent-strong); }
.legal b, .legal strong { color: var(--text); font-weight: 650; }
.legal-table { width: 100%; margin: .375rem 0 .875rem; border-collapse: collapse; font-size: var(--fs-sm); line-height: 1.5; display: block; overflow-x: auto; }
.legal-table th, .legal-table td { padding: .5625rem .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; min-width: 8.75rem; }
.legal-table th { color: var(--text); font-weight: 700; background: var(--surface-2); }
.legal-table tr:last-child td { border-bottom: 0; }
.legal-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 2.25rem; padding-top: 1.125rem; border-top: 1px solid var(--line); }
@media (max-width: 759px) {
  .legal-page { padding: 0 0 max(1.5rem, env(safe-area-inset-bottom)); background: var(--surface); }
  .legal { padding: max(1.25rem, env(safe-area-inset-top)) 1rem 1.25rem; border: 0; border-radius: 0; font-size: var(--fs-md); }
  .legal h1 { font-size: var(--fs-2xl); }
}
@media print {
  .legal-foot, .legal-nav { display: none; }
  .legal { border: 0; padding: 0; max-width: none; }
}

/* ===== Админка → Нагрузка: полоса заполнения ===== */
.meter { display: block; height: .375rem; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width var(--t) var(--ease-out); }
.meter.warn > i { background: var(--warning); }
.meter.bad > i { background: var(--danger); }
.tile .meter { margin-top: .125rem; }
.meter-cell { display: grid; gap: .3125rem; min-width: 10rem; }

@keyframes pr-float { 50% { transform: translateY(-.375rem) rotate(-1.5deg); } }

@property --pr-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes pr-spin { to { --pr-a: 360deg; } }

/* Окно-приглашение */

/* Админка: фото, заблокированные проверкой 18+ (превью размыто, открывается нажатием) */
.nsfw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16.25rem, 1fr)); gap: var(--s4); }
.nsfw-card { display: grid; align-content: start; overflow: hidden; padding: 0; }
.nsfw-pic { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; padding: 0; border: 0; overflow: hidden; background: var(--surface-3); }
.nsfw-pic img { width: 100%; height: 100%; object-fit: contain; filter: blur(1.75rem) saturate(.6); transform: scale(1.1); transition: filter var(--t); }
.nsfw-pic.shown img { filter: none; transform: none; }
.nsfw-hint { position: absolute; display: inline-flex; align-items: center; gap: .375rem; padding: .375rem .75rem; border-radius: var(--r-full); background: rgba(0, 0, 0, .6); color: #fff; font-size: var(--fs-sm); font-weight: 600; }
.nsfw-pic.shown .nsfw-hint { display: none; }
.nsfw-body { padding: var(--s4); gap: .625rem; }
.nsfw-appeal { padding: .625rem .75rem; border-radius: var(--r-md); background: var(--surface-2); }
.nsfw-appeal p { margin: .375rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
/* Настройки: предупреждения за 18+ */
.warn-thumb { width: 3.5rem; height: 3.5rem; flex: none; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-3); border: 0; padding: 0; }
.warn-thumb img { width: 100%; height: 100%; object-fit: cover; filter: blur(.625rem); }
.warn-thumb.shown img { filter: none; }

/* ---- Окно «Отправить в чат» (components/sharePost.js) ---- */
.share-post { display: grid; gap: .75rem; }
.share-preview { display: grid; grid-template-columns: auto 1fr; gap: .625rem; align-items: center; padding: .625rem .75rem; border-radius: var(--r-md); background: var(--surface-2); }
.share-preview .t { display: grid; gap: .125rem; min-width: 0; }
.share-preview .t span { color: var(--muted); font-size: var(--fs-xs); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.share-list { display: grid; align-content: start; gap: .125rem; min-height: 11.25rem; max-height: min(46vh, 22.5rem); overflow-y: auto; margin: 0 -.5rem; padding: 0 .5rem; }
.share-row { display: grid; grid-template-columns: auto 1fr auto; gap: .625rem; align-items: center; width: 100%; padding: .5rem; border: 0; border-radius: var(--r-xl); background: none; color: var(--text); text-align: left; font: inherit; transition: background var(--t-fast); }
.share-row:hover { background: var(--surface-2); }
.share-row:focus-visible { outline: .125rem solid var(--accent); outline-offset: -.125rem; }
.share-row .t { display: grid; min-width: 0; }
.share-row .t > span { color: var(--muted); font-size: var(--fs-xs); }
.share-row[data-state="error"] .t > span { color: var(--danger); }
.share-row .mark { width: 1.375rem; height: 1.375rem; border-radius: 50%; border: .125rem solid var(--line-strong); display: grid; place-items: center; color: transparent; transition: background var(--t-fast), border-color var(--t-fast); }
.share-row[aria-checked="true"] .mark { background: var(--accent); border-color: var(--accent); color: #fff; }
.share-row[data-state="sent"] .mark { background: var(--good); border-color: var(--good); color: #fff; }
.share-row[data-state="error"] .mark { background: var(--danger); border-color: var(--danger); color: #fff; }
.share-row[data-state="sending"] .mark { background: none; border-color: var(--accent); border-top-color: transparent; color: transparent; animation: share-spin .8s linear infinite; }
@keyframes share-spin { to { transform: rotate(1turn); } }
.share-sec { padding: .5rem .5rem .125rem; color: var(--muted); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.share-foot { display: flex; gap: .5rem; align-items: center; }
.share-foot .input { flex: 1; min-width: 0; }
@media (prefers-reduced-motion: reduce) { .share-row[data-state="sending"] .mark { animation: none; } }

/* ---------- Просмотр картинки на весь экран (ui/viewer.js): аватары, фото в чате ---------- */
.viewer { position: fixed; inset: 0; z-index: 95; color: #fff; }
.viewer-backdrop { position: absolute; inset: 0; background: rgba(10, 9, 8, .94); }
.viewer-stage { position: absolute; inset: 0; touch-action: none; cursor: zoom-out; }
.viewer-img {
  position: fixed; display: block; object-fit: cover; transform-origin: 0 0; user-select: none; -webkit-user-drag: none;
  background: rgba(255, 255, 255, .06); box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, .45); will-change: transform, clip-path; cursor: default;
}
.viewer-bar {
  position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: .5rem;
  padding: calc(.75rem + env(safe-area-inset-top)) 1rem 1.75rem; background: linear-gradient(rgba(0, 0, 0, .55), transparent);
  pointer-events: none;
}
.viewer-bar > * { pointer-events: auto; }
.viewer-title { flex: 1; min-width: 0; font-weight: 600; font-size: var(--fs-md); text-shadow: 0 1px .125rem rgba(0, 0, 0, .4); pointer-events: none; }
.viewer-btn {
  width: 2.75rem; height: 2.75rem; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff; transition: background var(--t-fast), transform var(--t-fast);
}
.viewer-btn:hover { background: rgba(255, 255, 255, .24); color: #fff; }
.viewer-btn:active { transform: scale(.94); }
.viewer-btn:focus-visible { outline: .125rem solid #fff; outline-offset: .125rem; }
.viewer-error { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .625rem; color: rgba(255, 255, 255, .8); text-align: center; padding: 1.5rem; }
.viewer-error .icon { width: 2rem; height: 2rem; }

/* Аватар, который открывается на весь экран, и кнопка смены своего фото */
.avatar-open { display: inline-flex; padding: 0; border: 0; background: none; border-radius: 50%; cursor: zoom-in; color: inherit; }
.avatar-open:has(.avatar.sq) { border-radius: var(--r-md); }
.avatar-open:focus-visible { outline: .125rem solid var(--accent); outline-offset: .1875rem; }
.avatar-open .avatar { transition: filter var(--t-fast), transform var(--t-fast) var(--ease); }
@media (hover: hover) { .avatar-open:hover .avatar { filter: brightness(.94); } }
.avatar-open:active .avatar { transform: scale(.98); }
.avatar-stack { position: relative; display: inline-flex; }
.avatar-edit {
  position: absolute; right: .125rem; bottom: .125rem; width: 2.125rem; height: 2.125rem; display: grid; place-items: center;
  border-radius: 50%; border: .1875rem solid var(--surface); background: var(--btn-bg); color: var(--btn-fg); padding: 0;
  transition: transform var(--t-fast) var(--ease);
}
.avatar-edit:hover { transform: scale(1.06); color: var(--btn-fg); }
.avatar-edit:focus-visible { outline: .125rem solid var(--accent); outline-offset: .125rem; }

/* ---------- Центр уведомлений (/notifications) ---------- */
.notif { position: relative; align-items: flex-start; }
.notif .avatar { margin-top: .125rem; }
.notif-ic { background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; }
/* Непрочитанное: мягкая заливка с затуханием вправо, цветная полоса слева, свечение значка; только что пришедшее вспыхивает */
.notif.unread { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 16%, transparent), var(--accent-soft) 45%, transparent 100%); box-shadow: inset .1875rem 0 0 var(--accent); }
.notif.unread .notif-meta .icon { color: var(--accent-strong); }
.notif.unread .avatar { box-shadow: 0 0 0 .125rem var(--surface), 0 0 0 .25rem color-mix(in srgb, var(--accent) 55%, transparent); }
.notif.t-like.unread, .notif.t-repost.unread { box-shadow: inset .1875rem 0 0 var(--like, var(--accent)); }
.notif.t-moderation.unread, .notif.t-system.unread { box-shadow: inset .1875rem 0 0 var(--warning); }
.notif.is-new { animation: notif-in .9s var(--ease-out); }
@keyframes notif-in { 0% { opacity: 0; transform: translateY(-.5rem); background-color: color-mix(in srgb, var(--accent) 38%, transparent); } 35% { opacity: 1; transform: none; } 100% { background-color: transparent; } }
.notif { transition: background-color var(--t), box-shadow var(--t); }
a.notif.unread:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.notif.unread .notif-text { font-weight: 600; }
.notif-text { overflow-wrap: anywhere; }
.notif-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .625rem; margin-top: .1875rem; color: var(--muted); font-size: var(--fs-xs); }
.notif-type { display: inline-flex; align-items: center; gap: .25rem; }
.notif-actions { flex: none; display: flex; align-items: center; gap: .125rem; margin: -.25rem -.375rem 0 0; }
.notif-dot { width: .625rem; height: .625rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 .1875rem var(--accent-soft); }
.notif-mark:hover .notif-dot { background: var(--accent-strong); }
.notif-fresh {
  position: sticky; top: calc(var(--s3) + env(safe-area-inset-top)); z-index: 5; display: flex; align-items: center; gap: .375rem;
  margin: 0 auto var(--s3); padding: .5rem 1rem; border: 0; border-radius: var(--r-full); background: var(--accent); color: var(--inverse);
  font-weight: 600; font-size: var(--fs-sm); box-shadow: var(--shadow-pop); animation: pop var(--t) var(--ease-out);
}
.notif-fresh[hidden] { display: none; }
@media (max-width: 759px) {
  .notif-fresh { top: calc(3.875rem + env(safe-area-inset-top)); }
}
@media (prefers-reduced-motion: reduce) { .notif-fresh, .notif.is-new { animation: none; } }

/* ---------- Лента: переключатель режима ---------- */
.feed-bar { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.feed-bar .tabs { flex: 1; min-width: 0; }
.feed-mode { flex: none; flex-wrap: nowrap; margin-right: .75rem; }
.feed-mode button { display: inline-flex; align-items: center; gap: .375rem; padding: .375rem .75rem; white-space: nowrap; }
.feed-mode button:focus-visible { outline: .125rem solid var(--accent); outline-offset: 1px; }
@media (max-width: 1199px) { .feed-mode-label { display: none; } .feed-mode button { padding: .375rem .5625rem; } }
@media (max-width: 759px) { .feed-mode { margin-right: .5rem; } .feed-mode button { padding: .3125rem .5rem; } }
body.feed-immersive .feed-composer { display: none !important; }
.feed-swap { animation: feed-swap .22s var(--ease-out); }
@keyframes feed-swap { from { opacity: 0; transform: translateY(.375rem); } }

/* ---------- Лента «погружение»: экран на публикацию ---------- */
.ifeed {
  position: relative; height: var(--ifeed-h, calc(100dvh - 8.75rem)); overflow-y: auto; overscroll-behavior: contain;
  scroll-snap-type: y mandatory; scrollbar-width: none; border-radius: var(--r-lg); outline: none; overflow-anchor: none;
}
.ifeed::-webkit-scrollbar { display: none; }
.ifeed:focus-visible { box-shadow: inset 0 0 0 .125rem var(--accent); }
.ifeed-slide {
  position: relative; height: 100%; display: flex; align-items: stretch; justify-content: center; padding: .5rem 0;
  scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; isolation: isolate;
}
.ifeed-backdrop {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: var(--r-lg);
  background: var(--ifeed-bg, none) center / cover no-repeat; filter: blur(2rem) saturate(1.15); opacity: .32; transform: scale(1.2);
}
/* Карточка сама не прокручивается — иначе колесо и палец «застревают» в ней и лента не листается.
   Прокручивается только раскрытая кнопкой «Ещё» карточка. */
.ifeed-card.post {
  width: 100%; max-height: 100%; display: flex; flex-direction: column; gap: .625rem; overflow: hidden;
  scrollbar-width: thin; animation: none; box-shadow: var(--shadow-pop, none);
}
.ifeed-card.post.expanded { overflow-y: auto; }
.ifeed-card:focus-visible { outline: .125rem solid var(--accent); outline-offset: -.125rem; }
/* В колонке экрана сжимается только область фото — шапка, текст и кнопки сохраняют свою высоту */
.ifeed-card > * { flex-shrink: 0; }
.ifeed-card > .post-actions { margin-top: auto; padding-top: .25rem; }
/* Фото — главное на экране: занимает всё свободное место, без обрезки и искажения */
.k-media .ifeed-card > .media-wrap > .imgrid, .k-media .ifeed-card > .embed > .imgrid { flex: 1 1 auto; min-height: 10rem; aspect-ratio: auto; grid-template-rows: minmax(0, 1fr); }
.k-media .ifeed-card .imgrid.n1 > button { aspect-ratio: auto; max-height: none; height: 100%; }
/* Горизонтальное фото не растягивается на весь экран с полосами — стоит во всю ширину в своих пропорциях
   посередине экрана (фон экрана — размытая копия фото) */
.k-media .ifeed-card > .media-wrap > .imgrid.n1.landscape { flex: 0 1 auto; aspect-ratio: var(--ar); min-height: 0; margin: auto 0; }
.k-media .ifeed-card > .embed { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.k-media .ifeed-card .imgrid.n1 img { max-height: none; object-fit: contain; }
.k-media .ifeed-card .imgrid:not(.n1) img { object-fit: cover; }
.k-media .ifeed-card:not(.expanded) > .rt { display: -webkit-box; -webkit-line-clamp: var(--clamp, 3); -webkit-box-orient: vertical; overflow: hidden; }
.ifeed-card.expanded > .media-wrap > .imgrid { flex: none; min-height: 0; max-height: 60%; }
/* Публикация без фото — открытка: мягкий цветной фон (оттенок по id поста), кавычка и крупный текст
   посередине. Размер шрифта — по длине: короткая мысль крупно антиквой, длинный текст — удобным для чтения. */
.k-text .ifeed-card {
  background: radial-gradient(110% 70% at 100% 0, var(--tint-a), transparent 68%), radial-gradient(90% 60% at 0 100%, var(--tint-b), transparent 70%), var(--surface);
}
.tint-0 { --tint-a: color-mix(in srgb, #e8956b 30%, transparent); --tint-b: color-mix(in srgb, #e8c46b 20%, transparent); --tint-q: #d98258; }
.tint-1 { --tint-a: color-mix(in srgb, #6ba7e8 28%, transparent); --tint-b: color-mix(in srgb, #8f7be8 18%, transparent); --tint-q: #5d8fd0; }
.tint-2 { --tint-a: color-mix(in srgb, #5fc29a 28%, transparent); --tint-b: color-mix(in srgb, #b6d36b 20%, transparent); --tint-q: #3fa77d; }
.tint-3 { --tint-a: color-mix(in srgb, #e87b9a 26%, transparent); --tint-b: color-mix(in srgb, #f0b38a 20%, transparent); --tint-q: #d1607f; }
.tint-4 { --tint-a: color-mix(in srgb, #a58be8 28%, transparent); --tint-b: color-mix(in srgb, #6bc8d8 18%, transparent); --tint-q: #8a6fd6; }
.tint-5 { --tint-a: color-mix(in srgb, #d8b05a 30%, transparent); --tint-b: color-mix(in srgb, #e8806b 16%, transparent); --tint-q: #c0953c; }
/* Текст без фото — ровно по центру между шапкой и кнопками: свободное место делится поровну над текстом
   и под ним. Кавычка занимает 38px над текстом — столько же оставляем под ним, чтобы сам текст стоял по центру. */
.k-text .ifeed-card > .rt { margin: auto 0 2.375rem; line-height: 1.5; font-size: var(--fs-lg); text-align: center; }
.k-text .ifeed-card > .rt:has(+ .ifeed-more) { margin-bottom: 0; }
.k-text .ifeed-card > .rt::before {
  content: "“" / ""; display: block; height: 2.125rem; margin-bottom: .25rem; font-family: var(--font-display); font-size: 5.25rem; line-height: .9; color: var(--tint-q);
}
.k-text .ifeed-card.t-s > .rt { font-family: var(--font-display); font-size: clamp(1.75rem, 2vw + 1.125rem, 2.5rem); line-height: 1.25; text-align: center; letter-spacing: -.005em; }
.k-text .ifeed-card.t-m > .rt { font-size: clamp(1.25rem, 1vw + .9375rem, 1.625rem); line-height: 1.45; }
.k-text .ifeed-card.t-s > .ifeed-more { align-self: center; }
.k-text .ifeed-card:not(.expanded) > .rt { display: -webkit-box; -webkit-line-clamp: var(--clamp, 12); -webkit-box-orient: vertical; overflow: hidden; }
.k-repost .ifeed-card > .embed { margin: auto 0; }
.ifeed-more { align-self: flex-start; margin-top: -.375rem; padding: .125rem 0; border: 0; background: none; color: var(--accent-strong); font-weight: 600; font-size: var(--fs-sm); }
.ifeed-more:focus-visible { outline: .125rem solid var(--accent); outline-offset: .125rem; border-radius: var(--r-sm); }
.ifeed-state { height: 100%; display: grid; place-items: center; scroll-snap-align: start; }
.ifeed-tail { min-height: 1px; }
.ifeed-tail.loading { display: grid; place-items: center; height: 4.5rem; color: var(--muted); scroll-snap-align: end; }
.ifeed-tail.loading::after { content: ""; width: 1.25rem; height: 1.25rem; border-radius: 50%; border: .125rem solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.ifeed:empty, .ifeed[aria-busy="true"] > .ifeed-tail:first-child { min-height: 12.5rem; }
@media (max-width: 759px) {
  /* Лента сама занимает экран до нижнего меню — отступы страницы под ней не нужны */
  body.feed-immersive .shell { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  body.feed-immersive .main { padding-bottom: 0; }
  .ifeed { border-radius: 0; }
  .ifeed-slide { padding: 0; }
  .ifeed-backdrop { border-radius: 0; }
  .ifeed-card.post { border-radius: 0; border-left: 0; border-right: 0; padding: .875rem 1rem .375rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ifeed { scroll-behavior: auto; }
  .feed-swap { animation: none; }
}

.pill.on { background: var(--accent-soft); color: var(--accent-strong); border-color: transparent; }
/* Мини-шапка профиля в цветах темы (карточка магазина): лист темы, обложка, аватар, две строки текста */

/* Предпросмотр: страница профиля целиком */

/* ============================ Стикеры ============================
   Магазин («Рубин» → «Стикеры»), коллекция и редактор в настройках, слои на профиле, подпись «кто подарил».
   Размеры считаются от ширины обложки (container query), а не от экрана: на любой ширине стикеры занимают
   одни и те же места и не заходят на аватар, имя и кнопки. */

/* --- Свободные стикеры на шапке профиля ---
   Положение — в долях ширины шапки: x — % слева, y — % ширины сверху (так положение на обложке не зависит от высоты шапки),
   размер --s — % ширины, поворот --r — градусы. Шапка — контейнер (cqw), поэтому на любом экране всё масштабируется вместе с ней. */

/* Слой стикеров — фон всей шапки: над обложкой (z-index 1), под аватаром, именем, сведениями и кнопками (.hero-body, z-index 2).
   Пустые места .hero-body касания пропускают — стикер под ними можно навести и нажать; ссылки, кнопки и текст — над слоем.
   Кнопка «Обложка» тоже над стикерами. Лёгкий ореол цвета карточки держит текст читаемым поверх рисунка. */

/* --- Редактор профиля: тот же слой, но стикеры можно двигать --- */

 /* ручки у края шапки не обрезаются */

 /* в редакторе текст не мешает двигать стикеры под ним */

.icon.flip, .iconbtn.flip .icon { transform: rotate(180deg); }

/* --- Коллекция --- */

/* --- Магазин --- */

/* --- Подарок --- */

/* --- Подпись «кто подарил» (подсказка на наведение, окошко по касанию) --- */

/* --- Комментарий на стикере («табличка» под рисунком) --- */

/* На профиле надпись появляется при наведении и фокусе — так же, как она стоит на стикере в коллекции; без неё рисунок целиком. */

/* --- Покупка и подарок подписки --- */

/* «Рубин» в быстрой панели слева: знак-рубин вместо линейной иконки */

/* ============ «Рубин»: понятный раздел, подтверждение операций, юзернеймы ============ */
/* Шапка: баланс всегда на виду, под ней — одна строка «что это» и подсказка к выбранной вкладке */

/* Подтверждение операции с рубинами */
.spend { display: grid; gap: var(--s4); }

/* Юзернеймы */
.names { gap: var(--s4); }
.names-card { padding: var(--s5); display: grid; gap: var(--s3); }
.names-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.names-head p { margin: .25rem 0 0; max-width: 32.5rem; }
.names-title, .names-sub { margin: 0; font-family: var(--font-display); font-weight: 400; }
.names-title { font-size: var(--fs-xl); }
.names-sub { font-size: var(--fs-lg); }
.names-count { display: grid; gap: .375rem; justify-items: end; }
.names-meter { display: flex; flex-wrap: wrap; gap: .3125rem; justify-content: flex-end; max-width: 11.25rem; }
.names-meter span { width: .875rem; height: .875rem; border-radius: 50%; border: .125rem solid var(--line-strong); background: transparent; }
.names-meter span.on { background: var(--accent); border-color: var(--accent); }
.names-row { align-items: center; padding: .625rem .25rem; }
.names-at { display: grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-weight: 700; }
.names-name { font-weight: 700; color: var(--text); }
.names-name:hover { text-decoration: underline; }
.names-actions { gap: .375rem; flex-wrap: wrap; justify-content: flex-end; }
.names-add { gap: var(--s2); align-items: stretch; }
.names-input { flex: 1; min-width: 0; }

.handle.alias { font-size: var(--fs-sm); opacity: .85; }

/* Магазин стикеров: как это работает */

@media (max-width: 759px) {
  
  
  
  .names-card { padding: var(--s4); }
  .names-count { justify-items: start; }
  .names-meter { justify-content: flex-start; }
  .names-row { flex-wrap: wrap; }
  .names-actions { width: 100%; justify-content: flex-start; padding-left: 3rem; }
  
  
  
}
.names-row .text { display: grid; gap: .125rem; min-width: 0; }
.names-row .sub { font-size: var(--fs-xs); color: var(--muted); }

/* ============ Лента «погружение» на компьютере: аккуратная скруглённая карточка, кнопки и подсказка ============ */
.ifeed-wrap { position: relative; }
.ifeed-nav, .ifeed-hint { display: none; }
@media (min-width: 760px) {
  .ifeed { border-radius: var(--r-xl); }
  .ifeed-slide { padding: .875rem 1.125rem; }
  .ifeed-backdrop { border-radius: var(--r-xl); opacity: .38; }
  .ifeed-card.post {
    max-width: 33.75rem; margin: 0 auto; padding: 1.25rem 1.5rem .5rem; border: 1px solid var(--line); border-radius: var(--r-xl);
    box-shadow: 0 1px .125rem rgba(0, 0, 0, .06), 0 1.125rem 3rem -1.125rem rgba(0, 0, 0, .35);
  }
  .k-media .ifeed-card.post, .k-repost .ifeed-card.post { background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(1rem) saturate(1.2); -webkit-backdrop-filter: blur(1rem) saturate(1.2); }
  .ifeed-card.post > .post-actions { margin: 0 -.75rem; border-top: 1px solid var(--line); padding-top: .375rem; }
  .ifeed-card .imgrid { border-radius: var(--r-lg); }
}
@media (min-width: 1100px) and (hover: hover) and (pointer: fine) {
  .ifeed-nav { position: absolute; right: 0; top: 50%; transform: translateY(-50%); z-index: 3; display: grid; gap: .625rem; }
  .ifeed-nav-btn {
    display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text);
    box-shadow: 0 .375rem 1.125rem -.5rem rgba(0, 0, 0, .4); transition: background var(--t-fast), transform var(--t-fast) var(--ease), opacity var(--t-fast);
  }
  .ifeed-nav-btn:hover:not(:disabled) { background: var(--surface-2); transform: scale(1.06); }
  .ifeed-nav-btn:focus-visible { outline: .125rem solid var(--accent); outline-offset: .125rem; }
  .ifeed-nav-btn:disabled { opacity: .35; cursor: default; }
  .ifeed-nav-btn.down .icon { transform: rotate(180deg); }
}
@media (hover: hover) and (pointer: fine) and (min-width: 760px) {
  .ifeed-hint {
    position: absolute; left: 50%; bottom: .375rem; white-space: nowrap; transform: translateX(-50%); z-index: 3; display: inline-flex; align-items: center; gap: .375rem; max-width: calc(100% - 2rem);
    padding: .5rem .875rem; border-radius: var(--r-full); background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line);
    box-shadow: 0 .5rem 1.5rem -.625rem rgba(0, 0, 0, .45); backdrop-filter: blur(.625rem); -webkit-backdrop-filter: blur(.625rem); color: var(--text-2); font-size: var(--fs-sm);
    pointer-events: none; animation: rise var(--t-slow) var(--ease-out) both; transition: opacity .35s var(--ease);
  }
  .ifeed-hint.gone { opacity: 0; }
  .ifeed-hint kbd { display: inline-grid; place-items: center; min-width: 1.375rem; height: 1.375rem; padding: 0 .3125rem; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface-2); font: inherit; font-size: var(--fs-xs); font-weight: 700; }
}

/* ---------- Тур «Как пользоваться Пижоном» ---------- */
.tour { display: grid; gap: var(--s4); justify-items: center; text-align: center; padding: var(--s2) 0; }
.tour-art { display: grid; place-items: center; width: 5.25rem; height: 5.25rem; border-radius: var(--r-xl); background: var(--accent-soft); color: var(--accent-strong); }
.tour-art .icon { width: 2.375rem; height: 2.375rem; }
.tour-copy { display: grid; gap: .375rem; min-height: 9.5em; align-content: start; }
.tour-count { margin: 0; }
.tour-title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: var(--fs-xl); }
.tour-text { margin: 0; color: var(--text-2); line-height: 1.55; max-width: 38ch; justify-self: center; }
.tour-dots { display: flex; gap: .375rem; }
.tour-dots i { width: .4375rem; height: .4375rem; border-radius: 50%; background: var(--line-strong); transition: background var(--t-fast), transform var(--t-fast); }
.tour-dots i.on { background: var(--accent); transform: scale(1.3); }

/* Вкладки ленты на узком экране прокручиваются, а не прячутся под переключателем вида */
.feed-bar .tabs { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.feed-bar .tabs::-webkit-scrollbar { display: none; }
.feed-bar .tabs > button { flex: none; white-space: nowrap; }

/* ============================ Компактный магазин и коллекция, корзина ============================ */

/* ---------- Альбом в просмотре фото, быстрые действия на фото публикации, лайк двойным касанием ---------- */
.viewer-count { flex: none; padding: 0 .625rem; font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .85); text-shadow: 0 1px .125rem rgba(0, 0, 0, .4); }
.viewer-nav { position: absolute; top: 50%; margin-top: -1.375rem; z-index: 2; }
.viewer-nav.prev { left: 1rem; }
.viewer-nav.next { right: 1rem; }
.viewer-nav.prev .icon { transform: rotate(180deg); }
.viewer-nav:disabled { opacity: .25; cursor: default; pointer-events: none; }
@media (hover: none) { .viewer-nav { display: none; } }

/* Блок фото публикации: сетка + круглые кнопки «Сохранить» и «Скачать» в углу */
.media-wrap { position: relative; }
.media-quick { position: absolute; right: .5rem; bottom: .5rem; z-index: 3; display: flex; gap: .375rem; }
.media-quick button {
  width: 2.25rem; height: 2.25rem; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; color: #fff; cursor: pointer;
  background: rgba(20, 16, 12, .55); backdrop-filter: blur(.5rem); -webkit-backdrop-filter: blur(.5rem);
  transition: background var(--t-fast), transform var(--t-fast), opacity var(--t-fast);
}
.media-quick button:hover { background: rgba(20, 16, 12, .75); }
.media-quick button:active { transform: scale(.92); }
.media-quick button:focus-visible { outline: .125rem solid #fff; outline-offset: .125rem; }
.media-quick button[aria-pressed="true"] { background: var(--accent); }
.media-quick button[aria-pressed="true"] .icon { fill: currentColor; }
.media-quick button[aria-busy="true"] { opacity: .6; }
@media (hover: hover) and (pointer: fine) {
  .media-quick { opacity: 0; transform: translateY(.25rem); transition: opacity var(--t-fast), transform var(--t-fast); }
  .media-wrap:hover .media-quick, .media-wrap:focus-within .media-quick, .media-quick:has([aria-pressed="true"]) { opacity: 1; transform: none; }
}

/* Четыре фото: ряды одинаковой высоты, ширина плиток пропорциональна фото (post.js → fourLayout): без обрезки, зазоры 4px везде */
.imgrid.rows { display: flex; flex-direction: column; gap: .25rem; aspect-ratio: auto; max-height: none; border-radius: var(--r-lg); box-shadow: none; }
.imgrid.rows .imgrid-row { display: flex; gap: .25rem; min-width: 0; }
.imgrid.rows .imgrid-row > button { flex: var(--ar, 1) 1 0%; aspect-ratio: var(--ar, 1); min-width: 0; position: relative; border-radius: 0; }
.imgrid.rows .imgrid-row > button::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(20, 16, 12, .08); pointer-events: none; }
.imgrid.rows img { position: absolute; inset: 0; }
.imgrid .more-n { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(20, 16, 12, .5); color: #fff; font-size: var(--fs-xl); font-weight: 700; pointer-events: none; }

/* Лайк двойным касанием: сердце вырастает из точки касания и уплывает вверх */
.post-heart {
  position: absolute; z-index: 4; width: 6rem; height: 6rem; margin: -3rem 0 0 -3rem; pointer-events: none; color: var(--like, #e8416b);
  filter: drop-shadow(0 .375rem .875rem rgba(20, 16, 12, .4)); animation: post-heart 900ms cubic-bezier(.2, .9, .25, 1) forwards;
}
.post-heart .icon { width: 100%; height: 100%; fill: currentColor; stroke: #fff; stroke-width: 1.2; }
@keyframes post-heart {
  0% { opacity: 0; transform: scale(.3) rotate(-12deg); }
  18% { opacity: 1; transform: scale(1.18) rotate(6deg); }
  34% { transform: scale(.96) rotate(-3deg); }
  50% { opacity: 1; transform: scale(1.04) rotate(0); }
  100% { opacity: 0; transform: translateY(-2.875rem) scale(1.12); }
}
.act.like.pop .icon { animation: like-pop 460ms cubic-bezier(.2, .9, .25, 1.4); }
@keyframes like-pop { 0% { transform: scale(1); } 35% { transform: scale(1.45); } 70% { transform: scale(.92); } 100% { transform: scale(1); } }
.post { -webkit-tap-highlight-color: transparent; }
.post .imgrid button { touch-action: manipulation; } /* нет задержки 300 мс и увеличения по двойному касанию */
@media (prefers-reduced-motion: reduce) {
  .post-heart { animation: post-heart-fade 700ms linear forwards; }
  .act.like.pop .icon { animation: none; }
  .media-quick { transition: none; }
}
@keyframes post-heart-fade { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }
.ifeed-card > .media-wrap { display: contents; }
.ifeed-card .media-quick { display: none; }
.post { position: relative; }

/* Лента «погружение»: блок из четырёх фото не растягивается на всю карточку */
/* «Погружение»: карточка фиксированной высоты — блок фото занимает всё свободное место, ряды делят его поровну (без прокрутки и обрезки рядов) */
.ifeed-card > .media-wrap > .imgrid.rows { flex: 1 1 auto; min-height: 11.25rem; margin: 0; max-height: none; }
.ifeed-card > .media-wrap > .imgrid.rows .imgrid-row { flex: 1 1 0; min-height: 0; }
.ifeed-card > .media-wrap > .imgrid.rows .imgrid-row > button { aspect-ratio: auto; height: auto; }
.ifeed-card > .media-wrap > .imgrid.rows img { object-fit: cover; }

/* Двухстрочные названия стикеров («Букет / роз», «Ветка / сакуры») */

.pe-quick { gap: .375rem; margin-top: .25rem; }
.pe-quick .chip { text-decoration: none; display: inline-flex; align-items: center; gap: .375rem; }
@media (max-width: 759px) { .hero-top .actions .hide-sm { display: none; } }

/* ============================ Лента на ПК: крупные фото, просторные карточки ============================ */
@media (min-width: 1200px) {
  :root { --main-w: 42.5rem; }
}
@media (min-width: 1480px) {
  :root { --main-w: 46.25rem; }
}
@media (min-width: 900px) {
  .shell:not(.wide) .main .post:not(.ifeed-card) { padding: 1.375rem 1.75rem .75rem; gap: .75rem; }
  .shell:not(.wide) .main .post:not(.ifeed-card) > .rt, .shell:not(.wide) .main .post:not(.ifeed-card) > .rt p { font-size: var(--fs-lg); line-height: 1.6; }
  /* Фото — почти во всю ширину карточки, выше, чем на телефоне; рамка по-прежнему в пропорциях фото */
  .post:not(.ifeed-card) .imgrid.n1 > button, .post:not(.ifeed-card) .imgrid.n1 img { max-height: min(82vh, 51.25rem); }
  .post:not(.ifeed-card) .media-wrap { margin: .125rem 0; }
  .post:not(.ifeed-card) .imgrid { border-radius: var(--r-xl); }
  .post:not(.ifeed-card) .imgrid.rows { gap: .3125rem; }
  .post:not(.ifeed-card) .imgrid.rows .imgrid-row { gap: .3125rem; }
  .post:not(.ifeed-card) .post-actions { margin: .125rem -.625rem 0; padding-top: .25rem; gap: .125rem; }
  .post:not(.ifeed-card) .post-actions .act { height: 2.375rem; padding: 0 .75rem; }
}
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .shell:not(.wide) .main .post:not(.ifeed-card) { transition: background var(--t); }
  .shell:not(.wide) .main .post:not(.ifeed-card):hover { background: color-mix(in srgb, var(--text) 1.6%, transparent); }
  .post:not(.ifeed-card) .imgrid button { cursor: zoom-in; }
  .post:not(.ifeed-card) .imgrid button:hover img { transform: scale(1.02); }
}
@media (min-width: 1200px) { .ifeed-card.post { max-width: 38.75rem; padding: 1.375rem 1.75rem .5rem; } }
@media (min-width: 1480px) { .ifeed-card.post { max-width: 43.125rem; } }
.ifeed-card.expanded > .media-wrap > .imgrid.rows { flex: none; max-height: none; min-height: 0; }
.ifeed-card.expanded > .media-wrap > .imgrid.rows .imgrid-row { flex: none; }
.ifeed-card.expanded > .media-wrap > .imgrid.rows .imgrid-row > button { aspect-ratio: var(--ar, 1); height: auto; }

/* ============================ Ход проверки 18+ (components/checkTracker.js) ============================ */
.ctrack { display: grid; gap: var(--s3); min-width: 0; }
.ctrack-loading { display: flex; align-items: center; gap: .625rem; padding: 1rem; color: var(--muted); font-size: var(--fs-sm); }
.ctrack-summary { display: flex; align-items: center; gap: .75rem; padding: .875rem 1rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.ctrack-summary .text { display: grid; gap: .125rem; min-width: 0; }
.ctrack-summary .sub { font-size: var(--fs-sm); color: var(--muted); }
.ctrack-ic { flex: none; width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--text-2); }
.ctrack-summary.busy .ctrack-ic { background: var(--accent-soft); color: var(--accent-strong); }
.ctrack-item { display: grid; gap: .75rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); animation: rise var(--t) var(--ease-out); }
.ctrack-item.blocked { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.ctrack-head { display: flex; align-items: center; justify-content: space-between; gap: .625rem; flex-wrap: wrap; }
.ctrack-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.ctrack-step { position: relative; display: grid; justify-items: center; gap: .375rem; text-align: center; font-size: var(--fs-xs); color: var(--muted); padding: 0 .125rem; }
.ctrack-step::before { content: ''; position: absolute; top: .6875rem; right: 50%; width: 100%; height: .125rem; background: var(--line-strong); }
.ctrack-step:first-child::before { display: none; }
.ctrack-step.done::before, .ctrack-step.active::before { background: var(--accent); }
.ctrack-dot { position: relative; z-index: 1; width: 1.5rem; height: 1.5rem; display: grid; place-items: center; border-radius: 50%; background: var(--surface); border: .125rem solid var(--line-strong); color: #fff; }
.ctrack-step.done .ctrack-dot { background: var(--accent); border-color: var(--accent); }
.ctrack-step.active .ctrack-dot { border-color: var(--accent); box-shadow: 0 0 0 .25rem var(--accent-soft); animation: ctrack-pulse 1.4s ease-in-out infinite; }
.ctrack-step.bad .ctrack-dot { background: var(--danger); border-color: var(--danger); }
.ctrack-step.bad::before { background: var(--danger); }
.ctrack-step.done, .ctrack-step.active { color: var(--text); }
.ctrack-step.active .ctrack-label { font-weight: 700; }
@keyframes ctrack-pulse { 50% { box-shadow: 0 0 0 .4375rem transparent; } }
.ctrack-meter { height: .375rem; border-radius: var(--r-md); background: var(--surface-2); overflow: hidden; }
.ctrack-meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .9s linear; }
.ctrack-note { margin: 0; font-size: var(--fs-sm); color: var(--text-2); }
.ctrack-time { margin: 0; display: flex; align-items: center; gap: .375rem; font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.ctrack.compact { margin-bottom: var(--s3); }
@media (max-width: 759px) { .ctrack-step { font-size: var(--fs-2xs); } }
@media (prefers-reduced-motion: reduce) { .ctrack-step.active .ctrack-dot { animation: none; } .ctrack-meter i { transition: none; } }

/* Текст публикаций — по центру (ленты, страница поста, профиль, репосты); код остаётся по левому краю.
   Секция комментариев лежит внутри карточки поста, поэтому «.post .rt» цеплял и текст комментариев —
   они выравниваются по левому краю, как и весь остальной интерфейс. */
.post .rt:not(.comments .rt) { text-align: center; }
.post .rt pre { text-align: left; }
.post .rt blockquote { border-left: 0; padding: 0 1rem; position: relative; }
.post .rt ul, .post .rt ol { list-style-position: inside; padding-left: 0; }

/* Текст без фото — по центру карточки и по высоте: не между шапкой и кнопками, а ровно посередине экрана.
   Кавычка (38px) в расчёт не входит. Если есть «Ещё» или карточка раскрыта — прежняя раскладка. */
.k-text .ifeed-card.post:not(.expanded) { position: relative; }
.k-text .ifeed-card.post:not(.expanded) > .rt:not(:has(+ .ifeed-more)) {
  position: absolute; top: 50%; left: 1.25rem; right: 1.25rem; margin: 0; transform: translateY(calc(-50% - 1.1875rem));
  max-height: calc(100% - 9.375rem);
}

/* Панель действий поста (нравится, комментарии, репост…) в ленте «погружение»: у нижнего края карточки, но без плашки —
   ни фона, ни линии, ни размытия; просто ряд значков, как в обычной ленте */
.ifeed-card.post > .post-actions { margin: auto 0 0; padding-top: .375rem; border-top: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
.ifeed-card.post > .post-actions .act { color: var(--muted); }
.ifeed-card.post > .post-actions .act:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }

/* ---- Обновить: кнопка и жест «потянуть вниз» (core/refresh.js) ---- */
.refresh-btn.spin .icon { animation: spin .8s linear; }
button.navlink.spin .icon { animation: spin .8s linear; }
.topbar .refresh-btn { width: 2.5rem; height: 2.5rem; color: var(--text-2); }
.topbar .refresh-btn .icon { width: 1.25rem; height: 1.25rem; }
.ptr {
  position: fixed; left: 50%; top: calc(3.375rem + env(safe-area-inset-top)); z-index: var(--z-toast); width: 2.625rem; height: 2.625rem; display: grid; place-items: center;
  border-radius: 50%; background: var(--surface); color: var(--accent-strong); border: 1px solid var(--line); box-shadow: var(--shadow-pop);
  opacity: 0; pointer-events: none; transform: translate(-50%, -2.875rem);
}
.ptr.ready { background: var(--accent); color: var(--inverse); border-color: transparent; }
.ptr.loading .icon { animation: spin .7s linear infinite; }
@media (min-width: 760px) { .topbar .refresh-btn { display: none; } }
@media (prefers-reduced-motion: reduce) { .refresh-btn.spin .icon, button.navlink.spin .icon, .ptr.loading .icon { animation: none; } }

/* Приближение в просмотре фото (ui/viewer.js): колесо, щипок, двойной щелчок; в приближении картинку можно двигать */
.viewer-img { cursor: zoom-in; }
.viewer.zoomed .viewer-img { cursor: grab; }
.viewer.zoomed .viewer-img:active { cursor: grabbing; }
.viewer-zoom { font-size: var(--fs-2xl); font-weight: 300; line-height: 1; }
.viewer-zoom:disabled { opacity: .3; pointer-events: none; }
@media (hover: none) { .viewer-zoom { display: none; } }
.viewer.zoomed .viewer-nav { display: none; }

/* ---- Редактор фото при публикации (components/photoEditor.js) ---- */
.attachment .ed { position: absolute; top: .25rem; left: .25rem; width: 1.625rem; height: 1.625rem; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: none; place-items: center; }
.attachment.done .ed { display: grid; }
.pe-ed-wrap { display: grid; justify-items: center; gap: .375rem; }
.pe-ed-box { position: relative; margin: 0 auto; padding: .875rem; box-sizing: border-box; overflow: hidden; border-radius: var(--r-md); background: #111; touch-action: none; user-select: none; max-width: 100%; }
.pe-stage { position: relative; }
.pe-ed-box canvas { display: block; width: 100%; height: 100%; }
/* Рамка обрезки: всё снаружи затемнено, внутри — сетка третей, ручки по углам и сторонам */
.pe-crop { position: absolute; box-shadow: 0 0 0 624.9375rem rgba(0, 0, 0, .58); outline: .125rem solid #fff; cursor: move; touch-action: none; }
.pe-grid { position: absolute; background: rgba(255, 255, 255, .45); pointer-events: none; }
.pe-grid.v1, .pe-grid.v2 { top: 0; bottom: 0; width: 1px; }
.pe-grid.h1, .pe-grid.h2 { left: 0; right: 0; height: 1px; }
.pe-grid.v1 { left: 33.33%; } .pe-grid.v2 { left: 66.66%; } .pe-grid.h1 { top: 33.33%; } .pe-grid.h2 { top: 66.66%; }
.pe-h { position: absolute; width: 1.75rem; height: 1.75rem; margin: -.875rem 0 0 -.875rem; display: grid; place-items: center; touch-action: none; }
.pe-h::after { content: ""; width: .75rem; height: .75rem; border-radius: .1875rem; background: #fff; box-shadow: 0 1px .25rem rgba(0, 0, 0, .5); }
.pe-h.n::after, .pe-h.s::after { width: 1.375rem; height: .375rem; } .pe-h.e::after, .pe-h.w::after { width: .375rem; height: 1.375rem; }
.pe-h.nw { left: 0; top: 0; cursor: nwse-resize; } .pe-h.ne { left: 100%; top: 0; cursor: nesw-resize; }
.pe-h.se { left: 100%; top: 100%; cursor: nwse-resize; } .pe-h.sw { left: 0; top: 100%; cursor: nesw-resize; }
.pe-h.n { left: 50%; top: 0; cursor: ns-resize; } .pe-h.s { left: 50%; top: 100%; cursor: ns-resize; }
.pe-h.e { left: 100%; top: 50%; cursor: ew-resize; } .pe-h.w { left: 0; top: 50%; cursor: ew-resize; }
.pe-crop.locked .pe-h.n, .pe-crop.locked .pe-h.s, .pe-crop.locked .pe-h.e, .pe-crop.locked .pe-h.w { display: none; } /* с фиксированной пропорцией — только углы */
.pe-ed-row { display: flex; flex-wrap: wrap; justify-content: center; gap: .375rem; }
.pe-ed-filters { display: flex; gap: .625rem; overflow-x: auto; padding: .25rem .125rem .5rem; scrollbar-width: thin; overscroll-behavior-x: contain; }
.pe-ed-filter { flex: none; width: 4.5rem; display: grid; gap: .3125rem; justify-items: center; padding: 0; border: 0; background: none; color: var(--text-2); font-size: var(--fs-xs); cursor: pointer; }
.pe-ed-filter canvas { width: 4.5rem; height: 4.5rem; border-radius: var(--r-xl); box-shadow: 0 0 0 1px var(--line); transition: box-shadow var(--t-fast), transform var(--t-fast); }
.pe-ed-filter:hover canvas { transform: translateY(-.125rem); }
.pe-ed-filter[aria-selected="true"] { color: var(--text); font-weight: 650; }
.pe-ed-filter[aria-selected="true"] canvas { box-shadow: 0 0 0 .1875rem var(--accent); }

/* ---- Настройки: вкладки раздела ---- */
.settings-tabs { display: flex; gap: .375rem; overflow-x: auto; margin: -.25rem 0 0; padding: .125rem 0 .375rem; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.settings-tabs::-webkit-scrollbar { display: none; }
.settings-tabs a { flex: none; display: inline-flex; align-items: center; height: 2.25rem; padding: 0 1rem; border-radius: var(--r-full); border: 1px solid var(--line-strong); color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; text-decoration: none; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast); }
.settings-tabs a:hover { background: var(--surface-2); color: var(--text); }
.settings-tabs a[aria-selected="true"] { background: var(--text); border-color: var(--text); color: var(--surface); }
@media (max-width: 759px) {
  /* Список разделов — обычная часть страницы: одна прокрутка, без вложенной (раньше колонка «прокручивалась в прокрутке») */
  .settings-nav { overflow: visible; max-height: none; }
  .settings-tabs { margin: 0 -1rem; padding: .25rem 1rem .5rem; }
}
@media (min-width: 760px) {
  /* Компьютер: колонка разделов теперь короткая — вложенная прокрутка не нужна */
  .settings-nav { overflow: visible; }
}

/* ---- Раскрывающиеся строки настроек (блок «Проверки») ---- */
.sdetails { border-top: 1px solid var(--line); }
.sdetails:first-child { border-top: 0; }
.sdetails > summary { display: flex; align-items: center; gap: .75rem .875rem; padding: .875rem 1rem; cursor: pointer; list-style: none; min-width: 0; -webkit-tap-highlight-color: transparent; }
.sdetails > summary::-webkit-details-marker { display: none; }
.sdetails > summary .text { flex: 1; min-width: 0; display: grid; }
.sdetails > summary .sub { font-size: var(--fs-sm); color: var(--muted); }
.sdetails > summary .chev { color: var(--muted); transition: transform var(--t) var(--ease); }
.sdetails[open] > summary .chev { transform: rotate(90deg); }
.sdetails > summary:hover { background: var(--surface-2); }
.sdetails-body { display: grid; gap: var(--s3); padding: .25rem 1rem 1rem; min-width: 0; }
.sdetails-body > .srow { padding-left: 0; padding-right: 0; border-top: 0; }
@media (max-width: 759px) { .sdetails > summary { padding: .8125rem .875rem; } .sdetails-body { padding: .125rem .875rem .875rem; } }

/* ---- Жесты смахивания (core/swipe.js): стрелка-подсказка у края экрана ---- */
.swipe-hint {
  position: fixed; top: 50%; z-index: var(--z-toast); width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border-radius: 50%;
  background: var(--surface); color: var(--text-2); border: 1px solid var(--line); box-shadow: var(--shadow-pop); pointer-events: none; opacity: 0;
  transition: opacity .12s, background .12s, color .12s; --p: 0;
}
.swipe-hint.left { left: .375rem; transform: translate(calc(-3.625rem + var(--p) * 4rem), -50%) scale(calc(.6 + var(--p) * .4)); }
.swipe-hint.right { right: .375rem; transform: translate(calc(3.625rem - var(--p) * 4rem), -50%) scale(calc(.6 + var(--p) * .4)); }
.swipe-hint.on { opacity: 1; }
.swipe-hint.ready { background: var(--accent); color: var(--inverse); border-color: transparent; }
@media (prefers-reduced-motion: reduce) { .swipe-hint { display: none; } }

/* ---- Новая публикация на телефоне: во весь экран, большие кнопки, закреплённая нижняя панель над клавиатурой ---- */
@media (max-width: 759px) {
  .modal.composer-modal, .modal.composer-modal.wide {
    position: fixed; left: 0; right: 0; top: var(--vv-top, 0px); bottom: auto; width: 100%; max-width: none; margin: 0;
    height: var(--vv-h, 100dvh); max-height: none; border-radius: 0; padding-bottom: 0; display: flex; flex-direction: column; overflow: hidden; animation: sheet-up .28s var(--ease-out);
  }
  .modal.composer-modal::before { display: none; }
  .modal.composer-modal .modal-head { padding: calc(.625rem + env(safe-area-inset-top)) .625rem .375rem 1.125rem; border-bottom: 1px solid var(--line); }
  .modal.composer-modal .modal-head h2 { font-size: var(--fs-lg); }
  .modal.composer-modal .modal-head .iconbtn { width: 2.75rem; height: 2.75rem; }
  .modal.composer-modal .modal-body { flex: 1; min-height: 0; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
  .modal.composer-modal .composer { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
  /* Область текста прокручивается, нижняя панель — нет */
  .modal.composer-modal .composer > .row { flex: 1; min-height: 0; overflow-y: auto; padding: .875rem 1rem .5rem; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .modal.composer-modal .editor { min-height: 34dvh; max-height: none; font-size: var(--fs-lg); line-height: 1.5; }
  .modal.composer-modal .editor-tools, .modal.composer-modal .ed-bar { flex: none; }
  .modal.composer-modal .composer > .editor-tools { padding: .25rem .75rem; border-top: 1px solid var(--line); }
  .modal.composer-modal .field-error { margin: 0; padding: .375rem 1rem 0; }
  /* Нижняя панель: ряд параметров (прокручивается вбок) и ряд крупных кнопок */
  .modal.composer-modal .composer-foot { flex: none; border-top: 1px solid var(--line); background: var(--surface); padding: .5rem .75rem calc(.625rem + env(safe-area-inset-bottom)); gap: .375rem; flex-wrap: wrap; }
  html.kb-open .modal.composer-modal .composer-foot { padding-bottom: .5rem; }
  .modal.composer-modal .composer-opts { order: -1; flex-basis: 100%; margin: 0 -.125rem .25rem; }
  .modal.composer-modal .composer-foot .iconbtn { width: 2.875rem; height: 2.875rem; }
  .modal.composer-modal .composer-foot > .btn { --h: 2.875rem; margin-left: .375rem; padding: 0 1.375rem; font-size: var(--fs-md); }
  .modal.composer-modal .cpick { height: 2.375rem; }
  .modal.composer-modal .attachments { grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr)); }
  .modal.composer-modal .attachment .x, .modal.composer-modal .attachment .ed { width: 2rem; height: 2rem; }
}

.pe-ed-filters { cursor: grab; scroll-snap-type: x proximity; }
.pe-ed-filters.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.pe-ed-filter { scroll-snap-align: center; }

/* ---------- Упоминания @ник (components/richtext.js, ui/mentions.js) ---------- */
/* В тексте — ник акцентным цветом без подчёркивания (подчёркивание остаётся у обычных ссылок). */
.rt a.mention { text-decoration: none; font-weight: 600; border-radius: var(--r-sm); }
.rt a.mention:hover { text-decoration: none; opacity: .8; }
.rt a.mention:focus-visible { outline: .125rem solid var(--accent); outline-offset: 1px; }
.editor .mention { color: var(--accent-strong); font-weight: 600; background: var(--accent-soft); border-radius: var(--r-sm); padding: 0 1px; }
/* Подсказки у курсора: опора — невидимая точка у курсора, панель — общая .popover */
.mention-anchor { position: fixed; width: 1px; pointer-events: none; visibility: hidden; }
.popover.mention-pop { width: min(18.75rem, calc(100vw - 1rem)); padding: .25rem; }
.mention-list { display: grid; gap: 1px; max-height: min(20rem, 45vh); overflow-y: auto; overscroll-behavior: contain; }
.mention-opt {
  display: flex; align-items: center; gap: .625rem; min-height: 2.75rem; padding: .375rem .5rem; border-radius: var(--r-sm);
  cursor: pointer; color: var(--text); transition: background var(--t-fast);
}
.mention-opt.on { background: var(--accent-soft); }
.mention-opt.on .mention-text span { color: var(--accent-strong); }
.mention-text { display: grid; min-width: 0; line-height: 1.25; }
.mention-text b { font-weight: 600; font-size: var(--fs-sm); }
.mention-text span { font-size: var(--fs-xs); color: var(--muted); }
.mention-note { display: flex; align-items: center; gap: .5rem; padding: .625rem .5rem; color: var(--muted); font-size: var(--fs-sm); }
.mention-note .spinner { width: .875rem; height: .875rem; }

/* Сообщества: строка каталога с обложкой, опросы, события */
.list-row.has-cover { background-repeat: no-repeat; }
a.small.block { display: block; }
article.card h3 { font-size: var(--fs-lg, 1.1rem); }
.act.repost[aria-pressed="true"] { color: var(--accent); }

/* Магазин тем и стикеров: подъём карточки при наведении — только на устройствах с мышью (на телефоне «залипал» и карточки прыгали). */

/* Магазин тем: карточки одной высоты, кнопки — друг под другом на всю ширину, одинаковые отступы (раньше «Включить»/«Купить» переносились по-разному). */

/* ---------- Темы в цветах самой темы: карточка магазина, выбор в настройках, крафт ---------- */

/* ---------- Сообщество в профиле: продольная плашка ---------- */
.cplate { position: relative; display: block; overflow: hidden; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface-2); color: var(--text); text-decoration: none; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
a.cplate:hover { border-color: var(--line-strong); box-shadow: var(--shadow-pop); }
a.cplate:focus-visible { outline: .125rem solid var(--accent); outline-offset: .125rem; }
.cplate-cover { position: absolute; inset: 0; background: linear-gradient(120deg, var(--accent-soft), var(--surface-3)) center / cover; opacity: .55; }
.cplate::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--surface) 28%, color-mix(in srgb, var(--surface) 55%, transparent) 100%); }
.cplate-inner { position: relative; z-index: 1; display: flex; align-items: center; gap: .875rem; padding: .75rem .875rem; min-width: 0; }
.cplate-text { display: grid; gap: .125rem; min-width: 0; flex: 1; }
.cplate-kicker { font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.cplate-name { font-size: var(--fs-md); }
.cplate-sub, .cplate-desc { font-size: var(--fs-sm); color: var(--text-2); }
.cplate-desc { color: var(--muted); }
.cplate-role { flex: none; }
.cplate .chev { flex: none; color: var(--muted); }
@media (max-width: 520px) { .cplate-role { display: none; } .cplate-inner { padding: .625rem .75rem; gap: .625rem; } }

/* ---------- Коллекция стикеров: поиск, фильтры, выбор нескольких ---------- */

