/* Оформление видеовстреч. Цвета взяты у портала (палитра «Стандарт»): тёплый светлый фон и тёплый почти чёрный в
   тёмной теме, фирменный зелёный. У каждого цвета своя работа:
     зелёный   главное действие, ссылки и всё «живое»: кто говорит, непрочитанное, включённое;
     красный   выключено и опасно: микрофон или камера выключены, выход, ошибка;
     янтарный  просит внимания: поднятая рука, предупреждение о связи;
     нейтральные  фон, панели, текст.
   У каждого участника свой флаг (два цвета и рисунок из имени): по нему человека узнают в окне без видео, в списке
   и в чате. Шрифт тот же, что у портала: Golos Text.
   Светлая тема основная, тёмная включается переключателем. Страница рассчитана на слабые машины и старый Chrome:
   без размытия, без движущихся украшений (кроме шара-аватарки и фона главной страницы: их рисует только видеокарта),
   без новых приёмов CSS (цвета заданы готовыми значениями, без смешивания на лету). Все цвета заданы именами ниже. */
@font-face {
  font-family: "Golos Text";
  src: url("golos.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
:root {
  color-scheme: light;
  --bg: #f5f3ef; --surface: #fbfaf8; --field: #fdfcfa; --hover: #ece9e3;
  --ink: #1a1714; --muted: #473f37; --placeholder: #766d5f; --line: #e2ded6; --line-strong: #c4bdb1;
  /* панели страницы (шапка встречи и панель кнопок) нейтральные, как у портала */
  --shell: #fbfaf8; --on-shell: #1a1714; --shell-soft: #e2ded6;
  --accent: #329e54; --accent-hover: #3fae5c; --on-accent: #052010; --accent-text: #0d7a30;
  --accent-soft: #d6efdd; --accent-ink: #0d5c26;
  --danger: #c0392b; --danger-hover: #a93226; --on-danger: #ffffff; --err: #ad3a30;
  --warn: #8a5410; --attn-bg: #f6dfb8; --attn-text: #6b3f08; --attn-line: #d9a85a;
  /* средняя задержка связи: оранжевый между зелёным и красным, на шапке различим не хуже них */
  --ping-mid: #d4700f;
  --link: #0d7a30; --focus: #0d7a30;
  --stage: #eae7e0; --tile: #dedad1; --tile-line: #cdc7bb; --letterbox: #dedad1;
  --over: rgba(251, 250, 248, 0.94); --over-text: #1a1714;
  --toast: #1a1714; --toast-text: #f5f1ec; --scrim: rgba(18, 26, 22, 0.42);
  --lift: 0 12px 32px rgba(26, 18, 0, 0.18);
  /* цвета флагов одни и те же в обеих темах: флаг участника не должен меняться от оформления */
  --f-g: #329e54; --f-b: #2862bf; --f-y: #e3a94a; --f-r: #c0392b; --f-w: #fbfaf8; --f-k: #1a1714;
  /* поля вокруг картинки во весь экран: чёрные в обеих темах, как у любого проигрывателя */
  --full-bg: #000000;
  --r: 12px; --r-s: 8px;
  --font: "Golos Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0908; --surface: #201e1d; --field: #161412; --hover: #2c2927;
  --ink: #ece7e1; --muted: #9d978d; --placeholder: #928879; --line: #2b2826; --line-strong: #47423d;
  --shell: #171514; --on-shell: #ece7e1; --shell-soft: #2b2826;
  --accent: #5fd07b; --accent-hover: #7be095; --on-accent: #07210e; --accent-text: #7be095;
  --accent-soft: #1c3a26; --accent-ink: #a3e5b3;
  --danger: #cf3a30; --danger-hover: #e04a3f; --err: #f0958c;
  --warn: #f0c790; --attn-bg: #4a3a1c; --attn-text: #f0c790; --attn-line: #7a5f2c;
  --ping-mid: #f59a3c;
  --link: #7be095; --focus: #5fd07b;
  --stage: #050505; --tile: #1a1817; --tile-line: #2b2826; --letterbox: #000000;
  --over: rgba(10, 9, 8, 0.86); --over-text: #ece7e1;
  --toast: #ece7e1; --toast-text: #1a1714; --scrim: rgba(4, 8, 6, 0.6);
  --lift: 0 12px 32px rgba(0, 0, 0, 0.5);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.5 var(--font);
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
/* то, что рисует сам браузер (выделение текста, курсор ввода, полосы прокрутки), тоже в цветах темы */
::selection { background: var(--accent-soft); color: var(--ink); }
:root { accent-color: var(--accent); scrollbar-color: var(--line-strong) transparent; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- общие детали ---------- */
h1 { font-size: 32px; line-height: 1.1; font-weight: 800; margin: 0 0 12px; letter-spacing: -0.02em; }
#lobby h1 { margin-bottom: 26px; }
h2 { font-size: 20px; line-height: 1.2; font-weight: 800; margin: 0; letter-spacing: -0.01em; }
h1, h2 { text-wrap: balance; }
.lead, .msg, .hint { text-wrap: pretty; }
.lead { color: var(--muted); margin: 0 0 20px; }
.code { font-family: Consolas, "SF Mono", "Courier New", monospace; font-size: 18px; font-weight: 400; letter-spacing: 0; white-space: nowrap; color: var(--accent-text); }
.code, #top, .chat-time { font-variant-numeric: tabular-nums; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
label { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin: 0 0 16px; }
input, select, button { font: inherit; color: inherit; }
input, select {
  display: block; width: 100%; min-height: 48px; margin-top: 6px; padding: 10px 14px;
  background: var(--field); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--r-s);
  /* подпись над полем мелкая и жирная, а само поле нет; мельче 16 px телефон при нажатии приближал бы страницу */
  font-size: 16px; font-weight: 400; caret-color: var(--accent-text);
}
input:hover, select:hover { border-color: var(--muted); }
input::placeholder { color: var(--placeholder); }
input[aria-invalid="true"] { border-color: var(--err); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 20px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--r-s);
  font-weight: 650; cursor: pointer; touch-action: manipulation;
}
.btn .ic { margin-right: 8px; }
.btn:hover { background: var(--hover); }
/* главное действие: фирменный зелёный портала */
.btn.primary { width: 100%; background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.small { min-height: 44px; padding: 8px 14px; font-size: 14px; }
.btn:disabled, .ctl:disabled { opacity: 0.45; cursor: default; }
/* нажатие видно сразу: кнопка чуть уходит вниз */
.btn:active:not(:disabled), .ctl:active:not(:disabled), .icon-btn:active { transform: translateY(1px); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
  background: var(--over); border: 1px solid var(--line-strong); border-radius: var(--r-s); color: var(--over-text); cursor: pointer;
}
.icon-btn:hover { background: var(--hover); }
a:focus-visible, input:focus-visible, select:focus-visible, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.msg { margin: 0 0 16px; color: var(--err); font-weight: 500; }
.msg.calm { color: var(--accent-text); }
.msg:empty { display: none; }
.hint { margin: 10px 0 0; font-size: 14px; color: var(--muted); min-height: 21px; }
.empty { margin: 0; padding: 14px; font-size: 14px; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .btn, .ctl, .icon-btn, input, select { transition: background-color 0.15s ease-out, border-color 0.15s ease-out; }
}

/* ---------- флаг участника ---------- */
/* Два цвета (--a и --b) и рисунок берутся из имени. Рисунки как у сигнальных флагов: половины, четверти, крест,
   косая черта, круг, прямоугольник в поле, три полосы. Цвета из тонов портала. */
.flag { --a: var(--f-g); --b: var(--f-w); position: relative; display: block; background: var(--a); border: 1px solid var(--f-k); border-radius: 3px; }
.a-g { --a: var(--f-g); } .b-g { --b: var(--f-g); }
.a-b { --a: var(--f-b); } .a-y { --a: var(--f-y); } .a-r { --a: var(--f-r); } .a-w { --a: var(--f-w); } .a-k { --a: var(--f-k); }
.b-b { --b: var(--f-b); } .b-y { --b: var(--f-y); } .b-r { --b: var(--f-r); } .b-w { --b: var(--f-w); } .b-k { --b: var(--f-k); }
.f-h2 { background: linear-gradient(var(--a) 50%, var(--b) 0); }
.f-v2 { background: linear-gradient(90deg, var(--a) 50%, var(--b) 0); }
.f-q { background: conic-gradient(var(--a) 25%, var(--b) 0 50%, var(--a) 0 75%, var(--b) 0); }
.f-x { background: linear-gradient(var(--b), var(--b)) center / 100% 24% no-repeat, linear-gradient(var(--b), var(--b)) center / 16% 100% no-repeat, var(--a); }
.f-d { background: linear-gradient(to bottom right, var(--a) 50%, var(--b) 0); }
.f-o { background: radial-gradient(circle closest-side, var(--b) 58%, transparent 60%), var(--a); }
.f-r { background: linear-gradient(var(--b), var(--b)) center / 56% 52% no-repeat, var(--a); }
.f-h3 { background: linear-gradient(var(--a) 33.4%, var(--b) 0 66.6%, var(--a) 0); }
.flag.mini { display: inline-block; flex: 0 0 auto; width: 20px; height: 14px; margin-right: 8px; border-width: 1px; vertical-align: -2px; }
.flag.lg { width: 42%; max-width: 210px; min-width: 84px; aspect-ratio: 3 / 2; }
/* Аватарка-шар (ball.js) встаёт на место флага там, где браузер умеет её нарисовать: флаг становится квадратным
   прозрачным полем с холстом. Буквы на шаре нет (владелец, 17.11.2026); на запасном флаге она остаётся. */
.flag.ball { background: none; border: 0; border-radius: 0; aspect-ratio: 1 / 1; }
.flag.ball canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.flag.ball.mini { width: 24px; height: 24px; margin-right: 6px; vertical-align: -7px; }
.flag.ball.lg { width: 46%; max-width: 230px; min-width: 96px; }
.flag.ball b { display: none; }
/* первая буква имени на табличке поверх флага: читается на любом рисунке */
.flag.lg b {
  position: absolute; top: 50%; left: 50%; min-width: 44px; padding: 0 10px; transform: translate(-50%, -50%);
  background: #fbfaf8; color: #1a1714; border: 1.5px solid #1a1714; border-radius: 8px;
  font-size: 28px; line-height: 40px; font-weight: 800; text-align: center;
}

/* ---------- первая страница и страница входа ---------- */
.page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 0 0 32px; }
/* фон главной страницы (tide.js): поверх цвета страницы, но под всем содержимым, мимо мыши; раскладку не трогает */
#tide { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
/* шапка: только переход на главную и переключатель оформления */
.brand {
  display: flex; align-items: center; justify-content: flex-end; align-self: stretch; min-height: 44px; margin: 20px 0 24px;
  padding: 0 16px; padding: 0 max(16px, calc((100% - 960px) / 2));
}
.brand a { padding: 10px 0 10px 12px; font-weight: 600; font-size: 15px; }
.brand .theme { background: var(--surface); color: var(--ink); }
.brand .theme:hover { background: var(--hover); }
.brand a + .theme { margin-left: 12px; }
.theme .sun { display: none; }
:root[data-theme="dark"] .theme .sun { display: block; }
:root[data-theme="dark"] .theme .moon { display: none; }
.card { width: calc(100% - 32px); max-width: 460px; padding: 32px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.or { display: flex; align-items: center; margin: 24px 0 18px; color: var(--muted); font-size: 14px; }
.or:before, .or:after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }
.or span { padding: 0 12px; }
.inline { display: flex; align-items: flex-end; }
.inline label { flex: 1 1 auto; margin: 0 8px 0 0; }
.inline .btn { flex: 0 0 auto; }
#lobby .msg { margin: 12px 0 0; }
/* Выпадающий список в облике сайта: кнопка с выбранным значением и перечень. Браузерный select лежит рядом
   невидимым: в нём значение. */
.pick { position: relative; display: block; margin-top: 6px; }
.pick-btn {
  display: block; width: 100%; min-height: 48px; padding: 10px 40px 10px 14px; background: var(--field); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r-s); font-size: 16px; font-weight: 400; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.pick-btn:hover { border-color: var(--muted); }
.pick-btn[aria-expanded="true"] { border-color: var(--accent-text); }
.pick-btn:disabled { opacity: 0.55; cursor: default; }
.pick:after {
  content: ""; position: absolute; top: 19px; right: 17px; width: 7px; height: 7px; border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted); transform: rotate(45deg); pointer-events: none;
}
.pick-native { position: absolute; bottom: 0; left: 0; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.pick-list {
  position: fixed; z-index: 60; max-height: 292px; overflow: auto; padding: 4px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-s); box-shadow: var(--lift);
}
.pick-list button {
  display: block; width: 100%; min-height: 40px; padding: 8px 10px; background: none; color: var(--ink); border: 0; border-radius: 6px;
  font-size: 15px; font-weight: 400; line-height: 1.35; text-align: left; cursor: pointer;
}
.pick-list button:hover, .pick-list button:focus-visible { background: var(--hover); }
.pick-list button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
/* Когда встреча: свой календарь вместо браузерного. День, час и минуты выбираются нажатием на крупные клетки,
   прошедшее не нажимается. */
.plan { margin: 0 0 16px; }
.plan-label { display: block; font-size: 14px; font-weight: 600; color: var(--muted); }
.plan-btn {
  display: block; width: 100%; min-height: 48px; margin-top: 6px; padding: 10px 14px; background: var(--field); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r-s); font-size: 16px; text-align: left; cursor: pointer;
}
.plan-btn:hover { border-color: var(--muted); }
.plan-btn[aria-expanded="true"] { border-color: var(--accent-text); }
#planBox { margin-top: 8px; padding: 12px; background: var(--field); border: 1px solid var(--line); border-radius: var(--r-s); }
.plan-quick { display: flex; flex-wrap: wrap; margin: 0 -3px 6px; }
.plan-quick button {
  flex: 1 1 auto; min-height: 40px; margin: 0 3px 6px; padding: 6px 10px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r-s); font-size: 14px; font-weight: 600; cursor: pointer;
}
.plan-quick button:hover { background: var(--hover); }
.plan-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.plan-head b { font-size: 15px; font-weight: 700; }
.plan-head .icon-btn { background: transparent; border-color: transparent; color: var(--ink); font-size: 24px; line-height: 1; }
.plan-head .icon-btn:hover { background: var(--hover); }
.plan-head .icon-btn:disabled { opacity: 0.3; background: transparent; cursor: default; }
.plan-week, .plan-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.plan-week { margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; }
/* время: поле, куда его можно набрать цифрами, шаг по 15 минут и готовые часы */
.plan-time { display: flex; align-items: center; margin-bottom: 6px; }
.plan-time input {
  flex: 1 1 auto; min-width: 0; min-height: 44px; margin: 0 6px; padding: 4px 10px; font-size: 20px; font-weight: 700;
  text-align: center; font-variant-numeric: tabular-nums;
}
.plan-time .icon-btn { flex: 0 0 auto; background: var(--surface); color: var(--ink); font-size: 22px; line-height: 1; }
.plan-time .icon-btn:hover { background: var(--hover); }
.plan-slots { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.plan-slots .cell { font-size: 14px; }
.plan-sub { margin: 10px 0 4px; color: var(--muted); font-size: 13px; font-weight: 600; }
.plan .cell {
  min-height: 36px; padding: 0; background: transparent; color: var(--ink); border: 1px solid transparent; border-radius: var(--r-s);
  font-size: 15px; font-variant-numeric: tabular-nums; cursor: pointer;
}
.plan .cell:hover:not(:disabled) { background: var(--hover); }
.plan .cell.today { border-color: var(--line-strong); font-weight: 700; }
.plan .cell.on, .plan .cell.on:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.plan .cell:disabled { color: var(--placeholder); opacity: 0.5; cursor: default; }
.plan-foot { display: flex; justify-content: space-between; margin-top: 12px; }
/* встречи организатора: открыть или завершить, не входя */
/* Список встреч стоит сбоку от карточки создания, вровень с её верхом; на узком экране уходит под неё. */
.lobby-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center; width: 100%; }
.lobby-row .card { margin: 0 8px 16px; }
#mine { padding-top: 24px; padding-bottom: 14px; }
#mine h2 { margin-bottom: 4px; }
#mine .tabs { margin: 0 -12px; border-bottom: 1px solid var(--line); }
#mine .tabs span { color: var(--muted); font-weight: 400; }
.mine-empty { margin: 14px 0 10px; color: var(--muted); }
#mineList li:first-child { border-top: 0; }
#mineList { margin: 0; padding: 0; list-style: none; }
#mineList li { display: flex; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
#mineList a { flex: 1 1 auto; min-width: 0; margin-right: 12px; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
#mineList a:hover b { text-decoration: underline; }
#mineList b { font-weight: 600; }
#mineList small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; font-variant-numeric: tabular-nums; }
#mineList .btn { flex: 0 0 auto; }
#mineList .icon-btn { flex: 0 0 auto; margin-right: 6px; background: transparent; color: var(--ink); }
#mineList .icon-btn:hover { background: var(--hover); }
#mineList .icon-btn.done { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.key-kept { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.key-kept button { padding: 0; background: none; border: 0; color: var(--link); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
#mineList .btn.sure { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
.foot { margin: 22px 0 0; font-size: 15px; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; }
.foot .ic { margin-right: 8px; }

