/* Портал ТСЖ — светлая тема. Все цвета проверены на контраст (см. contrast.py). */

/* Шрифт свой, а не с Google Fonts: там был лишний запрос на чужой сервер
   (блокировал отрисовку) и подмена шрифта на глазах — текст «мигал» при
   каждом переходе. Один файл на все начертания 400–700 (переменный шрифт),
   кириллица, латиница, ₽ и стрелки; лицензия OFL — shrift/OFL.txt.
   optional, а не swap: шрифт не успел за ~0,1 с — страница так и остаётся
   системным шрифтом, без подмены посреди чтения; файл подгружен заранее
   (<link rel="preload"> в _shrift.html) и дальше берётся из кэша. */
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 700;
  font-display: optional;
  src: url("shrift/golos.6d97dbf934b7.woff2") format("woff2");
}
:root {
  --bg: #FFFFFF;
  --surface: #F8F9FD;      /* заливка блока вместо рамки */
  /* тень плотная и короткая + тонкий кант: разделяет края, не размазывает фон */
  --shadow: 0 1px 3px rgba(23,32,74,0.05), 0 0 0 1px rgba(23,32,74,0.035);
  --shadow-card: 0 1px 2px rgba(23,32,74,0.06), 0 0 0 1px rgba(23,32,74,0.045);
  --surface-2: #EEF1F8;    /* вложенный элемент, ховер */
  --line: #E8EBF2;
  --text: #16181D;
  --muted: #6C727C;
  --accent: #3A4CB0;
  --accent-soft: #EEF0FC;
  --green: #08845B;
  --ok-bg: #E9F8F1;   --ok-fg: #0B6B47;
  --warn-bg: #FFF4E0; --warn-fg: #8A5A00;
  --err-bg: #FDECE8;  --err-fg: #9E3520;
  --r-block: 20px;
  --r-inner: 16px;
  --r-pill: 999px;
}

* { box-sizing: border-box; }
/* атрибут hidden — всегда скрыто: иначе любое правило с display (.btn —
   inline-flex) его перебивает, и на «Настройках уведомлений» на компьютере
   торчала кнопка «Установить приложение». Всё, что портал прячет и
   показывает скриптом, переключает именно hidden */
