/* v3 «Местные» — экран поста/новости (макет B, экран 2) + общая вспышка «Полезно» по двойному тапу.
   Только токены из css/base.css (с фолбэками). Владелец — Post (js/post.js, js/postscreen.js).
   v5 — design punch-list: типографика по шкале --t-*, движение на --ease-*/--d-*, тап-цели ≥44, «Отбой» зелёный,
   стопка источников, shared-element «карточка → пост», «Полезно»-взрыв, тикер чисел, комментарии. */

/* ---------------------------------------------------------------- экран: въезд справа (--d-screen), уход быстрее, свайп назад */
.screen.s-pst { transition: transform var(--d-screen, 360ms) var(--ease-out, cubic-bezier(.22, 1, .36, 1)); background: var(--bg); }
.screen.s-pst:not(.in) { transition-duration: 280ms; transition-timing-function: var(--ease-exit, cubic-bezier(.4, 0, 1, 1)); }
.screen.s-pst.pst-drag { transition: none; }
.screen.s-pst > .s-head { display: none !important; }
.s-pst .pst-body { padding: 0 0 24px; background: var(--bg); scroll-behavior: auto; }
.pst { position: relative; color: var(--text); }
.pst .pi { flex: none; }

/* shared element: экран держим за кадром, пока View Transition снимает «старое» состояние */
.screen.s-pst.pst-hold { transform: translateX(100%) !important; transition: none !important; }
.screen.s-pst.pst-shared { transition: none !important; }
.screen.s-pst.pst-gone { visibility: hidden; transition: none !important; }
.screen.s-pst.pst-fade { animation: pst-fade 200ms var(--ease-out, ease-out) both; }
@keyframes pst-fade { from { opacity: 0; } }
/* тело поста проявляется с задержкой 120 мс, пока картинка и заголовок летят из карточки */
.pst-rise .pst-chips, .pst-rise .pst-src, .pst-rise .pst-au, .pst-rise .pst-facts-h, .pst-rise .pst-facts, .pst-rise .pst-art,
.pst-rise .pst-react, .pst-rise .pst-cms, .pst-rise .pst-bar, .pst-rise .pst-nav-r, .pst-rise .pst-back {
  animation: pst-rise 360ms var(--ease-out, cubic-bezier(.22, 1, .36, 1)) 120ms both; }
.pst-rise .pst-sheet { animation: pst-fade 240ms var(--ease-out, ease-out) 60ms both; }
@keyframes pst-rise { from { opacity: 0; transform: translateY(12px); } }
/* фолбэк FLIP — клон картинки поверх всего */
.pst-flip { position: fixed; z-index: 70; border-radius: 18px; background: var(--surface-2) center / cover no-repeat; pointer-events: none; will-change: left, top, width, height; }
.pst-flip.go { border-radius: 0; transition: left 380ms var(--ease-out, cubic-bezier(.22, 1, .36, 1)), top 380ms var(--ease-out, cubic-bezier(.22, 1, .36, 1)),
  width 380ms var(--ease-out, cubic-bezier(.22, 1, .36, 1)), height 380ms var(--ease-out, cubic-bezier(.22, 1, .36, 1)), border-radius 380ms var(--ease-out, ease-out); }
.pst-cover--wait > img, .pst-cover--wait > .pst-car, .pst-cover--wait > .pst-blur { opacity: 0; }
/* View Transitions: только картинка и заголовок «растут», остальное — короткий кроссфейд */
html.vt-post::view-transition-group(*) { animation-duration: 380ms; animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
html.vt-post::view-transition-old(root) { animation: 160ms cubic-bezier(.4, 0, 1, 1) both pst-vt-out; }
html.vt-post::view-transition-new(root) { animation: 260ms cubic-bezier(.22, 1, .36, 1) 40ms both pst-vt-in; }
html.vt-post.vt-back::view-transition-old(root) { animation: 220ms cubic-bezier(.4, 0, 1, 1) both pst-vt-out; }
html.vt-post.vt-back::view-transition-new(root) { animation: none; }
@keyframes pst-vt-out { to { opacity: 0; } }
@keyframes pst-vt-in { from { opacity: 0; } }

/* ---------------------------------------------------------------- стеклянная навигация поверх обложки (кнопки 44×44) */
.pst-nav { position: absolute; z-index: 6; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px;
  padding: calc(var(--safe-top) + 8px) 12px 8px; pointer-events: none;
  transition: background var(--d-fast, 160ms) var(--ease-in-out, ease), box-shadow var(--d-fast, 160ms) var(--ease-in-out, ease); }
.pst-nav > * { pointer-events: auto; }
.pst-nav-r { display: flex; gap: 6px; margin-left: auto; }
.pst-g { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex: none;
  background: rgba(14, 17, 22, .42); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); transition: transform var(--d-base, 240ms) var(--ease-spring, ease-out), background .2s, color .2s; }
