/* BU Hub — кампусный деканат в цветах Blog University:
   вишнёвая боковая лента, кремовая бумага, конфетно-розовые исходящие и «нашивки» со строчкой. */
:root {
  --paper: #FBF6F0;        /* кремовая бумага кампуса */
  --surface: #FFFFFF;
  --surface-2: #FFF9FB;
  --ink: #2C1820;          /* основной текст */
  --ink-2: #6E5560;        /* вторичный текст */
  --ink-3: #A08D95;        /* подписи */
  --line: #EEDFE4;
  --line-2: #F6ECEF;
  --cherry: #8C1D40;       /* фирменный вишнёвый */
  --cherry-ink: #8C1D40;
  --cherry-soft: #F8E5EB;
  --pink: #F7A9CB;         /* BLOG UNI */
  --pink-bubble: #FBD3E3;
  --pink-wash: #FDEEF4;
  --butter: #FBE7A1;       /* кнопка «поступить» */
  --butter-ink: #6B1430;
  --sky: #DCE8F6;
  --navy: #2F3E66;
  --good: #1E8A5C;  --good-soft: #E1F3EA;
  --warn: #B26B00;  --warn-soft: #FDF0D8;
  --bad: #C8323E;   --bad-soft: #FCE4E5;
  --muted-soft: #F1ECEE;
  --rail: #8C1D40;
  --rail-ink: #FBE7EE;
  --shadow: 0 1px 2px rgba(92, 26, 50, .06), 0 8px 24px rgba(92, 26, 50, .07);
  --c-sent: #A8325A; --c-recv: #4C78C8; --c-grid: #F1E6EA;
  --on-cherry: #FFFFFF; --check: color-mix(in srgb, var(--pink) 9%, transparent);
  --f-body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-display: "Forum", "Cormorant Garamond", Georgia, serif;
  --f-script: "Great Vibes", "Snell Roundhand", cursive;
  --r-s: 8px; --r-m: 12px; --r-l: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1B1115; --surface: #251820; --surface-2: #2A1C24; --ink: #F7E9EE; --ink-2: #CDB4BE; --ink-3: #93808A;
    --line: #3B2730; --line-2: #2F1F27; --cherry: #E37AA2; --cherry-ink: #F3A6C3; --cherry-soft: #3A1E2A;
    --pink: #D9709C; --pink-bubble: #5A2740; --pink-wash: #33202A; --butter: #E9D27A; --butter-ink: #3D0E1E;
    --sky: #23324A; --navy: #A9BCE6; --good: #5BC995; --good-soft: #17352A; --warn: #E9B25A; --warn-soft: #3A2C14;
    --bad: #F0727B; --bad-soft: #3D1A1E; --muted-soft: #30232A; --rail: #4A0F24; --rail-ink: #F8DCE6;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
    --c-sent: #D66A9B; --c-recv: #6F86D6; --c-grid: #35242C;
    --on-cherry: #2A0E19; --check: rgba(217, 112, 156, .045);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1B1115; --surface: #251820; --surface-2: #2A1C24; --ink: #F7E9EE; --ink-2: #CDB4BE; --ink-3: #93808A;
  --line: #3B2730; --line-2: #2F1F27; --cherry: #E37AA2; --cherry-ink: #F3A6C3; --cherry-soft: #3A1E2A;
  --pink: #D9709C; --pink-bubble: #5A2740; --pink-wash: #33202A; --butter: #E9D27A; --butter-ink: #3D0E1E;
  --sky: #23324A; --navy: #A9BCE6; --good: #5BC995; --good-soft: #17352A; --warn: #E9B25A; --warn-soft: #3A2C14;
  --bad: #F0727B; --bad-soft: #3D1A1E; --muted-soft: #30232A; --rail: #4A0F24; --rail-ink: #F8DCE6;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  --c-sent: #D66A9B; --c-recv: #6F86D6; --c-grid: #35242C;
  --on-cherry: #2A0E19; --check: rgba(217, 112, 156, .045);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 14px/1.45 var(--f-body); -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 0; -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--cherry-ink); }
:focus-visible { outline: 2px solid var(--cherry); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- каркас ---------- */
#app { height: 100%; }
.shell { display: grid; grid-template-columns: 84px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 100vh; height: var(--app-h, 100dvh); overflow: hidden; }
.mob-only, .kv .mob-row { display: none !important; }
.rail {
  background: var(--rail); color: var(--rail-ink);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 8px max(14px, env(safe-area-inset-bottom, 0px));
  position: relative; z-index: 3;
}
.crest {
  width: 58px; height: 58px; border-radius: 50%; margin-bottom: 12px; display: block; flex: none;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .28)); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.crest img { width: 100%; height: 100%; display: block; border-radius: 50%; }
.crest:hover { transform: rotate(-8deg) scale(1.06); }
.nav-btn {
  width: 68px; border: 0; background: transparent; color: inherit; cursor: pointer;
  display: grid; justify-items: center; gap: 4px; padding: 9px 2px 8px; border-radius: 14px;
  font-size: 11px; font-weight: 600; letter-spacing: .01em; opacity: .82; position: relative;
}
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn:hover { opacity: 1; background: rgba(255, 255, 255, .08); }
.nav-btn.on { opacity: 1; background: var(--butter); color: var(--butter-ink); }
.nav-btn .dot {
  position: absolute; top: 5px; right: 12px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--pink); color: #5A0F28; font-size: 10.5px; font-weight: 800;
  display: grid; place-items: center; box-shadow: 0 0 0 2px var(--rail);
}
.nav-btn.on .dot { box-shadow: 0 0 0 2px var(--butter); }
.rail-spacer { flex: 1; }
.rail-sound { width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .1); color: var(--rail-ink);
  display: grid; place-items: center; cursor: pointer; margin-bottom: 10px; }
