:root {
  --bg: #050b14;
  --control: rgba(3, 12, 24, .85);
  --bar: rgba(5, 11, 20, .85);
  --glow: #0d2440;
  --bg2: #0a1628;
  --panel: rgba(12, 28, 48, 0.82);
  --line: rgba(0, 229, 255, 0.22);
  --cyan: #00e5ff;
  --cyan-dim: #5fb8cc;
  --green: #35f2a0;
  --amber: #ffb547;
  --red: #ff5a6a;
  --text: #dff6ff;
  --muted: #7fa2b5;
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: radial-gradient(ellipse at 50% 18%, var(--glow) 0%, var(--bg) 62%) fixed, var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "DejaVu Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
[hidden] { display: none !important; }
#app { height: 100%; }
.screen { height: 100%; display: flex; flex-direction: column; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--red); min-height: 1.2em; margin: 6px 0 0; }
code { font-family: "DejaVu Sans Mono", ui-monospace, Menlo, monospace; font-size: .92em; color: var(--cyan); }

button, .button, input, select, textarea {
  font: inherit; color: var(--text); border-radius: 10px;
  border: 1px solid var(--line); background: var(--control);
}
button, .button {
  padding: 10px 16px; cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px; min-height: 44px;
  transition: border-color .15s, background .15s, transform .08s;
}
button:hover, .button:hover { border-color: var(--cyan); }
button:active { transform: scale(.97); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: linear-gradient(180deg, #00b8d4, #0088a8); border-color: #00e5ff; color: #001018; font-weight: 700; }
button.danger { border-color: rgba(255, 90, 106, .6); color: #ffc3ca; }
input, select, textarea { padding: 10px 12px; width: 100%; outline: none; min-height: 44px; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 229, 255, .12); }
label { display: block; margin: 12px 0 0; color: var(--muted); font-size: 14px; }
label > input, label > select { margin-top: 6px; }
.row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.row > * { flex: 1; }
.icon-btn { background: transparent; border-color: transparent; font-size: 22px; padding: 6px 10px; min-width: 44px; }

/* ---------- привязка ---------- */
#pair-screen { align-items: center; justify-content: center; padding: 20px; overflow-y: auto; }
.pair-card {
  width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; padding: 28px 24px; text-align: center; backdrop-filter: blur(10px);
  box-shadow: 0 0 60px rgba(0, 229, 255, .08);
}
.pair-card form { text-align: left; }
.pair-card h1 { margin: 6px 0 2px; letter-spacing: .28em; font-weight: 300; color: var(--cyan); }
.pair-card button.primary { width: 100%; margin-top: 18px; }
.core-small { width: 120px; height: 120px; }
.fp { margin: 16px 0 6px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; display: grid; gap: 4px; }
.fp code { font-size: 18px; letter-spacing: .08em; }

/* ---------- основной экран ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px; padding: calc(10px + var(--safe-t)) 14px 10px;
  border-bottom: 1px solid var(--line); background: var(--bar); backdrop-filter: blur(8px);
}
.brand { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.logo { letter-spacing: .3em; color: var(--cyan); font-weight: 600; font-size: 15px; }
#server-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); letter-spacing: .08em; }
.st-label { margin-right: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #334; box-shadow: none; }
.dot.ok { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.warn { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.dot.bad { background: var(--red); box-shadow: 0 0 8px var(--red); }

.hud { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 6px; flex: 0 0 auto; }
#core { width: min(34vh, 60vw, 300px); height: min(34vh, 60vw, 300px); transition: width .3s, height .3s; }
.state-label { margin-top: -6px; letter-spacing: .35em; font-size: 12px; color: var(--cyan-dim); }
body.chatting #core { width: min(16vh, 30vw, 150px); height: min(16vh, 30vw, 150px); }

.chat { flex: 1; overflow-y: auto; padding: 12px 14px 18px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.msg { max-width: min(760px, 92%); padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line);
       white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; animation: rise .22s ease-out; }
.msg.user { align-self: flex-end; background: rgba(0, 136, 168, .22); border-color: rgba(0, 229, 255, .35); }
.msg.assistant { align-self: flex-start; background: var(--panel); }
.msg.system { align-self: center; background: transparent; border-style: dashed; color: var(--muted); font-size: 14px; }
.msg.pending::after { content: "▍"; color: var(--cyan); animation: blink 1s steps(2) infinite; }
.msg pre { white-space: pre; overflow-x: auto; background: var(--control); border: 1px solid var(--line); padding: 10px; border-radius: 10px; margin: 8px 0; }
.msg a { color: var(--cyan); text-decoration: underline; overflow-wrap: anywhere; }
.msg .meta { display: block; font-size: 11px; color: var(--muted); margin-top: 6px; }
.msg .play { min-height: 30px; padding: 2px 10px; font-size: 13px; margin-top: 6px; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }

.composer {
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: end;
  padding: 10px 12px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--bar);
}
.composer select { width: auto; max-width: 120px; }
.composer textarea { resize: none; max-height: 160px; }
.mic { font-size: 20px; width: 52px; }
.mic.rec { background: rgba(255, 90, 106, .25); border-color: var(--red); animation: pulse 1.2s infinite; }
.send { width: 52px; font-size: 18px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(255, 90, 106, .15); } }

/* ---------- меню ---------- */
.drawer { position: fixed; inset: 0 0 0 auto; width: min(460px, 100%); background: var(--bg2); border-left: 1px solid var(--line);
          z-index: 20; display: flex; flex-direction: column; box-shadow: -20px 0 60px rgba(0,0,0,.5); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: calc(10px + var(--safe-t)) 16px 8px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-weight: 400; letter-spacing: .15em; font-size: 18px; }
.drawer-body { overflow-y: auto; padding: 12px 14px calc(24px + var(--safe-b)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.card h3 { margin: 0 0 8px; font-size: 15px; letter-spacing: .1em; color: var(--cyan); font-weight: 600; }
.card h4 { margin: 14px 0 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.card button, .card .button { margin-top: 10px; }
.switch { display: flex; align-items: center; gap: 10px; color: var(--text); }
.switch input { width: 20px; height: 20px; min-height: 0; accent-color: var(--cyan); }
.list { display: grid; gap: 8px; }
.item { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; gap: 2px; font-size: 14px; }
.item .row { margin-top: 4px; }
.item.off { opacity: .5; }
.code-out { margin-top: 12px; text-align: center; padding: 14px; border: 1px solid var(--cyan); border-radius: 12px; }
.code-out b { display: block; font-size: 34px; letter-spacing: .2em; color: var(--cyan); font-family: "DejaVu Sans Mono", monospace; }
details { margin-top: 12px; } summary { cursor: pointer; color: var(--muted); }

/* ---------- чат 6.2: ответы, реакции, код, закрепы, проект ---------- */
.msg .quote { display: block; border-left: 3px solid var(--cyan); padding: 2px 8px; margin: 2px 0 6px; color: var(--muted); font-size: 13px;
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.msg .mention { color: var(--cyan); font-weight: 600; }
.msg .reacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.msg .reacts button { min-height: 26px; padding: 0 8px; border-radius: 12px; font-size: 13px; background: var(--control); border: 1px solid var(--line); }
.msg .reacts button.mine { border-color: var(--cyan); color: var(--cyan); }
.msg.deleted { font-style: italic; color: var(--muted); }
.msg.event { align-self: stretch; max-width: none; border-style: dashed; background: transparent; }
.msg .code-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.msg-pinned { margin: 6px 12px 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; color: var(--cyan);
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.msg-reply { margin: 0 12px; padding: 6px 12px; font-size: 13px; color: var(--muted); cursor: pointer; }
.sheet { width: 100%; max-width: 560px; max-height: 86vh; overflow: auto; background: var(--bg2); border: 1px solid var(--line);
         border-radius: 18px; padding: 16px; }
.sheet h2 { margin: 0 0 10px; font-size: 18px; font-weight: 500; color: var(--cyan); }
.sheet .item { display: block; width: 100%; text-align: left; padding: 10px 12px; margin: 6px 0; border-radius: 12px;
               background: var(--panel); border: 1px solid var(--line); color: var(--text); font-size: 15px; }
.sheet .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.sheet input, .sheet textarea { width: 100%; box-sizing: border-box; margin: 6px 0; }
.sheet pre.readme { white-space: pre-wrap; font-family: inherit; }
.center { text-align: center; }
#msg-composer { grid-template-columns: auto 1fr auto auto auto auto; }
@media (max-width: 520px) { #msg-composer { grid-template-columns: auto 1fr auto auto auto auto; } }

/* ---------- окно подтверждения ---------- */
.modal { position: fixed; inset: 0; background: rgba(0, 4, 10, .72); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-card { width: 100%; max-width: 440px; background: var(--bg2); border: 1px solid var(--amber); border-radius: 18px; padding: 20px; }
.modal-card h2 { margin: 0 0 8px; color: var(--amber); font-weight: 500; font-size: 19px; }
.pre { white-space: pre-wrap; }

.toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%); background: var(--bg2);
         border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; z-index: 50; max-width: 90%; }

@media (max-width: 520px) {
  .composer { grid-template-columns: 1fr auto auto; }
  .composer select { grid-column: 1 / -1; max-width: none; min-height: 36px; padding: 6px 10px; }
  .st-label { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* режим владельца */
.owner-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 45; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; padding: 8px 14px; background: #12324a; border-bottom: 1px solid var(--green);
  color: var(--green); font-size: 14px; }
.owner-banner button { background: var(--bg2); color: var(--fg); border: 1px solid var(--violet); border-radius: 8px; padding: 6px 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }
#owner-key-input { width: 100%; box-sizing: border-box; margin-top: 8px; padding: 12px; border-radius: 10px;
  background: #0b2031; color: var(--fg); border: 1px solid #35566f; font-size: 15px; }

/* Three device-local themes; pink dominates the animated third palette. */
:root[data-theme="light"], :root[data-theme="pink"] {
  --bg: #f4f7fa; --bg2: #eef3f8; --panel: rgba(255,255,255,.84);
  --control: rgba(255,255,255,.90); --bar: rgba(244,247,250,.87);
  --glow: #d8edf7; --line: rgba(0,110,140,.26); --cyan: #006e8c;
  --cyan-dim: #176f89; --text: #14212d; --muted: #506674;
  --green: #08744b; --red: #b72747; --amber: #8a5800; color-scheme: light;
}
:root[data-theme="pink"] {
  --bg: #ffecf6; --bg2: #ffe5f2; --panel: rgba(255,245,250,.85);
  --control: rgba(255,248,252,.92); --bar: rgba(255,232,245,.86);
  --glow: #ffc5e5; --line: rgba(170,48,125,.27); --cyan: #aa307d;
  --cyan-dim: #97356d; --text: #432539; --muted: #795266;
}
:root[data-theme="pink"] body {
  background: linear-gradient(120deg, #ffd6ec 0%, #ffeaf5 48%, #ffc7e5 78%, #fff2cb 100%);
  background-size: 180% 180%; animation: pink-flow 18s ease-in-out infinite alternate;
}
:root[data-theme="pink"] button.primary { background: #fac6e1; border-color: #aa307d; color: #432539; }
:root[data-theme="pink"] .msg.user { background: #ffdaec; border-color: var(--line); }
:root[data-theme="light"] button.danger, :root[data-theme="pink"] button.danger { color: var(--red); }
:root[data-theme="light"] .owner-banner, :root[data-theme="pink"] .owner-banner { background: var(--panel); }
@keyframes pink-flow { from { background-position: 0% 30%; } to { background-position: 100% 70%; } }
@media (prefers-reduced-motion: reduce) { :root[data-theme="pink"] body { animation: none; } }

/* ===== ТЕМЫ ===== */
[data-theme='light'] {
  --bg: #f4f7fa; --control: rgba(230,238,245,.92); --bar: rgba(240,245,250,.92);
  --glow: #c8dff0; --bg2: #e4eef5; --panel: rgba(220,232,242,0.9);
  --line: rgba(0,137,165,0.28); --cyan: #0089a5; --cyan-dim: #4a9ab0;
  --green: #008052; --amber: #b26a00; --red: #cc2233;
  --text: #141e26; --muted: #607482; color-scheme: light;
}
[data-theme='light'] body {
  background: radial-gradient(ellipse at 50% 18%, #c8dff0 0%, #f4f7fa 62%) fixed, #f4f7fa;
}
[data-theme='pink'] {
  --bg: #ffecf6; --control: rgba(255,228,244,.92); --bar: rgba(255,236,248,.92);
  --glow: #ffc0e0; --bg2: #ffe0f2; --panel: rgba(255,215,238,0.9);
  --line: rgba(190,48,140,0.28); --cyan: #be308c; --cyan-dim: #c070a8;
  --green: #1e7955; --amber: #976000; --red: #c02040;
  --text: #432539; --muted: #795266; color-scheme: light;
}
[data-theme='pink'] body {
  background: radial-gradient(ellipse at 50% 18%, #ffc0e0 0%, #ffecf6 62%) fixed, #ffecf6;
}
[data-theme='green'] {
  --bg: #050f08; --control: rgba(8,30,14,.88); --bar: rgba(5,15,8,.88);
  --glow: #0a3518; --bg2: #081e0c; --panel: rgba(10,40,18,0.85);
  --line: rgba(0,255,100,0.22); --cyan: #00ff64; --cyan-dim: #40c070;
  --green: #35ff82; --amber: #c8e650; --red: #ff6428;
  --text: #c8ffdc; --muted: #50a064; color-scheme: dark;
}
[data-theme='green'] body {
  background: radial-gradient(ellipse at 50% 18%, #0a3518 0%, #050f08 62%) fixed, #050f08;
}
[data-theme='red'] {
  --bg: #140505; --control: rgba(36,8,8,.88); --bar: rgba(20,5,5,.88);
  --glow: #3c0a0a; --bg2: #240808; --panel: rgba(48,10,10,0.85);
  --line: rgba(255,60,30,0.22); --cyan: #ff3c1e; --cyan-dim: #cc5040;
  --green: #ff643c; --amber: #ffb432; --red: #ff2040;
  --text: #ffdcd2; --muted: #b46450; color-scheme: dark;
}
[data-theme='red'] body {
  background: radial-gradient(ellipse at 50% 18%, #3c0a0a 0%, #140505 62%) fixed, #140505;
}

/* сообщения и заявки */
.link-btn { background: none; border: none; color: var(--cyan, #4dd0e1); text-decoration: underline; margin-top: 12px; cursor: pointer; font-size: 15px; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: #e53935; color: #fff; font-size: 12px; line-height: 20px; margin-left: 6px; }
.msg-list { overflow-y: auto; padding: 12px; flex: 1; }
.msg-row { padding: 14px 16px; margin: 8px 0; border-radius: 14px; background: rgba(77,208,225,.12); cursor: pointer; }
.msg-row b { display: block; font-size: 16px; }
.msg-row span { opacity: .7; font-size: 13px; }
.msg-row.unread b { color: var(--cyan, #4dd0e1); }
#msg-screen { display: flex; flex-direction: column; height: 100%; }
#msg-screen[hidden] { display: none !important; }
.req-row { display: flex; gap: 8px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
.req-row span { flex: 1; min-width: 140px; }

/* ===================================================================== */
/* Оформление «Голограмма» — как в приложении Android (5.12): стеклянные  */
/* панели, скругления 21px, бирюзовый акцент, фиолетовый дополнительный. */
/* Цвета тем берутся из переменных — пять тем по-прежнему работают.      */
/* ===================================================================== */
:root:not([data-theme]), :root[data-theme="dark"] {
  --bg: #070e19; --bg2: #0b1827; --glow: #10263a;
  --panel: rgba(24, 45, 65, .52); --control: rgba(11, 24, 39, .72); --bar: rgba(11, 24, 39, .62);
  --line: rgba(148, 213, 239, .19); --cyan: #73e8ef; --cyan-dim: #a2b5c9; --text: #edf7ff; --muted: #a2b5c9;
  --accent2: #a59df9;
}
:root { --radius: 21px; --accent2: #a59df9; }
body {
  background:
    radial-gradient(ellipse 70% 45% at 50% 22%, color-mix(in srgb, var(--cyan) 14%, transparent), transparent 70%),
    linear-gradient(115deg, transparent 0 48%, color-mix(in srgb, var(--cyan) 5%, transparent) 50%, transparent 52%) fixed,
    var(--bg);
}
.topbar { background: transparent; border-bottom: 0; padding-left: 21px; padding-right: 21px; }
.logo { letter-spacing: .32em; color: var(--text); font-weight: 700; font-size: 20px; }
.card, .composer, .drawer, .pair-card, .msg.assistant, .msg-row, .owner-banner {
  background: var(--panel);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.card, .pair-card, .msg-row { border-radius: 21px; }
.card h3 { letter-spacing: .14em; font-size: 12px; text-transform: uppercase; color: var(--muted); }
.drawer { border-left: 1px solid var(--line); }
.drawer-head { border-bottom: 1px solid var(--line); }
.composer { margin: 8px 14px calc(12px + var(--safe-b)); border-radius: 20px; padding: 8px; gap: 8px; }
.composer textarea, .composer select { background: transparent; border-color: transparent; }
button, .button { border-radius: 18px; }
button.primary {
  background: var(--cyan); border-color: var(--cyan); color: var(--bg); font-weight: 700;
  box-shadow: 0 0 24px color-mix(in srgb, var(--cyan) 35%, transparent);
}
button.send { border-radius: 16px; min-width: 48px; }
.msg { border-radius: 18px; }
.msg.user { background: color-mix(in srgb, var(--cyan) 18%, transparent); border-color: color-mix(in srgb, var(--cyan) 40%, transparent); }
.msg.assistant::before { content: "JARVIS"; display: block; font-size: 11px; letter-spacing: .16em; color: var(--cyan); margin-bottom: 4px; }
.msg.system::before { content: none; }
@keyframes holo-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg, .msg-row { animation: holo-in .22s ease-out; }
.state-label { letter-spacing: .3em; color: var(--muted); }
#core { filter: drop-shadow(0 0 22px color-mix(in srgb, var(--cyan) 30%, transparent)); }
.msg-list { padding: 12px 16px; }
@media (prefers-reduced-motion: reduce) { .msg, .msg-row { animation: none; } }

/* вложения в сообщениях */
.att-img { display: block; max-width: min(260px, 70vw); max-height: 320px; border-radius: 14px; margin: 4px 0 6px; cursor: zoom-in; }
.att-video { display: block; max-width: min(280px, 72vw); border-radius: 14px; margin: 4px 0 6px; }
.att-audio { display: block; width: min(260px, 70vw); margin: 4px 0 6px; }
.att-play { min-height: 38px; padding: 6px 14px; margin: 4px 0 6px; border-radius: 14px; }
.att-file { display: inline-block; margin: 4px 0 6px; color: var(--cyan); }
#msg-voice.rec { color: #ef5350; animation: holo-in .8s ease-in-out infinite alternate; }
#msg-composer { gap: 6px; }

/* 7.1.2: политика конфиденциальности */
.privacy-card { max-width: 640px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.privacy-text { flex: 1; overflow-y: auto; white-space: pre-wrap; line-height: 1.45; font-size: 15px; padding: 10px 12px; margin: 4px 0 10px;
  border: 1px solid rgba(127,127,127,.35); border-radius: 12px; min-height: 180px; }
.privacy-text h3 { margin: 14px 0 4px; font-size: 16px; }
.privacy-agree { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.privacy-agree input { width: 22px; height: 22px; flex: none; }

/* 7.4: статус в шапке, ✓✓, расшифровка голосовых, быстрые ответы */
#msg-sub { font-size: 12px; color: var(--muted); min-height: 14px; }
#msg-sub.live { color: var(--cyan); }
.msg .check { margin-left: 4px; }
.msg .check.read { color: var(--cyan); }
.msg .transcript { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); font-style: italic; }
.msg .transcript.btn { font-style: normal; cursor: pointer; color: var(--cyan); }
.quick-row { display: flex; gap: 6px; overflow-x: auto; padding: 4px 14px 0; scrollbar-width: none; }
.quick-row::-webkit-scrollbar { display: none; }
.quick-row button { flex: none; border-radius: 16px; padding: 7px 14px; font-size: 14px; white-space: nowrap; }

/* 7.5: кружочки, опросы, живое местоположение */
.note-wrap { position: relative; width: 210px; height: 210px; border-radius: 50%; overflow: hidden; border: 3px solid var(--cyan); background: #080c10; cursor: pointer;
  -webkit-mask-image: -webkit-radial-gradient(white, black); transform: translateZ(0); isolation: isolate; }   /* iOS Safari: видео внутри скруглённой рамки */
.note-wrap video, .att-note { width: 100%; height: 100%; object-fit: cover; }
.note-wrap::after { content: "▶ " attr(data-len); position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; color: #fff; font-size: 13px; text-shadow: 0 0 6px #000; }
.note-wrap.playing::after, .note-wrap.live::after { content: ""; }
.note-wrap.rec { border-color: #ef5350; }
.poll { display: flex; flex-direction: column; gap: 6px; min-width: 220px; }
.poll-opt { position: relative; display: flex; justify-content: space-between; gap: 10px; text-align: left; border-radius: 10px; overflow: hidden; padding: 8px 10px; }
.poll-opt i { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--cyan) 22%, transparent); z-index: 0; }
.poll-opt span { position: relative; z-index: 1; }
.poll-opt.mine { border-color: var(--cyan); color: var(--cyan); }
.live-card { display: flex; flex-direction: column; gap: 6px; }
.live-card .row { display: flex; gap: 12px; align-items: center; }

.room-card { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* 8.0: шапка переписки — имя собеседника не обрезается кнопками (🔒, звонки, проект) */
#msg-screen .topbar { padding-left: 8px; padding-right: 8px; }
#msg-screen .topbar .logo { letter-spacing: .02em; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#msg-screen .topbar .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#msg-screen .topbar .icon-btn { min-width: 34px; padding: 6px 3px; font-size: 20px; }
#msg-lock.on { color: var(--cyan); }
