/* v3 «Лента» (главная) в стиле B «Bento»: шапка дня, бенто «Сейчас в городе», сегменты, карточки ленты, поиск.
   Владелец — Foundation. Токены и общие компоненты — css/base.css. */

:root, :root[data-theme="dark"] { --wx-cloud: rgba(232, 238, 248, .92); --wx-bg-a: #1A2B45; --wx-bg-b: #161C26; }
:root[data-theme="light"] { --wx-cloud: #FFFFFF; --wx-bg-a: #D9E9FF; --wx-bg-b: #EFF5FF; }

.pane-in.feed { position: relative; padding: 0 var(--pad) calc(var(--tabbar-space) + 24px); }
.pane-in.feed > * { position: relative; z-index: 1; }
/* наследие ig.css давало соседским блокам, пустым состояниям и хвосту ленты лишние 12 px сбоку (34 px вместо 16) — P1-5 */
.pane-in.feed #nowTop, .pane-in.feed .finj, .pane-in.feed .empty, .pane-in.feed .fend, .pane-in.feed .fmore .btn { margin-left: 0; margin-right: 0; }

/* ---------------------------------------------------------------- шапка дня: приветствие по времени (P2-1) */
.home-hello { padding: 10px 0 12px; }
.home-hello__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; min-height: 32px; }
.home-hello small { font: var(--t-caption); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-hello h1 { margin: 0; font: var(--t-display); letter-spacing: -.03em; text-wrap: balance; }
.hello-w { display: inline-block; white-space: pre; }
.hello-in .hello-w { opacity: 0; transform: translateY(6px); animation: hello-w 320ms var(--ease-out) forwards; animation-delay: calc(var(--w) * 40ms); }
@keyframes hello-w { to { opacity: 1; transform: none; } }
.hello-sum { margin: 6px 0 0; font: var(--t-caption); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hello-sum b { font-weight: 700; color: var(--text); }
.hello-sum .is-alert { color: var(--red-text); }
.live { position: relative; display: inline-flex; align-items: center; gap: 7px; flex: none; min-height: 32px; padding: 0 12px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-text); font: 700 13px/18px var(--font); white-space: nowrap;
  transition: transform var(--d-base) var(--ease-spring); }
.live::before { content: ""; position: absolute; left: 0; right: 0; top: -6px; bottom: -6px; }   /* хит-зона 44 px (P0-5) */
.live:active { transform: scale(.96); transition-duration: var(--d-tap); }
/* P2-3: «онлайн-маяк» — кольцо 2 px расходится и гаснет */
.live i { position: relative; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.live i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid currentColor; opacity: .6;
  animation: live-beacon 1.8s var(--ease-out) infinite; }
@keyframes live-beacon { to { transform: scale(2.6); opacity: 0; } }
.live--off { background: var(--surface-2); color: var(--text-2); }
.live--off i::after { animation: none; opacity: 0; }
@keyframes live-pulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 10%, transparent); } }