.rail-sound:hover { background: rgba(255, 255, 255, .18); }
.rail-sound.off { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(251, 231, 238, .35); opacity: .75; }
.rail-sound svg { width: 20px; height: 20px; }
.sound-btn { color: var(--cherry-ink); }
.sound-btn.off { color: var(--ink-3); border-style: dashed; }
.me-chip {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: #fff; border: 2px solid rgba(255,255,255,.5); cursor: pointer;
}
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; height: 100%; }
.page { flex: 1; min-height: 0; overflow: auto; padding: 22px max(16px, 2.2vw) 40px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
h1.title { font: 400 34px/1.05 var(--f-display); margin: 0; letter-spacing: .01em; color: var(--cherry-ink); }
.sub { color: var(--ink-2); margin: 0; }
.grow { flex: 1; }

/* ---------- нашивка (фирменный ярлык со строчкой) ---------- */
.patch {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 8px; border-radius: 6px;
  font-size: 12px; font-weight: 700; line-height: 1.3; white-space: nowrap;
  background: var(--cherry-soft); color: var(--cherry-ink);
  outline: 1.2px dashed color-mix(in srgb, currentColor 70%, transparent); outline-offset: -3.5px; padding: 5px 11px;
}
.patch.good { background: var(--good-soft); color: var(--good); }
.patch.warn { background: var(--warn-soft); color: var(--warn); }
.patch.bad { background: var(--bad-soft); color: var(--bad); }
.patch.muted { background: var(--muted-soft); color: var(--ink-2); }
.patch.sky { background: var(--sky); color: var(--navy); }
.patch svg { width: 13px; height: 13px; }

/* ---------- кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--pink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--butter); border-color: transparent; color: var(--butter-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--butter) 85%, var(--cherry)); }
.btn.cherry { background: var(--cherry); color: var(--on-cherry); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--pink-wash); color: var(--ink); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.icon { padding: 7px; width: 34px; height: 34px; }
.field { display: grid; gap: 5px; align-content: start; }
.field > span { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: 12px; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px;
  padding: 9px 12px; min-height: 38px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-wash); }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.5; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.check { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.check input { accent-color: var(--cherry); width: 16px; height: 16px; }

.seg { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  border: 0; background: transparent; padding: 6px 11px; border-radius: 999px; cursor: pointer;
  font-size: 12.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; display: inline-flex; gap: 6px;
}
.seg button b { font-weight: 800; color: var(--ink-3); }
.seg button:hover { background: var(--pink-wash); }
.seg button.on { background: var(--cherry); color: var(--on-cherry); }
.seg button.on b { color: inherit; opacity: .7; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); }
.card-pad { padding: 18px; }

/* ---------- баннер оповещений ---------- */
.alertbar {
  display: flex; gap: 10px; align-items: center; padding: 10px max(16px, 2.2vw);
  background: var(--bad-soft); color: var(--bad); border-bottom: 1px solid color-mix(in srgb, var(--bad) 25%, transparent);
  font-weight: 700; font-size: 13px;
}
.alertbar svg { width: 18px; height: 18px; flex: none; }
.alertbar .txt { flex: 1; min-width: 0; }
.alertbar .more { font-weight: 500; opacity: .85; }

/* ---------- чаты ---------- */
/* список тянется, но чату всегда остаётся ≥420px — иначе шапка и сообщения сминаются */
.chats { --list-w: 372px; display: grid; grid-template-columns: clamp(280px, var(--list-w), calc(100% - 420px)) minmax(0, 1fr); flex: 1; min-height: 0; }
.chats.with-info { grid-template-columns: clamp(280px, var(--list-w), calc(100% - 720px)) minmax(0, 1fr) 300px; }
.list-col { border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; position: relative; }
/* граница между списком и чатом — тянется мышкой */
.splitter { position: absolute; top: 0; bottom: 0; right: -5px; width: 10px; z-index: 6; cursor: col-resize; touch-action: none; outline: none; }
.splitter::after { content: ''; position: absolute; top: 0; bottom: 0; left: 4px; width: 2px; border-radius: 2px; background: transparent; transition: background .15s; }
.splitter:hover::after, .splitter.drag::after, .splitter:focus-visible::after { background: var(--pink); }
body.resizing, body.resizing * { cursor: col-resize !important; user-select: none !important; }
.list-head { padding: 18px 16px 10px; display: grid; gap: 11px; border-bottom: 1px solid var(--line-2); }
.list-head .top { display: flex; align-items: center; gap: 8px; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filters .input { min-height: 34px; padding: 6px 10px; font-size: 13px; border-radius: 9px; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); }
.search .input { padding-left: 34px; min-height: 36px; border-radius: 999px; background: var(--paper); border-color: transparent; }
.dlist { overflow-y: auto; flex: 1; min-height: 0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.ditem {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 11px; padding: 11px 14px 11px 16px;
  cursor: pointer; border-bottom: 1px solid var(--line-2); position: relative; width: 100%;
  background: transparent; border-left: 0; border-right: 0; border-top: 0; text-align: left;
}
.ditem:hover { background: var(--surface-2); }
.ditem.on { background: var(--pink-wash); }
.ditem.on::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--cherry); }
.ditem .name { font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ditem .prev { color: var(--ink-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.ditem .prev em { font-style: normal; color: var(--ink-3); }
.ditem .meta { display: flex; gap: 6px; align-items: center; margin-top: 5px; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.ditem .side { display: grid; justify-items: end; align-content: start; gap: 6px; }
.ditem .time { font-size: 11.5px; color: var(--ink-3); }
.unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--cherry); color: var(--on-cherry); font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.ditem.unr .name { color: var(--cherry-ink); }
.ditem.unr .prev { color: var(--ink); font-weight: 600; }
.accdot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }

.ava {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; position: relative;
  font-weight: 800; font-size: 15px; color: #fff; flex: none; letter-spacing: .02em;
}
.ava.sm { width: 36px; height: 36px; font-size: 13px; }
.ava.lg { width: 64px; height: 64px; font-size: 22px; }
.ava img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--muted-soft); }
.ava.photo { background: var(--muted-soft) !important; }
.ava .badge { z-index: 1; }
.who-card { display: flex; gap: 12px; align-items: center; margin: 2px 0 14px; }
.who-card b { display: block; font-size: 15px; }
.who-card span { display: block; font-size: 12px; color: var(--ink-3); }
.ava .badge {
  position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid var(--surface); display: grid; place-items: center;
}
.ava .badge svg { width: 10px; height: 10px; color: #fff; }

.chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--paper); }
.chat-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--surface);
  border-bottom: 1px solid var(--line); min-height: 68px; flex-wrap: nowrap; container-type: inline-size;
}
.chat-head > * { flex-shrink: 0; }
.chat-head .who { flex-shrink: 1; }
.head-acc { min-width: 0; flex-shrink: 1 !important; max-width: 34%; }
.head-acc .patch { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; }
@container (max-width: 560px) { .head-acc { display: none; } }
@container (max-width: 440px) { .chat-head .head-status { width: 124px; padding-left: 12px; font-size: 13px; } }
.chat-head .who { min-width: 0; flex: 1; }
.chat-head .who b { font-size: 16px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .who span { color: var(--ink-3); font-size: 12.5px; }
.msgs {
  flex: 1; min-height: 0; overflow-y: auto; padding: 18px max(16px, 4%) 12px; display: flex; flex-direction: column; gap: 6px;
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(0deg, transparent 0 22px, var(--check) 22px 44px),
    repeating-linear-gradient(90deg, transparent 0 22px, var(--check) 22px 44px);
}
.daysep { align-self: center; margin: 10px 0 4px; }
.bubble {
  max-width: min(560px, 78%); padding: 9px 13px 7px; border-radius: 16px; position: relative;
  box-shadow: 0 1px 1px rgba(92, 26, 50, .06); overflow-wrap: anywhere; white-space: pre-wrap;
}
.bubble.in { align-self: flex-start; background: var(--surface); border-bottom-left-radius: 5px; }
.bubble.out { align-self: flex-end; background: var(--pink-bubble); border-bottom-right-radius: 5px; }
.bubble.out.campaign { background: var(--butter); color: var(--butter-ink); }
.bubble .foot { display: flex; gap: 6px; justify-content: flex-end; align-items: center; margin-top: 3px; font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.bubble.out .foot { color: color-mix(in srgb, var(--ink) 55%, transparent); }
.bubble .foot svg { width: 15px; height: 15px; }
.bubble .foot .read { color: var(--cherry-ink); }
.bubble.campaign .by, .bubble.campaign .foot, .bubble.campaign .foot .read { color: color-mix(in srgb, var(--butter-ink) 72%, transparent); }
.bubble .by { font-size: 11px; font-weight: 800; color: var(--cherry-ink); margin-bottom: 2px; white-space: normal; }
.bubble .media { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; color: var(--ink-2); }
.stopnote { align-self: center; max-width: 460px; text-align: center; }

.composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px max(12px, env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line); position: relative; }
.composer textarea {
  flex: 1; resize: none; border: 1px solid var(--line); background: var(--paper); border-radius: 18px;
  padding: 10px 14px; min-height: 42px; max-height: 180px; outline: none; line-height: 1.45;
}
.composer textarea:focus { border-color: var(--pink); }
.send { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--cherry); color: var(--on-cherry); display: grid; place-items: center; cursor: pointer; flex: none; }
.send:disabled { opacity: .4; cursor: default; }
.send svg { width: 19px; height: 19px; margin-left: 2px; }
.pop {
  position: absolute; bottom: calc(100% + 8px); left: 14px; width: min(420px, calc(100% - 28px)); max-height: 340px; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; z-index: 5;
}
.pop button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 11px; border-radius: 10px; cursor: pointer; }
.pop button:hover { background: var(--pink-wash); }
.pop button b { display: block; font-size: 13px; }
.pop button span { display: block; color: var(--ink-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.info-col { border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; padding: 18px 16px; display: grid; gap: 16px; align-content: start; }
.kv { display: grid; gap: 9px; }
.kv div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; font-size: 13px; }
.kv dt, .kv .k { color: var(--ink-3); }
.kv .v { overflow-wrap: anywhere; }
.sect-title { font: 400 19px/1.1 var(--f-display); color: var(--cherry-ink); margin: 0 0 8px; }

.empty { display: grid; place-items: center; text-align: center; padding: 40px 20px; gap: 10px; color: var(--ink-2); height: 100%; align-content: center; }
.empty .mascot { width: 168px; height: 168px; object-fit: contain; border-radius: 50%; background: var(--pink-wash); }
.empty h3 { font: 400 26px/1.1 var(--f-display); color: var(--cherry-ink); margin: 4px 0 0; }
.empty p { margin: 0; max-width: 340px; }

/* ---------- плитки и таблицы ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 13px; display: grid; gap: 3px; }
.tile .k { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.tile .v { font: 400 34px/1.1 var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.tile .d { font-size: 12px; color: var(--ink-3); }
.tile .d .up { color: var(--good); font-weight: 700; }
.tile .d .down { color: var(--bad); font-weight: 700; }
.tile.hl { background: var(--cherry); border-color: var(--cherry); }
.tile.hl .k, .tile.hl .d { color: color-mix(in srgb, var(--on-cherry) 80%, transparent); }
.tile.hl .v { color: var(--on-cherry); }

.tablewrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 12px; font-weight: 700; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.n, table.t th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--surface-2); }

.meter { height: 7px; border-radius: 4px; background: var(--muted-soft); overflow: hidden; min-width: 80px; display: flex; gap: 2px; }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--cherry); }
.meter i.p { background: var(--pink); }

/* ---------- аккаунты ---------- */
.accs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.acc { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: grid; gap: 12px; position: relative; }
.acc.badst { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); box-shadow: 0 0 0 3px var(--bad-soft); }
.acc-head { display: flex; gap: 12px; align-items: center; }
.acc-head > :last-child { flex: none; }
.acc-head .who { min-width: 0; flex: 1; }
.acc-head b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-head span { color: var(--ink-3); font-size: 12.5px; }
.acc .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.acc .stats div { background: var(--paper); border-radius: 10px; padding: 8px 10px; }
.acc .stats b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.acc .stats span { font-size: 11.5px; color: var(--ink-3); }
.acc .reason { font-size: 12.5px; color: var(--bad); background: var(--bad-soft); border-radius: 10px; padding: 8px 10px; }
.acc .acts { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- модалки и тосты ---------- */
.overlay { position: fixed; inset: 0; background: rgba(44, 24, 32, .38); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 22px; width: min(560px, 100%); max-height: calc(100% - 32px); overflow: auto; box-shadow: var(--shadow); }
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 8px; }
.modal-head h2 { font: 400 26px/1.1 var(--f-display); margin: 0; color: var(--cherry-ink); flex: 1; }
.modal-body { padding: 8px 20px 20px; display: grid; gap: 14px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 20px 20px; flex-wrap: wrap; }
.note { background: var(--sky); color: var(--navy); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.note.pink { background: var(--pink-wash); color: var(--ink); }
.err { background: var(--bad-soft); color: var(--bad); border-radius: 12px; padding: 10px 12px; font-size: 13px; font-weight: 600; }

.toasts { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(76px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 10px; z-index: 60; width: min(360px, calc(100% - 32px)); }
.toast {
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 12px 14px; display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; border: 1px solid var(--line);
  animation: toast-in .25s ease-out; cursor: pointer;
}
.toast.bad { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.toast b { display: block; font-size: 13.5px; }
.toast span { display: block; color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.toast small { color: var(--ink-3); font-size: 11.5px; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- рассылки ---------- */
.camps { display: grid; gap: 12px; }
.camp { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 18px; align-items: center; cursor: pointer; }
.camp:hover { border-color: var(--pink); }
.camp h3 { margin: 0; font-size: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.camp .nums { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.camp .nums b { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; margin-right: 3px; }
.camp .bar { grid-column: 1 / -1; }
.steps { display: grid; gap: 16px; }
.step { border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 12px; }
.step > h3 { margin: 0; font: 400 21px/1.1 var(--f-display); color: var(--cherry-ink); display: flex; gap: 10px; align-items: baseline; }
.step > h3 i { font: 700 12px var(--f-body); font-style: normal; color: var(--ink-3); }
.variant { display: grid; gap: 6px; }
.preview-bubble { background: var(--butter); color: var(--butter-ink); border-radius: 14px 14px 4px 14px; padding: 9px 12px; font-size: 13px; white-space: pre-wrap; justify-self: end; max-width: 92%; }
.statuslist { display: flex; flex-wrap: wrap; gap: 6px; }
.statuslist label { border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; font-size: 12.5px; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.statuslist label:has(input:checked) { background: var(--cherry-soft); border-color: var(--cherry); color: var(--cherry-ink); }
.statuslist input { display: none; }

/* ---------- вход ---------- */
.login {
  min-height: 100%; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left, 0px));
  background-color: var(--pink-wash);
  background-image:
    repeating-linear-gradient(0deg, transparent 0 28px, color-mix(in srgb, var(--pink) 22%, transparent) 28px 56px),
    repeating-linear-gradient(90deg, transparent 0 28px, color-mix(in srgb, var(--pink) 22%, transparent) 28px 56px);
}
.login-card { width: min(420px, 100%); background: var(--surface); border-radius: 26px; padding: 30px 28px 26px; box-shadow: var(--shadow); display: grid; gap: 16px; position: relative; }
.login-card::before { content: ""; position: absolute; inset: 9px; border: 1.5px dashed color-mix(in srgb, var(--cherry) 35%, transparent); border-radius: 19px; pointer-events: none; }
.wordmark { text-align: center; display: grid; gap: 2px; }
.wordmark .s { font: 400 50px/1 var(--f-script); color: var(--cherry-ink); }
.wordmark .t { font: 800 11.5px/1 var(--f-body); letter-spacing: .32em; color: var(--ink-3); text-transform: lowercase; }
.login-art { width: 100%; height: 170px; object-fit: cover; object-position: center 62%; border-radius: 16px; }
.pass-wrap { position: relative; display: block; }
.pass-wrap .input { padding-right: 46px; }
.pass-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: none;
  color: var(--ink-3); display: grid; place-items: center; border-radius: 10px; cursor: pointer; }
.pass-eye svg { width: 19px; height: 19px; }
.pass-eye:hover { color: var(--cherry-ink); }
/* телефон: карточка входа компактнее, а при открытой клавиатуре прячем картинку, чтобы поля и кнопка были видны */
@media (max-width: 520px), (max-height: 700px) {
  .login { place-items: start center; padding-top: max(20px, env(safe-area-inset-top, 0px)); padding-bottom: 24px; }
  .login-card { padding: 24px 20px 22px; gap: 14px; margin: auto 0; }
  .wordmark .s { font-size: 42px; }
  .login-art { height: 120px; }
  .login .btn.primary { min-height: 48px; font-size: 15px; }
}
.kb .login-art, .kb .login .wordmark .t { display: none; }
.kb .login { padding-top: 12px; }

.chart-wrap { position: relative; }
.chart-wrap svg text { fill: var(--ink-3); font-size: 11px; font-family: var(--f-body); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--paper); font-size: 12px; padding: 7px 9px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -110%); z-index: 4; }
.tip b { font-weight: 800; }

.mobile-back { display: none; }
@media (max-width: 1180px) { .chats.with-info { grid-template-columns: clamp(280px, var(--list-w), calc(100% - 420px)) minmax(0, 1fr); } .info-col { display: none; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .rail { order: 2; flex-direction: row; justify-content: space-around; padding: 6px 6px max(6px, env(safe-area-inset-bottom, 0px)); gap: 0; }
  .rail::after, .crest, .rail-spacer, .me-chip { display: none; }
  .nav-btn { width: auto; flex: 1; padding: 7px 2px; font-size: 10.5px; }
  .chats, .chats.with-info { grid-template-columns: minmax(0, 1fr); }
  .splitter { display: none; }
  .chats.open .list-col { display: none; }
  .chats:not(.open) .chat { display: none; }
  .mobile-back { display: inline-flex; }
  h1.title { font-size: 28px; }
  .page { padding: 16px max(16px, env(safe-area-inset-left, 0px)) 30px max(16px, env(safe-area-inset-right, 0px)); }
}


/* ================= каналы: Telegram / WhatsApp ================= */
.chseg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; background: var(--paper); border-radius: 12px; }
.chseg button { border: 0; background: transparent; border-radius: 9px; padding: 6px 4px; font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  cursor: pointer; display: inline-flex; gap: 6px; align-items: center; justify-content: center; --wa-hole: var(--paper); }
.chseg button svg { width: 14px; height: 14px; }
.chseg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(92, 26, 50, .1); --wa-hole: var(--surface); }
.chantag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px 1px 5px; border-radius: 999px; font-size: 10.5px; font-weight: 800;
  letter-spacing: .02em; color: var(--tint); background: color-mix(in srgb, var(--tint) 12%, var(--surface)); vertical-align: 1px;
  --wa-hole: color-mix(in srgb, var(--tint) 12%, var(--surface)); white-space: nowrap; }
.chantag svg { width: 11px; height: 11px; }

/* ================= сообщения с медиа ================= */
.bubble .txt { white-space: pre-wrap; }
.bubble .media small { font-weight: 500; color: var(--ink-3); }
.bubble.bare { background: transparent !important; box-shadow: none; padding: 0; }
.bubble.bare .foot { justify-content: flex-end; margin-top: 2px; }
.bubble.bare .foot > .num { background: rgba(44, 24, 32, .5); color: #fff; padding: 0 7px; border-radius: 999px; line-height: 18px; }
.bubble.bare .foot .read { color: var(--cherry-ink); }
.bubble.has-voice { min-width: 240px; }
.bubble.failed { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--bad) 55%, transparent); }
.bubble .foot .failed { color: var(--bad); }
.errline { font-size: 11.5px; color: var(--bad); font-weight: 700; margin-top: 3px; white-space: normal; }
.bubble .foot .reaction { margin-right: auto; display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 7px; font-size: 14px; line-height: 18px; color: var(--ink); box-shadow: 0 1px 2px rgba(92, 26, 50, .08);
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--f-body); }
.bubble .foot .reaction + .reaction { margin-left: -2px; }
.bubble .foot:has(.reaction) { margin-top: 6px; }

