/* Веб-версия IlmNur (29.09.2026). Цвета — словами, а не числами по месту:
   тема «День/Ночь» из настроек игрока меняет их все разом (body[data-theme]) */
:root, body[data-theme="light"] {
  --bg: #fffbf1; --card: #ffffffee; --text: #2b2b25; --muted: #6b6a5e;
  --line: #e4ddc8; --accent: #3e8e2a; --accent-text: #ffffff; --warn: #b3261e;
  --field: #ffffff;
}
body[data-theme="dark"] {
  --bg: #15170f; --card: #20231bee; --text: #eeeadb; --muted: #a9a693;
  --line: #383b30; --accent: #7fd35f; --accent-text: #10130c; --warn: #ffb4ab;
  --field: #191b14;
}
@media (prefers-color-scheme: dark) {
  body:not([data-theme]) {
    --bg: #15170f; --card: #20231bee; --text: #eeeadb; --muted: #a9a693;
    --line: #383b30; --accent: #7fd35f; --accent-text: #10130c; --warn: #ffb4ab;
    --field: #191b14;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg) center / cover fixed no-repeat; color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
[hidden] { display: none !important; }
main { max-width: 980px; margin: 0 auto; padding: 16px 16px 40px; }

/* Верхняя строка: язык и тема справа — как значок настроек в программе */
.bar { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; }
.bar select, .bar button {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer;
}

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px; backdrop-filter: blur(6px);
}

/* ------------------------------ ВХОД ------------------------------ */
.logo { display: block; margin: 12px auto 4px; width: 150px; height: auto; }
.meaning { text-align: center; color: var(--muted); margin: 0 0 16px; }
.sign { max-width: 420px; margin: 0 auto; }
.sign h1 { font-size: 20px; margin: 0 0 14px; text-align: center; }
.sign label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0 4px; }
.sign input {
  width: 100%; padding: 11px 12px; border-radius: 10px; font: inherit;
  border: 1px solid var(--line); background: var(--field); color: var(--text);
}
.sign input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn {
  display: inline-block; border: 0; border-radius: 12px; padding: 12px 20px;
  background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; text-align: center;
}
.btn.wide { width: 100%; margin-top: 16px; }
/* Длинное слово («Зарегистрироваться») при крупном шрифте телефона не
   влезало в кнопку и вылезало за край (29.09.2026) */