.pst-g:active { transform: scale(.92); transition-duration: var(--d-tap, 90ms); }
.pst-g.on { color: var(--accent); }
.pst-g.on .pi { fill: currentColor; }
.pst-g.pop .pi { animation: pst-pop 360ms var(--ease-spring, cubic-bezier(.34, 1.36, .64, 1)); }
.pst-nav-t { flex: 1; min-width: 0; opacity: 0; transform: translateY(4px); font: var(--t-callout, 700 14px/20px var(--font)); font-family: var(--font-head); font-weight: 600;
  letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); pointer-events: none;
  transition: opacity var(--d-fast, 160ms) var(--ease-out, ease-out), transform var(--d-fast, 160ms) var(--ease-out, ease-out); }
.pst-nav.solid { background: var(--bar); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 1px 0 var(--line); }
.pst-nav.titled .pst-nav-t { opacity: 1; transform: none; }
.pst-nav.solid .pst-g { background: var(--surface-2); color: var(--text); box-shadow: none; }
.pst-nav.solid .pst-g.on { color: var(--accent-text, var(--accent)); }

/* ---------------------------------------------------------------- обложка */
.pst-cover { position: relative; width: 100%; aspect-ratio: var(--ratio, 1.6); min-height: 240px; max-height: 56vh; overflow: hidden;
  background: var(--surface-2); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.pst-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.pst-cover::after { content: ""; position: absolute; inset: 0 0 auto; height: 120px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .45), transparent); }
.pst-cover--fit img { object-fit: contain; }
.pst-blur { position: absolute; inset: -20px; background-size: cover; background-position: center; filter: blur(22px) brightness(.7); transform: scale(1.1); }
.pst-credit { position: absolute; z-index: 2; right: 12px; bottom: 38px; padding: 3px 8px; border-radius: 8px; font: var(--t-micro, 800 11px/14px var(--font)); font-weight: 700;
  color: #fff; background: rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); max-width: 70%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pst-cover--none { aspect-ratio: auto; min-height: 0; height: calc(var(--safe-top) + 132px);
  background: radial-gradient(120% 140% at 85% 0%, color-mix(in srgb, var(--cc, var(--blue)) 34%, transparent), transparent 70%), var(--surface); }
.pst-cover--none::after { display: none; }
.pst-ghost { position: absolute; right: -14px; top: calc(var(--safe-top) + 6px); color: var(--cc, var(--blue)); opacity: .16; stroke-width: 1.2; }
.pst-c-incident, .pst-c-alert { --cc: var(--red); }
.pst-c-utilities { --cc: var(--amber); }
.pst-c-roads, .pst-c-city { --cc: var(--blue); }
.pst-c-ugc, .pst-c-culture { --cc: var(--violet); }
.pst-c-good { --cc: var(--accent); }
/* P0-3: отбой — зелёная шапка, никакого красного треугольника */
.pst-cover--none.pst-c-ok { --cc: var(--green, var(--accent));
  background: linear-gradient(160deg, color-mix(in srgb, var(--green, var(--accent)) 28%, var(--surface)) 0%, var(--surface) 70%); }
.pst-c-ok .pst-ghost { opacity: .22; }

