:root { --bg:#f7f5fd; --card:#fff; --text:#1c2333; --muted:#6b7385; --line:#e7e3f2; --brand:#7C3AED; --brand2:#DB2777; --grad:linear-gradient(135deg,#7C3AED,#DB2777); --ok:#14904a; --warn:#b26a00; --bad:#c62828; --radius:12px; }
@media (prefers-color-scheme: dark) { :root { --bg:#14111d; --card:#1e1a2b; --text:#ece8f6; --muted:#a39cb8; --line:#2f2942; --brand:#A78BFA; } }
* { box-sizing: border-box; }
[hidden] { display:none !important; }
body { margin:0; font:15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background:var(--bg); color:var(--text); }
.top { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:14px clamp(16px,4vw,40px); background:var(--card); border-bottom:1px solid var(--line); flex-wrap:wrap; }
.brand { font-weight:700; color:var(--brand); }
.who { display:flex; gap:14px; align-items:center; flex-wrap:wrap; color:var(--muted); }
main { padding:24px clamp(16px,4vw,40px); max-width:1400px; margin:0 auto; }
h1 { font-size:22px; margin:0 0 12px; } h2 { font-size:18px; margin:0; }
.card { background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:20px; }
.narrow { max-width:420px; margin:40px auto; }
label { display:block; margin:0 0 12px; font-size:13px; color:var(--muted); }
input, select { display:block; width:100%; margin-top:4px; padding:10px 12px; font:inherit; color:var(--text); background:var(--bg); border:1px solid var(--line); border-radius:8px; }
.inline { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.inline input, .inline select { width:auto; margin:0; min-width:180px; }
button { font:inherit; padding:9px 14px; border-radius:8px; border:1px solid var(--line); background:var(--card); color:var(--text); cursor:pointer; min-height:40px; }
button:disabled { opacity:.55; cursor:default; }
button.primary { background:var(--brand); border-color:var(--brand); color:#fff; }
button.danger { color:var(--bad); }
button.link { border:0; background:none; color:var(--brand); padding:0; min-height:0; }
.row-head { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; margin:8px 0 14px; }
.grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(300px, 1fr)); gap:16px; margin-bottom:32px; }
.profile { display:flex; flex-direction:column; gap:10px; }
.profile .head { display:flex; justify-content:space-between; gap:8px; align-items:flex-start; }
.profile .title { font-weight:600; }
.profile .sub { color:var(--muted); font-size:13px; }
.badge { font-size:12px; padding:3px 9px; border-radius:99px; white-space:nowrap; background:var(--line); }
.badge.ok { background:color-mix(in srgb, var(--ok) 16%, transparent); color:var(--ok); }
.badge.warn { background:color-mix(in srgb, var(--warn) 16%, transparent); color:var(--warn); }
.badge.bad { background:color-mix(in srgb, var(--bad) 14%, transparent); color:var(--bad); }
.qr { align-self:center; text-align:center; }
.qr img { width:240px; max-width:100%; height:auto; background:#fff; padding:6px; border-radius:8px; }
.qr p { margin:6px 0 0; font-size:13px; color:var(--muted); }
.buttons { display:flex; gap:8px; flex-wrap:wrap; }
.error { color:var(--bad); min-height:1em; margin:8px 0 0; }
.muted { color:var(--muted); font-size:13px; }
.notice { background:var(--card); border:1px solid var(--brand); border-radius:var(--radius); padding:14px; margin-bottom:14px; display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
code { font:13px ui-monospace, Consolas, monospace; word-break:break-all; background:var(--bg); padding:2px 6px; border-radius:6px; }
table.tokens { width:100%; border-collapse:collapse; background:var(--card); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; }
.tokens th, .tokens td { text-align:left; padding:10px 12px; border-bottom:1px solid var(--line); font-size:14px; }
.tokens th { color:var(--muted); font-weight:500; }
dialog { border:1px solid var(--line); border-radius:var(--radius); background:var(--card); color:var(--text); padding:20px; width:min(440px, 92vw); }
dialog::backdrop { background:rgba(0,0,0,.4); }
.actions { display:flex; justify-content:flex-end; gap:8px; margin-top:8px; }
@media (max-width:600px) { .tokens th:nth-child(3), .tokens td:nth-child(3), .tokens th:nth-child(4), .tokens td:nth-child(4) { display:none; } .inline input, .inline select { min-width:0; flex:1 1 140px; } }

/* ---------------- вкладки ---------------- */
.tabs { display:flex; gap:4px; flex-wrap:wrap; }
.tabs button { border:0; background:none; min-height:36px; padding:6px 14px; border-radius:8px; color:var(--muted); }
.tabs button.active { background:color-mix(in srgb, var(--brand) 12%, transparent); color:var(--brand); font-weight:600; }
.count { display:inline-block; min-width:20px; padding:1px 6px; border-radius:99px; background:var(--brand); color:#fff; font-size:12px; line-height:18px; text-align:center; font-weight:600; }
.doc h2 { margin:22px 0 8px; }
.doc table { margin:8px 0; }
.methods { width:100%; border-collapse:collapse; }
.methods th, .methods td { text-align:left; padding:8px 10px; border-bottom:1px solid var(--line); font-size:14px; vertical-align:top; }
.methods th { color:var(--muted); font-weight:500; }
pre { background:var(--bg); border:1px solid var(--line); border-radius:8px; padding:12px; overflow:auto; font:13px/1.5 ui-monospace, Consolas, monospace; white-space:pre-wrap; word-break:break-all; }

/* ---------------- мессенджер ---------------- */
body.wide main { max-width:none; padding:0; }
.messenger { display:grid; grid-template-columns:minmax(280px, 360px) 1fr; height:calc(100vh - 69px); height:calc(100dvh - 69px); background:var(--card); border-top:0; }
.side { display:flex; flex-direction:column; border-right:1px solid var(--line); min-height:0; }
.accounts { display:flex; gap:6px; flex-wrap:wrap; padding:10px 10px 0; }
.acc { min-height:32px; padding:4px 10px; font-size:13px; display:inline-flex; gap:6px; align-items:center; }
.acc.active { border-color:var(--brand); color:var(--brand); font-weight:600; }
.acc .off { color:var(--bad); font-size:10px; }
#chat-search { margin:10px; width:auto; }
.chat-list { overflow-y:auto; flex:1; min-height:0; }
.chat { display:flex; gap:10px; align-items:center; width:100%; text-align:left; border:0; border-radius:0; padding:10px 12px; background:none; min-height:64px; border-bottom:1px solid var(--line); }
.chat:hover { background:var(--bg); }
.chat.active { background:color-mix(in srgb, var(--brand) 10%, transparent); }
.chat .meta { flex:1; min-width:0; }
.chat .line { display:flex; justify-content:space-between; gap:8px; align-items:center; }
.chat .name { font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat .time { color:var(--muted); font-size:12px; white-space:nowrap; }
.chat .last { color:var(--muted); font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; min-width:0; }
.chat.unread .time { color:var(--brand); }
.chat.unread .last { color:var(--text); }
.ava { width:44px; height:44px; border-radius:50%; flex:none; display:grid; place-items:center; color:#fff; font-weight:600; overflow:hidden; background:var(--line); }
.ava img { width:100%; height:100%; object-fit:cover; }
.pad { padding:16px; }
.conv { position:relative; display:flex; flex-direction:column; min-height:0; background:var(--bg); }
.conv-empty { margin:auto; text-align:center; color:var(--muted); }
.conv-body { display:flex; flex-direction:column; height:100%; min-height:0; }
.conv-head { display:flex; gap:10px; align-items:center; padding:10px 14px; background:var(--card); border-bottom:1px solid var(--line); }
.conv-head .ava { width:40px; height:40px; }
.conv-title { min-width:0; } .conv-title > div:first-child { font-weight:600; }
.conv-title .muted { margin:0; }
/* «Данные группы» — как в WhatsApp/Telegram: подсказка при наведении на шапку и панель справа */
.conv-head.is-group { cursor:pointer; } .conv-head.is-group:hover .conv-title > div:first-child { text-decoration:underline; }
.ginfo-tip { position:absolute; top:60px; left:14px; z-index:20; max-width:340px; background:var(--card); border:1px solid var(--line); border-radius:10px; box-shadow:0 6px 24px rgba(0,0,0,.14); padding:10px 12px; font-size:13px; }
.ginfo-tip b { display:block; margin-bottom:4px; } .ginfo-tip .muted { margin:4px 0 0; }
.ginfo { position:absolute; top:0; right:0; bottom:0; width:min(380px, 100%); z-index:25; background:var(--card); border-left:1px solid var(--line); display:flex; flex-direction:column; box-shadow:-6px 0 24px rgba(0,0,0,.08); }
.ginfo-head { display:flex; gap:10px; align-items:center; padding:12px 14px; border-bottom:1px solid var(--line); }
.ginfo-close { border:0; background:none; font-size:18px; min-height:32px; padding:2px 8px; }
.ginfo-body { overflow-y:auto; padding:16px; flex:1; }
.ginfo-top { text-align:center; margin-bottom:14px; } .ginfo-top .ava { width:96px; height:96px; font-size:36px; margin:0 auto 8px; }
.ginfo-top .gname { font-size:18px; font-weight:600; overflow-wrap:anywhere; }
.ginfo-desc { white-space:pre-wrap; overflow-wrap:anywhere; background:var(--bg); border-radius:8px; padding:10px; margin:0 0 12px; font-size:14px; }
.ginfo-sec { font-size:13px; color:var(--muted); margin:12px 0 6px; display:flex; justify-content:space-between; gap:8px; align-items:center; }
.ginfo input[type=search] { margin:0 0 8px; }
.gmember { display:flex; gap:10px; align-items:center; padding:7px 4px; border-bottom:1px solid var(--line); }
.gmember .ava { width:36px; height:36px; font-size:14px; }
.gmember .who { flex:1; min-width:0; } .gmember .who div { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.gmember .who .muted { margin:0; }
.gbadge { font-size:11px; padding:2px 7px; border-radius:99px; background:color-mix(in srgb, var(--ok) 15%, transparent); color:var(--ok); white-space:nowrap; }
.gmember button { min-height:30px; padding:3px 9px; font-size:12px; }
@media (max-width: 700px) { .ginfo { width:100%; } .ginfo-tip { display:none !important; } }
.back { display:none; border:0; background:none; font-size:20px; padding:4px 8px; min-height:36px; }
.msgs { flex:1; overflow-y:auto; padding:12px clamp(10px, 3vw, 40px); min-height:0; }
.msgs-top { text-align:center; margin:4px 0 10px; }
.day { text-align:center; margin:12px 0 8px; font-size:12px; color:var(--muted); }
.msg { max-width:min(560px, 78%); margin:3px 0; padding:7px 10px 5px; border-radius:12px; background:var(--card); border:1px solid var(--line); word-wrap:break-word; overflow-wrap:anywhere; }
.msg.out { margin-left:auto; background:color-mix(in srgb, var(--brand) 13%, var(--card)); border-color:color-mix(in srgb, var(--brand) 25%, var(--line)); }
.msg .text { white-space:pre-wrap; }
.msg .sender { font-size:12px; font-weight:600; color:var(--brand); }
.msg .foot { display:flex; gap:4px; justify-content:flex-end; align-items:center; font-size:11px; color:var(--muted); margin-top:2px; }
.tick { font-size:11px; letter-spacing:-2px; color:var(--muted); }
.tick.read { color:#1a8cff; }
.tick.error, .tick.undelivered { color:var(--bad); letter-spacing:0; }
.media img, .media video { display:block; max-width:100%; max-height:320px; border-radius:8px; margin-bottom:4px; }
.media audio { width:260px; max-width:100%; }
.media .file { display:inline-block; padding:6px 0; }
.media .load { min-height:34px; font-size:13px; }
.composer { display:flex; gap:8px; align-items:flex-end; padding:10px 14px; background:var(--card); border-top:1px solid var(--line); }
.composer textarea { flex:1; resize:none; font:inherit; color:var(--text); background:var(--bg); border:1px solid var(--line); border-radius:10px; padding:10px 12px; max-height:180px; min-height:42px; }
.attach { display:grid; place-items:center; width:42px; height:42px; margin:0; font-size:20px; cursor:pointer; color:var(--muted); border-radius:8px; flex:none; }
.attach:hover { background:var(--bg); }
.send { width:46px; height:42px; padding:0; font-size:18px; flex:none; }
.conv-error { margin:0; padding:0 14px 8px; background:var(--card); min-height:0; }
.conv-error:empty { display:none; }
.drop { position:absolute; inset:0; display:grid; place-items:center; background:color-mix(in srgb, var(--brand) 18%, transparent); border:3px dashed var(--brand); font-size:20px; color:var(--brand); z-index:5; pointer-events:none; }
@media (max-width:760px) {
  .messenger { grid-template-columns:1fr; }
  .messenger .conv { display:none; }
  .messenger.open .side { display:none; }
  .messenger.open .conv { display:flex; }
  .back { display:block; }
  .msg { max-width:88%; }
  .top { padding:10px 12px; }
}
/* Вкладка «Чаты» занимает весь экран под шапкой любой высоты */
body.wide { height:100vh; height:100dvh; display:flex; flex-direction:column; overflow:hidden; }
body.wide main { flex:1; min-height:0; width:100%; margin:0; }
body.wide #view-main, body.wide #pane-chats { height:100%; }
body.wide .messenger { height:100%; }
@media (max-width:760px) { #who-email { display:none; } .tabs button { padding:6px 10px; } }
.brand-ico { width:20px; height:20px; flex:none; display:block; }
label textarea, .cm-add textarea { display:block; width:100%; margin-top:4px; padding:10px 12px; font:inherit; color:var(--text); background:var(--bg); border:1px solid var(--line); border-radius:8px; resize:vertical; }
dialog textarea { min-height:44px; }

/* ---------------- чаты: личные / группы и каналы ---------------- */
.kinds { display:flex; gap:4px; padding:10px 10px 0; }
.kinds button { flex:1; min-height:32px; padding:4px 8px; font-size:13px; }
.kinds button.active { border-color:var(--brand); color:var(--brand); font-weight:600; background:color-mix(in srgb, var(--brand) 8%, var(--card)); }
.ai-draft { width:42px; height:42px; min-height:42px; padding:0; font-size:18px; flex:none; border:0; background:none; }
.ai-draft:hover { background:var(--bg); }
.ai-note { margin:0; padding:6px 14px 8px; background:var(--card); color:var(--muted); font-size:13px; }
#cm-ai-form input { min-width:280px; }
.readonly-note { margin:0; padding:12px 14px; background:var(--card); border-top:1px solid var(--line); color:var(--muted); font-size:13px; text-align:center; }

/* ---------------- «Комментируй это» ---------------- */
#pane-comment { max-width:960px; }
.cm-block { margin-bottom:16px; }
.cm-block h2 { margin-bottom:6px; }
.cm-block .row-head { margin:0 0 6px; }
.cm-settings { display:grid; grid-template-columns:2fr 1fr 1fr auto; gap:12px; align-items:end; }
.cm-settings label { margin:0; }
.cm-settings button { height:42px; }
.cm-services { display:flex; flex-direction:column; gap:12px; margin-top:10px; }
.cm-service { border:1px solid var(--line); border-radius:10px; padding:14px; display:flex; flex-direction:column; gap:10px; }
.cm-head { display:flex; justify-content:space-between; gap:10px; align-items:flex-start; flex-wrap:wrap; }
.cm-head a { word-break:break-all; }
.cm-name { font-weight:700; font-size:16px; }
.cm-field b { display:block; font-size:13px; color:var(--muted); font-weight:600; margin-bottom:2px; }
.cm-text { white-space:pre-wrap; overflow-wrap:anywhere; }
.cm-imps { list-style:none; margin:6px 0; padding:0; display:flex; flex-direction:column; gap:6px; }
.cm-imps li { background:var(--bg); border-radius:8px; padding:8px 10px; }
.cm-imp-foot { display:flex; justify-content:space-between; gap:8px; margin-top:4px; }
.cm-add { display:flex; gap:8px; align-items:flex-end; }
.cm-add textarea { margin:0; flex:1; }
.cm-add button { flex:none; }
.cm-keywords { display:flex; gap:8px; align-items:flex-end; flex-wrap:wrap; }
.cm-keywords label { flex:1 1 320px; margin:0; }
.cm-keywords button { height:42px; }
.cm-chips { display:flex; gap:6px; flex-wrap:wrap; margin:10px 0; }
.chip { min-height:32px; padding:4px 12px; border-radius:99px; font-size:13px; }
.cm-search { margin-top:4px; }
.cm-search input { flex:1 1 240px; }
.cm-groups { display:flex; flex-direction:column; gap:8px; }
.cm-group { display:flex; justify-content:space-between; gap:10px; align-items:center; border:1px solid var(--line); border-radius:10px; padding:10px 12px; flex-wrap:wrap; }
.cm-group-main { min-width:0; flex:1 1 260px; display:flex; gap:10px; align-items:flex-start; margin:0; color:var(--text); font-size:15px; cursor:pointer; }
.cm-group-main > span { display:flex; flex-direction:column; min-width:0; }
.cm-group-meta { font-size:13px; margin:0; }
.cm-pick { width:20px; height:20px; margin:2px 0 0; padding:0; flex:none; display:inline-block; }
.cm-group.queued { border-color:color-mix(in srgb, var(--warn) 45%, var(--line)); }
.cm-queue-bar { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin:0 0 10px; }
.cm-group .cm-name { font-size:15px; }
.cm-feed { display:flex; flex-direction:column; gap:10px; }
.cm-person { display:flex; flex-wrap:wrap; align-items:center; gap:4px 12px; border-top:1px solid var(--line); padding-top:8px; }
.cm-person-name { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 8px; flex:1 1 220px; min-width:0; overflow-wrap:anywhere; }
.cm-person .cm-reply { flex-basis:100%; }
a.button { display:inline-flex; align-items:center; font:inherit; padding:9px 14px; border-radius:8px; border:1px solid var(--line); background:var(--card); color:var(--text); text-decoration:none; min-height:40px; box-sizing:border-box; }
label.check { display:inline-flex; align-items:center; gap:6px; margin:0; font-size:14px; }
label.check input, .inline label.check input { width:auto; min-width:0; flex:none; margin:0; }
.cm-item { border:1px solid var(--line); border-radius:10px; padding:12px; display:flex; flex-direction:column; gap:8px; }
.cm-item.answered { background:color-mix(in srgb, var(--ok) 6%, var(--card)); }
.cm-item-head { display:flex; justify-content:space-between; gap:8px; flex-wrap:wrap; }
.cm-item mark { background:color-mix(in srgb, var(--warn) 30%, transparent); color:inherit; border-radius:3px; padding:0 2px; }
.cm-fold > summary { display:flex; align-items:baseline; gap:12px; cursor:pointer; list-style:none; }
.cm-fold > summary::-webkit-details-marker { display:none; }
.cm-fold > summary::before { content:'▸'; color:var(--muted); font-size:14px; transition:transform .15s; }
.cm-fold[open] > summary::before { transform:rotate(90deg); }
.cm-fold[open] > summary .muted { display:none; }
.cm-fold > summary h2 { margin:0; }
.cm-fold[open] > summary { margin-bottom:10px; }
.cm-fold > .row-head { justify-content:flex-end; margin:0 0 6px; }
.cm-item.deleted { opacity:.6; }
.cm-item.deleted .cm-text { text-decoration:line-through; }
.cm-quote { border-left:3px solid var(--line); padding:2px 0 2px 10px; color:var(--muted); font-size:13px; white-space:pre-wrap; overflow-wrap:anywhere; max-height:5.5em; overflow:hidden; }
#cm-journal-user { min-width:180px; }
.cm-reply { display:flex; flex-direction:column; gap:6px; border-top:1px dashed var(--line); padding-top:8px; }
.cm-reply textarea { width:100%; font:inherit; color:var(--text); background:var(--bg); border:1px solid var(--line); border-radius:8px; padding:10px 12px; resize:vertical; }
.cm-reply p { margin:0; }
.cm-next ul { margin:6px 0 0; padding-left:20px; }
@media (max-width:700px) {
  .cm-settings { grid-template-columns:1fr; }
  .cm-add { flex-direction:column; align-items:stretch; }
}
tr.pending td { background:color-mix(in srgb, var(--warn) 10%, transparent); }

/* список для личных сообщений */
.cm-pickbar { position:sticky; bottom:0; z-index:2; display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px;
  background:var(--card, var(--bg)); border:1px solid var(--line); border-radius:10px; padding:8px 12px; margin:8px 0; }
.cm-pickbar span { flex:1 1 140px; font-weight:600; }
.cm-person > input.cm-pick-person { width:auto; min-width:0; flex:none; margin:0; }
.cm-template { display:flex; flex-direction:column; gap:6px; font-weight:600; }
.cm-template textarea { width:100%; font:inherit; font-weight:400; color:var(--text); background:var(--bg); border:1px solid var(--line);
  border-radius:8px; padding:10px 12px; resize:vertical; }
.cm-said { margin:0; padding:6px 10px; border-left:3px solid var(--line); color:var(--muted, inherit); overflow-wrap:anywhere; flex-basis:100%; }


/* ================= 26.11.2026: шапка, телефон, оформление мессенджеров ================= */
.menu-btn, .top-hide, .top-show { border:0; background:none; font-size:20px; min-height:40px; width:40px; padding:0; display:grid; place-items:center; color:var(--text); border-radius:10px; }
.menu-btn:hover, .top-hide:hover, .top-show:hover { background:var(--bg); }
.top-tab { display:none; font-weight:600; }
.top { flex-wrap:nowrap; }
.top .tabs { flex:1; justify-content:center; }
.top-hide { margin-left:4px; }
.top-show { position:fixed; top:8px; left:8px; z-index:60; background:var(--card); border:1px solid var(--line); box-shadow:0 2px 10px rgba(0,0,0,.12); }
body.top-hidden .top { display:none; }
body.top-hidden .side { padding-top:44px; }
body.top-hidden:not(.wide) main { padding-top:56px; }
@media (min-width:761px) { .menu-btn { display:none !important; } }
@media (max-width:760px) {
  .top { position:relative; padding:6px 8px; padding-top:max(6px, env(safe-area-inset-top)); gap:6px; min-height:52px; }
  .brand { font-size:15px; } .top-tab { display:block; margin-left:auto; color:var(--muted); font-size:14px; }
  .top-hide, .top-show { display:none !important; }
  body.top-hidden .top { display:flex; } body.top-hidden .side { padding-top:0; }
  .top .tabs, .top .who { display:none; }
  body.menu-open .top .tabs:not([hidden]), body.menu-open .top .who:not([hidden]) { display:flex; }
  body.menu-open .top .tabs { position:absolute; left:0; right:0; top:100%; z-index:70; flex-direction:column; gap:2px; padding:8px; background:var(--card); border-bottom:1px solid var(--line); box-shadow:0 10px 24px rgba(0,0,0,.14); }
  body.menu-open .top .tabs button { text-align:left; min-height:46px; font-size:16px; padding:10px 14px; display:flex; justify-content:space-between; align-items:center; }
  body.menu-open .top .who { position:absolute; left:0; right:0; z-index:70; top:calc(100% + var(--tabs-h, 0px)); padding:4px 16px 14px; background:var(--card); border-bottom:1px solid var(--line); flex-direction:column; align-items:flex-start; gap:10px; }
  body.menu-open #who-email { display:block; }
  /* Открытый чат на телефоне — на весь экран, как в мессенджере: шапка сайта прячется */
  body.wide.chat-open .top { display:none; }
  main { padding:14px 12px; }
  input, select, textarea, .composer textarea { font-size:16px !important; } /* без увеличения страницы при вводе */
  .accounts { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; padding:8px 8px 0; }
  .accounts::-webkit-scrollbar { display:none; }
  .acc { flex:none; min-height:36px; border-radius:99px; }
  .chat { min-height:70px; padding:10px 14px; }
  .chat .ava { width:50px; height:50px; }
  .conv-head { padding:8px 6px; padding-top:max(8px, env(safe-area-inset-top)); gap:8px; min-height:58px; }
  .composer { padding:8px; padding-bottom:max(8px, env(safe-area-inset-bottom)); gap:6px; }
  .msgs { padding:10px 8px; }
  .row-head { flex-direction:column; align-items:stretch; }
  .grid { grid-template-columns:1fr; }
  dialog { width:calc(100vw - 24px); }
}
/* Открывающееся меню: ставим список выхода под вкладками */
@media (max-width:760px) { body.menu-open .top .who { position:static; } body.menu-open .top { flex-wrap:wrap; } body.menu-open .top .tabs { position:static; box-shadow:none; border:0; padding:4px 0; order:5; flex-basis:100%; } body.menu-open .top .who { order:6; flex-basis:100%; border:0; padding:4px 14px 10px; } }

/* ---------- оформление по мессенджеру выбранного номера ---------- */
body[data-theme] .msg { border:0; box-shadow:0 1px .5px rgba(11,20,26,.13); }
body[data-theme] .send { border-radius:50%; width:44px; height:44px; min-height:44px; border:0; }
body[data-theme] .composer textarea { border-radius:22px; border:0; padding:11px 16px; }
body[data-theme] .chat { border-bottom:0; }
body[data-theme] .chat .meta { border-bottom:1px solid var(--m-line); padding-bottom:10px; margin-bottom:-10px; }
body[data-theme] .side, body[data-theme] .chat-list, body[data-theme] .accounts, body[data-theme] .kinds { background:var(--m-panel); }
body[data-theme] .side { border-right-color:var(--m-line); }
body[data-theme] #chat-search { background:var(--m-search); border:0; border-radius:10px; }
body[data-theme] .conv-head, body[data-theme] .composer, body[data-theme] .readonly-note, body[data-theme] .conv-error, body[data-theme] .ai-note { background:var(--m-head); border-color:var(--m-line); color:var(--m-head-text); }
body[data-theme] .conv-head .muted { color:var(--m-head-sub); }
body[data-theme] .composer textarea { background:var(--m-input); color:var(--text); }
body[data-theme] .msgs { background:var(--m-chat-bg); }
body[data-theme] .msg { background:var(--m-in); color:var(--m-text); }
body[data-theme] .msg.out { background:var(--m-out); color:var(--m-text-out, var(--m-text)); }
body[data-theme] .msg .foot { color:var(--m-time); }
body[data-theme] .msg.out .foot { color:var(--m-time-out, var(--m-time)); }
body[data-theme] .msg .sender { color:var(--m-accent); }
body[data-theme] .tick.read { color:var(--m-read); }
body[data-theme] .send { background:var(--m-send); color:#fff; }
body[data-theme] .chat.active { background:var(--m-active); }
body[data-theme] .chat.active .name, body[data-theme] .chat.active .last, body[data-theme] .chat.active .time { color:var(--m-active-text, inherit); }
body[data-theme] .chat:hover:not(.active) { background:var(--m-hover); }
body[data-theme] .chat .count, body[data-theme] .acc .count { background:var(--m-badge); }
body[data-theme] .chat.unread .time { color:var(--m-badge); }
body[data-theme] .acc.active, body[data-theme] .kinds button.active { border-color:var(--m-accent); color:var(--m-accent); background:color-mix(in srgb, var(--m-accent) 10%, var(--m-panel)); }
body[data-theme] .day { position:sticky; top:4px; z-index:2; }
body[data-theme] .day span, body[data-theme] .day { color:var(--m-day-text); }
body[data-theme] .msgs-top .link { color:var(--m-accent); }
body[data-theme] .ginfo, body[data-theme] .ginfo-tip { background:var(--m-panel); }
body[data-theme] .gbadge { background:color-mix(in srgb, var(--m-accent) 15%, transparent); color:var(--m-accent); }

/* WhatsApp */
body[data-theme="wz"] {
  --m-accent:#008069; --m-send:#00a884; --m-badge:#25d366; --m-read:#53bdeb; --m-panel:#ffffff; --m-line:#e9edef;
  --m-search:#f0f2f5; --m-head:#f0f2f5; --m-head-text:#111b21; --m-head-sub:#667781; --m-input:#ffffff;
  --m-chat-bg:#efeae2 radial-gradient(rgba(0,0,0,.035) 1px, transparent 1.2px) 0 0/18px 18px;
  --m-in:#ffffff; --m-out:#d9fdd3; --m-text:#111b21; --m-time:#667781; --m-active:#f0f2f5; --m-hover:#f5f6f6; --m-day-text:#54656f;
}
body[data-theme="wz"] .msg { border-radius:7.5px; }
body[data-theme="wz"] .msg.in { border-top-left-radius:0; } body[data-theme="wz"] .msg.out { border-top-right-radius:0; }
body[data-theme="wz"] .day { background:#fff; width:max-content; margin:12px auto 8px; padding:5px 12px; border-radius:7.5px; box-shadow:0 1px .5px rgba(11,20,26,.13); }
@media (max-width:760px) {
  body[data-theme="wz"] .conv-head { background:#008069; } body[data-theme="wz"] .conv-head, body[data-theme="wz"] .conv-head .back { color:#fff; }
  body[data-theme="wz"] .conv-head .muted { color:rgba(255,255,255,.8); }
  body[data-theme="wz"].wide:not(.chat-open) .top { background:#008069; border-color:#008069; }
  body[data-theme="wz"].wide:not(.chat-open) .top .brand, body[data-theme="wz"].wide:not(.chat-open) .top .top-tab, body[data-theme="wz"].wide:not(.chat-open) .menu-btn { color:#fff; }
  body[data-theme="wz"] .composer { background:#efeae2; border:0; } body[data-theme="wz"] .composer textarea { box-shadow:0 1px .5px rgba(11,20,26,.13); }
}
@media (prefers-color-scheme: dark) {
  body[data-theme="wz"] { --m-accent:#00a884; --m-panel:#111b21; --m-line:#222d34; --m-search:#202c33; --m-head:#202c33; --m-head-text:#e9edef; --m-head-sub:#8696a0;
    --m-input:#2a3942; --m-chat-bg:#0b141a radial-gradient(rgba(255,255,255,.025) 1px, transparent 1.2px) 0 0/18px 18px; --m-in:#202c33; --m-out:#005c4b; --m-text:#e9edef;
    --m-time:rgba(233,237,239,.6); --m-active:#2a3942; --m-hover:#202c33; --m-day-text:#8696a0; }
  body[data-theme="wz"] .day { background:#182229; }
  body[data-theme="wz"] .conv-head { background:#202c33; }
}

/* Telegram */
body[data-theme="tg"] {
  --m-accent:#3390ec; --m-send:#3390ec; --m-badge:#3390ec; --m-read:#4fae4e; --m-panel:#ffffff; --m-line:#f1f1f1;
  --m-search:#f4f4f5; --m-head:#ffffff; --m-head-text:#000000; --m-head-sub:#707579; --m-input:#ffffff;
  --m-chat-bg:linear-gradient(160deg, #c3d69a 0%, #a6c48a 35%, #8cb88c 70%, #b2c88a 100%);
  --m-in:#ffffff; --m-out:#eeffde; --m-text:#000000; --m-time:#a0acb6; --m-time-out:#4fae4e; --m-active:#3390ec; --m-active-text:#ffffff; --m-hover:#f4f4f5; --m-day-text:#ffffff;
}
body[data-theme="tg"] .msg { border-radius:15px; } body[data-theme="tg"] .msg.in { border-bottom-left-radius:4px; } body[data-theme="tg"] .msg.out { border-bottom-right-radius:4px; }
body[data-theme="tg"] .msg.out .tick { color:#4fae4e; }
body[data-theme="tg"] .day { background:rgba(0,0,0,.2); width:max-content; margin:12px auto 8px; padding:3px 10px; border-radius:12px; font-weight:500; }
body[data-theme="tg"] .chat { border-radius:12px; margin:0 6px; width:calc(100% - 12px); } body[data-theme="tg"] .chat .meta { border-bottom:0; }
body[data-theme="tg"] .chat .count { border-radius:12px; }
body[data-theme="tg"] .composer { background:transparent; border:0; } body[data-theme="tg"] .composer textarea { border-radius:14px; box-shadow:0 1px 2px rgba(16,16,16,.1); }
body[data-theme="tg"] .msgs-top .link { color:#fff; }
@media (prefers-color-scheme: dark) {
  body[data-theme="tg"] { --m-accent:#8774e1; --m-send:#8774e1; --m-badge:#8774e1; --m-panel:#212121; --m-line:#2c2c2c; --m-search:#2c2c2c; --m-head:#212121; --m-head-text:#fff; --m-head-sub:#aaaaaa;
    --m-input:#212121; --m-chat-bg:linear-gradient(160deg, #1e2a24 0%, #232f2c 50%, #1b2422 100%); --m-in:#212121; --m-out:#766ac8; --m-text:#fff; --m-time:#8f8f8f; --m-time-out:rgba(255,255,255,.65); --m-active:#766ac8; --m-hover:#2c2c2c; }
  body[data-theme="tg"] .msg.out .tick { color:#fff; }
}
@media (max-width:760px) { body[data-theme="tg"] .chat { margin:0; width:100%; border-radius:0; } }

/* MAX */
body[data-theme="max"] {
  --m-accent:#3a5cff; --m-send:linear-gradient(135deg, #2e7bff, #7b3cff); --m-badge:#4b5bff; --m-read:#3a5cff; --m-panel:#ffffff; --m-line:#eef0f5;
  --m-search:#f2f3f7; --m-head:#ffffff; --m-head-text:#111827; --m-head-sub:#7b8094; --m-input:#f2f3f7;
  --m-chat-bg:linear-gradient(180deg, #f6f7fb 0%, #eef1ff 100%);
  --m-in:#ffffff; --m-out:linear-gradient(135deg, #3a7bff, #6a4bff); --m-text:#111827; --m-text-out:#ffffff; --m-time:#9aa0b4; --m-time-out:rgba(255,255,255,.78);
  --m-active:#eef1ff; --m-hover:#f6f7fb; --m-day-text:#7b8094;
}
body[data-theme="max"] .msg { border-radius:18px; box-shadow:0 1px 2px rgba(17,24,39,.08); }
body[data-theme="max"] .msg.out .tick, body[data-theme="max"] .msg.out .tick.read { color:#fff; }
body[data-theme="max"] .msg.out a { color:#fff; }
body[data-theme="max"] .day { background:#fff; width:max-content; margin:12px auto 8px; padding:3px 12px; border-radius:99px; box-shadow:0 1px 2px rgba(17,24,39,.06); }
body[data-theme="max"] .chat { border-radius:14px; margin:0 6px; width:calc(100% - 12px); } body[data-theme="max"] .chat .meta { border-bottom:0; }
body[data-theme="max"] .composer textarea { border-radius:20px; }
@media (prefers-color-scheme: dark) {
  body[data-theme="max"] { --m-panel:#16161d; --m-line:#24242e; --m-search:#22222c; --m-head:#16161d; --m-head-text:#f3f4f8; --m-head-sub:#9a9cab; --m-input:#22222c;
    --m-chat-bg:linear-gradient(180deg, #101016 0%, #15152a 100%); --m-in:#22222c; --m-text:#f3f4f8; --m-active:#23233a; --m-hover:#1d1d26; }
  body[data-theme="max"] .day { background:#22222c; }
}
@media (max-width:760px) { body[data-theme="max"] .chat { margin:0; width:100%; border-radius:0; } }
@media (max-width:760px) { .messenger { grid-template-columns:minmax(0, 1fr); } .side, .conv { min-width:0; } .kinds button { min-width:0; } }

/* автор в группе: цветное имя-кнопка, меню «Написать лично» */
.msg button.sender { display:block; border:0; background:none; padding:0; min-height:0; font-size:12.5px; font-weight:600; text-align:left; cursor:pointer; margin-bottom:1px; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.msg button.sender:hover { text-decoration:underline; }
.msg .sender-phone { font-weight:400; opacity:.75; }
body[data-theme] .msg button.sender { color:inherit; }
.sender-menu { position:fixed; z-index:80; min-width:220px; max-width:300px; background:var(--card); border:1px solid var(--line); border-radius:12px; box-shadow:0 8px 28px rgba(0,0,0,.18); padding:10px; display:flex; flex-direction:column; gap:4px; }
.sender-menu .sm-name { font-weight:600; overflow-wrap:anywhere; }
.sender-menu .muted { margin:0 0 4px; }
.sender-menu button { text-align:left; border:0; background:none; border-radius:8px; min-height:40px; }
.sender-menu button:hover { background:var(--bg); }
.chat .last-sender { color:var(--text); }
body[data-theme] .chat.active .last-sender { color:inherit; }

/* уведомления о новых сообщениях */
.notify-btn { font-size:18px; text-decoration:none; }
label.check { display:flex; gap:10px; align-items:flex-start; color:var(--text); font-size:15px; }
label.check input { width:20px; height:20px; margin:2px 0 0; flex:none; }
.toasts { position:fixed; right:16px; bottom:16px; z-index:90; display:flex; flex-direction:column; gap:8px; width:min(360px, calc(100vw - 32px)); }
.toast { display:flex; gap:10px; align-items:center; text-align:left; width:100%; padding:10px 12px; border-radius:14px; border:1px solid var(--line); background:var(--card); color:var(--text);
  box-shadow:0 10px 30px rgba(0,0,0,.18); animation:toast-in .25s ease-out; min-height:64px; border-left:4px solid var(--brand); }
.toast.toast-wz { border-left-color:#25d366; } .toast.toast-tg { border-left-color:#3390ec; } .toast.toast-max { border-left-color:#6a4bff; }
.toast.out { opacity:0; transform:translateY(8px); transition:.25s; }
.toast-ava { width:40px; height:40px; font-size:16px; }
.toast-text { flex:1; min-width:0; }
.toast-title { font-weight:600; display:flex; justify-content:space-between; gap:8px; }
.toast-title, .toast-body { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.toast-from { font-weight:400; font-size:12px; color:var(--muted); flex:none; }
.toast-body { color:var(--muted); font-size:14px; }
.toast-x { color:var(--muted); padding:4px 6px; font-size:13px; }
@keyframes toast-in { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }
@media (max-width:760px) { .toasts { top:max(8px, env(safe-area-inset-top)); bottom:auto; right:8px; left:8px; width:auto; } body.menu-open .notify-btn { font-size:16px; } }
@media (prefers-reduced-motion: reduce) { .toast { animation:none; } }

/* приложение leontools */
a.button { display:inline-flex; align-items:center; justify-content:center; padding:9px 14px; border-radius:8px; border:1px solid var(--line); min-height:40px; text-decoration:none; color:var(--text); }
a.button.primary { background:var(--brand); border-color:var(--brand); color:#fff; }
.app-steps { padding-left:20px; } .app-steps li { margin:4px 0; }
#app-native .actions { flex-wrap:wrap; }

/* ---------- «Мои номера»: кнопки-логотипы мессенджеров, приветствие новичку, VIP (25.11.2026) ---------- */
.add-box { margin:0 0 18px; }
.add-buttons { display:flex; flex-wrap:wrap; gap:12px; }
.add-msgr { display:flex; align-items:center; gap:12px; padding:12px 18px 12px 12px; min-width:200px; flex:1 1 200px; max-width:280px;
  background:var(--card); border:1px solid var(--line); border-radius:14px; cursor:pointer; text-align:left; color:inherit;
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.add-msgr:hover { transform:translateY(-1px); box-shadow:0 6px 18px rgb(0 0 0 / .08); border-color:color-mix(in srgb, var(--line) 40%, #888); }
.add-msgr:active { transform:none; }
.add-msgr:disabled { opacity:.6; cursor:progress; }
.add-msgr svg { width:44px; height:44px; flex:none; }
.add-msgr span { display:flex; flex-direction:column; line-height:1.2; }
.add-msgr small { font-size:12px; color:var(--muted); }
.add-msgr b { font-size:17px; }
.add-msgr.big { flex-basis:100%; max-width:none; }
.add-hint { margin:10px 0 0; font-size:13px; }
.empty-numbers { text-align:center; padding:28px 20px; }
.empty-numbers p { margin:6px 0 0; }
.qr-steps { margin:10px 0 4px; padding-left:20px; text-align:left; font-size:14px; line-height:1.5; }
dialog.welcome { max-width:460px; width:calc(100% - 32px); }
dialog.welcome h2 { margin:0 0 6px; }
.welcome-steps { padding-left:20px; line-height:1.55; margin:12px 0 16px; }
dialog.welcome .add-buttons { flex-direction:column; gap:10px; }
dialog.welcome .buttons { justify-content:flex-end; margin-top:14px; }
#conv-hint button { margin-left:6px; }
button.vip { min-width:84px; }
button.vip.on { background:#f5b301; border-color:#f5b301; color:#1f1600; font-weight:600; }
.vip-badge { display:inline-block; margin-left:6px; padding:1px 7px; border-radius:99px; background:#f5b301; color:#1f1600;
  font-size:11px; font-weight:700; vertical-align:middle; }
@media (max-width:760px) { .add-msgr { max-width:none; min-width:0; flex:1 1 100%; } }
@media (prefers-reduced-motion:reduce) { .add-msgr { transition:none; } }

/* ---------- вход по номеру телефона (26.11.2026) ---------- */
.phone-form { display:flex; flex-direction:column; gap:6px; margin:10px 0 4px; }
.phone-form label { display:flex; flex-direction:column; gap:6px; font-size:13px; color:var(--muted); }
.phone-form input[type=tel] { font-size:17px; min-width:0; flex:1; }
.phone-form .link { align-self:flex-start; background:none; border:0; padding:0; color:var(--muted); text-decoration:underline; cursor:pointer; }
.phone-form p { margin:0; font-size:13px; }
.code-form input { font-size:22px; letter-spacing:4px; width:9em; text-align:center; }
.pair { text-align:center; margin:8px 0; }
.pair-code { font:700 34px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing:4px; margin:6px 0 8px;
  padding:10px 14px; border:2px dashed var(--line); border-radius:12px; user-select:all; }

/* ---------- новый чат по номеру / из контактов (26.11.2026) ---------- */
.search-row { display:flex; gap:6px; align-items:center; }
.search-row #chat-search { flex:1; min-width:0; }
#btn-newchat { white-space:nowrap; flex:none; }
dialog.newchat { max-width:420px; width:calc(100% - 32px); }
dialog.newchat form { display:flex; flex-direction:column; gap:10px; }
dialog.newchat h2 { margin:0; }
dialog.newchat label { display:flex; flex-direction:column; gap:4px; font-size:13px; color:var(--muted); }
dialog.newchat input, dialog.newchat select { font-size:16px; }
dialog.newchat .contacts-btn { font-size:16px; padding:12px; }
dialog.newchat .buttons { justify-content:flex-end; }
dialog.newchat p { margin:0; font-size:13px; }

/* ---------- папки Telegram (26.11.2026) ---------- */
.folder-tools { display:flex; justify-content:flex-end; padding:6px 12px 2px; }
.folder-tools button { background:none; border:0; padding:2px 4px; min-height:0; color:var(--muted); font-size:12px; text-decoration:underline; cursor:pointer; }
.folder-head { display:flex; align-items:center; gap:8px; width:100%; padding:9px 12px; border:0; border-radius:0; border-top:1px solid var(--line);
  background:color-mix(in srgb, var(--brand) 5%, var(--card)); text-align:left; font-weight:600; font-size:14px; cursor:pointer; position:sticky; top:0; z-index:1; }
.folder-head .arrow { width:14px; color:var(--muted); flex:none; transition:transform .15s; }
.folder-head.collapsed .arrow { transform:rotate(-90deg); }
.folder-head .fname { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.folder-head .fcount { color:var(--muted); font-weight:400; font-size:12px; }
body[data-theme] .folder-head { background:color-mix(in srgb, var(--m-accent) 7%, var(--m-panel)); }
body[data-theme] .folder-head .count { background:var(--m-badge); }
@media (prefers-reduced-motion: reduce) { .folder-head .arrow { transition:none; } }

/* ===================== Недвижимость ===================== */
.count.hot { background:var(--bad); }
.rl-number { margin:0; min-width:min(320px, 100%); }
.rl-groups, .rl-watches { display:flex; flex-direction:column; gap:8px; }
.rl-group { display:flex; flex-wrap:wrap; align-items:center; gap:4px 14px; border:1px solid var(--line); border-radius:10px; padding:10px 12px; }
.rl-group.bad { border-color:color-mix(in srgb, var(--bad) 45%, var(--line)); }
.rl-group.off { opacity:.65; }
.rl-group-name { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px; flex:1 1 260px; min-width:0; overflow-wrap:anywhere; }
.rl-group .buttons { margin-left:auto; }
.rl-filter { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:10px; }
.rl-filter input, .rl-filter select { width:auto; margin:0; min-width:150px; flex:1 1 150px; }
.rl-filter input[name="q"] { flex:3 1 260px; }
.rl-range { display:flex; gap:4px; flex:1 1 260px; min-width:0; max-width:100%; }
.rl-filter .rl-range input { flex:1 1 0; width:0; min-width:0; }
.rl-table-wrap { overflow-x:auto; border-radius:var(--radius); }
.rl-table { min-width:1500px; }
.rl-table td { vertical-align:top; font-size:13px; overflow-wrap:anywhere; }
.rl-table td.pre, .pre { white-space:pre-line; }
.rl-table .rl-desc { max-width:340px; }
.rl-row { cursor:pointer; }
.rl-row:hover, .rl-row:focus { background:color-mix(in srgb, var(--brand) 7%, transparent); outline:none; }
.rl-pages { justify-content:center; align-items:center; margin-top:10px; }
.badge.warn { background:color-mix(in srgb, var(--warn) 16%, transparent); color:var(--warn); }
.badge.bad { background:color-mix(in srgb, var(--bad) 14%, transparent); color:var(--bad); }
.rl-hits { border-color:var(--warn); }
.rl-hit-list { display:flex; flex-direction:column; gap:10px; }
.rl-hit { border:2px solid var(--warn); border-radius:10px; padding:12px; display:flex; flex-direction:column; gap:6px;
  background:color-mix(in srgb, var(--warn) 7%, var(--card)); animation:rl-glow 1.6s ease-in-out infinite; }
@keyframes rl-glow { 0%,100% { box-shadow:0 0 0 0 color-mix(in srgb, var(--warn) 0%, transparent); }
  50% { box-shadow:0 0 14px 2px color-mix(in srgb, var(--warn) 55%, transparent); } }
@media (prefers-reduced-motion: reduce) { .rl-hit { animation:none; } }
.rl-dialog { width:min(720px, 94vw); max-height:88vh; overflow:auto; }
.rl-dialog.wide { width:min(980px, 96vw); }
.rl-pick-folders, .rl-pick-list { display:flex; flex-direction:column; gap:6px; margin:8px 0; }
.rl-pick-list { max-height:46vh; overflow:auto; border:1px solid var(--line); border-radius:8px; padding:8px; }
.rl-pick-item { overflow-wrap:anywhere; }
.rl-preview th { width:220px; }
.rl-source { background:var(--bg); border:1px solid var(--line); border-radius:8px; padding:12px; max-height:40vh; overflow:auto; font-size:14px; overflow-wrap:anywhere; }
.rl-same { display:block; width:100%; text-align:left; margin:4px 0; }
.warn-note { color:var(--warn); }
@media (max-width:760px) { .rl-preview th { width:auto; } .rl-group .buttons { margin-left:0; } }

/* ---------------- VPN ---------------- */
.vpn-issue { display:flex; flex-wrap:wrap; gap:10px; align-items:flex-end; }
.vpn-issue label, .vpn-filter label { display:flex; flex-direction:column; gap:4px; font-size:13px; color:var(--muted); }
.vpn-issue select, .vpn-issue input { min-width:220px; }
.vpn-filter { display:flex; flex-wrap:wrap; gap:10px; margin:10px 0; }
.vpn-devices { display:flex; flex-direction:column; gap:10px; }
.vpn-dev { border:1px solid var(--line); border-radius:var(--radius); padding:12px 14px; display:flex; flex-direction:column; gap:6px; }
.vpn-dev.revoked { opacity:.6; }
.vpn-dev-head { display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; align-items:center; }
.vpn-dev .buttons { display:flex; flex-wrap:wrap; gap:8px; }
.vpn-scroll { overflow-x:auto; margin-bottom:12px; }
.vpn-table td.num { text-align:right; white-space:nowrap; }
.vpn-table td.ok { color:var(--ok); }
.vpn-table td, .vpn-table th { white-space:nowrap; }
#vpn-journal-box summary { cursor:pointer; list-style:revert; }
#vpn-journal-box summary h2 { display:inline; }
.vpn-help ol, .vpn-help ul { padding-left:20px; line-height:1.55; }
.vpn-help h3 { margin:14px 0 4px; }
dialog.vpn-dialog { width:min(460px, 94vw); }
.vpn-qr { display:flex; justify-content:center; margin:10px 0; min-height:240px; }
.vpn-qr img { width:min(300px, 80vw); height:auto; background:#fff; padding:6px; border-radius:8px; image-rendering:pixelated; }
.vpn-steps { padding-left:20px; line-height:1.5; }
@media (max-width:600px) { .vpn-issue select, .vpn-issue input { min-width:0; width:100%; } .vpn-issue label { flex:1 1 100%; } }

/* Instagram (Директ) — светлое оформление в духе Instagram, свои сообщения — фиолетово-синие */
body[data-theme="ig"] {
  --m-accent:#0095f6; --m-send:#0095f6; --m-badge:#ff3040; --m-read:#0095f6; --m-panel:#ffffff; --m-line:#efefef;
  --m-search:#efefef; --m-head:#ffffff; --m-head-text:#000000; --m-head-sub:#737373; --m-input:#ffffff;
  --m-chat-bg:#ffffff; --m-in:#efefef; --m-out:#3797f0; --m-out-text:#ffffff; --m-text:#000000; --m-time:#8e8e8e;
  --m-time-out:rgba(255,255,255,.8); --m-active:#efefef; --m-hover:#fafafa; --m-day-text:#737373;
}
body[data-theme="ig"] .msg { border-radius:20px; box-shadow:none; }
body[data-theme="ig"] .msg.out { background:linear-gradient(135deg, #7a3cf5 0%, #3797f0 100%); color:#fff; }
body[data-theme="ig"] .msg.out a, body[data-theme="ig"] .msg.out .time, body[data-theme="ig"] .msg.out .tick { color:rgba(255,255,255,.85); }
@media (prefers-color-scheme: dark) {
  body[data-theme="ig"] { --m-panel:#000000; --m-line:#262626; --m-search:#262626; --m-head:#000000; --m-head-text:#f5f5f5; --m-head-sub:#a8a8a8;
    --m-input:#121212; --m-chat-bg:#000000; --m-in:#262626; --m-text:#f5f5f5; --m-time:#a8a8a8; --m-active:#262626; --m-hover:#121212; --m-day-text:#a8a8a8; }
}
.add-msgr[data-platform="ig"] svg { border-radius:12px; }
.ig-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:12px; }
.ig-post { display:flex; flex-direction:column; gap:8px; }
.ig-thumbs { display:flex; gap:6px; flex-wrap:wrap; }
.ig-thumbs img, .ig-thumbs video { width:84px; height:84px; object-fit:cover; border-radius:8px; background:#eee; }
.ig-post .caption { white-space:pre-wrap; word-break:break-word; max-height:9em; overflow:auto; }
.ig-files { display:flex; gap:8px; flex-wrap:wrap; margin:8px 0; }
.ig-file { position:relative; }
.ig-file img, .ig-file video { width:96px; height:96px; object-fit:cover; border-radius:8px; display:block; }
.ig-file button { position:absolute; top:2px; right:2px; min-height:0; padding:0 6px; line-height:20px; }
.ig-comment { border-top:1px solid var(--line, #e5e7eb); padding:10px 0; }
.ig-comment.unseen { background:color-mix(in srgb, #ff3040 6%, transparent); }
.ig-comment .reply { margin-top:6px; }
.ig-stats { display:flex; gap:10px; flex-wrap:wrap; }
.ig-stat { border:1px solid var(--line, #e5e7eb); border-radius:10px; padding:8px 12px; min-width:110px; }
.ig-stat b { display:block; font-size:1.3em; }
textarea#ig-caption { width:100%; min-height:110px; }
.vpn-table td.vpn-from { white-space:normal; min-width:180px; max-width:320px; }
.vpn-table td.vpn-from .muted { font-size:12px; }
.vpn-geo { word-break:break-word; }

/* ---------------- leontools: логотип «Три облачка», фиолетовый градиент ---------------- */
.brand { display:flex; align-items:center; gap:10px; font-weight:800; font-size:19px; letter-spacing:-.3px; }
.brand span { background:var(--grad); -webkit-background-clip:text; background-clip:text; color:transparent; }
.brand .logo { width:32px; height:32px; flex:0 0 auto; }
.top { border-bottom:0; box-shadow:0 1px 0 var(--line), 0 6px 20px -16px #7C3AED; }
button.primary, a.button.primary { background:var(--grad); border-color:transparent; color:#fff; box-shadow:0 6px 16px -8px #7C3AED; }
button.primary:hover:not(:disabled), a.button.primary:hover { filter:brightness(1.06); }
.count { background:var(--grad); }
.tabs button.active { background:color-mix(in srgb, var(--brand) 13%, transparent); }
input:focus, select:focus, textarea:focus { outline:2px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset:1px; border-color:var(--brand); }
.card { border-radius:16px; }
.auth { margin-top:48px; box-shadow:0 20px 50px -30px #7C3AED; }
.auth button.primary { width:100%; min-height:46px; font-weight:600; }
.auth-logo { display:flex; flex-direction:column; align-items:center; gap:6px; margin:0 0 18px; text-align:center; }
.auth-logo svg { width:64px; height:64px; }
.auth-logo b { font-size:26px; font-weight:800; letter-spacing:-.5px; background:var(--grad); -webkit-background-clip:text; background-clip:text; color:transparent; }
.auth-logo span { color:var(--muted); font-size:13px; }
body:has(#view-login:not([hidden])), body:has(#view-register:not([hidden])), body:has(#view-forgot:not([hidden])), body:has(#view-setup:not([hidden])) {
  min-height:100vh; background:radial-gradient(1200px 600px at 10% -10%, #ede4ff 0, transparent 60%), radial-gradient(900px 500px at 110% 10%, #ffe1f0 0, transparent 55%), var(--bg); background-attachment:fixed; }
@media (prefers-color-scheme: dark) { body:has(#view-login:not([hidden])) { background:var(--bg); } }

/* ---------------- leontools 05.12.2026: кабинет — меню слева (компьютер) ---------------- */
.search-row { padding:10px; }
.search-row #chat-search { margin:0; }
#btn-newchat { background:var(--grad); color:#fff; border-color:transparent; font-weight:600; }
.conv-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; gap:6px; height:100%; }
.conv-empty::before { content:""; width:88px; height:88px; margin-bottom:8px; background:var(--grad); -webkit-mask:var(--ico-chat) center/contain no-repeat; mask:var(--ico-chat) center/contain no-repeat; opacity:.85; }
.conv-empty { --ico-chat:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M21%2012a8%208%200%200%201-11.6%207.1L4%2020l1-4.6A8%208%200%201%201%2021%2012z%22/%3E%3C/svg%3E"); }
.conv-empty p:first-child { font-size:18px; font-weight:700; color:var(--text); margin:0; }
.chat .ava, .conv-head .ava { box-shadow:0 0 0 2px color-mix(in srgb, var(--brand) 18%, transparent); }
.chat.active { background:linear-gradient(90deg, color-mix(in srgb, var(--brand) 14%, transparent), transparent); box-shadow:inset 3px 0 0 var(--brand); }
.kinds button.active { border-color:var(--brand); color:var(--brand); }
.tabs button::before { content:""; width:20px; height:20px; flex:none; background:currentColor; -webkit-mask:var(--ico) center/contain no-repeat; mask:var(--ico) center/contain no-repeat; }
.tabs button[data-tab="chats"] { --ico:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M21%2012a8%208%200%200%201-11.6%207.1L4%2020l1-4.6A8%208%200%201%201%2021%2012z%22/%3E%3C/svg%3E"); }
.tabs button[data-tab="numbers"] { --ico:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%226%22%20y%3D%222%22%20width%3D%2212%22%20height%3D%2220%22%20rx%3D%223%22/%3E%3Cpath%20d%3D%22M11%2018h2%22/%3E%3C/svg%3E"); }
.tabs button[data-tab="vpn"] { --ico:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%203l8%203v6c0%205-3.5%208-8%209-4.5-1-8-4-8-9V6z%22/%3E%3Cpath%20d%3D%22M9%2012l2%202%204-4%22/%3E%3C/svg%3E"); }
.tabs button[data-tab="employees"] { --ico:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%229%22%20cy%3D%228%22%20r%3D%223.5%22/%3E%3Cpath%20d%3D%22M2.5%2020a6.5%206.5%200%200%201%2013%200%22/%3E%3Cpath%20d%3D%22M16%204.5a3.5%203.5%200%200%201%200%207M18%2014a6%206%200%200%201%203.5%206%22/%3E%3C/svg%3E"); }
.tabs button[data-tab="api"] { --ico:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M8%207l-5%205%205%205M16%207l5%205-5%205M14%204l-4%2016%22/%3E%3C/svg%3E"); }

.tabs button { display:inline-flex; align-items:center; gap:8px; }
@media (min-width:1024px) {
  body:has(#view-main:not([hidden])) .top { position:fixed; inset:0 auto 0 0; width:232px; z-index:50; flex-direction:column; flex-wrap:nowrap;
    align-items:stretch; justify-content:flex-start; gap:22px; padding:22px 14px 18px; border-right:1px solid var(--line); box-shadow:none;
    background:linear-gradient(180deg, color-mix(in srgb, var(--brand) 7%, var(--card)), var(--card) 40%); }
  body:has(#view-main:not([hidden])) .top .brand { padding:0 8px; font-size:21px; }
  body:has(#view-main:not([hidden])) .top .brand .logo { width:36px; height:36px; }
  body:has(#view-main:not([hidden])) .top .tabs { flex:0 0 auto; flex-direction:column; gap:4px; justify-content:flex-start; }
  body:has(#view-main:not([hidden])) .top .tabs button { justify-content:flex-start; min-height:44px; padding:10px 12px; font-size:15px; color:var(--text); border-radius:12px; gap:12px; }
  body:has(#view-main:not([hidden])) .top .tabs button:hover { background:color-mix(in srgb, var(--brand) 7%, transparent); }
  body:has(#view-main:not([hidden])) .top .tabs button.active { background:var(--grad); color:#fff; box-shadow:0 8px 18px -10px #7C3AED; }
  body:has(#view-main:not([hidden])) .top .tabs button .count { margin-left:auto; }
  body:has(#view-main:not([hidden])) .top .tabs button.active .count { background:#fff; color:var(--brand); }
  body:has(#view-main:not([hidden])) .top .who { margin-top:auto; flex-direction:column; align-items:stretch; gap:2px; padding:12px 8px 0; border-top:1px solid var(--line); }
  body:has(#view-main:not([hidden])) .top .who > * { text-align:left; justify-content:flex-start; min-height:34px; padding:6px 4px; }
  body:has(#view-main:not([hidden])) #who-email { order:-1; font-size:13px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding-bottom:8px; }
  body:has(#view-main:not([hidden])) .top .who .link { color:var(--text); }
  body:has(#view-main:not([hidden])) #btn-logout { color:var(--bad) !important; }
  body:has(#view-main:not([hidden])) .top-hide, body:has(#view-main:not([hidden])) .top-show { display:none !important; }
  body:has(#view-main:not([hidden])) #app { margin-left:232px; max-width:none; width:auto; }
  body:has(#view-main:not([hidden])) .messenger { height:100vh; height:100dvh; }
  body.top-hidden:has(#view-main:not([hidden])) .top { display:flex; }
  body.top-hidden .side { padding-top:0; }
}
@media (min-width:1024px) { body:has(#view-main:not([hidden])) .notify-btn::after { content:"Звук и уведомления"; font-size:15px; margin-left:8px; color:var(--text); } body:has(#view-main:not([hidden])) .notify-btn { display:flex; align-items:center; font-size:15px; } }
.app-ios { background:color-mix(in srgb, var(--brand) 8%, var(--card)); border-radius:12px; padding:12px 14px; margin:8px 0; }
.app-ios p { margin:4px 0; }

/* вход по Face ID / отпечатку (05.12.2026) */
.passkey-login { width:100%; min-height:46px; margin-top:10px; font-weight:600; border:1px solid var(--brand); color:var(--brand); background:var(--card); }
.passkey-row { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--line); font-size:14px; }