.btn { max-width: 100%; overflow-wrap: anywhere; }
.sign .btn.wide { font-size: clamp(15px, 4.4vw, 17px); padding-inline: 12px; }
.btn.plain { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn:disabled { opacity: .6; cursor: default; }
.switch { text-align: center; margin: 14px 0 0; font-size: 15px; color: var(--muted); }
.switch button { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.message { min-height: 1.5em; margin: 12px 0 0; text-align: center; font-size: 15px; color: var(--warn); }
.message.good { color: var(--accent); }

/* Скачать программу и основной сайт — под входом, спокойно */
.more { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 24px 0 0; }
/* Белое поле вокруг кода нужно сканеру; на телефоне код ни к чему */
.apk-qr { display: block; width: 132px; height: 132px; margin: 16px auto 0;
  padding: 6px; background: #fff; border-radius: 8px; box-sizing: border-box; }
@media (max-width: 560px), (pointer: coarse) { .apk-qr { display: none; } }
.site { text-align: center; margin: 20px 0 0; color: var(--muted); font-size: 15px; }
.site a { color: var(--accent); font-weight: 600; text-decoration: none; }

/* -------------------------- ГЛАВНОЕ ОКНО -------------------------- */
.hello { font-size: clamp(20px, 3.4vw, 30px); margin: 12px 0 20px; }
.me { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.me img {
  width: 160px; height: 160px; object-fit: cover; border-radius: 16px;
  background: var(--line);
}
.me .name { font-size: clamp(22px, 4vw, 36px); font-weight: 600; margin: 0; }
.me .mail { color: var(--muted); margin: 4px 0 0; }
.actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin: 24px 0 0; }
.actions .btn { padding: 14px 16px; display: flex; align-items: center; justify-content: center; }
.leisure { margin: 12px 0 0; }
.leisure ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.leisure li { display: flex; justify-content: space-between; gap: 10px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.leisure .soon { color: var(--muted); font-size: 14px; }
.counts { text-align: center; color: var(--muted); font-size: 14px; margin: 28px 0 0; }

/* ----------------- ПАНЕЛИ: ДРУЗЬЯ И ПРОФИЛЬ (часть 2) ----------------- */
.panel { margin: 20px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); }
.panel h2 { font-size: 19px; margin: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn.small { padding: 8px 14px; font-size: 15px; }
.rows { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.rows li {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 12px;
}
.rows img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--line); flex: none; }
.rows .who { flex: 1; min-width: 0; }
.rows .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .who span { color: var(--muted); font-size: 14px; }
/* Ступень в строке друзей — нажимается: смена ступени (05.10.2026) */
.rows .who .kind-change { display: inline; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--muted); font: inherit; font-size: 14px; text-decoration: underline dotted; text-underline-offset: 3px; }
.rows .who .kind-change:hover { color: var(--accent); }
.level-chips { margin-top: 12px; }
/* Окно ступеней — выше липкой верхней полосы (m3.css, z-index 40), иначе
   она закрывала заголовок и «✕»; ниже окна вызова (90+) */
#level-sheet { z-index: 45; }
#level-sheet h2 { padding-inline-end: 48px; }
/* «Голосовые команды» из шестерёнки (05.10.2026): слова — плашками */
#voice-sheet { z-index: 45; }
#voice-sheet h2 { padding-inline-end: 48px; }
.voice-how { margin: 8px 0 14px; line-height: 1.5; }
/* Таблица «Скажите — Куда ведёт» */
.voice-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.voice-table thead th { text-align: start; padding: 8px 10px; border-bottom: 2px solid var(--line); font-weight: 700; }
.voice-table tbody th { text-align: start; padding: 16px 10px 6px; color: var(--muted); font-size: 14px; font-weight: 600; }
.voice-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.voice-table td:first-child { width: 55%; }
.rows .row-buttons { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
/* Кто в сети — зелёная точка у имени, как в таблицах программы */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 6px;
  background: var(--line); vertical-align: middle; }
.dot.on { background: #2fb344; }
.pick { margin: 12px 0 0; }
.pick input, .profile input, .profile textarea,
.person-form input:not([type=checkbox]):not([type=file]), .person-form select, .person-form textarea,
.inline input, .fe-search, #users-search {
  width: 100%; padding: 10px 12px; border-radius: 10px; font: inherit;
  border: 1px solid var(--line); background: var(--field); color: var(--text);
}
.profile { display: grid; gap: 4px; max-width: 560px; }
.profile label { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.profile .btn { margin-top: 14px; justify-self: start; }
.facts { color: var(--muted); font-size: 14px; margin: 6px 0 4px; }

/* ------------------------------ ВАС ЗОВУТ ------------------------------ */
.call {
  position: fixed; inset-inline: 16px; top: 16px; margin: 0 auto; max-width: 440px; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px;
  background: var(--card); border: 2px solid var(--accent); border-radius: 18px;
  box-shadow: 0 12px 40px #0006; backdrop-filter: blur(8px);
}
.call img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; background: var(--line); }
.call p { flex: 1; min-width: 180px; margin: 0; font-size: 18px; font-weight: 600; }
.call-buttons { display: flex; gap: 8px; width: 100%; }
.call-buttons .btn { flex: 1; }
/* «Не могу говорить» в окне вызова — отказ с сообщением звавшему (05.10.2026) */
.call-cant { width: 100%; }

/* ------------------------------ СООБЩЕНИЯ (05.10.2026) ------------------------------ */
/* Пришло сообщение: лицо, «Сообщение от …», текст крупно */
.msg-pop p.msg-pop-from { font-size: 15px; font-weight: 600; }
.msg-pop p.msg-pop-text { flex-basis: 100%; font-size: 20px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.msg-pop a { color: var(--accent); }
/* Окно «Написать» */
#msg-sheet { z-index: 45; }
#msg-sheet h2 { padding-inline-end: 48px; }
.msg-hint { color: var(--muted); margin: 4px 0 10px; }
.msg-chips { margin-bottom: 12px; }
#msg-text { width: 100%; box-sizing: border-box; font-size: 17px; padding: 10px 12px; resize: vertical; }
.msg-buttons { display: flex; gap: 8px; margin-top: 10px; }
.msg-buttons .btn { flex: 1; }
/* Счётчик непрочитанных на плитке «Сообщения» */
.m-count { position: absolute; top: 8px; inset-inline-end: 10px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; background: #d93025; color: #fff; font-size: 13px; font-weight: 700; line-height: 22px; text-align: center; }
/* Страница «Сообщения» */
.rows .who .m-text { display: block; color: var(--text); font-size: 16px; margin: 2px 0; overflow-wrap: anywhere; white-space: normal; }
.rows .who .m-meta { display: block; font-size: 13px; }
.rows .who .m-text a { color: var(--accent); font-weight: 600; }
.rows li.m-new { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
/* Переписка, как WhatsApp (05.10.2026): собеседники и пузыри */
.rows li.chat-row { cursor: pointer; }
.rows li.chat-row:hover { border-color: var(--accent); }
.rows .who .m-last { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.chat-unread { min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: #25a244; color: #fff;
  font-weight: 700; font-size: 14px; line-height: 26px; text-align: center; }
.chat-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.chat-head img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--line); }
.chat-head b { font-size: 18px; }
.chat-head .grow { flex: 1; }
.chat-head .c-back { font-size: 24px !important; line-height: 1 !important; min-width: 48px; padding: 6px 12px !important; }
.chat-head .c-me { color: var(--muted); font-weight: 600; text-align: end; }
@media (max-width: 560px) { .chat-head .c-me { display: none; } }
.bubbles { height: min(60vh, 560px); overflow-y: auto; padding: 12px 4px; display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 78%; padding: 8px 12px 6px; border-radius: 14px; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.bubble.theirs { align-self: flex-start; background: var(--field); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.mine { align-self: flex-end; background: color-mix(in srgb, var(--accent) 22%, var(--card)); border-bottom-right-radius: 4px; }
.bubble a { color: var(--accent); font-weight: 600; }
.bubble-meta { font-size: 12px; color: var(--muted); text-align: end; margin-top: 2px; }
.bubble-day { align-self: center; font-size: 12px; color: var(--muted); background: var(--field); border-radius: 8px; padding: 2px 10px; margin: 6px 0; }
.composer { border-top: 1px solid var(--line); padding-top: 10px; }
#c-text { width: 100%; box-sizing: border-box; font-size: 17px; padding: 10px 12px; resize: vertical; }
.composer-buttons { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.composer-buttons #c-send { margin-inline-start: auto; min-width: 140px; }
#c-chips { max-height: 30vh; overflow-y: auto; margin: 8px 0; }
/* Учитель «без входа» и карточка человека (06.10.2026) */
.person-new { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 10px; }
.person-new h3 { font-size: 16px; margin: 0 0 8px; }
.person-new input { width: 100%; box-sizing: border-box; margin-bottom: 8px; }
.pn-years { display: flex; gap: 8px; }
.pn-years input { flex: 1; min-width: 0; }
.rows .who b.person-link { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.rows .who b.person-link:hover { color: var(--accent); }
#person { z-index: 45; }
#person .sheet-body { max-width: 760px; }
.pc-head { display: flex; gap: 14px; align-items: center; padding-inline-end: 48px; }
.pc-head img { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; background: var(--line); }
.pc-head h2 { margin: 0; }
.pc-life { margin: 4px 0 0; color: var(--muted); }
#pc-body h3 { font-size: 15px; color: var(--muted); margin: 18px 0 6px; font-weight: 600; }
/* «Сегодня день рождения» на главной */
.bday { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin: 10px 0 0; padding: 10px 14px; border: 1px solid var(--accent); border-radius: 14px; background: var(--field); }

/* ------------------------------ МУЗЫКА (часть 3) ------------------------------ */
.panel-head select {
  border: 1px solid var(--line); background: var(--field); color: var(--text);
  border-radius: 10px; padding: 8px 10px; font: inherit; max-width: 60%;
}
.search {
  width: 100%; margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; font: inherit;
  border: 1px solid var(--line); background: var(--field); color: var(--text);
}
.rows li.track { cursor: pointer; }
.rows li.track.playing { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.heart { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.heart.on { color: #d9849a; }
.soon { color: var(--muted); font-size: 14px; }

.player {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 9; padding: 10px 16px 12px;
  background: var(--card); border-top: 1px solid var(--line); backdrop-filter: blur(8px);
}
.player-top, .player-bottom { max-width: 980px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.player-bottom { margin-top: 6px; }
.player button {
  border: 1px solid var(--line); background: var(--field); color: var(--text);
  border-radius: 999px; width: 42px; height: 42px; font-size: 18px; cursor: pointer; flex: none;
}
.player .now { flex: 1; min-width: 0; }
.player .now b, .player .now span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .now span { color: var(--muted); font-size: 14px; }
#p-seek { flex: 1; accent-color: var(--accent); }
#p-volume { width: 90px; accent-color: var(--accent); }
.player-bottom span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
body.has-player main { padding-bottom: 130px; }

/* --------------------------- РОДОСЛОВНАЯ (часть 4) --------------------------- */
.tree ul { list-style: none; margin: 0; padding-inline-start: 22px; border-inline-start: 1px dashed var(--line); }
.tree > ul { padding-inline-start: 0; border: 0; }
.tree li { margin: 6px 0; }
.node { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.node img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: var(--line); }
.node button.person {
  border: 0; background: none; color: var(--text); font: inherit; font-weight: 600;
  cursor: pointer; padding: 2px 0; text-align: start;
}
.node button.person:hover { color: var(--accent); }
.node .years, .node .spouse, .node .elsewhere { color: var(--muted); font-size: 14px; }
.node .spouse button.person { font-weight: 500; }
.node.found button.person { background: #ffe58f; color: #222; border-radius: 6px; padding: 2px 6px; }

.sheet {
  position: fixed; inset: 0; z-index: 11; background: #0008;
  display: flex; align-items: flex-start; justify-content: center; overflow: auto; padding: 24px 12px;
}
.sheet-body { position: relative; width: 100%; max-width: 640px; }
.close {
  position: absolute; inset-inline-end: 12px; top: 12px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--field); color: var(--text); font-size: 18px; cursor: pointer;
}
#card-kin h3 { font-size: 15px; color: var(--muted); margin: 16px 0 6px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  border: 1px solid var(--line); background: var(--field); color: var(--text);
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 15px; cursor: pointer;
}
.chips button:hover { border-color: var(--accent); }
#card-note { white-space: pre-wrap; }

/* ------------------------------ ШАХМАТЫ (часть 5) ------------------------------ */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line); background: var(--field); color: var(--text);
  border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 15px; cursor: pointer;
}
.tab.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.chess-wrap { display: flex; flex-wrap: wrap; gap: 18px; margin: 14px 0 0; align-items: flex-start; }
/* Доска — квадрат по ширине: на телефоне во всю ширину, на компьютере не больше 560 */
.board {
  width: min(100%, 560px); aspect-ratio: 1; display: grid;
  grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
  border-radius: 8px; overflow: hidden; user-select: none; touch-action: manipulation;
}
/* min-height 0 и фигура поверх клетки: иначе ряды сетки подстраивались под
   картинку фигуры и выходили разной высоты, нижний ряд срезало (29.09.2026) */
.sq { position: relative; min-width: 0; min-height: 0; overflow: hidden; cursor: pointer; }
.sq.l { background: #ede6d1; }
.sq.d { background: #739366; }
.sq.chosen { background: #f2d14c; }
.sq.last { box-shadow: inset 0 0 0 100vmax #f5e36a55; }
.sq img { position: absolute; inset: 3%; width: 94%; height: 94%; object-fit: contain; pointer-events: none; }
/* Куда можно пойти — точка, что можно взять — кольцо (как в программе, 27.09.2026) */
.sq.move::after { content: ""; position: absolute; inset: 34%; border-radius: 50%; background: #1419205a; }
.sq.take::after { content: ""; position: absolute; inset: 4%; border-radius: 50%; border: 5px solid #1419205a; }
.sq .coord { position: absolute; font-size: 11px; color: #0008; inset-inline-start: 3px; bottom: 1px; pointer-events: none; }
.chess-side { flex: 1; min-width: 240px; }
.chess-status { font-size: 18px; font-weight: 700; margin: 0; min-height: 1.5em; }
.chess-status.good { color: var(--accent); }
.c-mode label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0 0; }
.c-mode select { display: block; margin-top: 4px; padding: 8px 10px; border-radius: 10px; font: inherit;
  border: 1px solid var(--line); background: var(--field); color: var(--text); }
.c-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }

/* ----------------------- ОТДЕЛЬНЫЕ СТРАНИЦЫ (29.09.2026) ----------------------- */
.bar .grow { flex: 1; }
.bar a.back { text-decoration: none; }
.page-title { font-size: 22px; margin: 0; }
section#page > .card + .card { margin-top: 16px; }

/* Ошибка у поля формы: красная рамка и надпись под полем */
input.bad, textarea.bad { border-color: var(--warn) !important; box-shadow: 0 0 0 2px color-mix(in srgb, var(--warn) 35%, transparent); }
.field-msg { color: var(--warn); font-size: 14px; margin: 4px 0 0; }

/* ------------------------ УЗКИЙ ЭКРАН ТЕЛЕФОНА (29.09.2026) ------------------------ */
/* Рустам, снимок «Мои знакомые и друзья»: «помельче сделай, чтобы всё
   вмещалось» — имя обрезалось до «S…», «✕» уезжал за край. На телефоне
   всё компактнее, а не влезла строка — кнопки уходят под имя, имя целиком */
@media (max-width: 560px) {
  body { font-size: 15px; }
  main { padding: 10px 10px 32px; }
  .card { padding: 12px; border-radius: 14px; }
  .bar { gap: 6px; }
  .bar select, .bar button, .bar a.back { padding: 5px 10px; font-size: 13px; }
  .page-title, .panel h2 { font-size: 18px; }
  .btn { padding: 10px 14px; font-size: 15px; }
  .btn.small { padding: 6px 10px; font-size: 13px; border-radius: 10px; }
  .rows { gap: 6px; }
  .rows li { flex-wrap: wrap; gap: 8px; padding: 7px 8px; }
  .rows img { width: 36px; height: 36px; }
  .rows .who { flex: 1 1 0; min-width: 0; }
  /* Имя — всей ширине строки, слова не рвутся; кнопки — строкой ниже */
  .rows .who b { white-space: normal; overflow-wrap: break-word; font-size: 15px; }
  .rows .who span { font-size: 13px; white-space: normal; }
  .rows .row-buttons { flex-basis: 100%; justify-content: flex-end; }
  .panel-head { gap: 8px; }
  .tabs { gap: 4px; }
  .tab { padding: 5px 10px; font-size: 13px; }
  .hello { font-size: 20px; margin: 8px 0 12px; }
  .me img { width: 96px; height: 96px; }
  .actions { grid-template-columns: 1fr 1fr; gap: 8px; }
  .actions .btn { padding: 10px 8px; font-size: 14px; }
  .call { inset-inline: 8px; padding: 12px; }
  .call p { font-size: 16px; }
}

/* -------------------- НИЗКИЙ ЭКРАН: ТЕЛЕФОН ЛЁЖА (30.09.2026) -------------------- */
/* Снимок шахмат с телефона лёжа: шапка и вкладки занимали всю высоту, до
   доски дело не доходило. Низкий экран — всё компактно, как на узком */
@media (max-height: 500px) and (orientation: landscape) {
  body { font-size: 14px; }
  main { padding: 6px 10px 20px; }
  .card { padding: 10px; border-radius: 12px; }
  .bar { gap: 6px; margin-bottom: 4px; }
  .bar select, .bar button, .bar a.back { padding: 3px 10px; font-size: 13px; }
  .page-title, .panel h2 { font-size: 16px; }
  .panel-head { gap: 6px; }
  .tabs { gap: 4px; }
  .tab { padding: 3px 10px; font-size: 13px; }
  .btn { padding: 8px 12px; font-size: 14px; }
  .btn.small { padding: 5px 9px; font-size: 13px; }
  .rows li { padding: 6px 8px; }
  .rows img { width: 34px; height: 34px; }
  .call { top: 6px; padding: 10px; }
}

/* «Досуг»: большие плитки-кнопки (30.09.2026) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-top: 16px; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  aspect-ratio: 4 / 3; border-radius: 18px; text-decoration: none; color: var(--text);
  background: var(--field); border: 1px solid var(--line); box-shadow: 0 4px 16px #0002;
  transition: transform .12s, border-color .12s;
}
.tile:hover, .tile:focus-visible { transform: translateY(-2px); border-color: var(--accent); }
.tile-icon { font-size: 56px; line-height: 1; }
.tile b { font-size: 20px; }
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr 1fr; gap: 10px; } .tile-icon { font-size: 44px; } .tile b { font-size: 16px; } }

/* ---------- ГЛАВНАЯ БЕЗ ФОТО, «МОЙ ПРОФИЛЬ» ОТДЕЛЬНО (30.09.2026) ----------
   Рустам: «открой отдельную страницу мой профиль и туда эту фотографию… и
   всё в экран уместится». Кнопки — сразу под приветствием; слова в них
   переносятся по слогам, а не рвутся посреди («однокашни/ки») */
.actions { margin-top: 0; }
.actions .btn { overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; line-height: 1.25; }
.profile .me { margin: 10px 0 4px; }
.profile .me img { width: 140px; height: 140px; }
.profile .me .btn { margin: 0; font-size: 15px; color: var(--accent); }
.file-btn { cursor: pointer; }
#in-msg:empty { display: none; }
@media (max-width: 560px) {
  #in .hello { margin: 4px 0 10px; }
  #in .card { padding: 12px; }
  .actions .btn { min-height: 56px; padding: 8px 6px; }
  .counts { margin-top: 14px; }
  .profile .me { gap: 12px; }
  .profile .me img { width: 112px; height: 112px; }
}

/* ------- «Родословная»: меню разделов, правка, живые родственники (30.09.2026) ------- */
.menu-list { display: grid; gap: 12px; margin-top: 14px; max-width: 640px; }
.menu-item {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--field); color: var(--text); text-decoration: none;
  transition: border-color .12s, transform .12s;
}
.menu-item:hover, .menu-item:focus-visible { border-color: var(--accent); transform: translateY(-1px); }
.menu-item .tile-icon { font-size: 34px; width: 44px; text-align: center; flex: none; }
.menu-item b { display: block; font-size: 17px; }
.menu-item small { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }

.fe-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.fe-col { display: grid; gap: 16px; min-width: 0; }
.rod-list { display: grid; gap: 8px; margin: 10px 0; }
.rod-list button {
  text-align: start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--field); color: var(--text); cursor: pointer; font: inherit;
}
.rod-list button small { display: block; color: var(--muted); font-size: 13px; }
.rod-list button.on { border: 2px solid var(--accent); }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.inline input { flex: 1; min-width: 140px; }
.fe-tree { max-height: 50vh; overflow: auto; margin-top: 8px; }
.node.chosen button.person { outline: 2px solid var(--accent); border-radius: 6px; }
.person-form { display: grid; grid-template-columns: 150px 1fr 1fr; gap: 8px 12px; align-items: start; }
.person-form .ph { grid-row: span 4; display: grid; gap: 6px; justify-items: start; }
.person-form .ph img { width: 150px; height: 150px; object-fit: cover; border-radius: 14px; background: var(--line); }
.person-form label { display: grid; gap: 3px; font-size: 14px; color: var(--muted); }
.person-form .wide2 { grid-column: span 2; }
.person-form .all { grid-column: 1 / -1; }
.person-form input, .person-form select, .person-form textarea { width: 100%; }
.seg { display: inline-flex; gap: 4px; }
.seg button { min-width: 44px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); color: var(--text); cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.person-form label.check { display: flex; align-items: center; gap: 8px; align-self: end; padding-bottom: 10px; color: var(--text); }
.person-form label.check input { width: auto; }
.person-form input:disabled, .person-form select:disabled, .person-form textarea:disabled { opacity: .75; }
.person-form > .btn { align-self: end; }

.living { width: 100%; border-collapse: collapse; margin-top: 10px; }
.living th { text-align: start; font-size: 13px; color: var(--muted); font-weight: 600; padding: 6px 8px; }
.living td { padding: 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.living tr.on td { background: color-mix(in srgb, #2fb344 12%, transparent); }
.living img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--line); display: block; }
.living .who { font-weight: 600; }
.living .num { font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 800px) {
  .fe-layout { grid-template-columns: 1fr; }
  .person-form { grid-template-columns: 1fr 1fr; }
  .person-form .ph { grid-row: auto; grid-column: 1 / -1; grid-template-columns: 110px 1fr; align-items: center; }
  .person-form .ph img { width: 110px; height: 110px; grid-row: span 3; }
  .person-form .wide2 { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .menu-item { padding: 12px; gap: 12px; }
  .menu-item .tile-icon { font-size: 28px; width: 34px; }
  .living thead { display: none; }
  .living tr { display: grid; grid-template-columns: 44px 1fr auto; gap: 2px 10px; padding: 8px 0; border-top: 1px solid var(--line); }
  .living td { border: 0; padding: 0; }
  .living td.pic { grid-row: span 3; }
  .living td.act { grid-row: span 3; grid-column: 3; grid-row-start: 1; align-self: center; }
  .living td.who, .living td.rel, .living td.num { grid-column: 2; }
  .living td.rel, .living td.num { font-size: 13px; color: var(--muted); text-align: start; }
}

/* -------- «Мои учителя и однокашники» — как окно программы (30.09.2026) -------- */
.sch-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.sch-form { display: grid; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.sch-form h3 { margin: 0; font-size: 16px; }
.sch-form .btn[type=submit] { justify-self: start; }
.sch-form select { padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); color: var(--text); font: inherit; }
.inline input.year { flex: 0 0 96px; min-width: 0; }
.rows li.tip { color: var(--muted); font-size: 14px; border-style: dashed; }
.rows li.note { color: var(--muted); font-size: 14px; }
.rows .who span.info { display: block; font-size: 13px; color: var(--muted); white-space: normal; }
@media (max-width: 900px) { .sch-layout { grid-template-columns: 1fr; } }
/* Колонки не шире экрана: иначе поле с кнопкой в строке распирали карточку */
.sch-layout > *, .fe-layout > * { min-width: 0; }
.inline select { min-width: 0; max-width: 100%; }
@media (max-width: 560px) { .inline input { min-width: 0; flex-basis: 100%; } .inline input.year { flex: 1 1 40%; } }
.sch-layout .rows .who b { white-space: normal; overflow-wrap: break-word; }
.sch-form > * { min-width: 0; }
.seg { flex-wrap: wrap; }

/* ---------- Шестерёнка: язык, день/ночь, фон — как на сайте (30.09.2026) ---------- */
.gear-wrap { position: relative; }
.bar button.gear {
  width: 40px; height: 40px; padding: 0; border-radius: 12px; display: grid; place-items: center;
}
.gear-menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 50; min-width: 240px;
  display: grid; gap: 2px; padding: 8px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); box-shadow: 0 12px 32px #0006;
  backdrop-filter: blur(10px);
}
.bar .gear-menu .gear-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: start;
  padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text);
  font: inherit; font-size: 16px; cursor: pointer;
}
.bar .gear-menu .gear-item:hover { background: var(--field); }
.gear-icon { width: 24px; text-align: center; font-size: 18px; }
.bar .gear-menu select {
  flex: 1; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px;
  padding: 0; border-radius: 0; cursor: pointer;
}
.bar .gear-menu select option { background: var(--card); color: var(--text); }
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 12px; }
.bg-grid button {
  aspect-ratio: 16 / 10; padding: 0; border: 2px solid var(--line); border-radius: 10px; overflow: hidden;
  background: var(--field); color: var(--text); cursor: pointer; font: inherit; font-size: 14px;
}
.bg-grid button.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.bg-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
#bg-sheet .sheet-body { max-width: 760px; max-height: 85vh; overflow: auto; }
@media (max-width: 560px) { .bar button.gear { width: 36px; height: 36px; } .bg-grid { grid-template-columns: repeat(3, 1fr); } }
/* Строка списка не шире экрана: длинное имя в одну строку распирало список */
.rows { grid-template-columns: minmax(0, 1fr); }
.rows > li { min-width: 0; }
.bar .gear-menu #theme { gap: 12px; }

/* ------- Главная: без приветствия, ровные столбцы кнопок (30.09.2026) -------
   На телефоне с крупным шрифтом правый столбец сжимался в «Ви-део-связь»:
   столбцы — строго поровну, ряды — одной высоты, шрифт мельче */
.actions { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-auto-rows: 1fr; }
.actions .btn { font-size: 15px; hyphens: manual; -webkit-hyphens: manual; }
.me-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 60%;
  padding: 3px 12px 3px 3px !important; border-radius: 999px;
}
.me-chip img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--line); flex: none; }
.me-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14px; }
#in .card { margin-top: 10px; }
@media (max-width: 560px) {
  .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .actions .btn { font-size: 13px; padding: 8px 6px; min-height: 52px; line-height: 1.2; }
  .me-chip span { font-size: 13px; }
}
.actions .btn.wide-row { grid-column: 1 / -1; }

/* «Досуг» мельче (Рустам, 30.09.2026: «размер кнопок и шрифт помельче»): при
   крупном шрифте телефона вторая плитка уезжала за край — столбцы поровну */
.tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { aspect-ratio: auto; padding: 18px 10px; gap: 6px; min-width: 0; }
.tile-icon { font-size: 40px; }
.tile b { font-size: 16px; text-align: center; overflow-wrap: break-word; max-width: 100%; }
@media (max-width: 560px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
  .tile { padding: 12px 6px; border-radius: 14px; }
  .tile-icon { font-size: 30px; }
  .tile b { font-size: 14px; }
}
/* «Лёжа» — только когда экран и правда лежит (orientation: landscape).
   С крупным масштабом страницы в телефоне стоя (Рустам, 30.09.2026) экран
   для страницы ~220×490 точек — «ниже 500» срабатывало стоя, и шахматы
   раскладывались как лёжа: буквы кнопок падали по одной */
/* Очень узкий экран (крупный масштаб страницы в телефоне): подписи кнопок
   главной — мельче и с переносом по слогам, чтобы не вылезали из кнопки */
@media (max-width: 300px) {
  .actions .btn { font-size: 12px; padding: 6px 4px; overflow-wrap: anywhere; hyphens: auto; -webkit-hyphens: auto; }
  .actions .site-link { font-size: 11px; }
}

/* ---------- Очень узкий экран (крупный масштаб, ~220 точек; 01.10.2026) ---------- */
/* Меню родословной: подпись переносится, а не распирает карточку */
.menu-item { min-width: 0; }
.menu-item > span:last-child { flex: 1; min-width: 0; }
.menu-item b, .menu-item small { overflow-wrap: anywhere; }
/* Правка родословной: столбец не шире экрана */
.fe-col { grid-template-columns: minmax(0, 1fr); }
.fe-col > * { min-width: 0; }
#tree-title { overflow-wrap: anywhere; min-width: 0; }
/* Дерево: длинные имена переносятся */
.node { max-width: 100%; }
.node button.person { white-space: normal; overflow-wrap: anywhere; text-align: start; }
/* Таблица живых: строка по ширине экрана */
@media (max-width: 560px) {
  .living, .living tbody { display: block; width: 100%; }
  .living tr { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .living img { width: 40px; height: 40px; }
  .living td.who { overflow-wrap: anywhere; }
}
@media (max-width: 300px) {
  .menu-item { padding: 10px; gap: 10px; }
  .menu-item .tile-icon { font-size: 22px; width: 26px; }
  .menu-item b { font-size: 15px; }
  .tree ul { padding-inline-start: 12px; }
  .living tr { grid-template-columns: 32px minmax(0, 1fr); }
  .living img { width: 32px; height: 32px; }
  .living td.act { grid-column: 2; grid-row: auto; }
  .card { padding: 12px; }
  main { padding-inline: 10px; }
}
/* Слова в кнопках — целиком: шрифт чуть мельче, рвать слово только если
   оно всё равно не лезет */
@media (max-width: 300px) {
  .actions { gap: 6px; }
  .actions .btn { font-size: 11px; padding: 6px 3px; overflow-wrap: break-word; line-height: 1.2; }
  .actions .site-link { font-size: 10.5px; }
  .menu-item b { font-size: 13.5px; overflow-wrap: break-word; }
}

/* Меню шахмат: пять плиток, последняя («Партии чемпионов мира») — во всю ширину */
.chess-tiles .wide-tile { grid-column: 1 / -1; }
.chess-tiles .tile b { text-align: center; }
/* Не видно глазам, но читают программы чтения с экрана */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- «Знакомство с IlmNur» для гостя (01.10.2026) ---------- */
.tour-head { display: flex; gap: 16px; align-items: center; }
.tour-head .facts { margin: 6px 0 0; font-size: 15px; line-height: 1.5; }
.tour-logo { width: 72px; height: auto; flex: none; }
.tour-sub { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin: 22px 4px 10px; }
.tour-open { border-color: var(--accent); }
.tour-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.menu-item.locked { opacity: .85; cursor: default; }
.menu-item.locked:hover { transform: none; border-color: var(--line); }
.menu-item.locked b::after { content: " 🔒"; font-size: .8em; }
.tour-register { display: block; text-align: center; margin: 22px auto 0; max-width: 420px; font-size: 17px; padding: 14px; }
/* Плашка гостя на страницах шахмат: «Зарегистрироваться» */
.guest-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between;
  margin: 0 0 10px; padding: 10px 14px; border-radius: 14px; border: 1px dashed var(--accent); background: var(--card); }
.guest-bar span { color: var(--muted); font-size: 14px; }
@media (max-width: 560px) {
  .tour-head { flex-direction: column; align-items: flex-start; }
  .tour-grid { grid-template-columns: 1fr; }
}
.tour-link { margin-top: 14px; background: transparent; color: var(--accent); border: 1px solid var(--accent); }
@media (max-width: 560px) {
  .guest-bar { padding: 6px 10px; gap: 8px; flex-wrap: nowrap; }
  .guest-bar span { font-size: 12px; line-height: 1.3; }
  .guest-bar .btn { flex: none; padding: 6px 10px; font-size: 12px; }
}
.tour-open + .tour-open { margin-top: 10px; }
/* Плашка гостя на узком экране: текст сверху, «Зарегистрироваться» — во всю ширину */
@media (max-width: 420px) {
  .guest-bar { flex-direction: column; align-items: stretch; flex-wrap: wrap; }
  .guest-bar .btn { width: 100%; text-align: center; padding: 8px; font-size: 13px; }
  .guest-bar span { font-size: 13px; }
}

/* «Сказать, куда перейти»: слушаем — кнопка горит */
.actions .btn.voice-go.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Правка родословной — во всю ширину экрана, дерево — во всю высоту
   (Рустам, 04.10.2026: «экран пошире»; дерево в узкой колонке не помещалось) */
main.wide { max-width: 1600px; }
/* Учителя и однокашники во всю ширину: справа люди с кнопками — им места больше */
@media (min-width: 901px) { main.wide .sch-layout { grid-template-columns: 1fr 1.35fr; } }
@media (min-width: 801px) {
  main.wide .fe-layout { grid-template-columns: 300px 1fr; }
  main.wide .fe-tree { max-height: calc(100vh - 300px); min-height: 50vh; }
}

/* Логотип на главном экране после входа — чуть меньше, чем на входе */
.logo-in { width: 120px; margin: 8px auto 16px; }
@media (max-width: 600px) { .logo-in { width: 90px; } }

/* «Играть под нейтральным флагом» в «Моём профиле» (06.10.2026) */
#profile label.check { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; color: var(--text); }
#profile label.check input { width: auto; margin: 0; }

/* «Сообщения» на широком экране — как Telegram (09.10.2026): слева
   собеседники, справа переписка, во всю высоту окна */
@media (min-width: 900px) {
  body.messages-page main { max-width: 1400px; }
  .messenger { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 12px;
               height: calc(100vh - 96px); }
  .messenger > .card { margin: 0; min-height: 0; overflow: hidden; }
  .messenger #chats { overflow-y: auto; }
  .messenger #chat { display: flex; flex-direction: column; }
  .messenger #chat[hidden], .messenger #c-empty[hidden] { display: none; }
  .messenger .bubbles { height: auto; flex: 1; min-height: 0; }
  .messenger .c-back { display: none; }
  .chat-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); }
  .rows li.chat-row.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--card)); }
}