/* карусель фото жителя */
.pst-car { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.pst-car::-webkit-scrollbar { display: none; }
.pst-sl { position: relative; flex: 0 0 100%; scroll-snap-align: center; }
.pst-cnt { position: absolute; z-index: 3; top: auto; bottom: 40px; right: 12px; left: auto; padding: 3px 9px; border-radius: 9px; font: var(--t-micro, 800 11px/14px var(--font));
  font-variant-numeric: tabular-nums; color: #fff; background: rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); pointer-events: none; }
.pst-dots { position: absolute; z-index: 3; left: 0; right: 0; bottom: 42px; margin: 0; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.pst-dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .5); transition: width var(--d-base, 240ms) var(--ease-out, ease), background .2s; }
.pst-dots i.on { width: 16px; background: #fff; }

/* двойной тап = «Полезно»: акцентный палец (и в ленте, и на экране) */
.ig-m .ig-heart, .pst-cover .ig-heart { position: absolute; z-index: 4; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  display: grid; place-items: center; border-radius: 22px; background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 45%, transparent); opacity: 0; transform: scale(.4); pointer-events: none; }
.ig-m .ig-heart svg, .pst-cover .ig-heart svg { width: 30px; height: 30px; }
.ig-m .ig-heart.go, .pst-cover .ig-heart.go { animation: pst-thumb 800ms var(--ease-spring, cubic-bezier(.34, 1.36, .64, 1)) both; }
@keyframes pst-thumb {
  0% { opacity: 0; transform: scale(.4) rotate(-12deg); }
  25% { opacity: 1; transform: scale(1.12) rotate(4deg); }
  45% { transform: scale(.96) rotate(0); }
  75% { opacity: 1; transform: scale(1) translateY(0); }
  100% { opacity: 0; transform: scale(.9) translateY(-18px); }
}
@keyframes pst-pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* ---------------------------------------------------------------- «Полезно»-взрыв: 6 точек по кругу на 18 px за 420 мс (P2-5) */
.fcard__act--useful, .ig-b.lk, .pst-like, .pst-cm-lk { position: relative; }
.fcard__act--useful.pop .ico, .ig-b.lk.pop svg, .pst-like.pop .pi, .pst-cm-lk.pop .pi { animation: pst-pop 360ms var(--ease-spring, cubic-bezier(.34, 1.36, .64, 1)); }
.burst::after { content: ""; position: absolute; z-index: 1; left: var(--bx, 22px); top: var(--by, 50%); width: 4px; height: 4px; margin: -2px 0 0 -2px;
  border-radius: 50%; pointer-events: none; color: var(--accent); animation: pst-burst 420ms var(--ease-out, cubic-bezier(.22, 1, .36, 1)) both; }
.pst-like:not(.on).burst::after, .fcard__act--useful.on.burst::after { color: var(--accent); }
@keyframes pst-burst {
  0% { opacity: 1; box-shadow: 0 0 0 1px currentColor, 0 0 0 1px currentColor, 0 0 0 1px currentColor, 0 0 0 1px currentColor, 0 0 0 1px currentColor, 0 0 0 1px currentColor; }
  70% { opacity: 1; }
  100% { opacity: 0; box-shadow: 18px 0 0 0 currentColor, 9px 15.6px 0 0 currentColor, -9px 15.6px 0 0 currentColor, -18px 0 0 0 currentColor,
    -9px -15.6px 0 0 currentColor, 9px -15.6px 0 0 currentColor; }
}

/* ---------------------------------------------------------------- тикер чисел (P2-5) */
.tk { display: inline-flex; height: 1.2em; line-height: 1.2em; overflow: hidden; vertical-align: bottom; font-variant-numeric: tabular-nums; }
.tk-c { display: inline-block; height: 1.2em; overflow: hidden; }
.tk-r { display: block; line-height: 1.2em; transition: transform 500ms var(--ease-out, cubic-bezier(.22, 1, .36, 1)); }
.tk-s { display: inline-block; }
.ig-likes b, .ig-cn, .pst-cms-n, .pst-cm-lk span, .rx-likes { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- лист поверх обложки */
.pst-sheet { position: relative; z-index: 2; margin-top: -28px; padding: 20px var(--pad) 4px; background: var(--bg); border-radius: 28px 28px 0 0; }
.pst-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pst-chip { gap: 5px; min-height: 28px; padding: 4px 10px; font: var(--t-caption, 600 13px/18px var(--font)); font-weight: 700; }
.pst-chip .pi { width: 14px; height: 14px; stroke-width: 2.1; }
.pst-chip--place { max-width: 100%; min-width: 0; }
.pst-chip--place > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pst-chip.chip--accent { color: var(--accent-text, var(--accent)); }
.pst-chip.chip--amber { color: var(--amber-text, var(--amber)); }
.pst-chip.chip--red { color: var(--red-text, var(--red)); }
.pst-chip--ok, .pst-chip--ok.chip--accent { background: var(--green-soft, var(--accent-soft)); color: var(--green-text, var(--accent-text, var(--accent))); }
.pst-title { margin: 12px 0 16px; font: var(--t-title, 700 22px/28px var(--font-head)); letter-spacing: -.02em; color: var(--text); overflow-wrap: break-word;
  -webkit-hyphens: auto; hyphens: auto; }

/* строка источника (P1-6): аватар 40, справа две строки */
.pst-src { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.pst-src .av { width: 40px; height: 40px; border-radius: 13px; font-size: 16px; }
.pst-src-av { display: flex; flex: none; }
.pst-src-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pst-src-n { display: flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; text-align: left; color: var(--text); font: var(--t-callout, 700 14px/20px var(--font)); }
.pst-src-n b { font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pst-src-n svg { flex: none; }
.pst-src-t i { font: var(--t-caption, 600 13px/18px var(--font)); font-style: normal; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* строка жителя */
.pst-au { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; }
.pst-au-av { display: flex; flex: none; }
.pst-au .av { width: 40px; height: 40px; border-radius: 13px; font-size: 16px; }
.pst-au-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pst-au-n { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; text-align: left; font: var(--t-callout, 700 14px/20px var(--font)); font-size: 15px; color: var(--text); }
.pst-au-n b { font-weight: 800; }
.pst-au-s { font: var(--t-caption, 600 13px/18px var(--font)); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pst-fol { flex: none; height: 40px; padding: 0 16px; border-radius: 12px; background: var(--invert); color: var(--invert-ink); font: var(--t-callout, 700 14px/20px var(--font)); font-weight: 800;
  position: relative; transition: transform var(--d-base, 240ms) var(--ease-spring, ease-out), background .2s; }
.pst-fol::before { content: ""; position: absolute; inset: -2px; }
.pst-fol:active { transform: scale(.96); transition-duration: var(--d-tap, 90ms); }
.pst-fol.on { background: var(--surface-2); color: var(--text-2); }

/* аватарки (sapi.avatarHtml → .av) в стиле B: скруглённый квадрат */
.s-pst .av { display: inline-grid; place-items: center; flex: none; overflow: hidden; border-radius: 34%; color: #fff; font-weight: 800; line-height: 1;
  background: var(--av, var(--violet)); }
.s-pst .av img { width: 100%; height: 100%; object-fit: cover; }

/* главное за 5 секунд */
.pst-facts-h { margin: 20px 0 8px; font: var(--t-micro, 800 11px/14px var(--font)); letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.pst-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pst-facts.n1 { grid-template-columns: 1fr; }
.pst-facts.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pst-fact { --tone: var(--violet); min-width: 0; padding: 12px 10px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-1); }
.pst-fact-i { display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 8px; border-radius: 11px; color: var(--tone);
  background: color-mix(in srgb, var(--tone) 15%, transparent); }
.pst-fact-e { font-size: 17px; line-height: 1; }
.pst-fact b { display: block; font: var(--t-caption, 600 13px/18px var(--font)); font-weight: 800; color: var(--text); overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; }
.pst-fact > span:last-child:not(.pst-fact-i) { display: block; margin-top: 4px; overflow-wrap: break-word; font: var(--t-caption, 600 13px/18px var(--font)); font-size: 12px; line-height: 16px; color: var(--text-3); }
/* три факта на узком экране — строками (иконка слева): в трёх колонках по 84 px слова рвутся посередине */
@media (max-width: 479px) {
  .pst-facts.n3 { grid-template-columns: 1fr; gap: 6px; }
  .pst-facts.n3 .pst-fact { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 12px; align-items: center; padding: 10px 12px; border-radius: 16px; }
  .pst-facts.n3 .pst-fact-i { grid-row: span 2; margin: 0; }
  .pst-facts.n3 .pst-fact > span:last-child:not(.pst-fact-i) { margin-top: 0; }
}
.tone-accent { --tone: var(--accent); }
.tone-red { --tone: var(--red); }
.tone-blue { --tone: var(--blue); }
.tone-amber { --tone: var(--amber); }
.tone-violet { --tone: var(--violet); }

/* ---------------------------------------------------------------- текст */
.pst-art { padding: 16px var(--pad) 0; }
.pst-txt { font: var(--t-body, 500 15px/22px var(--font)); font-size: 16px; line-height: 26px; color: var(--text); overflow-wrap: break-word; }
.pst-txt p { margin: 0 0 12px; }
.pst-txt h2, .pst-txt h3, .pst-txt h4 { margin: 20px 0 8px; font: var(--t-headline, 600 17px/24px var(--font-head)); }
.pst-txt ul, .pst-txt ol { margin: 0 0 12px; padding-left: 20px; }
.pst-txt li { margin-bottom: 4px; }
.pst-txt a { color: var(--accent-text, var(--accent)); text-decoration: none; font-weight: 700; }
.pst-txt b, .pst-txt strong { font-weight: 800; }
.pst-txt.ugc.big { font: var(--t-headline, 600 17px/24px var(--font-head)); font-family: var(--font); font-size: 19px; line-height: 28px; }
.pst-pend { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface);
  font: var(--t-callout, 700 14px/20px var(--font)); color: var(--text-2); }
.pst-spin { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.pst-note { display: flex; align-items: flex-start; gap: 8px; margin: 4px 0 12px; font: var(--t-caption, 600 13px/18px var(--font)); font-weight: 700; color: var(--text-3); }
.pst-note .pi { margin-top: 1px; }
.pst-links { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 16px; }
.pst-link { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface);
  box-shadow: var(--shadow-1); text-align: left; color: var(--text); }
.pst-link > .pi:first-child { color: var(--accent); }
.pst-link span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pst-link b { font: var(--t-callout, 700 14px/20px var(--font)); font-size: 15px; font-weight: 800; }
.pst-link i { font: var(--t-caption, 600 13px/18px var(--font)); font-style: normal; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pst-ext { color: var(--text-3); }
.pst-fine { margin: 4px 0 8px; font: var(--t-caption, 600 13px/18px var(--font)); font-weight: 500; color: var(--text-3); }

/* мини-карта */
.pst-map { position: relative; height: 170px; margin: 8px 0 16px; border-radius: var(--r-lg); overflow: hidden; background: var(--mm-ph, var(--surface-2)); }
.pst-map img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--d-base, 240ms) var(--ease-out, ease); display: block; }
.pst-map.ok img { opacity: 1; }
.pst-map-pin { position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -36px 0 0 -18px; border-radius: 12px 12px 12px 3px;
  transform: rotate(-45deg); display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.pst-map-pin .pi { transform: rotate(45deg); }
.pst-map.area .pst-map-pin { display: none; }
.pst-map-w { position: absolute; left: 10px; top: 10px; max-width: 70%; padding: 5px 10px; border-radius: 10px; font: var(--t-caption, 600 13px/18px var(--font)); font-weight: 800;
  background: var(--bar); color: var(--text); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pst-map-go { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px;
  border-radius: 14px; background: var(--invert); color: var(--invert-ink); font: var(--t-callout, 700 14px/20px var(--font)); font-weight: 800; }
.pst-map-attr { position: absolute; left: 8px; bottom: 6px; font: var(--t-micro, 800 11px/14px var(--font)); font-weight: 600; color: var(--text-3); }

/* ---------------------------------------------------------------- «Полезно · N» */
.pst-react { display: flex; gap: 8px; margin: 8px var(--pad) 24px; }
.pst-like { flex: 1; min-width: 0; height: 52px; border-radius: 18px; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink); font: var(--t-callout, 700 14px/20px var(--font)); font-size: 15px; font-weight: 800;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 28%, transparent); transition: transform var(--d-base, 240ms) var(--ease-spring, ease-out), background .2s, color .2s, box-shadow .2s; }
.pst-like.on { background: var(--accent-soft); color: var(--accent-text, var(--accent)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 45%, transparent); }
.pst-like.on .pi { fill: currentColor; fill-opacity: .25; }
.pst-sq { flex: none; width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-1); }

/* ---------------------------------------------------------------- обсуждение */
.pst-cms, .pst-more { padding: 0 var(--pad); }
.pst-sec { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 12px; }
.pst-sec h2 { margin: 0; min-width: 0; font: var(--t-headline, 600 17px/24px var(--font-head)); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pst-sec h2 span { margin-left: 2px; font: var(--t-callout, 700 14px/20px var(--font)); font-size: 15px; color: var(--text-3); }
.pst-seg { flex: none; padding: 3px; border-radius: 14px; }
.pst-seg .seg__item { flex: none; min-height: 36px; padding: 8px 10px; border-radius: 11px; font: var(--t-caption, 600 13px/18px var(--font)); font-weight: 700; position: relative; }
.pst-seg .seg__item::before { content: ""; position: absolute; inset: -4px 0; }
.pst-th { padding: 4px 0; }
.pst-th + .pst-th { border-top: 1px solid var(--line); }
.pst-cm { display: flex; gap: 12px; padding: 10px 0 4px; border-radius: 14px; transition: opacity var(--d-base, 240ms) var(--ease-out, ease); }
.pst-cm-av { flex: none; display: flex; padding-top: 2px; }
.pst-cm .av { width: 36px; height: 36px; font-size: 14px; }
.pst-cm.rp .av { width: 28px; height: 28px; font-size: 12px; }
/* ветка ответов: линия под аватаркой родителя */
.pst-rps { position: relative; margin-left: 17px; padding-left: 19px; border-left: 2px solid color-mix(in srgb, var(--text) 9%, transparent); }
.pst-rps .pst-cm { padding-top: 8px; gap: 10px; }
.pst-cm-b { flex: 1; min-width: 0; }
.pst-cm-who { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; font: var(--t-caption, 600 13px/18px var(--font)); }
.pst-cm-who b { font-weight: 800; color: var(--text); }
.pst-cm-who > span { color: var(--text-3); }
.pst-cm-st { font: var(--t-micro, 800 11px/14px var(--font)); font-style: normal; padding: 2px 7px; border-radius: 7px; background: var(--amber-soft); color: var(--amber-text, var(--amber)); }
.pst-cm-st.is-send { background: var(--surface-2); color: var(--text-3); }
.pst-cm-x { margin: 4px 0 0; font: var(--t-body, 500 15px/22px var(--font)); color: var(--text); overflow-wrap: break-word; white-space: pre-wrap; }
.pst-cm-x.muted { color: var(--text-3); font-style: italic; }
.pst-cm.pend .pst-cm-x, .pst-cm.sending .pst-cm-x { opacity: .6; }
.pst-cm.new { animation: pst-new 1.2s var(--ease-out, ease-out); }
@keyframes pst-new { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
/* действия: «Полезно», «Ответить», справа «…» (44×44, жалоба/удаление — там и по долгому нажатию) */
.pst-cm-m { display: flex; align-items: center; gap: 18px; min-height: 36px; margin-top: 2px; font: var(--t-caption, 600 13px/18px var(--font)); font-weight: 700; color: var(--text-3); }
.pst-cm-m button { min-height: 32px; color: inherit; font-weight: 700; }
.pst-cm-sp { flex: 1; }
.pst-cm-lk { display: inline-flex; align-items: center; gap: 6px; }
.pst-cm-lk.on { color: var(--accent-text, var(--accent)); }
.pst-cm-lk.on .pi { fill: currentColor; fill-opacity: .25; }
.pst-cm-more { width: 44px; height: 44px; min-height: 44px !important; margin: -6px -12px -6px 0; display: grid; place-items: center; border-radius: 12px; color: var(--text-3); }
.pst-cm-more:active { background: var(--surface-2); }
.pst-cm-fail { color: var(--red-text, var(--red)); flex-wrap: wrap; gap: 4px 14px; }
.pst-cm-fail > span { display: inline-flex; align-items: center; gap: 6px; }
.pst-cm-fail button { color: var(--text); font-weight: 800; }
.pst-cm.failed .pst-cm-x { opacity: .7; }
.pst-cms-e { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 12px 28px; text-align: center; color: var(--text-3); }
.pst-cms-e b { font: var(--t-headline, 600 17px/24px var(--font-head)); font-size: 15px; color: var(--text); }
.pst-cms-e span { font: var(--t-caption, 600 13px/18px var(--font)); font-size: 14px; }
.pst-cms-e .btn { margin-top: 8px; min-height: 44px; }
.pst-cms-more, .pst-cms-ch { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; margin: 8px 0;
  border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-1); font: var(--t-callout, 700 14px/20px var(--font)); font-weight: 800; color: var(--text); }
.pst-sk i { display: block; height: 52px; margin-bottom: 10px; border-radius: 14px; background: var(--skel); animation: pst-sk 1.2s var(--ease-in-out, ease-in-out) infinite alternate; }
.pst-sk i:nth-child(2) { width: 82%; }
.pst-sk i:nth-child(3) { width: 64%; }
@keyframes pst-sk { to { background: var(--skel-hi); } }

/* «Ещё от …» */
.pst-more:not(:empty) { margin-top: 24px; }
.pst-all { display: inline-flex; align-items: center; gap: 2px; min-height: 36px; font: var(--t-callout, 700 14px/20px var(--font)); font-weight: 800; color: var(--accent-text, var(--accent)); }
.pst-r { transform: rotate(180deg); }
.pst-more .tgrid { padding: 0; }
.pst-more .tl.noimg .tl-im { aspect-ratio: 4 / 3; }
.pst-more .tl-e { color: var(--cc, var(--text-3)); }

/* ---------------------------------------------------------------- поле ввода снизу (safe-area, P2-7) */
.pst-bar { position: relative; z-index: 5; flex: none; padding: 8px 12px max(12px, var(--safe-bottom)); background: var(--bg);
  box-shadow: 0 -1px 0 var(--line); }
.pst-in-row { display: flex; align-items: flex-end; gap: 8px; }
.pst-in { flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 8px; min-height: 48px; padding: 8px 12px 8px 8px; border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow-1); cursor: text; transition: box-shadow var(--d-fast, 160ms) var(--ease-out, ease); }
.pst-in:focus-within { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent); }
.pst-in .av { width: 32px; height: 32px; border-radius: 11px; font-size: 13px; }
.pst-in textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent; padding: 5px 0; max-height: 110px;
  font: var(--t-body, 500 15px/22px var(--font)); color: var(--text); }
.pst-in textarea::placeholder { color: var(--text-3); }
.pst-send { flex: none; width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink);
  transition: transform var(--d-base, 240ms) var(--ease-spring, ease-out), background var(--d-fast, 160ms), color var(--d-fast, 160ms); }
