/* v11 (18.10.2026): вкладки Главная · Новости · ＋ · Карта · Чаты, профиль — аватар в шапке, разгруженная «Главная»,
   вкладка «Чаты» с непрочитанным, «Назад» у панелей без вкладки, фото профиля (кадрирование). Контракт — docs/design_v3.md «v11». */

/* ---------------------------------------------------------------- шапка: аватар с кольцом уровня, «Назад» */
.hdr-av { position: relative; width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--text); }
.hdr-av[hidden] { display: none; }
.hdr-av__ring { position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--ring, var(--accent)) calc(var(--p, 0) * 360deg), var(--surface-2) 0);
  -webkit-mask: radial-gradient(circle, transparent 19.5px, #000 20px); mask: radial-gradient(circle, transparent 19.5px, #000 20px); }
.hdr-av[data-tier="0"] { --ring: var(--line); }
.hdr-av[data-tier="1"] { --ring: var(--accent); }
.hdr-av[data-tier="2"] { --ring: var(--blue); }
.hdr-av[data-tier="3"] { --ring: var(--violet); }
.hdr-av[data-tier="4"] { --ring: var(--amber); }
.hdr-av__in { position: relative; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--surface); }
.hdr-av__in .av { width: 34px !important; height: 34px !important; }
.hdr-av__in .ico { width: 20px; height: 20px; }
.hdr-av.is-pending::after { content: ""; position: absolute; right: 0; bottom: 1px; width: 11px; height: 11px; border-radius: 50%; background: var(--amber); border: 2px solid var(--bg); }
.hdr-av:active { transform: scale(.94); }
.hdr-back { margin-right: 2px; }
.hdr-t:has(.hdr-back) .hdr-title { font: var(--t-headline); letter-spacing: -.02em; }

/* ---------------------------------------------------------------- таб-бар: счётчик непрочитанного на «Чатах» */
.tb-n { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; box-sizing: border-box;
  background: var(--red); color: #fff; font: 800 0.6875rem/18px var(--font); font-style: normal; text-align: center; border: 2px solid var(--bar, var(--surface));
  line-height: 14px; pointer-events: none; }
.tb-n[hidden] { display: none; }