.m-sticker { display: block; width: 168px; height: 168px; object-fit: contain; }
.m-round { display: block; width: 220px; height: 220px; border-radius: 50%; overflow: hidden; border: 0; padding: 0; position: relative; cursor: pointer;
  background: var(--muted-soft); box-shadow: 0 1px 3px rgba(92, 26, 50, .18); }
.m-round video { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-round-ic { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); background: rgba(44, 24, 32, .55); color: #fff;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; }
.m-round-ic svg { width: 15px; height: 15px; }
.m-photo { display: block; border: 0; padding: 0; background: none; cursor: zoom-in; margin: -5px -9px 6px; border-radius: 12px; overflow: hidden; }
.m-photo img { display: block; max-width: min(360px, 100%); max-height: 360px; width: auto; height: auto; }
.m-video { display: block; max-width: min(360px, 100%); max-height: 360px; border-radius: 12px; margin: -5px -9px 6px; background: #000; }
.m-file { display: flex; gap: 10px; align-items: center; text-decoration: none; color: inherit; padding: 2px 0 4px; }
.m-file .ic { width: 40px; height: 40px; border-radius: 50%; background: var(--cherry); color: var(--on-cherry); display: grid; place-items: center; flex: none; }
.m-file .ic svg { width: 19px; height: 19px; }
.m-file b { display: block; font-size: 13.5px; overflow-wrap: anywhere; }
.m-file small { color: var(--ink-3); font-size: 12px; }

.voice { display: flex; gap: 10px; align-items: center; padding: 2px 0; }
.vplay { width: 42px; height: 42px; flex: none; border: 0; border-radius: 50%; background: var(--cherry); color: var(--on-cherry);
  display: grid; place-items: center; cursor: pointer; }
.vplay svg { width: 18px; height: 18px; fill: currentColor; }
.bubble.out .vplay { background: var(--cherry); }
.vmain { flex: 1; min-width: 0; display: grid; gap: 3px; }
.vbars { height: 26px; display: flex; align-items: center; gap: 2px; cursor: pointer; }
.vbars i { flex: 1; min-width: 2px; max-width: 4px; border-radius: 2px; background: color-mix(in srgb, var(--cherry) 30%, transparent); transition: background .1s; }
.vbars i.p { background: var(--cherry); }
.vmeta { display: flex; gap: 8px; align-items: center; font-size: 11.5px; color: var(--ink-3); }
.vrate { border: 0; background: color-mix(in srgb, var(--cherry) 14%, transparent); color: var(--cherry-ink); font-size: 10.5px; font-weight: 800;
  border-radius: 999px; padding: 0 6px; line-height: 17px; cursor: pointer; }

.lightbox { position: fixed; inset: 0; background: rgba(20, 8, 14, .88); z-index: 70; display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }
.lightbox .btn { position: absolute; top: max(14px, env(safe-area-inset-top, 0px)); right: 14px; }

/* ================= поле ввода: эмодзи, голос ================= */
.cbox { flex: 1; display: grid; gap: 4px; min-width: 0; }
.chint { color: var(--ink-3); font-weight: 600; padding-left: 6px; font-size: 11.5px; display: inline-flex; gap: 5px; align-items: center; }
.chint.warn { color: var(--warn); }
.cfield { position: relative; display: flex; }
.cfield textarea { padding-right: 44px; min-width: 0; width: 100%; }
.emoji-btn { position: absolute; right: 4px; bottom: 3px; width: 36px; height: 36px; border: 0; background: transparent; color: var(--ink-3);
  border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.emoji-btn:hover, .emoji-btn.on { color: var(--cherry-ink); background: var(--pink-wash); }
.emoji-btn svg { width: 22px; height: 22px; }
.send.mic { background: var(--surface); color: var(--cherry-ink); box-shadow: inset 0 0 0 1.5px var(--pink); }
.send.mic svg { margin: 0; width: 21px; height: 21px; }
.send.mic:hover { background: var(--pink-wash); }

.composer.recording { align-items: center; }
.rec-strip { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: var(--paper); border-radius: 18px; padding: 0 14px; height: 42px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); flex: none; animation: rec-pulse 1.1s ease-in-out infinite; }
@keyframes rec-pulse { 50% { opacity: .25; transform: scale(.8); } }
.rec-time { font-weight: 800; font-size: 14px; min-width: 38px; }
.rec-wave { flex: 1; min-width: 0; height: 26px; display: flex; align-items: center; gap: 2px; justify-content: flex-end; overflow: hidden; }
.rec-wave i { width: 3px; flex: none; border-radius: 2px; background: var(--cherry); transition: height .09s linear; }
.rec-hint { font-size: 12px; color: var(--ink-3); white-space: nowrap; }

.emoji-pop { position: absolute; bottom: calc(100% + 8px); right: 14px; width: min(352px, calc(100% - 28px)); z-index: 6;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); display: grid; grid-template-rows: auto 1fr auto; height: 330px; overflow: hidden; }
.emoji-title { font-size: 12px; font-weight: 800; color: var(--ink-3); padding: 10px 14px 4px; }
.emoji-grid { overflow-y: auto; padding: 2px 8px 8px; display: grid; grid-template-columns: repeat(8, 1fr); align-content: start; overscroll-behavior: contain; }
.emoji-grid button { border: 0; background: transparent; font-size: 26px; line-height: 1; aspect-ratio: 1; border-radius: 10px; cursor: pointer; padding: 0;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.emoji-grid button:hover { background: var(--pink-wash); }
.emoji-tabs { display: flex; gap: 2px; justify-content: space-between; padding: 5px 8px; border-top: 1px solid var(--line-2); background: var(--surface-2); }
.emoji-tabs button { flex: 1; border: 0; background: transparent; border-radius: 9px; height: 34px; font-size: 18px; cursor: pointer; display: grid; place-items: center;
  filter: grayscale(.7); opacity: .7; color: var(--ink-2); }
.emoji-tabs button svg { width: 18px; height: 18px; }
.emoji-tabs button.on { background: var(--pink-wash); filter: none; opacity: 1; }

.window-closed { display: flex; gap: 12px; align-items: center; padding: 12px 16px max(12px, env(safe-area-inset-bottom, 0px)); background: var(--warn-soft);
  border-top: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.window-closed > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.window-closed b { color: var(--warn); font-size: 13.5px; }
.window-closed span { font-size: 12.5px; color: var(--ink-2); }

/* ================= подключение WhatsApp ================= */
.kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kind { border: 1.5px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px 10px; display: grid; gap: 3px; justify-items: start;
  text-align: left; cursor: pointer; --wa-hole: color-mix(in srgb, var(--tint) 14%, var(--surface)); }
.kind .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--tint);
  background: color-mix(in srgb, var(--tint) 14%, var(--surface)); margin-bottom: 4px; }
.kind .ic svg { width: 18px; height: 18px; }
.kind b { font-size: 13px; line-height: 1.2; }
.kind small { color: var(--ink-3); font-size: 11.5px; }
.kind.on { border-color: var(--cherry); box-shadow: 0 0 0 3px var(--cherry-soft); }
.qr-wrap { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 18px; align-items: center; }
.qr-box { width: 232px; height: 232px; border-radius: 18px; background: #fff; display: grid; place-items: center; padding: 12px;
  box-shadow: inset 0 0 0 1.5px var(--line); }
.qr-box img { width: 100%; height: 100%; image-rendering: pixelated; }
.qr-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 13.5px; }
.qr-wrap > .sub { grid-column: 1 / -1; }
.qr-done { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 10px 0; }
.qr-done .ok { width: 56px; height: 56px; border-radius: 50%; background: var(--good-soft); color: var(--good); display: grid; place-items: center; }
.qr-done .ok svg { width: 28px; height: 28px; }
.qr-done h3 { font: 400 26px/1.1 var(--f-display); color: var(--cherry-ink); margin: 0; }
.copyrow { display: flex; gap: 6px; align-items: center; background: var(--paper); border-radius: 10px; padding: 4px 4px 4px 12px; }
.copyrow code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 12.5px; }