.pst-send:disabled { background: var(--surface-2); color: var(--text-3); }
.pst-to { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 2px 8px; padding: 4px 4px 4px 12px; border-radius: 12px;
  background: var(--surface-2); font: var(--t-caption, 600 13px/18px var(--font)); font-weight: 700; color: var(--text-2); }
.pst-to button { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--text-2); }
.pst-err { margin: 0 2px 8px; padding: 10px 12px; border-radius: 12px; background: var(--red-soft); color: var(--red-text, var(--red)); font: var(--t-caption, 600 13px/18px var(--font)); font-weight: 700; }

/* ---------------------------------------------------------------- меню поста/комментария: иконки вместо эмодзи */
.mn-l button span .pi { width: 20px; height: 20px; vertical-align: middle; }
.mn-l button.bad { color: var(--red-text, var(--red)); }
.mn-q { margin: 0 4px 12px; font: var(--t-caption, 600 13px/18px var(--font)); color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@media (min-width: 640px) {
  .s-pst .pst { max-width: 640px; margin: 0 auto; }
  .pst-cover { max-height: 460px; }
  .pst-txt { max-width: 34em; }
}

/* без обложки-картинки кнопки не «стеклянные», а обычные плашки */
.pst-nav.flat .pst-g { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); -webkit-backdrop-filter: none; backdrop-filter: none; }
.pst-nav.flat .pst-g.on { color: var(--accent-text, var(--accent)); }