/* ---------------------------------------------------------------- небо под погоду (P2-2): только transform/opacity */
.sky { position: absolute !important; z-index: 0 !important; top: 0; left: calc(-1 * var(--pad)); right: calc(-1 * var(--pad)); height: 220px; overflow: hidden;
  pointer-events: none; -webkit-mask-image: linear-gradient(#000 40%, transparent); mask-image: linear-gradient(#000 40%, transparent);
  opacity: 0; transition: opacity 600ms var(--ease-out); }
.sky.on { opacity: 1; }
.sky[data-sky="clear"] { background: radial-gradient(120% 80% at 85% 0%, #FFD36E33, transparent 60%); }
:root[data-theme="light"] .sky[data-sky="clear"] { background: radial-gradient(120% 80% at 85% 0%, #FFC94D40, transparent 60%); }
.sky[data-sky="cloud"] { background: radial-gradient(140% 90% at 70% 0%, #8FA3B833, transparent 65%); }
.sky[data-sky="rain"], .sky[data-sky="storm"] { background: linear-gradient(#5B6B8029, transparent); }
.sky[data-sky="snow"] { background: linear-gradient(#C9D6E826, transparent); }
.sky[data-sky="night"] { background: radial-gradient(120% 90% at 50% 0%, #3B4A7A33, transparent 70%); }
.sky[data-sky="fog"] { background: linear-gradient(#9AA3B01F, transparent); }
.sky i { position: absolute; display: block; will-change: transform, opacity; }
.sky .cl { top: 18px; width: 150px; height: 46px; border-radius: 46px; background: var(--wx-cloud); opacity: .1; filter: blur(2px);
  animation: sky-drift 60s linear infinite; }
.sky .cl::before { content: ""; position: absolute; left: 30px; top: -22px; width: 70px; height: 60px; border-radius: 50%; background: inherit; }
.sky .cl:nth-child(2) { top: 70px; width: 110px; animation-duration: 84s; animation-delay: -40s; opacity: .07; }
@keyframes sky-drift { from { transform: translateX(-180px); } to { transform: translateX(110vw); } }
.sky .dr { top: -14px; width: 1px; height: 12px; border-radius: 1px; background: currentColor; color: var(--blue); opacity: .3;
  animation: sky-fall .9s linear infinite; }
@keyframes sky-fall { to { transform: translateY(240px); } }
.sky .sn { top: -6px; width: 3px; height: 3px; border-radius: 50%; background: var(--wx-cloud); opacity: .7;
  animation: sky-snow 6s linear infinite; }
:root[data-theme="light"] .sky .sn { background: #9FB3CC; }
@keyframes sky-snow { 0% { transform: translate(0, 0); } 50% { transform: translate(12px, 120px); } 100% { transform: translate(-6px, 240px); } }
.sky .fg { left: -20%; width: 90%; height: 60px; border-radius: 60px; background: #fff; opacity: .08; filter: blur(20px); animation: sky-fog 40s ease-in-out infinite alternate; }
.sky .fg:nth-child(1) { top: 30px; }
.sky .fg:nth-child(2) { top: 100px; left: 30%; animation-duration: 52s; animation-direction: alternate-reverse; }
:root[data-theme="light"] .sky .fg { background: #8C99AA; opacity: .1; }
@keyframes sky-fog { to { transform: translateX(30%); } }
.sky .st { width: 1.5px; height: 1.5px; border-radius: 50%; background: #fff; opacity: .3; animation: sky-tw 4s ease-in-out infinite alternate; }
:root[data-theme="light"] .sky .st { display: none; }
@keyframes sky-tw { to { opacity: .9; } }

/* ---------------------------------------------------------------- «пульс города» (P2-3) */
.pulse { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 10px; padding: 0; min-height: 44px; text-align: left; color: var(--text-2); }
.pulse__bars { flex: 1; min-width: 0; height: 28px; display: flex; align-items: flex-end; gap: 2px; }
.pulse__b { flex: 1; min-width: 2px; height: calc(3px + var(--h, 0) * 25px); border-radius: 2px; background: var(--c, var(--accent)); opacity: calc(.35 + var(--h, 0) * .65);
  transform-origin: bottom; transition: height var(--d-3) var(--ease-out); }
.pulse__b.z { background: var(--surface-3); opacity: 1; }
.pulse__b:last-child { animation: pulse-breathe 2s var(--ease-in-out) infinite; }
@keyframes pulse-breathe { 50% { transform: scaleY(1.15); } }
.pulse__t { flex: none; font: var(--t-caption); white-space: nowrap; }
.pulse__t b { color: var(--text); font-weight: 700; }

/* ---------------------------------------------------------------- бенто */
.bento { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.bento .tile { font: inherit; }
.tile .t-lbl { display: flex; align-items: center; gap: 6px; font: 700 13px/18px var(--font); color: var(--text-2); position: relative; z-index: 1; }
.tile .t-lbl--amber { color: var(--amber-text); } .tile .t-lbl--blue { color: var(--blue-text); } .tile .t-lbl--red { color: var(--red-text); }
.tile .t-big { display: block; font: 700 28px/32px var(--font-head); letter-spacing: -.04em; color: var(--text); font-variant-numeric: tabular-nums; }
.tile .t-big--sm { font: var(--t-headline); letter-spacing: -.02em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .t-sub { display: block; margin-top: 4px; font: var(--t-caption); color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile .t-sub--3 { color: var(--text-3); -webkit-line-clamp: 1; margin-top: 2px; }
.tile .t-row { display: flex; align-items: baseline; gap: 6px; }
.tile .t-unit { font: 700 13px/18px var(--font); color: var(--text-2); }
.tile.t-sq { min-height: 136px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.tile.t-sq > span:last-child { position: relative; z-index: 1; }
.is-calm .t-big { font: var(--t-title); letter-spacing: -.02em; color: var(--text-2); }
/* P2-5: числовой тикер — каждая цифра крутится колонкой 0–9 */
.tk { display: inline-flex; --tk-h: 32px; }
.tk-c { display: inline-block; height: var(--tk-h); overflow: hidden; }
.tk-s { display: flex; flex-direction: column; transform: translateY(calc(var(--n, 0) * -1 * var(--tk-h))); transition: transform 500ms var(--ease-out); }
.tk-s > span { height: var(--tk-h); line-height: var(--tk-h); }
/* плитка «нет данных · обновить» — после таймаута API (P0-1.5) */
.tile.t-off { min-height: 136px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; color: var(--text-2); }
.tile.t-off .t-off__h { display: block; font: var(--t-headline); color: var(--text-2); }
.tile.t-off .t-off__s { display: inline-flex; align-items: center; gap: 6px; font: var(--t-caption); color: var(--accent-text); }
.tile--wide.t-off { min-height: 76px; flex-direction: row; align-items: center; gap: 12px; }
.tile--wide.t-off .t-calm__ico { background: var(--surface-2); color: var(--text-2); }

/* тревога */
.tile.t-alert { min-height: 122px; padding: 16px 16px 14px; display: flex; flex-direction: column; color: #fff;
  background: linear-gradient(135deg, #FF5A4E 0%, #E5233A 60%, #C2183A 100%); box-shadow: 0 10px 30px rgba(229, 35, 58, .28); }
.tile .t-alert__rings { position: absolute; right: -40px; top: -40px; width: 200px; height: 200px; pointer-events: none; }
.tile .t-alert__rings span { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .18); animation: ring 3s ease-out infinite; }
.tile .t-alert__rings span:nth-child(2) { inset: 30px; animation-delay: .4s; }
.tile .t-alert__rings span:nth-child(3) { inset: 60px; background: rgba(255, 255, 255, .08); animation-delay: .8s; }
@keyframes ring { 50% { transform: scale(1.04); opacity: .7; } }
.tile .t-alert__pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .2); border-radius: 20px;
  padding: 4px 9px 4px 7px; font: var(--t-micro); letter-spacing: .04em; text-transform: uppercase; position: relative; }
.tile .t-alert__pill i { width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .3); animation: live-pulse 1.4s ease-in-out infinite; }
.tile .t-alert__h { display: block; font: var(--t-headline); letter-spacing: -.02em; margin-top: 8px; position: relative; }
.tile .t-alert__bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; position: relative; }
.tile .t-alert__timer { font: 700 22px/28px var(--font-head); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tile .t-alert__timer small { display: block; font: var(--t-caption); opacity: .85; letter-spacing: 0; }
.tile .t-alert__cta { flex: none; background: #fff; color: #C42830; font: var(--t-callout); padding: 12px 14px; border-radius: 14px; }
.tile.t-alert--sm { margin-bottom: 12px; }
.tile .t-alert__acts { display: flex; gap: 8px; margin-top: 12px; position: relative; }
.tile .t-alert__acts > button { flex: 1; min-height: 44px; border-radius: 14px; font: var(--t-callout); transition: transform var(--d-base) var(--ease-spring); }
.tile .t-alert__acts > button:active { transform: scale(.96); transition-duration: var(--d-tap); }
.tile .t-alert__btn { background: rgba(255, 255, 255, .2); color: #fff; }
.t-alert .t-alert__acts .t-alert__cta { padding: 0 14px; }

/* всё спокойно / отбой */
.tile.t-calm { min-height: 76px; display: flex; flex-direction: row; align-items: center; gap: 12px; padding: 14px 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--surface)) 0%, var(--surface) 75%); }
.tile .t-calm__ico { width: 44px; height: 44px; flex: none; border-radius: 15px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.tile .t-calm__tx { flex: 1; min-width: 0; }
.tile .t-calm__h { display: block; font: var(--t-headline); letter-spacing: -.02em; }
.tile .t-calm__s { display: block; margin-top: 2px; font: var(--t-caption); color: var(--text-2); }
.tile .t-calm__go { color: var(--text-3); flex: none; }
.tile .t-calm__x { position: relative; width: 36px; height: 36px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); font-size: 18px; flex: none; }
.tile .t-calm__x::before { content: ""; position: absolute; inset: -4px; }
.tile.t-calm--recent { margin-bottom: 0; }

/* отключения */
.tile .t-out__spark { position: absolute; right: 12px; top: 40px; }
/* погода */
.tile.t-wx { background: linear-gradient(160deg, var(--wx-bg-a) 0%, var(--wx-bg-b) 100%); }
.tile .t-wx__art { position: absolute; right: -6px; top: 10px; opacity: .95; }
/* дороги */
.tile .t-bar { display: flex; gap: 3px; height: 6px; margin: 7px 0 2px; }
.tile .t-bar i { flex: 1; border-radius: 3px; background: var(--surface-2); }
.tile .t-bar i.l1 { background: #22B573; } .t-bar i.l2 { background: #FFCC00; } .t-bar i.l3 { background: #FF9500; } .t-bar i.l4 { background: var(--red); }
/* «Главное за день» (содержимое — js/daily.js renderDailyTile, стили — css/daily.css; здесь цвет плитки) */
.tile.t-daily { background: linear-gradient(150deg, #3B2BD6 0%, #6A3DE8 55%, #9B4DDB 100%); color: #fff; box-shadow: 0 10px 30px rgba(90, 54, 224, .25); }
/* P1-12: в светлой — тоже фиолетовая (по контракту violet), а не чёрная */
:root[data-theme="light"] .t-daily { background: linear-gradient(135deg, #6A55F0, #8B5CF6); box-shadow: 0 10px 30px rgba(106, 85, 240, .22); }
.tile.t-daily .dly-tile__lbl { color: rgba(255, 255, 255, .75); }
.tile.t-daily .dly-tile__txt { color: #fff; }
.tile.t-daily .dly-tile__stack > span { border-color: #5A36E0; }
:root[data-theme="light"] .t-daily .dly-tile__stack > span { border-color: #6A55F0; }
/* скелеты плиток (высоты совпадают с настоящими — без прыжка, P2-6) */
.tile.t-sk { pointer-events: none; min-height: 136px; }
.tile.t-sk--wide, .tile--wide.t-sk { min-height: 76px; }
.bento > .sk-slow { grid-column: 1 / -1; }
.bento > .tile:not(.t-sk) { animation: tile-in var(--d-2) var(--ease-out) both; }
.bento.is-warm > .tile { animation: none; }
@keyframes tile-in { from { opacity: 0; } }

/* ---------------------------------------------------------------- сегменты (липкие, P1-5: подложка с блюром и маской) */
.home-seg { position: sticky; top: 0; z-index: 5 !important; margin: 0 calc(-1 * var(--pad)); padding: 8px var(--pad) 10px;
  background: linear-gradient(var(--bg) 70%, color-mix(in srgb, var(--bg) 0%, transparent));
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }

/* ---------------------------------------------------------------- карточка ленты */
.flist { display: flex; flex-direction: column; gap: 12px; }
.fcard { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 16px; overflow: hidden; margin: 0;
  border: 0; transition: transform .12s ease-out; content-visibility: auto; contain-intrinsic-size: auto 420px; }
.fcard--skel { content-visibility: visible; }
/* P2-5: новые сверху — подсветка фона, гаснет за 1,2 с */
.fcard.enter { animation: fcard-in var(--d-3) var(--ease-out), fcard-glow 1.2s var(--ease-out); }
@keyframes fcard-in { from { transform: translateY(-10px); opacity: 0; } }
@keyframes fcard-glow { from { background-color: color-mix(in srgb, var(--accent) 16%, var(--surface)); } }
.fcard--hot { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--red) 55%, transparent); }
/* P0-3: «Отбой» — зелёный, без красной рамки */
.fcard--ok { box-shadow: var(--shadow-1); }
.fcard__au { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fcard__av { flex: none; border-radius: 13px; }
.fcard__av .av { border-radius: 13px !important; display: grid; place-items: center; color: #fff; font-weight: 800; background: var(--av, var(--violet)); overflow: hidden; }
.fcard__av .av img { width: 100%; height: 100%; object-fit: cover; }
.fcard__who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fcard__n { display: flex; align-items: center; gap: 6px; min-width: 0; }
.fcard__name { position: relative; min-width: 0; font: var(--t-callout); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.fcard__n .vf { flex: none; }
/* рубрика рядом с именем — бейдж (микро-ступень капсом, P0-6) */
.fcard__n .chip { flex: 0 1 auto; min-width: 24px; overflow: hidden; text-overflow: ellipsis; min-height: 0; padding: 3px 7px; border-radius: 8px; font: var(--t-micro); letter-spacing: .04em; text-transform: uppercase; }
/* P0-7: имя автора важнее рубрики — сжимается сначала чип */
.fcard__n .fcard__name { flex: 0 0 auto; max-width: 100%; }
.fcard__n .chip .ico { width: 12px; height: 12px; }
.fcard__m { font: var(--t-caption); color: var(--text-3); margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcard__more { position: relative; flex: none; width: 36px; height: 36px; margin-right: -8px; border-radius: 12px; display: grid; place-items: center; color: var(--text-3); }
.fcard__more::before { content: ""; position: absolute; inset: -4px; }
/* P0-6: заголовок карточки — Unbounded 17/24 600, не больше 3 строк */
.fcard__t { margin: 12px 0 0; font: var(--t-headline); letter-spacing: -.01em; color: var(--text); cursor: pointer;
  overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fcard__x { margin: 12px 0 0; font: var(--t-body); color: var(--text); white-space: pre-line;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.fcard__x--big { font: var(--t-headline); letter-spacing: -.01em; -webkit-line-clamp: 6; }
.fcard__media { margin-top: 12px; }
.fcard__media .ig-m { position: relative; margin: 0; border-radius: 18px; overflow: hidden; background: var(--surface-2); max-height: 420px; }
.fcard__media .ig-m img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fcard__media .ig-dots { margin-top: 8px; }
.fcard__lead { margin: 12px 0 0; font: var(--t-body); color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.fcard__media + .fcard__lead { -webkit-line-clamp: 2; }   /* P2-9: с картинкой — 2 строки, карточка влезает в экран */
.fcard__acts { display: flex; align-items: center; gap: 6px; margin-top: 16px; }
.fcard__act { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--surface-2);
  font: 700 13px/18px var(--font); color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums;
  transition: transform var(--d-base) var(--ease-spring), background var(--d-fast), color var(--d-fast); }
.fcard__act::before { content: ""; position: absolute; left: 0; right: 0; top: -2px; bottom: -2px; }
.fcard__act--ghost { min-width: 44px; justify-content: center; }
.fcard__act:active { transform: scale(.94); transition-duration: var(--d-tap); }
.fcard__act--useful { background: var(--accent-soft); color: var(--accent-text); }
.fcard__act--useful.on { background: var(--accent); color: var(--accent-ink); }
.fcard__act--useful.on .ico { fill: currentColor; fill-opacity: .25; }
.fcard__act .ig-likes b { font-weight: 800; }
.fcard__act .ig-likes::before { content: "·"; margin-right: 5px; opacity: .6; }
.fcard__act--ghost { background: transparent; padding: 0 8px; color: var(--text-2); }
.fcard__act--ghost.on { color: var(--accent-text); }
.fcard__act--ghost.on .ico { fill: currentColor; }
.fcard__act.pop { animation: pop .35s var(--ease); }
@keyframes pop { 40% { transform: scale(1.12); } }
.fcard__sp { flex: 1; }
.fcard--skel { pointer-events: none; }
.fcard--skel .fcard__who { gap: 0; }
@media (max-width: 370px) {
  .fcard__act { padding: 0 10px; }
  .fcard__act--ghost { padding: 0 6px; }
  .t-big { font-size: 27px; }
}

/* хвост ленты */
.fmore { margin: 0; }
.fend { text-align: center; padding: 24px 12px 8px; color: var(--text-2); font: var(--t-callout); }
.fend span { width: 40px; height: 40px; margin: 0 auto 10px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.fend i { display: block; font: var(--t-caption); font-style: normal; color: var(--text-3); margin-top: 2px; }
.finj:empty { display: none; }
.flist .empty.card { padding: 32px 20px 24px; }
.flist .row-h { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 0 12px; padding: 0; }
.flist .row-h b { font: var(--t-headline); letter-spacing: -.02em; }
.flist .row-h span { color: var(--text-3); font: var(--t-caption); }
/* P1-5: «Соседи спрашивают» — карусель на всю ширину, следующая карточка выглядывает на 32 px */
.pane-in.feed .finj .poll-rail { margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad) 6px; scroll-padding: 0 var(--pad); scroll-snap-type: x mandatory; gap: 10px; }
.pane-in.feed .finj .poll-rail .poll { flex: 0 0 calc(100% - 48px); scroll-snap-align: start; }
.pane-in.feed .finj .ph-strip { margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad) 6px; scroll-padding: 0 var(--pad); }

/* «Кого почитать» */
.sug { margin-top: 4px; }
.sug-rail { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--pad)); padding: 2px var(--pad) 6px; }
.sug-rail::-webkit-scrollbar { display: none; }
.sug-c { flex: none; width: 136px; padding: 14px 10px 12px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.sug-c b { font: var(--t-callout); }
.sug-c i { font: var(--t-caption); font-style: normal; color: var(--text-3); }
.sug-c .btn { margin-top: 6px; width: 100%; }
.sug-av .av { border-radius: 20px !important; }

/* pull-to-refresh (P2-5): логотип «М» рисуется контуром по мере тяги, после порога — заливка, загрузка — вращение, итог — галочка */
.ptr { position: absolute; z-index: 3; left: 50%; top: 0; width: 32px; height: 32px; margin-top: 6px; transform: translate(-50%, -44px); opacity: 0; pointer-events: none; color: var(--accent); }
.ptr svg { display: block; width: 100%; height: 100%; overflow: visible; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ptr .ptr-box, .ptr .ptr-m { stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p, 0) * 100); }
.ptr .ptr-box { transition: fill var(--d-fast); }
.ptr .ptr-ok { stroke-dasharray: 100; stroke-dashoffset: 100; stroke: var(--accent-ink); }
.ptr.ready .ptr-box { fill: var(--accent); }
.ptr.ready .ptr-m { stroke: var(--accent-ink); }
.ptr.spin-on svg { animation: spin .8s linear infinite; }
.ptr.done .ptr-m { opacity: 0; }
.ptr.done .ptr-ok { stroke-dashoffset: 0; transition: stroke-dashoffset 320ms var(--ease-out); }
.pane-in.feed { transition: transform 320ms var(--ease-spring); }

/* ---------------------------------------------------------------- поиск */
.srch { padding: 4px var(--pad) 0; }
.srch__f { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: var(--r-md); background: var(--surface);
  box-shadow: var(--shadow-1); color: var(--text-3); }
.srch__f input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: var(--t-body); }
.srch__f input::placeholder { color: var(--text-3); }
.srch__list { display: flex; flex-direction: column; gap: 12px; padding: 16px 0 20px; }
.srch__hint { margin: 6px 0; color: var(--text-3); font: var(--t-caption); }
/* P1-8: поиск без запроса — «Часто ищут» и «Недавние» */
.srch__sec { margin: 8px 0 4px; font: var(--t-micro); letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.srch__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.srch mark, .fcard mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 4px; padding: 0 1px; }

/* ================================================================ v4: бесконечная лента сюжетов */
/* рубрики-чипы под сегментами (прилипают вместе с ними) */
.fcats { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 10px calc(-1 * var(--pad)) 0; padding: 0 var(--pad) 2px;
  scroll-snap-type: x proximity; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent); }
.fcats::-webkit-scrollbar { display: none; }
.fchip { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 12px; scroll-snap-align: start;
  background: var(--surface); box-shadow: var(--shadow-1); color: var(--text-2); font: 700 13px/18px var(--font); white-space: nowrap;
  transition: transform .12s ease-out, background .2s, color .2s, box-shadow .2s; }
.fchip:active { transform: scale(.95); }
.fchip i { width: 7px; height: 7px; border-radius: 50%; background: var(--tone, var(--text-3)); transition: transform .2s; }
.fchip--red { --tone: var(--red); } .fchip--amber { --tone: var(--amber); } .fchip--blue { --tone: var(--blue); }
.fchip--violet { --tone: var(--violet); } .fchip--accent { --tone: var(--accent); }
.fchip.is-on { background: var(--invert); color: var(--invert-ink); box-shadow: none; animation: fchip-on .3s var(--ease); }
.fchip.is-on i { transform: scale(1.25); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone, var(--accent)) 30%, transparent); }
.fchip::before { content: ""; position: absolute; left: 0; right: 0; top: -4px; bottom: -4px; }
.fchip--cta { color: var(--accent-text); background: var(--accent-soft); box-shadow: none; }
.fchip--cta .ico { width: 14px; height: 14px; }
@keyframes fchip-on { 40% { transform: scale(1.06); } }

/* карточка: появление новой страницы, прочитанное */
.fcard.rise { animation: fcard-rise .42s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes fcard-rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.fcard { transition: transform .12s ease-out, opacity .35s ease; }
.fcard.is-read { opacity: .66; }
.fcard.is-read .fcard__t { color: var(--text-2); }
.fcard.is-read .fcard__media img { filter: saturate(.75); }
.fcard.is-read:active, .fcard.is-read:focus-within { opacity: .9; }

/* строка сюжета: источники · обновлено · в канале */
.fcard__story { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 12px; font: var(--t-caption); color: var(--text-3); cursor: pointer; }
.fcard__src { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); }
.fcard__src b { font-weight: 700; }
.fcard__upd, .fcard__ch { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.fcard__upd .ico, .fcard__ch .ico { width: 13px; height: 13px; }
.fcard__upd.is-fresh { color: var(--amber-text); }
.fcard__upd.is-fresh .ico { animation: upd-spin 2.4s var(--ease) 1; }
@keyframes upd-spin { 30% { transform: rotate(-200deg); } 100% { transform: rotate(-360deg); } }
.fcard__ch { padding: 3px 8px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); }

/* стопка иконок источников (и в пилюле «↑ N новых») */
.sstack { display: inline-flex; align-items: center; }
.sstack__i { position: relative; display: inline-flex; border-radius: 34%; box-shadow: 0 0 0 2px var(--surface); }
.sstack__i + .sstack__i { margin-left: -6px; }
.sstack .av { border-radius: 34% !important; font-weight: 800; }

/* «↑ N новых» */
#feedPill { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px 0 12px; opacity: 0; transform: translate(-50%, -14px) scale(.92);
  transition: opacity .25s, transform .35s var(--ease); }
#feedPill.is-in { opacity: 1; transform: translate(-50%, 0) scale(1); }
#feedPill .sstack__i { box-shadow: 0 0 0 2px var(--accent); }
#feedPill .fpill__ar { font-size: 15px; animation: pill-bob 1.6s ease-in-out infinite; }
@keyframes pill-bob { 50% { transform: translateY(-2px); } }

/* пустые состояния ленты */
.fempty { animation: fcard-rise .4s var(--ease) both; }
.fmore .fcard--skel { opacity: .8; }

/* карточка «Рейтинг соседей» в ленте */
.rt-teaser { padding: 14px; border-radius: var(--r-lg); background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--amber) 16%, transparent), transparent 60%), var(--surface); }
.rt-teaser__h { display: flex; align-items: center; gap: 10px; }
.rt-teaser__h > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rt-teaser__h b { font: var(--t-headline); letter-spacing: -.02em; }
.rt-teaser__h i { font: var(--t-caption); font-style: normal; color: var(--text-3); }
.rt-teaser__ic { width: 36px; height: 36px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber); }
.rt-teaser__go { position: relative; flex: none; height: 36px; padding: 0 12px; border-radius: 12px; background: var(--surface-2); font: 700 13px/18px var(--font); color: var(--text); }
.rt-teaser__go::before { content: ""; position: absolute; left: 0; right: 0; top: -4px; bottom: -4px; }
.rt-teaser__l { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.rt-teaser__p { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px; border-radius: 16px; background: var(--surface-2); min-width: 0; }
.rt-teaser__p b { font: 700 13px/18px var(--font); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-teaser__p em { font-style: normal; font: 700 13px/18px var(--font); color: var(--accent-text); }
.rt-teaser__av { position: relative; }
.rt-teaser__av .av { border-radius: 34% !important; }
.rt-teaser__me { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; font: var(--t-caption); color: var(--text-2); }
.rt-teaser__me b { color: var(--text); }
.rt-teaser__me > svg { color: var(--amber); }
/* v4: липкая шапка «сегменты + рубрики» — плотный фон до низа чипов, ниже мягкая маска, чтобы лента не обрезалась резко */
.home-seg { padding-bottom: 14px; background: linear-gradient(var(--bg) calc(100% - 14px), color-mix(in srgb, var(--bg) 0%, transparent)); }
.pane-in.feed > .home-seg { position: sticky; }

/* ---------------------------------------------------------------- экран «Погода» (P1-4, feed.js openWeather) */
.wxs { padding: 0 var(--pad) 24px; max-width: 640px; margin: 0 auto; }
.wxs-hero { position: relative; padding: 8px 0 16px; }
.wxs-hero .t-wx__art { position: absolute; right: 0; top: 8px; transform: scale(1.4); transform-origin: top right; }
.wxs-t { font: 700 64px/64px var(--font-head); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.wxs-x { margin: 8px 0 0; font: var(--t-headline); }
.wxs-f { margin: 2px 0 0; font: var(--t-caption); color: var(--text-2); }
.wxs-hours { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin: 0 calc(-1 * var(--pad)); padding: 4px var(--pad) 8px; scroll-padding: 0 var(--pad); }
.wxs-hours::-webkit-scrollbar { display: none; }
.wxs-h { flex: none; width: 56px; height: 88px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 10px 0; scroll-snap-align: start; }
.wxs-h span { font: var(--t-caption); color: var(--text-3); }
.wxs-h b { font: var(--t-callout); font-variant-numeric: tabular-nums; }
.wxs-h .ico { color: var(--blue); }
.wxs-adv { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 14px 16px; font: var(--t-body); }
.wxs-adv .ico { color: var(--accent); }
.wxs-sec { margin: 24px 0 12px; font: var(--t-headline); }
.wxs-none { margin: 0; font: var(--t-body); color: var(--text-2); }
.wxs-w { display: flex; gap: 12px; padding: 14px 16px; margin-bottom: 10px; }
.wxs-w b { display: block; font: var(--t-callout); }
.wxs-w p { margin: 4px 0 0; font: var(--t-caption); color: var(--text-2); }
.wxs-wi { flex: none; width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber-text); }
.wxs-radar { margin-top: 16px; }