.door { display: grid; grid-template-columns: 1fr; grid-gap: 24px; width: calc(100% - 32px); max-width: 960px; }
.door .join { padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); align-self: start; }
.door .join .btn { width: 100%; }
.door .join .btn + .btn { margin-top: 10px; }
@media (min-width: 820px) {
  .door { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-gap: 32px; align-items: start; }
}
.preview { position: relative; padding-top: 56.25%; background: var(--tile); border: 1px solid var(--tile-line); border-radius: var(--r); overflow: hidden; }
.preview video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview.nomirror video { transform: none; }
.preview span { position: absolute; left: 0; right: 0; top: 50%; padding: 0 20px; text-align: center; color: var(--muted); font-size: 15px; transform: translateY(-50%); }
/* камера выключена по выбору человека: в окне его флаг (так его увидят во встрече), пояснение уходит под флаг */
.preview .flag.lg { position: absolute; top: 40%; left: 50%; width: 36%; transform: translate(-50%, -50%); }
.preview.flagged span { top: auto; bottom: 68px; transform: none; }
.preview .icon-btn { position: absolute; top: 10px; right: 10px; }
/* выбор «с микрофоном и камерой или без» до входа: две кнопки внизу окна, выключенное красное */
.toggles { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; }
.toggles .icon-btn { position: static; width: 48px; height: 48px; margin: 0 5px; background: var(--over); }
.toggles .icon-btn[aria-pressed="false"] { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
.testing .toggles { display: none; }
#check { margin: 16px 0 0; }
.meter { display: flex; align-items: center; color: var(--muted); }
.meter .bar { flex: 1 1 auto; height: 10px; margin-left: 10px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 5px; overflow: hidden; }
#level { width: 0; height: 100%; background: var(--accent); }
#check .row { display: flex; flex-wrap: wrap; margin: 12px -4px 0; }
#check .row .btn { flex: 1 1 auto; margin: 0 4px 8px; }
/* микрофон не слушается (человек только что вышел из встречи или выключил его): полоске громкости нечего показывать */
#check.idle .meter { display: none; }
#check.idle .row { margin-top: 0; }
#check.idle .hint { display: none; }
/* страница проверки камеры и микрофона: та же страница входа, но без самой встречи */
.testing #enterForm { display: none; }

/* ---------- встреча ---------- */
#call {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; background: var(--stage);
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}
#top { display: flex; align-items: center; min-height: 36px; padding: 4px 12px; background: var(--shell); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; }
#callTitle { overflow: hidden; text-overflow: ellipsis; }
/* кружок задержки связи: цвет по задержке до сервера, число при наведении (на телефоне по нажатию) */
.ping { position: relative; flex: none; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin: 0 4px 0 -7px; border-radius: 50%; cursor: default; }
.ping::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ping, var(--line-strong)); transition: background-color 0.3s; }
.ping.good { --ping: var(--accent); }
.ping.mid { --ping: var(--ping-mid); }
.ping.bad { --ping: var(--danger); }
.ping::after {
  content: attr(aria-label); position: absolute; top: calc(100% + 6px); left: 0; z-index: 35; padding: 5px 10px;
  background: var(--toast); color: var(--toast-text); border-radius: var(--r-s); box-shadow: var(--lift);
  font-size: 13px; font-weight: 500; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.12s;
}
.ping:hover::after, .ping:focus::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .ping::before, .ping::after { transition: none; } }
#callNote { margin-left: 12px; color: var(--warn); overflow: hidden; text-overflow: ellipsis; }
#mid { position: relative; display: flex; flex: 1 1 auto; min-height: 0; }
/* сетка окон привязана к краям сцены, а не к её высоте в процентах: внутри гибкой строки проценты высоты не
   считаются, и окна схлопывались бы в ноль */
