/* HuVam в браузере и программе Windows. Цвета — только переменные web/theme.css (подключён раньше), шрифт Onest — там же
   (@font-face, свой файл; пока его нет или буквы нет в Onest — системный запасной). Только свои файлы, без внешних шрифтов.
   Облик (проект §3): текст 12 / 13 / 15 / 17 px, заголовок 28; скругления: карточки и кнопки 12, пузыри 16 с хвостиком 4,
   поле ввода 22. Без теней, стекла и градиентов (кроме узоров фона чата wall-N — их выбирает человек). */
* { box-sizing: border-box; }
/* Сам документ никогда не прокручивается (находка тестировщика 05.10: в чате поле ввода висело посередине, под ним
   пусто; прокрутка переписки вниз тянула вверх весь экран). Прежде высоту body задавало число — 100dvh или --app-h из
   window.innerHeight (fitview.js): в Android WebView после закрытия клавиатуры оно оставалось прежним (событие resize
   приходит раньше нового innerHeight, повтор — один, через 300 мс), и body был короче окна (поле посередине, внизу
   пусто) или длиннее (документ прокручивался, и прокрутка ленты передавалась ему). Теперь body прибит к окну
   (position: fixed; inset: 0): размер считает сам движок страницы в каждом кадре, без чисел из JS. */
html { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
/* баннеры сверху, под ними экран: чат занимает ровно остаток окна, длинные экраны прокручиваются внутри main */
body { margin: 0; position: fixed; inset: 0; overflow: hidden; overscroll-behavior: none;
  background: var(--bg); color: var(--fg); font: 17px/1.45 sans-serif; font-family: 'Onest', system-ui, sans-serif;
  display: flex; flex-direction: column; }
/* .wrap — колонка списка (#side, только широкое окно) и экран (#app) */
.wrap { flex: 1; min-height: 0; display: flex; }
#side { display: none; }
main { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; width: 100%; max-width: 640px; margin: 0 auto; }
@media (min-width: 900px) {
  /* полоса разделов 100 + колонка раздела 340 (порядок интерфейса, Task 3); раздел без колонки — одна полоса */
  #side:not([hidden]) { display: flex; flex: none; overflow-y: auto; border-right: 1px solid var(--line); }
  #side > .nav.rail { position: sticky; top: 0; align-self: flex-start; min-height: 100%; }
  #side > .nav.rail:not(:last-child) { border-right: 1px solid var(--line); }
  #side > :not(.nav) { flex: none; width: 340px; min-width: 0; align-self: flex-start; } /* по высоте содержимого, прокручивает #side */
  main { max-width: 760px; }
}
.row.on { background: var(--acc-bg); border-color: var(--acc); }
/* рисунок микросхемы на фоне (шаг 3): слой на всё окно позади экрана, не прокручивается и не ловит касания; рисунки — web/img/
   (tools/circuit/gen.mjs). Экран (баннеры, main, #side) — над ним (z-index 1), окна (20), звонок (30) и всплывашка (40) — выше.
   Выбор человека — data-art на <html> (themepref.js): off прячет слой. */
.art { position: fixed; inset: 0; z-index: 0; pointer-events: none; background-repeat: no-repeat; background-position: center; }
:root[data-theme="dark"] .art { background-image: url(/web/img/circuit-dark.svg); background-repeat: repeat; background-size: 240px 400px; opacity: .11; }
:root:not([data-theme="dark"]) .art { background-image: url(/web/img/chip-light.svg); background-size: min(90vw, 90vh); opacity: .07; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .art { background-image: url(/web/img/circuit-dark.svg); background-repeat: repeat; background-size: 240px 400px; opacity: .11; }
}
[data-art="off"] .art { display: none; }
.banners, main, #side { position: relative; z-index: 1; }
/* заголовок экрана и окна — 17 полужирный; 28 — только верхние (дом, приветствие, замок: h1.big, .home .bar h1) */
h1 { font-size: 17px; line-height: 1.3; font-weight: 600; margin: 0; }
h1.big { font-size: 28px; line-height: 1.2; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 12px; }

.screen { padding: 16px; display: flex; flex-direction: column; gap: 12px; min-height: 100%; }
.screen.center { justify-content: center; }
.card { background: var(--surface); border-radius: 12px; padding: 20px; }
.muted { color: var(--fg-2); }
/* «ключ сменился», ошибки: заметно, но спокойно — тревога на своей подложке, без рамки */
.warn { color: var(--alarm); background: var(--alarm-bg); padding: 8px 12px; border-radius: 12px; }
.warn:empty { display: none; }
/* сведения (старая версия у собеседника и т. п.) — тихо, без заливки */
.note { color: var(--fg-2); }
.weak { color: var(--alarm); font-size: 15px; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* кнопки и поля: не ниже 44 px */
button, .btn, select {
  min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); font: inherit; cursor: pointer;
}
button:disabled { opacity: .6; cursor: default; }
/* кнопки подряд прямо в карточке (вход: «Дальше», «Привязать…», «Из копии…») — не слипаются */
.card > button { margin: 0 8px 8px 0; }
.card > button.row { margin-right: 0; } /* строка во всю ширину: правый отступ давал прокрутку вбок у листов */
.card > button:last-child { margin-bottom: 0; }
button.primary { background: var(--acc); color: var(--bg); border-color: var(--acc); font-weight: 600; }
button.danger { color: var(--alarm); }
button:focus-visible, select:focus-visible, .field:focus-visible, .in:focus-visible, .btn:focus-within {
  outline: 3px solid var(--acc); outline-offset: 2px;
}
.field, .in {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--fg); font: inherit;
}