/* Фон переписки — как в Telegram (Рустам, 09.10.2026: «фон можем ли
   улучшить?»): мягкая заливка и тонкий узор — книги, ноты, шахматы, перо,
   звёзды. Пузыри на нём — светлые, свои — зеленоватые */
.bubbles {
  border-radius: 12px;
  background: url("/web/img/chat_pattern_light.svg?v=1") repeat,
              linear-gradient(135deg, #d4e6a9 0%, #9fcf9c 45%, #cfe4b0 100%);
}
.bubble.theirs { background: #ffffff; color: #1b1f1a; border: none; box-shadow: 0 1px 1px rgba(0,0,0,.12); }
.bubble.mine { background: #e1f7cb; color: #1b1f1a; box-shadow: 0 1px 1px rgba(0,0,0,.12); }
.bubble a { color: #2a7d3b; }
.bubble .bubble-meta { color: #6b7a68; }
.bubble.mine .bubble-meta { color: #4c8a4f; }
.bubble-day { background: rgba(40, 70, 45, .45); color: #fff; }
body[data-theme="dark"] .bubbles {
  background: url("/web/img/chat_pattern_dark.svg?v=1") repeat,
              linear-gradient(135deg, #1d3326 0%, #13231a 50%, #22392a 100%);
}
body[data-theme="dark"] .bubble.theirs { background: #222b25; color: #e6ece4; }
body[data-theme="dark"] .bubble.mine { background: #2d5c3c; color: #eef6ea; }
body[data-theme="dark"] .bubble a { color: #9be7a5; }
body[data-theme="dark"] .bubble .bubble-meta { color: #9fb39c; }
body[data-theme="dark"] .bubble.mine .bubble-meta { color: #a8d8a8; }
@media (prefers-color-scheme: dark) {
  body:not([data-theme]) .bubbles {
    background: url("/web/img/chat_pattern_dark.svg?v=1") repeat,
                linear-gradient(135deg, #1d3326 0%, #13231a 50%, #22392a 100%);
  }
  body:not([data-theme]) .bubble.theirs { background: #222b25; color: #e6ece4; }
  body:not([data-theme]) .bubble.mine { background: #2d5c3c; color: #eef6ea; }
  body:not([data-theme]) .bubble a { color: #9be7a5; }
  body:not([data-theme]) .bubble .bubble-meta { color: #9fb39c; }
}
/* Галочки: одна серая — доставлено, две голубые — прочитано (09.10.2026) */
.bubble-meta .tick { font-size: 15px; font-weight: 700; letter-spacing: -3px; margin-inline-start: 4px; color: #8a9590; }
.bubble-meta .tick.read { color: #2f9fd6; }
body[data-theme="dark"] .bubble-meta .tick.read { color: #53bdeb; }

/* Удаление сообщений (09.10.2026): отмеченный пузырь — с рамкой и галочкой,
   сверху полоса «Отмечено: N · Удалить», подтверждение — окном */
.bubble { cursor: pointer; position: relative; }
.bubble.picked { outline: 3px solid #2f9fd6; outline-offset: 2px; }
.bubble.picked::before { content: "✓"; position: absolute; top: -10px; inset-inline-start: -10px; width: 22px; height: 22px;
  border-radius: 50%; background: #2f9fd6; color: #fff; font-size: 14px; font-weight: 700; display: grid; place-items: center; }
.select-bar { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.select-bar[hidden] { display: none; }
.select-bar .grow { flex: 1; }
.btn.danger { background: #c62828 !important; color: #fff !important; border-color: #c62828 !important; }
.del-dialog { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 60; padding: 16px; }
.del-dialog[hidden] { display: none; }
.del-dialog .card { max-width: 420px; width: 100%; }
.del-buttons { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

/* Значки «свои» в верхней строке «Сообщений» (10.10.2026) */
.bar-people { display: flex; gap: 6px; margin-inline-start: 12px; }
.icon-link { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 18%, transparent); }
.icon-link:hover, .icon-link:focus-visible { background: color-mix(in srgb, var(--accent) 34%, transparent); }
.icon-link .ic { width: 24px; height: 24px; background: var(--accent);
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.icon-link { border: none; cursor: pointer; padding: 0; }
.icon-link.on { background: var(--accent); }
.icon-link.on .ic { background: var(--bg, #111); }
/* Видеозвонок в «Сообщениях» — зелёный, как «в сети» (10.10.2026) */
.icon-link.call-now { background: #2e9e4a; margin-inline-end: 8px; }
.icon-link.call-now .ic { background: #fff; }
.icon-link[hidden] { display: none; }

/* Разговор с видео в «Сообщениях» — сверху над перепиской (10.10.2026) */
.talk-box { position: relative; height: 46vh; min-height: 260px; margin: 6px 0; border-radius: 12px; overflow: hidden; background: #000; flex: none; }
.talk-box[hidden] { display: none; }
.talk-box iframe { width: 100%; height: 100%; border: 0; display: block; }
.talk-buttons { position: absolute; top: 8px; inset-inline-end: 8px; display: flex; gap: 6px; z-index: 2; }
.talk-big { background: rgba(10, 13, 14, .75); color: #fff; border: 1px solid rgba(255,255,255,.35); }
@media (max-width: 899px) { .talk-box { height: 38vh; } }
.icon-link.call-now.away { background: #5f6b62; }
/* Идёт разговор над перепиской — на телефоне переписка ниже и короче, чтобы
   поле для сообщения оставалось на экране (10.10.2026) */
@media (max-width: 899px) {
  #chat.talking .bubbles { height: 24vh; }
  #chat.talking .talk-box { height: 40vh; }
}
/* Верхняя строка «Сообщений» на узком телефоне — в одну строку (10.10.2026) */
@media (max-width: 480px) {
  body.messages-page .bar { flex-wrap: nowrap; gap: 4px; }
  .bar-people { gap: 4px; margin-inline-start: 4px; }
  .icon-link { width: 38px; height: 38px; }
  .icon-link .ic { width: 20px; height: 20px; }
}


/* Логотип вместо стрелки и слова IlmNur; «Выйти» — у шестерёнки, красноватым (11.10.2026) */
.bar-logo { width: 54px; height: auto; display: block; }
.icon-link.logout .ic { background: #e57373; }
.icon-link.logout:hover, .icon-link.logout:focus-visible { background: color-mix(in srgb, #e57373 30%, transparent); }
@media (max-width: 480px) { .bar-logo { width: 38px; } }
/* Долгое нажатие на сообщение — отметить для удаления (11.10.2026): на телефоне
   не выделять текст и не открывать меню ссылки */
@media (pointer: coarse) { .bubble { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; } }

/* «Увеличить» разговор (11.10.2026): окно — почти весь экран, под ним
   несколько последних сообщений и поле. На телефоне прячем верхнюю строку
   значков — она вернётся с «Уменьшить» */
#chat.talking.talk-large .talk-box { height: 68vh; }
#chat.talking.talk-large .bubbles { height: 14vh; min-height: 0; }
@media (max-width: 899px) {
  body.talk-large .bar { display: none; }
  #chat.talking.talk-large .talk-box { height: 60vh; }
  #chat.talking.talk-large .bubbles { height: 12vh; }
}

/* «Сообщения»: кем приходится — под именем, цветом темы (11.10.2026) */
.rows .who .m-rel { display: block; color: var(--accent); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Наследник рода (11.10.2026) */
.heir-field { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.heir-field select { width: 100%; }
.heir-next { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