#stage { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; }
/* Сетка окон. Столбцов в ней вдвое больше, чем окон в ряду, и каждое окно занимает два: так неполный последний
   ряд встаёт по центру (его первое окно сдвигается), а не остаётся прижатым к левому краю. */
#tiles { position: absolute; top: 8px; right: 8px; bottom: 8px; left: 8px; display: grid; grid-gap: 8px; grid-template-columns: repeat(2, 1fr); grid-auto-rows: minmax(0, 1fr); }
#tiles.n2, #tiles.n3, #tiles.n4 { grid-template-columns: repeat(4, 1fr); }
#tiles.n5, #tiles.n6, #tiles.n7, #tiles.n8, #tiles.n9 { grid-template-columns: repeat(6, 1fr); }
#tiles.n10, #tiles.n11, #tiles.n12, #tiles.n13, #tiles.n14, #tiles.n15, #tiles.n16 { grid-template-columns: repeat(8, 1fr); }
#tiles.n17, #tiles.n18, #tiles.n19, #tiles.n20, #tiles.n21, #tiles.n22, #tiles.n23, #tiles.n24, #tiles.n25 { grid-template-columns: repeat(10, 1fr); }
@media (orientation: landscape) {
  #tiles.n3 .tile:nth-child(3), #tiles.n5 .tile:nth-child(4), #tiles.n8 .tile:nth-child(7), #tiles.n11 .tile:nth-child(9), #tiles.n15 .tile:nth-child(13) { grid-column-start: 2; }
  #tiles.n7 .tile:nth-child(7), #tiles.n10 .tile:nth-child(9), #tiles.n14 .tile:nth-child(13) { grid-column-start: 3; }
  #tiles.n13 .tile:nth-child(13) { grid-column-start: 4; }
}
/* экран выше, чем шире (телефон): до четырёх окон идут одно под другим во всю ширину, так картинка крупнее,
   чем в двух узких высоких столбцах */