/* ================================================================ v4 */
/* чип уровня жителя «★ 4» (лента, экран поста, комментарии, рейтинг, профиль) */
.lvl { display: inline-flex; align-items: center; gap: 3px; flex: none; height: 18px; padding: 0 6px 0 5px; margin-left: 5px; border-radius: 7px;
  font: var(--t-micro, 800 11px/14px var(--font)); vertical-align: middle; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.lvl b { font-weight: 800; }
.lvl i { font-style: normal; font-weight: 700; margin-left: 3px; padding-left: 5px; border-left: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.lvl svg { color: var(--amber); }
.lvl--t2 { background: var(--accent-soft); color: var(--accent-text, var(--accent)); }
.lvl--t2 svg { color: currentColor; }
.lvl--t3 { background: var(--blue-soft); color: var(--blue-text, var(--blue)); }
.lvl--t3 svg { color: currentColor; }
.lvl--t4 { background: linear-gradient(135deg, color-mix(in srgb, var(--amber) 28%, transparent), color-mix(in srgb, var(--violet) 22%, transparent)); color: var(--amber-text, var(--amber)); }
.lvl--big { height: 24px; padding: 0 9px 0 7px; border-radius: 9px; font: var(--t-caption, 600 13px/18px var(--font)); font-weight: 800; margin-left: 0; }
.lvl--big svg { width: 12px; height: 12px; }

/* P0-2: стопка источников и строка сюжета в карточке ленты — стили в home.css (Foundation); здесь только экран поста ниже */

/* P0-3: отбой в ленте — cards.js ставит .fcard--ok и зелёный чип (по isResolved из post.js) */

/* P1-7: картинка — сгенерированная карточка канала с текстом: заголовок только для скринридера, картинка целиком */
.fcard:has(.ig-m.is-card) .fcard__t { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; margin: 0; }
.fcard__media .ig-m.is-card { max-height: none; }

/* тап-цели старой карточки .ig (ig.css) ≥44: видимый размер прежний, хит-зона шире */
.ig-b, .ig-more { position: relative; }
.ig-b::before, .ig-more::before { content: ""; position: absolute; inset: -4px; }

/* сюжет: строка источников со стопкой иконок */
.pst-src-stack { display: flex; flex: none; min-height: 44px; align-items: center; }
.pst-src--multi .sstack__i { box-shadow: 0 0 0 2px var(--bg); }
.pst-src--multi .sstack .av { width: 28px; height: 28px; }
.pst-src-n span { margin-left: 4px; font-weight: 600; color: var(--text-3); white-space: nowrap; }

/* «История обновлялась» */
.pst-upd { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 12px; padding: 12px; border-radius: var(--r-md);
  background: var(--amber-soft); color: var(--text); font: var(--t-caption, 600 13px/18px var(--font)); }
.pst-upd__i { flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--amber) 20%, transparent); color: var(--amber-text, var(--amber)); }
.pst-upd b { display: block; font-weight: 800; }
.pst-upd i { display: block; font-style: normal; font-weight: 600; color: var(--text-2); margin-top: 2px; }