.tpl-pick { display: grid; gap: 12px; }
.tpl-list { display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.tpl { border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 9px 12px; text-align: left; cursor: pointer; display: grid; gap: 2px; }
.tpl b { font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tpl small { color: var(--ink-3); font-size: 11.5px; }
.tpl span { font-size: 12.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tpl.on { border-color: var(--cherry); background: var(--pink-wash); }
.preview-bubble.wa { background: #DCF7C5; color: #1F2A1A; }
:root[data-theme="dark"] .preview-bubble.wa { background: #24452F; color: #E5F5DD; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .preview-bubble.wa { background: #24452F; color: #E5F5DD; } }

/* ================= шапка чата и карточка ================= */
.chat-head .head-status { width: 152px; flex: none; height: 36px; min-height: 36px; padding: 0 30px 0 14px; border-radius: 999px; line-height: 34px;
  font-size: 14px; appearance: none; -webkit-appearance: none; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a5a66' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
.chat-head .head-status:focus { box-shadow: 0 0 0 3px var(--pink-wash); }
.info-close, .info-scrim { display: none; }
.me-overlay { background: transparent; place-items: end start; padding: 0 0 70px 92px; }
.me-menu { width: 280px; }
@media (max-width: 1180px) {
  .chats.with-info .info-col { display: grid; position: fixed; z-index: 45; top: 0; right: 0; bottom: 0; width: min(360px, 100%);
    box-shadow: var(--shadow); padding-top: max(18px, env(safe-area-inset-top, 0px)); padding-bottom: max(18px, env(safe-area-inset-bottom, 0px));
    animation: sheet-in .2s ease-out; }
  .chats.with-info .info-scrim { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(44, 24, 32, .32); }
  .info-close { display: inline-flex; }
}
@keyframes sheet-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ================= телефон, особенно iPhone ================= */
@media (max-width: 860px) {
  .mob-only, .kv .mob-row { display: grid !important; }
  .desk-only { display: none !important; }
  .shell.chat-open { grid-template-rows: minmax(0, 1fr); }
  .shell.chat-open .rail { display: none; }
  .chat-head { flex-wrap: nowrap; gap: 8px; padding: max(8px, env(safe-area-inset-top, 0px)) 10px 8px 6px; min-height: 60px; }
  .chat-head .ava { width: 40px; height: 40px; font-size: 14px; }
  .head-acc { display: none; }
  .chat-head .head-status { display: none; }
  .list-head .top .btn.primary { padding: 8px 12px; }
  .shell.chat-open .alertbar { display: none; }
  .alertbar { padding: max(8px, env(safe-area-inset-top, 0px)) 12px 8px; font-size: 12.5px; gap: 8px; flex-wrap: nowrap; }
  .alertbar .txt { flex-basis: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .alertbar .more { display: none; }
  .alertbar .btn { min-height: 32px; padding: 5px 10px; }
  .alertbar .btn.ghost { display: none; }
  .main:has(> .alertbar) .list-head, .main:has(> .alertbar) .page { padding-top: 14px; }
  .list-head { padding: max(14px, env(safe-area-inset-top, 0px)) 14px 10px; }
  .page { padding-top: max(16px, env(safe-area-inset-top, 0px)); }
  .msgs { padding: 14px 10px 12px; }
  .bubble { max-width: 86%; }
  .m-photo img, .m-video { max-width: 100%; }
  .m-round { width: 200px; height: 200px; }
  .composer { padding: 8px 8px max(8px, env(safe-area-inset-bottom, 0px)); gap: 6px; }
  .composer > .btn.icon { width: 40px; height: 42px; }
  .emoji-pop { left: 8px; right: 8px; width: auto; height: min(300px, 46vh); }
  .emoji-grid { grid-template-columns: repeat(7, 1fr); }
  .pop { left: 8px; width: calc(100% - 16px); }
  .rec-hint { display: none; }
  /* iOS увеличивает страницу, если шрифт поля меньше 16px */
  input.input, select.input, textarea.input, .composer textarea, .search .input, .filters .input { font-size: 16px; }
  .btn.icon { width: 40px; height: 40px; }
  .btn.sm { min-height: 36px; }
  .seg button { padding: 8px 12px; }
  .chseg button { padding: 8px 4px; }
  .ditem { padding: 12px 14px; }
  .overlay { place-items: end center; padding: 0; }
  .modal { width: 100%; max-height: calc(var(--app-h, 100dvh) - 24px); border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px);
    animation: up-in .22s ease-out; }
  .modal.wide { width: 100%; }
  .modal-head { position: sticky; top: 0; background: var(--surface); z-index: 1; }
  .modal-foot { position: sticky; bottom: 0; background: var(--surface); padding-top: 10px; }
  .me-overlay { background: rgba(44, 24, 32, .38); padding: 0; place-items: end center; }
  .me-menu { width: 100%; }
  .kinds { grid-template-columns: 1fr; }
  .kind { grid-template-columns: 32px 1fr; column-gap: 10px; align-items: center; }
  .kind .ic { grid-row: span 2; margin: 0; }
  .qr-wrap { grid-template-columns: 1fr; justify-items: center; }
  .window-closed { flex-wrap: wrap; }
  .window-closed .btn { width: 100%; }
  .toasts { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); right: 16px; left: 16px; width: auto; }
  .shell.chat-open ~ .toasts { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}
@keyframes up-in { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (hover: none) {
  .ditem:hover { background: transparent; }
  .ditem.on:hover { background: var(--pink-wash); }
  .btn:not(.primary):not(.cherry):not(.ghost):hover { border-color: var(--line); }
}

/* ================= период аналитики (календарь) ================= */
.period-note { margin: -6px 0 14px; font-size: 12.5px; color: var(--ink-3); }
.period-note b { color: var(--ink-2); }
.dr { position: relative; }
.dr-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 12px 6px 11px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13px; max-width: 100%; }
.dr-btn:hover, .dr-btn.on { border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-wash); }
.dr-btn > svg { width: 17px; height: 17px; color: var(--cherry-ink); flex: none; }
.dr-btn .dr-chev { width: 15px; height: 15px; color: var(--ink-3); transition: transform .15s; }
.dr-btn.on .dr-chev { transform: rotate(180deg); }
.dr-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-label b { font-weight: 800; }
.dr-sub { color: var(--ink-2); }
.dr-scrim { display: none; }
.dr-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; display: grid; grid-template-columns: 172px auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; animation: dr-in .16s ease-out; }
@keyframes dr-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dr-presets { display: grid; align-content: start; gap: 2px; padding: 12px 8px; background: var(--surface-2); border-right: 1px solid var(--line-2); }
.dr-presets button { border: 0; background: transparent; text-align: left; padding: 8px 12px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.dr-presets button:hover { background: var(--pink-wash); color: var(--ink); }
.dr-presets button.on { background: var(--cherry); color: var(--on-cherry); }
.dr-cal { padding: 12px 16px 14px; display: grid; gap: 8px; }
.dr-nav { display: flex; align-items: center; gap: 6px; }
.dr-titles { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; text-align: center; }
.dr-titles b { font: 400 18px/1.2 var(--f-display); color: var(--cherry-ink); }
.dr-months { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.dr-wd, .dr-grid { display: grid; grid-template-columns: repeat(7, 38px); }
.dr-wd span { text-align: center; font-size: 11px; font-weight: 800; color: var(--ink-3); padding: 4px 0 6px; }
.dr-day { height: 36px; border: 0; padding: 0; background: transparent; cursor: pointer; position: relative; font-size: 13px; font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums; margin: 1px 0; }
.dr-day span { position: relative; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto; border-radius: 50%; }
.dr-day:hover span { background: var(--pink-wash); }
.dr-day.in { background: var(--cherry-soft); }
.dr-day.start { border-radius: 18px 0 0 18px; }
.dr-day.end { border-radius: 0 18px 18px 0; }
.dr-day.start.end { border-radius: 18px; }
.dr-day.start span, .dr-day.end span { background: var(--cherry); color: var(--on-cherry); }
.dr-day.today span { box-shadow: inset 0 0 0 1.5px var(--pink); }
.dr-day.off { color: var(--ink-3); opacity: .45; cursor: default; }
.dr-day.off:hover span { background: transparent; }
.dr-grid > span:empty { height: 36px; }
.dr-foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.dr-sum { flex: 1; font-size: 12.5px; color: var(--ink-2); }
.dr-sum b { color: var(--ink); }
@media (max-width: 860px) {
  .an-head { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .an-head .title, .an-head .dr { grid-column: 1 / -1; }
  .an-head .grow { display: none; }
  .an-head .ms-btn { width: 100%; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile { padding: 12px 12px 11px; border-radius: 14px; }
  .tile .v { font-size: 28px; }
  .tile .k { font-size: 12px; }
  .tile .d { font-size: 11.5px; }
  .dr-btn { width: 100%; min-height: 44px; font-size: 15px; }
  .dr-btn .dr-chev { margin-left: auto; }
  .dr-scrim { display: block; position: fixed; inset: 0; background: rgba(44, 24, 32, .38); z-index: 49; }
  .dr-pop { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 50; grid-template-columns: 1fr; border-radius: 22px 22px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px); max-height: calc(var(--app-h, 100dvh) - 40px); overflow: auto; animation: up-in .22s ease-out; }
  .dr-presets { display: flex; overflow-x: auto; gap: 6px; padding: 14px 14px 10px; border-right: 0; border-bottom: 1px solid var(--line-2); scrollbar-width: none; }
  .dr-presets::-webkit-scrollbar { display: none; }
  .dr-presets button { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); padding: 8px 12px; flex: none; }
  .dr-second { display: none; }
  .dr-titles, .dr-months { grid-template-columns: 1fr; }
  .dr-wd, .dr-grid { grid-template-columns: repeat(7, 1fr); }
  .dr-day { height: 44px; font-size: 15px; }
  .dr-day span { width: 40px; height: 40px; }
  .dr-foot { flex-wrap: wrap; }
  .dr-sum { flex-basis: 100%; }
  .dr-foot .btn { flex: 1; min-height: 44px; }
}
.dr-grid > .dr-day.in:nth-child(7n + 1) { border-top-left-radius: 18px; border-bottom-left-radius: 18px; }
.dr-grid > .dr-day.in:nth-child(7n) { border-top-right-radius: 18px; border-bottom-right-radius: 18px; }

/* ================= мультивыбор с поиском ================= */
.ms { position: relative; min-width: 0; }
.page-head .ms { width: 230px; }
.ms-btn { display: flex; align-items: center; gap: 7px; text-align: left; cursor: pointer; min-height: 38px; width: 100%; }
.filters .ms-btn { min-height: 34px; padding: 6px 10px; font-size: 13px; border-radius: 9px; }
.ms-btn.has { border-color: color-mix(in srgb, var(--cherry) 45%, var(--line)); background: var(--pink-wash); }
.ms.open .ms-btn { border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-wash); }
.ms-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-btn.has .ms-label { font-weight: 700; color: var(--cherry-ink); }
.ms-dots { display: inline-flex; flex: none; }
.ms-dots i { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 2px var(--pink-wash); margin-right: -3px; }
.ms-dots i:last-child { margin-right: 0; }
.ms-chev { width: 15px; height: 15px; color: var(--ink-3); flex: none; }
.ms-clear { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--cherry-ink); }
.ms-clear:hover { background: var(--cherry-soft); }
.ms-clear svg { width: 13px; height: 13px; }
.ms-scrim { display: none; }
.ms-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 320px; max-width: calc(100vw - 32px); background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; display: grid; animation: dr-in .14s ease-out; }
.page-head .ms-pop, .filters .ms + .ms .ms-pop { left: auto; right: 0; }
.ms-foot .btn { white-space: nowrap; }
.ms-search { position: relative; padding: 10px 10px 6px; }
.ms-search svg { position: absolute; left: 21px; top: 50%; transform: translateY(-35%); width: 15px; height: 15px; color: var(--ink-3); }
.ms-search .input { padding-left: 32px; min-height: 36px; border-radius: 10px; background: var(--paper); border-color: transparent; }
.ms-list { max-height: 300px; overflow-y: auto; padding: 2px 6px 6px; overscroll-behavior: contain; }
.ms-group { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 3px; font-size: 11px; font-weight: 800;
  text-transform: lowercase; letter-spacing: .06em; color: var(--ink-3); }
.ms-group button { border: 0; background: none; color: var(--cherry-ink); font-size: 11.5px; font-weight: 700; text-transform: none; letter-spacing: 0; cursor: pointer; }
.ms-opt { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: transparent; text-align: left; padding: 7px 8px;
  border-radius: 10px; cursor: pointer; }
.ms-opt:hover { background: var(--surface-2); }
.ms-opt.on { background: var(--pink-wash); }
.ms-check { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line); display: grid; place-items: center; flex: none;
  background: var(--surface); transition: background .12s, border-color .12s; }
.ms-opt.on .ms-check { background: var(--cherry); border-color: var(--cherry); color: var(--on-cherry); }
.ms-check svg { width: 13px; height: 13px; stroke-width: 2.6; }
.ms-text { min-width: 0; display: grid; }
.ms-text b { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-text small { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-empty { padding: 16px; text-align: center; color: var(--ink-3); font-size: 13px; }
.ms-foot { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line-2); background: var(--surface-2); }
@media (max-width: 860px) {
  .an-head .ms { width: 100%; }
  .an-head .ms-btn { min-height: 44px; }
  .ms-scrim { display: block; position: fixed; inset: 0; background: rgba(44, 24, 32, .38); z-index: 49; }
  .ms-pop, .page-head .ms-pop, .filters .ms + .ms .ms-pop { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none; z-index: 50; border-radius: 22px 22px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px); max-height: calc(var(--app-h, 100dvh) - 60px); grid-template-rows: auto minmax(0, 1fr) auto;
    animation: up-in .22s ease-out; }
  .ms-list { max-height: none; }
  .ms-opt { padding: 11px 10px; }
  .ms-text b { font-size: 15px; }
  .ms-foot .btn { min-height: 40px; }
  .ms-search { padding: 14px 12px 8px; }
}

/* ================= тёплые пустые экраны ================= */
.empty.warm { gap: 8px; }
.empty .em-art { width: 150px; height: 150px; object-fit: contain; animation: em-float 4.5s ease-in-out infinite; filter: drop-shadow(0 8px 14px rgba(140, 29, 64, .12)); }
.empty.warm h3 { margin-top: 6px; }
.empty.compact { padding: 24px 16px; height: auto; }
.empty.compact .em-art { width: 92px; height: 92px; }
.chat > .empty .em-art { width: 190px; height: 190px; }
@keyframes em-float { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-7px) rotate(1.5deg); } }

