/* NavX Messenger — /messenger/ (стиль: тёмная тема NavX, линейные SVG, кнопки 46px) */
:root{
  --bg:#0B1423; --bg2:#0F1B2D; --surface:#16263A; --surface2:#1E3350;
  --line:rgba(255,255,255,.10); --line2:rgba(255,255,255,.16);
  --ink:#E6F1FF; --mut:#9AA7BD; --acc:#5AA0F7; --acc2:#2563EB;
  --ok:#22C55E; --warn:#F59E0B; --danger:#F87171;
  --bubble-them:#16263A; --bubble-me1:#3B82F6; --bubble-me2:#2563EB;
  --radius:14px; --radius-lg:18px; --shadow:0 4px 18px rgba(0,0,0,.42);
  --hdr:64px; --font:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  --safe-b:env(safe-area-inset-bottom,0px); --safe-t:env(safe-area-inset-top,0px);
}
body.light{
  --bg:#F5F7FB; --bg2:#EEF2F8; --surface:#FFFFFF; --surface2:#EDF2FA;
  --line:rgba(15,27,45,.12); --line2:rgba(15,27,45,.18);
  --ink:#0F1B2D; --mut:#5B6B82; --acc:#2563EB; --acc2:#2563EB;
  --bubble-them:#FFFFFF; --bubble-me1:#3B82F6; --bubble-me2:#2563EB;
  --shadow:0 4px 18px rgba(15,27,45,.10);
  color-scheme:light;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;background:var(--bg);color:var(--ink);font-family:var(--font);font-size:15px;line-height:1.45;
  -webkit-font-smoothing:antialiased;overscroll-behavior:none;color-scheme:dark;
}
body.light{color-scheme:light}
a{color:var(--acc);text-decoration:none}
button{font-family:inherit}
svg{display:block}
.ic{width:22px;height:22px;flex:none}
.sr-only{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
[hidden]{display:none!important}
.grow{flex:1;min-width:0}

/* ------------------------------------------------------------------ app -- */
.app{height:100dvh;display:flex;flex-direction:column;overflow:hidden}
.topbar{
  flex:none;display:flex;align-items:center;gap:10px;height:var(--hdr);
  padding:0 14px 0 16px;background:var(--bg2);border-bottom:1px solid var(--line);
  position:relative;z-index:20;padding-top:var(--safe-t);box-sizing:content-box;
}
.brand{display:flex;align-items:center;gap:9px;color:var(--ink);font-weight:800;font-size:19px;letter-spacing:.2px}
.brand .brand-mark{width:30px;height:27px;flex:none}
.brand b{font-weight:800}
.brand .sep{width:1px;height:18px;background:var(--line2);margin:0 2px}
.brand .sub{font-size:13.5px;font-weight:600;color:var(--mut)}
.topbar-title{margin-left:6px;padding-left:12px;border-left:1px solid var(--line2);font-weight:700;font-size:15px;white-space:nowrap}
.topbar .grow{flex:1}
.icon-btn{
  width:46px;height:46px;border-radius:13px;border:1px solid transparent;background:transparent;color:var(--ink);
  display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0;
  transition:background .15s,border-color .15s,color .15s;
}
.icon-btn:hover{background:var(--surface);border-color:var(--line);color:var(--acc)}
.icon-btn:focus-visible,.chip:focus-visible,.thread:focus-visible,.c-btn:focus-visible,.btn:focus-visible{outline:2px solid var(--acc);outline-offset:2px}
.topbar .icon-btn{background:var(--surface);border-color:var(--line)}
.topbar .icon-btn:hover{background:var(--surface2);border-color:var(--line2)}
.acc-btn{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:50%;
  background:linear-gradient(160deg,#8DB8F8,#2563EB);color:#06203A;font-weight:800;font-size:12px;text-decoration:none;
  box-shadow:0 0 0 1px rgba(85,201,255,.35);flex:none;margin-left:2px}
.acc-btn:hover{filter:brightness(1.08)}
.lang-wrap{position:relative}
.lang-btn{width:auto;min-width:46px;padding:0 8px;font-weight:800;font-size:12.5px;letter-spacing:.3px}
.lang-menu{
  position:absolute;right:0;top:52px;min-width:178px;padding:6px;border-radius:14px;
  background:var(--bg2);border:1px solid var(--line2);box-shadow:0 18px 46px rgba(0,0,0,.5);z-index:60;
}
.lang-opt{display:flex;align-items:center;gap:10px;width:100%;border:0;background:transparent;color:var(--ink);
  padding:10px 10px;border-radius:10px;cursor:pointer;font-size:14px;text-align:left}
.lang-opt:hover{background:var(--surface)}
.lang-opt.on{background:rgba(37,99,235,.22)}
.lang-opt .code{margin-left:auto;font-size:11px;color:var(--mut);font-weight:700;letter-spacing:.5px}
.lang-opt svg{width:16px;height:16px;color:var(--acc);opacity:0}
.lang-opt.on svg{opacity:1}

/* -------------------------------------------------------------- layout -- */
.layout{flex:1;min-height:0;display:grid;grid-template-columns:352px minmax(0,1fr) 322px;overflow:hidden}

/* ---------------------------------------------------------------- side -- */
.side{display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--bg2);border-right:1px solid var(--line)}
.side-head{flex:none;display:flex;align-items:flex-start;gap:10px;padding:16px 14px 10px}
.side-head h1{margin:0;font-size:19px;font-weight:800;letter-spacing:.2px}
.side-sub{margin-top:3px;color:var(--mut);font-size:12px}
.side-head .icon-btn{background:var(--surface);border-color:var(--line);margin-left:auto}
.side-search{margin:0 14px 10px;display:flex;align-items:center;gap:9px;background:var(--surface);border:1px solid var(--line);
  border-radius:13px;padding:0 12px;height:44px;color:var(--mut)}
.side-search svg{width:17px;height:17px;flex:none;color:var(--mut)}
.side-search input{flex:1;min-width:0;background:transparent;border:0;outline:0;color:var(--ink);font:inherit;font-size:14px}
.side-search input::placeholder{color:var(--mut)}
.chips{display:flex;gap:7px;overflow-x:auto;padding:0 14px 11px;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{flex:none;height:34px;padding:0 13px;border-radius:999px;border:1px solid var(--line);background:var(--surface);
  color:var(--ink);font-weight:600;font-size:12.5px;display:inline-flex;align-items:center;gap:6px;cursor:pointer;
  white-space:nowrap;transition:background .15s,border-color .15s,color .15s}
.chip:hover{border-color:var(--line2)}
.chip.on{background:var(--acc2);border-color:var(--acc2);color:#fff}
.chip .cnt{font-size:11px;font-weight:800;background:rgba(255,255,255,.16);border-radius:999px;padding:1px 6px}
.chip.on .cnt{background:rgba(0,0,0,.22)}
.thread-list{flex:1;min-height:0;overflow:auto;padding:0 8px 14px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.18) transparent}
.thread{display:flex;align-items:center;gap:11px;width:100%;min-width:0;padding:10px;border-radius:14px;border:1px solid transparent;
  background:transparent;color:var(--ink);cursor:pointer;text-align:left;margin-bottom:2px;transition:background .13s,border-color .13s}
.thread:hover{background:rgba(90,160,247,.08)}
.thread.on{background:rgba(90,160,247,.13);border-color:rgba(90,160,247,.34)}
.th-ava{width:44px;height:44px;border-radius:13px;flex:none;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,#1b3355,#27456e);color:#BBD9FF;box-shadow:inset 0 0 0 1px rgba(255,255,255,.06)}
.th-ava svg{width:22px;height:22px}
.th-ava.k-direct{background:linear-gradient(135deg,#1b3355,#2563EB)}
.th-ava.k-object{background:linear-gradient(135deg,#123a2b,#1f6b4a);color:#A9F0C8}
.th-ava.k-district{background:linear-gradient(135deg,#123a46,#1f5b6b);color:#A8E6F4}
body.light .th-ava{box-shadow:inset 0 0 0 1px rgba(15,27,45,.08)}
.th-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.th-top{display:flex;align-items:center;gap:8px;min-width:0}
.th-title{font-weight:700;font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}
.th-time{flex:none;color:var(--mut);font-size:10.5px}
.th-prev{color:var(--mut);font-size:12px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.th-prev .you{color:var(--acc);font-weight:600}
.th-bot{display:flex;align-items:center;gap:6px;min-width:0}
.th-tag{display:inline-flex;align-items:center;gap:4px;height:18px;padding:0 6px;border-radius:999px;background:var(--surface2);
  color:var(--mut);font-size:9.5px;font-weight:700;letter-spacing:.2px;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.th-tag svg{width:11px;height:11px}
.th-badge{margin-left:auto;min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:var(--acc2);color:#fff;
  font-size:11px;font-weight:800;display:inline-flex;align-items:center;justify-content:center;flex:none}
.side-empty{padding:34px 22px;text-align:center;color:var(--mut)}
.side-empty .big-ic{width:64px;height:64px;margin:0 auto 14px;border-radius:20px;background:var(--surface);
  display:flex;align-items:center;justify-content:center;color:var(--acc)}
.side-empty .big-ic svg{width:32px;height:32px}
.side-empty b{display:block;color:var(--ink);font-size:15px;margin-bottom:6px}
.side-empty p{margin:0 0 16px;font-size:13px}
.side-empty .btn{height:46px}
.side-foot{flex:none;display:flex;align-items:center;gap:8px;padding:10px 16px;border-top:1px solid var(--line);
  color:var(--mut);font-size:11.5px;background:var(--bg2)}
.dot{width:8px;height:8px;border-radius:50%;background:var(--mut);flex:none}
.dot.ok{background:var(--ok);box-shadow:0 0 0 3px rgba(34,197,94,.16)}
.dot.warn{background:var(--warn);box-shadow:0 0 0 3px rgba(245,158,11,.16);animation:blink 1.4s ease-in-out infinite}
.dot.err{background:var(--danger);box-shadow:0 0 0 3px rgba(248,113,113,.16)}
@keyframes blink{0%,100%{opacity:1}50%{opacity:.35}}
.side-foot .grow{flex:1}
.side-foot .secure{display:inline-flex;align-items:center;gap:5px;opacity:.8}
.side-foot .secure svg{width:13px;height:13px}

/* ---------------------------------------------------------------- chat -- */
.chat{display:flex;flex-direction:column;min-width:0;min-height:0;background:
  radial-gradient(900px 420px at 78% -6%,rgba(90,160,247,.09),transparent 62%),var(--bg)}
.chat-head{flex:none;display:flex;align-items:center;padding:11px 16px;border-bottom:1px solid var(--line);
  background:var(--bg2);position:relative;z-index:4}
.head-row{display:flex;align-items:center;gap:11px;width:100%;min-width:0}
.back-btn{display:none;background:transparent;border:0;width:40px;height:40px;margin-left:-8px}
.chat-ava{width:44px;height:44px;border-radius:13px;flex:none;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,#1b3355,#27456e);color:#BBD9FF}
.chat-ava svg{width:22px;height:22px}
.chat-ava.k-object{background:linear-gradient(135deg,#123a2b,#1f6b4a);color:#A9F0C8}
.chat-ava.k-district{background:linear-gradient(135deg,#123a46,#1f5b6b);color:#A8E6F4}
.chat-ava.k-direct{background:linear-gradient(135deg,#1b3355,#2563EB)}
.chat-meta{min-width:0;flex:1}
.chat-title{font-weight:800;font-size:15px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-sub{margin-top:3px;color:var(--mut);font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-head .icon-btn{background:var(--surface);border-color:var(--line)}
.obj-card{display:flex;align-items:center;gap:11px;flex:1;min-width:0;padding:8px 10px;border-radius:14px;
  background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow)}
.obj-thumb{width:40px;height:40px;border-radius:11px;flex:none;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,#123a2b,#1f6b4a);color:#A9F0C8}
.obj-thumb svg{width:21px;height:21px}
.obj-body{min-width:0;flex:1}
.obj-title{font-weight:700;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.obj-sub{margin-top:2px;color:var(--mut);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.obj-go{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 11px;border-radius:10px;border:1px solid var(--line2);
  background:var(--surface2);color:var(--ink);font-size:12px;font-weight:700;white-space:nowrap;flex:none}
.obj-go:hover{border-color:var(--acc);color:var(--acc)}

/* -------------------------------------------------------------- msgs -- */
.msgs{flex:1;min-height:0;overflow:auto;padding:18px 20px 10px;display:flex;flex-direction:column;gap:10px;
  scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.18) transparent;overscroll-behavior:contain}
.msgs-empty{margin:auto;text-align:center;color:var(--mut);max-width:320px}
.msgs-empty .big-ic{width:64px;height:64px;margin:0 auto 14px;border-radius:20px;background:var(--surface);
  display:flex;align-items:center;justify-content:center;color:var(--acc)}
.msgs-empty .big-ic svg{width:30px;height:30px}
.msgs-empty b{display:block;color:var(--ink);font-size:15px;margin-bottom:5px}
.msgs-empty p{margin:0;font-size:13px}
.daysep{align-self:center;margin:6px 0 4px;padding:5px 12px;border-radius:999px;background:var(--surface);
  color:var(--mut);font-size:11px;font-weight:600;border:1px solid var(--line)}
.sysmsg{align-self:center;max-width:min(90%,480px);text-align:center;padding:7px 12px;border-radius:10px;
  background:rgba(245,158,11,.10);border:1px solid rgba(245,158,11,.22);color:#F5C46B;font-size:11.5px;line-height:1.4}
body.light .sysmsg{color:#9A6700}
.msg{max-width:min(78%,560px);padding:9px 12px 8px;border-radius:16px 16px 16px 5px;background:var(--bubble-them);
  align-self:flex-start;box-shadow:0 2px 10px rgba(0,0,0,.18);display:flex;flex-direction:column;gap:5px;
  word-break:break-word;font-size:14px;line-height:1.45;border:1px solid transparent}
body.light .msg{box-shadow:0 2px 10px rgba(15,27,45,.07);border-color:rgba(15,27,45,.06)}
.msg.me{align-self:flex-end;border-radius:16px 16px 5px 16px;background:linear-gradient(160deg,var(--bubble-me1),var(--bubble-me2));
  color:#fff;border-color:transparent;text-shadow:0 1px 1px rgba(0,0,0,.12)}
.msg .who{font-size:11px;font-weight:700;color:var(--acc);margin-bottom:-2px}
.msg.me .who{color:#D8E9FF}
.msg .txt{white-space:pre-wrap}
.msg .tm{display:flex;align-items:center;justify-content:flex-end;gap:4px;font-size:10px;opacity:.62}
.msg.me .tm{opacity:.82}
.msg .tm svg{width:12px;height:12px}
.msg.pending{opacity:.72}
.msg.pending .tm .st{opacity:.9}
.msg.failed{border-color:var(--danger);box-shadow:0 0 0 1px var(--danger),0 2px 10px rgba(0,0,0,.2)}
.msg.failed .fail{display:flex;align-items:center;gap:7px;font-size:11.5px;color:#FFC5C5}
.msg.failed.me{color:#fff}
.retry-btn{border:1px solid rgba(255,255,255,.4);background:rgba(0,0,0,.18);color:#fff;border-radius:8px;
  height:28px;padding:0 9px;font-size:11px;font-weight:700;cursor:pointer}
.geo-msg{max-width:min(86%,560px);padding:9px}
.geo-mini{position:relative;height:132px;border-radius:11px;overflow:hidden;flex:none;
  background:
    radial-gradient(420px 200px at 72% 12%,rgba(90,160,247,.20),transparent 62%),
    repeating-linear-gradient(0deg,rgba(255,255,255,.055) 0 1px,transparent 1px 34px),
    repeating-linear-gradient(90deg,rgba(255,255,255,.055) 0 1px,transparent 1px 34px),
    linear-gradient(180deg,#0d1a2b,#0a1220)}
body.light .geo-mini{background:
    radial-gradient(420px 200px at 72% 12%,rgba(37,99,235,.16),transparent 62%),
    repeating-linear-gradient(0deg,rgba(15,27,45,.07) 0 1px,transparent 1px 34px),
    repeating-linear-gradient(90deg,rgba(15,27,45,.07) 0 1px,transparent 1px 34px),
    linear-gradient(180deg,#EAF1FC,#DCE7F7)}
.geo-mini .road{position:absolute;height:7px;border-radius:6px;background:rgba(90,160,247,.24)}
.geo-mini .road.r2{background:rgba(90,160,247,.14)}
.geo-pin{position:absolute;left:50%;top:50%;transform:translate(-50%,-100%);color:#fff;filter:drop-shadow(0 4px 8px rgba(0,0,0,.5))}
.geo-pin svg{width:30px;height:30px;fill:var(--acc2);stroke:#fff;stroke-width:1.6}
.geo-mini .price{position:absolute;left:8px;top:8px;background:rgba(11,20,35,.82);border:1px solid rgba(255,255,255,.18);
  color:#fff;border-radius:999px;padding:4px 9px;font-size:10.5px;font-weight:700;letter-spacing:.2px}
.geo-mini .eta{position:absolute;right:8px;bottom:8px;background:rgba(11,20,35,.82);border:1px solid rgba(255,255,255,.18);
  color:#fff;border-radius:8px;padding:4px 8px;font-size:10px;font-weight:600;max-width:70%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.geo-body{padding:2px 2px 0;display:flex;flex-direction:column;gap:2px}
.geo-name{font-weight:700;font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.geo-coords{color:var(--mut);font-size:11px;font-variant-numeric:tabular-nums}
.msg.me .geo-coords{color:rgba(255,255,255,.74)}
.msg.me .geo-name{color:#fff}
.msg.me .geo-open{background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.38);color:#fff}
.msg.me .geo-open:hover{background:rgba(255,255,255,.24)}
.msg.me .geo-mini{border:1px solid rgba(255,255,255,.14)}
.geo-open{display:inline-flex;align-items:center;justify-content:center;gap:7px;margin-top:7px;height:38px;border-radius:10px;
  background:var(--acc2);color:#fff;font-size:12.5px;font-weight:700;border:0}
.geo-open svg{width:14px;height:14px}
.msg .txt a{color:#BBD9FF;text-decoration:underline}
.msg.me .txt a{color:#fff}
.quick{flex:none;display:flex;gap:7px;overflow-x:auto;padding:0 20px 8px;scrollbar-width:none}
.quick::-webkit-scrollbar{display:none}
.quick .chip{height:32px;font-size:11.5px;background:var(--surface);box-shadow:none}
.quick .chip .ic{width:14px;height:14px;color:var(--acc)}

/* ------------------------------------------------------------ composer -- */
.composer{flex:none;display:flex;align-items:flex-end;gap:9px;padding:10px 16px calc(12px + var(--safe-b));
  border-top:1px solid var(--line);background:var(--bg2)}
.composer textarea{flex:1;min-width:0;min-height:46px;max-height:150px;resize:none;border-radius:14px;border:1px solid var(--line);
  background:var(--surface);color:var(--ink);padding:12px 14px;font:inherit;font-size:14.5px;line-height:1.4;outline:0;
  transition:border-color .15s,box-shadow .15s}
.composer textarea::placeholder{color:var(--mut)}
.composer textarea:focus{border-color:var(--acc);box-shadow:0 0 0 3px rgba(90,160,247,.16)}
.c-btn{width:46px;height:46px;border-radius:50%;flex:none;border:1px solid var(--line);background:var(--surface);
  color:var(--acc);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0;
  transition:background .15s,border-color .15s,transform .1s,opacity .15s}
.c-btn:hover{border-color:var(--line2);background:var(--surface2)}
.c-btn:active{transform:scale(.94)}
.c-btn:disabled{opacity:.45;cursor:default}
.c-btn.send{background:var(--acc2);border-color:var(--acc2);color:#fff;box-shadow:0 6px 16px rgba(37,99,235,.4)}
.c-btn.send:hover{background:#1D4ED8}
.c-btn.send:disabled{box-shadow:none}
.c-btn.geo.locating .ic{animation:spin 1.1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* ---------------------------------------------------------------- info -- */
.info{display:flex;flex-direction:column;min-height:0;background:var(--bg2);border-left:1px solid var(--line);overflow:auto}
.info-head{flex:none;display:flex;align-items:center;gap:8px;padding:16px 16px 10px}
.info-head b{font-size:14px;font-weight:800}
.info-head .icon-btn{width:38px;height:38px;border-radius:11px;margin-left:auto;background:var(--surface);border-color:var(--line)}
.info-body{padding:0 16px 20px;display:flex;flex-direction:column;gap:14px}
.info-card{background:var(--surface);border:1px solid var(--line);border-radius:16px;overflow:hidden;box-shadow:var(--shadow)}
.info-hero{height:104px;display:flex;align-items:center;justify-content:center;color:#A9F0C8;
  background:linear-gradient(135deg,#123a2b,#1f6b4a)}
.info-hero svg{width:46px;height:46px}
.info-hero.k-direct{background:linear-gradient(135deg,#1b3355,#2563EB);color:#D8E9FF}
.info-hero.k-district{background:linear-gradient(135deg,#123a46,#1f5b6b);color:#A8E6F4}
.info-card .pad{padding:12px 13px}
.info-title{font-weight:800;font-size:14.5px;line-height:1.3}
.info-sub{color:var(--mut);font-size:11.5px;margin-top:3px}
.info-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:9px}
.info-tags .tag{display:inline-flex;align-items:center;gap:5px;height:22px;padding:0 8px;border-radius:999px;
  background:var(--surface2);font-size:10.5px;font-weight:700;color:var(--mut)}
.info-tags .tag svg{width:12px;height:12px}
.info-kv{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:11px}
.info-kv > div{background:var(--surface2);border-radius:10px;padding:7px 9px;min-width:0}
.info-kv span{display:block;color:var(--mut);font-size:10px;font-weight:600;letter-spacing:.2px;text-transform:uppercase}
.info-kv b{display:block;margin-top:2px;font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.info-actions{display:flex;flex-direction:column;gap:8px;margin-top:11px}
.info-actions .btn{height:46px;width:100%}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:46px;padding:0 16px;border-radius:13px;
  border:1px solid var(--line2);background:var(--surface2);color:var(--ink);font-weight:700;font-size:13.5px;cursor:pointer;
  transition:background .15s,border-color .15s,color .15s}
.btn:hover{border-color:var(--acc);color:var(--acc)}
.btn.primary{background:var(--acc2);border-color:var(--acc2);color:#fff}
.btn.primary:hover{background:#1D4ED8;color:#fff}
.btn.ghost{background:transparent}
.btn svg{width:18px;height:18px}
.info-part{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.info-part li{display:flex;align-items:center;gap:9px;padding:7px 9px;border-radius:11px;background:var(--surface2)}
.info-part .pav{width:30px;height:30px;border-radius:9px;background:linear-gradient(135deg,#1b3355,#2563EB);color:#D8E9FF;
  display:flex;align-items:center;justify-content:center;font-size:10.5px;font-weight:800;flex:none}
.info-part .pb{min-width:0;flex:1}
.info-part .pn{font-size:12.5px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.info-part .pr{color:var(--mut);font-size:10.5px;margin-top:1px;display:flex;align-items:center;gap:5px}
.info-part .pr svg{width:11px;height:11px}
.info-note{display:flex;gap:9px;padding:10px 11px;border-radius:12px;background:rgba(34,197,94,.08);
  border:1px solid rgba(34,197,94,.2);color:var(--mut);font-size:11px;line-height:1.45}
.info-note svg{width:16px;height:16px;color:var(--ok);flex:none;margin-top:1px}
.info-empty{margin:auto;text-align:center;color:var(--mut);padding:30px 20px;max-width:260px}
.info-empty .big-ic{width:58px;height:58px;margin:0 auto 12px;border-radius:19px;background:var(--surface);
  display:flex;align-items:center;justify-content:center;color:var(--acc)}
.info-empty .big-ic svg{width:28px;height:28px}
.info-empty b{display:block;color:var(--ink);font-size:14px;margin-bottom:5px}
.info-empty p{margin:0;font-size:12px}
.info-list{list-style:none;margin:12px 0 0;padding:0;text-align:left;display:flex;flex-direction:column;gap:8px}
.info-list li{display:flex;gap:8px;align-items:flex-start;font-size:11.5px;color:var(--mut)}
.info-list .n{width:18px;height:18px;border-radius:50%;background:var(--surface2);color:var(--ink);
  font-size:10px;font-weight:800;display:flex;align-items:center;justify-content:center;flex:none}

/* ---------------------------------------------------------------- auth -- */
.auth{position:fixed;inset:0;z-index:80;display:flex;align-items:center;justify-content:center;padding:20px;
  background:radial-gradient(800px 460px at 60% 0%,rgba(37,99,235,.22),transparent 60%),var(--bg)}
.auth-card{width:100%;max-width:420px;background:var(--bg2);border:1px solid var(--line2);border-radius:24px;
  padding:30px 26px;box-shadow:0 30px 80px rgba(0,0,0,.55);text-align:center}
.auth-ic{width:74px;height:74px;margin:0 auto 18px;border-radius:22px;background:linear-gradient(160deg,#2563EB,#5AA0F7);
  color:#fff;display:flex;align-items:center;justify-content:center;box-shadow:0 14px 34px rgba(37,99,235,.4)}
.auth-ic svg{width:38px;height:38px}
.auth-card h2{margin:0 0 8px;font-size:21px;font-weight:800;letter-spacing:.2px}
.auth-card p{margin:0 0 20px;color:var(--mut);font-size:13.5px;line-height:1.5}
.auth-card .btn{width:100%;margin-bottom:9px}
.auth-note{margin-top:14px;color:var(--mut);font-size:11px;display:flex;align-items:center;justify-content:center;gap:6px}
.auth-note svg{width:13px;height:13px}

/* --------------------------------------------------------------- toast -- */
.toast{position:fixed;left:50%;bottom:26px;transform:translateX(-50%) translateY(14px);z-index:120;
  background:#0B1423;color:#E8F1FF;border:1px solid rgba(255,255,255,.16);border-radius:12px;
  padding:11px 16px;font-size:13px;font-weight:600;box-shadow:0 14px 34px rgba(0,0,0,.5);
  opacity:0;pointer-events:none;transition:opacity .18s,transform .18s;max-width:min(92vw,420px);text-align:center}
body.light .toast{background:#fff;color:#0F1B2D;border-color:rgba(15,27,45,.14);box-shadow:0 14px 34px rgba(15,27,45,.2)}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

/* ----------------------------------------------------------- skeletons -- */
.skel{position:relative;overflow:hidden;background:var(--surface);border-radius:12px}
.skel::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.07),transparent);
  animation:shimmer 1.4s infinite}
@keyframes shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}
.skel-thread{display:flex;gap:11px;padding:10px;margin-bottom:4px}
.skel-thread .a{width:44px;height:44px;border-radius:13px;flex:none}
.skel-thread .b{flex:1;display:flex;flex-direction:column;gap:7px}
.skel-thread .b i{display:block;height:11px;border-radius:6px}
.skel-thread .b i:first-child{width:62%}
.skel-thread .b i:last-child{width:88%;height:9px}

/* ---------------------------------------------------------- responsive -- */
/* Встроенный режим (iframe в карточке объекта на карте): своя шапка не нужна */
body.embedded .topbar{display:none}
body.embedded .app{height:100dvh}

@media (max-width:1180px){
  .layout{grid-template-columns:330px minmax(0,1fr)}
  .info{display:none}
}
@media (max-width:820px){
  :root{--hdr:56px}
  .topbar{padding-left:12px;padding-right:8px;gap:6px}
  .brand .sub,.brand .sep,.topbar-title{display:none}
  .brand{font-size:17px}
  .brand .brand-mark{width:26px;height:23px}
  .topbar .icon-btn{width:42px;height:42px;border-radius:12px}
  .acc-btn{width:38px;height:38px}
  .layout{grid-template-columns:minmax(0,1fr)}
  .side{border-right:0}
  .chat{display:none}
  body.chat-open .side{display:none}
  body.chat-open .chat{display:flex}
  .back-btn{display:inline-flex}
  .chat-head{padding:8px 10px}
  .head-row{gap:8px}
  .chat-head .icon-btn{width:42px;height:42px}
  .obj-card{gap:9px;padding:7px 9px}
  .obj-thumb{width:36px;height:36px;border-radius:10px}
  .obj-title{font-size:12.5px}
  .obj-sub{font-size:10.5px}
  .msgs{padding:14px 12px 8px;gap:8px}
  .msg{max-width:84%}
  .geo-msg{max-width:92%}
  .composer{padding:8px 10px calc(10px + var(--safe-b));gap:7px}
  .composer textarea{min-height:44px;padding:11px 13px;font-size:16px} /* 16px — iOS без зума */
  .c-btn{width:46px;height:46px}
  .quick{padding:0 12px 6px}
  .obj-card{margin-top:-2px}
  .obj-go .lbl{display:none}
  .obj-go{width:38px;padding:0;justify-content:center;height:38px}
  .side-search{margin:0 12px 10px}
  .chips{padding:0 12px 10px}
  .side-head{padding:14px 12px 8px}
  .side-foot{padding:8px 12px}
  .msgs-empty{padding:0 20px}
}
@media (max-width:420px){
  .topbar .icon-btn{width:40px;height:40px}
  .lang-btn{min-width:40px;padding:0 5px;font-size:11.5px}
  .brand b{display:none}
  .chat-head .icon-btn#chatMapBtn{display:none}
  .chat-ava{width:40px;height:40px;border-radius:12px}
}
@media (prefers-reduced-motion:reduce){
  *,*::after,*::before{animation-duration:.001ms!important;transition-duration:.001ms!important}
}
::-webkit-scrollbar{width:8px;height:8px}
::-webkit-scrollbar-thumb{background:rgba(255,255,255,.16);border-radius:8px}
body.light ::-webkit-scrollbar-thumb{background:rgba(15,27,45,.2)}
::-webkit-scrollbar-track{background:transparent}


/* ===========================================================================
   NavX Messenger — AV / full-feature layer (voice, calls, conference, contacts,
   invites, reactions, attachments, search, viewer).  Appended to chat.css.
   Uses the same design tokens as the base sheet; light theme overrides below.
   =========================================================================== */
html.cab-embed, html.cab-embed body{height:100%;overflow:hidden}
html.cab-embed .app{height:100%}
html.cab-embed .topbar{display:none!important}
html.cab-embed .info{display:none!important}
@media(min-width:821px){html.cab-embed .layout{grid-template-columns:310px minmax(0,1fr)!important}}

/* ---------- chat header actions ---------- */
.head-row{position:relative}
.head-actions{display:flex;align-items:center;gap:2px;margin-left:auto;flex:0 0 auto}
.head-actions .icon-btn{width:38px;height:38px}
body.light .head-actions .icon-btn:hover{background:var(--surface2)}
.pin-bar{display:flex;align-items:center;gap:8px;padding:7px 12px;margin:0 0 4px;border-radius:12px;
  background:var(--surface2);border:1px solid var(--line);font-size:12.5px;color:var(--ink);cursor:pointer}
.pin-bar b{color:var(--acc);font-weight:700;font-size:11px;text-transform:uppercase;letter-spacing:.04em}
.pin-bar .pin-txt{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pin-bar .icon-btn{width:26px;height:26px;margin-left:auto;flex:0 0 auto}
.reply-bar{display:flex;align-items:center;gap:10px;margin:6px 0 0;padding:8px 10px;border-radius:12px;
  background:var(--surface2);border:1px solid var(--line)}
.reply-bar .reply-ic{color:var(--acc);font-size:11.5px;font-weight:800;text-transform:uppercase;letter-spacing:.05em}
.reply-bar .reply-body{min-width:0;flex:1}
.reply-bar .reply-body b{display:block;font-size:12px;color:var(--acc)}
.reply-bar .reply-body span{display:block;font-size:12px;color:var(--mut);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.reply-bar .icon-btn{width:30px;height:30px}

/* ---------- select bar / record bar ---------- */
.select-bar{display:flex;align-items:center;gap:6px;padding:8px 12px;border-top:1px solid var(--line);background:var(--surface)}
.select-bar #selectCount{margin-right:auto;font-size:13px;font-weight:700;color:var(--acc)}
.rec-bar{display:flex;align-items:center;gap:10px;padding:10px 14px;background:var(--surface);
  border-top:1px solid var(--line)}
.rec-dot{width:10px;height:10px;border-radius:50%;background:var(--danger);animation:avpulse 1.1s infinite}
@keyframes avpulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.35;transform:scale(.8)}}
.rec-time{font-variant-numeric:tabular-nums;font-weight:700;color:var(--danger);font-size:14px}
.rec-hint{flex:1;font-size:12px;color:var(--mut);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rec-bar .icon-btn{width:38px;height:38px}
.rec-bar.paused .rec-dot{animation:none;opacity:.4}

/* ---------- composer buttons ---------- */
.c-btn.voice.recording{background:var(--danger);color:#fff;border-color:transparent}
.c-btn.voice.recording .ic{fill:currentColor}
body:not(.light) .c-btn.voice.recording{box-shadow:0 0 0 6px rgba(248,113,113,.16)}

/* ---------- message extras ---------- */
.msg{position:relative}
.msg .av-reply{border-left:3px solid var(--acc);padding:3px 0 3px 8px;margin:-2px 0 6px;
  border-radius:4px 0 0 4px;background:rgba(90,160,247,.10);max-width:100%;cursor:pointer}
.msg.me .av-reply{background:rgba(255,255,255,.14);border-left-color:#fff}
.av-reply .rp-who{display:block;font-size:11px;font-weight:800;color:var(--acc)}
.msg.me .av-reply .rp-who{color:#fff}
.av-reply .rp-text{display:block;font-size:11.5px;color:var(--mut);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.msg.me .av-reply .rp-text{color:rgba(255,255,255,.82)}
.av-fwd{font-size:11px;color:var(--mut);margin-bottom:4px;font-style:italic}
.msg.me .av-fwd{color:rgba(255,255,255,.8)}
.av-edited{font-size:10px;opacity:.55;margin-left:4px}
.msg.selected{outline:2px solid var(--acc);outline-offset:1px}
.msg.me.selected{outline-color:#fff}
.msg .st.read{color:#9BE7FF}
.msg .st.read svg{color:#9BE7FF}
.msg.flash{animation:avflash 1.4s ease}
@keyframes avflash{0%{box-shadow:0 0 0 2px var(--acc)}100%{box-shadow:0 0 0 2px transparent}}
.av-reactions{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px}
.av-reactions .rx{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;
  background:rgba(255,255,255,.10);border:1px solid var(--line2);color:inherit;font-size:12px;cursor:pointer;line-height:1.5}
.msg.me .av-reactions .rx{background:rgba(255,255,255,.18)}
.av-reactions .rx.me{border-color:var(--acc);background:rgba(90,160,247,.22)}
body.light .av-reactions .rx{background:#EFF4FB}
body.light .av-reactions .rx.me{background:#DCEAFF;border-color:#2563EB}
.av-more{position:absolute;top:-8px;right:6px;width:22px;height:22px;border-radius:50%;border:1px solid var(--line2);
  background:var(--surface);color:var(--mut);font-size:13px;line-height:1;display:none;cursor:pointer}
.msg:hover .av-more{display:block}
.av-menu{position:fixed;z-index:60;display:flex;gap:2px;padding:5px;border-radius:999px;background:var(--surface);
  border:1px solid var(--line2);box-shadow:var(--shadow)}
.av-menu button{width:34px;height:34px;border-radius:50%;border:0;background:transparent;font-size:18px;cursor:pointer}
.av-menu button:hover{background:var(--surface2)}

/* ---------- voice / audio player ---------- */
.av-voice{display:flex;align-items:center;gap:10px;min-width:220px;max-width:100%;padding:2px 0 1px}
.av-voice .vplay{width:40px;height:40px;flex:0 0 auto;border-radius:50%;border:0;cursor:pointer;
  background:rgba(255,255,255,.18);color:inherit;display:grid;place-items:center}
.msg:not(.me) .av-voice .vplay{background:rgba(90,160,247,.16);color:var(--acc)}
.msg.me .av-voice .vplay{background:rgba(255,255,255,.22);color:#fff}
.av-voice .vplay svg{width:18px;height:18px}
.av-voice .vwave{flex:1;min-width:0;height:34px;display:flex;align-items:flex-end;gap:2px;cursor:pointer}
.av-voice .vbar{flex:1 1 0;min-width:2px;max-width:5px;border-radius:2px;background:rgba(159,180,206,.55);height:20%}
.msg.me .av-voice .vbar{background:rgba(255,255,255,.5)}
.av-voice .vbar.on{background:var(--acc)}
.msg.me .av-voice .vbar.on{background:#fff}
.av-voice .vmeta{flex:0 0 auto;text-align:right;font-size:11px;line-height:1.4;opacity:.85}
.av-voice .vspd{border:1px solid currentColor;border-radius:999px;background:transparent;color:inherit;
  font-size:10.5px;padding:1px 7px;cursor:pointer;opacity:.9}
.av-voice .vdl{width:26px;height:26px;flex:0 0 auto;display:grid;place-items:center;color:inherit;opacity:.75}
.av-voice.playing .vplay{transform:scale(1.03)}

/* ---------- media in bubbles ---------- */
.av-photo{display:block;margin:-4px -6px 2px;max-width:100%;border-radius:12px;overflow:hidden;cursor:zoom-in}
.av-photo img{display:block;width:100%;max-height:320px;object-fit:cover;background:var(--surface2)}
.av-video{display:block;margin:-4px -6px 2px;border-radius:12px;overflow:hidden;background:#000;max-width:100%}
.av-video video{display:block;width:100%;max-height:340px}
.av-file{display:flex;align-items:center;gap:10px;margin:2px 0;padding:6px 4px;text-decoration:none;color:inherit}
.av-file .fico{width:42px;height:42px;border-radius:10px;display:grid;place-items:center;flex:0 0 auto;
  background:rgba(90,160,247,.15);color:var(--acc);font-size:11px;font-weight:800;text-transform:uppercase}
.msg.me .av-file .fico{background:rgba(255,255,255,.2);color:#fff}
.av-file .fbody{min-width:0}
.av-file .fname{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px}
.av-file .fsize{font-size:11px;opacity:.7}
.av-lp{margin-top:6px;border-radius:12px;overflow:hidden;border:1px solid var(--line2);background:var(--surface2);
  text-decoration:none;color:inherit;display:block;max-width:340px}
.av-lp img{display:block;width:100%;max-height:150px;object-fit:cover}
.av-lp .lpb{padding:8px 10px}
.av-lp .lpsite{font-size:10.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--acc);font-weight:700}
.av-lp .lptitle{font-size:13px;font-weight:700;margin:1px 0}
.av-lp .lpdesc{font-size:11.5px;color:var(--mut);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.msg.me .av-lp{background:rgba(255,255,255,.14);border-color:rgba(255,255,255,.3)}
.msg.me .av-lp .lpdesc{color:rgba(255,255,255,.85)}
.msg.me .av-lp .lpsite{color:#D8E9FF}
body.light .av-lp{background:#F3F7FD}

/* ---------- call history card ---------- */
.av-call{display:flex;align-items:center;gap:10px;min-width:200px}
.av-call .cico{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;flex:0 0 auto;
  background:rgba(34,197,94,.16);color:#22C55E}
.av-call.missed .cico{background:rgba(248,113,113,.16);color:var(--danger)}
.msg.me .av-call .cico{background:rgba(255,255,255,.2);color:#fff}
.av-call .cinfo{min-width:0}
.av-call .ctitle{font-size:13px;font-weight:700}
.av-call .csub{font-size:11.5px;opacity:.8}
.av-call .cback{margin-left:auto;width:32px;height:32px;border-radius:50%;border:1px solid var(--line2);
  background:transparent;color:inherit;display:grid;place-items:center;cursor:pointer;flex:0 0 auto}

/* ---------- sheet (bottom action menu / dialogs) ---------- */
.sheet{position:fixed;inset:0;z-index:80;background:rgba(4,10,20,.55);display:flex;align-items:flex-end;
  justify-content:center;backdrop-filter:blur(2px)}
.sheet-card{width:min(520px,100%);max-height:86dvh;overflow:auto;background:var(--surface);color:var(--ink);
  border:1px solid var(--line2);border-radius:18px 18px 0 0;padding:12px;box-shadow:var(--shadow)}
@media(min-width:620px){.sheet{align-items:center}.sheet-card{border-radius:18px}}
.sheet-title{font-size:13px;font-weight:800;color:var(--mut);text-transform:uppercase;letter-spacing:.06em;
  padding:4px 8px 10px}
.sheet-row{display:flex;align-items:center;gap:12px;width:100%;padding:11px 10px;border:0;border-radius:12px;
  background:transparent;color:var(--ink);font-size:14px;text-align:left;cursor:pointer}
.sheet-row:hover{background:var(--surface2)}
.sheet-row .ic{width:19px;height:19px;flex:0 0 auto;color:var(--acc)}
.sheet-row.danger{color:var(--danger)}
.sheet-row.danger .ic{color:var(--danger)}
.sheet-hour{display:flex;gap:6px;padding:2px 10px 12px;flex-wrap:wrap}
.sheet-hour button{width:38px;height:38px;border-radius:12px;border:1px solid var(--line);background:var(--surface2);
  font-size:18px;cursor:pointer;color:inherit}
.sheet-input{width:100%;padding:10px 12px;border-radius:12px;border:1px solid var(--line2);background:var(--bg2);
  color:var(--ink);font:inherit;font-size:14px;resize:vertical;min-height:52px}
.sheet-actions{display:flex;gap:8px;justify-content:flex-end;padding:12px 2px 4px}
.sheet-actions .btn{min-width:96px}

/* ---------- side panels (contacts / search / favorites) ---------- */
.panel{position:fixed;z-index:70;top:0;bottom:0;left:0;width:min(420px,100%);background:var(--surface);
  color:var(--ink);border-right:1px solid var(--line2);display:flex;flex-direction:column;box-shadow:var(--shadow)}
.panel[hidden]{display:none}
.panel-head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--line)}
.panel-head b{font-size:16px}
.panel-search{margin:10px 12px}
.panel-tabs{margin:0 12px 8px}
.panel-body{flex:1;overflow:auto;padding:0 10px 12px}
.panel-foot{padding:10px 12px;border-top:1px solid var(--line)}
.panel-foot .btn{width:100%}
.c-row{display:flex;align-items:center;gap:10px;padding:9px 8px;border-radius:12px}
.c-row:hover{background:var(--surface2)}
.c-row .c-ava{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;flex:0 0 auto;
  background:rgba(90,160,247,.18);color:var(--acc);font-size:13px;font-weight:800;position:relative}
.c-row .c-ava .on{position:absolute;right:0;bottom:0;width:10px;height:10px;border-radius:50%;
  background:var(--ok);border:2px solid var(--surface)}
.c-row .c-body{min-width:0;flex:1}
.c-row .c-name{font-size:13.5px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.c-row .c-sub{font-size:11.5px;color:var(--mut);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.c-row .c-act{display:flex;gap:4px;flex:0 0 auto}
.c-row .c-act button{width:30px;height:30px;border-radius:50%;border:1px solid var(--line);background:transparent;
  color:var(--acc);cursor:pointer;display:grid;place-items:center;font-size:14px}
.c-row .c-act button:hover{background:var(--surface2)}
.panel-empty{padding:34px 16px;text-align:center;color:var(--mut);font-size:13px;line-height:1.6}
.panel-empty b{display:block;color:var(--ink);font-size:14.5px;margin-bottom:6px}
.search-scope{display:flex;gap:14px;padding:0 16px 8px;font-size:12.5px;color:var(--mut)}
.search-scope label{display:flex;align-items:center;gap:6px;cursor:pointer}
.sr-row{display:flex;gap:9px;padding:9px 8px;border-radius:12px;cursor:pointer}
.sr-row:hover{background:var(--surface2)}
.sr-row .sr-thread{font-size:11px;font-weight:800;color:var(--acc);text-transform:uppercase;letter-spacing:.04em}
.sr-row .sr-txt{font-size:13px;color:var(--ink);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.sr-row .sr-meta{font-size:10.5px;color:var(--mut);margin-top:2px}
.sr-row .sr-ava{width:34px;height:34px;border-radius:10px;flex:0 0 auto;display:grid;place-items:center;
  background:rgba(90,160,247,.15);color:var(--acc)}
.fav-row{display:flex;gap:9px;padding:9px 8px;border-radius:12px;cursor:pointer}
.fav-row:hover{background:var(--surface2)}
.fav-row .sr-thread{font-size:11px;color:var(--acc);font-weight:800}

/* ---------- media gallery in info panel ---------- */
.av-gallery{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;margin:6px 0 12px}
.av-gallery button{padding:0;border:0;background:var(--surface2);border-radius:8px;overflow:hidden;
  aspect-ratio:1;display:grid;place-items:center;cursor:pointer;color:var(--mut);font-size:11px}
.av-gallery img{width:100%;height:100%;object-fit:cover;display:block}
.info-sec{margin:12px 0 4px}
.info-sec>h3{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--mut);margin:0 0 6px}
.info-actions2{display:flex;flex-wrap:wrap;gap:6px}
.info-actions2 button{border:1px solid var(--line);background:var(--surface2);color:var(--ink);border-radius:10px;
  padding:7px 10px;font-size:12px;cursor:pointer;display:inline-flex;align-items:center;gap:6px}
.info-actions2 button:hover{border-color:var(--acc);color:var(--acc)}
.info-actions2 button.on{background:rgba(90,160,247,.18);border-color:var(--acc);color:var(--acc)}
.info-actions2 button svg{width:14px;height:14px}
.info-online{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--ok);margin-right:5px;vertical-align:middle}

/* ---------- call screen ---------- */
.call-screen{position:fixed;inset:0;z-index:90;background:radial-gradient(1200px 700px at 50% -10%,#173252 0%,#0A1524 55%,#060D18 100%);
  color:#EAF3FF;display:flex;flex-direction:column;padding:calc(10px + var(--safe-t)) 12px calc(12px + var(--safe-b))}
.call-screen[hidden]{display:none}
body.light .call-screen{background:radial-gradient(1200px 700px at 50% -10%,#E8F1FF 0%,#F5F7FB 60%,#EEF2F8 100%);color:#0F1B2D}
.call-top{display:flex;align-items:center;gap:12px;padding:4px 6px 10px}
.call-who{min-width:0}
.call-title{font-size:16px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.call-sub{font-size:12px;opacity:.75;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.call-timer{margin-left:auto;font-variant-numeric:tabular-nums;font-size:14px;font-weight:700;opacity:.9;
  background:rgba(255,255,255,.10);padding:4px 12px;border-radius:999px}
body.light .call-timer{background:rgba(15,27,45,.07)}
.call-min{color:inherit}
.call-grid{flex:1;min-height:0;display:grid;gap:8px;grid-template-columns:1fr;align-content:center;overflow:auto}
.call-grid.n2{grid-template-columns:repeat(2,1fr)}
.call-grid.n3,.call-grid.n4{grid-template-columns:repeat(2,1fr)}
@media(max-width:700px){.call-grid.n3,.call-grid.n4{grid-template-columns:1fr 1fr}}
.call-tile{position:relative;border-radius:16px;overflow:hidden;background:#0E1B2C;min-height:150px;
  border:1px solid rgba(255,255,255,.10);display:grid;place-items:center}
body.light .call-tile{background:#DCE6F5;border-color:rgba(15,27,45,.10)}
.call-tile video{width:100%;height:100%;object-fit:cover;display:block;background:#0A1220}
.call-tile.audio-only{background:linear-gradient(160deg,#12263D,#0B1729)}
.call-tile .tile-ava{width:76px;height:76px;border-radius:50%;display:grid;place-items:center;font-size:26px;
  font-weight:800;background:rgba(90,160,247,.28);color:#EAF3FF}
body.light .call-tile .tile-ava{background:#2563EB;color:#fff}
.call-tile .tile-name{position:absolute;left:8px;bottom:8px;font-size:11.5px;font-weight:700;
  background:rgba(4,10,20,.55);padding:2px 8px;border-radius:999px;max-width:80%;overflow:hidden;
  white-space:nowrap;text-overflow:ellipsis}
body.light .call-tile .tile-name{background:rgba(255,255,255,.8);color:#0F1B2D}
.call-tile .tile-mic{position:absolute;right:8px;bottom:8px;width:22px;height:22px;border-radius:50%;
  background:rgba(4,10,20,.55);display:grid;place-items:center;color:#FCA5A5}
.call-tile .tile-mic svg{width:12px;height:12px}
.call-tile.speaking{box-shadow:0 0 0 2px var(--ok),0 0 22px rgba(34,197,94,.35)}
.call-tile.local{position:absolute;right:14px;bottom:96px;width:110px;min-height:0;aspect-ratio:3/4;
  z-index:2;box-shadow:0 6px 22px rgba(0,0,0,.45)}
.call-tile.local video{transform:scaleX(-1)}
.call-tile.local .tile-name{display:none}
.call-participants{display:flex;flex-wrap:wrap;gap:5px;justify-content:center;padding:8px 4px;font-size:11px;
  color:rgba(234,243,255,.8)}
body.light .call-participants{color:#5B6B82}
.call-participants span{background:rgba(255,255,255,.10);padding:2px 9px;border-radius:999px}
body.light .call-participants span{background:rgba(15,27,45,.06)}
.call-controls{display:flex;justify-content:center;gap:10px;padding:10px 0 4px}
.cc-btn{width:52px;height:52px;border-radius:50%;border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.10);
  color:#EAF3FF;display:grid;place-items:center;cursor:pointer;position:relative}
.cc-btn .ic{width:22px;height:22px}
.cc-btn:hover{background:rgba(255,255,255,.18)}
.cc-btn.off{background:#F87171;color:#fff;border-color:transparent}
.cc-btn.hangup{background:#EF4444;border-color:transparent;width:60px;height:60px}
.cc-btn .xline{position:absolute;width:30px;height:2px;background:currentColor;transform:rotate(-45deg);display:none}
.cc-btn.off .xline{display:none}
body.light .cc-btn{background:rgba(15,27,45,.06);border-color:rgba(15,27,45,.12);color:#0F1B2D}
body.light .cc-btn:hover{background:rgba(15,27,45,.10)}
@media(max-width:520px){.cc-btn{width:46px;height:46px}.cc-btn.hangup{width:54px;height:54px}.call-controls{gap:7px}}
.call-mini-window{position:fixed;z-index:91;right:14px;bottom:14px;display:flex;align-items:center;gap:8px;
  background:var(--surface);color:var(--ink);border:1px solid var(--line2);border-radius:14px;
  padding:8px 10px;box-shadow:var(--shadow)}
.call-mini-window[hidden]{display:none}
.call-mini-title{font-size:12.5px;font-weight:700;max-width:140px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.call-mini-timer{font-variant-numeric:tabular-nums;font-size:12px;color:var(--acc);font-weight:700}
.call-mini-window .hangup{color:var(--danger)}

/* ---------- incoming call ---------- */
.incoming{position:fixed;inset:0;z-index:95;display:grid;place-items:center;background:rgba(4,10,20,.62);
  backdrop-filter:blur(4px)}
.incoming[hidden]{display:none}
.incoming-card{width:min(360px,92vw);background:var(--surface);color:var(--ink);border-radius:24px;
  padding:26px 20px 20px;text-align:center;box-shadow:0 24px 70px rgba(0,0,0,.5);border:1px solid var(--line2)}
.incoming-ava{width:82px;height:82px;margin:0 auto 12px;border-radius:50%;display:grid;place-items:center;
  font-size:30px;font-weight:800;background:rgba(90,160,247,.18);color:var(--acc);animation:incoming 1.6s infinite}
@keyframes incoming{0%,100%{box-shadow:0 0 0 0 rgba(90,160,247,.35)}50%{box-shadow:0 0 0 14px rgba(90,160,247,0)}}
.incoming-name{font-size:18px;font-weight:800}
.incoming-sub{font-size:12.5px;color:var(--mut);margin:4px 0 18px}
.incoming-actions{display:flex;justify-content:center;gap:18px}
.incoming-btn{display:inline-flex;flex-direction:column;align-items:center;gap:6px;border:0;background:transparent;
  color:var(--ink);font-size:12px;cursor:pointer}
.incoming-btn .ic{width:52px;height:52px;padding:14px;border-radius:50%;background:var(--surface2);color:var(--ink)}
.incoming-btn.reject .ic{background:#EF4444;color:#fff}
.incoming-btn.accept .ic{background:#22C55E;color:#fff}
.incoming-btn.cam{margin-top:16px;padding:9px 18px;border:1px solid var(--line2);border-radius:999px;
  font-size:13px;font-weight:700;background:rgba(90,160,247,.14);color:var(--acc)}

/* ---------- media viewer ---------- */
.viewer{position:fixed;inset:0;z-index:92;background:rgba(3,8,16,.94);color:#EAF3FF;display:flex;
  flex-direction:column;padding:calc(8px + var(--safe-t)) 10px calc(10px + var(--safe-b))}
.viewer[hidden]{display:none}
.viewer-top{display:flex;align-items:center;gap:10px;padding:2px 4px 8px}
.viewer-top span{font-size:13px;opacity:.85;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1}
.viewer-tools{display:flex;gap:4px}
.viewer-tools .icon-btn{color:#EAF3FF}
.viewer-stage{flex:1;min-height:0;display:grid;place-items:center;overflow:hidden;touch-action:none}
.viewer-stage img,.viewer-stage video{max-width:100%;max-height:100%;transition:transform .12s;border-radius:8px;
  user-select:none;-webkit-user-drag:none}
.viewer-nav{position:absolute;top:50%;transform:translateY(-50%);width:44px;height:64px;border:0;cursor:pointer;
  background:rgba(255,255,255,.10);color:#fff;font-size:26px;border-radius:12px}
.viewer-nav.prev{left:8px}.viewer-nav.next{right:8px}
.viewer-nav:disabled{opacity:.2}

/* ---------- light theme touch-ups for AV ---------- */
body.light .sheet{background:rgba(15,27,45,.38)}
body.light .sheet-card,body.light .panel{box-shadow:0 18px 50px rgba(15,27,45,.18)}
body.light .av-voice .vplay{background:#E3EDFB}
body.light .msg .av-reply{background:rgba(37,99,235,.08)}
body.light .msg.me .av-reply{background:rgba(255,255,255,.20)}
body.light .pin-bar{background:#EDF2FA}
body.light .reply-bar{background:#EDF2FA}
body.light .rec-bar{background:#fff}
body.light .panel .chip.on{background:#2563EB;color:#fff}

/* ---------- mobile ---------- */
@media(max-width:820px){
  .head-actions .icon-btn{width:34px;height:34px}
  #callAudioBtn,#callVideoBtn{display:none}
  #callVideoBtn{display:inline-flex}
  .av-voice{min-width:170px}
  .panel{width:100%}
  .call-tile.local{width:86px;bottom:88px;right:10px}
  .msg{max-width:86%}
  .av-photo img,.av-video video{max-height:260px}
}
@media(prefers-reduced-motion:reduce){.rec-dot,.incoming-ava{animation:none}}

/* ---------- mobile hardening (owner feedback 22.11): one composer row ---------- */
@media(max-width:820px){
  .app{height:100vh;height:100dvh}
  .layout{flex:1;min-height:0}
  .chat{min-height:0;overflow:hidden}
  .msgs{padding:12px 12px 6px;gap:8px;flex:1;min-height:0;-webkit-overflow-scrolling:touch}
  .msg{max-width:78%!important}
  body.chat-open .head-actions #chatSearchBtn{display:none}
  .head-actions{gap:0;margin-left:auto}
  .head-actions .icon-btn{width:38px!important;height:38px!important}
  .chat-title{font-size:15px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .chat-sub{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .composer{flex:none;display:flex;flex-wrap:nowrap;align-items:flex-end;gap:6px;
    padding:8px 10px calc(8px + var(--safe-b))!important;background:var(--bg2);
    padding-bottom:calc(8px + env(safe-area-inset-bottom,0px))!important}
  .composer textarea{flex:1 1 auto;min-width:0;width:auto;height:46px;min-height:46px!important;max-height:120px;
    padding:11px 12px!important;font-size:16px!important;line-height:1.35;resize:none;overflow:auto}
  .composer textarea::placeholder{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .composer .c-btn{flex:0 0 46px;width:46px!important;height:46px!important}
  .composer .c-btn .ic{width:22px;height:22px}
  .rec-bar{padding:8px 10px;gap:6px}
  .rec-hint{display:none}
  .select-bar{padding:6px 8px;gap:2px}
  .pin-bar{margin:0 0 4px;padding:6px 8px;font-size:12px}
  .reply-bar{margin:4px 0 0;padding:6px 8px}
  .call-tile.local{width:92px;bottom:82px;right:8px}
  .call-controls{gap:6px;padding:8px 0 2px}
  .cc-btn{width:44px;height:44px}
  .cc-btn.hangup{width:52px;height:52px}
  .call-top{padding:2px 2px 8px}
  .call-timer{font-size:12.5px;padding:3px 9px}
}
@media(max-width:380px){
  .composer{gap:4px;padding-left:8px!important;padding-right:8px!important}
  .composer .c-btn{flex:0 0 42px;width:42px!important;height:42px!important}
  .composer textarea{height:42px;min-height:42px!important;padding:10px 10px!important;font-size:15px!important}
}

/* ---------- safe areas / system bars (Android + iOS, owner feedback) ---------- */
.topbar{padding-left:calc(14px + env(safe-area-inset-left,0px))!important;
  padding-right:calc(10px + env(safe-area-inset-right,0px))!important}
@media(max-width:820px){
  .topbar{padding-top:calc(5px + env(safe-area-inset-top,0px))!important;
    height:calc(56px + env(safe-area-inset-top,0px))!important;box-sizing:border-box}
  .app{height:var(--vvh,100dvh)}
  .composer{padding-bottom:max(10px, calc(8px + env(safe-area-inset-bottom,0px)))!important;
    padding-left:calc(10px + env(safe-area-inset-left,0px))!important;
    padding-right:calc(10px + env(safe-area-inset-right,0px))!important}
  .msgs{padding-bottom:6px!important}
  .call-screen{padding-top:calc(8px + env(safe-area-inset-top,0px))!important;
    padding-bottom:calc(10px + env(safe-area-inset-bottom,0px))!important}
  .viewer{padding-top:calc(8px + env(safe-area-inset-top,0px))!important;
    padding-bottom:calc(10px + env(safe-area-inset-bottom,0px))!important}
  .sheet-card{padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))!important}
}
@media(max-width:820px) and (display-mode:standalone){
  .topbar{padding-top:calc(8px + env(safe-area-inset-top,0px))!important}
}
/* test hooks for safe-area emulation in headless Chrome (no real cutouts there) */
body.safe-test .topbar{padding-top:calc(30px + env(safe-area-inset-top,0px))!important;height:calc(56px + 30px)!important}
body.safe-test .composer{padding-bottom:48px!important}
body.safe-test .call-screen{padding-top:30px!important;padding-bottom:48px!important}

/* --- NavX phone identity MVP (22.11.2026): привязка номера, поиск и звонок по номеру --- */
.phone-card{margin:4px 0 10px;background:var(--surface2);border:1px solid var(--line);border-radius:14px;align-items:flex-start}
.phone-ava{background:linear-gradient(135deg,var(--acc2),#22B8FF);color:#fff;flex:0 0 auto}
.phone-num{font-size:14px;letter-spacing:.4px}
.phone-ok{color:#3ED598;font-weight:700;margin-left:4px}
.phone-bind-btn{margin-top:7px;height:32px;padding:0 12px;border-radius:10px;border:1px solid var(--line2);
  background:var(--surface);color:var(--acc);font:inherit;font-size:12px;font-weight:700;cursor:pointer}
.phone-bind-btn:hover{background:var(--surface2)}
.phone-search{margin:0 0 8px}
.phone-btnrow{display:flex;gap:8px;padding:0 2px 6px}
.phone-btnrow .btn{height:42px;flex:1}
.phone-results{padding-top:4px}
.phone-hit{background:var(--surface2);border:1px solid var(--line);border-radius:14px}
.phone-acts button{width:34px;height:34px;font-size:15px;display:grid;place-items:center;border-radius:50%;
  border:1px solid var(--line);background:transparent;color:var(--ink);cursor:pointer}
.phone-acts button:hover{background:var(--surface)}
.phone-bind-p{padding:2px 10px 10px;margin:0;font-size:13.5px;line-height:1.55;color:var(--mut)}
.phone-err{color:#ff8a8a;font-size:12.5px;min-height:16px;padding:0 10px 4px}
.phone-hint{padding:4px 10px 8px;font-size:12px;color:var(--mut)}
.phone-hint-line{background:var(--surface2);border:1px solid var(--line);border-radius:10px;padding:8px 10px;line-height:1.45}
.phone-hint-line.dev{border-color:rgba(255,178,74,.45);color:#FFB24A}
.phone-code-input{letter-spacing:6px;font-weight:700;text-align:center}
body.light .phone-hint-line.dev{color:#B26A00}
