/* node-4 Chat: the look of docs/mockups (desktop.html, mobile.html). Golos Text — SIL OFL 1.1. */
@font-face { font-family: 'Golos Text'; font-weight: 400 700; font-display: swap; src: url(fonts/golos-text-400-700-cyrillic.woff2) format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; font-weight: 400 700; font-display: swap; src: url(fonts/golos-text-400-700-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #f4f6fb; --panel: #ffffff; --line: #e7eaf1; --ink: #0f1222; --muted: #646c82; --faint: #8e95a9;
  --accent: #4466ff; --accent2: #5b5ef2; --accent-ink: #fff; --accent-soft: #e8ecff; --mine: #4f62f8; --mine-ink: #fff; --theirs: #ffffff;
  --hover: #eef1f8; --ok: #22c55e; --warn: #b45309; --danger: #e5484d; --badge: #ff3b5c; --read: #e3e6ff;
  --grad: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  --lift: 0 1px 2px rgba(17, 24, 39, .05), 0 4px 14px rgba(17, 24, 39, .05);
  --shadow: 0 12px 32px rgba(15, 18, 34, .16);
  /* A conversation: its wall, the line under a message, the time, the days, the quotes, the reactions. */
  --wall: #dfe6ee; --wall-pattern: url(wall.svg);
  --bub-shadow: 0 1px 1px rgba(16, 24, 40, .12); --meta: #8a93a5; --mine-meta: rgba(255, 255, 255, .78); --tick: #ffffff;
  --day: rgba(255, 255, 255, .78); --day-ink: #5a6478;
  --quote: rgba(68, 102, 255, .08); --mine-quote: rgba(255, 255, 255, .16); --mine-quote-bar: #ffffff; --mine-quote-ink: rgba(255, 255, 255, .85);
  --reac: #eaedff; --reac-ink: #3f5bf0; --mine-reac: rgba(255, 255, 255, .2); --mine-reac-ink: #ffffff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e141d; --panel: #151c27; --line: #232a3a; --ink: #e8edf5; --muted: #9aa3b8; --faint: #6e778d;
    --accent: #6f86ff; --accent2: #6a62f0; --accent-soft: #232c52; --mine: #4750d8; --theirs: #1b2431; --hover: #1a2030;
    --ok: #34d36b; --warn: #f0b04a; --danger: #f26b6b; --badge: #ff4d6a; --read: #e3e6ff;
    --grad: linear-gradient(135deg, #3d55e0 0%, #5146cf 100%);
    --lift: 0 1px 2px rgba(0, 0, 0, .35); --shadow: 0 12px 32px rgba(0, 0, 0, .55);
    --wall: #0e141d; --wall-pattern: url(wall-dark.svg);
    --bub-shadow: 0 1px 1px rgba(0, 0, 0, .3); --meta: #7f8aa0; --mine-meta: rgba(255, 255, 255, .72);
    --day: rgba(30, 40, 54, .82); --day-ink: #b9c3d4;
    --quote: rgba(111, 134, 255, .12); --mine-quote: rgba(255, 255, 255, .12); --mine-quote-ink: rgba(255, 255, 255, .8);
    --reac: #262f55; --reac-ink: #a9b6ff; --mine-reac: rgba(255, 255, 255, .16);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e141d; --panel: #151c27; --line: #232a3a; --ink: #e8edf5; --muted: #9aa3b8; --faint: #6e778d;
  --accent: #6f86ff; --accent2: #6a62f0; --accent-soft: #232c52; --mine: #4750d8; --theirs: #1b2431; --hover: #1a2030;
  --ok: #34d36b; --warn: #f0b04a; --danger: #f26b6b; --badge: #ff4d6a; --read: #e3e6ff;
  --grad: linear-gradient(135deg, #3d55e0 0%, #5146cf 100%);
  --lift: 0 1px 2px rgba(0, 0, 0, .35); --shadow: 0 12px 32px rgba(0, 0, 0, .55);
  --wall: #0e141d; --wall-pattern: url(wall-dark.svg);
  --bub-shadow: 0 1px 1px rgba(0, 0, 0, .3); --meta: #7f8aa0; --mine-meta: rgba(255, 255, 255, .72);
  --day: rgba(30, 40, 54, .82); --day-ink: #b9c3d4;
  --quote: rgba(111, 134, 255, .12); --mine-quote: rgba(255, 255, 255, .12); --mine-quote-ink: rgba(255, 255, 255, .8);
  --reac: #262f55; --reac-ink: #a9b6ff; --mine-reac: rgba(255, 255, 255, .16);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font: 14px/1.4 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--ink); background: var(--bg); overflow: hidden; -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: var(--accent); }
[hidden] { display: none !important; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.noscript { padding: 24px; }

/* The first thing drawn, in the colour of the window of the installed app (the manifests): the
   start of the app is one colour from the system's splash to the list of chats. */
.boot { position: fixed; inset: 0; display: grid; place-items: center; align-content: center; gap: 18px; background: var(--panel); }
.boot-note { max-width: 320px; padding: 0 24px; color: var(--muted); font-size: 14px; line-height: 1.4; text-align: center; }
.logo { width: 40px; height: 40px; border-radius: 14px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; letter-spacing: -.5px; flex: none; }
.logo.big { width: 64px; height: 64px; border-radius: 20px; font-size: 24px; }

/* Buttons and fields */
.btn { height: 40px; padding: 0 18px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: var(--hover); color: var(--ink); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.wide { width: 100%; height: 48px; border-radius: 16px; }
.link { color: var(--accent); font-weight: 600; padding: 6px 2px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.input { height: 44px; border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; background: var(--panel); outline: 0; width: 100%; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.code-input { letter-spacing: .5em; font-size: 20px; text-align: center; font-weight: 600; }
.code-input.letters { text-transform: uppercase; }
.error { color: var(--danger); font-size: 13px; min-height: 18px; }
.hint { color: var(--muted); font-size: 13px; }
.ib { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); flex: none; }
.ib:hover { background: var(--hover); color: var(--ink); }
.ib.accent { color: var(--accent); }

/* Sign-in */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; overflow: auto; }
.card { width: 100%; max-width: 400px; background: var(--panel); border: 0; border-radius: 24px; padding: 28px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--lift); }
.card h1 { font-size: 22px; }
.card .head { display: flex; align-items: center; gap: 12px; }
.card .head small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
/* The consent to the processing of personal data (0.2.47): a box nobody ticks for the person. */
.consent { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 13px; line-height: 1.4; cursor: pointer; }
.consent input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.consent a, .legal-links a { color: var(--accent); }
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; }
.card .row2 { display: flex; justify-content: space-between; align-items: center; }
.secure { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 12.5px; }
/* When the SMS with the code does not come (0.2.37): an SMS to the number of Chat, or a call to it. */
.proof { display: flex; flex-direction: column; gap: 10px; }
.proof:empty { display: none; }
.proof-ways { display: flex; flex-direction: column; gap: 8px; }
.proof-ways .btn { width: 100%; }
.proof b { color: var(--ink); white-space: nowrap; }
.proof .proof-code { font-size: 17px; letter-spacing: .12em; }
.secure svg.i { color: var(--ok); width: 16px; height: 16px; margin-top: 1px; }

/* A closed archive replaces the messenger; no conversation remains behind an overlay. */
.archive-lock { z-index: 40; background: var(--bg); padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
.archive-lock-card { margin: auto; }
.archive-form, .archive-trust, .archive-settings-actions { display: flex; flex-direction: column; gap: 12px; }
.archive-ack { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; }
.archive-ack input { flex: none; margin-top: 3px; width: 17px; height: 17px; accent-color: var(--accent); }
.archive-warning { color: var(--danger); }
.archive-limit { font-size: 12px; }
textarea.archive-package { height: 150px; min-height: 90px; max-height: 40dvh; padding: 10px 12px; resize: vertical; overflow-wrap: anywhere; font: 12px/1.5 ui-monospace, monospace; }

/* The app */
.app { height: 100vh; height: 100dvh; display: grid; grid-template-columns: 68px 336px minmax(0, 1fr) auto; }
.rail { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 14px 0; gap: 6px; border-right-color: var(--line); }
.rail .logo { margin-bottom: 14px; }
.ri { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: var(--muted); position: relative; }
.ri:hover { background: var(--hover); }
.ri.on { background: var(--accent-soft); color: var(--accent); }
.badge { position: absolute; top: 4px; right: 3px; background: var(--badge); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 9px; padding: 1px 5px; line-height: 1.35; }
.grow { flex: 1; }
/* The state of the network after «Чаты»: green while connected, grey otherwise. */
.net { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-left: 8px; vertical-align: middle; background: var(--faint); }
.net.online { background: var(--ok); }

.list { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.lh { padding: 18px 16px 10px; display: flex; align-items: center; gap: 8px; }
.lh h1 { font-size: 20px; flex: 1; letter-spacing: -.5px; }
.search { margin: 0 16px 10px; height: 38px; border-radius: 14px; background: var(--hover); display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--faint); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); height: 100%; }
.tabs { display: flex; gap: 6px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; flex: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { font-size: 12.5px; padding: 6px 12px; border-radius: 999px; color: var(--muted); border: 0; white-space: nowrap; background: var(--hover); font-weight: 600; }
.tab.on { background: var(--ink); color: var(--panel); border-color: var(--accent); }
.scroll { overflow-y: auto; min-height: 0; flex: 1; overscroll-behavior: contain; }
.notice { margin: 0 16px 10px; padding: 10px 12px; border-radius: 16px; background: var(--accent-soft); font-size: 13px; display: flex; gap: 10px; align-items: center; }
.notice b { color: var(--accent); }
.notice .grow { min-width: 0; }
/* Ready for calls: a step a line, ✓ when done. */
.ready { display: flex; flex-direction: column; gap: 4px; }
.ready-step { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ready-step:last-of-type { border-bottom: 0; }
.ready-step .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ready-step small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.ready-mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.ready-step.ok .ready-mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.ready-mark svg.i { width: 14px; height: 14px; stroke-width: 3; }
.ready-step .btn { flex: none; }
.ready-phone { margin-top: 6px; font-size: 12.5px; line-height: 1.45; }

.chat { display: flex; gap: 12px; padding: 10px 16px; align-items: center; cursor: pointer; width: 100%; text-align: left; padding-left: 10px; }
.chat:hover { background: var(--hover); }
.chat > * { pointer-events: none; }
.chat.on { background: var(--accent-soft); }
.chat-item { position: relative; overflow: hidden; isolation: isolate; margin: 0 8px; border-radius: 18px; }
.chat-slide { position: relative; background: var(--panel); display: flex; touch-action: pan-y; transition: transform .18s ease; }
.chat-slide .chat { padding-right: 46px; min-height: 68px; }
.chat-item.swiping .chat-slide { transition: none; }
.chat-menu-button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.chat-actions { position: absolute; inset: 0 0 0 auto; width: auto; display: flex; pointer-events: none; visibility: hidden; }
.actions-open .chat-actions, .swiping .chat-actions { pointer-events: auto; visibility: visible; }
.chat-actions button { width: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: #fff; }
.chat-clear { background: #586985; }
.chat-delete { background: #ce3038; }
.chat-mute { background: #4771a9; }
.chat-actions button:hover { filter: brightness(1.12); }
.chat-actions svg.i { width: 24px; height: 24px; }
.chat-slide:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.av { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 15px; flex: none; position: relative; user-select: none; }
.av.sm { width: 32px; height: 32px; font-size: 12px; }
.av.md { width: 38px; height: 38px; font-size: 13px; }
.av.lg { width: 72px; height: 72px; font-size: 22px; }
/* A picture of the account (0.2.40): the circle is the picture; the dot of presence stays over its edge. */
.av > img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.av.photo { background: var(--hover) !important; }
.av > .dot { z-index: 1; }
/* 0.2.48: the big avatar of a profile, and an avatar whose photo opens big at a click. */
.av.xl { width: 112px; height: 112px; font-size: 34px; }
.av.xl .dot { width: 18px; height: 18px; right: 5px; bottom: 5px; border-width: 3px; }
.pic-slot { display: contents; }
.av-open { border-radius: 50%; padding: 0; display: block; flex: none; cursor: zoom-in; }
.av-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.side .top .av-open { margin: 6px auto 10px; }
.side .top .av-open .av { margin: 0; }
.side .top .profile-about, .profile-card .profile-about { margin: 6px 0 2px; font-size: 13.5px; color: var(--ink); overflow-wrap: anywhere; }
.profile-card { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.profile-card .pic-slot > * { margin-bottom: 8px; }
.profile-card .profile-name { font-size: 17px; overflow-wrap: anywhere; }
.profile-card small { color: var(--muted); font-size: 13px; }
.profile-card .acts { margin-top: 12px; flex-wrap: wrap; }
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.profile-head b { font-size: 17px; overflow-wrap: anywhere; }
.profile-head small { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.profile-head small.profile-about { color: var(--ink); }
.about-field small.about-left { color: var(--faint); font-size: 12px; text-align: right; }
.mem-open { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-align: left; border-radius: 12px; }
.mem-open > div { min-width: 0; flex: 1; }
.mem-open:hover { background: var(--hover); }
/* «Область фото» (0.2.48): the photo moves under a circle; what is outside of it is shaded. */
.crop-box { display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.crop { position: relative; width: min(320px, 100%); aspect-ratio: 1; margin: 0 auto; border-radius: 18px; overflow: hidden; background: #111; touch-action: none; cursor: grab; outline: none; }
.crop.moving { cursor: grabbing; }
.crop:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.crop-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0, 0, 0, .55); border: 2px solid rgba(255, 255, 255, .85); pointer-events: none; }
.crop-scale { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; }
.crop-scale input { flex: 1; accent-color: var(--accent); }
/* The photo big (0.2.48). */
.picture-view { position: fixed; inset: 0; z-index: 60; background: rgba(5, 8, 14, .86); display: grid; place-items: center; padding: 24px; cursor: zoom-out; outline: none; }
.picture-view figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.picture-view img { width: min(82vw, 72dvh, 512px); height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 20px; box-shadow: 0 18px 60px rgba(0, 0, 0, .5); user-select: none; }
.picture-view figcaption { color: #fff; font-weight: 600; font-size: 16px; text-align: center; overflow-wrap: anywhere; max-width: min(82vw, 512px); }
.picture-view .picture-close { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; color: #fff; background: rgba(255, 255, 255, .12); }
.photo-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.av .dot { position: absolute; right: 1px; bottom: 1px; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); border: 2px solid var(--panel); }
.av.sm .dot { width: 10px; height: 10px; right: -1px; bottom: -1px; }
/* «В сети», the app put away: a ring. The full dot is «в приложении». */
.av .dot.net { background: var(--panel); box-shadow: inset 0 0 0 2px var(--ok); }
.cm { flex: 1; min-width: 0; }
.cm .t { display: flex; gap: 6px; align-items: center; }
.cm .t b { font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm .t span { font-size: 12px; color: var(--faint); flex: none; }
.mutei { width: 16px; height: 16px; color: var(--danger); flex: none; }
.cm .s { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; margin-top: 2px; }
.cm .s em { font-style: normal; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm .s em.typing { color: var(--accent); }
.cnt { background: var(--grad); color: #fff; font-size: 11.5px; font-weight: 700; border-radius: 10px; padding: 0 6px; flex: none; min-width: 20px; height: 20px; display: inline-grid; place-items: center; line-height: 1; }
.cnt.mute { background: var(--faint); }
.st { display: inline-flex; align-items: center; flex: none; }
.st svg.i { width: 16px; height: 16px; }
.st.read { color: var(--accent); }
.st.failed { color: var(--danger); }
.empty-list { padding: 32px 24px; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 14px; align-items: center; }
.sres { padding: 8px 16px; cursor: pointer; display: block; width: 100%; text-align: left; }
.sres:hover { background: var(--hover); }
.sres small { color: var(--faint); display: block; font-size: 12px; }
.sres span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sec { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 600; padding: 10px 16px 6px; }

/* A conversation */
.conv { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--wall-pattern) repeat, var(--wall); position: relative; background-size: 300px 300px, auto; }
.ch { min-height: 64px; background: var(--panel); border-bottom: 0; display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 18px; flex: none; box-shadow: 0 1px 0 var(--line); position: relative; z-index: 1; }
.ch .cm { cursor: pointer; }
.ch .cm b { font-size: 15.5px; }
.ch .back { display: none; }
.e2e { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-size: 12.5px; white-space: nowrap; }
.e2e svg.i { width: 13px; height: 13px; }
.msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 10px 6px; display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; isolation: isolate; contain: paint; }
.msgs > * { flex-shrink: 0; }
.msgs .spacer { flex: 1; }
.day { align-self: center; font-size: 12.5px; color: var(--day-ink); background: var(--day); border: 0; border-radius: 999px; padding: 3px 11px; margin: 10px 0 4px; box-shadow: none; font-weight: 600; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.sys { align-self: center; font-size: 12.5px; color: var(--muted); text-align: center; max-width: 80%; }
.row { display: flex; gap: 10px; align-items: flex-end; max-width: min(72%, 640px); }
/* A message drawn to the left on a phone is answered; the sign appears at the edge it leaves. */
.swipe-reply { position: absolute; right: 12px; z-index: 2; width: 34px; height: 34px; margin-top: -17px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 0; color: var(--accent); box-shadow: var(--shadow); pointer-events: none; opacity: var(--swipe, 0); transform: scale(calc(.6 + .4 * var(--swipe, 0))); }
.swipe-reply[hidden] { display: none; }
.swipe-reply.armed { background: var(--grad); border-color: var(--accent); color: #fff; }
.swipe-reply svg.i { width: 18px; height: 18px; }
.row.mine { align-self: flex-end; flex-direction: row-reverse; }
/* One person's messages within five minutes stick together (0.2.38): 2 apart instead of the 6 of
   `.msgs`. Where two of them meet, their corners at the side of the sender are small; the last one
   of the group, or one alone, has a hook at its lower corner (`.bub::before`, `::after`). */
.row.join-prev { margin-top: 0; }
.row.cont .av { visibility: hidden; }
.row.flash .bub { animation: flash 1.2s; }
.row:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 16px; }
.msg-check { display: none; width: 21px; height: 21px; flex: none; align-self: center; border: 2px solid var(--faint); border-radius: 50%; color: transparent; }
.msg-check svg.i { width: 17px; height: 17px; stroke-width: 3; }
.selecting .msg-check { display: grid; place-items: center; }
.selecting .row { cursor: pointer; }
.selecting .bub { user-select: none; }
.selected .msg-check { color: #fff; background: var(--accent); border-color: var(--accent); }
.selected .bub { box-shadow: 0 0 0 2px var(--accent), 0 0 0 5px var(--accent-soft); }
.selection-count { flex: 1; font-size: 15px; }
.selection-top .ib { color: var(--accent); }
.selection-top .ib:last-child { color: var(--danger); }
.selection-top .ib:disabled, .selection-action:disabled { opacity: .4; cursor: default; }
.selection-bottom { min-height: 50px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 24px; align-items: center; }
.selection-reactions { flex-basis: 100%; display: flex; justify-content: center; gap: 6px; padding-top: 4px; }
.selection-reaction { width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 21px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.selection-reaction:hover, .selection-reaction.on { background: var(--accent-soft); }
.selection-action { color: var(--accent); display: flex; align-items: center; justify-content: center; gap: 9px; padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.selection-action:hover:not(:disabled) { background: var(--accent-soft); }
.delete-option { display: flex; gap: 9px; align-items: center; padding: 12px 0; }
.delete-option input { width: 18px; height: 18px; accent-color: var(--accent); }
.clipboard-helper { position: fixed; top: 0; left: -9999px; width: 1px; height: 1px; }
.forward-dialog { display: flex; flex-direction: column; gap: 12px; }
.forward-list { max-height: min(45vh, 360px); overflow-y: auto; }
.forward-target { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 8px; text-align: left; border-radius: 10px; }
.forward-target:hover { background: var(--hover); }
.forward-target > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.forward-target > svg.i { color: var(--accent); }
.forward-target:disabled { opacity: .5; cursor: default; }
.forward-dialog summary { color: var(--accent); cursor: pointer; margin-bottom: 10px; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: none; } }
.bub { --big: 18px; --small: 6px; background: var(--theirs); border: 0; border-radius: var(--big) var(--big) var(--big) 6px; padding: 6px 10px 5px 11px; position: relative; min-width: 64px; max-width: 100%; overflow-wrap: anywhere; box-shadow: var(--bub-shadow); line-height: 1.34; }
.join-prev > .bub { border-top-left-radius: var(--small); }
.join-next > .bub { border-bottom-left-radius: var(--small); }
/* On a touch screen a long press opens the menu of the message (with «Копировать»), not a text selection. */
@media (hover: none) { .bub { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; } }
.mine .bub { background: var(--grad); color: var(--mine-ink); border-color: var(--mine); border-radius: var(--big) var(--big) 6px var(--big); box-shadow: var(--bub-shadow); }
.mine.join-prev > .bub { border-top-left-radius: var(--big); border-top-right-radius: var(--small); }
.mine.join-next > .bub { border-bottom-left-radius: var(--big); border-bottom-right-radius: var(--small); }
.mine .bub a { color: #fff; }
.text { white-space: pre-wrap; }
.who { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.meta { font-size: 11.5px; color: var(--meta); margin-top: 2px; display: flex; gap: 4px; justify-content: flex-end; align-items: center; user-select: none; }
.mine .meta { color: var(--mine-meta); }
.mine .meta .st.delivered { opacity: .6; }
.mine .meta .st.read { color: var(--read); }
.mine .meta .st.failed { color: #ffd2d2; cursor: pointer; }
.meta .warn { color: var(--warn); }
/* The time and the ticks to the right of the last line of the text (0.2.37): beside it when
   there is room, under it when the line is full. Only when the text ends the message. */
.bub.tail { display: flow-root; padding-bottom: 5px; }
.bub.tail > .text { display: inline; }
.bub.tail > .meta { float: right; margin: 3px 0 0 10px; position: relative; top: 4px; }
.quote { border-left: 3px solid var(--accent); padding: 3px 8px; margin-bottom: 5px; font-size: 12.5px; color: var(--muted); cursor: pointer; border-radius: 6px; border-left-width: 3px; background: var(--quote); }
.quote b { display: block; color: var(--accent); font-weight: 600; }
.quote span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; }
.mine .quote { border-left-color: var(--mine-quote-bar); color: var(--mine-quote-ink); background: var(--mine-quote); }
.mine .quote b { color: var(--mine-quote-bar); }
.deleted { font-style: italic; color: var(--faint); display: flex; align-items: center; gap: 6px; }
.mine .deleted { color: rgba(255, 255, 255, .8); }
.deleted svg.i { width: 15px; height: 15px; }
.file { display: flex; gap: 10px; align-items: center; margin: 2px 0; text-decoration: none; color: inherit; min-width: 200px; }
.fi { width: 40px; height: 40px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.mine .fi { background: rgba(255, 255, 255, .18); color: #fff; }
.file small { display: block; font-size: 12.5px; color: var(--muted); }
.mine .file small { color: rgba(255, 255, 255, .8); }
.file b { display: block; word-break: break-all; }
.pic { display: block; max-width: min(320px, 100%); max-height: 320px; border-radius: 14px; margin: 4px 0 2px; cursor: zoom-in; background: var(--hover); }
.media-status { margin: 3px 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.mine .media-status { color: rgba(255, 255, 255, .85); }
.media-retry { margin-left: 8px; font-size: inherit; color: inherit; text-decoration: underline; }
.media-file { min-width: 0; max-width: 100%; }
/* 0.2.37: the small picture of a photo or a video that is not on this device yet, and where the file is. */
.pre { position: relative; display: block; max-width: 100%; border-radius: 14px; overflow: hidden; margin: 4px 0 2px; background: var(--hover); cursor: pointer; outline: none; isolation: isolate; }
.pre:focus-visible { box-shadow: 0 0 0 3px var(--accent); }
.pre img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
.pre-video { background: #000; }
.pre-note { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 1px 7px; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.pre-note:empty { display: none; }
.video-file.media-pre { width: var(--media-width); max-width: 100%; }
.video-file.media-ready { width: var(--media-width); max-width: 100%; }
.vid { position: relative; display: block; width: 100%; border-radius: 14px; overflow: hidden; margin: 4px 0 2px; background: #000; cursor: pointer; isolation: isolate; contain: paint; }
.vid video { display: block; width: 100%; height: auto; max-height: 320px; object-fit: contain; pointer-events: none; }
.vid-play { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; }
.vid-play svg.i { width: 24px; height: 24px; margin-left: 3px; stroke: none; }
.vid-dur { position: absolute; left: 8px; bottom: 8px; padding: 1px 6px; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; }
.vid-dur:empty { display: none; }
.vid-dl { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); text-decoration: none; margin: 2px 0; max-width: min(320px, 100%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vid-dl .file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vid-dl svg.i { width: 15px; height: 15px; flex: none; }
.mine .vid-dl { color: var(--mine-meta); }
.aud audio { display: block; width: min(300px, 70vw); margin: 4px 0 2px; }
/* A voice message: ▶, the outline of its sound, its length, «В текст» and the text. */
.voice { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 10px; align-items: center; width: min(300px, 68vw); padding: 4px 0 2px; }
.voice.media-pending { display: block; width: auto; padding: 0; }
.voice.media-pending > :not(.media-status) { display: none; }
.vplay { width: 40px; height: 40px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; }
.vplay:disabled { opacity: .5; }
.vplay svg.i { width: 18px; height: 18px; }
.mine .vplay { background: #fff; color: var(--accent); }
.vwave { display: flex; align-items: center; gap: 2px; height: 30px; cursor: pointer; }
.vwave i { flex: 1; min-width: 2px; max-width: 4px; border-radius: 2px; background: color-mix(in srgb, currentColor 30%, transparent); }
.vwave i.on { background: var(--accent); }
.mine .vwave i.on { background: #fff; }
.vrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; font-size: 12px; opacity: .85; }
.vtotext { font-size: 12px; font-weight: 600; color: var(--accent); padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); }
.mine .vtotext { color: #fff; background: rgba(255, 255, 255, .2); }
.vtotext[hidden] { display: none; }
.vtext { grid-column: 1 / -1; margin-top: 6px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; }
.vtext[hidden] { display: none; }
.vtext.busy, .vtext.err { opacity: .75; font-style: italic; }
/* A video circle (0.2.31): no bubble — the circle, its length over its lower left edge and the
   time of the message over the right one; playing, it grows and a ring shows how far it has gone. */
.round-bub { display: flex; flex-direction: column; align-items: flex-start; background: none !important; border: 0 !important; padding: 0 !important; min-width: 0; box-shadow: none; }
.mine .round-bub { align-items: flex-end; }
.round-bub .reacts { order: 3; }
.round-bub .meta { order: 2; align-self: flex-end; position: relative; z-index: 2; margin: -30px 0 8px; padding: 2px 8px; border-radius: 999px; background: rgba(18, 24, 38, .72); color: #fff; }
.round-bub .quote { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; padding: 4px 10px; margin-bottom: 6px; max-width: min(200px, 56vw); }
/* A circle of one's own has no bubble of one's own colour under it: what was white on that colour is drawn as in a message of another. */
.mine .round-bub .quote { border-left-color: var(--accent); color: var(--muted); }
.mine .round-bub .quote b { color: var(--accent); }
.mine .round-bub .reac { background: var(--accent-soft); color: var(--accent); }
.selected .round-bub { box-shadow: none; }
.selected .round-bub .round-clip { box-shadow: 0 0 0 3px var(--accent), 0 0 0 6px var(--accent-soft); }
.round { --round: 200px; position: relative; width: var(--round); max-width: 100%; aspect-ratio: 1 / 1; border-radius: 50%; cursor: pointer; flex: none; outline: none; transition: width .2s ease, height .2s ease; -webkit-user-select: none; user-select: none; }
.round.open { --round: 280px; }
.round:focus-visible .round-clip { box-shadow: 0 0 0 3px var(--accent); }
.round-clip { position: absolute; inset: 6px; border-radius: 50%; overflow: hidden; background: #0b0f16; box-shadow: 0 1px 3px rgba(15, 23, 42, .18); isolation: isolate; transition: inset .2s ease; }
.round.open .round-clip { inset: 4.5%; }
.round-clip video { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.round-ring { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .2s; pointer-events: none; }
.round.open .round-ring { opacity: 1; }
.round-ring circle, .round-rec-ring circle { fill: none; stroke-width: 2.2; }
.round-ring .track { stroke: var(--line); }
.round-ring .done, .round-rec-ring .done { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.round-play { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; display: grid; place-items: center; pointer-events: none; }
.round-play svg.i { width: 22px; height: 22px; margin-left: 3px; stroke: none; }
.round.playing .round-play, .round.media-pending .round-play, .round.broken .round-play { display: none; }
.round-time { position: absolute; left: 4px; bottom: 8px; z-index: 1; padding: 2px 8px; border-radius: 999px; background: rgba(18, 24, 38, .72); color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; display: flex; gap: 4px; align-items: center; pointer-events: none; }
.round-time svg.i { width: 14px; height: 14px; display: none; }
.round.open .round-time { left: 14px; bottom: 16px; }
.round.open .round-time svg.i { display: block; }
.round.media-pending .round-time, .round.broken .round-time { display: none; }
.round-status { position: absolute; inset: 6px; z-index: 1; border-radius: 50%; display: grid; place-items: center; align-content: center; gap: 6px; padding: 0 22px; text-align: center; font-size: 12.5px; line-height: 1.35; color: var(--muted); background: var(--hover); border: 1px dashed var(--line); }
.round-status a, .mine .round-status a { font-weight: 600; color: var(--accent); }
/* 0.2.37: the first frame of a circle comes inside the message; over it only what the person asked about is said. */
.round-pre { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.round.has-pre.media-pending .round-play { display: grid; }
.round.has-pre.media-pending .round-time { display: flex; }
.round.has-pre.said .round-play { display: none; }
.round.has-pre .round-status, .mine .round.has-pre .round-status { color: #fff; background: rgba(11, 15, 22, .62); border: 0; }
.round.has-pre .round-status a, .round.has-pre .round-status .media-retry { color: #fff; }
.reacts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.reac { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; border-radius: 999px; padding: 2px 8px; background: var(--reac); color: var(--reac-ink); font-weight: 600; border: 0; box-shadow: none; }
.reac.on { box-shadow: inset 0 0 0 1.5px var(--accent); }
.mine .reac { background: var(--mine-reac); color: var(--mine-reac-ink); }
.typing-line { color: var(--muted); font-size: 12.5px; padding: 0 28px 4px; min-height: 22px; }
.down { position: absolute; right: 24px; bottom: 96px; width: 42px; height: 42px; border-radius: 50%; background: var(--panel); border: 0; box-shadow: var(--shadow); display: grid; place-items: center; color: var(--muted); }
.down .cnt { position: absolute; top: -6px; right: -4px; }
.drop { position: absolute; inset: 0; background: rgba(68, 102, 255, .12); border: 3px dashed var(--accent); display: grid; place-items: center; font-weight: 600; color: var(--accent); font-size: 18px; z-index: 5; pointer-events: none; }

.comp-wrap { padding: 0 20px 18px; flex: none; position: relative; }
.bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--panel); border: 0; border-bottom: 0; border-radius: 14px 14px 0 0; font-size: 13px; box-shadow: var(--bub-shadow); }
.bar svg.i { color: var(--accent); }
.bar .cm b { color: var(--accent); font-size: 13px; }
.bar .cm span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.bar + .comp { border-radius: 0 0 14px 14px; }
.files-bar { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 12px; background: var(--panel); border: 0; border-bottom: 0; border-radius: 14px 14px 0 0; box-shadow: var(--bub-shadow); }
.files-bar + .comp, .files-bar + .bar { border-radius: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--hover); border-radius: 8px; padding: 4px 6px 4px 10px; font-size: 12.5px; max-width: 240px; }
.chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip button { width: 20px; height: 20px; display: grid; place-items: center; color: var(--muted); border-radius: 6px; }
/* 0.2.44: an attached picture or video — its small picture, and a tap opens the viewer. */
.chip.media { cursor: pointer; padding-left: 4px; }
.chip.media:hover { background: color-mix(in srgb, var(--hover) 70%, var(--ink) 8%); }
.chip.media:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip-pic { width: 36px; height: 36px; flex: none; object-fit: cover; border-radius: 6px; background: var(--line); pointer-events: none; }
.comp { background: var(--panel); border: 0; border-radius: 24px; display: flex; align-items: flex-end; gap: 6px; padding: 6px 8px; box-shadow: var(--bub-shadow); }
.comp textarea { flex: 1; min-width: 0; border: 0; outline: 0; background: none; resize: none; max-height: 180px; min-height: 36px; padding: 7px 4px; line-height: 22px; }
.composer-tools { position: relative; width: 78px; height: 36px; flex: none; transition: width .18s ease; }
.composer-tools > .emoji-toggle { position: relative; z-index: 2; background: var(--panel); }
.attach-slot { position: absolute; left: 42px; bottom: 0; width: 36px; height: 36px; transition: transform .18s ease, opacity .18s ease; }
.attach-toggle { width: 36px; height: 36px; }
.composer-tools.has-text { width: 36px; }
.composer-tools.has-text .attach-slot { transform: translateX(-42px); opacity: 0; pointer-events: none; }
.composer-tools.attachment-open .attach-slot { transform: translate(-42px, -50px); opacity: 1; pointer-events: auto; z-index: 3; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }
.emoji-toggle[aria-expanded="true"] { color: var(--accent); background: var(--accent-soft); }
.emoji-picker { position: absolute; bottom: calc(100% + 4px); left: 20px; z-index: 15; width: min(360px, calc(100% - 40px)); max-height: min(330px, calc(var(--chat-viewport-height, 100dvh) - 120px)); overflow-y: auto; overscroll-behavior: contain; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); }
.emoji-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-left: 8px; }
.emoji-head b { font-size: 13px; color: var(--muted); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; }
.emoji-grid button { display: grid; place-items: center; min-height: 38px; border-radius: 8px; font-size: 24px; line-height: 1; touch-action: manipulation; }
.emoji-grid button:hover, .emoji-grid button:focus-visible { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: -2px; }
.recording > .comp:not(.recbar) .send { display: none !important; }
.recording > .comp:not(.recbar) .attach-slot { visibility: hidden; pointer-events: none; }
.recording .recbar { margin-bottom: 6px; }
.send { width: 36px; height: 36px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; }
.send:disabled { opacity: .5; }
.send[hidden] { display: none; }
/* Recording a voice message in place of the composer. */
.recbar { align-items: center; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); flex: none; animation: recpulse 1s ease-in-out infinite; }
@keyframes recpulse { 50% { opacity: .25; } }
.rec-time { font-variant-numeric: tabular-nums; min-width: 40px; }
.rec-wave { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 2px; height: 28px; overflow: hidden; color: var(--accent); }
.rec-wave i { width: 3px; flex: none; border-radius: 2px; background: currentColor; }
/* The button of a video circle, and a circle being sent above the composer (0.2.31). */
/* 0.2.50: one button records a voice message or a circle; a swipe up or a long press switches. */
.send.mic { touch-action: none; -webkit-touch-callout: none; user-select: none; }
.send.mic.round-kind svg.i { width: 22px; height: 22px; }
.record-kinds { position: fixed; z-index: 90; transform: translate(-50%, -100%); display: flex; align-items: center; gap: 4px; padding: 4px 10px 4px 4px; border-radius: 999px;
  background: var(--panel); color: var(--muted); box-shadow: var(--shadow); border: 1px solid var(--line); font-size: 12.5px; pointer-events: none; transition: opacity .3s; }
.record-kinds span { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; }
.record-kinds span.on { background: var(--accent-soft); color: var(--accent); }
.record-kinds b { margin-left: 4px; color: var(--ink); font-weight: 600; }
.record-kinds.gone { opacity: 0; }
.round-out { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; margin-bottom: 6px; background: var(--panel); border: 0; border-radius: 14px; font-size: 13px; box-shadow: var(--lift); }
.round-out-pic { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: none; background: #0b0f16; }
.round-out-pic video { display: block; width: 100%; height: 100%; object-fit: cover; }
.round-out .cm b { display: block; font-size: 13px; font-weight: 600; }
.round-out .cm span { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.round-out.failed .cm span { color: var(--danger); }
.round-out.files-out .round-out-pic { border-radius: 10px; }
.round-out-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.files-out-pic { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: #fff; }
.round-again { height: 32px; padding: 0 12px; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 600; font-size: 13px; flex: none; }
/* Recording a video circle: the camera over the conversation. */
.round-rec { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; background: #0b0f16; color: #fff; padding-bottom: env(safe-area-inset-bottom); }
.round-rec-top { display: flex; align-items: center; gap: 6px; padding: 22px 20px 0; padding-top: max(22px, env(safe-area-inset-top)); font-size: 13px; color: #8fe3ad; text-align: center; }
.round-rec-top svg.i { width: 14px; height: 14px; }
.round-rec-main { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 12px 16px; }
.round-rec-circle { --size: min(290px, 74vw, 48vh); position: relative; width: var(--size); height: var(--size); flex: none; }
@supports (height: 1dvh) { .round-rec-circle { --size: min(290px, 74vw, 48dvh); } }
.round-rec-ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.round-rec-ring .track { stroke: rgba(255, 255, 255, .22); }
.round-rec-ring .done { stroke: #ef4444; }
.round-rec-clip { position: absolute; inset: 3.5%; border-radius: 50%; overflow: hidden; background: #000; isolation: isolate; }
.round-rec-clip video { display: block; width: 100%; height: 100%; object-fit: cover; }
.round-rec.mirrored .round-rec-clip video { transform: scaleX(-1); }
.round-canvas { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.round-rec-wait { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; color: rgba(255, 255, 255, .8); }
.round-rec-time { display: flex; align-items: center; gap: 8px; font-size: 17px; font-variant-numeric: tabular-nums; }
.round-rec-time b { font-weight: 600; }
.round-rec-time > span:last-child { color: rgba(255, 255, 255, .7); }
.round-rec.pending .round-rec-time { visibility: hidden; }
.round-rec-to { max-width: 90%; font-size: 13px; color: rgba(255, 255, 255, .72); text-align: center; overflow-wrap: anywhere; }
.round-rec-bar { width: 100%; max-width: 420px; display: flex; justify-content: space-between; align-items: flex-start; padding: 0 28px 32px; }
.round-rec-btn { width: 84px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: #fff; font-size: 12.5px; }
.round-rec-btn > span { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .14); }
.round-rec-btn:hover:not(:disabled) > span { background: rgba(255, 255, 255, .24); }
.round-rec-btn.go > span { width: 64px; height: 64px; margin-top: -4px; background: var(--accent); box-shadow: 0 6px 18px rgba(68, 102, 255, .45); }
.round-rec-btn.go:hover:not(:disabled) > span { background: var(--accent); filter: brightness(1.08); }
.round-rec-btn:disabled { opacity: .45; cursor: default; }
.round-rec-btn:focus-visible { outline: none; }
.round-rec-btn:focus-visible > span { outline: 2px solid #fff; outline-offset: 3px; }
.readonly { padding: 14px 20px 20px; text-align: center; color: var(--muted); }

.empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 24px; }
.empty > div { display: flex; flex-direction: column; gap: 10px; align-items: center; max-width: 380px; }
.empty .logo { margin-bottom: 6px; }
.empty h2 { color: var(--ink); font-size: 18px; }

/* The info panel */
.side { width: 300px; background: var(--panel); border-left: 1px solid var(--line); padding: 18px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; min-height: 0; }
.side .top { text-align: center; position: relative; }
.side .top .av { margin: 6px auto 10px; }
.side .top b { font-size: 16px; display: block; }
.side .top b .mutei { display: inline-block; vertical-align: -2px; margin-left: 6px; }
.side .top small { color: var(--muted); font-size: 13px; display: block; }
.side .close { position: absolute; top: -6px; right: -6px; }
.acts { display: flex; justify-content: center; gap: 10px; }
.act { width: 76px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.act > span { width: 40px; height: 40px; border-radius: 14px; background: var(--hover); display: grid; place-items: center; color: var(--accent); }
.act.on > span { background: var(--accent); color: #fff; }
.box { border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; font-size: 13px; }
.box .h { display: flex; align-items: center; gap: 6px; font-weight: 600; margin-bottom: 4px; }
.box .h.ok { color: var(--ok); }
.box .h svg.i { width: 16px; height: 16px; }
.box .link { padding: 4px 0 0; font-size: 13px; }
.side .sec { padding: 4px 0 0; }
.mem { display: flex; align-items: center; gap: 10px; font-size: 13.5px; width: 100%; text-align: left; }
.mem > div:not(.av) { min-width: 0; flex: 1; }
.mem small { color: var(--faint); display: block; font-size: 12px; }
.mem .x { color: var(--faint); }
.contact-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.contact-row > .mem { flex: 1; min-width: 0; }
.contact-row > .ib { width: 36px; height: 36px; flex: none; }
/* «Собеседники» (0.2.51): the filter «Все / CRM» and the mark of a colleague of the CRM. */
.contacts-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.crm-mark { margin-left: 6px; font-size: 10.5px; padding: 1px 7px; vertical-align: 1px; }
.mute-options { display: flex; flex-direction: column; gap: 6px; }
.mute-options button { width: 100%; padding: 12px; border-radius: 9px; text-align: left; display: flex; align-items: center; gap: 10px; }
.mute-options button:hover, .mute-options button:focus-visible { background: var(--hover); }
.danger-link { color: var(--danger); font-weight: 600; text-align: left; padding: 6px 0; }
/* What takes a danger back (0.2.35: «Разблокировать») stands where the danger stood, in the calm colour. */
.danger-link.calm { color: var(--accent); }
.side .top small.blocked { color: var(--danger); }
.contents { display: flex; flex-direction: column; gap: 10px; }
.contents-tabs { display: flex; width: 100%; }
/* Each tab as wide as its words, and what is left shared equally: «Голосовые 12» does not fit a quarter of a phone. */
.contents-tabs button { flex: 1 1 auto; padding: 7px 4px; min-width: 0; white-space: nowrap; }
.contents-tabs .n { margin-left: 4px; color: var(--faint); font-weight: 400; font-size: 11.5px; }
/* Three equal columns whatever the pictures are: a plain `1fr` grows to the width of a picture. */
.contents-list.contents-media { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
.contents-list.contents-media > .hint { grid-column: 1 / -1; }
.contents-tile { position: relative; aspect-ratio: 1; width: 100%; min-width: 0; padding: 0; border-radius: 6px; overflow: hidden; background: var(--hover); display: grid; place-items: center; }
.contents-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.contents-tile.round img { inset: 6%; width: 88%; height: 88%; border-radius: 50%; }
.contents-tile .mark { position: absolute; right: 4px; bottom: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; }
.contents-tile .mark svg.i { width: 14px; height: 14px; }
.contents-list:not(.contents-media) { display: flex; flex-direction: column; gap: 2px; }
.contents-row, .contents-link { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 6px 4px; border-radius: 8px; color: var(--ink); text-decoration: none; min-width: 0; }
.contents-row:hover, .contents-link:hover { background: var(--hover); }
.contents .ci { width: 34px; height: 34px; flex: none; border-radius: 9px; background: var(--accent-soft, var(--hover)); color: var(--accent); display: grid; place-items: center; }
.contents .grow { min-width: 0; }
.contents .grow b, .contents .grow small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contents .grow b { font-size: 13px; font-weight: 600; }
.contents .grow small, .contents small.when { color: var(--faint); font-size: 12px; }
.contents small.when { flex: none; }
.readonly .link { font-weight: 600; }
.about-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.leave { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.buttons-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

/* Settings and contacts */
/* The page column scrolls inside itself, on the computer and on the phone alike. */
.pagewrap { display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }
.page { flex: 1; overflow-y: auto; padding: 28px; min-height: 0; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.page > div { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.page h2 { font-size: 20px; }
.page h3 { font-size: 15px; margin-bottom: 4px; }
.panel { background: var(--panel); border: 0; border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--lift); }
.line { display: flex; align-items: center; gap: 12px; }
.line > div:first-child { flex: 1; min-width: 0; }
.line small { display: block; color: var(--muted); font-size: 12.5px; }
/* A name that does not fit ends with «…» (0.2.48): the whole of it is in the hint. */
.line small.one-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line > div:has(> small.one-line) { min-width: 0; }
.sound-acts { display: flex; gap: 4px; flex: none; }
.key-acts { display: flex; gap: 6px; justify-content: flex-end; }
/* A line whose buttons go under its words when the two do not fit side by side (a phone): «Фото» and
   «Синхронизация с другими устройствами» would be squeezed into a narrow column beside them. */
.line.wrap { flex-wrap: wrap; row-gap: 8px; }
.line.wrap > div:first-child { flex: 1 1 220px; }
/* «Синхронизировать» and «Сбросить» (0.2.45) in one row (0.2.46), on a phone too: there the buttons are a little narrower. */
.sync-buttons { display: flex; gap: 8px; justify-content: flex-end; }
@media (max-width: 760px) { .sync-buttons .btn { padding: 0 10px; } }
.dev { display: flex; gap: 12px; align-items: center; padding: 6px 0; }
.dev + .dev { border-top: 1px solid var(--line); padding-top: 12px; }
.dev .fi { width: 36px; height: 36px; }
.dev > div:nth-child(2) { flex: 1; min-width: 0; }
.dev small { display: block; color: var(--muted); font-size: 12.5px; }
.dev code { font-size: 11.5px; color: var(--faint); }
.pill { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.seg { display: inline-flex; background: var(--hover); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { padding: 7px 14px; border-radius: 11px; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); font-weight: 600; }
/* The app for Windows in «О программе» (0.2.45): its rows are those of the panel. */
.desktop-settings { display: contents; }
.update-state { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.switch { width: 46px; height: 28px; border-radius: 14px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch.on { background: var(--grad); }
.switch.on::after { transform: translateX(18px); }

/* Dialogs, menus, toasts */
/* --chat-keyboard-inset: the part of the window under a keyboard that lies over the page (app.js,
   syncComposerViewport). What is fixed to the window ends above it. */
.veil { position: fixed; inset: 0; bottom: var(--chat-keyboard-inset, 0px); background: rgba(10, 15, 25, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { width: 100%; max-width: 420px; max-height: calc(100dvh - 32px - var(--chat-keyboard-inset, 0px)); overflow-y: auto; background: var(--panel); border-radius: 24px; padding: 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.modal h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.modal h2 span { flex: 1; }
.modal .buttons { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
/* «Поддержка» (0.2.39): the topic, the address to answer to, the text, and where it goes. */
.support-form { display: flex; flex-direction: column; gap: 12px; }
.support-text { height: 140px; padding: 10px 12px; resize: vertical; line-height: 1.4; }
.support-address { text-align: center; }
.found { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; }
.found > div:nth-child(2) { flex: 1; min-width: 0; }
.found small { display: block; color: var(--muted); }
/* Contacts of the phone (0.2.26): who is here, whom to invite. */
.picked-contacts { display: flex; flex-direction: column; gap: 8px; }
.picked-contacts:empty { display: none; }
.phone-contacts > .picked-contacts { margin: 12px 0; }
a.btn { text-decoration: none; }
.error .invite-sms { white-space: nowrap; }
.picked { display: flex; flex-wrap: wrap; gap: 6px; }
.safety { display: grid; grid-template-columns: repeat(4, auto); gap: 6px 18px; justify-content: center; font: 600 17px/1.3 ui-monospace, 'Cascadia Mono', 'Noto Sans Mono', monospace; letter-spacing: 1px; padding: 12px 0; }
.viewer { position: fixed; top: 0; left: 0; width: 100%; height: 100dvh; min-width: 0; min-height: 0; overflow: hidden; background: rgba(0, 0, 0, calc(.88 * var(--viewer-fade, 1))); z-index: 60; display: grid; grid-template-rows: minmax(0, 1fr) auto; place-items: center; gap: 12px; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); cursor: zoom-out; }
.viewer img { min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; cursor: default; }
.viewer-stage { width: 100%; height: 100%; min-width: 0; min-height: 0; display: grid; place-items: center; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: zoom-in; }
.viewer-stage img { transform-origin: center; cursor: inherit; -webkit-user-drag: none; }
.viewer-stage.zoomed { cursor: grab; }
.viewer-stage.zoomed.dragging { cursor: grabbing; }
.viewer.video, .viewer.video .viewer-stage { cursor: default; }
.viewer-stage video { transform-origin: center; }
.viewer.video video { width: min(100%, 1100px); min-height: 0; max-height: 100%; object-fit: contain; border-radius: 6px; background: #000; align-self: center; }
.viewer.video .viewer-stage.zoomed video { cursor: grab; }
.viewer.video .viewer-stage.zoomed.dragging video { cursor: grabbing; }
.viewer-bar { position: relative; z-index: 1; display: flex; gap: 10px; justify-content: center; align-items: center; opacity: var(--viewer-fade, 1); }
/* A picture swiped away takes the backdrop and the buttons with it; released, they follow smoothly. */
.viewer.settling { transition: background-color .16s ease-out; }
.viewer.settling .viewer-bar { transition: opacity .16s ease-out; }
.viewer-count { color: rgba(255, 255, 255, .78); font-size: 13.5px; font-variant-numeric: tabular-nums; min-width: 52px; text-align: center; }
.viewer-bar .btn { color: #fff; background: rgba(255, 255, 255, .14); display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.menu { position: fixed; z-index: 70; background: var(--panel); border: 0; border-radius: 16px; box-shadow: var(--shadow); padding: 6px; min-width: 200px; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 10px; text-align: left; }
.menu button:hover { background: var(--hover); }
.menu button.danger { color: var(--danger); }
.menu .emo { display: flex; justify-content: space-between; padding: 2px 2px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu .emo button { width: 34px; height: 34px; padding: 0; justify-content: center; font-size: 18px; border-radius: 50%; }
/* Where the sound of a call goes: over the screen of the call. */
.place-menu { z-index: 95; min-width: 210px; }
.place-menu button span { flex: 1; }
.place-menu button[aria-checked="true"] { color: var(--accent); font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: calc(28px + var(--chat-keyboard-inset, 0px)); transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 16px; border-radius: 14px; z-index: 80; font-size: 13.5px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }

.tabbar { display: none; }

/* A call: over everything (docs/mockups/mobile.html, «Входящий звонок»). */
.call { position: fixed; inset: 0; z-index: 90; background: linear-gradient(180deg, #24306b, #0b0e15); color: #fff; display: flex; flex-direction: column; align-items: center; overflow: hidden; }
/* The engine's canvas takes the place of the slot. */
.call-slot { display: contents; }
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.call-me { position: absolute; right: 16px; bottom: 140px; width: min(30vw, 220px); border-radius: 14px; overflow: hidden; background: #000; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); z-index: 2; touch-action: none; cursor: grab; }
.call-me.settling { transition: left .2s ease, top .2s ease; }
.call-local { display: block; width: 100%; max-height: 40vh; object-fit: cover; }
/* The front camera is shown as a mirror, the main one as it is. */
.call-local.mirror { transform: scaleX(-1); }
.call-remote.off, .call-me.off { opacity: 0; pointer-events: none; }
.me-btn { position: absolute; top: 6px; width: 30px; height: 30px; border-radius: 50%; background: rgba(15, 23, 42, .55); color: #fff; display: grid; place-items: center; }
.me-btn svg.i { width: 17px; height: 17px; }
.me-switch { left: 6px; }
.me-close { right: 6px; }
.call-me-show { position: absolute; right: 16px; bottom: 140px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .18); color: #fff; display: grid; place-items: center; }
.me-btn[hidden], .call-me-show[hidden] { display: none; }
/* «Свернуть в окошко» (0.2.30): the call goes on in a small window over other apps. */
.call-min { position: absolute; left: 16px; top: max(16px, env(safe-area-inset-top)); z-index: 3; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .18); color: #fff; display: grid; place-items: center; }
.call-min[hidden] { display: none; }
.call-min svg.i { width: 22px; height: 22px; }
/* The picture of that window: played by the page, shown only by the window. */
.call-mini { position: absolute; left: 0; top: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; }
/* What is said during a call is said over the call (0.2.30: it was under it), above its buttons. */
.call ~ .toast { z-index: 96; left: 16px; right: 16px; bottom: calc(184px + env(safe-area-inset-bottom)); transform: none; width: fit-content; max-width: min(460px, calc(100vw - 32px)); margin: 0 auto; text-align: center; line-height: 1.35; }
.call-note { margin-top: 10px; display: inline-block; padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, .35); color: #fde68a; font-size: 13.5px; text-shadow: none; }
/* The link of the call: its quality and its way. */
.call-net { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 5px 11px 5px 8px; border-radius: 999px; background: rgba(0, 0, 0, .3); color: #fff; font-size: 12.5px; text-shadow: none; }
.call-net[hidden] { display: none; }
.call-net .bars { width: 16px; height: 16px; flex: none; }
.call-net .bars rect { fill: rgba(255, 255, 255, .3); }
.call-net.good .bars rect.on { fill: #4ade80; }
.call-net.fair .bars rect.on { fill: #facc15; }
.call-net.poor .bars rect.on { fill: #f87171; }
.call-net.lost { color: #fecaca; }
.call-who { position: relative; z-index: 1; margin-top: max(12vh, 56px); text-align: center; padding: 0 16px; }
.call-who .av { width: 116px; height: 116px; font-size: 38px; margin: 0 auto 18px; }
.call-who h2 { font-size: 28px; font-weight: 600; }
.call-who p { color: #c7d2fe; margin-top: 6px; font-size: 15px; }
.call-e2e { margin-top: 10px; font-size: 13px; color: #86efac; display: inline-flex; gap: 4px; align-items: center; }
.call-e2e svg.i { width: 14px; height: 14px; }
.call.has-video .call-who { margin-top: max(16px, env(safe-area-inset-top)); text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
.call.has-video .call-who .av, .call.has-video .call-e2e { display: none; }
.call.has-video .call-who h2 { font-size: 18px; }
.call-bar { position: relative; z-index: 1; margin-top: auto; margin-bottom: max(40px, env(safe-area-inset-bottom)); display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; padding: 14px 18px 12px; border-radius: 32px; background: rgba(20, 22, 32, .5); }
.cb { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; color: #e0e7ff; min-width: 72px; }
.cb > span { width: 64px; height: 64px; border-radius: 50%; background: rgba(255, 255, 255, .16); display: grid; place-items: center; color: #fff; }
.cb.red > span { background: #ef4444; }
.cb.green > span { background: #22c55e; }
.cb.on > span { background: #fff; color: #0f172a; }
.cb svg.i { width: 28px; height: 28px; }
.cb svg.i.hang { transform: rotate(135deg); }

/* The look of a conversation (0.2.42): a hairline under a message instead of a line around it, closer
   messages, a picture framed by its message with the time over it, the days and the reactions as soft
   pills, a quiet wall with a pattern of small signs. */
.row:not(.join-prev) { margin-top: 6px; }
/* The ticks of one's own message are white; read and not sent keep their own colours. */
.mine .meta .st { color: var(--tick); }
/* A message with a photo or a video: the picture 3 from the edges of the message, all the rest 11
   from them as in any message — the picture goes 8 out over the room of the message. */
.bub:has(> .media-file :is(.pic, .vid, .pre)) { padding: 3px 11px 5px; }
.bub > .media-file:has(.pic, .vid, .pre) { margin: 0 -8px; max-width: none; }
.bub > .media-file:has(.pic, .vid, .pre) + .media-file:has(.pic, .vid, .pre) { margin-top: 2px; }
.bub > .media-file:has(.pic, .vid, .pre):has(+ .text) { margin-bottom: 4px; }
.bub:has(> .media-file :is(.pic, .vid, .pre)) > :is(.who, .quote):first-child { margin-top: 3px; }
.bub .media-file :is(.pic, .vid, .pre) { margin: 0; border-radius: 15px 15px 6px 6px; max-width: min(300px, 72vw); }
.bub .media-file .pic { max-height: 380px; width: auto; }
.bub > .video-file:has(.vid, .pre) { width: min(var(--media-width, 300px), 300px, 72vw); }
.bub > .media-file:has(.vid, .pre) .vid-dl { margin: 4px 8px 0; }
.mine .vid-dl .file-name { color: var(--mine-meta); }
/* With words the message is as wide as its picture, and not narrower than 220. */
.bub:has(> .media-file :is(.pic, .vid, .pre)):has(> .text) { width: min-content; min-width: min(220px, 100%); }
/* Without words: 3 all round, and over a photo the time stands on the picture. */
.bub:has(> .media-file :is(.pic, .vid, .pre)):not(:has(> .text)) { padding: 3px; }
.bub:has(> .media-file :is(.pic, .vid, .pre)):not(:has(> .text)) > .media-file { margin-left: 0; margin-right: 0; }
.bub:has(> .media-file :is(.pic, .vid, .pre)):not(:has(> .text)) > :is(.who, .quote, .reacts, .meta) { margin-left: 8px; margin-right: 8px; }
.bub:has(> .media-file :is(.pic, .vid, .pre)):not(:has(> .text)) .media-file :is(.pic, .vid, .pre) { border-radius: 15px 15px 15px 4px; }
.mine .bub:has(> .media-file :is(.pic, .vid, .pre)):not(:has(> .text)) .media-file :is(.pic, .vid, .pre) { border-radius: 15px 15px 4px 15px; }
.bub:has(> .media-file :is(.pic, .vid, .pre)):not(:has(> .text, > .reacts, .vid-dl)) > .meta { position: absolute; right: 10px; bottom: 10px; margin: 0; padding: 1px 7px; border-radius: 10px; background: rgba(12, 16, 24, .5); color: #fff; z-index: 2; }
.bub:has(> .media-file :is(.pic, .vid, .pre)):not(:has(> .text, > .reacts, .vid-dl)) > .meta .st { color: #fff; }

/* Without the info panel on mid-size screens it opens over the conversation. */
@media (max-width: 1199px) {
  .app { grid-template-columns: 68px 320px minmax(0, 1fr); }
  .side { position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; box-shadow: var(--shadow); }
}

/* Phones, and a narrow window of a computer (0.2.45: up to 900 wide, where the list, the
   conversation and the settings no longer fit side by side): one screen at a time, tabs at the
   bottom (docs/mockups/mobile.html). */
@media (max-width: 900px) {
  body { font-size: 15px; }
  .app { grid-template-columns: 100%; grid-template-rows: minmax(0, 1fr) auto; position: fixed; left: 0; right: 0; top: var(--chat-viewport-top, 0px); height: var(--chat-viewport-height, 100dvh); }
  /* The keyboard comes and goes in about 0.3 s, and the app with it: its lower edge rides on the
     keyboard (the time and the curve are those of the system's own animation). */
  .keyboard-moving .app { transition: height 285ms cubic-bezier(.2, 0, 0, 1); }
  .keyboard-moving .veil { transition: bottom 285ms cubic-bezier(.2, 0, 0, 1); }
  .side { bottom: var(--chat-keyboard-inset, 0px); padding-bottom: 16px; }
  .rail { display: none; }
  .list, .conv, .pagewrap { grid-column: 1; grid-row: 1; border: 0; }
  .app[data-view="chats"] .conv, .app[data-view="chats"] .pagewrap { display: none; }
  .app[data-view="conv"] .list, .app[data-view="conv"] .pagewrap, .app[data-view="conv"] .tabbar { display: none; }
  /* Swipes are the phone's: horizontal moves of the conversation belong to the app, the vertical
     scroll and the pinch stay the browser's. A swiped message returns to its place smoothly. */
  .conv .ch, .conv .msgs, .conv .typing-line { touch-action: pan-y pinch-zoom; }
  .row { transition: transform .18s ease; }
  .row.swiping { transition: none; }
  /* The conversation drawn to the right uncovers the list of chats it returns to. */
  .app.back-swipe[data-view="conv"] .list, .app.back-swipe[data-view="conv"] .tabbar { display: flex; }
  .app.back-swipe .conv { grid-row: 1 / -1; z-index: 3; box-shadow: -8px 0 22px rgba(0, 0, 0, .18); transition: transform .18s ease-out; will-change: transform; }
  .app.back-swipe .conv.swiping { transition: none; }

  .app[data-view="page"] .list, .app[data-view="page"] .conv { display: none; }
  .lh { padding: 14px 16px 8px; padding-top: max(14px, env(safe-area-inset-top)); }
  .lh h1 { font-size: 32px; letter-spacing: -.9px; }
  .av { width: 52px; height: 52px; }
  .chat { padding: 10px 10px; }
  .chat .cm { border-bottom: 0; padding-bottom: 0; }
  .ch { height: auto; min-height: 56px; padding: 6px 8px 6px 4px; padding-top: max(6px, env(safe-area-inset-top)); gap: 8px; }
  .ch .back { display: grid; color: var(--accent); }
  .ch .av { width: 38px; height: 38px; }
  .ch .cm .s { white-space: nowrap; overflow: hidden; }
  .ch .cm .s > span:first-child { overflow: hidden; text-overflow: ellipsis; }
  .ch .cm .s > span[data-presence-account] { white-space: normal; overflow: visible; text-overflow: clip; min-width: 0; }
  .e2e-t { display: none; }
  .msgs { padding: 10px 10px 6px; background: transparent; }
  .row { max-width: 86%; }
  .row .av.sm { display: none; }
  .bub { font-size: 15px; }
  .typing-line { padding: 0 14px 2px; }
  .comp-wrap { padding: 6px 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); border-top: 0; background: transparent; }
  /* On a keyboard that lies over the page the composer stands on the keyboard, not on the
     edge of the screen: the room left for the gesture bar of the system is not needed. */
  .keyboard-up .comp-wrap { padding-bottom: 8px; }
  .keyboard-moving .comp-wrap { transition: padding-bottom 285ms cubic-bezier(.2, 0, 0, 1); }
  .comp { border-radius: 24px; border-color: var(--line); padding: 4px 4px 4px 8px; }
  .comp textarea { font-size: 16px; }
  .emoji-picker { left: 8px; width: min(360px, calc(100% - 16px)); }
  .bar, .files-bar { border-radius: 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; border: 0; }
  .bar + .comp, .files-bar + .comp { border-radius: 24px; }
  .files-bar + .bar { border-radius: 12px; }
  .send { border-radius: 50%; }
  .round { --round: min(200px, 56vw); }
  .round.open { --round: min(280px, 76vw); }
  .round-rec-bar { padding: 0 20px 28px; }
  .down { bottom: 84px; right: 14px; }
  .side { width: 100%; border: 0; padding-top: max(18px, env(safe-area-inset-top)); }
  .page { padding: 16px; padding-top: max(16px, env(safe-area-inset-top)); padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; grid-column: 1; grid-row: 1; border-top: 1px solid var(--line); justify-content: space-around; padding: 6px; background: var(--panel); align-self: end; z-index: 4; margin: 0 16px max(12px, env(safe-area-inset-bottom)); border: 0; border-radius: 24px; box-shadow: 0 10px 30px rgba(15, 18, 34, .14), 0 0 0 1px var(--line); }
  .tb { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--faint); position: relative; min-width: 96px; padding: 6px 0; border-radius: 18px; font-weight: 600; }
  .tb svg.i { width: 24px; height: 24px; }
  .tb.on { color: var(--accent); background: var(--accent-soft); }
  .tb .badge { top: 0; right: 24px; }
  .modal { border-radius: 24px; }
  .search { height: 44px; }
  .list .scroll { padding-bottom: 96px; }
  .app[data-view="conv"] .page { padding-bottom: 16px; }
}
/* «Свернуть контакты» (0.2.45): the list is a strip of pictures with the unread counts. */
.list-fold { display: none; }
@media (min-width: 901px) {
  .list-fold { display: grid; }
  .app.list-folded { grid-template-columns: 68px 88px minmax(0, 1fr) auto; }
  .app.list-folded .lh { flex-direction: column; padding: 18px 8px 10px; gap: 6px; }
  /* The word «Чаты» goes; the dot of the network stays. */
  .app.list-folded .lh h1 { font-size: 0; flex: none; }
  .app.list-folded .lh h1 .net { margin-left: 0; }
  .app.list-folded .search, .app.list-folded .tabs, .app.list-folded .notice { display: none; }
  .app.list-folded .chat-item { margin: 0 6px; }
  .app.list-folded .chat-slide .chat { justify-content: center; padding: 8px 0; min-height: 64px; position: relative; }
  .app.list-folded .chat-menu-button { display: none; }
  .app.list-folded .chat .cm { position: absolute; top: 4px; right: 2px; }
  .app.list-folded .chat .cm .t, .app.list-folded .chat .cm .s > :not(.cnt) { display: none; }
}
@media (min-width: 901px) and (max-width: 1199px) {
  .app.list-folded { grid-template-columns: 68px 88px minmax(0, 1fr); }
}
@media (min-width: 901px) {
  .pagewrap { grid-column: 3 / -1; }
  .app[data-view="page"] .conv { display: none; }
  .app:not([data-view="page"]) .pagewrap { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
