/* v12 «Главная · Гибрид» (js/home.js, js/homemap.js): «Рязань сейчас» с мини-картой, бегущая строка, «Соседи · район»,
   бенто «Бензин рядом» / «Мой дом» / «Рейтинг». Тёмная тема — основная, светлая — свои градиенты. Контракт — docs/design_v3.md «v12».
   Анимации: пульс точек, «живая» точка, бегущая строка — выключены при prefers-reduced-motion и html.lowfx. */

:root {
  --h12-pulse-bg: radial-gradient(110% 100% at 82% 0%, #14281F, #0F1216 66%);
  --h12-pulse-bd: rgba(43, 217, 159, .22);
  --h12-fade: #0F1216;
  --h12-alert-bg: radial-gradient(110% 100% at 82% 0%, #4A1019, #1A0B0E 70%);
  --h12-alert-bd: rgba(255, 77, 94, .45);
  --hm-ds: rgba(255, 255, 255, .11);
  --hm-mine: rgba(43, 217, 159, .16);
  --hm-oka: rgba(91, 155, 255, .34);
  --h12-fuel-bg: linear-gradient(165deg, #15231D, var(--surface) 62%);
  --h12-rate-bg: linear-gradient(160deg, #221D3D, var(--surface) 78%);
  --h12-in-bg: var(--bg);
}
:root[data-theme="light"] {
  --h12-pulse-bg: radial-gradient(110% 100% at 82% 0%, #D3F4E6, #FFFFFF 68%);
  --h12-pulse-bd: rgba(18, 165, 122, .24);
  --h12-fade: #FFFFFF;
  --h12-alert-bg: radial-gradient(110% 100% at 82% 0%, #FFD5D9, #FFF6F6 70%);
  --h12-alert-bd: rgba(229, 54, 63, .4);
  --hm-ds: rgba(15, 30, 40, .16);
  --hm-mine: rgba(18, 165, 122, .16);
  --hm-oka: rgba(47, 111, 235, .32);
  --h12-fuel-bg: linear-gradient(165deg, #E3F6EE, #FFFFFF 62%);
  --h12-rate-bg: linear-gradient(160deg, #ECE8FF, #FFFFFF 78%);
  --h12-in-bg: var(--surface-2);
}

.h12 { display: flex; flex-direction: column; gap: 12px; padding-top: 10px; }
.h12-part[hidden] { display: none; }
.h12 .sk { display: block; border-radius: 8px; background: color-mix(in srgb, var(--text) 9%, transparent); }
.h12-lbl { display: inline-flex; align-items: center; gap: 6px; font: 800 0.6875rem/1 var(--font); letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); }
.h12-lbl .ico { width: 14px; height: 14px; }
.h12-lbl--g { color: var(--accent-text); }
.h12-lbl--v { color: var(--violet-text); }

/* ---------------------------------------------------------------- 1. «Рязань сейчас» */
.h12-pulse { position: relative; min-height: 190px; border-radius: 28px; overflow: hidden; background: var(--h12-pulse-bg); border: 1px solid var(--h12-pulse-bd);
  isolation: isolate; color: var(--text); }
.h12-pulse::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, var(--h12-fade) 30%, color-mix(in srgb, var(--h12-fade) 0%, transparent) 74%); }
.h12-pulse.is-alert { background: var(--h12-alert-bg); border-color: var(--h12-alert-bd); --h12-fade: color-mix(in srgb, #1A0B0E 92%, transparent); }
:root[data-theme="light"] .h12-pulse.is-alert { --h12-fade: color-mix(in srgb, #FFF6F6 94%, transparent); }
.h12-pulse__map { position: absolute; z-index: 0; top: 0; bottom: 0; right: -10px; width: 70%; display: grid; place-items: center; }
.h12-pulse__map .hmap { width: 100%; height: 100%; }
.h12-pulse__hit { position: absolute; inset: 0; z-index: 1; border-radius: inherit; background: none; }
.h12-pulse__hit:active { background: color-mix(in srgb, var(--text) 4%, transparent); }
.h12-pulse__tx { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; width: 64%; min-height: 190px; padding: 16px 0 16px 16px;
  pointer-events: none; box-sizing: border-box; }
.h12-pulse__tx button { pointer-events: auto; }
.h12-pulse__h { margin: 10px 0 0; font: 700 1.3125rem/1.6rem var(--font-head); letter-spacing: -.02em; color: var(--text); text-wrap: balance; overflow-wrap: anywhere; }
.h12-pulse__s { margin: 6px 0 0; font: 700 0.8125rem/1.15rem var(--font); color: var(--text-2); }
.h12-pulse__s b { color: var(--text); font-variant-numeric: tabular-nums; }
.h12-pulse.is-sk .h12-pulse__tx { width: 70%; }
.h12-chip { display: inline-flex; align-items: center; gap: 4px; margin-top: auto; min-height: 36px; padding: 0 12px 0 14px; border-radius: 999px;
  background: color-mix(in srgb, var(--text) 9%, transparent); color: var(--text); font: 800 0.8125rem/1 var(--font); }
.h12-pulse__tx > .h12-chip { margin-top: auto; }
.h12-pulse__tx > .h12-pulse__h, .h12-pulse__tx > .h12-pulse__s { margin-bottom: 0; }
.h12-pulse__tx > :nth-last-child(2) { margin-bottom: 14px; }
.h12-chip .ico { width: 14px; height: 14px; }
.h12-pulse__acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 14px; }
.h12-btn { min-height: 40px; padding: 0 14px; border-radius: 14px; background: var(--red); color: #fff; font: 800 0.875rem/1 var(--font); }
.h12-btn--w { background: #fff; color: #B0111F; }
:root[data-theme="light"] .h12-btn--w { background: var(--text); color: #fff; }
.h12-pulse.is-alert .h12-pulse__tx { width: 78%; }

/* «живая» метка */
.h12-live { display: inline-flex; align-items: center; gap: 7px; font: 800 0.6875rem/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
.h12-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); animation: h12live 2s ease-out infinite; }
.h12-live--red { color: var(--red-text); }
.h12-live--red i { background: var(--red); box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 60%, transparent); }
.h12-live--off { color: var(--text-3); }
.h12-live--off i { background: var(--text-3); animation: none; }
@keyframes h12live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }

/* мини-карта (homemap.js) */
.hmap { display: block; overflow: visible; }
.hmap__d { fill: none; stroke: var(--hm-ds); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hmap__d.is-mine { fill: var(--hm-mine); stroke: color-mix(in srgb, var(--accent) 55%, transparent); stroke-width: 1.4; }
.hmap__oka { fill: none; stroke: var(--hm-oka); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.hmap__p { --c: var(--accent); }
.hmap__p--g { --c: var(--accent); }
.hmap__p--b { --c: var(--blue); }
.hmap__p--a { --c: var(--amber); }
.hmap__p--v { --c: var(--violet); }
.hmap__p--r { --c: var(--red); }
.hmap__c { fill: var(--c); stroke: color-mix(in srgb, var(--h12-fade) 70%, transparent); stroke-width: 1.2; }
.hmap__r { fill: var(--c); opacity: 0; transform-box: fill-box; transform-origin: center; animation: h12dot 2.4s ease-out infinite; animation-delay: var(--d, 0s); }
@keyframes h12dot { 0% { opacity: .5; transform: scale(.8); } 100% { opacity: 0; transform: scale(3.6); } }
.hmap__al circle { fill: color-mix(in srgb, var(--red) 30%, transparent); stroke: var(--red); stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: h12al 3s ease-out infinite; animation-delay: var(--d, 0s); }
@keyframes h12al { 0% { opacity: .7; transform: scale(.2); } 100% { opacity: 0; transform: scale(2.2); } }
.h12-pulse.is-alert .hmap__d { stroke: color-mix(in srgb, var(--red) 35%, transparent); }

/* ---------------------------------------------------------------- 2. бегущая строка */
.h12-tk { margin: -2px calc(-1 * var(--pad, 16px)) 0; padding: 0 var(--pad, 16px); overflow-x: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent); }
.h12-tk::-webkit-scrollbar { display: none; }
.h12-tk__tr { display: flex; gap: 8px; width: max-content; }
.h12-tk.is-run { overflow: hidden; }
.h12-tk.is-run .h12-tk__tr { animation: h12tick var(--dur, 30s) linear infinite; }
.h12-tk.is-run:hover .h12-tk__tr, .h12-tk.is-run:focus-within .h12-tk__tr, .h12-tk.is-run:active .h12-tk__tr { animation-play-state: paused; }
@keyframes h12tick { to { transform: translateX(calc(-50% - 4px)); } }
.h12-tk__c { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; max-width: 300px; padding: 0 14px 0 12px; border-radius: 14px; flex: none;
  background: var(--surface); box-shadow: var(--shadow-1); color: var(--text); font: 700 0.8125rem/1.1 var(--font); white-space: nowrap; }
.h12-tk__c > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.h12-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.h12-dot--g { background: var(--accent); } .h12-dot--b { background: var(--blue); } .h12-dot--a { background: var(--amber); }
.h12-dot--v { background: var(--violet); } .h12-dot--n { background: var(--text-2); }

/* ---------------------------------------------------------------- 3. «Соседи · район» */
.h12-ngh { padding: 8px 8px 10px; display: flex; flex-direction: column; gap: 6px; border-radius: 26px; }
.h12-ngh__h { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; width: 100%; min-height: 54px; padding: 6px 8px;
  border-radius: 18px; text-align: left; color: var(--text); }
.h12-ngh__t { min-width: 0; font: 600 0.9375rem/1.25rem var(--font-head); letter-spacing: -.02em; overflow-wrap: anywhere; }
.h12-ngh__s { min-width: 0; font: 700 0.75rem/1.05rem var(--font); font-style: normal; color: var(--text-2); }
.h12-on { color: var(--accent-text); font-weight: 800; }
.h12-on i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.h12-ppl { display: flex; flex: none; }
.h12-ppl .av { width: 30px !important; height: 30px !important; border-radius: 50%; border: 2.5px solid var(--surface); margin-left: -9px; box-sizing: content-box;
  display: inline-grid; place-items: center; overflow: hidden; color: #fff; font-weight: 800; background: var(--av, var(--violet)); font-size: 12px !important; }
.h12-ppl .av img { width: 100%; height: 100%; object-fit: cover; }
.h12-ppl .av:first-child { margin-left: 0; }
.h12-ppl__n { width: 30px; height: 30px; margin-left: -9px; border-radius: 50%; border: 2.5px solid var(--surface); display: grid; place-items: center; box-sizing: content-box;
  background: var(--surface-2); color: var(--text); font: 800 0.6875rem/1 var(--font); }
.h12-msg { display: flex; gap: 8px; align-items: flex-start; width: 100%; padding: 2px 6px; text-align: left; color: var(--text); }
.h12-msg__av .av { border-radius: 50%; display: inline-grid; place-items: center; overflow: hidden; color: #fff; font-weight: 800; background: var(--av, var(--violet)); }
.h12-msg__av .av img { width: 100%; height: 100%; object-fit: cover; }
.h12-msg__b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 8px 11px 9px; border-radius: 5px 16px 16px 16px; background: var(--surface-2); }
.h12-msg.is-sk .h12-msg__b { background: none; padding: 4px 0; }
.h12-msg__who { display: flex; align-items: center; min-width: 0; font: 800 0.75rem/1.1 var(--font); color: var(--accent-text); }
.h12-msg__who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-weight: 800; }
.h12-msg__who i { margin-left: auto; padding-left: 8px; font-style: normal; font-weight: 700; color: var(--text-3); flex: none; }
.h12-msg__ed { margin-left: 6px; padding: 0 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); font-size: .6875rem; line-height: 17px; flex: none; }
.h12-msg__tx { font: 600 0.875rem/1.25rem var(--font); color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.h12-empty { display: flex; flex-direction: column; gap: 2px; margin: 0 6px; padding: 10px 12px; border-radius: 16px; text-align: left;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 40%, transparent); color: var(--text); }
.h12-empty b { font: 800 0.875rem/1.2 var(--font); }
.h12-empty span { font: 600 0.75rem/1.1rem var(--font); color: var(--text-2); }
.h12-in { display: flex; align-items: center; gap: 10px; margin: 4px 6px 0; min-height: 48px; padding: 0 4px 0 14px; border-radius: 16px;
  background: var(--h12-in-bg); box-shadow: inset 0 0 0 1px var(--line); color: var(--text-3); font: 700 0.875rem/1 var(--font); text-align: left; }
.h12-in > span:first-child { flex: 1; }
.h12-in__send { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex: none; }
.h12-in__send .ico { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- 4. бенто */
.h12-bento { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px; align-items: stretch; }
.h12-bento.is-nofuel { grid-template-columns: minmax(0, 1fr); }
.h12-bento.is-nofuel .h12-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.h12-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.h12-bento .card { border-radius: 24px; text-align: left; color: var(--text); }
.h12-fuel { display: flex; flex-direction: column; align-items: stretch; padding: 14px 12px 12px 14px; background: var(--h12-fuel-bg); min-width: 0; }
.h12-fuel__big { display: block; margin: 9px 0 2px; font: 700 1.1875rem/1.5rem var(--font-head); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h12-fuel__sub { display: block; font: 700 0.6875rem/1rem var(--font); color: var(--text-2); }
.h12-st-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.h12-st { display: flex; align-items: center; gap: 7px; min-width: 0; font: 800 0.75rem/1.1 var(--font); }
.h12-st__lg { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text); font: 900 0.625rem/1 var(--font);
  box-shadow: inset 0 0 0 1px var(--line); }
.h12-st__nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h12-q { flex: none; padding: 3px 6px; border-radius: 6px; font: 800 0.6563rem/1 var(--font); background: var(--surface-2); color: var(--text-3); }
.h12-q--g { background: var(--accent-soft); color: var(--accent-text); }
.h12-q--a { background: var(--amber-soft); color: var(--amber-text); }
.h12-q--r { background: var(--red-soft); color: var(--red-text); }
.h12-home { display: flex; align-items: center; gap: 10px; padding: 12px; min-width: 0; }
.h12-rings { width: 50px; height: 50px; flex: none; }
.h12-ring__t, .h12-ring__v { fill: none; stroke-width: 5.5; }
.h12-ring__v { stroke-linecap: round; }
.h12-ring__t.h12-ring--water { stroke: color-mix(in srgb, var(--blue) 18%, transparent); }
.h12-ring__t.h12-ring--power { stroke: color-mix(in srgb, var(--amber) 18%, transparent); }
.h12-ring__t.h12-ring--heat { stroke: color-mix(in srgb, var(--accent) 18%, transparent); }
.h12-ring__v.h12-ring--water { stroke: var(--blue); }
.h12-ring__v.h12-ring--power { stroke: var(--amber); }
.h12-ring__v.h12-ring--heat { stroke: var(--accent); }
.h12-ring__v.is-bad { stroke: var(--red); }
.h12-ring__v.is-plan { stroke-dasharray: none; opacity: .7; }
.h12-home__t { min-width: 0; display: flex; flex-direction: column; }
.h12-home__t b { font: 800 0.8125rem/1.15 var(--font); }
.h12-home__t small { display: flex; flex-direction: column; margin-top: 3px; font: 700 0.6875rem/1rem var(--font); color: var(--text-2); overflow-wrap: anywhere; }
.h12-home__t .is-bad { color: var(--red-text); }
.h12-home__t .is-plan { color: var(--amber-text); }
.h12-rate { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 12px; background: var(--h12-rate-bg); min-width: 0; }
.h12-rate__top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; }
.h12-rate__top b { font: 800 1.375rem/1.1 var(--font-head); color: var(--violet-text); letter-spacing: -.02em; }
.h12-rate__top b.is-sm { font: 700 0.875rem/1.2 var(--font-head); color: var(--text); }
.h12-rate__w { flex: none; padding: 3px 6px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); font: 800 0.625rem/1 var(--font); }
.h12-rate small { font: 700 0.6875rem/1rem var(--font); color: var(--text-2); }
.h12-rate__bar { display: block; height: 6px; margin-top: 4px; border-radius: 3px; background: color-mix(in srgb, var(--violet) 18%, transparent); overflow: hidden; }
.h12-rate__bar i { display: block; height: 100%; border-radius: 3px; background: var(--violet); }
.h12-rate.is-sk, .h12-home.is-sk { min-height: 90px; }

/* карточка канала на Главной (js/subcta.js) */
.h12 .subcta { margin: 0; }
.subcta--home { padding: 14px 44px 14px 14px; }
.subcta__rw { color: var(--accent-text) !important; font-weight: 800 !important; }
/* плашка канала сверху «Новостей» */
#newsCh:not([hidden]) { margin: 10px 0 0; }
.chban { position: relative; display: flex; align-items: center; border-radius: 16px; background: var(--accent-soft); color: var(--text); }
.chban__go { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 6px 0 12px; text-align: left; font: 600 0.8125rem/1.2 var(--font); color: var(--text); }
.chban__go > .ico { flex: none; width: 18px; height: 18px; color: var(--accent-text); }
.chban__go span { flex: 1; min-width: 0; }
.chban__go b { font-weight: 800; }
.chban__go em { flex: none; font-style: normal; font: 800 0.8125rem/1 var(--font); color: var(--accent-text); }
.chban__x { flex: none; width: 44px; height: 44px; display: grid; place-items: center; color: var(--text-3); }

/* шапка: «Рязань · район» не толкает кнопки */
.brand > span:last-child { min-width: 0; }
.brand__city { max-width: 52vw; white-space: nowrap; }
.brand__city { overflow: hidden; text-overflow: ellipsis; display: inline-block; }
.brand__city .ico { vertical-align: -2px; }

/* узкие экраны */
@media (max-width: 374px) {
  .h12-pulse__h { font-size: 1.1875rem; line-height: 1.45rem; }
  .h12-pulse__tx { width: 68%; }
  .h12-home { flex-direction: column; align-items: flex-start; gap: 6px; }
}
/* крупный текст */
:root[data-fs="l"] .h12-pulse__tx { width: 74%; }
:root[data-fs="xl"] .h12-pulse__tx { width: 86%; }
:root[data-fs="xl"] .h12-pulse__map { opacity: .45; width: 100%; right: -30%; }
:root[data-fs="xl"] .h12-bento { grid-template-columns: minmax(0, 1fr); }
:root[data-fs="xl"] .h12-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
:root[data-fs="xl"] .h12-home { flex-direction: column; align-items: flex-start; }
:root[data-fs] .h12-msg__who { flex-wrap: wrap; row-gap: 2px; }
:root[data-fs="xl"] .h12-ngh__h { grid-template-columns: minmax(0, 1fr); }

/* тихий режим: без пульса и бегущей строки */
.lowfx .h12-live i, .lowfx .hmap__r, .lowfx .hmap__al circle, .lowfx .h12-tk__tr { animation: none !important; }
.lowfx .hmap__r { opacity: 0; }
.lowfx .hmap__al circle:first-child { opacity: .5; transform: scale(1); }
@media (prefers-reduced-motion: reduce) {
  .h12-live i, .hmap__r, .hmap__al circle, .h12-tk__tr { animation: none !important; }
  .hmap__r { opacity: 0; }
  .hmap__al circle:first-child { opacity: .5; transform: scale(1); }
}
.h12-ngh__h > .rm-n, .h12-ngh__h > .h12-ppl { justify-self: end; }