@media (orientation: portrait) {
  #tiles.n2, #tiles.n3, #tiles.n4 { grid-template-columns: repeat(2, 1fr); }
  #tiles.n5, #tiles.n6 { grid-template-columns: repeat(4, 1fr); }
  #tiles.n10, #tiles.n11, #tiles.n12, #tiles.n13, #tiles.n14, #tiles.n15, #tiles.n16, #tiles.n17, #tiles.n18 { grid-template-columns: repeat(6, 1fr); }
  #tiles.n19, #tiles.n20, #tiles.n21, #tiles.n22, #tiles.n23, #tiles.n24, #tiles.n25 { grid-template-columns: repeat(8, 1fr); }
  #tiles.n5 .tile:nth-child(5), #tiles.n8 .tile:nth-child(7), #tiles.n11 .tile:nth-child(10), #tiles.n14 .tile:nth-child(13), #tiles.n17 .tile:nth-child(16) { grid-column-start: 2; }
  #tiles.n7 .tile:nth-child(7), #tiles.n10 .tile:nth-child(10), #tiles.n13 .tile:nth-child(13), #tiles.n16 .tile:nth-child(16) { grid-column-start: 3; }
}
.tile { position: relative; grid-column-end: span 2; min-width: 0; min-height: 0; background: var(--tile); border: 1px solid var(--tile-line); border-radius: var(--r); overflow: hidden; cursor: pointer; }
/* поля вокруг картинки, если она не того же формата, что окно: в цвет окна, а не чёрные полосы на светлом */
.tile video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; background: var(--letterbox); }
.tile.me video { transform: scaleX(-1); }
.tile.me.screen video, .tile.me.nomirror video { transform: none; }
/* без видео в окне флаг участника с первой буквой имени */
.tile .who { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: none; align-items: center; justify-content: center; padding: 12px 12px 40px; color: var(--ink); }
/* когда окон много, табличка с буквой на флаге мельче */
#tiles.n10 .who b, #tiles.n11 .who b, #tiles.n12 .who b, #tiles.n13 .who b, #tiles.n14 .who b, #tiles.n15 .who b, #tiles.n16 .who b,
#tiles.n17 .who b, #tiles.n18 .who b, #tiles.n19 .who b, #tiles.n20 .who b { min-width: 32px; padding: 0 6px; font-size: 19px; line-height: 28px; }
.tile.novideo video { visibility: hidden; opacity: 0; }
.tile.novideo .who { display: flex; }
.tile .tag { position: absolute; left: 8px; bottom: 8px; display: flex; align-items: center; max-width: calc(100% - 16px); padding: 4px 10px; background: var(--over); color: var(--over-text); border-radius: var(--r-s); font-size: 13px; font-weight: 500; line-height: 1.4; white-space: nowrap; }
.tile .tag span { overflow: hidden; text-overflow: ellipsis; }
.tile .tag i { margin-left: 8px; font-style: normal; color: var(--warn); overflow: hidden; text-overflow: ellipsis; }
.tile .tag i.muted { display: inline-flex; flex: 0 0 auto; color: var(--err); }
.tile .tag i.muted .ic { width: 15px; height: 15px; }
.tile .tag em.vol { margin-left: 8px; font-style: normal; opacity: 0.75; }
/* своя громкость участника: окно у курсора по правой кнопке мыши */
.vol-pop { position: fixed; z-index: 36; width: 260px; padding: 14px 14px 12px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--lift); }
.vol-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); }
.vol-head > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vol-head b { color: var(--ink); font-weight: 700; }
#volVal { flex: none; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.vol-pop input[type="range"] { display: block; width: 100%; min-height: 0; margin: 10px 0 12px; padding: 0; background: none; border: 0; accent-color: var(--accent); cursor: pointer; }
.vol-foot { display: flex; gap: 8px; }
.vol-foot .btn { flex: 1 1 0; min-height: 40px; }
.tile .flip { position: absolute; top: 8px; right: 8px; }
/* Во весь экран: кнопка в углу окна с картинкой. Во весь экран окно на чёрном, без рамок; кнопка и имя прячутся
   через 3 секунды, касание возвращает их. Класс fs ставит app.js: так одно правило работает и в браузерах, где
   весь экран называется по-своему. Окно во весь экран видно, даже если во встрече развёрнуто другое. */