/* ---------------------------------------------------------------- «Главная» */
.hm { display: flex; flex-direction: column; gap: 18px; padding-top: 12px; }
.hm .sk { display: block; border-radius: 8px; background: color-mix(in srgb, var(--text) 9%, transparent); }
.hm-calm { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 14px 12px 16px; border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-1); color: var(--text-2); font: var(--t-callout); text-align: left; }
.hm-calm b { color: var(--text); font-weight: 800; }
.hm-calm__dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.hm-calm.is-ended .hm-calm__dot { background: var(--amber); box-shadow: 0 0 0 5px var(--amber-soft); }
.hm-calm.is-off .hm-calm__dot { background: var(--text-3); box-shadow: 0 0 0 5px var(--surface-2); }
.hm-calm__t { flex: 1; min-width: 0; }
.hm-calm__go { flex: none; color: var(--text-3); display: grid; }
.hm-calm.hm-sk { min-height: 56px; }
.hm-alert { display: block; }
.hm-tiles { gap: 12px; }
.hm-tiles .tile.t-sq { min-height: 148px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.hm-tiles.is-one .tile { grid-column: 1 / -1; min-height: 112px; }
.hm-fuel__h { display: block; font: 700 1.125rem/1.35rem var(--font-head); letter-spacing: -.02em; color: var(--text); overflow-wrap: anywhere; }
.hm-fuel .t-sub { display: block; margin-top: 4px; }
.hm-sec { display: flex; align-items: center; gap: 8px; margin: 6px 2px -6px; font: var(--t-caption); font-weight: 800; letter-spacing: .02em; text-transform: uppercase; color: var(--text-3); }
.hm-sec .ico { width: 16px; height: 16px; }

/* чат «Вся Рязань» на главной */
.hm-chat { padding: 6px 6px 8px; display: flex; flex-direction: column; }
.hm-chat__h { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 10px; text-align: left; color: var(--text); border-radius: 18px; }
.hm-chat__ic { flex: none; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--violet-soft); color: var(--violet-text, var(--violet)); }
.hm-chat__ic .ico { width: 22px; height: 22px; }
.hm-chat__t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hm-chat__t b { font: var(--t-headline); letter-spacing: -.02em; }
.hm-chat__t i { font: var(--t-caption); font-style: normal; color: var(--text-2); }
.hm-on { color: var(--accent-text); font-weight: 700; }
.hm-on i, .rm__on i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.hm-chat__go { color: var(--text-3); display: grid; flex: none; }
.hm-chat__list { display: flex; flex-direction: column; padding: 0 4px; }
.hm-msg { display: flex; gap: 10px; width: 100%; padding: 10px 6px; text-align: left; color: var(--text); border-top: 1px solid var(--line); }
.hm-msg__av { flex: none; padding-top: 2px; }
.hm-msg__b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hm-msg__who { display: flex; align-items: center; min-width: 0; gap: 0; font: var(--t-caption); }
.hm-msg__who b { font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hm-msg__who i { margin-left: auto; padding-left: 8px; font-style: normal; color: var(--text-3); flex: none; }
.hm-msg__ed { margin-left: 6px; padding: 0 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); font-weight: 800; font-size: .75rem; line-height: 18px; flex: none; }
.hm-msg__tx { font: var(--t-callout); font-weight: 500; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.hm-msg--sk { align-items: center; }
.hm-msg--sk > .sk { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.hm-msg--sk > span { flex: 1; }
.hm-chat__empty { margin: 0; padding: 12px 8px 14px; border-top: 1px solid var(--line); font: var(--t-callout); color: var(--text-2); }
.hm-chat__in { display: flex; align-items: center; gap: 10px; margin: 6px 4px 0; min-height: 50px; padding: 0 6px 0 16px; border-radius: 16px;
  background: var(--surface-2); color: var(--text-3); font: var(--t-callout); text-align: left; }
.hm-chat__in > span:first-child { flex: 1; }
.hm-chat__send { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex: none; }
.hm-chat__send .ico { width: 18px; height: 18px; }
.hm-disc { display: block; }
.hm-disc .tile.t-disc { padding: 12px 12px 8px; }
.hm-disc-sk { padding: 16px; }
/* счётчик непрочитанного (Главная, Чаты) */
.rm-n { flex: none; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; box-sizing: border-box; display: inline-grid; place-items: center;
  background: var(--red); color: #fff; font: 800 0.8125rem/1 var(--font); }
.rm-n--sm { min-width: 20px; height: 20px; padding: 0 6px; font-size: .75rem; }

/* ---------------------------------------------------------------- «Новости»: «Главное за день» широкой плиткой */
.news-top { margin-top: 8px; }
.news-top .tile.t-daily--wide { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 14px; row-gap: 10px; min-height: 0; padding: 14px 16px; }
.news-top .t-daily--wide .dly-tile__lbl { grid-column: 1 / -1; }
.news-top .t-daily--wide .dly-tile__stack { margin: 0; }
.news-top .t-daily--wide .dly-tile__txt { margin: 0; }
#nowTop:not([hidden]) { margin: 12px 0 0; }
#nowTop .hd-ask { margin: 0; }

/* ---------------------------------------------------------------- вкладка «Чаты» */
#chatsBody { padding-top: 10px; }
.rm-lead { margin: 2px 2px 14px; font: var(--t-callout); color: var(--text-2); }
.rm-list { display: flex; flex-direction: column; gap: 10px; }
.rm { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 14px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1);
  color: var(--text); text-align: left; }
.rm--top { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--violet) 45%, transparent), var(--shadow-1); }
.rm__ic { flex: none; width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; }
.rm__ic .ico { width: 23px; height: 23px; }
.rm--city { background: var(--violet-soft); color: var(--violet-text, var(--violet)); }
.rm--fuel { background: var(--amber-soft); color: var(--amber-text, var(--amber)); }
.rm--district { background: var(--accent-soft); color: var(--accent-text, var(--accent)); }
.rm__t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rm__top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rm__top b { font: var(--t-headline); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rm__top em { flex: none; font: 800 0.6875rem/1 var(--font); font-style: normal; padding: 4px 7px; border-radius: 7px; }
.rm__mine { background: var(--accent-soft); color: var(--accent-text); }
.rm__pin { background: var(--violet-soft); color: var(--violet-text); }
.rm__top i { margin-left: auto; flex: none; font: var(--t-caption); font-style: normal; color: var(--text-3); }
.rm__last { font: var(--t-callout); font-weight: 500; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.rm__last b { color: var(--text); font-weight: 700; }
.rm.has-n .rm__last { color: var(--text); }
.rm__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font: var(--t-caption); color: var(--text-3); }
.rm__on { color: var(--accent-text); font-weight: 700; }
.rm__go { color: var(--text-3); display: grid; flex: none; }
.rm--sk { min-height: 78px; flex-direction: column; align-items: stretch; justify-content: center; }
.rm--sk .sk { display: block; height: 12px; border-radius: 6px; background: color-mix(in srgb, var(--text) 9%, transparent); }
.rm--sk .sk + .sk { width: 70%; margin-top: 10px; }
.rm--pick { box-shadow: none; border: 1.5px dashed color-mix(in srgb, var(--text) 18%, transparent); background: transparent; }
.rm-more { margin-top: 18px; }
.rm-more__b { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; border-radius: 16px; background: var(--surface-2); color: var(--text); text-align: left; }
.rm-more__b b { font: var(--t-callout); font-weight: 800; }
.rm-more__b > i { font: var(--t-caption); font-style: normal; color: var(--text-3); flex: 1; }
.rm-more__c { display: grid; color: var(--text-3); transition: transform var(--d-base) var(--ease-out); }
.rm-more.is-open .rm-more__c { transform: rotate(180deg); }
.rm-list--more { margin-top: 10px; }
.rm-links { display: flex; flex-direction: column; margin-top: 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); overflow: hidden; }
.rm-link { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 16px; color: var(--text); text-align: left; font: var(--t-callout); font-weight: 700; }
.rm-link + .rm-link { border-top: 1px solid var(--line); }
.rm-link span { flex: 1; }
.rm-link .ico:first-child { color: var(--text-2); }
.rm-link .ico:last-child { color: var(--text-3); }