/* ================= реакции ================= */
.bubble { --react-side: auto; }
.react-btn { position: absolute; top: 50%; right: -40px; transform: translateY(-50%) scale(.8); opacity: 0; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); display: grid; place-items: center; cursor: pointer;
  transition: opacity .15s, transform .15s; box-shadow: 0 1px 3px rgba(92, 26, 50, .1); }
.react-btn svg { width: 17px; height: 17px; }
.bubble.in:hover .react-btn, .react-btn:focus-visible { opacity: 1; transform: translateY(-50%) scale(1); }
.react-btn:hover { color: var(--cherry-ink); border-color: var(--pink); }
@media (hover: none) { .react-btn { display: none; } .bubble.in { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; } }
.react-bar { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 8; display: flex; gap: 2px; padding: 5px 6px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); animation: rb-in .18s cubic-bezier(.3, 1.4, .5, 1); white-space: nowrap; }
.react-bar button { width: 36px; height: 36px; border: 0; background: transparent; border-radius: 50%; font-size: 22px; cursor: pointer; line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; animation: rb-pop .28s cubic-bezier(.3, 1.6, .5, 1) both;
  animation-delay: calc(var(--i) * 22ms); transition: transform .12s; }
.react-bar button:hover { transform: scale(1.25) translateY(-2px); background: var(--pink-wash); }
.react-bar button.on { background: var(--cherry-soft); box-shadow: inset 0 0 0 1.5px var(--cherry); }
@keyframes rb-in { from { opacity: 0; transform: translateY(6px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes rb-pop { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: none; } }
.bubble .foot .reaction.mine { border: 1.5px solid var(--cherry); background: var(--cherry-soft); cursor: pointer; animation: react-pop .4s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes react-pop { 0% { transform: scale(0); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }
@media (max-width: 860px) {
  .react-bar { left: 50%; transform: translateX(-50%); animation: none; }
  .react-bar button { width: 40px; height: 40px; font-size: 24px; }
}

/* ================= стикеры BU в панели ================= */
.sticker-grid { overflow-y: auto; padding: 4px 10px 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; align-content: start; overscroll-behavior: contain; }
.sticker-grid button { border: 0; background: transparent; padding: 4px; border-radius: 14px; cursor: pointer; aspect-ratio: 1; transition: transform .15s, background .15s; }
.sticker-grid button:hover { background: var(--pink-wash); transform: scale(1.06) rotate(-2deg); }
.sticker-grid img { width: 100%; height: 100%; object-fit: contain; display: block; }
.emoji-tabs .stk-tab img { width: 24px; height: 24px; border-radius: 50%; }
.emoji-tabs .stk-tab { filter: none; opacity: .85; }
@media (max-width: 860px) { .sticker-grid { grid-template-columns: repeat(3, 1fr); } }


/* ================= телефон: результаты прогона синтетических пользователей ================= */
@media (max-width: 860px) {
  /* зоны касания не меньше 40–44px (рекомендация Apple — 44) */
  .filters .ms-btn, .an-head .ms-btn { min-height: 44px; }
  .seg button { min-height: 40px; }
  .chseg button { min-height: 40px; }
  .emoji-tabs button { height: 40px; }
  .ms-group button { padding: 8px 4px; margin: -8px 0; font-size: 12.5px; }
  .ms-group { padding-top: 10px; }
  /* «команда» на телефоне — карточками, а не широкой таблицей, которая уезжает за край */
  .users-t thead { display: none; }
  .users-t, .users-t tbody { display: block; }
  .users-t tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); align-items: center; }
  .users-t td { display: block; padding: 0 !important; border: 0 !important; min-width: 0; }
  .users-t td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .users-t td:nth-child(6) { grid-column: 2; grid-row: 1; }
  .users-t td:nth-child(2), .users-t td:nth-child(3), .users-t td:nth-child(4) { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); padding-left: 42px !important; }
  .users-t td:nth-child(2)::before { content: 'логин: '; color: var(--ink-3); }
  .users-t td:nth-child(5) { grid-column: 1 / -1; padding-left: 42px !important; }
  .users-t td:nth-child(4):has(.sub) { display: none; }
}
@media (max-width: 380px) {
  .react-bar { gap: 0; padding: 4px; }
  .react-bar button { width: 35px; height: 40px; font-size: 21px; }
  .wordmark .t { letter-spacing: .2em; font-size: 10.5px; }
  .chat-head .who b { font-size: 15px; }
}
@media (pointer: coarse) {
  /* своя реакция под сообщением маленькая — расширяем невидимую зону касания */
  .bubble .foot .reaction { position: relative; }
  .bubble .foot .reaction::after { content: ''; position: absolute; inset: -10px -8px; }
}

/* ================= удаление сотрудника ================= */
.danger-zone { border-top: 1px dashed var(--line); padding-top: 12px; display: grid; gap: 6px; justify-items: start; }
.danger-zone small { color: var(--ink-3); font-size: 12px; }
.danger-zone.on { border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); background: color-mix(in srgb, var(--bad) 7%, var(--surface));
  border-radius: 14px; padding: 12px 14px; justify-items: stretch; }