/* шапка экрана */
.bar { display: flex; align-items: center; gap: 12px; }
.bar .title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.home .bar { flex-wrap: wrap; } /* длинные «Поиск/Настройки» (греческий, финский) — на новую строку, без полосы прокрутки */
.home .bar h1 { flex: 1; font-size: 28px; line-height: 1.2; }
/* галочки: место для пальца и цвет темы */
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--acc); }

/* список */
.list { display: flex; flex-direction: column; gap: 8px; }
.row { text-align: left; width: 100%; overflow-wrap: anywhere; }
.row.req { border-color: var(--acc); }
.row.danger { color: var(--alarm); background: var(--alarm-bg); border-color: var(--alarm-bg); }
.foot { margin-top: auto; display: flex; flex-direction: column; }
/* строка выбора (галочка + имя). Только label: экран выбора — «screen pick», его поле названия — обычное поле */
label.pick { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; background: var(--surface);
  border-radius: 12px; overflow-wrap: anywhere; }
label.pick input { width: 22px; height: 22px; flex: none; }

/* чат: шапка сверху, переписка прокручивается, поле — внизу */
.screen.chat { height: 100%; min-height: 0; gap: 8px; padding-top: 4px; }
.top { display: flex; flex-direction: column; gap: 8px; }
/* коды сверки и копии — не заголовок: 17 полужирный; перенос только между группами цифр */
.panel .code { font-size: 17px; font-weight: 600; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.panel .code span { display: block; } /* 24 цифры: две строки по три группы (узко — группа переносится целиком) */
.backup .code { font-size: 17px; font-weight: 600; letter-spacing: .06em; font-variant-numeric: tabular-nums; user-select: all; }
.msgs { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.msg { max-width: 85%; padding: 8px 12px; border-radius: 16px; background: var(--surface); overflow-wrap: anywhere; white-space: pre-wrap; }
/* хвостик — нижний угол со стороны автора */
.msg.mine { align-self: flex-end; background: var(--acc-bg); border-radius: 16px 16px 4px 16px; }
.msg.theirs { align-self: flex-start; border-radius: 16px 16px 16px 4px; }
.msg .who { font-weight: 600; font-size: 15px; }
/* время и остаток таймера — мелко и тихо */
.msg .meta { color: var(--fg-2); font-size: 12px; text-align: right; }
.msg .photo { display: block; max-width: 100%; max-height: 320px; border-radius: 12px; cursor: zoom-in; }
.sys { align-self: center; color: var(--fg-2); font-size: 13px; text-align: center; margin: 4px 0; }
/* разделитель дня в ленте («Сегодня», «Вчера», «Понедельник, 28 сентября») — пилюля по центру */
.daysep { align-self: center; margin: 10px 0 4px; }
.daysep span { display: inline-block; padding: 4px 12px; border-radius: 12px; background: var(--surface); color: var(--fg-2); font-size: 13px; }
.compose { display: flex; flex-direction: column; gap: 8px; }
/* низ чата (Task 6): «+» · поле · круглая кнопка; кнопки не сжимаются, поле — да (узкий телефон, находка Д) */
.compose-line { display: flex; gap: 6px; align-items: flex-end; min-width: 0; }
.compose-line > button { flex: none; }
.compose .in { flex: 1; min-width: 0; resize: none; height: 44px; max-height: 160px; border-radius: 22px; padding: 10px 16px; overflow-y: hidden; } /* auto — только когда текст выше 160 px (chat.js fitInput) */
.compose .ib.add { color: var(--fg-2); }
.compose .ib.round { width: 48px; height: 48px; border-radius: 24px; background: var(--acc); color: var(--bg); }
.compose .ib.round:hover { background: var(--acc); }
/* включённые «Один раз ×», «Без звука ×» над полем — переносятся, а не вылезают за край */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip { font-size: 13px; }
.chips .chip svg.i { width: 16px; height: 16px; }
.once { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.once input { width: 20px; height: 20px; }
/* поле файла — невидимо, но доступно с клавиатуры (фокус подсвечивает «Фото») */
.hide { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

/* окна поверх экрана */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 20; }
.overlay.menu-wrap.compact { background: rgba(0, 0, 0, .2); }
.menu.compact { width: 360px; max-width: calc(100% - 8px); padding: 12px; gap: 8px; }
.menu.compact .reacts { margin-top: 0; flex-wrap: wrap; justify-content: center; gap: 4px; }
.menu.compact .reacts .react { min-width: 44px; min-height: 44px; font-size: 17px; }
.dialog { width: 100%; max-width: 440px; }
/* ожидание снимка своей камеры (мелочи B-5): крутилка и надпись; без движения — только надпись */
.wait { display: flex; align-items: center; gap: 14px; }
.wait p { margin: 0; }
.wait .spin { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 3px solid var(--line);
  border-top-color: var(--acc); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .wait .spin { display: none; } }
.row-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.row-buttons button { flex: 1; }
.ring .who { font-size: 28px; overflow-wrap: anywhere; }
.viewer-wrap { background: var(--media-bg); padding: 0; }
.viewer { display: flex; flex-direction: column; width: 100%; height: 100%; padding: 16px; gap: 12px; }
.viewer .full { flex: 1; min-height: 0; object-fit: contain; width: 100%; }
/* увеличение фото (zoom.js): рамка не прокручивается и сама ловит пальцы (щипок, перетаскивание) */
.viewer .zoom { flex: 1; min-height: 0; position: relative; overflow: hidden; touch-action: none; cursor: zoom-in; user-select: none; }
.viewer .zoom.zoomed { cursor: grab; }
.viewer .zoom .full { display: block; width: 100%; height: 100%; transform-origin: center center; will-change: transform; -webkit-user-drag: none; }

/* звонок — во весь экран поверх всего */
iframe.call { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; z-index: 30; background: var(--media-bg); }
/* входящий 1:1 во время группового звонка — поверх окна звонка (выбор «Ответить (выйти из группового)» / «Отклонить») */
.overlay.ring-wrap { z-index: 35; }

.banners { flex: none; width: 100%; max-width: 640px; margin: 0 auto; }
@media (min-width: 900px) { .banners { max-width: none; } } /* широкое окно: на всю ширину, не по центру поверх колонки списка (после общего правила) */
/* сведения — спокойно; предупреждения (места нет, запись не прошла) — .alarm, цветом тревоги (banners.js) */
.banner { margin: 0; padding: 10px 16px; background: var(--surface-2); color: var(--fg); font-size: 15px; }
.banner.alarm { background: var(--alarm-bg); color: var(--alarm); }
/* Android: «Идёт звонок — вернуться» (callbar.js) — над баннерами, цветом акцента; скрыта, пока окна звонка нет */
.callbar { display: none; flex: none; width: 100%; margin: 0; padding: 12px 16px; border: 0; border-radius: 0;
  background: var(--acc); color: var(--bg); font: inherit; font-size: 15px; font-weight: 600; position: relative; z-index: 1; }
.callbar.on { display: block; }
.toast { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 16px;
  border-radius: 12px; background: var(--fg); color: var(--bg); font-size: 15px; z-index: 40; opacity: 0; pointer-events: none;
  transition: opacity .2s; }
.toast.on { opacity: 1; }

/* этап 5 — переписка */
.msg .more { float: right; min-height: 28px; padding: 0 8px; margin: -4px -6px 0 6px; background: transparent; border: 0; color: var(--fg-2); }
.msg .quote { display: block; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; margin: 2px 0 4px; background: transparent; color: var(--fg-2); font-size: 13px; }
.msg .fwd { color: var(--fg-2); font-size: 13px; font-style: italic; }
.msg.deleted .text { color: var(--fg-2); font-style: italic; }
.reacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.reacts .react { min-height: 32px; padding: 2px 8px; border-radius: 12px; }
.reacts .react.mine { outline: 2px solid var(--fg-2); }
.reply { display: flex; align-items: center; gap: 8px; color: var(--fg-2); }
.reply span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* этап 5, часть 03 */
.home .sub { margin: 4px 0 0; font-size: 15px; color: var(--fg-2); }
.row .draft { color: var(--alarm); }
.row.self { font-weight: 600; }
.search .field { width: 100%; }
.hit .snip { display: block; color: var(--fg-2); font-weight: 400; }
.msg.planned { opacity: .75; border: 1px dashed var(--line); }
.poll .poll-opt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.poll .vote { min-height: 36px; text-align: left; }
.poll .vote.mine { outline: 2px solid var(--fg-2); }


/* этап 5, часть 04 — оформление чата: цвет своих сообщений (engine.BubbleColors) и узоры фона */
.look-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.look-row select { flex: 1; max-width: 60%; }
.col-1 .msg.mine { background: var(--bubble-1); }
.col-2 .msg.mine { background: var(--bubble-2); }
.col-3 .msg.mine { background: var(--bubble-3); }
.col-4 .msg.mine { background: var(--bubble-4); }
.col-5 .msg.mine { background: var(--bubble-5); }
.col-6 .msg.mine { background: var(--bubble-6); }
.col-7 .msg.mine { background: var(--bubble-7); }
.col-8 .msg.mine { background: var(--bubble-8); }
.col-9 .msg.mine { background: var(--bubble-9); }
.col-10 .msg.mine { background: var(--bubble-10); }
.col-11 .msg.mine { background: var(--bubble-11); }
.col-12 .msg.mine { background: var(--bubble-12); }
.msgs.wall-1 { background-image: radial-gradient(var(--line) 1.5px, transparent 1.5px); background-size: 16px 16px; }
.msgs.wall-2 { background-image: repeating-linear-gradient(45deg, var(--line) 0 1px, transparent 1px 10px); }
.msgs.wall-3 { background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 20px 20px; }
.msgs.wall-4 { background-image: repeating-linear-gradient(45deg, var(--line) 0 1px, transparent 1px 17px),
  repeating-linear-gradient(-45deg, var(--line) 0 1px, transparent 1px 17px); }
.msgs.wall-5 { background-image: radial-gradient(circle, transparent 5px, var(--line) 5px 6px, transparent 6px); background-size: 24px 24px; }
.msgs.wall-6 { background-image: linear-gradient(135deg, var(--line) 25%, transparent 25%), linear-gradient(225deg, var(--line) 25%, transparent 25%);
  background-size: 24px 12px; }

/* этап 5, часть 04 — список чатов */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; } /* колесо и палец прокручивают, системной полосы нет */
.tabs .tab { flex: none; min-height: 36px; padding: 6px 12px; border-radius: 18px; font-size: 15px; }
.tabs .tab.on { background: var(--acc); color: var(--bg); border-color: var(--acc); }
.chatrow { display: flex; gap: 8px; align-items: stretch; }
.chatrow .row { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.chatrow .more { flex: none; width: 44px; padding: 0; }
.badge { margin-left: auto; min-width: 24px; padding: 0 8px; border-radius: 12px; background: var(--acc); color: var(--bg);
  font-size: 13px; font-weight: 600; text-align: center; }
.badge.off { background: var(--line); color: var(--fg-2); }
.row.arch { color: var(--fg-2); }
/* этап 5, часть 05 — голосовые, кружочки, «Скрыть лица» */
.msg .media .play { min-height: 44px; }
.msg .wave { display: flex; align-items: center; gap: 2px; height: 28px; margin-top: 4px; }
.msg .wave span { width: 3px; border-radius: 2px; background: var(--fg-2); }
.wave .b0 { height: 2px; } .wave .b1 { height: 5px; } .wave .b2 { height: 8px; } .wave .b3 { height: 11px; } .wave .b4 { height: 14px; }
.wave .b5 { height: 17px; } .wave .b6 { height: 20px; } .wave .b7 { height: 24px; } .wave .b8 { height: 28px; }
.rec .round-view, .viewer .round-play { width: min(70vw, 320px); aspect-ratio: 1; border-radius: 50%; object-fit: cover; align-self: center; background: var(--media-bg); }
.rec .rec-time { font-variant-numeric: tabular-nums; text-align: center; font-size: 28px; }
.viewer .voice-play { width: 100%; }
/* «Отправить фото?»: не выше окна (S20: «Отмена» уходила за нижний край) — фото ≤ 45 % высоты, остальное прокручивается */
.shot-card { max-height: 100%; overflow-y: auto; }
.shot-card .shot { width: 100%; max-height: 45vh; object-fit: contain; cursor: crosshair; }
/* QR привязки (0.6.1): версия около 8, 570 точек (app/webhost/linkqr.go) — 60–70 % окна, но не меньше 456 точек
   (8 на модуль) и не шире окна; pixelated — модули резкие */
.screen.link img.qr { width: min(100%, max(456px, min(65vw, 70vh))); max-width: 100%; height: auto; image-rendering: pixelated; background: var(--qr-bg); border-radius: 12px; align-self: center; }
/* QR сверки в контакте — короче QR привязки (≈ 37 модулей): не больше 330 точек */
.screen.contact img.qr, .qrbox img.qr { width: min(100%, 330px); height: auto; image-rendering: pixelated; background: var(--qr-bg); border-radius: 12px; align-self: center; }
/* свой QR приглашения — плотный (≈ 149 модулей на уровне Medium): крупно, но не больше окна */
.screen.add img.qr { width: min(100%, max(360px, min(65vw, 60vh))); max-width: 100%; height: auto; image-rendering: pixelated; background: var(--qr-bg); border-radius: 12px; align-self: center; }
/* QR переноса HVT2 (уровень Medium, как в Fyne): крупно, но не больше окна; код сверки — 17 полужирный цифрами одной ширины */
.screen.transfer img.qr { width: min(100%, max(360px, min(65vw, 60vh))); max-width: 100%; height: auto; image-rendering: pixelated; background: var(--qr-bg); border-radius: 12px; align-self: center; }
.screen.transfer .code, .dialog .code { font-size: 17px; font-weight: 600; letter-spacing: .06em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.screen.link ol { padding-left: 1.4em; }
/* низкое окно — телефон боком (находка Г): шапка чата ниже, отступы меньше, полосы тоньше; переписке — своя наименьшая
   высота (не помещается — прокручивается весь экран). Шапка — одна строка: имя сжимается многоточием, значки — нет */
@media (max-height: 500px) {
  .screen.chat { padding: 4px 16px 8px; gap: 4px; }
  .chathead { min-height: 48px; }
  .chathead .ava { width: 36px; height: 36px; }
  .strip { padding: 4px 16px; }
  .screen.chat .msgs { min-height: 120px; }
  .compose { gap: 4px; }
}

/* порядок интерфейса (Task 3): навигация — панель снизу (телефон, корни разделов) и полоса слева (широкое окно) */
.navbox { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--bg); border-top: 1px solid var(--line); }
.navbox[hidden] { display: none; }
/* --nav-h — настоящая высота панели (nav.js syncNavPad: крупный шрифт телефона делает её выше 72 px) */
body.has-nav #app { padding-bottom: var(--nav-h, calc(72px + env(safe-area-inset-bottom))); }
.nav { display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
.nav .nb { position: relative; flex: 1 1 0; min-width: 0; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 2px; background: none; border: 0; color: var(--fg-2); border-radius: 16px; }
.nav .nb.on { color: var(--acc); font-weight: 600; }
.nav .nb svg.i { padding: 2px 14px; border-radius: 12px; box-sizing: content-box; }
.nav .nb.on svg.i { background: var(--acc-bg); }
.nav .lb { font-size: 12px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav .badge { position: absolute; top: 2px; left: calc(50% + 8px); margin: 0; min-width: 20px; padding: 0 6px; font-size: 12px; }
.nav.rail { flex-direction: column; justify-content: flex-start; gap: 8px; width: 100px; flex: none; margin: 0; padding: 12px 4px; }
.nav.rail .nb { flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.more.sr:focus, .more.sr:focus-visible { position: static; width: auto; height: auto; clip: auto; }
.ib { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; color: var(--fg); border-radius: 22px; padding: 0; flex: none; }
.ib:hover { background: var(--surface); }
svg.i { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ava { width: 44px; height: 44px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--acc-bg); color: var(--acc); font-weight: 600; }
.ava.sq { border-radius: 12px; }
.fab { position: sticky; float: right; bottom: 84px; margin: 0 16px 16px auto; width: 56px; height: 56px; border-radius: 18px; background: var(--acc); color: var(--bg); border: 0; display: inline-flex; align-items: center; justify-content: center; }
/* нижний лист (ui.sheet): окно прижато к низу, скруглены верхние углы */
.overlay.sheet { align-items: flex-end; padding: 0; }
.overlay.sheet > .card { width: 100%; max-width: 560px; max-height: 100%; overflow-y: auto; border-radius: 20px 20px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); } /* телефон боком — лист прокручивается */
/* строки в две строки (имя и время, начало сообщения): одна строка с многоточием */
.row.chat2 { display: flex; gap: 12px; align-items: center; text-align: left; }
.row .r-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row .r-top, .row .r-sub { display: flex; gap: 8px; align-items: center; min-width: 0; }
.row .r-name { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.row .r-prev { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--fg-2); }
.row .r-prev.alarm { color: var(--alarm); }
.row .r-time { flex: none; color: var(--fg-2); font-size: 13px; }
/* компактная шапка чата: стрелка, лицо и имя, значки звонка */
.chathead { display: flex; align-items: center; gap: 0; min-height: 60px; margin-right: -8px; }
.chathead .ava { width: 40px; height: 40px; }
.chathead .title { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.chathead .peer { width: 100%; min-width: 0; min-height: 48px; display: flex; align-items: center; background: none; border: 0; border-radius: 12px; text-align: left; color: var(--fg); padding: 0 4px; font: inherit; gap: 8px; }
.chathead .who { min-width: 0; display: flex; flex-direction: column; }
.chathead .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.chathead .st { color: var(--fg-2); font-size: 13px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* полосы (сведения, тревога, акцент) и метки */
.strip { display: block; width: 100%; min-width: 0; text-align: left; padding: 8px 16px; border: 0; background: var(--surface); color: var(--fg-2); overflow-wrap: anywhere; } /* имя без пробелов — переносится */
.strip.alarm { background: var(--alarm-bg); color: var(--alarm); display: flex; align-items: center; gap: 10px; }
.strip.alarm svg.i { width: 20px; height: 20px; }
.strip.acc { background: var(--acc-bg); color: var(--acc); }
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 12px; border-radius: 16px; border: 0; background: var(--acc-bg); color: var(--acc); }
button.strip { min-height: 44px; border-radius: 12px; }
p.strip { border-radius: 12px; margin: 0; font-size: 15px; }
/* лист «+» (макет mock.html ?v=attach): плитки сверху, выключатели и «Отправить позже…» строками */
.attach .tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.attach .tile { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 80px; padding: 8px 2px; border: 0; background: none; color: var(--fg-2); font-size: 13px; text-align: center; border-radius: 12px; cursor: pointer; }
.attach .tile .tic { width: 52px; height: 52px; border-radius: 26px; background: var(--bg); color: var(--fg); display: flex; align-items: center; justify-content: center; }
.attach .tile .tl { max-width: 100%; overflow-wrap: anywhere; }
.attach .tile:focus-within { outline: 3px solid var(--acc); outline-offset: 2px; }
.attach .rows { display: flex; flex-direction: column; }
.attach .row.it { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 8px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; cursor: pointer; }
.attach .row.it .r-name { font-weight: 400; }
/* выключатель (role="switch"): дорожка 44 × 26 цветом акцента, когда включён */
.tog input { appearance: none; -webkit-appearance: none; flex: none; width: 44px; height: 26px; margin: 0; border-radius: 13px; background: var(--line); position: relative; cursor: pointer; }
.tog input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 10px; background: var(--bg); }
.tog input:checked { background: var(--acc); }
.tog input:checked::after { left: 21px; }
.tog input:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
/* «Назад» стрелкой в шапке */
.bar .ib.back { margin-left: -10px; }

/* «Чаты» (Task 4): строки без рамок, разделитель — тонкая линия; запрос — плашкой, «Архив» — тихой строкой сверху */
.home .list { gap: 0; padding-bottom: 80px; } /* место под «Новый»: последнюю строку можно прокрутить выше кнопки */
.home .chatrow .row.chat2, .calls .chatrow .row.chat2 { min-height: 72px; padding: 10px 4px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
.home .chatrow .row.chat2.on, .calls .chatrow .row.chat2.on { background: var(--acc-bg); border-radius: 12px; }
.home .chatrow .row.chat2.danger { background: none; color: var(--fg); }
.home .chatrow .row.chat2.self { font-weight: 400; }
.chatrow .more.sr:not(:focus) { width: 1px; height: 1px; padding: 0; border: 0; }
.ava.star { background: var(--acc-bg); color: var(--acc); }
.ava svg.i { width: 22px; height: 22px; }
.row svg.mk { width: 16px; height: 16px; color: var(--fg-2); }
.row .r-time.acc, .row .r-prev.acc { color: var(--acc); }
.row .r-time.acc { font-weight: 600; }
.row .r-mark { flex: none; color: var(--fg-2); font-size: 13px; white-space: nowrap; }
.row .r-sub .badge { flex: none; margin-left: 0; }
.home .row.req, .contacts .row.req { display: flex; align-items: center; gap: 12px; min-height: 56px; margin-bottom: 8px; background: var(--acc-bg); border: 0; border-radius: 14px; }
.home .row.req .r-name, .contacts .row.req .r-name { font-weight: 400; white-space: normal; overflow-wrap: anywhere; }
.home .row.arch { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; border: 0; background: none; font-weight: 600; }
.home .empty { align-items: flex-start; padding: 24px 4px; }
.home .fab { bottom: 16px; width: auto; min-width: 56px; padding: 0 20px 0 16px; gap: 10px; font-weight: 600; z-index: 4; }
.newsheet .row.chat2 { min-height: 56px; padding: 6px 4px; border: 0; background: none; }
.newsheet .row.chat2.it .r-name { font-weight: 600; }
.newsheet .sub { margin: 8px 0 0; font-size: 13px; font-weight: 600; color: var(--fg-2); }
.newsheet { max-height: 80vh; overflow-y: auto; }
body.has-nav .home .fab { bottom: calc(var(--nav-h, 72px) + 12px); }

/* «Контакты» (Task 5): поиск сверху, две строки-действия, запросы плашкой, люди по алфавиту с буквами-разделителями */
.contacts .bar h1 { font-size: 28px; line-height: 1.2; }
.calls .bar h1 { flex: 1; font-size: 28px; line-height: 1.2; }
.contacts .field { width: 100%; border-radius: 22px; }
.contacts .list.acts { gap: 0; }
.contacts .row.chat2 { min-height: 56px; padding: 6px 4px; border: 0; background: none; }
.contacts .row.chat2.it .r-name { font-weight: 600; }
.contacts .row.req { margin: 8px 0 0; }
.people { gap: 0; }
.people .letter { margin: 12px 0 2px 4px; font-size: 13px; font-weight: 600; color: var(--acc); }
.people .row.chat2 { min-height: 64px; padding: 8px 4px; border: 0; border-radius: 12px; background: none; }
.people .row.chat2.on { background: var(--acc-bg); }
.people .r-prev { font-size: 13px; }
.row .r-prev.ok { color: var(--acc); }

/* экран контакта (Task 5, макет new-09): крупно кружок, имя, номер; три кнопки; строки-кнопки в карточках */
.contact .hero { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.contact .hero .title { font-size: 28px; line-height: 1.2; overflow-wrap: anywhere; }
.contact .hero .num { margin: 0; font-size: 15px; }
/* заголовок карточки доверия (Task 5, раунд 1): первой строкой — «Проверен» / «Не проверен» / «Ключ сменился!» */
.panel .trust-head { font-weight: 600; margin-bottom: 8px; }
.panel .trust-head.ok { color: var(--acc); }
.panel .trust-head.alarm { color: var(--alarm); }
.contact .panel.trust-ok { background: var(--acc-bg); }
.contact .panel.trust-changed { background: var(--alarm-bg); }
.ava.big { width: 88px; height: 88px; font-size: 28px; }
.contact .acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; width: 100%; margin-top: 10px; }
.contact .act { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 10px 4px; color: var(--acc); font-size: 15px; font-weight: 600; border: 0; overflow-wrap: anywhere; }
.card.rows { padding: 4px 16px; display: flex; flex-direction: column; gap: 0; }
.card.rows .row.it { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
.card.rows .row.it:last-child { border-bottom: 0; }
.card.rows .row.it .r-name { font-weight: 400; }
.card.rows .row.it[data-val]::after { content: attr(data-val); flex: 0 1 auto; min-width: 0; max-width: 45%; color: var(--fg-2); font-size: 15px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.rows .row.it.danger { color: var(--alarm); }
.choose > button { margin: 0; text-align: left; }
.choose .opt.on { background: var(--acc-bg); border-color: var(--acc); color: var(--acc); font-weight: 600; }
/* настройки по разделам (порядок интерфейса Task 8, макет new-10): профиль карточкой, «Нужно внимание», разделы карточками
   со строками «значок · название и пояснение · стрелка»; подписи переносятся (длинные de/el/fi не обрезаются) */
.settings .row.it.profile { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 16px; border: 0; border-radius: 12px; background: var(--surface); text-align: left; }
.settings .row.it.profile .ava { width: 52px; height: 52px; }
.settings .row.it.profile .r-name { font-size: 17px; }
.settings .row.it.profile .r-prev { white-space: normal; overflow-wrap: anywhere; } /* номер целиком (узкая колонка) */
.settings .ghdr { font-size: 15px; font-weight: 600; color: var(--fg-2); margin: 4px 4px 6px; }
.settings .card.rows .row.it .r-name { font-weight: 600; white-space: normal; overflow-wrap: anywhere; }
.settings .card.rows .row.it .r-prev { white-space: normal; overflow-wrap: anywhere; font-size: 15px; }
.settings .row.it > svg.i:first-child { color: var(--acc); }
.settings .row.it > svg.i:last-child { width: 20px; height: 20px; color: var(--fg-2); }
.settings .row.it.alarm { color: var(--alarm); }
.settings .row.it.alarm > svg.i:first-child { color: var(--alarm); }
.settings .row.it.on { background: var(--acc-bg); border-radius: 10px; }
.settings .danger-zone { background: var(--alarm-bg); }
.settings .danger-zone .muted { color: var(--fg); }
/* «Защита» (Task 9): выключатели и срок — строками той же карточки, с чертой между ними */
.settings .card.rows > .check, .settings .card.rows > label.sel { min-height: 52px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.settings .card.rows > label.sel { gap: 6px; }
.settings .card.rows > p.muted { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pinform .warn { margin: 0; }
.pinform .field-l { gap: 6px; font-size: 15px; color: var(--fg-2); }
.pinform .duress-here { margin: -4px 0 0; font-size: 13px; color: var(--alarm); } /* под полем обычного PIN в окнах тревожного */

/* «Как устроен HuVam» (about.js): категории раскрываются, текст обычный, списки с отступом */
.about-how details { border-bottom: 1px solid var(--line); }
.about-how details:last-child { border-bottom: 0; }
.about-how summary { cursor: pointer; padding: 12px 0; font-weight: 600; min-height: 44px; }
.about-how .ab-body { padding: 0 0 12px; font-size: 15px; }
.about-how .ab-body p { margin: 0 0 8px; }
.about-how .ab-body ul { margin: 0 0 8px; padding-left: 20px; }
.about-how .ab-body li { margin: 0 0 6px; overflow-wrap: anywhere; }
.about-how .ab-h { font-size: 15px; font-weight: 600; margin: 12px 0 4px; }