/* ---------------------------------------------------------------- фото профиля (js/avatar.js) */
.av-pend { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; background: var(--amber-soft); color: var(--amber-text);
  font: 800 0.75rem/1.1 var(--font); }
.av-pend .ico { width: 14px; height: 14px; }
.av-pend--sm { margin-left: 6px; }
.av-sh { padding: 4px var(--pad) 16px; display: flex; flex-direction: column; gap: 8px; }
.av-sh__cur { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 0 4px; }
.av-sh__h { margin: 0 0 6px; text-align: center; font: var(--t-headline); }
.av-row { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 16px; border-radius: 16px; background: var(--surface-2); color: var(--text); cursor: pointer; }
.av-row b { font: var(--t-callout); font-weight: 700; }
.av-row--bad { color: var(--red-text, var(--red)); }
.av-note { display: flex; gap: 10px; margin: 6px 2px 0; font: var(--t-caption); color: var(--text-2); }
.av-note .ico { flex: none; color: var(--accent-text); margin-top: 1px; }
.av-crop { padding: 8px var(--pad) 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.av-stage { position: relative; width: min(100%, 340px); aspect-ratio: 1; overflow: hidden; border-radius: 24px; background: #000; touch-action: none; cursor: grab; user-select: none; }
.av-img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; -webkit-user-drag: none; }
.av-mask { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0, 0, 0, .55); outline: 2px solid rgba(255, 255, 255, .85); outline-offset: -2px; pointer-events: none; }
.av-hint { margin: 0; font: var(--t-caption); color: var(--text-2); text-align: center; }
.av-zoom { display: flex; align-items: center; gap: 10px; width: min(100%, 340px); }
.av-zoom input { flex: 1; accent-color: var(--accent); min-height: 32px; }
.av-zb { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); flex: none; }
.av-prog { width: min(100%, 340px); }
.av-prog i { display: block; height: 6px; border-radius: 3px; background: var(--accent); width: 4%; transition: width .2s; }
.av-prog { position: relative; padding-top: 0; }
.av-prog::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; border-radius: 3px; background: var(--surface-2); z-index: -1; }
.av-prog span { display: block; margin-top: 6px; font: var(--t-caption); color: var(--text-2); text-align: center; }
.av-err { width: min(100%, 340px); padding: 10px 12px; border-radius: 12px; background: var(--red-soft); color: var(--red-text); font: var(--t-caption); font-weight: 700; }
.av-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(100%, 340px); }
.av-done { padding: 28px var(--pad); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.av-done__av { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.av-done h2 { margin: 6px 0 0; font: var(--t-title); }
.av-done p { margin: 0 0 8px; font: var(--t-callout); color: var(--text-2); max-width: 340px; }

/* крупный текст: плитки и шапка не теснятся */
:root[data-fs="xl"] .hm-tiles { grid-template-columns: minmax(0, 1fr); }
:root[data-fs] .hm-msg__who { flex-wrap: wrap; row-gap: 2px; }
.rm__meta em { font: 800 0.6875rem/1 var(--font); font-style: normal; padding: 4px 7px; border-radius: 7px; align-self: center; }
.p3-avrep { display: block; margin: 12px auto 0; min-height: 40px; padding: 0 12px; font: var(--t-caption); font-weight: 700; color: var(--text-3); }