.danger-zone p { margin: 4px 0 10px; color: var(--ink-2); font-size: 13px; }
.btn.danger-solid { background: var(--bad); color: #fff; border-color: transparent; }
.btn.danger-solid:hover { filter: brightness(.95); }

/* ================= личный Telegram ================= */
.kinds.four { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .kinds.four { grid-template-columns: 1fr; } }
.linkish { border: 0; background: none; padding: 4px 0; color: var(--cherry-ink); font-weight: 700; font-size: 13px; cursor: pointer; justify-self: start; text-align: left; }
.linkish:hover { text-decoration: underline; }
.mini-tag { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: lowercase; color: var(--cherry-ink);
  background: var(--pink-wash); border-radius: 6px; padding: 1px 6px; vertical-align: 1px; }

/* ================= «не требует ответа» ================= */
.noreply { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 14px; background: var(--surface-2);
  border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.noreply span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.noreply svg { width: 15px; height: 15px; }
.noreply .btn { flex: none; }
.noreply.done { color: var(--good); }
@media (max-width: 860px) { .noreply { padding: 6px 10px; } .noreply .btn { min-height: 36px; } }

/* ================= задачи amoCRM ================= */
.amo-tasks { display: grid; gap: 8px; border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 2px; }
.at-title { font-size: 13px; }
.at-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px;
  background: var(--surface-2); font-size: 13px; }
.at-item small { display: block; color: var(--ink-3); font-size: 11.5px; margin-top: 2px; }
.at-item.late small { color: var(--bad); font-weight: 700; }
.at-form { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; }
.at-form .input { min-height: 36px; padding: 6px 10px; }
.at-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.at-chips button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.at-chips button.on { background: var(--cherry); color: var(--on-cherry); border-color: transparent; }
@media (max-width: 860px) { .at-chips button { min-height: 36px; } .at-form .input { min-height: 44px; } }

/* ================= телефон: правки по свежему ревью ================= */
.search-row { display: flex; gap: 8px; align-items: center; }
.search-row .search { flex: 1; min-width: 0; }
.f-toggle { display: none; position: relative; }
.f-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--cherry); color: var(--on-cherry);
  font-size: 11px; font-weight: 800; display: grid; place-items: center; padding: 0 4px; }