[hidden] { display: none !important; }
/* Android подсвечивает нажатие голубым квадратом поверх наших состояний */
a, button, summary, label, [role="button"] { -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Golos Text', 'Segoe UI', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

/* ——— каркас ——— */
.shell { width: 100%; max-width: 1440px; min-height: 100vh; margin: 0 auto; display: flex; flex-direction: column; }
/* ШАПКА — один компонент на все кабинеты (_shapka.html, data-shapka). Кусочки
   общие (знак с названием, .shapka-ikonki: колокольчик, профиль, ☰), раскладка
   на компьютере своя: у жильца — полоса сверху (.shapka-zhilca), у правления и
   мастера — боковое меню (.side). На телефоне (≤900) у всех одна: знак слева,
   иконки справа, пункты — под ☰ */
.shapka-zhilca { height: 76px; flex-shrink: 0; display: flex; align-items: center; gap: 28px; padding: 0 40px; }
/* квартира и профиль — к правому краю: иначе шапка сбивается в левый угол */
.shapka-zhilca > .shapka-nav { margin-right: auto; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .mark { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: #FFF; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
img.mark { object-fit: cover; }
a.brand { text-decoration: none; color: inherit; }
.brand .name { font-size: 15px; font-weight: 600; line-height: 1.25; }
.brand .sub { font-size: 12px; color: var(--muted); line-height: 1.3; }
.shapka-nav { display: flex; align-items: center; gap: 4px; flex-grow: 1; }
.shapka-nav a { font-size: 15px; font-weight: 500; color: var(--muted); text-decoration: none; padding: 9px 14px; border-radius: var(--r-pill); }
.shapka-nav a:hover { background: var(--surface); color: var(--text); }
.shapka-nav a.on { color: var(--text); font-weight: 600; }
.main { flex-grow: 1; padding: 8px 40px 48px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.page-head .where { font-size: 14px; color: var(--muted); }
/* перенос по умолчанию: без него поиск и фильтры сжимались до наложения */
.row { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 20px; }
/* решает перенос не min-width, а базовый размер: при flex-basis: auto браузер
   примеряет колонку по ширине её самого широкого содержимого (крупная сумма
   плюс столбик кнопок, длинная строка новости) — рядом с жёсткими 340 px она
   не влезала и уезжала целиком вниз, оставляя справа пустую половину экрана.
   С flex-basis: 0 колонка примеряется нулём и всегда встаёт рядом, а уже
   потом растягивается на остаток места */
.col.grow { flex: 1 1 0; min-width: 0; }
.grow { flex-grow: 1; min-width: 0; }
/* то же самое для крупных блоков рядом с жёсткой колонкой (карточка должника,
   помещения, сотрудника, «Расходы», переписка): примерка по самой длинной
   строке таблицы уводила блок под соседа. Плитки показателей живут в .row.even
   и мелкие .grow на полях форм правило не задевает — им перенос как раз нужен */
.row:not(.even) > .block.grow { flex-basis: 0; }

/* ——— блоки ——— */
.block { background: var(--surface); border-radius: var(--r-block); padding: 24px; box-shadow: var(--shadow); }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.block-title { font-size: 17px; font-weight: 600; }
.card { background: var(--bg); border-radius: var(--r-inner); padding: 18px; box-shadow: var(--shadow-card); }
.link { font-size: 14px; font-weight: 500; color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ——— кнопки ——— */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 48px; padding: 0 22px; border: none; border-radius: var(--r-pill); font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-green { background: var(--green); color: #FFF; }
.btn-accent { background: var(--accent); color: #FFF; }
.btn-outline { background: var(--bg); color: var(--accent); box-shadow: inset 0 0 0 1.5px #D5DAEC; }
.btn-ghost { background: var(--surface-2); color: var(--accent); }
.btn-sm { height: 40px; padding: 0 16px; font-size: 14px; }
.select { display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 18px; border: none; border-radius: var(--r-pill); background: var(--surface); font-family: inherit; font-size: 15px; font-weight: 600; color: var(--text); cursor: pointer; }

/* ——— мелочи ——— */
.badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; border-radius: var(--r-pill); padding: 5px 12px; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge-warn { background: var(--warn-bg); color: var(--warn-fg); }
.badge-err { background: var(--err-bg); color: var(--err-fg); }
.badge-info { background: var(--accent-soft); color: var(--accent); }
.badge-mute { background: var(--surface-2); color: var(--muted); }
.amount { font-size: 46px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.05; }
.stat { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.label { font-size: 14px; color: var(--muted); }
.note { font-size: 13px; color: var(--muted); line-height: 1.5; }
.banner { border-radius: var(--r-inner); padding: 18px 22px; font-size: 15px; font-weight: 500; }
.banner-ok { background: var(--ok-bg); color: var(--ok-fg); }

.dl { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.dl > div { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; text-align: right; }

.feed { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.feed li { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: none; padding-bottom: 0; }
.feed li:first-child { padding-top: 0; }
.feed .t { font-size: 14px; font-weight: 500; line-height: 1.4; }
.feed .d { font-size: 13px; color: var(--muted); }

/* ——— админский каркас: светлый сайдбар ——— */
.layout { display: flex; min-height: 100vh; }
/* меню высотой в окно и прилипает: раньше сайдбар тянулся по высоте страницы,
   и профиль с «Выйти» уезжал вниз — на длинных страницах до него скроллили.
   Не влезает в низкое окно — прокручиваются только пункты, профиль на месте */
.side { width: 264px; flex-shrink: 0; background: var(--surface); padding: 24px 16px; display: flex; flex-direction: column; gap: 28px;
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; }
.side .brand { padding: 0 8px; flex-shrink: 0; }
.side-nav { display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow-y: auto; }
.side-nav a { font-size: 15px; font-weight: 500; color: var(--muted); text-decoration: none; padding: 11px 14px; border-radius: 12px; }
.side-nav a:hover { background: var(--bg); color: var(--text); }
.side-nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
/* за какой месяц данные 1С: серым, если свежие; жёлтым с причиной, если отстали */
.side .svezhest { margin-top: auto; flex-shrink: 0; display: block; font-size: 12.5px; line-height: 1.45;
  color: var(--muted); text-decoration: none; padding: 10px 14px; border-radius: var(--r-inner); background: var(--bg); }
.side .svezhest span { display: block; margin-top: 4px; }
.side .svezhest.otstaet { background: var(--warn-bg); color: var(--warn-fg); font-weight: 500; }
.side .svezhest + .shapka-ikonki { margin-top: 0; }
/* профиль внизу меню — кнопка: по нажатию меню «Моя карточка / Выйти».
   Список открывается над карточкой; okna.js ставит его position: fixed,
   иначе прокрутка меню (overflow) обрезала бы его */
/* низ меню: колокольчик уведомлений и профиль в одну строку (на телефоне — справа в шапке) */
.shapka-ikonki { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
/* в боковом меню иконки — внизу, профиль карточкой во всю ширину */
.side .shapka-ikonki { margin-top: auto; }
.side .profil { display: block; flex: 1 1 auto; min-width: 0; }
.side .profil .menu-spisok { top: auto; bottom: calc(100% + 6px); left: 0; right: 0; }
.profil .who { position: relative; list-style: none; cursor: pointer; background: var(--bg); border-radius: var(--r-inner);
  padding: 10px 36px 10px 10px; box-shadow: var(--shadow-card); display: flex; align-items: center; gap: 10px; }
.profil .who-ava { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; }
.profil .who-tekst { min-width: 0; }
.profil .who-tekst b, .profil .who-tekst span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profil .who-tekst b { font-size: 14px; font-weight: 600; }
.profil .who-tekst span { font-size: 13px; color: var(--muted); }
.profil .who::-webkit-details-marker { display: none; }
/* профиль кружком: в шапке жильца всегда, у правления — когда меню сверху (≤1180) */
.shapka-zhilca .profil .who { padding: 0; background: none; box-shadow: none; }
.shapka-zhilca .profil .who-ava { width: 40px; height: 40px; }
.shapka-zhilca .profil .who-tekst, .shapka-zhilca .profil .who::after { display: none; }
/* колокольчик: что с уведомлениями на этом устройстве (заполняет push.js; вне приложения скрыт).
   Красная метка — уведомления выключены, запрещены или не доходят */
.kolokol-knopka { list-style: none; cursor: pointer; position: relative; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--muted); background: var(--bg); box-shadow: var(--shadow-card); }
.kolokol-knopka::-webkit-details-marker { display: none; }
.kolokol-knopka:hover, .kolokol[open] .kolokol-knopka { color: var(--accent); }
.kolokol-metka { display: none; position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%;
  background: #D93F2B; box-shadow: 0 0 0 2px var(--bg); }
.kolokol.trevoga .kolokol-metka { display: block; }
.kolokol .menu-spisok { width: 290px; padding: 10px; }
.kolokol .push-status { margin-bottom: 0; }
.kolokol .push-status + form { margin-top: 6px !important; }
.profil .who::after { content: "⋯"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 18px; color: var(--muted); }
.profil .who:hover::after, .profil[open] .who::after { color: var(--accent); }
.content { flex-grow: 1; min-width: 0; padding: 28px 36px 48px; display: flex; flex-direction: column; gap: 20px; }
.toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* ——— вкладки, поиск, фильтры ——— */
.tabs { display: flex; gap: 6px; }
.tab { font-size: 15px; font-weight: 500; color: var(--muted); text-decoration: none; padding: 10px 16px; border-radius: var(--r-pill); }
.tab.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.search { flex-grow: 1; height: 48px; border: none; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow); padding: 0 22px; font-family: inherit; font-size: 15px; color: var(--text); }
.search::placeholder { color: var(--muted); }
.filter { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 20px; border: none; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow); font-family: inherit; font-size: 15px; font-weight: 500; color: var(--text); cursor: pointer; }

/* ——— таблица ——— */
/* таблица шире блока не обрезается, а прокручивается внутри него: колонки
   «Исполнитель» и «Статус» уезжали за край на ноутбуке, и до них было не
   добраться вовсе */
.block:has(> .tbl), .block:has(> form + .tbl) { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 13px; font-weight: 500; color: var(--muted); padding: 0 16px 14px; }
.tbl td { padding: 16px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr:hover td { background: var(--bg); }
.tbl tr.hot td { background: var(--err-bg); }
.tbl tr.me td { background: var(--accent-soft); }
.tbl .num { font-weight: 600; }
.tbl .right { text-align: right; }
.tbl tfoot td { border-top: 1px solid var(--line); font-weight: 700; font-size: 15px; }

/* ——— журнал / ход работы ——— */
.timeline { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 20px; }
.timeline li { position: relative; padding-left: 26px; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.timeline li.wait::before { background: var(--bg); box-shadow: inset 0 0 0 2px #C7CCD6; }
.timeline .t { font-size: 15px; font-weight: 600; line-height: 1.35; }
.timeline .d { font-size: 13px; color: var(--muted); line-height: 1.5; }
.timeline .say { margin-top: 8px; background: var(--bg); border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.5; }

/* ——— фотоплейсхолдеры ——— */
.slots { display: flex; gap: 12px; flex-wrap: wrap; }
.slot { width: 128px; height: 96px; border-radius: var(--r-inner); background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line); display: flex; align-items: center; justify-content: center; text-align: center; font-size: 12px; color: var(--muted); padding: 8px; }

.task { background: var(--surface); border-radius: var(--r-inner); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; }
.task .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.task .t { font-size: 16px; font-weight: 600; line-height: 1.3; }
.tbl .nw { white-space: nowrap; }
.row.even { align-items: stretch; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* карточка заявки в списке */
.ticket { background: var(--surface); border-radius: var(--r-inner); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; }
.ticket.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px #CFD6F5; }
.ticket .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ticket .no { font-size: 13px; font-weight: 600; color: var(--muted); }
.ticket .t { font-size: 15px; font-weight: 600; line-height: 1.35; }

/* ——— подсказка у заголовка блока ——— */
.titled { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hint {
  display: inline-flex; align-items: center; justify-content: center;
  width: 19px; height: 19px; flex-shrink: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--muted);
  font-size: 12px; font-weight: 700; font-style: normal; line-height: 1;
  cursor: help; position: relative;
}
.hint:hover, .hint:focus-visible { background: var(--accent-soft); color: var(--accent); outline: none; }
.hint::after {
  content: attr(data-hint);
  /* от левого края значка вправо, а не по центру: в узкой колонке и в окне
     центрированная подсказка уезжала за край и обрезалась на полслова */
  position: absolute; left: -6px; top: calc(100% + 10px);
  width: max-content; max-width: min(300px, 60vw);
  background: var(--text); color: var(--bg);
  font-size: 13px; font-weight: 400; line-height: 1.5; text-align: left;
  padding: 11px 14px; border-radius: 12px;
  opacity: 0; visibility: hidden; pointer-events: none; z-index: 30;
  transition: opacity 0.12s ease;
  box-shadow: 0 8px 28px rgba(23,32,74,0.18);
}
.hint::before {
  content: ""; position: absolute; left: 4px; top: calc(100% + 4px);
  border: 6px solid transparent;
  border-bottom-color: var(--text);
  opacity: 0; visibility: hidden; z-index: 30; transition: opacity 0.12s ease;
}
.hint:hover::after, .hint:focus-visible::after,
.hint:hover::before, .hint:focus-visible::before { opacity: 1; visibility: visible; }
/* у правого края страницы подсказка ушла бы за экран — там её разворачиваем
   влево: класс ставится на значок рядом с последней колонкой формы */
.hint.vlevo::after { left: auto; right: -6px; }
.hint.vlevo::before { left: auto; right: 4px; }

/* Если браузер умеет popover, подсказку рисует podskazki.js — поверх всего
   и без влияния на размеры страницы. Старый ::after тогда выключаем:
   внутри попапа он растягивал окно и давал горизонтальный скролл. */
.js-podskazki .hint::after, .js-podskazki .hint::before { content: none; }
.podskazka {
  position: fixed; margin: 0; inset: auto;
  background: var(--text); color: var(--bg);
  font-size: 13px; font-weight: 400; line-height: 1.5; text-align: left;
  padding: 11px 14px; border: none; border-radius: 12px;
  box-shadow: 0 8px 28px rgba(23,32,74,0.18);
}
@media (prefers-reduced-motion: reduce) { .hint::after, .hint::before { transition: none; } }

/* ─── панель управления: на ноутбуке боковое меню уже мешает ───
   264 пикселя меню плюс поля — и таблица заявок с семью колонками перестаёт
   помещаться. Раньше меню уезжало наверх только на 900, то есть на ноутбуке
   человек видел обрезанные «Исполнитель» и «Статус» и не мог до них добраться.
*/
@media (max-width: 1180px) {
  .layout { flex-direction: column; max-width: 100vw; }
  .side {
    width: 100%; flex-direction: row; align-items: center; gap: 14px;
    padding: 12px 16px; overflow-x: auto; scrollbar-width: none;
    /* без min-width флекс-элемент не даёт себя сжать, и вся страница
       становится шире экрана вместо того, чтобы прокручиваться меню */
    min-width: 0;
    /* меню сверху — обычная полоса, не прилипает и высоты окна не берёт */
    position: static; height: auto; overflow-y: visible;
  }
  .side::-webkit-scrollbar { display: none; }
  .side .brand { flex-shrink: 0; }
  .side-nav { flex-direction: row; gap: 4px; overflow: visible; }
  .side-nav a { white-space: nowrap; padding: 9px 14px; font-size: 14px; }
  /* в шапке профиль — один кружок-человечек; имя в aria-label */
  /* у правления полоса пунктов прокручивается вбок — колокольчик и профиль
     прилипают к правому краю, а не уезжают в конец полосы */
  .side .shapka-ikonki { margin-top: 0; margin-left: auto; position: sticky; z-index: 1;
              /* закрываем и поле полосы справа (16px), иначе в нём видны уезжающие пункты */
              right: -16px; margin-right: -16px; padding: 0 16px 0 8px;
              background: var(--surface); box-shadow: -12px 0 12px -4px var(--surface); }
  .side .profil { flex: 0 0 auto; }
  .side .profil .who { padding: 0; background: none; box-shadow: none; }
  .side .profil .who-ava { width: 40px; height: 40px; }
  .side .profil .who-tekst, .side .profil .who::after { display: none; }
  .side .svezhest { margin-top: 0; max-width: 260px; }
  .content { padding: 22px 20px 40px; }

  /* кабинет мастера: пунктов меню нет, в шапке только название и профиль —
     название сжимается с многоточием, профиль компактный, прокрутки нет */
  /* меню профиля при шапке сверху раскрывалось вверх, за край страницы, —
     «Выйти» было не достать. fixed выводит его из-под обрезки прокруткой полосы */
  .side .profil .menu-spisok { position: fixed; top: 68px; bottom: auto; left: auto; right: 12px;
                               width: 220px; }
  .side-prosto { overflow-x: hidden; }
  .side-prosto .brand { flex: 1 1 0; min-width: 0; }
  .side-prosto .brand > div { min-width: 0; }
  .side-prosto .brand .name, .side-prosto .brand .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ─────────────────────────── телефон и планшет ───────────────────────────
   Жильцы заходят с телефона, поэтому это не украшение, а рабочий режим.
   ponytail: ширины блоков заданы инлайном в шаблонах, поэтому здесь !important —
   переписывать полсотни шаблонов ради трёх правил не стоит.
*/
@media (max-width: 900px) {
  /* кабинет жильца */
  .shell { min-height: 100dvh; }
  .brand .name { font-size: 14px; }
  .shapka-zhilca .select { height: 40px; padding: 0 14px; font-size: 14px; }
  .main { padding: 6px 16px 40px; gap: 16px; }

  .layout > *, .content, .main, .row > *, .col > * { min-width: 0; }
  /* ponytail: страницу режем по ширине экрана, прокрутка остаётся внутри
     меню и таблиц. Точечно ловить каждый вылезающий блок дороже, чем польза */
  .layout, .shell { max-width: 100vw; overflow-x: hidden; }
  .content { padding: 18px 16px 40px; }

  /* колонки складываются в одну */
  .row, .col { flex-direction: column; }
  .row > *, .col > * { width: 100% !important; max-width: 100% !important; }
  /* в столбик flex-basis — это уже высота, и нуль сплющил бы колонку:
     возвращаем размер по содержимому */
  .col.grow, .row:not(.even) > .block.grow { flex-basis: auto; }
  .row.even { align-items: stretch; }

  /* заголовки и суммы соразмерно экрану */
  .page-head { gap: 6px; }
  .page-head h1 { font-size: 24px; }
  .toolbar h1 { font-size: 24px !important; }
  .amount { font-size: 34px; }
  .stat { font-size: 22px; }
  .block { padding: 18px; border-radius: 16px; }
  .block-head { flex-wrap: wrap; gap: 8px; }

  /* таблицы прокручиваются внутри себя, а не растягивают страницу */
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; flex-shrink: 0; }
  .tbl { display: block; overflow-x: auto; white-space: nowrap; }
  .tbl td, .tbl th { padding: 12px 10px; }

  /* iPhone увеличивает страницу при фокусе в поле, если шрифт меньше 16px, и
     оставляет её увеличенной: справа всё «обрезано». Поля на телефоне — 16px */
  select, textarea, input:not([type=checkbox]):not([type=radio]) { font-size: 16px !important; }
  .chat .msg, .chat .sys { overflow-wrap: anywhere; }

  /* переписка заявки у правления и мастера: на телефоне — лента на фоне
     страницы, как у жильца, а не отдельная серая коробка */
  .perepiska.block { background: transparent; box-shadow: none; padding: 0 !important; }

  /* подсказка не должна вылезать за край экрана */
  .hint::after { width: 260px; max-width: 78vw; }

  /* кнопки в столбик на всю ширину */
  .btn { width: 100%; }
  .toolbar > div:last-child { width: 100%; display: flex; flex-direction: column; gap: 8px; }
}

@media (max-width: 520px) {
  .brand .sub { display: none; }
  .page-head .where { font-size: 13px; }
  .amount { font-size: 30px; }
  .slot { width: 100% !important; }
}

/* ——— периоды с раскрытием: детализация открывается на месте, а не уводит ——— */
.шапка-периода,
.период > summary {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) repeat(4, minmax(90px, 140px));
  gap: 12px;
  align-items: center;
}
.шапка-периода { padding: 0 44px 12px 16px; font-size: 13px; }
.период { border-top: 1px solid var(--line); }
.период > summary {
  padding: 16px 16px 16px 40px;
  cursor: pointer;
  list-style: none;
  position: relative;
  font-size: 14px;
}
.период > summary::-webkit-details-marker { display: none; }
.период > summary::before {
  content: "›";
  position: absolute;
  left: 16px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  transition: transform 0.15s ease;
}
.период[open] > summary::before { transform: rotate(90deg); }
.период > summary:hover { background: var(--bg); }
.период > summary .месяц { font-weight: 600; }
.период[open] > summary { background: var(--accent-soft); }

@media (max-width: 900px) {
  .шапка-периода { display: none; }
  .период > summary {
    grid-template-columns: 1fr auto;
    row-gap: 4px;
    padding-left: 34px;
  }
  .период > summary .месяц { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .период > summary::before { transition: none; }
}

/* ——— заявка как переписка (кабинет жильца) ——— */
.chat { display: flex; flex-direction: column; gap: 10px; }
.chat .msg { max-width: 86%; padding: 9px 13px; border-radius: 16px; font-size: 15px; line-height: 1.45; white-space: pre-line; }
.chat .msg.me { align-self: flex-end; background: var(--accent); color: #FFF; border-bottom-right-radius: 6px; }
.chat .msg.them { align-self: flex-start; background: var(--bg); box-shadow: var(--shadow-card); border-bottom-left-radius: 6px; }
.chat .msg.photo { padding: 6px; }
.chat .msg.photo img { display: block; max-width: 240px; max-height: 240px; border-radius: 10px; }
/* строка переписки: кружок с буквой и пузырь. Своё — справа, кружок за ним */
.chat-row { display: flex; align-items: flex-end; gap: 10px; max-width: 86%; }
.chat-row.moyo { flex-direction: row-reverse; align-self: flex-end; }
.chat-row .msg { max-width: 100%; }
.ava { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--muted); display: flex;
  align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
  margin-bottom: 2px; }
.chat-row.moyo .ava { background: var(--accent-soft); color: var(--accent); }

.chat .meta { display: block; font-size: 11px; opacity: .7; margin-top: 2px; line-height: 1.3; }
.chat .who { display: block; font-size: 12px; font-weight: 600; margin-bottom: 2px; color: var(--accent); line-height: 1.3; }
.chat .sys { align-self: center; font-size: 12px; color: var(--muted); background: var(--surface-2); border-radius: var(--r-pill); padding: 5px 12px; text-align: center; }
.chat .sys b { color: var(--text); font-weight: 600; }
.chat .sys .thumb { display: block; max-width: 220px; max-height: 160px; border-radius: 8px;
  margin: 6px auto 2px; }
.chat .msg .who + br { display: none; }

.composer { display: flex; align-items: flex-end; gap: 8px; background: var(--bg); border-radius: 24px; padding: 6px 6px 6px 16px; box-shadow: inset 0 0 0 1.5px var(--line); }
.composer:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
/* Полоса «добавьте кабинет на телефон»: снизу, поверх страницы, не перекрывая
   содержимое целиком. Показывается один раз, дальше человек её закрывает. */
.yarlyk {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--bg); border-radius: var(--r-inner); padding: 12px 16px;
  /* рамка цветом кнопок: без неё полоса сливалась со страницей и терялась */
  box-shadow: 0 8px 28px rgba(20, 20, 43, 0.18), 0 0 0 2px var(--accent);
  font-size: 14px; max-width: 640px; margin: 0 auto;
}
.yarlyk > span { flex: 1; min-width: 200px; }

.push-okno {
  border: none; border-radius: var(--r-block); padding: 26px 28px;
  box-shadow: 0 20px 60px rgba(20, 20, 43, 0.28);
  width: 420px; max-width: calc(100vw - 32px); color: var(--text);
}
.push-okno::backdrop { background: rgba(20, 20, 43, 0.4); }
.kak-dobavit {
  border: none; border-radius: var(--r-block); padding: 26px 28px;
  box-shadow: 0 20px 60px rgba(20, 20, 43, 0.28);
  width: 460px; max-width: calc(100vw - 32px); color: var(--text);
}
.kak-dobavit::backdrop { background: rgba(20, 20, 43, 0.4); }
/* нумерованные шаги инструкции: и в окне установки, и в окне про уведомления */
.shagi { margin: 0 0 18px; padding-left: 20px; font-size: 15px; line-height: 1.5; }
.shagi li { margin-bottom: 16px; }
.push-okno .shagi li { margin-bottom: 10px; }
.kak-dobavit .shagi img {
  display: block; width: 100%; margin-top: 8px;
  border-radius: 10px; box-shadow: 0 0 0 1px var(--line);
}

/* Поле формы: подпись, ввод и подсказка друг под другом. Без этого браузер
   ставил их в строку, и подсказка обтекала поле. Ширину ограничиваем: у
   textarea собственный cols=40, и на телефоне она вылезала за край экрана. */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > .label { font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea { max-width: 100%; box-sizing: border-box; }
.field textarea { width: 100%; }

/* поле внутри пилюли: фокус показывает только сама пилюля (:focus-within).
   Общее правило textarea:focus из staff_base.html рисовало внутри вторую,
   прямоугольную рамку — у правления и мастера; здесь сильнее и для всех кабинетов */
.composer textarea:focus, .composer textarea:focus-visible { box-shadow: none; outline: none; }
.composer textarea { flex: 1 1 0; min-width: 0; border: none; border-radius: 0; box-shadow: none; background: transparent; font-family: inherit; font-size: 15px; resize: none; padding: 9px 0; min-height: 40px; max-height: 160px; outline: none; color: var(--text); }
.composer .ico { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--surface-2); color: var(--accent); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; font-size: 16px; }
.composer .ico.send { background: var(--accent); color: #FFF; }

/* Заявка-чат во всю доступную высоту: переписка прокручивается внутри,
   поле ввода всегда на виду — иначе на длинной переписке до него не добраться. */
/* align-items у .row — flex-start, поэтому карточка тянулась по тексту, а не по экрану */
.row.tickets { flex: 1; min-height: 0; align-items: stretch; }
.row.tickets > .col { max-height: 100%; overflow-y: auto; }
.chat-card { display: flex; flex-direction: column; max-height: 100%; }

/* ─────────── экран-мессенджер (заявка у мастера, body.ekran-chata) ───────────
   Как в Telegram: своя шапка чата, прокручивается ТОЛЬКО лента, поле ввода
   прижато к низу. Страница высотой ровно в окно (100dvh — с учётом панелей
   браузера, а не 100vh, который на телефоне выше видимого). Разметка общая —
   так же можно собрать экран заявки у жильца и правления. На компьютере меню
   остаётся, на телефоне шапки сайта и подвала нет. */
/* --vysota-ekrana ставит okna.js по visualViewport (клавиатура iOS), без неё — 100dvh */
body.ekran-chata { overflow: hidden; overscroll-behavior: none; }
body.ekran-chata .layout { height: 100vh; height: var(--vysota-ekrana, 100dvh); min-height: 0; overflow: hidden; }
body.ekran-chata .content { min-height: 0; overflow: hidden; padding-bottom: 12px; gap: 12px; }
/* у подвала inline display: flex — без !important не спрятать */
body.ekran-chata .content > footer { display: none !important; }
.chat-ekran { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.chat-shapka { flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line); min-width: 0; }
.chat-nazad { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  color: var(--text); text-decoration: none; margin-left: -6px; }
.chat-nazad:hover { background: var(--surface-2); }
.chat-shapka-tekst { flex: 1 1 auto; min-width: 0; }
.chat-shapka-glav { font-size: 16px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-shapka-pod { font-size: 12.5px; color: var(--muted); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-shapka-pod .chat-srochno { color: var(--err-fg); font-weight: 600; }
.chat-ikonka { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); text-decoration: none; border: none; cursor: pointer; }
.chat-zakryt { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 11px;
  border: none; border-radius: var(--r-pill); background: var(--ok-bg); color: var(--ok-fg); font: inherit;
  font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chat-zakryt:hover { filter: brightness(.97); }
.chat-lenta { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 2px; }
.chat-niz { flex-shrink: 0; padding-top: 8px; padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); }
.chat-niz form { margin-top: 0 !important; }
.chat-niz .composer textarea::placeholder { font-size: 14px; }
/* клавиатура открыта (okna.js по visualViewport ставит body.klaviatura):
   полоски «домой» под полем нет — без этого над клавиатурой пустые ~34 px */
body.klaviatura .chat-niz { padding-bottom: 0; }
/* экран-мессенджер с viewport-fit=cover: в альбомной ориентации у iPhone
   «чёлка» слева или справа — шапка, лента и поле ответа не лезут под неё.
   На остальных устройствах env() = 0 и ничего не меняется */
body.ekran-chata .layout { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
@media (max-width: 900px) {
  body.ekran-chata .side { display: none; }
  body.ekran-chata .content { padding: env(safe-area-inset-top) 12px 8px; gap: 8px; }
  .chat-shapka { padding-top: 8px; padding-bottom: 8px; }
  .chat-lenta { padding: 12px 0; }
}
@media (max-width: 520px) { .chat-zakryt-dop { display: none; } }
/* совсем узкий телефон: от кнопки закрытия остаётся галочка, подпись — в aria-label */
@media (max-width: 360px) { .chat-zakryt > span { display: none; } .chat-zakryt { padding: 0; width: 40px; justify-content: center; } }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 22px 4px; }
.chat-foot { padding: 10px 22px 22px; }

/* «Куда звонить»: на компьютере блок, на телефоне кнопка с попапом —
   иначе телефоны занимают пол-экрана выше всего остального. */
/* три точки в строке таблицы: редкие действия не должны занимать место */
.menu { display: inline-block; position: relative; vertical-align: middle; }
/* размеры как у кнопки рядом (.btn-sm): иначе три точки «проваливаются» ниже */
.menu-knopka {
  list-style: none; cursor: pointer; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; font-size: 18px; line-height: 1; color: var(--muted);
  background: var(--bg); box-shadow: inset 0 0 0 1.5px #D5DAEC;
}
.menu-knopka:hover { color: var(--accent); }
.menu-knopka::-webkit-details-marker { display: none; }
.menu[open] .menu-knopka { color: var(--text); }
.menu-spisok {
  /* выше полосы «добавьте на телефон» (50); язычок стенда на время открытого меню прячется */
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 80; min-width: 190px;
  background: var(--bg); border-radius: var(--r-inner); padding: 6px;
  box-shadow: 0 12px 32px rgba(20, 20, 43, 0.18), 0 0 0 1px var(--line);
}
.menu-punkt {
  display: block; width: 100%; text-align: left; border: none; background: none;
  font-family: inherit; font-size: 14px; color: var(--text); cursor: pointer;
  padding: 10px 12px; border-radius: 10px;
}
.menu-punkt:hover { background: var(--surface); }
/* бургер правления: только на телефоне (≤900), вместо полосы пунктов в шапке.
   Список ставит okna.js на всю ширину под шапкой (.vo-vsyu) */
.burger { display: none; }
.burger-knopka { list-style: none; cursor: pointer; position: relative; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--text); background: var(--bg); box-shadow: var(--shadow-card); }
.burger-knopka::-webkit-details-marker { display: none; }
.burger[open] .burger-knopka { color: var(--accent); }
/* «ждут реакции» видно и при закрытом меню */
.burger-chislo { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent); color: #FFF; font-size: 11px; font-weight: 700; line-height: 18px;
  text-align: center; box-shadow: 0 0 0 2px var(--surface); }
/* список в верхнем слое (popover, okna.js): у popover свои стили браузера —
   рамка, поля, inset: 0 и margin: auto по центру экрана, — снимаем; место
   ставит okna.js. Меню закрыли — списка нет, даже если popover ещё не убран */
.menu-spisok[popover] { margin: 0; border: 0; inset: auto; overflow: visible; color: inherit; }
details.menu:not([open]) > .menu-spisok { display: none; }
/* заголовок меню профиля: кто вошёл — только имя (решение Антона 2026-10-26) */
.profil-kto { padding: 8px 12px 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); line-height: 1.3; }
.profil-kto b { display: block; font-size: 15px; font-weight: 600; color: var(--text); }
.burger .menu-spisok { padding: 8px; }
.burger-punkty { display: flex; flex-direction: column; gap: 2px; }
.burger-punkty a { font-size: 16px; font-weight: 500; color: var(--text); text-decoration: none;
  padding: 12px 14px; border-radius: 12px; }
.burger-punkty a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.burger .menu-spisok .svezhest { display: block; margin: 8px 0 0; max-width: none; background: var(--surface); }
@media (max-width: 900px) {
  /* шапка у всех одна: знак с названием слева, иконки справа, пункты под ☰.
     Высота одинаковая: поля 12px и иконки 40px */
  /* у мастера ☰ нет: его единственный пункт «Мои заявки» на телефоне не нужен — туда ведёт название */
  .side .side-nav, .side > .svezhest, .shapka-nav { display: none; }
  .burger { display: block; }
  /* visible, а не overflow-x: hidden: hidden + visible по другой оси браузер
     превращает в auto по обеим — шапка становилась прокручиваемой областью,
     обрезающей всё, что из неё выходит (от списка профиля на айфоне была видна
     кромка). Ширину держат многоточие у названия и min-width: 0 */
  .side { overflow: visible; gap: 10px; }
  .shapka-zhilca { height: auto; padding: 12px 16px; gap: 10px; }
  .shapka .brand { flex: 1 1 0; min-width: 0; padding: 0; }
  .shapka .brand > div { min-width: 0; }
  .shapka .brand .name, .shapka .brand .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .shapka .shapka-ikonki { position: static; margin: 0; padding: 0; box-shadow: none; gap: 6px; }
}
tr.zhilec { cursor: pointer; }
/* кнопки строки по одной линии и без переносов */
.tbl td.deistviya { white-space: nowrap; }
.tbl td.deistviya > form, .tbl td.deistviya > .menu { vertical-align: middle; }
.tbl td.deistviya > form { display: inline-flex; margin-right: 8px; }
.karta-okno {
  border: none; border-radius: var(--r-block); padding: 26px 28px;
  box-shadow: 0 20px 60px rgba(20, 20, 43, 0.28);
  width: 620px; max-width: calc(100vw - 32px); color: var(--text);
}
.karta-okno::backdrop { background: rgba(20, 20, 43, 0.4); }

/* полоса «вы в чужом кабинете»: должна быть видна сразу и не теряться */
.chuzhoj {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; background: var(--warn-fg); color: #FFF;
  padding: 10px 18px; font-size: 14px; line-height: 1.4;
}

.zvonit-knopka { display: none; }

@media (max-width: 900px) {
  .zvonit-knopka {
    display: inline-flex; width: 100%; justify-content: center;
    background: var(--err-bg); color: var(--err-fg); box-shadow: none;
  }
  .zvonit-okno {
    border: none; border-radius: var(--r-block); padding: 16px;
    width: calc(100vw - 24px); max-width: 520px;
    box-shadow: 0 20px 60px rgba(20, 20, 43, 0.28);
  }
  .zvonit-okno::backdrop { background: rgba(20, 20, 43, 0.4); }
  .zvonit-okno .zvonit { margin-bottom: 12px; }
}

/* Кнопка «назад» к списку заявок: нужна только на телефоне, где список и
   переписка — разные экраны. */
.nazad { display: none; }

/* Выбор роли и прочие варианты с пояснением: кружок слева, название
   строкой, объяснение под ним. Django рисует каждый вариант своим div. */
.vybor > div, .vybor > label { margin-bottom: 10px; }
.vybor > div:last-child, .vybor > label:last-child { margin-bottom: 0; }
.vybor label {
  display: grid; grid-template-columns: 18px 1fr; gap: 4px 12px;
  align-items: start; cursor: pointer; line-height: 1.45;
}
.vybor input { grid-row: 1 / 3; margin: 3px 0 0; width: 17px; height: 17px; accent-color: var(--accent); }
.vybor label b { font-weight: 600; }
.vybor label .note { grid-column: 2; margin: 0; }

/* Короткие варианты — в строку: канал заявки выбирают в каждой заявке,
   и список в столбик занимал пол-экрана. */
.vybor.ryadom { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.vybor.ryadom > div { margin: 0; }
.vybor.ryadom label { grid-template-columns: 18px auto; align-items: center; }

/* Своя стрелка у выпадающих списков: браузерная рисуется у самого края,
   разной толщины в каждом браузере, и выбивается из полей с мягкими углами.
   Правило общее — списки есть и у правления, и в кабинете жильца. */
select { appearance: none; -webkit-appearance: none; padding-right: 44px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M1.5 1.5 7 7l5.5-5.5' stroke='%236C727C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 18px center; background-size: 13px 9px; }
select::-ms-expand { display: none; }
/* у кнопки-селектора свой отступ — возвращаем место под стрелку,
   иначе текст наезжает на неё */
select.select { padding-right: 40px; }
select.select { padding-left: 18px; }

/* Подстановка одним нажатием (жильцы квартиры в приёме заявки): это
   не действие формы, а подсказка — поэтому мелко и неброско, обычными
   кнопками список из двух человек занимал две строки. */
.chipy { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.chip { font-family: inherit; font-size: 13px; line-height: 1.2; padding: 7px 12px;
  border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface);
  color: var(--text); cursor: pointer; }
.chip:hover, .chip:focus-visible { background: var(--accent-soft); color: var(--accent);
  border-color: transparent; outline: none; }
.chip .tel { color: var(--muted); margin-left: 6px; }

/* Попап: один стиль на все окна портала (тег {% okno %}). */
.okno { border: none; border-radius: var(--r-block); padding: 26px 30px;
  box-shadow: 0 20px 60px rgba(20, 20, 43, 0.28); width: calc(100vw - 32px);
  background: var(--surface); color: var(--text); }
.okno::backdrop { background: rgba(20, 20, 43, 0.35); }
.okno-head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 16px; }
.okno-x { border: none; background: none; font-size: 26px; line-height: 1; color: var(--muted);
  cursor: pointer; padding: 0 2px; border-radius: 8px; }
.okno-x:hover, .okno-x:focus-visible { color: var(--text); outline: none; }
@media (max-width: 520px) { .okno { padding: 20px 18px; } }


@media (max-width: 900px) {
  /* на телефоне колонки складываются в одну — фиксированная высота там мешает */
  .row.tickets, .row.tickets > .col, .chat-card { max-height: none; }
  .chat-scroll { overflow: visible; padding: 16px 16px 4px; }
  .chat-foot { padding: 10px 16px 18px; }

  /* один экран — одно дело: или список заявок, или переписка по одной из них */
  .row.tickets[data-otkryta] > .col { display: none; }
  .row.tickets:not([data-otkryta]) .chat-card { display: none; }
  .nazad {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; margin-right: 10px; flex-shrink: 0;
    border-radius: 50%; background: rgba(255, 255, 255, 0.6);
    color: inherit; text-decoration: none; font-size: 19px; line-height: 1;
  }
}
.composer .ico.has-file { background: var(--ok-bg); color: var(--ok-fg); }
.status-big { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--r-pill); font-weight: 600; font-size: 14px; white-space: nowrap; }
.ticket-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.ticket-head .state { font-size: 16px; font-weight: 600; margin-top: 4px; line-height: 1.35; }
/* статус — цветной пилюлей, сама шапка нейтральная */
.ticket-head.info .status-big { background: var(--accent-soft); color: var(--accent); }
.ticket-head.warn .status-big { background: var(--warn-bg); color: var(--warn-fg); }
.ticket-head.ok   .status-big { background: var(--ok-bg); color: var(--ok-fg); }
.ticket-head.err  .status-big { background: var(--err-bg); color: var(--err-fg); }
.ticket-head.mute .status-big { background: var(--bg); color: var(--muted); }
@media (max-width: 520px) { .ticket-head { flex-direction: column; align-items: flex-start; } }
.tbl tr.rowlink { cursor: pointer; }
/* кружок с числом непрочитанных сообщений: карточки мастера и список заявок правления */
.krug { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; box-sizing: border-box; vertical-align: middle;
  background: var(--accent); color: #FFF; font-size: 12px; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; }
/* точка вместо числа — «новое», когда считать нечего (_otmetka.html) */
.krug.tochka { min-width: 10px; width: 10px; height: 10px; padding: 0; }
/* строка заявки, которая ждёт реакции правления: только отметка — полоска
   слева и кружок у номера; текст обычным начертанием (Антон, 2026-10-25:
   «пометка — лишь отметка») */
.tbl tr.trebuet td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.tbl tr.rowlink:hover td { background: var(--surface-2); }
.chat .msg.me .who { color: rgba(255,255,255,.85); }


/* ——— контакты служб (вкладка «Контакты», список председателя) ———
   Сетка с align-items: start — карточка по высоте своего содержимого.
   Раньше это был .row с flex-basis у карточки: на телефоне ряд встаёт
   в столбик, basis становится высотой, и карточка тянулась на пол-экрана */
.kontakty { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
            gap: 12px; align-items: start; }
.kontakty > .card { padding: 14px 16px; }
.kontakt { display: flex; flex-direction: column; gap: 4px; }
.kontakt-imya { font-weight: 600; }
.kontakt-svyaz { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 4px 0 2px; }
.kontakt-svyaz .link { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  /* на телефоне — список строками: весь перечень читается одной прокруткой */
  .kontakty { grid-template-columns: 1fr; gap: 0; }
  .kontakty > .card { background: none; box-shadow: none; border-radius: 0; padding: 12px 0;
                      border-top: 1px solid var(--line); }
  .kontakty > .card:first-child { border-top: none; padding-top: 0; }
  .kontakty > .card:last-child { padding-bottom: 0; }
  /* общее правило растягивает кнопки на всю ширину — номеру это не нужно */
  .kontakt .btn { width: auto; height: 36px; padding: 0 14px; }
}

/* ——— заголовок страницы и кнопка в одну строку (кабинет жильца) ———
   Общее правило на ≤900px растягивает кнопки на всю ширину и ставит их под
   заголовок — для пары «Мои заявки + Новая заявка» это лишняя строка экрана.
   .toolbar.v-ryad держит их рядом, кнопка компактная, на узком — короткая подпись */
.toolbar.v-ryad { flex-wrap: nowrap; align-items: center; }
.toolbar.v-ryad .page-head { min-width: 0; }
.toolbar.v-ryad .uzko { display: none; }
@media (max-width: 900px) {
  .toolbar.v-ryad .btn { width: auto; flex-shrink: 0; height: 40px; padding: 0 16px; font-size: 14px; }
}
@media (max-width: 520px) {
  .toolbar.v-ryad .shiroko { display: none; }
  .toolbar.v-ryad .uzko { display: inline; }
}

/* кнопка «Квитанция» рядом с суммой на главной: на широком экране колонка
   растягивалась до ~450 px, и кнопка читалась пустой синей полосой */
.kvit-knopki { max-width: 280px; }
@media (max-width: 900px) { .kvit-knopki { max-width: none; } }

/* ——— «Потяните вниз, чтобы обновить» (obnovit.js) ———
   Только в установленном кабинете: там у браузера нет своего жеста обновления.
   Резинку айфона наверху выключаем, иначе страница едет вместе с индикатором */
html.tyani-vkl { overscroll-behavior-y: none; }
/* пришло уведомление, а человек набирает текст или в попапе — вместо
   перезагрузки плашка сверху (push.js); тап по ней — обновить */
.svezhee { position: fixed; z-index: 95; left: 50%; transform: translateX(-50%);
  top: calc(env(safe-area-inset-top, 0px) + 10px); max-width: calc(100vw - 24px);
  border: none; border-radius: var(--r-pill); padding: 10px 18px; cursor: pointer;
  background: var(--accent); color: #FFF; font: inherit; font-size: 14px; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(20, 20, 43, .25); }
.tyani { position: fixed; z-index: 90; left: 50%; top: env(safe-area-inset-top, 0px);
         transform: translate(-50%, -56px); opacity: 0; pointer-events: none;
         display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tyani.plavno { transition: transform .22s ease, opacity .22s ease; }
.tyani-krug { width: 40px; height: 40px; border-radius: 50%; background: var(--bg); color: var(--accent);
              box-shadow: 0 2px 10px rgba(23,32,74,0.16); display: flex; align-items: center; justify-content: center; }
.tyani-krug svg { transition: transform .18s ease; }
.tyani.gotovo .tyani-krug svg { transform: rotate(180deg); }
.tyani.idet .tyani-krug svg { animation: tyani-krutit .8s linear infinite; }
.tyani-tekst { font-size: 12px; font-weight: 500; color: var(--muted); background: var(--bg);
               padding: 3px 10px; border-radius: var(--r-pill); white-space: nowrap; box-shadow: var(--shadow-card); }
@keyframes tyani-krutit { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .tyani.plavno, .tyani-krug svg { transition: none; }
  .tyani.idet .tyani-krug svg { animation: none; }
}

/* ——— переходы между страницами ———
   Каждый переход в кабинете — новая страница с сервера. Без этого браузер
   на миг показывал пустой экран, и казалось, что перерисовывается всё.
   View Transitions (Safari 18.2+, Chrome 126+): старая страница держится до
   готовности новой и плавно сменяется; шапка и боковое меню названы — стоят
   на месте, меняется только середина. Старые браузеры правило пропускают */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
/* Имя перехода делает шапку контекстом наложения: всё внутри неё, включая
   fixed-списки ☰, профиля и колокольчика, рисуется на её уровне. Без z-index
   этот уровень — «позиционированный с z-index 0», и любой позиционированный
   элемент страницы ниже по разметке (.hint, .timeline li, .menu в карточках)
   ложился поверх открытого меню (скриншот Антона 2026-10-25). Шапка — флекс-
   элемент .shell/.layout, z-index действует без смены position (sticky
   не трогаем). 80 — как у списков меню: выше полосы установки (50); язычок
   стенда (85) выше шапки, но на время открытого меню прячется */
.shapka { view-transition-name: shapka; z-index: 80; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }
::view-transition-group(shapka) { animation-duration: .16s; }

/* нажатие видно сразу: ответ сервера и отрисовка — доли секунды, а без
   отклика кажется, что тап не принят (подсветку нажатия браузера мы сняли
   -webkit-tap-highlight-color выше). На айфоне :active работает только при
   слушателе touchstart — его ставит okna.js */
a.task:active, .tbl tr.rowlink:active td { background: var(--surface-2); }
a.task:active { transform: scale(.99); }

/* ── карточка заявки правления: тот же экран-мессенджер (.chat-ekran), что у
   мастера, но на компьютере — карточкой рядом с меню, а в шапке вторая строка
   со свойствами (2026-10-25) ── */
.chat-shapka.s-svoystvami { flex-wrap: wrap; row-gap: 6px; }
/* basis 0: иначе длинная строка текста «не влезает» и кнопки уезжают на новую строку */
.chat-shapka.s-svoystvami .chat-shapka-tekst { flex: 1 1 0; }
.chat-shapka-svoystva { flex-basis: 100%; font-size: 13px; color: var(--muted); line-height: 1.4; }
.chat-shapka-svoystva b { color: var(--text); font-weight: 600; }
.chat-izmenit { width: auto; display: inline-flex; gap: 6px; padding: 0 14px 0 11px; border-radius: var(--r-pill);
  font: inherit; font-size: 13.5px; font-weight: 600; }
@media (max-width: 520px) {
  .chat-izmenit { width: 40px; padding: 0; justify-content: center; }
  .chat-izmenit-tekst { display: none; }
}
@media (min-width: 901px) {
  .chat-ekran-karta { background: var(--surface); border-radius: var(--r-block); box-shadow: var(--shadow); padding: 16px 20px 14px; }
}