/* «По данным: …» */
.pst-srcs { margin: 8px 0 16px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); transition: box-shadow .3s; }
.pst-srcs.flash { animation: pst-flash 1.2s var(--ease-out, ease-out); }
@keyframes pst-flash { 0%, 30% { box-shadow: 0 0 0 2px var(--accent); } 100% { box-shadow: var(--shadow-1); } }
.pst-srcs__h { font: var(--t-callout, 700 14px/20px var(--font)); font-weight: 600; color: var(--text-2); }
.pst-srcs__h b { color: var(--text); font-weight: 800; }
.pst-srcs__n { display: flex; align-items: center; gap: 8px; margin-top: 8px; font: var(--t-caption, 600 13px/18px var(--font)); color: var(--text-3); }
.pst-srcs__n .sstack__i { box-shadow: 0 0 0 2px var(--surface); }
.pst-srcs__l { display: flex; flex-direction: column; margin-top: 8px; }
.pst-srcs__i { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 0; text-align: left; color: var(--text); border-top: 1px solid var(--line); }
.pst-srcs__i:first-child { border-top: 0; }
.pst-srcs__i .av { width: 32px; height: 32px; border-radius: 10px !important; }
.pst-srcs__i > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pst-srcs__i b { font: var(--t-callout, 700 14px/20px var(--font)); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pst-srcs__i i { font: var(--t-caption, 600 13px/18px var(--font)); font-style: normal; color: var(--text-3); }

/* черновик сюжета: сводка готовится */
.pst-txt.is-draft { color: var(--text-2); }
.pst-draft { display: flex; align-items: center; gap: 8px; margin: -2px 0 12px; font: var(--t-caption, 600 13px/18px var(--font)); font-weight: 700; color: var(--text-3); }
.pst-draft .pst-spin { width: 13px; height: 13px; border-width: 1.6px; }

/* имя комментатора — ссылка на профиль */
.pst-cm-n { color: var(--text); font: inherit; padding: 0; min-height: 0; }
.pst-cm-who .lvl { margin-left: 0; height: 18px; }

/* ---------------------------------------------------------------- меньше движения (P2-8): кроссфейды остаются, сдвиги и частицы — нет */
@media (prefers-reduced-motion: reduce) {
  .ig-heart.go, .pst-like.pop .pi, .pst-cm.new, .burst::after, .pop .ico, .pop .pi, .pop svg, .pst-g.pop .pi { animation: none !important; }
  .pst-rise .pst-chips, .pst-rise .pst-src, .pst-rise .pst-au, .pst-rise .pst-facts-h, .pst-rise .pst-facts, .pst-rise .pst-art,
  .pst-rise .pst-react, .pst-rise .pst-cms, .pst-rise .pst-bar, .pst-rise .pst-nav-r, .pst-rise .pst-back { animation: pst-fade 150ms linear both !important; }
  .tk-r { transition: none; }
  .pst-nav-t { transform: none; }
  .pst-dots i { transition: none; }
}

/* P0-4: в светлой теме белый текст на --accent (#12A57A) — 3,1:1; заливки кнопок с текстом — на --accent-text (#0B7F5C, 5:1) */
:root[data-theme="light"] .pst-like:not(.on), :root[data-theme="light"] .pst-send:not(:disabled) { background: var(--accent-text, #0B7F5C); }