.alertbar .txt-short { display: none; }
.accs > .acc { min-width: 0; }
.acc-head { flex-wrap: wrap; }
.acc-head .who { min-width: 0; }
@media (max-width: 860px) {
  /* фильтры (аккаунты, менеджеры, мессенджер) — под кнопкой рядом с поиском, чтобы чаты было видно сразу */
  .f-toggle { display: inline-grid; width: 44px; height: 44px; flex: none; border: 1px solid var(--line); background: var(--surface); }
  .f-toggle.on { border-color: var(--pink); background: var(--pink-wash); color: var(--cherry-ink); }
  .list-head .filters:not(.open), .list-head .chseg:not(.open) { display: none; }
  .list-head { gap: 9px; }
  .list-head .title { font-size: 30px; }
  /* баннер: коротко и по нажатию ведёт к аккаунтам */
  .alertbar .txt-full { display: none; }
  .alertbar .txt-short { display: inline; font-weight: 700; }
  .alertbar { cursor: pointer; }
  /* клавиатура открыта — прячем нижнее меню и баннер */
  .typing .shell > .rail, .typing .alertbar { display: none !important; }
  .typing .shell { grid-template-rows: minmax(0, 1fr); }
  /* подвал окон: сплошной фон и разделитель, кнопки в строку */
  .modal-foot { border-top: 1px solid var(--line-2); box-shadow: 0 -8px 16px -12px rgba(44, 24, 32, .25); padding-bottom: max(14px, env(safe-area-inset-bottom, 0px)); flex-wrap: nowrap; }
  .modal-body .modal-foot { margin: 0 -20px; padding-left: 20px !important; padding-right: 20px !important; padding-top: 10px !important; }
  /* поле ввода сообщения — не выше ~4 строк, дальше прокрутка внутри */
  .composer textarea { max-height: 124px; }
  /* быстрые периоды календаря — переносом, без скрытой прокрутки */
  .dr-presets { flex-wrap: wrap; overflow: visible; }
  /* вкладки списка: мягкое затухание по краям — видно, что лента прокручивается */
  .list-head .seg { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 22px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 22px), transparent 100%); padding-left: 6px; scroll-padding: 0 24px; }
  .chart-wrap svg text { font-size: 17px; }
}
@media (max-width: 480px) { .chats.with-info .info-col { width: 100%; } }
/* тёмная тема: рамка невыбранного чекбокса заметнее */
:root[data-theme="dark"] .ms-check { border-color: #8E7480; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ms-check { border-color: #8E7480; } }
@media (max-width: 860px) {
  .alertbar .btn { display: none !important; }
  .alertbar .txt-short::after { content: ' →'; }
}
/* форма задачи amo: поля не шире карточки, даже если в списке длинные имена */
.at-form { min-width: 0; }
.at-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 8px; }
.at-form > *, .at-row > * { min-width: 0; max-width: 100%; }
.at-form select.input { width: 100%; text-overflow: ellipsis; }
.amo-tasks, .info-col > div { min-width: 0; }

/* ================= расшифровка голосовых ================= */
.tr { margin: 6px 0 2px; padding: 7px 10px; border-radius: 10px; background: color-mix(in srgb, var(--ink) 5%, transparent);
  font-size: 13.5px; line-height: 1.45; max-width: 360px; }
.tr-k { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: lowercase; color: var(--ink-3); margin-bottom: 2px; }
.tr-head { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; border: 0; background: none; padding: 0; margin: 0 0 2px; cursor: pointer; color: inherit; font: inherit; }
.tr-head .tr-k { margin: 0; }
.tr-fold { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.tr-fold svg { width: 14px; height: 14px; transform: rotate(180deg); }
.tr-head:hover .tr-fold { color: var(--cherry-ink); }
.tr.folded { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; cursor: pointer; text-align: left; color: var(--ink-2); font: inherit; font-size: 13px; }
.tr.folded .tr-k { margin: 0; flex: none; }
.tr-peek { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr.folded svg { width: 15px; height: 15px; flex: none; color: var(--ink-3); }
.tr.folded:hover { color: var(--ink); }
@media (pointer: coarse) { .tr-head { min-height: 30px; } .tr.folded { min-height: 38px; } }
.tr-t { white-space: pre-wrap; overflow-wrap: anywhere; }
.tr-t.cut { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.tr-more { border: 0; background: none; padding: 4px 0 0; color: var(--cherry-ink); font-weight: 700; font-size: 12.5px; cursor: pointer; }
.tr.pending, .tr.muted { color: var(--ink-3); font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.tr-dots { display: inline-flex; gap: 3px; }
.tr-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); animation: tr-b 1s infinite ease-in-out; }
.tr-dots i:nth-child(2) { animation-delay: .15s; } .tr-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes tr-b { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .tr-dots i { animation: none; opacity: .6; } }
.tr-btn { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 2px; border: 1px solid var(--line); background: var(--surface);
  color: var(--cherry-ink); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.tr-btn svg { width: 14px; height: 14px; }
.tr-btn:hover { background: var(--pink-wash); }
@media (pointer: coarse) { .tr-btn { min-height: 36px; } }

/* ================= блогги — ии-помощник ================= */
.composer > .bg-open { color: var(--cherry-ink); }
.composer > .bg-open.on, .composer > .bg-open:hover { background: var(--pink-wash); }
.blogi {
  position: absolute; bottom: calc(100% + 8px); left: 14px; width: min(560px, calc(100% - 28px)); z-index: 6;
  max-height: min(620px, calc(var(--app-h, 100dvh) * .66)); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden;
  animation: dr-in .16s ease-out;
}
.bg-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 8px 12px; border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--pink-wash), var(--surface)); }
.bg-head > b { font: 400 21px/1 var(--f-display); color: var(--cherry-ink); }
.bg-ava { width: 34px; height: 34px; flex: none; margin: -4px 0; }
.bg-seg { flex: 1; min-width: 0; justify-content: flex-end; padding-bottom: 0; }
.bg-seg button { padding: 6px 10px; font-size: 12px; }
.bg-body { overflow-y: auto; padding: 12px; display: grid; gap: 10px; align-content: start; overscroll-behavior: contain; }
.bg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bg-chips button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 11px; font-size: 12.5px;
  font-weight: 700; cursor: pointer; color: var(--ink-2); }