.tile .full { position: absolute; top: 8px; right: 8px; }
.tile.novideo .full { display: none; }
#tiles .tile.fs, #tiles.solo .tile.fs { background: var(--full-bg); border: 0; border-radius: 0; opacity: 1 !important; pointer-events: auto !important; cursor: default; }
.tile.fs video { background: var(--full-bg); }
.tile.fs::after, .tile.fs.talk::after { box-shadow: none; }
.tile.fs .full { top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); }
.tile.fs .tag { left: max(8px, env(safe-area-inset-left)); bottom: max(8px, env(safe-area-inset-bottom)); }
.tile.fs.bare .full, .tile.fs.bare .tag { opacity: 0; pointer-events: none; }
/* поднятая рука: янтарная метка в углу окна */
.tile .handmark { position: absolute; top: 8px; left: 8px; display: none; align-items: center; padding: 3px 9px 3px 6px; background: var(--attn-bg); color: var(--attn-text); border: 1px solid var(--attn-line); border-radius: var(--r-s); font-size: 12px; font-weight: 700; line-height: 1.4; }
.tile .handmark .ic { width: 16px; height: 16px; margin-right: 4px; }
.tile.hand .handmark { display: flex; }
/* номер в очереди поднятых рук: кто поднял раньше, тот и говорит раньше */
.tile .handmark b { margin-left: 6px; padding: 0 5px; background: var(--attn-text); color: var(--attn-bg); border-radius: 4px; font-size: 11px; line-height: 1.5; }
.tile .handmark b:empty { display: none; }
/* реакция: зелёный квадрат со значком по центру окна на пару секунд */
.tile .reaction { position: absolute; top: 50%; left: 50%; display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; margin: -36px 0 0 -36px; background: var(--accent); color: var(--on-accent); border-radius: var(--r); pointer-events: none; animation: react 2.6s ease-out forwards; }
.tile .reaction .ic { width: 40px; height: 40px; }
/* реакция вспыхивает, чуть всплывает и тает вверх: видно, что это мгновенный отклик, а не метка */
@keyframes react { 0% { opacity: 0; transform: translateY(14px) scale(0.6); } 8% { opacity: 1; transform: translateY(0) scale(1.06); } 14% { transform: scale(1); } 78% { opacity: 1; transform: translateY(-10px); } 100% { opacity: 0; transform: translateY(-34px) scale(0.92); } }
@media (prefers-reduced-motion: reduce) { .tile .reaction { animation-name: react-still; } }
@keyframes react-still { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
/* окно того, кто говорит: зелёная рамка без размытия. Рамка лежит поверх картинки, а не вокруг неё: иначе видео
   сжималось бы каждый раз, когда человек начинает говорить */
.tile::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: inherit; box-shadow: inset 0 0 0 3px transparent; pointer-events: none; }
.tile.talk { border-color: var(--accent); }
.tile.talk::after { box-shadow: inset 0 0 0 3px var(--accent); }
/* развёрнутое окно занимает всю сцену; остальные остаются на странице невидимыми, чтобы их звук не пропал */
#tiles.solo { grid-template-columns: 1fr; }
#tiles.solo .tile.big { grid-column: 1 / -1; }
#tiles.solo .tile:not(.big) { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
/* окно уходит под развёрнутое: стоит на прежнем месте (место задано в app.js) и гаснет, развёрнутое растёт поверх */
#tiles.solo .tile.covered { position: fixed; z-index: 1; }