.bg-chips button:hover:not(:disabled) { border-color: var(--pink); color: var(--ink); }
.bg-chips button.on { background: var(--cherry-soft); border-color: var(--pink); color: var(--cherry-ink); }
.bg-chips button:disabled { opacity: .5; cursor: default; }
.bg-form { display: flex; gap: 6px; align-items: center; }
.bg-form.col { display: grid; }
.bg-form .input { min-height: 38px; min-width: 0; }
.bg-form .btn.primary.sm { flex: none; min-width: 40px; justify-content: center; }
.bg-think { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13px; padding: 8px 4px; }
.bg-mascot { flex: none; }
.bg-mascot.bob { animation: bg-bob 1.1s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes bg-bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-4px) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .bg-mascot.bob { animation: none; } }
.bg-hello { display: flex; gap: 10px; align-items: center; }
.bg-hello .bg-hint { margin: 0; background: var(--pink-wash); border-radius: 14px 14px 14px 4px; padding: 9px 12px; color: var(--ink-2); }
.composer > .bg-open img { width: 28px; height: 28px; }
.ai-title { gap: 8px; }
.ai-title img { margin: -8px 0 -6px -4px; }
.ai-title .sect-title { margin: 0; }
.bg-err { background: var(--bad-soft); color: var(--bad); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.bg-hint { color: var(--ink-3); font-size: 12.5px; margin: 2px 2px 4px; line-height: 1.45; }
.bg-res { display: grid; gap: 10px; }
.bg-sit { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.bg-stage { display: inline-block; background: var(--sky); color: var(--navy); border-radius: 6px; padding: 1px 7px; margin-right: 6px; font-size: 11px; font-weight: 800; }
.bg-var { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: grid; gap: 6px; background: var(--surface-2); }
.bg-label { font-size: 11px; font-weight: 800; color: var(--cherry-ink); letter-spacing: .02em; }
.bg-text { white-space: pre-wrap; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.bg-answer { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.bg-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.bg-tip { font-size: 12.5px; background: var(--warn-soft); color: var(--ink); border-radius: 12px; padding: 8px 11px; line-height: 1.45; }
.bg-tip b { color: var(--warn); }
.bg-src { font-size: 12px; color: var(--ink-3); }
.bg-src summary { cursor: pointer; }
.bg-src ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 2px; }
.bg-foot { font-size: 11px; color: var(--ink-3); padding: 7px 12px 9px; border-top: 1px solid var(--line-2); text-align: center; }
.sum-box { display: grid; gap: 4px; }
.sum-box .sub { font-size: 12px; }
.bg-btn-sum img { width: 20px; height: 20px; margin: -3px 0; }
.sum-text { font-size: 14px; line-height: 1.5; min-height: 260px; resize: vertical; }
.sum-task { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--surface-2); }
@media (max-width: 860px) {
  .blogi { left: 6px; width: calc(100% - 12px); max-height: calc(var(--app-h, 100dvh) * .62); border-radius: 18px; }
  .bg-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px 2px; min-height: 40px; }
  .bg-chips::-webkit-scrollbar { display: none; }
  .bg-chips button { min-height: 36px; white-space: nowrap; flex: none; }
  .bg-foot { padding: 5px 10px 7px; }
  .modal:has(.sum-text) .modal-foot, .modal:has(.sum-task) .modal-foot { flex-wrap: wrap; justify-content: space-between; }
  .modal:has(.sum-text) .modal-foot > .btn.primary { flex: 1 1 100%; justify-content: center; }
  .bg-head > b { display: none; }
  .bg-seg { justify-content: flex-start; }
  .sum-text { min-height: 220px; }
}
@media (max-width: 380px) {
  .composer > .btn.icon.cbtn { width: 32px; }
}

/* ---------- настройки блогги и база знаний ---------- */
.kb-card { grid-column: 1 / -1; }
.kb-docs { display: grid; gap: 0; }
.kb-doc { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.kb-doc:last-child { border-bottom: 0; }
.kb-doc .t { font-weight: 700; font-size: 13.5px; overflow-wrap: anywhere; }
.kb-doc .m { font-size: 12px; color: var(--ink-3); }
.kb-doc.off .t { color: var(--ink-3); text-decoration: line-through; }
.kb-doc .acts { display: flex; gap: 2px; }
.kb-kind { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 6px; background: var(--muted-soft); color: var(--ink-2); margin-right: 6px; }
.kb-kind.rules { background: var(--cherry-soft); color: var(--cherry-ink); }
.kb-kind.sales, .kb-kind.site { background: var(--good-soft); color: var(--good); }
.kb-kind.method { background: var(--sky); color: var(--navy); }
.kb-facts { min-height: 170px; font-size: 13.5px; line-height: 1.5; }
.kb-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.kb-tool { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 8px; align-content: start; }
.kb-tool h3 { margin: 0; font-size: 13.5px; }
.kb-hit { font-size: 12.5px; border-top: 1px solid var(--line-2); padding-top: 6px; }
.kb-hit b { display: block; }
.kb-hit span { color: var(--ink-2); }
.kb-edit { min-height: 340px; font-size: 13.5px; line-height: 1.5; font-family: ui-monospace, Menlo, monospace; }
.ai-usage { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.ai-usage b { color: var(--ink); font-variant-numeric: tabular-nums; }

.ai-card { display: grid; gap: 14px; align-content: start; }
.ai-desc { font-size: 13px; line-height: 1.5; margin-top: -4px; }
.ai-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 10px; align-items: start; }
.ai-pair .input { height: 42px; }
.ai-pair select.input { padding-top: 0; padding-bottom: 0; text-overflow: ellipsis; }
.ai-checks { display: grid; gap: 8px; }
.ai-checks .check { font-size: 13.5px; }
.ai-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.ai-stats > div { display: grid; gap: 1px; padding: 10px 12px; min-width: 0; }
.ai-stats > div + div { border-left: 1px solid var(--line-2); }
.ai-stats span { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-stats b { font: 400 24px/1.15 var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.ai-stats small { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-limits { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 13px; color: var(--ink-2); }
.ai-limits label { display: inline-flex; align-items: center; gap: 7px; }
.ai-limits .input { width: 78px; min-height: 34px; padding: 5px 9px; text-align: center; }
.ai-reply { font-size: 13px; color: var(--ink-2); }
@media (max-width: 420px) {
  .ai-stats > div { padding: 9px 10px; }
  .ai-stats b { font-size: 21px; }
  .ai-pair { grid-template-columns: 1fr 1fr; }
  .ai-pair.ai-pair-wide { grid-template-columns: 1fr; }
  .ai-stats span, .ai-stats small { white-space: normal; }
}

.wg-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.wg-steps li::marker { color: var(--cherry-ink); font-weight: 800; }
.wg-steps .btn { vertical-align: middle; margin: -6px 0 -4px; }
.lead-dlg { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; color: inherit; text-decoration: none; }
.lead-dlg:hover { border-color: var(--pink); background: var(--pink-wash); }
.lead-dlg b { display: block; }
.lead-dlg small { display: block; color: var(--ink-3); font-size: 12px; }
.lead-dlg small.prev { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-alts { margin-top: -6px; }
.wg-links { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--surface-2); }
.wg-links small { font-size: 12px; line-height: 1.45; }

.emo { display: inline-block; height: 1.3em; width: auto; vertical-align: -0.3em; margin: 0 .05em; }
h3 .emo { height: 1.1em; vertical-align: -0.15em; }

/* ---------- аналитика: вкладки, возражения, утренняя сводка ---------- */
.an-tabs { margin: -4px 0 16px; }
.ins-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 14px; }
.ins-bar .period-note { margin: 0; }
.dl-row { display: flex; gap: 6px; }
.dl-row .btn svg { width: 15px; height: 15px; }
.ins-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: start; }
.ins-col { display: grid; gap: 18px; }
.ins-hint { font-size: 12.5px; margin: -4px 0 10px; }
.ins-foot { font-size: 12px; margin: 14px 2px 0; }
.tile.warn .v { color: var(--warn); }
.bad-t { color: var(--bad); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--muted-soft); color: var(--ink-2); }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }

.hbars { display: grid; gap: 7px; }
.hb { display: grid; grid-template-columns: minmax(110px, 40%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.hb-l { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-bar { height: 10px; background: var(--pink-wash); border-radius: 6px; overflow: hidden; }
.hb-bar i { display: block; height: 100%; background: var(--pink); border-radius: 6px; }
.hb-bar i.top { background: var(--cherry); }
.hb-v { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }
.hb-v em { font-style: normal; font-weight: 600; color: var(--ink-3); margin-left: 6px; }

.blogi-advice, .dg-focus { margin-bottom: 18px; background: linear-gradient(135deg, var(--pink-wash), var(--surface) 70%); }
.ba-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ba-head .sect-title { margin: 0 0 2px; }
.ba-head .sub { font-size: 12.5px; margin: 0; }
.ba-mascot { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: none; }
.ba-list { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 7px; font-size: 14px; line-height: 1.45; }
.ba-list li::marker { color: var(--cherry); font-weight: 800; }

.obj-list { display: grid; }
.obj { border-bottom: 1px solid var(--line-2); }
.obj:last-child { border-bottom: 0; }
.obj-row { width: 100%; display: grid; grid-template-columns: 22px minmax(120px, 42%) 1fr auto; align-items: center; gap: 10px;
  padding: 10px 2px; background: none; border: 0; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.obj-row:hover { background: var(--surface-2); }
.obj-n { width: 22px; height: 22px; border-radius: 50%; background: var(--pink-wash); color: var(--cherry-ink); font-size: 11.5px; font-weight: 800;
  display: grid; place-items: center; }
.obj-name { font-weight: 700; font-size: 13.5px; }
.obj-bar { height: 10px; background: var(--pink-wash); border-radius: 6px; overflow: hidden; }
.obj-bar i { display: block; height: 100%; background: var(--cherry); border-radius: 6px; }
.obj-c { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.obj-c em { font-style: normal; font-weight: 600; color: var(--ink-3); margin-left: 4px; font-size: 12px; }
.obj.open .obj-row { background: var(--surface-2); }
.obj-more { padding: 4px 4px 14px 34px; display: grid; gap: 8px; }
.obj-out { display: flex; gap: 6px; flex-wrap: wrap; }
.obj-more blockquote { margin: 0; padding: 8px 12px; border-left: 3px solid var(--pink); background: var(--surface-2); border-radius: 0 10px 10px 0;
  font-size: 13px; color: var(--ink-2); }

.dg-pick { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.dg-pick select { min-width: 220px; }
.dg-list { display: grid; }
.dg-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 18px; border-top: 1px solid var(--line-2);
  color: inherit; text-decoration: none; }
.dg-item:hover { background: var(--surface-2); }
.dg-name { font-weight: 800; font-size: 13.5px; }
.dg-wait { font-weight: 800; font-size: 12.5px; color: var(--bad); white-space: nowrap; }
.dg-ball { font-size: 12px; font-weight: 700; color: var(--ink-3); white-space: nowrap; }
.dg-ball.ours { color: var(--cherry-ink); }
.dg-meta { grid-column: 1 / -1; font-size: 12px; color: var(--ink-3); }
.dg-text { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-h3 { font: 700 13px/1.2 var(--f-body); color: var(--ink-2); margin: 16px 0 6px; }
.dg-bad { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 4px; }
.dg-set { display: grid; gap: 10px; margin-bottom: 18px; max-width: 560px; }
.dg-time { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.dg-time .input { width: 120px; }

.bk-card { display: grid; gap: 12px; }
.bk-sum { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.bk-how summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--cherry-ink); }
.bk-how pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; overflow-x: auto; user-select: all; }
.bk-how code { font-size: 12.5px; }

@media (max-width: 720px) {
  .hb { grid-template-columns: minmax(90px, 44%) 1fr auto; }
  .obj-row { grid-template-columns: 22px 1fr auto; }
  .obj-bar { grid-column: 2 / -1; grid-row: 2; }
  .ins-bar .grow { display: none; }
  .dg-pick { grid-column: 1 / -1; }
  .dg-pick select { flex: 1; min-width: 0; }
}