/* ---------- боковая панель: чат и участники ---------- */
#side { display: flex; flex-direction: column; flex: 0 0 340px; min-height: 0; background: var(--surface); border-left: 1px solid var(--line); }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 0 4px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; }
.tabs button { min-height: 48px; padding: 0 12px; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 600; cursor: pointer; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
#side .icon-btn { background: transparent; border-color: transparent; color: var(--ink); }
#side .icon-btn:hover { background: var(--hover); }
#paneChat, #panePeople { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
#chatLog { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 14px 14px 4px; }
#chatLog:empty { display: none; }
#chatLog:not(:empty) + .empty { display: none; }
#paneChat .empty { flex: 1 1 auto; }
.chat-row { margin: 0 0 14px; }
.chat-head { display: flex; align-items: center; font-size: 14px; }
.chat-head b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.chat-time { flex: 0 0 auto; margin-left: 8px; color: var(--muted); font-size: 12px; }
.chat-text { margin: 2px 0 0; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
#chatForm { display: flex; padding: 10px; border-top: 1px solid var(--line); }
#chatForm input { flex: 1 1 auto; min-width: 0; margin: 0 8px 0 0; }
#chatForm .btn { flex: 0 0 auto; width: 48px; padding: 0; }
#chatForm .btn .ic { margin: 0; }
.people-tools { display: flex; flex-wrap: wrap; padding: 10px 10px 2px; }
.people-tools .btn { flex: 1 1 auto; margin: 0 4px 8px; }
.people-tools .btn.sure { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
#peopleList { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 0; padding: 0 14px 12px; list-style: none; }
#peopleList li { display: flex; align-items: center; min-height: 52px; padding-left: 6px; border-top: 1px solid var(--line); box-shadow: inset 3px 0 0 transparent; }
/* тот, кого сейчас слышно: зелёная черта слева и имя зелёным, как рамка его окна */
#peopleList li.talking { box-shadow: inset 3px 0 0 var(--accent); }
#peopleList li.talking .who-name { color: var(--accent-text); }
#peopleList .who-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 500; }
#peopleList .who-name small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
#peopleList .marks { display: flex; flex: 0 0 auto; align-items: center; color: var(--muted); }
#peopleList .marks .ic { width: 18px; height: 18px; margin-left: 8px; }
#peopleList .marks .off { color: var(--err); }
#peopleList .marks .hand-on { padding: 2px; background: var(--attn-bg); color: var(--attn-text); border-radius: 4px; }
#peopleList .act { width: 40px; height: 40px; margin-left: 4px; }
#peopleList .act.sure { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }

/* ---------- панель встречи ---------- */
#bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; padding: 8px 6px; background: var(--shell); border-top: 1px solid var(--line); color: var(--on-shell); }
.ctl {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 86px; min-height: 56px; margin: 0 3px; padding: 6px 8px 5px;
  background: transparent; border: 1px solid transparent; border-radius: var(--r-s); color: var(--on-shell);
  font-size: 12px; font-weight: 600; line-height: 1.3; cursor: pointer; touch-action: manipulation;
}
.ctl .ic { width: 22px; height: 22px; margin-bottom: 3px; }
.ctl:hover { background: var(--hover); }
.ctl.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.ctl.on:hover { background: var(--accent-soft); }
.ctl.off { background: var(--danger); color: var(--on-danger); }
.ctl.off:hover { background: var(--danger-hover); }
/* выключенное перечёркнуто: состояние видно не только по цвету */
.ctl.off:after { content: ""; position: absolute; top: 9px; left: 50%; width: 2px; height: 24px; margin-left: -1px; background: currentColor; border-radius: 1px; transform: rotate(-45deg); }
.ctl.danger { margin-left: 12px; background: var(--danger); color: var(--on-danger); }
.ctl.danger:hover { background: var(--danger-hover); }
#bar .gap { flex: 0 0 auto; width: 1px; height: 32px; margin: 0 8px; background: var(--shell-soft); }
/* число непрочитанных сообщений на кнопке чата */
#chatBadge { position: absolute; top: 3px; right: 14px; min-width: 20px; padding: 0 5px; background: var(--accent); color: var(--on-accent); border: 1.5px solid var(--shell); border-radius: 10px; font-size: 11px; font-style: normal; font-weight: 700; line-height: 17px; text-align: center; }
.pop-wrap { position: relative; display: flex; }
.pop { position: absolute; left: 50%; bottom: calc(100% + 10px); z-index: 25; display: flex; padding: 6px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--lift); transform: translateX(-50%); }
.pop .icon-btn { width: 48px; height: 48px; margin: 0 2px; background: transparent; border-color: transparent; color: var(--ink); }
.pop .icon-btn:hover { background: var(--accent); color: var(--on-accent); }
.pop .icon-btn .ic { width: 26px; height: 26px; }
/* окно показа экрана: над кнопкой «Экран», выровнено по её левому краю (кнопка у левого края панели) */
.scr-pop { display: block; left: 0; width: 360px; max-width: calc(100vw - 16px); padding: 16px 16px 14px; transform: none; text-align: left; }
.scr-pop h3 { margin: 0 0 12px; font-size: 16px; font-weight: 700; color: var(--ink); }
.scr-pop label { margin-bottom: 12px; }
.scr-pop .hint { margin: -6px 0 12px; font-size: 13px; color: var(--muted); }
.scr-pop .hint:empty { display: none; }
.scr-row { margin-bottom: 12px; }
.scr-label { display: block; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg { display: flex; margin-top: 6px; border: 1px solid var(--line-strong); border-radius: var(--r-s); overflow: hidden; }
.seg button { flex: 1 1 0; min-height: 44px; padding: 0 6px; background: var(--field); border: 0; border-left: 1px solid var(--line-strong); color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button:hover { background: var(--hover); }
.seg button[aria-checked="true"] { background: var(--accent-soft); color: var(--accent-ink); }
.scr-check { display: flex; align-items: center; color: var(--ink); cursor: pointer; }
.scr-check input { width: 20px; height: 20px; min-height: 0; margin: 0 10px 0 0; padding: 0; flex: none; accent-color: var(--accent); cursor: pointer; }
.scr-actions { display: flex; flex-direction: column; gap: 8px; }
.scr-actions .btn { width: 100%; }
.scr-actions .btn.danger { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
.scr-actions .btn.danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
#toast { position: absolute; left: 50%; bottom: 92px; z-index: 20; max-width: 92%; padding: 10px 16px; background: var(--toast); color: var(--toast-text); border-radius: var(--r-s); box-shadow: var(--lift); font-size: 14px; font-weight: 500; transform: translateX(-50%); display: none; }
#toast.show { display: block; }
/* кнопка «включить звук»: по центру экрана поверх окон, её нельзя не заметить */
#unmute { position: absolute; left: 50%; top: 40%; z-index: 30; width: auto; max-width: 90%; padding: 14px 22px; transform: translate(-50%, -50%); font-size: 17px; box-shadow: var(--lift); }

/* ---------- окно настроек ---------- */
#sheet { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px; }
#scrim { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: var(--scrim); }
.dialog { position: relative; width: 100%; max-width: 440px; max-height: 100%; overflow: auto; padding: 22px 22px 24px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--lift); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin: -6px -8px 14px 0; }
.dialog .icon-btn { background: transparent; border-color: transparent; color: var(--ink); }
.dialog .icon-btn:hover { background: var(--hover); }
.dialog .hint { margin: -8px 0 16px; min-height: 0; }
.dialog .hint:empty { display: none; }
.keys { margin: 0 0 16px; font-size: 13px; line-height: 1.45; color: var(--muted); }
/* на телефоне клавиатуры нет: подсказка про клавиши там лишняя */
@media (hover: none) { .keys { display: none; } }

/* средняя ширина: подписи кнопок панели не помещаются в один ряд, остаются значки (названия читает программа
   чтения с экрана и показывает подсказка) */
@media (max-width: 1040px) {
  .ctl { min-width: 52px; min-height: 52px; padding: 0; }
  .ctl span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ctl .ic { width: 24px; height: 24px; margin: 0; }
  .ctl.off:after { top: 50%; height: 28px; margin-top: -14px; }
  #chatBadge { right: 2px; }
}
/* узкое окно: боковая панель не помещается рядом с окнами участников и открывается поверх них */
@media (max-width: 760px) {
  #side { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 15; border-left: 0; }
}
/* телефон: кнопки панели делят ширину поровну и остаются в одну строку; ссылка на встречу переезжает в список
   участников; шапка и отступы плотнее, чтобы кнопка входа была видна без прокрутки */
@media (max-width: 480px) {
  h1 { font-size: 27px; }
  #bar { flex-wrap: nowrap; padding: 6px 2px; }
  .ctl { flex: 1 1 0; min-width: 0; margin: 0 2px; }
  .pop-wrap { flex: 1 1 0; min-width: 0; }
  #bar .gap, #bLink { display: none; }
  .ctl.danger { margin-left: 4px; }
  .brand { min-height: 48px; margin-bottom: 20px; }
  .door { grid-gap: 16px; }
  .door .join { padding: 20px 16px; }
  .card { padding: 24px 18px; }
  #tiles { top: 6px; right: 6px; bottom: 6px; left: 6px; grid-gap: 6px; }
  #toast { bottom: 76px; }
}

/* ---------- телефон: вырез экрана, пальцы, экран на боку ---------- */
/* вырез и полоса жестов: панель встречи и шапка не уходят под них */
#bar { padding-bottom: max(8px, env(safe-area-inset-bottom)); padding-left: max(6px, env(safe-area-inset-left)); padding-right: max(6px, env(safe-area-inset-right)); }
#top { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
/* палец крупнее указателя мыши: клетки календаря и строки перечней выше */
@media (hover: none) {
  .plan .cell { min-height: 42px; }
  .pick-list button { min-height: 46px; }
}
@media (max-width: 480px) {
  #bar { padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .lobby-row .card { margin-bottom: 12px; }
  #mineList li { flex-wrap: wrap; }
  #mineList a { flex-basis: 100%; margin: 0 0 8px; }
  #mineList .btn { margin-left: auto; }
  /* окно настроек занимает экран целиком: так списки и кнопка «Готово» под большим пальцем */
  #sheet { padding: 0; align-items: flex-end; }
  .dialog { max-width: none; max-height: 92%; border-radius: var(--r) var(--r) 0 0; border-bottom: 0; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
}
/* телефон на боку: по высоте места мало, поэтому шапка встречи убрана, панель ниже, а страница входа в два столбца */
@media (orientation: landscape) and (max-height: 480px) {
  #top { display: none; }
  #bar { padding-top: 3px; padding-bottom: max(3px, env(safe-area-inset-bottom)); }
  .ctl { min-height: 44px; }
  #tiles { top: 4px; right: 4px; bottom: 4px; left: 4px; grid-gap: 4px; }
  .brand { min-height: 40px; margin: 6px 0 8px; }
  .door { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-gap: 12px; }
  .door .join { padding: 14px 16px; }
  h1 { font-size: 24px; margin-bottom: 8px; }
  #lobby h1 { margin-bottom: 12px; }
  #side { flex-basis: 300px; }
  #toast { bottom: 64px; }
}

/* ---------- телевизор ---------- */
/* Метку tv ставит theme.js. Всё рисуется на треть крупнее: на экран смотрят издалека. По краям оставлены
   поля: телевизоры обрезают картинку. Выбранная пультом кнопка обведена жирнее. */
html.tv { zoom: 1.3; }
/* высота «во весь экран» при таком увеличении считается от увеличенного экрана: возвращаем её к настоящему */
html.tv .page { min-height: calc(100vh / 1.3); padding-bottom: 12px; }
html.tv .brand { min-height: 40px; margin: 8px 0 12px; }
html.tv #call { top: 2%; right: 2%; bottom: 2%; left: 2%; border-radius: var(--r); overflow: hidden; }
html.tv .page { padding-left: 2%; padding-right: 2%; }
html.tv a:focus-visible, html.tv input:focus-visible, html.tv select:focus-visible, html.tv button:focus-visible { outline-width: 4px; outline-offset: 3px; }
html.tv .keys { display: none; }

/* ---------- плавность ---------- */
/* Лёгкие переходы: меняются только прозрачность и сдвиг (их рисует видеокарта, раскладка не пересчитывается),
   длительность до четверти секунды. У того, кто просил в системе поменьше движения, их нет. */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes slide { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  /* страницы сменяют друг друга: новая проявляется и чуть поднимается */
  #lobby:not([hidden]) .card, #lobby:not([hidden]) .foot, #door:not([hidden]) .door { animation: rise 0.22s ease-out backwards; }
  #lobby:not([hidden]) #mine { animation-delay: 0.05s; }
  #call:not([hidden]) { animation: fade 0.2s ease-out backwards; }
  /* раскрывающееся: календарь, перечень списка, окно настроек, боковая панель, всплывающие реакции */
  #planBox:not([hidden]), .pick-list:not([hidden]) { animation: drop 0.16s ease-out backwards; }
  #sheet:not([hidden]) #scrim { animation: fade 0.18s ease-out backwards; }
  #sheet:not([hidden]) .dialog { animation: pop 0.18s ease-out backwards; }
  #side:not([hidden]) { animation: slide 0.2s ease-out backwards; }
  #reactPop:not([hidden]), #scrPop:not([hidden]) { animation: rise 0.14s ease-out backwards; }
  #volPop:not([hidden]) { animation: pop 0.12s ease-out backwards; }
  /* новое окно участника, новая строка списка, сообщение чата, всплывающая подсказка */
  .tile { animation: pop 0.24s ease-out backwards; }
  /* строка участника проявляется только при входе человека: список перестраивается при любой перемене, и
     анимация всех строк заново мигала бы */
  #mineList li, #peopleList li.fresh, .chat-row { animation: rise 0.18s ease-out backwards; }
  /* поднятая рука опускается на окно сверху */
  .tile.hand .handmark { animation: drop 0.2s ease-out backwards; }
  #toast.show { animation: rise 0.18s ease-out backwards; }
  .msg:not(:empty) { animation: fade 0.2s ease-out backwards; }
  /* нажатия и выбор: цвет и рамка меняются мягко */
  .cell, .tabs button, .plan-btn, .pick-btn, .pick-list button, .plan-quick button, #mineList a b { transition: background-color 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out; }
  .tile { transition: border-color 0.18s ease-out; }
  .tile::after { transition: box-shadow 0.18s ease-out; }
  /* картинка появляется мягко, а не вспышкой поверх флага */
  .tile video { transition: opacity 0.28s ease-out; }
  .tile.fs .full, .tile.fs .tag { transition: opacity 0.2s ease-out; }
  #peopleList li { transition: box-shadow 0.18s ease-out; }
  #peopleList .who-name { transition: color 0.18s ease-out; }
  .btn, .ctl, .icon-btn { transition: background-color 0.15s ease-out, border-color 0.15s ease-out, transform 0.08s ease-out; }
}
@media (max-width: 480px) and (prefers-reduced-motion: no-preference) {
  /* на телефоне окно настроек выезжает снизу */
  #sheet:not([hidden]) .dialog { animation-name: rise; }
}

/* окно ушедшего участника гаснет на своём прежнем месте поверх раскладки (app.js fadeAway) */
#ghosts { position: absolute; top: 0; left: 0; width: 0; height: 0; pointer-events: none; }
.tile.leaving { position: fixed; z-index: 1; pointer-events: none; animation: none; transition: none; }
#peopleList .marks .hand-no { margin-left: 3px; color: var(--attn-text); font-size: 12px; font-weight: 700; }
/* чат: кому писать (всем или лично одному) и личные сообщения, отмеченные янтарным «просит внимания» */
.chat-to { display: flex; align-items: center; padding: 10px 10px 0; border-top: 1px solid var(--line); }
.chat-to label { flex: 0 0 auto; margin-right: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.chat-to .pick { flex: 1 1 auto; min-width: 0; margin-top: 0; }
.chat-to:not([hidden]) + #chatForm { border-top: 0; }
.chat-row.private { padding-left: 9px; box-shadow: inset 3px 0 0 var(--attn-line); }
.chat-row.reply { cursor: pointer; }
.chat-private { flex: 0 0 auto; margin-left: 8px; padding: 0 6px; background: var(--attn-bg); color: var(--attn-text); border-radius: 4px; font-size: 12px; font-weight: 600; line-height: 1.6; }
